Ejemplo n.º 1
0
        public XmlDocWriterBase(System.Xml.XmlWriter xmlwriter)
        {
            this.stack = new Stack<string>();
            if (xmlwriter == null)
            {
                throw new System.ArgumentNullException("xmlwriter");
            }

            this._xw = xmlwriter;
        }
Ejemplo n.º 2
0
        public XmlDocWriterBase(string filename)
        {
            this.stack = new Stack<string>();
            if (filename == null)
            {
                throw new System.ArgumentNullException("filename");
            }

            var settings = new System.Xml.XmlWriterSettings();
            settings.Indent = true;
            this._xw = System.Xml.XmlWriter.Create(filename, settings);
        }
Ejemplo n.º 3
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();
		}
Ejemplo n.º 4
0
		public void PrepareDependenciesDump ()
		{
			System.Xml.XmlWriterSettings settings = new System.Xml.XmlWriterSettings();
			settings.Indent = true;
			settings.IndentChars = "\t";
			var depsFile = File.OpenWrite ("linker-dependencies.xml.gz");
			zipStream = new GZipStream (depsFile, CompressionMode.Compress);

			writer = System.Xml.XmlWriter.Create (zipStream, settings);
			writer.WriteStartDocument ();
			writer.WriteStartElement ("dependencies");
			writer.WriteStartAttribute ("version");
			writer.WriteString ("1.0");
			writer.WriteEndAttribute ();
		}
Ejemplo n.º 5
0
		public void PrepareDependenciesDump (string filename)
		{
			dependency_stack = new Stack<object> ();
			System.Xml.XmlWriterSettings settings = new System.Xml.XmlWriterSettings();
			settings.Indent = true;
			settings.IndentChars = "\t";
			var depsFile = File.OpenWrite (filename);
			zipStream = new GZipStream (depsFile, CompressionMode.Compress);

			writer = System.Xml.XmlWriter.Create (zipStream, settings);
			writer.WriteStartDocument ();
			writer.WriteStartElement ("dependencies");
			writer.WriteStartAttribute ("version");
			writer.WriteString ("1.0");
			writer.WriteEndAttribute ();
		}
Ejemplo n.º 6
0
		public void PrepareDependenciesDump ()
		{
			dependency_stack = new Stack<object> ();
			System.Xml.XmlWriterSettings settings = new System.Xml.XmlWriterSettings();
			settings.Indent = true;
			settings.IndentChars = "\t";
			var depsFile = File.OpenWrite (string.Format ("linker-dependencies-{0}.xml.gz", DateTime.Now.Ticks));
			zipStream = new GZipStream (depsFile, CompressionMode.Compress);

			writer = System.Xml.XmlWriter.Create (zipStream, settings);
			writer.WriteStartDocument ();
			writer.WriteStartElement ("dependencies");
			writer.WriteStartAttribute ("version");
			writer.WriteString ("1.0");
			writer.WriteEndAttribute ();
		}
Ejemplo n.º 7
0
 public override void WriteXml(System.Xml.XmlWriter writer)
 {
     base.WriteXml(writer);
     writer.WriteAttributeDouble("Magnitude", Magnitude);
     writer.WriteAttributeDouble("Direction", Direction);
 }
Ejemplo n.º 8
0
 public override void Write(System.Xml.XmlWriter writer)
 {
     writer.WriteElementString("string", Value);
 }
