コード例 #1
0
ファイル: Database.cs プロジェクト: zixuan203344/Pycad
        public void SaveAs(string fileName)
        {
            if (fileName == null)
            {
                return;
            }

            var dict =
                new Dictionary <string, XElement>
            {
                { "Root", Root.ToX() },
                { "Config", ConfigDictionary.ToX() }
            };

            ZipUtils.Compress(
                fileName,
                dict,
                ImagePartTable,
                FunctionTable);
        }
コード例 #2
0
 private IEnumerator <KeyValuePair <string, XElement> > GetXDicts()
 {
     foreach (var name in _dictNames)
     {
         var      dname = GetDictRealName(name);
         XElement xe;
         if (IsLoad(name))
         {
             xe = new XElement("Dict");
             foreach (var value in this[name])
             {
                 xe.Add(value.ToX());
             }
         }
         else
         {
             xe      = ZipUtils.Extract(Database.FileName, dname);
             xe.Name = "Dict";
         }
         yield return(new KeyValuePair <string, XElement>(dname, xe));
     }
 }