示例#1
0
        //load processed data from PreData folder
        public static SQLProductSum LoadSQLProductFromMetaData()
        {
            SQLProductSum sum  = null;
            string        path = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);

            //string path2 = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase);
            path = Path.Combine(path, "MetaData");
            if (!Directory.Exists(path))
            {
                Logger.LogMsg("[LoadSQLProductFromMetaData]Data folder doesn't exist:" + path);
                return(null);
            }

            UpdateProgress("Loading MSI/MSP meta data from:" + path + ", may take minutes...", true);

            List <string> xmlFiles = Utility.GetFilesFromFolder(path, new string[] { "*.xml" });
            SQLProductSum totalSum = new SQLProductSum("All-Pre-Sum", "Pre-MetaData", "Merge All sum in predata folder into one");

            foreach (string f in xmlFiles)
            {
                try
                {
                    UpdateProgress("Reading MSI/MSP meta data from pre-processed data:" + Path.GetFileName(f) + ", may take minutes...", true);
                    sum = OutputProcessor.DataContractDeSerializeToXML <SQLProductSum>(f);
                    totalSum.AddProductSum(sum);
                }
                catch (Exception ex)
                {
                    Logger.LogError("[LoadSQLProductFromMetaData]:" + ex.Message);
                }
            }

            return(totalSum);
        }
示例#2
0
        }//function

        public void AddProductSumFromFile(string f)
        {
            try
            {
                Logger.LogMsg("AddProductSumFromFile:" + f);
                SQLProductSum sum = OutputProcessor.DataContractDeSerializeToXML <SQLProductSum>(f);
                this.AddProductSum(sum);
            }
            catch (Exception ex)
            {
                Logger.LogError("[AddProductSumFromFile]:" + ex.Message);
            }
        }