Ejemplo n.º 9
0
        public void GetResultsForCiscoIPPhone(string directory, string givenName, string sn, string telephonenumber, string pos)
        {
            string gn     = "givenName";
            string name   = "sn";
            string tel    = "telephonenumber";
            string filter = "";
            CiscoIPPhoneDirectoryType             dir   = new CiscoIPPhoneDirectoryType();
            List <CiscoIPPhoneDirectoryEntryType> entry = new List <CiscoIPPhoneDirectoryEntryType>();

            try
            {
                dir.Title = "Recherche répertoire";
                foreach (DirectoryType dt in Global.directoryConfiguration)
                {
                    if (dt.name == directory)
                    {
                        if (dt.Item is SqlDatasourceType)
                        {
                            SqlDatasourceType sdt = dt.Item as SqlDatasourceType;
                            if (sdt.ipphonefilter != null)
                            {
                                gn   = sdt.ipphonefilter.firstnamemap;
                                name = sdt.ipphonefilter.lastnamemap;
                                tel  = sdt.ipphonefilter.telephonenumbermap;
                            }
                        }
                        else if (dt.Item is LdapDatasourceType)
                        {
                            LdapDatasourceType ldt = dt.Item as LdapDatasourceType;
                            if (ldt.ipphonefilter != null)
                            {
                                gn   = ldt.ipphonefilter.firstnamemap;
                                name = ldt.ipphonefilter.lastnamemap;
                                tel  = ldt.ipphonefilter.telephonenumbermap;
                            }
                        }
                        else if (dt.Item is CiscoDatasourceType)
                        {
                            CiscoDatasourceType cdt = dt.Item as CiscoDatasourceType;
                            if (cdt.ipphonefilter != null)
                            {
                                gn   = cdt.ipphonefilter.firstnamemap;
                                name = cdt.ipphonefilter.lastnamemap;
                                tel  = cdt.ipphonefilter.telephonenumbermap;
                            }
                        }
                        filter = gn + " LIKE '" + givenName.Trim() + "*' AND " + name + " LIKE '" + sn.Trim() + "*' AND " + tel + " LIKE '" + telephonenumber.Trim() + "*'";
                    }
                }

                DataTable results      = null;
                int       identityCol  = 0;
                int       telephoneCol = 0;
                foreach (DirectoryType dt in Global.directoryConfiguration)
                {
                    if (dt.name == directory)
                    {
                        FieldFormatter[] ffs = null;
                        if (dt.Item is SqlDatasourceType)
                        {
                            ffs = ((SqlDatasourceType)dt.Item).fieldFormatters;
                        }
                        else if (dt.Item is LdapDatasourceType)
                        {
                            ffs = ((LdapDatasourceType)dt.Item).fieldFormatters;
                        }
                        else if (dt.Item is CiscoDatasourceType)
                        {
                            ffs = ((CiscoDatasourceType)dt.Item).fieldFormatters;
                        }
                        int cpt = 0;
                        foreach (FieldFormatter ff in ffs)
                        {
                            if (ff.fieldType == FieldType.Identity)
                            {
                                identityCol = cpt;
                            }
                            if (ff.fieldType == FieldType.Telephone)
                            {
                                telephoneCol = cpt;
                            }

                            cpt++;
                        }

                        break;
                    }
                }
                if (HttpRuntime.Cache.Get(directory + "_" + filter) != null)
                {
                    results = (DataTable)HttpRuntime.Cache.Get(directory + "_" + filter);
                }
                else
                {
                    if (HttpRuntime.Cache.Get(directory) != null)
                    {
                        DataSet  fromCache = (DataSet)HttpRuntime.Cache.Get(directory);
                        DataView dv        = null;
                        try
                        {
                            if (fromCache != null)
                            {
                                dv           = fromCache.Tables[0].AsDataView();
                                dv.RowFilter = filter;
                                DataTable calcTable = dv.ToTable("CalcTable");
                                foreach (DirectoryType dt in Global.directoryConfiguration)
                                {
                                    if (dt.name == directory)
                                    {
                                        FieldFormatter[] ffs  = null;
                                        List <string>    cols = new List <string>();
                                        if (dt.Item is SqlDatasourceType)
                                        {
                                            ffs = ((SqlDatasourceType)dt.Item).fieldFormatters;
                                        }
                                        else if (dt.Item is LdapDatasourceType)
                                        {
                                            ffs = ((LdapDatasourceType)dt.Item).fieldFormatters;
                                        }
                                        else if (dt.Item is CiscoDatasourceType)
                                        {
                                            ffs = ((CiscoDatasourceType)dt.Item).fieldFormatters;
                                        }

                                        foreach (FieldFormatter ff in ffs)
                                        {
                                            cols.Add(ff.fieldName);
                                            if (!calcTable.Columns.Contains(ff.fieldName))
                                            {
                                                DataColumn dc = new DataColumn();
                                                dc.DataType   = typeof(string);
                                                dc.ColumnName = ff.fieldName;
                                                dc.Expression = ff.value;
                                                calcTable.Columns.Add(dc);
                                            }
                                        }
                                        DataView sortedView = calcTable.AsDataView();
                                        if (cols.Count > 0)
                                        {
                                            sortedView.Sort = cols[identityCol];
                                        }
                                        results      = sortedView.ToTable("Results", false, cols.ToArray());
                                        dv           = results.AsDataView();
                                        dv.RowFilter = results.Columns[telephoneCol].ColumnName + " <> ''";
                                        results      = dv.ToTable();
                                        HttpRuntime.Cache.Insert(directory + "_" + filter, results, null, DateTime.Now.AddMinutes(Double.Parse(System.Web.Configuration.WebConfigurationManager.AppSettings.Get("DMDRefreshTimer"))), System.Web.Caching.Cache.NoSlidingExpiration, System.Web.Caching.CacheItemPriority.Normal, null);
                                        break;
                                    }
                                }
                            }
                            else
                            {
                                log.Debug("Cache is null, no data to retreive...");
                            }
                        }
                        catch (Exception e)
                        {
                            log.Error("Error while searching: " + e.Message);
                        }
                    }
                }
                if (results.Rows.Count > 0)
                {
                    if ((Int32.Parse(pos) + 32) >= results.Rows.Count)
                    {
                        dir.Prompt  = "Enreg. " + (Int32.Parse(pos) + 1).ToString() + " à " + results.Rows.Count.ToString() + " sur " + results.Rows.Count.ToString();
                        dir.SoftKey = new CiscoIPPhoneSoftKeyType[4];

                        dir.SoftKey[0]                  = new CiscoIPPhoneSoftKeyType();
                        dir.SoftKey[0].Name             = "Compos.";
                        dir.SoftKey[0].URL              = "SoftKey:Dial";
                        dir.SoftKey[0].URLDown          = "";
                        dir.SoftKey[0].Postion          = 1;
                        dir.SoftKey[0].PostionSpecified = true;

                        dir.SoftKey[1]                  = new CiscoIPPhoneSoftKeyType();
                        dir.SoftKey[1].Name             = "EditNum.";
                        dir.SoftKey[1].URL              = "SoftKey:EditDial";
                        dir.SoftKey[1].URLDown          = "";
                        dir.SoftKey[1].Postion          = 2;
                        dir.SoftKey[1].PostionSpecified = true;


                        dir.SoftKey[2]                  = new CiscoIPPhoneSoftKeyType();
                        dir.SoftKey[2].Name             = "Quitter";
                        dir.SoftKey[2].URL              = "SoftKey:Exit";
                        dir.SoftKey[2].URLDown          = "";
                        dir.SoftKey[2].Postion          = 3;
                        dir.SoftKey[2].PostionSpecified = true;

                        dir.SoftKey[3]                  = new CiscoIPPhoneSoftKeyType();
                        dir.SoftKey[3].Name             = "Recher.";
                        dir.SoftKey[3].URL              = this.Context.Request.Url.AbsoluteUri.Substring(0, this.Context.Request.Url.AbsoluteUri.LastIndexOf("/") + 1) + "SearchForCiscoIPPhone?directory=" + System.Web.HttpUtility.UrlEncode(directory);
                        dir.SoftKey[3].URLDown          = "";
                        dir.SoftKey[3].Postion          = 4;
                        dir.SoftKey[3].PostionSpecified = true;
                    }
                    else
                    {
                        dir.Prompt = "Enreg. " + (Int32.Parse(pos) + 1).ToString() + " à " + (Int32.Parse(pos) + 32).ToString() + " sur " + results.Rows.Count.ToString();
                        this.Context.Response.AddHeader("Refresh", ";url=" + this.Context.Request.Url.AbsoluteUri.Substring(0, this.Context.Request.Url.AbsoluteUri.LastIndexOf("/") + 1) + "GetResultsForCiscoIPPhone?directory=" + System.Web.HttpUtility.UrlEncode(directory) + "&givenName=" + System.Web.HttpUtility.UrlEncode(givenName) + "&sn=" + System.Web.HttpUtility.UrlEncode(sn) + "&telephonenumber=" + System.Web.HttpUtility.UrlEncode(telephonenumber) + "&pos=" + System.Web.HttpUtility.UrlEncode((Int32.Parse(pos) + 32).ToString()));
                        dir.SoftKey = new CiscoIPPhoneSoftKeyType[5];

                        dir.SoftKey[0]                  = new CiscoIPPhoneSoftKeyType();
                        dir.SoftKey[0].Name             = "Compos.";
                        dir.SoftKey[0].URL              = "SoftKey:Dial";
                        dir.SoftKey[0].URLDown          = "";
                        dir.SoftKey[0].Postion          = 1;
                        dir.SoftKey[0].PostionSpecified = true;

                        dir.SoftKey[1]                  = new CiscoIPPhoneSoftKeyType();
                        dir.SoftKey[1].Name             = "EditNum.";
                        dir.SoftKey[1].URL              = "SoftKey:EditDial";
                        dir.SoftKey[1].URLDown          = "";
                        dir.SoftKey[1].Postion          = 2;
                        dir.SoftKey[1].PostionSpecified = true;

                        dir.SoftKey[2]                  = new CiscoIPPhoneSoftKeyType();
                        dir.SoftKey[2].Name             = "Quitter";
                        dir.SoftKey[2].URL              = "SoftKey:Exit";
                        dir.SoftKey[2].URLDown          = "";
                        dir.SoftKey[2].Postion          = 3;
                        dir.SoftKey[2].PostionSpecified = true;

                        dir.SoftKey[3]                  = new CiscoIPPhoneSoftKeyType();
                        dir.SoftKey[3].Name             = "Suivant";
                        dir.SoftKey[3].URL              = "SoftKey:Update";
                        dir.SoftKey[3].URLDown          = "";
                        dir.SoftKey[3].Postion          = 4;
                        dir.SoftKey[3].PostionSpecified = true;

                        dir.SoftKey[4]                  = new CiscoIPPhoneSoftKeyType();
                        dir.SoftKey[4].Name             = "Recher.";
                        dir.SoftKey[4].URL              = this.Context.Request.Url.AbsoluteUri.Substring(0, this.Context.Request.Url.AbsoluteUri.LastIndexOf("/") + 1) + "SearchForCiscoIPPhone?directory=" + System.Web.HttpUtility.UrlEncode(directory);
                        dir.SoftKey[4].URLDown          = "";
                        dir.SoftKey[4].Postion          = 5;
                        dir.SoftKey[4].PostionSpecified = true;
                    }
                    for (int cptRow = Int32.Parse(pos); cptRow <= Int32.Parse(pos) + 31; cptRow++)
                    {
                        if (cptRow < results.Rows.Count)
                        {
                            CiscoIPPhoneDirectoryEntryType dirEntry = new CiscoIPPhoneDirectoryEntryType();
                            dirEntry.Name      = (string)results.Rows[cptRow][identityCol];
                            dirEntry.Telephone = (string)results.Rows[cptRow][telephoneCol];
                            entry.Add(dirEntry);
                        }
                        else
                        {
                            break;
                        }
                    }
                }
                else
                {
                    dir.Prompt  = "Pas d'enregistrement trouvé";
                    dir.SoftKey = new CiscoIPPhoneSoftKeyType[2];

                    dir.SoftKey[0]                  = new CiscoIPPhoneSoftKeyType();
                    dir.SoftKey[0].Name             = "Quitter";
                    dir.SoftKey[0].URL              = "SoftKey:Exit";
                    dir.SoftKey[0].URLDown          = "";
                    dir.SoftKey[0].Postion          = 3;
                    dir.SoftKey[0].PostionSpecified = true;

                    dir.SoftKey[1]                  = new CiscoIPPhoneSoftKeyType();
                    dir.SoftKey[1].Name             = "Recher.";
                    dir.SoftKey[1].URL              = this.Context.Request.Url.AbsoluteUri.Substring(0, this.Context.Request.Url.AbsoluteUri.LastIndexOf("/") + 1) + "SearchForCiscoIPPhone?directory=" + System.Web.HttpUtility.UrlEncode(directory);
                    dir.SoftKey[1].URLDown          = "";
                    dir.SoftKey[1].Postion          = 1;
                    dir.SoftKey[1].PostionSpecified = true;
                }

                dir.DirectoryEntry = entry.ToArray();

                //return dir;
                CiscoIPPhoneDirectoryTypeSerializer xml      = new CiscoIPPhoneDirectoryTypeSerializer();
                System.Xml.XmlWriterSettings        settings = new System.Xml.XmlWriterSettings();;
                settings.Encoding = System.Text.Encoding.UTF8;
                System.IO.MemoryStream ms = new System.IO.MemoryStream();
                System.Xml.XmlWriter   xw = System.Xml.XmlWriter.Create(ms, settings);
                System.Xml.Serialization.XmlSerializerNamespaces xmlnsEmpty = new System.Xml.Serialization.XmlSerializerNamespaces();
                xmlnsEmpty.Add("", "");
                xml.Serialize(xw, dir, xmlnsEmpty);
                ms.Position = 0;
                this.Context.Response.ContentType     = "text/xml";
                this.Context.Response.ContentEncoding = System.Text.Encoding.UTF8;
                this.Context.Response.Write(GetStringFromStream(ms));
            }
            catch (Exception e)
            {
                log.Error("Unable to build Cisco Ipphone Directory Type: " + e.Message);
                this.Context.Response.Redirect(this.Context.Request.Url.AbsoluteUri.Substring(0, this.Context.Request.Url.AbsoluteUri.LastIndexOf("/") + 1) + "Error?error=" + System.Web.HttpUtility.UrlEncode(e.Message), false);
                //return dir;
            }
        }
