我正在开发一个应用程序,它记住用户关于表单最后位于屏幕上的位置的首选项.在某些情况下,用户将其放在辅助屏幕上,然后在没有第二个屏幕的情况下稍后启动应用程序(有时窗体显示在屏幕外).其他时候,用户将改变其分辨率,从而产生类似的效果.
我希望在Form_Shown事件处理程序中执行此检查.基本上我想确定表格是否完全不在屏幕上,所以我可以重新定位它.
有什么建议?
我和一位同事最近使用Fluent NHibernate为一个小应用程序做后端.我们编写了实体,映射文件,持久性管理器,但由于某种原因,我们无法将数据库模式导出到任何东西.
通过调试器,我们发现FluentMappings.AddFromAssemblyOf返回0映射,即使它们显然在那里,并且显然是正确的.我们尝试了我们能想到的一切,最终不得不手动添加每个映射.
以下是无效的代码:
return Fluently.Configure().Database(
MsSqlConfiguration.MsSql2005
.ConnectionString(c => c
.TrustedConnection()
.Server("localhost")
.Database("LDTT")))
.Mappings(m => m.FluentMappings.AddFromAssemblyOf<UserMap>())
.ExposeConfiguration(BuildSchema)
.BuildSessionFactory();
Run Code Online (Sandbox Code Playgroud)
虽然这段代码确实有效:
return Fluently.Configure().Database(
MsSqlConfiguration.MsSql2005
.ConnectionString(c => c
.TrustedConnection()
.Server("localhost")
.Database("LDTT")))
.Mappings(m => m.FluentMappings.Add<ClientMap>())
.Mappings(m => m.FluentMappings.Add<ContactMap>())
.Mappings(m => m.FluentMappings.Add<DepartmentMap>())
.Mappings(m => m.FluentMappings.Add<DivisionMap>())
.Mappings(m => m.FluentMappings.Add<FileMap>())
.Mappings(m => m.FluentMappings.Add<FileTypeMap>())
.Mappings(m => m.FluentMappings.Add<RegionMap>())
.Mappings(m => m.FluentMappings.Add<TimeEntryMap>())
.Mappings(m => m.FluentMappings.Add<UserMap>())
.ExposeConfiguration(BuildSchema)
.BuildSessionFactory();
Run Code Online (Sandbox Code Playgroud)
有谁知道为什么会这样,以及如何解决它?
我在ASP.NET MVC 4 RC Web API中得到了我认为是一个奇怪的绑定问题.我有一个方法来接受来自客户端的帖子请求.问题是,当调用post方法时,没有任何参数是绑定的,我到达了抛出线上的断点并且名称,email都是null.如果我在JavaScript中将请求的类型更改为GET,则使用参数绑定调用下面的Get函数.
为什么参数无法为Post方法绑定,我该如何解决这个问题?
send: function(evt) {
evt.preventDefault();
$.ajax( {
url: '/api/person',
data: this.model.toJSON(),
type: "POST",
dataType: "json",
success: function(data) {
console.log("Success");
},
error: function(data) {
console.log("Error");
}
});
}
Run Code Online (Sandbox Code Playgroud)
以下是控制器操作:
public void Get(string name, string email) {
throw new NotImplementedException();
}
public void Post(string name, string email) {
throw new NotImplementedException();
}
Run Code Online (Sandbox Code Playgroud)
笔记:
对于C++,HTML代码是否相当于整洁?我在互联网上搜索过,但除了C++包装器之外我什么也找不到等等......我认为关键字整洁是我挂断的东西.
我基本上是在寻找能够由两个人编写代码的东西,并将其清理成标准化的样式.这样的应用程序是否存在?
谢谢你!