object

委托的异步调用

隐身守侯 提交于 2020-01-24 00:46:11
public delegate void deleGetUserList(object sdf);//定义一个委托 deleGetUserList du = new deleGetUserList(GetUserList); du.BeginInvoke(AdminId, null, null); public void GetUserList(Object str) {} 异步调用相当于在主线程中开辟了一个新的线程在后台来执行需要异步调用的方法,在这个方法中如果要操作其他控件(比如将文本框填入某一字符串),就 会抛出一个cross-thread异常,这个异常是由于编译器出于安全考虑,不允许不是创建这个控件的线程来调用这个控件(文本框).解决的方法是:     在这个另外的一个线程中通过使用这个控件的Invoke(Delegate method,params object[] args)方法,Invoke可以调用一个委托,可以在这个委托所代表的方法中对这个控件进行操作;     Invoke有2个参数,第一个是要执行操作的方法的代理,第二个是要执行操作的方法需要的参数对象数组.     下面是一个小例子(在按钮事件新建立的线程中对一个文本框写入"helloworld"字符串): delegate void AddMsgDel(string msg); private void

Linked Excel Object in Powerpoint wont update when showing in slideshow

岁酱吖の 提交于 2020-01-24 00:17:18
问题 I'm new to this and basically what I want to do is: -I have 2 excel files and 1 powerpoint presentation -all of the files are in a shared network -I linked my excel files to the powerpoint -I have office 2003 and 2007 versions The problem: I play the slideshow of the powerpoint and set it to loop on 1 computer to display it on a big LCD at work, I then access the excel files on a separate computer and update it from there, the problem is the slideshow that is playing wont display my changes

前端基础JavaScript

孤街醉人 提交于 2020-01-23 23:05:03
JavaScript引入方式 <script> // 在这里写你的JS代码 </script> <script src="myscript.js"></script> 引入额外的JS文件 JavaScript 注释 // 这是单行注释 /* 这是 多行注释 */ 结束符   JavaScript中的语句要以分号(;)为结束符。 JavaScript变量声明   1. JavaScript的变量名可以使用_,数字,字母,$组成,不能以数字开头。   2. 声明变量使用 var 或 let变量名; 的格式来进行声明   var :全局 let:局部作用域 var name = "Alex"; var age = 18;   变量名是区分大小写的。 推荐使用驼峰式命名规则。 JavaScript数据类型 JavaScript拥有动态类型 var x; // 此时x是undefined var x = 1; // 此时x是数字 var x = "Alex" // 此时x是字符串 数值 JavaScript不区分整型和浮点型,就只有一种数字类型 var a = 12.34; var b = 20; var c = 123e5; // 12300000 var d = 123e-5; // 0.00123 还有一种NaN,表示不是一个数字(Not a Number)。 parseInt(

反射

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-23 22:59:42
反射是.NET中的重要机制,通过反射,可以在运行时获得程序或程序集中每一个类型(包括类、结构、委托、接口和枚举等)的成员和成员的信息。有了反射,即可对每一个类型了如指掌。另外我还可以直接创建对象,即使这个对象的类型在编译时还不知道。 反射的用途: (1)使用Assembly定义和加载程序集,加载在程序集清单中列出模块,以及从此程序集中查找类型并创建该类型的实例。 (2)使用Module了解包含模块的程序集以及模块中的类等,还可以获取在模块上定义的所有全局方法或其他特定的非全局方法。 (3)使用ConstructorInfo了解构造函数的名称、参数、访问修饰符(如pulic 或private)和实现详细信息(如abstract或virtual)等。 (4)使用MethodInfo了解方法的名称、返回类型、参数、访问修饰符(如pulic 或private)和实现详细信息(如abstract或virtual)等。 (5)使用FiedInfo了解字段的名称、访问修饰符(如public或private)和实现详细信息(如static)等,并获取或设置字段值。 (6)使用EventInfo了解事件的名称、事件处理程序数据类型、自定义属性、声明类型和反射类型等,添加或移除事件处理程序。 (7)使用PropertyInfo了解属性的名称、数据类型、声明类型、反射类型和只读或可写状态等

Ream--(objc)写事务精简方案