Ejemplo n.º 10
0
		public SparqlXmlQuerySink(System.Xml.XmlWriter output) {
			this.output = output;
		}
Ejemplo n.º 11
0
 public ExcelXMLWriter(string filename)
 {
     var settings = new System.Xml.XmlWriterSettings();
     settings.Indent = true;
     xwriter = System.Xml.XmlWriter.Create(filename, settings);
 }
Ejemplo n.º 12
0
 /// <summary>
 /// Serializa os dados.
 /// </summary>
 /// <param name="writer"></param>
 void System.Xml.Serialization.IXmlSerializable.WriteXml(System.Xml.XmlWriter writer)
 {
     writer.WriteAttributeString("Name", Name);
     writer.WriteValue(Value);
 }
Ejemplo n.º 13
0
 protected virtual void Serialize(System.Xml.Serialization.XmlSerializer xmlSerializer, System.Xml.XmlWriter xmlWriter, object value)
 {
 }
 public static System.Xml.XmlWriter Create(System.Xml.XmlWriter output)
 {
     throw null;
 }
 public override void WriteParams(System.Xml.XmlWriter writer, Dictionary <HavokClassNode, int> classNodes)
 {
     writer.WriteString(_value.ToString("0.000000", System.Globalization.CultureInfo.InvariantCulture));
 }
