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

C# SelectionMode类代码示例

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

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



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

示例1: GraphicsEditor

        public GraphicsEditor()
        {
            InitializeComponent();
            CompositeTable = ProjectController.GraphicsManager.BuildPatternTable(0);
            CmbPalettes.DisplayMember = "Name";

            foreach (var p in ProjectController.PaletteManager.Palettes)
            {
                CmbPalettes.Items.Add(p);
            }

            
            CmbGraphics1.DisplayMember = CmbGraphics2.DisplayMember = CmbGraphics3.DisplayMember = CmbGraphics4.DisplayMember = "Name";
            foreach (var g in ProjectController.GraphicsManager.GraphicsInfo)
            {
                CmbGraphics1.Items.Add(g);
                CmbGraphics2.Items.Add(g);
                CmbGraphics3.Items.Add(g);
                CmbGraphics4.Items.Add(g);
            }

            CmbGraphics1.SelectedIndex = 0;
            CmbGraphics2.SelectedIndex = 1;
            CmbGraphics3.SelectedIndex = 2;
            CmbGraphics4.SelectedIndex = 3;

            CmbPalettes.SelectedIndex = 0;

            PtvTileSelector.CurrentTable= CompositeTable;
            SelectionMode = SelectionMode.Quarter;
            PslView.SelectedIndexChanged += new EventHandler(PslView_SelectedIndexChanged);
            PslView.SelectedOffsetChanged += new EventHandler(PslView_SelectedOffsetChanged);
            PtvTileSelector.SelectionChanged += new EventHandler(PtvTileSelector_SelectionChanged);
            PtvTileSelector.UpdateSelection();
        }
开发者ID:AbuSLmLm,项目名称:reuben-smb3,代码行数:35,代码来源:GraphicsEditor.cs


示例2: OnWizardCreate

    void OnWizardCreate()
    {
    
        if(includeChildren || excludePrefabs)

        modePrefs=(SelectionMode.ExcludePrefab | SelectionMode.Editable | SelectionMode.Deep);
        else
            modePrefs=(SelectionMode.Editable);
    
        Object[] objs = Selection.GetFiltered(typeof(GameObject), modePrefs);
        
        foreach (GameObject go in objs)
        {
            go.renderer.material = material;
        }

/* if you replace the above foreach with my version below, it seems to work well for cases where some children parts don't have a renderer:

        foreach (GameObject go in objs)
        {
            if (go.renderer)
                go.renderer.material = material;
        }

*/
    
    }   
开发者ID:ly774508966,项目名称:Light-Harvest-Unity3D,代码行数:27,代码来源:SetSelectionToMaterial.cs


示例3: SelectionModel

 /// <summary>
 /// Represents a <see cref="Model"/> that executes the appropriate selection logic requested by different commands.
 /// </summary>
 public SelectionModel()
     : base(NAME)
 {
     this.items = new List<object>(0);
     this.SelectedItems = new SelectedItemsCollection();
     this.selectionMode = SelectionMode.Extended;
     this.ranges = new RangeCollection();
 }
开发者ID:guidgets,项目名称:XamlGrid,代码行数:11,代码来源:SelectionModel.cs


示例4: Selection

		public Selection (DocumentLocation anchor, DocumentLocation lead, SelectionMode selectionMode = SelectionMode.Normal)
		{
			if (anchor.Line < DocumentLocation.MinLine || anchor.Column < DocumentLocation.MinColumn)
				throw new ArgumentOutOfRangeException ("anchor", anchor + " is out of range.");
			if (lead.Line < DocumentLocation.MinLine || lead.Column < DocumentLocation.MinColumn)
				throw new ArgumentOutOfRangeException ("lead", lead + " is out of range.");
			this.Anchor        = anchor;
			this.Lead          = lead;
			this.SelectionMode = selectionMode;
		}
开发者ID:txdv,项目名称:monodevelop,代码行数:10,代码来源:Selection.cs


示例5: Selection

		public Selection (DocumentLocation anchor, DocumentLocation lead, SelectionMode selectionMode)
		{
			if (anchor.Line < DocumentLocation.MinLine || anchor.Column < DocumentLocation.MinColumn)
				throw new ArgumentException ("anchor");
			if (lead.Line < DocumentLocation.MinLine || lead.Column < DocumentLocation.MinColumn)
				throw new ArgumentException ("lead");
			this.Anchor        = anchor;
			this.Lead          = lead;
			this.SelectionMode = selectionMode;
		}
开发者ID:nickname100,项目名称:monodevelop,代码行数:10,代码来源:Selection.cs


