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);
     }
 }
Esempio n. 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);
     }
 }