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


C# IButton类代码示例

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


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

示例1: createPopupMenu

        private void createPopupMenu(IButton button)
        {
            // create menu drawable
            PopupMenuDrawable _menu = new PopupMenuDrawable();

            // create menu options
            IButton _option1 = _menu.AddOption("Show/Hide image");
            _option1.OnClick += e => Toggle();
            IButton _option2 = _menu.AddOption("Show/hide image list");
            _option2.OnClick += e => _showList = !_showList;
            IButton _option3 = _menu.AddOption("Change skin");
            _option3.OnClick += e => _useKSPskin = !_useKSPskin;
            IButton _option4 = _menu.AddOption("Next image");
            _option4.OnClick += e => ImageNext();
            IButton _option5 = _menu.AddOption("Prev image");
            _option5.OnClick += e => ImagePrev();
            IButton _option6 = _menu.AddOption("-10% size");
            _option6.OnClick += e => ImageZm();
            IButton _option7 = _menu.AddOption("Original");
            _option7.OnClick += e => ImageOrig();
            IButton _option8 = _menu.AddOption("+10% size");
            _option8.OnClick += e => ImageZp();
            // auto-close popup menu when any option is clicked
            _menu.OnAnyOptionClicked += () => destroyPopupMenu(button);

            // hook drawable to button
            button.Drawable = _menu;
        }
开发者ID:hashashin,项目名称:ksp-img_viewer,代码行数:28,代码来源:img_viewer.cs

示例2: Delete

 public Delete(IButton button, SandboxControl control, UUID owner)
     : base(button)
 {
     _control = control;
     _control.State.AddStateButton(owner, button);
     button.SetVisualState(_control.Fade, 0);
 }
开发者ID:JohnMcCaffery,项目名称:RoutingIsland,代码行数:7,代码来源:Delete.cs

示例3: WriteButtonModel

 public static void WriteButtonModel(IButton button)
 {
     Log.Info("IsEnabled: " + button.IsEnabled);
     Log.Info("IsPressed: " + button.IsPressed);
     Log.Info("CanToggle: " + button.CanToggle);
     Log.Info("CanFocus: " + button.CanFocus);
 }
开发者ID:philcockfield,项目名称:Open.TestHarness.SL,代码行数:7,代码来源:WriteLogForButtons.cs

示例4: Start

		/// <summary>
		/// Start this instance.
		/// <para xml:lang="es">
		/// Inicia la instancia del boton.
		/// </para>
		/// </summary>
		public override void Start()
		{
			base.Start();

			// Create an stack
			IStack stack = Platform.Current.Create<IStack>();

			// Creates the button with text, size and specific color, with the event also click and adds it to the stack
			cmdShow = Platform.Current.Create<IButton>();
			cmdShow.Text = "Show/Hide";
			cmdShow.Click += CmdShow_Click;
			cmdShow.BackgroundColor = new Color(1, 255, 0, 0);
			cmdShow.FontColor = new Color(1, 255, 255, 255);
			stack.Children.Add(cmdShow);

			// Create an Label with text specific, not visible and adds it to the stack
			lbltext = Platform.Current.Create<ILabel>();
			lbltext.Text = "I'm visible, i want an ice-cream";
			lbltext.Visible = false;
			stack.Children.Add(lbltext);

			// Create another button with a specific text with your event click and adds it to the stack
			IButton cmdClose = Platform.Current.Create<IButton>();
			cmdClose.Text = "Close";
			cmdClose.Click += CmdClose_Click;
			stack.Children.Add(cmdClose);

			// Establishes the content and title of the page
			Platform.Current.Page.Title = "Test label";
			Platform.Current.Page.Content = stack;
		}
开发者ID:okhosting,项目名称:OKHOSTING.UI,代码行数:37,代码来源:ButtonController.cs

