Пример #1
0
 public void Save(ICompilateur comp, System.Xml.XmlWriter writer, ref System.Windows.Forms.HtmlElement child)
 {
     writer.WriteStartElement("label");
     if (this.indent > 0)
     {
         writer.WriteAttributeString("indent", this.indent.ToString());
     }
     writer.WriteString(this.name);
     writer.WriteEndElement();
     child = child.NextSibling;
 }
Пример #2
0
 public void WriteXml(System.Xml.XmlWriter writer)
 {
     foreach (TKey key in Keys)
     {
         writer.WriteStartElement(item_tag);
         writer.WriteStartElement(key_tag);
         keySerializer.Serialize(writer, key);
         writer.WriteEndElement();
         writer.WriteStartElement(valueType_tag);
         TValue value = this[key];
         string type  = value.GetType().AssemblyQualifiedName;
         stringSerializer.Serialize(writer, type);
         writer.WriteEndElement();
         writer.WriteStartElement(value_tag);
         XmlSerializer valueSerializer = new XmlSerializer(value.GetType());
         valueSerializer.Serialize(writer, value);
         writer.WriteEndElement();
         writer.WriteEndElement();
     }
 }
Пример #3
0
 public override void WriteXml(System.Xml.XmlWriter w)
 {
     w.WriteStartElement(RootElement.Prefix, RootElement.LocalName, RootElement.NameSpace);
     w.WriteAttributeString("versione", FatturaElettronicaHeader.DatiTrasmissione.FormatoTrasmissione);
     foreach (var a in RootElement.ExtraAttributes)
     {
         w.WriteAttributeString(a.Prefix, a.LocalName, a.ns, a.value);
     }
     base.WriteXml(w);
     w.WriteEndElement();
 }
Пример #4
0
 public override void WriteXml(System.Xml.XmlWriter writer)
 {
     writer.WriteStartElement("TextCell");
     base.WriteXml(writer);
     writer.WriteElementString("Text", mText);
     writer.WriteElementString("Orientation", mOrientation.ToString(System.Globalization.CultureInfo.InvariantCulture));
     XmlReadWrite.writeColor(writer, "FontColor", FontColor);
     XmlReadWrite.writeFont(writer, "Font", mTextFont);
     writer.WriteElementString("TextAlignment", TextAlignment.ToString());
     writer.WriteEndElement();                 // end of TextCell
 }
Пример #5
0
        public void WriteXml(System.Xml.XmlWriter writer)
        {
            XmlSerializer keySerializer   = new XmlSerializer(typeof(TKey));
            XmlSerializer valueSerializer = new XmlSerializer(typeof(TValue));

            foreach (var pair in this)
            {
                writer.WriteStartElement("item");

                writer.WriteStartElement("key");
                keySerializer.Serialize(writer, pair.Key);
                writer.WriteEndElement();

                writer.WriteStartElement("value");
                valueSerializer.Serialize(writer, pair.Value);
                writer.WriteEndElement();

                writer.WriteEndElement();
            }
        }
Пример #6
0
        protected override void WriteXmlBase(System.Xml.XmlWriter writer)
        {
            base.WriteXmlBase(writer);

            string prefix    = RmXmlSerializer.UseOpenEhrPrefix(writer);
            string xsiPrefix = RmXmlSerializer.UseXsiPrefix(writer);

            writer.WriteStartElement(prefix, "relationship", RmXmlSerializer.OpenEhrNamespace);
            this.Relationship.WriteXml(writer);
            writer.WriteEndElement();
        }
 public override void OnSaveAsset(System.Xml.XmlWriter writer)
 {
     base.OnSaveAsset(writer);
     foreach (var effect in Effects)
     {
         writer.WriteStartElement("Effect");
         writer.SetAttr("AssetType", effect.GetType().Name);
         effect.OnSaveAsset(writer);
         writer.WriteEndElement();
     }
 }
Пример #8
0
 public void WriteXml(System.Xml.XmlWriter writer)
 {
     foreach (var config in this)
     {
         writer.WriteStartElement("Overlay");
         writer.WriteAttributeString("Type", config.GetType().FullName);
         var serializer = new XmlSerializer(config.GetType());
         serializer.Serialize(writer, config);
         writer.WriteEndElement();
     }
 }
