コード例 #1
0
 private void Write181_GeneralTab(string n, string ns, GeneralTab o, bool isNullable, bool needType)
 {
     if (o == null)
     {
         if (isNullable)
         {
             base.WriteNullTagLiteral(n, ns);
         }
     }
     else
     {
         if (!needType)
         {
             System.Type type = o.GetType();
             if (type != typeof(GeneralTab))
             {
                 if (type != typeof(TwoPanelTab))
                 {
                     throw base.CreateUnknownTypeException(o);
                 }
                 this.Write182_TwoPanelTab(n, ns, (TwoPanelTab) o, isNullable, true);
                 return;
             }
         }
         base.WriteStartElement(n, ns, o, false, null);
         if (needType)
         {
             base.WriteXsiType("GeneralTab", "");
         }
         base.WriteElementString("Caption", "", o.Caption);
         base.WriteElementString("Hotkey", "", o.SerializableHotkey);
         base.WriteEndElement(o);
     }
 }
コード例 #2
0
 public static void SerializeBookmark(XmlWriter writer, GeneralTab tabBookmark)
 {
     if (tabBookmark == null)
     {
         throw new ArgumentNullException("tabBookmark");
     }
     if (!(tabBookmark is TwoPanelTab))
     {
         throw new ArgumentException();
     }
     Serializer.Value.Serialize(writer, tabBookmark);
 }
コード例 #3
0
 private GeneralTab Read181_GeneralTab(bool isNullable, bool checkType)
 {
     XmlQualifiedName type = checkType ? base.GetXsiType() : null;
     bool flag = false;
     if (isNullable)
     {
         flag = base.ReadNull();
     }
     if ((checkType && (type != null)) && ((type.Name != this.id137_GeneralTab) || (type.Namespace != this.id2_Item)))
     {
         if ((type.Name != this.id138_TwoPanelTab) || (type.Namespace != this.id2_Item))
         {
             throw base.CreateUnknownTypeException(type);
         }
         return this.Read182_TwoPanelTab(isNullable, false);
     }
     if (flag)
     {
         return null;
     }
     GeneralTab o = new GeneralTab();
     bool[] flagArray = new bool[2];
     while (base.Reader.MoveToNextAttribute())
     {
         if (!base.IsXmlnsAttribute(base.Reader.Name))
         {
             base.UnknownNode(o);
         }
     }
     base.Reader.MoveToElement();
     if (base.Reader.IsEmptyElement)
     {
         base.Reader.Skip();
         return o;
     }
     base.Reader.ReadStartElement();
     base.Reader.MoveToContent();
     int whileIterations = 0;
     int readerCount = base.ReaderCount;
     while ((base.Reader.NodeType != XmlNodeType.EndElement) && (base.Reader.NodeType != XmlNodeType.None))
     {
         if (base.Reader.NodeType == XmlNodeType.Element)
         {
             if ((!flagArray[0] && (base.Reader.LocalName == this.id171_Caption)) && (base.Reader.NamespaceURI == this.id2_Item))
             {
                 o.Caption = base.Reader.ReadElementString();
                 flagArray[0] = true;
             }
             else if ((!flagArray[1] && (base.Reader.LocalName == this.id172_Hotkey)) && (base.Reader.NamespaceURI == this.id2_Item))
             {
                 o.SerializableHotkey = base.Reader.ReadElementString();
                 flagArray[1] = true;
             }
             else
             {
                 base.UnknownNode(o, ":Caption, :Hotkey");
             }
         }
         else
         {
             base.UnknownNode(o, ":Caption, :Hotkey");
         }
         base.Reader.MoveToContent();
         base.CheckReaderCount(ref whileIterations, ref readerCount);
     }
     base.ReadEndElement();
     return o;
 }