Esempio n. 1
0
 /// <summary>
 /// Initializes the singleton application object.  This is the first line of authored code
 /// executed, and as such is the logical equivalent of main() or WinMain().
 /// </summary>
 public App()
 {
     InitializeComponent();
     Suspending         += OnSuspending;
     UnhandledException += App_UnhandledException;
     AppCenter.Start(Constants.AppCenterSecret, typeof(Analytics));
     AppCenter.Start(Constants.AppCenterSecret, typeof(Crashes));
     AppCenter.Start(Constants.AppCenterSecret, typeof(Push));
     AppHelper.SetTheme();
     DI.Build();
     Analytics.TrackEvent("App Opened");
 }
Esempio n. 2
0
        static void Main(string[] args)
        {
            DI.Configure(services => services
                         .AddSingleton <Settings>()
                         .AddSingleton <IDirSettings>(p => p.GetService <Settings>())
                         .AddSingleton <SceneManager>()
                         .AddSingleton <ContentFinder>()
                         .AddSingleton <Scene>()
                         .AddSingleton <Vectorizer>());
            DI.Build();

            var settings     = DI.Get <Settings>();
            var sceneManager = DI.Get <SceneManager>();
            var scene        = DI.Get <Scene>();

            try
            {
                var sw          = Stopwatch.StartNew();
                var shape       = scene.GetShape();
                var meshedScene = sceneManager.CreateScene(shape);
                sw.Stop();

                Console.WriteLine($"Scene generation time {TimeSpan.FromMilliseconds(sw.ElapsedMilliseconds)}");

                meshedScene.Save(settings.FullFileName, settings.Format);

                var process = new Process();
                process.StartInfo.UseShellExecute = true;
                process.StartInfo.FileName        = settings.FullFileName;
                process.Start();
            }
            catch (PolygonFillException)
            {
                Console.WriteLine($"Incorrect construction. Use View (2D) to fix it!");
            }
        }