Пример #9
0
 void IXmlSerializable.WriteXml(System.Xml.XmlWriter a)
 {
     a.WriteElementString("DefaultValueGroupId", DefaultValueGroupId.ToString());
     a.WriteElementString("FullName", FullName);
     a.WriteElementString("GroupRoleId", GroupRoleId.ToString());
     a.WriteStartElement("IsAnonymous");
     a.WriteValue(IsAnonymous);
     a.WriteEndElement();
     a.WriteElementString("SearchMode", SearchMode.ToString());
     a.WriteDateTimeOffset(LastActivityDate, "LastActivityDate");
     a.WriteDateTimeOffset(LastUpdatedDate, "LastUpdatedDate");
     a.WriteElementString("ProfileId", ProfileId.ToString());
     a.WriteStartElement("Properties");
     if (Properties != null)
     {
         var b = new XmlSerializer(typeof(ProfileProperty), new XmlRootAttribute("ProfileProperty"));
         foreach (IXmlSerializable i in Properties)
         {
             b.Serialize(a, i);
         }
     }
     a.WriteEndElement();
     a.WriteStartElement("RoleSet");
     if (RoleSet != null)
     {
         ((IXmlSerializable)RoleSet).WriteXml(a);
     }
     a.WriteEndElement();
     a.WriteStartElement("Source");
     if (Source != null)
     {
         ((IXmlSerializable)Source).WriteXml(a);
     }
     a.WriteEndElement();
     a.WriteElementString("SourceId", SourceId.ToString());
     a.WriteElementString("UserId", UserId.ToString());
     a.WriteElementString("UserName", UserName);
     a.WriteStartElement("MarkGroupId");
     if (MarkGroupId.HasValue)
     {
         a.WriteValue(MarkGroupId.Value);
     }
     a.WriteEndElement();
     a.WriteStartElement("SellerTreeId");
     if (SellerTreeId.HasValue)
     {
         a.WriteValue(SellerTreeId.Value);
     }
     a.WriteEndElement();
     a.WriteStartElement("IntermediateId");
     if (IntermediateId.HasValue)
     {
         a.WriteValue(IntermediateId.Value);
     }
     a.WriteEndElement();
 }
Пример #10
0
        public void WriteXml(System.Xml.XmlWriter writer, string parentStreamIdentifier)
        {
            if (StreamType.Heat == m_type)
            {
                writer.WriteStartElement("HeatStreamPropertiesWindow");
            }
            else
            {
                writer.WriteStartElement("ChemicalStreamPropertiesWindow");
            }

            // Write the parent stream ID
            writer.WriteElementString("ParentStream", parentStreamIdentifier);

            // Write the data rows
            writer.WriteStartElement("DataRows");
            foreach (IStreamDataRow row in Rows)
            {
                row.WriteXml(writer);
            }
            writer.WriteEndElement();

            // Write the location
            writer.WriteStartElement("Location");
            writer.WriteElementString("X", m_location.X.ToString());
            writer.WriteElementString("Y", m_location.Y.ToString());
            writer.WriteEndElement();

            if (StreamType.Chemical == m_type)
            {
                // Write temperature stuff
                writer.WriteStartElement("Temperature");
                writer.WriteElementString("Quantity", m_temperature);
                writer.WriteElementString("Units", m_temperatureUnits.ToString());
                writer.WriteElementString("UserHasChangedTemperature",
                                          m_userHasChangedTemperature.ToString());
                writer.WriteEndElement();
            }

            writer.WriteEndElement();
        }
Пример #11
0
        public static void _QueryTableCallback(Object obj,
                                               out SqlString PartitionKey,
                                               out SqlString RowKey,
                                               out SqlDateTime TimeStamp,
                                               out SqlXml Attributes)
        {
            if (!(obj is ITPCfSQL.Azure.TableEntity))
            {
                throw new ArgumentException("Expected " + typeof(ITPCfSQL.Azure.TableEntity).ToString() + ", received " + obj.GetType().ToString());
            }

            ITPCfSQL.Azure.TableEntity entity = (ITPCfSQL.Azure.TableEntity)obj;

            PartitionKey = entity.PartitionKey;
            RowKey       = entity.RowKey;
            TimeStamp    = entity.TimeStamp;

            using (System.IO.MemoryStream ms = new System.IO.MemoryStream())
            {
                using (System.Xml.XmlWriter wr = System.Xml.XmlWriter.Create(ms))
                {
                    wr.WriteStartElement("AttributeList");

                    foreach (KeyValuePair <string, string> kvp in entity.Attributes)
                    {
                        wr.WriteStartElement(kvp.Key);
                        wr.WriteString(kvp.Value);
                        wr.WriteEndElement();
                    }

                    wr.WriteEndElement();
                }

                ms.Seek(0, System.IO.SeekOrigin.Begin);

                using (System.Xml.XmlReader r = System.Xml.XmlReader.Create(ms))
                {
                    Attributes = new SqlXml(r);
                }
            }
        }
