void Update_Buttons_List() { List <BOL.Terminal.objTerminal> List = DAL.Terminal.Terminal_Repository.GetTerminalToTransfer(this.Terminal); Buttons.Clear(); foreach (var obj in List) { Views.ucButton Buttonv = new Views.ucButton(); ViewModels.ucButton Buttonvm = new ucButton(obj, this.Queue); Buttonv.DataContext = Buttonvm; Buttonvm.CloseAction = new Action(() => { CloseAction(); }); Buttons.Add(Buttonv); } Views.ucButton ButtonCancelV = new Views.ucButton() { Content = "CANCEL" }; ButtonCancelV.Click += ButtonCancelV_Click; Buttons.Add(ButtonCancelV); }
protected void ResetButtons(HorizontalAlignment buttonAlignment, MessageBoxButtons buttons, params string[] extraButtons) { SuspendLayout(); // Remove all existing buttons. if (m_buttons != null) { foreach (Button button in m_buttons) { if (Controls.Contains(button)) { Controls.Remove(button); } } m_buttons.Clear(); } m_buttonAlignment = buttonAlignment; InitializeButtons(buttons, extraButtons); AutoScaleBaseSize = new Size(5, 13); foreach (Button button in m_buttons) { Controls.Add(button); } Name = "Dialog"; LayoutButtons(); ResumeLayout(false); }
private void UpdateItemsSource(List <ApplicationBarIconButton> buttons, FlowDirection flowDirection) { if (buttons != null) { if (buttons.Count > 0) { if (flowDirection == FlowDirection.RightToLeft) { buttons.Reverse(); } Buttons.Dettach(SysAppBar); Buttons.Clear(); foreach (ApplicationBarIconButton button in buttons) { Buttons.Add(button); } Buttons.Attach(DataContext, SysAppBar); } } else { Buttons.Dettach(SysAppBar); Buttons.Clear(); Buttons.Attach(DataContext, SysAppBar); } }
public override void Clear() { AllSprites.Clear(); Stars.Clear(); Buttons.Clear(); GC.Collect(); }
protected virtual void Clear() { NextButtonID = 1; NextSwitchID = 0; NextTextInputID = 0; Buttons.Clear(); TileButtons.Clear(); Switches.Clear(); Radios.Clear(); TextInputs.Clear(); LimitedTextInputs.Clear(); Entries.Clear(); Entries.TrimExcess(); if (Layout == null) { Layout = new SuperGumpLayout(); } else { Layout.Clear(); } }
public override void CreateButtons(TabButtons buttons, CustomHeaderButtonCollection userButtons) { if (this.keepButtons > 0) { return; } Buttons.Clear(); if (TabViewInfo.AddActiveFilesButton) { this.Buttons.Add(CreateButton(TabButtonType.User)); } if ((buttons & TabButtons.Prev) != 0) { this.Buttons.Add(CreateButton(TabButtonType.Prev)); } if ((buttons & TabButtons.Next) != 0) { this.Buttons.Add(CreateButton(TabButtonType.Next)); } if ((buttons & TabButtons.Close) != 0) { this.Buttons.Add(CreateButton(TabButtonType.Close)); } }
public void OnSizeChanged(Size size) { // 测算需要容纳的 Button 数目,向下取证 var buttonsCount = (int)Math.Floor(size.Height / ButtonSize.Height); if (_oldButtonsCount != buttonsCount) { Buttons.Clear(); // 顶部按钮 foreach (var button in _config.TopButtons) { Buttons.Add(new MenuButtonViewModel(this, button)); } // padding 按钮 var paddingCount = Math.Max(0, buttonsCount - _config.TopButtons.Count - _config.BottomButtons.Count); for (int i = 0; i < paddingCount; i++) { Buttons.Add(new MenuButtonViewModel(this, null)); } // 底部按钮 foreach (var button in _config.BottomButtons) { Buttons.Add(new MenuButtonViewModel(this, button)); } _loaded = _entered = _leaved = 0; _oldButtonsCount = buttonsCount; } }
/// <summary> /// Unload contents /// </summary> public override void UnloadContent() { Trace.WriteDebugLine("[MainMenu] : UnloadContent"); if (Tileset != null) { Tileset.Dispose(); } Tileset = null; ResourceManager.UnlockSharedAsset <BitmapFont>(Font); Font = null; if (Theme != null) { Theme.Dispose(); } Theme = null; if (Batch != null) { Batch.Dispose(); } Batch = null; StringTable.Dispose(); StringTable = null; Buttons.Clear(); // Buttons = null; }
/// <summary> /// 清理视图组件所持有的基础控件列表。 /// </summary> private void CleanControlList() { Images.Clear(); RawImages.Clear(); Buttons.Clear(); InputFields.Clear(); Sliders.Clear(); }
public override void Clear() { BackgroundImg = null; AllSprites.Clear(); Stars.Clear(); Buttons.Clear(); GC.Collect(); }
public new void Clear() { Icon = null; Text = null; Buttons.Clear(); base.Clear(); }
void Load(Profile profile) { if (profile == null) { //dbg.Error("Could not find profile"); //ErrorMessage = "Could not find profile"; //Current = States.Error; //ErrorBtnClick = new DelegateCommand(() => { Load(); }); Current = States.Common; Buttons.Clear(); string proftoken = null; Buttons.Clear(); CreateEmergencyButtons(proftoken); } else { var profileToken = profile.token; Current = States.Loading; Buttons.Clear(); //StopVideoStreaming(); string curProfToken; if (profileToken == null) { curProfToken = null; } else { curProfToken = profileToken; } profToken = curProfToken; subscriptions.Add(facade.GetChannel(curProfToken) .ObserveOnCurrentDispatcher() .Subscribe(channel => { Current = States.Common; Name = videoSource.token + " : " + channel.name; curProfToken = channel.profileToken; this.channel = channel; //starts only servers //StartVideoStreaming(); FillVideoInfo(); CreateButtons(profile); }, err => { dbg.Error(err); ErrorMessage = err.Message; Current = States.Error; ErrorBtnClick = new DelegateCommand(() => { Load(); }); })); GetSnapshot(curProfToken); } }
public Editor() : base() { Globals.currentTileset.RefreshTileset(); TextBoxes.Clear(); Buttons.Clear(); Buttons.Add(new Button(new Vector2(660, 50), AddLayer, AssetManager.addButton, "Add new layer")); TextBoxes.Add(new TextBox(new Vector2(50, 430), true, false, " | SAVE PATH: ", 0)); Buttons.Add(new Button(new Vector2(AssetManager.font.MeasureString("SAVE").X / 2, 430 + AssetManager.font.MeasureString("SAVE").Y / 2), SaveMap, "SAVE", "SAVES MAP TO PATH")); }
public void ExitWorkshop() { if (Mode != MainMenu.RollcallModes.Quest) { orig_ExitWorkshop(); return; } WorkshopLevels = false; TweenOutAllButtons(); Buttons.Clear(); Begin(); }
private void SetHeaderIndex(int index) { if (index < 0 || index >= pages.Count) { return; } PageControl item = pages[index]; Title = item.Title; if (item.BackButton != null) { header.BackButton = item.BackButton; } else { header.SetDefaultBackButton(); } Buttons.RaiseListChangedEvents = false; Buttons.Clear(); foreach (FluidButton b in item.Buttons) { Buttons.Add(b); } Buttons.Notify(); header.ButtonsWidth = item.Buttons.Width; if (header.IsDefaultBackButton) { if (index > minBackIndex) { PageControl parent = pages[index - 1]; BackButton.Visible = true; BackButton.Text = parent.Title; using (Graphics g = CreateGraphics()) { if (g != null) { SizeF size = g.MeasureString(parent.Title, BackButton.Font); int w = (int)size.Width + ScaleX(8); BackButton.Width = Math.Max(w, ScaleX(48)); } } } else { BackButton.Visible = false; } } }
public void Dispose() { if (IsDisposed) { return; } IsDisposed = true; //Console.WriteLine("SuperGump Disposing: {0} (0x{1:X})", GetType(), Serial); //GC.SuppressFinalize(this); VitaNexCore.TryCatch(OnDispose); VitaNexCore.TryCatch(UnregisterInstance); NextButtonID = 1; NextSwitchID = 0; NextTextInputID = 0; if (InstancePoller != null) { VitaNexCore.TryCatch(InstancePoller.Dispose); InstancePoller = null; } VitaNexCore.TryCatch( () => { Buttons.Clear(); TileButtons.Clear(); Switches.Clear(); Radios.Clear(); TextInputs.Clear(); LimitedTextInputs.Clear(); Entries.Clear(); Entries.TrimExcess(); Layout.Clear(); }); VitaNexCore.TryCatch(() => Linked.AsEnumerable().ForEach(Unlink)); VitaNexCore.TryCatch(() => Children.AsEnumerable().ForEach(RemoveChild)); IsOpen = false; Hidden = false; Parent = null; User = null; VitaNexCore.TryCatch(OnDisposed); }
private void MakePlayground() { Labels.Clear(); Buttons.Clear(); GameGrid.Children.Clear(); CreateImage(); StageImage.Source = Game.GetStageImage(); CreateCharacterBtns(); CreateCharacterLbl(); }
public void ApplyChanges() { if (parsed) { ButtonRemapEnabled = RemapEnabledToggle; Buttons.Clear(); foreach (var cell in buttonList.data) { Buttons.Add(ControllerTweaksInputHelper.NameToButton[cell.text]); } } }
void Fill_Buttons() { Buttons.Clear(); List <BOL.Transaction.objTransaction> Transactions = DAL.Transaction.Transaction_Repository.GetActiveTransaction(); foreach (var obj in Transactions) { Views.ucButton butn = new Views.ucButton(); ViewModels.ucButton btmvm = new ucButton(obj); butn.DataContext = btmvm; Buttons.Add(butn); } }
private void GenerateListItems() { DropdownItemPanel.Children.Clear(); foreach (var btn in Buttons) { btn.MainButton.Click -= Btn_Click; btn.CrossButton.Click -= CrossBtn_Click; } Buttons.Clear(); GenerateDefaultIconList(); GenerateCustomIconList(); }
protected new void RecreateHandle() { ToolBoxButton[] btns = GetTToolBarButtons(); Buttons.Clear(); buttons = null; buttonsCount = 0; base.RecreateHandle(); for (int i = 0; i < btns.Length; i++) { Buttons.Add(btns[i]); } }
private void InitializeGameField(string word) { HangmanGame = new Game(word, GameLanguage.En); Labels.Clear(); Buttons.Clear(); GameGrid.Children.Clear(); CreateImage(); StageImage.Source = HangmanGame.GetStageImage(); CreateNewGameBtn(); CreateCharacterBtns(HangmanGame.Alphabet); CreateCharacterLbl(HangmanGame.Lenght); }
///<summary>Initializes the editor's default set of buttons.</summary> public override void CreateDefaultButton() { Buttons.Clear(); base.CreateDefaultButton(); Buttons[0].SuperTip = Utilities.CreateSuperTip(body: "Click to select a person"); Buttons.Add(new EditorButton(ButtonPredefines.Glyph) { SuperTip = Utilities.CreateSuperTip("New Person...", "Adds a new person to the master directory"), Image = Resources.Plus13, Width = 90, ImageLocation = ImageLocation.MiddleLeft, Caption = "New person...", IsDefaultButton = true }); }
public virtual void ClearStuff() { tickCount = 0; chipForced = null; chip = null; dead = false; Buttons.Clear(); Creatures.Clear(); Teleports.Clear(); slipList.Clear(); inventory.Clear(); movingBlocks.Clear(); IsChipOnHintField = false; secondsTimer.Change(Timeout.Infinite, Timeout.Infinite); }
void UpdateView() { TextView.ReadOnly = !AllowEdit; Buttons.Clear(); if (AllowEdit) { Buttons.Add(new DialogButton(T.GetString("Save"), Command.Save)); Buttons.Add(new DialogButton(T.GetString("Cancel"), Command.Cancel)); DefaultCommand = Command.Save; } else { Buttons.Add(new DialogButton(T.GetString("Close"), Command.Close)); DefaultCommand = Command.Close; } }
protected override void OnPropertiesSet() { base.OnPropertiesSet(); foreach (var button in Buttons) { Destroy(button.UIButton.gameObject); } Buttons.Clear(); foreach (var buttonProperties in Properties.GetButtonProperties()) { var button = Instantiate(buttonPrefab.UIButton.gameObject, buttonContainer).GetComponent <TButtonController>(); button.UIButton.transform.SetParent(buttonContainer, false); button.Clicked += (x) => Button_Clicked(button); button.SetProperties(buttonProperties); button.ToggleInteractability(IsInteractable); InitializeButton(button); Buttons.Add(button); } }
private void RemoveMergeRows() { foreach (var button in Buttons) { Controls.Remove(button); } foreach (var label in Labels) { Controls.Remove(label); } foreach (var txtBox in Textboxes) { Controls.Remove(txtBox); } Buttons.Clear(); Labels.Clear(); Textboxes.Clear(); Documents.Clear(); }
public void Reset() { WindowTitle = null; MainInstruction = null; Content = null; CommonButtons = 0; MainIcon = TaskDialogIcon.None; CustomMainIcon = null; FooterIcon = TaskDialogIcon.None; CustomFooterIcon = null; Buttons.Clear(); RadioButtons.Clear(); _flags = 0; DefaultButton = 0; DefaultRadioButton = 0; VerificationText = null; ExpandedInformation = null; ExpandedControlText = null; CollapsedControlText = null; Footer = null; Callback = null; CallbackData = null; Width = 0; }
public override void OnSwiped(RecyclerView.ViewHolder viewHolder, int direction) { int pos = viewHolder.AdapterPosition; if (_swipedPos != pos) { _recoverQueue.Enqueue(_swipedPos); } _swipedPos = pos; if (_buttonsBuffer.ContainsKey(_swipedPos)) { Buttons = _buttonsBuffer[_swipedPos]; } else { Buttons.Clear(); } _buttonsBuffer.Clear(); _swipeThreshold = 0.5f * Buttons.Count * ButtonWidth; RecoverSwipedItem(); }
public void SetButtons(IEnumerable <string> buttons) { Buttons.Clear(); Buttons.AddRange(buttons.Select((b, i) => new Indexed <string>(i, b))); HasButtons = Buttons.Any(); }