private System.Xml.XmlElement ToXMLElement(System.Xml.XmlDocument doc, ICSSoft.STORMNET.FunctionalLanguage.Function funct)
        {
            System.Xml.XmlElement el = doc.CreateElement("Function");
            if (funct != null)
            {
                el.SetAttribute("Name", funct.FunctionDef.StringedView);
                for (int i = 0; i < funct.Parameters.Count; i++)
                {
                    if (funct.Parameters[i] is ICSSoft.STORMNET.FunctionalLanguage.Function)
                    {
                        el.AppendChild(ToXMLElement(doc, funct.Parameters[i] as ICSSoft.STORMNET.FunctionalLanguage.Function));
                    }
                    else if (funct.Parameters[i] is ICSSoft.STORMNET.FunctionalLanguage.VariableDef)
                    {
                        System.Xml.XmlElement varel = doc.CreateElement("Variable");
                        varel.SetAttribute("Value", (funct.Parameters[i] as ICSSoft.STORMNET.FunctionalLanguage.VariableDef).StringedView);
                        el.AppendChild(varel);
                    }
                    else
                    {
                        System.Xml.XmlElement valel = doc.CreateElement("Value");
                        int parindex = (i >= funct.FunctionDef.Parameters.Count) ? funct.FunctionDef.Parameters.Count - 1 : i;
                        valel.SetAttribute("ConstType", funct.FunctionDef.Parameters[parindex].Type.StringedView);
                        valel.SetAttribute("Value", funct.Parameters[i].ToString());
                        el.AppendChild(valel);
                    }
                }
            }

            return(el);
        }
Exemple #2
0
        /// <summary>
        /// 整数を読み取って elem に追加します。
        /// </summary>
        /// <param name="str">読み取りもと</param>
        /// <param name="elem">追加先の要素</param>
        private void init_read_int(System.IO.Stream str, System.Xml.XmlElement elem)
        {
            char   letter;
            string r = "";

            while (this.ReadChar(str, out letter))
            {
                switch (letter)
                {
                case 'e': goto write;

                case '-':
                    if (r != "")
                    {
                        goto fail;
                    }
                    r += "-";
                    break;

                case '0': r += "0"; break;

                case '1':
                case '2':
                case '3':
                case '4':
                case '5':
                case '6':
                case '7':
                case '8':
                case '9':
                    if (r == "0")
                    {
                        goto fail;
                    }
                    r += letter.ToString();
                    break;

                default: goto fail;
                }
            }
write:
            if (r == "")
            {
                goto fail;
            }
            System.Xml.XmlElement e = this.createElement(elem);
            e.SetAttribute("type", "int");
            e.SetAttribute("value", r);
            elem.AppendChild(e);
            return;

fail:
            while (letter != 'e')
            {
                if (!this.ReadChar(str, out letter))
                {
                    break;
                }
            }
        }
        public void WritePictureXMLFile()
        {
            GlobalDataStore.Logger.Debug("Updating Pictures.xml ...");
            List <LabelX.Toolbox.LabelXItem> items        = new List <LabelX.Toolbox.LabelXItem>();
            DirectoryInfo PicturesRootFolderDirectoryInfo = new DirectoryInfo(PicturesRootFolder);

            LabelX.Toolbox.Toolbox.GetPicturesFromFolderTree(PicturesRootFolderDirectoryInfo.FullName, ref items);

            //items = alle ingelezen pictures. Nu gaan wegschrijven.
            System.Xml.XmlDocument doc  = new System.Xml.XmlDocument();
            System.Xml.XmlElement  root = doc.CreateElement("LabelXItems");

            foreach (LabelX.Toolbox.LabelXItem item in items)
            {
                System.Xml.XmlElement itemXML = doc.CreateElement("item");
                itemXML.SetAttribute("name", item.Name);
                itemXML.SetAttribute("hash", item.Hash);

                root.AppendChild(itemXML);
            }

            doc.AppendChild(root);

            MemoryStream ms = new MemoryStream();

            System.Xml.XmlTextWriter tw = new System.Xml.XmlTextWriter(ms, Encoding.UTF8);
            tw.Formatting = System.Xml.Formatting.Indented;
            doc.WriteContentTo(tw);
            doc.Save(PicturesRootFolder + "pictures.xml");


            tw.Close();
        }