Пример #12
0
        public bool WriteRequiredReleasNotes(bool?releaseNoteRequired, string fileName)
        {
            var assets = LinqReleaseNotes.GetAssetsWithReleaseNoteRequired(
                Dictionary.RefinedDictionary, releaseNoteRequired);

            IEnumerable <CReleaseNoteAsset> cReleaseNoteAssets =
                assets as CReleaseNoteAsset[] ?? assets.ToArray();

            if (!UtilityFunctions.IsAny(cReleaseNoteAssets))
            {
                NoAssetsAvailableToPrint(fileName);
                return(false);
            }

            using (System.Xml.XmlWriter writer = System.Xml.XmlWriter.Create(fileName + ".xml"))
            {
                writer.WriteStartDocument();
                writer.WriteStartElement("AllReleaseNotes");

                foreach (CReleaseNoteAsset cReleaseNoteAsset in cReleaseNoteAssets)
                {
                    writer.WriteStartElement("ReleaseNote");
                    writer.WriteElementString("ID", cReleaseNoteAsset.Id.ToString());
                    writer.WriteElementString("Name", cReleaseNoteAsset.Name.ToString());
                    writer.WriteElementString("URL", cReleaseNoteAsset.URL.ToString());
                    writer.WriteElementString("ReleaseNoteRequired", cReleaseNoteAsset.ReleaseNoteRequired.ToString());

                    writer.WriteStartElement("Categories");

                    foreach (int i in Dictionary.RefinedDictionary[cReleaseNoteAsset].Keys)
                    {
                        writer.WriteElementString("Category", Dictionary.RefinedDictionary[cReleaseNoteAsset][i]);
                    }
                    writer.WriteEndElement();
                    writer.WriteEndElement();
                }
                writer.WriteEndElement();
                writer.WriteEndDocument();
            }
            return(true);
        }
Пример #13
0
        /// <summary>
        /// Writes a QuoteOption to XML format
        /// </summary>
        /// <param name="writer">The used XML writer</param>
        /// <param name="quoteOption">The used QuoteOption</param>
        /// <param name="culture">The used culture for formating dates and numbers. If parameter value is null/Nothing, default Culture will be used.</param>
        /// <remarks></remarks>
        public static void FromQuoteOption(System.Xml.XmlWriter writer, QuoteOptionsData quoteOption, System.Globalization.CultureInfo culture = null)
        {
            System.Globalization.CultureInfo ci = System.Globalization.CultureInfo.CurrentCulture;
            if (culture != null)
            {
                ci = culture;
            }
            writer.WriteStartElement("Option");

            writer.WriteAttributeString(FinanceHelper.NameOptionSymbol, quoteOption.Symbol);
            writer.WriteAttributeString(FinanceHelper.NameOptionType, (quoteOption.Type == QuoteOptionType.Call ? "C" : "P").ToString());

            writer.WriteStartElement(FinanceHelper.NameOptionLastPrice);
            writer.WriteValue(MyHelper.ObjectToString(quoteOption.LastPrice, ci));
            writer.WriteEndElement();

            writer.WriteStartElement(FinanceHelper.NameOptionStrikePrice);
            writer.WriteValue(MyHelper.ObjectToString(quoteOption.StrikePrice, ci));
            writer.WriteEndElement();

            writer.WriteStartElement(FinanceHelper.NameOptionChange);
            writer.WriteValue(MyHelper.ObjectToString(Math.Abs(quoteOption.Change), ci));
            writer.WriteEndElement();

            writer.WriteStartElement(FinanceHelper.NameOptionChangeDir);
            writer.WriteValue((quoteOption.Change >= 0 ? "Up" : "Down").ToString());
            writer.WriteEndElement();

            writer.WriteStartElement(FinanceHelper.NameOptionBid);
            writer.WriteValue(MyHelper.ObjectToString(quoteOption.Bid, ci));
            writer.WriteEndElement();

            writer.WriteStartElement(FinanceHelper.NameOptionAsk);
            writer.WriteValue(MyHelper.ObjectToString(quoteOption.Ask, ci));
            writer.WriteEndElement();

            writer.WriteStartElement(FinanceHelper.NameOptionVolume);
            writer.WriteValue(MyHelper.ObjectToString(quoteOption.Volume, ci));
            writer.WriteEndElement();

            writer.WriteStartElement(FinanceHelper.NameOptionOpenInterest);
            writer.WriteValue(MyHelper.ObjectToString(quoteOption.OpenInterest, ci));
            writer.WriteEndElement();

            writer.WriteEndElement();
        }
