Пример #1
0
        public static void Stats(string[] args)
        {
            // Load the file
            var parms = new ParameterParser <InstallParameters>().Parse(args);

            ApplicationContext.Current.Start();
            var ds = DatasetInstall.Load(parms.DatasetFile);

            Console.WriteLine("Statistics for {0} ({1} objects)...", ds.Action.Count, ds.Id);
            foreach (var gc in ds.Action?.GroupBy(o => o.Element?.GetType()))
            {
                Console.WriteLine("{0} - {1} items", gc.Key, gc.Count());
            }
        }
Пример #2
0
        public static void Install(string[] args)
        {
            // Load the file
            var parms = new ParameterParser <InstallParameters>().Parse(args);

            ApplicationContext.Current.Start();
            var dsi = new DataInitializationService();
            var ds  = DatasetInstall.Load(parms.DatasetFile);

            Console.WriteLine("Will install dataset {0} ({1} objects)...", ds.Action.Count, ds.Id);

            dsi.ProgressChanged += (o, e) =>
            {
                Console.CursorLeft = 4;
                Console.Write("{0} ({1:0%})", e.State, e.Progress);
            };

            dsi.InstallDataset(ds);
        }