Ejemplo n.º 16
0
 public void WriteXml(System.Xml.XmlWriter writer)
 {
     writer.WriteString(Value.ToString("X8"));
 }
Ejemplo n.º 17
0
 public void WriteXml(System.Xml.XmlWriter writer)
 {
 }
Ejemplo n.º 18
0
 /// <summary>
 /// Serializa os dados como Xml.
 /// </summary>
 /// <param name="writer"></param>
 void System.Xml.Serialization.IXmlSerializable.WriteXml(System.Xml.XmlWriter writer)
 {
     writer.WriteAttributeString("name", Name);
     writer.WriteAttributeString("namespace", Namespace);
     writer.WriteAttributeString("assembly", Assembly);
 }
Ejemplo n.º 19
0
 /// <summary>
 /// Writes the XML from the inner value.
 /// </summary>
 /// <param name="writer">XmlWriter.</param>
 public void WriteXml(System.Xml.XmlWriter writer)
 {
     writer.WriteString(ToString());
 }
Ejemplo n.º 20
0
 public virtual void WriteXml(System.Xml.XmlWriter writer)
 {
     DataAccess.DomainXmlSerializationHelper.WriteXML(this, writer);
 }
Ejemplo n.º 21
0
 public override void WriteParams(System.Xml.XmlWriter writer, Dictionary <HavokClassNode, int> classNodes)
 {
     writer.WriteString(_value);
 }
 public static System.Xml.XmlWriter Create(System.Xml.XmlWriter output, System.Xml.XmlWriterSettings settings)
 {
     throw null;
 }
