本文整理汇总了C#中ITreeItem类的典型用法代码示例。如果您正苦于以下问题:C# ITreeItem类的具体用法?C# ITreeItem怎么用?C# ITreeItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ITreeItem类属于命名空间,在下文中一共展示了ITreeItem类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: treeView_SelectedNodeChanged
//-------------------------------------------------------------------------------------
void treeView_SelectedNodeChanged(object sender, ITreeItem item)
{
if(isOkEnabled == null)
ButtonOkEnabled = item != null;
else
ButtonOkEnabled = item == null ? false : isOkEnabled(item);
}
开发者ID:GoldMax,项目名称:Pulsar.NET,代码行数:8,代码来源:SimModalTreeItemChoiceBox.cs
示例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;
}
}
开发者ID:e82eric,项目名称:Prompts,代码行数:26,代码来源:MultiSelector.cs
示例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;
}
开发者ID:GoldMax,项目名称:Pulsar.NET,代码行数:14,代码来源:SimTreeGridView.cs
示例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( );
}
开发者ID:SteveDunn,项目名称:oglr,代码行数:29,代码来源:ItemSelectorControl.cs
示例5: ModelChangedEventArgs
public ModelChangedEventArgs( ITreeItem item )
{
ItemsAffected = new[ ]
{
item
} ;
}
开发者ID:jethac,项目名称:oglr,代码行数:7,代码来源:ModelChangedEventArgs.cs
示例6: Select
public void Select(ICollection<ITreeItem> items, ITreeItem item)
{
var flattenedItems = _hierarchyFlattener.Flatten(items);
foreach (var treeItem in flattenedItems)
{
treeItem.IsSelected2 = treeItem == item;
}
}
开发者ID:e82eric,项目名称:Prompts,代码行数:9,代码来源:Selector.cs
示例7: SelectItem
public void SelectItem(ITreeItem item)
{
if (_oldSelectedItem == null)
{
_oldSelectedItem = item;
}
_multiSelector.Select(Keyboard.Modifiers, _treeItems, item, _oldSelectedItem);
_oldSelectedItem = item;
SelectedItems = GetSelectedItems();
}
开发者ID:e82eric,项目名称:Prompts,代码行数:10,代码来源:PromptTreeControl.cs
示例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();
}
开发者ID:GoldMax,项目名称:Pulsar.NET,代码行数:13,代码来源:FormMainMenu.cs
示例9: AddChildren
private void AddChildren(ITreeItem rootTreeItem)
{
if (rootTreeItem.Children != null)
{
foreach (var child in rootTreeItem.Children)
{
_denormalizedItems.Add(child);
AddChildren(child);
}
}
}
开发者ID:e82eric,项目名称:Prompts,代码行数:11,代码来源:TreeItemHierarchyFlattener2.cs
示例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;
}
开发者ID:ppnrao,项目名称:pickles,代码行数:14,代码来源:TreeItemHelper.cs
示例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);
}
开发者ID:elsiete,项目名称:CanvasDiagramEditor,代码行数:14,代码来源:TreeEditor.cs
示例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);
}
}
}
开发者ID:e82eric,项目名称:Prompts,代码行数:15,代码来源:PromptTreeControl.cs
示例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;
}
}
开发者ID:aaaaaaaannn,项目名称:Altman,代码行数:16,代码来源:TreeViewPlus.cs
示例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();
}
}
开发者ID:ppnrao,项目名称:pickles,代码行数:19,代码来源:Folder.cs
示例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 ;
}
开发者ID:SteveDunn,项目名称:oglr,代码行数:19,代码来源:PositionAnimationBehaviourPlugin.cs
示例16: buildBehaviour
IBehaviour buildBehaviour(ITreeItem forEditor)
{
ItemProperties itemProperties = forEditor.ItemProperties ;
var behaviour = new ScaleAnimationBehaviour(
itemProperties,
new FloatAnimationBehaviourProperties
{
DurationInSeconds = .75f,
Easing = Easing.EaseInOut,
From = 1,
To = 2,
Name = @"scale_animation_{0}".FormatWith( IoC.Model.NextItemNumber ),
NameOfPropertyToModify = @"Scale",
ClrTypeOfInterpolator = typeof( Quartic ).AssemblyQualifiedName
} ) ;
return behaviour ;
}
开发者ID:SteveDunn,项目名称:oglr,代码行数:19,代码来源:ScaleAnimationBehaviourPlugin.cs
示例17: Select
public void Select(ICollection<ITreeItem> rootItems, ITreeItem item1, ITreeItem item2)
{
var flatItemsList = _hierarchyFlattener.Flatten(rootItems).ToList();
var indexOfItem1 = flatItemsList.IndexOf(item1);
var indexOfItem2 = flatItemsList.IndexOf(item2);
ITreeItem firstItem;
ITreeItem secondItem;
if(indexOfItem1 < indexOfItem2)
{
firstItem = item1;
secondItem = item2;
}
else
{
firstItem = item2;
secondItem = item1;
}
var firstItemFound = false;
var secondItemFound = false;
foreach (var treeItem in flatItemsList)
{
if (treeItem == firstItem)
{
firstItemFound = true;
}
if (firstItemFound && !secondItemFound)
{
treeItem.IsSelected2 = true;
}
else
{
treeItem.IsSelected2 = false;
}
if (treeItem == secondItem)
{
secondItemFound = true;
}
}
}
开发者ID:e82eric,项目名称:Prompts,代码行数:42,代码来源:RangeSelector.cs
示例18: NeedImageIndexEventArgs
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//-------------------------------------------------------------------------------------
#region << Constructors >>
/// <summary>
/// Инициализирующий конструктор.
/// </summary>
/// <param name="item">Объект данных, для элемента которого определяется индекс изображения.</param>
/// <param name="imageIndex">Индекс изображения.</param>
public NeedImageIndexEventArgs(ITreeItem item, int imageIndex) : base ()
{
this.item = item;
this.imageIndex = imageIndex;
}
开发者ID:GoldMax,项目名称:Pulsar.NET,代码行数:13,代码来源:SimTreeView.cs
示例19: OnSelectedNodeChanged
/// <summary>
/// Метод, вызывающий событие SelectedNodeChanged.
/// </summary>
/// <param name="item">Элемент дерева.</param>
protected void OnSelectedNodeChanged(ITreeItem item)
{
if(SelectedNodeChanged != null)
SelectedNodeChanged(this, item);
}
开发者ID:GoldMax,项目名称:Pulsar.NET,代码行数:9,代码来源:SimTreeView.cs
示例20: OnSelectedNodeChanging
/// <summary>
/// Метод, вызывающий событие SelectedNodeChanging.
/// </summary>
/// <param name="item">Элемент дерева.</param>
protected bool OnSelectedNodeChanging(ITreeItem item)
{
if(SelectedNodeChanging != null)
{
CancelEventArgs<object> args = new CancelEventArgs<object>(item);
SelectedNodeChanging(this, args);
return args.Cancel;
}
else
return false;
}
开发者ID:GoldMax,项目名称:Pulsar.NET,代码行数:15,代码来源:SimTreeView.cs
注:本文中的ITreeItem类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论