Пример #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
        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
 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
        public static object GetEnvDteInstance(IServiceProvider provider)
        {
            object envDte = provider.GetService(DteServices.GetEnvDteType());

            return(envDte);
        }
Пример #8
0
        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()));
 }