Exemple #4
0
 public override void SaveToXml(System.Xml.XmlElement xmlEl, System.Xml.XmlDocument doc)
 {
     base.SaveToXml(xmlEl, doc);
     xmlEl.SetAttribute("T", TypeString);
     xmlEl.SetAttribute("O", this.Operator.ToString());
     xmlEl.SetAttribute("V", this.Value);
 }
Exemple #5
0
 /// <summary>
 /// 设置 web.config 的 AppSettings 中某项的值
 /// </summary>
 /// <param name="key">项的名称</param>
 /// <param name="value">项的值</param>
 /// <returns>返回结果</returns>
 public static Boolean SetAppSettings(String key, String value)
 {
     try
     {
         //指定超级管理员
         String XmlPath = System.IO.PathTool.ServerMap("~/web.config");
         System.Xml.XmlDocument xmldoc = new System.Xml.XmlDocument();
         xmldoc.Load(XmlPath);
         System.Xml.XmlNode    root       = xmldoc.DocumentElement.SelectSingleNode("appSettings");
         System.Xml.XmlElement subElement = (System.Xml.XmlElement)root.SelectSingleNode("//add[@key='" + key + "']");
         if (subElement == null)
         {
             subElement = xmldoc.CreateElement("add");
             subElement.SetAttribute("key", key);
             subElement.SetAttribute("value", value);
             root.AppendChild(subElement);
             xmldoc.Save(XmlPath);
         }
         else
         {
             subElement.SetAttribute("value", value);
             xmldoc.Save(XmlPath);
         }
         return(true);
     }
     catch { return(false); }
 }
Exemple #6
0
 public virtual void SaveToXml(System.Xml.XmlElement xmlEl, System.Xml.XmlDocument doc)
 {
     xmlEl.SetAttribute("UN", _uniqueName);
     xmlEl.SetAttribute("N", _name);
     xmlEl.SetAttribute("CC", _childCount.ToString());
     xmlEl.SetAttribute("LD", _levelDepth.ToString());
 }
        private void SaveToXml(ref string ProductsXml, ref string FilterXml)
        {
            System.Xml.XmlDocument doc    = null;
            System.Xml.XmlElement  rootEl = null;

            // products
            doc    = new System.Xml.XmlDocument();
            rootEl = doc.CreateElement("PRODUCTS");
            doc.AppendChild(rootEl);
            foreach (string serNo in this._productsSerNoList)
            {
                System.Xml.XmlElement childEl = doc.CreateElement("PR");
                childEl.SetAttribute("SN", serNo);
                rootEl.AppendChild(childEl);
            }
            ProductsXml = doc.InnerXml;

            // filter
            doc    = new System.Xml.XmlDocument();
            rootEl = doc.CreateElement("FILTER");
            doc.AppendChild(rootEl);
            for (int i = 0; i < this._filterList.Count; i++)
            {
                string colName = this._filterList.Keys[i];
                string val     = this._filterList[i];

                System.Xml.XmlElement childEl = doc.CreateElement("COL");
                childEl.SetAttribute("N", colName);
                childEl.SetAttribute("V", val);
                rootEl.AppendChild(childEl);
            }
            FilterXml = doc.InnerXml;
        }
        public override void ToXml(System.Xml.XmlElement aNode)
        {
            base.ToXml(aNode);
            aNode.InnerText = FCode128.Text;

            if (FAutoSize)
            {
                aNode.SetAttribute("autosize", "1");
            }
            else
            {
                aNode.SetAttribute("autosize", "0");
            }

            if (FCode128.TextVisible)
            {
                aNode.SetAttribute("showtext", "1");
            }
            else
            {
                aNode.SetAttribute("showtext", "0");
            }

            aNode.SetAttribute("penwidth", FCode128.Zoom.ToString());
        }
 public override void WriteXml(System.Xml.XmlElement element)
 {
     base.WriteXml(element);
     element.SetAttribute("baudRate", baudRate.ToString());
     element.SetAttribute("autoDetectAnimation", autoDetectAnimation.ToString());
     element.SetAttribute("animationEnabled", animationEnabled.ToString());
 }
        public override void ToXml(System.Xml.XmlElement aNode)
        {
            base.ToXml(aNode);
            aNode.InnerText = FText;

            if (FAutoSize)
            {
                aNode.SetAttribute("autosize", "1");
            }
            else
            {
                aNode.SetAttribute("autosize", "0");
            }

            if (FShowText)
            {
                aNode.SetAttribute("showtext", "1");
            }
            else
            {
                aNode.SetAttribute("showtext", "0");
            }

            aNode.SetAttribute("penwidth", FPenWidth.ToString());
        }
 public override void SaveToXml(System.Xml.XmlElement xmlEl, System.Xml.XmlDocument doc)
 {
     base.SaveToXml(xmlEl, doc);
     xmlEl.SetAttribute("T", TypeString);
     xmlEl.SetAttribute("GE", this.GrOrEq);
     xmlEl.SetAttribute("LE", this.LessOrEq);
 }
 internal void SaveUserData(System.Xml.XmlElement node)
 {
     node.SetAttribute("autoRefresh", this.buttonAutoRefresh.Checked.ToString(CultureInfo.InvariantCulture));
     node.SetAttribute("locked", this.buttonLock.Checked.ToString(CultureInfo.InvariantCulture));
     node.SetAttribute("titleText", this.Text);
     node.SetAttribute("debug", this.buttonDebug.Checked.ToString(CultureInfo.InvariantCulture));
 }
 public System.Xml.XmlElement ConvertToXml()
 {
     System.Xml.XmlElement node = Forms.frmQuickReportEditor.xmlDocument.CreateElement(XmlAttrDic.ConditionValueNumeralInt.ToString());
     node.SetAttribute(XmlAttrDic.tValue.ToString(), ucNumeralText.Text);
     node.SetAttribute(XmlAttrDic.tDefaultOperator.ToString(), cmbOperators.Text);
     node.SetAttribute(XmlAttrDic.bHideOperator.ToString(), Convert.ToInt32(cbHideOperator.Checked).ToString());
     return(node);
 }
