当前位置: 首页>>代码示例>>C#>>正文


C# ISelectable类代码示例

本文整理汇总了C#中ISelectable的典型用法代码示例。如果您正苦于以下问题:C# ISelectable类的具体用法?C# ISelectable怎么用?C# ISelectable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ISelectable类属于命名空间,在下文中一共展示了ISelectable类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddToSelection

        internal void AddToSelection(ISelectable item)
        {
            var x = item as DesignerItem;
            if (x != null)
            {
                CurrentSelection.Add(item);
                x.IsSelected = true;

                //_diagramControl.SelectedItems.Add(x);

                //_diagramControl.SelectedItems.Clear();
                //foreach (var designerItem in CurrentSelection.Cast<DesignerItem>())
                //{
                //    _diagramControl.SelectedItems.Add(designerItem);
                //}

                //if (item is IGroupable)
                //{
                //  List<IGroupable> groupItems = GetGroupMembers(item as IGroupable);

                //foreach (ISelectable groupItem in groupItems)
                //{
                //    groupItem.IsSelected = true;
                //    CurrentSelection.Add(groupItem);
                //}
                //}
                //else
                //{
                //    item.IsSelected = true;
                //    CurrentSelection.Add(item);
                //}
            }
        }
开发者ID:eolandezhang,项目名称:Diagram,代码行数:33,代码来源:SelectionService.cs

示例2: AddItem

        public void AddItem(ISelectable selectable, int rowIndex, int columnIndex)
        {
            if (Destroyed)
                throw new InvalidOperationException("Cannot add a control to a destroyed group");

            if (selectable == null)
                throw new ArgumentNullException("selectable");

            if (rowIndex < 0)
                throw new ArgumentException("Cannot add an item to a row index less than 0");

            if (columnIndex < 0)
                throw new ArgumentException("Cannot add an item to a column index less than 0");

            // Make sure this item doesn't already exist or an item doesn't exist in this row/column
            if (_items.Contains(selectable))
                throw new InvalidOperationException("Selectable item already exists in the GridSelectableGroup");

            // Make sure the row/column index is available
            if (_items[rowIndex, columnIndex] != null)
                throw new InvalidOperationException(
                    string.Format("An item already exists at row {0} column {1} in the GridSelectableGroup", rowIndex, columnIndex));

            // If we got here, the specified spot in the grid is free
            _items.Add(selectable, null, rowIndex, columnIndex);
        }
开发者ID:KallDrexx,项目名称:FrbUi,代码行数:26,代码来源:GridSelectableGroup.cs

示例3: IsSelectedItemMenuOperator

 protected override bool IsSelectedItemMenuOperator(ISelectable selected) {
     if (_universeCenterMenuOperator.IsSelected) {
         D.AssertEqual(_universeCenterMenuOperator, selected as UniverseCenterItem);
         return true;
     }
     return false;
 }
开发者ID:Maxii,项目名称:CodeEnv.Master,代码行数:7,代码来源:UniverseCenterCtxControl.cs

示例4: IsSelectedItemMenuOperator

 protected sealed override bool IsSelectedItemMenuOperator(ISelectable selected) {
     if (_planetoidMenuOperator.IsSelected) {
         D.AssertEqual(_planetoidMenuOperator, selected as APlanetoidItem);
         return true;
     }
     return false;
 }
开发者ID:Maxii,项目名称:CodeEnv.Master,代码行数:7,代码来源:PlanetoidCtxControl.cs

示例5: IsSelectedItemMenuOperator

 protected override bool IsSelectedItemMenuOperator(ISelectable selected) {
     if (_fleetMenuOperator.IsSelected) {
         D.AssertEqual(_fleetMenuOperator, selected as FleetCmdItem);
         return true;
     }
     return false;
 }
开发者ID:Maxii,项目名称:CodeEnv.Master,代码行数:7,代码来源:FleetCtxControl_AI.cs

示例6: AddToSelection

        /// <summary>
        /// 添加设计组件
        /// </summary>
        /// <param name="item"></param>
        public void AddToSelection(ISelectable item)
        {
            if (item is IGroupable)
            {
                IEnumerable<IGroupable> list = designerCanvas.Children.OfType<IGroupable>();
                List<IGroupable> groupItems = new List<IGroupable>();

                foreach (IGroupable groupitem in list)
                {
                    if (groupitem.CurrentSerialNumber == (item as IGroupable).CurrentSerialNumber)
                    {
                        groupItems.Add(groupitem);
                        break;
                    }
                }
                foreach (ISelectable groupItem in groupItems)
                {
                    groupItem.IsSelected = true;
                    CurrentSelection.Add(groupItem);
                }
            }
            else
            {
                item.IsSelected = true;
                CurrentSelection.Add(item);
            }
        }
开发者ID:ohzxc,项目名称:DesignerCanvasTest,代码行数:31,代码来源:SelectionService.cs

示例7: select

 public void select(ISelectable select)
 {
     currentSelection.Selected = false;
     currentSelection = select;
     currentSelection.Selected = true;
     panel1.Invalidate();
 }