示例5: OnButtonPressed

        protected override void OnButtonPressed(IButton button, ButtonPressedDuration duration)
        {
            JsonObject data = CreateDataPackage(button.Id, EventType.ButtonPressed);
            data.SetNamedValue("kind", JsonValue.CreateStringValue(duration.ToString()));

            Task.Run(() => SendToAzureEventHubAsync(data));
        }
开发者ID:rishabhbanga,项目名称:CK.HomeAutomation,代码行数:7,代码来源:AzureEventHubPublisher.cs

示例6: WithButtonPressedLongTrigger

        public Automation WithButtonPressedLongTrigger(IButton button)
        {
            if (button == null) throw new ArgumentNullException(nameof(button));

            button.PressedLong += (s, e) => Trigger();
            return this;
        }
开发者ID:rishabhbanga,项目名称:CK.HomeAutomation,代码行数:7,代码来源:Automation.cs

示例7: Initialize

        public override void Initialize(params object[] list)
        {
            if (list != null && list[0] != null)
            {
                controled = list[0] as UIObject;
            }
            mainButton = ToolbarManager.Instance.add("AGM", "AGMMainSwitch");
            string str = SettingsManager.Settings.GetValue<bool>( SettingsManager.IsMainWindowVisible, true) ?
                mainPath + onButton :
                mainPath + offButton;
            mainButton.ToolTip = "Action Group Manager";

            mainButton.TexturePath = str;

            mainButton.Visibility = new GameScenesVisibility(GameScenes.FLIGHT);

            mainButton.OnClick +=
                (e) =>
                {
                    if (e.MouseButton == 0)
                    {
                        controled.SetVisible(!controled.IsVisible());
                        mainButton.TexturePath = controled.IsVisible() ? mainPath + onButton : mainPath + offButton;
                    }
                };
        }
开发者ID:KaiSforza,项目名称:ActionGroupManager,代码行数:26,代码来源:ShortcutNew.cs

示例8: TestPage1

 public TestPage1(IBrowserDriver driver)
     : base(driver)
 {
     InputField = driver.CreateTextField().FromID("TextField");
     OutputField = driver.CreateTextField().FromID("TextFieldOutput");
     Button = driver.CreateButton().FromID("UpdateButton");
 }
开发者ID:PeteProgrammer,项目名称:WebTestFramework,代码行数:7,代码来源:TestPage1.cs

示例9: AttachChildControls

 protected override void AttachChildControls()
 {
     if (!int.TryParse(this.Page.Request.QueryString["productId"], out this.productId))
     {
         base.GotoResourceNotFound();
     }
     this.txtEmail = (TextBox) this.FindControl("txtEmail");
     this.txtUserName = (TextBox) this.FindControl("txtUserName");
     this.txtContent = (TextBox) this.FindControl("txtContent");
     this.btnRefer = ButtonManager.Create(this.FindControl("btnRefer"));
     this.txtConsultationCode = (HtmlInputText) this.FindControl("txtConsultationCode");
     this.prodetailsLink = (ProductDetailsLink) this.FindControl("ProductDetailsLink1");
     this.btnRefer.Click += new EventHandler(this.btnRefer_Click);
     if (!this.Page.IsPostBack)
     {
         PageTitle.AddSiteNameTitle("商品咨询", HiContext.Current.Context);
         if ((HiContext.Current.User.UserRole == UserRole.Member) || (HiContext.Current.User.UserRole == UserRole.Underling))
         {
             this.txtUserName.Text = HiContext.Current.User.Username;
             this.txtEmail.Text = HiContext.Current.User.Email;
             this.btnRefer.Text = "咨询";
         }
         ProductInfo productSimpleInfo = ProductBrowser.GetProductSimpleInfo(this.productId);
         if (productSimpleInfo != null)
         {
             this.prodetailsLink.ProductId = this.productId;
             this.prodetailsLink.ProductName = productSimpleInfo.ProductName;
         }
         this.txtConsultationCode.Value = string.Empty;
     }
 }
开发者ID:davinx,项目名称:himedi,代码行数:31,代码来源:ProductConsultations.cs

示例10: OnDestroy

 public void OnDestroy()
 {
     if ( toolbarButton != null ) {
         toolbarButton.Destroy();
         toolbarButton = null;
     }
 }
开发者ID:gnikandrov,项目名称:MinimalAmbientLight,代码行数:7,代码来源:MinimalAmbientLight.cs

示例11: Start

        public void Start()
        {
            // Register toolbar button
            toolbarButton = ToolbarManager.Instance.add("MinimalAmbientLight", "Adjust");
            toolbarButton.Text = "Adjust Minimal Ambient Light";
            toolbarButton.TexturePath = "MinimalAmbientLight/MinimalAmbientLight24";
            toolbarButton.ToolTip = "Lightning: LMB: Next; MMB: Default, RMB: Adjust";
            toolbarButton.Visibility = new GameScenesVisibility(GameScenes.FLIGHT);
            toolbarButton.OnClick += (e) => {
                switch (e.MouseButton) {
                    case 0:		// LMB
                        nextSetting();
                        break;
                    case 2:		// MMB
                        resetDefault();
                        break;
                    case 1:		// RMB
                        toggleToolbarConfig();
                        break;
                    default:
                        nextSetting();
                        break;
                }
            };

            // TODO: Register applauncher button
            loadSettings();
        }
开发者ID:gnikandrov,项目名称:MinimalAmbientLight,代码行数:28,代码来源:MinimalAmbientLight.cs

示例12: AttachChildControls

 protected override void AttachChildControls()
 {
     this.txtRealName = (TextBox) this.FindControl("txtRealName");
     this.txtEmail = (TextBox) this.FindControl("txtEmail");
     this.dropRegionsSelect = (RegionSelector) this.FindControl("dropRegions");
     this.gender = (GenderRadioButtonList) this.FindControl("gender");
     this.calendDate = (WebCalendar) this.FindControl("calendDate");
     this.txtAddress = (TextBox) this.FindControl("txtAddress");
     this.txtQQ = (TextBox) this.FindControl("txtQQ");
     this.txtMSN = (TextBox) this.FindControl("txtMSN");
     this.txtTel = (TextBox) this.FindControl("txtTel");
     this.txtHandSet = (TextBox) this.FindControl("txtHandSet");
     this.btnOK1 = ButtonManager.Create(this.FindControl("btnOK1"));
     this.Statuses = (SmallStatusMessage) this.FindControl("Statuses");
     this.btnOK1.Click += new EventHandler(this.btnOK1_Click);
     PageTitle.AddSiteNameTitle("个人信息", HiContext.Current.Context);
     if (!this.Page.IsPostBack)
     {
         Member user = HiContext.Current.User as Member;
         if (user != null)
         {
             this.BindData(user);
         }
     }
 }
开发者ID:davinx,项目名称:himedi,代码行数:25,代码来源:UserProfile.cs

示例13: AttachChildControls

 protected override void AttachChildControls()
 {
     this.favorites = (Common_Favorite_ProductList) this.FindControl("list_Common_Favorite_ProList");
     this.btnSearch = ButtonManager.Create(this.FindControl("btnSearch"));
     this.txtKeyWord = (TextBox) this.FindControl("txtKeyWord");
     this.pager = (Pager) this.FindControl("pager");
     this.btnDeleteSelect = (LinkButton) this.FindControl("btnDeleteSelect");
     this.btnSearch.Click += new EventHandler(this.btnSearch_Click);
     this.favorites.ItemCommand += new Common_Favorite_ProductList.CommandEventHandler(this.favorites_ItemCommand);
     this.btnDeleteSelect.Click += new EventHandler(this.btnDeleteSelect_Click);
     PageTitle.AddSiteNameTitle("商品收藏夹", HiContext.Current.Context);
     if (!this.Page.IsPostBack)
     {
         if (!string.IsNullOrEmpty(this.Page.Request.QueryString["ProductId"]))
         {
             int result = 0;
             int.TryParse(this.Page.Request.QueryString["ProductId"], out result);
             if (!CommentsHelper.ExistsProduct(result) && !CommentsHelper.AddProductToFavorite(result))
             {
                 this.ShowMessage("添加商品到收藏夹失败", false);
             }
         }
         this.BindList();
     }
 }
开发者ID:davinx,项目名称:himedi,代码行数:25,代码来源:Favorites.cs

示例14: AttachChildControls

 protected override void AttachChildControls()
 {
     int.TryParse(this.Page.Request.QueryString["modeId"], out this.paymentModeId);
     decimal.TryParse(this.Page.Request.QueryString["blance"], out this.balance);
     this.litUserName = (Literal) this.FindControl("litUserName");
     this.lblPaymentName = (Literal) this.FindControl("lblPaymentName");
     this.imgPayment = (HiImage) this.FindControl("imgPayment");
     this.lblBlance = (FormatedMoneyLabel) this.FindControl("lblBlance");
     this.litPayCharge = (Literal) this.FindControl("litPayCharge");
     this.btnConfirm = ButtonManager.Create(this.FindControl("btnConfirm"));
     PageTitle.AddSiteNameTitle("充值确认", HiContext.Current.Context);
     this.btnConfirm.Click += new EventHandler(this.btnConfirm_Click);
     if (!this.Page.IsPostBack)
     {
         if ((this.paymentModeId == 0) || (this.balance == 0M))
         {
             this.Page.Response.Redirect(Globals.GetSiteUrls().UrlData.FormatUrl("user_InpourRequest"));
         }
         else
         {
             PaymentModeInfo paymentMode = TradeHelper.GetPaymentMode(this.paymentModeId);
             this.litUserName.Text = HiContext.Current.User.Username;
             if (paymentMode != null)
             {
                 this.lblPaymentName.Text = paymentMode.Name;
                 this.lblBlance.Money = this.balance;
                 this.ViewState["PayCharge"] = paymentMode.CalcPayCharge(this.balance);
                 this.litPayCharge.Text = Globals.FormatMoney(paymentMode.CalcPayCharge(this.balance));
             }
         }
     }
 }
开发者ID:davinx,项目名称:himedi,代码行数:32,代码来源:RechargeConfirm.cs

示例15: Awake

        //Called once everything else is loaded, just before the first execution tick
        public void Awake()
        {
            //DontDestroyOnLoad(this);
            Debug.Log("Awakening ExplorerTrackBehaviour");

            GUIResources.LoadAssets();

            //mainWindowOpen = false;

            //Load config
            //KSP.IO.PluginConfiguration configfile = KSP.IO.PluginConfiguration.CreateForType<ExplorerTrackBehaviour>();
            //configfile.load();

            //trackManager.restoreTracksFromFile();
            setupRepeatingUpdate(recordingInterval);
            lastReferencePos = new Vector3(0,0,0);

            InvokeRepeating("checkGPS", 1, 1); //Cancel with CancelInvoke

            mainWindowButton = ToolbarManager.Instance.add("PersistentTrails", "mainWindowButton");
            mainWindowButton.TexturePath = "PersistentTrails/Icons/Main-NoRecording";// GUIResources.IconNoRecordingPath;
            mainWindowButton.ToolTip = "Persistent Trails";
            mainWindowButton.Visibility = new GameScenesVisibility(GameScenes.FLIGHT);
            mainWindowButton.OnClick += (e) =>
            {
                Debug.Log("button1 clicked, mouseButton: " + e.MouseButton);
                mainWindow.ToggleVisible();
            };
        }
开发者ID:GrJo,项目名称:KSPPersistentTrails,代码行数:30,代码来源:TrackManager.cs


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