Ejemplo n.º 23
0
        /// <summary>
        /// 속성들을 Xml Attribute로 생성합니다.
        /// </summary>
        /// <param name="writer">Attribute를 쓸 Writer</param>
        public override void GenerateXmlAttributes(System.Xml.XmlWriter writer)
        {
            base.GenerateXmlAttributes(writer);

            if (ShowAxis.HasValue)
            {
                writer.WriteAttributeString("showAxis", ShowAxis.GetHashCode().ToString());
            }
            if (AxisOnLeft.HasValue)
            {
                writer.WriteAttributeString("AxisOnLeft", AxisOnLeft.GetHashCode().ToString());
            }
            if (Title.IsNotWhiteSpace())
            {
                writer.WriteAttributeString("Title", Title);
            }
            if (TitlePos.HasValue)
            {
                writer.WriteAttributeString("TitlePos", TitlePos.ToString());
            }

            if (MaxValue.HasValue)
            {
                writer.WriteAttributeString("MaxValue", MaxValue.ToString());
            }
            if (MinValue.HasValue)
            {
                writer.WriteAttributeString("MinValue", MinValue.ToString());
            }

            if (SetAdaptiveYMin.HasValue)
            {
                writer.WriteAttributeString("setAdaptiveYMin", SetAdaptiveYMin.GetHashCode().ToString());
            }
            if (AxisLineThickness.HasValue)
            {
                writer.WriteAttributeString("axisLineThickness", AxisLineThickness.ToString());
            }
            if (TickWidth.HasValue)
            {
                writer.WriteAttributeString("tickWidth", TickWidth.ToString());
            }

            if (Color.HasValue)
            {
                writer.WriteAttributeString("Color", Color.Value.ToHexString());
            }
            if (NumDivLines.HasValue)
            {
                writer.WriteAttributeString("NumDivLines", NumDivLines.ToString());
            }

            if (AdjustDiv.HasValue)
            {
                writer.WriteAttributeString("AdjustDiv", AdjustDiv.GetHashCode().ToString());
            }

            if (ShowYAxisValues.HasValue)
            {
                writer.WriteAttributeString("ShowYAxisValues", ShowYAxisValues.GetHashCode().ToString());
            }
            if (YAxisValuesStep.HasValue)
            {
                writer.WriteAttributeString("YAxisValuesStep", YAxisValuesStep.GetHashCode().ToString());
            }

            if (_divLine != null)
            {
                _divLine.GenerateXmlAttributes(writer);
            }

            if (_zeroPane != null)
            {
                _zeroPane.GenerateXmlAttributes(writer);
            }
            if (_numberFormat != null)
            {
                _numberFormat.GenerateXmlAttributes(writer);
            }
            if (_line != null)
            {
                _line.GenerateXmlAttributes(writer);
            }
        }
