草庐IT

Name_of_your_preference

全部标签

C#/WPF : Binding Combobox ItemSource in Datagrid to element outside of the DataContext

我想做以下事情:publicListPreLoadedUserList{get;set;}publicListSomeDataRowList{get;set;}publicclassUsers{publicintAge{get;set;}publicstringName{get;set;}}publicclassSomeDataRowList{publicintUserAge{get;set;}现在我的(WPF工具包)DataGrid看起来像这样:现在我的问题是,PreLoadedUserList在ItemSource(SomeDataRowList)之外,我不知道如何绑定(bind)

c# - SQL 服务器 : invalid object name in query execution

我正在尝试执行Insert语句,但一直收到Invalidobjectname错误。这是我的代码:publicstringaddNewComment(intuserID,intpageID,stringtitle,stringcomment){stringquery="INSERTINTOdbo.nokernok_kommentarer(userID,pageID,commentTitle,comment)"+"VALUES("+userID+","+pageID+",'"+title+"','"+comment+"')";adapter.InsertCommand=newSqlComm

c# - Resharper 中的警告 "Return value of pure method is not used"

我有一个快速的问题,关于我正在工作的c#项目中从VisualStudio中的Resharper收到的警告。警告是:"ReturnValueofpuremethodisnotused"发生这种情况的方法如下:privatestaticboolFilePathHasInvalidChars(stringuserInputPath){try{//thisiswherethewarningoccurs:Path.GetFullPath(userInputPath);}catch(Exceptione){Log.Error(String.Format("TheProgramfailedtorun

c# - 如何使用 Name 属性枚举 .NET 中的线程?

假设我像这样启动两个线程://StartfirstthreadThreadloaderThread1=newThread(loader.Load);loaderThread1.Name="Rope";loaderThread1.Start();//StartsecondthreadThreadloaderThread2=newThread(loader.Load);loaderThread2.Name="String";loaderThread2.Start();有什么方法可以通过使用它们的Name属性来枚举线程?我想检查具有特定名称的线程是否仍在运行。我创建的每个线程都处理一组命名的

c# - 错误 : Native images generated against multiple versions of assembly System.Net.Http.Primitives

我在我的WP8.1应用程序中遇到了这个错误,Application_UnhandledExceptionERROR:NativeimagesgeneratedagainstmultipleversionsofassemblySystem.Net.Http.Primitives.atCoolEditor.Class.DropNetRt.DropNetClient.LoadClient()atCoolEditor.Class.DropNetRt.DropNetClient..ctor(StringapiKey,StringappSecret)atCoolEditor.MainPage.d_

c# - 从浏览器安装后启动 Silverlight Out-of-Browser

我正在Silverlight4Beta中构建原型(prototype)应用程序,并且正在使用浏览器外(OOB)功能。我需要OOB功能才能访问本地文件系统,并且我想避免编写ActiveX组件或Java小程序。我需要在客户端计算机上安装浏览器后能够启动OOB体验。我似乎能做的就是从浏览器检测该应用程序是否已安装,然后要求用户从桌面或开始菜单(作为普通应用程序)启动它。然而,这“破坏”了客户所需的体验,而这本应由浏览器引导。有没有人能够直接从浏览器启动OOB应用程序?谢谢,马丁 最佳答案 这应该是不可能的。仅仅因为用户已同意将应用程序安装

c# - Visual Studio Community 2015 调试器在带有 "Evaluation of native methods is not supported"的条件断点处结束 - 如何修复?

我有一个条件断点,条件检查字符串的值,如果为真则停止。它停止了,但随后打开一个窗口说:断点的条件无法执行...返回的错误是“评估方法System.Collections.Specialized.NameValueCollection.get_Item()调用native方法”System.Globalization.TextInfo.Internal.GetCaseInsHash().不支持在此上下文中评估native方法。'。单击“确定”在此断点处停止。我搜索了答案,但他们说启用托管兼容模式,但没有用。 最佳答案 在项目调试设置下

c# - 使用 al.exe 对具有强名称的程序集进行签名时, 'module name' 是什么?

我正在尝试按照此处的指南使用强名称对程序集进行签名:http://msdn.microsoft.com/en-us/library/xc31ft41.aspx关键指令是:al/out:/keyfile:它说modulenameisthenameofthecodemoduleusedtocreatetheassembly我不明白这是什么意思。从字面上看,我会将上面的内容解释为csc.exe的某个组件(即,它创建了程序集),但显然在这种情况下这是荒谬的。那么首先这是指什么,其次(为了帮助我的元学习)人们将如何推理它是什么?鉴于文档的简洁性,我的印象是它对我来说应该是显而易见的或直观的,但目

c# - 为什么不接受 IEnumerable(of T) 作为扩展方法接收器

在代码前完成问题:为什么是IEnumerablewhereT:ITest不被接受为期望thisIEnumerable的扩展方法的接收者?现在是代码:我有三种类型:publicinterfaceITest{}publicclassElement:ITest{}publicclassElementInfo:ITest{}还有两种扩展方法:publicstaticclassExtensions{publicstaticIEnumerableMethod(thisIEnumerablecollection)whereT:ITest{→returncollection.ToInfoObjects

c# - XML 序列化错误 : 2 types both use the XML type name, 'Relationship',来自命名空间 ''

我在通过XML进行序列化时遇到问题,因为2个类使用一个类(尽管类不同!)称为关系。我尝试使用XML属性用另一个名称装饰其中的一个类,但它仍然给我以下错误:{"Types'SiteServer.Relationship'and'LocalServer.Relationship'bothusetheXMLtypename,'Relationship',fromnamespace''.UseXMLattributestospecifyauniqueXMLnameand/ornamespaceforthetype."}这是我的2个类(class),有人知道为什么吗??我使用了错误的属性吗?它似