Example #1
0
 private void Setup()
 {
     _runningApplication = RunningApplication.Instance();
     _correctLoginColor  = new SolidColorBrush(Color.FromRgb(51, 51, 51));
     _wrongLoginColor    = new SolidColorBrush(Color.FromRgb(255, 117, 117));
     SetConfigurationText();
 }
 public SettingsImageReminder()
 {
     _runningApplication = RunningApplication.Instance();
     InitializeComponent();
     _configuration = _runningApplication.Services.ProgramConfiguration.TempConfiguration;
     DataContext    = _configuration;
     SetNewestImagePath();
 }
Example #3
0
 public SystemLevelEditor()
 {
     _runningApplication = RunningApplication.Instance();
     if (!_runningApplication.UnitTestSetup)
     {
         InitializeComponent();
     }
 }
 public RunningWebProxy(ServicesKeyword servicesKeyword)
 {
     _runningApplication = RunningApplication.Instance();
     _webProxy           = new LocalWebProxy();
     ProxyIsEnabled      = servicesKeyword.ProgramConfiguration.Configuration.ProxyEnabled;
     ProxyIsRunning      = false;
     SetupWebProxyForProgramStart(servicesKeyword);
 }
        public void Logout()
        {
            Hide();
            CloseWindowOperations();
            Thread.Sleep(200);

            RunningApplication.Instance().UI.Login.Show();
        }
        public void SetupUnlockedRunningApplication()
        {
            string password = "******";

            Application = new RunningApplication(true, TempFolder.Name);
            Application.Services.UserConfiguration.CreateNewConfiguration(password);
            Application.UI.LoginInMainViewWithoutShowing(password);
        }
        public ProgramConfigurationSupplier()
        {
            _runningApplication = RunningApplication.Instance();
            ConfigurationPath   =
                $"{RunningApplication.ProgramSettingsPath()}\\.backOnTrack\\config.settings";
            Autorun = new AutorunHelper();

            SetCurrentConfigurationFromConfig();
        }
        public CrystalQuartzPanelMiddleware(
            OwinMiddleware next,
            ISchedulerProvider schedulerProvider,
            Options options) : base(next)
        {
            Application application = new CrystalQuartzPanelApplication(schedulerProvider, options);

            _runningApplication = application.Run();
        }
Example #9
0
 public ImageReminderView(ModernWindow wnd, ViewProfiles viewProfiles)
 {
     _runningApplication = RunningApplication.Instance();
     InitializeComponent();
     _userCancelledAction = false;
     _window        = wnd;
     _baseView      = viewProfiles;
     _configuration = _runningApplication.Services.ProgramConfiguration.TempConfiguration;
     Setup();
 }
Example #10
0
        public bool TryTerminate(RunningApplication application)
        {
            var success = true;

            foreach (var process in application.Processes)
            {
                success &= TryTerminate(process);
            }

            return(success);
        }
        public CrystalQuartzPanelMiddleware(
            RequestDelegate next,
            ISchedulerProvider schedulerProvider,
            Options options)
        {
            _next = next;

            var application = new CrystalQuartzPanelApplication(schedulerProvider, options);

            _runningApplication = application.Run();
        }
Example #12
0
 public UiKeyword(bool openLoginView = true)
 {
     _runningApplication = RunningApplication.Instance();
     Login = new LoginWindow();
     if (!_runningApplication.UnitTestSetup)
     {
         if (openLoginView)
         {
             Login.Show();
         }
     }
 }
Example #13
0
        private void AddForTermination(string name, IProcess process, InitializationResult result)
        {
            var application = result.RunningApplications.FirstOrDefault(a => a.Name == name);

            if (application == default(RunningApplication))
            {
                application = new RunningApplication(name);
                result.RunningApplications.Add(application);
            }

            application.Processes.Add(process);
            logger.Debug($"Process {process} belongs to application '{application.Name}' and needs to be terminated.");
        }
        public CrystalQuartzPanelMiddleware(
            OwinMiddleware next,
            ISchedulerProvider schedulerProvider,
            CrystalQuartzOptions options) : base(next)
        {
            Application application = new CrystalQuartzPanelApplication(
                schedulerProvider,
                new DefaultSchedulerDataProvider(schedulerProvider),
                options);

            this.options        = options;
            _runningApplication = application.Run();
        }