Ejemplo n.º 24
0
 /// <summary>
 /// <see cref="Field.ExportContent"/>
 /// </summary>
 protected override void ExportContent(System.Xml.XmlWriter w)
 {
     w.WriteAttributeString("value", this.value);
 }
Ejemplo n.º 25
0
        public virtual void WriteXml(System.Xml.XmlWriter writer)
        {
            if (!string.IsNullOrWhiteSpace(Title))
            {
                writer.WriteAttributeString("Title", Title);
            }

            //if (IconSource != null)
            //    writer.WriteAttributeString("IconSource", IconSource.ToString());

            if (IsSelected)
            {
                writer.WriteAttributeString("IsSelected", IsSelected.ToString());
            }

            if (IsLastFocusedDocument)
            {
                writer.WriteAttributeString("IsLastFocusedDocument", IsLastFocusedDocument.ToString());
            }

            if (!string.IsNullOrWhiteSpace(ContentId))
            {
                writer.WriteAttributeString("ContentId", ContentId);
            }


            if (ToolTip != null && ToolTip is string)
            {
                if (!string.IsNullOrWhiteSpace((string)ToolTip))
                {
                    writer.WriteAttributeString("ToolTip", (string)ToolTip);
                }
            }

            if (FloatingLeft != 0.0)
            {
                writer.WriteAttributeString("FloatingLeft", FloatingLeft.ToString(CultureInfo.InvariantCulture));
            }
            if (FloatingTop != 0.0)
            {
                writer.WriteAttributeString("FloatingTop", FloatingTop.ToString(CultureInfo.InvariantCulture));
            }
            if (FloatingWidth != 0.0)
            {
                writer.WriteAttributeString("FloatingWidth", FloatingWidth.ToString(CultureInfo.InvariantCulture));
            }
            if (FloatingHeight != 0.0)
            {
                writer.WriteAttributeString("FloatingHeight", FloatingHeight.ToString(CultureInfo.InvariantCulture));
            }

            if (IsMaximized)
            {
                writer.WriteAttributeString("IsMaximized", IsMaximized.ToString());
            }
            if (!CanClose)
            {
                writer.WriteAttributeString("CanClose", CanClose.ToString());
            }
            if (!CanFloat)
            {
                writer.WriteAttributeString("CanFloat", CanFloat.ToString());
            }

            if (LastActivationTimeStamp != null)
            {
                writer.WriteAttributeString("LastActivationTimeStamp", LastActivationTimeStamp.Value.ToString(CultureInfo.InvariantCulture));
            }

            if (_previousContainer != null)
            {
                var paneSerializable = _previousContainer as ILayoutPaneSerializable;
                if (paneSerializable != null)
                {
                    writer.WriteAttributeString("PreviousContainerId", paneSerializable.Id);
                    writer.WriteAttributeString("PreviousContainerIndex", _previousContainerIndex.ToString());
                }
            }
        }
