当前位置: 首页>>代码示例>>C#>>正文


C# IntPtr类代码示例

本文整理汇总了C#中IntPtr的典型用法代码示例。如果您正苦于以下问题:C# IntPtr类的具体用法?C# IntPtr怎么用?C# IntPtr使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IntPtr类属于命名空间,在下文中一共展示了IntPtr类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Metafile

		// Usually called when cloning images that need to have
		// not only the handle saved, but also the underlying stream
		// (when using MS GDI+ and IStream we must ensure the stream stays alive for all the life of the Image)
		internal Metafile (IntPtr ptr, Stream stream)
		{
			// under Win32 stream is owned by SD/GDI+ code
			if (GDIPlus.RunningOnWindows ())
				this.stream = stream;
			nativeObject = ptr;
		}
开发者ID:nlhepler,项目名称:mono,代码行数:10,代码来源:Metafile.cs

示例2: CheckEnvironment

 static int CheckEnvironment(IntPtr L)
 {
     LuaScriptMgr.CheckArgsCount(L, 0);
     bool o = Util.CheckEnvironment();
     LuaScriptMgr.Push(L, o);
     return 1;
 }
开发者ID:amadabarney,项目名称:Bead,代码行数:7,代码来源:UtilWrap.cs

示例3: SetEnabledFading

	static public int SetEnabledFading(IntPtr l) {
		try {
			int argc = LuaDLL.lua_gettop(l);
			if(argc==2){
				UnityEngine.Cloth self=(UnityEngine.Cloth)checkSelf(l);
				System.Boolean a1;
				checkType(l,2,out a1);
				self.SetEnabledFading(a1);
				pushValue(l,true);
				return 1;
			}
			else if(argc==3){
				UnityEngine.Cloth self=(UnityEngine.Cloth)checkSelf(l);
				System.Boolean a1;
				checkType(l,2,out a1);
				System.Single a2;
				checkType(l,3,out a2);
				self.SetEnabledFading(a1,a2);
				pushValue(l,true);
				return 1;
			}
			pushValue(l,false);
			LuaDLL.lua_pushstring(l,"No matched override function to call");
			return 2;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
开发者ID:602147629,项目名称:2DPlatformer-SLua,代码行数:29,代码来源:Lua_UnityEngine_Cloth.cs

示例4: GetProcessPath

 public static string GetProcessPath(IntPtr hwnd)
 {
     uint pid = 0;
     GetWindowThreadProcessId(hwnd, out pid);
     Process proc = Process.GetProcessById((int)pid);
     return proc.MainModule.FileName.ToString();
 }
开发者ID:lluk,项目名称:LoLy,代码行数:7,代码来源:ProcessHelper.cs

示例5: AddMatrix

 public static int AddMatrix(IntPtr l)
 {
     try {
         int argc = LuaDLL.lua_gettop(l);
         if(matchType(l,argc,2,typeof(int),typeof(UnityEngine.Matrix4x4))){
             UnityEngine.MaterialPropertyBlock self=(UnityEngine.MaterialPropertyBlock)checkSelf(l);
             System.Int32 a1;
             checkType(l,2,out a1);
             UnityEngine.Matrix4x4 a2;
             checkValueType(l,3,out a2);
             self.AddMatrix(a1,a2);
             pushValue(l,true);
             return 1;
         }
         else if(matchType(l,argc,2,typeof(string),typeof(UnityEngine.Matrix4x4))){
             UnityEngine.MaterialPropertyBlock self=(UnityEngine.MaterialPropertyBlock)checkSelf(l);
             System.String a1;
             checkType(l,2,out a1);
             UnityEngine.Matrix4x4 a2;
             checkValueType(l,3,out a2);
             self.AddMatrix(a1,a2);
             pushValue(l,true);
             return 1;
         }
         pushValue(l,false);
         LuaDLL.lua_pushstring(l,"No matched override function to call");
         return 2;
     }
     catch(Exception e) {
         return error(l,e);
     }
 }
开发者ID:jadie,项目名称:slua_test,代码行数:32,代码来源:Lua_UnityEngine_MaterialPropertyBlock.cs

示例6: AddChild

    static int AddChild(IntPtr L)
    {
        int count = LuaDLL.lua_gettop(L);

        if (count == 1)
        {
            GameObject arg0 = (GameObject)LuaScriptMgr.GetUnityObject(L, 1, typeof(GameObject));
            GameObject o = NGUITools.AddChild(arg0);
            LuaScriptMgr.Push(L, o);
            return 1;
        }
        else if (count == 2 && LuaScriptMgr.CheckTypes(L, 1, typeof(GameObject), typeof(GameObject)))
        {
            GameObject arg0 = (GameObject)LuaScriptMgr.GetLuaObject(L, 1);
            GameObject arg1 = (GameObject)LuaScriptMgr.GetLuaObject(L, 2);
            GameObject o = NGUITools.AddChild(arg0,arg1);
            LuaScriptMgr.Push(L, o);
            return 1;
        }
        else if (count == 2 && LuaScriptMgr.CheckTypes(L, 1, typeof(GameObject), typeof(bool)))
        {
            GameObject arg0 = (GameObject)LuaScriptMgr.GetLuaObject(L, 1);
            bool arg1 = LuaDLL.lua_toboolean(L, 2);
            GameObject o = NGUITools.AddChild(arg0,arg1);
            LuaScriptMgr.Push(L, o);
            return 1;
        }
        else
        {
            LuaDLL.luaL_error(L, "invalid arguments to method: NGUITools.AddChild");
        }

        return 0;
    }
开发者ID:dafei2015,项目名称:hugular_cstolua,代码行数:34,代码来源:NGUIToolsWrap.cs

示例7: LsaLookupSids

 internal static extern uint LsaLookupSids(
     SafeLsaPolicyHandle handle,
     int count,
     IntPtr[] sids,
     ref SafeLsaMemoryHandle referencedDomains,
     ref SafeLsaMemoryHandle names
     );
开发者ID:dotnet,项目名称:corefx,代码行数:7,代码来源:Interop.LsaLookupSids.cs

示例8: OpenCounter

        // The app name should either be a valid app name or be 'null' to get the state service
        // counters initialized
        private static void OpenCounter(string appName) {
            try {
                // Don't activate perf counters if webengine.dll isn't loaded
                if (! HttpRuntime.IsEngineLoaded) 
                    return;

                // Open the global counters
                if (_global == IntPtr.Zero) {
                    _global = UnsafeNativeMethods.PerfOpenGlobalCounters();
                }

                // If appName is null, then we want the state counters
                if (appName == null) {
                    if (_stateService == IntPtr.Zero) {
                        _stateService = UnsafeNativeMethods.PerfOpenStateCounters();
                    }
                }
                else {
                    if (appName != null) {
                        _instance = UnsafeNativeMethods.PerfOpenAppCounters(appName);
                    }
                }
            }
            catch (Exception e) {
                Debug.Trace("Perfcounters", "Exception: " + e.StackTrace);
            }
        }
开发者ID:JokerMisfits,项目名称:linux-packaging-mono,代码行数:29,代码来源:PerfCounters.cs

示例9: reg

	static public void reg(IntPtr l) {
		getEnumTable(l,"UnityEngine.ColorSpace");
		addMember(l,0,"Gamma");
		addMember(l,1,"Linear");
		addMember(l,-1,"Uninitialized");
		LuaDLL.lua_pop(l, 1);
	}
开发者ID:602147629,项目名称:2DPlatformer-SLua,代码行数:7,代码来源:Lua_UnityEngine_ColorSpace.cs

示例10: reg

 public static void reg(IntPtr l)
 {
     getTypeTable(l,"UnityEngine.AvatarBuilder");
     addMember(l,BuildHumanAvatar_s);
     addMember(l,BuildGenericAvatar_s);
     createTypeMetatable(l,constructor, typeof(UnityEngine.AvatarBuilder));
 }
开发者ID:terwxqian,项目名称:2DPlatformer-SLua,代码行数:7,代码来源:Lua_UnityEngine_AvatarBuilder.cs

示例11: reg

 public static void reg(IntPtr l)
 {
     getTypeTable(l,"UnityEngine.AudioHighPassFilter");
     addMember(l,"cutoffFrequency",get_cutoffFrequency,set_cutoffFrequency,true);
     addMember(l,"highpassResonanceQ",get_highpassResonanceQ,set_highpassResonanceQ,true);
     createTypeMetatable(l,constructor, typeof(UnityEngine.AudioHighPassFilter),typeof(UnityEngine.Behaviour));
 }
开发者ID:BobLChen,项目名称:hugula,代码行数:7,代码来源:Lua_UnityEngine_AudioHighPassFilter.cs

示例12: reg

	static public void reg(IntPtr l) {
		getEnumTable(l,"UnityEngine.BlendWeights");
		addMember(l,1,"OneBone");
		addMember(l,2,"TwoBones");
		addMember(l,4,"FourBones");
		LuaDLL.lua_pop(l, 1);
	}
开发者ID:602147629,项目名称:2DPlatformer-SLua,代码行数:7,代码来源:Lua_UnityEngine_BlendWeights.cs

示例13: IntToEnum

 static int IntToEnum(IntPtr L)
 {
     int arg0 = (int)LuaDLL.lua_tonumber(L, 1);
     OffMeshLinkType o = (OffMeshLinkType)arg0;
     LuaScriptMgr.Push(L, o);
     return 1;
 }
开发者ID:dafei2015,项目名称:hugular_cstolua,代码行数:7,代码来源:OffMeshLinkTypeWrap.cs

示例14: reg

 public static void reg(IntPtr l)
 {
     getEnumTable(l,"UnityEngine.Experimental.Director.PlayState");
     addMember(l,0,"Paused");
     addMember(l,1,"Playing");
     LuaDLL.lua_pop(l, 1);
 }
开发者ID:jadie,项目名称:slua_test,代码行数:7,代码来源:Lua_UnityEngine_Experimental_Director_PlayState.cs

示例15: SendFileToPrinter

	public static bool SendFileToPrinter( string szPrinterName, string szFileName )
	{
		// Open the file.
		FileStream fs = new FileStream(szFileName, FileMode.Open);
		// Create a BinaryReader on the file.
		BinaryReader br = new BinaryReader(fs);
		// Dim an array of bytes big enough to hold the file's contents.
		Byte []bytes = new Byte[fs.Length];
		bool bSuccess = false;
		// Your unmanaged pointer.
		IntPtr pUnmanagedBytes = new IntPtr(0);
		int nLength;

		nLength = Convert.ToInt32(fs.Length);
		// Read the contents of the file into the array.
		bytes = br.ReadBytes( nLength );
		// Allocate some unmanaged memory for those bytes.
		pUnmanagedBytes = Marshal.AllocCoTaskMem(nLength);
		// Copy the managed byte array into the unmanaged array.
		Marshal.Copy(bytes, 0, pUnmanagedBytes, nLength);
		// Send the unmanaged bytes to the printer.
		bSuccess = SendBytesToPrinter(szPrinterName, pUnmanagedBytes, nLength);
		// Free the unmanaged memory that you allocated earlier.
		Marshal.FreeCoTaskMem(pUnmanagedBytes);
		return bSuccess;
	}
开发者ID:marioricci,项目名称:erp-luma,代码行数:26,代码来源:Class2.cs


注:本文中的IntPtr类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。