示例6: GeneticAlgorithm

 public GeneticAlgorithm(int populationSize, int chromosomeLength, int numberOfGenerations, double crossoverRate, double mutationRate, EvaluationDelegate fitnessFunction, BoundPair[] genesDomain ,  int elitismFactor = 0, SelectionMode Selection = SelectionMode.RouletteWheel, bool PrintLogMode = false)
 {
     this.populationSize = populationSize;
     this.chromosomeLength = chromosomeLength;
     this.numberOfGenerations = numberOfGenerations;
     this.crossoverRate = crossoverRate;
     this.mutationRate = mutationRate;
     this.fitnessFunction = fitnessFunction;
     this.genesDomain = genesDomain;
     this.elitismFactor = elitismFactor;
     this.PrintLogMode = PrintLogMode;
 }
开发者ID:Mennat-Ullah,项目名称:DataHiding-Stegno-GA,代码行数:12,代码来源:GeneticAlgorithmxxxxxx.cs


示例7: RadioListBox

        // Public constructor
        public RadioListBox()
        {
            this.DrawMode = DrawMode.OwnerDrawFixed;
            this.SelectionMode = SelectionMode.One;
            this.ItemHeight = this.FontHeight;

            this.Align = new StringFormat(StringFormat.GenericDefault);
            this.Align.LineAlignment = StringAlignment.Center;

            // Force transparent analisys
            this.BackColor = this.BackColor;
        }
开发者ID:emote-project,项目名称:Scenario1,代码行数:13,代码来源:RadioListBox.cs


示例8: DefaultListSelectionModel

        /// <summary>
        /// Creates a default implementation of ListSelectionModel interface.
        /// </summary>
        public DefaultListSelectionModel()
        {
            selectedIndices = new List<int>();

            anchorIndex = -1;
            leadIndex = -1;
            maxIndex = -1;
            minIndex = -1;

            mode = SelectionMode.Single;
            isAdjusting = false;
        }
开发者ID:NinjaSteph,项目名称:SureShot,代码行数:15,代码来源:DefaultListSelectionModel.cs


示例9: OnMouseDown

        /// <summary>
        /// ����������
        /// </summary>
        /// <param name="regionForm"></param>
        /// <param name="e"></param>
        public override void OnMouseDown(RegionForm regionForm, MouseEventArgs e)
        {
            wasMove = false;

            selectMode = SelectionMode.None;
            Point point = new Point(e.X, e.Y);

            int handleNumber = regionForm.DrawRectangle.HitTest(point);

            if (handleNumber > 0)
            {
                selectMode = SelectionMode.Size;

                resizedObject = regionForm.DrawRectangle;
                resizedObjectHandle = handleNumber;
            }

            if (selectMode == SelectionMode.None)
            {
                DrawRectangle o = null;

                if (regionForm.DrawRectangle.HitTest(point) == 0)
                {
                    o = regionForm.DrawRectangle;
                }

                if (o != null)
                {
                    selectMode = SelectionMode.Move;

                    regionForm.Cursor = Cursors.SizeAll;
                }
            }

            lastPoint.X = e.X;
            lastPoint.Y = e.Y;
            startPoint.X = e.X;
            startPoint.Y = e.Y;

            regionForm.Capture = true;

            regionForm.Refresh();
        }
开发者ID:tolbkni,项目名称:ScreenCapture,代码行数:48,代码来源:ToolPointer.cs


示例10: OnMouseDoubleClick

        //public tooltipForm tpform = new tooltipForm();
        public override void OnMouseDoubleClick(DrawArea drawArea, MouseEventArgs e)
        {
            commandChangeState = null;
            wasMove = false;

            selectMode = SelectionMode.None;
            Point point = drawArea.BackTrackMouse(new Point(e.X, e.Y));

            // Test for resizing (only if control is selected, cursor is on the handle)
            int al = drawArea.TheLayers.ActiveLayerIndex;
            int n = drawArea.TheLayers[al].Graphics.SelectionCount;

            // Test for move (cursor is on the object)
            if (selectMode == SelectionMode.None)
            {
                int n1 = drawArea.TheLayers[al].Graphics.Count;
                DrawObject o = null;

                for (int i = 0; i < n1; i++)
                {
                    if (drawArea.TheLayers[al].Graphics[i].HitTest(point) == 0)
                    {
                        o = drawArea.TheLayers[al].Graphics[i];
                        break;
                    }
                }

                if (o != null)
                {
                    //if (drawArea.IsPainting)
                    //{
                    //    o.editProperties();
                    //}
                    //else
                    //{
                    //    o.showProperties();
                    //}
                    o.ShowPropertiesDialog();
                    drawArea.Refresh();
                }
            }
        }
