Example #1
0
 void SolutionLoaded(object sender, SolutionEventArgs e)
 {
     foreach (IProject project in e.Solution.Projects)
     {
         CreateTypeScriptContextIfProjectHasTypeScriptFiles(project);
     }
 }
Example #2
0
        //public class LinearSolutionEventArgs : EventArgs
        //{
        //    public int VariableCount { get; private set; }

        //    public int ConstraintCount { get; private set; }

        //    public LinearResultStatus ResultStatus { get; private set; }

        //    public dynamic SolutionValues { get; private set; }

        //    internal LinearSolutionEventArgs(int variableCount, int constraintCount, LinearResultStatus resultStatus,
        //        dynamic solutionValues)
        //    {
        //        VariableCount = variableCount;
        //        ConstraintCount = constraintCount;
        //        ResultStatus = resultStatus;
        //        SolutionValues = solutionValues;
        //    }
        //}

        //public event EventHandler<LinearSolutionEventArgs> Solved;

        //private void OnSolved(LinearSolutionEventArgs e)
        //{
        //    Solved?.Invoke(this, e);
        //}

        protected override void ReceiveSolution(Solver solver, LinearResultStatus resultStatus, dynamic problem)
        {
            var solution = resultStatus == Optimal || resultStatus == Feasible;
            var e        = new SolutionEventArgs(solver, resultStatus, solution, GetSolutionValues(problem));

            OnSolved(e);
        }
Example #3
0
 void OnSettingsChanged(object sender, SolutionEventArgs e)
 {
     if (SettingsChanged != null)
     {
         SettingsChanged(this, new EventArgs());
     }
 }
Example #4
0
 private void ProjectManager_SolutionClosed(object sender, SolutionEventArgs e)
 {
     this.FilterString = null;
     this.CleanupClosedSolution(e.Solution);
     this.EnableSearch = false;
     this.OnPropertyChanged("RootItem");
 }
Example #5
0
 internal static void OnSolutionCreated(SolutionEventArgs e)
 {
     if (SolutionCreated != null)
     {
         SolutionCreated(null, e);
     }
 }
        private void OnSolutionOpened(object sender, SolutionEventArgs e)
        {
            var pathExpression1 = Path.Combine(SolutionExtensions.SolutionItemsFolderName, string.Concat(@"*", Runtime.StoreConstants.RuntimeStoreExtension));
            var pathExpression2 = string.Concat(@"*", Runtime.StoreConstants.RuntimeStoreExtension);

            // Ensure solution contains at least one state file
            if (e.Solution != null)
            {
                // Search Solution Items folder
                var solutionFiles = e.Solution.Find <IItem>(pathExpression1);
                if (solutionFiles.Any())
                {
                    SolutionBuilderToolWindow.AutoOpenWindow(this);
                }
                else
                {
                    // Search whole solution for state file.
                    solutionFiles = e.Solution.Find <IItem>(pathExpression2);
                    if (solutionFiles.Any())
                    {
                        SolutionBuilderToolWindow.AutoOpenWindow(this);
                    }
                }
            }

            if (!this.GuidanceManager.IsOpened)
            {
                this.GuidanceManager.Open(new SolutionDataState(this.Solution));

                // Open guidance windows
                GuidanceExplorerToolWindow.AutoOpenWindow(this);
                //GuidanceBrowserToolWindow.OpenWindow(this);
            }
        }
Example #7
0
 static void OnSolutionSaved(SolutionEventArgs e)
 {
     if (SolutionSaved != null)
     {
         SolutionSaved(null, e);
     }
 }
Example #8
0
 static void OnSolutionClosing(SolutionEventArgs e)
 {
     if (SolutionClosing != null)
     {
         SolutionClosing(null, e);
     }
 }
Example #9
0
 void SolutionLoaded(object sender, SolutionEventArgs e)
 {
     foreach (MessageViewCategory category in messageCategories)
     {
         category.ClearText();
     }
 }
Example #10
0
        ///--------------------------------------------------------------------------------
        /// <summary>This method updates the view model data and sends update command back
        /// to the solution builder.</summary>
        ///--------------------------------------------------------------------------------
        protected override void OnUpdate()
        {
            foreach (WorkspaceViewModel view in ItemsToTag)
            {
                if (view.IsSelected == true)
                {
                    if (ItemsTagged[view.ItemID.ToString()] == null)
                    {
                        // add tag
                        view.Item.AddTag(SelectedTag);
                        AddTagToUsedTags(view.ItemID, SelectedTag);
                    }
                }
                else
                {
                    if (ItemsTagged[view.ItemID.ToString()] != null)
                    {
                        // remove tag
                        view.Item.RemoveTag(SelectedTag);
                        RemoveTagFromUsedTags(view.ItemID, SelectedTag);
                    }
                }
            }
            ItemsTagged = null;
            SelectedTag = null;
            SelectAll   = false;

            // refresh solution
            SolutionEventArgs message = new SolutionEventArgs();

            message.Solution   = Solution;
            message.SolutionID = Solution.SolutionID;
            Mediator.NotifyColleagues <SolutionEventArgs>(MediatorMessages.Command_RefreshSolutionRequested, message);
        }