Exemple #14
0
 public override bool ToXML(System.Xml.XmlElement myElement)
 {
     base.ToXML(myElement);
     myElement.SetAttribute("user", strUserName);
     myElement.SetAttribute("time", dtmDateTime.ToString("yyyy-MM-dd HH:mm:ss"));
     myElement.SetAttribute("level", intLevel.ToString());
     return(true);
 }
Exemple #15
0
 public void WriteHeader(System.Xml.XmlElement node)
 {
     node.SetAttribute("Size", Size.ToString());
     node.SetAttribute("CompressedSize", CompressedSize.ToString());
     node.SetAttribute("Checksum", String.Format("{0:x8}", Adler32));
     node.SetAttribute("FileTime", String.Format("{0:x8}", FileTime));
     node.SetAttribute("Algorithm", Algorithm.ToString());
 }
Exemple #16
0
 public void ToXmlEmr(System.Xml.XmlElement aNode)
 {
     aNode.SetAttribute("DeCode", EMR.EMRSTYLE_TOOTH.ToString());
     aNode.SetAttribute("lefttop", FLeftTopText);
     aNode.SetAttribute("righttop", FRightTopText);
     aNode.SetAttribute("leftbottom", FLeftBottomText);
     aNode.SetAttribute("rightbottom", FRightBottomText);
 }
 public override void ToXml(System.Xml.XmlElement aNode)
 {
     base.ToXml(aNode);
     aNode.SetAttribute("readonly", FReadOnly.ToString());
     aNode.SetAttribute("border", HC.GetBorderSidePro(FBorderSides));
     aNode.SetAttribute("borderwidth", FBorderWidth.ToString());
     aNode.InnerText = FText;
 }
Exemple #18
0
        public System.Xml.XmlElement CreateText(string text, int x, int y)
        {
            System.Xml.XmlElement textElement = this.SvgDocument.CreateElement("text", SVGnamespace);
            textElement.InnerText = text;
            textElement.SetAttribute("x", Int2String(x));
            textElement.SetAttribute("y", Int2String(y));

            return(textElement);
        }
Exemple #19
0
 /// <summary>
 /// Create rect element.
 /// </summary>
 /// <returns></returns>
 public override System.Xml.XmlElement CreateElement()
 {
     System.Xml.XmlElement elem = GDI.Document.CreateElement("rect");
     elem.SetAttribute("x", "" + (int)GDI.DC.ToAbsoluteX(Left));
     elem.SetAttribute("y", "" + (int)GDI.DC.ToAbsoluteY(Top));
     elem.SetAttribute("width", "" + (int)GDI.DC.ToRelativeX(Right - Left));
     elem.SetAttribute("height", "" + (int)GDI.DC.ToRelativeY(Bottom - Top));
     return(elem);
 }
