Exemplo n.º 1
0
        private ReferenceResolver PrepareReferenceResolverWithDialog()
        {
            CommandResultDialog dialog   = new CommandResultDialog();
            ReferenceResolver   resolver = new ReferenceResolver(this);

            resolver.Info.OnStartResolving = () => { this.DoOnStartResolving(dialog); };

            int projectsCount     = 0;
            int referencesAdded   = 0;
            int referencesRemoved = 0;

            resolver.Info.OnProjectModifyingStart = (project) =>
            {
                projectsCount++;
                referencesAdded   = 0;
                referencesRemoved = 0;
                this.DoOnProjectModifyingStart(dialog, project);
            };

            resolver.Info.OnReferenceAdded = (reference) =>
            {
                referencesAdded++;
                this.DoOnReferenceAdded(dialog, reference);
            };

            resolver.Info.OnReferenceRemoved = (reference) =>
            {
                referencesRemoved++;
                this.DoOnReferenceRemoved(dialog, reference);
            };

            resolver.Info.OnProjectModifyingEnd = (project) => { this.DoOnProjectModifyingEnd(dialog, project, referencesAdded, referencesRemoved); };
            resolver.Info.OnFinishedResolving   = () => { this.DoOnFinishedResolving(dialog, projectsCount); };
            resolver.Info.OnException           = (ex) => { this.DoOnException(dialog, ex); };

            return(resolver);
        }
Exemplo n.º 2
0
 private void DoOnFinishedResolving(CommandResultDialog dialog, int projectsCount)
 {
     dialog.AddResult(string.Format("Finished! \n {0} projects resolved!", projectsCount));
     this.IsResolving = false;
     dialog.ShowFinishButton();
 }
Exemplo n.º 3
0
 private void DoOnStartResolving(CommandResultDialog dialog)
 {
     this.IsResolving = true;
     dialog.AddResult("Start resolving references ...");
     dialog.ShowDialog();
 }
Exemplo n.º 4
0
 private void DoOnReferenceRemoved(CommandResultDialog dialog, ReferenceModel reference)
 {
     dialog.AddResult(string.Format("Removed reference: {0} \n {1}", reference.Name, reference.Path));
 }
Exemplo n.º 5
0
 private void DoOnProjectModifyingEnd(CommandResultDialog dialog, VSLangProj.VSProject project, int addedReferences, int removedReferences)
 {
     dialog.AddResult(string.Format("Finished modifying project: {0} \n {1} references added \n {2} references removed \n --------------",
                                    project.Project.Name, addedReferences, removedReferences));
 }
Exemplo n.º 6
0
 private void DoOnProjectModifyingStart(CommandResultDialog dialog, VSLangProj.VSProject project)
 {
     dialog.AddResult(string.Format(" --------------\nModifying project: {0}", project.Project.Name));
 }
Exemplo n.º 7
0
 private void DoOnException(CommandResultDialog dialog, Exception ex)
 {
     dialog.AddResult(string.Format("Exception occured: {0} \n StackTrace: {1}", ex.Message, ex.StackTrace));
 }