Example #11
0
 private static void HandleSolutionChanged(object sender, SolutionEventArgs e)
 {
     if (e.Solution == null)
     {
         return;
     }
     VersionHelper.SetDefaultSerializer(e.Solution);
 }
Example #12
0
 void SolutionLoaded(object sender, SolutionEventArgs e)
 {
     try {
         OnSolutionLoaded(e.Solution).Ignore();
     } catch (Exception ex) {
         LoggingService.LogError("TaskRunnerWorkspace SolutionLoaded error", ex);
     }
 }
Example #13
0
 public void DispatchSolutionLoad(SolutionEventArgs e)
 {
     CurrentSolution = e.TargetSolution;
     if (SolutionLoad != null)
     {
         SolutionLoad(this, e);
     }
 }
 void SolutionOpened(object sender, SolutionEventArgs e)
 {
     try {
         RunPackageInitializationScripts(e.Solution);
     } catch (Exception ex) {
         scriptsConsole.WriteError(ex.Message);
     }
 }
Example #15
0
 private void _extensionHost_SolutionLoad(object sender, SolutionEventArgs e)
 {
     _solution = _extensionHost.CurrentSolution;
     _solution.Settings.StartupProjects.InsertedItem += StartupProjects_Changed;
     _solution.Settings.StartupProjects.RemovedItem  += StartupProjects_Changed;
     contextMenuStrip1.Renderer = _extensionHost.ControlManager.MenuRenderer;
     mainTreeView.Nodes.Add(new SolutionNode(_solution, _iconProvider));
 }
Example #16
0
        ///--------------------------------------------------------------------------------
        /// <summary>This method opens a solution.</summary>
        ///--------------------------------------------------------------------------------
        public void OpenSolution(string path)
        {
            SolutionEventArgs message = new SolutionEventArgs();

            message.Path        = path;
            message.WorkspaceID = WorkspaceID;
            Mediator.NotifyColleagues <SolutionEventArgs>(MediatorMessages.Command_OpenSolutionRequested, message);
        }
Example #17
0
 public void DispatchSolutionUnload(SolutionEventArgs e)
 {
     CurrentSolution.Dispose();
     CurrentSolution = null;
     if (SolutionUnload != null)
     {
         SolutionUnload(this, e);
     }
 }
Example #18
0
 void SolutionUnloaded(object sender, SolutionEventArgs e)
 {
     try {
         StopRunningTasks();
         RemoveTasks(e.Solution);
     } catch (Exception ex) {
         LoggingService.LogError("TaskRunnerWorkspace SolutionUnloaded error", ex);
     }
 }
Example #19
0
        private void _extensionHost_SolutionLoad(object sender, SolutionEventArgs e)
        {
            _extensionHost.CurrentSolution.BuildStarted   += CurrentSolution_BuildOrCleanStarted;
            _extensionHost.CurrentSolution.BuildCompleted += CurrentSolution_BuildCompleted;
            _extensionHost.CurrentSolution.CleanStarted   += CurrentSolution_BuildOrCleanStarted;
            _extensionHost.CurrentSolution.CleanCompleted += CurrentSolution_CleanCompleted;

            EnableInitialDebuggerItems();
        }
Example #20
0
        ///--------------------------------------------------------------------------------
        /// <summary>This method processes the new solution command.</summary>
        ///--------------------------------------------------------------------------------
        public void ProcessNewSolutionCommand()
        {
            SolutionEventArgs message = new SolutionEventArgs();

            message.Solution            = new Solution();
            message.Solution.SolutionID = Guid.NewGuid();
            message.WorkspaceID         = WorkspaceID;
            Mediator.NotifyColleagues <SolutionEventArgs>(MediatorMessages.Command_EditSolutionRequested, message);
        }
Example #21
0
        ///--------------------------------------------------------------------------------
        /// <summary>This method starts a new solution.</summary>
        ///--------------------------------------------------------------------------------
        protected virtual void OnNewSolution()
        {
            SolutionEventArgs message = new SolutionEventArgs();

            message.Solution            = new Solution();
            message.Solution.SolutionID = Guid.NewGuid();
            message.WorkspaceID         = WorkspaceID;
            Mediator.NotifyColleagues <SolutionEventArgs>(MediatorMessages.Command_EditSolutionRequested, message);
        }
        static void SolutionLoaded(object sender, SolutionEventArgs e)
        {
            var solutionCodeCoverageResults = new SolutionCodeCoverageResults(e.Solution);

            foreach (CodeCoverageResults results in solutionCodeCoverageResults.GetCodeCoverageResultsForAllProjects())
            {
                ShowResults(results);
            }
        }
        void SolutionEventsOnOpened(object sender, SolutionEventArgs args)
        {
            var solution     = args.Solution;
            var solutionName = (solution == null)
                ? GetActiveSolutionPath()
                : solution.FileName.FileName;

            OnSolutionOpened(solutionName);
        }
Example #24
0
        private void ProjectManager_SolutionClosing(object sender, SolutionEventArgs e)
        {
            ISolutionManagement solution = e.Solution as ISolutionManagement;

            if (solution != null)
            {
                this.PersistProjectNodeState(solution);
            }
        }