Exemple #20
0
 public override bool ToXML(System.Xml.XmlElement myElement)
 {
     if (myElement != null)
     {
         myElement.SetAttribute("type", StringCommon.GetNameByType(this.Type));
         myElement.SetAttribute("name", this.Name);
         return(true);
     }
     return(false);
 }
 public System.Xml.XmlElement ConvertToXml()
 {
     System.Xml.XmlElement node = Forms.frmQuickReportEditor.xmlDocument.CreateElement(XmlAttrDic.DefaultValueDate.ToString());
     node.SetAttribute(XmlAttrDic.tFixedDateValue.ToString(), dateTimePicker.Value.ToShortDateString());
     node.SetAttribute(XmlAttrDic.bUseSystemValue.ToString(), Convert.ToInt32(cbSystemValue.Checked).ToString());
     node.SetAttribute(XmlAttrDic.tSystemDateValueType.ToString(), ((Interfaces.ISystemValue)cmbSystemDataValue.SelectedItem).ValueID);
     node.SetAttribute(XmlAttrDic.tOperator.ToString(), cmbAddOrSub.Text);
     node.SetAttribute(XmlAttrDic.tDay.ToString(), txtDay.Text);
     return(node);
 }
 public System.Xml.XmlElement ConvertToXml()
 {
     System.Xml.XmlElement node = Forms.frmQuickReportEditor.xmlDocument.CreateElement(XmlAttrDic.ViewSettingGridSetting.ToString());
     node.SetAttribute(XmlAttrDic.tGroupRow.ToString(), cmbRowGroupSum.Text);
     node.SetAttribute(XmlAttrDic.tRowGroupSumName.ToString(), txtRowGroupSumName.Text);
     node.SetAttribute(XmlAttrDic.bUseGroupSumRow.ToString(), Convert.ToInt32(cbUseGroupSumRow.Checked).ToString());
     node.SetAttribute(XmlAttrDic.bUseHeader.ToString(), Convert.ToInt32(cbUseHeader.Checked).ToString());
     node.SetAttribute(XmlAttrDic.bUnion.ToString(), Convert.ToInt32(cbUnion.Checked).ToString());
     return(node);
 }
Exemple #23
0
        private void MyXml(CLAS.FileAccountRow r, System.Xml.XmlDocument xd)
        {
            System.Xml.XmlElement xe = (System.Xml.XmlElement)xd.SelectSingleNode("//toc[@type='account' and @id=" + r.FileAccountId.ToString() + "]");
            if (xe == null)
            {
                xe = xd.CreateElement("toc");
                xe.SetAttribute("type", "account");
                xe.SetAttribute("supertype", "fileaccount");
            }
            xe.SetAttribute("id", r.FileAccountId.ToString());
            xe.SetAttribute("titlee", r["AccountTypeCode"].ToString() + " (" + r["DARSAccountType"].ToString() + ")");
            xe.SetAttribute("titlef", r["AccountTypeCode"].ToString() + " (" + r["DARSAccountType"].ToString() + ")");

            if (r.ActiveWithJustice)
            {
                xe.SetAttribute("tooltipe", "Assigned");
                xe.SetAttribute("strikeout", "false");
            }
            else
            {
                xe.SetAttribute("tooltipe", "Not Assigned");
                xe.SetAttribute("strikeout", "true");
            }


            if (xe.ParentNode == null)
            {
                System.Xml.XmlElement xes = EFileBE.XmlAddFld(xd, "account", "Accounts", "Comptes", 220);
                xes.AppendChild(xe);
            }
        }
Exemple #24
0
        public System.Xml.XmlElement CreatePolyline(string points)
        {
            System.Xml.XmlElement polyline = this.SvgDocument.CreateElement("polyline", SVGnamespace);
            polyline.SetAttribute("points", points);
            polyline.SetAttribute("style", "fill:none;stroke-width:3;stroke:rgb(0,0,0)");
            // polyline.SetAttribute ("stroke", "black");
            // polyline.SetAttribute ("stroke-width", "3");
            // polyline.SetAttribute ("fill", "red");

            return(polyline);
        }
Exemple #25
0
        public System.Xml.XmlElement CreateRectangle(int x, int y, int w, int h)
        {
            System.Xml.XmlElement rect = this.SvgDocument.CreateElement("rect", SVGnamespace);
            rect.SetAttribute("x", Int2String(x));
            rect.SetAttribute("y", Int2String(y));
            rect.SetAttribute("width", Int2String(w));
            rect.SetAttribute("height", Int2String(h));
            rect.SetAttribute("style", "fill:rgb(0,0,255);stroke-width:3;stroke:rgb(0,0,0)");

            return(rect);
        }
