Example #1
0
        [PrincipalPermission(SecurityAction.Demand)]  // Principal must be authenticated
        protected override void OnStartup(System.Windows.StartupEventArgs e)
        {
            Tracker.StartStudio();
            ShutdownMode = System.Windows.ShutdownMode.OnMainWindowClose;
            Task.Factory.StartNew(() =>
            {
                var path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), GlobalConstants.Warewolf, "Feedback");
                DirectoryHelper.CleanUp(path);
                DirectoryHelper.CleanUp(Path.Combine(GlobalConstants.TempLocation, GlobalConstants.Warewolf, "Debug"));
            });

            var localprocessGuard = new Mutex(true, GlobalConstants.WarewolfStudio, out bool createdNew);

            if (createdNew)
            {
                _processGuard = localprocessGuard;
            }
            else
            {
                Environment.Exit(Environment.ExitCode);
            }

            InitializeShell(e);
#if !(DEBUG)
            var versionChecker = new VersionChecker();
            if (versionChecker.GetNewerVersion())
            {
                WebLatestVersionDialog dialog = new WebLatestVersionDialog();
                dialog.ShowDialog();
            }
#endif
        }
Example #2
0
        [PrincipalPermission(SecurityAction.Demand)]  // Principal must be authenticated
        protected override void OnStartup(StartupEventArgs e)
        {
            Tracker.StartStudio();
            bool createdNew;

            Task.Factory.StartNew(() =>
            {
                var path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Warewolf", "Feedback");
                DirectoryHelper.CleanUp(path);
                DirectoryHelper.CleanUp(Path.Combine(GlobalConstants.TempLocation, "Warewolf", "Debug"));
            });

            // ReSharper disable once UnusedVariable
            var localprocessGuard = e.Args.Length > 0
                                        ? new Mutex(true, e.Args[0], out createdNew)
                                        : new Mutex(true, "Warewolf Studio", out createdNew);

            if (createdNew)
            {
                _processGuard = localprocessGuard;
            }
            else
            {
                Environment.Exit(Environment.ExitCode);
            }

            Browser.Startup();

            new Bootstrapper().Start();

            base.OnStartup(e);
            var settingsConfigFile = HelperUtils.GetStudioLogSettingsConfigFile();

            if (!File.Exists(settingsConfigFile))
            {
                File.WriteAllText(settingsConfigFile, GlobalConstants.DefaultStudioLogFileConfig);
            }
            XmlConfigurator.ConfigureAndWatch(new FileInfo(settingsConfigFile));
            _mainViewModel = MainWindow.DataContext as MainViewModel;
            //2013.07.01: Ashley Lewis for bug 9817 - setup exception handler on 'this', with main window data context as the popup dialog controller
            _appExceptionHandler = new AppExceptionHandler(this, _mainViewModel);

#if !(DEBUG)
            var versionChecker = new VersionChecker();
            if (versionChecker.GetNewerVersion())
            {
                WebLatestVersionDialog dialog = new WebLatestVersionDialog();
                dialog.ShowDialog();
            }
#endif
        }
Example #3
0
        [PrincipalPermission(SecurityAction.Demand)]  // Principal must be authenticated
        protected override void OnStartup(System.Windows.StartupEventArgs e)
        {
            CustomContainer.Register <IApplicationTracker>(ApplicationTrackerFactory.GetApplicationTrackerProvider());
            //Create configuration for action tracker and start
            var applicationTracker = CustomContainer.Get <IApplicationTracker>();

            if (applicationTracker != null)
            {
                applicationTracker.EnableAppplicationTracker(VersionInfo.FetchVersionInfo(), @"Warewolf" + $" ({ClaimsPrincipal.Current.Identity.Name})".ToUpperInvariant());
            }
            ShutdownMode = System.Windows.ShutdownMode.OnMainWindowClose;

            Task.Factory.StartNew(() =>
            {
                var dir  = new DirectoryHelper();
                var path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), GlobalConstants.Warewolf, "Feedback");
                dir.CleanUp(path);
                dir.CleanUp(Path.Combine(GlobalConstants.TempLocation, GlobalConstants.Warewolf, "Debug"));
            });

            var localprocessGuard = new Mutex(true, GlobalConstants.WarewolfStudio, out bool createdNew);

            if (createdNew)
            {
                _processGuard = localprocessGuard;
            }
            else
            {
                Environment.Exit(Environment.ExitCode);
            }

            InitializeShell(e);
#if !(DEBUG)
            var versionChecker = new VersionChecker();
            if (versionChecker.GetNewerVersion())
            {
                WebLatestVersionDialog dialog = new WebLatestVersionDialog();
                dialog.ShowDialog();
            }
#endif
        }
Example #4
0
        [PrincipalPermission(SecurityAction.Demand)]  // Principal must be authenticated
        protected override void OnStartup(StartupEventArgs e)
        {
            Tracker.StartStudio();
            bool createdNew;

            Task.Factory.StartNew(() =>
            {
                var path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Warewolf", "Feedback");
                DirectoryHelper.CleanUp(path);
                DirectoryHelper.CleanUp(Path.Combine(GlobalConstants.TempLocation, "Warewolf", "Debug"));
            });

            // ReSharper disable once UnusedVariable
            var localprocessGuard = e.Args.Length > 0
                                        ? new Mutex(true, e.Args[0], out createdNew)
                                        : new Mutex(true, "Warewolf Studio", out createdNew);

            if (createdNew)
            {
                _processGuard = localprocessGuard;
            }
            else
            {
                Environment.Exit(Environment.ExitCode);
            }



            InitializeShell(e);
#if !(DEBUG)
            var versionChecker = new VersionChecker();
            if (versionChecker.GetNewerVersion())
            {
                WebLatestVersionDialog dialog = new WebLatestVersionDialog();
                dialog.ShowDialog();
            }
#endif
        }