Exemple #1
0
 private void FlushPreamble()
 {
     if (this.otherNodes != null)
     {
         base.CurrentWriter = base.Writer.innerWriter;
         string classNamespace = null;
         if (this.defaultValueNodes != null)
         {
             classNamespace = this.xClassNamespace;
         }
         this.rootNode.FlushPendingNodes(classNamespace);
         this.rootNode = null;
         base.CurrentWriter.WriteStartObject(base.Writer.activityXamlType);
         if (this.xClassNodes == null)
         {
             this.SetXClass(null, null);
         }
         XamlServices.Transform(this.xClassNodes.Reader, base.CurrentWriter, false);
         XamlNodeQueue queue = null;
         if (this.defaultValueNodes != null)
         {
             foreach (KeyValuePair <string, XamlNodeQueue> pair in this.defaultValueNodes)
             {
                 XamlReader reader = pair.Value.Reader;
                 if (reader.Read())
                 {
                     bool flag = false;
                     if ((reader.NodeType == XamlNodeType.Value) && (reader.Value is string))
                     {
                         flag = true;
                     }
                     if (flag)
                     {
                         base.CurrentWriter.WriteStartMember(new XamlMember(pair.Key, this.xClassXamlType, true));
                         base.CurrentWriter.WriteNode(reader);
                         XamlServices.Transform(pair.Value.Reader, base.CurrentWriter, false);
                     }
                     else
                     {
                         if (queue == null)
                         {
                             queue = new XamlNodeQueue(base.Writer.SchemaContext);
                         }
                         queue.Writer.WriteStartMember(new XamlMember(pair.Key, this.xClassXamlType, true));
                         queue.Writer.WriteNode(reader);
                         XamlServices.Transform(pair.Value.Reader, queue.Writer, false);
                     }
                 }
             }
         }
         if (this.xClassAttributeNodes != null)
         {
             XamlServices.Transform(this.xClassAttributeNodes.Reader, base.CurrentWriter, false);
         }
         if (this.xPropertiesNodes != null)
         {
             XamlServices.Transform(this.xPropertiesNodes.Reader, base.CurrentWriter, false);
         }
         if (queue != null)
         {
             XamlServices.Transform(queue.Reader, base.CurrentWriter, false);
         }
         if (this.otherNodes.Count > 0)
         {
             XamlServices.Transform(this.otherNodes.Reader, base.CurrentWriter, false);
         }
         this.otherNodes = null;
     }
 }
 private void FlushPreamble()
 {
     if (this.otherNodes != null)
     {
         base.CurrentWriter = base.Writer.innerWriter;
         string classNamespace = null;
         if (this.defaultValueNodes != null)
         {
             classNamespace = this.xClassNamespace;
         }
         this.rootNode.FlushPendingNodes(classNamespace);
         this.rootNode = null;
         base.CurrentWriter.WriteStartObject(base.Writer.activityXamlType);
         if (this.xClassNodes == null)
         {
             this.SetXClass(null, null);
         }
         XamlServices.Transform(this.xClassNodes.Reader, base.CurrentWriter, false);
         XamlNodeQueue queue = null;
         if (this.defaultValueNodes != null)
         {
             foreach (KeyValuePair<string, XamlNodeQueue> pair in this.defaultValueNodes)
             {
                 XamlReader reader = pair.Value.Reader;
                 if (reader.Read())
                 {
                     bool flag = false;
                     if ((reader.NodeType == XamlNodeType.Value) && (reader.Value is string))
                     {
                         flag = true;
                     }
                     if (flag)
                     {
                         base.CurrentWriter.WriteStartMember(new XamlMember(pair.Key, this.xClassXamlType, true));
                         base.CurrentWriter.WriteNode(reader);
                         XamlServices.Transform(pair.Value.Reader, base.CurrentWriter, false);
                     }
                     else
                     {
                         if (queue == null)
                         {
                             queue = new XamlNodeQueue(base.Writer.SchemaContext);
                         }
                         queue.Writer.WriteStartMember(new XamlMember(pair.Key, this.xClassXamlType, true));
                         queue.Writer.WriteNode(reader);
                         XamlServices.Transform(pair.Value.Reader, queue.Writer, false);
                     }
                 }
             }
         }
         if (this.xClassAttributeNodes != null)
         {
             XamlServices.Transform(this.xClassAttributeNodes.Reader, base.CurrentWriter, false);
         }
         if (this.xPropertiesNodes != null)
         {
             XamlServices.Transform(this.xPropertiesNodes.Reader, base.CurrentWriter, false);
         }
         if (queue != null)
         {
             XamlServices.Transform(queue.Reader, base.CurrentWriter, false);
         }
         if (this.otherNodes.Count > 0)
         {
             XamlServices.Transform(this.otherNodes.Reader, base.CurrentWriter, false);
         }
         this.otherNodes = null;
     }
 }
Exemple #3
0
 public BuilderClassNode(ActivityBuilderXamlWriter.RootNode rootNode, ActivityBuilderXamlWriter writer) : base(writer)
 {
     this.rootNode      = rootNode;
     this.otherNodes    = new XamlNodeQueue(writer.SchemaContext);
     base.CurrentWriter = this.otherNodes.Writer;
 }
 public BuilderClassNode(ActivityBuilderXamlWriter.RootNode rootNode, ActivityBuilderXamlWriter writer) : base(writer)
 {
     this.rootNode = rootNode;
     this.otherNodes = new XamlNodeQueue(writer.SchemaContext);
     base.CurrentWriter = this.otherNodes.Writer;
 }