本文整理汇总了C#中ITreeNavigator类的典型用法代码示例。如果您正苦于以下问题:C# ITreeNavigator类的具体用法?C# ITreeNavigator怎么用?C# ITreeNavigator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ITreeNavigator类属于命名空间,在下文中一共展示了ITreeNavigator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1:
List<ReferenceSegment> IAssemblyBrowserNodeBuilder.Disassemble (TextEditorData data, ITreeNavigator navigator)
{
if (DomMethodNodeBuilder.HandleSourceCodeEntity (navigator, data))
return null;
var field = CecilLoader.GetCecilObject ((IUnresolvedField)navigator.DataItem);
return DomMethodNodeBuilder.Disassemble (data, rd => rd.DisassembleField (field));
}
示例2: GetNodeName
public override string GetNodeName (ITreeNavigator thisNode, object dataObject)
{
var method = (IUnresolvedMethod)dataObject;
if (method.EntityType == EntityType.Constructor || method.EntityType == EntityType.Destructor)
return method.DeclaringTypeDefinition.Name;
return method.Name;
}
示例3: Fill
public void Fill (Extension ext, ITreeNavigator nav)
{
labelName.Markup = "<small>Extension</small>\n<big><b>" + GLib.Markup.EscapeText (Util.GetDisplayName (ext)) + "</b></big>";
object parent = ext.GetExtendedObject ();
if (parent is ExtensionPoint) {
ExtensionPoint ep = (ExtensionPoint) parent;
string txt = "<small>Extension Point</small>\n<b>" + GLib.Markup.EscapeText (Util.GetDisplayName (ep)) + "</b>";
if (!string.IsNullOrEmpty (ep.Description))
txt += "\n" + GLib.Markup.EscapeText (ep.Description);
Gtk.Label lab = new Gtk.Label ();
lab.Xalign = lab.Yalign = 0;
lab.Markup = txt;
lab.WidthRequest = 400;
lab.Wrap = true;
Gtk.Image img = new Gtk.Image (ImageService.GetPixbuf ("md-extension-point", Gtk.IconSize.Menu));
img.Yalign = 0;
Gtk.HBox box = new Gtk.HBox (false, 6);
box.PackStart (img, false, false, 0);
box.PackStart (lab, true, true, 0);
buttonExt.Add (box);
buttonExt.ShowAll ();
buttonExt.Clicked += delegate {
if (nav.MoveToObject (ext)) {
nav.MoveToParent (typeof(Solution));
nav.Expanded = true;
if (nav.MoveToObject (ep.ParentAddinDescription)) {
nav.Expanded = true;
if (nav.MoveToObject (ep))
nav.Selected = true;
}
}
};
}
}
示例4: CompareObjects
public override int CompareObjects (ITreeNavigator thisNode, ITreeNavigator otherNode)
{
if (otherNode.DataItem is Enumeration)
return 1;
else
return -1;
}
示例5: GetNodeName
public override string GetNodeName (ITreeNavigator thisNode, object dataObject)
{
Translation translation = dataObject as Translation;
if (translation == null)
return "Translation";
return translation.IsoCode;
}
示例6: CompareObjects
public override int CompareObjects(ITreeNavigator thisNode, ITreeNavigator otherNode)
{
if (otherNode.DataItem is ProjectReferenceCollection) {
return 1;
}
return -1;
}
示例7: MoveCopyFile
public static void MoveCopyFile(Project project, ITreeNavigator nav, string filename, bool move, bool alreadyInPlace)
{
if (Runtime.FileUtilityService.IsDirectory (filename))
return;
ProjectFolder folder = nav.GetParentDataItem (typeof(ProjectFolder), true) as ProjectFolder;
string name = System.IO.Path.GetFileName (filename);
string baseDirectory = folder != null ? folder.Path : project.BaseDirectory;
string newfilename = alreadyInPlace ? filename : Path.Combine (baseDirectory, name);
if (filename != newfilename) {
if (File.Exists (newfilename)) {
if (!Runtime.MessageService.AskQuestion (string.Format (GettextCatalog.GetString ("The file '{0}' already exists. Do you want to replace it?"), newfilename), "MonoDevelop"))
return;
}
File.Copy (filename, newfilename, true);
if (move)
Runtime.FileService.RemoveFile (filename);
}
if (project.IsCompileable (newfilename)) {
project.AddFile (newfilename, BuildAction.Compile);
} else {
project.AddFile (newfilename, BuildAction.Nothing);
}
Runtime.ProjectService.SaveCombine();
}
示例8: GetNodeName
public override string GetNodeName (ITreeNavigator thisNode, object dataObject)
{
if (thisNode.Options["NestedNamespaces"])
return ((Namespace)dataObject).Name;
else
return ((Namespace)dataObject).FullName;
}
示例9: CompareObjects
public override int CompareObjects (ITreeNavigator thisNode, ITreeNavigator otherNode)
{
if (otherNode.DataItem is SolutionFolderFileNode)
return DefaultSort;
else
return -1;
}
示例10: MustParseAndCacheCurrentSelection
/// <summary>
/// Checks if it's necessary to parse and cache the current selection.
/// </summary>
/// <param name="currentTreeSelection">Current tree selection.</param>
/// <param name="forceCaching">Overrides the current logic and forces the caching of the current selection.</param>
/// <returns>True if it's necessary to parse and cache the current selection, false otherwise.</returns>
private bool MustParseAndCacheCurrentSelection(ITreeNavigator[] currentTreeSelection, bool forceCaching)
{
bool parseAndCacheCurrentSelection = false;
// Check if the cached tree selection and the current one are still the same.
if (cachedTreeSelection != null && currentTreeSelection != null && cachedTreeSelection.Length == currentTreeSelection.Length && !forceCaching)
{
// Check if the selection is still the same.
for (int i = 0; i < cachedTreeSelection.Length; i++)
{
if (!cachedTreeSelection[i].DataItem.Equals(currentTreeSelection[i].DataItem))
{
cachedTreeSelection = currentTreeSelection;
parseAndCacheCurrentSelection = true;
break;
}
}
}
else
{
cachedTreeSelection = currentTreeSelection;
parseAndCacheCurrentSelection = true;
}
return parseAndCacheCurrentSelection;
}
示例11: GetNodeAttributes
public override void GetNodeAttributes (ITreeNavigator parentNode, object dataObject, ref NodeAttributes attributes)
{
Project p = parentNode.DataItem as Project;
if (p is CProject)
attributes |= NodeAttributes.Hidden;
}
示例12: CompareObjects
public override int CompareObjects(ITreeNavigator thisNode, ITreeNavigator otherNode)
{
if (thisNode.Options ["GroupByType"]) {
}
return DefaultSort;
}
示例13: CompareObjects
public override int CompareObjects (ITreeNavigator thisNode, ITreeNavigator otherNode)
{
if (otherNode.DataItem is ProjectFolder)
return 1;
else
return DefaultSort;
}
示例14: GetNodeName
public override string GetNodeName (ITreeNavigator thisNode, object dataObject)
{
TranslationProject project = dataObject as TranslationProject;
if (project == null)
return "TranslationProject";
return project.Name;
}
示例15: CompareObjects
public override int CompareObjects (ITreeNavigator thisNode, ITreeNavigator otherNode)
{
if (otherNode.NodeName == ".NET Portable Subset") {
return 1;
}
return -1;
}