本文整理汇总了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();
}
}
}
示例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;
}
示例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);
}
}