Ejemplo n.º 1
0
        private void ShellOnSolutionChanged(object sender, SolutionChangedEventArgs e)
        {
            if (e.NewValue != null)
            {
                var newProject = new RecentProject
                {
                    Name = e.NewValue.Name,
                    Path = e.NewValue.Location
                };

                if (RecentProjectsCollection.RecentProjects == null)
                {
                    RecentProjectsCollection.RecentProjects = new List <RecentProject>();
                }

                if (RecentProjectsCollection.RecentProjects.Contains(newProject))
                {
                    RecentProjectsCollection.RecentProjects.Remove(newProject);
                }

                RecentProjectsCollection.RecentProjects.Insert(0, newProject);

                RecentProjectsCollection.Save();

                LoadRecentProjects();
            }
        }
Ejemplo n.º 2
0
        private void ShellOnSolutionChanged(object sender, SolutionChangedEventArgs e)
        {
            if (e.NewValue != null)
            {
                var newProject = new RecentProject
                {
                    Name = e.NewValue.Name,
                    Path = e.NewValue.CurrentDirectory
                };

                if (RecentProjectsCollection.RecentProjects == null)
                {
                    RecentProjectsCollection.RecentProjects = new List <RecentProject>();
                }

                if (RecentProjectsCollection.RecentProjects.Contains(newProject))
                {
                    RecentProjectsCollection.Save();
                    return;
                }

                RecentProjectsCollection.RecentProjects.Add(newProject);

                RecentProjectsCollection.Save();
            }
        }
        private void SolutionPathChanged(object sender, SolutionChangedEventArgs e)
        {
            bool preferredViewSelected = TrySelectPreferredView(e);

            if (!preferredViewSelected)
            {
                // If correct view was already selected, or view doesn't exists, manually update the link icon
                UpdateJobLinkedStatus(e.SolutionPath);
            }
        }
Ejemplo n.º 4
0
 private void ModuleData_SolutionChangedEvent(object sender, SolutionChangedEventArgs <int[]> args)
 {
     if (args.CurrentSolution == null)
     {
         ImageA.Source = null;
         ImageB.Source = null;
         ImageC.Source = null;
         ImageD.Source = null;
         bool skip;
         if (ModuleData.OtherOptions == null)
         {
             skip = true;
         }
         else
         {
             skip = ModuleData.OtherOptions.Count == 0;
         }
         foreach (ListBoxItem item in MainSelection.Items)
         {
             if (skip)
             {
                 item.IsEnabled = true;
             }
             else if (ModuleData.OtherOptions.Remove((int)item.Tag))
             {
                 item.IsEnabled = true;
             }
             else
             {
                 item.IsEnabled = false;
             }
         }
     }
     else
     {
         SetSource(ImageA, args.CurrentSolution[0]);
         SetSource(ImageB, args.CurrentSolution[1]);
         SetSource(ImageC, args.CurrentSolution[2]);
         SetSource(ImageD, args.CurrentSolution[3]);
     }
 }
Ejemplo n.º 5
0
        void solutionMonitor_SolutionChanged(object sender, SolutionChangedEventArgs e)
        {
            switch (e.ChangeType)
            {
            case SolutionChangeType.Loaded:
                if (!_isInitialized)
                {
                    Initialize();
                }
                OnTestContainersUpdated();
                break;

            case SolutionChangeType.Unloaded:
                _containerCache.Clear();

                _fileWatcher.EnableRaisingEvents = false;
                _fileWatcher.Changed            -= fileWatcher_Changed;
                _isInitialized = false;
                break;
            }
        }
        private bool TrySelectPreferredView(SolutionChangedEventArgs e)
        {
            if (!ApiHandlerSettingsManager.ContainsSolutionPreference(e.SolutionPath))
            {
                return(false);
            }

            var jobLink       = ApiHandlerSettingsManager.GetJobLink(e.SolutionPath);
            var jobLinkServer = JenkinsServers.FirstOrDefault((s) => string.Equals(s.Url, jobLink.JenkinsServerUrl, StringComparison.InvariantCultureIgnoreCase));

            if (jobLinkServer == null)
            {
                // server has been removed
                return(false);
            }

            bool preferredViewSelected = false;

            if (SelectedJenkinsServer == jobLinkServer)
            {
                // Correct server already selected, just fix the view
                var preferredView = _jenkinsViews.FirstOrDefault((j) => string.Equals(j.Name, jobLink.JenkinsViewName));
                if (preferredView != null)
                {
                    SelectedView          = preferredView;
                    preferredViewSelected = true;
                }
            }
            else
            {
                SelectNewJenkinsServer(jobLinkServer, jobLink.JenkinsViewName);
                preferredViewSelected = true;
            }

            return(preferredViewSelected);
        }
 private void ModuleData_SolutionChangedEvent(object sender, SolutionChangedEventArgs <int> args)
 {
     DefusalPage.SetOutput(string.Format("Cut wire {0}", args.CurrentSolution));
 }
Ejemplo n.º 8
0
 private void ModuleData_SolutionChangedEvent(object sender, SolutionChangedEventArgs <HashSet <string> > args)
 {
     DefusalPage.MessageOutput.Text = string.Join(",", args.CurrentSolution);
 }
        private void RaiseSolutionChanged()
        {
            var eventArgs = SolutionChangedEventArgs.FromDTE(this.dte);

            this.SolutionChanged.Raise(this, eventArgs);
        }
Ejemplo n.º 10
0
 private void ModuleData_SolutionChangedEvent(object sender, SolutionChangedEventArgs <ButtonPhase> args)
 {
     DefusalPage.MessageOutput.Text = args.CurrentSolution.ToString();
 }
 private void ModuleData_SolutionChangedEvent(object sender, SolutionChangedEventArgs <HashSet <MorseResponse> > args)
 {
     DefusalPage.MessageOutput.Text = string.Join(",", args.CurrentSolution.Select(x => x.Word).ToArray());
 }