[亡魂溺海] 提交于 2020-01-23 22:30:12
Ream--(objc)写事务精简方案 地址: REALM-- Realm官方提供的的写事务有两种方式: A[realm beginWriteTransaction]; // ... [realm commitWriteTransaction]; B [realm transactionWithBlock:^{ //... }]; 由于realm强制线程安全,所以realm对象不适合持有。所以造成了realm写事务面向realm编程,而不是面向RLMObject编程。或者说realm的面向过的程痕迹还没消除干净,追求速度的realm由c++实现,realm选择了速度放弃了一些便利。 这种编码方式才是我们期望的[object commitTransaction:^(object){ object.key = value; }]; 常见的封装策略都是围绕AB两种形式。围绕A形式封装的问题是代码损耗大,作用域不直观,并且中间不能return,B形式封装的问题是夸闭包传值代码损耗大,调试原作用域浪费时间,不能return。 最理想的编码方式是一行 { @realm_writing; /// Begin commit object.key = value; } /// Commit when leava current scope. 这种编码方式需要借助析构函数,使用C++会要求所有

GetObject详解

左心房为你撑大大i 提交于 2020-01-23 19:02:11
GetObject函数用于从指定的图形对象中获取信息,原型如下: int GetObject( HGDIOBJ hgdiobj, // handle to graphics object int cbBuffer, // size of buffer for object information LPVOID lpvObject // buffer for object information ); 其中 参数hgdiobj是图形对象的句柄,图形对象可以是如下几种:逻辑位图、刷子、字体、调色板、画笔或者由函数CreateDIBSection创建的设备无关位图; 参数cbBuffer是即将写入到缓冲区中的图形对象信息的字节数; 参数lpvObject是指向接收图形对象信息的缓冲区的指针,下表是每一种图形对象对应获取到的缓冲区中的信息; 关于返回值: 当函数执行成功且参数lpvObject为NULL时,返回值是保存获取的信息的缓冲区需要的字节数; 当函数执行成功且参数lpvObject是有效地指针时,返回值是存储到缓冲区中的数据的字节数; 当函数执行失败时,返回值是0。 GetObject(hBitmap,sizeof(BITMAP),&Bitmap); cxSource=Bitmap.bmWidth; cySource=Bitmap.bmHeight; 来源: https://www

LINQ checking for duplicate objects (excluding ID)

扶醉桌前 提交于 2020-01-23 18:45:49
问题 I am using LINQ to SQL (SQL Server) with C#. I have a table called "Cars" which automatically becomes the LINQ class/object called "Car". All well and good. Each car has a number of fields, say CarID(primary key int), EngineID, ColourID. I have 10 existing rows in the Cars table. Using all the cool LINQ stuff, I create a new "Car" object in C# with an overloaded constructor that I've created in my "Car" partial class. So for example: Car MyCar = new Car(17, 5); Now this nicely gives me a

What are “undetectable means” and how can they change objects of a C/C++ program?

China☆狼群 提交于 2020-01-23 17:28:45
问题 In ISO/IEC 14882:2003 (C++03) is stated under 7.1.5.1/8, section "The cv-qualifers": [Note: volatile is a hint to the implementation to avoid aggressive optimization involving the object because the value of the object might be changed by means undetectable by an implementation. See 1.9 for detailed semantics. In general, the semantics of volatile are intended to be the same in C++ as they are in C. ] These "means", that are undetectable by an implementation has been also already subject of

What are “undetectable means” and how can they change objects of a C/C++ program?

给你一囗甜甜゛ 提交于 2020-01-23 17:28:28
问题 In ISO/IEC 14882:2003 (C++03) is stated under 7.1.5.1/8, section "The cv-qualifers": [Note: volatile is a hint to the implementation to avoid aggressive optimization involving the object because the value of the object might be changed by means undetectable by an implementation. See 1.9 for detailed semantics. In general, the semantics of volatile are intended to be the same in C++ as they are in C. ] These "means", that are undetectable by an implementation has been also already subject of

JAVA中的instanceof用法

会有一股神秘感。 提交于 2020-01-23 15:24:34
java 中的instanceof 运算符是用来在运行时指出对象是否是特定类的一个实例。instanceof通过返回一个布尔值来指出,这个对象是否是这个特定类或者是它的子类的一个实例。 用法: result = object instanceof class 参数: Result:布尔类型。 Object:必选项。任意对象表达式。 Class:必选项。任意已定义的对象类。 说明: 如果 object 是 class 的一个实例,则 instanceof 运算符返回 true。如果 object 不是指定类的一个实例,或者 object 是 null,则返回 false。 但是instanceof在Java的编译状态和运行状态是有区别的: 在编译状态中,class可以是object对象的父类,自身类,子类。在这三种情况下Java编译时不会报错。 在运行转态中,class可以是object对象的父类,自身类,不能是子类。在前两种情况下result的结果为true,最后一种为false。但是class为子类时编译不会报错。运行结果为false。 例子: 接口Person public interface Person { public void eat ( ) ; } 实现类People public class People implements Person { private