Пример #14
0
        internal void WriteXml(System.Xml.XmlWriter writer)
        {
            CheckInvariants();

            string xsiPrefix     = RmXmlSerializer.UseXsiPrefix(writer);
            string openEhrPrefix = RmXmlSerializer.UseOpenEhrPrefix(writer);

            writer.WriteStartElement(openEhrPrefix, "meaning", RmXmlSerializer.OpenEhrNamespace);
            if (this.Meaning.GetType() == typeof(OpenEhr.RM.DataTypes.Text.DvCodedText))
            {
                if (!string.IsNullOrEmpty(openEhrPrefix))
                {
                    writer.WriteAttributeString(xsiPrefix, "type", RmXmlSerializer.XsiNamespace, openEhrPrefix + ":DV_CODED_TEXT");
                }
                else
                {
                    writer.WriteAttributeString(xsiPrefix, "type", RmXmlSerializer.XsiNamespace, "DV_CODED_TEXT");
                }
            }
            this.Meaning.WriteXml(writer);
            writer.WriteEndElement();

            writer.WriteStartElement(openEhrPrefix, "type", RmXmlSerializer.OpenEhrNamespace);
            if (this.Type.GetType() == typeof(OpenEhr.RM.DataTypes.Text.DvCodedText))
            {
                if (!string.IsNullOrEmpty(openEhrPrefix))
                {
                    writer.WriteAttributeString(xsiPrefix, "type", RmXmlSerializer.XsiNamespace, openEhrPrefix + ":DV_CODED_TEXT");
                }
                else
                {
                    writer.WriteAttributeString(xsiPrefix, "type", RmXmlSerializer.XsiNamespace, "DV_CODED_TEXT");
                }
            }
            this.Type.WriteXml(writer);
            writer.WriteEndElement();

            writer.WriteStartElement(openEhrPrefix, "target", RmXmlSerializer.OpenEhrNamespace);
            this.Target.WriteXml(writer);
            writer.WriteEndElement();
        }
Пример #15
0
        public void WriteXml(System.Xml.XmlWriter writer)
        {
            XmlSerializer serializer;

            writer.WriteStartElement("type");
            writer.WriteValue((int)_type);
            writer.WriteEndElement();

            writer.WriteStartElement("value");

            switch (_type)
            {
            case VariantType.Int:
                writer.WriteValue(_valueInt);
                break;

            case VariantType.Long:
                writer.WriteValue(_valueLong);
                break;

            case VariantType.ULong:
                writer.WriteValue(_valueULong);
                break;

            case VariantType.String:
                writer.WriteValue(_valueString);
                break;

            case VariantType.ByteString:
                serializer = new XmlSerializer(typeof(byte[]));
                serializer.Serialize(writer, _valueByteArray);
                break;

            case VariantType.BitStream:
                serializer = new XmlSerializer(typeof(BitStream));
                serializer.Serialize(writer, _valueBitStream);
                break;
            }

            writer.WriteEndElement();
        }
