本文整理汇总了C#中ITreeBuilder.MoveToPosition方法的典型用法代码示例。如果您正苦于以下问题:C# ITreeBuilder.MoveToPosition方法的具体用法?C# ITreeBuilder.MoveToPosition怎么用?C# ITreeBuilder.MoveToPosition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ITreeBuilder
的用法示例。
在下文中一共展示了ITreeBuilder.MoveToPosition方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetPackagesFolderNode
ProjectPackagesFolderNode GetPackagesFolderNode (ITreeBuilder treeBuilder)
{
NodePosition originalPosition = treeBuilder.CurrentPosition;
if (!treeBuilder.MoveToParent ()) {
return null;
}
ProjectPackagesFolderNode packagesFolder = null;
if (treeBuilder.MoveToChild (ProjectPackagesFolderNode.NodeName, typeof(ProjectPackagesFolderNode))) {
packagesFolder = treeBuilder.DataItem as ProjectPackagesFolderNode;
}
treeBuilder.MoveToPosition (originalPosition);
return packagesFolder;
}
示例2: GetNodeInfo
internal static void GetNodeInfo (ExtensibleTreeView tree, ITreeBuilder tb, NodeBuilder[] chain, object dataObject, out string text, out Gdk.Pixbuf icon, out Gdk.Pixbuf closedIcon)
{
icon = null;
closedIcon = null;
text = string.Empty;
NodePosition pos = tb.CurrentPosition;
foreach (NodeBuilder builder in chain) {
try {
builder.BuildNode (tb, dataObject, ref text, ref icon, ref closedIcon);
} catch (Exception ex) {
LoggingService.LogError (ex.ToString ());
}
tb.MoveToPosition (pos);
}
if (closedIcon == null) closedIcon = icon;
if (tree.CopyObjects != null && ((IList)tree.CopyObjects).Contains (dataObject) && tree.CurrentTransferOperation == DragOperation.Move) {
Gdk.Pixbuf gicon = tree.BuilderContext.GetComposedIcon (icon, "fade");
if (gicon == null) {
gicon = ImageService.MakeTransparent (icon, 0.5);
tree.BuilderContext.CacheComposedIcon (icon, "fade", gicon);
}
icon = gicon;
gicon = tree.BuilderContext.GetComposedIcon (closedIcon, "fade");
if (gicon == null) {
gicon = ImageService.MakeTransparent (closedIcon, 0.5);
tree.BuilderContext.CacheComposedIcon (closedIcon, "fade", gicon);
}
closedIcon = gicon;
}
}
示例3: HasChildNodes
internal static bool HasChildNodes (ITreeBuilder tb, NodeBuilder[] chain, object dataObject)
{
NodePosition pos = tb.CurrentPosition;
foreach (NodeBuilder nb in chain) {
try {
bool res = nb.HasChildNodes (tb, dataObject);
if (res) return true;
} catch (Exception ex) {
LoggingService.LogError (ex.ToString ());
} finally {
tb.MoveToPosition (pos);
}
}
return false;
}
示例4: GetAttributes
internal static NodeAttributes GetAttributes (ITreeBuilder tb, NodeBuilder[] chain, object dataObject)
{
NodePosition pos = tb.CurrentPosition;
NodeAttributes ats = NodeAttributes.None;
foreach (NodeBuilder nb in chain) {
try {
nb.GetNodeAttributes (tb, dataObject, ref ats);
} catch (Exception ex) {
LoggingService.LogError (ex.ToString ());
}
tb.MoveToPosition (pos);
}
return ats;
}
示例5: GetNodeInfo
internal static NodeInfo GetNodeInfo (NodeInfo nodeInfo, ExtensibleTreeView tree, ITreeBuilder tb, NodeBuilder[] chain, object dataObject)
{
NodePosition pos = tb.CurrentPosition;
foreach (NodeBuilder builder in chain) {
try {
builder.BuildNode (tb, dataObject, nodeInfo);
} catch (Exception ex) {
LoggingService.LogError (ex.ToString ());
}
tb.MoveToPosition (pos);
}
if (nodeInfo.ClosedIcon == null) nodeInfo.ClosedIcon = nodeInfo.Icon;
if (tree.CopyObjects != null && ((IList)tree.CopyObjects).Contains (dataObject) && tree.CurrentTransferOperation == DragOperation.Move) {
var gicon = tree.BuilderContext.GetComposedIcon (nodeInfo.Icon, "fade");
if (gicon == null) {
gicon = nodeInfo.Icon.WithAlpha (0.5);
tree.BuilderContext.CacheComposedIcon (nodeInfo.Icon, "fade", gicon);
}
nodeInfo.Icon = gicon;
gicon = tree.BuilderContext.GetComposedIcon (nodeInfo.ClosedIcon, "fade");
if (gicon == null) {
gicon = nodeInfo.ClosedIcon.WithAlpha (0.5);
tree.BuilderContext.CacheComposedIcon (nodeInfo.ClosedIcon, "fade", gicon);
}
nodeInfo.ClosedIcon = gicon;
}
return nodeInfo;
}