Ejemplo n.º 26
0
 public override void WriteXml(System.Xml.XmlWriter writer)
 {
 }
Ejemplo n.º 27
0
 public ExcelXMLWriter(System.Xml.XmlWriter xmlwriter)
 {
     this.xwriter = xmlwriter;
 }
Ejemplo n.º 28
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();
            }
        }
Ejemplo n.º 29
0
 public void WriteXml(System.Xml.XmlWriter writer)
 {
     System.Runtime.Serialization.XmlSerializableServices.WriteNodes(writer, this.Nodes);
 }
Ejemplo n.º 30
0
        public void GetDirectoriesForCiscoIPPhone()
        {
            CiscoIPPhoneMenuType menu = new CiscoIPPhoneMenuType();

            menu.Prompt = "Sélectionner un répertoire";
            menu.Title  = "Répertoires";
            try
            {
                List <CiscoIPPhoneMenuItemType> menus = new List <CiscoIPPhoneMenuItemType>();

                foreach (DirectoryType dt in Global.directoryConfiguration)
                {
                    CiscoIPPhoneMenuItemType menuitem = null;
                    bool isIPPhoneCompliant           = false;
                    if (dt.Item is SqlDatasourceType)
                    {
                        SqlDatasourceType sdt = dt.Item as SqlDatasourceType;
                        if (sdt.ipphonefilter != null)
                        {
                            isIPPhoneCompliant = true;
                        }
                    }
                    else if (dt.Item is LdapDatasourceType)
                    {
                        LdapDatasourceType ldt = dt.Item as LdapDatasourceType;
                        if (ldt.ipphonefilter != null)
                        {
                            isIPPhoneCompliant = true;
                        }
                    }
                    else if (dt.Item is CiscoDatasourceType)
                    {
                        CiscoDatasourceType cdt = dt.Item as CiscoDatasourceType;
                        if (cdt.ipphonefilter != null)
                        {
                            isIPPhoneCompliant = true;
                        }
                    }
                    if (isIPPhoneCompliant)
                    {
                        menuitem      = new CiscoIPPhoneMenuItemType();
                        menuitem.Name = dt.name;
                        menuitem.URL  = this.Context.Request.Url.AbsoluteUri.Substring(0, this.Context.Request.Url.AbsoluteUri.LastIndexOf("/") + 1) + "SearchForCiscoIPPhone?directory=" + System.Web.HttpUtility.UrlEncode(dt.name);
                        menus.Add(menuitem);
                    }
                }
                if (menus.Count > 0)
                {
                    menu.MenuItem = menus.ToArray();
                }
                else
                {
                    this.Context.Response.Redirect(this.Context.Request.Url.AbsoluteUri.Substring(0, this.Context.Request.Url.AbsoluteUri.LastIndexOf("/") + 1) + "Error?error=" + System.Web.HttpUtility.UrlEncode("No ipphone directories finded"), false);
                    //return menu;
                }
                //return menu;
                CiscoIPPhoneMenuTypeSerializer xml      = new CiscoIPPhoneMenuTypeSerializer();
                System.Xml.XmlWriterSettings   settings = new System.Xml.XmlWriterSettings();;
                settings.Encoding = System.Text.Encoding.UTF8;
                System.IO.MemoryStream ms = new System.IO.MemoryStream();
                System.Xml.XmlWriter   xw = System.Xml.XmlWriter.Create(ms, settings);
                System.Xml.Serialization.XmlSerializerNamespaces xmlnsEmpty = new System.Xml.Serialization.XmlSerializerNamespaces();
                xmlnsEmpty.Add("", "");
                xml.Serialize(xw, menu, xmlnsEmpty);
                ms.Position = 0;
                this.Context.Response.ContentType     = "text/xml";
                this.Context.Response.ContentEncoding = System.Text.Encoding.UTF8;
                this.Context.Response.Write(GetStringFromStream(ms));
                //xw.Flush();
                //xw.Close();
            }
            catch (Exception e)
            {
                log.Error("Unable get directories: " + e.Message);
                this.Context.Response.Redirect(this.Context.Request.Url.AbsoluteUri.Substring(0, this.Context.Request.Url.AbsoluteUri.LastIndexOf("/") + 1) + "Error?error=" + System.Web.HttpUtility.UrlEncode(e.Message), false);
                //return menu;
            }
        }
