public ExHentaiAccountSettingsControl() { this.SuspendLayout(); var fm = this.FontManager; this.Text = SR.Get("Settings.ExHentaiAccount.Title"); var memberIdControl = this.MemberIdControl = new LabeledTextBox(); memberIdControl.Label.Text = "MemberId"; memberIdControl.Label.TextAlign = ContentAlignment.MiddleRight; memberIdControl.TextBox.KeyDown += this.OnControlKeyDown; memberIdControl.TextBox.Font = fm[10, FontStyle.Regular]; this.Controls.Add(memberIdControl); var passHashControl = this.PassHashControl = new LabeledTextBox(); passHashControl.Label.Text = "PassHash"; passHashControl.Label.TextAlign = ContentAlignment.MiddleRight; passHashControl.TextBox.KeyDown += this.OnControlKeyDown; passHashControl.TextBox.Font = fm[10, FontStyle.Regular]; this.Controls.Add(passHashControl); var verifyButton = this.VerifyButton = new Button(); verifyButton.FlatStyle = FlatStyle.Flat; verifyButton.Text = SR.Get("Settings.ExHentaiAccount.Verify"); verifyButton.Font = fm[12, FontStyle.Regular]; verifyButton.Click += this.OnVerifyButtonClick; this.Controls.Add(verifyButton); var messageLabel = this.MessageLabel = new Label(); messageLabel.TextAlign = ContentAlignment.MiddleRight; messageLabel.Font = fm[12, FontStyle.Regular]; this.Controls.Add(messageLabel); var accountInformationGroupBox = this.AccountInfoGroupBox = new AccountInfoGroupBox(); this.Controls.Add(accountInformationGroupBox); this.KeyDown += this.OnControlKeyDown; this.AccountInfoGroupBox.Bind(null); this.ResumeLayout(false); }
public void Test_10_LinkPropertyToAction_Text() { IActionPropertySet actionProps = GetTestPropertySet(); ActionPropertyController controller = new ActionPropertyController(); LabeledTextBox ledCustProps = new LabeledTextBox(); ledCustProps.Text = "CustProp"; IActionProperty propCustom = actionProps["CustomProperties"]; Assert.AreEqual("", Convert.ToString(propCustom.Value), "This Mock should be \"\" on creation"); controller.Associate(ledCustProps, propCustom); Assert.AreEqual("", ledCustProps.Text, "Should initialize immediately on connection"); Assert.AreEqual("", Convert.ToString(propCustom.Value), "Should initialize immediately on connection"); ledCustProps.Text = "Another"; Assert.AreEqual("Another", Convert.ToString(propCustom.Value), "The property seems not to be reference by the UI!"); ledCustProps.Text = ""; Assert.AreEqual("", Convert.ToString(propCustom.Value), "The property seems not to be reference by the UI!"); }
public override void Loaded(object sender, SectionLoadedEventArgs e) { var service = GetService <TeamExplorerViewModel>(); if (service == null) { ShowNotification("Commit Formatter: Can't get TeamExplorerViewModel", NotificationType.Error); return; } var changesGuid = Guid.Parse(TeamExplorerPageIds.GitChanges); var pages = new List <ITeamExplorerPage>(); if (service.CurrentPage != null) { pages.Add(service.CurrentPage); } pages.AddRange(service.UndockedPages); var changesPage = pages.FirstOrDefault(p => p.GetId() == changesGuid); if (changesPage == null) { ShowNotification("Commit Formatter: Can't get the Changes page", NotificationType.Error); return; } var view = changesPage.PageContent as UserControl; if (view == null) { ShowNotification("Commit Formatter: Can't get the Changes view", NotificationType.Error); return; } _labeledTextBox = view.FindName("commentTextBox") as LabeledTextBox; if (_labeledTextBox == null) { ShowNotification("Commit Formatter: Can't find commentTextBox", NotificationType.Error); return; } _commitMessageBox = _labeledTextBox.FindName("textBox") as TextBox; if (_commitMessageBox == null) { ShowNotification("Commit Formatter: Can't find textBox", NotificationType.Error); return; } _commitMessageBox.TextChanged += OnCommitMessageChanged; _commitMessageBox.SelectionChanged += OnSelectionChanged; _commitMessageBox.SpellCheck.IsEnabled = _enableSpellCheck; if (_useMonospacedFont) { _commitMessageBox.FontFamily = new FontFamily("Consolas"); } _commitMessageBox.FontSize = _fontSize; _commitMessageBox.TextWrapping = TextWrapping.NoWrap; }
public NewDownloadForm() { this.SuspendLayout(); this.Text = SR.Get("NewDownload.Title"); this.StartPosition = FormStartPosition.CenterParent; var fm = this.FontManager; var inputControl = this.InputControl = new LabeledTextBox(); inputControl.Label.Text = SR.Get("NewDownload.Input"); inputControl.TextBox.Font = fm[11, FontStyle.Regular]; inputControl.TextBox.KeyDown += this.OnInputControlKeyDown; this.Controls.Add(inputControl); var verifyButton = this.VerifyButton = new Button(); verifyButton.Text = SR.Get("NewDownload.Verify"); verifyButton.FlatStyle = FlatStyle.Flat; verifyButton.Click += this.OnVerifyButtonClick; this.Controls.Add(verifyButton); var verifyMessageLabel = this.VerifyMessageLabel = new Label(); verifyMessageLabel.TextAlign = ContentAlignment.MiddleRight; this.Controls.Add(verifyMessageLabel); var downloadSelectGroupBox = this.DownloadSelectGroupBox = new DownloadSelectGroupBox(); downloadSelectGroupBox.GalleryListChanged += this.OnDownloadSelectGroupBoxGalleryListChanged; downloadSelectGroupBox.SelectedGalleryChanged += this.OnDownloadSelectGroupBoxSelectedGalleryChanged; this.Controls.Add(downloadSelectGroupBox); var thumbnailControl = this.ThumbnailControl = new PictureBox(); thumbnailControl.SizeMode = PictureBoxSizeMode.StretchImage; this.Controls.Add(thumbnailControl); var titleLabel = this.TitleLabel = new SelectAllableTextBox(); titleLabel.ReadOnly = true; titleLabel.Multiline = true; titleLabel.BackColor = this.BackColor; titleLabel.BorderStyle = BorderStyle.None; this.Controls.Add(titleLabel); var addMessageLabel = this.AddMessageLabel = new Label(); addMessageLabel.TextAlign = ContentAlignment.MiddleRight; addMessageLabel.Font = fm[12, FontStyle.Regular]; this.Controls.Add(addMessageLabel); var addButton = this.AddButton = new Button(); addButton.Text = SR.Get("NewDownload.Add"); addButton.FlatStyle = FlatStyle.Flat; addButton.Font = fm[12, FontStyle.Regular]; addButton.Click += this.OnAddButtonClick; this.Controls.Add(addButton); var cancelButton = this.CancelButton = new Button(); cancelButton.Text = SR.Get("NewDownload.Cancel"); cancelButton.FlatStyle = FlatStyle.Flat; cancelButton.Font = fm[12, FontStyle.Regular]; cancelButton.Click += this.OnCancelButtonClick; this.Controls.Add(cancelButton); var continueCheckBox = this.ContinueCheckBox = new CheckBox(); continueCheckBox.Text = SR.Get("NewDownload.Continue"); continueCheckBox.Font = fm[12, FontStyle.Regular]; this.Controls.Add(continueCheckBox); this.ResumeLayout(false); this.ClientSize = new Size(500, 520); this.UpdateControlsBoundsPreferred(); }
public ContentsSettingControl() { this.SuspendLayout(); var fm = this.FontManager; this.Text = SR.Get("Settings.Download.Title"); var completeAutoRemoveCheckBox = this.CompleteAutoRemoveCheckBox = new CheckBox(); completeAutoRemoveCheckBox.Text = SR.Get("Settings.Download.CompleteAutoRemove"); this.Controls.Add(completeAutoRemoveCheckBox); var downloadToArchiveCheckBox = this.DownloadToArchiveCheckBox = new CheckBox(); downloadToArchiveCheckBox.Text = SR.Get("Settings.Download.DownloadToArchive"); this.Controls.Add(downloadToArchiveCheckBox); var singleFrameConvertTypeComboBox = this.SingleFrameConvertTypeComboBox = new LabeledComboBox(); singleFrameConvertTypeComboBox.Label.Text = SR.Get("Settings.Download.SingleFrameConvertType"); singleFrameConvertTypeComboBox.ComboBox.DropDownStyle = ComboBoxStyle.DropDownList; singleFrameConvertTypeComboBox.ComboBox.Items.Add(new ImageConvertTypeItem(ImageConvertType.Original)); //singleFrameConvertTypeComboBox.ComboBox.Items.Add(new ImageConvertTypeItem(ImageConvertType.Avif)); singleFrameConvertTypeComboBox.ComboBox.Items.Add(new ImageConvertTypeItem(ImageConvertType.WebP)); singleFrameConvertTypeComboBox.ComboBox.Items.Add(new ImageConvertTypeItem(ImageConvertType.Png)); singleFrameConvertTypeComboBox.ComboBox.Items.Add(new ImageConvertTypeItem(ImageConvertType.Jpg)); this.Controls.Add(singleFrameConvertTypeComboBox); var multiFrameConvertTypeComboBox = this.MultiFrameConvertTypeComboBox = new LabeledComboBox(); multiFrameConvertTypeComboBox.Label.Text = SR.Get("Settings.Download.MultiFrameConvertType"); multiFrameConvertTypeComboBox.ComboBox.DropDownStyle = ComboBoxStyle.DropDownList; multiFrameConvertTypeComboBox.ComboBox.Items.Add(new ImageConvertTypeItem(ImageConvertType.Original)); //multiFrameConvertTypeComboBox.ComboBox.Items.Add(new ImageConvertTypeItem(ImageConvertType.Avif)); multiFrameConvertTypeComboBox.ComboBox.Items.Add(new ImageConvertTypeItem(ImageConvertType.WebP)); multiFrameConvertTypeComboBox.ComboBox.Items.Add(new ImageConvertTypeItem(ImageConvertType.Gif)); this.Controls.Add(multiFrameConvertTypeComboBox); var directoryTextBox = this.DirectoryTextBox = new LabeledTextBox(); directoryTextBox.Label.Text = SR.Get("Settings.Download.DirectoryTextBox"); directoryTextBox.TextBox.TextChanged += this.OnDirectoryTextBoxTextChanged; directoryTextBox.TextBox.Font = fm[10, FontStyle.Regular]; this.Controls.Add(directoryTextBox); var directoryButton = this.DirectoryButton = new Button(); directoryButton.FlatStyle = FlatStyle.Flat; directoryButton.Text = "..."; directoryButton.Font = fm[10, FontStyle.Regular]; directoryButton.Click += this.OnDirectoryButtonClick; this.Controls.Add(directoryButton); var directoryCommentLabel = this.DirectoryCommentLabel = new Label(); directoryCommentLabel.Text = SR.Get("Settings.Download.DirectoryWarning"); directoryCommentLabel.TextAlign = ContentAlignment.MiddleLeft; this.Controls.Add(directoryCommentLabel); var labels = new List <Label>() { singleFrameConvertTypeComboBox.Label, multiFrameConvertTypeComboBox.Label }; var labelsMaxWidth = labels.Max(l => l.PreferredWidth); foreach (var label in labels) { label.Width = labelsMaxWidth; } this.ResumeLayout(false); }
/// <summary> /// Raises the <see cref="E:System.Web.UI.Control.Init" /> event. /// </summary> /// <param name="e">An <see cref="T:System.EventArgs" /> object that contains the event data.</param> protected override void OnInit(EventArgs e) { DialogMasterPage masterPage = this.Page.Master as DialogMasterPage; if (masterPage != null) { masterPage.OnSave += new EventHandler <EventArgs>(masterPage_OnSave); } try { int pageId = Convert.ToInt32(PageParameter("Page")); _page = Rock.Web.Cache.PageCache.Read(pageId); if (_page.IsAuthorized("Administrate", CurrentPerson)) { phAttributes.Controls.Clear(); Rock.Attribute.Helper.AddEditControls(_page, phAttributes, !Page.IsPostBack); List <string> blockContexts = new List <string>(); foreach (var block in _page.Blocks) { var blockControl = TemplateControl.LoadControl(block.BlockType.Path) as RockBlock; if (blockControl != null) { blockControl.CurrentPage = _page; blockControl.CurrentBlock = block; foreach (var context in blockControl.ContextTypesRequired) { if (!blockContexts.Contains(context)) { blockContexts.Add(context); } } } } phContextPanel.Visible = blockContexts.Count > 0; int i = 0; foreach (string context in blockContexts) { var tbContext = new LabeledTextBox(); tbContext.ID = string.Format("context_{0}", i++); tbContext.Required = true; tbContext.LabelText = context; if (_page.PageContexts.ContainsKey(context)) { tbContext.Text = _page.PageContexts[context]; } phContext.Controls.Add(tbContext); } } else { DisplayError("You are not authorized to edit this page"); } } catch (SystemException ex) { DisplayError(ex.Message); } base.OnInit(e); }
void mniltbStrategyRenameTo_UserTyped(object sender, LabeledTextBox.LabeledTextBoxUserTypedArgs e) { string msig = "StrategiesTree.mniltbStrategyRenameTo_UserTyped(): "; if (this.FolderSelected == null) { string msg = "this.FolderSelected==null; please set mniFolderCreate.Enabled=false when right-clicked not on the folder"; statusReporter.PopupException(new Exception(msig + msg)); return; } if (this.StrategySelected == null) { string msg = "this.StrategySelected==null"; statusReporter.PopupException(new Exception(msig + msg)); return; } string strategyNameUserTyped = e.StringUserTyped; try { string strategyNameSucceeded = strategyRepository.StrategyRenameModifyNameTillNoException(this.StrategySelected, strategyNameUserTyped); strategyRepository.StrategyRename(this.StrategySelected, strategyNameSucceeded); } catch (Exception ex) { statusReporter.PopupException(ex); return; } finally { this.tree.SetObjects(this.strategyRepository.AllFoldersAvailable); this.tree.RebuildAll(true); } //this.tree.SelectObject(strategyNew, true); // does it work?? //var olvStrategy = this.treeListView.FindItemWithText(strategyNew.Name, true, 0); // finds first occurency, not what I've inserted! //var olvStrategy = this.tree.ModelToItem(strategyNew); //this.tree.EditSubItem(olvStrategy as OLVListItem, 0); e.RootHandlerShouldCloseParentContextMenuStrip = true; this.RaiseOnStrategyRenamed(); }