Example #1
0
        /// <summary>
        /// TODO: переименовать во что-то более осмысленное
        /// </summary>
        /// <param name="Folder"></param>
        /// <returns></returns>
        private async System.Threading.Tasks.Task BurnDaHausAsync(string Folder)
        {
            string _folder      = Folder;
            string xmlPath      = _folder;
            string xsdPath      = _folder;
            string originalText = Text;
            Dictionary <string, string> tables = GetTablesNames.GetTables(xsdPath);

            foreach (KeyValuePair <string, string> table in tables.AsEnumerable())
            {
                ResetProgressBar();
                Text = table.Value;
                Action <int> progress = new Action <int>(ProgressChanged);
                string[]     files    = GetXMLSBySchema(table.Value, xmlPath, true);



                ProccessXSD     proc = new ProccessXSD();
                TableDefinition def  = proc.XSDToTableDefinition(table.Key, TargetSchema);
                if (def.tableName == "as_param")
                {
                    ResetProgressBar();
                    Action <int> localProgress = new Action <int>(ProgressChanged);
                    string[]     paramXmls     = System.IO.Directory.GetFiles(xmlPath, "AS_*_PARAMS_*.xml", System.IO.SearchOption.AllDirectories);
                    foreach (string paramXml in paramXmls)
                    {
                        textBox1.Text = paramXml;
                        WriteData paramWrt = new WriteData(def, paramXml, _cs, 100);
                        await paramWrt.ReadXmlAsync(localProgress);
                    }
                    continue;
                }

                if (files.Count() < 1)
                {
                    continue;
                }

                foreach (string xmlfile in files)
                {
                    textBox1.Text = xmlfile;
                    WriteData wrt = new WriteData(def, xmlfile, _cs);
                    await wrt.ReadXmlAsync(progress);
                }
            }
            Text = originalText;
            ResetProgressBar();
        }