草庐IT

win_class

全部标签

c# - 在 C# Win Form 中嵌入 PowerPoint Viewer

是否可以将PowerPoint查看器嵌入到C#Windows窗体中?我目前使用以下代码:objApp=newPowerPoint.Application();//objApp.Visible=MsoTriState.msoTrue;objPresSet=objApp.Presentations;objPres=objPresSet.Open(ppsAction.FileInfo.FullName,MsoTriState.msoTrue,MsoTriState.msoTrue,MsoTriState.msoFalse);objSlides=objPres.Slides;//RuntheS

c# - FileLoadException 在 InitializeComponent 或 x :Class=

我在InitializeComponent方法中遇到文件加载器异常(第一次机会),或者调试器在多个WPF的xaml-root的x:Class属性处中断用户控制。尽管异常会大大降低导航速度,但一切正常。这是异常信息:Couldnotloadfileorassembly'Company.Solution.UserInterface,Version=0.1.5568.25577,Culture=neutral,PublicKeyToken=45069ab0c15881ce'oroneofitsdependencies.Thelocatedassembly'smanifestdefinitio

c# - 为什么具有 "where T : class"约束的 Generic<T> 方法接受接口(interface)

我有这个interface:publicinterfaceITestInterface{intTestInt{get;set;}}和这个通用方法(带有T:class约束):publicvoidTest()whereT:class{//DoSomething}这个电话:Test();一切都编译并运行,同时interface不是class(或者是吗?)。为什么会这样?我第一次看到这个是在我的WCF代理类上:publicpartialclassTestServiceClient:System.ServiceModel.ClientBase,TestNamespace.ITestService

c# - 代码契约(Contract) : Why are some invariants not considered outside the class?

考虑这个不可变类型:publicclassSettings{publicstringPath{get;privateset;}[ContractInvariantMethod]privatevoidObjectInvariants(){Contract.Invariant(Path!=null);}publicSettings(stringpath){Contract.Requires(path!=null);Path=path;}}这里需要注意两点:有一个保证Path属性永远不会为null的契约不变量构造函数检查path参数值以遵守先前的契约不变量此时,Setting实例永远不能有n

c# - 如何使用 Win32 API 在 TreeView 中选择一个项目

我正在尝试使用Win32API将一系列用户输入自动化到C#中已编译的应用程序。我没有我试图控制的应用程序的任何源代码,并且在我试图控制它时它正在运行。在我的代码中,我有一个按钮,单击该按钮时,需要对我试图控制的应用程序进行一系列3次输入:在TreeView中选择一个项目点击一个按钮点击另一个按钮它的工作方式是第2步中的按钮根据第1步中在TreeView中选择的项目执行操作。我可以通过简单地发送消息来使按钮点击正常工作,但我无法确定了解如何选择我想要的TreeView项目。TreeView是静态的,因此项目和布局永远不会改变。它具有以下布局:-itemsA-元素B--itemB1-ite

c# - Visual Studio express : free class diagram tool

关闭。这个问题不符合StackOverflowguidelines.它目前不接受答案。我们不允许提问寻求书籍、工具、软件库等的推荐。您可以编辑问题,以便用事实和引用来回答。关闭8年前。Improvethisquestion我正在使用c#express并希望使用免费工具来设计我的类图。您有什么推荐的免费工具?

c# - 将 .NET P/Invoke 代码组织到 Win32 API 的最佳实践

我正在.NET中重构一个庞大而复杂的代码库,它大量使用P/InvoketoWin32API。项目的结构不是最好的,我发现到处都是DllImport语句,经常重复相同的功能,并且还以多种方式声明:导入指令和方法有时声明为公共(public)的,有时声明为私有(private)的,有时声明为静态的,有时声明为实例方法。我担心重构可能会产生意想不到的后果,但这可能是不可避免的。是否有我可以遵循的记录在案的最佳做法可以帮助我解决问题?我坚持要组织一个静态/共享的Win32P/InvokeAPI类,在一个文件中列出所有这些方法和关联的常量...编辑user32DLL有超过70个导入.(代码库由2

c# - Win32Exception 存储空间不足,无法处理此命令

通过我对MaxTo的自动崩溃收集我收到以下崩溃报告:V8.12.0.0-System.ComponentModel.Win32Exception-:VoidUpdateLayered():0Version:MaxTo8.12.0.0Exception:System.ComponentModel.Win32ExceptionErrormessage:NotenoughstorageisavailabletoprocessthiscommandStacktrace:atSystem.Windows.Forms.Form.UpdateLayered()atSystem.Windows.For

c# - 通过反射仅获取当前类(class)成员

假设这段代码:usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingSystem.Threading.Tasks;usingSystem.Reflection;namespaceTestFunctionality{classProgram{staticvoidMain(string[]args){//System.Reflection.Assembly.GetExecutingAssembly().LocationAssemblyassembly=Assembly.LoadF

C#/N 休眠 : Association references unmapped class

几个小时以来,我一直在努力解决这个NHibernate问题。我在网络和NHibernate文档上进行了广泛的研究,但我无法理解这个问题。我对NHibernate比较陌生,但很喜欢它。不过,在那种情况下,它让我发疯。我正在为网站编写一个小型“投票”模块。我有几个类(Poll、PollVote和PollAnswer)。主要的Poll是导致问题的原因。这就是类的样子:publicclassPoll{publicvirtualintId{get;set;}publicvirtualSiteSite{get;set;}publicvirtualstringQuestion{get;set;}pu