Esempio n. 1
0
        protected void InitializeShell(StartupEventArgs e)
        {
            _resetSplashCreated = new ManualResetEvent(false);

            _splashThread = new Thread(ShowSplash);
            _splashThread.SetApartmentState(ApartmentState.STA);
            _splashThread.IsBackground = true;
            _splashThread.Name         = "Splash Screen";
            _splashThread.Start();
            _resetSplashCreated.WaitOne();
            new Bootstrapper().Start();

            base.OnStartup(e);
            _shellViewModel = MainWindow.DataContext as ShellViewModel;
            if (_shellViewModel != null)
            {
                CreateDummyWorkflowDesignerForCaching();
                SplashView.CloseSplash();
                CheckForDuplicateResources();
                var settingsConfigFile = HelperUtils.GetStudioLogSettingsConfigFile();
                if (!File.Exists(settingsConfigFile))
                {
                    File.WriteAllText(settingsConfigFile, GlobalConstants.DefaultStudioLogFileConfig);
                }
                Dev2Logger.AddEventLogging(settingsConfigFile, "Warewolf Studio");
                XmlConfigurator.ConfigureAndWatch(new FileInfo(settingsConfigFile));
                _appExceptionHandler = new AppExceptionHandler(this, _shellViewModel);
            }
            var toolboxPane = Current.MainWindow.FindName("Toolbox") as ContentPane;

            toolboxPane?.Activate();
        }
Esempio n. 2
0
        public virtual void Save(LoggingSettingsTo logSettings)
        {
            logSettings.LogLevel = ServerLogLevel.ToString();
            logSettings.LogSize  = int.Parse(ServerLogMaxSize);
            var settingsConfigFile = HelperUtils.GetStudioLogSettingsConfigFile();

            Dev2Logger.WriteLogSettings(StudioLogMaxSize, StudioLogLevel.ToString(), settingsConfigFile);
        }
Esempio n. 3
0
        public virtual void Save(LoggingSettingsTo logSettings)
        {
            logSettings.EventLogLoggerLogLevel = ServerEventLogLevel.ToString();
            logSettings.FileLoggerLogSize      = int.Parse(ServerLogMaxSize);
            var settingsConfigFile = HelperUtils.GetStudioLogSettingsConfigFile();

            Dev2Logger.WriteLogSettings(StudioLogMaxSize, StudioFileLogLevel.ToString(), StudioEventLogLevel.ToString(), settingsConfigFile, "Warewolf Studio");
            SetItem(this);
        }
Esempio n. 4
0
        static void ConfigureLogging()
        {
            var settingsConfigFile = HelperUtils.GetStudioLogSettingsConfigFile();

            if (!File.Exists(settingsConfigFile))
            {
                File.WriteAllText(settingsConfigFile, GlobalConstants.DefaultStudioLogFileConfig);
            }
            Dev2Logger.AddEventLogging(settingsConfigFile, GlobalConstants.WarewolfStudio);
            XmlConfigurator.ConfigureAndWatch(new FileInfo(settingsConfigFile));
        }
Esempio n. 5
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
        }
Esempio n. 6
0
        public void HelperUtils_GetStudioLogSettingsConfigFile()
        {
            var settingsConfigFile = HelperUtils.GetStudioLogSettingsConfigFile();

            Assert.IsTrue(settingsConfigFile.Contains("Settings.config"));
        }