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


C# Key类代码示例

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


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

示例1: ControlHandle

 public override void ControlHandle(Key k)
 {
     switch (k)
     {
         case Key.Up:
             if (option > 0) option--;
             if (topRow > option) topRow--;
             break;
         case Key.Down:
             if (option < Materiatory.MATERIATORY_SIZE - 1) option++;
             if (topRow < option - rows + 1) topRow++;
             break;
         case Key.X:
             if (trashing)
             {
                 MenuState.MateriaScreen.ChangeControl(MenuState.MateriaArrange);
             }
             else
             {
                 MenuState.MateriaScreen.ChangeToDefaultControl();
             }
             trashing = false;
             break;
         case Key.Circle:
             if (Trashing)
             {
                 MenuState.MateriaScreen.ChangeControl(MenuState.MateriaPrompt);
                 break;
             }
             MateriaOrb neworb = MenuState.Party.Materiatory.Get(option);
             MateriaOrb oldorb;
             switch (MenuState.MateriaTop.OptionY)
             {
                 case 0:
                     oldorb = MenuState.Party.Selected.Weapon.Slots[MenuState.MateriaTop.OptionX];
                     if (oldorb != null)
                         oldorb.Detach(MenuState.Party.Selected);
                     MenuState.Party.Materiatory.Put(oldorb, option);
                     if (neworb != null)
                         neworb.Attach(MenuState.Party.Selected);
                     MenuState.Party.Selected.Weapon.AttachMateria(neworb, MenuState.MateriaTop.OptionX);
                     MenuState.MateriaScreen.ChangeToDefaultControl();
                     break;
                 case 1:
                     oldorb = MenuState.Party.Selected.Armor.Slots[MenuState.MateriaTop.OptionX];
                     if (oldorb != null)
                         oldorb.Detach(MenuState.Party.Selected);
                     MenuState.Party.Materiatory.Put(oldorb, option);
                     if (neworb != null)
                         neworb.Attach(MenuState.Party.Selected);
                     MenuState.Party.Selected.Armor.AttachMateria(neworb, MenuState.MateriaTop.OptionX);
                     MenuState.MateriaScreen.ChangeToDefaultControl();
                     break;
                 default: break;
             }
             break;
         default:
             break;
     }
 }
开发者ID:skinitimski,项目名称:Reverence,代码行数:60,代码来源:List.cs

示例2: WasKeyReleased

        public bool WasKeyReleased(Key key)
        {
            var previouseMouseButtonState = _previousKeyboardState[key];
            var currentMouseButtonState = _currentKeyboardState[key];

            return previouseMouseButtonState && !currentMouseButtonState;
        }
开发者ID:HaKDMoDz,项目名称:ProceduralGeneration,代码行数:7,代码来源:KeyboardInputProcessor.cs

示例3: RefreshData

 void RefreshData() 
 {
      _Key = null;
      _Group = null;
      
      groupKey.Visible = false;
 }
开发者ID:gpanayir,项目名称:sffwk,代码行数:7,代码来源:UCKey.cs

示例4: CreateKeyEventArgs

 protected static KeyEventArgs CreateKeyEventArgs(
     Key key,
     ModifierKeys modKeys = ModifierKeys.None)
 {
     var device = new MockKeyboardDevice(InputManager.Current) { ModifierKeysImpl = modKeys };
     return device.CreateKeyEventArgs(key, modKeys);
 }
开发者ID:Kazark,项目名称:VsVim,代码行数:7,代码来源:VimKeyProcessorTest.cs

示例5: ColumnName

        public void ColumnName()
        {
            var x = new Key();
            Assert.IsNull(x.ColumnFamily);
            Assert.IsNull(x.ColumnQualifier);
            Assert.IsNull(x.Column);

            x = new Key { ColumnFamily = "CF" };
            Assert.AreEqual("CF", x.ColumnFamily);
            Assert.IsNull(x.ColumnQualifier);
            Assert.AreEqual("CF", x.Column);

            x = new Key { ColumnFamily = "CF", ColumnQualifier = "CQ" };
            Assert.AreEqual("CF", x.ColumnFamily);
            Assert.AreEqual("CQ", x.ColumnQualifier);
            Assert.AreEqual("CF:CQ", x.Column);

            x = new Key { Column = "CF" };
            Assert.AreEqual("CF", x.ColumnFamily);
            Assert.IsNull(x.ColumnQualifier);
            Assert.AreEqual("CF", x.Column);

            x = new Key { Column = "CF:CQ" };
            Assert.AreEqual("CF", x.ColumnFamily);
            Assert.AreEqual("CQ", x.ColumnQualifier);
            Assert.AreEqual("CF:CQ", x.Column);
        }