开发者ID:bqIcelove,项目名称:DrawTools,代码行数:43,代码来源:ToolPointer.cs


示例11: Click

	public void Click(BaseEventData data) {
		var pData = (PointerEventData)data;
		if (pData.dragging)
			return;
		var pos = Camera.main.ScreenToWorldPoint(pData.position);
		pos.z = Camera.main.transform.position.z;
		var dir = new Vector3 (0, 0, 1);
		var hit = Physics2D.Raycast (pos, dir, 100f, CellLayer);
		if (hit) {
			var cell = hit.transform.GetComponent<GridCell>();
			if(!cell) return;
			if(mSelectionMode == SelectionMode.CellInfo) {
				if(cell == SelectedCell)
					SelectedCell = null;
				else
					SelectedCell = cell;
			}
			else if(mSelectionMode == SelectionMode.DeployBomb) {
				mBombToDeploy.Deploy(cell);
				mSelectionMode = SelectionMode.CellInfo;
			}
		}
	}
开发者ID:Winded,项目名称:BombInc,代码行数:23,代码来源:CellSelector.cs


示例12: OnWizardCreate

    void OnWizardCreate()
    {
        if (includeChildren || excludePrefabs)

                modePrefs = (SelectionMode.ExcludePrefab | SelectionMode.Editable | SelectionMode.Deep);
            else
                modePrefs = (SelectionMode.Editable);

            Object[] objs = Selection.GetFiltered(typeof(GameObject), modePrefs);

            foreach (GameObject go in objs)
            {
                GameObject clone = PrefabUtility.InstantiatePrefab(prefab) as GameObject;
                clone.name = prefab.name;
                clone.transform.parent = go.transform.parent;
                if (copyPosition)
                {
                    clone.transform.localPosition = go.transform.localPosition;
                }
                if (copyRotation)
                {
                    clone.transform.localRotation = go.transform.localRotation;
                }
                if (copyScale)
                {
                    clone.transform.localScale = go.transform.localScale;
                }

            }
            if (deleteSelectedObjects)
            {
                foreach (GameObject go in objs)
                {
                    DestroyImmediate(go.gameObject);
                }
            }
    }
开发者ID:azanium,项目名称:PopBloop-Unity,代码行数:37,代码来源:MergeScene.cs


示例13: GetFiltered

 /// <summary>
 /// <para>Returns the current selection filtered by type and mode.</para>
 /// </summary>
 /// <param name="type">Only objects of this type will be retrieved.</param>
 /// <param name="mode">Further options to refine the selection.</param>
 public static Object[] GetFiltered(Type type, SelectionMode mode)
 {
     ArrayList list = new ArrayList();
     if ((type == typeof(Component)) || type.IsSubclassOf(typeof(Component)))
     {
         Transform[] transforms = GetTransforms(mode);
         foreach (Transform transform in transforms)
         {
             Component component = transform.GetComponent(type);
             if (component != null)
             {
                 list.Add(component);
             }
         }
     }
     else if ((type == typeof(GameObject)) || type.IsSubclassOf(typeof(GameObject)))
     {
         Transform[] transformArray3 = GetTransforms(mode);
         foreach (Transform transform2 in transformArray3)
         {
             list.Add(transform2.gameObject);
         }
     }
     else
     {
         Object[] objectsMode = GetObjectsMode(mode);
         foreach (Object obj2 in objectsMode)
         {
             if ((obj2 != null) && ((obj2.GetType() == type) || obj2.GetType().IsSubclassOf(type)))
             {
                 list.Add(obj2);
             }
         }
     }
     return (Object[]) list.ToArray(typeof(Object));
 }
开发者ID:CarlosHBC,项目名称:UnityDecompiled,代码行数:41,代码来源:Selection.cs


示例14: InstantiateIn

        /// <summary>
        /// When implemented by a class, defines the <see cref="T:System.Web.UI.Control" /> object that child controls and templates belong to. These child controls are in turn defined within an inline template.
        /// </summary>
        /// <param name="container">The <see cref="T:System.Web.UI.Control" /> object to contain the instances of controls from the inline template.</param>
        public void InstantiateIn( Control container )
        {
            var cell = container as DataControlFieldCell;
            if (cell != null)
            {
                var selectField = cell.ContainingField as SelectField;
                if ( selectField != null )
                {
                    SelectionMode = selectField.SelectionMode;
                    DataVisibleField = selectField.DataVisibleField;
                    DataSelectedField = selectField.DataSelectedField;
                    DataTextField = selectField.DataTextField;
                    ColumnIndex = selectField.ColumnIndex;

                    CheckBox cb = null;

                    if ( SelectionMode == SelectionMode.Multiple )
                    {
                        cb = new CheckBox();
                    }
                    else
                    {
                        cb = new RockRadioButton();
                    }

                    cb.ID = "cbSelect_" + ColumnIndex.ToString();
                    cb.DataBinding += cb_DataBinding;
                    cell.Controls.Add( cb );
                }
            }
        }
