Example #1
0
 protected void Dump(String path)
 {
     path = Path.GetFullPath(path);
     IVocabulary voc = new VocabularyFactory().CreateVocabulary();
     voc.Load(path);
     Console.Out.WriteLine(path);
     Dump(voc);
 }
Example #2
0
        static void Main(string[] args)
        {
            Debug.Assert(args.Length == 1);
            if (args.Length != 1)
            {
                Usage();
                return;
            }

            String srcPath = args[0];

            IVocabulary voc = new VocabularyFactory().CreateVocabulary();

            try
            {
                Console.Write("Loading source vocabulary [{0}]...", Path.GetFileName(srcPath));
                voc.Load(srcPath, null);
                Console.WriteLine("ok");

                String dstPath = srcPath + ".sdf";

                if (File.Exists(dstPath))
                {
                    File.Delete(dstPath);
                }

                Console.Write("Opening destination database [{0}]...", Path.GetFileName(dstPath));
                using (SqlCeConnection conn = DataUtils.OpenDatabase(dstPath, DataUtils.PASSWORD_VOCABULARY, DataUtils.SCHEMA_VOCABULARY))
                {
                    Console.WriteLine("ok");

                    Console.WriteLine("Conversion started...");
                    Convert(voc, conn);
                    Console.WriteLine("Conversion finished.");

                    conn.Close();
                }
            }
            catch (Exception e)
            {
                Console.WriteLine();
                Console.WriteLine("*** ERROR: " + e.Message);
            }
        }