Example #15
0
        private void AddFailed(string name, IProcess process, InitializationResult result)
        {
            var application = result.FailedAutoTerminations.FirstOrDefault(a => a.Name == name);

            if (application == default(RunningApplication))
            {
                application = new RunningApplication(name);
                result.FailedAutoTerminations.Add(application);
            }

            application.Processes.Add(process);
            logger.Error($"Process {process} belongs to application '{application.Name}' and could not be terminated automatically!");
        }
Example #16
0
        private void AddFailed(IProcess process, List <RunningApplication> failed)
        {
            var name        = blacklist.First(a => BelongsToApplication(process, a)).ExecutableName;
            var application = failed.FirstOrDefault(a => a.Name == name);

            if (application == default(RunningApplication))
            {
                application = new RunningApplication(name);
                failed.Add(application);
            }

            application.Processes.Add(process);
        }
        public SpecificProfileView(string profileName)
        {
            _runningApplication = RunningApplication.Instance();

            if (!_runningApplication.UnitTestSetup)
            {
                InitializeComponent();
            }

            this.DataContext = this;
            _profileName     = profileName;
            Setup(_profileName);
            EntryEditButtonIsEnabled = true;
        }
Example #18
0
        static PagesHandler()
        {
            var options = new CrystalQuartzOptions
            {
                CustomCssUrl = Configuration.ConfigUtils.CustomCssUrl
            };

            ISchedulerProvider schedulerProvider = Configuration.ConfigUtils.SchedulerProvider;

            Application application = new CrystalQuartzPanelApplication(
                schedulerProvider,
                options.ToRuntimeOptions(SchedulerEngineProviders.SchedulerEngineResolvers, FrameworkVersion.Value));

            RunningApplication = application.Run();
        }
Example #19
0
        static PagesHandler()
        {
            var options = new CrystalQuartzOptions
            {
                CustomCssUrl = Configuration.ConfigUtils.CustomCssUrl
            };

            ISchedulerProvider     schedulerProvider     = Configuration.ConfigUtils.SchedulerProvider;
            ISchedulerDataProvider schedulerDataProvider = new DefaultSchedulerDataProvider(schedulerProvider);

            Application application = new CrystalQuartzPanelApplication(
                schedulerProvider,
                schedulerDataProvider,
                options);

            RunningApplication = application.Run();
        }
Example #20
0
        protected override object LoadContent(Uri uri)
        {
            try
            {
                if (uri.ToString().Contains("/UI/MainView/Pages/Profiles/EmptyView.xaml"))
                {
                    return(new EmptyView());
                }

                return(new SpecificProfileView(uri.ToString().Substring(1)));
            }
            catch (System.InvalidOperationException)
            {
                //happens when specificProfileView is reloaded but old specificProfileView is still in editing mode
                string alertTitle   = "Could not load profile.";
                string alertContent =
                    "Could not load profile, try opening the page again with the menu. If is doesn`t work, save your changes, log out and back in.";
                RunningApplication.Instance().UI.MainView.CreateAlertWindow(alertTitle, alertContent);

                return(new EmptyView());
            }
        }
        public MainView(CurrentUserConfiguration userConfiguration, string password)
        {
            _runningApplication = RunningApplication.Instance();

            if (!_runningApplication.UnitTestSetup)
            {
                InitializeComponent();
                App.Current.MainWindow = _runningApplication.UI.MainView; //fix for the dialogWindow
            }

            UserConfiguration = userConfiguration;
            _password         = password;

            if (!_runningApplication.UnitTestSetup)
            {
                WindowIsShown = true;
            }
            else
            {
                WindowIsShown = false;
            }

            IsInEntryEditingMode = false;
        }
 public Shutdown()
 {
     _runningApplication = RunningApplication.Instance();
     InitializeComponent();
 }
 public SettingsGeneral()
 {
     _runningApplication = RunningApplication.Instance();
     InitializeComponent();
     DataContext = _runningApplication.Services.ProgramConfiguration.TempConfiguration;
 }
