コード例 #1
0
 private void Write25_TwoPanelLayout(string n, string ns, TwoPanelLayout o, bool isNullable, bool needType)
 {
     if (o == null)
     {
         if (isNullable)
         {
             base.WriteNullTagLiteral(n, ns);
         }
     }
     else
     {
         if (!needType && (o.GetType() != typeof(TwoPanelLayout)))
         {
             throw base.CreateUnknownTypeException(o);
         }
         base.WriteStartElement(n, ns, o, false, null);
         if (needType)
         {
             base.WriteXsiType("TwoPanelLayout", "");
         }
         base.WriteAttribute("name", "", o.Name);
         if (o.OnePanel)
         {
             base.WriteElementStringRaw("OnePanel", "", XmlConvert.ToString(o.OnePanel));
         }
         if (o.PanelsOrientation != Orientation.Vertical)
         {
             base.WriteElementString("PanelsOrientation", "", this.Write20_Orientation(o.PanelsOrientation));
         }
         if (o.SplitterPercent != 500)
         {
             base.WriteElementStringRaw("SplitterPercent", "", XmlConvert.ToString(o.SplitterPercent));
         }
         if (o.ActivePanel != ActivePanel.Unchanged)
         {
             base.WriteElementString("ActivePanel", "", this.Write23_ActivePanel(o.ActivePanel));
         }
         base.WriteElementString("StoreEntry", "", this.Write24_TwoPanelLayoutEntry(o.StoreEntry));
         this.Write22_PanelLayout("LeftLayout", "", o.LeftLayout, false, false);
         this.Write22_PanelLayout("RightLayout", "", o.RightLayout, false, false);
         base.WriteEndElement(o);
     }
 }
コード例 #2
0
 public TwoPanelLayout GetTwoPanelLayout(bool useRemembered, bool storeActivePanel)
 {
     TwoPanelLayout layout;
     layout = new TwoPanelLayout {
         OnePanel = this.OnePanelMode != SinglePanel.None,
         StoreEntry = layout.StoreEntry | TwoPanelLayoutEntry.OnePanel
     };
     if (layout.OnePanel)
     {
         layout.LeftLayout = this.CurrentPanel.GetPanelLayout(useRemembered, PanelLayoutEntry.None);
         layout.StoreEntry |= TwoPanelLayoutEntry.LeftLayout;
         return layout;
     }
     layout.PanelsOrientation = this.Orientation;
     layout.SplitterPercent = this.SplitterPercent;
     layout.LeftLayout = this.LeftPanel.GetPanelLayout(useRemembered, PanelLayoutEntry.None);
     layout.RightLayout = this.RightPanel.GetPanelLayout(useRemembered, PanelLayoutEntry.None);
     if (storeActivePanel)
     {
         if (this.CurrentPanel == this.LeftPanel)
         {
             layout.ActivePanel = ActivePanel.Left;
         }
         else if (this.CurrentPanel == this.RightPanel)
         {
             layout.ActivePanel = ActivePanel.Right;
         }
         else
         {
             layout.ActivePanel = ActivePanel.Unchanged;
         }
         layout.StoreEntry |= TwoPanelLayoutEntry.ActivePanel;
     }
     layout.StoreEntry |= TwoPanelLayoutEntry.RightLayout | TwoPanelLayoutEntry.LeftLayout | TwoPanelLayoutEntry.PanelsOrientation;
     return layout;
 }
コード例 #3
0
 private TwoPanelLayout Read25_TwoPanelLayout(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.id18_TwoPanelLayout) || (type.Namespace != this.id2_Item)))
     {
         throw base.CreateUnknownTypeException(type);
     }
     if (flag)
     {
         return null;
     }
     TwoPanelLayout o = new TwoPanelLayout();
     bool[] flagArray = new bool[8];
     while (base.Reader.MoveToNextAttribute())
     {
         if ((!flagArray[0] && (base.Reader.LocalName == this.id232_name)) && (base.Reader.NamespaceURI == this.id2_Item))
         {
             o.Name = base.Reader.Value;
             flagArray[0] = true;
         }
         else if (!base.IsXmlnsAttribute(base.Reader.Name))
         {
             base.UnknownNode(o, ":name");
         }
     }
     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[1] && (base.Reader.LocalName == this.id233_OnePanel)) && (base.Reader.NamespaceURI == this.id2_Item))
             {
                 if (base.Reader.IsEmptyElement)
                 {
                     base.Reader.Skip();
                 }
                 else
                 {
                     o.OnePanel = XmlConvert.ToBoolean(base.Reader.ReadElementString());
                 }
                 flagArray[1] = true;
             }
             else if ((!flagArray[2] && (base.Reader.LocalName == this.id234_PanelsOrientation)) && (base.Reader.NamespaceURI == this.id2_Item))
             {
                 if (base.Reader.IsEmptyElement)
                 {
                     base.Reader.Skip();
                 }
                 else
                 {
                     o.PanelsOrientation = this.Read20_Orientation(base.Reader.ReadElementString());
                 }
                 flagArray[2] = true;
             }
             else if ((!flagArray[3] && (base.Reader.LocalName == this.id235_SplitterPercent)) && (base.Reader.NamespaceURI == this.id2_Item))
             {
                 if (base.Reader.IsEmptyElement)
                 {
                     base.Reader.Skip();
                 }
                 else
                 {
                     o.SplitterPercent = XmlConvert.ToInt32(base.Reader.ReadElementString());
                 }
                 flagArray[3] = true;
             }
             else if ((!flagArray[4] && (base.Reader.LocalName == this.id16_ActivePanel)) && (base.Reader.NamespaceURI == this.id2_Item))
             {
                 if (base.Reader.IsEmptyElement)
                 {
                     base.Reader.Skip();
                 }
                 else
                 {
                     o.ActivePanel = this.Read23_ActivePanel(base.Reader.ReadElementString());
                 }
                 flagArray[4] = true;
             }
             else if ((!flagArray[5] && (base.Reader.LocalName == this.id236_StoreEntry)) && (base.Reader.NamespaceURI == this.id2_Item))
             {
                 o.StoreEntry = this.Read24_TwoPanelLayoutEntry(base.Reader.ReadElementString());
                 flagArray[5] = true;
             }
             else if ((!flagArray[6] && (base.Reader.LocalName == this.id237_LeftLayout)) && (base.Reader.NamespaceURI == this.id2_Item))
             {
                 o.LeftLayout = this.Read22_PanelLayout(false, true);
                 flagArray[6] = true;
             }
             else if ((!flagArray[7] && (base.Reader.LocalName == this.id238_RightLayout)) && (base.Reader.NamespaceURI == this.id2_Item))
             {
                 o.RightLayout = this.Read22_PanelLayout(false, true);
                 flagArray[7] = true;
             }
             else
             {
                 base.UnknownNode(o, ":OnePanel, :PanelsOrientation, :SplitterPercent, :ActivePanel, :StoreEntry, :LeftLayout, :RightLayout");
             }
         }
         else
         {
             base.UnknownNode(o, ":OnePanel, :PanelsOrientation, :SplitterPercent, :ActivePanel, :StoreEntry, :LeftLayout, :RightLayout");
         }
         base.Reader.MoveToContent();
         base.CheckReaderCount(ref whileIterations, ref readerCount);
     }
     base.ReadEndElement();
     return o;
 }