本文整理汇总了C#中IntPtr类的典型用法代码示例。如果您正苦于以下问题:C# IntPtr类的具体用法?C# IntPtr怎么用?C# IntPtr使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IntPtr类属于命名空间,在下文中一共展示了IntPtr类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: GetFloat
static public int GetFloat(IntPtr l) {
try {
int argc = LuaDLL.lua_gettop(l);
if(matchType(l,argc,2,typeof(int))){
UnityEngine.Animator self=(UnityEngine.Animator)checkSelf(l);
System.Int32 a1;
checkType(l,2,out a1);
var ret=self.GetFloat(a1);
pushValue(l,true);
pushValue(l,ret);
return 2;
}
else if(matchType(l,argc,2,typeof(string))){
UnityEngine.Animator self=(UnityEngine.Animator)checkSelf(l);
System.String a1;
checkType(l,2,out a1);
var ret=self.GetFloat(a1);
pushValue(l,true);
pushValue(l,ret);
return 2;
}
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_Animator.cs
示例17: UpdateResource
private static extern bool UpdateResource(
IntPtr hUpdate,
string lpType,
IntPtr intResource,
ushort wLanguage,
IntPtr lpData,
uint cbData);
开发者ID:Ryknyk,项目名称:ExcelDna,代码行数:7,代码来源:ResourceHelper.cs
示例18: WithRefsWithReturn
public object WithRefsWithReturn(
ref string param1,
ref int param2,
ref short param3,
ref long param4,
ref uint param5,
ref ushort param6,
ref ulong param7,
ref bool param8,
ref double param9,
ref decimal param10,
ref int? param11,
ref object param12,
ref char param13,
ref DateTime param14,
ref Single param15,
ref IntPtr param16,
ref UInt16 param17,
ref UInt32 param18,
ref UInt64 param19,
ref UIntPtr param20
)
{
throw new Exception("Foo");
}
开发者ID:vlaci,项目名称:Anotar,代码行数:25,代码来源:OnException.cs
示例19: Register
public static void Register(IntPtr L)
{
LuaMethod[] regs = new LuaMethod[]
{
new LuaMethod("Lerp", Lerp),
new LuaMethod("ClampIndex", ClampIndex),
new LuaMethod("RepeatIndex", RepeatIndex),
new LuaMethod("WrapAngle", WrapAngle),
new LuaMethod("Wrap01", Wrap01),
new LuaMethod("HexToDecimal", HexToDecimal),
new LuaMethod("DecimalToHexChar", DecimalToHexChar),
new LuaMethod("DecimalToHex24", DecimalToHex24),
new LuaMethod("DecimalToHex32", DecimalToHex32),
new LuaMethod("ColorToInt", ColorToInt),
new LuaMethod("IntToColor", IntToColor),
new LuaMethod("IntToBinary", IntToBinary),
new LuaMethod("HexToColor", HexToColor),
new LuaMethod("ConvertToTexCoords", ConvertToTexCoords),
new LuaMethod("ConvertToPixels", ConvertToPixels),
new LuaMethod("MakePixelPerfect", MakePixelPerfect),
new LuaMethod("ConstrainRect", ConstrainRect),
new LuaMethod("SpringDampen", SpringDampen),
new LuaMethod("SpringLerp", SpringLerp),
new LuaMethod("RotateTowards", RotateTowards),
new LuaMethod("DistanceToRectangle", DistanceToRectangle),
new LuaMethod("AdjustByDPI", AdjustByDPI),
new LuaMethod("ScreenToPixels", ScreenToPixels),
new LuaMethod("ScreenToParentPixels", ScreenToParentPixels),
new LuaMethod("New", _CreateNGUIMath),
new LuaMethod("GetClassType", GetClassType),
};
LuaScriptMgr.RegisterLib(L, "NGUIMath", regs);
}
开发者ID:dafei2015,项目名称:hugular_cstolua,代码行数:34,代码来源:NGUIMathWrap.cs
示例20: RectangleContainsScreenPoint
static int RectangleContainsScreenPoint(IntPtr L)
{
try
{
int count = LuaDLL.lua_gettop(L);
if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(UnityEngine.RectTransform), typeof(UnityEngine.Vector2)))
{
UnityEngine.RectTransform arg0 = (UnityEngine.RectTransform)ToLua.ToObject(L, 1);
UnityEngine.Vector2 arg1 = ToLua.ToVector2(L, 2);
bool o = UnityEngine.RectTransformUtility.RectangleContainsScreenPoint(arg0, arg1);
LuaDLL.lua_pushboolean(L, o);
return 1;
}
else if (count == 3 && TypeChecker.CheckTypes(L, 1, typeof(UnityEngine.RectTransform), typeof(UnityEngine.Vector2), typeof(UnityEngine.Camera)))
{
UnityEngine.RectTransform arg0 = (UnityEngine.RectTransform)ToLua.ToObject(L, 1);
UnityEngine.Vector2 arg1 = ToLua.ToVector2(L, 2);
UnityEngine.Camera arg2 = (UnityEngine.Camera)ToLua.ToObject(L, 3);
bool o = UnityEngine.RectTransformUtility.RectangleContainsScreenPoint(arg0, arg1, arg2);
LuaDLL.lua_pushboolean(L, o);
return 1;
}
else
{
return LuaDLL.luaL_throw(L, "invalid arguments to method: UnityEngine.RectTransformUtility.RectangleContainsScreenPoint");
}
}
catch(Exception e)
{
return LuaDLL.toluaL_exception(L, e);
}
}
开发者ID:woshihuo12,项目名称:UnityHello,代码行数:33,代码来源:UnityEngine_RectTransformUtilityWrap.cs
注:本文中的IntPtr类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论