Exemple #1
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);
        }
Exemple #2
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);
        }
Exemple #3
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();
 }
Exemple #4
0
        public static object GetEnvDteInstance(IServiceProvider provider)
        {
            object envDte = provider.GetService(DteServices.GetEnvDteType());

            return(envDte);
        }
Exemple #5
0
 public static object GetEnvDteInstance(System.IServiceProvider provider)
 {
     return(provider.GetService(DteServices.GetEnvDteType()));
 }