• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# DumpState类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: DumpMem

        public static void DumpMem(object b, DumpState D)
        {
#if XBOX || SILVERLIGHT
			// todo: implement this - mjf
			Debug.Assert(false);
#else
            //Console.WriteLine(b.GetType().ToString() + ":::" + b.ToString());
            //uint size = (uint)Marshal.SizeOf(b);
            //D.status = D.writer(D.L, new CharPtr(b.ToString()), size, D.data);
            
            ///*
            int size = Marshal.SizeOf(b);
            IntPtr ptr = Marshal.AllocHGlobal(size);
            Marshal.StructureToPtr(b, ptr, false);
            byte[] bytes = new byte[size];
            Marshal.Copy(ptr, bytes, 0, size);
            char[] ch = new char[bytes.Length];
            for (int i = 0; i < bytes.Length; i++)
                ch[i] = (char)bytes[i];
            CharPtr str = ch;
            DumpBlock(str, (uint)str.chars.Length, D);
            Marshal.Release(ptr);
            // */
#endif
        }
开发者ID:chenzuo,项目名称:SharpLua,代码行数:25,代码来源:ldump.cs


示例2: DumpMem

 public static void DumpMem(object b, int n, DumpState D)
 {
     Array array = b as Array;
     Debug.Assert(array.Length == n);
     for (int i = 0; i < n; i++)
         DumpMem(array.GetValue(i), D);
 }
开发者ID:prabirshrestha,项目名称:KopiLua,代码行数:7,代码来源:ldump.cs


示例3: Write

 public override void Write(object o, HtmlWriter tag, DumpState state, RefDictionary refDict)
 {
     var val =  o.ToString();
     tag.Tag("kbd", t =>
     {
         t.NewLineAfterSTag = false;
         t.WriteString(val);
     });
 }
开发者ID:cmc19,项目名称:DumpUtil,代码行数:9,代码来源:EnumDumpType.cs


示例4: DumpBlock

 private static void DumpBlock(CharPtr b, uint size, DumpState D)
 {
     if (D.status==0)
      {
       LuaUnlock(D.L);
       D.status=D.writer(D.L,b,size,D.data);
       LuaLock(D.L);
      }
 }
开发者ID:prabirshrestha,项目名称:KopiLua,代码行数:9,代码来源:ldump.cs


示例5: LuaUDump

 public static int LuaUDump(LuaState L, Proto f, lua_Writer w, object data, int strip)
 {
     DumpState D = new DumpState();
      D.L=L;
      D.writer=w;
      D.data=data;
      D.strip=strip;
      D.status=0;
      DumpHeader(D);
      DumpFunction(f,null,D);
      return D.status;
 }
开发者ID:prabirshrestha,项目名称:KopiLua,代码行数:12,代码来源:ldump.cs


示例6: DumpVector

 static void DumpVector(object b, int n, DumpState D)
 {
     DumpInt(n,D);
      DumpMem(b, n, D);
 }
开发者ID:prabirshrestha,项目名称:KopiLua,代码行数:5,代码来源:ldump.cs


示例7: DumpString

 private static void DumpString(TString s, DumpState D)
 {
     if (s==null || GetStr(s)==null)
      {
       uint size=0;
       DumpVar(size,D);
      }
      else
      {
       uint size=s.tsv.len+1;		/* include trailing '\0' */
       DumpVar(size,D);
       DumpBlock(GetStr(s),size,D);
      }
 }
开发者ID:prabirshrestha,项目名称:KopiLua,代码行数:14,代码来源:ldump.cs


示例8: DumpNumber

 private static void DumpNumber(LuaNumberType x, DumpState D)
 {
     DumpVar(x,D);
 }
开发者ID:prabirshrestha,项目名称:KopiLua,代码行数:4,代码来源:ldump.cs


示例9: DumpInt

 private static void DumpInt(int x, DumpState D)
 {
     DumpVar(x,D);
 }
开发者ID:prabirshrestha,项目名称:KopiLua,代码行数:4,代码来源:ldump.cs


示例10: DumpHeader

 private static void DumpHeader(DumpState D)
 {
     CharPtr h = new char[LUAC_HEADERSIZE];
      luaU_header(h);
      DumpBlock(h,LUAC_HEADERSIZE,D);
 }
开发者ID:prabirshrestha,项目名称:KopiLua,代码行数:6,代码来源:ldump.cs


示例11: DumpFunction

 private static void DumpFunction(Proto f, TString p, DumpState D)
 {
     DumpString( ((f.source==p) || (D.strip!=0)) ? null : f.source, D);
      DumpInt(f.linedefined,D);
      DumpInt(f.lastlinedefined,D);
      DumpChar(f.nups,D);
      DumpChar(f.numparams,D);
      DumpChar(f.is_vararg,D);
      DumpChar(f.maxstacksize,D);
      DumpCode(f,D);
      DumpConstants(f,D);
      DumpDebug(f,D);
 }
开发者ID:prabirshrestha,项目名称:KopiLua,代码行数:13,代码来源:ldump.cs