开发者ID:tcavaletto,项目名称:Rock-CentralAZ,代码行数:35,代码来源:SelectField.cs


示例15: SetSelectionMode

        /// <summary>
        /// Set the selection mode for all three list boxes
        /// </summary>
        /// <param name="selectionMode"></param>
        private void SetSelectionMode(SelectionMode selectionMode)
        {
            // workaround for the CollectionViewSource wrappers that are used for the different ListBox sorts
            // setting SelectionMode to Multiple removes the issue where the SelectionChanged event handler gets
            // invoked every time the list is changed (which triggers a resort).  The SelectionMode gets reset back
            // to Single when the SelectionChanged events handler gets called (for a valid reason - i.e. user action)

            // mitigate the recursive behavior of setting the SelectionMode re-invoking the SelectionChanged event handler
            bool disableState = disableListBoxSelectionChanged;
            disableListBoxSelectionChanged = true;

            ByNameListBox.SelectionMode = selectionMode;
            ByDueListBox.SelectionMode = selectionMode;
            ByPriListBox.SelectionMode = selectionMode;

            // reset the disable state
            disableListBoxSelectionChanged = disableState;
        }
开发者ID:ogazitt,项目名称:TaskStore,代码行数:22,代码来源:TaskListPage.xaml.cs


示例16: SetSelectionMode

 /// <summary>
 /// Sets the current selectionMode. SINGLE, MULTI or SIMPLE.
 /// </summary>
 /// <param name="mode">'SINGLE', 'MULTI' or 'SIMPLE'.</param>
 public void SetSelectionMode(SelectionMode mode)
 {
     this.Call("setSelectionMode", mode.ToString().ToLowerInvariant());   
 }
开发者ID:shalves,项目名称:Ext.NET.Community,代码行数:8,代码来源:AbstractSelectionModel.cs


示例17: SetSelectionMode

 public void SetSelectionMode(SelectionMode mode)
 {
     switch (mode) {
     case SelectionMode.Single: Widget.Selection.Mode = Gtk.SelectionMode.Single; break;
     case SelectionMode.Multiple: Widget.Selection.Mode = Gtk.SelectionMode.Multiple; break;
     }
 }
开发者ID:modulexcite,项目名称:xwt,代码行数:7,代码来源:TableViewBackend.cs


示例18: Create

 private void Create(SelectionMode mode, params string[] lines)
 {
     _view = EditorUtil.CreateView(lines);
     _tracker = new SelectionTracker(_view, mode);
     _tracker.Start();
 }
开发者ID:ChrisMarinos,项目名称:VsVim,代码行数:6,代码来源:SelectionTrackerTest.cs


示例19: Detach

		public void Detach()
		{
			mode = SelectionMode.None;
			textArea.MouseLeftButtonDown -= textArea_MouseLeftButtonDown;
			textArea.MouseMove -= textArea_MouseMove;
			textArea.MouseLeftButtonUp -= textArea_MouseLeftButtonUp;
			textArea.QueryCursor -= textArea_QueryCursor;
			textArea.OptionChanged -= textArea_OptionChanged;
			if (enableTextDragDrop) {
				DetachDragDrop();
			}
		}
开发者ID:bbqchickenrobot,项目名称:AvalonEdit,代码行数:12,代码来源:SelectionMouseHandler.cs


示例20: OnSelectionModeChanged

        private void OnSelectionModeChanged(SelectionMode newValue)
        {
            // Show/Hide the multiple selection mode summary text block or the items presenter depending on which selection mode chosen
            if (newValue == SelectionMode.Multiple || newValue == SelectionMode.Extended)
            {
                if (_multipleSelectionModeSummary != null && _itemsPresenterHostPart != null)
                {
                    _multipleSelectionModeSummary.Visibility = Visibility.Visible;
                    _itemsPresenterHostPart.Visibility = Visibility.Collapsed;
                }

            }
            else
            {
                if (_multipleSelectionModeSummary != null && _itemsPresenterHostPart != null)
                {
                    _multipleSelectionModeSummary.Visibility = Visibility.Collapsed;
                    _itemsPresenterHostPart.Visibility = Visibility.Visible;
                }
            }
        }
开发者ID:kvervo,项目名称:HorizontalLoopingSelector,代码行数:21,代码来源:ListPicker.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Selector类代码示例发布时间:2022-05-24
下一篇:
C# Selection类代码示例发布时间: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