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


C# Selection类代码示例

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


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

示例1: MainMenu

        public MainMenu(Rectangle windowSize, KeyboardState newKeyboardState, MouseState newMouseState)
        {
            windowWidth = windowSize.Width;
            windowHeight = windowSize.Height;
            keyboardState = newKeyboardState;
            mousestate = newMouseState;
            selection = Selection.Play;
            wallpaper = new Sprite(new Rectangle(0, 0, windowWidth, windowHeight), windowSize);
            wallpaperText = new Sprite(new Rectangle(0, 0, windowWidth, windowHeight), windowSize);
            nuages = new Sprite(new Rectangle(0, 0, windowWidth * 3, windowHeight), windowSize);
            nuages.Direction = new Vector2(-1, 0);
            nuages.Vitesse = 0.1f; // 1f = 1000 px/sec
            mouse = new AnimatedSprite(new Rectangle(-100, -100, 80, 100), windowSize, 8, 4, 40);
            relativeAmplitudeVibrationSelection = (float)amplitudeVibrationSelection / (float)(windowHeight + windowWidth);
            sprites = new List<AnimatedSprite>();

            menuItems = new Dictionary<Selection, Sprite>();
            menuItems.Add(Selection.Play, new Sprite(new Rectangle(112, 423, 124, 55), windowSize, "menu/textPlay"));
            menuItems.Add(Selection.Extra, new Sprite(new Rectangle(191, 480, 124, 55), windowSize, "menu/textExtra"));
            menuItems.Add(Selection.Options, new Sprite(new Rectangle(394, 470, 135, 55), windowSize, "menu/textOptions"));
            menuItems.Add(Selection.Credit, new Sprite(new Rectangle(562, 400, 124, 55), windowSize, "menu/textCredit"));
            menuItems.Add(Selection.Exit, new Sprite(new Rectangle(675, 480, 101, 55), windowSize, "menu/textExit"));

            Fire = new ParticleEngine(new Rectangle(0,windowSize.Height,windowSize.Width,0));
            Fire.SetSpeedRange(0.2f, 2f, 90, 40);
            Fire.SetLifeTimeRange(20, 90);
            Fire.SetScaleRange(0.2f, 1.4f);

            Cursor = new ParticleEngine(new Rectangle());
            Cursor.SetSpeedRange(0.2f, 1.6f, -45, 25);
            Cursor.SetAngularSpeedRange(0, 3);
            Cursor.SetLifeTimeRange(20, 50);
            Cursor.SetScaleRange(0.2f, 1.4f);
            Cursor.SetColorRange(0, 255, 0, 255, 0, 255, 0, 20);
        }
开发者ID:Thyvs,项目名称:The-Revenge-Of-the-Dark-Side,代码行数:35,代码来源:MainMenu.cs

示例2: Execute

 /// <summary>
 /// Replace the text of the selection with the answer to the calculation
 /// </summary>
 /// <param Name="selection">The current selection, used as input, and modified for the output</param>
 /// <param Name="argument">Anything added after the command Name, used as input</param>
 public void Execute(Selection selection, string[] arguments)
 {
     //Attempt to perform the calculation
     try { selection.Text = PerformCalculation(selection.Text); }
     //If it fails, raise an error to the user
     catch { new Error(String.Format(@"Sum'{0}' is not formatted correctly", selection.Text), Camera); }
 }
开发者ID:malacandrian,项目名称:fyp,代码行数:12,代码来源:CalculateCommand.cs

示例3: Calendar

        public Calendar()
        {
            InitializeComponent();

            ItemContextMenu = new ContextMenu();
            MenuItem Block = new MenuItem();
            Block.Header = "Block";
            Block.Click += new RoutedEventHandler(MenuBlock_Click);
            ItemContextMenu = new ContextMenu();
            MenuItem UnBlock = new MenuItem();
            UnBlock.Header = "Unblock";
            UnBlock.Click += new RoutedEventHandler(MenuUnBlock_Click);
            MenuItem Delete = new MenuItem();
            Delete.Header = "Delete";
            Delete.Click += new RoutedEventHandler(MenuDelete_Click);
            ItemContextMenu.Items.Add(Block);
            ItemContextMenu.Items.Add(UnBlock);
            ItemContextMenu.Items.Add(Delete);

            oSel = new Selection(this);
            DispatcherTimer dispatcherTimer = new System.Windows.Threading.DispatcherTimer();
            dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick);
            dispatcherTimer.Interval = new TimeSpan(0, 0, 1);
            dispatcherTimer.Start();
            oRefresh();
        }
开发者ID:JGEsteves89,项目名称:SchedulePlannerWPF,代码行数:26,代码来源:Calendar.xaml.cs

示例4: YoutubeWidget

 public YoutubeWidget(string source, 
     Selection selection) 
     : this(source)
 {
     this.mSelection = selection;
     HttpService = new HttpService();
 }
开发者ID:rlbisbe,项目名称:metrics,代码行数:7,代码来源:YoutubeWidget.cs