Пример #16
0
        public void WriteXml(System.Xml.XmlWriter writer)
        {
            // Attributes
            if (this.Schema != default(string))
            {
                writer.WriteAttributeString(XmlAttribute_Schema, this.Schema);
            }
            if (this.Name != default(string))
            {
                writer.WriteAttributeString(XmlAttribute_Name, this.Name);
            }

            // Columns
            if (this.Columns != null)
            {
                writer.WriteStartElement(ColumnModelCollection.XmlElement_Tag);
                this.Columns.WriteXml(writer);
                writer.WriteEndElement();
            }
            // Identity
            if (this.Identity != null)
            {
                writer.WriteStartElement(IdentityModel.XmlElement_Tag);
                this.Identity.WriteXml(writer);
                writer.WriteEndElement();
            }
            // Constraints
            if (this.Constraints != null)
            {
                writer.WriteStartElement(ConstraintModelCollection.XmlElement_Tag);
                this.Constraints.WriteXml(writer);
                writer.WriteEndElement();
            }
            // Indexes
            if (this.Indexes != null)
            {
                writer.WriteStartElement(IndexModelCollection.XmlElement_Tag);
                this.Indexes.WriteXml(writer);
                writer.WriteEndElement();
            }
        }
Пример #17
0
        public void WriteXml(System.Xml.XmlWriter writer)
        {
            writer.WriteStartElement("Style");
            writer.WriteString(Style.ToString());
            writer.WriteEndElement();

            foreach (double key in this.Keys)
            {
                writer.WriteStartElement("Item");
                writer.WriteStartElement("Offset");
                writer.WriteValue(key);
                writer.WriteEndElement();

                writer.WriteStartElement("Color");
                Color value = this[key];
                writer.WriteString(value.ToArgb().ToString());
                writer.WriteEndElement();

                writer.WriteEndElement();
            }
        }
Пример #18
0
 public void ToXml(System.Xml.XmlWriter writer)
 {
     writer.WriteStartElement(this.TagName);
     if (this.Nodes.Count > 0)
     {
         foreach (IConditionItem item in this.Nodes)
         {
             item.ToXml(writer);
         }
     }
     writer.WriteEndElement();
 }
Пример #19
0
        /// <summary>
        /// Function to call when serializing this object to XML
        /// </summary>
        /// <param name="writer">The xml writer</param>
        public virtual void WriteXml(System.Xml.XmlWriter writer)
        {
            writer.WriteAttributeString("Rows", Rows.ToString());
            writer.WriteAttributeString("Cols", Cols.ToString());
            writer.WriteAttributeString("NumberOfChannels", NumberOfChannels.ToString());
            writer.WriteAttributeString("CompressionRatio", SerializationCompressionRatio.ToString());

            writer.WriteStartElement("Bytes");
            Byte[] bytes = Bytes;
            writer.WriteBase64(bytes, 0, bytes.Length);
            writer.WriteEndElement();
        }
Пример #20
0
        public void WriteXml(System.Xml.XmlWriter writer)
        {
            XmlSerializer keySerializer   = new XmlSerializer(typeof(TKey));
            XmlSerializer valueSerializer = new XmlSerializer(typeof(TValue));

            foreach (TKey key in from k in Keys orderby k select k)
            {
                writer.WriteStartElement("item");

                writer.WriteStartElement("key");
                keySerializer.Serialize(writer, key);
                writer.WriteEndElement();

                writer.WriteStartElement("value");
                TValue value = this[key];
                valueSerializer.Serialize(writer, value);
                writer.WriteEndElement();

                writer.WriteEndElement();
            }
        }
        public void WriteXml(System.Xml.XmlWriter writer)
        {
            XmlSerializer keySerializer   = ChoUtility.GetXmlSerializer(typeof(TKey));   // new XmlSerializer(typeof(TKey));
            XmlSerializer valueSerializer = ChoUtility.GetXmlSerializer(typeof(TValue)); //new XmlSerializer(typeof(TValue));

            foreach (TKey key in this.Keys)
            {
                writer.WriteStartElement("item");

                writer.WriteStartElement("key");
                keySerializer.Serialize(writer, key);
                writer.WriteEndElement();

                writer.WriteStartElement("value");
                TValue value = this[key];
                valueSerializer.Serialize(writer, value);
                writer.WriteEndElement();

                writer.WriteEndElement();
            }
        }
        public void WriteXml(System.Xml.XmlWriter writer)
        {
            var keySerializer   = new XmlSerializer(typeof(TKey));
            var valueSerializer = new XmlSerializer(typeof(TValue));

            foreach (var key in Keys)
            {
                writer.WriteStartElement("item");

                writer.WriteStartElement("key");
                keySerializer.Serialize(writer, key);
                writer.WriteEndElement();

                writer.WriteStartElement("value");
                TValue value = this[key];
                valueSerializer.Serialize(writer, value);
                writer.WriteEndElement();

                writer.WriteEndElement();
            }
        }
        public void WriteXml(System.Xml.XmlWriter writer)
        {
            XmlSerializer keySerializer   = new XmlSerializer(typeof(string));
            XmlSerializer valueSerializer = new XmlSerializer(typeof(Abstract.Component));

            foreach (Type key in this.Keys)
            {
                writer.WriteStartElement("item");

                writer.WriteStartElement("key");
                keySerializer.Serialize(writer, key.FullName);
                writer.WriteEndElement();

                writer.WriteStartElement("value");
                Abstract.Component value = this[key];
                valueSerializer.Serialize(writer, value);
                writer.WriteEndElement();

                writer.WriteEndElement();
            }
        }
