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


C# Main.GetType方法代码示例

本文整理汇总了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();
		}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:20,代码来源:ProjectService.cs

示例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;
		}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:17,代码来源:RelDocNodeProxy.cs


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