本文整理汇总了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);
}
}
示例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));
}
示例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;
}
示例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;
}
示例5: stateString
private string stateString(ButtonState state)
{
return state.ToString();
}