Example #25
0
        ///--------------------------------------------------------------------------------
        /// <summary>This method applies solution updates.</summary>
        ///--------------------------------------------------------------------------------
        public void ProcessEditSolutionPerformed(SolutionEventArgs data)
        {
            try
            {
                bool isItemMatch = false;
                if (data != null && data.Solution != null)
                {
                    foreach (SolutionViewModel item in Solutions)
                    {
                        if (item.Solution.SolutionID == data.Solution.SolutionID)
                        {
                            isItemMatch = true;
                            item.Solution.TransformDataFromObject(data.Solution, null, false);

                            #region protected
                            if (!String.IsNullOrEmpty(item.Solution.TemplatePath))
                            {
                                if (item.CodeTemplatesFolder.Items.Count == 0 || String.IsNullOrEmpty(item.OriginalTemplatePath) || System.IO.Directory.GetParent(item.OriginalTemplatePath).FullName != System.IO.Directory.GetParent(item.Solution.TemplateAbsolutePath).FullName)
                                {
                                    item.CodeTemplatesFolder.LoadTemplateDirectories();
                                    item.OriginalTemplatePath = item.Solution.TemplatePath;
                                }
                            }
                            #endregion protected

                            item.OnUpdated(item, null);
                            item.ShowInTreeView();
                            break;
                        }
                    }
                    if (isItemMatch == false)
                    {
                        // add new Solution
                        SolutionViewModel newItem = new SolutionViewModel(data.Solution);
                        newItem.Updated += new EventHandler(Children_Updated);
                        Solutions.Add(newItem);

                        #region protected
                        if (String.IsNullOrEmpty(newItem.OriginalTemplatePath) || System.IO.Directory.GetParent(newItem.OriginalTemplatePath).FullName != System.IO.Directory.GetParent(newItem.Solution.TemplateAbsolutePath).FullName)
                        {
                            newItem.CodeTemplatesFolder.LoadTemplateDirectories();
                            newItem.OriginalTemplatePath = newItem.Solution.TemplatePath;
                        }
                        #endregion protected

                        Items.Add(newItem);
                        OnUpdated(this, null);
                        newItem.ShowInTreeView();
                    }
                }
            }
            catch (Exception ex)
            {
                ShowIssue(ex.Message + ex.StackTrace);
            }
        }
 void SolutionUnloaded(object sender, SolutionEventArgs e)
 {
     try {
         Runtime.RunInMainThread(() => {
             RemoveSolution(e.Solution);
         });
     } catch (Exception ex) {
         LoggingService.LogError("Unable to unload solution manager.", ex);
     }
 }
Example #27
0
 static void SolutionOpened(object sender, SolutionEventArgs e)
 {
     // Load solution settings
     SolutionOptions = new CSharpFormattingOptionsPersistence(
         e.Solution.GlobalPreferences,
         new CSharpFormattingOptionsContainer(GlobalOptions.OptionsContainer)
     {
         DefaultText = StringParser.Parse("${res:CSharpBinding.Formatting.SolutionOptionReference}")
     });
 }
Example #28
0
 private void OnSolutionClosing(object sender, SolutionEventArgs e)
 {
     if (this.IsOpen)
     {
         tracer.ShieldUI(
             () => this.Close(),
             Resources.PatternManager_FailedToCloseOpenedStore,
             this.StoreFile);
     }
 }
Example #29
0
 private void projectManager_SolutionClosing(object sender, SolutionEventArgs e)
 {
     if (this.solution != null)
     {
         ((Microsoft.Expression.Extensibility.Project.Solution) this.solution).Close();
         this.solution = null;
     }
     this.projectManager.SolutionClosing -= new EventHandler <SolutionEventArgs>(this.projectManager_SolutionClosing);
     this.projectManager.ProjectClosing  -= new EventHandler <ProjectEventArgs>(this.projectManager_ProjectClosing);
 }
        void SolutionLoaded(object sender, SolutionEventArgs e)
        {
            if (!PackageManagementServices.Options.IsAutomaticPackageRestoreOnOpeningSolutionEnabled)
            {
                return;
            }

            var restorer = new PackageRestorer(e.Solution);

            DispatchService.BackgroundDispatch(() => restorer.Restore());
        }
Example #31
0
 protected virtual void RaiseSolutionEvent(SolutionEventArgs.EventType type, string message = "")
 {
     if (SolutionEvent != null)
         SolutionEvent(this, new SolutionEventArgs(type, message));
 }
Example #32
0
        void solver_SolutionFound(object sender, SolutionEventArgs e)
        {
            e.Solution.Number = string.Format("Matrix #{0}", iSolution++);
            lstResults.Items.Add(e.Solution);
            lstResults.SetSelected(lstResults.Items.Count - 1, true);
            lstResults.SetSelected(lstResults.Items.Count - 1, false);

            
        }
Example #33
0
 private void RaiseSolutionEventInUserThread(SolutionEventArgs.EventType type, string message = "")
 {
     _dispatcher.BeginInvoke(new Action(() => { RaiseSolutionEvent(type, message); }));
 }