开发者ID:andysoftdev,项目名称:ht4n,代码行数:27,代码来源:TestKey.cs

示例6: KeyUp

        public void KeyUp(Key key)
        {
            if (key == Key.Space)
            {
                SpaceCraft.SetThrottle(0);

                SpaceCraft.Stage();
            }

            if (key == Key.X)
            {
                SpaceCraft.SetThrottle(0);
            }

            if (key == Key.Z)
            {
                SpaceCraft.SetThrottle(100);
            }

            if (key == Key.Q && !IsRetrograde)
            {
                IsPrograde = !IsPrograde;
            }

            if (key == Key.W && !IsPrograde)
            {
                IsRetrograde = !IsRetrograde;
            }
        }
开发者ID:rdancer,项目名称:SpaceSim,代码行数:29,代码来源:SimpleFlightController.cs

示例7: KeyboardState

 public KeyboardState( params Key [] keys )
     : this()
 {
     PressedKeys = new Key [ keys.Length ];
     for ( int i = 0; i < keys.Length; i++ )
         PressedKeys [ i ] = keys [ i ];
 }
开发者ID:Daramkun,项目名称:Misty,代码行数:7,代码来源:KeyboardState.cs

示例8: TryGetToken

 public override bool TryGetToken(EndpointAddress target, EndpointAddress issuer, out GenericXmlSecurityToken cachedToken)
 {
     if (target == null)
     {
         throw new ArgumentNullException("target");
     }
     cachedToken = null;
     lock (thisLock)
     {
         GenericXmlSecurityToken tmp;
         Key key = new Key(target.Uri, issuer == null ? null : issuer.Uri);
         if (this.cache.TryGetValue(key, out tmp))
         {
             // if the cached token is going to expire soon, remove it from the cache and return a cache miss
             if (tmp.ValidTo < DateTime.UtcNow + TimeSpan.FromMinutes(1))
             {
                 this.cache.Remove(key);
                 OnTokenRemoved(key);
             }
             else
             {
                 cachedToken = tmp;
             }
         }
     }
     return (cachedToken != null);
 }
开发者ID:ssickles,项目名称:archive,代码行数:27,代码来源:IssuedTokenCache.cs

示例9: IconButton

		public IconButton(IGameWindow window, Camera<OrthographicProjection> camera, Vector2 position, IRenderable renderable, Key? hotkey = null)
			: base(window, camera, position)
		{
			Renderable = renderable;
			IsSelected = false;
			Hotkey = hotkey;
		}
开发者ID:treytomes,项目名称:ASCIIWorld2,代码行数:7,代码来源:IconButton.cs

示例10: DomainEvent

 public DomainEvent()
 {
     //AggregateRootId = aggregateRootId;
     //EventVersion = version;
     EventState = EventState.Sequence;
     Key = new Key { KeyName = this.GetType().Name };
 }
开发者ID:ryzam,项目名称:Vaccine-CQRS,代码行数:7,代码来源:DomainEvent.cs

示例11: NesVSUnisystemDIPKeyboardConnection

        public NesVSUnisystemDIPKeyboardConnection(IntPtr handle, IInputSettingsVSUnisystemDIP settings)
        {
            DirectInput di = new DirectInput();
            keyboard = new Keyboard(di);
            keyboard.SetCooperativeLevel(handle, CooperativeLevel.Nonexclusive | CooperativeLevel.Foreground);

            if (settings.CreditServiceButton != "")
                CreditServiceButton = (SlimDX.DirectInput.Key)Enum.Parse(typeof(SlimDX.DirectInput.Key), settings.CreditServiceButton);
            if (settings.DIPSwitch1 != "")
                DIPSwitch1 = (SlimDX.DirectInput.Key)Enum.Parse(typeof(SlimDX.DirectInput.Key), settings.DIPSwitch1);
            if (settings.DIPSwitch2 != "")
                DIPSwitch2 = (SlimDX.DirectInput.Key)Enum.Parse(typeof(SlimDX.DirectInput.Key), settings.DIPSwitch2);
            if (settings.DIPSwitch3 != "")
                DIPSwitch3 = (SlimDX.DirectInput.Key)Enum.Parse(typeof(SlimDX.DirectInput.Key), settings.DIPSwitch3);
            if (settings.DIPSwitch4 != "")
                DIPSwitch4 = (SlimDX.DirectInput.Key)Enum.Parse(typeof(SlimDX.DirectInput.Key), settings.DIPSwitch4);
            if (settings.DIPSwitch5 != "")
                DIPSwitch5 = (SlimDX.DirectInput.Key)Enum.Parse(typeof(SlimDX.DirectInput.Key), settings.DIPSwitch5);
            if (settings.DIPSwitch6 != "")
                DIPSwitch6 = (SlimDX.DirectInput.Key)Enum.Parse(typeof(SlimDX.DirectInput.Key), settings.DIPSwitch6);
            if (settings.DIPSwitch7 != "")
                DIPSwitch7 = (SlimDX.DirectInput.Key)Enum.Parse(typeof(SlimDX.DirectInput.Key), settings.DIPSwitch7);
            if (settings.DIPSwitch8 != "")
                DIPSwitch8 = (SlimDX.DirectInput.Key)Enum.Parse(typeof(SlimDX.DirectInput.Key), settings.DIPSwitch8);
            if (settings.CreditLeftCoinSlot != "")
                CreditLeftCoinSlot = (SlimDX.DirectInput.Key)Enum.Parse(typeof(SlimDX.DirectInput.Key), settings.CreditLeftCoinSlot);
            if (settings.CreditRightCoinSlot != "")
                CreditRightCoinSlot = (SlimDX.DirectInput.Key)Enum.Parse(typeof(SlimDX.DirectInput.Key), settings.CreditRightCoinSlot);
            NesEmu.EMUShutdown += NesEmu_EMUShutdown;
        }
