我有一个tableview活动作为设置或首选项面板(见下文).设置的名称(例如地址)是设置所属部分的标题.我的问题是,如果我想允许用户添加她自己的设置应该如何做?我想在工具栏上添加一个"+"按钮,弹出一个模态视图控制器,询问新的设置细节.我的问题是,是否有一种方法可以直接将设置添加到设置视图,而不是弹出模态视图控制器.因此,按"+"将使用文本字段展开下面显示的视图,以输入新设置的详细信息.
alt text http://www.freeimagehosting.net/uploads/634bb426be.png
我正在使用http://www.codeproject.com/KB/IP/Facebook_API.aspx
调用线程必须是STA,因为许多UI组件都需要这个.
我不知道该怎么办.我想这样做:
FacebookApplication.FacebookFriendsList ffl = new FacebookFriendsList();
Run Code Online (Sandbox Code Playgroud)
但它给了我这个错误.
我添加了一个后台工作者:
static BackgroundWorker bw = new BackgroundWorker();
static void Main(string[] args)
{
bw.DoWork += bw_DoWork;
bw.RunWorkerAsync("Message to worker");
Console.ReadLine();
}
static void bw_DoWork(object sender, DoWorkEventArgs e)
{
// This is called on the worker thread
FacebookApplication.FacebookFriendsList ffl = new FacebookFriendsList();
Console.WriteLine(e.Argument); // Writes "Message to worker"
// Perform time-consuming task...
}
Run Code Online (Sandbox Code Playgroud) 是否可以让Inno Setup读取主可执行文件的文件版本,并将创建的设置的名称设置为"myapp_setup_1_0_3708_19805.exe"?
我正在使用XmlSerializer并在类中具有以下属性
public string Data { get; set; }
Run Code Online (Sandbox Code Playgroud)
我需要输出完全如此
<Data />
Run Code Online (Sandbox Code Playgroud)
我将如何实现这一目标?
是否有可以接收电子邮件的Java库,将其与电子邮件数据库进行比较,并查找可能来自与邮件列表类似的电子邮件"线程"的其他电子邮件?
我一直在寻找一个命令行工具,它可以将html代码转换为网站上显示的文本......所以它等同于在Web浏览器中选择所有内容然后将其粘贴到文本编辑器中. .
任何人都知道Ubuntu会做这件事吗?我正在尝试编写一个脚本来解析一些网页,但是我不想处理HTML,而只是想解析网站上出现的文本.
谢谢,
担
我有一个static class与static private readonly构件的VIA类的设置static constructor.下面是一个简化的例子.
public static class MyClass
{
private static readonly string m_myField;
static MyClass()
{
// logic to determine and set m_myField;
}
public static string MyField
{
get
{
// More logic to validate m_myField and then return it.
}
}
}
Run Code Online (Sandbox Code Playgroud)
由于上面的类是一个静态类,我无法创建它的实例,以便利用传递给FieldInfo.GetValue()调用来检索并稍后设置值m_myField.有没有一种方法我不知道要么使用FieldInfo类来获取和设置静态类的值,还是唯一的选择是重构我被要求进行单元测试的类?
我们有几个长时间运行的后端进程需要比默认的30秒更长的时间.
我们的NHibernate版本是2.0.1.4000,Spring.NET是1.2.0.20313.NHibernate通过Spring.NET以这种方式配置:
<object id="SessionFactory" type="Spring.Data.NHibernate.LocalSessionFactoryObject, Spring.Data.NHibernate20">
<property name="DbProvider" ref="DbProvider"/>
<property name="MappingAssemblies">
<list>
<value>SomeKindOfAnItem</value>
</list>
</property>
<property name="HibernateProperties">
<dictionary>
<entry key="expiration" value="120"/>
<entry key="adonet.batch_size" value="10"/>
<entry key="cache.provider_class" value="NHibernate.Caches.SysCache.SysCacheProvider, NHibernate.Caches.SysCache"/>
<entry key="cache.use_query_cache" value="true"/>
<entry key="connection.driver_class" value="NHibernate.Driver.SqlClientDriver"/>
<entry key="connection.provider" value="NHibernate.Connection.DriverConnectionProvider"/>
<entry key="dialect" value="NHibernate.Dialect.MsSql2005Dialect"/>
<entry key="current_session_context_class" value="Spring.Data.NHibernate.SpringSessionContext, Spring.Data.NHibernate20"/>
<entry key="show_sql" value="false"/>
</dictionary>
</property>
</object>
Run Code Online (Sandbox Code Playgroud)
为了解决这个问题,我试图在Web.config中将NHibernate command_timeout设置为60.这是来自Web.config:
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory>
<property name="command_timeout">60</property>
</session-factory>
</hibernate-configuration>
Run Code Online (Sandbox Code Playgroud)
不幸的是,这不起作用,命令在30秒后超时.
我构建了一个控制台应用程序,就像Web应用程序一样调用DAO.我在其配置文件中具有完全相同的NHibernate配置设置.IDbCommand在60秒后超时,而不是30,使用配置文件中的设置成功.
我尝试调试应用程序并检查从网站调用DAO程序集时是否设置了commandTimeout.它是.
这是来自Visual Studio观看:
((NHibernate.Driver.DriverBase)(((NHibernate.Connection.DriverConnectionProvider)((NHibernate.Impl.SessionFactoryImpl)session.SessionFactory).ConnectionProvider).Driver)).commandTimeout:60
会话创建如下:
ISession session = SessionFactoryUtils.GetSession(HibernateTemplate.SessionFactory, true);
Run Code Online (Sandbox Code Playgroud)
我的问题是:如果命令超时字段从我的Web.config成功设置为60,为什么它会在30秒后超时?我可以尝试任何想法吗?
我正在使用Silverlight WriteableBitmap命令使用以下代码呈现"饼图".
Chart GetChart()
{
Chart newChart = new Chart() { Width = 100.0,
Height = 100.0 };
PieSeries pieSeries = new PieSeries();
pieSeries.SetBinding(PieSeries.ItemsSourceProperty, new Binding());
pieSeries.DependentValueBinding = new Binding("Value");
pieSeries.IndependentValueBinding = new Binding("Key");
pieSeries.AnimationSequence = AnimationSequence.FirstToLast;
pieSeries.IsSelectionEnabled = true;
newChart.Series.Add(pieSeries);
newChart.SetValue(Chart.DataContextProperty, new KeyValuePair<string, int>[]
{
new KeyValuePair<string, int>("Work", 9),
new KeyValuePair<string, int>("Driving", 2),
new KeyValuePair<string, int>("Family", 4),
new KeyValuePair<string, int>("Sleep", 8),
new KeyValuePair<string, int>("Friends", 1)
});
return newChart;
}
WriteableBitmap bmapPreviewCanvas = new WriteableBitmap(GetChart, null);
Run Code Online (Sandbox Code Playgroud)
我期待的结果是带有PieChart的Bitmap.我得到的是一个没有任何PieChart背景的Bitmap.
问题是:我应该怎么做才能在变量'bmapPreviewCanvas'中呈现饼图?
编辑:这是否与ANIMATIONSEQUENCE有关?
我有一个通用业务对象集合类,其中包含一些业务对象:
public abstract class BusinessObjectCollection<T> : ICollection<T>
where T : BusinessObject
Run Code Online (Sandbox Code Playgroud)
我想在我的Collection类上编写一个返回类型T的方法,以及一个返回类型为T的新实例化对象的方法.
在C++中,这是你只需声明一个typedef value_type T;并使用BusinessObjectCollection :: value_type但我在C#中找不到等价物的地方.
有什么建议?
编辑:一个与我想到的typedef平行的关键是方法:
Type GetGenericParameter() {
return typeof(T);
}
Run Code Online (Sandbox Code Playgroud) c# ×3
.net ×1
bash ×1
email ×1
facebook ×1
generics ×1
html ×1
inno-setup ×1
iphone ×1
java ×1
linux ×1
nhibernate ×1
parsing ×1
reflection ×1
settings ×1
silverlight ×1
timeout ×1
uitableview ×1
wpf ×1
xaml ×1