开发者ID:FRCTeam159,项目名称:MentorRepository,代码行数:7,代码来源:RobotGraphPanel.cs

示例8: ToggleSelection

 public void ToggleSelection(ISelectable item)
 {
     if (ActiveItems.Contains(item))
         RemoveActive(item);
     else
         AddActive(item);
 }
开发者ID:greengiant83,项目名称:shellexplorer,代码行数:7,代码来源:SelectionSet.cs

示例9: SetHoverItem

 public void SetHoverItem(ISelectable item)
 {
     var prevHoverItem = HoverItem;
     HoverItem = item;
     if (HoverItem != null) HoverItem.AddHighlightColor(HoverColor);
     if (prevHoverItem != null && item != prevHoverItem) prevHoverItem.RemoveHighlightColor(HoverColor);
 }
开发者ID:greengiant83,项目名称:shellexplorer,代码行数:7,代码来源:SelectionSet.cs

示例10: IsSelectedItemMenuOperator

 protected override bool IsSelectedItemMenuOperator(ISelectable selected) {
     if (_baseMenuOperator.IsSelected) {
         D.AssertEqual(_baseMenuOperator, selected as AUnitBaseCmdItem);
         return true;
     }
     return false;
 }
开发者ID:Maxii,项目名称:CodeEnv.Master,代码行数:7,代码来源:BaseCtxControl_AI.cs

示例11: CheckInteraction

    public override bool CheckInteraction(ISelectable[] selectedObjects, IInteractable obj)
    {
        if (selectedObjects[0].GetType() == typeof(Unit) && obj.GetType() == typeof(Map)) {
            return true;
        }

        return false;
    }
开发者ID:tiberiu,项目名称:zombieage,代码行数:8,代码来源:MovementInteraction.cs

示例12: selectSingle

 /// <summary>
 /// Selects an object an unselects all other
 /// </summary>
 private void selectSingle(ISelectable selected)
 {
     foreach (var item in selectables) {
         if (item == selected) {
             if (!item.IsSelected) item.OnSelect();
         } else item.OnDeselect();
     }
 }
开发者ID:piranha771,项目名称:tdp,代码行数:11,代码来源:Selecter.cs

示例13: AddItem

	public void AddItem(ISelectable item) {
		if (!items.Contains(item)) {
			items.Add(item);
			item.SetSelected(false);
			item.SetSelectable(true);
			item.OnSelected += SetSelected; 
		}
	}
开发者ID:wids-eria,项目名称:tf_client,代码行数:8,代码来源:GUIRadioGroup.cs

示例14: TryIsSelectedItemAccessAttempted

    //protected override CtxObject ValidateAndAcquireCtxObject() {
    //    // the system's CtxObject, not the system's base's CtxObject    - provides proper menu positioning
    //    return UnityUtility.ValidateMonoBehaviourPresence<CtxObject>(_system.gameObject);
    //}

    //public override void OnRightPressRelease() {    // must override to test for the system being selected
    //    if (_system.IsSelected) {
    //        D.Assert(_system.Owner.IsPlayer);
    //        _accessSource = AccessSource.Local;
    //        _playerRemoteAccessItem = null;
    //        Show(true);
    //        return;
    //    }

    //    var selected = SelectionManager.Instance.CurrentSelection;
    //    var selectedFleet = selected as FleetCommandItem;
    //    if (selectedFleet != null && selectedFleet.Owner.IsPlayer) {
    //        // a remote player owned fleet is selected
    //        _accessSource = AccessSource.RemoteFleet;
    //        _playerRemoteAccessItem = selectedFleet;
    //        Show(true);
    //        return;
    //    }

    //    var selectedShip = selected as ShipItem;
    //    if (selectedShip != null && selectedShip.Owner.IsPlayer) {
    //        // a remote player owned ship is selected
    //        _accessSource = AccessSource.RemoteShip;
    //        _playerRemoteAccessItem = selectedShip;
    //        Show(true);
    //        return;
    //    }

    //    _accessSource = AccessSource.None;
    //    _playerRemoteAccessItem = null;
    //}

    protected override bool TryIsSelectedItemAccessAttempted(ISelectable selected) {
        if (_system.IsSelected) {
            D.Assert(_system == selected as SystemItem);
            D.Assert(_system.Owner.IsPlayer);
            return true;
        }
        return false;
    }
开发者ID:Maxii,项目名称:CodeEnv.Master,代码行数:45,代码来源:SystemCtxControl_Player.cs

示例15: SetSelected

	public void SetSelected(ISelectable item) {
		if ( !items.Contains(item)) return;
		selectedItem = item;
		foreach(ISelectable i in items) {
			if (i != item) {
				i.SetSelected(false);
			}
		}
		Debug.Log(string.Format("ISelectable `{0}' was selected.",item.ToString()));
	}
开发者ID:wids-eria,项目名称:tf_client,代码行数:10,代码来源:GUIRadioGroup.cs


注:本文中的ISelectable类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。