Пример #24
0
 public void WriteXml(System.Xml.XmlWriter w, DateTime?Date)
 {
     w.WriteStartElement("Resources");
     if (Date.HasValue)
     {
         w.WriteAttributeString("Date", Date.Value.ToString(System.Globalization.CultureInfo.InvariantCulture));
     }
     w.WriteElementString("Wood", Wood.ToString());
     w.WriteElementString("Clay", Clay.ToString());
     w.WriteElementString("Iron", Iron.ToString());
     w.WriteEndElement();
 }
Пример #25
0
        public void WriteXml(System.Xml.XmlWriter writer)
        {
            XmlSerializer keySerializer   = new XmlSerializer(typeof(TKey));
            XmlSerializer valueSerializer = new XmlSerializer(typeof(TValue));

            foreach (TKey key in this.Keys)
            {
                writer.WriteStartElement("initializer");

                writer.WriteStartElement("word");
                keySerializer.Serialize(writer, key);
                writer.WriteEndElement();

                writer.WriteStartElement("count");
                TValue value = this[key];
                valueSerializer.Serialize(writer, value);
                writer.WriteEndElement();

                writer.WriteEndElement();
            }
        }
Пример #26
0
        /// <summary>
        /// Converts an object into its XML representation.
        /// </summary>
        /// <param name="writer">The <see cref="T:System.Xml.XmlWriter"/> stream to which the object is serialized.</param>
        public void WriteXml(System.Xml.XmlWriter writer)
        {
            var keySerializer   = TraceLab.Core.Serialization.XmlSerializerFactory.GetSerializer(typeof(TKey), null);
            var valueSerializer = TraceLab.Core.Serialization.XmlSerializerFactory.GetSerializer(typeof(TValue), null);

            foreach (TKey key in this.Keys)
            {
                writer.WriteStartElement("item");

                writer.WriteStartElement("key");
                keySerializer.Serialize(writer, key);
                writer.WriteEndElement();

                writer.WriteStartElement("value");
                TValue value = this[key];
                valueSerializer.Serialize(writer, value);
                writer.WriteEndElement();

                writer.WriteEndElement();
            }
        }
Пример #27
0
 /// <summary>
 /// Write extension information
 /// </summary>
 internal override void WriteText(System.Xml.XmlWriter w)
 {
     if (this.Value != null)
     {
         this.Value.WriteText(w);
     }
     w.WriteString(" - Profile: ");
     w.WriteStartElement("a");
     w.WriteAttributeString("href", this.Url);
     w.WriteString(this.Url);
     w.WriteEndElement(); //a
 }
Пример #28
0
 public void WriteSettings(System.Xml.XmlWriter xml)
 {
     xml.WriteStartElement("settings_start");
     xml.WriteElementString("state", (Started) ? "true" : "false");
     xml.WriteElementString("use_ca", (UseCASign) ? "true" : "false");
     if (SslProt.Length > 0)
     {
         xml.WriteElementString("protocols", ProtocolToString());
     }
     xml.WriteElementString("state_autogen", (AutoGenerate) ? "true" : "false");
     xml.WriteEndElement();
 }
