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


C# IViewContent.GetType方法代码示例

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


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

示例1: GetToolBoxContent

		public object GetToolBoxContent(IViewContent viewContent)
		{
			if (viewContent != null)
			{
				Type holderType = viewContent.GetType();
				var node = AddInTree.GetTreeNode("/SharpDevelop/Workbench/ToolBoxContent", false);
				var toolBoxCodon = node.Codons.Where(codon => codon.Properties["holder"].Equals(holderType.FullName)).FirstOrDefault();
				if (toolBoxCodon != null)
					return toolBoxCodon.BuildItem(null, null);
			}
		
			return StringParser.Parse("${res:SharpDevelop.SideBar.NoToolsAvailableForCurrentDocument}");;
		}
开发者ID:yuriykipnis,项目名称:SharpDevelop,代码行数:13,代码来源:ToolsPad.cs

示例2: GetMementoKeyName

		static string GetMementoKeyName(IViewContent viewContent)
		{
			return String.Concat(viewContent.GetType().FullName.GetHashCode().ToString("x", CultureInfo.InvariantCulture), ":", FileUtility.NormalizePath(viewContent.PrimaryFileName).ToLowerInvariant());
		}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:4,代码来源:DefaultWorkbench.cs

示例3: ShowView

		public virtual void ShowView (IViewContent content, bool bringToFront, IViewDisplayBinding binding = null, DockNotebook notebook = null)
		{
			bool isFile = content.IsFile;
			if (!isFile) {
				try {
					isFile = File.Exists (content.ContentName);
				} catch { /*Ignore*/ }
			}

			string type;
			if (isFile) {
				type = System.IO.Path.GetExtension (content.ContentName);
				var mt = DesktopService.GetMimeTypeForUri (content.ContentName);
				if (!string.IsNullOrEmpty (mt))
					type += " (" + mt + ")";
			} else
				type = "(not a file)";

			var metadata = new Dictionary<string,string> () {
				{ "FileType", type },
				{ "DisplayBinding", content.GetType ().FullName },
			};

			if (isFile)
				metadata ["DisplayBindingAndType"] = type + " | " + content.GetType ().FullName;

			Counters.DocumentOpened.Inc (metadata);

			var mimeimage = PrepareShowView (content);
			var addToControl = notebook ?? DockNotebook.ActiveNotebook ?? tabControl;
			var tab = addToControl.AddTab ();

			SdiWorkspaceWindow sdiWorkspaceWindow = new SdiWorkspaceWindow (this, content, addToControl, tab);
			sdiWorkspaceWindow.TitleChanged += delegate { SetWorkbenchTitle (); };
			sdiWorkspaceWindow.Closed += CloseWindowEvent;
			sdiWorkspaceWindow.Show ();
			if (binding != null)
				DisplayBindingService.AttachSubWindows (sdiWorkspaceWindow, binding);

			sdiWorkspaceWindow.CreateCommandHandler ();

			tab.Content = sdiWorkspaceWindow;
			if (mimeimage != null)
				tab.Icon = mimeimage;

			if (content.Project != null)
				content.Project.NameChanged += HandleProjectNameChanged;
			if (bringToFront)
				content.WorkbenchWindow.SelectWindow();

			// The insertion of the tab may have changed the active view (or maybe not, this is checked in OnActiveWindowChanged)
			OnActiveWindowChanged (null, null);
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:53,代码来源:DefaultWorkbench.cs


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