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


C# Serialiser.Deserialise方法代码示例

本文整理汇总了C#中Tools.Serialiser.Deserialise方法的典型用法代码示例。如果您正苦于以下问题:C# Serialiser.Deserialise方法的具体用法?C# Serialiser.Deserialise怎么用?C# Serialiser.Deserialise使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Tools.Serialiser的用法示例。


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

示例1: Serialise

		public static object Serialise(object o,Serialiser s)
		{
			if (s==null)
				return new TokClassDef();
			TokClassDef t = (TokClassDef)o;
			if (s.Encode) 
			{
				s.Serialise(t.m_name);
				s.Serialise(t.m_yynum);
				return null;
			}
			t.m_name = (string)s.Deserialise();
			t.m_yynum = (int)s.Deserialise();
			return t;
		}
开发者ID:Belxjander,项目名称:Asuna,代码行数:15,代码来源:dfa.cs

示例2: Serialise

 /// <exclude/>
 public static object Serialise(object o,Serialiser s)
 {
     if (s==null)
         return new Dfa();
     Dfa d = (Dfa)o;
     if (s.Encode)
     {
         s.Serialise(d.m_state);
         s.Serialise(d.m_map);
         s.Serialise(d.m_actions);
         s.Serialise(d.m_tokClass);
         s.Serialise(d.m_reswds);
         return null;
     }
     d.m_state = (int)s.Deserialise();
     d.m_map = (Hashtable)s.Deserialise();
     d.m_actions = (Action)s.Deserialise();
     d.m_tokClass = (string)s.Deserialise();
     d.m_reswds = (int)s.Deserialise();
     return d;
 }
开发者ID:hdinh,项目名称:OmahaBot,代码行数:22,代码来源:dfa.cs

示例3: GetDfa

		// Deserializing 
		public void GetDfa() 
		{
			if (tokens.Count>0)
				return;
			Serialiser f = new Serialiser(arr);
			f.VersionCheck();
			m_encoding = (Encoding)f.Deserialise();
			toupper = (bool)f.Deserialise();
			cats = (Hashtable)f.Deserialise();
			m_gencat = (UnicodeCategory)f.Deserialise();
			usingEOF = (bool)f.Deserialise();
			starts = (Hashtable)f.Deserialise();
			Dfa.SetTokens(this,starts);
			tokens = (Hashtable)f.Deserialise();
			reswds = (Hashtable)f.Deserialise();
		}
开发者ID:Belxjander,项目名称:Asuna,代码行数:17,代码来源:lexer.cs

示例4: Serialise

		public static object Serialise(object o, Serialiser s)
		{
			if (s==null)
				return new ParseState();
			ParseState p = (ParseState)o;
			if (s.Encode)
			{
				s.Serialise(p.m_state);
				s.Serialise(p.m_accessingSymbol);
				s.Serialise(p.m_changed);
				return true;
			}
			p.m_state = (int)s.Deserialise();
			p.m_accessingSymbol = (CSymbol)s.Deserialise();
			p.m_changed = (bool)s.Deserialise();
			return p;
		}
开发者ID:Belxjander,项目名称:Asuna,代码行数:17,代码来源:parser.cs

示例5: EncodingSerialise

        static object EncodingSerialise(object o, Serialiser s)
        {
            if (s.Encode)
            {
                Encoding e = (Encoding)o;
                s.Serialise(e.WebName);
                return null;
            }
            string str = (string)s.Deserialise();
            switch (str)
            {
                case "us-ascii": return Encoding.ASCII;
                case "utf-16": return Encoding.Unicode;
                case "utf-7": return Encoding.UTF7;
                case "utf-8": return Encoding.UTF8;

                default:
                    try
                    {
                        return Encoding.GetEncoding(str); // 4.7f
                    }
                    catch (Exception)
                    {
                        throw new Exception("Unknown encoding");
                    }
            }
        }
开发者ID:Belxjander,项目名称:Asuna,代码行数:27,代码来源:serialise.cs

示例6: Serialise

 /// <exclude/>
 public static object Serialise(object o,Serialiser s)
 {
     if (s==null)
         return new Charset();
     Charset c = (Charset)o;
     if (s.Encode)
     {
         s.Serialise((int)c.m_cat);
         s.Serialise(c.m_generic);
         s.Serialise(c.m_chars);
         return null;
     }
     c.m_cat = (UnicodeCategory)s.Deserialise();
     c.m_generic = (char)s.Deserialise();
     c.m_chars = (Hashtable)s.Deserialise();
     return c;
 }
开发者ID:Ezakhiel,项目名称:Donate-Money-For-Unicorns-ubbse2015,代码行数:18,代码来源:lexer.cs

示例7: HashtableSerialise

 static object HashtableSerialise(object o,Serialiser s)
 {
     if (s==null)
         return new Hashtable();
     Hashtable h = (Hashtable)o;
     if (s.Encode)
     {
         s._Write(h.Count);
         foreach (DictionaryEntry d in h)
         {
             s.Serialise(d.Key);
             s.Serialise(d.Value);
         }
         return null;
     }
     int ct = s._Read();
     for (int j=0;j<ct;j++)
     {
         object k = s.Deserialise();
         object v = s.Deserialise();
         h[k] = v;
     }
     return h;
 }
开发者ID:montyaahad,项目名称:PokerBot,代码行数:24,代码来源:serialise.cs

示例8: EncodingSerialise

 static object EncodingSerialise(object o,Serialiser s)
 {
     if (s.Encode)
     {
         Encoding e = (Encoding)o;
         s.Serialise(e.WebName);
         return null;
     }
     switch((string)s.Deserialise())
     {
         case "us-ascii": return Encoding.ASCII;
         case "utf-16": return Encoding.Unicode;
         case "utf-7": return Encoding.UTF7;
         case "utf-8": return Encoding.UTF8;
     }
     throw new Exception("Unknown encoding");
 }
开发者ID:montyaahad,项目名称:PokerBot,代码行数:17,代码来源:serialise.cs

示例9: GetParser

		public void GetParser(Lexer m_lexer)
		{
			Serialiser b = new Serialiser(arr);
			b.VersionCheck();
			m_startSymbol = (CSymbol)b.Deserialise();
			m_startSymbol.kids = new ObjectList(); // 4.2a
			m_accept = (ParseState)b.Deserialise();
			m_states = (Hashtable)b.Deserialise();
			literals = (Hashtable)b.Deserialise();
			symbolInfo = (Hashtable)b.Deserialise();
			m_concrete = (bool)b.Deserialise();
			GetEOF(m_lexer);
		}
开发者ID:Belxjander,项目名称:Asuna,代码行数:13,代码来源:parser.cs


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