예제 #1
0
        private static void BuildProgIdListing(string mainPath, string bcfPath, string extendBcfPath, string fileName, Dictionary <string, Assembly> assemblyDic)
        {
            LibBinaryFormatter formatter = new LibBinaryFormatter();

            if (Directory.Exists(bcfPath))
            {
                ProgIdConfigListing progIdListing = BuildProgId(bcfPath, extendBcfPath, assemblyDic);
                using (FileStream fs = new FileStream(Path.Combine(mainPath, "Runtime", fileName), FileMode.Create))
                {
                    formatter.Serialize(fs, progIdListing);
                }
            }
        }
예제 #2
0
        private void SaveSqlModel(string name, DataSet dataSet)
        {
            string preFix = name.Substring(0, name.IndexOf('.'));
            string path   = Path.Combine(EnvProvider.Default.MainPath, "SqlModel", preFix);

            if (!Directory.Exists(path))
            {
                Directory.CreateDirectory(path);
            }
            LibSqlModel libDataSet = new LibSqlModel();

            libDataSet.CloneDataSet(dataSet);
            using (FileStream fs = new FileStream(Path.Combine(path, string.Format("{0}.bin", name)), FileMode.Create, FileAccess.Write))
            {
                LibBinaryFormatter formatter = new LibBinaryFormatter();
                formatter.Serialize(fs, libDataSet);
            }
        }