internal void Synchronize(SharedPropertiesController anotherController) { Debug.Assert(!ReferenceEquals(controller, anotherController)); anotherController.Other = controller; controller.Other = anotherController; }
internal PostPropertiesForm(CommandManager commandManager, CategoryContext categoryContext) { this.commandManager = commandManager; InitializeComponent(); this.Name = "PostPropertiesForm"; Text = Res.Get(StringId.PostProperties); AccessibleName = Text; buttonClose.Text = Res.Get(StringId.CloseButtonNoMnemonic); this.labelPageOrder.Text = Res.Get(StringId.PropertiesPageOrder); this.labelPageParent.Text = Res.Get(StringId.PropertiesPageParent); this.labelCategories.Text = Res.Get(StringId.PropertiesCategories); this.labelPublishDate.Text = Res.Get(StringId.PropertiesPublishDate); this.labelSlug.Text = Res.Get(StringId.PropertiesSlug); this.labelComments.Text = Res.Get(StringId.PropertiesComments); this.labelPings.Text = Res.Get(StringId.PropertiesPings); this.labelTags.Text = Res.Get(StringId.PropertiesKeywords); this.labelAuthor.Text = Res.Get(StringId.PropertiesAuthor); this.labelPassword.Text = Res.Get(StringId.PropertiesPassword); this.labelTrackbacks.Text = Res.Get(StringId.PropertiesTrackbacks); this.labelExcerpt.Text = Res.Get(StringId.PropertiesExcerpt); this.textPassword.PasswordChar = Res.PasswordChar; ControlHelper.SetCueBanner(textTrackbacks, Res.Get(StringId.PropertiesCommaSeparated)); SuppressAutoRtlFixup = true; comboComments.Items.AddRange(new[] { new CommentComboItem(BlogCommentPolicy.Unspecified), new CommentComboItem(BlogCommentPolicy.None), new CommentComboItem(BlogCommentPolicy.Open), new CommentComboItem(BlogCommentPolicy.Closed), }); comboPings.Items.AddRange(new[] { new TrackbackComboItem(BlogTrackbackPolicy.Unspecified), new TrackbackComboItem(BlogTrackbackPolicy.Allow), new TrackbackComboItem(BlogTrackbackPolicy.Deny), }); InitializePropertyFields(); controller = new SharedPropertiesController( this, labelCategories, categoryDropDown, labelTags, textTags, labelPageOrder, textPageOrder, labelPageParent, comboPageParent, labelPublishDate, datePublishDate, fields, categoryContext); this.comboComments.SelectedIndexChanged += controller.MakeDirty; this.comboPings.SelectedIndexChanged += controller.MakeDirty; this.textSlug.TextChanged += controller.MakeDirty; this.textPassword.TextChanged += controller.MakeDirty; this.textExcerpt.TextChanged += controller.MakeDirty; this.textTrackbacks.TextChanged += controller.MakeDirty; SimpleTextEditorCommandHelper.UseNativeBehaviors(commandManager, textExcerpt, textPageOrder, textPassword, textSlug, textTags, textTrackbacks); }
public PostPropertiesBandControl(CommandManager commandManager) { SetStyle(ControlStyles.UserPaint, true); SetStyle(ControlStyles.DoubleBuffer, true); SetStyle(ControlStyles.AllPaintingInWmPaint, true); SetStyle(ControlStyles.ResizeRedraw, true); InitializeComponent(); categoryContext = new CategoryContext(); controller = new SharedPropertiesController(this, null, categoryDropDown, null, textTags, labelPageOrder, textPageOrder, labelPageParent, comboPageParent, null, datePublishDate, fields, categoryContext); SimpleTextEditorCommandHelper.UseNativeBehaviors(commandManager, textTags, textPageOrder); postPropertiesForm = new PostPropertiesForm(commandManager, categoryContext); if (components == null) { components = new Container(); } components.Add(postPropertiesForm); postPropertiesForm.Synchronize(controller); commandManager.Add(CommandId.PostProperties, PostProperties_Execute); commandManager.Add(CommandId.ShowCategoryPopup, ShowCategoryPopup_Execute); linkViewAll.KeyDown += (sender, args) => { if (args.KeyValue == ' ') { linkViewAll_LinkClicked(sender, new LinkLabelLinkClickedEventArgs(null)); } }; // WinLive 180287: We don't want to show or use mnemonics on labels in the post properties band because // they can steal focus from the canvas. linkViewAll.Text = TextHelper.StripAmpersands(Res.Get(StringId.ViewAll)); linkViewAll.UseMnemonic = false; labelPageParent.Text = TextHelper.StripAmpersands(Res.Get(StringId.PropertiesPageParent)); labelPageParent.UseMnemonic = false; labelPageOrder.Text = TextHelper.StripAmpersands(Res.Get(StringId.PropertiesPageOrder)); labelPageOrder.UseMnemonic = false; }
public PostPropertiesBandControl(CommandManager commandManager) { SetStyle(ControlStyles.UserPaint, true); SetStyle(ControlStyles.DoubleBuffer, true); SetStyle(ControlStyles.AllPaintingInWmPaint, true); SetStyle(ControlStyles.ResizeRedraw, true); InitializeComponent(); categoryContext = new CategoryContext(); controller = new SharedPropertiesController(this, null, categoryDropDown, null, textTags, labelPageOrder, textPageOrder, labelPageParent, comboPageParent, null, datePublishDate, fields, categoryContext); SimpleTextEditorCommandHelper.UseNativeBehaviors(commandManager, textTags, textPageOrder); postPropertiesForm = new PostPropertiesForm(commandManager, categoryContext); if (components == null) components = new Container(); components.Add(postPropertiesForm); postPropertiesForm.Synchronize(controller); commandManager.Add(CommandId.PostProperties, PostProperties_Execute); commandManager.Add(CommandId.ShowCategoryPopup, ShowCategoryPopup_Execute); linkViewAll.KeyDown += (sender, args) => { if (args.KeyValue == ' ') linkViewAll_LinkClicked(sender, new LinkLabelLinkClickedEventArgs(null)); }; // WinLive 180287: We don't want to show or use mnemonics on labels in the post properties band because // they can steal focus from the canvas. linkViewAll.Text = TextHelper.StripAmpersands(Res.Get(StringId.ViewAll)); linkViewAll.UseMnemonic = false; labelPageParent.Text = TextHelper.StripAmpersands(Res.Get(StringId.PropertiesPageParent)); labelPageParent.UseMnemonic = false; labelPageOrder.Text = TextHelper.StripAmpersands(Res.Get(StringId.PropertiesPageOrder)); labelPageOrder.UseMnemonic = false; }