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


C# ButtonState.ToString方法代码示例

本文整理汇总了C#中ButtonState.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# ButtonState.ToString方法的具体用法?C# ButtonState.ToString怎么用?C# ButtonState.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ButtonState的用法示例。


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

示例1: ThreadButtonState

        internal void ThreadButtonState()
        {
            int LastSearchTime = Config.ButtonStateUpdateInterval;
            while (true)
            {
                if (Form.NTRConnection.HardwarePID != null)
                {
                    SearchCriteria Criteria = new SearchCriteria();
                    Criteria.ProcessID = BitConverter.ToUInt32(Utilities.GetByteArrayFromByteString(Form.NTRConnection.HardwarePID), 0);
                    Criteria.DataType = DataTypeExact.Bytes1;
                    Criteria.StartAddress = BUTTON_STATES_START;
                    Criteria.Length = BUTTON_STATES_SIZE;
                    Criteria.SearchType = SearchTypeBase.Unknown;
                    Criteria.SearchValue = new byte[] { 0 };
                    Criteria.Size = 1;
                    Criteria.HideSearch = true;
                    Form.NTRConnection.SearchCriteria.Add(Criteria);

                    Form.NTRConnection.SendReadMemoryPacket(Criteria);

                    ButtonState = (ButtonState)Criteria.AddressesFound[BUTTON_STATES_START + Offset_Button][0];
                    ShoulderState = (ShoulderState)Criteria.AddressesFound[BUTTON_STATES_START + Offset_Shoulder][0];
                    StickState = (StickState)Criteria.AddressesFound[BUTTON_STATES_START + Offset_Stick][0];
                    StickHoriz = Criteria.AddressesFound[BUTTON_STATES_START + Offset_Horiz][0];
                    StickVert = Criteria.AddressesFound[BUTTON_STATES_START + Offset_Vert][0];

                    LastSearchTime = Math.Max(LastSearchTime, (int)Criteria.Duration);

                    Form.NTRConnection.SetCurrentOperationText2 = ButtonState.ToString() + "|" + ShoulderState.ToString() + "|" + StickState.ToString() + "|" + StickHoriz + "|" + StickVert + "|" + LastSearchTime;
                }

                Thread.Sleep(LastSearchTime * 2);
            }
        }
开发者ID:valarnin,项目名称:NTRRemoteDebugger,代码行数:34,代码来源:MainFormThreadButtonState.cs

示例2: StateChangedMethod

 protected void StateChangedMethod(ButtonState prevState, ButtonState currState)
 {
     var backButtonTex = Resources.Load<Texture2D>(String.Format(@"Buttons/{0}", gameObject.GetComponent<SpriteRenderer>().sprite.texture.name.Replace(prevState.ToString(), currState.ToString())));
     if (!backButtonTex) return;
     gameObject.GetComponent<SpriteRenderer>().sprite = Sprite.Create(backButtonTex,
         new Rect(0, 0, backButtonTex.width, backButtonTex.height), new Vector2(0, 0));
 }
开发者ID:Lindet,项目名称:DiabloClickerWiP,代码行数:7,代码来源:ButtonBaseMouseEvents.cs

示例3: ForStateWithFallback

        private string ForStateWithFallback(ButtonState state)
        {
            string path = ForState(state);
            switch (state)
            {
                case ButtonState.Normal: break; // No fallback.

                case ButtonState.MouseOver: 
                    path = Over ?? ForState(ButtonState.Normal);
                    break;

                case ButtonState.MouseDown: 
                    path = Down ?? ForState(ButtonState.Normal);
                    break;

                case ButtonState.Pressed: 
                    path = Pressed ?? ForStateWithFallback(ButtonState.MouseDown);
                    break;

                default: throw new Exception("Not Supported: " + state.ToString());
            }
            return path;
        }
开发者ID:philcockfield,项目名称:Open.TestHarness.SL,代码行数:23,代码来源:ImageButtonUrls.cs

示例4: ForState

 private string ForState(ButtonState state)
 {
     string path;
     switch (state)
     {
         case ButtonState.Normal: path = Normal; break;
         case ButtonState.MouseOver: path = Over; break;
         case ButtonState.MouseDown: path = Down; break;
         case ButtonState.Pressed: path = Pressed; break;
         default: throw new Exception("Not Supported: " + state.ToString());
     }
     if (string.IsNullOrEmpty(path)) path = null;
     return path;
 }
开发者ID:philcockfield,项目名称:Open.TestHarness.SL,代码行数:14,代码来源:ImageButtonUrls.cs

示例5: stateString

 private string stateString(ButtonState state)
 {
     return state.ToString();
 }
开发者ID:sopindm,项目名称:CodeSamples,代码行数:4,代码来源:Button.cs


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