示例5: SaveLoadScreen

        /// <summary>
        /// Create a new Load/Save Screen.
        /// </summary>
        /// <param name="NextState">Depending whether the game is loading or saving.
        /// If the game is loading, then the it is the state the game will go to if the operation is cancelled.
        /// If the game is saving, this state will be reached regardless.</param>
        /// <param name="SaveMode">True for saving, false for loading.</param>
        public SaveLoadScreen(State.State NextState, bool SaveMode)
        {
            this.NextState = NextState;
            this.SaveMode = SaveMode;

            if (SaveMode)
            {
                LogsSelection = new Selection(50, 130, new string[] {
                    "1: ", "2: ", "3: ", "4: ", "5: ", "6: ", "7: ", "8: ", "Cancel"});
            }
            else
            {
                LogsSelection = new Selection(50, 130, new string[] {
                    "1: ", "2: ", "3: ", "4: ", "5: ", "6: ", "7: ", "8: ", "Autosave", "Cancel"});
            }

            for (int i = 0; i < 8; i++)
            {
                if (Properties.Settings.Default.Logs[i] == "0")
                {
                    LogsSelection.Choices[i] += "-";
                }
                else
                {
                    LogsSelection.Choices[i] += Properties.Settings.Default.Logs[i];
                }
            }
        }
开发者ID:husathap,项目名称:Charlotte,代码行数:35,代码来源:SaveLoadScreen.cs

示例6: UseItem

		public Composite UseItem(Selection<bool> reqs = null)
		{
			return new Decorator(ret => reqs == null || reqs(ret),
				new Action(delegate
				{
					if (_timer.IsRunning && _timer.Elapsed.TotalSeconds < CoolDown)
						return RunStatus.Failure;

					if (!_timer.IsRunning)
						_timer.Start();

					foreach (var o in BuddyTor.Me.InventoryEquipment)
					{
						if (o.Name.Contains(ItemName))
						{
							o.Use();
							o.Interact();
							_timer.Stop();
							_timer.Reset();
							_timer.Start();
							return RunStatus.Success;
						}
					}
					return RunStatus.Failure;
				}));
		}
开发者ID:cassrgs,项目名称:BuddyWing.DefaultCombat,代码行数:26,代码来源:InventoryManager.cs

示例7: TryExtendSelectionToComments

		static Selection TryExtendSelectionToComments(IDocument document, Selection selection, IList<ISpecial> commentsBlankLines)
		{
			var extendedToComments = ExtendSelectionToComments(document, selection, commentsBlankLines);
			if (extendedToComments != null)
				return extendedToComments;
			return selection;
		}
开发者ID:hpsa,项目名称:SharpDevelop,代码行数:7,代码来源:CodeManipulation.cs

示例8: PreSelection

        public virtual Selection PreSelection(SelectionManager sm, Selection sel)
        {
            if ( !sel.IsEmpty && !sel.Start.Node.Equals(node) )
                return new Selection(SelectionManager.CreateSelectionPoint(node, false));

            return sel;
        }
开发者ID:jugglingcats,项目名称:XEditNet,代码行数:7,代码来源:QuickFix.cs

示例9: ObjectsPropertiesVM

        // Constructor
        #region Constructor


        public ObjectsPropertiesVM()
        {
            Selection = new Selection();
            Selection.PropertyChanged += Selection_SelectionSetChanged;

            //_canSelectFirstNodes = true;
        }
开发者ID:Sugz,项目名称:ObjectsProperties,代码行数:11,代码来源:ObjectsPropertiesVM.cs

示例10: RelateInfo

 /// <summary>
 /// Represents the Relationship Class information
 /// </summary>
 /// <param name="featureLayer"></param>
 /// <param name="selection"></param>
 public RelateInfo(FeatureLayer featureLayer, Selection selection)
 {
     _featureLayer = featureLayer;
     _selection = selection;            
     _featureClassName = _featureLayer.GetFeatureClass().GetName();
     
 }
开发者ID:ChaitG,项目名称:arcgis-pro-sdk-community-samples,代码行数:12,代码来源:RelateInfo.cs

示例11: ToSelection

        internal Selection ToSelection()
        {
            Selection s = new Selection();
            if (this.Pane != PaneValues.TopLeft) s.Pane = this.Pane;

            if (this.ActiveCell.Length > 0 && !this.ActiveCell.Equals("A1", StringComparison.OrdinalIgnoreCase))
            {
                s.ActiveCell = this.ActiveCell;
            }

            if (this.ActiveCellId != 0) s.ActiveCellId = this.ActiveCellId;

            if (this.SequenceOfReferences.Count > 0)
            {
                if (this.SequenceOfReferences.Count == 1)
                {
                    // not equal to A1
                    if (this.SequenceOfReferences[0].StartRowIndex != 1
                        || this.SequenceOfReferences[0].StartColumnIndex != 1
                        || this.SequenceOfReferences[0].EndRowIndex != 1
                        || this.SequenceOfReferences[0].EndColumnIndex != 1)
                    {
                        s.SequenceOfReferences = SLTool.TranslateCellPointRangeToSeqRef(this.SequenceOfReferences);
                    }
                }
                else
                {
                    s.SequenceOfReferences = SLTool.TranslateCellPointRangeToSeqRef(this.SequenceOfReferences);
                }
            }

            return s;
        }