开发者ID:Blizz9,项目名称:FanCut,代码行数:30,代码来源:NesVSUnisystemDIPKeyboardConnection.cs

示例12: KeyEventArgs

		public KeyEventArgs (KeyboardDevice keyboard, PresentationSource inputSource,
				     int timestamp, Key key)
			: base (keyboard, timestamp)
		{
			this.inputSource = inputSource;
			this.key = key;
		}
开发者ID:alesliehughes,项目名称:olive,代码行数:7,代码来源:KeyEventArgs.cs

示例13: The_Corresponding_Relationship_Should_Also_Have_The_Column_Removed

        public void The_Corresponding_Relationship_Should_Also_Have_The_Column_Removed()
        {
            // Create database and relationships
            Database db = RelationshipDatabaseLoader.GetDb();

            Relationship relationship = db.Tables[1].Relationships[0];
            Assert.That(relationship.PrimaryKey, Is.SameAs(db.Tables[0].Keys[0]));
            Assert.That(relationship.ForeignKey, Is.SameAs(db.Tables[1].Keys[0]));
            Assert.That(relationship.PrimaryKey.Columns[0].Name, Is.EqualTo("Column1"));
            Assert.That(relationship.PrimaryKey.Columns[1].Name, Is.EqualTo("Column2"));

            IKey originalKey = db.Tables[1].Keys[0];

            IKey newKey = new Key(originalKey.Name, originalKey.Keytype);
            newKey.Parent = new Table("Table2");
            newKey.Parent.AddColumn(new Column("Column2"));
            newKey.Description = "new description";
            newKey.AddColumn("Column2");

            KeyChangeOperation op = new KeyChangeOperation(db.Tables[1].Keys[0], newKey);
            op.RunOperation();
            op.RunSecondStep();

            // Make sure the relationship is still the same, and has the same references.
            Relationship relationship2 = db.Tables[1].Relationships[0];
            Assert.That(relationship2, Is.SameAs(relationship));
            Assert.That(relationship2.PrimaryKey, Is.SameAs(db.Tables[0].Keys[0]));
            Assert.That(relationship2.ForeignKey, Is.SameAs(db.Tables[1].Keys[0]));
            Assert.That(relationship2.PrimaryKey.Columns, Has.Count(2));
            Assert.That(relationship2.ForeignKey.Columns, Has.Count(1));
            Assert.That(relationship2.ForeignKey.Columns[0].Name, Is.EqualTo("Column2"));
        }
开发者ID:uQr,项目名称:Visual-NHibernate,代码行数:32,代码来源:Specs_For_Merging_Databases_Relationships.cs

示例14: PlayerViewModel

 public PlayerViewModel(string name, Key key, int allowedShots)
 {
     Name = name;
     Key = key;
     AllowedShots = allowedShots;
     scores = new Dictionary<string, int>();
 }
开发者ID:anyhotcountry,项目名称:YouthClubApp,代码行数:7,代码来源:PlayerViewModel.cs

示例15: AThresholdGesture

 /// <summary>
 /// 
 /// </summary>
 /// <param name="jointType"></param>
 /// <param name="threshold"></param>
 /// <param name="comparator"></param>
 /// <param name="name"></param>
 /// <param name="key"></param>
 protected AThresholdGesture(JointType jointType, double threshold, ThresholdComparator comparator, string name, Key key)
     : base(name, key)
 {
     this.jointType = jointType;
     this.threshold = threshold;
     this.comparator = comparator;
 }
开发者ID:zeromeus,项目名称:gest_tracker,代码行数:15,代码来源:AThresholdGesture.cs


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