Example #24
0
        void Debug_Start(DocTabPage currentTab)
        {
            lock (this)
            {
                if (currentTab == null)
                {
                    return;
                }

                if (_RunningApplication.IsRunning)
                {
                    //Code is already running but the run icon was enabled... must be a debug continue.
                    Debug_Break_Continue();
                    return;
                }

                _RunningApplication = new RunningApplication();

                _RunningApplication.OriginalTab               = currentTab;
                _RunningApplication.Form                      = this;
                _RunningApplication.InstanceId                = "IDE_" + Guid.NewGuid().ToString();
                _RunningApplication.IsRunning                 = true;
                _RunningApplication.WasAttach                 = false;
                _RunningApplication.AttachProcessId           = 0;
                _RunningApplication.pAddErrorToList           = AddErrorToList;
                _RunningApplication.pAddOutputToList          = AddOutputToList;
                _RunningApplication.pExecutionBegin           = ExecutionBegin;
                _RunningApplication.pExecutionComplete        = ExecutionComplete;
                _RunningApplication.pBreakPointHit            = BreakPointHit;
                _RunningApplication.pUpdateWatchValue         = UpdateWatchValue;
                _RunningApplication.pQuickWatchInfo           = QuickWatchInfo;
                _RunningApplication.pAddImmediateInfo         = AddImmediateInfo;
                _RunningApplication.pUpdateLocalsValue        = UpdateLocalsValue;
                _RunningApplication.pAddFileToGrid            = AddFileToGrid;
                _RunningApplication.pAutosizeFileGrid         = AutosizeFileGrid;
                _RunningApplication.pClearFilesGrid           = ClearFilesGrid;
                _RunningApplication.pRemoveNonUpdatedLocals   = RemoveNonUpdatedLocals;
                _RunningApplication.pToolTipSymbolInfo        = ToolTipSymbolInfo;
                _RunningApplication.pImmediateAutoListBegin   = ImmediateAutoListBegin;
                _RunningApplication.pImmediateAutoListEnd     = ImmediateAutoListEnd;
                _RunningApplication.pImmediateAutoListAddWord = ImmediateAutoListAddWord;

                DeleteAllSystemAddedWatchValues();

                SetIconsRunning();

                if (currentTab != null)
                {
                    _ErrorGrid.Rows.Clear();

                    if (_OutputSplitter.Panel2Collapsed)
                    {
                        _OutputSplitter.Panel2Collapsed = false;
                    }

                    _OutputBox.Text = "";

                    bool   isTempFile     = false;
                    string scriptFileName = "";

                    if (currentTab.CodeEditor.FileName == "" || currentTab.CodeEditor.FileName == null)
                    {
                        string tabText = currentTab.Text;

                        System.Random rand        = new System.Random();
                        Double        randomValue = rand.NextDouble() * 1234.0;
                        scriptFileName = System.IO.Path.GetTempPath() + "\\Script_" + randomValue + global.CodeFileExtension;

                        scriptFileName = scriptFileName.Replace("/", "\\");
                        scriptFileName = scriptFileName.Replace("\\\\", "\\");

                        currentTab.CodeEditor.Save(scriptFileName);
                        currentTab.Text = tabText;

                        isTempFile = true;
                    }
                    else
                    {
                        scriptFileName = currentTab.CodeEditor.FileName;
                        if (!SaveTab(currentTab))
                        {
                            _RunningApplication.IsRunning = false;
                            SetIconsStopped();
                            return;
                        }
                    }

                    _RunningApplication.Engine = global.GetRegistryString("", "Engine");
                    _RunningApplication.Script = scriptFileName;
                    if (isTempFile)
                    {
                        currentTab.TempFileName = scriptFileName;
                    }
                    else
                    {
                        currentTab.TempFileName = null;
                    }

                    if (_RunningApplication.Engine != "" && _RunningApplication.Engine != null)
                    {
                        if (System.IO.File.Exists(_RunningApplication.Engine))
                        {
                            _RunningApplication.ProcessMonitorThread = new System.Threading.Thread(ProcessMonitorThread);
                            _RunningApplication.ProcessMonitorThread.Start();
                        }
                        else
                        {
                            MessageBox.Show("Cannot find the scripting engine. Is it installed?");
                        }
                    }
                    else
                    {
                        MessageBox.Show("Cannot find the scripting engine. Is it installed?");
                    }
                }

                //Somthing went wrong if the thread was not started, reset everyting back to a non-running state.
                if (_RunningApplication.ProcessMonitorThread == null)
                {
                    _RunningApplication.IsRunning = false;
                    SetIconsStopped();
                    _RunningApplication.Form.Invoke(_RunningApplication.pExecutionComplete);
                }
            }
        }
 public SystemLevelConfigurationSupplier()
 {
     ConfigurationPath =
         $"{RunningApplication.ProgramSettingsPath()}\\.backOnTrack";
 }