开发者ID:rahmatsyaparudin,项目名称:KP_Raport,代码行数:33,代码来源:SLSelection.cs

示例12: Buff

		public static Composite Buff(string spell, Selection<bool> reqs = null)
		{
			return
				new Decorator(
					ret => (reqs == null || reqs(ret)) && !Me.HasBuff(spell),
					Cast(spell, ret => Me, ret => true));
		}
开发者ID:BosslandGmbH,项目名称:BuddyWing.DefaultCombat,代码行数:7,代码来源:Spell.cs

示例13: MainMenu

        public MainMenu(Rectangle windowSize, KeyboardState newKeyboardState, MouseState newMouseState)
        {
            windowWidth = windowSize.Width;
            windowHeight = windowSize.Height;
            keyboardState = newKeyboardState;
            mousestate = newMouseState;
            selection = Selection.Play;
            wallpaper = new Sprite(new Rectangle(0, 0, windowWidth, windowHeight), windowSize);
            wallpaperText = new Sprite(new Rectangle(0, 0, windowWidth, windowHeight), windowSize);
            nuages = new Sprite(new Rectangle(0, 0, windowWidth * 3, windowHeight), windowSize);
            nuages.Direction = new Vector2(-1, 0);
            nuages.Vitesse = 0.1f; // 1f = 1000 px/sec
            mouse = new ParticleEngine(windowSize, new DecimalRectangle(-200, -200, 0, 0), new Vector3(1, 10, 10),
                                new List<string>() { "particle/star"}, 10, 0.1f, 2f, -45f, 15f, 0f, 180f, -1f, 1f, 10f, 150f);
            mouse.SetColorRange(0, 100, 0, 30, 0, 30);
            relativeAmplitudeVibrationSelection = (float)amplitudeVibrationSelection / (float)(windowHeight + windowWidth);
            sprites = new List<AnimatedSprite>();

            menuItems = new Dictionary<Selection, Sprite>();
            menuItems.Add(Selection.Play, new Sprite(new Rectangle(112, 423, 124, 55), windowSize, "menu/textPlay"));
            menuItems.Add(Selection.Extra, new Sprite(new Rectangle(191, 480, 124, 55), windowSize, "menu/textExtra"));
            menuItems.Add(Selection.Options, new Sprite(new Rectangle(394, 470, 135, 55), windowSize, "menu/textOptions"));
            menuItems.Add(Selection.Credit, new Sprite(new Rectangle(562, 400, 124, 55), windowSize, "menu/textCredit"));
            menuItems.Add(Selection.Exit, new Sprite(new Rectangle(675, 480, 101, 55), windowSize, "menu/textExit"));
        }
开发者ID:Nicomplex,项目名称:The-Revenge-Of-the-Dark-Side,代码行数:25,代码来源:MainMenu.cs

示例14: Init

		protected override void Init ()
		{
			var listView = new ListView ();

			var selection = new Selection ();
			listView.SetBinding (ListView.ItemsSourceProperty, "Items");

			listView.ItemTemplate = new DataTemplate (() => {
				var cell = new SwitchCell ();
				cell.SetBinding (SwitchCell.TextProperty, "Name");
				cell.SetBinding (SwitchCell.OnProperty, "IsSelected", BindingMode.TwoWay);
				return cell;
			});

			var instructions = new Label {
				FontSize = 16,
				Text =
					"The label at the bottom should equal the number of switches which are in the 'on' position. Flip some of the switches. If the number at the bottom does not equal the number of 'on' switches, the test has failed."
			};

			var label = new Label { FontSize = 24 };
			label.SetBinding (Label.TextProperty, "SelectedCount");

			Content = new StackLayout {
				VerticalOptions = LayoutOptions.Fill,
				Children = {
					instructions,
					listView,
					label
				}
			};

			BindingContext = selection;
		}
开发者ID:Costo,项目名称:Xamarin.Forms,代码行数:34,代码来源:Bugzilla31964.cs

示例15: Execute

 /// <summary>
 /// Replace the current selection'sections text color with  the color specified in the argument
 /// </summary>
 /// <param Name="selection">The selection to modify</param>
 /// <param Name="argument">The argument provided to the command</param>
 public override void Execute(Selection selection, string[] arguments)
 {
     //Detect which color the user wanted
     Color? color = GetColor(arguments);
     //If there was a valid color and a valid selection, apply the color to the selection
     if (color != null && selection != null) { MergeAndApply(selection, color: color); }
 }
开发者ID:malacandrian,项目名称:fyp,代码行数:12,代码来源:ColorCommand.cs


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