示例12: DumpMem

        public static void DumpMem(object b, DumpState D)
        {
            #if XBOX
            // todo: implement this - mjf
            Debug.Assert(false);
            #endif

            #if SILVERLIGHT
            // No support for Marshal.SizeOf in Silverlight, so we
            // have to manually set the size. Size values are from
            // Lua's 5.1 spec.

            // No support for Marshal.StructureToPtr in Silverlight,
            // let's use BitConverter instead!

            int size = 0;
            byte[] bytes;
            Type t = b.GetType();
            if (t.Equals(typeof(UInt32)))
            {
                size = 4;
                bytes = BitConverter.GetBytes((uint)b);
            }
            else if (t.Equals(typeof(Int32)))
            {
                size = 4;
                bytes = BitConverter.GetBytes((int)b);
            }
            else if (t.Equals(typeof(Char)))
            {
                size = 1;
                bytes = new byte[1] { BitConverter.GetBytes((char)b)[0] };
            }
            else if (t.Equals(typeof(Byte)))
            {
                size = 1;
                bytes = new byte[1] { (byte)b };
                //bytes = BitConverter.GetBytes((byte)b);
            }
            else if (t.Equals(typeof(Double)))
            {
                size = 8;
                bytes = BitConverter.GetBytes((double)b);
            }
            else
            {
                throw new NotImplementedException("Invalid type: " + t.FullName);
            }

            #else
            int size = Marshal.SizeOf(b);
            IntPtr ptr = Marshal.AllocHGlobal(size);
            Marshal.StructureToPtr(b, ptr, false);
            byte[] bytes = new byte[size];
            Marshal.Copy(ptr, bytes, 0, size);
            #endif
            char[] ch = new char[bytes.Length];
            for (int i = 0; i < bytes.Length; i++)
                ch[i] = (char)bytes[i];
            CharPtr str = ch;
            DumpBlock(str, (uint)str.chars.Length, D);

            #if !SILVERLIGHT
            Marshal.Release(ptr);
            #endif
        }
开发者ID:WondermSwift,项目名称:KopiLua,代码行数:66,代码来源:ldump.cs


示例13: DumpVar

 public static void DumpVar(object x, DumpState D)
 {
     DumpMem(x, D);
 }
开发者ID:prabirshrestha,项目名称:KopiLua,代码行数:4,代码来源:ldump.cs


示例14: WriteUOL

 private static void WriteUOL(WZUOLProperty node, DumpState ds, BinaryWriter bw) {
     ds.AddNode(node);
     bw.Write(ds.AddString(node.Name));
     ds.AddUOL(node, bw.BaseStream.Position);
     bw.Write(0L);
     bw.Write(0L);
 }
开发者ID:mspencer92,项目名称:ms-wz2nx,代码行数:7,代码来源:Program.cs


示例15: DumpCode

 private static void DumpCode(Proto f, DumpState D)
 {
     DumpInt(f.sizecode, D);
     for (int i = 0; i < f.sizecode; i++)
         DumpInt((int)f.code[i], D);
 }
开发者ID:chenzuo,项目名称:SharpLua,代码行数:6,代码来源:ldump.cs


示例16: DumpNumber

 private static void DumpNumber(lua_Number x, DumpState D)
 {
     DumpMem(BitConverter.GetBytes(x), D);
 }
开发者ID:chenzuo,项目名称:SharpLua,代码行数:4,代码来源:ldump.cs


示例17: DumpInt

 private static void DumpInt(int x, DumpState D)
 {
     byte[] b = BitConverter.GetBytes((UInt32) x);
     if (!BitConverter.IsLittleEndian)
         Array.Reverse(b);
     DumpMem(b, D);
 }
开发者ID:chenzuo,项目名称:SharpLua,代码行数:7,代码来源:ldump.cs


示例18: DumpByte

 private static void DumpByte(int y, DumpState D)
 {
     byte[] x = new byte[1];
     x[0] = (byte)y;
     DumpMem(x, D);
 }
开发者ID:chenzuo,项目名称:SharpLua,代码行数:6,代码来源:ldump.cs


示例19: WriteNodeLevel

 private static void WriteNodeLevel(ref List<WZObject> nodeLevel, DumpState ds, BinaryWriter bw) {
     uint nextChildId = (uint) (ds.GetNextNodeID() + nodeLevel.Count);
     foreach (WZObject levelNode in nodeLevel) {
         if (levelNode is WZUOLProperty)
             WriteUOL((WZUOLProperty) levelNode, ds, bw);
         else
             WriteNode(levelNode, ds, bw, nextChildId);
         nextChildId += (uint) levelNode.ChildCount;
     }
     List<WZObject> @out = new List<WZObject>();
     foreach (WZObject levelNode in nodeLevel.Where(n => n.ChildCount > 0))
         @out.AddRange(levelNode.OrderBy(f => f.Name, StringComparer.Ordinal));
     nodeLevel.Clear();
     nodeLevel = @out;
 }
开发者ID:mspencer92,项目名称:ms-wz2nx,代码行数:15,代码来源:Program.cs


示例20: DumpCode

 private static void DumpCode(Proto f,DumpState D)
 {
     DumpVector(f.code, f.sizecode, D);
 }
开发者ID:prabirshrestha,项目名称:KopiLua,代码行数:4,代码来源:ldump.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Dungeon类代码示例发布时间:2022-05-24
下一篇:
C# DummyClass类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap