本文整理汇总了C#中ButtonType类的典型用法代码示例。如果您正苦于以下问题:C# ButtonType类的具体用法?C# ButtonType怎么用?C# ButtonType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ButtonType类属于命名空间,在下文中一共展示了ButtonType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ButtonLabelForType
public String ButtonLabelForType (ButtonType type)
{
switch (type) {
case ButtonType.Free:
return "Free()";
case ButtonType.Release:
return "[Release]";
case ButtonType.AutoRelease:
return "[AutoRelease]";
case ButtonType.DeAlloc:
return "[DeAlloc]";
case ButtonType.GC:
return "Garbage Collection";
case ButtonType.ARC:
return "ARC!";
default:
break;
}
return null;
}
示例2: SetButton
public void SetButton(ButtonType btn, bool value)
{
if( value )
buttons = buttons | btn; // set on
else
buttons = buttons & ~btn; // set off
}
示例3: TypeButtonPressed
public static void TypeButtonPressed(object sender, ButtonType button)
{
if (TypeButtonChanged != null)
{
TypeButtonChanged(sender, new TypeButtonEventArgs(button));
}
}
示例4: SendDownEvent
private void SendDownEvent( ButtonType button )
{
//Debug.Log( "Button: " + button );
if( OnButtonDown != null )
OnButtonDown( button );
}
示例5: TypeButton
public TypeButton(ButtonType type, Rect menuArea)
{
m_ButtonType = type;
CalculateSize (menuArea);
//Create Style
if (m_ButtonType == ButtonType.Building){
m_ButtonStyle = GUIStyles.CreateTypeButtonStyleB();
Debug.Log (m_ButtonType);
}
if (m_ButtonType == ButtonType.Ship){
m_ButtonStyle = GUIStyles.CreateTypeButtonStyleSh();
Debug.Log (m_ButtonType);
}
if (m_ButtonType == ButtonType.Science){
m_ButtonStyle = GUIStyles.CreateTypeButtonStyleSc();
Debug.Log (m_ButtonType);
}
//Attach to events
GUIEvents.TypeButtonChanged += ButtonPressedEvent;
}
示例6: ButtonCell
public ButtonCell()
{
title = "Button";
buttonType = ButtonType.MomentaryLight;
bezelStyle = BezelStyle.Rounded;
buttonState = ButtonState.Unchecked;
}
示例7: OnClick
void OnClick()
{
switch (type)
{
case ButtonType.Play:
GameDirector.gameInstance.ResetGame();
break;
case ButtonType.Credits:
break;
case ButtonType.Pause:
GameDirector.gameInstance.PauseGame();
GUIManager.guiInstance.ShowGamePausedPanel();
// type = ButtonType.Resume;
break;
case ButtonType.Resume:
GameDirector.gameInstance.ResumeGame();
GUIManager.guiInstance.ShowInGamePanel();
// type = ButtonType.Pause;
break;
case ButtonType.Share:
FacebookManager.facebookInstance.PostOnFacebook();
type = ButtonType.Share;
break;
case ButtonType.GoHome:
GUIManager.guiInstance.ShowStartPanel();
break;
case ButtonType.Leaderboard:
GUIManager.guiInstance.ShowLeaderboardPanel();
break;
}
}
示例8: CreateButton
public static IDataControlButton CreateButton (ButtonType type, Control container, string text, string image, string command, string commandArg, bool allowCallback)
{
IDataControlButton btn;
switch (type) {
case ButtonType.Link:
btn = new DataControlLinkButton ();
break;
case ButtonType.Image:
btn = new DataControlImageButton ();
btn.ImageUrl = image;
break;
default:
btn = new DataControlButton ();
break;
}
btn.Container = container;
btn.CommandName = command;
btn.CommandArgument = commandArg;
btn.Text = text;
btn.CausesValidation = false;
btn.AllowCallback = allowCallback;
return btn;
}
示例9: GetButtonDown
public bool GetButtonDown(ButtonType buttonType)
{
if( currentState.GetButton(buttonType) && !lastState.GetButton(buttonType))
return true;
return false;
}
示例10: OnButtonClick
private void OnButtonClick(ButtonType type)
{
string account = accountInput.text;
string password = passwordInput.text;
Debug.Log("---"+account+"---" + password);
if(account.Equals(""))
{
ShowErrorMsg("账号不能为空");
return;
}
if (password.Equals(""))
{
ShowErrorMsg ("密码不能为空");
return;
}
if(type == ButtonType.LOGIN)
{
AccountController.Instance.SendLoginRequest(account, password);
}
else if(type == ButtonType.REGIST)
{
AccountController.Instance.SendRegistRequest(account, password);
}
}
示例11: GetButtonUp
public bool GetButtonUp(ButtonType buttonType)
{
if( !currentState.GetButton(buttonType) && lastState.GetButton(buttonType))
return true;
return false;
}
示例12: ControlButton
/// <summary>
/// 根据按钮类型实例化按钮
/// </summary>
public ControlButton(ButtonType buttonType)
{
this.Type = buttonType;
StateLast = ButtonState.Released;
StateNow = ButtonState.Released;
//将按钮添加到按钮列表
buttonList.Add(this);
}
示例13: MessageForm
public MessageForm(string info,string title,ButtonType buttonType)
{
this.info=info;
this.title=title;
this.buttonType=buttonType;
InitializeComponent();
this.BackgroundImage=new Bitmap(GetType(),"images.message.jpg");
}
示例14: OnButtonClick
public override void OnButtonClick(ButtonType button)
{
if( ButtonType.ButtonWinGame == button )
gameManager.NewGameState(gameManager.stateGameWon);
if( ButtonType.ButtonLoseGame == button )
gameManager.NewGameState(gameManager.stateGameLost);
}
示例15: GetButton
public string GetButton(ButtonType buttonType)
{
foreach(ButtonMapping mapping in buttonMappings)
{
if( mapping.target == buttonType )
return mapping.button;
}
return "";
}