当前位置: 首页>>代码示例>>C#>>正文


C# ProjectItem.get_IsOpen方法代码示例

本文整理汇总了C#中ProjectItem.get_IsOpen方法的典型用法代码示例。如果您正苦于以下问题:C# ProjectItem.get_IsOpen方法的具体用法?C# ProjectItem.get_IsOpen怎么用?C# ProjectItem.get_IsOpen使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ProjectItem的用法示例。


在下文中一共展示了ProjectItem.get_IsOpen方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetFileContent

 static public string GetFileContent(ProjectItem projectItem)
 {
     if (projectItem.get_IsOpen(EnvDTE.Constants.vsViewKindAny))
     {
         TextDocument textDoc = (TextDocument)projectItem.Document.Object("TextDocument");
         EditPoint start = textDoc.StartPoint.CreateEditPoint();
         return start.GetText(textDoc.EndPoint);
     }
     else
     {
         using (TextReader file = new StreamReader(GetFileName(projectItem)))
         {
             return file.ReadToEnd();
         }
     }
 }
开发者ID:heinrichbreedt,项目名称:SpecFlow,代码行数:16,代码来源:DteProjectReader.cs

示例2: GetPackageProperties

        /// <summary>
        /// If the package designer is already open, then use the package object on it which may have in-memory modifications.
        /// If the package designer is not open, then just load the package from disk.
        /// </summary>
        /// <param name="pi"></param>
        /// <returns></returns>
        private PackageProperties GetPackageProperties(ProjectItem pi)
        {
            Package package;
            bool bIsOpen = pi.get_IsOpen(BIDSViewKinds.Designer);

            if (bIsOpen)
            {
                Window w = pi.Open(BIDSViewKinds.Designer); //opens the designer
                w.Activate();

                IDesignerHost designer = w.Object as IDesignerHost;
                if (designer == null) return null;
                EditorWindow win = (EditorWindow)designer.GetService(typeof(Microsoft.DataWarehouse.ComponentModel.IComponentNavigator));
                package = win.PropertiesLinkComponent as Package;
            }
            else
            {
                Microsoft.SqlServer.Dts.Runtime.Application app = new Microsoft.SqlServer.Dts.Runtime.Application();
                package = app.LoadPackage(pi.get_FileNames(0), null);
            }

            if (package == null) return null;

            PackageProperties props = new PackageProperties(package);
            props.DatabaseName = this.DatabaseName;
            props.PackagePathPrefix = this.PackagePathPrefix;
            return props;
        }
开发者ID:sgtgold,项目名称:bids-helper-extension,代码行数:34,代码来源:SortablePackagePropertiesPlugin.cs

示例3: GetPackageFromIntegrationServicesProjectItem

        /// <summary>
        /// If the package designer is already open, then use the package object on it which may have in-memory modifications.
        /// If the package designer is not open, then just load the package from disk.
        /// </summary>
        /// <param name="pi"></param>
        /// <returns></returns>
        private Package GetPackageFromIntegrationServicesProjectItem(ProjectItem pi)
        {
            bool bIsOpen = pi.get_IsOpen(BIDSViewKinds.Designer);

            if (bIsOpen)
            {
                Window w = pi.Open(BIDSViewKinds.Designer); //opens the designer
                w.Activate();

                IDesignerHost designer = w.Object as IDesignerHost;
                if (designer == null) return null;
                EditorWindow win = (EditorWindow)designer.GetService(typeof(Microsoft.DataWarehouse.ComponentModel.IComponentNavigator));
                return win.PropertiesLinkComponent as Package;
            }
            else
            {
                Microsoft.SqlServer.Dts.Runtime.Application app = new Microsoft.SqlServer.Dts.Runtime.Application();
                return app.LoadPackage(pi.get_FileNames(0), null);
            }
        }
开发者ID:japj,项目名称:bidshelper,代码行数:26,代码来源:NonDefaultPropertiesPlugin.cs


注:本文中的ProjectItem.get_IsOpen方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。