public void SetObjects(uint cObjects, object[] objects)
 {
     try
     {
         if (objects != null && cObjects > 0)
         {
             IVsBrowseObject browse = objects[0] as IVsBrowseObject;
             if (browse != null)
             {
                 IVsHierarchy hier;
                 uint         id;
                 browse.GetProjectItem(out hier, out id);
                 Project = hier as IVsProject;
                 if (Project != null)
                 {
                     Settings = new ProjectSettigns(Project);
                     Settings.Load();
                     ConfigurationView.LoadSettigns(Settings);
                     ProjectSubscription = Project.OnProjectUpdate(() =>
                     {
                         if (!ConfigurationView.Dirty)
                         {
                             Settings.Load();
                             ConfigurationView.LoadSettigns(Settings);
                         }
                     });
                 }
             }
         }
     }
     catch (Exception ex)
     {
         Package.UnexpectedExceptionWarning(ex);
     }
 }
Example #2
0
 public void SetObjects(uint cObjects, object[] objects)
 {
     try
     {
         if (objects != null && cObjects > 0)
         {
             IVsBrowseObject browse = objects[0] as IVsBrowseObject;
             if (browse != null)
             {
                 IVsHierarchy hier;
                 uint         id;
                 browse.GetProjectItem(out hier, out id);
                 Project = hier as IVsProject;
                 if (Project != null)
                 {
                     Settings = new ProjectSettigns(Package.Instance.ProjectManagerFactory.GetProjectManager(Project));
                     Settings.Load();
                     ConfigurationView.LoadSettigns(Settings);
                     Settings.ProjectManager.ProjectChanged += (sender, args) =>
                     {
                         if (!ConfigurationView.Dirty)
                         {
                             Settings.Load();
                             ConfigurationView.LoadSettigns(Settings);
                         }
                     };
                 }
             }
         }
     }
     catch (Exception ex)
     {
         Package.UnexpectedExceptionWarning(ex);
     }
 }
 public void SetObjects(uint cObjects, Object[] objects)
 {
     try
     {
         if (objects != null && cObjects > 0)
         {
             IVsBrowseObject browse = objects[0] as IVsBrowseObject;
             if (browse != null)
             {
                 IVsHierarchy hier;
                 uint         id;
                 browse.GetProjectItem(out hier, out id);
                 Project = hier as IVsProject;
                 if (Project != null)
                 {
                     Settings = new ProjectSettigns(Project);
                     Settings.Load();
                     ConfigurationView.OutputDir   = Settings.OutputDir;
                     ConfigurationView.Ice         = Settings.AllowIcePrefix ? CheckState.Checked : CheckState.Unchecked;
                     ConfigurationView.Checksum    = Settings.Checksum ? CheckState.Checked : CheckState.Unchecked;
                     ConfigurationView.Streaming   = Settings.Stream ? CheckState.Checked : CheckState.Unchecked;
                     ConfigurationView.Tie         = Settings.Tie ? CheckState.Checked : CheckState.Unchecked;
                     ConfigurationView.Underscores = Settings.Underscore ? CheckState.Checked : CheckState.Unchecked;
                     ConfigurationView.IncludeDirectories.Values = new List <String>(
                         Settings.IncludeDirectories.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries));
                     ConfigurationView.AdditionalOptions = Settings.AdditionalOptions;
                     ConfigurationView.LoadReferencedAssemblies();
                     ConfigurationView.Dirty = false;
                 }
             }
         }
     }
     catch (Exception ex)
     {
         Package.UnexpectedExceptionWarning(ex);
         throw;
     }
 }
 public void SetObjects(uint cObjects, Object[] objects)
 {
     try
     {
         if (objects != null && cObjects > 0)
         {
             IVsBrowseObject browse = objects[0] as IVsBrowseObject;
             if (browse != null)
             {
                 IVsHierarchy hier;
                 uint id;
                 browse.GetProjectItem(out hier, out id);
                 Project = DTEUtil.GetProject(hier);
                 if (Project != null)
                 {
                     Settings = new ProjectSettigns(Project);
                     Settings.Load();
                     ConfigurationView.OutputDir = Settings.OutputDir;
                     ConfigurationView.Ice = Settings.AllowIcePrefix ? CheckState.Checked : CheckState.Unchecked;
                     ConfigurationView.Checksum = Settings.Checksum ? CheckState.Checked : CheckState.Unchecked;
                     ConfigurationView.Streaming = Settings.Stream ? CheckState.Checked : CheckState.Unchecked;
                     ConfigurationView.Tie = Settings.Tie ? CheckState.Checked : CheckState.Unchecked;
                     ConfigurationView.Underscores = Settings.Underscore ? CheckState.Checked : CheckState.Unchecked;
                     ConfigurationView.IncludeDirectories.Values = new List<String>(
                         Settings.IncludeDirectories.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries));
                     ConfigurationView.AdditionalOptions = Settings.AdditionalOptions;
                     ConfigurationView.LoadReferencedAssemblies();
                     ConfigurationView.Dirty = false;
                 }
             }
         }
     }
     catch (Exception ex)
     {
         Package.UnexpectedExceptionWarning(ex);
         throw;
     }
 }