Ejemplo n.º 31
0
 /// <inheritdoc />
 public void WriteXml(System.Xml.XmlWriter writer)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 32
0
 /// <summary>
 /// 写入XML
 /// </summary>
 /// <param name="writer"></param>
 void IXmlSerializable.WriteXml(System.Xml.XmlWriter writer)
 {
     WriteXml(this.text, writer);
 }
Ejemplo n.º 33
0
		public void SaveDependencies ()
		{
			if (writer == null)
				return;

			writer.WriteEndElement ();
			writer.WriteEndDocument ();
			writer.Flush ();
			writer.Close ();
			zipStream.Close ();

			writer.Dispose ();
			zipStream.Dispose ();
			writer = null;
			zipStream = null;
			dependency_stack = null;
		}
Ejemplo n.º 34
0
 /// <summary>
 /// Converts an object into its XML representation.
 /// </summary>
 /// <param name="writer">The <see cref="T:System.Xml.XmlWriter"></see> stream to which the object is serialized.</param>
 public override void WriteXml(System.Xml.XmlWriter writer)
 {
     throw new NotImplementedException("The method or operation is not implemented.");
 }
Ejemplo n.º 35
0
 public DomProcessor(Word.Range document, System.Xml.XmlWriter writer)
 {
     _xmlWriter = writer;
     _domIter = new DomIter(document);
 }
Ejemplo n.º 36
0
 void System.Xml.Serialization.IXmlSerializable.WriteXml(System.Xml.XmlWriter writer)
 {
     this.WriteXml(writer);
 }