Example #26
0
        void Debug_Attach(int attachProcessId)
        {
            lock (this)
            {
                if (_RunningApplication.IsRunning)
                {
                    //Code is already running but the run icon was enabled... must be a debug continue.
                    Debug_Break_Continue();
                    return;
                }

                _RunningApplication = new RunningApplication();

                _RunningApplication.OriginalTab               = null;
                _RunningApplication.Form                      = this;
                _RunningApplication.InstanceId                = attachProcessId.ToString();
                _RunningApplication.IsRunning                 = true;
                _RunningApplication.WasAttach                 = true;
                _RunningApplication.AttachProcessId           = attachProcessId;
                _RunningApplication.pAddErrorToList           = AddErrorToList;
                _RunningApplication.pAddOutputToList          = AddOutputToList;
                _RunningApplication.pExecutionBegin           = ExecutionBegin;
                _RunningApplication.pExecutionComplete        = ExecutionComplete;
                _RunningApplication.pBreakPointHit            = BreakPointHit;
                _RunningApplication.pUpdateWatchValue         = UpdateWatchValue;
                _RunningApplication.pQuickWatchInfo           = QuickWatchInfo;
                _RunningApplication.pAddImmediateInfo         = AddImmediateInfo;
                _RunningApplication.pUpdateLocalsValue        = UpdateLocalsValue;
                _RunningApplication.pAddFileToGrid            = AddFileToGrid;
                _RunningApplication.pAutosizeFileGrid         = AutosizeFileGrid;
                _RunningApplication.pClearFilesGrid           = ClearFilesGrid;
                _RunningApplication.pRemoveNonUpdatedLocals   = RemoveNonUpdatedLocals;
                _RunningApplication.pToolTipSymbolInfo        = ToolTipSymbolInfo;
                _RunningApplication.pImmediateAutoListBegin   = ImmediateAutoListBegin;
                _RunningApplication.pImmediateAutoListEnd     = ImmediateAutoListEnd;
                _RunningApplication.pImmediateAutoListAddWord = ImmediateAutoListAddWord;

                DeleteAllSystemAddedWatchValues();

                SetIconsRunning();

                _ErrorGrid.Rows.Clear();

                if (_OutputSplitter.Panel2Collapsed)
                {
                    _OutputSplitter.Panel2Collapsed = false;
                }

                _OutputBox.Text = "";

                _RunningApplication.ProcessMonitorThread = new System.Threading.Thread(ProcessMonitorThread);
                _RunningApplication.ProcessMonitorThread.Start();

                //Somthing went wrong if the thread was not started, reset everyting back to a non-running state.
                if (_RunningApplication.ProcessMonitorThread == null)
                {
                    _RunningApplication.IsRunning = false;
                    SetIconsStopped();
                    _RunningApplication.Form.Invoke(_RunningApplication.pExecutionComplete);
                }
            }
        }
Example #27
0
 public Logout()
 {
     _runningApplication = RunningApplication.Instance();
     InitializeComponent();
 }
 public static List <string> GetListOfAllAlreadyUsedAddresses()
 {
     return((from profile in RunningApplication.Instance().UI.MainView.UserConfiguration.ProfileList from entry in profile.EntryList select entry.Url).ToList());
 }
 public AddressValidationRule()
 {
     _runningApplication = RunningApplication.Instance();
 }
 public UserConfigurationOnSystemLevel()
 {
     _runningApplication = RunningApplication.Instance();
 }