• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ISelectable类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: mainCanvas_SelectedItemChangedEvent

 private void mainCanvas_SelectedItemChangedEvent(object sender, ISelectable item)
 {
     DesignerItem designerItem = item as DesignerItem;
     if (designerItem != null)
     {
         designerItem.ContextMenu=(ContextMenu)MenuService.ContextMenuResource["item"];
     }
     CustomProperty property = new CustomProperty(designerItem.EuipType);
     ((Window1)App.Current.MainWindow).PropertyBrowser.SelectedObject = designerItem.EuipType;
 }
开发者ID:ichengzi,项目名称:atnets,代码行数:10,代码来源:CanvasDocument.xaml.cs


示例17: Select

 public void Select(GameObject toSelect)
 {
     if (toSelect.GetComponent<ISelectable>() != null)
     {
         Deselect();
         CurrentSelected = toSelect;
         moveableSelection = CurrentSelected.GetComponent<IMoveable>();
         selection = CurrentSelected.GetComponent<ISelectable>();
         UIPortrait.sprite = selection.GetSelectionPortrait();
         UIPortraitText.text = selection.GetName();
     }
 }
开发者ID:Xyag,项目名称:TrueRavage,代码行数:12,代码来源:SelectionManager.cs


示例18: AddToSelection

        /// <summary>
        /// Adds an item to selection.
        /// </summary>
        /// <param name="item">Item to add to selection.</param>
        /// <param name="bNotify">True to notify of this selection change. False otherwise.</param>
        public void AddToSelection(ISelectable item, bool bNotify)
        {
            if (item is ISelectable)
            {
                if (!ContainsInSelection(item))
                    CurrentSelection.Add(item);
                item.IsSelected = true;
            }

            if (bNotify)
                Notify();
        }
开发者ID:apoorv-vijay-joshi,项目名称:FSE-2011-PDE,代码行数:17,代码来源:SelectionService.cs


示例19: Contains

        public static bool Contains(ISelectable item, object[] dataCriteria)
        {
            return dataCriteria.Any(o =>
                                     {
                                         if (o is string)
                                             return item.Contains((string) o);

                                         if (o is DateTime)
                                             return item.Contains((DateTime) o);

                                         return true;
                                     });
        }
开发者ID:sergiosorias,项目名称:terminalzero,代码行数:13,代码来源:ComparisonExtentions.cs


示例20: ExternalSelect

 public void ExternalSelect(ISelectable o)
 {
     if (o == null)
     {
         o = robot;
     }
     robotGraphPanel1.select(o);
     Select(o);
     if (this.Visible != true)
     {
         this.Show();
     }
 }
开发者ID:FRCTeam159,项目名称:MentorRepository,代码行数:13,代码来源:ManageRobot.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ISelection类代码示例发布时间:2022-05-24
下一篇:
C# ISegment类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap