Exemplo n.º 1
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
#if (!DEBUG)
            RemoteLogger.WriteLogAsync(MessageType.Starting);
#else
            //RemoteLogger.ReportIssue("errType", "errMessage", "errTrace");
            //RemoteLogger.WriteLogAsync(MessageType.Error, "message", "trace");
#endif

            var mainWindow = new MainWindow();

            if (AppDomain.CurrentDomain != null &&
                AppDomain.CurrentDomain.SetupInformation != null &&
                AppDomain.CurrentDomain.SetupInformation.ActivationArguments != null)
            {
                string[] activationData = AppDomain.CurrentDomain.SetupInformation.ActivationArguments.ActivationData;
                if (activationData != null && activationData.Length > 0)
                {
                    Uri    uri  = new Uri(activationData[0]);
                    string path = uri.LocalPath;

                    if (path.EndsWith(".vislab") && File.Exists(path))
                    {
                        mainWindow.OpenProject(path);
                    }
                }
            }

            mainWindow.Show();
        }