示例#1
0
        static internal void Main(string[] args)
        {
            try
            {
                var cmdLineArgs = StartupUtils.CommandLineArguments.Parse(args);
                var locale      = StartupUtils.SetLocale(cmdLineArgs);
                var model       = StartupUtils.MakeModel(true);
                var runner      = new CommandLineRunner(model);
                runner.Run(cmdLineArgs);
            }
            catch (Exception e)
            {
                try
                {
                    DynamoModel.IsCrashing = true;
                    Dynamo.Logging.Analytics.TrackException(e, true);
                }
                catch
                {
                }

                Console.WriteLine(e.Message);
                Console.WriteLine(e.StackTrace);
            }
        }
示例#2
0
        public DynamoCoreSetup(string[] args)
        {
            var cmdLineArgs = StartupUtils.CommandLineArguments.Parse(args);
            var locale      = StartupUtils.SetLocale(cmdLineArgs);

            _putenv(locale);
            commandFilePath = cmdLineArgs.CommandFilePath;
        }
示例#3
0
 // This method gets called by the runtime. Use this method to add services to the container.
 public void ConfigureServices(IServiceCollection services)
 {
     services.AddControllers();
     StartupUtils.ConfigureMiaLibraryServices(services, Configuration);
     StartupUtils.ConfigureDocs(services, new OpenApiInfo
     {
         Version     = "v1",
         Title       = AppDomain.CurrentDomain.FriendlyName,
         Description = "Template microservice."
     });
 }
示例#4
0
        public DynamoSandboxService(ISolidWorksAddin addin)
        {
            _addin = addin;

            var cmdLineArgs = StartupUtils.CommandLineArguments.Parse(null);
            var locale      = StartupUtils.SetLocale(cmdLineArgs);

            _putenv(locale);
            commandFilePath = cmdLineArgs.CommandFilePath;
            ASMPath         = cmdLineArgs.ASMPath;
        }
        public void RunApp(IntPtr windowHandle)
        {
            try
            {
                DynamoModel model;
                StartupUtils.ASMPreloadFailure += ASMPreloadFailureHandler;

                if (!String.IsNullOrEmpty(ASMPath))
                {
                    model = StartupUtils.MakeModel(false, ASMPath);
                }
                else
                {
                    model = StartupUtils.MakeModel(false);
                }

                ViewModel = DynamoViewModel.Start(
                    new DynamoViewModel.StartConfiguration()
                {
                    DynamoModel      = model,
                    Watch3DViewModel = HelixWatch3DViewModel.TryCreateHelixWatch3DViewModel
                                       (
                        null,
                        new Watch3DViewModelStartupParams(model),
                        model.Logger
                                       ),
                    ShowLogin = true
                });

                var view = new DynamoView(ViewModel);
                view.Loaded += OnDynamoViewLoaded;

                var windowHelper = new WindowInteropHelper(view);
                windowHelper.Owner = windowHandle;

                var app = Application.Current;
                if (app != null)
                {
                    app.Run(view);
                }
                else
                {
                    //view.Owner
                    view.Show();
                }

                StartupUtils.ASMPreloadFailure -= ASMPreloadFailureHandler;
            }
            catch (Exception ex)
            {
                //throw;
            }
        }
示例#6
0
        static internal void Main(string[] args)
        {
            try
            {
                var cmdLineArgs = StartupUtils.CommandLineArguments.Parse(args);
                var locale      = StartupUtils.SetLocale(cmdLineArgs);
                if (cmdLineArgs.DisableAnalytics)
                {
                    Dynamo.Logging.Analytics.DisableAnalytics = true;
                }

                DynamoModel model;
                if (!String.IsNullOrEmpty(cmdLineArgs.ASMPath))
                {
                    model = Dynamo.Applications.StartupUtils.MakeModel(true, cmdLineArgs.ASMPath);
                }
                else
                {
                    model = Dynamo.Applications.StartupUtils.MakeModel(true);
                }
                var viewModel = DynamoViewModel.Start(
                    new DynamoViewModel.StartConfiguration()
                {
                    DynamoModel      = model,
                    Watch3DViewModel = new DefaultWatch3DViewModel(null, new Watch3DViewModelStartupParams(model))
                    {
                        Active         = false,
                        CanBeActivated = false
                    }
                });

                var runner = new CommandLineRunnerWPF(viewModel);
                runner.Run(cmdLineArgs);
            }
            catch (Exception e)
            {
                try
                {
                    DynamoModel.IsCrashing = true;
                    Dynamo.Logging.Analytics.TrackException(e, true);
                }
                catch
                {
                }

                Console.WriteLine(e.Message);
                Console.WriteLine(e.StackTrace);
            }
        }
        public static DynamoSetup Create(string[] args = null)
        {
            if (args == null)
            {
                args = new string[] { "" };
            }
            var cmdLineArgs = StartupUtils.CommandLineArguments.Parse(args);
            var locale      = StartupUtils.SetLocale(cmdLineArgs);

            _putenv(locale);
            _commandFilePath = cmdLineArgs.CommandFilePath;
            ASMPath          = cmdLineArgs.ASMPath;
            var setup = new DynamoSetup();

            return(setup);
        }
示例#8
0
        public DynamoCoreSetup(string[] args)
        {
            var cmdLineArgs = StartupUtils.CommandLineArguments.Parse(args);
            var locale      = StartupUtils.SetLocale(cmdLineArgs);

            _putenv(locale);

            if (cmdLineArgs.DisableAnalytics)
            {
                Analytics.DisableAnalytics = true;
            }

            commandFilePath = cmdLineArgs.CommandFilePath;
            ASMPath         = cmdLineArgs.ASMPath;
            analyticsInfo   = cmdLineArgs.AnalyticsInfo;
        }
示例#9
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseHttpsRedirection();

            app.Use(StartupUtils.RouteInjections(app));

            StartupUtils.UseSwagger(app);

            app.UseRequestResponseLoggingMiddleware();

            app.UseRouting();

            app.UseAuthorization();

            app.UseEndpoints(endpoints => { endpoints.MapControllers(); });
        }
示例#10
0
        static internal void Main(string[] args)
        {
            try
            {
                var cmdLineArgs = StartupUtils.CommandLineArguments.Parse(args);
                var locale      = StartupUtils.SetLocale(cmdLineArgs);
                if (cmdLineArgs.DisableAnalytics)
                {
                    Dynamo.Logging.Analytics.DisableAnalytics = true;
                }

                DynamoModel model;
                if (!String.IsNullOrEmpty(cmdLineArgs.ASMPath))
                {
                    model = Dynamo.Applications.StartupUtils.MakeModel(true, cmdLineArgs.ASMPath);
                }
                else
                {
                    model = Dynamo.Applications.StartupUtils.MakeModel(true);
                }
                var runner = new CommandLineRunner(model);
                runner.Run(cmdLineArgs);
            }
            catch (Exception e)
            {
                try
                {
                    DynamoModel.IsCrashing = true;
                    Dynamo.Logging.Analytics.TrackException(e, true);
                }
                catch
                {
                }

                Console.WriteLine(e.Message);
                Console.WriteLine(e.StackTrace);
            }
        }
 private void AssemblyLoad(object sender, AssemblyLoadEventArgs args)
 {
     //push any exceptions generated before DynamoLoad to this list
     preLoadExceptions.AddRange(StartupUtils.CheckAssemblyForVersionMismatches(args.LoadedAssembly));
 }