コード例 #1
0
ファイル: DrawObject.cs プロジェクト: congkhanguyen/Mokkan
        public virtual void ToXml(XmlElement xmlEle, IXmlContext cnt)
        {
            XmlElement _infoEle   = cnt.ToXml(_mkaInfo);
            XmlElement _formatEle = cnt.ToXml(_mkaInfo.Properties);

            xmlEle.AppendChild(_infoEle);
            xmlEle.AppendChild(_formatEle);
        }
コード例 #2
0
 void IXmlable.ToXml(XmlElement xmlEle, IXmlContext cnt)
 {
     foreach (DrawObject obj in _mokkanObjList)
     {
         XmlElement objEle = cnt.ToXml(obj);
         if (null != objEle)
         {
             xmlEle.AppendChild(objEle);
         }
     }
 }
コード例 #3
0
ファイル: MkaBatManager.cs プロジェクト: congkhanguyen/Mokkan
        public void Save()
        {
            try
            {
                // Serialize object to xml format
                XmlDocument   doc       = new XmlDocument();
                IXmlFormatter formatter = FepXmlableFactory.CreateXmlFormatter();
                IXmlContext   cnt       = FepXmlableFactory.CreateXmlContext(formatter, doc);

                doc = cnt.Document;
                XmlDeclaration xmldecl = doc.CreateXmlDeclaration("1.0", null, null);

                XmlElement _eleBat = cnt.ToXml(this);
                doc.AppendChild(_eleBat);

                doc.InsertBefore(xmldecl, doc.DocumentElement);
                doc.Save(BatFilePath);
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(Owner, MkaMessage.ErrSaveFile);
                _log.Error(MkaMessage.ErrSaveFile, ex);
            }
        }