Exemple #26
0
        public System.Xml.XmlElement CreatePath(string path)
        {
            System.Xml.XmlElement xp = this.SvgDocument.CreateElement("path", SVGnamespace);
            xp.SetAttribute("d", path);
            xp.SetAttribute("style", "fill:rgb(255,0,0);stroke-width:3;stroke:rgb(0,0,0)");
            // xp.SetAttribute ("stroke", "black");
            // xp.SetAttribute ("stroke-width", "3");
            // xp.SetAttribute ("fill", "red");

            return(xp);
        }
Exemple #27
0
        public System.Xml.XmlElement CreateLine(int x1, int y1, int x2, int y2)
        {
            System.Xml.XmlElement line = this.SvgDocument.CreateElement("line", SVGnamespace);
            line.SetAttribute("x1", Int2String(x1));
            line.SetAttribute("y1", Int2String(y1));
            line.SetAttribute("x2", Int2String(x2));
            line.SetAttribute("y2", Int2String(y2));
            line.SetAttribute("style", "stroke:rgb(255,0,0);stroke-width:2");

            return(line);
        }
Exemple #28
0
 public override void ToXml(System.Xml.XmlElement element)
 {
     base.ToXml(element);
     if (this.originalColumnNode != null)
     {
         element.SetAttribute("OriginalColumnNode", this.originalColumnNode.GetHashCode().ToString());
     }
     if (this.relatedTableNode != null)
     {
         element.SetAttribute("RelatedTableNode", this.relatedTableNode.GetHashCode().ToString());
     }
 }
Exemple #29
0
        private void MyXml(CLAS.WritRow wr, System.Xml.XmlDocument xd)
        {
            System.Xml.XmlElement xe = (System.Xml.XmlElement)xd.SelectSingleNode("//toc[@type='writ' and @id=" + wr.WritID.ToString() + "]");
            if (xe == null)
            {
                xe = xd.CreateElement("toc");
                xe.SetAttribute("type", "writ");
            }
            xe.SetAttribute("id", wr.WritID.ToString());

            string writtypeEng = "";
            string writtypeFre = "";

            if (!wr.IsTypeofWritCodeNull())
            {
                //JLL Yuck ... should move desc to view/dataset
                DataRow[] dr = myA.FM.Codes("TypeofWrit").Select("TypeofWritCode='" + wr.TypeofWritCode + "'", "");
                if (dr.Length == 1)
                {
                    writtypeEng = dr[0]["TypeofWritDescEng"].ToString();
                    writtypeFre = dr[0]["TypeofWritDescFre"].ToString();
                }
            }

            if (!wr.IsIssueRenewalDateNull())
            {
                xe.SetAttribute("titlee", wr.IssueRenewalDate.ToString("yyyy/MM/dd") + " - " + writtypeEng);
                xe.SetAttribute("titlef", wr.IssueRenewalDate.ToString("yyyy/MM/dd") + " - " + writtypeFre);
            }

            if (!wr.IsSheriffJurisdictionNull())
            {
                xe.SetAttribute("tooltipe", wr.SheriffJurisdiction);
                xe.SetAttribute("tooltipf", wr.SheriffJurisdiction);
            }


            if (xe.ParentNode == null)
            {
                System.Xml.XmlNode    xeJudg = xd.SelectSingleNode("//toc[@type='judgment' and @id=" + wr.JudgmentID.ToString() + "]");
                System.Xml.XmlElement xes    = (System.Xml.XmlElement)xeJudg.SelectSingleNode("fld[@type='writs']");

                if (xes == null)
                {
                    xes = xeJudg.OwnerDocument.CreateElement("fld");
                    xes.SetAttribute("type", "writs");
                    xes.SetAttribute("titlee", "Encumbrances");
                    xes.SetAttribute("titlef", "Grèvements");
                    xeJudg.AppendChild(xes);
                }
                xes.AppendChild(xe);
            }
        }
Exemple #30
0
 public override bool ToXML(System.Xml.XmlElement myElement)
 {
     if (myElement != null)
     {
         myElement.SetAttribute("type", StringCommon.GetNameByType(this.Type));
         myElement.SetAttribute("name", this.Name);
         myElement.SetAttribute("lineHeight", this.LineHeight.ToString());
         myElement.SetAttribute("percent", this.Percent.ToString());
         //return base.ToXML(myElement);
     }
     return(false);
 }