Пример #29
0
 /// <summary>
 /// Serializa os dados do material.
 /// </summary>
 /// <param name="writer"></param>
 /// <param name="material"></param>
 private static void Serializar(System.Xml.XmlWriter writer, IMaterial material)
 {
     writer.WriteAttributeString("code", material.Codigo);
     writer.WriteAttributeString("type", ObterTipoMaterial(material.Tipo));
     writer.WriteStartAttribute("thickness1");
     writer.WriteValue(material.Espessura1);
     writer.WriteEndAttribute();
     writer.WriteStartAttribute("thickness2");
     writer.WriteValue(material.Espessura2);
     writer.WriteEndAttribute();
     writer.WriteStartAttribute("thickness3");
     writer.WriteValue(material.Espessura3);
     writer.WriteEndAttribute();
     writer.WriteStartAttribute("thickness4");
     writer.WriteValue(material.Espessura4);
     writer.WriteEndAttribute();
     writer.WriteStartAttribute("minDistance");
     writer.WriteValue(material.DistanciaMin);
     writer.WriteEndAttribute();
     writer.WriteStartAttribute("trimX1");
     writer.WriteValue(material.RecorteX1);
     writer.WriteEndAttribute();
     writer.WriteStartAttribute("trimY1");
     writer.WriteValue(material.RecorteY1);
     writer.WriteEndAttribute();
     writer.WriteStartAttribute("trimX2");
     writer.WriteValue(material.RecorteX2);
     writer.WriteEndAttribute();
     writer.WriteStartAttribute("trimY2");
     writer.WriteValue(material.RecorteY2);
     writer.WriteEndAttribute();
     writer.WriteStartAttribute("xCrosscut");
     writer.WriteValue(material.TransversalMaxX);
     writer.WriteEndAttribute();
     writer.WriteStartAttribute("yCrosscut");
     writer.WriteValue(material.TransversalMaxY);
     writer.WriteEndAttribute();
     writer.WriteStartAttribute("minXOffcut");
     writer.WriteValue(material.DesperdicioMinX);
     writer.WriteEndAttribute();
     writer.WriteStartAttribute("minYOffcut");
     writer.WriteValue(material.DesperdicioMinY);
     writer.WriteEndAttribute();
     writer.WriteStartAttribute("autoShapeTrim");
     writer.WriteValue(material.RecorteAutomaticoForma);
     writer.WriteEndAttribute();
     writer.WriteStartAttribute("autoShapeTrimAngle");
     writer.WriteValue(material.AnguloRecorteAutomatico);
     writer.WriteEndAttribute();
     writer.WriteStartElement("Description");
     writer.WriteValue(material.Descricao);
     writer.WriteEndElement();
 }
Пример #30
0
        void IReflectorPersistance.Save(System.Xml.XmlWriter w)
        {
            //throw new NotImplementedException();
            w.WriteStartElement("BoardPlugins");
            int n = 0;

            foreach (Assembly a in assemblies)
            {
                w.WriteAttributeString("_" + (n++).ToString(), a.Location);
            }
            w.WriteEndElement();
        }
Пример #31
0
		public void Export(string filename)
		{
			_writer = new System.Xml.XmlTextWriter(filename, System.Text.Encoding.UTF8);
			_writer.WriteStartDocument();
			_writer.WriteStartElement("LinearPredictionModel");

			WriteProperties();
			WriteSpectralPreprocessing();
			WriteLinearPredictionData();

			_writer.WriteEndElement(); // PLSCalibrationModel
			_writer.WriteEndDocument();

			_writer.Close();
		}
Пример #32
0
        void IXmlExportable.ToXml(XmlWriter writer)
        {
            if (writer == null)
                throw new ArgumentNullException("writer");

            if (this.Count == 0)
            {
                return;
            }

            //
            // Write out a named multi-value collection as follows
            // (example here is the ServerVariables collection):
            //
            //      <item name="HTTP_URL">
            //          <value string="/myapp/somewhere/page.aspx" />
            //      </item>
            //      <item name="QUERY_STRING">
            //          <value string="a=1&amp;b=2" />
            //      </item>
            //      ...
            //

            foreach (string key in this.Keys)
            {
                writer.WriteStartElement("item");
                writer.WriteAttributeString("name", key);

                string[] values = GetValues(key);

                if (values != null)
                {
                    foreach (string value in values)
                    {
                        writer.WriteStartElement("value");
                        writer.WriteAttributeString("string", value);
                        writer.WriteEndElement();
                    }
                }

                writer.WriteEndElement();
            }
        }