本文整理汇总了C#中ITreeItem类的典型用法代码示例。如果您正苦于以下问题:C# ITreeItem类的具体用法?C# ITreeItem怎么用?C# ITreeItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ITreeItem类属于命名空间,在下文中一共展示了ITreeItem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: treeView_SelectedNodeChanged
//-------------------------------------------------------------------------------------
void treeView_SelectedNodeChanged(object sender, ITreeItem item)
{
if(isOkEnabled == null)
ButtonOkEnabled = item != null;
else
ButtonOkEnabled = item == null ? false : isOkEnabled(item);
}
示例2: Select
public void Select(ModifierKeys modifierKey, ICollection<ITreeItem> rootTreeItems, ITreeItem newSelectedItem, ITreeItem oldSelectedItem)
{
switch (modifierKey)
{
case ModifierKeys.Shift:
if(_previousSelectionWasShift)
{
_rangeSelector.Select(rootTreeItems, newSelectedItem, _previousShiftSelection);
}
else
{
_rangeSelector.Select(rootTreeItems, newSelectedItem, oldSelectedItem);
_previousShiftSelection = oldSelectedItem;
}
_previousSelectionWasShift = true;
break;
case ModifierKeys.Control:
_previousSelectionWasShift = false;
_inverseSelector.Select(rootTreeItems, newSelectedItem);
break;
default:
_previousSelectionWasShift = false;
_nullSelector.Select(rootTreeItems, newSelectedItem);
break;
}
}
示例3: SimTreeGridItemEventArgs
//-------------------------------------------------------------------------------------
/// <summary>
/// Инициализирующий конструктор.
/// </summary>
/// <param name="hasChildren">Определяет, имеются ли дочерние элементы.</param>
/// <param name="item">Элемент дерева, для которого определяется наличие дочерних элементов.</param>
/// <param name="tree">Дерево</param>
public SimTreeGridItemEventArgs(ITree tree, ITreeItem item, bool hasChildren)
: this()
{
Item = item;
HasChildren = hasChildren;
Tree = tree;
}
示例4: ItemSelectorControl
public ItemSelectorControl( ITreeItem itemEditor )
{
ItemEditor = itemEditor ;
InitializeComponent( ) ;
_levelExplorer = new LevelExplorerControl
{
Dock = DockStyle.Fill,
Parent = this,
CheckBoxes= false,
Visible = true,
ShowToolStrip = false,
HideContextMenus=true,
InteractsWithModel=false
} ;
_levelExplorer.ItemSelected += ( s, e ) =>
{
if( e.Item is ItemEditor )
{
ItemEditor = e.Item as ItemEditor ;
}
} ;
Controls.Add( _levelExplorer );
_levelExplorer.Refresh( );
}
示例5: ModelChangedEventArgs
public ModelChangedEventArgs( ITreeItem item )
{
ItemsAffected = new[ ]
{
item
} ;
}
示例6: Select
public void Select(ICollection<ITreeItem> items, ITreeItem item)
{
var flattenedItems = _hierarchyFlattener.Flatten(items);
foreach (var treeItem in flattenedItems)
{
treeItem.IsSelected2 = treeItem == item;
}
}
示例7: SelectItem
public void SelectItem(ITreeItem item)
{
if (_oldSelectedItem == null)
{
_oldSelectedItem = item;
}
_multiSelector.Select(Keyboard.Modifiers, _treeItems, item, _oldSelectedItem);
_oldSelectedItem = item;
SelectedItems = GetSelectedItems();
}
示例8: ftvTree_SelectedNodeChanged
//-------------------------------------------------------------------------------------
#region << Controls Handlers>>
private void ftvTree_SelectedNodeChanged(object sender, ITreeItem item)
{
if(item == null)
{
propertyGrid.SelectedObject = null;
lblEditSortOrder.Value = string.Empty;
return;
}
propertyGrid.SelectedObject = item;
lblEditSortOrder.Value = item.SortOrder == null ? string.Empty : item.SortOrder.ToString();
}
示例9: AddChildren
private void AddChildren(ITreeItem rootTreeItem)
{
if (rootTreeItem.Children != null)
{
foreach (var child in rootTreeItem.Children)
{
_denormalizedItems.Add(child);
AddChildren(child);
}
}
}
示例10: CreateHierarchy
internal static List<ITreeItem> CreateHierarchy(ITreeItem treeItem)
{
var hierarchy = new List<ITreeItem>();
ITreeItem temp = treeItem;
while (temp != null)
{
hierarchy.Add(temp);
temp = temp.Parent;
}
return hierarchy;
}
示例11: AddDiagram
public static void AddDiagram(ITreeItem project,
bool select,
Func<ITreeItem> createDiagram,
IdCounter counter)
{
var diagram = CreateDiagramItem(null, createDiagram, counter);
project.Add(diagram);
ModelEditor.Store(null, diagram);
if (select == true)
diagram.SetSelected(true);
}
示例12: AddSelectedItemsFromChildren
private static void AddSelectedItemsFromChildren(ITreeItem treeItem, ICollection<object> selectedItems)
{
if(treeItem.Children != null)
{
foreach (var child in treeItem.Children)
{
if (child.IsSelected2)
{
var dataContext = ((TreeViewItem) treeItem).DataContext;
selectedItems.Add(dataContext);
}
AddSelectedItemsFromChildren(child, selectedItems);
}
}
}
示例13: Expand
public void Expand(ITreeItem treeItem)
{
var root = treeItem;
var catchTreeItem = new List<ITreeItem>();
while (true)
{
if (root == null)
break;
catchTreeItem.Insert(0, root);
root = root.Parent;
}
foreach (var item in catchTreeItem)
{
(item as TreeItem).Expanded = true;
}
}
示例14: FindCommonAncestor
public ITreeItem FindCommonAncestor(ITreeItem other)
{
if (other == null) throw new ArgumentNullException("other");
if (Parent == other)
{
return Parent;
}
else
{
List<ITreeItem> myHierarchy = TreeItemHelper.CreateHierarchy(this);
List<ITreeItem> othersHierarchy = TreeItemHelper.CreateHierarchy(other);
IEnumerable<ITreeItem> intersection = myHierarchy.Intersect(othersHierarchy);
return intersection.FirstOrDefault();
}
}
示例15: buildBehaviour
IBehaviour buildBehaviour( ITreeItem forItem )
{
ItemProperties itemProperties = forItem.ItemProperties;
var interpolationBehaviour = new PositionAnimationBehaviour(
itemProperties,
new PositionAnimationBehaviourProperties
{
DurationInSeconds = .75f,
Easing = Easing.EaseInOut,
From = itemProperties.Position,
To = Vector2.Zero,
Name = @"movement_animation_{0}".FormatWith(IoC.Model.NextItemNumber),
NameOfPropertyToModify = @"Position",
ClrTypeOfInterpolator = typeof(Quartic).AssemblyQualifiedName,
});
return interpolationBehaviour ;
}