本文整理汇总了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}");;
}
示例2: GetMementoKeyName
static string GetMementoKeyName(IViewContent viewContent)
{
return String.Concat(viewContent.GetType().FullName.GetHashCode().ToString("x", CultureInfo.InvariantCulture), ":", FileUtility.NormalizePath(viewContent.PrimaryFileName).ToLowerInvariant());
}
示例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);
}