本文整理汇总了C#中Main.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# Main.GetType方法的具体用法?C# Main.GetType怎么用?C# Main.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Main
的用法示例。
在下文中一共展示了Main.GetType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DeleteDocument_Unsynchronized
private void DeleteDocument_Unsynchronized(Main.IProjectItem document, bool force)
{
if (!force &&
false == Current.Gui.YesNoMessageBox(string.Format("Are you sure to remove the {0} and the corresponding views?", document.GetType().Name), "Attention", false))
return;
// close all windows
List<IViewContent> foundContent = SearchViewContentForDocument(document, int.MaxValue);
foreach (IViewContent content in foundContent)
{
content.WorkbenchWindow.CloseWindow(true);
}
Current.Project.RemoveItem(document);
// the following sequence is related to a bug encountered when closing a tabbed window by the program:
// the active view content is not updated because the dockpanel lost the focus
// to circumvent this, we focus on a new viewcontent, in this case the first one
SelectFirstAvailableView();
}
示例2: RelDocNodeProxy
public RelDocNodeProxy(Main.IDocumentLeafNode docNode, Main.IDocumentNode parentNode)
{
if (null == docNode)
throw new ArgumentNullException(nameof(docNode));
if (null == parentNode)
throw new ArgumentNullException(nameof(parentNode));
var docNodeRoot = Main.AbsoluteDocumentPath.GetRootNode(docNode);
var parentNodeRoot = Main.AbsoluteDocumentPath.GetRootNode(parentNode);
if (!object.ReferenceEquals(docNodeRoot, parentNodeRoot))
throw new ArgumentException(string.Format("parentNode (type: {0}) and docNode (type: {1}) have no common root. This suggests that one of the items is not rooted. Please report this error! The type of the parent node's root is {2}. The type of the docNode's root is {3}.", parentNode.GetType(), docNode.GetType(), parentNodeRoot.GetType(), docNodeRoot.GetType()));
InternalSetDocNode(docNode, parentNode);
if (!(_docNodePath != null)) throw new InvalidProgramException(); // because we tested above that both nodes have a common root
_parent = parentNode;
}