コード例 #1
0
        public object GetProjectConfigurationPropertyValue(string propertyName)
        {
            object obj = (object)null;

            if (this.EnvDteContainingProject != null)
            {
                object propertyValue1 = DteServices.GetPropertyValue("ConfigurationManager", this.EnvDteContainingProject);
                if (propertyValue1 == null)
                {
                    return((object)null);
                }
                object propertyValue2 = DteServices.GetPropertyValue("ActiveConfiguration", propertyValue1);
                if (propertyValue2 == null)
                {
                    return((object)null);
                }
                object propertyValue3 = DteServices.GetPropertyValue("Properties", propertyValue2);
                if (propertyValue3 == null)
                {
                    return((object)null);
                }
                object targetObject = DteServices.InvokeMethod("Item", propertyValue3, (object)propertyName);
                if (targetObject == null)
                {
                    return((object)null);
                }
                obj = DteServices.GetPropertyValue("Value", targetObject);
            }
            return(obj);
        }
コード例 #2
0
        public static object GetActiveDocument(object envdteInstance)
        {
            object obj = (object)null;

            if (envdteInstance != null)
            {
                obj = DteServices.GetEnvDteType().InvokeMember("ActiveDocument", BindingFlags.Instance | BindingFlags.Public | BindingFlags.GetProperty, (Binder)null, envdteInstance, new object[0]);
            }
            return(obj);
        }
コード例 #3
0
ファイル: VSProjectHelper.cs プロジェクト: configare/hispeed
        public static object GetActiveDocument(object envdteInstance)
        {
            object activeDoc = null;

            if (envdteInstance != null)
            {
                activeDoc = DteServices.GetEnvDteType().InvokeMember("ActiveDocument",
                                                                     propFlag, null, envdteInstance, new Object[] { });
            }
            return(activeDoc);
        }
コード例 #4
0
        public string GetActiveDocumentPath()
        {
            string str            = (string)null;
            object activeDocument = this.GetActiveDocument();

            if (activeDocument != null)
            {
                str = (string)DteServices.GetPropertyValue("Path", activeDocument);
            }
            return(str);
        }
コード例 #5
0
ファイル: VSProjectHelper.cs プロジェクト: configare/hispeed
 public DteServices(IServiceProvider provider)
 {
     ServiceProvider                   = provider;
     EnvDteType                        = DteServices.GetEnvDteType();
     EnvDteInstance                    = this.GetEnvDteInstance();
     EnvDteActiveDocument              = this.GetActiveDocument();
     EnvDteActiveProjectItem           = this.GetActiveProjectItem();
     EnvDteContainingProject           = this.GetActiveContainingProject();
     EnvDteContainingProjectProperties = this.GetActiveProjectProperties();
     EnvDteContainingProjectPath       = this.GetActivePathAddIn();
     EnvDteContainingProjectPathStr    = this.GetActiveProjectFullPath();
 }
コード例 #6
0
 private ProjectManagement(IServiceProvider provider)
 {
     this._Services = new DteServices(provider);
 }
コード例 #7
0
ファイル: VSProjectHelper.cs プロジェクト: configare/hispeed
        public static object GetEnvDteInstance(IServiceProvider provider)
        {
            object envDte = provider.GetService(DteServices.GetEnvDteType());

            return(envDte);
        }
コード例 #8
0
ファイル: VSProjectHelper.cs プロジェクト: configare/hispeed
        internal static string GetProjectFolder(IServiceProvider provider)
        {
            DteServices Services = new DteServices(provider);

            return(Services.GetActiveProjectFullPath());
        }
コード例 #9
0
 public static object GetEnvDteInstance(System.IServiceProvider provider)
 {
     return(provider.GetService(DteServices.GetEnvDteType()));
 }