diff --git a/src/managed/Canvas/CanvasForm.cs b/src/managed/Canvas/CanvasForm.cs index 3ff8e9cb..acd5d3d8 100644 --- a/src/managed/Canvas/CanvasForm.cs +++ b/src/managed/Canvas/CanvasForm.cs @@ -247,7 +247,6 @@ namespace OpenLiveWriter.Test editor.ChangeView(EditingMode.PlainText); } - [DllImport("KERNEL32.DLL", CharSet=CharSet.Auto, EntryPoint="LoadLibrary")] public static extern IntPtr LoadLibrary(String lpFileName); } diff --git a/src/managed/LocUtil/AppMain.cs b/src/managed/LocUtil/AppMain.cs index 4a94ddfc..ecd4066a 100644 --- a/src/managed/LocUtil/AppMain.cs +++ b/src/managed/LocUtil/AppMain.cs @@ -301,11 +301,11 @@ namespace LocUtil { const string TEMPLATE = @"namespace OpenLiveWriter.Localization {{ - public enum {0} - {{ - None, - {1} - }} + public enum {0} + {{ + None, + {1} + }} }} "; @@ -367,9 +367,9 @@ namespace LocUtil else if (values == null) { const string DESC_TEMPLATE = @"/// - /// {0} - /// - {1}"; + /// {0} + /// + {1}"; ArrayList descs = new ArrayList(); foreach (string command in commandList.ToArray()) { diff --git a/src/managed/OpenLiveWriter.Api/ILiveClipboardOptionsEditor.cs b/src/managed/OpenLiveWriter.Api/ILiveClipboardOptionsEditor.cs index 147bd05c..e0411604 100644 --- a/src/managed/OpenLiveWriter.Api/ILiveClipboardOptionsEditor.cs +++ b/src/managed/OpenLiveWriter.Api/ILiveClipboardOptionsEditor.cs @@ -6,8 +6,8 @@ using System.Windows.Forms; namespace OpenLiveWriter.Api { - public interface ILiveClipboardOptionsEditor - { - void EditLiveClipboardOptions(IWin32Window dialogOwner) ; - } + public interface ILiveClipboardOptionsEditor + { + void EditLiveClipboardOptions(IWin32Window dialogOwner) ; + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationControl.cs b/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationControl.cs index 8ca77f01..8d6da497 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationControl.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationControl.cs @@ -10,129 +10,129 @@ using System.Windows.Forms; namespace Project31.ApplicationFramework { - /// - /// Application control. - /// - public class ApplicationControl : System.Windows.Forms.UserControl, ICommandManager, ISelectionManager - { - /// - /// The set of active commands, keyed by command identifier. - /// - private Hashtable commandTable = new Hashtable(); + /// + /// Application control. + /// + public class ApplicationControl : System.Windows.Forms.UserControl, ICommandManager, ISelectionManager + { + /// + /// The set of active commands, keyed by command identifier. + /// + private Hashtable commandTable = new Hashtable(); - /// - /// The set of selected objects. - /// - private ArrayList selectionList = new ArrayList(); + /// + /// The set of selected objects. + /// + private ArrayList selectionList = new ArrayList(); - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; + /// + /// Required designer variable. + /// + private System.ComponentModel.Container components = null; - /// - /// Occurs when the selection changes. - /// - public event EventHandler SelectionChanged; + /// + /// Occurs when the selection changes. + /// + public event EventHandler SelectionChanged; - /// - /// Initializes a new instance of the ApplicationControl class. - /// - public ApplicationControl() - { - // This call is required by the Windows.Forms Form Designer. - InitializeComponent(); - } + /// + /// Initializes a new instance of the ApplicationControl class. + /// + public ApplicationControl() + { + // This call is required by the Windows.Forms Form Designer. + InitializeComponent(); + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - components = new System.ComponentModel.Container(); - } - #endregion + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + } + #endregion - /// ICommandManager - /// - /// Activates the specified command list. - /// - /// The CommandList to activate. - public void ActivateCommandList(CommandList commandList) - { - // Add all the commands from this command provider to the command table. - foreach (Command command in commandList.Commands) - commandTable.Add(command.Identifier, command); - } + /// ICommandManager + /// + /// Activates the specified command list. + /// + /// The CommandList to activate. + public void ActivateCommandList(CommandList commandList) + { + // Add all the commands from this command provider to the command table. + foreach (Command command in commandList.Commands) + commandTable.Add(command.Identifier, command); + } - /// ICommandManager - /// - /// Deactivates the specified command list. - /// - /// The CommandList to deactivate. - public void DeactivateCommandList(CommandList commandList) - { - // Remove all the commands from this command provider from the command table. - foreach (Command command in commandList.Commands) - commandTable.Remove(command.Identifier); - } + /// ICommandManager + /// + /// Deactivates the specified command list. + /// + /// The CommandList to deactivate. + public void DeactivateCommandList(CommandList commandList) + { + // Remove all the commands from this command provider from the command table. + foreach (Command command in commandList.Commands) + commandTable.Remove(command.Identifier); + } - /// ISelectionManager - /// - /// Clears the current selection. - /// - public void ClearSelection() - { - // Clear the selection list. - selectionList.Clear(); + /// ISelectionManager + /// + /// Clears the current selection. + /// + public void ClearSelection() + { + // Clear the selection list. + selectionList.Clear(); - // Raise the SelectionChanged event. - OnSelectionChanged(EventArgs.Empty); - } + // Raise the SelectionChanged event. + OnSelectionChanged(EventArgs.Empty); + } - /// - /// Raises the SelectionChanged event. - /// - /// And EventArgs that contains the event data. - protected virtual void OnSelectionChanged(EventArgs e) - { - if (SelectionChanged != null) - SelectionChanged(this, e); - } + /// + /// Raises the SelectionChanged event. + /// + /// And EventArgs that contains the event data. + protected virtual void OnSelectionChanged(EventArgs e) + { + if (SelectionChanged != null) + SelectionChanged(this, e); + } - /// ISelectionManager - /// - /// Sets the selection. - /// - /// The ISelectableObject value to select. - public void SetSelection(ISelectableObject selectableObject) - { - } + /// ISelectionManager + /// + /// Sets the selection. + /// + /// The ISelectableObject value to select. + public void SetSelection(ISelectableObject selectableObject) + { + } - /// ISelectionManager - /// - /// Sets the selection. - /// - /// The array of ISelectableObject values to select. - public void SetSelection(ISelectableObject[] selectableObjects) - { - } - } + /// ISelectionManager + /// + /// Sets the selection. + /// + /// The array of ISelectableObject values to select. + public void SetSelection(ISelectableObject[] selectableObjects) + { + } + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationGlobalContext.cs b/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationGlobalContext.cs index 9f7a2ed8..9ae4135b 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationGlobalContext.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationGlobalContext.cs @@ -5,16 +5,16 @@ using System; namespace Project31.ApplicationFramework { - /// - /// ApplicationGlobalContext for for the ApplicationFramework. - /// - public class ApplicationGlobalContext - { - /// - /// Initializes a new instance of the ApplicationGlobalContext class. - /// - private ApplicationGlobalContext() - { - } - } + /// + /// ApplicationGlobalContext for for the ApplicationFramework. + /// + public class ApplicationGlobalContext + { + /// + /// Initializes a new instance of the ApplicationGlobalContext class. + /// + private ApplicationGlobalContext() + { + } + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationStyles/ApplicationStyleBlue.cs b/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationStyles/ApplicationStyleBlue.cs index 9018a0b2..40ae5819 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationStyles/ApplicationStyleBlue.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationStyles/ApplicationStyleBlue.cs @@ -10,85 +10,85 @@ using System.Windows.Forms; namespace Project31.ApplicationFramework.ApplicationStyles { - public class ApplicationStyleBlue : ApplicationStyle - { - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; + public class ApplicationStyleBlue : ApplicationStyle + { + /// + /// Required designer variable. + /// + private System.ComponentModel.Container components = null; - public ApplicationStyleBlue() - { - // This call is required by the Windows.Forms Form Designer. - InitializeComponent(); - } + public ApplicationStyleBlue() + { + // This call is required by the Windows.Forms Form Designer. + InitializeComponent(); + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // ApplicationStyleBlue - // - this.ActiveSelectionColor = System.Drawing.Color.FromArgb(((System.Byte)(117)), ((System.Byte)(135)), ((System.Byte)(179))); - this.ActiveTabBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(183)), ((System.Byte)(203)), ((System.Byte)(245))); - this.ActiveTabHighlightColor = System.Drawing.Color.FromArgb(((System.Byte)(243)), ((System.Byte)(243)), ((System.Byte)(243))); - this.ActiveTabLowlightColor = System.Drawing.Color.FromArgb(((System.Byte)(181)), ((System.Byte)(193)), ((System.Byte)(196))); - this.ActiveTabTextColor = System.Drawing.Color.Black; - this.ActiveTabTopColor = System.Drawing.Color.FromArgb(((System.Byte)(207)), ((System.Byte)(227)), ((System.Byte)(253))); - this.AlertControlColor = System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(255)), ((System.Byte)(194))); - this.BoldApplicationFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold); - this.BorderColor = System.Drawing.Color.FromArgb(((System.Byte)(117)), ((System.Byte)(135)), ((System.Byte)(179))); - this.InactiveSelectionColor = System.Drawing.SystemColors.Control; - this.InactiveTabBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(228)), ((System.Byte)(228)), ((System.Byte)(228))); - this.InactiveTabHighlightColor = System.Drawing.Color.FromArgb(((System.Byte)(243)), ((System.Byte)(243)), ((System.Byte)(243))); - this.InactiveTabLowlightColor = System.Drawing.Color.FromArgb(((System.Byte)(189)), ((System.Byte)(189)), ((System.Byte)(189))); - this.InactiveTabTextColor = System.Drawing.Color.Black; - this.InactiveTabTopColor = System.Drawing.Color.FromArgb(((System.Byte)(232)), ((System.Byte)(232)), ((System.Byte)(232))); - this.ItalicApplicationFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Italic); - this.LinkApplicationFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Underline); - this.MenuBitmapAreaColor = System.Drawing.Color.FromArgb(((System.Byte)(195)), ((System.Byte)(215)), ((System.Byte)(249))); - this.MenuSelectionColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(117)), ((System.Byte)(135)), ((System.Byte)(179))); - this.NormalApplicationFont = new System.Drawing.Font("Tahoma", 8.25F); - this.PrimaryWorkspaceBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(161)), ((System.Byte)(180)), ((System.Byte)(215))); - this.PrimaryWorkspaceCommandBarBottomBevelFirstLineColor = System.Drawing.Color.FromArgb(((System.Byte)(117)), ((System.Byte)(135)), ((System.Byte)(179))); - this.PrimaryWorkspaceCommandBarBottomBevelSecondLineColor = System.Drawing.Color.FromArgb(((System.Byte)(166)), ((System.Byte)(187)), ((System.Byte)(223))); - this.PrimaryWorkspaceCommandBarBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(148)), ((System.Byte)(173)), ((System.Byte)(222))); - this.PrimaryWorkspaceCommandBarBottomLayoutMargin = 3; - this.PrimaryWorkspaceCommandBarDisabledTextColor = System.Drawing.Color.Gray; - this.PrimaryWorkspaceCommandBarLeftLayoutMargin = 2; - this.PrimaryWorkspaceCommandBarRightLayoutMargin = 2; - this.PrimaryWorkspaceCommandBarSeparatorLayoutMargin = 2; - this.PrimaryWorkspaceCommandBarTextColor = System.Drawing.Color.Black; - this.PrimaryWorkspaceCommandBarTopBevelFirstLineColor = System.Drawing.Color.Transparent; - this.PrimaryWorkspaceCommandBarTopBevelSecondLineColor = System.Drawing.Color.Transparent; - this.PrimaryWorkspaceCommandBarTopColor = System.Drawing.Color.FromArgb(((System.Byte)(193)), ((System.Byte)(213)), ((System.Byte)(249))); - this.PrimaryWorkspaceCommandBarTopLayoutMargin = 2; - this.PrimaryWorkspaceTopColor = System.Drawing.Color.FromArgb(((System.Byte)(154)), ((System.Byte)(174)), ((System.Byte)(213))); - this.SecondaryWorkspaceBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(183)), ((System.Byte)(203)), ((System.Byte)(245))); - this.SecondaryWorkspaceTopColor = System.Drawing.Color.FromArgb(((System.Byte)(183)), ((System.Byte)(203)), ((System.Byte)(245))); - this.SmallApplicationFont = new System.Drawing.Font("Tahoma", 6.75F); - this.WorkspacePaneControlColor = System.Drawing.Color.FromArgb(((System.Byte)(214)), ((System.Byte)(223)), ((System.Byte)(247))); + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // ApplicationStyleBlue + // + this.ActiveSelectionColor = System.Drawing.Color.FromArgb(((System.Byte)(117)), ((System.Byte)(135)), ((System.Byte)(179))); + this.ActiveTabBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(183)), ((System.Byte)(203)), ((System.Byte)(245))); + this.ActiveTabHighlightColor = System.Drawing.Color.FromArgb(((System.Byte)(243)), ((System.Byte)(243)), ((System.Byte)(243))); + this.ActiveTabLowlightColor = System.Drawing.Color.FromArgb(((System.Byte)(181)), ((System.Byte)(193)), ((System.Byte)(196))); + this.ActiveTabTextColor = System.Drawing.Color.Black; + this.ActiveTabTopColor = System.Drawing.Color.FromArgb(((System.Byte)(207)), ((System.Byte)(227)), ((System.Byte)(253))); + this.AlertControlColor = System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(255)), ((System.Byte)(194))); + this.BoldApplicationFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold); + this.BorderColor = System.Drawing.Color.FromArgb(((System.Byte)(117)), ((System.Byte)(135)), ((System.Byte)(179))); + this.InactiveSelectionColor = System.Drawing.SystemColors.Control; + this.InactiveTabBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(228)), ((System.Byte)(228)), ((System.Byte)(228))); + this.InactiveTabHighlightColor = System.Drawing.Color.FromArgb(((System.Byte)(243)), ((System.Byte)(243)), ((System.Byte)(243))); + this.InactiveTabLowlightColor = System.Drawing.Color.FromArgb(((System.Byte)(189)), ((System.Byte)(189)), ((System.Byte)(189))); + this.InactiveTabTextColor = System.Drawing.Color.Black; + this.InactiveTabTopColor = System.Drawing.Color.FromArgb(((System.Byte)(232)), ((System.Byte)(232)), ((System.Byte)(232))); + this.ItalicApplicationFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Italic); + this.LinkApplicationFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Underline); + this.MenuBitmapAreaColor = System.Drawing.Color.FromArgb(((System.Byte)(195)), ((System.Byte)(215)), ((System.Byte)(249))); + this.MenuSelectionColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(117)), ((System.Byte)(135)), ((System.Byte)(179))); + this.NormalApplicationFont = new System.Drawing.Font("Tahoma", 8.25F); + this.PrimaryWorkspaceBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(161)), ((System.Byte)(180)), ((System.Byte)(215))); + this.PrimaryWorkspaceCommandBarBottomBevelFirstLineColor = System.Drawing.Color.FromArgb(((System.Byte)(117)), ((System.Byte)(135)), ((System.Byte)(179))); + this.PrimaryWorkspaceCommandBarBottomBevelSecondLineColor = System.Drawing.Color.FromArgb(((System.Byte)(166)), ((System.Byte)(187)), ((System.Byte)(223))); + this.PrimaryWorkspaceCommandBarBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(148)), ((System.Byte)(173)), ((System.Byte)(222))); + this.PrimaryWorkspaceCommandBarBottomLayoutMargin = 3; + this.PrimaryWorkspaceCommandBarDisabledTextColor = System.Drawing.Color.Gray; + this.PrimaryWorkspaceCommandBarLeftLayoutMargin = 2; + this.PrimaryWorkspaceCommandBarRightLayoutMargin = 2; + this.PrimaryWorkspaceCommandBarSeparatorLayoutMargin = 2; + this.PrimaryWorkspaceCommandBarTextColor = System.Drawing.Color.Black; + this.PrimaryWorkspaceCommandBarTopBevelFirstLineColor = System.Drawing.Color.Transparent; + this.PrimaryWorkspaceCommandBarTopBevelSecondLineColor = System.Drawing.Color.Transparent; + this.PrimaryWorkspaceCommandBarTopColor = System.Drawing.Color.FromArgb(((System.Byte)(193)), ((System.Byte)(213)), ((System.Byte)(249))); + this.PrimaryWorkspaceCommandBarTopLayoutMargin = 2; + this.PrimaryWorkspaceTopColor = System.Drawing.Color.FromArgb(((System.Byte)(154)), ((System.Byte)(174)), ((System.Byte)(213))); + this.SecondaryWorkspaceBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(183)), ((System.Byte)(203)), ((System.Byte)(245))); + this.SecondaryWorkspaceTopColor = System.Drawing.Color.FromArgb(((System.Byte)(183)), ((System.Byte)(203)), ((System.Byte)(245))); + this.SmallApplicationFont = new System.Drawing.Font("Tahoma", 6.75F); + this.WorkspacePaneControlColor = System.Drawing.Color.FromArgb(((System.Byte)(214)), ((System.Byte)(223)), ((System.Byte)(247))); - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationStyles/ApplicationStyleBronze.cs b/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationStyles/ApplicationStyleBronze.cs index 3406c993..bdc8b3ef 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationStyles/ApplicationStyleBronze.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationStyles/ApplicationStyleBronze.cs @@ -10,81 +10,81 @@ using System.Windows.Forms; namespace Project31.ApplicationFramework.ApplicationStyles { - public class ApplicationStyleBronze : ApplicationStyle - { - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; + public class ApplicationStyleBronze : ApplicationStyle + { + /// + /// Required designer variable. + /// + private System.ComponentModel.Container components = null; - public ApplicationStyleBronze() - { - // This call is required by the Windows.Forms Form Designer. - InitializeComponent(); - } + public ApplicationStyleBronze() + { + // This call is required by the Windows.Forms Form Designer. + InitializeComponent(); + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // ApplicationStyleBronze - // - this.ActiveTabBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(223)), ((System.Byte)(221)), ((System.Byte)(192))); - this.ActiveTabHighlightColor = System.Drawing.Color.FromArgb(((System.Byte)(243)), ((System.Byte)(243)), ((System.Byte)(243))); - this.ActiveTabLowlightColor = System.Drawing.Color.FromArgb(((System.Byte)(181)), ((System.Byte)(193)), ((System.Byte)(196))); - this.ActiveTabTextColor = System.Drawing.Color.Black; - this.ActiveTabTopColor = System.Drawing.Color.FromArgb(((System.Byte)(240)), ((System.Byte)(240)), ((System.Byte)(226))); - this.AlertControlColor = System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(255)), ((System.Byte)(194))); - this.BoldApplicationFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold); - this.BorderColor = System.Drawing.Color.FromArgb(((System.Byte)(172)), ((System.Byte)(172)), ((System.Byte)(133))); - this.InactiveTabBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(228)), ((System.Byte)(228)), ((System.Byte)(228))); - this.InactiveTabHighlightColor = System.Drawing.Color.FromArgb(((System.Byte)(243)), ((System.Byte)(243)), ((System.Byte)(243))); - this.InactiveTabLowlightColor = System.Drawing.Color.FromArgb(((System.Byte)(189)), ((System.Byte)(189)), ((System.Byte)(189))); - this.InactiveTabTextColor = System.Drawing.Color.Black; - this.InactiveTabTopColor = System.Drawing.Color.FromArgb(((System.Byte)(232)), ((System.Byte)(232)), ((System.Byte)(232))); - this.ItalicApplicationFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Italic); - this.LinkApplicationFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Underline); - this.NormalApplicationFont = new System.Drawing.Font("Tahoma", 8.25F); - this.PrimaryWorkspaceBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(202)), ((System.Byte)(200)), ((System.Byte)(173))); - this.PrimaryWorkspaceCommandBarBottomBevelFirstLineColor = System.Drawing.Color.FromArgb(((System.Byte)(172)), ((System.Byte)(172)), ((System.Byte)(133))); - this.PrimaryWorkspaceCommandBarBottomBevelSecondLineColor = System.Drawing.Color.FromArgb(((System.Byte)(230)), ((System.Byte)(230)), ((System.Byte)(220))); - this.PrimaryWorkspaceCommandBarBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(222)), ((System.Byte)(220)), ((System.Byte)(191))); - this.PrimaryWorkspaceCommandBarBottomLayoutMargin = 3; - this.PrimaryWorkspaceCommandBarDisabledTextColor = System.Drawing.Color.Gray; - this.PrimaryWorkspaceCommandBarLeftLayoutMargin = 2; - this.PrimaryWorkspaceCommandBarRightLayoutMargin = 2; - this.PrimaryWorkspaceCommandBarSeparatorLayoutMargin = 2; - this.PrimaryWorkspaceCommandBarTextColor = System.Drawing.Color.Black; - this.PrimaryWorkspaceCommandBarTopBevelFirstLineColor = System.Drawing.Color.Transparent; - this.PrimaryWorkspaceCommandBarTopBevelSecondLineColor = System.Drawing.Color.Transparent; - this.PrimaryWorkspaceCommandBarTopColor = System.Drawing.Color.FromArgb(((System.Byte)(241)), ((System.Byte)(241)), ((System.Byte)(227))); - this.PrimaryWorkspaceCommandBarTopLayoutMargin = 2; - this.PrimaryWorkspaceTopColor = System.Drawing.Color.FromArgb(((System.Byte)(202)), ((System.Byte)(200)), ((System.Byte)(173))); - this.SecondaryWorkspaceBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(222)), ((System.Byte)(220)), ((System.Byte)(191))); - this.SecondaryWorkspaceTopColor = System.Drawing.Color.FromArgb(((System.Byte)(222)), ((System.Byte)(220)), ((System.Byte)(191))); - this.SmallApplicationFont = new System.Drawing.Font("Tahoma", 6.75F); - this.WorkspacePaneControlColor = System.Drawing.Color.FromArgb(((System.Byte)(238)), ((System.Byte)(238)), ((System.Byte)(222))); + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // ApplicationStyleBronze + // + this.ActiveTabBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(223)), ((System.Byte)(221)), ((System.Byte)(192))); + this.ActiveTabHighlightColor = System.Drawing.Color.FromArgb(((System.Byte)(243)), ((System.Byte)(243)), ((System.Byte)(243))); + this.ActiveTabLowlightColor = System.Drawing.Color.FromArgb(((System.Byte)(181)), ((System.Byte)(193)), ((System.Byte)(196))); + this.ActiveTabTextColor = System.Drawing.Color.Black; + this.ActiveTabTopColor = System.Drawing.Color.FromArgb(((System.Byte)(240)), ((System.Byte)(240)), ((System.Byte)(226))); + this.AlertControlColor = System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(255)), ((System.Byte)(194))); + this.BoldApplicationFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold); + this.BorderColor = System.Drawing.Color.FromArgb(((System.Byte)(172)), ((System.Byte)(172)), ((System.Byte)(133))); + this.InactiveTabBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(228)), ((System.Byte)(228)), ((System.Byte)(228))); + this.InactiveTabHighlightColor = System.Drawing.Color.FromArgb(((System.Byte)(243)), ((System.Byte)(243)), ((System.Byte)(243))); + this.InactiveTabLowlightColor = System.Drawing.Color.FromArgb(((System.Byte)(189)), ((System.Byte)(189)), ((System.Byte)(189))); + this.InactiveTabTextColor = System.Drawing.Color.Black; + this.InactiveTabTopColor = System.Drawing.Color.FromArgb(((System.Byte)(232)), ((System.Byte)(232)), ((System.Byte)(232))); + this.ItalicApplicationFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Italic); + this.LinkApplicationFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Underline); + this.NormalApplicationFont = new System.Drawing.Font("Tahoma", 8.25F); + this.PrimaryWorkspaceBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(202)), ((System.Byte)(200)), ((System.Byte)(173))); + this.PrimaryWorkspaceCommandBarBottomBevelFirstLineColor = System.Drawing.Color.FromArgb(((System.Byte)(172)), ((System.Byte)(172)), ((System.Byte)(133))); + this.PrimaryWorkspaceCommandBarBottomBevelSecondLineColor = System.Drawing.Color.FromArgb(((System.Byte)(230)), ((System.Byte)(230)), ((System.Byte)(220))); + this.PrimaryWorkspaceCommandBarBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(222)), ((System.Byte)(220)), ((System.Byte)(191))); + this.PrimaryWorkspaceCommandBarBottomLayoutMargin = 3; + this.PrimaryWorkspaceCommandBarDisabledTextColor = System.Drawing.Color.Gray; + this.PrimaryWorkspaceCommandBarLeftLayoutMargin = 2; + this.PrimaryWorkspaceCommandBarRightLayoutMargin = 2; + this.PrimaryWorkspaceCommandBarSeparatorLayoutMargin = 2; + this.PrimaryWorkspaceCommandBarTextColor = System.Drawing.Color.Black; + this.PrimaryWorkspaceCommandBarTopBevelFirstLineColor = System.Drawing.Color.Transparent; + this.PrimaryWorkspaceCommandBarTopBevelSecondLineColor = System.Drawing.Color.Transparent; + this.PrimaryWorkspaceCommandBarTopColor = System.Drawing.Color.FromArgb(((System.Byte)(241)), ((System.Byte)(241)), ((System.Byte)(227))); + this.PrimaryWorkspaceCommandBarTopLayoutMargin = 2; + this.PrimaryWorkspaceTopColor = System.Drawing.Color.FromArgb(((System.Byte)(202)), ((System.Byte)(200)), ((System.Byte)(173))); + this.SecondaryWorkspaceBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(222)), ((System.Byte)(220)), ((System.Byte)(191))); + this.SecondaryWorkspaceTopColor = System.Drawing.Color.FromArgb(((System.Byte)(222)), ((System.Byte)(220)), ((System.Byte)(191))); + this.SmallApplicationFont = new System.Drawing.Font("Tahoma", 6.75F); + this.WorkspacePaneControlColor = System.Drawing.Color.FromArgb(((System.Byte)(238)), ((System.Byte)(238)), ((System.Byte)(222))); - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationStyles/ApplicationStyleGreen.cs b/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationStyles/ApplicationStyleGreen.cs index 8fe6a96d..0c565b6c 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationStyles/ApplicationStyleGreen.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationStyles/ApplicationStyleGreen.cs @@ -10,85 +10,85 @@ using System.Windows.Forms; namespace Project31.ApplicationFramework.ApplicationStyles { - public class ApplicationStyleGreen : ApplicationStyle - { - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; + public class ApplicationStyleGreen : ApplicationStyle + { + /// + /// Required designer variable. + /// + private System.ComponentModel.Container components = null; - public ApplicationStyleGreen() - { - // This call is required by the Windows.Forms Form Designer. - InitializeComponent(); - } + public ApplicationStyleGreen() + { + // This call is required by the Windows.Forms Form Designer. + InitializeComponent(); + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // ApplicationStyleGreen - // - this.ActiveSelectionColor = System.Drawing.Color.FromArgb(((System.Byte)(127)), ((System.Byte)(168)), ((System.Byte)(163))); - this.ActiveTabBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(193)), ((System.Byte)(234)), ((System.Byte)(228))); - this.ActiveTabHighlightColor = System.Drawing.Color.FromArgb(((System.Byte)(243)), ((System.Byte)(243)), ((System.Byte)(243))); - this.ActiveTabLowlightColor = System.Drawing.Color.FromArgb(((System.Byte)(181)), ((System.Byte)(193)), ((System.Byte)(196))); - this.ActiveTabTextColor = System.Drawing.Color.Black; - this.ActiveTabTopColor = System.Drawing.Color.FromArgb(((System.Byte)(201)), ((System.Byte)(238)), ((System.Byte)(231))); - this.AlertControlColor = System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(255)), ((System.Byte)(194))); - this.BoldApplicationFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold); - this.BorderColor = System.Drawing.Color.FromArgb(((System.Byte)(127)), ((System.Byte)(168)), ((System.Byte)(163))); - this.InactiveSelectionColor = System.Drawing.SystemColors.Control; - this.InactiveTabBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(228)), ((System.Byte)(228)), ((System.Byte)(228))); - this.InactiveTabHighlightColor = System.Drawing.Color.FromArgb(((System.Byte)(243)), ((System.Byte)(243)), ((System.Byte)(243))); - this.InactiveTabLowlightColor = System.Drawing.Color.FromArgb(((System.Byte)(189)), ((System.Byte)(189)), ((System.Byte)(189))); - this.InactiveTabTextColor = System.Drawing.Color.Black; - this.InactiveTabTopColor = System.Drawing.Color.FromArgb(((System.Byte)(232)), ((System.Byte)(232)), ((System.Byte)(232))); - this.ItalicApplicationFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Italic); - this.LinkApplicationFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Underline); - this.MenuBitmapAreaColor = System.Drawing.Color.FromArgb(((System.Byte)(197)), ((System.Byte)(236)), ((System.Byte)(230))); - this.MenuSelectionColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(127)), ((System.Byte)(168)), ((System.Byte)(163))); - this.NormalApplicationFont = new System.Drawing.Font("Tahoma", 8.25F); - this.PrimaryWorkspaceBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(164)), ((System.Byte)(203)), ((System.Byte)(197))); - this.PrimaryWorkspaceCommandBarBottomBevelFirstLineColor = System.Drawing.Color.FromArgb(((System.Byte)(127)), ((System.Byte)(168)), ((System.Byte)(163))); - this.PrimaryWorkspaceCommandBarBottomBevelSecondLineColor = System.Drawing.Color.FromArgb(((System.Byte)(175)), ((System.Byte)(213)), ((System.Byte)(205))); - this.PrimaryWorkspaceCommandBarBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(164)), ((System.Byte)(212)), ((System.Byte)(204))); - this.PrimaryWorkspaceCommandBarBottomLayoutMargin = 3; - this.PrimaryWorkspaceCommandBarDisabledTextColor = System.Drawing.Color.Gray; - this.PrimaryWorkspaceCommandBarLeftLayoutMargin = 2; - this.PrimaryWorkspaceCommandBarRightLayoutMargin = 2; - this.PrimaryWorkspaceCommandBarSeparatorLayoutMargin = 2; - this.PrimaryWorkspaceCommandBarTextColor = System.Drawing.Color.Black; - this.PrimaryWorkspaceCommandBarTopBevelFirstLineColor = System.Drawing.Color.Transparent; - this.PrimaryWorkspaceCommandBarTopBevelSecondLineColor = System.Drawing.Color.Transparent; - this.PrimaryWorkspaceCommandBarTopColor = System.Drawing.Color.FromArgb(((System.Byte)(201)), ((System.Byte)(238)), ((System.Byte)(231))); - this.PrimaryWorkspaceCommandBarTopLayoutMargin = 2; - this.PrimaryWorkspaceTopColor = System.Drawing.Color.FromArgb(((System.Byte)(164)), ((System.Byte)(203)), ((System.Byte)(197))); - this.SecondaryWorkspaceBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(193)), ((System.Byte)(234)), ((System.Byte)(228))); - this.SecondaryWorkspaceTopColor = System.Drawing.Color.FromArgb(((System.Byte)(193)), ((System.Byte)(234)), ((System.Byte)(228))); - this.SmallApplicationFont = new System.Drawing.Font("Tahoma", 6.75F); - this.WorkspacePaneControlColor = System.Drawing.Color.FromArgb(((System.Byte)(204)), ((System.Byte)(224)), ((System.Byte)(221))); + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // ApplicationStyleGreen + // + this.ActiveSelectionColor = System.Drawing.Color.FromArgb(((System.Byte)(127)), ((System.Byte)(168)), ((System.Byte)(163))); + this.ActiveTabBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(193)), ((System.Byte)(234)), ((System.Byte)(228))); + this.ActiveTabHighlightColor = System.Drawing.Color.FromArgb(((System.Byte)(243)), ((System.Byte)(243)), ((System.Byte)(243))); + this.ActiveTabLowlightColor = System.Drawing.Color.FromArgb(((System.Byte)(181)), ((System.Byte)(193)), ((System.Byte)(196))); + this.ActiveTabTextColor = System.Drawing.Color.Black; + this.ActiveTabTopColor = System.Drawing.Color.FromArgb(((System.Byte)(201)), ((System.Byte)(238)), ((System.Byte)(231))); + this.AlertControlColor = System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(255)), ((System.Byte)(194))); + this.BoldApplicationFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold); + this.BorderColor = System.Drawing.Color.FromArgb(((System.Byte)(127)), ((System.Byte)(168)), ((System.Byte)(163))); + this.InactiveSelectionColor = System.Drawing.SystemColors.Control; + this.InactiveTabBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(228)), ((System.Byte)(228)), ((System.Byte)(228))); + this.InactiveTabHighlightColor = System.Drawing.Color.FromArgb(((System.Byte)(243)), ((System.Byte)(243)), ((System.Byte)(243))); + this.InactiveTabLowlightColor = System.Drawing.Color.FromArgb(((System.Byte)(189)), ((System.Byte)(189)), ((System.Byte)(189))); + this.InactiveTabTextColor = System.Drawing.Color.Black; + this.InactiveTabTopColor = System.Drawing.Color.FromArgb(((System.Byte)(232)), ((System.Byte)(232)), ((System.Byte)(232))); + this.ItalicApplicationFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Italic); + this.LinkApplicationFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Underline); + this.MenuBitmapAreaColor = System.Drawing.Color.FromArgb(((System.Byte)(197)), ((System.Byte)(236)), ((System.Byte)(230))); + this.MenuSelectionColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(127)), ((System.Byte)(168)), ((System.Byte)(163))); + this.NormalApplicationFont = new System.Drawing.Font("Tahoma", 8.25F); + this.PrimaryWorkspaceBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(164)), ((System.Byte)(203)), ((System.Byte)(197))); + this.PrimaryWorkspaceCommandBarBottomBevelFirstLineColor = System.Drawing.Color.FromArgb(((System.Byte)(127)), ((System.Byte)(168)), ((System.Byte)(163))); + this.PrimaryWorkspaceCommandBarBottomBevelSecondLineColor = System.Drawing.Color.FromArgb(((System.Byte)(175)), ((System.Byte)(213)), ((System.Byte)(205))); + this.PrimaryWorkspaceCommandBarBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(164)), ((System.Byte)(212)), ((System.Byte)(204))); + this.PrimaryWorkspaceCommandBarBottomLayoutMargin = 3; + this.PrimaryWorkspaceCommandBarDisabledTextColor = System.Drawing.Color.Gray; + this.PrimaryWorkspaceCommandBarLeftLayoutMargin = 2; + this.PrimaryWorkspaceCommandBarRightLayoutMargin = 2; + this.PrimaryWorkspaceCommandBarSeparatorLayoutMargin = 2; + this.PrimaryWorkspaceCommandBarTextColor = System.Drawing.Color.Black; + this.PrimaryWorkspaceCommandBarTopBevelFirstLineColor = System.Drawing.Color.Transparent; + this.PrimaryWorkspaceCommandBarTopBevelSecondLineColor = System.Drawing.Color.Transparent; + this.PrimaryWorkspaceCommandBarTopColor = System.Drawing.Color.FromArgb(((System.Byte)(201)), ((System.Byte)(238)), ((System.Byte)(231))); + this.PrimaryWorkspaceCommandBarTopLayoutMargin = 2; + this.PrimaryWorkspaceTopColor = System.Drawing.Color.FromArgb(((System.Byte)(164)), ((System.Byte)(203)), ((System.Byte)(197))); + this.SecondaryWorkspaceBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(193)), ((System.Byte)(234)), ((System.Byte)(228))); + this.SecondaryWorkspaceTopColor = System.Drawing.Color.FromArgb(((System.Byte)(193)), ((System.Byte)(234)), ((System.Byte)(228))); + this.SmallApplicationFont = new System.Drawing.Font("Tahoma", 6.75F); + this.WorkspacePaneControlColor = System.Drawing.Color.FromArgb(((System.Byte)(204)), ((System.Byte)(224)), ((System.Byte)(221))); - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationStyles/ApplicationStyleLavender.cs b/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationStyles/ApplicationStyleLavender.cs index cb9de1f7..ce70e7a9 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationStyles/ApplicationStyleLavender.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationStyles/ApplicationStyleLavender.cs @@ -7,107 +7,107 @@ using OpenLiveWriter.CoreServices; namespace OpenLiveWriter.ApplicationFramework.ApplicationStyles { - public class ApplicationStyleLavender : ApplicationStyle - { - /// - /// Required designer variable. - /// - private Container components = null; + public class ApplicationStyleLavender : ApplicationStyle + { + /// + /// Required designer variable. + /// + private Container components = null; - /// - /// Initializes a new insance of the ApplicationStyleSienna class. - /// - public ApplicationStyleLavender() - { - // This call is required by the Windows.Forms Form Designer. - InitializeComponent(); - } + /// + /// Initializes a new insance of the ApplicationStyleSienna class. + /// + public ApplicationStyleLavender() + { + // This call is required by the Windows.Forms Form Designer. + InitializeComponent(); + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // ApplicationStyleLavender - // - this.ActiveSelectionColor = System.Drawing.Color.FromArgb(((System.Byte)(129)), ((System.Byte)(129)), ((System.Byte)(197))); - this.ActiveTabBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(186)), ((System.Byte)(188)), ((System.Byte)(226))); - this.ActiveTabHighlightColor = System.Drawing.Color.FromArgb(((System.Byte)(243)), ((System.Byte)(243)), ((System.Byte)(243))); - this.ActiveTabLowlightColor = System.Drawing.Color.FromArgb(((System.Byte)(181)), ((System.Byte)(193)), ((System.Byte)(196))); - this.ActiveTabTextColor = System.Drawing.Color.Black; - this.ActiveTabTopColor = System.Drawing.Color.FromArgb(((System.Byte)(213)), ((System.Byte)(214)), ((System.Byte)(238))); - this.AlertControlColor = System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(255)), ((System.Byte)(194))); - this.BoldApplicationFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold); - this.BorderColor = System.Drawing.Color.FromArgb(((System.Byte)(127)), ((System.Byte)(127)), ((System.Byte)(177))); - this.DisplayName = "Lavender"; - this.InactiveSelectionColor = System.Drawing.Color.FromArgb(((System.Byte)(227)), ((System.Byte)(224)), ((System.Byte)(238))); - this.InactiveTabBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(182)), ((System.Byte)(178)), ((System.Byte)(202))); - this.InactiveTabHighlightColor = System.Drawing.Color.FromArgb(((System.Byte)(243)), ((System.Byte)(243)), ((System.Byte)(243))); - this.InactiveTabLowlightColor = System.Drawing.Color.FromArgb(((System.Byte)(181)), ((System.Byte)(193)), ((System.Byte)(196))); - this.InactiveTabTextColor = System.Drawing.Color.Black; - this.InactiveTabTopColor = System.Drawing.Color.FromArgb(((System.Byte)(202)), ((System.Byte)(198)), ((System.Byte)(218))); - this.ItalicApplicationFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Italic); - this.LinkApplicationFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Underline); - this.MenuBitmapAreaColor = System.Drawing.Color.FromArgb(((System.Byte)(178)), ((System.Byte)(181)), ((System.Byte)(221))); - this.MenuSelectionColor = System.Drawing.Color.FromArgb(((System.Byte)(154)), ((System.Byte)(178)), ((System.Byte)(181)), ((System.Byte)(221))); - this.NormalApplicationFont = new System.Drawing.Font("Tahoma", 8.25F); - this.PrimaryWorkspaceBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(163)), ((System.Byte)(158)), ((System.Byte)(217))); - this.PrimaryWorkspaceCommandBarBottomBevelFirstLineColor = System.Drawing.Color.FromArgb(((System.Byte)(127)), ((System.Byte)(127)), ((System.Byte)(177))); - this.PrimaryWorkspaceCommandBarBottomBevelSecondLineColor = System.Drawing.Color.FromArgb(((System.Byte)(211)), ((System.Byte)(215)), ((System.Byte)(219))); - this.PrimaryWorkspaceCommandBarBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(161)), ((System.Byte)(155)), ((System.Byte)(209))); - this.PrimaryWorkspaceCommandBarBottomLayoutMargin = 3; - this.PrimaryWorkspaceCommandBarDisabledTextColor = System.Drawing.Color.Gray; - this.PrimaryWorkspaceCommandBarLeftLayoutMargin = 2; - this.PrimaryWorkspaceCommandBarRightLayoutMargin = 2; - this.PrimaryWorkspaceCommandBarSeparatorLayoutMargin = 2; - this.PrimaryWorkspaceCommandBarTextColor = System.Drawing.Color.Black; - this.PrimaryWorkspaceCommandBarTopBevelFirstLineColor = System.Drawing.Color.Transparent; - this.PrimaryWorkspaceCommandBarTopBevelSecondLineColor = System.Drawing.Color.Transparent; - this.PrimaryWorkspaceCommandBarTopColor = System.Drawing.Color.FromArgb(((System.Byte)(199)), ((System.Byte)(211)), ((System.Byte)(232))); - this.PrimaryWorkspaceCommandBarTopLayoutMargin = 2; - this.PrimaryWorkspaceTopColor = System.Drawing.Color.FromArgb(((System.Byte)(163)), ((System.Byte)(158)), ((System.Byte)(217))); - this.SecondaryWorkspaceBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(186)), ((System.Byte)(188)), ((System.Byte)(226))); - this.SecondaryWorkspaceTopColor = System.Drawing.Color.FromArgb(((System.Byte)(186)), ((System.Byte)(188)), ((System.Byte)(226))); - this.SmallApplicationFont = new System.Drawing.Font("Tahoma", 6.75F); - this.ToolWindowBackgroundColor = System.Drawing.Color.FromArgb(((System.Byte)(94)), ((System.Byte)(131)), ((System.Byte)(200))); - this.ToolWindowBorderColor = System.Drawing.Color.FromArgb(((System.Byte)(72)), ((System.Byte)(100)), ((System.Byte)(165))); - this.ToolWindowTitleBarBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(94)), ((System.Byte)(131)), ((System.Byte)(200))); - this.ToolWindowTitleBarFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.ToolWindowTitleBarTextColor = System.Drawing.Color.White; - this.ToolWindowTitleBarTopColor = System.Drawing.Color.FromArgb(((System.Byte)(126)), ((System.Byte)(166)), ((System.Byte)(237))); - this.WindowColor = System.Drawing.Color.White; - this.WorkspacePaneControlColor = System.Drawing.Color.FromArgb(((System.Byte)(227)), ((System.Byte)(224)), ((System.Byte)(238))); + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // ApplicationStyleLavender + // + this.ActiveSelectionColor = System.Drawing.Color.FromArgb(((System.Byte)(129)), ((System.Byte)(129)), ((System.Byte)(197))); + this.ActiveTabBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(186)), ((System.Byte)(188)), ((System.Byte)(226))); + this.ActiveTabHighlightColor = System.Drawing.Color.FromArgb(((System.Byte)(243)), ((System.Byte)(243)), ((System.Byte)(243))); + this.ActiveTabLowlightColor = System.Drawing.Color.FromArgb(((System.Byte)(181)), ((System.Byte)(193)), ((System.Byte)(196))); + this.ActiveTabTextColor = System.Drawing.Color.Black; + this.ActiveTabTopColor = System.Drawing.Color.FromArgb(((System.Byte)(213)), ((System.Byte)(214)), ((System.Byte)(238))); + this.AlertControlColor = System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(255)), ((System.Byte)(194))); + this.BoldApplicationFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold); + this.BorderColor = System.Drawing.Color.FromArgb(((System.Byte)(127)), ((System.Byte)(127)), ((System.Byte)(177))); + this.DisplayName = "Lavender"; + this.InactiveSelectionColor = System.Drawing.Color.FromArgb(((System.Byte)(227)), ((System.Byte)(224)), ((System.Byte)(238))); + this.InactiveTabBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(182)), ((System.Byte)(178)), ((System.Byte)(202))); + this.InactiveTabHighlightColor = System.Drawing.Color.FromArgb(((System.Byte)(243)), ((System.Byte)(243)), ((System.Byte)(243))); + this.InactiveTabLowlightColor = System.Drawing.Color.FromArgb(((System.Byte)(181)), ((System.Byte)(193)), ((System.Byte)(196))); + this.InactiveTabTextColor = System.Drawing.Color.Black; + this.InactiveTabTopColor = System.Drawing.Color.FromArgb(((System.Byte)(202)), ((System.Byte)(198)), ((System.Byte)(218))); + this.ItalicApplicationFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Italic); + this.LinkApplicationFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Underline); + this.MenuBitmapAreaColor = System.Drawing.Color.FromArgb(((System.Byte)(178)), ((System.Byte)(181)), ((System.Byte)(221))); + this.MenuSelectionColor = System.Drawing.Color.FromArgb(((System.Byte)(154)), ((System.Byte)(178)), ((System.Byte)(181)), ((System.Byte)(221))); + this.NormalApplicationFont = new System.Drawing.Font("Tahoma", 8.25F); + this.PrimaryWorkspaceBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(163)), ((System.Byte)(158)), ((System.Byte)(217))); + this.PrimaryWorkspaceCommandBarBottomBevelFirstLineColor = System.Drawing.Color.FromArgb(((System.Byte)(127)), ((System.Byte)(127)), ((System.Byte)(177))); + this.PrimaryWorkspaceCommandBarBottomBevelSecondLineColor = System.Drawing.Color.FromArgb(((System.Byte)(211)), ((System.Byte)(215)), ((System.Byte)(219))); + this.PrimaryWorkspaceCommandBarBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(161)), ((System.Byte)(155)), ((System.Byte)(209))); + this.PrimaryWorkspaceCommandBarBottomLayoutMargin = 3; + this.PrimaryWorkspaceCommandBarDisabledTextColor = System.Drawing.Color.Gray; + this.PrimaryWorkspaceCommandBarLeftLayoutMargin = 2; + this.PrimaryWorkspaceCommandBarRightLayoutMargin = 2; + this.PrimaryWorkspaceCommandBarSeparatorLayoutMargin = 2; + this.PrimaryWorkspaceCommandBarTextColor = System.Drawing.Color.Black; + this.PrimaryWorkspaceCommandBarTopBevelFirstLineColor = System.Drawing.Color.Transparent; + this.PrimaryWorkspaceCommandBarTopBevelSecondLineColor = System.Drawing.Color.Transparent; + this.PrimaryWorkspaceCommandBarTopColor = System.Drawing.Color.FromArgb(((System.Byte)(199)), ((System.Byte)(211)), ((System.Byte)(232))); + this.PrimaryWorkspaceCommandBarTopLayoutMargin = 2; + this.PrimaryWorkspaceTopColor = System.Drawing.Color.FromArgb(((System.Byte)(163)), ((System.Byte)(158)), ((System.Byte)(217))); + this.SecondaryWorkspaceBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(186)), ((System.Byte)(188)), ((System.Byte)(226))); + this.SecondaryWorkspaceTopColor = System.Drawing.Color.FromArgb(((System.Byte)(186)), ((System.Byte)(188)), ((System.Byte)(226))); + this.SmallApplicationFont = new System.Drawing.Font("Tahoma", 6.75F); + this.ToolWindowBackgroundColor = System.Drawing.Color.FromArgb(((System.Byte)(94)), ((System.Byte)(131)), ((System.Byte)(200))); + this.ToolWindowBorderColor = System.Drawing.Color.FromArgb(((System.Byte)(72)), ((System.Byte)(100)), ((System.Byte)(165))); + this.ToolWindowTitleBarBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(94)), ((System.Byte)(131)), ((System.Byte)(200))); + this.ToolWindowTitleBarFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); + this.ToolWindowTitleBarTextColor = System.Drawing.Color.White; + this.ToolWindowTitleBarTopColor = System.Drawing.Color.FromArgb(((System.Byte)(126)), ((System.Byte)(166)), ((System.Byte)(237))); + this.WindowColor = System.Drawing.Color.White; + this.WorkspacePaneControlColor = System.Drawing.Color.FromArgb(((System.Byte)(227)), ((System.Byte)(224)), ((System.Byte)(238))); - } - #endregion + } + #endregion - /// - /// Gets or sets the preview image of the ApplicationStyle. - /// - public override Image PreviewImage - { - get - { - return ResourceHelper.LoadAssemblyResourceBitmap("ApplicationStyles.Images.Lavender.png"); - } - } - } + /// + /// Gets or sets the preview image of the ApplicationStyle. + /// + public override Image PreviewImage + { + get + { + return ResourceHelper.LoadAssemblyResourceBitmap("ApplicationStyles.Images.Lavender.png"); + } + } + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationStyles/ApplicationStyleManager.cs b/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationStyles/ApplicationStyleManager.cs index 4537bdfe..3e2d41b4 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationStyles/ApplicationStyleManager.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationStyles/ApplicationStyleManager.cs @@ -6,63 +6,60 @@ using OpenLiveWriter.ApplicationFramework.Preferences; namespace OpenLiveWriter.ApplicationFramework.ApplicationStyles { - /// - /// Provides application management service. - /// - public sealed class ApplicationStyleManager - { + /// + /// Provides application management service. + /// + public sealed class ApplicationStyleManager + { - /// - /// Gets or sets the ApplicationStyle object - /// - public static ApplicationStyle ApplicationStyle - { - get - { - return ApplicationManager.ApplicationStyle; - } - } + /// + /// Gets or sets the ApplicationStyle object + /// + public static ApplicationStyle ApplicationStyle + { + get + { + return ApplicationManager.ApplicationStyle; + } + } - #region ApplicatonStyle access/monitoring + #region ApplicatonStyle access/monitoring - public static event EventHandler ApplicationStyleChanged - { - add - { - ApplicationStylePreferences.PreferencesChanged += value ; - } - remove - { - ApplicationStylePreferences.PreferencesChanged -= value ; - } - } + public static event EventHandler ApplicationStyleChanged + { + add + { + ApplicationStylePreferences.PreferencesChanged += value ; + } + remove + { + ApplicationStylePreferences.PreferencesChanged -= value ; + } + } - public static void CheckForApplicationStyleChanges() - { - ApplicationStylePreferences.CheckForChanges() ; - } + public static void CheckForApplicationStyleChanges() + { + ApplicationStylePreferences.CheckForChanges() ; + } + + /// Get the ApplicationStylePreferences instance for the current thread + /// + private static ApplicationStylePreferences ApplicationStylePreferences + { + get + { + if (_applicationStylePreferences == null) + { + _applicationStylePreferences = Activator.CreateInstance(typeof(ApplicationStylePreferences), new object[] { true } ) as ApplicationStylePreferences ; + } + return _applicationStylePreferences; + } + } + [ThreadStatic] + private static ApplicationStylePreferences _applicationStylePreferences ; - /// Get the ApplicationStylePreferences instance for the current thread - /// - private static ApplicationStylePreferences ApplicationStylePreferences - { - get - { - if (_applicationStylePreferences == null) - { - _applicationStylePreferences = Activator.CreateInstance(typeof(ApplicationStylePreferences), new object[] { true } ) as ApplicationStylePreferences ; - } - return _applicationStylePreferences; - } - } - [ThreadStatic] - private static ApplicationStylePreferences _applicationStylePreferences ; + #endregion - - - - #endregion - - } + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationStyles/ApplicationStylePreferences.cs b/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationStyles/ApplicationStylePreferences.cs index bfc1b930..77297674 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationStyles/ApplicationStylePreferences.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationStyles/ApplicationStylePreferences.cs @@ -10,144 +10,144 @@ using OpenLiveWriter.ApplicationFramework.Preferences ; namespace OpenLiveWriter.ApplicationFramework.ApplicationStyles { - /// - /// Appearance preferences. - /// - public class ApplicationStylePreferences : OpenLiveWriter.ApplicationFramework.Preferences.Preferences - { - #region Static & Constant Declarations + /// + /// Appearance preferences. + /// + public class ApplicationStylePreferences : OpenLiveWriter.ApplicationFramework.Preferences.Preferences + { + #region Static & Constant Declarations - /// - /// The AppearancePreferences sub-key. - /// - private const string PREFERENCES_SUB_KEY = "Appearance"; + /// + /// The AppearancePreferences sub-key. + /// + private const string PREFERENCES_SUB_KEY = "Appearance"; - /// - /// The ApplicationStyleTypeName key. - /// - private const string APPLICATION_STYLE_TYPE_NAME = "ApplicationStyleTypeName"; + /// + /// The ApplicationStyleTypeName key. + /// + private const string APPLICATION_STYLE_TYPE_NAME = "ApplicationStyleTypeName"; - #endregion Static & Constant Declarations + #endregion Static & Constant Declarations - #region Private Member Variables + #region Private Member Variables - /// - /// The ApplicationStyle Type. - /// - private Type applicationStyleType; + /// + /// The ApplicationStyle Type. + /// + private Type applicationStyleType; - #endregion + #endregion - #region Class Initialization & Termination + #region Class Initialization & Termination - /// - /// Initializes a new instance of the AppearancePreferences class. - /// - public ApplicationStylePreferences(bool monitorChanges) : base(PREFERENCES_SUB_KEY, monitorChanges) - { - } + /// + /// Initializes a new instance of the AppearancePreferences class. + /// + public ApplicationStylePreferences(bool monitorChanges) : base(PREFERENCES_SUB_KEY, monitorChanges) + { + } - public ApplicationStylePreferences() : this(false) - { - } + public ApplicationStylePreferences() : this(false) + { + } - #endregion Class Initialization & Termination + #endregion Class Initialization & Termination - #region Public Properties + #region Public Properties - /// - /// Gets or sets the ApplicationStyle Type. - /// - public Type ApplicationStyleType - { - get - { - return typeof(ApplicationStyleSkyBlue); + /// + /// Gets or sets the ApplicationStyle Type. + /// + public Type ApplicationStyleType + { + get + { + return typeof(ApplicationStyleSkyBlue); - // JJA: Decided to only support SkyBlue so we could make the - // design of the sidebar more straightforward - //return applicationStyleType; - } - set - { - if (applicationStyleType != value) - { - applicationStyleType = value; - Modified(); - } - } - } + // JJA: Decided to only support SkyBlue so we could make the + // design of the sidebar more straightforward + //return applicationStyleType; + } + set + { + if (applicationStyleType != value) + { + applicationStyleType = value; + Modified(); + } + } + } - #endregion Public Properties + #endregion Public Properties - #region Protected Methods + #region Protected Methods - /// - /// Loads preferences. - /// - protected override void LoadPreferences() - { - // Obtain the type name of the application style. If it's null, use SkyBlue. - string name = SettingsPersisterHelper.GetString(APPLICATION_STYLE_TYPE_NAME, "ApplicationStyleSkyBlue"); + /// + /// Loads preferences. + /// + protected override void LoadPreferences() + { + // Obtain the type name of the application style. If it's null, use SkyBlue. + string name = SettingsPersisterHelper.GetString(APPLICATION_STYLE_TYPE_NAME, "ApplicationStyleSkyBlue"); - // strip "AplicationStyle" preface (for legacy settings format support) - const string APPLICATION_STYLE = "ApplicationStyle"; - if ( name.StartsWith(APPLICATION_STYLE) ) - name = name.Substring(APPLICATION_STYLE.Length) ; + // strip "AplicationStyle" preface (for legacy settings format support) + const string APPLICATION_STYLE = "ApplicationStyle"; + if ( name.StartsWith(APPLICATION_STYLE) ) + name = name.Substring(APPLICATION_STYLE.Length) ; - switch(name) - { - case "SkyBlue": - applicationStyleType = typeof(ApplicationStyleSkyBlue); - break; - case "Lavender": - applicationStyleType = typeof(ApplicationStyleLavender); - break; - case "Sienna": - applicationStyleType = typeof(ApplicationStyleSienna); - break; - case "Sterling": - applicationStyleType = typeof(ApplicationStyleSterling); - break; - case "Wintergreen": - applicationStyleType = typeof(ApplicationStyleWintergreen); - break; - default: - Trace.Fail("Unexpected application style type: " + name); - applicationStyleType = typeof(ApplicationStyleSkyBlue); - break; - } + switch(name) + { + case "SkyBlue": + applicationStyleType = typeof(ApplicationStyleSkyBlue); + break; + case "Lavender": + applicationStyleType = typeof(ApplicationStyleLavender); + break; + case "Sienna": + applicationStyleType = typeof(ApplicationStyleSienna); + break; + case "Sterling": + applicationStyleType = typeof(ApplicationStyleSterling); + break; + case "Wintergreen": + applicationStyleType = typeof(ApplicationStyleWintergreen); + break; + default: + Trace.Fail("Unexpected application style type: " + name); + applicationStyleType = typeof(ApplicationStyleSkyBlue); + break; + } - // Set the new application style. - if (ApplicationManager.ApplicationStyle.GetType() != applicationStyleType) - ApplicationManager.ApplicationStyle = Activator.CreateInstance(applicationStyleType) as ApplicationStyle; - } + // Set the new application style. + if (ApplicationManager.ApplicationStyle.GetType() != applicationStyleType) + ApplicationManager.ApplicationStyle = Activator.CreateInstance(applicationStyleType) as ApplicationStyle; + } - /// - /// Saves preferences. - /// - protected override void SavePreferences() - { - string name = null; - if ( applicationStyleType == typeof(ApplicationStyleSkyBlue) ) - name = "SkyBlue"; - else if ( applicationStyleType == typeof(ApplicationStyleLavender) ) - name = "Lavender"; - else if ( applicationStyleType == typeof(ApplicationStyleSienna) ) - name = "Sienna"; - else if ( applicationStyleType == typeof(ApplicationStyleSterling) ) - name = "Sterling"; - else if ( applicationStyleType == typeof(ApplicationStyleWintergreen) ) - name = "Wintergreen"; - else - { - Trace.Fail("Unexpected application style: " + applicationStyleType.Name); - name = "SkyBlue"; - } + /// + /// Saves preferences. + /// + protected override void SavePreferences() + { + string name = null; + if ( applicationStyleType == typeof(ApplicationStyleSkyBlue) ) + name = "SkyBlue"; + else if ( applicationStyleType == typeof(ApplicationStyleLavender) ) + name = "Lavender"; + else if ( applicationStyleType == typeof(ApplicationStyleSienna) ) + name = "Sienna"; + else if ( applicationStyleType == typeof(ApplicationStyleSterling) ) + name = "Sterling"; + else if ( applicationStyleType == typeof(ApplicationStyleWintergreen) ) + name = "Wintergreen"; + else + { + Trace.Fail("Unexpected application style: " + applicationStyleType.Name); + name = "SkyBlue"; + } - SettingsPersisterHelper.SetString(APPLICATION_STYLE_TYPE_NAME, name); - } + SettingsPersisterHelper.SetString(APPLICATION_STYLE_TYPE_NAME, name); + } - #endregion Protected Methods - } + #endregion Protected Methods + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationStyles/ApplicationStylePreferencesPanel.cs b/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationStyles/ApplicationStylePreferencesPanel.cs index 10fe9724..0e40faa8 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationStyles/ApplicationStylePreferencesPanel.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationStyles/ApplicationStylePreferencesPanel.cs @@ -9,245 +9,245 @@ using OpenLiveWriter.CoreServices; namespace OpenLiveWriter.ApplicationFramework.ApplicationStyles { - /// - /// Appearance preferences panel. - /// - public class ApplicationStylePreferencesPanel : PreferencesPanel - { - #region Static & Constant Declarations + /// + /// Appearance preferences panel. + /// + public class ApplicationStylePreferencesPanel : PreferencesPanel + { + #region Static & Constant Declarations - /// - /// The types of ApplicationStyle objects provided by the system. - /// - private Type[] applicationStyleTypes = new Type[] - { - typeof(ApplicationStyleSkyBlue), - }; + /// + /// The types of ApplicationStyle objects provided by the system. + /// + private Type[] applicationStyleTypes = new Type[] + { + typeof(ApplicationStyleSkyBlue), + }; - #endregion Static & Constant Declarations + #endregion Static & Constant Declarations - #region Private Member Variables + #region Private Member Variables - /// - /// The AppearancePreferences object. - /// - private ApplicationStylePreferences applicationStylePreferences; + /// + /// The AppearancePreferences object. + /// + private ApplicationStylePreferences applicationStylePreferences; - #endregion Private Member Variables + #endregion Private Member Variables - #region Windows Form Designer generated code + #region Windows Form Designer generated code - private System.Windows.Forms.FontDialog fontDialog; - private System.Windows.Forms.GroupBox groupBoxTheme; - private System.Windows.Forms.Label labelFolderNameFont; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.ListBox listBoxApplicationStyles; - private System.Windows.Forms.PictureBox pictureBoxPreview; - private System.ComponentModel.Container components = null; + private System.Windows.Forms.FontDialog fontDialog; + private System.Windows.Forms.GroupBox groupBoxTheme; + private System.Windows.Forms.Label labelFolderNameFont; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.ListBox listBoxApplicationStyles; + private System.Windows.Forms.PictureBox pictureBoxPreview; + private System.ComponentModel.Container components = null; - #endregion Windows Form Designer generated code + #endregion Windows Form Designer generated code - #region Class Initialization & Termination + #region Class Initialization & Termination - /// - /// Initializes a new instance of the AppearancePreferencesPanel class. - /// - public ApplicationStylePreferencesPanel() : this(new ApplicationStylePreferences(false)) - { - } + /// + /// Initializes a new instance of the AppearancePreferencesPanel class. + /// + public ApplicationStylePreferencesPanel() : this(new ApplicationStylePreferences(false)) + { + } - public ApplicationStylePreferencesPanel(ApplicationStylePreferences preferences) - { - // This call is required by the Windows.Forms Form Designer. - InitializeComponent(); + public ApplicationStylePreferencesPanel(ApplicationStylePreferences preferences) + { + // This call is required by the Windows.Forms Form Designer. + InitializeComponent(); - // Set the panel bitmap. - PanelBitmap = ResourceHelper.LoadAssemblyResourceBitmap("ApplicationStyles.Images.ApplicationStyleSmall.png"); + // Set the panel bitmap. + PanelBitmap = ResourceHelper.LoadAssemblyResourceBitmap("ApplicationStyles.Images.ApplicationStyleSmall.png"); - // Instantiate the MicroViewPreferences object and initialize the controls. - applicationStylePreferences = preferences; - applicationStylePreferences.PreferencesModified += new EventHandler(appearancePreferences_PreferencesModified); + // Instantiate the MicroViewPreferences object and initialize the controls. + applicationStylePreferences = preferences; + applicationStylePreferences.PreferencesModified += new EventHandler(appearancePreferences_PreferencesModified); - // Initialize the application styles listbox. - InitializeApplicationStyles(); - } + // Initialize the application styles listbox. + InitializeApplicationStyles(); + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #endregion Class Initialization & Termination + #endregion Class Initialization & Termination - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.groupBoxTheme = new System.Windows.Forms.GroupBox(); - this.label1 = new System.Windows.Forms.Label(); - this.pictureBoxPreview = new System.Windows.Forms.PictureBox(); - this.labelFolderNameFont = new System.Windows.Forms.Label(); - this.listBoxApplicationStyles = new System.Windows.Forms.ListBox(); - this.fontDialog = new System.Windows.Forms.FontDialog(); - this.groupBoxTheme.SuspendLayout(); - this.SuspendLayout(); - // - // groupBoxTheme - // - this.groupBoxTheme.Controls.Add(this.label1); - this.groupBoxTheme.Controls.Add(this.pictureBoxPreview); - this.groupBoxTheme.Controls.Add(this.labelFolderNameFont); - this.groupBoxTheme.Controls.Add(this.listBoxApplicationStyles); - this.groupBoxTheme.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.groupBoxTheme.Location = new System.Drawing.Point(8, 32); - this.groupBoxTheme.Name = "groupBoxTheme"; - this.groupBoxTheme.Size = new System.Drawing.Size(354, 282); - this.groupBoxTheme.TabIndex = 1; - this.groupBoxTheme.TabStop = false; - this.groupBoxTheme.Text = "Color"; - // - // label1 - // - this.label1.BackColor = System.Drawing.SystemColors.Control; - this.label1.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.label1.Location = new System.Drawing.Point(150, 18); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(132, 18); - this.label1.TabIndex = 2; - this.label1.Text = "Preview:"; - // - // pictureBoxPreview - // - this.pictureBoxPreview.BackColor = System.Drawing.SystemColors.Control; - this.pictureBoxPreview.Location = new System.Drawing.Point(150, 36); - this.pictureBoxPreview.Name = "pictureBoxPreview"; - this.pictureBoxPreview.Size = new System.Drawing.Size(192, 235); - this.pictureBoxPreview.TabIndex = 2; - this.pictureBoxPreview.TabStop = false; - // - // labelFolderNameFont - // - this.labelFolderNameFont.BackColor = System.Drawing.SystemColors.Control; - this.labelFolderNameFont.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.labelFolderNameFont.Location = new System.Drawing.Point(10, 18); - this.labelFolderNameFont.Name = "labelFolderNameFont"; - this.labelFolderNameFont.Size = new System.Drawing.Size(132, 18); - this.labelFolderNameFont.TabIndex = 0; - this.labelFolderNameFont.Text = "&Color scheme:"; - // - // listBoxApplicationStyles - // - this.listBoxApplicationStyles.DisplayMember = "DisplayName"; - this.listBoxApplicationStyles.IntegralHeight = false; - this.listBoxApplicationStyles.Location = new System.Drawing.Point(10, 36); - this.listBoxApplicationStyles.Name = "listBoxApplicationStyles"; - this.listBoxApplicationStyles.Size = new System.Drawing.Size(130, 235); - this.listBoxApplicationStyles.TabIndex = 1; - this.listBoxApplicationStyles.SelectedIndexChanged += new System.EventHandler(this.listBoxApplicationStyles_SelectedIndexChanged); - // - // fontDialog - // - this.fontDialog.AllowScriptChange = false; - this.fontDialog.AllowVerticalFonts = false; - this.fontDialog.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.fontDialog.FontMustExist = true; - this.fontDialog.ScriptsOnly = true; - this.fontDialog.ShowEffects = false; - // - // AppearancePreferencesPanel - // - this.Controls.Add(this.groupBoxTheme); - this.Name = "AppearancePreferencesPanel"; - this.PanelName = "Appearance"; - this.Controls.SetChildIndex(this.groupBoxTheme, 0); - this.groupBoxTheme.ResumeLayout(false); - this.ResumeLayout(false); + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.groupBoxTheme = new System.Windows.Forms.GroupBox(); + this.label1 = new System.Windows.Forms.Label(); + this.pictureBoxPreview = new System.Windows.Forms.PictureBox(); + this.labelFolderNameFont = new System.Windows.Forms.Label(); + this.listBoxApplicationStyles = new System.Windows.Forms.ListBox(); + this.fontDialog = new System.Windows.Forms.FontDialog(); + this.groupBoxTheme.SuspendLayout(); + this.SuspendLayout(); + // + // groupBoxTheme + // + this.groupBoxTheme.Controls.Add(this.label1); + this.groupBoxTheme.Controls.Add(this.pictureBoxPreview); + this.groupBoxTheme.Controls.Add(this.labelFolderNameFont); + this.groupBoxTheme.Controls.Add(this.listBoxApplicationStyles); + this.groupBoxTheme.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.groupBoxTheme.Location = new System.Drawing.Point(8, 32); + this.groupBoxTheme.Name = "groupBoxTheme"; + this.groupBoxTheme.Size = new System.Drawing.Size(354, 282); + this.groupBoxTheme.TabIndex = 1; + this.groupBoxTheme.TabStop = false; + this.groupBoxTheme.Text = "Color"; + // + // label1 + // + this.label1.BackColor = System.Drawing.SystemColors.Control; + this.label1.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.label1.Location = new System.Drawing.Point(150, 18); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(132, 18); + this.label1.TabIndex = 2; + this.label1.Text = "Preview:"; + // + // pictureBoxPreview + // + this.pictureBoxPreview.BackColor = System.Drawing.SystemColors.Control; + this.pictureBoxPreview.Location = new System.Drawing.Point(150, 36); + this.pictureBoxPreview.Name = "pictureBoxPreview"; + this.pictureBoxPreview.Size = new System.Drawing.Size(192, 235); + this.pictureBoxPreview.TabIndex = 2; + this.pictureBoxPreview.TabStop = false; + // + // labelFolderNameFont + // + this.labelFolderNameFont.BackColor = System.Drawing.SystemColors.Control; + this.labelFolderNameFont.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.labelFolderNameFont.Location = new System.Drawing.Point(10, 18); + this.labelFolderNameFont.Name = "labelFolderNameFont"; + this.labelFolderNameFont.Size = new System.Drawing.Size(132, 18); + this.labelFolderNameFont.TabIndex = 0; + this.labelFolderNameFont.Text = "&Color scheme:"; + // + // listBoxApplicationStyles + // + this.listBoxApplicationStyles.DisplayMember = "DisplayName"; + this.listBoxApplicationStyles.IntegralHeight = false; + this.listBoxApplicationStyles.Location = new System.Drawing.Point(10, 36); + this.listBoxApplicationStyles.Name = "listBoxApplicationStyles"; + this.listBoxApplicationStyles.Size = new System.Drawing.Size(130, 235); + this.listBoxApplicationStyles.TabIndex = 1; + this.listBoxApplicationStyles.SelectedIndexChanged += new System.EventHandler(this.listBoxApplicationStyles_SelectedIndexChanged); + // + // fontDialog + // + this.fontDialog.AllowScriptChange = false; + this.fontDialog.AllowVerticalFonts = false; + this.fontDialog.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); + this.fontDialog.FontMustExist = true; + this.fontDialog.ScriptsOnly = true; + this.fontDialog.ShowEffects = false; + // + // AppearancePreferencesPanel + // + this.Controls.Add(this.groupBoxTheme); + this.Name = "AppearancePreferencesPanel"; + this.PanelName = "Appearance"; + this.Controls.SetChildIndex(this.groupBoxTheme, 0); + this.groupBoxTheme.ResumeLayout(false); + this.ResumeLayout(false); - } - #endregion + } + #endregion - #region Public Methods + #region Public Methods - /// - /// Saves the PreferencesPanel. - /// - public override void Save() - { - if (applicationStylePreferences.IsModified()) - applicationStylePreferences.Save(); - } + /// + /// Saves the PreferencesPanel. + /// + public override void Save() + { + if (applicationStylePreferences.IsModified()) + applicationStylePreferences.Save(); + } - #endregion Public Methods + #endregion Public Methods - #region Private Methods + #region Private Methods - /// - /// Initialize the application styles listbox. - /// - private void InitializeApplicationStyles() - { - // Add each of the available styles. - foreach (Type type in applicationStyleTypes) - { - ApplicationStyle applicationStyle; - try - { - applicationStyle = Activator.CreateInstance(type) as ApplicationStyle; - listBoxApplicationStyles.Items.Add(applicationStyle); - if (applicationStyle.GetType() == ApplicationManager.ApplicationStyle.GetType()) - listBoxApplicationStyles.SelectedItem = applicationStyle; - } - catch (Exception e) - { - Debug.Fail("Error loading ApplicationStyle "+type.ToString(), e.StackTrace.ToString()); - } - } - } + /// + /// Initialize the application styles listbox. + /// + private void InitializeApplicationStyles() + { + // Add each of the available styles. + foreach (Type type in applicationStyleTypes) + { + ApplicationStyle applicationStyle; + try + { + applicationStyle = Activator.CreateInstance(type) as ApplicationStyle; + listBoxApplicationStyles.Items.Add(applicationStyle); + if (applicationStyle.GetType() == ApplicationManager.ApplicationStyle.GetType()) + listBoxApplicationStyles.SelectedItem = applicationStyle; + } + catch (Exception e) + { + Debug.Fail("Error loading ApplicationStyle "+type.ToString(), e.StackTrace.ToString()); + } + } + } - #endregion Private Methods + #endregion Private Methods - #region Private Event Handlers + #region Private Event Handlers - /// - /// appearancePreferences_PreferencesModified event handler. - /// - /// The source of the event. - /// An EventArgs that contains the event data. - private void appearancePreferences_PreferencesModified(object sender, EventArgs e) - { - OnModified(EventArgs.Empty); - } + /// + /// appearancePreferences_PreferencesModified event handler. + /// + /// The source of the event. + /// An EventArgs that contains the event data. + private void appearancePreferences_PreferencesModified(object sender, EventArgs e) + { + OnModified(EventArgs.Empty); + } - /// - /// listBoxApplicationStyles_SelectedIndexChanged event handler. - /// - /// The source of the event. - /// An EventArgs that contains the event data. - private void listBoxApplicationStyles_SelectedIndexChanged(object sender, EventArgs e) - { - // If the list box is empty, just ignore the event. - if (listBoxApplicationStyles.Items.Count == 0) - return; + /// + /// listBoxApplicationStyles_SelectedIndexChanged event handler. + /// + /// The source of the event. + /// An EventArgs that contains the event data. + private void listBoxApplicationStyles_SelectedIndexChanged(object sender, EventArgs e) + { + // If the list box is empty, just ignore the event. + if (listBoxApplicationStyles.Items.Count == 0) + return; - // Update state. - ApplicationStyle applicationStyle = (ApplicationStyle)listBoxApplicationStyles.SelectedItem; - pictureBoxPreview.Image = applicationStyle.PreviewImage; - applicationStylePreferences.ApplicationStyleType = applicationStyle.GetType(); - } + // Update state. + ApplicationStyle applicationStyle = (ApplicationStyle)listBoxApplicationStyles.SelectedItem; + pictureBoxPreview.Image = applicationStyle.PreviewImage; + applicationStylePreferences.ApplicationStyleType = applicationStyle.GetType(); + } - #endregion Private Event Handlers - } + #endregion Private Event Handlers + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationStyles/ApplicationStyleSienna.cs b/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationStyles/ApplicationStyleSienna.cs index 061edd1d..647c8f86 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationStyles/ApplicationStyleSienna.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationStyles/ApplicationStyleSienna.cs @@ -7,107 +7,107 @@ using OpenLiveWriter.CoreServices; namespace OpenLiveWriter.ApplicationFramework.ApplicationStyles { - public class ApplicationStyleSienna : ApplicationStyle - { - /// - /// Required designer variable. - /// - private Container components = null; + public class ApplicationStyleSienna : ApplicationStyle + { + /// + /// Required designer variable. + /// + private Container components = null; - /// - /// Initializes a new insance of the ApplicationStyleSienna class. - /// - public ApplicationStyleSienna() - { - // This call is required by the Windows.Forms Form Designer. - InitializeComponent(); - } + /// + /// Initializes a new insance of the ApplicationStyleSienna class. + /// + public ApplicationStyleSienna() + { + // This call is required by the Windows.Forms Form Designer. + InitializeComponent(); + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // ApplicationStyleSienna - // - this.ActiveSelectionColor = System.Drawing.Color.FromArgb(((System.Byte)(161)), ((System.Byte)(156)), ((System.Byte)(112))); - this.ActiveTabBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(226)), ((System.Byte)(221)), ((System.Byte)(176))); - this.ActiveTabHighlightColor = System.Drawing.Color.FromArgb(((System.Byte)(243)), ((System.Byte)(243)), ((System.Byte)(243))); - this.ActiveTabLowlightColor = System.Drawing.Color.FromArgb(((System.Byte)(214)), ((System.Byte)(208)), ((System.Byte)(181))); - this.ActiveTabTextColor = System.Drawing.Color.Black; - this.ActiveTabTopColor = System.Drawing.Color.FromArgb(((System.Byte)(250)), ((System.Byte)(245)), ((System.Byte)(202))); - this.AlertControlColor = System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(255)), ((System.Byte)(194))); - this.BoldApplicationFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold); - this.BorderColor = System.Drawing.Color.FromArgb(((System.Byte)(161)), ((System.Byte)(156)), ((System.Byte)(112))); - this.DisplayName = "Sienna"; - this.InactiveSelectionColor = System.Drawing.Color.FromArgb(((System.Byte)(229)), ((System.Byte)(225)), ((System.Byte)(184))); - this.InactiveTabBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(227)), ((System.Byte)(224)), ((System.Byte)(202))); - this.InactiveTabHighlightColor = System.Drawing.Color.White; - this.InactiveTabLowlightColor = System.Drawing.Color.FromArgb(((System.Byte)(214)), ((System.Byte)(208)), ((System.Byte)(181))); - this.InactiveTabTextColor = System.Drawing.Color.Black; - this.InactiveTabTopColor = System.Drawing.Color.FromArgb(((System.Byte)(227)), ((System.Byte)(224)), ((System.Byte)(202))); - this.ItalicApplicationFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Italic); - this.LinkApplicationFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Underline); - this.MenuBitmapAreaColor = System.Drawing.Color.FromArgb(((System.Byte)(227)), ((System.Byte)(222)), ((System.Byte)(178))); - this.MenuSelectionColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(161)), ((System.Byte)(156)), ((System.Byte)(112))); - this.NormalApplicationFont = new System.Drawing.Font("Tahoma", 8.25F); - this.PrimaryWorkspaceBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(199)), ((System.Byte)(194)), ((System.Byte)(149))); - this.PrimaryWorkspaceCommandBarBottomBevelFirstLineColor = System.Drawing.Color.FromArgb(((System.Byte)(171)), ((System.Byte)(166)), ((System.Byte)(120))); - this.PrimaryWorkspaceCommandBarBottomBevelSecondLineColor = System.Drawing.Color.FromArgb(((System.Byte)(214)), ((System.Byte)(208)), ((System.Byte)(181))); - this.PrimaryWorkspaceCommandBarBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(203)), ((System.Byte)(198)), ((System.Byte)(152))); - this.PrimaryWorkspaceCommandBarBottomLayoutMargin = 3; - this.PrimaryWorkspaceCommandBarDisabledTextColor = System.Drawing.Color.Gray; - this.PrimaryWorkspaceCommandBarLeftLayoutMargin = 2; - this.PrimaryWorkspaceCommandBarRightLayoutMargin = 2; - this.PrimaryWorkspaceCommandBarSeparatorLayoutMargin = 2; - this.PrimaryWorkspaceCommandBarTextColor = System.Drawing.Color.Black; - this.PrimaryWorkspaceCommandBarTopBevelFirstLineColor = System.Drawing.Color.Transparent; - this.PrimaryWorkspaceCommandBarTopBevelSecondLineColor = System.Drawing.Color.Transparent; - this.PrimaryWorkspaceCommandBarTopColor = System.Drawing.Color.FromArgb(((System.Byte)(250)), ((System.Byte)(245)), ((System.Byte)(202))); - this.PrimaryWorkspaceCommandBarTopLayoutMargin = 2; - this.PrimaryWorkspaceTopColor = System.Drawing.Color.FromArgb(((System.Byte)(199)), ((System.Byte)(194)), ((System.Byte)(149))); - this.SecondaryWorkspaceBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(226)), ((System.Byte)(221)), ((System.Byte)(176))); - this.SecondaryWorkspaceTopColor = System.Drawing.Color.FromArgb(((System.Byte)(226)), ((System.Byte)(221)), ((System.Byte)(176))); - this.SmallApplicationFont = new System.Drawing.Font("Tahoma", 6.75F); - this.ToolWindowBackgroundColor = System.Drawing.Color.FromArgb(((System.Byte)(94)), ((System.Byte)(131)), ((System.Byte)(200))); - this.ToolWindowBorderColor = System.Drawing.Color.FromArgb(((System.Byte)(72)), ((System.Byte)(100)), ((System.Byte)(165))); - this.ToolWindowTitleBarBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(94)), ((System.Byte)(131)), ((System.Byte)(200))); - this.ToolWindowTitleBarFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.ToolWindowTitleBarTextColor = System.Drawing.Color.White; - this.ToolWindowTitleBarTopColor = System.Drawing.Color.FromArgb(((System.Byte)(126)), ((System.Byte)(166)), ((System.Byte)(237))); - this.WindowColor = System.Drawing.Color.White; - this.WorkspacePaneControlColor = System.Drawing.Color.FromArgb(((System.Byte)(227)), ((System.Byte)(224)), ((System.Byte)(202))); + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // ApplicationStyleSienna + // + this.ActiveSelectionColor = System.Drawing.Color.FromArgb(((System.Byte)(161)), ((System.Byte)(156)), ((System.Byte)(112))); + this.ActiveTabBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(226)), ((System.Byte)(221)), ((System.Byte)(176))); + this.ActiveTabHighlightColor = System.Drawing.Color.FromArgb(((System.Byte)(243)), ((System.Byte)(243)), ((System.Byte)(243))); + this.ActiveTabLowlightColor = System.Drawing.Color.FromArgb(((System.Byte)(214)), ((System.Byte)(208)), ((System.Byte)(181))); + this.ActiveTabTextColor = System.Drawing.Color.Black; + this.ActiveTabTopColor = System.Drawing.Color.FromArgb(((System.Byte)(250)), ((System.Byte)(245)), ((System.Byte)(202))); + this.AlertControlColor = System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(255)), ((System.Byte)(194))); + this.BoldApplicationFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold); + this.BorderColor = System.Drawing.Color.FromArgb(((System.Byte)(161)), ((System.Byte)(156)), ((System.Byte)(112))); + this.DisplayName = "Sienna"; + this.InactiveSelectionColor = System.Drawing.Color.FromArgb(((System.Byte)(229)), ((System.Byte)(225)), ((System.Byte)(184))); + this.InactiveTabBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(227)), ((System.Byte)(224)), ((System.Byte)(202))); + this.InactiveTabHighlightColor = System.Drawing.Color.White; + this.InactiveTabLowlightColor = System.Drawing.Color.FromArgb(((System.Byte)(214)), ((System.Byte)(208)), ((System.Byte)(181))); + this.InactiveTabTextColor = System.Drawing.Color.Black; + this.InactiveTabTopColor = System.Drawing.Color.FromArgb(((System.Byte)(227)), ((System.Byte)(224)), ((System.Byte)(202))); + this.ItalicApplicationFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Italic); + this.LinkApplicationFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Underline); + this.MenuBitmapAreaColor = System.Drawing.Color.FromArgb(((System.Byte)(227)), ((System.Byte)(222)), ((System.Byte)(178))); + this.MenuSelectionColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(161)), ((System.Byte)(156)), ((System.Byte)(112))); + this.NormalApplicationFont = new System.Drawing.Font("Tahoma", 8.25F); + this.PrimaryWorkspaceBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(199)), ((System.Byte)(194)), ((System.Byte)(149))); + this.PrimaryWorkspaceCommandBarBottomBevelFirstLineColor = System.Drawing.Color.FromArgb(((System.Byte)(171)), ((System.Byte)(166)), ((System.Byte)(120))); + this.PrimaryWorkspaceCommandBarBottomBevelSecondLineColor = System.Drawing.Color.FromArgb(((System.Byte)(214)), ((System.Byte)(208)), ((System.Byte)(181))); + this.PrimaryWorkspaceCommandBarBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(203)), ((System.Byte)(198)), ((System.Byte)(152))); + this.PrimaryWorkspaceCommandBarBottomLayoutMargin = 3; + this.PrimaryWorkspaceCommandBarDisabledTextColor = System.Drawing.Color.Gray; + this.PrimaryWorkspaceCommandBarLeftLayoutMargin = 2; + this.PrimaryWorkspaceCommandBarRightLayoutMargin = 2; + this.PrimaryWorkspaceCommandBarSeparatorLayoutMargin = 2; + this.PrimaryWorkspaceCommandBarTextColor = System.Drawing.Color.Black; + this.PrimaryWorkspaceCommandBarTopBevelFirstLineColor = System.Drawing.Color.Transparent; + this.PrimaryWorkspaceCommandBarTopBevelSecondLineColor = System.Drawing.Color.Transparent; + this.PrimaryWorkspaceCommandBarTopColor = System.Drawing.Color.FromArgb(((System.Byte)(250)), ((System.Byte)(245)), ((System.Byte)(202))); + this.PrimaryWorkspaceCommandBarTopLayoutMargin = 2; + this.PrimaryWorkspaceTopColor = System.Drawing.Color.FromArgb(((System.Byte)(199)), ((System.Byte)(194)), ((System.Byte)(149))); + this.SecondaryWorkspaceBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(226)), ((System.Byte)(221)), ((System.Byte)(176))); + this.SecondaryWorkspaceTopColor = System.Drawing.Color.FromArgb(((System.Byte)(226)), ((System.Byte)(221)), ((System.Byte)(176))); + this.SmallApplicationFont = new System.Drawing.Font("Tahoma", 6.75F); + this.ToolWindowBackgroundColor = System.Drawing.Color.FromArgb(((System.Byte)(94)), ((System.Byte)(131)), ((System.Byte)(200))); + this.ToolWindowBorderColor = System.Drawing.Color.FromArgb(((System.Byte)(72)), ((System.Byte)(100)), ((System.Byte)(165))); + this.ToolWindowTitleBarBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(94)), ((System.Byte)(131)), ((System.Byte)(200))); + this.ToolWindowTitleBarFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); + this.ToolWindowTitleBarTextColor = System.Drawing.Color.White; + this.ToolWindowTitleBarTopColor = System.Drawing.Color.FromArgb(((System.Byte)(126)), ((System.Byte)(166)), ((System.Byte)(237))); + this.WindowColor = System.Drawing.Color.White; + this.WorkspacePaneControlColor = System.Drawing.Color.FromArgb(((System.Byte)(227)), ((System.Byte)(224)), ((System.Byte)(202))); - } - #endregion + } + #endregion - /// - /// Gets or sets the preview image of the ApplicationStyle. - /// - public override Image PreviewImage - { - get - { - return ResourceHelper.LoadAssemblyResourceBitmap("ApplicationStyles.Images.Sienna.png"); - } - } - } + /// + /// Gets or sets the preview image of the ApplicationStyle. + /// + public override Image PreviewImage + { + get + { + return ResourceHelper.LoadAssemblyResourceBitmap("ApplicationStyles.Images.Sienna.png"); + } + } + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationStyles/ApplicationStyleSterling.cs b/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationStyles/ApplicationStyleSterling.cs index d1ec726e..ecc69f05 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationStyles/ApplicationStyleSterling.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationStyles/ApplicationStyleSterling.cs @@ -7,104 +7,104 @@ using OpenLiveWriter.CoreServices; namespace OpenLiveWriter.ApplicationFramework.ApplicationStyles { - public class ApplicationStyleSterling : ApplicationStyle - { - /// - /// Required designer variable. - /// - private Container components = null; + public class ApplicationStyleSterling : ApplicationStyle + { + /// + /// Required designer variable. + /// + private Container components = null; - public ApplicationStyleSterling() - { - // This call is required by the Windows.Forms Form Designer. - InitializeComponent(); - } + public ApplicationStyleSterling() + { + // This call is required by the Windows.Forms Form Designer. + InitializeComponent(); + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // ApplicationStyleSterling - // - this.ActiveSelectionColor = System.Drawing.Color.FromArgb(((System.Byte)(146)), ((System.Byte)(155)), ((System.Byte)(174))); - this.ActiveTabBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(219)), ((System.Byte)(224)), ((System.Byte)(229))); - this.ActiveTabHighlightColor = System.Drawing.Color.FromArgb(((System.Byte)(243)), ((System.Byte)(243)), ((System.Byte)(243))); - this.ActiveTabLowlightColor = System.Drawing.Color.FromArgb(((System.Byte)(181)), ((System.Byte)(193)), ((System.Byte)(196))); - this.ActiveTabTextColor = System.Drawing.Color.Black; - this.ActiveTabTopColor = System.Drawing.Color.FromArgb(((System.Byte)(230)), ((System.Byte)(234)), ((System.Byte)(238))); - this.AlertControlColor = System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(255)), ((System.Byte)(194))); - this.BoldApplicationFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold); - this.BorderColor = System.Drawing.Color.FromArgb(((System.Byte)(157)), ((System.Byte)(161)), ((System.Byte)(167))); - this.DisplayName = "Sterling"; - this.InactiveSelectionColor = System.Drawing.Color.FromArgb(((System.Byte)(208)), ((System.Byte)(212)), ((System.Byte)(220))); - this.InactiveTabBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(192)), ((System.Byte)(194)), ((System.Byte)(202))); - this.InactiveTabHighlightColor = System.Drawing.Color.FromArgb(((System.Byte)(243)), ((System.Byte)(243)), ((System.Byte)(243))); - this.InactiveTabLowlightColor = System.Drawing.Color.FromArgb(((System.Byte)(189)), ((System.Byte)(189)), ((System.Byte)(189))); - this.InactiveTabTextColor = System.Drawing.Color.Black; - this.InactiveTabTopColor = System.Drawing.Color.FromArgb(((System.Byte)(205)), ((System.Byte)(206)), ((System.Byte)(215))); - this.ItalicApplicationFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Italic); - this.LinkApplicationFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Underline); - this.MenuBitmapAreaColor = System.Drawing.Color.FromArgb(((System.Byte)(193)), ((System.Byte)(198)), ((System.Byte)(203))); - this.MenuSelectionColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(157)), ((System.Byte)(161)), ((System.Byte)(167))); - this.NormalApplicationFont = new System.Drawing.Font("Tahoma", 8.25F); - this.PrimaryWorkspaceBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(193)), ((System.Byte)(198)), ((System.Byte)(203))); - this.PrimaryWorkspaceCommandBarBottomBevelFirstLineColor = System.Drawing.Color.FromArgb(((System.Byte)(157)), ((System.Byte)(161)), ((System.Byte)(167))); - this.PrimaryWorkspaceCommandBarBottomBevelSecondLineColor = System.Drawing.Color.FromArgb(((System.Byte)(211)), ((System.Byte)(215)), ((System.Byte)(219))); - this.PrimaryWorkspaceCommandBarBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(191)), ((System.Byte)(199)), ((System.Byte)(206))); - this.PrimaryWorkspaceCommandBarBottomLayoutMargin = 3; - this.PrimaryWorkspaceCommandBarDisabledTextColor = System.Drawing.Color.Gray; - this.PrimaryWorkspaceCommandBarLeftLayoutMargin = 2; - this.PrimaryWorkspaceCommandBarRightLayoutMargin = 2; - this.PrimaryWorkspaceCommandBarSeparatorLayoutMargin = 2; - this.PrimaryWorkspaceCommandBarTextColor = System.Drawing.Color.Black; - this.PrimaryWorkspaceCommandBarTopBevelFirstLineColor = System.Drawing.Color.Transparent; - this.PrimaryWorkspaceCommandBarTopBevelSecondLineColor = System.Drawing.Color.Transparent; - this.PrimaryWorkspaceCommandBarTopColor = System.Drawing.Color.FromArgb(((System.Byte)(223)), ((System.Byte)(228)), ((System.Byte)(234))); - this.PrimaryWorkspaceCommandBarTopLayoutMargin = 2; - this.PrimaryWorkspaceTopColor = System.Drawing.Color.FromArgb(((System.Byte)(193)), ((System.Byte)(198)), ((System.Byte)(203))); - this.SecondaryWorkspaceBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(217)), ((System.Byte)(222)), ((System.Byte)(227))); - this.SecondaryWorkspaceTopColor = System.Drawing.Color.FromArgb(((System.Byte)(217)), ((System.Byte)(222)), ((System.Byte)(227))); - this.SmallApplicationFont = new System.Drawing.Font("Tahoma", 6.75F); - this.ToolWindowBackgroundColor = System.Drawing.Color.FromArgb(((System.Byte)(94)), ((System.Byte)(131)), ((System.Byte)(200))); - this.ToolWindowBorderColor = System.Drawing.Color.FromArgb(((System.Byte)(72)), ((System.Byte)(100)), ((System.Byte)(165))); - this.ToolWindowTitleBarBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(94)), ((System.Byte)(131)), ((System.Byte)(200))); - this.ToolWindowTitleBarFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.ToolWindowTitleBarTextColor = System.Drawing.Color.White; - this.ToolWindowTitleBarTopColor = System.Drawing.Color.FromArgb(((System.Byte)(126)), ((System.Byte)(166)), ((System.Byte)(237))); - this.WindowColor = System.Drawing.Color.White; - this.WorkspacePaneControlColor = System.Drawing.Color.FromArgb(((System.Byte)(237)), ((System.Byte)(240)), ((System.Byte)(243))); + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // ApplicationStyleSterling + // + this.ActiveSelectionColor = System.Drawing.Color.FromArgb(((System.Byte)(146)), ((System.Byte)(155)), ((System.Byte)(174))); + this.ActiveTabBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(219)), ((System.Byte)(224)), ((System.Byte)(229))); + this.ActiveTabHighlightColor = System.Drawing.Color.FromArgb(((System.Byte)(243)), ((System.Byte)(243)), ((System.Byte)(243))); + this.ActiveTabLowlightColor = System.Drawing.Color.FromArgb(((System.Byte)(181)), ((System.Byte)(193)), ((System.Byte)(196))); + this.ActiveTabTextColor = System.Drawing.Color.Black; + this.ActiveTabTopColor = System.Drawing.Color.FromArgb(((System.Byte)(230)), ((System.Byte)(234)), ((System.Byte)(238))); + this.AlertControlColor = System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(255)), ((System.Byte)(194))); + this.BoldApplicationFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold); + this.BorderColor = System.Drawing.Color.FromArgb(((System.Byte)(157)), ((System.Byte)(161)), ((System.Byte)(167))); + this.DisplayName = "Sterling"; + this.InactiveSelectionColor = System.Drawing.Color.FromArgb(((System.Byte)(208)), ((System.Byte)(212)), ((System.Byte)(220))); + this.InactiveTabBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(192)), ((System.Byte)(194)), ((System.Byte)(202))); + this.InactiveTabHighlightColor = System.Drawing.Color.FromArgb(((System.Byte)(243)), ((System.Byte)(243)), ((System.Byte)(243))); + this.InactiveTabLowlightColor = System.Drawing.Color.FromArgb(((System.Byte)(189)), ((System.Byte)(189)), ((System.Byte)(189))); + this.InactiveTabTextColor = System.Drawing.Color.Black; + this.InactiveTabTopColor = System.Drawing.Color.FromArgb(((System.Byte)(205)), ((System.Byte)(206)), ((System.Byte)(215))); + this.ItalicApplicationFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Italic); + this.LinkApplicationFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Underline); + this.MenuBitmapAreaColor = System.Drawing.Color.FromArgb(((System.Byte)(193)), ((System.Byte)(198)), ((System.Byte)(203))); + this.MenuSelectionColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(157)), ((System.Byte)(161)), ((System.Byte)(167))); + this.NormalApplicationFont = new System.Drawing.Font("Tahoma", 8.25F); + this.PrimaryWorkspaceBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(193)), ((System.Byte)(198)), ((System.Byte)(203))); + this.PrimaryWorkspaceCommandBarBottomBevelFirstLineColor = System.Drawing.Color.FromArgb(((System.Byte)(157)), ((System.Byte)(161)), ((System.Byte)(167))); + this.PrimaryWorkspaceCommandBarBottomBevelSecondLineColor = System.Drawing.Color.FromArgb(((System.Byte)(211)), ((System.Byte)(215)), ((System.Byte)(219))); + this.PrimaryWorkspaceCommandBarBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(191)), ((System.Byte)(199)), ((System.Byte)(206))); + this.PrimaryWorkspaceCommandBarBottomLayoutMargin = 3; + this.PrimaryWorkspaceCommandBarDisabledTextColor = System.Drawing.Color.Gray; + this.PrimaryWorkspaceCommandBarLeftLayoutMargin = 2; + this.PrimaryWorkspaceCommandBarRightLayoutMargin = 2; + this.PrimaryWorkspaceCommandBarSeparatorLayoutMargin = 2; + this.PrimaryWorkspaceCommandBarTextColor = System.Drawing.Color.Black; + this.PrimaryWorkspaceCommandBarTopBevelFirstLineColor = System.Drawing.Color.Transparent; + this.PrimaryWorkspaceCommandBarTopBevelSecondLineColor = System.Drawing.Color.Transparent; + this.PrimaryWorkspaceCommandBarTopColor = System.Drawing.Color.FromArgb(((System.Byte)(223)), ((System.Byte)(228)), ((System.Byte)(234))); + this.PrimaryWorkspaceCommandBarTopLayoutMargin = 2; + this.PrimaryWorkspaceTopColor = System.Drawing.Color.FromArgb(((System.Byte)(193)), ((System.Byte)(198)), ((System.Byte)(203))); + this.SecondaryWorkspaceBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(217)), ((System.Byte)(222)), ((System.Byte)(227))); + this.SecondaryWorkspaceTopColor = System.Drawing.Color.FromArgb(((System.Byte)(217)), ((System.Byte)(222)), ((System.Byte)(227))); + this.SmallApplicationFont = new System.Drawing.Font("Tahoma", 6.75F); + this.ToolWindowBackgroundColor = System.Drawing.Color.FromArgb(((System.Byte)(94)), ((System.Byte)(131)), ((System.Byte)(200))); + this.ToolWindowBorderColor = System.Drawing.Color.FromArgb(((System.Byte)(72)), ((System.Byte)(100)), ((System.Byte)(165))); + this.ToolWindowTitleBarBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(94)), ((System.Byte)(131)), ((System.Byte)(200))); + this.ToolWindowTitleBarFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); + this.ToolWindowTitleBarTextColor = System.Drawing.Color.White; + this.ToolWindowTitleBarTopColor = System.Drawing.Color.FromArgb(((System.Byte)(126)), ((System.Byte)(166)), ((System.Byte)(237))); + this.WindowColor = System.Drawing.Color.White; + this.WorkspacePaneControlColor = System.Drawing.Color.FromArgb(((System.Byte)(237)), ((System.Byte)(240)), ((System.Byte)(243))); - } - #endregion + } + #endregion - /// - /// Gets or sets the preview image of the ApplicationStyle. - /// - public override Image PreviewImage - { - get - { - return ResourceHelper.LoadAssemblyResourceBitmap("ApplicationStyles.Images.Sterling.png"); - } - } - } + /// + /// Gets or sets the preview image of the ApplicationStyle. + /// + public override Image PreviewImage + { + get + { + return ResourceHelper.LoadAssemblyResourceBitmap("ApplicationStyles.Images.Sterling.png"); + } + } + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationStyles/ApplicationStyleWintergreen.cs b/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationStyles/ApplicationStyleWintergreen.cs index 2c4e359b..8f596be3 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationStyles/ApplicationStyleWintergreen.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationStyles/ApplicationStyleWintergreen.cs @@ -7,104 +7,104 @@ using OpenLiveWriter.CoreServices; namespace OpenLiveWriter.ApplicationFramework.ApplicationStyles { - public class ApplicationStyleWintergreen : ApplicationStyle - { - /// - /// Required designer variable. - /// - private Container components = null; + public class ApplicationStyleWintergreen : ApplicationStyle + { + /// + /// Required designer variable. + /// + private Container components = null; - public ApplicationStyleWintergreen() - { - // This call is required by the Windows.Forms Form Designer. - InitializeComponent(); - } + public ApplicationStyleWintergreen() + { + // This call is required by the Windows.Forms Form Designer. + InitializeComponent(); + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // ApplicationStyleWintergreen - // - this.ActiveSelectionColor = System.Drawing.Color.FromArgb(((System.Byte)(127)), ((System.Byte)(168)), ((System.Byte)(163))); - this.ActiveTabBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(193)), ((System.Byte)(234)), ((System.Byte)(228))); - this.ActiveTabHighlightColor = System.Drawing.Color.FromArgb(((System.Byte)(243)), ((System.Byte)(243)), ((System.Byte)(243))); - this.ActiveTabLowlightColor = System.Drawing.Color.FromArgb(((System.Byte)(181)), ((System.Byte)(193)), ((System.Byte)(196))); - this.ActiveTabTextColor = System.Drawing.Color.Black; - this.ActiveTabTopColor = System.Drawing.Color.FromArgb(((System.Byte)(201)), ((System.Byte)(238)), ((System.Byte)(231))); - this.AlertControlColor = System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(255)), ((System.Byte)(194))); - this.BoldApplicationFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold); - this.BorderColor = System.Drawing.Color.FromArgb(((System.Byte)(127)), ((System.Byte)(168)), ((System.Byte)(163))); - this.DisplayName = "Wintergreen"; - this.InactiveSelectionColor = System.Drawing.Color.FromArgb(((System.Byte)(204)), ((System.Byte)(224)), ((System.Byte)(221))); - this.InactiveTabBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(198)), ((System.Byte)(215)), ((System.Byte)(212))); - this.InactiveTabHighlightColor = System.Drawing.Color.FromArgb(((System.Byte)(243)), ((System.Byte)(243)), ((System.Byte)(243))); - this.InactiveTabLowlightColor = System.Drawing.Color.FromArgb(((System.Byte)(189)), ((System.Byte)(189)), ((System.Byte)(189))); - this.InactiveTabTextColor = System.Drawing.Color.Black; - this.InactiveTabTopColor = System.Drawing.Color.FromArgb(((System.Byte)(202)), ((System.Byte)(217)), ((System.Byte)(215))); - this.ItalicApplicationFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Italic); - this.LinkApplicationFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Underline); - this.MenuBitmapAreaColor = System.Drawing.Color.FromArgb(((System.Byte)(197)), ((System.Byte)(236)), ((System.Byte)(230))); - this.MenuSelectionColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(127)), ((System.Byte)(168)), ((System.Byte)(163))); - this.NormalApplicationFont = new System.Drawing.Font("Tahoma", 8.25F); - this.PrimaryWorkspaceBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(164)), ((System.Byte)(203)), ((System.Byte)(197))); - this.PrimaryWorkspaceCommandBarBottomBevelFirstLineColor = System.Drawing.Color.FromArgb(((System.Byte)(127)), ((System.Byte)(168)), ((System.Byte)(163))); - this.PrimaryWorkspaceCommandBarBottomBevelSecondLineColor = System.Drawing.Color.FromArgb(((System.Byte)(175)), ((System.Byte)(213)), ((System.Byte)(205))); - this.PrimaryWorkspaceCommandBarBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(164)), ((System.Byte)(212)), ((System.Byte)(204))); - this.PrimaryWorkspaceCommandBarBottomLayoutMargin = 3; - this.PrimaryWorkspaceCommandBarDisabledTextColor = System.Drawing.Color.Gray; - this.PrimaryWorkspaceCommandBarLeftLayoutMargin = 2; - this.PrimaryWorkspaceCommandBarRightLayoutMargin = 2; - this.PrimaryWorkspaceCommandBarSeparatorLayoutMargin = 2; - this.PrimaryWorkspaceCommandBarTextColor = System.Drawing.Color.Black; - this.PrimaryWorkspaceCommandBarTopBevelFirstLineColor = System.Drawing.Color.Transparent; - this.PrimaryWorkspaceCommandBarTopBevelSecondLineColor = System.Drawing.Color.Transparent; - this.PrimaryWorkspaceCommandBarTopColor = System.Drawing.Color.FromArgb(((System.Byte)(201)), ((System.Byte)(238)), ((System.Byte)(231))); - this.PrimaryWorkspaceCommandBarTopLayoutMargin = 2; - this.PrimaryWorkspaceTopColor = System.Drawing.Color.FromArgb(((System.Byte)(164)), ((System.Byte)(203)), ((System.Byte)(197))); - this.SecondaryWorkspaceBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(193)), ((System.Byte)(234)), ((System.Byte)(228))); - this.SecondaryWorkspaceTopColor = System.Drawing.Color.FromArgb(((System.Byte)(193)), ((System.Byte)(234)), ((System.Byte)(228))); - this.SmallApplicationFont = new System.Drawing.Font("Tahoma", 6.75F); - this.ToolWindowBackgroundColor = System.Drawing.Color.FromArgb(((System.Byte)(94)), ((System.Byte)(131)), ((System.Byte)(200))); - this.ToolWindowBorderColor = System.Drawing.Color.FromArgb(((System.Byte)(72)), ((System.Byte)(100)), ((System.Byte)(165))); - this.ToolWindowTitleBarBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(94)), ((System.Byte)(131)), ((System.Byte)(200))); - this.ToolWindowTitleBarFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.ToolWindowTitleBarTextColor = System.Drawing.Color.White; - this.ToolWindowTitleBarTopColor = System.Drawing.Color.FromArgb(((System.Byte)(126)), ((System.Byte)(166)), ((System.Byte)(237))); - this.WindowColor = System.Drawing.Color.White; - this.WorkspacePaneControlColor = System.Drawing.Color.FromArgb(((System.Byte)(204)), ((System.Byte)(224)), ((System.Byte)(221))); + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // ApplicationStyleWintergreen + // + this.ActiveSelectionColor = System.Drawing.Color.FromArgb(((System.Byte)(127)), ((System.Byte)(168)), ((System.Byte)(163))); + this.ActiveTabBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(193)), ((System.Byte)(234)), ((System.Byte)(228))); + this.ActiveTabHighlightColor = System.Drawing.Color.FromArgb(((System.Byte)(243)), ((System.Byte)(243)), ((System.Byte)(243))); + this.ActiveTabLowlightColor = System.Drawing.Color.FromArgb(((System.Byte)(181)), ((System.Byte)(193)), ((System.Byte)(196))); + this.ActiveTabTextColor = System.Drawing.Color.Black; + this.ActiveTabTopColor = System.Drawing.Color.FromArgb(((System.Byte)(201)), ((System.Byte)(238)), ((System.Byte)(231))); + this.AlertControlColor = System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(255)), ((System.Byte)(194))); + this.BoldApplicationFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold); + this.BorderColor = System.Drawing.Color.FromArgb(((System.Byte)(127)), ((System.Byte)(168)), ((System.Byte)(163))); + this.DisplayName = "Wintergreen"; + this.InactiveSelectionColor = System.Drawing.Color.FromArgb(((System.Byte)(204)), ((System.Byte)(224)), ((System.Byte)(221))); + this.InactiveTabBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(198)), ((System.Byte)(215)), ((System.Byte)(212))); + this.InactiveTabHighlightColor = System.Drawing.Color.FromArgb(((System.Byte)(243)), ((System.Byte)(243)), ((System.Byte)(243))); + this.InactiveTabLowlightColor = System.Drawing.Color.FromArgb(((System.Byte)(189)), ((System.Byte)(189)), ((System.Byte)(189))); + this.InactiveTabTextColor = System.Drawing.Color.Black; + this.InactiveTabTopColor = System.Drawing.Color.FromArgb(((System.Byte)(202)), ((System.Byte)(217)), ((System.Byte)(215))); + this.ItalicApplicationFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Italic); + this.LinkApplicationFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Underline); + this.MenuBitmapAreaColor = System.Drawing.Color.FromArgb(((System.Byte)(197)), ((System.Byte)(236)), ((System.Byte)(230))); + this.MenuSelectionColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(127)), ((System.Byte)(168)), ((System.Byte)(163))); + this.NormalApplicationFont = new System.Drawing.Font("Tahoma", 8.25F); + this.PrimaryWorkspaceBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(164)), ((System.Byte)(203)), ((System.Byte)(197))); + this.PrimaryWorkspaceCommandBarBottomBevelFirstLineColor = System.Drawing.Color.FromArgb(((System.Byte)(127)), ((System.Byte)(168)), ((System.Byte)(163))); + this.PrimaryWorkspaceCommandBarBottomBevelSecondLineColor = System.Drawing.Color.FromArgb(((System.Byte)(175)), ((System.Byte)(213)), ((System.Byte)(205))); + this.PrimaryWorkspaceCommandBarBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(164)), ((System.Byte)(212)), ((System.Byte)(204))); + this.PrimaryWorkspaceCommandBarBottomLayoutMargin = 3; + this.PrimaryWorkspaceCommandBarDisabledTextColor = System.Drawing.Color.Gray; + this.PrimaryWorkspaceCommandBarLeftLayoutMargin = 2; + this.PrimaryWorkspaceCommandBarRightLayoutMargin = 2; + this.PrimaryWorkspaceCommandBarSeparatorLayoutMargin = 2; + this.PrimaryWorkspaceCommandBarTextColor = System.Drawing.Color.Black; + this.PrimaryWorkspaceCommandBarTopBevelFirstLineColor = System.Drawing.Color.Transparent; + this.PrimaryWorkspaceCommandBarTopBevelSecondLineColor = System.Drawing.Color.Transparent; + this.PrimaryWorkspaceCommandBarTopColor = System.Drawing.Color.FromArgb(((System.Byte)(201)), ((System.Byte)(238)), ((System.Byte)(231))); + this.PrimaryWorkspaceCommandBarTopLayoutMargin = 2; + this.PrimaryWorkspaceTopColor = System.Drawing.Color.FromArgb(((System.Byte)(164)), ((System.Byte)(203)), ((System.Byte)(197))); + this.SecondaryWorkspaceBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(193)), ((System.Byte)(234)), ((System.Byte)(228))); + this.SecondaryWorkspaceTopColor = System.Drawing.Color.FromArgb(((System.Byte)(193)), ((System.Byte)(234)), ((System.Byte)(228))); + this.SmallApplicationFont = new System.Drawing.Font("Tahoma", 6.75F); + this.ToolWindowBackgroundColor = System.Drawing.Color.FromArgb(((System.Byte)(94)), ((System.Byte)(131)), ((System.Byte)(200))); + this.ToolWindowBorderColor = System.Drawing.Color.FromArgb(((System.Byte)(72)), ((System.Byte)(100)), ((System.Byte)(165))); + this.ToolWindowTitleBarBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(94)), ((System.Byte)(131)), ((System.Byte)(200))); + this.ToolWindowTitleBarFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); + this.ToolWindowTitleBarTextColor = System.Drawing.Color.White; + this.ToolWindowTitleBarTopColor = System.Drawing.Color.FromArgb(((System.Byte)(126)), ((System.Byte)(166)), ((System.Byte)(237))); + this.WindowColor = System.Drawing.Color.White; + this.WorkspacePaneControlColor = System.Drawing.Color.FromArgb(((System.Byte)(204)), ((System.Byte)(224)), ((System.Byte)(221))); - } - #endregion + } + #endregion - /// - /// Gets or sets the preview image of the ApplicationStyle. - /// - public override Image PreviewImage - { - get - { - return ResourceHelper.LoadAssemblyResourceBitmap("ApplicationStyles.Images.Wintergreen.png"); - } - } - } + /// + /// Gets or sets the preview image of the ApplicationStyle. + /// + public override Image PreviewImage + { + get + { + return ResourceHelper.LoadAssemblyResourceBitmap("ApplicationStyles.Images.Wintergreen.png"); + } + } + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationWorkspace.cs b/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationWorkspace.cs index 35aed1e2..9f87635e 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationWorkspace.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationWorkspace.cs @@ -13,618 +13,618 @@ using Project31.CoreServices; namespace Project31.ApplicationFramework { - /// - /// The ApplicationWorkspace control provides a multi-pane workspace. - /// - public class ApplicationWorkspace : Project31.Controls.LightweightControlContainerControl - { - /// - /// The default left column preferred width. - /// - private const int LEFT_COLUMN_DEFAULT_PREFERRED_WIDTH = 150; + /// + /// The ApplicationWorkspace control provides a multi-pane workspace. + /// + public class ApplicationWorkspace : Project31.Controls.LightweightControlContainerControl + { + /// + /// The default left column preferred width. + /// + private const int LEFT_COLUMN_DEFAULT_PREFERRED_WIDTH = 150; - /// - /// The default center column preferred width. - /// - private const int CENTER_COLUMN_DEFAULT_PREFERRED_WIDTH = 20; + /// + /// The default center column preferred width. + /// + private const int CENTER_COLUMN_DEFAULT_PREFERRED_WIDTH = 20; - /// - /// The default right column preferred width. - /// - private const int RIGHT_COLUMN_DEFAULT_PREFERRED_WIDTH = 150; + /// + /// The default right column preferred width. + /// + private const int RIGHT_COLUMN_DEFAULT_PREFERRED_WIDTH = 150; - /// - /// The default left column minimum width. - /// - private const int LEFT_COLUMN_DEFAULT_MINIMUM_WIDTH = 10; + /// + /// The default left column minimum width. + /// + private const int LEFT_COLUMN_DEFAULT_MINIMUM_WIDTH = 10; - /// - /// The default center column minimum width. - /// - private const int CENTER_COLUMN_DEFAULT_MINIMUM_WIDTH = 10; + /// + /// The default center column minimum width. + /// + private const int CENTER_COLUMN_DEFAULT_MINIMUM_WIDTH = 10; - /// - /// The default right column minimum width. - /// - private const int RIGHT_COLUMN_DEFAULT_MINIMUM_WIDTH = 10; + /// + /// The default right column minimum width. + /// + private const int RIGHT_COLUMN_DEFAULT_MINIMUM_WIDTH = 10; - /// - /// Required designer cruft. - /// - private System.ComponentModel.IContainer components = null; + /// + /// Required designer cruft. + /// + private System.ComponentModel.IContainer components = null; - /// - /// The column layout margin. - /// - private Size columnLayoutMargin = new Size(5, 5); + /// + /// The column layout margin. + /// + private Size columnLayoutMargin = new Size(5, 5); - /// - /// Gets or sets the column layout margin. - /// - [ - Category("Appearance"), - DefaultValue(typeof(Size), "5, 5"), - Description("Specifies the column layout margin.") - ] - public Size ColumnLayoutMargin - { - get - { - return columnLayoutMargin; - } - set - { - columnLayoutMargin = value; - } - } + /// + /// Gets or sets the column layout margin. + /// + [ + Category("Appearance"), + DefaultValue(typeof(Size), "5, 5"), + Description("Specifies the column layout margin.") + ] + public Size ColumnLayoutMargin + { + get + { + return columnLayoutMargin; + } + set + { + columnLayoutMargin = value; + } + } - /// - /// Gets or sets the command bar definition. - /// - public CommandBarDefinition CommandBarDefinition - { - get - { - return applicationCommandBarLightweightControl.CommandBarDefinition; - } - set - { - applicationCommandBarLightweightControl.CommandBarDefinition = value; - PerformLayout(); - Invalidate(); - } - } + /// + /// Gets or sets the command bar definition. + /// + public CommandBarDefinition CommandBarDefinition + { + get + { + return applicationCommandBarLightweightControl.CommandBarDefinition; + } + set + { + applicationCommandBarLightweightControl.CommandBarDefinition = value; + PerformLayout(); + Invalidate(); + } + } - /// - /// The application workspace command bar lightweight control. - /// - private Project31.ApplicationFramework.ApplicationWorkspaceCommandBarLightweightControl applicationCommandBarLightweightControl; + /// + /// The application workspace command bar lightweight control. + /// + private Project31.ApplicationFramework.ApplicationWorkspaceCommandBarLightweightControl applicationCommandBarLightweightControl; - /// - /// The left ApplicationWorkspaceColumnLightweightControl. - /// - private Project31.ApplicationFramework.ApplicationWorkspaceColumnLightweightControl leftColumn; + /// + /// The left ApplicationWorkspaceColumnLightweightControl. + /// + private Project31.ApplicationFramework.ApplicationWorkspaceColumnLightweightControl leftColumn; - /// - /// Gets the left ApplicationWorkspaceColumnLightweightControl. - /// - public ApplicationWorkspaceColumnLightweightControl LeftColumn - { - get - { - return leftColumn; - } - } + /// + /// Gets the left ApplicationWorkspaceColumnLightweightControl. + /// + public ApplicationWorkspaceColumnLightweightControl LeftColumn + { + get + { + return leftColumn; + } + } - /// - /// The center ApplicationWorkspaceColumnLightweightControl. - /// - private Project31.ApplicationFramework.ApplicationWorkspaceColumnLightweightControl centerColumn; + /// + /// The center ApplicationWorkspaceColumnLightweightControl. + /// + private Project31.ApplicationFramework.ApplicationWorkspaceColumnLightweightControl centerColumn; - /// - /// Gets the center ApplicationWorkspaceColumnLightweightControl. - /// - public ApplicationWorkspaceColumnLightweightControl CenterColumn - { - get - { - return centerColumn; - } - } + /// + /// Gets the center ApplicationWorkspaceColumnLightweightControl. + /// + public ApplicationWorkspaceColumnLightweightControl CenterColumn + { + get + { + return centerColumn; + } + } - /// - /// The right ApplicationWorkspaceColumnLightweightControl. - /// - private Project31.ApplicationFramework.ApplicationWorkspaceColumnLightweightControl rightColumn; + /// + /// The right ApplicationWorkspaceColumnLightweightControl. + /// + private Project31.ApplicationFramework.ApplicationWorkspaceColumnLightweightControl rightColumn; - /// - /// Gets the right ApplicationWorkspaceColumnLightweightControl. - /// - public ApplicationWorkspaceColumnLightweightControl RightColumn - { - get - { - return rightColumn; - } - } + /// + /// Gets the right ApplicationWorkspaceColumnLightweightControl. + /// + public ApplicationWorkspaceColumnLightweightControl RightColumn + { + get + { + return rightColumn; + } + } - /// - /// Initializes a new instance of the ApplicationWorkspace class. - /// - public ApplicationWorkspace() - { - // This call is required by the Windows Form Designer. - InitializeComponent(); + /// + /// Initializes a new instance of the ApplicationWorkspace class. + /// + public ApplicationWorkspace() + { + // This call is required by the Windows Form Designer. + InitializeComponent(); - // Turn on double buffered painting. - SetStyle(ControlStyles.UserPaint, true); - SetStyle(ControlStyles.DoubleBuffer, true); - SetStyle(ControlStyles.AllPaintingInWmPaint, true); - } + // Turn on double buffered painting. + SetStyle(ControlStyles.UserPaint, true); + SetStyle(ControlStyles.DoubleBuffer, true); + SetStyle(ControlStyles.AllPaintingInWmPaint, true); + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if (components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if (components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - this.applicationCommandBarLightweightControl = new Project31.ApplicationFramework.ApplicationWorkspaceCommandBarLightweightControl(this.components); - this.leftColumn = new Project31.ApplicationFramework.ApplicationWorkspaceColumnLightweightControl(); - this.centerColumn = new Project31.ApplicationFramework.ApplicationWorkspaceColumnLightweightControl(); - this.rightColumn = new Project31.ApplicationFramework.ApplicationWorkspaceColumnLightweightControl(); - ((System.ComponentModel.ISupportInitialize)(this.applicationCommandBarLightweightControl)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.leftColumn)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.centerColumn)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.rightColumn)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this)).BeginInit(); - // - // applicationCommandBarLightweightControl - // - this.applicationCommandBarLightweightControl.LayoutMargin = new System.Drawing.Size(2, 2); - this.applicationCommandBarLightweightControl.LightweightControlContainerControl = this; - this.applicationCommandBarLightweightControl.Visible = false; - // - // leftColumn - // - this.leftColumn.LightweightControlContainerControl = this; - this.leftColumn.MinimumColumnWidth = 30; - this.leftColumn.PreferredColumnWidth = 150; - this.leftColumn.MaximumColumnWidthChanged += new System.EventHandler(this.leftColumn_MaximumColumnWidthChanged); - this.leftColumn.PreferredColumnWidthChanged += new System.EventHandler(this.leftColumn_PreferredColumnWidthChanged); - this.leftColumn.MinimumColumnWidthChanged += new System.EventHandler(this.leftColumn_MinimumColumnWidthChanged); - // - // centerColumn - // - this.centerColumn.LightweightControlContainerControl = this; - this.centerColumn.MinimumColumnWidth = 30; - this.centerColumn.PreferredColumnWidth = 30; - // - // rightColumn - // - this.rightColumn.LightweightControlContainerControl = this; - this.rightColumn.MinimumColumnWidth = 30; - this.rightColumn.PreferredColumnWidth = 150; - this.rightColumn.MaximumColumnWidthChanged += new System.EventHandler(this.rightColumn_MaximumColumnWidthChanged); - this.rightColumn.PreferredColumnWidthChanged += new System.EventHandler(this.rightColumn_PreferredColumnWidthChanged); - this.rightColumn.MinimumColumnWidthChanged += new System.EventHandler(this.rightColumn_MinimumColumnWidthChanged); - // - // ApplicationWorkspace - // - this.BackColor = System.Drawing.SystemColors.Control; - this.Name = "ApplicationWorkspace"; - this.Size = new System.Drawing.Size(294, 286); - ((System.ComponentModel.ISupportInitialize)(this.applicationCommandBarLightweightControl)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.leftColumn)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.centerColumn)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.rightColumn)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this)).EndInit(); + #region Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.applicationCommandBarLightweightControl = new Project31.ApplicationFramework.ApplicationWorkspaceCommandBarLightweightControl(this.components); + this.leftColumn = new Project31.ApplicationFramework.ApplicationWorkspaceColumnLightweightControl(); + this.centerColumn = new Project31.ApplicationFramework.ApplicationWorkspaceColumnLightweightControl(); + this.rightColumn = new Project31.ApplicationFramework.ApplicationWorkspaceColumnLightweightControl(); + ((System.ComponentModel.ISupportInitialize)(this.applicationCommandBarLightweightControl)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.leftColumn)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.centerColumn)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.rightColumn)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this)).BeginInit(); + // + // applicationCommandBarLightweightControl + // + this.applicationCommandBarLightweightControl.LayoutMargin = new System.Drawing.Size(2, 2); + this.applicationCommandBarLightweightControl.LightweightControlContainerControl = this; + this.applicationCommandBarLightweightControl.Visible = false; + // + // leftColumn + // + this.leftColumn.LightweightControlContainerControl = this; + this.leftColumn.MinimumColumnWidth = 30; + this.leftColumn.PreferredColumnWidth = 150; + this.leftColumn.MaximumColumnWidthChanged += new System.EventHandler(this.leftColumn_MaximumColumnWidthChanged); + this.leftColumn.PreferredColumnWidthChanged += new System.EventHandler(this.leftColumn_PreferredColumnWidthChanged); + this.leftColumn.MinimumColumnWidthChanged += new System.EventHandler(this.leftColumn_MinimumColumnWidthChanged); + // + // centerColumn + // + this.centerColumn.LightweightControlContainerControl = this; + this.centerColumn.MinimumColumnWidth = 30; + this.centerColumn.PreferredColumnWidth = 30; + // + // rightColumn + // + this.rightColumn.LightweightControlContainerControl = this; + this.rightColumn.MinimumColumnWidth = 30; + this.rightColumn.PreferredColumnWidth = 150; + this.rightColumn.MaximumColumnWidthChanged += new System.EventHandler(this.rightColumn_MaximumColumnWidthChanged); + this.rightColumn.PreferredColumnWidthChanged += new System.EventHandler(this.rightColumn_PreferredColumnWidthChanged); + this.rightColumn.MinimumColumnWidthChanged += new System.EventHandler(this.rightColumn_MinimumColumnWidthChanged); + // + // ApplicationWorkspace + // + this.BackColor = System.Drawing.SystemColors.Control; + this.Name = "ApplicationWorkspace"; + this.Size = new System.Drawing.Size(294, 286); + ((System.ComponentModel.ISupportInitialize)(this.applicationCommandBarLightweightControl)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.leftColumn)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.centerColumn)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.rightColumn)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this)).EndInit(); - } - #endregion + } + #endregion - /// - /// Raises the Layout event. - /// - /// A PaintEventArgs that contains the event data. - protected override void OnLayout(LayoutEventArgs e) - { - // Call the base class's method so that registered delegates receive the event. - base.OnLayout(e); + /// + /// Raises the Layout event. + /// + /// A PaintEventArgs that contains the event data. + protected override void OnLayout(LayoutEventArgs e) + { + // Call the base class's method so that registered delegates receive the event. + base.OnLayout(e); - // Layout the application command bar lightweight control. The return is the column - // layout rectangle. - Rectangle columnLayoutRectangle = LayoutApplicationCommandBarLightweightControl(); + // Layout the application command bar lightweight control. The return is the column + // layout rectangle. + Rectangle columnLayoutRectangle = LayoutApplicationCommandBarLightweightControl(); - // Set the initial (to be adjusted below) column widths. - int leftColumnWidth = LeftColumnPreferredWidth; - int centerColumnWidth = CenterColumnMinimumWidth; - int rightColumnWidth = RightColumnPreferredWidth; + // Set the initial (to be adjusted below) column widths. + int leftColumnWidth = LeftColumnPreferredWidth; + int centerColumnWidth = CenterColumnMinimumWidth; + int rightColumnWidth = RightColumnPreferredWidth; - // Adjust the column widths as needed for the layout width. - if (leftColumnWidth+centerColumnWidth+rightColumnWidth > columnLayoutRectangle.Width) - { - // Calculate the width that is available to the left and right columns. - int availableWidth = columnLayoutRectangle.Width-centerColumnWidth; + // Adjust the column widths as needed for the layout width. + if (leftColumnWidth+centerColumnWidth+rightColumnWidth > columnLayoutRectangle.Width) + { + // Calculate the width that is available to the left and right columns. + int availableWidth = columnLayoutRectangle.Width-centerColumnWidth; - // Adjust the left and right column widths. - if (LeftColumnVisible && RightColumnVisible) - { - // Calculate the relative width of the left column. - double leftColumnRelativeWidth = ((double)leftColumnWidth)/(leftColumnWidth+rightColumnWidth); + // Adjust the left and right column widths. + if (LeftColumnVisible && RightColumnVisible) + { + // Calculate the relative width of the left column. + double leftColumnRelativeWidth = ((double)leftColumnWidth)/(leftColumnWidth+rightColumnWidth); - // Adjust the left and right column widths. - leftColumnWidth = Math.Max((int)(leftColumnRelativeWidth*availableWidth), LeftColumnMinimumWidth); - rightColumnWidth = Math.Max(availableWidth-leftColumnWidth, RightColumnMinimumWidth); - } - else if (LeftColumnVisible) - { - // Only the left column is visible, so it gets all the available width. - leftColumnWidth = Math.Max(availableWidth, LeftColumnMinimumWidth); - } - else if (RightColumnVisible) - { - // Only the right column is visible, so it gets all the available width. - rightColumnWidth = Math.Max(availableWidth, RightColumnMinimumWidth); - } - } - else - { - // We have a surplus of room. Allocate additional space to the center column, if - // if is visible, or the left column if it is not. - if (CenterColumnVisible) - centerColumnWidth = columnLayoutRectangle.Width-(leftColumnWidth+rightColumnWidth); - else - leftColumnWidth = columnLayoutRectangle.Width-rightColumnWidth; - } + // Adjust the left and right column widths. + leftColumnWidth = Math.Max((int)(leftColumnRelativeWidth*availableWidth), LeftColumnMinimumWidth); + rightColumnWidth = Math.Max(availableWidth-leftColumnWidth, RightColumnMinimumWidth); + } + else if (LeftColumnVisible) + { + // Only the left column is visible, so it gets all the available width. + leftColumnWidth = Math.Max(availableWidth, LeftColumnMinimumWidth); + } + else if (RightColumnVisible) + { + // Only the right column is visible, so it gets all the available width. + rightColumnWidth = Math.Max(availableWidth, RightColumnMinimumWidth); + } + } + else + { + // We have a surplus of room. Allocate additional space to the center column, if + // if is visible, or the left column if it is not. + if (CenterColumnVisible) + centerColumnWidth = columnLayoutRectangle.Width-(leftColumnWidth+rightColumnWidth); + else + leftColumnWidth = columnLayoutRectangle.Width-rightColumnWidth; + } - // Set the layout X offset. - int layoutX = columnLayoutRectangle.X; + // Set the layout X offset. + int layoutX = columnLayoutRectangle.X; - // Layout the left column, if it is visible. - if (LeftColumnVisible) - { - // Set the virtual bounds of the left column. - leftColumn.VirtualBounds = new Rectangle( layoutX, - columnLayoutRectangle.Y, - leftColumnWidth, - columnLayoutRectangle.Height); + // Layout the left column, if it is visible. + if (LeftColumnVisible) + { + // Set the virtual bounds of the left column. + leftColumn.VirtualBounds = new Rectangle( layoutX, + columnLayoutRectangle.Y, + leftColumnWidth, + columnLayoutRectangle.Height); - // Adjust the layout X to account for the left column. - layoutX += leftColumnWidth; + // Adjust the layout X to account for the left column. + layoutX += leftColumnWidth; - // Update the left column vertical splitter and maximum column width. - if (CenterColumnVisible) - { - // Turn on the left column vertical splitter on the right side. - leftColumn.VerticalSplitter = VerticalSplitterStyle.Right; + // Update the left column vertical splitter and maximum column width. + if (CenterColumnVisible) + { + // Turn on the left column vertical splitter on the right side. + leftColumn.VerticalSplitter = VerticalSplitterStyle.Right; - // Set the left column's maximum width. - leftColumn.MaximumColumnWidth = columnLayoutRectangle.Width- - (CenterColumnMinimumWidth+this.RightColumnPreferredWidth); - } - else - { - leftColumn.VerticalSplitter = VerticalSplitterStyle.None; - leftColumn.MaximumColumnWidth = 0; - } - } + // Set the left column's maximum width. + leftColumn.MaximumColumnWidth = columnLayoutRectangle.Width- + (CenterColumnMinimumWidth+this.RightColumnPreferredWidth); + } + else + { + leftColumn.VerticalSplitter = VerticalSplitterStyle.None; + leftColumn.MaximumColumnWidth = 0; + } + } - // Layout the center column. - if (CenterColumnVisible) - { - // Set the virtual bounds of the center column. - centerColumn.VirtualBounds = new Rectangle( layoutX, - columnLayoutRectangle.Y, - centerColumnWidth, - columnLayoutRectangle.Height); + // Layout the center column. + if (CenterColumnVisible) + { + // Set the virtual bounds of the center column. + centerColumn.VirtualBounds = new Rectangle( layoutX, + columnLayoutRectangle.Y, + centerColumnWidth, + columnLayoutRectangle.Height); - // Adjust the layout X to account for the center column. - layoutX += centerColumnWidth; + // Adjust the layout X to account for the center column. + layoutX += centerColumnWidth; - // The center column never has a vertical splitter or a maximum column width. - centerColumn.VerticalSplitter = VerticalSplitterStyle.None; - centerColumn.MaximumColumnWidth = 0; - } + // The center column never has a vertical splitter or a maximum column width. + centerColumn.VerticalSplitter = VerticalSplitterStyle.None; + centerColumn.MaximumColumnWidth = 0; + } - // Layout the right column. - if (RightColumnVisible) - { - // Set the virtual bounds of the right column. - rightColumn.VirtualBounds = new Rectangle( layoutX, - columnLayoutRectangle.Y, - rightColumnWidth, - columnLayoutRectangle.Height); + // Layout the right column. + if (RightColumnVisible) + { + // Set the virtual bounds of the right column. + rightColumn.VirtualBounds = new Rectangle( layoutX, + columnLayoutRectangle.Y, + rightColumnWidth, + columnLayoutRectangle.Height); - // Update the right column vertical splitter and maximum column width. - if (CenterColumnVisible || LeftColumnVisible) - { - // Turn on the right column's vertical splitter on the left side. - rightColumn.VerticalSplitter = VerticalSplitterStyle.Left; + // Update the right column vertical splitter and maximum column width. + if (CenterColumnVisible || LeftColumnVisible) + { + // Turn on the right column's vertical splitter on the left side. + rightColumn.VerticalSplitter = VerticalSplitterStyle.Left; - // Set the right column's maximum width. - rightColumn.MaximumColumnWidth = columnLayoutRectangle.Width- - (LeftColumnPreferredWidth+CenterColumnMinimumWidth); - } - else - { - rightColumn.VerticalSplitter = VerticalSplitterStyle.None; - rightColumn.MaximumColumnWidth = 0; - } - } - } + // Set the right column's maximum width. + rightColumn.MaximumColumnWidth = columnLayoutRectangle.Width- + (LeftColumnPreferredWidth+CenterColumnMinimumWidth); + } + else + { + rightColumn.VerticalSplitter = VerticalSplitterStyle.None; + rightColumn.MaximumColumnWidth = 0; + } + } + } - /// - /// Override background painting. - /// - /// Event parameters. - protected override void OnPaintBackground(System.Windows.Forms.PaintEventArgs e) - { - // Fill the background. - using (LinearGradientBrush linearGradientBrush = new LinearGradientBrush(ClientRectangle, ApplicationManager.ApplicationStyle.ApplicationWorkspaceTopColor, ApplicationManager.ApplicationStyle.ApplicationWorkspaceBottomColor, LinearGradientMode.ForwardDiagonal)) - e.Graphics.FillRectangle(linearGradientBrush, ClientRectangle); - } + /// + /// Override background painting. + /// + /// Event parameters. + protected override void OnPaintBackground(System.Windows.Forms.PaintEventArgs e) + { + // Fill the background. + using (LinearGradientBrush linearGradientBrush = new LinearGradientBrush(ClientRectangle, ApplicationManager.ApplicationStyle.ApplicationWorkspaceTopColor, ApplicationManager.ApplicationStyle.ApplicationWorkspaceBottomColor, LinearGradientMode.ForwardDiagonal)) + e.Graphics.FillRectangle(linearGradientBrush, ClientRectangle); + } - /// - /// Gets a value indicating whether the left column is visible. - /// - private bool LeftColumnVisible - { - get - { - return leftColumn != null && leftColumn.Visible; - } - } + /// + /// Gets a value indicating whether the left column is visible. + /// + private bool LeftColumnVisible + { + get + { + return leftColumn != null && leftColumn.Visible; + } + } - /// - /// Gets a value indicating whether the center column is visible. - /// - private bool CenterColumnVisible - { - get - { - return centerColumn != null && centerColumn.Visible; - } - } + /// + /// Gets a value indicating whether the center column is visible. + /// + private bool CenterColumnVisible + { + get + { + return centerColumn != null && centerColumn.Visible; + } + } - /// - /// Gets a value indicating whether the right column is visible. - /// - private bool RightColumnVisible - { - get - { - return rightColumn != null && rightColumn.Visible; - } - } + /// + /// Gets a value indicating whether the right column is visible. + /// + private bool RightColumnVisible + { + get + { + return rightColumn != null && rightColumn.Visible; + } + } - /// - /// Gets the preferred width of the left column. - /// - private int LeftColumnPreferredWidth - { - get - { - if (!LeftColumnVisible) - return 0; - else - { - if (leftColumn.PreferredColumnWidth == 0) - leftColumn.PreferredColumnWidth = LEFT_COLUMN_DEFAULT_PREFERRED_WIDTH; - return leftColumn.PreferredColumnWidth; - } - } - } + /// + /// Gets the preferred width of the left column. + /// + private int LeftColumnPreferredWidth + { + get + { + if (!LeftColumnVisible) + return 0; + else + { + if (leftColumn.PreferredColumnWidth == 0) + leftColumn.PreferredColumnWidth = LEFT_COLUMN_DEFAULT_PREFERRED_WIDTH; + return leftColumn.PreferredColumnWidth; + } + } + } - /// - /// Gets the preferred width of the center column. - /// - private int CenterColumnPreferredWidth - { - get - { - if (!CenterColumnVisible) - return 0; - else - { - if (centerColumn.PreferredColumnWidth == 0) - centerColumn.PreferredColumnWidth = CENTER_COLUMN_DEFAULT_PREFERRED_WIDTH; - return centerColumn.PreferredColumnWidth; - } - } - } + /// + /// Gets the preferred width of the center column. + /// + private int CenterColumnPreferredWidth + { + get + { + if (!CenterColumnVisible) + return 0; + else + { + if (centerColumn.PreferredColumnWidth == 0) + centerColumn.PreferredColumnWidth = CENTER_COLUMN_DEFAULT_PREFERRED_WIDTH; + return centerColumn.PreferredColumnWidth; + } + } + } - /// - /// Gets the preferred width of the right column. - /// - private int RightColumnPreferredWidth - { - get - { - if (!RightColumnVisible) - return 0; - else - { - if (rightColumn.PreferredColumnWidth == 0) - rightColumn.PreferredColumnWidth = RIGHT_COLUMN_DEFAULT_PREFERRED_WIDTH; - return rightColumn.PreferredColumnWidth; - } - } - } + /// + /// Gets the preferred width of the right column. + /// + private int RightColumnPreferredWidth + { + get + { + if (!RightColumnVisible) + return 0; + else + { + if (rightColumn.PreferredColumnWidth == 0) + rightColumn.PreferredColumnWidth = RIGHT_COLUMN_DEFAULT_PREFERRED_WIDTH; + return rightColumn.PreferredColumnWidth; + } + } + } - /// - /// Gets the minimum width of the left column. - /// - private int LeftColumnMinimumWidth - { - get - { - if (!LeftColumnVisible) - return 0; - else - { - if (leftColumn.MinimumColumnWidth == 0) - leftColumn.MinimumColumnWidth = LEFT_COLUMN_DEFAULT_MINIMUM_WIDTH; - return leftColumn.MinimumColumnWidth; - } - } - } + /// + /// Gets the minimum width of the left column. + /// + private int LeftColumnMinimumWidth + { + get + { + if (!LeftColumnVisible) + return 0; + else + { + if (leftColumn.MinimumColumnWidth == 0) + leftColumn.MinimumColumnWidth = LEFT_COLUMN_DEFAULT_MINIMUM_WIDTH; + return leftColumn.MinimumColumnWidth; + } + } + } - /// - /// Gets the minimum width of the center column. - /// - private int CenterColumnMinimumWidth - { - get - { - if (!CenterColumnVisible) - return 0; - else - { - if (centerColumn.MinimumColumnWidth == 0) - centerColumn.MinimumColumnWidth = CENTER_COLUMN_DEFAULT_MINIMUM_WIDTH; - return centerColumn.MinimumColumnWidth; - } - } - } + /// + /// Gets the minimum width of the center column. + /// + private int CenterColumnMinimumWidth + { + get + { + if (!CenterColumnVisible) + return 0; + else + { + if (centerColumn.MinimumColumnWidth == 0) + centerColumn.MinimumColumnWidth = CENTER_COLUMN_DEFAULT_MINIMUM_WIDTH; + return centerColumn.MinimumColumnWidth; + } + } + } - /// - /// Gets the minimum width of the right column. - /// - private int RightColumnMinimumWidth - { - get - { - if (!RightColumnVisible) - return 0; - else - { - if (rightColumn.MinimumColumnWidth == 0) - rightColumn.MinimumColumnWidth = RIGHT_COLUMN_DEFAULT_MINIMUM_WIDTH; - return rightColumn.MinimumColumnWidth; - } - } - } + /// + /// Gets the minimum width of the right column. + /// + private int RightColumnMinimumWidth + { + get + { + if (!RightColumnVisible) + return 0; + else + { + if (rightColumn.MinimumColumnWidth == 0) + rightColumn.MinimumColumnWidth = RIGHT_COLUMN_DEFAULT_MINIMUM_WIDTH; + return rightColumn.MinimumColumnWidth; + } + } + } - /// - /// Layout the application command bar lightweight control. - /// - /// Column layout rectangle. - private Rectangle LayoutApplicationCommandBarLightweightControl() - { - // The command bar height (set below if ). - int applicationCommandBarHeight = 0; + /// + /// Layout the application command bar lightweight control. + /// + /// Column layout rectangle. + private Rectangle LayoutApplicationCommandBarLightweightControl() + { + // The command bar height (set below if ). + int applicationCommandBarHeight = 0; - // If we have am application command bar lightweight control, lay it out. - if (applicationCommandBarLightweightControl != null) - { - // If a command bar definition has been supplied, layout the application command - // bar lightweight control. Otherwise, hide it. - if (CommandBarDefinition != null) - { - // Set the application command bar height. - applicationCommandBarHeight = applicationCommandBarLightweightControl.DefaultVirtualSize.Height; + // If we have am application command bar lightweight control, lay it out. + if (applicationCommandBarLightweightControl != null) + { + // If a command bar definition has been supplied, layout the application command + // bar lightweight control. Otherwise, hide it. + if (CommandBarDefinition != null) + { + // Set the application command bar height. + applicationCommandBarHeight = applicationCommandBarLightweightControl.DefaultVirtualSize.Height; - // Layout the application command bar lightweight control. - applicationCommandBarLightweightControl.Visible = true; - applicationCommandBarLightweightControl.VirtualBounds = new Rectangle(0, 0, Width, applicationCommandBarHeight); - } - else - { - // Layout the application command bar lightweight control. - applicationCommandBarLightweightControl.Visible = false; - applicationCommandBarLightweightControl.VirtualBounds = Rectangle.Empty; - } - } + // Layout the application command bar lightweight control. + applicationCommandBarLightweightControl.Visible = true; + applicationCommandBarLightweightControl.VirtualBounds = new Rectangle(0, 0, Width, applicationCommandBarHeight); + } + else + { + // Layout the application command bar lightweight control. + applicationCommandBarLightweightControl.Visible = false; + applicationCommandBarLightweightControl.VirtualBounds = Rectangle.Empty; + } + } - // Return the column layout rectangle. - return new Rectangle( columnLayoutMargin.Width, - applicationCommandBarHeight+columnLayoutMargin.Height, - Width-(columnLayoutMargin.Width*2), - Height-applicationCommandBarHeight-(columnLayoutMargin.Height*2)); - } + // Return the column layout rectangle. + return new Rectangle( columnLayoutMargin.Width, + applicationCommandBarHeight+columnLayoutMargin.Height, + Width-(columnLayoutMargin.Width*2), + Height-applicationCommandBarHeight-(columnLayoutMargin.Height*2)); + } - /// - /// leftColumn_MaximumColumnWidthChanged event handler. - /// - /// The source of the event. - /// An EventArgs that contains the event data. - private void leftColumn_MaximumColumnWidthChanged(object sender, System.EventArgs e) - { - PerformLayout(); - Invalidate(); - } + /// + /// leftColumn_MaximumColumnWidthChanged event handler. + /// + /// The source of the event. + /// An EventArgs that contains the event data. + private void leftColumn_MaximumColumnWidthChanged(object sender, System.EventArgs e) + { + PerformLayout(); + Invalidate(); + } - /// - /// leftColumn_MinimumColumnWidthChanged event handler. - /// - /// The source of the event. - /// An EventArgs that contains the event data. - private void leftColumn_MinimumColumnWidthChanged(object sender, System.EventArgs e) - { - PerformLayout(); - Invalidate(); - } + /// + /// leftColumn_MinimumColumnWidthChanged event handler. + /// + /// The source of the event. + /// An EventArgs that contains the event data. + private void leftColumn_MinimumColumnWidthChanged(object sender, System.EventArgs e) + { + PerformLayout(); + Invalidate(); + } - /// - /// leftColumn_PreferredColumnWidthChanged event handler. - /// - /// The source of the event. - /// An EventArgs that contains the event data. - private void leftColumn_PreferredColumnWidthChanged(object sender, System.EventArgs e) - { - PerformLayout(); - Invalidate(); - } + /// + /// leftColumn_PreferredColumnWidthChanged event handler. + /// + /// The source of the event. + /// An EventArgs that contains the event data. + private void leftColumn_PreferredColumnWidthChanged(object sender, System.EventArgs e) + { + PerformLayout(); + Invalidate(); + } - /// - /// rightColumn_MaximumColumnWidthChanged event handler. - /// - /// The source of the event. - /// An EventArgs that contains the event data. - private void rightColumn_MaximumColumnWidthChanged(object sender, System.EventArgs e) - { - PerformLayout(); - Invalidate(); - } + /// + /// rightColumn_MaximumColumnWidthChanged event handler. + /// + /// The source of the event. + /// An EventArgs that contains the event data. + private void rightColumn_MaximumColumnWidthChanged(object sender, System.EventArgs e) + { + PerformLayout(); + Invalidate(); + } - /// - /// rightColumn_MinimumColumnWidthChanged event handler. - /// - /// The source of the event. - /// An EventArgs that contains the event data. - private void rightColumn_MinimumColumnWidthChanged(object sender, System.EventArgs e) - { - PerformLayout(); - Invalidate(); - } + /// + /// rightColumn_MinimumColumnWidthChanged event handler. + /// + /// The source of the event. + /// An EventArgs that contains the event data. + private void rightColumn_MinimumColumnWidthChanged(object sender, System.EventArgs e) + { + PerformLayout(); + Invalidate(); + } - /// - /// rightColumn_PreferredColumnWidthChanged event handler. - /// - /// The source of the event. - /// An EventArgs that contains the event data. - private void rightColumn_PreferredColumnWidthChanged(object sender, System.EventArgs e) - { - PerformLayout(); - Invalidate(); - } - } + /// + /// rightColumn_PreferredColumnWidthChanged event handler. + /// + /// The source of the event. + /// An EventArgs that contains the event data. + private void rightColumn_PreferredColumnWidthChanged(object sender, System.EventArgs e) + { + PerformLayout(); + Invalidate(); + } + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationWorkspaceColumnLightweightControl.cs b/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationWorkspaceColumnLightweightControl.cs index e1fb900d..2dc24504 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationWorkspaceColumnLightweightControl.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationWorkspaceColumnLightweightControl.cs @@ -12,822 +12,822 @@ using Project31.Controls; namespace Project31.ApplicationFramework { - /// - /// The vertical splitter style. - /// - public enum VerticalSplitterStyle - { - None, // No vertical splitter. - Left, // Vertical splitter on the left edge of the column. - Right // Vertical splitter on the right edge of the column. - } - - /// - /// - /// - public class ApplicationWorkspaceColumnLightweightControl : Project31.Controls.LightweightControl - { - /// - /// The minimum horizontal splitter position. - /// - private static double MINIMUM_HORIZONTAL_SPLITTER_POSITION = 0.20; - - /// - /// The maximum horizontal splitter position. - /// - private static double MAXIMUM_HORIZONTAL_SPLITTER_POSITION = 0.80; - - /// - /// Required designer cruft. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// The vertical splitter lightweight control. - /// - private Project31.ApplicationFramework.SplitterLightweightControl splitterLightweightControlVertical; - - /// - /// The horizontal splitter lightweight control. - /// - private Project31.ApplicationFramework.SplitterLightweightControl splitterLightweightControlHorizontal; - - /// - /// The upper pane lightweight control. - /// - private LightweightControl upperPaneLightweightControl; - - /// - /// Gets or sets the upper pane lightweight control. - /// - [ - Category("Design"), - Localizable(false), - DefaultValue(null), - Description("Specifies the upper pane lightweight control.") - ] - public LightweightControl UpperPaneLightweightControl - { - get - { - return upperPaneLightweightControl; - } - set - { - ChangePaneLightweightControl(value, ref upperPaneLightweightControl); - } - } - - /// - /// Gets or sets the upper pane control. - /// - [ - Category("Design"), - Localizable(false), - DefaultValue(null), - Description("Specifies the upper pane control.") - ] - public Control UpperPaneControl - { - get - { - if (upperPaneLightweightControl is ApplicationWorkspaceColumnPaneLightweightControl) - return ((ApplicationWorkspaceColumnPaneLightweightControl)upperPaneLightweightControl).Control; - else - return null; - } - set - { - ApplicationWorkspaceColumnPaneLightweightControl applicationWorkspaceColumnPaneLightweightControl = new ApplicationWorkspaceColumnPaneLightweightControl(); - applicationWorkspaceColumnPaneLightweightControl.Control = value; - ChangePaneLightweightControl(applicationWorkspaceColumnPaneLightweightControl, ref upperPaneLightweightControl); - } - } - - /// - /// The lower pane lightweight control. - /// - private LightweightControl lowerPaneLightweightControl; - - /// - /// Gets or sets the lower pane lightweight control. - /// - [ - Category("Design"), - Localizable(false), - DefaultValue(null), - Description("Specifies the lower pane lightweight control.") - ] - public LightweightControl LowerPaneLightweightControl - { - get - { - return lowerPaneLightweightControl; - } - set - { - ChangePaneLightweightControl(value, ref lowerPaneLightweightControl); - } - } - - /// - /// Gets or sets the lower pane control. - /// - [ - Category("Design"), - Localizable(false), - DefaultValue(null), - Description("Specifies the lower pane control.") - ] - public Control LowerPaneControl - { - get - { - if (lowerPaneLightweightControl is ApplicationWorkspaceColumnPaneLightweightControl) - return ((ApplicationWorkspaceColumnPaneLightweightControl)lowerPaneLightweightControl).Control; - else - return null; - } - set - { - ApplicationWorkspaceColumnPaneLightweightControl applicationWorkspaceColumnPaneLightweightControl = new ApplicationWorkspaceColumnPaneLightweightControl(); - applicationWorkspaceColumnPaneLightweightControl.Control = value; - ChangePaneLightweightControl(applicationWorkspaceColumnPaneLightweightControl, ref lowerPaneLightweightControl); - } - } - - /// - /// The vertical splitter style. - /// - private VerticalSplitterStyle verticalSplitterStyle = VerticalSplitterStyle.None; - - /// - /// Gets or sets the vertical splitter style. - /// - [ - Category("Appearance"), - Localizable(false), - DefaultValue(VerticalSplitterStyle.None), - Description("Specifies the initial vertical splitter style.") - ] - public VerticalSplitterStyle VerticalSplitter - { - get - { - return verticalSplitterStyle; - } - set - { - if (verticalSplitterStyle != value) - { - verticalSplitterStyle = value; - PerformLayout(); - Invalidate(); - } - } - } - - /// - /// The vertical splitter width. - /// - private int verticalSplitterWidth = 5; - - /// - /// Gets or sets the vertical splitter width. - /// - [ - Category("Appearance"), - Localizable(false), - DefaultValue(5), - Description("Specifies the initial vertical splitter width.") - ] - public int VerticalSplitterWidth - { - get - { - return verticalSplitterWidth; - } - set - { - if (verticalSplitterWidth != value) - { - verticalSplitterWidth = value; - PerformLayout(); - Invalidate(); - } - } - } - - /// - /// The horizontal splitter height. - /// - private int horizontalSplitterHeight = 5; - - /// - /// Gets or sets the horizontal splitter height. - /// - [ - Category("Appearance"), - Localizable(false), - DefaultValue(5), - Description("Specifies the initial horizontal splitter height.") - ] - public int HorizontalSplitterHeight - { - get - { - return horizontalSplitterHeight; - } - set - { - if (horizontalSplitterHeight != value) - { - horizontalSplitterHeight = value; - PerformLayout(); - Invalidate(); - } - } - } - - /// - /// The preferred column width. - /// - private int preferredColumnWidth = 0; - - /// - /// Gets or sets the preferred column width. - /// - [ - Category("Appearance"), - Localizable(false), - DefaultValue(0), - Description("Specifies the preferred column width.") - ] - public int PreferredColumnWidth - { - get - { - return preferredColumnWidth; - } - set - { - if (preferredColumnWidth != value) - { - preferredColumnWidth = value; - OnPreferredColumnWidthChanged(EventArgs.Empty); - } - } - } - - /// - /// The minimum column width. - /// - private int minimumColumnWidth = 0; - - /// - /// Gets or sets the preferred column width. - /// - [ - Category("Appearance"), - Localizable(false), - DefaultValue(0), - Description("Specifies the minimum column width.") - ] - public int MinimumColumnWidth - { - get - { - return minimumColumnWidth; - } - set - { - if (minimumColumnWidth != value) - { - minimumColumnWidth = value; - OnMinimumColumnWidthChanged(EventArgs.Empty); - } - } - } - - /// - /// The maximum column width. - /// - private int maximumColumnWidth = 0; - - /// - /// Gets or sets the maximum column width. - /// - [ - Category("Appearance"), - Localizable(false), - DefaultValue(0), - Description("Specifies the maximum column width.") - ] - public int MaximumColumnWidth - { - get - { - return maximumColumnWidth; - } - set - { - if (maximumColumnWidth != value) - { - maximumColumnWidth = value; - OnMaximumColumnWidthChanged(EventArgs.Empty); - } - } - } - - /// - /// The horizontal splitter position. - /// - private double horizontalSplitterPosition = 0.60; - - /// - /// Gets or sets the preferred horizontal splitter position. - /// - [ - Category("Appearance"), - Localizable(false), - DefaultValue(0.60), - Description("Specifies the horizontal splitter position.") - ] - public double HorizontalSplitterPosition - { - get - { - return horizontalSplitterPosition; - } - set - { - // Check the new horizontal splitter position. - if (value < MINIMUM_HORIZONTAL_SPLITTER_POSITION) - value = MINIMUM_HORIZONTAL_SPLITTER_POSITION; - else if (value > MAXIMUM_HORIZONTAL_SPLITTER_POSITION) - value = MAXIMUM_HORIZONTAL_SPLITTER_POSITION; - - // If the horizontal splitter position is changing, change it. - if (horizontalSplitterPosition != value) - { - horizontalSplitterPosition = value; - OnHorizontalSplitterPositionChanged(EventArgs.Empty); - } - } - } - - /// - /// Occurs when the PreferredColumnWidth changes. - /// - public event EventHandler PreferredColumnWidthChanged; - - /// - /// Occurs when the MinimumColumnWidth changes. - /// - public event EventHandler MinimumColumnWidthChanged; - - /// - /// Occurs when the MaximumColumnWidth changes. - /// - public event EventHandler MaximumColumnWidthChanged; - - /// - /// Occurs when the HorizontalSplitterPosition changes. - /// - public event EventHandler HorizontalSplitterPositionChanged; - - /// - /// Initializes a new instance of the ApplicationWorkspaceColumnLightweightControl class. - /// - public ApplicationWorkspaceColumnLightweightControl() - { - // This call is required by the Windows Form Designer. - InitializeComponent(); - } - - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if (components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } - - #region Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - this.splitterLightweightControlVertical = new Project31.ApplicationFramework.SplitterLightweightControl(this.components); - this.splitterLightweightControlHorizontal = new Project31.ApplicationFramework.SplitterLightweightControl(this.components); - // - // splitterLightweightControlVertical - // - this.splitterLightweightControlVertical.LightweightControlContainerControl = this; - this.splitterLightweightControlVertical.Orientation = Project31.ApplicationFramework.SplitterLightweightControl.SplitterOrientation.Vertical; - this.splitterLightweightControlVertical.SplitterEndMove += new Project31.ApplicationFramework.LightweightSplitterEventHandler(this.splitterLightweightControlVertical_SplitterEndMove); - this.splitterLightweightControlVertical.SplitterMoving += new Project31.ApplicationFramework.LightweightSplitterEventHandler(this.splitterLightweightControlVertical_SplitterMoving); - // - // splitterLightweightControlHorizontal - // - this.splitterLightweightControlHorizontal.LightweightControlContainerControl = this; - this.splitterLightweightControlHorizontal.Orientation = Project31.ApplicationFramework.SplitterLightweightControl.SplitterOrientation.Horizontal; - this.splitterLightweightControlHorizontal.SplitterEndMove += new Project31.ApplicationFramework.LightweightSplitterEventHandler(this.splitterLightweightControlHorizontal_SplitterEndMove); - this.splitterLightweightControlHorizontal.SplitterMoving += new Project31.ApplicationFramework.LightweightSplitterEventHandler(this.splitterLightweightControlHorizontal_SplitterMoving); - } - #endregion - - /// - /// Raises the MaximumColumnWidthChanged event. - /// - /// An EventArgs that contains the event data. - protected virtual void OnMaximumColumnWidthChanged(EventArgs e) - { - if (MaximumColumnWidthChanged != null) - MaximumColumnWidthChanged(this, e); - } - - /// - /// Raises the MinimumColumnWidthChanged event. - /// - /// An EventArgs that contains the event data. - protected virtual void OnMinimumColumnWidthChanged(EventArgs e) - { - if (MinimumColumnWidthChanged != null) - MinimumColumnWidthChanged(this, e); - } - - /// - /// Raises the PreferredColumnWidthChanged event. - /// - /// An EventArgs that contains the event data. - protected virtual void OnPreferredColumnWidthChanged(EventArgs e) - { - if (PreferredColumnWidthChanged != null) - PreferredColumnWidthChanged(this, e); - } - - /// - /// Raises the HorizontalSplitterPositionChanged event. - /// - /// An EventArgs that contains the event data. - protected virtual void OnHorizontalSplitterPositionChanged(EventArgs e) - { - if (HorizontalSplitterPositionChanged != null) - HorizontalSplitterPositionChanged(this, e); - } - - /// - /// Raises the Layout event. - /// - /// An EventArgs that contains the event data. - protected override void OnLayout(EventArgs e) - { - // Call the base class's method so that registered delegates receive the event. - base.OnLayout(e); - - // Obtain the layout rectangle. - Rectangle layoutRectangle = VirtualClientRectangle; - - // Layout the vertical splitter lightweight control and adjust the layout rectangle. - if (verticalSplitterStyle == VerticalSplitterStyle.None) - { - // No vertical splitter lightweight control. - splitterLightweightControlVertical.Visible = false; - splitterLightweightControlVertical.VirtualBounds = Rectangle.Empty; - } - else if (verticalSplitterStyle == VerticalSplitterStyle.Left) - { - // Left vertical splitter lightweight control. - splitterLightweightControlVertical.Visible = true; - splitterLightweightControlVertical.VirtualBounds = new Rectangle( layoutRectangle.X, - layoutRectangle.Y, - verticalSplitterWidth, - layoutRectangle.Height); - layoutRectangle.X += verticalSplitterWidth; - layoutRectangle.Width -= verticalSplitterWidth; - } - else if (verticalSplitterStyle == VerticalSplitterStyle.Right) - { - // Right vertical splitter lightweight control. - splitterLightweightControlVertical.Visible = true; - splitterLightweightControlVertical.VirtualBounds = new Rectangle( layoutRectangle.Right-verticalSplitterWidth, - layoutRectangle.Top, - verticalSplitterWidth, - layoutRectangle.Height); - layoutRectangle.Width -= verticalSplitterWidth; - } - - // Layout the upper and lower pane lightweight controls. - if (upperPaneLightweightControl != null && upperPaneLightweightControl.Visible && - lowerPaneLightweightControl != null && lowerPaneLightweightControl.Visible) - { - // Calculate the pane layout height (the area available for layout of the upper - // and lower panes). - int paneLayoutHeight = layoutRectangle.Height-horizontalSplitterHeight; - - // If the pane layout height is too small (i.e. there isn't enough room to show - // both panes), err on the side of showing just the top pane. This is an extreme - // edge condition. - if (paneLayoutHeight < 10*horizontalSplitterHeight) - { - // Only the upper pane lightweight control is visible. - upperPaneLightweightControl.VirtualBounds = layoutRectangle; - lowerPaneLightweightControl.VirtualBounds = Rectangle.Empty; - splitterLightweightControlHorizontal.Visible = false; - splitterLightweightControlHorizontal.VirtualBounds = Rectangle.Empty; - } - else - { - // Get the horizontal splitter layout position. - int horizontalSplitterLayoutPosition = HorizontalSplitterLayoutPosition; - - // Layout the upper pane lightweight control. - upperPaneLightweightControl.VirtualBounds = new Rectangle( layoutRectangle.X, - layoutRectangle.Y, - layoutRectangle.Width, - horizontalSplitterLayoutPosition); - - // Layout the horizontal splitter lightweight control. - splitterLightweightControlHorizontal.Visible = true; - splitterLightweightControlHorizontal.VirtualBounds = new Rectangle( layoutRectangle.X, - upperPaneLightweightControl.VirtualBounds.Bottom, - layoutRectangle.Width, - horizontalSplitterHeight); - - // Layout the lower pane lightweight control. - lowerPaneLightweightControl.VirtualBounds = new Rectangle( layoutRectangle.X, - splitterLightweightControlHorizontal.VirtualBounds.Bottom, - layoutRectangle.Width, - layoutRectangle.Height-(upperPaneLightweightControl.VirtualHeight+horizontalSplitterHeight)); - } - } - else if (upperPaneLightweightControl != null && upperPaneLightweightControl.Visible) - { - // Only the upper pane lightweight control is visible. - upperPaneLightweightControl.VirtualBounds = layoutRectangle; - } - else if (lowerPaneLightweightControl != null && lowerPaneLightweightControl.Visible) - { - // Only the lower pane lightweight control is visible. - lowerPaneLightweightControl.VirtualBounds = layoutRectangle; - } - } - - /// - /// Private helper to change one of the pane lightweight controls. - /// - /// The new lightweight control. - /// The pane lightweight control to change. - private void ChangePaneLightweightControl(LightweightControl lightweightControl, ref LightweightControl paneLightweightControl) - { - // If the pane lightweight control is changing, change it. - if (paneLightweightControl != lightweightControl) - { - // If we have a current lightweight control in the pane, remove it. - if (paneLightweightControl != null) - paneLightweightControl.LightweightControlContainerControl = null; - - // Set the pane lightweight control. - paneLightweightControl = lightweightControl; - - // If we have a new lightweight control in the pane, add it. - if (paneLightweightControl != null) - paneLightweightControl.LightweightControlContainerControl = this; - - // Layout and invalidate. - PerformLayout(); - Invalidate(); - } - } - - /// - /// Gets the maximum width increase. - /// - private int MaximumWidthIncrease - { - get - { - Debug.Assert(VirtualWidth <= MaximumColumnWidth, "The column is wider than it's maximum width. Call Brian."); - return Math.Max(0, MaximumColumnWidth-VirtualWidth); - } - } - - /// - /// Gets the maximum width decrease. - /// - private int MaximumWidthDecrease - { - get - { - Debug.Assert(VirtualWidth >= MinimumColumnWidth, "The column is narrower than it's minimum width. Call Brian."); - return Math.Max(0, VirtualWidth-MinimumColumnWidth); - } - } - - /// - /// Gets the pane layout height. - /// - private int PaneLayoutHeight - { - get - { - return Math.Max(0, VirtualClientRectangle.Height-horizontalSplitterHeight); - } - } - - /// - /// Gets the layout position of the horizontal splitter. - /// - private int HorizontalSplitterLayoutPosition - { - get - { - return (int)(PaneLayoutHeight*horizontalSplitterPosition); - } - } - - /// - /// Gets the minimum layout position of the horizontal splitter. - /// - private int MinimumHorizontalSplitterLayoutPosition - { - get - { - return (int)(PaneLayoutHeight*MINIMUM_HORIZONTAL_SPLITTER_POSITION); - } - } - - /// - /// Gets the maximum layout position of the horizontal splitter. - /// - private int MaximumHorizontalSplitterLayoutPosition - { - get - { - return (int)(PaneLayoutHeight*MAXIMUM_HORIZONTAL_SPLITTER_POSITION); - } - } - - /// - /// Helper to adjust the Position in the LightweightSplitterEventArgs for the vertical splitter. - /// - /// LightweightSplitterEventArgs to adjust. - private void AdjustVerticalLightweightSplitterEventArgsPosition(ref LightweightSplitterEventArgs e) - { - // If the vertical splitter style is non, we shouldn't receive this event. - Debug.Assert(verticalSplitterStyle != VerticalSplitterStyle.None); - if (verticalSplitterStyle == VerticalSplitterStyle.None) - return; - - // Left or right splitter style. - if (verticalSplitterStyle == VerticalSplitterStyle.Left) - { - if (e.Position < 0) - { - if (Math.Abs(e.Position) > MaximumWidthIncrease) - e.Position = MaximumWidthIncrease*-1; - } - else - { - if (e.Position > MaximumWidthDecrease) - e.Position = MaximumWidthDecrease; - } - } - else if (verticalSplitterStyle == VerticalSplitterStyle.Right) - { - if (e.Position > 0) - { - if (e.Position > MaximumWidthIncrease) - e.Position = MaximumWidthIncrease; - } - else - { - if (Math.Abs(e.Position) > MaximumWidthDecrease) - e.Position = MaximumWidthDecrease*-1; - } - } - } - - /// - /// Helper to adjust the Position in the LightweightSplitterEventArgs for the horizontal splitter. - /// - /// LightweightSplitterEventArgs to adjust. - private void AdjustHorizontalLightweightSplitterEventArgsPosition(ref LightweightSplitterEventArgs e) - { - int horizontalSplitterLayoutPosition = HorizontalSplitterLayoutPosition; - if (e.Position < 0) - { - if (HorizontalSplitterLayoutPosition+e.Position < MinimumHorizontalSplitterLayoutPosition) - e.Position = MinimumHorizontalSplitterLayoutPosition-horizontalSplitterLayoutPosition; - } - else - { - if (HorizontalSplitterLayoutPosition+e.Position > MaximumHorizontalSplitterLayoutPosition) - e.Position = MaximumHorizontalSplitterLayoutPosition-horizontalSplitterLayoutPosition; - } - } - - /// - /// splitterLightweightControlVertical_SplitterEndMove event handler. - /// - /// - /// - private void splitterLightweightControlVertical_SplitterEndMove(object sender, Project31.ApplicationFramework.LightweightSplitterEventArgs e) - { - // If the splitter has moved. - if (e.Position != 0) - { - // Adjust the vertical splitter position. - AdjustVerticalLightweightSplitterEventArgsPosition(ref e); - - // Adjust the preferred column width. - if (verticalSplitterStyle == VerticalSplitterStyle.Left) - PreferredColumnWidth -= e.Position; - else if (verticalSplitterStyle == VerticalSplitterStyle.Right) - PreferredColumnWidth += e.Position; - } - } - - /// - /// splitterLightweightControlVertical_SplitterMoving event handler. - /// - /// - /// - private void splitterLightweightControlVertical_SplitterMoving(object sender, Project31.ApplicationFramework.LightweightSplitterEventArgs e) - { - // If the splitter has moved. - if (e.Position != 0) - { - // Adjust the splitter position. - AdjustVerticalLightweightSplitterEventArgsPosition(ref e); - - // Adjust the preferred column width - in real time. - if (verticalSplitterStyle == VerticalSplitterStyle.Left) - PreferredColumnWidth -= e.Position; - else if (verticalSplitterStyle == VerticalSplitterStyle.Right) - PreferredColumnWidth += e.Position; - - // Update manually to keep the screen as up to date as possible. - Update(); - } - } - - /// - /// splitterLightweightControlHorizontal_SplitterEndMove event handler. - /// - /// - /// - private void splitterLightweightControlHorizontal_SplitterEndMove(object sender, Project31.ApplicationFramework.LightweightSplitterEventArgs e) - { - // If the splitter has moved. - if (e.Position != 0) - { - // Adjust the horizontal splitter position. - AdjustHorizontalLightweightSplitterEventArgsPosition(ref e); - - // Adjust the horizontal splitter position. - HorizontalSplitterPosition += (double)e.Position/PaneLayoutHeight; - - // Layout and invalidate. - PerformLayout(); - Invalidate(); - } - } - - /// - /// splitterLightweightControlHorizontal_SplitterMoving event handler. - /// - /// - /// - private void splitterLightweightControlHorizontal_SplitterMoving(object sender, Project31.ApplicationFramework.LightweightSplitterEventArgs e) - { - // If the splitter has moved. - if (e.Position != 0) - { - AdjustHorizontalLightweightSplitterEventArgsPosition(ref e); - - // Adjust the horizontal splitter position. - HorizontalSplitterPosition += (double)e.Position/PaneLayoutHeight; - - // Layout and invalidate. - PerformLayout(); - Invalidate(); - - // Update manually to keep the screen as up to date as possible. - Update(); - } - } - } + /// + /// The vertical splitter style. + /// + public enum VerticalSplitterStyle + { + None, // No vertical splitter. + Left, // Vertical splitter on the left edge of the column. + Right // Vertical splitter on the right edge of the column. + } + + /// + /// + /// + public class ApplicationWorkspaceColumnLightweightControl : Project31.Controls.LightweightControl + { + /// + /// The minimum horizontal splitter position. + /// + private static double MINIMUM_HORIZONTAL_SPLITTER_POSITION = 0.20; + + /// + /// The maximum horizontal splitter position. + /// + private static double MAXIMUM_HORIZONTAL_SPLITTER_POSITION = 0.80; + + /// + /// Required designer cruft. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// The vertical splitter lightweight control. + /// + private Project31.ApplicationFramework.SplitterLightweightControl splitterLightweightControlVertical; + + /// + /// The horizontal splitter lightweight control. + /// + private Project31.ApplicationFramework.SplitterLightweightControl splitterLightweightControlHorizontal; + + /// + /// The upper pane lightweight control. + /// + private LightweightControl upperPaneLightweightControl; + + /// + /// Gets or sets the upper pane lightweight control. + /// + [ + Category("Design"), + Localizable(false), + DefaultValue(null), + Description("Specifies the upper pane lightweight control.") + ] + public LightweightControl UpperPaneLightweightControl + { + get + { + return upperPaneLightweightControl; + } + set + { + ChangePaneLightweightControl(value, ref upperPaneLightweightControl); + } + } + + /// + /// Gets or sets the upper pane control. + /// + [ + Category("Design"), + Localizable(false), + DefaultValue(null), + Description("Specifies the upper pane control.") + ] + public Control UpperPaneControl + { + get + { + if (upperPaneLightweightControl is ApplicationWorkspaceColumnPaneLightweightControl) + return ((ApplicationWorkspaceColumnPaneLightweightControl)upperPaneLightweightControl).Control; + else + return null; + } + set + { + ApplicationWorkspaceColumnPaneLightweightControl applicationWorkspaceColumnPaneLightweightControl = new ApplicationWorkspaceColumnPaneLightweightControl(); + applicationWorkspaceColumnPaneLightweightControl.Control = value; + ChangePaneLightweightControl(applicationWorkspaceColumnPaneLightweightControl, ref upperPaneLightweightControl); + } + } + + /// + /// The lower pane lightweight control. + /// + private LightweightControl lowerPaneLightweightControl; + + /// + /// Gets or sets the lower pane lightweight control. + /// + [ + Category("Design"), + Localizable(false), + DefaultValue(null), + Description("Specifies the lower pane lightweight control.") + ] + public LightweightControl LowerPaneLightweightControl + { + get + { + return lowerPaneLightweightControl; + } + set + { + ChangePaneLightweightControl(value, ref lowerPaneLightweightControl); + } + } + + /// + /// Gets or sets the lower pane control. + /// + [ + Category("Design"), + Localizable(false), + DefaultValue(null), + Description("Specifies the lower pane control.") + ] + public Control LowerPaneControl + { + get + { + if (lowerPaneLightweightControl is ApplicationWorkspaceColumnPaneLightweightControl) + return ((ApplicationWorkspaceColumnPaneLightweightControl)lowerPaneLightweightControl).Control; + else + return null; + } + set + { + ApplicationWorkspaceColumnPaneLightweightControl applicationWorkspaceColumnPaneLightweightControl = new ApplicationWorkspaceColumnPaneLightweightControl(); + applicationWorkspaceColumnPaneLightweightControl.Control = value; + ChangePaneLightweightControl(applicationWorkspaceColumnPaneLightweightControl, ref lowerPaneLightweightControl); + } + } + + /// + /// The vertical splitter style. + /// + private VerticalSplitterStyle verticalSplitterStyle = VerticalSplitterStyle.None; + + /// + /// Gets or sets the vertical splitter style. + /// + [ + Category("Appearance"), + Localizable(false), + DefaultValue(VerticalSplitterStyle.None), + Description("Specifies the initial vertical splitter style.") + ] + public VerticalSplitterStyle VerticalSplitter + { + get + { + return verticalSplitterStyle; + } + set + { + if (verticalSplitterStyle != value) + { + verticalSplitterStyle = value; + PerformLayout(); + Invalidate(); + } + } + } + + /// + /// The vertical splitter width. + /// + private int verticalSplitterWidth = 5; + + /// + /// Gets or sets the vertical splitter width. + /// + [ + Category("Appearance"), + Localizable(false), + DefaultValue(5), + Description("Specifies the initial vertical splitter width.") + ] + public int VerticalSplitterWidth + { + get + { + return verticalSplitterWidth; + } + set + { + if (verticalSplitterWidth != value) + { + verticalSplitterWidth = value; + PerformLayout(); + Invalidate(); + } + } + } + + /// + /// The horizontal splitter height. + /// + private int horizontalSplitterHeight = 5; + + /// + /// Gets or sets the horizontal splitter height. + /// + [ + Category("Appearance"), + Localizable(false), + DefaultValue(5), + Description("Specifies the initial horizontal splitter height.") + ] + public int HorizontalSplitterHeight + { + get + { + return horizontalSplitterHeight; + } + set + { + if (horizontalSplitterHeight != value) + { + horizontalSplitterHeight = value; + PerformLayout(); + Invalidate(); + } + } + } + + /// + /// The preferred column width. + /// + private int preferredColumnWidth = 0; + + /// + /// Gets or sets the preferred column width. + /// + [ + Category("Appearance"), + Localizable(false), + DefaultValue(0), + Description("Specifies the preferred column width.") + ] + public int PreferredColumnWidth + { + get + { + return preferredColumnWidth; + } + set + { + if (preferredColumnWidth != value) + { + preferredColumnWidth = value; + OnPreferredColumnWidthChanged(EventArgs.Empty); + } + } + } + + /// + /// The minimum column width. + /// + private int minimumColumnWidth = 0; + + /// + /// Gets or sets the preferred column width. + /// + [ + Category("Appearance"), + Localizable(false), + DefaultValue(0), + Description("Specifies the minimum column width.") + ] + public int MinimumColumnWidth + { + get + { + return minimumColumnWidth; + } + set + { + if (minimumColumnWidth != value) + { + minimumColumnWidth = value; + OnMinimumColumnWidthChanged(EventArgs.Empty); + } + } + } + + /// + /// The maximum column width. + /// + private int maximumColumnWidth = 0; + + /// + /// Gets or sets the maximum column width. + /// + [ + Category("Appearance"), + Localizable(false), + DefaultValue(0), + Description("Specifies the maximum column width.") + ] + public int MaximumColumnWidth + { + get + { + return maximumColumnWidth; + } + set + { + if (maximumColumnWidth != value) + { + maximumColumnWidth = value; + OnMaximumColumnWidthChanged(EventArgs.Empty); + } + } + } + + /// + /// The horizontal splitter position. + /// + private double horizontalSplitterPosition = 0.60; + + /// + /// Gets or sets the preferred horizontal splitter position. + /// + [ + Category("Appearance"), + Localizable(false), + DefaultValue(0.60), + Description("Specifies the horizontal splitter position.") + ] + public double HorizontalSplitterPosition + { + get + { + return horizontalSplitterPosition; + } + set + { + // Check the new horizontal splitter position. + if (value < MINIMUM_HORIZONTAL_SPLITTER_POSITION) + value = MINIMUM_HORIZONTAL_SPLITTER_POSITION; + else if (value > MAXIMUM_HORIZONTAL_SPLITTER_POSITION) + value = MAXIMUM_HORIZONTAL_SPLITTER_POSITION; + + // If the horizontal splitter position is changing, change it. + if (horizontalSplitterPosition != value) + { + horizontalSplitterPosition = value; + OnHorizontalSplitterPositionChanged(EventArgs.Empty); + } + } + } + + /// + /// Occurs when the PreferredColumnWidth changes. + /// + public event EventHandler PreferredColumnWidthChanged; + + /// + /// Occurs when the MinimumColumnWidth changes. + /// + public event EventHandler MinimumColumnWidthChanged; + + /// + /// Occurs when the MaximumColumnWidth changes. + /// + public event EventHandler MaximumColumnWidthChanged; + + /// + /// Occurs when the HorizontalSplitterPosition changes. + /// + public event EventHandler HorizontalSplitterPositionChanged; + + /// + /// Initializes a new instance of the ApplicationWorkspaceColumnLightweightControl class. + /// + public ApplicationWorkspaceColumnLightweightControl() + { + // This call is required by the Windows Form Designer. + InitializeComponent(); + } + + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if (components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } + + #region Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.splitterLightweightControlVertical = new Project31.ApplicationFramework.SplitterLightweightControl(this.components); + this.splitterLightweightControlHorizontal = new Project31.ApplicationFramework.SplitterLightweightControl(this.components); + // + // splitterLightweightControlVertical + // + this.splitterLightweightControlVertical.LightweightControlContainerControl = this; + this.splitterLightweightControlVertical.Orientation = Project31.ApplicationFramework.SplitterLightweightControl.SplitterOrientation.Vertical; + this.splitterLightweightControlVertical.SplitterEndMove += new Project31.ApplicationFramework.LightweightSplitterEventHandler(this.splitterLightweightControlVertical_SplitterEndMove); + this.splitterLightweightControlVertical.SplitterMoving += new Project31.ApplicationFramework.LightweightSplitterEventHandler(this.splitterLightweightControlVertical_SplitterMoving); + // + // splitterLightweightControlHorizontal + // + this.splitterLightweightControlHorizontal.LightweightControlContainerControl = this; + this.splitterLightweightControlHorizontal.Orientation = Project31.ApplicationFramework.SplitterLightweightControl.SplitterOrientation.Horizontal; + this.splitterLightweightControlHorizontal.SplitterEndMove += new Project31.ApplicationFramework.LightweightSplitterEventHandler(this.splitterLightweightControlHorizontal_SplitterEndMove); + this.splitterLightweightControlHorizontal.SplitterMoving += new Project31.ApplicationFramework.LightweightSplitterEventHandler(this.splitterLightweightControlHorizontal_SplitterMoving); + } + #endregion + + /// + /// Raises the MaximumColumnWidthChanged event. + /// + /// An EventArgs that contains the event data. + protected virtual void OnMaximumColumnWidthChanged(EventArgs e) + { + if (MaximumColumnWidthChanged != null) + MaximumColumnWidthChanged(this, e); + } + + /// + /// Raises the MinimumColumnWidthChanged event. + /// + /// An EventArgs that contains the event data. + protected virtual void OnMinimumColumnWidthChanged(EventArgs e) + { + if (MinimumColumnWidthChanged != null) + MinimumColumnWidthChanged(this, e); + } + + /// + /// Raises the PreferredColumnWidthChanged event. + /// + /// An EventArgs that contains the event data. + protected virtual void OnPreferredColumnWidthChanged(EventArgs e) + { + if (PreferredColumnWidthChanged != null) + PreferredColumnWidthChanged(this, e); + } + + /// + /// Raises the HorizontalSplitterPositionChanged event. + /// + /// An EventArgs that contains the event data. + protected virtual void OnHorizontalSplitterPositionChanged(EventArgs e) + { + if (HorizontalSplitterPositionChanged != null) + HorizontalSplitterPositionChanged(this, e); + } + + /// + /// Raises the Layout event. + /// + /// An EventArgs that contains the event data. + protected override void OnLayout(EventArgs e) + { + // Call the base class's method so that registered delegates receive the event. + base.OnLayout(e); + + // Obtain the layout rectangle. + Rectangle layoutRectangle = VirtualClientRectangle; + + // Layout the vertical splitter lightweight control and adjust the layout rectangle. + if (verticalSplitterStyle == VerticalSplitterStyle.None) + { + // No vertical splitter lightweight control. + splitterLightweightControlVertical.Visible = false; + splitterLightweightControlVertical.VirtualBounds = Rectangle.Empty; + } + else if (verticalSplitterStyle == VerticalSplitterStyle.Left) + { + // Left vertical splitter lightweight control. + splitterLightweightControlVertical.Visible = true; + splitterLightweightControlVertical.VirtualBounds = new Rectangle( layoutRectangle.X, + layoutRectangle.Y, + verticalSplitterWidth, + layoutRectangle.Height); + layoutRectangle.X += verticalSplitterWidth; + layoutRectangle.Width -= verticalSplitterWidth; + } + else if (verticalSplitterStyle == VerticalSplitterStyle.Right) + { + // Right vertical splitter lightweight control. + splitterLightweightControlVertical.Visible = true; + splitterLightweightControlVertical.VirtualBounds = new Rectangle( layoutRectangle.Right-verticalSplitterWidth, + layoutRectangle.Top, + verticalSplitterWidth, + layoutRectangle.Height); + layoutRectangle.Width -= verticalSplitterWidth; + } + + // Layout the upper and lower pane lightweight controls. + if (upperPaneLightweightControl != null && upperPaneLightweightControl.Visible && + lowerPaneLightweightControl != null && lowerPaneLightweightControl.Visible) + { + // Calculate the pane layout height (the area available for layout of the upper + // and lower panes). + int paneLayoutHeight = layoutRectangle.Height-horizontalSplitterHeight; + + // If the pane layout height is too small (i.e. there isn't enough room to show + // both panes), err on the side of showing just the top pane. This is an extreme + // edge condition. + if (paneLayoutHeight < 10*horizontalSplitterHeight) + { + // Only the upper pane lightweight control is visible. + upperPaneLightweightControl.VirtualBounds = layoutRectangle; + lowerPaneLightweightControl.VirtualBounds = Rectangle.Empty; + splitterLightweightControlHorizontal.Visible = false; + splitterLightweightControlHorizontal.VirtualBounds = Rectangle.Empty; + } + else + { + // Get the horizontal splitter layout position. + int horizontalSplitterLayoutPosition = HorizontalSplitterLayoutPosition; + + // Layout the upper pane lightweight control. + upperPaneLightweightControl.VirtualBounds = new Rectangle( layoutRectangle.X, + layoutRectangle.Y, + layoutRectangle.Width, + horizontalSplitterLayoutPosition); + + // Layout the horizontal splitter lightweight control. + splitterLightweightControlHorizontal.Visible = true; + splitterLightweightControlHorizontal.VirtualBounds = new Rectangle( layoutRectangle.X, + upperPaneLightweightControl.VirtualBounds.Bottom, + layoutRectangle.Width, + horizontalSplitterHeight); + + // Layout the lower pane lightweight control. + lowerPaneLightweightControl.VirtualBounds = new Rectangle( layoutRectangle.X, + splitterLightweightControlHorizontal.VirtualBounds.Bottom, + layoutRectangle.Width, + layoutRectangle.Height-(upperPaneLightweightControl.VirtualHeight+horizontalSplitterHeight)); + } + } + else if (upperPaneLightweightControl != null && upperPaneLightweightControl.Visible) + { + // Only the upper pane lightweight control is visible. + upperPaneLightweightControl.VirtualBounds = layoutRectangle; + } + else if (lowerPaneLightweightControl != null && lowerPaneLightweightControl.Visible) + { + // Only the lower pane lightweight control is visible. + lowerPaneLightweightControl.VirtualBounds = layoutRectangle; + } + } + + /// + /// Private helper to change one of the pane lightweight controls. + /// + /// The new lightweight control. + /// The pane lightweight control to change. + private void ChangePaneLightweightControl(LightweightControl lightweightControl, ref LightweightControl paneLightweightControl) + { + // If the pane lightweight control is changing, change it. + if (paneLightweightControl != lightweightControl) + { + // If we have a current lightweight control in the pane, remove it. + if (paneLightweightControl != null) + paneLightweightControl.LightweightControlContainerControl = null; + + // Set the pane lightweight control. + paneLightweightControl = lightweightControl; + + // If we have a new lightweight control in the pane, add it. + if (paneLightweightControl != null) + paneLightweightControl.LightweightControlContainerControl = this; + + // Layout and invalidate. + PerformLayout(); + Invalidate(); + } + } + + /// + /// Gets the maximum width increase. + /// + private int MaximumWidthIncrease + { + get + { + Debug.Assert(VirtualWidth <= MaximumColumnWidth, "The column is wider than it's maximum width. Call Brian."); + return Math.Max(0, MaximumColumnWidth-VirtualWidth); + } + } + + /// + /// Gets the maximum width decrease. + /// + private int MaximumWidthDecrease + { + get + { + Debug.Assert(VirtualWidth >= MinimumColumnWidth, "The column is narrower than it's minimum width. Call Brian."); + return Math.Max(0, VirtualWidth-MinimumColumnWidth); + } + } + + /// + /// Gets the pane layout height. + /// + private int PaneLayoutHeight + { + get + { + return Math.Max(0, VirtualClientRectangle.Height-horizontalSplitterHeight); + } + } + + /// + /// Gets the layout position of the horizontal splitter. + /// + private int HorizontalSplitterLayoutPosition + { + get + { + return (int)(PaneLayoutHeight*horizontalSplitterPosition); + } + } + + /// + /// Gets the minimum layout position of the horizontal splitter. + /// + private int MinimumHorizontalSplitterLayoutPosition + { + get + { + return (int)(PaneLayoutHeight*MINIMUM_HORIZONTAL_SPLITTER_POSITION); + } + } + + /// + /// Gets the maximum layout position of the horizontal splitter. + /// + private int MaximumHorizontalSplitterLayoutPosition + { + get + { + return (int)(PaneLayoutHeight*MAXIMUM_HORIZONTAL_SPLITTER_POSITION); + } + } + + /// + /// Helper to adjust the Position in the LightweightSplitterEventArgs for the vertical splitter. + /// + /// LightweightSplitterEventArgs to adjust. + private void AdjustVerticalLightweightSplitterEventArgsPosition(ref LightweightSplitterEventArgs e) + { + // If the vertical splitter style is non, we shouldn't receive this event. + Debug.Assert(verticalSplitterStyle != VerticalSplitterStyle.None); + if (verticalSplitterStyle == VerticalSplitterStyle.None) + return; + + // Left or right splitter style. + if (verticalSplitterStyle == VerticalSplitterStyle.Left) + { + if (e.Position < 0) + { + if (Math.Abs(e.Position) > MaximumWidthIncrease) + e.Position = MaximumWidthIncrease*-1; + } + else + { + if (e.Position > MaximumWidthDecrease) + e.Position = MaximumWidthDecrease; + } + } + else if (verticalSplitterStyle == VerticalSplitterStyle.Right) + { + if (e.Position > 0) + { + if (e.Position > MaximumWidthIncrease) + e.Position = MaximumWidthIncrease; + } + else + { + if (Math.Abs(e.Position) > MaximumWidthDecrease) + e.Position = MaximumWidthDecrease*-1; + } + } + } + + /// + /// Helper to adjust the Position in the LightweightSplitterEventArgs for the horizontal splitter. + /// + /// LightweightSplitterEventArgs to adjust. + private void AdjustHorizontalLightweightSplitterEventArgsPosition(ref LightweightSplitterEventArgs e) + { + int horizontalSplitterLayoutPosition = HorizontalSplitterLayoutPosition; + if (e.Position < 0) + { + if (HorizontalSplitterLayoutPosition+e.Position < MinimumHorizontalSplitterLayoutPosition) + e.Position = MinimumHorizontalSplitterLayoutPosition-horizontalSplitterLayoutPosition; + } + else + { + if (HorizontalSplitterLayoutPosition+e.Position > MaximumHorizontalSplitterLayoutPosition) + e.Position = MaximumHorizontalSplitterLayoutPosition-horizontalSplitterLayoutPosition; + } + } + + /// + /// splitterLightweightControlVertical_SplitterEndMove event handler. + /// + /// + /// + private void splitterLightweightControlVertical_SplitterEndMove(object sender, Project31.ApplicationFramework.LightweightSplitterEventArgs e) + { + // If the splitter has moved. + if (e.Position != 0) + { + // Adjust the vertical splitter position. + AdjustVerticalLightweightSplitterEventArgsPosition(ref e); + + // Adjust the preferred column width. + if (verticalSplitterStyle == VerticalSplitterStyle.Left) + PreferredColumnWidth -= e.Position; + else if (verticalSplitterStyle == VerticalSplitterStyle.Right) + PreferredColumnWidth += e.Position; + } + } + + /// + /// splitterLightweightControlVertical_SplitterMoving event handler. + /// + /// + /// + private void splitterLightweightControlVertical_SplitterMoving(object sender, Project31.ApplicationFramework.LightweightSplitterEventArgs e) + { + // If the splitter has moved. + if (e.Position != 0) + { + // Adjust the splitter position. + AdjustVerticalLightweightSplitterEventArgsPosition(ref e); + + // Adjust the preferred column width - in real time. + if (verticalSplitterStyle == VerticalSplitterStyle.Left) + PreferredColumnWidth -= e.Position; + else if (verticalSplitterStyle == VerticalSplitterStyle.Right) + PreferredColumnWidth += e.Position; + + // Update manually to keep the screen as up to date as possible. + Update(); + } + } + + /// + /// splitterLightweightControlHorizontal_SplitterEndMove event handler. + /// + /// + /// + private void splitterLightweightControlHorizontal_SplitterEndMove(object sender, Project31.ApplicationFramework.LightweightSplitterEventArgs e) + { + // If the splitter has moved. + if (e.Position != 0) + { + // Adjust the horizontal splitter position. + AdjustHorizontalLightweightSplitterEventArgsPosition(ref e); + + // Adjust the horizontal splitter position. + HorizontalSplitterPosition += (double)e.Position/PaneLayoutHeight; + + // Layout and invalidate. + PerformLayout(); + Invalidate(); + } + } + + /// + /// splitterLightweightControlHorizontal_SplitterMoving event handler. + /// + /// + /// + private void splitterLightweightControlHorizontal_SplitterMoving(object sender, Project31.ApplicationFramework.LightweightSplitterEventArgs e) + { + // If the splitter has moved. + if (e.Position != 0) + { + AdjustHorizontalLightweightSplitterEventArgsPosition(ref e); + + // Adjust the horizontal splitter position. + HorizontalSplitterPosition += (double)e.Position/PaneLayoutHeight; + + // Layout and invalidate. + PerformLayout(); + Invalidate(); + + // Update manually to keep the screen as up to date as possible. + Update(); + } + } + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationWorkspaceColumnPaneLightweightControl.cs b/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationWorkspaceColumnPaneLightweightControl.cs index 0ae68927..5c83fec3 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationWorkspaceColumnPaneLightweightControl.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationWorkspaceColumnPaneLightweightControl.cs @@ -12,118 +12,118 @@ using Project31.Controls; namespace Project31.ApplicationFramework { - /// - /// ApplicationWorkspaceColumnPaneLightweightControl. Internal helper class used by - /// ApplicationWorkspaceColumnLightweightControl. - /// - internal class ApplicationWorkspaceColumnPaneLightweightControl : LightweightControl - { - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; + /// + /// ApplicationWorkspaceColumnPaneLightweightControl. Internal helper class used by + /// ApplicationWorkspaceColumnLightweightControl. + /// + internal class ApplicationWorkspaceColumnPaneLightweightControl : LightweightControl + { + /// + /// Required designer variable. + /// + private System.ComponentModel.Container components = null; - /// - /// The control. - /// - private Control control; + /// + /// The control. + /// + private Control control; - /// - /// Gets or sets the control. - /// - public Control Control - { - get - { - return control; - } - set - { - if (control != value) - { - if (control != null) - control.Parent = null; + /// + /// Gets or sets the control. + /// + public Control Control + { + get + { + return control; + } + set + { + if (control != value) + { + if (control != null) + control.Parent = null; - control = value; + control = value; - PerformLayout(); - Invalidate(); - } - } - } + PerformLayout(); + Invalidate(); + } + } + } - /// - /// Initializes a new instance of the DummyPaneLightweightControl class. - /// - /// - public ApplicationWorkspaceColumnPaneLightweightControl(System.ComponentModel.IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); - } + /// + /// Initializes a new instance of the DummyPaneLightweightControl class. + /// + /// + public ApplicationWorkspaceColumnPaneLightweightControl(System.ComponentModel.IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); + } - /// - /// Initializes a new instance of the DummyPaneLightweightControl class. - /// - public ApplicationWorkspaceColumnPaneLightweightControl() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); - } + /// + /// Initializes a new instance of the DummyPaneLightweightControl class. + /// + public ApplicationWorkspaceColumnPaneLightweightControl() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - ((System.ComponentModel.ISupportInitialize)(this)).BeginInit(); - // - // ApplicationWorkspaceColumnPaneLightweightControl - // - this.Visible = false; - ((System.ComponentModel.ISupportInitialize)(this)).EndInit(); + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + ((System.ComponentModel.ISupportInitialize)(this)).BeginInit(); + // + // ApplicationWorkspaceColumnPaneLightweightControl + // + this.Visible = false; + ((System.ComponentModel.ISupportInitialize)(this)).EndInit(); - } - #endregion + } + #endregion - protected override void OnLayout(EventArgs e) - { - // Call the base class's method so that registered delegates receive the event. - base.OnLayout(e); + protected override void OnLayout(EventArgs e) + { + // Call the base class's method so that registered delegates receive the event. + base.OnLayout(e); - // Layout the control. - if (control != null) - { - // - if (control.Parent != Parent) - control.Parent = Parent; + // Layout the control. + if (control != null) + { + // + if (control.Parent != Parent) + control.Parent = Parent; - // - Rectangle layoutRectangle = VirtualClientRectangle; - layoutRectangle.Inflate(-1, -1); - control.Bounds = VirtualClientRectangleToParent(layoutRectangle); - } - } + // + Rectangle layoutRectangle = VirtualClientRectangle; + layoutRectangle.Inflate(-1, -1); + control.Bounds = VirtualClientRectangleToParent(layoutRectangle); + } + } - /// - /// Raises the Paint event. - /// - /// A PaintEventArgs that contains the event data. - protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) - { - // Call the base class's method so that registered delegates receive the event. - base.OnPaint(e); + /// + /// Raises the Paint event. + /// + /// A PaintEventArgs that contains the event data. + protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) + { + // Call the base class's method so that registered delegates receive the event. + base.OnPaint(e); - // Solid background color. - using (SolidBrush backgroundBrush = new SolidBrush(ApplicationManager.ApplicationStyle.BorderColor)) - e.Graphics.FillRectangle(backgroundBrush, VirtualClientRectangle); - } - } + // Solid background color. + using (SolidBrush backgroundBrush = new SolidBrush(ApplicationManager.ApplicationStyle.BorderColor)) + e.Graphics.FillRectangle(backgroundBrush, VirtualClientRectangle); + } + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationWorkspaceCommandBarLightweightControl.cs b/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationWorkspaceCommandBarLightweightControl.cs index ecb8e200..dfe66e6a 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationWorkspaceCommandBarLightweightControl.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationWorkspaceCommandBarLightweightControl.cs @@ -11,98 +11,98 @@ using System.Windows.Forms; namespace Project31.ApplicationFramework { - /// - /// ApplicationCommandBar lightweight control. Provides the CommandBarLightweightControl for - /// the ApplicationWorkspace. - /// - public class ApplicationWorkspaceCommandBarLightweightControl : CommandBarLightweightControl - { - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; + /// + /// ApplicationCommandBar lightweight control. Provides the CommandBarLightweightControl for + /// the ApplicationWorkspace. + /// + public class ApplicationWorkspaceCommandBarLightweightControl : CommandBarLightweightControl + { + /// + /// Required designer variable. + /// + private System.ComponentModel.Container components = null; - /// - /// Initializes a new instance of the ApplicationCommandBarLightweightControl class. - /// - public ApplicationWorkspaceCommandBarLightweightControl() - { - // This call is required by the Windows.Forms Form Designer. - InitializeComponent(); - } + /// + /// Initializes a new instance of the ApplicationCommandBarLightweightControl class. + /// + public ApplicationWorkspaceCommandBarLightweightControl() + { + // This call is required by the Windows.Forms Form Designer. + InitializeComponent(); + } - /// - /// Initializes a new instance of the ApplicationCommandBarLightweightControl class. - /// - /// - public ApplicationWorkspaceCommandBarLightweightControl(System.ComponentModel.IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); - } + /// + /// Initializes a new instance of the ApplicationCommandBarLightweightControl class. + /// + /// + public ApplicationWorkspaceCommandBarLightweightControl(System.ComponentModel.IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - components = new System.ComponentModel.Container(); - } - #endregion + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + } + #endregion - /// - /// Raises the Paint event. - /// - /// A PaintEventArgs that contains the event data. - protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) - { - // Fill the background. - if (ApplicationManager.ApplicationStyle.ApplicationWorkspaceCommandBarTopColor == ApplicationManager.ApplicationStyle.ApplicationWorkspaceCommandBarBottomColor) - using (SolidBrush solidBrush = new SolidBrush(ApplicationManager.ApplicationStyle.ApplicationWorkspaceCommandBarTopColor)) - e.Graphics.FillRectangle(solidBrush, VirtualClientRectangle); - else - using (LinearGradientBrush linearGradientBrush = new LinearGradientBrush(VirtualClientRectangle, ApplicationManager.ApplicationStyle.ApplicationWorkspaceCommandBarTopColor, ApplicationManager.ApplicationStyle.ApplicationWorkspaceCommandBarBottomColor, LinearGradientMode.Vertical)) - e.Graphics.FillRectangle(linearGradientBrush, VirtualClientRectangle); + /// + /// Raises the Paint event. + /// + /// A PaintEventArgs that contains the event data. + protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) + { + // Fill the background. + if (ApplicationManager.ApplicationStyle.ApplicationWorkspaceCommandBarTopColor == ApplicationManager.ApplicationStyle.ApplicationWorkspaceCommandBarBottomColor) + using (SolidBrush solidBrush = new SolidBrush(ApplicationManager.ApplicationStyle.ApplicationWorkspaceCommandBarTopColor)) + e.Graphics.FillRectangle(solidBrush, VirtualClientRectangle); + else + using (LinearGradientBrush linearGradientBrush = new LinearGradientBrush(VirtualClientRectangle, ApplicationManager.ApplicationStyle.ApplicationWorkspaceCommandBarTopColor, ApplicationManager.ApplicationStyle.ApplicationWorkspaceCommandBarBottomColor, LinearGradientMode.Vertical)) + e.Graphics.FillRectangle(linearGradientBrush, VirtualClientRectangle); - // Draw the first line of the top bevel. - using (SolidBrush solidBrush = new SolidBrush(ApplicationManager.ApplicationStyle.ApplicationWorkspaceCommandBarTopBevelFirstLineColor)) - e.Graphics.FillRectangle(solidBrush, 0, 0, VirtualWidth, 1); + // Draw the first line of the top bevel. + using (SolidBrush solidBrush = new SolidBrush(ApplicationManager.ApplicationStyle.ApplicationWorkspaceCommandBarTopBevelFirstLineColor)) + e.Graphics.FillRectangle(solidBrush, 0, 0, VirtualWidth, 1); - // Draw the second line of the top bevel. - using (SolidBrush solidBrush = new SolidBrush(ApplicationManager.ApplicationStyle.ApplicationWorkspaceCommandBarTopBevelSecondLineColor)) - e.Graphics.FillRectangle(solidBrush, 0, 1, VirtualWidth, 1); + // Draw the second line of the top bevel. + using (SolidBrush solidBrush = new SolidBrush(ApplicationManager.ApplicationStyle.ApplicationWorkspaceCommandBarTopBevelSecondLineColor)) + e.Graphics.FillRectangle(solidBrush, 0, 1, VirtualWidth, 1); - // Draw the first line of the bottom bevel. - using (SolidBrush solidBrush = new SolidBrush(ApplicationManager.ApplicationStyle.ApplicationWorkspaceCommandBarBottomBevelFirstLineColor)) - e.Graphics.FillRectangle(solidBrush, 0, VirtualHeight-2, VirtualWidth, 1); + // Draw the first line of the bottom bevel. + using (SolidBrush solidBrush = new SolidBrush(ApplicationManager.ApplicationStyle.ApplicationWorkspaceCommandBarBottomBevelFirstLineColor)) + e.Graphics.FillRectangle(solidBrush, 0, VirtualHeight-2, VirtualWidth, 1); - // Draw the first line of the bottom bevel. - using (SolidBrush solidBrush = new SolidBrush(ApplicationManager.ApplicationStyle.ApplicationWorkspaceCommandBarBottomBevelSecondLineColor)) - e.Graphics.FillRectangle(solidBrush, 0, VirtualHeight-1, VirtualWidth, 1); + // Draw the first line of the bottom bevel. + using (SolidBrush solidBrush = new SolidBrush(ApplicationManager.ApplicationStyle.ApplicationWorkspaceCommandBarBottomBevelSecondLineColor)) + e.Graphics.FillRectangle(solidBrush, 0, VirtualHeight-1, VirtualWidth, 1); - // Call the base class's method so that registered delegates receive the event. - base.OnPaint(e); - } + // Call the base class's method so that registered delegates receive the event. + base.OnPaint(e); + } - } + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationWorkspaceControl.cs b/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationWorkspaceControl.cs index e84da081..10dcf5bb 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationWorkspaceControl.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/ApplicationWorkspaceControl.cs @@ -13,625 +13,625 @@ using Project31.CoreServices; namespace Project31.ApplicationFramework { - /// - /// The ApplicationWorkspaceControl control provides a multi-pane workspace, with an optional - /// command bar. - /// - public class ApplicationWorkspaceControl : Project31.Controls.LightweightControlContainerControl - { - /// - /// The default left column preferred width. - /// - private const int LEFT_COLUMN_DEFAULT_PREFERRED_WIDTH = 150; + /// + /// The ApplicationWorkspaceControl control provides a multi-pane workspace, with an optional + /// command bar. + /// + public class ApplicationWorkspaceControl : Project31.Controls.LightweightControlContainerControl + { + /// + /// The default left column preferred width. + /// + private const int LEFT_COLUMN_DEFAULT_PREFERRED_WIDTH = 150; - /// - /// The default center column preferred width. - /// - private const int CENTER_COLUMN_DEFAULT_PREFERRED_WIDTH = 20; + /// + /// The default center column preferred width. + /// + private const int CENTER_COLUMN_DEFAULT_PREFERRED_WIDTH = 20; - /// - /// The default right column preferred width. - /// - private const int RIGHT_COLUMN_DEFAULT_PREFERRED_WIDTH = 150; + /// + /// The default right column preferred width. + /// + private const int RIGHT_COLUMN_DEFAULT_PREFERRED_WIDTH = 150; - /// - /// The default left column minimum width. - /// - private const int LEFT_COLUMN_DEFAULT_MINIMUM_WIDTH = 10; + /// + /// The default left column minimum width. + /// + private const int LEFT_COLUMN_DEFAULT_MINIMUM_WIDTH = 10; - /// - /// The default center column minimum width. - /// - private const int CENTER_COLUMN_DEFAULT_MINIMUM_WIDTH = 10; + /// + /// The default center column minimum width. + /// + private const int CENTER_COLUMN_DEFAULT_MINIMUM_WIDTH = 10; - /// - /// The default right column minimum width. - /// - private const int RIGHT_COLUMN_DEFAULT_MINIMUM_WIDTH = 10; + /// + /// The default right column minimum width. + /// + private const int RIGHT_COLUMN_DEFAULT_MINIMUM_WIDTH = 10; - /// - /// Required designer cruft. - /// - private System.ComponentModel.IContainer components = null; + /// + /// Required designer cruft. + /// + private System.ComponentModel.IContainer components = null; - /// - /// The column layout margin. - /// - private Size columnLayoutMargin = new Size(3, 3); + /// + /// The column layout margin. + /// + private Size columnLayoutMargin = new Size(3, 3); - /// - /// Gets or sets the column layout margin. - /// - [ - Category("Appearance"), - DefaultValue(typeof(Size), "3, 3"), - Description("Specifies the column layout margin.") - ] - public Size ColumnLayoutMargin - { - get - { - return columnLayoutMargin; - } - set - { - columnLayoutMargin = value; - } - } + /// + /// Gets or sets the column layout margin. + /// + [ + Category("Appearance"), + DefaultValue(typeof(Size), "3, 3"), + Description("Specifies the column layout margin.") + ] + public Size ColumnLayoutMargin + { + get + { + return columnLayoutMargin; + } + set + { + columnLayoutMargin = value; + } + } - /// - /// Gets or sets the command bar definition. - /// - public CommandBarDefinition CommandBarDefinition - { - get - { - return applicationWorkspaceCommandBarLightweightControl.CommandBarDefinition; - } - set - { - applicationWorkspaceCommandBarLightweightControl.CommandBarDefinition = value; - PerformLayout(); - Invalidate(); - } - } + /// + /// Gets or sets the command bar definition. + /// + public CommandBarDefinition CommandBarDefinition + { + get + { + return applicationWorkspaceCommandBarLightweightControl.CommandBarDefinition; + } + set + { + applicationWorkspaceCommandBarLightweightControl.CommandBarDefinition = value; + PerformLayout(); + Invalidate(); + } + } - /// - /// The application workspace command bar lightweight control. - /// - private Project31.ApplicationFramework.ApplicationWorkspaceCommandBarLightweightControl applicationWorkspaceCommandBarLightweightControl; + /// + /// The application workspace command bar lightweight control. + /// + private Project31.ApplicationFramework.ApplicationWorkspaceCommandBarLightweightControl applicationWorkspaceCommandBarLightweightControl; - /// - /// The left ApplicationWorkspaceColumnLightweightControl. - /// - private Project31.ApplicationFramework.ApplicationWorkspaceColumnLightweightControl leftColumn; + /// + /// The left ApplicationWorkspaceColumnLightweightControl. + /// + private Project31.ApplicationFramework.ApplicationWorkspaceColumnLightweightControl leftColumn; - /// - /// Gets the left ApplicationWorkspaceColumnLightweightControl. - /// - public ApplicationWorkspaceColumnLightweightControl LeftColumn - { - get - { - return leftColumn; - } - } + /// + /// Gets the left ApplicationWorkspaceColumnLightweightControl. + /// + public ApplicationWorkspaceColumnLightweightControl LeftColumn + { + get + { + return leftColumn; + } + } - /// - /// The center ApplicationWorkspaceColumnLightweightControl. - /// - private Project31.ApplicationFramework.ApplicationWorkspaceColumnLightweightControl centerColumn; + /// + /// The center ApplicationWorkspaceColumnLightweightControl. + /// + private Project31.ApplicationFramework.ApplicationWorkspaceColumnLightweightControl centerColumn; - /// - /// Gets the center ApplicationWorkspaceColumnLightweightControl. - /// - public ApplicationWorkspaceColumnLightweightControl CenterColumn - { - get - { - return centerColumn; - } - } + /// + /// Gets the center ApplicationWorkspaceColumnLightweightControl. + /// + public ApplicationWorkspaceColumnLightweightControl CenterColumn + { + get + { + return centerColumn; + } + } - /// - /// The right ApplicationWorkspaceColumnLightweightControl. - /// - private Project31.ApplicationFramework.ApplicationWorkspaceColumnLightweightControl rightColumn; + /// + /// The right ApplicationWorkspaceColumnLightweightControl. + /// + private Project31.ApplicationFramework.ApplicationWorkspaceColumnLightweightControl rightColumn; - /// - /// Gets the right ApplicationWorkspaceColumnLightweightControl. - /// - public ApplicationWorkspaceColumnLightweightControl RightColumn - { - get - { - return rightColumn; - } - } + /// + /// Gets the right ApplicationWorkspaceColumnLightweightControl. + /// + public ApplicationWorkspaceColumnLightweightControl RightColumn + { + get + { + return rightColumn; + } + } - /// - /// Initializes a new instance of the ApplicationWorkspaceControl class. - /// - public ApplicationWorkspaceControl() - { - // This call is required by the Windows Form Designer. - InitializeComponent(); + /// + /// Initializes a new instance of the ApplicationWorkspaceControl class. + /// + public ApplicationWorkspaceControl() + { + // This call is required by the Windows Form Designer. + InitializeComponent(); - // Turn on double buffered painting. - SetStyle(ControlStyles.UserPaint, true); - SetStyle(ControlStyles.DoubleBuffer, true); - SetStyle(ControlStyles.AllPaintingInWmPaint, true); - } + // Turn on double buffered painting. + SetStyle(ControlStyles.UserPaint, true); + SetStyle(ControlStyles.DoubleBuffer, true); + SetStyle(ControlStyles.AllPaintingInWmPaint, true); + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if (components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if (components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - this.applicationWorkspaceCommandBarLightweightControl = new Project31.ApplicationFramework.ApplicationWorkspaceCommandBarLightweightControl(this.components); - this.leftColumn = new Project31.ApplicationFramework.ApplicationWorkspaceColumnLightweightControl(); - this.centerColumn = new Project31.ApplicationFramework.ApplicationWorkspaceColumnLightweightControl(); - this.rightColumn = new Project31.ApplicationFramework.ApplicationWorkspaceColumnLightweightControl(); - ((System.ComponentModel.ISupportInitialize)(this.applicationWorkspaceCommandBarLightweightControl)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.leftColumn)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.centerColumn)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.rightColumn)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this)).BeginInit(); - // - // applicationWorkspaceCommandBarLightweightControl - // - this.applicationWorkspaceCommandBarLightweightControl.LayoutMargin = new System.Drawing.Size(1, 2); - this.applicationWorkspaceCommandBarLightweightControl.LightweightControlContainerControl = this; - this.applicationWorkspaceCommandBarLightweightControl.Visible = false; - // - // leftColumn - // - this.leftColumn.HorizontalSplitterHeight = 4; - this.leftColumn.LightweightControlContainerControl = this; - this.leftColumn.MinimumColumnWidth = 30; - this.leftColumn.PreferredColumnWidth = 150; - this.leftColumn.VerticalSplitterWidth = 4; - this.leftColumn.MaximumColumnWidthChanged += new System.EventHandler(this.leftColumn_MaximumColumnWidthChanged); - this.leftColumn.PreferredColumnWidthChanged += new System.EventHandler(this.leftColumn_PreferredColumnWidthChanged); - this.leftColumn.MinimumColumnWidthChanged += new System.EventHandler(this.leftColumn_MinimumColumnWidthChanged); - // - // centerColumn - // - this.centerColumn.HorizontalSplitterHeight = 4; - this.centerColumn.LightweightControlContainerControl = this; - this.centerColumn.MinimumColumnWidth = 30; - this.centerColumn.PreferredColumnWidth = 30; - this.centerColumn.VerticalSplitterWidth = 4; - // - // rightColumn - // - this.rightColumn.HorizontalSplitterHeight = 4; - this.rightColumn.LightweightControlContainerControl = this; - this.rightColumn.MinimumColumnWidth = 30; - this.rightColumn.PreferredColumnWidth = 150; - this.rightColumn.VerticalSplitterWidth = 4; - this.rightColumn.MaximumColumnWidthChanged += new System.EventHandler(this.rightColumn_MaximumColumnWidthChanged); - this.rightColumn.PreferredColumnWidthChanged += new System.EventHandler(this.rightColumn_PreferredColumnWidthChanged); - this.rightColumn.MinimumColumnWidthChanged += new System.EventHandler(this.rightColumn_MinimumColumnWidthChanged); - // - // ApplicationWorkspaceControl - // - this.BackColor = System.Drawing.SystemColors.Control; - this.Name = "ApplicationWorkspaceControl"; - this.Size = new System.Drawing.Size(294, 286); - ((System.ComponentModel.ISupportInitialize)(this.applicationWorkspaceCommandBarLightweightControl)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.leftColumn)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.centerColumn)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.rightColumn)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this)).EndInit(); + #region Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.applicationWorkspaceCommandBarLightweightControl = new Project31.ApplicationFramework.ApplicationWorkspaceCommandBarLightweightControl(this.components); + this.leftColumn = new Project31.ApplicationFramework.ApplicationWorkspaceColumnLightweightControl(); + this.centerColumn = new Project31.ApplicationFramework.ApplicationWorkspaceColumnLightweightControl(); + this.rightColumn = new Project31.ApplicationFramework.ApplicationWorkspaceColumnLightweightControl(); + ((System.ComponentModel.ISupportInitialize)(this.applicationWorkspaceCommandBarLightweightControl)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.leftColumn)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.centerColumn)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.rightColumn)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this)).BeginInit(); + // + // applicationWorkspaceCommandBarLightweightControl + // + this.applicationWorkspaceCommandBarLightweightControl.LayoutMargin = new System.Drawing.Size(1, 2); + this.applicationWorkspaceCommandBarLightweightControl.LightweightControlContainerControl = this; + this.applicationWorkspaceCommandBarLightweightControl.Visible = false; + // + // leftColumn + // + this.leftColumn.HorizontalSplitterHeight = 4; + this.leftColumn.LightweightControlContainerControl = this; + this.leftColumn.MinimumColumnWidth = 30; + this.leftColumn.PreferredColumnWidth = 150; + this.leftColumn.VerticalSplitterWidth = 4; + this.leftColumn.MaximumColumnWidthChanged += new System.EventHandler(this.leftColumn_MaximumColumnWidthChanged); + this.leftColumn.PreferredColumnWidthChanged += new System.EventHandler(this.leftColumn_PreferredColumnWidthChanged); + this.leftColumn.MinimumColumnWidthChanged += new System.EventHandler(this.leftColumn_MinimumColumnWidthChanged); + // + // centerColumn + // + this.centerColumn.HorizontalSplitterHeight = 4; + this.centerColumn.LightweightControlContainerControl = this; + this.centerColumn.MinimumColumnWidth = 30; + this.centerColumn.PreferredColumnWidth = 30; + this.centerColumn.VerticalSplitterWidth = 4; + // + // rightColumn + // + this.rightColumn.HorizontalSplitterHeight = 4; + this.rightColumn.LightweightControlContainerControl = this; + this.rightColumn.MinimumColumnWidth = 30; + this.rightColumn.PreferredColumnWidth = 150; + this.rightColumn.VerticalSplitterWidth = 4; + this.rightColumn.MaximumColumnWidthChanged += new System.EventHandler(this.rightColumn_MaximumColumnWidthChanged); + this.rightColumn.PreferredColumnWidthChanged += new System.EventHandler(this.rightColumn_PreferredColumnWidthChanged); + this.rightColumn.MinimumColumnWidthChanged += new System.EventHandler(this.rightColumn_MinimumColumnWidthChanged); + // + // ApplicationWorkspaceControl + // + this.BackColor = System.Drawing.SystemColors.Control; + this.Name = "ApplicationWorkspaceControl"; + this.Size = new System.Drawing.Size(294, 286); + ((System.ComponentModel.ISupportInitialize)(this.applicationWorkspaceCommandBarLightweightControl)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.leftColumn)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.centerColumn)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.rightColumn)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this)).EndInit(); - } - #endregion + } + #endregion - /// - /// Raises the Layout event. - /// - /// A LayoutEventArgs that contains the event data. - protected override void OnLayout(LayoutEventArgs e) - { - // Call the base class's method so that registered delegates receive the event. - base.OnLayout(e); + /// + /// Raises the Layout event. + /// + /// A LayoutEventArgs that contains the event data. + protected override void OnLayout(LayoutEventArgs e) + { + // Call the base class's method so that registered delegates receive the event. + base.OnLayout(e); - // Layout the application workspace command bar lightweight control. The return is the column - // layout rectangle. - Rectangle columnLayoutRectangle = LayoutApplicationWorkspaceCommandBar(); + // Layout the application workspace command bar lightweight control. The return is the column + // layout rectangle. + Rectangle columnLayoutRectangle = LayoutApplicationWorkspaceCommandBar(); - // Set the initial (to be adjusted below) column widths. - int leftColumnWidth = LeftColumnPreferredWidth; - int centerColumnWidth = CenterColumnMinimumWidth; - int rightColumnWidth = RightColumnPreferredWidth; + // Set the initial (to be adjusted below) column widths. + int leftColumnWidth = LeftColumnPreferredWidth; + int centerColumnWidth = CenterColumnMinimumWidth; + int rightColumnWidth = RightColumnPreferredWidth; - // Adjust the column widths as needed for the layout width. - if (leftColumnWidth+centerColumnWidth+rightColumnWidth > columnLayoutRectangle.Width) - { - // Calculate the width that is available to the left and right columns. - int availableWidth = columnLayoutRectangle.Width-centerColumnWidth; + // Adjust the column widths as needed for the layout width. + if (leftColumnWidth+centerColumnWidth+rightColumnWidth > columnLayoutRectangle.Width) + { + // Calculate the width that is available to the left and right columns. + int availableWidth = columnLayoutRectangle.Width-centerColumnWidth; - // Adjust the left and right column widths. - if (LeftColumnVisible && RightColumnVisible) - { - // Calculate the relative width of the left column. - double leftColumnRelativeWidth = ((double)leftColumnWidth)/(leftColumnWidth+rightColumnWidth); + // Adjust the left and right column widths. + if (LeftColumnVisible && RightColumnVisible) + { + // Calculate the relative width of the left column. + double leftColumnRelativeWidth = ((double)leftColumnWidth)/(leftColumnWidth+rightColumnWidth); - // Adjust the left and right column widths. - leftColumnWidth = Math.Max((int)(leftColumnRelativeWidth*availableWidth), LeftColumnMinimumWidth); - rightColumnWidth = Math.Max(availableWidth-leftColumnWidth, RightColumnMinimumWidth); - } - else if (LeftColumnVisible) - { - // Only the left column is visible, so it gets all the available width. - leftColumnWidth = Math.Max(availableWidth, LeftColumnMinimumWidth); - } - else if (RightColumnVisible) - { - // Only the right column is visible, so it gets all the available width. - rightColumnWidth = Math.Max(availableWidth, RightColumnMinimumWidth); - } - } - else - { - // We have a surplus of room. Allocate additional space to the center column, if - // if is visible, or the left column if it is not. - if (CenterColumnVisible) - centerColumnWidth = columnLayoutRectangle.Width-(leftColumnWidth+rightColumnWidth); - else - leftColumnWidth = columnLayoutRectangle.Width-rightColumnWidth; - } + // Adjust the left and right column widths. + leftColumnWidth = Math.Max((int)(leftColumnRelativeWidth*availableWidth), LeftColumnMinimumWidth); + rightColumnWidth = Math.Max(availableWidth-leftColumnWidth, RightColumnMinimumWidth); + } + else if (LeftColumnVisible) + { + // Only the left column is visible, so it gets all the available width. + leftColumnWidth = Math.Max(availableWidth, LeftColumnMinimumWidth); + } + else if (RightColumnVisible) + { + // Only the right column is visible, so it gets all the available width. + rightColumnWidth = Math.Max(availableWidth, RightColumnMinimumWidth); + } + } + else + { + // We have a surplus of room. Allocate additional space to the center column, if + // if is visible, or the left column if it is not. + if (CenterColumnVisible) + centerColumnWidth = columnLayoutRectangle.Width-(leftColumnWidth+rightColumnWidth); + else + leftColumnWidth = columnLayoutRectangle.Width-rightColumnWidth; + } - // Set the layout X offset. - int layoutX = columnLayoutRectangle.X; + // Set the layout X offset. + int layoutX = columnLayoutRectangle.X; - // Layout the left column, if it is visible. - if (LeftColumnVisible) - { - // Set the virtual bounds of the left column. - leftColumn.VirtualBounds = new Rectangle( layoutX, - columnLayoutRectangle.Y, - leftColumnWidth, - columnLayoutRectangle.Height); + // Layout the left column, if it is visible. + if (LeftColumnVisible) + { + // Set the virtual bounds of the left column. + leftColumn.VirtualBounds = new Rectangle( layoutX, + columnLayoutRectangle.Y, + leftColumnWidth, + columnLayoutRectangle.Height); - // Adjust the layout X to account for the left column. - layoutX += leftColumnWidth; + // Adjust the layout X to account for the left column. + layoutX += leftColumnWidth; - // Update the left column vertical splitter and maximum column width. - if (CenterColumnVisible) - { - // Turn on the left column vertical splitter on the right side. - leftColumn.VerticalSplitter = VerticalSplitterStyle.Right; + // Update the left column vertical splitter and maximum column width. + if (CenterColumnVisible) + { + // Turn on the left column vertical splitter on the right side. + leftColumn.VerticalSplitter = VerticalSplitterStyle.Right; - // Set the left column's maximum width. - leftColumn.MaximumColumnWidth = columnLayoutRectangle.Width- - (CenterColumnMinimumWidth+this.RightColumnPreferredWidth); - } - else - { - leftColumn.VerticalSplitter = VerticalSplitterStyle.None; - leftColumn.MaximumColumnWidth = 0; - } - } + // Set the left column's maximum width. + leftColumn.MaximumColumnWidth = columnLayoutRectangle.Width- + (CenterColumnMinimumWidth+this.RightColumnPreferredWidth); + } + else + { + leftColumn.VerticalSplitter = VerticalSplitterStyle.None; + leftColumn.MaximumColumnWidth = 0; + } + } - // Layout the center column. - if (CenterColumnVisible) - { - // Set the virtual bounds of the center column. - centerColumn.VirtualBounds = new Rectangle( layoutX, - columnLayoutRectangle.Y, - centerColumnWidth, - columnLayoutRectangle.Height); + // Layout the center column. + if (CenterColumnVisible) + { + // Set the virtual bounds of the center column. + centerColumn.VirtualBounds = new Rectangle( layoutX, + columnLayoutRectangle.Y, + centerColumnWidth, + columnLayoutRectangle.Height); - // Adjust the layout X to account for the center column. - layoutX += centerColumnWidth; + // Adjust the layout X to account for the center column. + layoutX += centerColumnWidth; - // The center column never has a vertical splitter or a maximum column width. - centerColumn.VerticalSplitter = VerticalSplitterStyle.None; - centerColumn.MaximumColumnWidth = 0; - } + // The center column never has a vertical splitter or a maximum column width. + centerColumn.VerticalSplitter = VerticalSplitterStyle.None; + centerColumn.MaximumColumnWidth = 0; + } - // Layout the right column. - if (RightColumnVisible) - { - // Set the virtual bounds of the right column. - rightColumn.VirtualBounds = new Rectangle( layoutX, - columnLayoutRectangle.Y, - rightColumnWidth, - columnLayoutRectangle.Height); + // Layout the right column. + if (RightColumnVisible) + { + // Set the virtual bounds of the right column. + rightColumn.VirtualBounds = new Rectangle( layoutX, + columnLayoutRectangle.Y, + rightColumnWidth, + columnLayoutRectangle.Height); - // Update the right column vertical splitter and maximum column width. - if (CenterColumnVisible || LeftColumnVisible) - { - // Turn on the right column's vertical splitter on the left side. - rightColumn.VerticalSplitter = VerticalSplitterStyle.Left; + // Update the right column vertical splitter and maximum column width. + if (CenterColumnVisible || LeftColumnVisible) + { + // Turn on the right column's vertical splitter on the left side. + rightColumn.VerticalSplitter = VerticalSplitterStyle.Left; - // Set the right column's maximum width. - rightColumn.MaximumColumnWidth = columnLayoutRectangle.Width- - (LeftColumnPreferredWidth+CenterColumnMinimumWidth); - } - else - { - rightColumn.VerticalSplitter = VerticalSplitterStyle.None; - rightColumn.MaximumColumnWidth = 0; - } - } - } + // Set the right column's maximum width. + rightColumn.MaximumColumnWidth = columnLayoutRectangle.Width- + (LeftColumnPreferredWidth+CenterColumnMinimumWidth); + } + else + { + rightColumn.VerticalSplitter = VerticalSplitterStyle.None; + rightColumn.MaximumColumnWidth = 0; + } + } + } - /// - /// Override background painting. - /// - /// A PaintEventArgs that contains the event data. - protected override void OnPaintBackground(System.Windows.Forms.PaintEventArgs e) - { - // Fill the background. - using (LinearGradientBrush linearGradientBrush = new LinearGradientBrush(ClientRectangle, ApplicationManager.ApplicationStyle.ApplicationWorkspaceTopColor, ApplicationManager.ApplicationStyle.ApplicationWorkspaceBottomColor, LinearGradientMode.ForwardDiagonal)) - e.Graphics.FillRectangle(linearGradientBrush, ClientRectangle); - } + /// + /// Override background painting. + /// + /// A PaintEventArgs that contains the event data. + protected override void OnPaintBackground(System.Windows.Forms.PaintEventArgs e) + { + // Fill the background. + using (LinearGradientBrush linearGradientBrush = new LinearGradientBrush(ClientRectangle, ApplicationManager.ApplicationStyle.ApplicationWorkspaceTopColor, ApplicationManager.ApplicationStyle.ApplicationWorkspaceBottomColor, LinearGradientMode.ForwardDiagonal)) + e.Graphics.FillRectangle(linearGradientBrush, ClientRectangle); + } - /// - /// Gets a value indicating whether the left column is visible. - /// - private bool LeftColumnVisible - { - get - { - return leftColumn != null && leftColumn.Visible; - } - } + /// + /// Gets a value indicating whether the left column is visible. + /// + private bool LeftColumnVisible + { + get + { + return leftColumn != null && leftColumn.Visible; + } + } - /// - /// Gets a value indicating whether the center column is visible. - /// - private bool CenterColumnVisible - { - get - { - return centerColumn != null && centerColumn.Visible; - } - } + /// + /// Gets a value indicating whether the center column is visible. + /// + private bool CenterColumnVisible + { + get + { + return centerColumn != null && centerColumn.Visible; + } + } - /// - /// Gets a value indicating whether the right column is visible. - /// - private bool RightColumnVisible - { - get - { - return rightColumn != null && rightColumn.Visible; - } - } + /// + /// Gets a value indicating whether the right column is visible. + /// + private bool RightColumnVisible + { + get + { + return rightColumn != null && rightColumn.Visible; + } + } - /// - /// Gets the preferred width of the left column. - /// - private int LeftColumnPreferredWidth - { - get - { - if (!LeftColumnVisible) - return 0; - else - { - if (leftColumn.PreferredColumnWidth == 0) - leftColumn.PreferredColumnWidth = LEFT_COLUMN_DEFAULT_PREFERRED_WIDTH; - return leftColumn.PreferredColumnWidth; - } - } - } + /// + /// Gets the preferred width of the left column. + /// + private int LeftColumnPreferredWidth + { + get + { + if (!LeftColumnVisible) + return 0; + else + { + if (leftColumn.PreferredColumnWidth == 0) + leftColumn.PreferredColumnWidth = LEFT_COLUMN_DEFAULT_PREFERRED_WIDTH; + return leftColumn.PreferredColumnWidth; + } + } + } - /// - /// Gets the preferred width of the center column. - /// - private int CenterColumnPreferredWidth - { - get - { - if (!CenterColumnVisible) - return 0; - else - { - if (centerColumn.PreferredColumnWidth == 0) - centerColumn.PreferredColumnWidth = CENTER_COLUMN_DEFAULT_PREFERRED_WIDTH; - return centerColumn.PreferredColumnWidth; - } - } - } + /// + /// Gets the preferred width of the center column. + /// + private int CenterColumnPreferredWidth + { + get + { + if (!CenterColumnVisible) + return 0; + else + { + if (centerColumn.PreferredColumnWidth == 0) + centerColumn.PreferredColumnWidth = CENTER_COLUMN_DEFAULT_PREFERRED_WIDTH; + return centerColumn.PreferredColumnWidth; + } + } + } - /// - /// Gets the preferred width of the right column. - /// - private int RightColumnPreferredWidth - { - get - { - if (!RightColumnVisible) - return 0; - else - { - if (rightColumn.PreferredColumnWidth == 0) - rightColumn.PreferredColumnWidth = RIGHT_COLUMN_DEFAULT_PREFERRED_WIDTH; - return rightColumn.PreferredColumnWidth; - } - } - } + /// + /// Gets the preferred width of the right column. + /// + private int RightColumnPreferredWidth + { + get + { + if (!RightColumnVisible) + return 0; + else + { + if (rightColumn.PreferredColumnWidth == 0) + rightColumn.PreferredColumnWidth = RIGHT_COLUMN_DEFAULT_PREFERRED_WIDTH; + return rightColumn.PreferredColumnWidth; + } + } + } - /// - /// Gets the minimum width of the left column. - /// - private int LeftColumnMinimumWidth - { - get - { - if (!LeftColumnVisible) - return 0; - else - { - if (leftColumn.MinimumColumnWidth == 0) - leftColumn.MinimumColumnWidth = LEFT_COLUMN_DEFAULT_MINIMUM_WIDTH; - return leftColumn.MinimumColumnWidth; - } - } - } + /// + /// Gets the minimum width of the left column. + /// + private int LeftColumnMinimumWidth + { + get + { + if (!LeftColumnVisible) + return 0; + else + { + if (leftColumn.MinimumColumnWidth == 0) + leftColumn.MinimumColumnWidth = LEFT_COLUMN_DEFAULT_MINIMUM_WIDTH; + return leftColumn.MinimumColumnWidth; + } + } + } - /// - /// Gets the minimum width of the center column. - /// - private int CenterColumnMinimumWidth - { - get - { - if (!CenterColumnVisible) - return 0; - else - { - if (centerColumn.MinimumColumnWidth == 0) - centerColumn.MinimumColumnWidth = CENTER_COLUMN_DEFAULT_MINIMUM_WIDTH; - return centerColumn.MinimumColumnWidth; - } - } - } + /// + /// Gets the minimum width of the center column. + /// + private int CenterColumnMinimumWidth + { + get + { + if (!CenterColumnVisible) + return 0; + else + { + if (centerColumn.MinimumColumnWidth == 0) + centerColumn.MinimumColumnWidth = CENTER_COLUMN_DEFAULT_MINIMUM_WIDTH; + return centerColumn.MinimumColumnWidth; + } + } + } - /// - /// Gets the minimum width of the right column. - /// - private int RightColumnMinimumWidth - { - get - { - if (!RightColumnVisible) - return 0; - else - { - if (rightColumn.MinimumColumnWidth == 0) - rightColumn.MinimumColumnWidth = RIGHT_COLUMN_DEFAULT_MINIMUM_WIDTH; - return rightColumn.MinimumColumnWidth; - } - } - } + /// + /// Gets the minimum width of the right column. + /// + private int RightColumnMinimumWidth + { + get + { + if (!RightColumnVisible) + return 0; + else + { + if (rightColumn.MinimumColumnWidth == 0) + rightColumn.MinimumColumnWidth = RIGHT_COLUMN_DEFAULT_MINIMUM_WIDTH; + return rightColumn.MinimumColumnWidth; + } + } + } - /// - /// Layout the application workspace command bar. - /// - /// Column layout rectangle. - private Rectangle LayoutApplicationWorkspaceCommandBar() - { - // The application workspace command bar height (set below). - int applicationWorkspaceCommandBarHeight = 0; + /// + /// Layout the application workspace command bar. + /// + /// Column layout rectangle. + private Rectangle LayoutApplicationWorkspaceCommandBar() + { + // The application workspace command bar height (set below). + int applicationWorkspaceCommandBarHeight = 0; - // If we have an application workspace command bar lightweight control, lay it out. - if (applicationWorkspaceCommandBarLightweightControl != null) - { - // If a command bar definition has been supplied, layout the application workspace - // command bar lightweight control. Otherwise, hide it. - if (CommandBarDefinition != null) - { - // Set the application command bar height. - applicationWorkspaceCommandBarHeight = applicationWorkspaceCommandBarLightweightControl.DefaultVirtualSize.Height; + // If we have an application workspace command bar lightweight control, lay it out. + if (applicationWorkspaceCommandBarLightweightControl != null) + { + // If a command bar definition has been supplied, layout the application workspace + // command bar lightweight control. Otherwise, hide it. + if (CommandBarDefinition != null) + { + // Set the application command bar height. + applicationWorkspaceCommandBarHeight = applicationWorkspaceCommandBarLightweightControl.DefaultVirtualSize.Height; - // Layout the application workspace command bar lightweight control. - applicationWorkspaceCommandBarLightweightControl.Visible = true; - applicationWorkspaceCommandBarLightweightControl.VirtualBounds = new Rectangle(0, 0, Width, applicationWorkspaceCommandBarHeight); - } - else - { - // Layout the application workspace command bar lightweight control. - applicationWorkspaceCommandBarLightweightControl.Visible = false; - applicationWorkspaceCommandBarLightweightControl.VirtualBounds = Rectangle.Empty; - } - } + // Layout the application workspace command bar lightweight control. + applicationWorkspaceCommandBarLightweightControl.Visible = true; + applicationWorkspaceCommandBarLightweightControl.VirtualBounds = new Rectangle(0, 0, Width, applicationWorkspaceCommandBarHeight); + } + else + { + // Layout the application workspace command bar lightweight control. + applicationWorkspaceCommandBarLightweightControl.Visible = false; + applicationWorkspaceCommandBarLightweightControl.VirtualBounds = Rectangle.Empty; + } + } - // Return the column layout rectangle. - return new Rectangle( columnLayoutMargin.Width, - applicationWorkspaceCommandBarHeight+columnLayoutMargin.Height, - Width-(columnLayoutMargin.Width*2), - Height-applicationWorkspaceCommandBarHeight-(columnLayoutMargin.Height*2)); - } + // Return the column layout rectangle. + return new Rectangle( columnLayoutMargin.Width, + applicationWorkspaceCommandBarHeight+columnLayoutMargin.Height, + Width-(columnLayoutMargin.Width*2), + Height-applicationWorkspaceCommandBarHeight-(columnLayoutMargin.Height*2)); + } - /// - /// leftColumn_MaximumColumnWidthChanged event handler. - /// - /// The source of the event. - /// An EventArgs that contains the event data. - private void leftColumn_MaximumColumnWidthChanged(object sender, System.EventArgs e) - { - PerformLayout(); - Invalidate(); - } + /// + /// leftColumn_MaximumColumnWidthChanged event handler. + /// + /// The source of the event. + /// An EventArgs that contains the event data. + private void leftColumn_MaximumColumnWidthChanged(object sender, System.EventArgs e) + { + PerformLayout(); + Invalidate(); + } - /// - /// leftColumn_MinimumColumnWidthChanged event handler. - /// - /// The source of the event. - /// An EventArgs that contains the event data. - private void leftColumn_MinimumColumnWidthChanged(object sender, System.EventArgs e) - { - PerformLayout(); - Invalidate(); - } + /// + /// leftColumn_MinimumColumnWidthChanged event handler. + /// + /// The source of the event. + /// An EventArgs that contains the event data. + private void leftColumn_MinimumColumnWidthChanged(object sender, System.EventArgs e) + { + PerformLayout(); + Invalidate(); + } - /// - /// leftColumn_PreferredColumnWidthChanged event handler. - /// - /// The source of the event. - /// An EventArgs that contains the event data. - private void leftColumn_PreferredColumnWidthChanged(object sender, System.EventArgs e) - { - PerformLayout(); - Invalidate(); - } + /// + /// leftColumn_PreferredColumnWidthChanged event handler. + /// + /// The source of the event. + /// An EventArgs that contains the event data. + private void leftColumn_PreferredColumnWidthChanged(object sender, System.EventArgs e) + { + PerformLayout(); + Invalidate(); + } - /// - /// rightColumn_MaximumColumnWidthChanged event handler. - /// - /// The source of the event. - /// An EventArgs that contains the event data. - private void rightColumn_MaximumColumnWidthChanged(object sender, System.EventArgs e) - { - PerformLayout(); - Invalidate(); - } + /// + /// rightColumn_MaximumColumnWidthChanged event handler. + /// + /// The source of the event. + /// An EventArgs that contains the event data. + private void rightColumn_MaximumColumnWidthChanged(object sender, System.EventArgs e) + { + PerformLayout(); + Invalidate(); + } - /// - /// rightColumn_MinimumColumnWidthChanged event handler. - /// - /// The source of the event. - /// An EventArgs that contains the event data. - private void rightColumn_MinimumColumnWidthChanged(object sender, System.EventArgs e) - { - PerformLayout(); - Invalidate(); - } + /// + /// rightColumn_MinimumColumnWidthChanged event handler. + /// + /// The source of the event. + /// An EventArgs that contains the event data. + private void rightColumn_MinimumColumnWidthChanged(object sender, System.EventArgs e) + { + PerformLayout(); + Invalidate(); + } - /// - /// rightColumn_PreferredColumnWidthChanged event handler. - /// - /// The source of the event. - /// An EventArgs that contains the event data. - private void rightColumn_PreferredColumnWidthChanged(object sender, System.EventArgs e) - { - PerformLayout(); - Invalidate(); - } - } + /// + /// rightColumn_PreferredColumnWidthChanged event handler. + /// + /// The source of the event. + /// An EventArgs that contains the event data. + private void rightColumn_PreferredColumnWidthChanged(object sender, System.EventArgs e) + { + PerformLayout(); + Invalidate(); + } + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/BorderControl.cs b/src/managed/OpenLiveWriter.ApplicationFramework/BorderControl.cs index 20562a7e..be9d028c 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/BorderControl.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/BorderControl.cs @@ -73,7 +73,7 @@ namespace OpenLiveWriter.ApplicationFramework /// /// True if bottom border should not be used. /// - private bool suppressBottomBorder; + private bool suppressBottomBorder; /// /// The right inset. diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/ColorPickerForm.cs b/src/managed/OpenLiveWriter.ApplicationFramework/ColorPickerForm.cs index 2c5f6094..4e7e3de7 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/ColorPickerForm.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/ColorPickerForm.cs @@ -291,7 +291,7 @@ namespace OpenLiveWriter.ApplicationFramework /// Raised by a subcontrol to inform ColorPickerForm that it should navigate /// (either for forward or backward) to the next control. /// - public event NavigateEventHandler _Navigate; + public event NavigateEventHandler _Navigate; /// /// Called by a subcontrol (derived class of IColorPickerSubControl) to raise the _Navigate event diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/ColorPopup.cs b/src/managed/OpenLiveWriter.ApplicationFramework/ColorPopup.cs index 4551d7b7..7d46ce16 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/ColorPopup.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/ColorPopup.cs @@ -128,7 +128,6 @@ namespace OpenLiveWriter.ApplicationFramework Invalidate(); } - const int PADDING = 6; const int GUTTER_SIZE = 3; const int COLOR_SIZE = 14; diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/Command.cs b/src/managed/OpenLiveWriter.ApplicationFramework/Command.cs index 63cb1114..6d7c3bd1 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/Command.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/Command.cs @@ -1248,7 +1248,6 @@ namespace OpenLiveWriter.ApplicationFramework } private bool commandBarButtonContextMenuInvalidateParent = false; - /// /// Gets or sets the command text. /// diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/CommandBarButtonLightweightControl.cs b/src/managed/OpenLiveWriter.ApplicationFramework/CommandBarButtonLightweightControl.cs index 6fd61fa0..4b328e71 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/CommandBarButtonLightweightControl.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/CommandBarButtonLightweightControl.cs @@ -158,9 +158,9 @@ namespace OpenLiveWriter.ApplicationFramework public CommandBarButtonLightweightControl(CommandBarLightweightControl commandBarLightweightControl, string commandIdentifier, bool rightAligned) { /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); InitializeObject(); // Set the command bar lightweight control. @@ -1261,7 +1261,6 @@ namespace OpenLiveWriter.ApplicationFramework void Paint(BidiGraphics g, Rectangle bounds, DrawState drawState); } - public override bool DoDefaultAction() { if (ContextMenuUserInterface || DropDownContextMenuUserInterface) diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/CommandContextMenu.cs b/src/managed/OpenLiveWriter.ApplicationFramework/CommandContextMenu.cs index 23ab82c3..f8316d5f 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/CommandContextMenu.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/CommandContextMenu.cs @@ -308,7 +308,6 @@ namespace OpenLiveWriter.ApplicationFramework MenuItems.AddRange(commandMenuBuilder.CreateMenuItems()); } - /// /// Displays the CommandContextMenu at the specified location and returns the command that /// was selected by the user. diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/CommandContextMenuMiniForm.cs b/src/managed/OpenLiveWriter.ApplicationFramework/CommandContextMenuMiniForm.cs index 5cec8542..48b013d5 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/CommandContextMenuMiniForm.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/CommandContextMenuMiniForm.cs @@ -17,33 +17,33 @@ namespace OpenLiveWriter.ApplicationFramework internal class CommandContextMenuMiniForm : BaseForm { /* NOTE: When being shown in the context of the browser (or any non .NET - * application) this form will not handle any dialog level keyboard - * commands (tab, enter, escape, alt-mnenonics, etc.). This is because - * it is a modeless form that does not have its own thread/message-loop. - * Because the form was created by our .NET code the main IE frame that - * has the message loop has no idea it needs to route keyboard events' - * to us. There are several possible workarounds: - * - * (1) Create and show this form on its own thread with its own - * message loop. In this case all calls from the form back - * to the main UI thread would need to be marshalled. - * - * (2) Manually process keyboard events in the low-level - * ProcessKeyPreview override (see commented out method below) - * - * (3) Change the implementation of the mini-form to be a modal - * dialog. The only problem here is we would need to capture - * mouse input so that clicks outside of the modal dialog onto - * the IE window result in the window being dismissed. We were - * not able to get this to work (couldn't capture the mouse) - * in experimenting with this implementation. - * - * Our judgement was to leave it as-is for now as it is unlikely that - * keyboard input into a mini-form will be a big deal (the only way - * to access the mini-form is with a mouse gesture on the toolbar so - * the user is still in "mouse-mode" when the form pops up. - * - */ + * application) this form will not handle any dialog level keyboard + * commands (tab, enter, escape, alt-mnenonics, etc.). This is because + * it is a modeless form that does not have its own thread/message-loop. + * Because the form was created by our .NET code the main IE frame that + * has the message loop has no idea it needs to route keyboard events' + * to us. There are several possible workarounds: + * + * (1) Create and show this form on its own thread with its own + * message loop. In this case all calls from the form back + * to the main UI thread would need to be marshalled. + * + * (2) Manually process keyboard events in the low-level + * ProcessKeyPreview override (see commented out method below) + * + * (3) Change the implementation of the mini-form to be a modal + * dialog. The only problem here is we would need to capture + * mouse input so that clicks outside of the modal dialog onto + * the IE window result in the window being dismissed. We were + * not able to get this to work (couldn't capture the mouse) + * in experimenting with this implementation. + * + * Our judgement was to leave it as-is for now as it is unlikely that + * keyboard input into a mini-form will be a big deal (the only way + * to access the mini-form is with a mouse gesture on the toolbar so + * the user is still in "mouse-mode" when the form pops up. + * + */ public CommandContextMenuMiniForm(IWin32Window parentFrame, Command command) { @@ -119,7 +119,6 @@ namespace OpenLiveWriter.ApplicationFramework User32.SendMessage(_parentFrame.Handle, WM.NCACTIVATE, new UIntPtr(1), IntPtr.Zero); } - /// /// Automatically close when the form is deactivated /// @@ -193,7 +192,6 @@ namespace OpenLiveWriter.ApplicationFramework miniFormBevelBitmap.Height)); } - /// /// Prevent background painting (supports double-buffering) /// @@ -203,20 +201,19 @@ namespace OpenLiveWriter.ApplicationFramework } - /* - protected override bool ProcessKeyPreview(ref Message m) - { - // NOTE: this is the only keyboard "event" which appears - // to get called when our form is shown in the browser. - // if we want to support tab, esc, enter, mnemonics, etc. - // without creating a new thread/message-loop for this - // form (see comment at the top) then this is where we - // would do the manual processing + protected override bool ProcessKeyPreview(ref Message m) + { + // NOTE: this is the only keyboard "event" which appears + // to get called when our form is shown in the browser. + // if we want to support tab, esc, enter, mnemonics, etc. + // without creating a new thread/message-loop for this + // form (see comment at the top) then this is where we + // would do the manual processing - return base.ProcessKeyPreview (ref m); - } - */ + return base.ProcessKeyPreview (ref m); + } + */ /// /// User clicked the action button diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/CommandInstance.cs b/src/managed/OpenLiveWriter.ApplicationFramework/CommandInstance.cs index ea733fe9..3c34917f 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/CommandInstance.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/CommandInstance.cs @@ -12,422 +12,422 @@ using Project31.MindShare.CoreServices; namespace Project31.ApplicationFramework { - /// - /// Represents a command in the Project31.ApplicationFramework. - /// - [ - DesignTimeVisible(false), - ToolboxItem(false) - ] - public class CommandInstance : Component - { - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; + /// + /// Represents a command in the Project31.ApplicationFramework. + /// + [ + DesignTimeVisible(false), + ToolboxItem(false) + ] + public class CommandInstance : Component + { + /// + /// Required designer variable. + /// + private System.ComponentModel.Container components = null; - /// - /// Menu bitmap for the enabled state. - /// - private CommandDefinition commandDefinition; + /// + /// Menu bitmap for the enabled state. + /// + private CommandDefinition commandDefinition; - /// - /// Gets or sets the menu bitmap for the enabled state. - /// - [ - Category("Appearance"), - Localizable(false), - DefaultValue(null), - Description("Specifies the menu bitmap for the enabled state.") - ] - public Bitmap MenuBitmapEnabled - { - get - { - return menuBitmapEnabled; - } + /// + /// Gets or sets the menu bitmap for the enabled state. + /// + [ + Category("Appearance"), + Localizable(false), + DefaultValue(null), + Description("Specifies the menu bitmap for the enabled state.") + ] + public Bitmap MenuBitmapEnabled + { + get + { + return menuBitmapEnabled; + } - set - { - menuBitmapEnabled = value; - } - } + set + { + menuBitmapEnabled = value; + } + } - /// - /// Menu bitmap for the disabled state. - /// - private Bitmap menuBitmapDisabled; + /// + /// Menu bitmap for the disabled state. + /// + private Bitmap menuBitmapDisabled; - /// - /// Gets or sets the menu bitmap for the disabled state. - /// - [ - Category("Appearance"), - Localizable(false), - DefaultValue(null), - Description("Specifies the menu bitmap for the disabled state.") - ] - public Bitmap MenuBitmapDisabled - { - get - { - return menuBitmapDisabled; - } + /// + /// Gets or sets the menu bitmap for the disabled state. + /// + [ + Category("Appearance"), + Localizable(false), + DefaultValue(null), + Description("Specifies the menu bitmap for the disabled state.") + ] + public Bitmap MenuBitmapDisabled + { + get + { + return menuBitmapDisabled; + } - set - { - menuBitmapDisabled = value; - } - } + set + { + menuBitmapDisabled = value; + } + } - /// - /// Menu bitmap for the selected state. - /// - private Bitmap menuBitmapSelected; + /// + /// Menu bitmap for the selected state. + /// + private Bitmap menuBitmapSelected; - /// - /// Gets or sets the menu selected bitmap. - /// - [ - Category("Appearance"), - Localizable(false), - DefaultValue(null), - Description("Specifies the menu bitmap for the selected state.") - ] - public Bitmap MenuBitmapSelected - { - get - { - return menuBitmapSelected; - } + /// + /// Gets or sets the menu selected bitmap. + /// + [ + Category("Appearance"), + Localizable(false), + DefaultValue(null), + Description("Specifies the menu bitmap for the selected state.") + ] + public Bitmap MenuBitmapSelected + { + get + { + return menuBitmapSelected; + } - set - { - menuBitmapSelected = value; - } - } + set + { + menuBitmapSelected = value; + } + } - /// - /// The menu shortcut of the command. - /// - private Shortcut menuShortcut; + /// + /// The menu shortcut of the command. + /// + private Shortcut menuShortcut; - /// - /// Gets or sets the menu shortcut of the command. - /// - [ - Category("Behavior"), - DefaultValue(Shortcut.None), - Description("Specifies the menu shortcut of the command.") - ] - public Shortcut MenuShortcut - { - get - { - return menuShortcut; - } - set - { - menuShortcut = value; - } - } + /// + /// Gets or sets the menu shortcut of the command. + /// + [ + Category("Behavior"), + DefaultValue(Shortcut.None), + Description("Specifies the menu shortcut of the command.") + ] + public Shortcut MenuShortcut + { + get + { + return menuShortcut; + } + set + { + menuShortcut = value; + } + } - /// - /// A value indicating whether the menu shortcut should be shown for the command. - /// - private bool showMenuShortcut; + /// + /// A value indicating whether the menu shortcut should be shown for the command. + /// + private bool showMenuShortcut; - /// - /// Gets or sets a value indicating whether the menu shortcut should be shown for the command. - /// - [ - Category("Behavior"), - DefaultValue(false), - Description("Specifies whether the menu shortcut should be shown for the command.") - ] - public bool ShowMenuShortcut - { - get - { - return showMenuShortcut; - } - set - { - showMenuShortcut = value; - } - } + /// + /// Gets or sets a value indicating whether the menu shortcut should be shown for the command. + /// + [ + Category("Behavior"), + DefaultValue(false), + Description("Specifies whether the menu shortcut should be shown for the command.") + ] + public bool ShowMenuShortcut + { + get + { + return showMenuShortcut; + } + set + { + showMenuShortcut = value; + } + } - /// - /// The command text. This is the "user visible text" that is associate with the command - /// (such as "Save All"). It appears whenever the user can see text for the command. - /// - private string text; + /// + /// The command text. This is the "user visible text" that is associate with the command + /// (such as "Save All"). It appears whenever the user can see text for the command. + /// + private string text; - /// - /// Gets or sets the command text. - /// - [ - Category("Appearance"), - Localizable(true), - DefaultValue(null), - Description("Specifies the text that is associated with the command.") - ] - public string Text - { - get - { - return text; - } - set - { - text = value; - } - } + /// + /// Gets or sets the command text. + /// + [ + Category("Appearance"), + Localizable(true), + DefaultValue(null), + Description("Specifies the text that is associated with the command.") + ] + public string Text + { + get + { + return text; + } + set + { + text = value; + } + } - /// - /// The command description. This is the "user visible description" that is associated - /// with the command. It appears whenever the user can see a description for the command. - /// - private string description; + /// + /// The command description. This is the "user visible description" that is associated + /// with the command. It appears whenever the user can see a description for the command. + /// + private string description; - /// - /// Gets or sets the command description. - /// - [ - Category("Appearance"), - Localizable(true), - DefaultValue(null), - Description("Specifies the description for the command.") - ] - public string Description - { - get - { - return description; - } - set - { - description = value; - } - } + /// + /// Gets or sets the command description. + /// + [ + Category("Appearance"), + Localizable(true), + DefaultValue(null), + Description("Specifies the description for the command.") + ] + public string Description + { + get + { + return description; + } + set + { + description = value; + } + } - /// - /// Command bar button bitmap for the disabled state. - /// - private Bitmap commandBarButtonBitmapDisabled; + /// + /// Command bar button bitmap for the disabled state. + /// + private Bitmap commandBarButtonBitmapDisabled; - /// - /// Gets or sets the command bar button bitmap for the disabled state. - /// - [ - Category("Appearance"), - Localizable(true), - DefaultValue(null), - Description("Specifies the command bar button bitmap for the disabled state.") - ] - public Bitmap CommandBarButtonBitmapDisabled - { - get - { - return commandBarButtonBitmapDisabled; - } + /// + /// Gets or sets the command bar button bitmap for the disabled state. + /// + [ + Category("Appearance"), + Localizable(true), + DefaultValue(null), + Description("Specifies the command bar button bitmap for the disabled state.") + ] + public Bitmap CommandBarButtonBitmapDisabled + { + get + { + return commandBarButtonBitmapDisabled; + } - set - { - commandBarButtonBitmapDisabled = value; - } - } + set + { + commandBarButtonBitmapDisabled = value; + } + } - /// - /// Command bar button bitmap for the enabled state. - /// - private Bitmap commandBarButtonBitmapEnabled; + /// + /// Command bar button bitmap for the enabled state. + /// + private Bitmap commandBarButtonBitmapEnabled; - /// - /// Gets or sets the command bar button bitmap for the enabled state. - /// - [ - Category("Appearance"), - Localizable(true), - DefaultValue(null), - Description("Specifies the command bar button bitmap for the enabled state.") - ] - public Bitmap CommandBarButtonBitmapEnabled - { - get - { - return commandBarButtonBitmapEnabled; - } + /// + /// Gets or sets the command bar button bitmap for the enabled state. + /// + [ + Category("Appearance"), + Localizable(true), + DefaultValue(null), + Description("Specifies the command bar button bitmap for the enabled state.") + ] + public Bitmap CommandBarButtonBitmapEnabled + { + get + { + return commandBarButtonBitmapEnabled; + } - set - { - commandBarButtonBitmapEnabled = value; - } - } + set + { + commandBarButtonBitmapEnabled = value; + } + } - /// - /// Command bar button bitmap for the pushed state. - /// - private Bitmap commandBarButtonBitmapPushed; + /// + /// Command bar button bitmap for the pushed state. + /// + private Bitmap commandBarButtonBitmapPushed; - /// - /// Gets or sets the command bar button bitmap for the pushed state. - /// - [ - Category("Appearance"), - Localizable(true), - DefaultValue(null), - Description("Specifies the command bar button bitmap for the pushed state.") - ] - public Bitmap CommandBarButtonBitmapPushed - { - get - { - return commandBarButtonBitmapPushed; - } + /// + /// Gets or sets the command bar button bitmap for the pushed state. + /// + [ + Category("Appearance"), + Localizable(true), + DefaultValue(null), + Description("Specifies the command bar button bitmap for the pushed state.") + ] + public Bitmap CommandBarButtonBitmapPushed + { + get + { + return commandBarButtonBitmapPushed; + } - set - { - commandBarButtonBitmapPushed = value; - } - } + set + { + commandBarButtonBitmapPushed = value; + } + } - /// - /// Command bar button bitmap for the rollover state. - /// - private Bitmap commandBarButtonBitmapRollover; + /// + /// Command bar button bitmap for the rollover state. + /// + private Bitmap commandBarButtonBitmapRollover; - /// - /// Gets or sets the command bar button bitmap for the rollover state. - /// - [ - Category("Appearance"), - Localizable(true), - DefaultValue(null), - Description("Specifies the command bar button bitmap for the rollover state.") - ] - public Bitmap CommandBarButtonBitmapRollover - { - get - { - return commandBarButtonBitmapRollover; - } + /// + /// Gets or sets the command bar button bitmap for the rollover state. + /// + [ + Category("Appearance"), + Localizable(true), + DefaultValue(null), + Description("Specifies the command bar button bitmap for the rollover state.") + ] + public Bitmap CommandBarButtonBitmapRollover + { + get + { + return commandBarButtonBitmapRollover; + } - set - { - commandBarButtonBitmapRollover = value; - } - } + set + { + commandBarButtonBitmapRollover = value; + } + } - /// - /// A value indicating whether the command is enabled or not (i.e. can respond to user interaction). - /// - private bool enabled = true; + /// + /// A value indicating whether the command is enabled or not (i.e. can respond to user interaction). + /// + private bool enabled = true; - /// - /// Gets or sets a value indicating whether the command is enabled or not (i.e. can respond to user interaction). - /// - [ - Category("Behavior"), - DefaultValue(true), - Description("Specifies whether the command is enabled by default.") - ] - public bool Enabled - { - get - { - return enabled; - } - set - { - // Set the value. - enabled = value; + /// + /// Gets or sets a value indicating whether the command is enabled or not (i.e. can respond to user interaction). + /// + [ + Category("Behavior"), + DefaultValue(true), + Description("Specifies whether the command is enabled by default.") + ] + public bool Enabled + { + get + { + return enabled; + } + set + { + // Set the value. + enabled = value; - // Fire the enabled changed event. - OnEnabledChanged(EventArgs.Empty); - } - } + // Fire the enabled changed event. + OnEnabledChanged(EventArgs.Empty); + } + } - /// - /// Occurs when the command is executed. - /// - [ - Category("Action"), - Description("Occurs when the command is executed.") - ] - public event EventHandler Execute; + /// + /// Occurs when the command is executed. + /// + [ + Category("Action"), + Description("Occurs when the command is executed.") + ] + public event EventHandler Execute; - /// - /// Occurs when the command's enabled state changes. - /// - [ - Category("Property Changed"), - Description("Occurs when the command's enabled state changes.") - ] - public event EventHandler EnabledChanged; + /// + /// Occurs when the command's enabled state changes. + /// + [ + Category("Property Changed"), + Description("Occurs when the command's enabled state changes.") + ] + public event EventHandler EnabledChanged; - /// - /// Initializes a new instance of the Command class. - /// - /// - public CommandDefinition(System.ComponentModel.IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); - } + /// + /// Initializes a new instance of the Command class. + /// + /// + public CommandDefinition(System.ComponentModel.IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); + } - /// - /// Initializes a new instance of the Command class. - /// - public CommandDefinition() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); - } + /// + /// Initializes a new instance of the Command class. + /// + public CommandDefinition() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - components = new System.ComponentModel.Container(); - } - #endregion + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + } + #endregion - /// - /// This method can be called to raise the Execute event - /// - public void PerformExecute() - { - Debug.Assert(Enabled, "Command is disabled.", "It is illogical to execute a command that is disabled."); - OnExecute(EventArgs.Empty); - } + /// + /// This method can be called to raise the Execute event + /// + public void PerformExecute() + { + Debug.Assert(Enabled, "Command is disabled.", "It is illogical to execute a command that is disabled."); + OnExecute(EventArgs.Empty); + } - /// - /// Raises the Execute event. - /// - protected void OnExecute(EventArgs e) - { - if (Execute != null) - Execute(this, e); - else - UnderConstructionForm.Show(); - } + /// + /// Raises the Execute event. + /// + protected void OnExecute(EventArgs e) + { + if (Execute != null) + Execute(this, e); + else + UnderConstructionForm.Show(); + } - /// - /// Raises the EnabledChanged event. - /// - protected void OnEnabledChanged(EventArgs e) - { - if (EnabledChanged != null) - EnabledChanged(this, e); - } - } + /// + /// Raises the EnabledChanged event. + /// + protected void OnEnabledChanged(EventArgs e) + { + if (EnabledChanged != null) + EnabledChanged(this, e); + } + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/CommandList.cs b/src/managed/OpenLiveWriter.ApplicationFramework/CommandList.cs index ef96bfda..efa5c896 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/CommandList.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/CommandList.cs @@ -12,90 +12,90 @@ using Project31.CoreServices; namespace Project31.ApplicationFramework { - /// - /// Summary description for CommandList. - /// - [Designer(typeof(ComponentRootDesigner), typeof(IRootDesigner))] - public class CommandList : Component - { - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; + /// + /// Summary description for CommandList. + /// + [Designer(typeof(ComponentRootDesigner), typeof(IRootDesigner))] + public class CommandList : Component + { + /// + /// Required designer variable. + /// + private System.ComponentModel.Container components = null; - /// - /// The command collection for this command list. - /// - private CommandCollection commands = new CommandCollection(); + /// + /// The command collection for this command list. + /// + private CommandCollection commands = new CommandCollection(); - /// - /// Gets or sets the command collection for this command list. - /// - [ - Localizable(true), - DesignerSerializationVisibility(DesignerSerializationVisibility.Content) - ] - public CommandCollection Commands - { - get - { - return commands; - } - set - { - commands = value; - } - } + /// + /// Gets or sets the command collection for this command list. + /// + [ + Localizable(true), + DesignerSerializationVisibility(DesignerSerializationVisibility.Content) + ] + public CommandCollection Commands + { + get + { + return commands; + } + set + { + commands = value; + } + } - /// - /// Initializes a new instance of the CommandList class. - /// - /// Component container. - public CommandList(System.ComponentModel.IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); - } + /// + /// Initializes a new instance of the CommandList class. + /// + /// Component container. + public CommandList(System.ComponentModel.IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); + } - /// - /// Initializes a new instance of the CommandList class. - /// - public CommandList() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); - } + /// + /// Initializes a new instance of the CommandList class. + /// + public CommandList() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); + } - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - components = new System.ComponentModel.Container(); - } + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + } - /// - /// Helper to enable all the commands in the command list. - /// - public void Enable() - { - foreach (Command command in commands) - command.Enabled = true; - } + /// + /// Helper to enable all the commands in the command list. + /// + public void Enable() + { + foreach (Command command in commands) + command.Enabled = true; + } - /// - /// Helper to disable all the commands in the command list. - /// - public void Disable() - { - foreach (Command command in commands) - command.Enabled = false; - } - } + /// + /// Helper to disable all the commands in the command list. + /// + public void Disable() + { + foreach (Command command in commands) + command.Enabled = false; + } + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/CommandMenuItemEventBridge.cs b/src/managed/OpenLiveWriter.ApplicationFramework/CommandMenuItemEventBridge.cs index 3a9b288a..1fcdda76 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/CommandMenuItemEventBridge.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/CommandMenuItemEventBridge.cs @@ -8,81 +8,81 @@ using System.Windows.Forms; namespace Project31.ApplicationFramework { - /// - /// Provides "event bridging" between MenuItem objects and Command objects. - /// - internal class CommandMenuItemEventBridge - { - #region Private Member Variables & Properties - /// - /// The Command for this Command to MenuItem event bridge. - /// - private Command command; + /// + /// Provides "event bridging" between MenuItem objects and Command objects. + /// + internal class CommandMenuItemEventBridge + { + #region Private Member Variables & Properties + /// + /// The Command for this Command to MenuItem event bridge. + /// + private Command command; - /// - /// The MenuItem for this Command to MenuItem event bridge. - /// - private MenuItem menuItem; - #endregion + /// + /// The MenuItem for this Command to MenuItem event bridge. + /// + private MenuItem menuItem; + #endregion - #region Class Initialization & Termination - /// - /// Initializes a new instance of the CommandMenuItemEventBridge class. - /// - /// The Command for this Command to MenuItem event bridge. - /// The MenuItem for this Command to MenuItem event bridge. - public CommandMenuItemEventBridge(Command command, MenuItem menuItem) - { - // Set the command. - this.command = command; + #region Class Initialization & Termination + /// + /// Initializes a new instance of the CommandMenuItemEventBridge class. + /// + /// The Command for this Command to MenuItem event bridge. + /// The MenuItem for this Command to MenuItem event bridge. + public CommandMenuItemEventBridge(Command command, MenuItem menuItem) + { + // Set the command. + this.command = command; - // Set the menu item. - this.menuItem = menuItem; + // Set the menu item. + this.menuItem = menuItem; - // Add event handlers for the command events. - command.EnabledChanged += new EventHandler(command_EnabledChanged); + // Add event handlers for the command events. + command.EnabledChanged += new EventHandler(command_EnabledChanged); - // Add event handlers for the menu item events. - menuItem.Click += new EventHandler(menuItem_Click); - } - #endregion + // Add event handlers for the menu item events. + menuItem.Click += new EventHandler(menuItem_Click); + } + #endregion - #region Public Methods - /// - /// The enabled property of the command changed. - /// - /// Sender of the event. - /// Event parameters. - public void Disconnect() - { - // Add event handlers for command events. - command.EnabledChanged -= new EventHandler(command_EnabledChanged); + #region Public Methods + /// + /// The enabled property of the command changed. + /// + /// Sender of the event. + /// Event parameters. + public void Disconnect() + { + // Add event handlers for command events. + command.EnabledChanged -= new EventHandler(command_EnabledChanged); - // Bridge menu item events. - menuItem.Click -= new EventHandler(menuItem_Click); - } - #endregion + // Bridge menu item events. + menuItem.Click -= new EventHandler(menuItem_Click); + } + #endregion - #region Event Handlers - /// - /// The enabled property of the command changed. - /// - /// Sender of the event. - /// Event parameters. - private void command_EnabledChanged(object sender, System.EventArgs e) - { - menuItem.Enabled = command.Enabled; - } + #region Event Handlers + /// + /// The enabled property of the command changed. + /// + /// Sender of the event. + /// Event parameters. + private void command_EnabledChanged(object sender, System.EventArgs e) + { + menuItem.Enabled = command.Enabled; + } - /// - /// The menu item was clicked. - /// - /// Sender of the event. - /// Event parameters. - private void menuItem_Click(object sender, System.EventArgs e) - { - command.PerformExecute(); - } - #endregion - } + /// + /// The menu item was clicked. + /// + /// Sender of the event. + /// Event parameters. + private void menuItem_Click(object sender, System.EventArgs e) + { + command.PerformExecute(); + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/CommandTable.cs b/src/managed/OpenLiveWriter.ApplicationFramework/CommandTable.cs index e1953f52..ee39f995 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/CommandTable.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/CommandTable.cs @@ -8,171 +8,171 @@ using System.Diagnostics; namespace Project31.ApplicationFramework { - /// - /// Provides command table management. - /// - public class CommandTable : IEnumerable - { - /// - /// The set of active commands, keyed by command identifier. - /// - private Hashtable commandTable = new Hashtable(); + /// + /// Provides command table management. + /// + public class CommandTable : IEnumerable + { + /// + /// The set of active commands, keyed by command identifier. + /// + private Hashtable commandTable = new Hashtable(); - /// - /// The cross-referenced set of active shortcuts. Keyed by shortcut. This table is not - /// maintained until it is used. A call to GetCommand with a shortcut will cause the table - /// to be loaded. Once loaded, it is maintained. - /// - private Hashtable shortcutTable = null; + /// + /// The cross-referenced set of active shortcuts. Keyed by shortcut. This table is not + /// maintained until it is used. A call to GetCommand with a shortcut will cause the table + /// to be loaded. Once loaded, it is maintained. + /// + private Hashtable shortcutTable = null; - /// - /// Initializes a new instance of the CommandTable class. - /// - public CommandTable() - { - } + /// + /// Initializes a new instance of the CommandTable class. + /// + public CommandTable() + { + } - /// - /// Clears the command table. - /// - public void Clear() - { - commandTable.Clear(); - if (shortcutTable != null) - shortcutTable.Clear(); - } + /// + /// Clears the command table. + /// + public void Clear() + { + commandTable.Clear(); + if (shortcutTable != null) + shortcutTable.Clear(); + } - /// - /// Adds the specified command. - /// - /// The command to add. - public void AddCommand(Command command) - { - // Ensure that this is not a duplicate. In debug mode, assert that this is true. - // In release mode, fail silently (replacing the existing command) so as not to take - // down a running system. - Debug.Assert(!commandTable.Contains(command.Identifier), "Duplicate command encountered.", String.Format("Command {0} already exists.", command.Identifier)); + /// + /// Adds the specified command. + /// + /// The command to add. + public void AddCommand(Command command) + { + // Ensure that this is not a duplicate. In debug mode, assert that this is true. + // In release mode, fail silently (replacing the existing command) so as not to take + // down a running system. + Debug.Assert(!commandTable.Contains(command.Identifier), "Duplicate command encountered.", String.Format("Command {0} already exists.", command.Identifier)); - // Add the command to the command table. - commandTable[command.Identifier] = command; + // Add the command to the command table. + commandTable[command.Identifier] = command; - // Add the shortcut for the command to the shortcut table. - AddShortcut(command); - } + // Add the shortcut for the command to the shortcut table. + AddShortcut(command); + } - /// - /// Removes the specified command. - /// - /// The command to remove. - public void RemoveCommand(Command command) - { - // Ensure that the command is in the table. In debug mode, assert that this is true. - // In release mode, fail silently (replacing the existing command) so as not to take - // down a running system. - Debug.Assert(commandTable.Contains(command.Identifier), "Command not found.", String.Format("Command {0} does not exist.", command.Identifier)); + /// + /// Removes the specified command. + /// + /// The command to remove. + public void RemoveCommand(Command command) + { + // Ensure that the command is in the table. In debug mode, assert that this is true. + // In release mode, fail silently (replacing the existing command) so as not to take + // down a running system. + Debug.Assert(commandTable.Contains(command.Identifier), "Command not found.", String.Format("Command {0} does not exist.", command.Identifier)); - // Remove the command from the command table. - commandTable.Remove(command.Identifier); + // Remove the command from the command table. + commandTable.Remove(command.Identifier); - // Remove the shortcut for the command from the shortcut table. - RemoveShortcut(command); - } + // Remove the shortcut for the command from the shortcut table. + RemoveShortcut(command); + } - /// - /// Adds the specified command list. - /// - /// The CommandList to add. - public void AddCommandList(CommandList commandList) - { - // Add all the commands to the command table. - foreach (Command command in commandList.Commands) - AddCommand(command); - } + /// + /// Adds the specified command list. + /// + /// The CommandList to add. + public void AddCommandList(CommandList commandList) + { + // Add all the commands to the command table. + foreach (Command command in commandList.Commands) + AddCommand(command); + } - /// - /// Removes the specified command list. - /// - /// The CommandList to remove. - public void RemoveCommandList(CommandList commandList) - { - // Remove all the commands from the command table. - foreach (Command command in commandList.Commands) - RemoveCommand(command); - } + /// + /// Removes the specified command list. + /// + /// The CommandList to remove. + public void RemoveCommandList(CommandList commandList) + { + // Remove all the commands from the command table. + foreach (Command command in commandList.Commands) + RemoveCommand(command); + } - /// - /// Gets the command with the specified command identifier. - /// - /// The command identifier of the command to get. - /// The command, or null if a command with the specified command identifier cannot be found. - public Command GetCommand(string commandIdentifier) - { - return (Command)commandTable[commandIdentifier]; - } + /// + /// Gets the command with the specified command identifier. + /// + /// The command identifier of the command to get. + /// The command, or null if a command with the specified command identifier cannot be found. + public Command GetCommand(string commandIdentifier) + { + return (Command)commandTable[commandIdentifier]; + } - /// - /// Gets the command with the specified shortcut. - /// - /// The shortcut of the command to get. - /// The command, or null if a command with the specified shortcut cannot be found. - public Command GetCommand(Shortcut shortcut) - { - // If the shortcut table has not been built, build it. - if (shortcutTable == null) - { - // Instantiate the shortcut table. - shortcutTable = new Hashtable(); + /// + /// Gets the command with the specified shortcut. + /// + /// The shortcut of the command to get. + /// The command, or null if a command with the specified shortcut cannot be found. + public Command GetCommand(Shortcut shortcut) + { + // If the shortcut table has not been built, build it. + if (shortcutTable == null) + { + // Instantiate the shortcut table. + shortcutTable = new Hashtable(); - // Load all the commands into the shortcut table. - foreach (Command command in this) - AddShortcut(command); - } + // Load all the commands into the shortcut table. + foreach (Command command in this) + AddShortcut(command); + } - // Return the command with the specified shortcut. - return (Command)shortcutTable[shortcut]; - } + // Return the command with the specified shortcut. + return (Command)shortcutTable[shortcut]; + } - /// - /// Returns an enumerator that can iterate through a collection. - /// - /// An IEnumerator that can be used to iterate through the collection. - public IEnumerator GetEnumerator() - { - return commandTable.Values.GetEnumerator(); - } + /// + /// Returns an enumerator that can iterate through a collection. + /// + /// An IEnumerator that can be used to iterate through the collection. + public IEnumerator GetEnumerator() + { + return commandTable.Values.GetEnumerator(); + } - /// - /// Adds the specified command to the shortcut table. - /// - /// The command to add to the shortcut table. - private void AddShortcut(Command command) - { - // If we have a shortcut table, and the command has a shortcut, add it. - if (shortcutTable != null && command.Shortcut != Shortcut.None) - { - // Ensure that this is not a duplicate. In debug mode, assert that this is true. - // In release mode, fail silently (replacing the existing command) so as not to take - // down a running system. - Debug.Assert(!shortcutTable.Contains(command.Shortcut), "Duplicate shortcut encountered.", String.Format("Shortcut {0} already exists.", command.Shortcut.ToString())); - shortcutTable[command.Shortcut] = command; - } - } + /// + /// Adds the specified command to the shortcut table. + /// + /// The command to add to the shortcut table. + private void AddShortcut(Command command) + { + // If we have a shortcut table, and the command has a shortcut, add it. + if (shortcutTable != null && command.Shortcut != Shortcut.None) + { + // Ensure that this is not a duplicate. In debug mode, assert that this is true. + // In release mode, fail silently (replacing the existing command) so as not to take + // down a running system. + Debug.Assert(!shortcutTable.Contains(command.Shortcut), "Duplicate shortcut encountered.", String.Format("Shortcut {0} already exists.", command.Shortcut.ToString())); + shortcutTable[command.Shortcut] = command; + } + } - /// - /// Adds the specified command to the shortcut table. - /// - /// The command to add to the shortcut table. - private void RemoveShortcut(Command command) - { - // If the command has a shortcut, remove it from the shortcut table. - if (shortcutTable != null && command.Shortcut != Shortcut.None) - { - // Ensure that the shortcut is in the table. In debug mode, assert that this is true. - // In release mode, fail silently (replacing the existing command) so as not to take - // down a running system. - Debug.Assert(shortcutTable.Contains(command.Shortcut), "Shortcut not found.", String.Format("Shortcut {0} does not exists.", command.Shortcut.ToString())); - shortcutTable.Remove(command.Shortcut); - } - } - } + /// + /// Adds the specified command to the shortcut table. + /// + /// The command to add to the shortcut table. + private void RemoveShortcut(Command command) + { + // If the command has a shortcut, remove it from the shortcut table. + if (shortcutTable != null && command.Shortcut != Shortcut.None) + { + // Ensure that the shortcut is in the table. In debug mode, assert that this is true. + // In release mode, fail silently (replacing the existing command) so as not to take + // down a running system. + Debug.Assert(shortcutTable.Contains(command.Shortcut), "Shortcut not found.", String.Format("Shortcut {0} does not exists.", command.Shortcut.ToString())); + shortcutTable.Remove(command.Shortcut); + } + } + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandAbout.cs b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandAbout.cs index 11cde183..d1cd3abd 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandAbout.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandAbout.cs @@ -9,48 +9,47 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.ApplicationFramework.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandAbout : Command - { + /// + /// Summary description for CommandCopy. + /// + public class CommandAbout : Command + { - public CommandAbout(System.ComponentModel.IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandAbout(System.ComponentModel.IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - } + } - public CommandAbout() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandAbout() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); + } - } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandAbout + // + this.ContextMenuPath = "-&About {0}...@401"; + this.Identifier = "WindowsLive.ApplicationFramework.Commands.About"; + this.MainMenuPath = "&Help@500/-&About {0}...@401"; + this.MenuText = "&About {0}..."; + this.Text = "About"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandAbout - // - this.ContextMenuPath = "-&About {0}...@401"; - this.Identifier = "WindowsLive.ApplicationFramework.Commands.About"; - this.MainMenuPath = "&Help@500/-&About {0}...@401"; - this.MenuText = "&About {0}..."; - this.Text = "About"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandAlignCenter.cs b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandAlignCenter.cs index 968802d4..7b1e9c44 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandAlignCenter.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandAlignCenter.cs @@ -5,53 +5,52 @@ using System.ComponentModel; namespace OpenLiveWriter.ApplicationFramework.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandAlignCenter : Command - { + /// + /// Summary description for CommandCopy. + /// + public class CommandAlignCenter : Command + { - public CommandAlignCenter(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandAlignCenter(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandAlignCenter() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandAlignCenter() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandAlignCenter + // + this.ContextMenuPath = ""; + this.Identifier = "MindShare.ApplicationCore.Commands.AlignCenter"; + this.MainMenuPath = "F&ormat@5/-&Align@300/&Center@101"; + this.Text = "Center Align"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandAlignCenter - // - this.ContextMenuPath = ""; - this.Identifier = "MindShare.ApplicationCore.Commands.AlignCenter"; - this.MainMenuPath = "F&ormat@5/-&Align@300/&Center@101"; - this.Text = "Center Align"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandAlignLeft.cs b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandAlignLeft.cs index d4792d30..694a2b90 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandAlignLeft.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandAlignLeft.cs @@ -5,53 +5,52 @@ using System.ComponentModel; namespace OpenLiveWriter.ApplicationFramework.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandAlignLeft : Command - { + /// + /// Summary description for CommandCopy. + /// + public class CommandAlignLeft : Command + { - public CommandAlignLeft(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandAlignLeft(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandAlignLeft() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandAlignLeft() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandAlignLeft + // + this.ContextMenuPath = ""; + this.Identifier = "MindShare.ApplicationCore.Commands.AlignLeft"; + this.MainMenuPath = "F&ormat@5/-&Align@300/&Left@100"; + this.Text = "Left Align"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandAlignLeft - // - this.ContextMenuPath = ""; - this.Identifier = "MindShare.ApplicationCore.Commands.AlignLeft"; - this.MainMenuPath = "F&ormat@5/-&Align@300/&Left@100"; - this.Text = "Left Align"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandAlignRight.cs b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandAlignRight.cs index 1e15aa37..088beb06 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandAlignRight.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandAlignRight.cs @@ -5,53 +5,52 @@ using System.ComponentModel; namespace OpenLiveWriter.ApplicationFramework.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandAlignRight : Command - { + /// + /// Summary description for CommandCopy. + /// + public class CommandAlignRight : Command + { - public CommandAlignRight(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandAlignRight(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandAlignRight() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandAlignRight() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandAlignRight + // + this.ContextMenuPath = ""; + this.Identifier = "MindShare.ApplicationCore.Commands.AlignRight"; + this.MainMenuPath = "F&ormat@5/-&Align@300/&Right@102"; + this.Text = "Right Align"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandAlignRight - // - this.ContextMenuPath = ""; - this.Identifier = "MindShare.ApplicationCore.Commands.AlignRight"; - this.MainMenuPath = "F&ormat@5/-&Align@300/&Right@102"; - this.Text = "Right Align"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandBlockquote.cs b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandBlockquote.cs index 77b43443..a7db5f99 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandBlockquote.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandBlockquote.cs @@ -5,53 +5,52 @@ using System.ComponentModel; namespace OpenLiveWriter.ApplicationFramework.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandBlockquote : Command - { + /// + /// Summary description for CommandCopy. + /// + public class CommandBlockquote : Command + { - public CommandBlockquote(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandBlockquote(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandBlockquote() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandBlockquote() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandBlockquote - // - this.ContextMenuPath = ""; - this.Identifier = "MindShare.ApplicationCore.Commands.Blockquote"; - this.MainMenuPath = "F&ormat@5/Block"e@499"; - this.Text = "Blockquote"; - this.SuppressMenuBitmap = true; - } - #endregion - } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandBlockquote + // + this.ContextMenuPath = ""; + this.Identifier = "MindShare.ApplicationCore.Commands.Blockquote"; + this.MainMenuPath = "F&ormat@5/Block"e@499"; + this.Text = "Blockquote"; + this.SuppressMenuBitmap = true; + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandBold.cs b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandBold.cs index 140edd00..078bb785 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandBold.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandBold.cs @@ -5,54 +5,53 @@ using System.ComponentModel; namespace OpenLiveWriter.ApplicationFramework.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandBold : Command - { + /// + /// Summary description for CommandCopy. + /// + public class CommandBold : Command + { - public CommandBold(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandBold(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandBold() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandBold() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandBold + // + this.ContextMenuPath = ""; + this.Identifier = "MindShare.ApplicationCore.Commands.Bold"; + this.MainMenuPath = ""; + this.Shortcut = System.Windows.Forms.Shortcut.CtrlB; + this.Text = "Bold"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandBold - // - this.ContextMenuPath = ""; - this.Identifier = "MindShare.ApplicationCore.Commands.Bold"; - this.MainMenuPath = ""; - this.Shortcut = System.Windows.Forms.Shortcut.CtrlB; - this.Text = "Bold"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandBullets.cs b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandBullets.cs index 63ddf967..c092321c 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandBullets.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandBullets.cs @@ -5,53 +5,52 @@ using System.ComponentModel; namespace OpenLiveWriter.ApplicationFramework.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandBullets : Command - { + /// + /// Summary description for CommandCopy. + /// + public class CommandBullets : Command + { - public CommandBullets(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandBullets(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandBullets() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandBullets() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandBullets - // - this.ContextMenuPath = ""; - this.Identifier = "MindShare.ApplicationCore.Commands.Bullets"; - this.MainMenuPath = "F&ormat@5/&Bullets@402"; - this.Text = "Bullets"; - this.SuppressMenuBitmap = true; - } - #endregion - } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandBullets + // + this.ContextMenuPath = ""; + this.Identifier = "MindShare.ApplicationCore.Commands.Bullets"; + this.MainMenuPath = "F&ormat@5/&Bullets@402"; + this.Text = "Bullets"; + this.SuppressMenuBitmap = true; + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandCheckSpelling.cs b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandCheckSpelling.cs index 91985791..40b7e8d5 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandCheckSpelling.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandCheckSpelling.cs @@ -5,56 +5,55 @@ using System.ComponentModel; namespace OpenLiveWriter.ApplicationFramework.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandCheckSpelling : Command - { + /// + /// Summary description for CommandCopy. + /// + public class CommandCheckSpelling : Command + { - public CommandCheckSpelling(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandCheckSpelling(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandCheckSpelling() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandCheckSpelling() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandCheckSpelling + // + this.CommandBarButtonText = ""; + this.ContextMenuPath = ""; + this.MenuText = "Check &Spelling"; + this.Identifier = "MindShare.ApplicationCore.Commands.CheckSpelling"; + this.MainMenuPath = "&Tools@7/Check &Spelling...@100"; + this.Shortcut = System.Windows.Forms.Shortcut.F7; + this.Text = "Check Spelling"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandCheckSpelling - // - this.CommandBarButtonText = ""; - this.ContextMenuPath = ""; - this.MenuText = "Check &Spelling"; - this.Identifier = "MindShare.ApplicationCore.Commands.CheckSpelling"; - this.MainMenuPath = "&Tools@7/Check &Spelling...@100"; - this.Shortcut = System.Windows.Forms.Shortcut.F7; - this.Text = "Check Spelling"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandClear.cs b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandClear.cs index 7a758490..9273645c 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandClear.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandClear.cs @@ -5,55 +5,54 @@ using System.ComponentModel; namespace OpenLiveWriter.ApplicationFramework.Commands { - /// - /// Summary description for CommandClear. - /// - public class CommandClear : Command - { + /// + /// Summary description for CommandClear. + /// + public class CommandClear : Command + { - public CommandClear(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandClear(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandClear() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandClear() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandClear + // + this.ContextMenuPath = "-Clea&r@151"; + this.Identifier = "MindShare.ApplicationCore.Commands.Clear"; + this.MainMenuPath = "&Edit@2/-Clea&r@151"; + this.MenuText = "-Clea&r"; + this.Shortcut = System.Windows.Forms.Shortcut.Del; + this.Text = "Clear"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandClear - // - this.ContextMenuPath = "-Clea&r@151"; - this.Identifier = "MindShare.ApplicationCore.Commands.Clear"; - this.MainMenuPath = "&Edit@2/-Clea&r@151"; - this.MenuText = "-Clea&r"; - this.Shortcut = System.Windows.Forms.Shortcut.Del; - this.Text = "Clear"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandClose.cs b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandClose.cs index c772aefd..bd0c8eef 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandClose.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandClose.cs @@ -5,56 +5,55 @@ using System.ComponentModel; namespace OpenLiveWriter.ApplicationFramework.Commands { - /// - /// Summary description for CommandMinimize. - /// - public class CommandClose : Command - { + /// + /// Summary description for CommandMinimize. + /// + public class CommandClose : Command + { - public CommandClose(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandClose(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // TODO: Add any constructor code after InitializeComponent call - // - } + // + // TODO: Add any constructor code after InitializeComponent call + // + } - public CommandClose() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandClose() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // TODO: Add any constructor code after InitializeComponent call - // - } + // + // TODO: Add any constructor code after InitializeComponent call + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandClose + // + this.AccessibleDescription = ""; + this.ContextMenuPath = "-Close@20"; + this.Identifier = "OpenLiveWriter.ApplicationFramework.CommandClose"; + this.MainMenuPath = "&File@0/-&Close@500"; + this.Shortcut = System.Windows.Forms.Shortcut.AltF4; + this.Text = "Close"; + this.VisibleOnMainMenu = true; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandClose - // - this.AccessibleDescription = ""; - this.ContextMenuPath = "-Close@20"; - this.Identifier = "OpenLiveWriter.ApplicationFramework.CommandClose"; - this.MainMenuPath = "&File@0/-&Close@500"; - this.Shortcut = System.Windows.Forms.Shortcut.AltF4; - this.Text = "Close"; - this.VisibleOnMainMenu = true; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandColorize.cs b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandColorize.cs index 3a2c285d..8c9416e7 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandColorize.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandColorize.cs @@ -8,52 +8,51 @@ using System.Diagnostics; namespace OpenLiveWriter.ApplicationFramework.Commands { - /// - /// Summary description for CommandColorize. - /// - public class CommandColorize : Command - { + /// + /// Summary description for CommandColorize. + /// + public class CommandColorize : Command + { - public CommandColorize(System.ComponentModel.IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandColorize(System.ComponentModel.IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // TODO: Add any constructor code after InitializeComponent call - // - } + // + // TODO: Add any constructor code after InitializeComponent call + // + } - public CommandColorize() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandColorize() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // TODO: Add any constructor code after InitializeComponent call - // - } + // + // TODO: Add any constructor code after InitializeComponent call + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandColorize + // + this.Description = "Change the color scheme of Open Live Writer"; + this.Identifier = "OpenLiveWriter.Commands.Colorize"; + this.Text = "Colorize"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandColorize - // - this.Description = "Change the color scheme of Open Live Writer"; - this.Identifier = "OpenLiveWriter.Commands.Colorize"; - this.Text = "Colorize"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandCopy.cs b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandCopy.cs index 76a25e89..14dfe07c 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandCopy.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandCopy.cs @@ -5,55 +5,54 @@ using System.ComponentModel; namespace OpenLiveWriter.ApplicationFramework.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandCopy : Command - { + /// + /// Summary description for CommandCopy. + /// + public class CommandCopy : Command + { - public CommandCopy(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandCopy(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandCopy() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandCopy() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandCopy + // + this.ContextMenuPath = "&Copy@102"; + this.Identifier = "MindShare.ApplicationCore.Commands.Copy"; + this.MainMenuPath = "&Edit@2/&Copy@102"; + this.MenuText = "&Copy"; + this.Shortcut = System.Windows.Forms.Shortcut.CtrlC; + this.Text = "Copy"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandCopy - // - this.ContextMenuPath = "&Copy@102"; - this.Identifier = "MindShare.ApplicationCore.Commands.Copy"; - this.MainMenuPath = "&Edit@2/&Copy@102"; - this.MenuText = "&Copy"; - this.Shortcut = System.Windows.Forms.Shortcut.CtrlC; - this.Text = "Copy"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandCut.cs b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandCut.cs index 7b2f0e42..435abd53 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandCut.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandCut.cs @@ -5,55 +5,54 @@ using System.ComponentModel; namespace OpenLiveWriter.ApplicationFramework.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandCut : Command - { + /// + /// Summary description for CommandCopy. + /// + public class CommandCut : Command + { - public CommandCut(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandCut(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandCut() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandCut() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandCut + // + this.ContextMenuPath = "Cu&t@101"; + this.Identifier = "MindShare.ApplicationCore.Commands.Cut"; + this.MainMenuPath = "&Edit@2/Cu&t@101"; + this.MenuText = "Cu&t"; + this.Shortcut = System.Windows.Forms.Shortcut.CtrlX; + this.Text = "Cut"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandCut - // - this.ContextMenuPath = "Cu&t@101"; - this.Identifier = "MindShare.ApplicationCore.Commands.Cut"; - this.MainMenuPath = "&Edit@2/Cu&t@101"; - this.MenuText = "Cu&t"; - this.Shortcut = System.Windows.Forms.Shortcut.CtrlX; - this.Text = "Cut"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandDelete.cs b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandDelete.cs index 63ed637c..47b0be71 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandDelete.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandDelete.cs @@ -5,55 +5,54 @@ using System.ComponentModel; namespace OpenLiveWriter.ApplicationFramework.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandDelete : Command - { + /// + /// Summary description for CommandCopy. + /// + public class CommandDelete : Command + { - public CommandDelete(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandDelete(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandDelete() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandDelete() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandDelete + // + this.ContextMenuPath = "-&Delete-@151"; + this.Identifier = "MindShare.ApplicationCore.Commands.Delete"; + this.MainMenuPath = "&Edit@2/-&Delete-@151"; + this.MenuText = "&Delete"; + this.Shortcut = System.Windows.Forms.Shortcut.Del; + this.Text = "Delete"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandDelete - // - this.ContextMenuPath = "-&Delete-@151"; - this.Identifier = "MindShare.ApplicationCore.Commands.Delete"; - this.MainMenuPath = "&Edit@2/-&Delete-@151"; - this.MenuText = "&Delete"; - this.Shortcut = System.Windows.Forms.Shortcut.Del; - this.Text = "Delete"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandFind.cs b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandFind.cs index 236535f2..17dd0ef5 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandFind.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandFind.cs @@ -5,55 +5,54 @@ using System.ComponentModel; namespace OpenLiveWriter.ApplicationFramework.Commands { - /// - /// Summary description for CommandClear. - /// - public class CommandFind : Command - { + /// + /// Summary description for CommandClear. + /// + public class CommandFind : Command + { - public CommandFind(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandFind(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandFind() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandFind() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandFind + // + this.ContextMenuPath = "Fi&nd Text...@601"; + this.Identifier = "MindShare.ApplicationCore.Commands.Find"; + this.MainMenuPath = "&Edit@2/Fi&nd Text...@601"; + this.MenuText = "Fi&nd Text..."; + this.Shortcut = System.Windows.Forms.Shortcut.CtrlF; + this.Text = "Find"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandFind - // - this.ContextMenuPath = "Fi&nd Text...@601"; - this.Identifier = "MindShare.ApplicationCore.Commands.Find"; - this.MainMenuPath = "&Edit@2/Fi&nd Text...@601"; - this.MenuText = "Fi&nd Text..."; - this.Shortcut = System.Windows.Forms.Shortcut.CtrlF; - this.Text = "Find"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandFocusNextPane.cs b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandFocusNextPane.cs index 55989335..c1b2bbe6 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandFocusNextPane.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandFocusNextPane.cs @@ -5,73 +5,73 @@ using System.ComponentModel; namespace OpenLiveWriter.ApplicationFramework.Commands { - /// - /// Summary description for CommandFocusNextPane. - /// - public class CommandFocusNextPane : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandFocusNextPane. + /// + public class CommandFocusNextPane : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandFocusNextPane(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public CommandFocusNextPane(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandFocusNextPane() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandFocusNextPane() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandFocusNextPane - // - this.Identifier = "MindShare.ApplicationCore.Commands.FocusNextPane"; - this.Shortcut = System.Windows.Forms.Shortcut.F6; - this.Text = "Next Pane"; - this.VisibleOnCommandBar = false; - this.VisibleOnContextMenu = false; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandFocusNextPane + // + this.Identifier = "MindShare.ApplicationCore.Commands.FocusNextPane"; + this.Shortcut = System.Windows.Forms.Shortcut.F6; + this.Text = "Next Pane"; + this.VisibleOnCommandBar = false; + this.VisibleOnContextMenu = false; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandFocusPreviousPane.cs b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandFocusPreviousPane.cs index 7095deea..d360e80a 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandFocusPreviousPane.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandFocusPreviousPane.cs @@ -5,74 +5,74 @@ using System.ComponentModel; namespace OpenLiveWriter.ApplicationFramework.Commands { - /// - /// Summary description for CommandFocusPreviousPane. - /// - public class CommandFocusPreviousPane : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandFocusPreviousPane. + /// + public class CommandFocusPreviousPane : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandFocusPreviousPane(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public CommandFocusPreviousPane(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandFocusPreviousPane() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandFocusPreviousPane() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandFocusPreviousPane - // - this.Identifier = "MindShare.ApplicationCore.Commands.FocusPreviousPane"; - this.Shortcut = System.Windows.Forms.Shortcut.ShiftF6; - this.Text = "Previous Pane"; - this.VisibleOnCommandBar = false; - this.VisibleOnContextMenu = false; - this.VisibleOnMainMenu = false; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandFocusPreviousPane + // + this.Identifier = "MindShare.ApplicationCore.Commands.FocusPreviousPane"; + this.Shortcut = System.Windows.Forms.Shortcut.ShiftF6; + this.Text = "Previous Pane"; + this.VisibleOnCommandBar = false; + this.VisibleOnContextMenu = false; + this.VisibleOnMainMenu = false; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandFont.cs b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandFont.cs index 923ed45c..4d5f1236 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandFont.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandFont.cs @@ -5,54 +5,53 @@ using System.ComponentModel; namespace OpenLiveWriter.ApplicationFramework.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandFont : Command - { + /// + /// Summary description for CommandCopy. + /// + public class CommandFont : Command + { - public CommandFont(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandFont(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandFont() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandFont() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandFont + // + this.ContextMenuPath = "-&Font...@120"; + this.Identifier = "MindShare.ApplicationCore.Commands.Font"; + this.MainMenuPath = "F&ormat@5/&Font...@100"; + this.MenuText = "-&Font..."; + this.Text = "Font"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandFont - // - this.ContextMenuPath = "-&Font...@120"; - this.Identifier = "MindShare.ApplicationCore.Commands.Font"; - this.MainMenuPath = "F&ormat@5/&Font...@100"; - this.MenuText = "-&Font..."; - this.Text = "Font"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandFontColor.cs b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandFontColor.cs index d083fa02..a1b1d49c 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandFontColor.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandFontColor.cs @@ -5,53 +5,52 @@ using System.ComponentModel; namespace OpenLiveWriter.ApplicationFramework.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandFontColor : Command - { + /// + /// Summary description for CommandCopy. + /// + public class CommandFontColor : Command + { - public CommandFontColor(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandFontColor(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandFontColor() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandFontColor() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandFontColor + // + this.ContextMenuPath = ""; + this.Identifier = "MindShare.ApplicationCore.Commands.FontColor"; + this.MainMenuPath = "F&ormat@5/Font &Color...@101"; + this.Text = "Font Color"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandFontColor - // - this.ContextMenuPath = ""; - this.Identifier = "MindShare.ApplicationCore.Commands.FontColor"; - this.MainMenuPath = "F&ormat@5/Font &Color...@101"; - this.Text = "Font Color"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandHelp.cs b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandHelp.cs index c1dc205a..3dbfa21a 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandHelp.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandHelp.cs @@ -9,53 +9,52 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.ApplicationFramework.Commands { - public class CommandHelp : Command - { + public class CommandHelp : Command + { - public CommandHelp(System.ComponentModel.IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandHelp(System.ComponentModel.IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // TODO: Add any constructor code after InitializeComponent call - // - } + // + // TODO: Add any constructor code after InitializeComponent call + // + } - public CommandHelp() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandHelp() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // TODO: Add any constructor code after InitializeComponent call - // - } + // + // TODO: Add any constructor code after InitializeComponent call + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandHelp + // + this.CommandBarButtonText = ""; + this.ContextMenuPath = "{0} &Help-@101"; + this.Identifier = "OpenLiveWriter.Commands.Help"; + this.MainMenuPath = "&Help@500/&{0} Help-@101"; + this.MenuText = "{0} &Help"; + this.Shortcut = System.Windows.Forms.Shortcut.F1; + this.Text = "Help"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandHelp - // - this.CommandBarButtonText = ""; - this.ContextMenuPath = "{0} &Help-@101"; - this.Identifier = "OpenLiveWriter.Commands.Help"; - this.MainMenuPath = "&Help@500/&{0} Help-@101"; - this.MenuText = "{0} &Help"; - this.Shortcut = System.Windows.Forms.Shortcut.F1; - this.Text = "Help"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandIndent.cs b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandIndent.cs index f2132e2e..3756adb1 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandIndent.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandIndent.cs @@ -5,54 +5,53 @@ using System.ComponentModel; namespace OpenLiveWriter.ApplicationFramework.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandIndent : Command - { + /// + /// Summary description for CommandCopy. + /// + public class CommandIndent : Command + { - public CommandIndent(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandIndent(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandIndent() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandIndent() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandIndent + // + this.ContextMenuPath = "-&Increase Indent@110"; + this.Identifier = "MindShare.ApplicationCore.Commands.Indent"; + this.MainMenuPath = "F&ormat@5/&Indent@500/&Increase@100"; + this.MenuText = "&Increase Indent"; + this.Text = "Increase Indent"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandIndent - // - this.ContextMenuPath = "-&Increase Indent@110"; - this.Identifier = "MindShare.ApplicationCore.Commands.Indent"; - this.MainMenuPath = "F&ormat@5/&Indent@500/&Increase@100"; - this.MenuText = "&Increase Indent"; - this.Text = "Increase Indent"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandInsertLink.cs b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandInsertLink.cs index ec8d08ec..ef7aad44 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandInsertLink.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandInsertLink.cs @@ -5,47 +5,46 @@ using System.ComponentModel; namespace OpenLiveWriter.ApplicationFramework.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandInsertLink : Command - { + /// + /// Summary description for CommandCopy. + /// + public class CommandInsertLink : Command + { - public CommandInsertLink(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); - } + public CommandInsertLink(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); + } - public CommandInsertLink() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); - } + public CommandInsertLink() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandInsertLink + // + this.ContextMenuPath = "-&Hyperlink...@130"; + this.Identifier = "OpenLiveWriter.ApplicationFramework.Commands.InsertLink"; + this.MainMenuPath = "&Insert@4/&Hyperlink...@100"; + this.MenuText = "&Hyperlink..."; + this.Shortcut = System.Windows.Forms.Shortcut.CtrlK; + this.Text = "Insert Hyperlink"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandInsertLink - // - this.ContextMenuPath = "-&Hyperlink...@130"; - this.Identifier = "OpenLiveWriter.ApplicationFramework.Commands.InsertLink"; - this.MainMenuPath = "&Insert@4/&Hyperlink...@100"; - this.MenuText = "&Hyperlink..."; - this.Shortcut = System.Windows.Forms.Shortcut.CtrlK; - this.Text = "Insert Hyperlink"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandItalic.cs b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandItalic.cs index 1a10e700..8b58ed36 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandItalic.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandItalic.cs @@ -5,54 +5,53 @@ using System.ComponentModel; namespace OpenLiveWriter.ApplicationFramework.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandItalic : Command - { + /// + /// Summary description for CommandCopy. + /// + public class CommandItalic : Command + { - public CommandItalic(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandItalic(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandItalic() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandItalic() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandItalic + // + this.ContextMenuPath = ""; + this.Identifier = "MindShare.ApplicationCore.Commands.Italic"; + this.MainMenuPath = ""; + this.Shortcut = System.Windows.Forms.Shortcut.CtrlI; + this.Text = "Italic"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandItalic - // - this.ContextMenuPath = ""; - this.Identifier = "MindShare.ApplicationCore.Commands.Italic"; - this.MainMenuPath = ""; - this.Shortcut = System.Windows.Forms.Shortcut.CtrlI; - this.Text = "Italic"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandMenu.cs b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandMenu.cs index 2783b5af..591b8421 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandMenu.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandMenu.cs @@ -8,51 +8,50 @@ using System.Diagnostics; namespace OpenLiveWriter.ApplicationFramework.Commands { - /// - /// Summary description for CommandMenu. - /// - public class CommandMenu : Command - { + /// + /// Summary description for CommandMenu. + /// + public class CommandMenu : Command + { - public CommandMenu(System.ComponentModel.IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandMenu(System.ComponentModel.IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // TODO: Add any constructor code after InitializeComponent call - // - } + // + // TODO: Add any constructor code after InitializeComponent call + // + } - public CommandMenu() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandMenu() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // TODO: Add any constructor code after InitializeComponent call - // - } + // + // TODO: Add any constructor code after InitializeComponent call + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandMenu + // + this.Identifier = "OpenLiveWriter.Commands.Menu"; + this.Text = "Show menu"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandMenu - // - this.Identifier = "OpenLiveWriter.Commands.Menu"; - this.Text = "Show menu"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandNumbers.cs b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandNumbers.cs index c5f43080..f0bf60ed 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandNumbers.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandNumbers.cs @@ -5,53 +5,52 @@ using System.ComponentModel; namespace OpenLiveWriter.ApplicationFramework.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandNumbers : Command - { + /// + /// Summary description for CommandCopy. + /// + public class CommandNumbers : Command + { - public CommandNumbers(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandNumbers(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandNumbers() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandNumbers() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandNumbers - // - this.ContextMenuPath = ""; - this.Identifier = "MindShare.ApplicationCore.Commands.Numbers"; - this.MainMenuPath = "F&ormat@5/-&Numbering@400"; - this.Text = "Numbering"; - this.SuppressMenuBitmap = true; - } - #endregion - } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandNumbers + // + this.ContextMenuPath = ""; + this.Identifier = "MindShare.ApplicationCore.Commands.Numbers"; + this.MainMenuPath = "F&ormat@5/-&Numbering@400"; + this.Text = "Numbering"; + this.SuppressMenuBitmap = true; + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandOpen.cs b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandOpen.cs index a612945e..17974cb3 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandOpen.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandOpen.cs @@ -5,54 +5,53 @@ using System.ComponentModel; namespace OpenLiveWriter.ApplicationFramework.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandOpen : Command - { + /// + /// Summary description for CommandCopy. + /// + public class CommandOpen : Command + { - public CommandOpen(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandOpen(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandOpen() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandOpen() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandOpen + // + this.ContextMenuPath = "&Open...@201"; + this.Identifier = "MindShare.ApplicationCore.Commands.Open"; + this.MainMenuPath = "&Edit@2/&Open...@201"; + this.MenuText = "&Open..."; + this.Text = "Open"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandOpen - // - this.ContextMenuPath = "&Open...@201"; - this.Identifier = "MindShare.ApplicationCore.Commands.Open"; - this.MainMenuPath = "&Edit@2/&Open...@201"; - this.MenuText = "&Open..."; - this.Text = "Open"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandOutdent.cs b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandOutdent.cs index 6d4239cf..364f398a 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandOutdent.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandOutdent.cs @@ -5,54 +5,53 @@ using System.ComponentModel; namespace OpenLiveWriter.ApplicationFramework.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandOutdent : Command - { + /// + /// Summary description for CommandCopy. + /// + public class CommandOutdent : Command + { - public CommandOutdent(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandOutdent(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandOutdent() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandOutdent() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandOutdent + // + this.ContextMenuPath = "&Decrease Indent@111"; + this.Identifier = "MindShare.ApplicationCore.Commands.Outdent"; + this.MainMenuPath = "F&ormat@5/&Indent@500/&Decrease@101"; + this.MenuText = "&Decrease Indent"; + this.Text = "Decrease Indent"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandOutdent - // - this.ContextMenuPath = "&Decrease Indent@111"; - this.Identifier = "MindShare.ApplicationCore.Commands.Outdent"; - this.MainMenuPath = "F&ormat@5/&Indent@500/&Decrease@101"; - this.MenuText = "&Decrease Indent"; - this.Text = "Decrease Indent"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandPageSetup.cs b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandPageSetup.cs index 9a165939..70345091 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandPageSetup.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandPageSetup.cs @@ -5,46 +5,45 @@ using System.ComponentModel; namespace OpenLiveWriter.ApplicationFramework.Commands { - /// - /// Summary description for PrintCommand. - /// - public class CommandPageSetup : Command - { + /// + /// Summary description for PrintCommand. + /// + public class CommandPageSetup : Command + { - public CommandPageSetup(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandPageSetup(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - } + } - public CommandPageSetup() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandPageSetup() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - } + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandPageSetup + // + this.Identifier = "MindShare.ApplicationCore.Commands.PageSetup"; + this.MainMenuPath = "&File@0/-Page Set&up...@120"; + this.Text = "Page Setup"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandPageSetup - // - this.Identifier = "MindShare.ApplicationCore.Commands.PageSetup"; - this.MainMenuPath = "&File@0/-Page Set&up...@120"; - this.Text = "Page Setup"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandPaste.cs b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandPaste.cs index e3b6cad5..f3560a28 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandPaste.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandPaste.cs @@ -5,55 +5,54 @@ using System.ComponentModel; namespace OpenLiveWriter.ApplicationFramework.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandPaste : Command - { + /// + /// Summary description for CommandCopy. + /// + public class CommandPaste : Command + { - public CommandPaste(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandPaste(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandPaste() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandPaste() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandPaste + // + this.ContextMenuPath = "&Paste@104"; + this.Identifier = "MindShare.ApplicationCore.Commands.Paste"; + this.MainMenuPath = "&Edit@2/&Paste@106"; + this.MenuText = "&Paste"; + this.Shortcut = System.Windows.Forms.Shortcut.CtrlV; + this.Text = "Paste"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandPaste - // - this.ContextMenuPath = "&Paste@104"; - this.Identifier = "MindShare.ApplicationCore.Commands.Paste"; - this.MainMenuPath = "&Edit@2/&Paste@106"; - this.MenuText = "&Paste"; - this.Shortcut = System.Windows.Forms.Shortcut.CtrlV; - this.Text = "Paste"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandPasteSpecial.cs b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandPasteSpecial.cs index 30abce47..b79e9774 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandPasteSpecial.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandPasteSpecial.cs @@ -5,55 +5,54 @@ using System.ComponentModel; namespace OpenLiveWriter.ApplicationFramework.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandPasteSpecial : Command - { + /// + /// Summary description for CommandCopy. + /// + public class CommandPasteSpecial : Command + { - public CommandPasteSpecial(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandPasteSpecial(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandPasteSpecial() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandPasteSpecial() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandPaste + // + this.ContextMenuPath = ""; + this.Identifier = "MindShare.ApplicationCore.Commands.PasteSpecial"; + this.MainMenuPath = "&Edit@2/&Paste Special...@108"; + this.MenuText = "Paste Spe&cial..."; + this.Shortcut = System.Windows.Forms.Shortcut.CtrlShiftV; + this.Text = "Paste Special..."; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandPaste - // - this.ContextMenuPath = ""; - this.Identifier = "MindShare.ApplicationCore.Commands.PasteSpecial"; - this.MainMenuPath = "&Edit@2/&Paste Special...@108"; - this.MenuText = "Paste Spe&cial..."; - this.Shortcut = System.Windows.Forms.Shortcut.CtrlShiftV; - this.Text = "Paste Special..."; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandPasteWithoutFormatting.cs b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandPasteWithoutFormatting.cs index 086d11a1..e303ddb1 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandPasteWithoutFormatting.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandPasteWithoutFormatting.cs @@ -5,55 +5,54 @@ using System.ComponentModel; namespace OpenLiveWriter.ApplicationFramework.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandPasteWithoutFormatting : Command - { + /// + /// Summary description for CommandCopy. + /// + public class CommandPasteWithoutFormatting : Command + { - public CommandPasteWithoutFormatting(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandPasteWithoutFormatting(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandPasteWithoutFormatting() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandPasteWithoutFormatting() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandPasteWithoutFormatting + // + this.ContextMenuPath = "Paste &Without Formatting@105"; + this.Identifier = "MindShare.ApplicationCore.Commands.PasteWithoutFormatting"; + this.MainMenuPath = "&Edit@2/Paste &Without Formatting@105"; + this.MenuText = "Paste &Without Formatting"; + this.Shortcut = System.Windows.Forms.Shortcut.CtrlShiftV; + this.Text = "Paste"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandPasteWithoutFormatting - // - this.ContextMenuPath = "Paste &Without Formatting@105"; - this.Identifier = "MindShare.ApplicationCore.Commands.PasteWithoutFormatting"; - this.MainMenuPath = "&Edit@2/Paste &Without Formatting@105"; - this.MenuText = "Paste &Without Formatting"; - this.Shortcut = System.Windows.Forms.Shortcut.CtrlShiftV; - this.Text = "Paste"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandPrint.cs b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandPrint.cs index 14c35619..dcba1768 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandPrint.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandPrint.cs @@ -5,47 +5,46 @@ using System.ComponentModel; namespace OpenLiveWriter.ApplicationFramework.Commands { - /// - /// Summary description for PrintCommand. - /// - public class CommandPrint : Command - { + /// + /// Summary description for PrintCommand. + /// + public class CommandPrint : Command + { - public CommandPrint(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandPrint(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - } + } - public CommandPrint() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandPrint() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - } + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandPrint + // + this.Identifier = "MindShare.ApplicationCore.Commands.Print"; + this.MainMenuPath = "&File@0/&Print...@121"; + this.Shortcut = System.Windows.Forms.Shortcut.CtrlP; + this.Text = "Print"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandPrint - // - this.Identifier = "MindShare.ApplicationCore.Commands.Print"; - this.MainMenuPath = "&File@0/&Print...@121"; - this.Shortcut = System.Windows.Forms.Shortcut.CtrlP; - this.Text = "Print"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandPrintPreview.cs b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandPrintPreview.cs index f7285012..dbce8db8 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandPrintPreview.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandPrintPreview.cs @@ -5,46 +5,45 @@ using System.ComponentModel; namespace OpenLiveWriter.ApplicationFramework.Commands { - /// - /// Summary description for PrintCommand. - /// - public class CommandPrintPreview : Command - { + /// + /// Summary description for PrintCommand. + /// + public class CommandPrintPreview : Command + { - public CommandPrintPreview(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandPrintPreview(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - } + } - public CommandPrintPreview() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandPrintPreview() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - } + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandPrintPreview + // + this.Identifier = "MindShare.ApplicationCore.Commands.PrintPreview"; + this.MainMenuPath = "&File@0/Print Pre&view...-@122"; + this.Text = "Print Preview"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandPrintPreview - // - this.Identifier = "MindShare.ApplicationCore.Commands.PrintPreview"; - this.MainMenuPath = "&File@0/Print Pre&view...-@122"; - this.Text = "Print Preview"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandRedo.cs b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandRedo.cs index ca2d6a64..c5b641fd 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandRedo.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandRedo.cs @@ -5,53 +5,52 @@ using System.ComponentModel; namespace OpenLiveWriter.ApplicationFramework.Commands { - /// - /// Summary description for CommandRename. - /// - public class CommandRedo : Command - { + /// + /// Summary description for CommandRename. + /// + public class CommandRedo : Command + { - public CommandRedo(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandRedo(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandRedo() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandRedo() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandRedo + // + this.Identifier = "MindShare.ApplicationCore.Commands.Redo"; + this.MainMenuPath = "&Edit@2/&Redo-@100"; + this.Shortcut = System.Windows.Forms.Shortcut.CtrlY; + this.Text = "Redo"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandRedo - // - this.Identifier = "MindShare.ApplicationCore.Commands.Redo"; - this.MainMenuPath = "&Edit@2/&Redo-@100"; - this.Shortcut = System.Windows.Forms.Shortcut.CtrlY; - this.Text = "Redo"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandSave.cs b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandSave.cs index 3b2f5e22..bcff9900 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandSave.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandSave.cs @@ -5,53 +5,52 @@ using System.ComponentModel; namespace OpenLiveWriter.ApplicationFramework.Commands { - /// - /// Summary description for CommandSave. - /// - public class CommandSave : Command - { + /// + /// Summary description for CommandSave. + /// + public class CommandSave : Command + { - public CommandSave(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandSave(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandSave() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandSave() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandSave + // + this.Identifier = "MindShare.ApplicationCore.Commands.Save"; + this.MainMenuPath = "&File@0/&Save@10"; + this.Shortcut = System.Windows.Forms.Shortcut.CtrlS; + this.Text = "Save"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandSave - // - this.Identifier = "MindShare.ApplicationCore.Commands.Save"; - this.MainMenuPath = "&File@0/&Save@10"; - this.Shortcut = System.Windows.Forms.Shortcut.CtrlS; - this.Text = "Save"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandSelectAll.cs b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandSelectAll.cs index 11e5a6d1..36561b57 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandSelectAll.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandSelectAll.cs @@ -5,55 +5,54 @@ using System.ComponentModel; namespace OpenLiveWriter.ApplicationFramework.Commands { - /// - /// Summary description for CommandClear. - /// - public class CommandSelectAll : Command - { + /// + /// Summary description for CommandClear. + /// + public class CommandSelectAll : Command + { - public CommandSelectAll(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandSelectAll(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandSelectAll() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandSelectAll() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandSelectAll + // + this.ContextMenuPath = "-Select &All@501"; + this.Identifier = "MindShare.ApplicationCore.Commands.SelectAll"; + this.MainMenuPath = "&Edit@2/-Select &All@501"; + this.MenuText = "Select &All"; + this.Shortcut = System.Windows.Forms.Shortcut.CtrlA; + this.Text = "Select All"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandSelectAll - // - this.ContextMenuPath = "-Select &All@501"; - this.Identifier = "MindShare.ApplicationCore.Commands.SelectAll"; - this.MainMenuPath = "&Edit@2/-Select &All@501"; - this.MenuText = "Select &All"; - this.Shortcut = System.Windows.Forms.Shortcut.CtrlA; - this.Text = "Select All"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandSendFeedback.cs b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandSendFeedback.cs index cd8bf04a..a7a5b2e7 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandSendFeedback.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandSendFeedback.cs @@ -9,54 +9,53 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.ApplicationFramework.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandSendFeedback : Command - { + /// + /// Summary description for CommandCopy. + /// + public class CommandSendFeedback : Command + { - public CommandSendFeedback(System.ComponentModel.IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandSendFeedback(System.ComponentModel.IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // TODO: Add any constructor code after InitializeComponent call - // - } + // + // TODO: Add any constructor code after InitializeComponent call + // + } - public CommandSendFeedback() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandSendFeedback() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // TODO: Add any constructor code after InitializeComponent call - // - } + // + // TODO: Add any constructor code after InitializeComponent call + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandSendFeedback + // + this.ContextMenuPath = "Send &Feedback@305"; + this.Identifier = "OpenLiveWriter.Commands.SendFeedback"; + this.MainMenuPath = "&Help@500/Send &Feedback@305"; + this.MenuText = "Send &Feedback"; + this.Text = "Send Feedback"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandSendFeedback - // - this.ContextMenuPath = "Send &Feedback@305"; - this.Identifier = "OpenLiveWriter.Commands.SendFeedback"; - this.MainMenuPath = "&Help@500/Send &Feedback@305"; - this.MenuText = "Send &Feedback"; - this.Text = "Send Feedback"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandShowMenu.cs b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandShowMenu.cs index 1553297b..dffa355f 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandShowMenu.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandShowMenu.cs @@ -8,53 +8,52 @@ using System.Diagnostics; namespace OpenLiveWriter.ApplicationFramework.Commands { - /// - /// Summary description for CommandShowMenu. - /// - public class CommandShowMenu : Command - { + /// + /// Summary description for CommandShowMenu. + /// + public class CommandShowMenu : Command + { - public CommandShowMenu(System.ComponentModel.IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandShowMenu(System.ComponentModel.IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // TODO: Add any constructor code after InitializeComponent call - // - } + // + // TODO: Add any constructor code after InitializeComponent call + // + } - public CommandShowMenu() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandShowMenu() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // TODO: Add any constructor code after InitializeComponent call - // - } + // + // TODO: Add any constructor code after InitializeComponent call + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandShowMenu + // + this.Identifier = "OpenLiveWriter.Commands.ShowMenu"; + this.MainMenuPath = "&View@2/&Menu Bar@130"; + this.MenuText = "Menu Bar"; + this.Text = "Show the menu bar"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandShowMenu - // - this.Identifier = "OpenLiveWriter.Commands.ShowMenu"; - this.MainMenuPath = "&View@2/&Menu Bar@130"; - this.MenuText = "Menu Bar"; - this.Text = "Show the menu bar"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandStrikethrough.cs b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandStrikethrough.cs index 1e2b46c1..9b57ae72 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandStrikethrough.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandStrikethrough.cs @@ -5,54 +5,53 @@ using System.ComponentModel; namespace OpenLiveWriter.ApplicationFramework.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandStrikethrough : Command - { + /// + /// Summary description for CommandCopy. + /// + public class CommandStrikethrough : Command + { - public CommandStrikethrough(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandStrikethrough(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandStrikethrough() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandStrikethrough() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandUnderline + // + this.ContextMenuPath = ""; + this.Identifier = "MindShare.ApplicationCore.Commands.Strikethrough"; + this.MainMenuPath = ""; + this.Shortcut = System.Windows.Forms.Shortcut.CtrlH ; + this.Text = "Strikethrough"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandUnderline - // - this.ContextMenuPath = ""; - this.Identifier = "MindShare.ApplicationCore.Commands.Strikethrough"; - this.MainMenuPath = ""; - this.Shortcut = System.Windows.Forms.Shortcut.CtrlH ; - this.Text = "Strikethrough"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandStyle.cs b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandStyle.cs index 342423e6..8b32df19 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandStyle.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandStyle.cs @@ -5,56 +5,55 @@ using System.ComponentModel; namespace OpenLiveWriter.ApplicationFramework.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandStyle : Command - { + /// + /// Summary description for CommandCopy. + /// + public class CommandStyle : Command + { - public CommandStyle(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandStyle(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandStyle() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandStyle() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandStyle + // + this.ContextMenuPath = ""; + this.Identifier = "MindShare.ApplicationCore.Commands.Style"; + this.MainMenuPath = ""; + this.MenuText = ""; + this.Text = "Style"; + this.VisibleOnContextMenu = false; + this.VisibleOnMainMenu = false; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandStyle - // - this.ContextMenuPath = ""; - this.Identifier = "MindShare.ApplicationCore.Commands.Style"; - this.MainMenuPath = ""; - this.MenuText = ""; - this.Text = "Style"; - this.VisibleOnContextMenu = false; - this.VisibleOnMainMenu = false; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandUnderline.cs b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandUnderline.cs index 1b56ced2..36c1d511 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandUnderline.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandUnderline.cs @@ -5,54 +5,53 @@ using System.ComponentModel; namespace OpenLiveWriter.ApplicationFramework.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandUnderline : Command - { + /// + /// Summary description for CommandCopy. + /// + public class CommandUnderline : Command + { - public CommandUnderline(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandUnderline(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandUnderline() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandUnderline() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandUnderline + // + this.ContextMenuPath = ""; + this.Identifier = "MindShare.ApplicationCore.Commands.Underline"; + this.MainMenuPath = ""; + this.Shortcut = System.Windows.Forms.Shortcut.CtrlU; + this.Text = "Underline"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandUnderline - // - this.ContextMenuPath = ""; - this.Identifier = "MindShare.ApplicationCore.Commands.Underline"; - this.MainMenuPath = ""; - this.Shortcut = System.Windows.Forms.Shortcut.CtrlU; - this.Text = "Underline"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandUndo.cs b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandUndo.cs index ac65765b..962c611d 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandUndo.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/Commands/CommandUndo.cs @@ -5,53 +5,52 @@ using System.ComponentModel; namespace OpenLiveWriter.ApplicationFramework.Commands { - /// - /// Summary description for CommandRename. - /// - public class CommandUndo : Command - { + /// + /// Summary description for CommandRename. + /// + public class CommandUndo : Command + { - public CommandUndo(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandUndo(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandUndo() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandUndo() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandUndo + // + this.Identifier = "MindShare.ApplicationCore.Commands.Undo"; + this.MainMenuPath = "&Edit@2/&Undo@99"; + this.Shortcut = System.Windows.Forms.Shortcut.CtrlZ; + this.Text = "Undo"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandUndo - // - this.Identifier = "MindShare.ApplicationCore.Commands.Undo"; - this.MainMenuPath = "&Edit@2/&Undo@99"; - this.Shortcut = System.Windows.Forms.Shortcut.CtrlZ; - this.Text = "Undo"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/DefaultApplicationStyle.cs b/src/managed/OpenLiveWriter.ApplicationFramework/DefaultApplicationStyle.cs index 1dde2624..812b535b 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/DefaultApplicationStyle.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/DefaultApplicationStyle.cs @@ -10,84 +10,84 @@ using System.Windows.Forms; namespace Project31.ApplicationFramework { - /// - /// A default application style. - /// - public class DefaultApplicationStyle : ApplicationStyle - { - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; + /// + /// A default application style. + /// + public class DefaultApplicationStyle : ApplicationStyle + { + /// + /// Required designer variable. + /// + private System.ComponentModel.Container components = null; - public DefaultApplicationStyle() - { - // This call is required by the Windows.Forms Form Designer. - InitializeComponent(); - } + public DefaultApplicationStyle() + { + // This call is required by the Windows.Forms Form Designer. + InitializeComponent(); + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // DefaultApplicationStyle - // - this.ActiveTabBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(183)), ((System.Byte)(203)), ((System.Byte)(245))); - this.ActiveTabHighlightColor = System.Drawing.Color.FromArgb(((System.Byte)(243)), ((System.Byte)(243)), ((System.Byte)(243))); - this.ActiveTabLowlightColor = System.Drawing.Color.FromArgb(((System.Byte)(181)), ((System.Byte)(193)), ((System.Byte)(196))); - this.ActiveTabTextColor = System.Drawing.Color.Black; - this.ActiveTabTopColor = System.Drawing.Color.FromArgb(((System.Byte)(207)), ((System.Byte)(227)), ((System.Byte)(253))); - this.AlertControlColor = System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(255)), ((System.Byte)(194))); - this.BoldApplicationFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold); - this.BorderColor = System.Drawing.Color.FromArgb(((System.Byte)(117)), ((System.Byte)(135)), ((System.Byte)(179))); - this.InactiveTabBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(228)), ((System.Byte)(228)), ((System.Byte)(228))); - this.InactiveTabHighlightColor = System.Drawing.Color.FromArgb(((System.Byte)(243)), ((System.Byte)(243)), ((System.Byte)(243))); - this.InactiveTabLowlightColor = System.Drawing.Color.FromArgb(((System.Byte)(189)), ((System.Byte)(189)), ((System.Byte)(189))); - this.InactiveTabTextColor = System.Drawing.Color.Black; - this.InactiveTabTopColor = System.Drawing.Color.FromArgb(((System.Byte)(232)), ((System.Byte)(232)), ((System.Byte)(232))); - this.ItalicApplicationFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Italic); - this.LinkApplicationFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Underline); - this.NormalApplicationFont = new System.Drawing.Font("Tahoma", 8.25F); - this.PrimaryWorkspaceBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(161)), ((System.Byte)(180)), ((System.Byte)(215))); - this.PrimaryWorkspaceCommandBarBottomBevelFirstLineColor = System.Drawing.Color.FromArgb(((System.Byte)(117)), ((System.Byte)(135)), ((System.Byte)(179))); - this.PrimaryWorkspaceCommandBarBottomBevelSecondLineColor = System.Drawing.Color.FromArgb(((System.Byte)(166)), ((System.Byte)(187)), ((System.Byte)(223))); - this.PrimaryWorkspaceCommandBarBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(148)), ((System.Byte)(173)), ((System.Byte)(222))); - this.PrimaryWorkspaceCommandBarBottomLayoutMargin = 3; - this.PrimaryWorkspaceCommandBarDisabledTextColor = System.Drawing.Color.Gray; - this.PrimaryWorkspaceCommandBarLeftLayoutMargin = 2; - this.PrimaryWorkspaceCommandBarRightLayoutMargin = 2; - this.PrimaryWorkspaceCommandBarSeparatorLayoutMargin = 2; - this.PrimaryWorkspaceCommandBarTextColor = System.Drawing.Color.Black; - this.PrimaryWorkspaceCommandBarTopBevelFirstLineColor = System.Drawing.Color.Transparent; - this.PrimaryWorkspaceCommandBarTopBevelSecondLineColor = System.Drawing.Color.Transparent; - this.PrimaryWorkspaceCommandBarTopColor = System.Drawing.Color.FromArgb(((System.Byte)(193)), ((System.Byte)(213)), ((System.Byte)(249))); - this.PrimaryWorkspaceCommandBarTopLayoutMargin = 2; - this.PrimaryWorkspaceTopColor = System.Drawing.Color.FromArgb(((System.Byte)(154)), ((System.Byte)(174)), ((System.Byte)(213))); - this.SecondaryWorkspaceBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(183)), ((System.Byte)(203)), ((System.Byte)(245))); - this.SecondaryWorkspaceTopColor = System.Drawing.Color.FromArgb(((System.Byte)(183)), ((System.Byte)(203)), ((System.Byte)(245))); - this.SmallApplicationFont = new System.Drawing.Font("Tahoma", 6.75F); - this.WorkspacePaneControlColor = System.Drawing.Color.FromArgb(((System.Byte)(214)), ((System.Byte)(223)), ((System.Byte)(247))); + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // DefaultApplicationStyle + // + this.ActiveTabBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(183)), ((System.Byte)(203)), ((System.Byte)(245))); + this.ActiveTabHighlightColor = System.Drawing.Color.FromArgb(((System.Byte)(243)), ((System.Byte)(243)), ((System.Byte)(243))); + this.ActiveTabLowlightColor = System.Drawing.Color.FromArgb(((System.Byte)(181)), ((System.Byte)(193)), ((System.Byte)(196))); + this.ActiveTabTextColor = System.Drawing.Color.Black; + this.ActiveTabTopColor = System.Drawing.Color.FromArgb(((System.Byte)(207)), ((System.Byte)(227)), ((System.Byte)(253))); + this.AlertControlColor = System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(255)), ((System.Byte)(194))); + this.BoldApplicationFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold); + this.BorderColor = System.Drawing.Color.FromArgb(((System.Byte)(117)), ((System.Byte)(135)), ((System.Byte)(179))); + this.InactiveTabBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(228)), ((System.Byte)(228)), ((System.Byte)(228))); + this.InactiveTabHighlightColor = System.Drawing.Color.FromArgb(((System.Byte)(243)), ((System.Byte)(243)), ((System.Byte)(243))); + this.InactiveTabLowlightColor = System.Drawing.Color.FromArgb(((System.Byte)(189)), ((System.Byte)(189)), ((System.Byte)(189))); + this.InactiveTabTextColor = System.Drawing.Color.Black; + this.InactiveTabTopColor = System.Drawing.Color.FromArgb(((System.Byte)(232)), ((System.Byte)(232)), ((System.Byte)(232))); + this.ItalicApplicationFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Italic); + this.LinkApplicationFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Underline); + this.NormalApplicationFont = new System.Drawing.Font("Tahoma", 8.25F); + this.PrimaryWorkspaceBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(161)), ((System.Byte)(180)), ((System.Byte)(215))); + this.PrimaryWorkspaceCommandBarBottomBevelFirstLineColor = System.Drawing.Color.FromArgb(((System.Byte)(117)), ((System.Byte)(135)), ((System.Byte)(179))); + this.PrimaryWorkspaceCommandBarBottomBevelSecondLineColor = System.Drawing.Color.FromArgb(((System.Byte)(166)), ((System.Byte)(187)), ((System.Byte)(223))); + this.PrimaryWorkspaceCommandBarBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(148)), ((System.Byte)(173)), ((System.Byte)(222))); + this.PrimaryWorkspaceCommandBarBottomLayoutMargin = 3; + this.PrimaryWorkspaceCommandBarDisabledTextColor = System.Drawing.Color.Gray; + this.PrimaryWorkspaceCommandBarLeftLayoutMargin = 2; + this.PrimaryWorkspaceCommandBarRightLayoutMargin = 2; + this.PrimaryWorkspaceCommandBarSeparatorLayoutMargin = 2; + this.PrimaryWorkspaceCommandBarTextColor = System.Drawing.Color.Black; + this.PrimaryWorkspaceCommandBarTopBevelFirstLineColor = System.Drawing.Color.Transparent; + this.PrimaryWorkspaceCommandBarTopBevelSecondLineColor = System.Drawing.Color.Transparent; + this.PrimaryWorkspaceCommandBarTopColor = System.Drawing.Color.FromArgb(((System.Byte)(193)), ((System.Byte)(213)), ((System.Byte)(249))); + this.PrimaryWorkspaceCommandBarTopLayoutMargin = 2; + this.PrimaryWorkspaceTopColor = System.Drawing.Color.FromArgb(((System.Byte)(154)), ((System.Byte)(174)), ((System.Byte)(213))); + this.SecondaryWorkspaceBottomColor = System.Drawing.Color.FromArgb(((System.Byte)(183)), ((System.Byte)(203)), ((System.Byte)(245))); + this.SecondaryWorkspaceTopColor = System.Drawing.Color.FromArgb(((System.Byte)(183)), ((System.Byte)(203)), ((System.Byte)(245))); + this.SmallApplicationFont = new System.Drawing.Font("Tahoma", 6.75F); + this.WorkspacePaneControlColor = System.Drawing.Color.FromArgb(((System.Byte)(214)), ((System.Byte)(223)), ((System.Byte)(247))); - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/DisplayMessages/NoLinkTextSpecifiedDisplayMessage.cs b/src/managed/OpenLiveWriter.ApplicationFramework/DisplayMessages/NoLinkTextSpecifiedDisplayMessage.cs index 96763a52..e243ab2d 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/DisplayMessages/NoLinkTextSpecifiedDisplayMessage.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/DisplayMessages/NoLinkTextSpecifiedDisplayMessage.cs @@ -6,64 +6,64 @@ using OpenLiveWriter.Controls; namespace OpenLiveWriter.ApplicationFramework { - /// - /// Summary description for DeleteSingleItemDisplayMessage. - /// - public class NoLinkTextSpecifiedDisplayMessage : DisplayMessage - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for DeleteSingleItemDisplayMessage. + /// + public class NoLinkTextSpecifiedDisplayMessage : DisplayMessage + { + /// + /// Required designer variable. + /// + private Container components = null; - public NoLinkTextSpecifiedDisplayMessage(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public NoLinkTextSpecifiedDisplayMessage(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - } + } - public NoLinkTextSpecifiedDisplayMessage() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public NoLinkTextSpecifiedDisplayMessage() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - } + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // NoLinkTextSpecifiedDisplayMessage - // - this.Text = "You must specify the text for the hyperlink."; - this.Title = "No Link Text Specified"; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // NoLinkTextSpecifiedDisplayMessage + // + this.Text = "You must specify the text for the hyperlink."; + this.Title = "No Link Text Specified"; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/DisplayMessages/NoValidHyperlinkSpecifiedDisplayMessage.cs b/src/managed/OpenLiveWriter.ApplicationFramework/DisplayMessages/NoValidHyperlinkSpecifiedDisplayMessage.cs index ea759e71..70f20dce 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/DisplayMessages/NoValidHyperlinkSpecifiedDisplayMessage.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/DisplayMessages/NoValidHyperlinkSpecifiedDisplayMessage.cs @@ -6,64 +6,64 @@ using OpenLiveWriter.Controls; namespace OpenLiveWriter.ApplicationFramework { - /// - /// Summary description for DeleteSingleItemDisplayMessage. - /// - public class NoValidHyperlinkSpecifiedDisplayMessage : DisplayMessage - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for DeleteSingleItemDisplayMessage. + /// + public class NoValidHyperlinkSpecifiedDisplayMessage : DisplayMessage + { + /// + /// Required designer variable. + /// + private Container components = null; - public NoValidHyperlinkSpecifiedDisplayMessage(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public NoValidHyperlinkSpecifiedDisplayMessage(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - } + } - public NoValidHyperlinkSpecifiedDisplayMessage() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public NoValidHyperlinkSpecifiedDisplayMessage() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - } + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // NoValidHyperlinkSpecifiedDisplayMesssage - // - this.Text = "You must specify a valid hyperlink."; - this.Title = "Hyperlink Not Specified"; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // NoValidHyperlinkSpecifiedDisplayMesssage + // + this.Text = "You must specify a valid hyperlink."; + this.Title = "Hyperlink Not Specified"; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/DynamicCommandMenu.cs b/src/managed/OpenLiveWriter.ApplicationFramework/DynamicCommandMenu.cs index f2876f67..5504a438 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/DynamicCommandMenu.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/DynamicCommandMenu.cs @@ -40,7 +40,6 @@ namespace OpenLiveWriter.ApplicationFramework } } - // /// Clean up any resources being used. /// @@ -55,7 +54,6 @@ namespace OpenLiveWriter.ApplicationFramework } } - private void InitializeCommands() { Context.CommandManager.BeginUpdate(); @@ -161,7 +159,6 @@ namespace OpenLiveWriter.ApplicationFramework } } - private void command_Execute(object sender, EventArgs ea) { // notify context @@ -199,7 +196,6 @@ namespace OpenLiveWriter.ApplicationFramework } - public interface IDynamicCommandMenuContext { /// @@ -309,6 +305,5 @@ namespace OpenLiveWriter.ApplicationFramework public bool SeparatorBegin; } - } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/ICommandManager.cs b/src/managed/OpenLiveWriter.ApplicationFramework/ICommandManager.cs index 856d1b68..100fef54 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/ICommandManager.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/ICommandManager.cs @@ -6,47 +6,47 @@ using System.Windows.Forms; namespace Project31.ApplicationFramework { - /// - /// The interface of a selection manager. - /// - public interface ICommandManager - { - /// - /// Activates the specified command. - /// - /// The Command to activate. - void ActivateCommand(Command command); + /// + /// The interface of a selection manager. + /// + public interface ICommandManager + { + /// + /// Activates the specified command. + /// + /// The Command to activate. + void ActivateCommand(Command command); - /// - /// Deactivates the specified command. - /// - /// The Command to deactivate. - void DeactivateCommand(Command command); + /// + /// Deactivates the specified command. + /// + /// The Command to deactivate. + void DeactivateCommand(Command command); - /// - /// Activates the specified command list. - /// - /// The CommandList to activate. - void ActivateCommandList(CommandList commandList); + /// + /// Activates the specified command list. + /// + /// The CommandList to activate. + void ActivateCommandList(CommandList commandList); - /// - /// Deactivates the specified command list. - /// - /// The CommandList to deactivate. - void DeactivateCommandList(CommandList commandList); + /// + /// Deactivates the specified command list. + /// + /// The CommandList to deactivate. + void DeactivateCommandList(CommandList commandList); - /// - /// Gets the command with the specified command identifier. - /// - /// The command identifier of the command to get. - /// The command, or null if a command with the specified command identifier cannot be found. - Command GetCommand(string commandIdentifier); + /// + /// Gets the command with the specified command identifier. + /// + /// The command identifier of the command to get. + /// The command, or null if a command with the specified command identifier cannot be found. + Command GetCommand(string commandIdentifier); - /// - /// Gets the command with the specified shortcut. - /// - /// The shortcut of the command to get. - /// The command, or null if a command with the specified shortcut cannot be found. - Command GetCommand(Shortcut shortcut); - } + /// + /// Gets the command with the specified shortcut. + /// + /// The shortcut of the command to get. + /// The command, or null if a command with the specified shortcut cannot be found. + Command GetCommand(Shortcut shortcut); + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/ICommandProvider.cs b/src/managed/OpenLiveWriter.ApplicationFramework/ICommandProvider.cs index dd8dfcc8..09b53dc9 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/ICommandProvider.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/ICommandProvider.cs @@ -5,17 +5,17 @@ using System; namespace Project31.ApplicationFramework { - /// - /// Interface for command providers. - /// - public interface ICommandProvider - { - /// - /// Returns the command list for the command provider. - /// - CommandList CommandList - { - get; - } - } + /// + /// Interface for command providers. + /// + public interface ICommandProvider + { + /// + /// Returns the command list for the command provider. + /// + CommandList CommandList + { + get; + } + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/IMainFrameWindow.cs b/src/managed/OpenLiveWriter.ApplicationFramework/IMainFrameWindow.cs index 793f3c62..835d3972 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/IMainFrameWindow.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/IMainFrameWindow.cs @@ -242,4 +242,3 @@ namespace OpenLiveWriter.ApplicationFramework } - diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/MenuBuilderEntry.cs b/src/managed/OpenLiveWriter.ApplicationFramework/MenuBuilderEntry.cs index 69135af6..5af5d79d 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/MenuBuilderEntry.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/MenuBuilderEntry.cs @@ -8,219 +8,219 @@ using System.Windows.Forms; namespace Project31.ApplicationFramework { - /// - /// MenuBuilderEntry is an internal class used to build Command-based menus. - /// - internal sealed class MenuBuilderEntry - { - /// - /// The MenuBuilder for this MenuBuilderEntry. - /// - private MenuBuilder menuBuilder; + /// + /// MenuBuilderEntry is an internal class used to build Command-based menus. + /// + internal sealed class MenuBuilderEntry + { + /// + /// The MenuBuilder for this MenuBuilderEntry. + /// + private MenuBuilder menuBuilder; - /// - /// Merge menu entry level. - /// - private int level; + /// + /// Merge menu entry level. + /// + private int level; - /// - /// Gets the merge menu entry level. - /// - public int Level - { - get - { - return level; - } - } + /// + /// Gets the merge menu entry level. + /// + public int Level + { + get + { + return level; + } + } - /// - /// Merge menu entry position. - /// - private int position; + /// + /// Merge menu entry position. + /// + private int position; - /// - /// Gets the merge menu entry position. - /// - public int Position - { - get - { - return position; - } - } + /// + /// Gets the merge menu entry position. + /// + public int Position + { + get + { + return position; + } + } - /// - /// Merge menu entry text. - /// - private string text; + /// + /// Merge menu entry text. + /// + private string text; - /// - /// Gets the merge menu entry text. - /// - public string Text - { - get - { - return text; - } - } + /// + /// Gets the merge menu entry text. + /// + public string Text + { + get + { + return text; + } + } - /// - /// Merge menu entry command. - /// - private Command command; + /// + /// Merge menu entry command. + /// + private Command command; - /// - /// Gets the merge menu entry command. - /// - public Command Command - { - get - { - return command; - } - } + /// + /// Gets the merge menu entry command. + /// + public Command Command + { + get + { + return command; + } + } - /// - /// Child merge menu entries. - /// - private SortedList childMergeMenuEntries = new SortedList(); + /// + /// Child merge menu entries. + /// + private SortedList childMergeMenuEntries = new SortedList(); - /// - /// Initializes a new instance of the MenuBuilderEntry class. - /// - public MenuBuilderEntry(MenuBuilder menuBuilder) - { - this.menuBuilder = menuBuilder; - this.level = -1; - } + /// + /// Initializes a new instance of the MenuBuilderEntry class. + /// + public MenuBuilderEntry(MenuBuilder menuBuilder) + { + this.menuBuilder = menuBuilder; + this.level = -1; + } - /// - /// Initializes a new instance of the MenuBuilderEntry class. This constructor is used for - /// top level and "container" menu items. - /// - /// Merge menu entry position. - /// Merge menu entry text. - public MenuBuilderEntry(MenuBuilder menuBuilder, int level, int position, string text) - : this(menuBuilder, level, position, text, null) - { - } + /// + /// Initializes a new instance of the MenuBuilderEntry class. This constructor is used for + /// top level and "container" menu items. + /// + /// Merge menu entry position. + /// Merge menu entry text. + public MenuBuilderEntry(MenuBuilder menuBuilder, int level, int position, string text) + : this(menuBuilder, level, position, text, null) + { + } - /// - /// Initializes a new instance of the MenuBuilderEntry class. This constructor is used for - /// the command menu entry. - /// - /// Merge menu entry position. - /// Merge menu entry text. - /// Merge menu entry command. - public MenuBuilderEntry(MenuBuilder menuBuilder, int level, int position, string text, Command command) - { - this.menuBuilder = menuBuilder; - this.level = level; - this.position = position; - this.text = text; - this.command = command; - } + /// + /// Initializes a new instance of the MenuBuilderEntry class. This constructor is used for + /// the command menu entry. + /// + /// Merge menu entry position. + /// Merge menu entry text. + /// Merge menu entry command. + public MenuBuilderEntry(MenuBuilder menuBuilder, int level, int position, string text, Command command) + { + this.menuBuilder = menuBuilder; + this.level = level; + this.position = position; + this.text = text; + this.command = command; + } - /// - /// Indexer for access child merge menu entries. - /// - public MenuBuilderEntry this [int position, string text] - { - get - { - string key = String.Format("{0}-{1}", position.ToString("D3"), text); - return (MenuBuilderEntry)childMergeMenuEntries[key]; - } - set - { - string key = String.Format("{0}-{1}", position.ToString("D3"), text); - childMergeMenuEntries[key] = value; - } - } + /// + /// Indexer for access child merge menu entries. + /// + public MenuBuilderEntry this [int position, string text] + { + get + { + string key = String.Format("{0}-{1}", position.ToString("D3"), text); + return (MenuBuilderEntry)childMergeMenuEntries[key]; + } + set + { + string key = String.Format("{0}-{1}", position.ToString("D3"), text); + childMergeMenuEntries[key] = value; + } + } - /// - /// Creates and returns a set of menu items from the child merge menu entries in this merge - /// menu entry. - /// - /// The level at which the MenuItems will appear. - /// Array of menu items. - public MenuItem[] CreateMenuItems() - { - // If this merge menu entry has no child merge menu entries, return null. - if (childMergeMenuEntries.Count == 0) - return null; + /// + /// Creates and returns a set of menu items from the child merge menu entries in this merge + /// menu entry. + /// + /// The level at which the MenuItems will appear. + /// Array of menu items. + public MenuItem[] CreateMenuItems() + { + // If this merge menu entry has no child merge menu entries, return null. + if (childMergeMenuEntries.Count == 0) + return null; - // Construct an array list to hold the menu items being created. - ArrayList menuItemArrayList = new ArrayList(); + // Construct an array list to hold the menu items being created. + ArrayList menuItemArrayList = new ArrayList(); - // Enumerate the child merge menu entries of this merge menu entry. - foreach (MenuBuilderEntry mergeMenuEntry in childMergeMenuEntries.Values) - { - // Get the text of the merge menu entry. - string text = mergeMenuEntry.Text; + // Enumerate the child merge menu entries of this merge menu entry. + foreach (MenuBuilderEntry mergeMenuEntry in childMergeMenuEntries.Values) + { + // Get the text of the merge menu entry. + string text = mergeMenuEntry.Text; - // Create the menu item for this child merge menu entry. - MenuItem menuItem; - bool separatorBefore, separatorAfter; - if (menuBuilder.MenuType == MenuType.Main && mergeMenuEntry.level == 0) - { - // Level zero of a main menu. - menuItem = new OwnerDrawMenuItem(menuBuilder.MenuType); - separatorBefore = separatorAfter = false; - } - else - { - // Determine whether a separator before and a separator after the menu item - // should be inserted. - separatorBefore = text.StartsWith(SEPARATOR_TEXT); - separatorAfter = text.EndsWith(SEPARATOR_TEXT); - if (separatorBefore || separatorAfter) - text = text.Replace(SEPARATOR_TEXT, string.Empty); + // Create the menu item for this child merge menu entry. + MenuItem menuItem; + bool separatorBefore, separatorAfter; + if (menuBuilder.MenuType == MenuType.Main && mergeMenuEntry.level == 0) + { + // Level zero of a main menu. + menuItem = new OwnerDrawMenuItem(menuBuilder.MenuType); + separatorBefore = separatorAfter = false; + } + else + { + // Determine whether a separator before and a separator after the menu item + // should be inserted. + separatorBefore = text.StartsWith(SEPARATOR_TEXT); + separatorAfter = text.EndsWith(SEPARATOR_TEXT); + if (separatorBefore || separatorAfter) + text = text.Replace(SEPARATOR_TEXT, string.Empty); - // Instantiate the menu item. - if (mergeMenuEntry.Command == null) - menuItem = new OwnerDrawMenuItem(menuBuilder.MenuType); - else - menuItem = new CommandOwnerDrawMenuItem(menuBuilder.MenuType, mergeMenuEntry.Command); - } + // Instantiate the menu item. + if (mergeMenuEntry.Command == null) + menuItem = new OwnerDrawMenuItem(menuBuilder.MenuType); + else + menuItem = new CommandOwnerDrawMenuItem(menuBuilder.MenuType, mergeMenuEntry.Command); + } - // Set the menu item text. - menuItem.Text = text; + // Set the menu item text. + menuItem.Text = text; - // If this child merge menu entry has any child merge menu entries, recursively - // create their menu items. - MenuItem[] childMenuItems = mergeMenuEntry.CreateMenuItems(); - if (childMenuItems != null) - menuItem.MenuItems.AddRange(childMenuItems); + // If this child merge menu entry has any child merge menu entries, recursively + // create their menu items. + MenuItem[] childMenuItems = mergeMenuEntry.CreateMenuItems(); + if (childMenuItems != null) + menuItem.MenuItems.AddRange(childMenuItems); - // Add the separator menu item, as needed. - if (separatorBefore) - menuItemArrayList.Add(MakeSeparatorMenuItem(menuBuilder.MenuType)); + // Add the separator menu item, as needed. + if (separatorBefore) + menuItemArrayList.Add(MakeSeparatorMenuItem(menuBuilder.MenuType)); - // Add the menu item to the array of menu items being returned. - menuItemArrayList.Add(menuItem); + // Add the menu item to the array of menu items being returned. + menuItemArrayList.Add(menuItem); - // Add the separator menu item, as needed. - if (separatorAfter) - menuItemArrayList.Add(MakeSeparatorMenuItem(menuBuilder.MenuType)); - } + // Add the separator menu item, as needed. + if (separatorAfter) + menuItemArrayList.Add(MakeSeparatorMenuItem(menuBuilder.MenuType)); + } - // Done. Convert the array list into a MenuItem array and return it. - return (MenuItem[])menuItemArrayList.ToArray(typeof(MenuItem)); - } + // Done. Convert the array list into a MenuItem array and return it. + return (MenuItem[])menuItemArrayList.ToArray(typeof(MenuItem)); + } - /// - /// Helper to make a separator menu item. - /// - /// A MenuItem that is a separator MenuItem. - private static MenuItem MakeSeparatorMenuItem(MenuType menuType) - { - // Instantiate the separator menu item. - MenuItem separatorMenuItem = new OwnerDrawMenuItem(menuType); - separatorMenuItem.Text = SEPARATOR_TEXT; - return separatorMenuItem; - } - } + /// + /// Helper to make a separator menu item. + /// + /// A MenuItem that is a separator MenuItem. + private static MenuItem MakeSeparatorMenuItem(MenuType menuType) + { + // Instantiate the separator menu item. + MenuItem separatorMenuItem = new OwnerDrawMenuItem(menuType); + separatorMenuItem.Text = SEPARATOR_TEXT; + return separatorMenuItem; + } + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/MergeMenu.cs b/src/managed/OpenLiveWriter.ApplicationFramework/MergeMenu.cs index 33086179..d385d064 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/MergeMenu.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/MergeMenu.cs @@ -15,160 +15,160 @@ using Project31.Controls; namespace Project31.ApplicationFramework { - /// - /// Specifies type of merge menu to build. - /// - internal enum MergeMenuType - { - /// - /// Performs merge operations for a MainMenu. - /// - Main, + /// + /// Specifies type of merge menu to build. + /// + internal enum MergeMenuType + { + /// + /// Performs merge operations for a MainMenu. + /// + Main, - /// - /// Performs merge operations for a ContextMenu. - /// - Context - } + /// + /// Performs merge operations for a ContextMenu. + /// + Context + } - /// - /// Menu mergers and aquisitions. - /// - internal class MergeMenu - { - /// - /// The root merge menu entry. Commands are merged as child entries of this entry and - /// returned as an array of MenuItems. - /// - private MergeMenuEntry rootMergeMenuEntry = new MergeMenuEntry(); + /// + /// Menu mergers and aquisitions. + /// + internal class MergeMenu + { + /// + /// The root merge menu entry. Commands are merged as child entries of this entry and + /// returned as an array of MenuItems. + /// + private MergeMenuEntry rootMergeMenuEntry = new MergeMenuEntry(); - /// - /// The type of menu merge to perform. - /// - private MenuType menuType = MenuType.Main; + /// + /// The type of menu merge to perform. + /// + private MenuType menuType = MenuType.Main; - /// - /// Gets or sets the type of menu merge to perform. - /// - public MenuType MenuType - { - get - { - return menuType; - } - set - { - menuType = value; - } - } + /// + /// Gets or sets the type of menu merge to perform. + /// + public MenuType MenuType + { + get + { + return menuType; + } + set + { + menuType = value; + } + } - /// - /// Initializes a new instance of the MergeMenu class. - /// - public MergeMenu() - { - } + /// + /// Initializes a new instance of the MergeMenu class. + /// + public MergeMenu() + { + } - /// - /// Creates and returns a set of menu items for the commands that have been merged. - /// - /// Array of menu items. - public MenuItem[] CreateMenuItems() - { - return rootMergeMenuEntry.CreateMenuItems(); - } + /// + /// Creates and returns a set of menu items for the commands that have been merged. + /// + /// Array of menu items. + public MenuItem[] CreateMenuItems() + { + return rootMergeMenuEntry.CreateMenuItems(); + } - /// - /// Merge a Command into the merge menu. - /// - /// The command to merge. - /// The menu path at which to merge the command. Generally, this - /// will be either command.MainMenuPath or command.ContextMenuPath, but it can also be - /// a totally custom menu path as well. - public void MergeCommand(Command command, string menuPath) - { - // Ensure that a menu path was specified. - Debug.Assert(menuPath != null && menuPath.Length != 0, "No menu path specified"); - if (menuPath == null || menuPath.Length == 0) - return; + /// + /// Merge a Command into the merge menu. + /// + /// The command to merge. + /// The menu path at which to merge the command. Generally, this + /// will be either command.MainMenuPath or command.ContextMenuPath, but it can also be + /// a totally custom menu path as well. + public void MergeCommand(Command command, string menuPath) + { + // Ensure that a menu path was specified. + Debug.Assert(menuPath != null && menuPath.Length != 0, "No menu path specified"); + if (menuPath == null || menuPath.Length == 0) + return; - // Parse the menu path into an array of menu path entries. - string[] menuPathEntries = menuPath.Split(new char[] {'/'}); + // Parse the menu path into an array of menu path entries. + string[] menuPathEntries = menuPath.Split(new char[] {'/'}); - // Build the menu structure for this command from the array of menu path entries. For - // example, &File@1/&Close@2 specifies that this command represents the Close command - // of the File menu. It specifies that the Close MenuItem should appear at merge - // position 2 of the File menu, and that the File menu should appear at merge position - // 1 of the main menu. - int lastEntry = menuPathEntries.Length-1; - MergeMenuEntry parentMergeMenuEntry = rootMergeMenuEntry; - for (int entry = 0; entry <= lastEntry; entry++) - { - // Parse the menu path entry into text and position values. - string text; - int position; - ParseMenuPathEntry(menuPathEntries[entry], out text, out position); + // Build the menu structure for this command from the array of menu path entries. For + // example, &File@1/&Close@2 specifies that this command represents the Close command + // of the File menu. It specifies that the Close MenuItem should appear at merge + // position 2 of the File menu, and that the File menu should appear at merge position + // 1 of the main menu. + int lastEntry = menuPathEntries.Length-1; + MergeMenuEntry parentMergeMenuEntry = rootMergeMenuEntry; + for (int entry = 0; entry <= lastEntry; entry++) + { + // Parse the menu path entry into text and position values. + string text; + int position; + ParseMenuPathEntry(menuPathEntries[entry], out text, out position); - // See if we have a merge menu entry for this text and position already. - MergeMenuEntry mergeMenuEntry = (MergeMenuEntry)parentMergeMenuEntry[position, text]; - if (entry == lastEntry) - { - // Create the merge menu entry for this menu path entry. - parentMergeMenuEntry[position, text] = new MergeMenuEntry(position, text, command); - } - else - { - // If there isn't a merge menu entry for this intermediate menu path entry, - // create it. - if (mergeMenuEntry == null) - { - mergeMenuEntry = new MergeMenuEntry(position, text); - parentMergeMenuEntry[position, text] = mergeMenuEntry; - } + // See if we have a merge menu entry for this text and position already. + MergeMenuEntry mergeMenuEntry = (MergeMenuEntry)parentMergeMenuEntry[position, text]; + if (entry == lastEntry) + { + // Create the merge menu entry for this menu path entry. + parentMergeMenuEntry[position, text] = new MergeMenuEntry(position, text, command); + } + else + { + // If there isn't a merge menu entry for this intermediate menu path entry, + // create it. + if (mergeMenuEntry == null) + { + mergeMenuEntry = new MergeMenuEntry(position, text); + parentMergeMenuEntry[position, text] = mergeMenuEntry; + } - // Set the root to this merge menu entry for the next loop iteration. - parentMergeMenuEntry = mergeMenuEntry; - } - } - } + // Set the root to this merge menu entry for the next loop iteration. + parentMergeMenuEntry = mergeMenuEntry; + } + } + } - /// - /// Helper to parse a menu path entry describing a menu item in the form: - /// [-]text@position - /// - /// '-' Optional. Specifies that a separator menu item should be inserted before the - /// menu item item. - /// text Menu item text (i.e. &File) - /// position Menu item position. For example, &File@1 specifies File menu, first menu - /// position, and &Edit@2 specifies Edit menu, second menu position. - /// - /// The menu path entry to parse. - /// The return text for the menu item specified in this menu path entry. - /// The return position for the menu item specified in this menu path entry. - private static void ParseMenuPathEntry(string menuPathEntry, out string text, out int position) - { - // Parse the menu path entry. - string[] values = menuPathEntry.Split(new char[] {'@'}); - Debug.Assert(values.Length == 2, "Invalid menu path entry.", String.Format("{0} is not a valid menu path entry.", menuPathEntry)); + /// + /// Helper to parse a menu path entry describing a menu item in the form: + /// [-]text@position + /// + /// '-' Optional. Specifies that a separator menu item should be inserted before the + /// menu item item. + /// text Menu item text (i.e. &File) + /// position Menu item position. For example, &File@1 specifies File menu, first menu + /// position, and &Edit@2 specifies Edit menu, second menu position. + /// + /// The menu path entry to parse. + /// The return text for the menu item specified in this menu path entry. + /// The return position for the menu item specified in this menu path entry. + private static void ParseMenuPathEntry(string menuPathEntry, out string text, out int position) + { + // Parse the menu path entry. + string[] values = menuPathEntry.Split(new char[] {'@'}); + Debug.Assert(values.Length == 2, "Invalid menu path entry.", String.Format("{0} is not a valid menu path entry.", menuPathEntry)); - // Set the name. - text = values[0]; + // Set the name. + text = values[0]; - // Set the position. - position = 0; - if (values.Length == 2) - { - try - { - position = Int32.Parse(values[1]); - } - catch (Exception) - { - // Don't kill a running system because of this problem. In this case, use a - // position of 0 and keep on running. For debug mode, throw an assertion. - Debug.Assert(false, "Invalid menu merge order specified.", String.Format("{0} contains an invalid menu merge order specification.", menuPathEntry)); - } - } - } - } + // Set the position. + position = 0; + if (values.Length == 2) + { + try + { + position = Int32.Parse(values[1]); + } + catch (Exception) + { + // Don't kill a running system because of this problem. In this case, use a + // position of 0 and keep on running. For debug mode, throw an assertion. + Debug.Assert(false, "Invalid menu merge order specified.", String.Format("{0} contains an invalid menu merge order specification.", menuPathEntry)); + } + } + } + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/MergeMenuEntry.cs b/src/managed/OpenLiveWriter.ApplicationFramework/MergeMenuEntry.cs index 780265c9..96f39ba1 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/MergeMenuEntry.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/MergeMenuEntry.cs @@ -8,196 +8,196 @@ using System.Windows.Forms; namespace Project31.ApplicationFramework { - /// - /// MergeMenuEntry is an internal class used to build Command-based menus. - /// - internal class MergeMenuEntry - { - /// - /// Used to indicate that the menu item should include a separator. Example: -File@0 - /// - private static string SEPARATOR_TEXT = "-"; + /// + /// MergeMenuEntry is an internal class used to build Command-based menus. + /// + internal class MergeMenuEntry + { + /// + /// Used to indicate that the menu item should include a separator. Example: -File@0 + /// + private static string SEPARATOR_TEXT = "-"; - /// - /// Merge menu entry position. - /// - private int position; + /// + /// Merge menu entry position. + /// + private int position; - /// - /// Gets the merge menu entry position. - /// - public int Position - { - get - { - return position; - } - } + /// + /// Gets the merge menu entry position. + /// + public int Position + { + get + { + return position; + } + } - /// - /// Merge menu entry text. - /// - private string text; + /// + /// Merge menu entry text. + /// + private string text; - /// - /// Gets the merge menu entry text. - /// - public string Text - { - get - { - return text; - } - } + /// + /// Gets the merge menu entry text. + /// + public string Text + { + get + { + return text; + } + } - /// - /// Merge menu entry command. - /// - private Command command; + /// + /// Merge menu entry command. + /// + private Command command; - /// - /// Gets the merge menu entry command. - /// - public Command Command - { - get - { - return command; - } - } + /// + /// Gets the merge menu entry command. + /// + public Command Command + { + get + { + return command; + } + } - /// - /// Child merge menu entries. - /// - private SortedList childMergeMenuEntries = new SortedList(); + /// + /// Child merge menu entries. + /// + private SortedList childMergeMenuEntries = new SortedList(); - /// - /// Initializes a new instance of the MergeMenuEntry class. - /// - public MergeMenuEntry() - { - } + /// + /// Initializes a new instance of the MergeMenuEntry class. + /// + public MergeMenuEntry() + { + } - /// - /// Initializes a new instance of the MergeMenuEntry class. This constructor is used for - /// top level and "container" menu items. - /// - /// Merge menu entry position. - /// Merge menu entry text. - public MergeMenuEntry(int position, string text) - { - this.position = position; - this.text = text; - this.command = null; - } + /// + /// Initializes a new instance of the MergeMenuEntry class. This constructor is used for + /// top level and "container" menu items. + /// + /// Merge menu entry position. + /// Merge menu entry text. + public MergeMenuEntry(int position, string text) + { + this.position = position; + this.text = text; + this.command = null; + } - /// - /// Initializes a new instance of the MergeMenuEntry class. This constructor is used for - /// the command menu entry. - /// - /// Merge menu entry position. - /// Merge menu entry text. - /// Merge menu entry command. - public MergeMenuEntry(int position, string text, Command command) - { - this.position = position; - this.text = text; - this.command = command; - } + /// + /// Initializes a new instance of the MergeMenuEntry class. This constructor is used for + /// the command menu entry. + /// + /// Merge menu entry position. + /// Merge menu entry text. + /// Merge menu entry command. + public MergeMenuEntry(int position, string text, Command command) + { + this.position = position; + this.text = text; + this.command = command; + } - /// - /// Indexer for access child merge menu entries. - /// - public MergeMenuEntry this [int position, string text] - { - get - { - string key = String.Format("{0}-{1}", position.ToString("D3"), text); - return (MergeMenuEntry)childMergeMenuEntries[key]; - } - set - { - string key = String.Format("{0}-{1}", position.ToString("D3"), text); - childMergeMenuEntries[key] = value; - } - } + /// + /// Indexer for access child merge menu entries. + /// + public MergeMenuEntry this [int position, string text] + { + get + { + string key = String.Format("{0}-{1}", position.ToString("D3"), text); + return (MergeMenuEntry)childMergeMenuEntries[key]; + } + set + { + string key = String.Format("{0}-{1}", position.ToString("D3"), text); + childMergeMenuEntries[key] = value; + } + } #if false - /// - /// Creates and returns a set of menu items from the child merge menu entries in this merge - /// menu entry. - /// - /// Array of menu items. - public MenuItem[] CreateMenuItems(bool mainMenu) - { - return CreateMenuItems(mainMenu); - } + /// + /// Creates and returns a set of menu items from the child merge menu entries in this merge + /// menu entry. + /// + /// Array of menu items. + public MenuItem[] CreateMenuItems(bool mainMenu) + { + return CreateMenuItems(mainMenu); + } #endif - /// - /// Creates and returns a set of menu items from the child merge menu entries in this merge - /// menu entry. - /// - /// The level at which the MenuItems will appear. - /// Array of menu items. - public MenuItem[] CreateMenuItems(bool mainMenu) - { - // If this merge menu entry has no child merge menu entries, return null. - if (childMergeMenuEntries.Count == 0) - return null; + /// + /// Creates and returns a set of menu items from the child merge menu entries in this merge + /// menu entry. + /// + /// The level at which the MenuItems will appear. + /// Array of menu items. + public MenuItem[] CreateMenuItems(bool mainMenu) + { + // If this merge menu entry has no child merge menu entries, return null. + if (childMergeMenuEntries.Count == 0) + return null; - // Construct an array list to hold the menu items being created. - ArrayList menuItemArrayList = new ArrayList(); + // Construct an array list to hold the menu items being created. + ArrayList menuItemArrayList = new ArrayList(); - // Enumerate the child merge menu entries of this merge menu entry. - foreach (MergeMenuEntry mergeMenuEntry in childMergeMenuEntries.Values) - { - // Get the text of the merge menu entry. - string text = mergeMenuEntry.Text; + // Enumerate the child merge menu entries of this merge menu entry. + foreach (MergeMenuEntry mergeMenuEntry in childMergeMenuEntries.Values) + { + // Get the text of the merge menu entry. + string text = mergeMenuEntry.Text; - // Create the menu item for this child merge menu entry. - MenuItem menuItem; - if (mainMenu) - menuItem = new OwnerDrawMenuItem(); - else - { - // If the text of the merge menu entry specifies that a separator menu item - // should appear before it, insert a separator menu item. - if (text.StartsWith(SEPARATOR_TEXT)) - { - // Strip off the SEPARATOR_TEXT. - text = text.Substring(1); + // Create the menu item for this child merge menu entry. + MenuItem menuItem; + if (mainMenu) + menuItem = new OwnerDrawMenuItem(); + else + { + // If the text of the merge menu entry specifies that a separator menu item + // should appear before it, insert a separator menu item. + if (text.StartsWith(SEPARATOR_TEXT)) + { + // Strip off the SEPARATOR_TEXT. + text = text.Substring(1); - // Instantiate the separator menu item. - MenuItem separatorMenuItem = new OwnerDrawMenuItem(); - separatorMenuItem.Text = SEPARATOR_TEXT; + // Instantiate the separator menu item. + MenuItem separatorMenuItem = new OwnerDrawMenuItem(); + separatorMenuItem.Text = SEPARATOR_TEXT; - // Add the separator menu item to the array of menu items being returned. - menuItemArrayList.Add(separatorMenuItem); - } + // Add the separator menu item to the array of menu items being returned. + menuItemArrayList.Add(separatorMenuItem); + } - // Instantiate the menu item. - if (mergeMenuEntry.Command == null) - menuItem = new OwnerDrawMenuItem(); - else - menuItem = new CommandOwnerDrawMenuItem(mergeMenuEntry.Command); - } + // Instantiate the menu item. + if (mergeMenuEntry.Command == null) + menuItem = new OwnerDrawMenuItem(); + else + menuItem = new CommandOwnerDrawMenuItem(mergeMenuEntry.Command); + } - // Set the menu item text. - menuItem.Text = text; + // Set the menu item text. + menuItem.Text = text; - // If this child merge menu entry has any child merge menu entries, recursively - // create their menu items. - MenuItem[] childMenuItems = mergeMenuEntry.CreateMenuItems(false); - if (childMenuItems != null) - menuItem.MenuItems.AddRange(childMenuItems); + // If this child merge menu entry has any child merge menu entries, recursively + // create their menu items. + MenuItem[] childMenuItems = mergeMenuEntry.CreateMenuItems(false); + if (childMenuItems != null) + menuItem.MenuItems.AddRange(childMenuItems); - // Add the menu item to the array of menu items being returned. - menuItemArrayList.Add(menuItem); - } + // Add the menu item to the array of menu items being returned. + menuItemArrayList.Add(menuItem); + } - // Done. Convert the array list into a MenuItem array and return it. - return (MenuItem[])menuItemArrayList.ToArray(typeof(MenuItem)); - } - } + // Done. Convert the array list into a MenuItem array and return it. + return (MenuItem[])menuItemArrayList.ToArray(typeof(MenuItem)); + } + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/MiniTab.cs b/src/managed/OpenLiveWriter.ApplicationFramework/MiniTab.cs index e27d7a14..742e91e4 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/MiniTab.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/MiniTab.cs @@ -96,7 +96,6 @@ namespace OpenLiveWriter.ApplicationFramework } } - protected override void OnPaint(PaintEventArgs e) { diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/MiniTabsControl.cs b/src/managed/OpenLiveWriter.ApplicationFramework/MiniTabsControl.cs index b2d88708..64003d5e 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/MiniTabsControl.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/MiniTabsControl.cs @@ -179,7 +179,6 @@ namespace OpenLiveWriter.ApplicationFramework PerformLayout(); Invalidate(); - if (selectedIndex >= 0 && SelectedTabChanged != null) SelectedTabChanged(this, new SelectedTabChangedEventArgs(selectedIndex)); } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/MultiPaneApplicationWorkspace.cs b/src/managed/OpenLiveWriter.ApplicationFramework/MultiPaneApplicationWorkspace.cs index d989e44b..e839849c 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/MultiPaneApplicationWorkspace.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/MultiPaneApplicationWorkspace.cs @@ -9,43 +9,43 @@ using System.Windows.Forms; namespace Project31.ApplicationFramework { - public class MultiPaneApplicationWorkspace : Project31.Controls.LightweightControlContainerControl - { - private System.ComponentModel.IContainer components = null; + public class MultiPaneApplicationWorkspace : Project31.Controls.LightweightControlContainerControl + { + private System.ComponentModel.IContainer components = null; - public MultiPaneApplicationWorkspace() - { - // This call is required by the Windows Form Designer. - InitializeComponent(); + public MultiPaneApplicationWorkspace() + { + // This call is required by the Windows Form Designer. + InitializeComponent(); - // TODO: Add any initialization after the InitializeComponent call - } + // TODO: Add any initialization after the InitializeComponent call + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if (components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if (components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - components = new System.ComponentModel.Container(); - } - #endregion - } + #region Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/MultiPaneLightweightControl.cs b/src/managed/OpenLiveWriter.ApplicationFramework/MultiPaneLightweightControl.cs index d04bf531..85d371e9 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/MultiPaneLightweightControl.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/MultiPaneLightweightControl.cs @@ -13,531 +13,531 @@ using Project31.CoreServices; namespace Project31.ApplicationFramework { - /// - /// Multipane lightweight control. - /// - public class MultiPaneLightweightControl : LightweightControl - { - /// - /// The height of the gutter area. - /// - private const int GUTTER_HEIGHT = 22; + /// + /// Multipane lightweight control. + /// + public class MultiPaneLightweightControl : LightweightControl + { + /// + /// The height of the gutter area. + /// + private const int GUTTER_HEIGHT = 22; - /// - /// The border size. - /// - private const int BORDER_SIZE = 4; + /// + /// The border size. + /// + private const int BORDER_SIZE = 4; - /// - /// The splitter width. - /// - private int SPLITTER_WIDTH = 4; + /// + /// The splitter width. + /// + private int SPLITTER_WIDTH = 4; - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components; + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components; - /// - /// The left splitter position. This is the offset of the left splitter from the left edge - /// of the multi pane lightweight control. A value of -1 indicates that the left splitter - /// position has not been set. - /// - private int leftSplitterPosition = -1; - private int newLeftSplitterPosition = -1; + /// + /// The left splitter position. This is the offset of the left splitter from the left edge + /// of the multi pane lightweight control. A value of -1 indicates that the left splitter + /// position has not been set. + /// + private int leftSplitterPosition = -1; + private int newLeftSplitterPosition = -1; - /// - /// The right splitter position. This is the offset of the right splitter from the right - /// edge of the multi pane lightweight control. A value of -1 indicates that the right - /// splitter position has not been set. - /// - private int rightSplitterPosition = -1; - private int newRightSplitterPosition = -1; + /// + /// The right splitter position. This is the offset of the right splitter from the right + /// edge of the multi pane lightweight control. A value of -1 indicates that the right + /// splitter position has not been set. + /// + private int rightSplitterPosition = -1; + private int newRightSplitterPosition = -1; - /// - /// - /// - private Project31.ApplicationFramework.WorkPaneLightweightControl workPaneLightweightControlLeft; + /// + /// + /// + private Project31.ApplicationFramework.WorkPaneLightweightControl workPaneLightweightControlLeft; - /// - /// - /// - private Project31.ApplicationFramework.WorkPaneLightweightControl workPaneLightweightControlCenter; + /// + /// + /// + private Project31.ApplicationFramework.WorkPaneLightweightControl workPaneLightweightControlCenter; - /// - /// - /// - private Project31.ApplicationFramework.WorkPaneLightweightControl workPaneLightweightControlRight; + /// + /// + /// + private Project31.ApplicationFramework.WorkPaneLightweightControl workPaneLightweightControlRight; - /// - /// The left splitter lightweight control. - /// - private Project31.ApplicationFramework.SplitterLightweightControl leftSplitter; + /// + /// The left splitter lightweight control. + /// + private Project31.ApplicationFramework.SplitterLightweightControl leftSplitter; - /// - /// The right splitter lightweight control. - /// - private Project31.ApplicationFramework.SplitterLightweightControl rightSplitter; + /// + /// The right splitter lightweight control. + /// + private Project31.ApplicationFramework.SplitterLightweightControl rightSplitter; - /// - /// The gutter lightweight control. - /// - private Project31.Controls.GutterLightweightControl gutter; + /// + /// The gutter lightweight control. + /// + private Project31.Controls.GutterLightweightControl gutter; - /// - /// Gets or sets the left pane control. - /// - [ - Category("Layout"), - Localizable(false), - DefaultValue(null), - Description("Specifies the left pane control.") - ] - public Control LeftPaneControl - { - get - { - return workPaneLightweightControlLeft.Control; - } - set - { - workPaneLightweightControlLeft.Control = value; - } - } + /// + /// Gets or sets the left pane control. + /// + [ + Category("Layout"), + Localizable(false), + DefaultValue(null), + Description("Specifies the left pane control.") + ] + public Control LeftPaneControl + { + get + { + return workPaneLightweightControlLeft.Control; + } + set + { + workPaneLightweightControlLeft.Control = value; + } + } - /// - /// Gets or sets the center pane control. - /// - [ - Category("Layout"), - Localizable(false), - DefaultValue(null), - Description("Specifies the center pane control.") - ] - public Control CenterPaneControl - { - get - { - return workPaneLightweightControlCenter.Control; - } - set - { - workPaneLightweightControlCenter.Control = value; - } - } + /// + /// Gets or sets the center pane control. + /// + [ + Category("Layout"), + Localizable(false), + DefaultValue(null), + Description("Specifies the center pane control.") + ] + public Control CenterPaneControl + { + get + { + return workPaneLightweightControlCenter.Control; + } + set + { + workPaneLightweightControlCenter.Control = value; + } + } - /// - /// Gets or sets the right pane control. - /// - [ - Category("Layout"), - Localizable(false), - DefaultValue(null), - Description("Specifies the right pane control.") - ] - public Control RightPaneControl - { - get - { - return workPaneLightweightControlRight.Control; - } - set - { - workPaneLightweightControlRight.Control = value; - } - } + /// + /// Gets or sets the right pane control. + /// + [ + Category("Layout"), + Localizable(false), + DefaultValue(null), + Description("Specifies the right pane control.") + ] + public Control RightPaneControl + { + get + { + return workPaneLightweightControlRight.Control; + } + set + { + workPaneLightweightControlRight.Control = value; + } + } - /// - /// The vertical tracking indicator. This helper class displays the splitter position when - /// a splitter is being resized. - /// - VerticalTrackingIndicator verticalTrackingIdicator = new VerticalTrackingIndicator(); + /// + /// The vertical tracking indicator. This helper class displays the splitter position when + /// a splitter is being resized. + /// + VerticalTrackingIndicator verticalTrackingIdicator = new VerticalTrackingIndicator(); - /// - /// Initializes a new instance of the MultiPaneLightweightControl class. - /// - /// - public MultiPaneLightweightControl(System.ComponentModel.IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); - } + /// + /// Initializes a new instance of the MultiPaneLightweightControl class. + /// + /// + public MultiPaneLightweightControl(System.ComponentModel.IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); + } - /// - /// Initializes a new instance of the MultiPaneLightweightControl class. - /// - public MultiPaneLightweightControl() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); - } + /// + /// Initializes a new instance of the MultiPaneLightweightControl class. + /// + public MultiPaneLightweightControl() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - this.leftSplitter = new Project31.ApplicationFramework.SplitterLightweightControl(this.components); - this.rightSplitter = new Project31.ApplicationFramework.SplitterLightweightControl(this.components); - this.gutter = new Project31.Controls.GutterLightweightControl(this.components); - this.workPaneLightweightControlLeft = new Project31.ApplicationFramework.WorkPaneLightweightControl(this.components); - this.workPaneLightweightControlCenter = new Project31.ApplicationFramework.WorkPaneLightweightControl(this.components); - this.workPaneLightweightControlRight = new Project31.ApplicationFramework.WorkPaneLightweightControl(this.components); - // - // leftSplitter - // - this.leftSplitter.LightweightControlContainerControl = this; - this.leftSplitter.SplitterEndMove += new Project31.ApplicationFramework.LightweightSplitterEventHandler(this.leftSplitter_SplitterEndMove); - this.leftSplitter.SplitterBeginMove += new System.EventHandler(this.leftSplitter_SplitterBeginMove); - this.leftSplitter.SplitterMoving += new Project31.ApplicationFramework.LightweightSplitterEventHandler(this.leftSplitter_SplitterMoving); - // - // rightSplitter - // - this.rightSplitter.LightweightControlContainerControl = this; - this.rightSplitter.SplitterEndMove += new Project31.ApplicationFramework.LightweightSplitterEventHandler(this.rightSplitter_SplitterEndMove); - this.rightSplitter.SplitterBeginMove += new System.EventHandler(this.rightSplitter_SplitterBeginMove); - this.rightSplitter.SplitterMoving += new Project31.ApplicationFramework.LightweightSplitterEventHandler(this.rightSplitter_SplitterMoving); - // - // gutter - // - this.gutter.LightweightControlContainerControl = this; - // - // workPaneLightweightControlLeft - // - this.workPaneLightweightControlLeft.Control = null; - this.workPaneLightweightControlLeft.LightweightControlContainerControl = this; - // - // workPaneLightweightControlCenter - // - this.workPaneLightweightControlCenter.Control = null; - this.workPaneLightweightControlCenter.LightweightControlContainerControl = this; - // - // workPaneLightweightControlRight - // - this.workPaneLightweightControlRight.Control = null; - this.workPaneLightweightControlRight.LightweightControlContainerControl = this; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.leftSplitter = new Project31.ApplicationFramework.SplitterLightweightControl(this.components); + this.rightSplitter = new Project31.ApplicationFramework.SplitterLightweightControl(this.components); + this.gutter = new Project31.Controls.GutterLightweightControl(this.components); + this.workPaneLightweightControlLeft = new Project31.ApplicationFramework.WorkPaneLightweightControl(this.components); + this.workPaneLightweightControlCenter = new Project31.ApplicationFramework.WorkPaneLightweightControl(this.components); + this.workPaneLightweightControlRight = new Project31.ApplicationFramework.WorkPaneLightweightControl(this.components); + // + // leftSplitter + // + this.leftSplitter.LightweightControlContainerControl = this; + this.leftSplitter.SplitterEndMove += new Project31.ApplicationFramework.LightweightSplitterEventHandler(this.leftSplitter_SplitterEndMove); + this.leftSplitter.SplitterBeginMove += new System.EventHandler(this.leftSplitter_SplitterBeginMove); + this.leftSplitter.SplitterMoving += new Project31.ApplicationFramework.LightweightSplitterEventHandler(this.leftSplitter_SplitterMoving); + // + // rightSplitter + // + this.rightSplitter.LightweightControlContainerControl = this; + this.rightSplitter.SplitterEndMove += new Project31.ApplicationFramework.LightweightSplitterEventHandler(this.rightSplitter_SplitterEndMove); + this.rightSplitter.SplitterBeginMove += new System.EventHandler(this.rightSplitter_SplitterBeginMove); + this.rightSplitter.SplitterMoving += new Project31.ApplicationFramework.LightweightSplitterEventHandler(this.rightSplitter_SplitterMoving); + // + // gutter + // + this.gutter.LightweightControlContainerControl = this; + // + // workPaneLightweightControlLeft + // + this.workPaneLightweightControlLeft.Control = null; + this.workPaneLightweightControlLeft.LightweightControlContainerControl = this; + // + // workPaneLightweightControlCenter + // + this.workPaneLightweightControlCenter.Control = null; + this.workPaneLightweightControlCenter.LightweightControlContainerControl = this; + // + // workPaneLightweightControlRight + // + this.workPaneLightweightControlRight.Control = null; + this.workPaneLightweightControlRight.LightweightControlContainerControl = this; - } - #endregion + } + #endregion - /// - /// - /// - /// - /// - protected override void OnLayout(System.EventArgs e) - { - // Call the base class's method so that registered delegates receive the event. - base.OnLayout(e); + /// + /// + /// + /// + /// + protected override void OnLayout(System.EventArgs e) + { + // Call the base class's method so that registered delegates receive the event. + base.OnLayout(e); - // Initialize the left splitter position, if it is uninitialized. - if (leftSplitterPosition == -1) - InitializeLeftSplitterPosition(); + // Initialize the left splitter position, if it is uninitialized. + if (leftSplitterPosition == -1) + InitializeLeftSplitterPosition(); - // Initialize the right splitter position, if it is uninitialized. - if (rightSplitterPosition == -1) - InitializeRightSplitterPosition(); + // Initialize the right splitter position, if it is uninitialized. + if (rightSplitterPosition == -1) + InitializeRightSplitterPosition(); - // Layout the gutter. - gutter.VirtualBounds = CalculateGutterBounds(); + // Layout the gutter. + gutter.VirtualBounds = CalculateGutterBounds(); - // Layout the left pane lightweight control. - workPaneLightweightControlLeft.VirtualBounds = CalculateLeftPaneControlBounds(); + // Layout the left pane lightweight control. + workPaneLightweightControlLeft.VirtualBounds = CalculateLeftPaneControlBounds(); - // Layout the left splitter. - leftSplitter.VirtualBounds = new Rectangle( leftSplitterPosition, - 0, - SPLITTER_WIDTH, - VirtualHeight-GUTTER_HEIGHT); + // Layout the left splitter. + leftSplitter.VirtualBounds = new Rectangle( leftSplitterPosition, + 0, + SPLITTER_WIDTH, + VirtualHeight-GUTTER_HEIGHT); - // Layout the center pane lightweight control. - workPaneLightweightControlCenter.VirtualBounds = CalculateCenterPaneLightweightControlBounds(); + // Layout the center pane lightweight control. + workPaneLightweightControlCenter.VirtualBounds = CalculateCenterPaneLightweightControlBounds(); - // Layout the right splitter. - rightSplitter.VirtualBounds = new Rectangle(VirtualWidth-rightSplitterPosition, - 0, - SPLITTER_WIDTH, - VirtualHeight-GUTTER_HEIGHT); + // Layout the right splitter. + rightSplitter.VirtualBounds = new Rectangle(VirtualWidth-rightSplitterPosition, + 0, + SPLITTER_WIDTH, + VirtualHeight-GUTTER_HEIGHT); - // Layout the right pane lightweight control. - workPaneLightweightControlRight.VirtualBounds = CalculateRightPaneControlBounds(); - } + // Layout the right pane lightweight control. + workPaneLightweightControlRight.VirtualBounds = CalculateRightPaneControlBounds(); + } - /// - /// - /// - /// - /// - protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) - { - // Paint the background. - using (LinearGradientBrush linearGradientBrush = new LinearGradientBrush(VirtualClientRectangle, Color.FromArgb(214, 232, 239), Color.FromArgb(148, 197, 217), LinearGradientMode.Horizontal)) - e.Graphics.FillRectangle(linearGradientBrush, VirtualClientRectangle); + /// + /// + /// + /// + /// + protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) + { + // Paint the background. + using (LinearGradientBrush linearGradientBrush = new LinearGradientBrush(VirtualClientRectangle, Color.FromArgb(214, 232, 239), Color.FromArgb(148, 197, 217), LinearGradientMode.Horizontal)) + e.Graphics.FillRectangle(linearGradientBrush, VirtualClientRectangle); - // Call the base class's method so that registered delegates receive the event and - // child lightweight controls are painted. - base.OnPaint(e); - } + // Call the base class's method so that registered delegates receive the event and + // child lightweight controls are painted. + base.OnPaint(e); + } - /// - /// - /// - private void InitializeLeftSplitterPosition() - { - leftSplitterPosition = 260;//Math.Max(MinimumLeftSplitterPosition(), VirtualWidth/5); - } + /// + /// + /// + private void InitializeLeftSplitterPosition() + { + leftSplitterPosition = 260;//Math.Max(MinimumLeftSplitterPosition(), VirtualWidth/5); + } - /// - /// - /// - private void InitializeRightSplitterPosition() - { - rightSplitterPosition = Math.Max(MinimumRightSplitterPosition(), VirtualWidth/5); - } + /// + /// + /// + private void InitializeRightSplitterPosition() + { + rightSplitterPosition = Math.Max(MinimumRightSplitterPosition(), VirtualWidth/5); + } - /// - /// - /// - /// - /// - private Rectangle CalculateVerticalTrackingIndicatorRectangle(int position) - { - return new Rectangle( position, - 0, - SPLITTER_WIDTH-1, - VirtualHeight-GUTTER_HEIGHT); - } + /// + /// + /// + /// + /// + private Rectangle CalculateVerticalTrackingIndicatorRectangle(int position) + { + return new Rectangle( position, + 0, + SPLITTER_WIDTH-1, + VirtualHeight-GUTTER_HEIGHT); + } - /// - /// - /// - /// - private Rectangle CalculateNewLeftSplitterBounds() - { - return new Rectangle( newLeftSplitterPosition, - -1, - SPLITTER_WIDTH+1, - VirtualHeight-GUTTER_HEIGHT); - } + /// + /// + /// + /// + private Rectangle CalculateNewLeftSplitterBounds() + { + return new Rectangle( newLeftSplitterPosition, + -1, + SPLITTER_WIDTH+1, + VirtualHeight-GUTTER_HEIGHT); + } - /// - /// - /// - /// - private Rectangle CalculateLeftSplitterBounds() - { - return new Rectangle( leftSplitterPosition, - 0, - SPLITTER_WIDTH, - VirtualHeight-GUTTER_HEIGHT); - } + /// + /// + /// + /// + private Rectangle CalculateLeftSplitterBounds() + { + return new Rectangle( leftSplitterPosition, + 0, + SPLITTER_WIDTH, + VirtualHeight-GUTTER_HEIGHT); + } - /// - /// Calculates the bounds of the gutter control. - /// - /// The bounds of the gutter control. - private Rectangle CalculateGutterBounds() - { - return new Rectangle( 0, - VirtualHeight-GUTTER_HEIGHT, - VirtualWidth, - GUTTER_HEIGHT); - } + /// + /// Calculates the bounds of the gutter control. + /// + /// The bounds of the gutter control. + private Rectangle CalculateGutterBounds() + { + return new Rectangle( 0, + VirtualHeight-GUTTER_HEIGHT, + VirtualWidth, + GUTTER_HEIGHT); + } - /// - /// - /// - /// - private Rectangle CalculateLeftPaneControlBounds() - { - return new Rectangle( BORDER_SIZE, - BORDER_SIZE, - leftSplitterPosition-BORDER_SIZE, - PaneHeight()); - } + /// + /// + /// + /// + private Rectangle CalculateLeftPaneControlBounds() + { + return new Rectangle( BORDER_SIZE, + BORDER_SIZE, + leftSplitterPosition-BORDER_SIZE, + PaneHeight()); + } - /// - /// - /// - /// - private Rectangle CalculateCenterPaneLightweightControlBounds() - { - return new Rectangle( leftSplitterPosition+SPLITTER_WIDTH, - BORDER_SIZE, - VirtualWidth-(rightSplitterPosition+leftSplitterPosition+SPLITTER_WIDTH), - PaneHeight()); - } + /// + /// + /// + /// + private Rectangle CalculateCenterPaneLightweightControlBounds() + { + return new Rectangle( leftSplitterPosition+SPLITTER_WIDTH, + BORDER_SIZE, + VirtualWidth-(rightSplitterPosition+leftSplitterPosition+SPLITTER_WIDTH), + PaneHeight()); + } - /// - /// - /// - /// - private Rectangle CalculateRightPaneControlBounds() - { - int rightControlX = VirtualWidth-rightSplitterPosition+SPLITTER_WIDTH; - return new Rectangle( rightControlX, - BORDER_SIZE, - VirtualWidth-(rightControlX+BORDER_SIZE), - PaneHeight()); - } + /// + /// + /// + /// + private Rectangle CalculateRightPaneControlBounds() + { + int rightControlX = VirtualWidth-rightSplitterPosition+SPLITTER_WIDTH; + return new Rectangle( rightControlX, + BORDER_SIZE, + VirtualWidth-(rightControlX+BORDER_SIZE), + PaneHeight()); + } - /// - /// - /// - /// - private int PaneHeight() - { - return VirtualHeight-GUTTER_HEIGHT-(BORDER_SIZE*2); - } + /// + /// + /// + /// + private int PaneHeight() + { + return VirtualHeight-GUTTER_HEIGHT-(BORDER_SIZE*2); + } - /// - /// Calculates the minimum left splitter position. - /// - /// - private int MinimumLeftSplitterPosition() - { - return 0; - } + /// + /// Calculates the minimum left splitter position. + /// + /// + private int MinimumLeftSplitterPosition() + { + return 0; + } - /// - /// Calculates the maximum left splitter position. - /// - /// - private int MaximumLeftSplitterPosition() - { - return VirtualWidth-10; - } + /// + /// Calculates the maximum left splitter position. + /// + /// + private int MaximumLeftSplitterPosition() + { + return VirtualWidth-10; + } - /// - /// Calculates the minimum right splitter position. - /// - /// - private int MinimumRightSplitterPosition() - { - return 100; - } + /// + /// Calculates the minimum right splitter position. + /// + /// + private int MinimumRightSplitterPosition() + { + return 100; + } - /// - /// Calculates the maximum right splitter position. - /// - /// - private int MaximumRightSplitterPosition() - { - return VirtualWidth-10; - } + /// + /// Calculates the maximum right splitter position. + /// + /// + private int MaximumRightSplitterPosition() + { + return VirtualWidth-10; + } - /// - /// - /// - /// - /// - private void leftSplitter_SplitterBeginMove(object sender, System.EventArgs e) - { - // Calculate. - Rectangle trackingIndicatorRectangle = CalculateVerticalTrackingIndicatorRectangle(leftSplitterPosition); + /// + /// + /// + /// + /// + private void leftSplitter_SplitterBeginMove(object sender, System.EventArgs e) + { + // Calculate. + Rectangle trackingIndicatorRectangle = CalculateVerticalTrackingIndicatorRectangle(leftSplitterPosition); - verticalTrackingIdicator.Begin(Parent, VirtualClientRectangleToParent(trackingIndicatorRectangle)); - } + verticalTrackingIdicator.Begin(Parent, VirtualClientRectangleToParent(trackingIndicatorRectangle)); + } - /// - /// - /// - /// - /// - private void leftSplitter_SplitterEndMove(object sender, Project31.ApplicationFramework.LightweightSplitterEventArgs e) - { - verticalTrackingIdicator.End(); - leftSplitterPosition = newLeftSplitterPosition; - PerformLayout(); - Invalidate(); - } + /// + /// + /// + /// + /// + private void leftSplitter_SplitterEndMove(object sender, Project31.ApplicationFramework.LightweightSplitterEventArgs e) + { + verticalTrackingIdicator.End(); + leftSplitterPosition = newLeftSplitterPosition; + PerformLayout(); + Invalidate(); + } - /// - /// - /// - /// - /// - private void leftSplitter_SplitterMoving(object sender, Project31.ApplicationFramework.LightweightSplitterEventArgs e) - { - // Obtain the minimum and maximum left splitter positions. - int minimumLeftSplitterPosition = MinimumLeftSplitterPosition(); - int maximumLeftSplitterPosition = MaximumLeftSplitterPosition(); + /// + /// + /// + /// + /// + private void leftSplitter_SplitterMoving(object sender, Project31.ApplicationFramework.LightweightSplitterEventArgs e) + { + // Obtain the minimum and maximum left splitter positions. + int minimumLeftSplitterPosition = MinimumLeftSplitterPosition(); + int maximumLeftSplitterPosition = MaximumLeftSplitterPosition(); - // Calculate the new left splitter position. - newLeftSplitterPosition = leftSplitterPosition+e.Position; + // Calculate the new left splitter position. + newLeftSplitterPosition = leftSplitterPosition+e.Position; - // Validate the new left splitter position. Adjust it as needed. - if (newLeftSplitterPosition < minimumLeftSplitterPosition) - newLeftSplitterPosition = minimumLeftSplitterPosition; - else if (newLeftSplitterPosition > maximumLeftSplitterPosition) - newLeftSplitterPosition = maximumLeftSplitterPosition; + // Validate the new left splitter position. Adjust it as needed. + if (newLeftSplitterPosition < minimumLeftSplitterPosition) + newLeftSplitterPosition = minimumLeftSplitterPosition; + else if (newLeftSplitterPosition > maximumLeftSplitterPosition) + newLeftSplitterPosition = maximumLeftSplitterPosition; - // Calculate. - Rectangle trackingIndicatorRectangle = CalculateVerticalTrackingIndicatorRectangle(newLeftSplitterPosition); + // Calculate. + Rectangle trackingIndicatorRectangle = CalculateVerticalTrackingIndicatorRectangle(newLeftSplitterPosition); - // Set the new left splitter position, if it has changed. - verticalTrackingIdicator.Update(VirtualClientRectangleToParent(trackingIndicatorRectangle).Location); - } + // Set the new left splitter position, if it has changed. + verticalTrackingIdicator.Update(VirtualClientRectangleToParent(trackingIndicatorRectangle).Location); + } - /// - /// - /// - /// - /// - private void rightSplitter_SplitterBeginMove(object sender, System.EventArgs e) - { - // Calculate. - Rectangle trackingIndicatorRectangle = CalculateVerticalTrackingIndicatorRectangle(VirtualWidth-rightSplitterPosition); + /// + /// + /// + /// + /// + private void rightSplitter_SplitterBeginMove(object sender, System.EventArgs e) + { + // Calculate. + Rectangle trackingIndicatorRectangle = CalculateVerticalTrackingIndicatorRectangle(VirtualWidth-rightSplitterPosition); - verticalTrackingIdicator.Begin(Parent, VirtualClientRectangleToParent(trackingIndicatorRectangle)); - } + verticalTrackingIdicator.Begin(Parent, VirtualClientRectangleToParent(trackingIndicatorRectangle)); + } - /// - /// - /// - /// - /// - private void rightSplitter_SplitterEndMove(object sender, Project31.ApplicationFramework.LightweightSplitterEventArgs e) - { - verticalTrackingIdicator.End(); - rightSplitterPosition = newRightSplitterPosition; - PerformLayout(); - Invalidate(); - } + /// + /// + /// + /// + /// + private void rightSplitter_SplitterEndMove(object sender, Project31.ApplicationFramework.LightweightSplitterEventArgs e) + { + verticalTrackingIdicator.End(); + rightSplitterPosition = newRightSplitterPosition; + PerformLayout(); + Invalidate(); + } - /// - /// - /// - /// - /// - private void rightSplitter_SplitterMoving(object sender, Project31.ApplicationFramework.LightweightSplitterEventArgs e) - { - // Obtain the minimum and maximum right splitter positions. - int minimumRightSplitterPosition = MinimumRightSplitterPosition(); - int maximumRightSplitterPosition = MaximumRightSplitterPosition(); + /// + /// + /// + /// + /// + private void rightSplitter_SplitterMoving(object sender, Project31.ApplicationFramework.LightweightSplitterEventArgs e) + { + // Obtain the minimum and maximum right splitter positions. + int minimumRightSplitterPosition = MinimumRightSplitterPosition(); + int maximumRightSplitterPosition = MaximumRightSplitterPosition(); - // Calculate the new right splitter position. - newRightSplitterPosition = rightSplitterPosition-e.Position; + // Calculate the new right splitter position. + newRightSplitterPosition = rightSplitterPosition-e.Position; - // Validate the new right splitter position. Adjust it as needed. - if (newRightSplitterPosition < minimumRightSplitterPosition) - newRightSplitterPosition = minimumRightSplitterPosition; - else if (newRightSplitterPosition > maximumRightSplitterPosition) - newRightSplitterPosition = maximumRightSplitterPosition; + // Validate the new right splitter position. Adjust it as needed. + if (newRightSplitterPosition < minimumRightSplitterPosition) + newRightSplitterPosition = minimumRightSplitterPosition; + else if (newRightSplitterPosition > maximumRightSplitterPosition) + newRightSplitterPosition = maximumRightSplitterPosition; - // Calculate. - Rectangle trackingIndicatorRectangle = CalculateVerticalTrackingIndicatorRectangle(VirtualWidth-newRightSplitterPosition); + // Calculate. + Rectangle trackingIndicatorRectangle = CalculateVerticalTrackingIndicatorRectangle(VirtualWidth-newRightSplitterPosition); - // Set the new right splitter position, if it has changed. - verticalTrackingIdicator.Update(VirtualClientRectangleToParent(trackingIndicatorRectangle).Location); - } - } + // Set the new right splitter position, if it has changed. + verticalTrackingIdicator.Update(VirtualClientRectangleToParent(trackingIndicatorRectangle).Location); + } + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/OwnerDrawMenuItem.cs b/src/managed/OpenLiveWriter.ApplicationFramework/OwnerDrawMenuItem.cs index 53980b29..60c20a57 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/OwnerDrawMenuItem.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/OwnerDrawMenuItem.cs @@ -536,9 +536,9 @@ namespace OpenLiveWriter.ApplicationFramework // Fill the background. /* - using (SolidBrush solidBrush = new SolidBrush(ApplicationManager.ApplicationStyle.MenuBitmapAreaColor)) - graphics.FillRectangle(solidBrush, bitmapAreaRectangle); - */ + using (SolidBrush solidBrush = new SolidBrush(ApplicationManager.ApplicationStyle.MenuBitmapAreaColor)) + graphics.FillRectangle(solidBrush, bitmapAreaRectangle); + */ Color backgroundColor = SystemColors.Menu; // If the item is selected, draw the selection rectangle. if ((drawItemState & DrawItemState.Selected) != 0) diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/Preferences/Preferences.cs b/src/managed/OpenLiveWriter.ApplicationFramework/Preferences/Preferences.cs index 5ad0e21f..49561127 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/Preferences/Preferences.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/Preferences/Preferences.cs @@ -18,7 +18,6 @@ namespace OpenLiveWriter.ApplicationFramework.Preferences { #region Static & Constant Declarations - #endregion Static & Constant Declarations #region Private Member Variables diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/Preferences/WebProxyPreferencesPanel.cs b/src/managed/OpenLiveWriter.ApplicationFramework/Preferences/WebProxyPreferencesPanel.cs index 4501d50e..05d5c0ca 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/Preferences/WebProxyPreferencesPanel.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/Preferences/WebProxyPreferencesPanel.cs @@ -324,6 +324,5 @@ namespace OpenLiveWriter.ApplicationFramework.Preferences } #endregion - } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/SatelliteApplicationForm.cs b/src/managed/OpenLiveWriter.ApplicationFramework/SatelliteApplicationForm.cs index 83a2dbfe..9101e088 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/SatelliteApplicationForm.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/SatelliteApplicationForm.cs @@ -322,7 +322,6 @@ namespace OpenLiveWriter.ApplicationFramework { } - protected override void Dispose(bool disposing) { if (disposing) diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/SearchBoxControl.cs b/src/managed/OpenLiveWriter.ApplicationFramework/SearchBoxControl.cs index f52b8f06..8421632a 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/SearchBoxControl.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/SearchBoxControl.cs @@ -12,210 +12,208 @@ using OpenLiveWriter.CoreServices; namespace OpenLiveWriter.ApplicationFramework { - /// - /// Summary description for SearchBoxControl. - /// - public class SearchBoxControl : System.Windows.Forms.UserControl - { - private TextBoxWithEnter txtQuery; - //private System.Windows.Forms.PictureBox picSearchBox; - private BitmapButton picSearchBox; + /// + /// Summary description for SearchBoxControl. + /// + public class SearchBoxControl : System.Windows.Forms.UserControl + { + private TextBoxWithEnter txtQuery; + //private System.Windows.Forms.PictureBox picSearchBox; + private BitmapButton picSearchBox; // private Bitmap bmpSearchInput = ResourceHelper.LoadAssemblyResourceBitmap("Images.HIG.SearchInput.png"); - private bool highlighted; + private bool highlighted; - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; + /// + /// Required designer variable. + /// + private System.ComponentModel.Container components = null; - public SearchBoxControl() - { - SetStyle(ControlStyles.UserPaint, true); + public SearchBoxControl() + { + SetStyle(ControlStyles.UserPaint, true); // SetStyle(ControlStyles.DoubleBuffer, true); - SetStyle(ControlStyles.AllPaintingInWmPaint, true); + SetStyle(ControlStyles.AllPaintingInWmPaint, true); - // This call is required by the Windows.Forms Form Designer. - InitializeComponent(); + // This call is required by the Windows.Forms Form Designer. + InitializeComponent(); - HookEvents(txtQuery, picSearchBox, this); + HookEvents(txtQuery, picSearchBox, this); - //picSearchBox.Image = ResourceHelper.LoadAssemblyResourceBitmap("Images.HIG.Search.png"); - picSearchBox.BitmapEnabled = ResourceHelper.LoadAssemblyResourceBitmap("Images.HIG.Search.png"); - picSearchBox.BitmapSelected = ResourceHelper.LoadAssemblyResourceBitmap("Images.HIG.Search.png"); - picSearchBox.BitmapDisabled = ResourceHelper.LoadAssemblyResourceBitmap("Images.HIG.Search.png"); - txtQuery.TabIndex = 0; - picSearchBox.TabStop = true; - picSearchBox.TabIndex = 1; + //picSearchBox.Image = ResourceHelper.LoadAssemblyResourceBitmap("Images.HIG.Search.png"); + picSearchBox.BitmapEnabled = ResourceHelper.LoadAssemblyResourceBitmap("Images.HIG.Search.png"); + picSearchBox.BitmapSelected = ResourceHelper.LoadAssemblyResourceBitmap("Images.HIG.Search.png"); + picSearchBox.BitmapDisabled = ResourceHelper.LoadAssemblyResourceBitmap("Images.HIG.Search.png"); + txtQuery.TabIndex = 0; + picSearchBox.TabStop = true; + picSearchBox.TabIndex = 1; + txtQuery.EnterPressed += new EventHandler(txtQuery_EnterPressed); + picSearchBox.Click += new EventHandler(picSearchBox_Click); + } - txtQuery.EnterPressed += new EventHandler(txtQuery_EnterPressed); - picSearchBox.Click += new EventHandler(picSearchBox_Click); - } + protected override void OnResize(EventArgs e) + { + Invalidate(false); + base.OnResize (e); + } - protected override void OnResize(EventArgs e) - { - Invalidate(false); - base.OnResize (e); - } + private void HookEvents(params Control[] controls) + { + foreach (Control c in controls) + { + c.GotFocus += new EventHandler(UpdateHighlightStateEventHandler); + c.LostFocus += new EventHandler(UpdateHighlightStateEventHandler); + c.MouseEnter += new EventHandler(UpdateHighlightStateEventHandler); + c.MouseLeave += new EventHandler(UpdateHighlightStateEventHandler); + } + } + public event EventHandler HighlightedChanged; - private void HookEvents(params Control[] controls) - { - foreach (Control c in controls) - { - c.GotFocus += new EventHandler(UpdateHighlightStateEventHandler); - c.LostFocus += new EventHandler(UpdateHighlightStateEventHandler); - c.MouseEnter += new EventHandler(UpdateHighlightStateEventHandler); - c.MouseLeave += new EventHandler(UpdateHighlightStateEventHandler); - } - } + public bool Highlighted + { + get { return highlighted; } + set + { + if (highlighted != value) + { + highlighted = value; + if (HighlightedChanged != null) + HighlightedChanged(this, EventArgs.Empty); + } + } + } - public event EventHandler HighlightedChanged; + private void UpdateHighlightState() + { + Highlighted = + ContainsFocus || new Rectangle(0, 0, Width, Height).Contains(PointToClient(MousePosition)); + } - public bool Highlighted - { - get { return highlighted; } - set - { - if (highlighted != value) - { - highlighted = value; - if (HighlightedChanged != null) - HighlightedChanged(this, EventArgs.Empty); - } - } - } + private void UpdateHighlightStateEventHandler(object sender, EventArgs args) + { + UpdateHighlightState(); + } - private void UpdateHighlightState() - { - Highlighted = - ContainsFocus || new Rectangle(0, 0, Width, Height).Contains(PointToClient(MousePosition)); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - private void UpdateHighlightStateEventHandler(object sender, EventArgs args) - { - UpdateHighlightState(); - } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.txtQuery = new OpenLiveWriter.ApplicationFramework.SearchBoxControl.TextBoxWithEnter(); + this.picSearchBox = new OpenLiveWriter.Controls.BitmapButton(); + this.SuspendLayout(); + // + // txtQuery + // + this.txtQuery.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.txtQuery.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.txtQuery.Location = new System.Drawing.Point(5, 5); + this.txtQuery.Name = "txtQuery"; + this.txtQuery.Size = new System.Drawing.Size(113, 14); + this.txtQuery.TabIndex = 0; + this.txtQuery.Text = ""; + // + // picSearchBox + // + this.picSearchBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.picSearchBox.Location = new System.Drawing.Point(126, 1); + this.picSearchBox.Name = "picSearchBox"; + this.picSearchBox.Size = new System.Drawing.Size(23, 20); + this.picSearchBox.TabIndex = 0; + this.picSearchBox.TabStop = false; + // + // SearchBoxControl + // + this.BackColor = System.Drawing.SystemColors.Window; + this.Controls.Add(this.picSearchBox); + this.Controls.Add(this.txtQuery); + this.Name = "SearchBoxControl"; + this.Size = new System.Drawing.Size(150, 22); + this.ResumeLayout(false); - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + } + #endregion - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.txtQuery = new OpenLiveWriter.ApplicationFramework.SearchBoxControl.TextBoxWithEnter(); - this.picSearchBox = new OpenLiveWriter.Controls.BitmapButton(); - this.SuspendLayout(); - // - // txtQuery - // - this.txtQuery.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.txtQuery.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.txtQuery.Location = new System.Drawing.Point(5, 5); - this.txtQuery.Name = "txtQuery"; - this.txtQuery.Size = new System.Drawing.Size(113, 14); - this.txtQuery.TabIndex = 0; - this.txtQuery.Text = ""; - // - // picSearchBox - // - this.picSearchBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.picSearchBox.Location = new System.Drawing.Point(126, 1); - this.picSearchBox.Name = "picSearchBox"; - this.picSearchBox.Size = new System.Drawing.Size(23, 20); - this.picSearchBox.TabIndex = 0; - this.picSearchBox.TabStop = false; - // - // SearchBoxControl - // - this.BackColor = System.Drawing.SystemColors.Window; - this.Controls.Add(this.picSearchBox); - this.Controls.Add(this.txtQuery); - this.Name = "SearchBoxControl"; - this.Size = new System.Drawing.Size(150, 22); - this.ResumeLayout(false); + protected override void OnPaint(PaintEventArgs e) + { + base.OnPaint (e); - } - #endregion + /* + GraphicsHelper.DrawCompositedImageBorder( + e.Graphics, + ClientRectangle, + bmpSearchInput, + GraphicsHelper.SliceCompositedImageBorder(bmpSearchInput.Size, 6, 7, 7, 8)); + */ - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint (e); + Color borderColor = Color.FromArgb(74, 114, 140); - /* - GraphicsHelper.DrawCompositedImageBorder( - e.Graphics, - ClientRectangle, - bmpSearchInput, - GraphicsHelper.SliceCompositedImageBorder(bmpSearchInput.Size, 6, 7, 7, 8)); - */ + using (Brush b = new SolidBrush(SystemColors.Window)) + e.Graphics.FillRectangle(b, 1, 1, Width-2, Height-2); + using (Pen p = new Pen(borderColor, 1)) + { + e.Graphics.DrawRectangle(p, 0, 0, Width - 1, Height - 1); + e.Graphics.DrawLine(p, Width - picSearchBox.Width - 2, 0, Width - picSearchBox.Width - 2, Height); + } - Color borderColor = Color.FromArgb(74, 114, 140); + } - using (Brush b = new SolidBrush(SystemColors.Window)) - e.Graphics.FillRectangle(b, 1, 1, Width-2, Height-2); - using (Pen p = new Pen(borderColor, 1)) - { - e.Graphics.DrawRectangle(p, 0, 0, Width - 1, Height - 1); - e.Graphics.DrawLine(p, Width - picSearchBox.Width - 2, 0, Width - picSearchBox.Width - 2, Height); - } + private class TextBoxWithEnter : TextBox + { + public event EventHandler EnterPressed; - } + protected override bool ProcessCmdKey(ref Message msg, Keys keyData) + { + if (keyData == Keys.Enter) + { + if (EnterPressed != null) + EnterPressed(this, EventArgs.Empty); + return true; + } + else + return base.ProcessCmdKey(ref msg, keyData); + } + } - private class TextBoxWithEnter : TextBox - { - public event EventHandler EnterPressed; + private void txtQuery_EnterPressed(object sender, EventArgs e) + { + Search(); + } - protected override bool ProcessCmdKey(ref Message msg, Keys keyData) - { - if (keyData == Keys.Enter) - { - if (EnterPressed != null) - EnterPressed(this, EventArgs.Empty); - return true; - } - else - return base.ProcessCmdKey(ref msg, keyData); - } - } + private void picSearchBox_Click(object sender, EventArgs e) + { + Search(); + } - private void txtQuery_EnterPressed(object sender, EventArgs e) - { - Search(); - } - - private void picSearchBox_Click(object sender, EventArgs e) - { - Search(); - } - - private void Search() - { - string query = txtQuery.Text.Trim(); - if (query == "") - Process.Start("http://search.live.com/"); - else - Process.Start( - string.Format(CultureInfo.InvariantCulture, "http://search.live.com/results.aspx?q={0}&mkt={1}&FORM=LVSP", - HttpUtility.UrlEncode(query), - HttpUtility.UrlEncode(CultureInfo.CurrentCulture.Name))); - } - } + private void Search() + { + string query = txtQuery.Text.Trim(); + if (query == "") + Process.Start("http://search.live.com/"); + else + Process.Start( + string.Format(CultureInfo.InvariantCulture, "http://search.live.com/results.aspx?q={0}&mkt={1}&FORM=LVSP", + HttpUtility.UrlEncode(query), + HttpUtility.UrlEncode(CultureInfo.CurrentCulture.Name))); + } + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/SecondaryWorkspaceControl.cs b/src/managed/OpenLiveWriter.ApplicationFramework/SecondaryWorkspaceControl.cs index 3fa6130b..a2f94a3e 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/SecondaryWorkspaceControl.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/SecondaryWorkspaceControl.cs @@ -6,78 +6,78 @@ using System.Drawing; namespace OpenLiveWriter.ApplicationFramework { - /// - /// Secondary version of the WorkspaceControl. - /// - public class SecondaryWorkspaceControl : WorkspaceControl - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Secondary version of the WorkspaceControl. + /// + public class SecondaryWorkspaceControl : WorkspaceControl + { + /// + /// Required designer variable. + /// + private Container components = null; - /// - /// Gets the top color. - /// - public override Color TopColor - { - get - { - return ApplicationManager.ApplicationStyle.SecondaryWorkspaceTopColor; - } - } + /// + /// Gets the top color. + /// + public override Color TopColor + { + get + { + return ApplicationManager.ApplicationStyle.SecondaryWorkspaceTopColor; + } + } - /// - /// Gets the bottom color. - /// - public override Color BottomColor - { - get - { - return ApplicationManager.ApplicationStyle.SecondaryWorkspaceBottomColor; - } - } + /// + /// Gets the bottom color. + /// + public override Color BottomColor + { + get + { + return ApplicationManager.ApplicationStyle.SecondaryWorkspaceBottomColor; + } + } - /// - /// Initializes a new instance of the SecondaryWorkspaceControl class. - /// - public SecondaryWorkspaceControl() : this(ApplicationManager.CommandManager) - { - } + /// + /// Initializes a new instance of the SecondaryWorkspaceControl class. + /// + public SecondaryWorkspaceControl() : this(ApplicationManager.CommandManager) + { + } - /// - /// Initializes a new instance of the SecondaryWorkspaceControl class. - /// - public SecondaryWorkspaceControl(CommandManager commandManager) : base(commandManager) - { - // This call is required by the Windows.Forms Form Designer. - InitializeComponent(); - } + /// + /// Initializes a new instance of the SecondaryWorkspaceControl class. + /// + public SecondaryWorkspaceControl(CommandManager commandManager) : base(commandManager) + { + // This call is required by the Windows.Forms Form Designer. + InitializeComponent(); + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - components = new System.ComponentModel.Container(); - } - #endregion - } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/SidebarHeaderControl.cs b/src/managed/OpenLiveWriter.ApplicationFramework/SidebarHeaderControl.cs index d5a5fc0f..1116578b 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/SidebarHeaderControl.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/SidebarHeaderControl.cs @@ -207,12 +207,10 @@ namespace OpenLiveWriter.ApplicationFramework } } - private void linkLabelOptional_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { LaunchUrl(_secondUrl); } - } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/Skinning/ColorizedResources.cs b/src/managed/OpenLiveWriter.ApplicationFramework/Skinning/ColorizedResources.cs index b8f90eb4..3c74e62e 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/Skinning/ColorizedResources.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/Skinning/ColorizedResources.cs @@ -222,21 +222,20 @@ namespace OpenLiveWriter.ApplicationFramework.Skinning _sidebarLinkColor = SystemInformation.HighContrast ? SystemColors.HotTrack : Color.FromArgb(0, 134, 198); /* - SwapAndDispose(ref _imgAppVapor, - ColorizeBitmap(ResourceHelper.LoadAssemblyResourceBitmap("Images.HIG.AppVapor.png"))); + SwapAndDispose(ref _imgAppVapor, + ColorizeBitmap(ResourceHelper.LoadAssemblyResourceBitmap("Images.HIG.AppVapor.png"))); - if (_hbAppVapor != IntPtr.Zero) - Gdi32.DeleteObject(_hbAppVapor); - _hbAppVapor = _imgAppVapor.GetHbitmap(); + if (_hbAppVapor != IntPtr.Zero) + Gdi32.DeleteObject(_hbAppVapor); + _hbAppVapor = _imgAppVapor.GetHbitmap(); + SwapAndDispose(ref _imgAppVaporFaded, + ColorizeBitmap(ResourceHelper.LoadAssemblyResourceBitmap("Images.HIG.AppVaporFaded.png"))); - SwapAndDispose(ref _imgAppVaporFaded, - ColorizeBitmap(ResourceHelper.LoadAssemblyResourceBitmap("Images.HIG.AppVaporFaded.png"))); - - if (_hbAppVaporFaded != IntPtr.Zero) - Gdi32.DeleteObject(_hbAppVaporFaded); - _hbAppVaporFaded = _imgAppVaporFaded.GetHbitmap(); - */ + if (_hbAppVaporFaded != IntPtr.Zero) + Gdi32.DeleteObject(_hbAppVaporFaded); + _hbAppVaporFaded = _imgAppVaporFaded.GetHbitmap(); + */ } } @@ -466,7 +465,6 @@ namespace OpenLiveWriter.ApplicationFramework.Skinning return Colorizer.ColorizeBitmap(bmp, _colorizeColor, _colorizeScale); } - public delegate void ControlUpdater(ColorizedResources cr, TControl c) where TControl : Control; public void RegisterControlForUpdates(TControl control, ControlUpdater updater) where TControl : Control { @@ -523,11 +521,11 @@ namespace OpenLiveWriter.ApplicationFramework.Skinning { // Convert special COL_GrayText value to the system's graytext color. /* - if (crColorize == COL_GrayText) - { - crColorize = ::GetSysColor(COLOR_GRAYTEXT); - } - */ + if (crColorize == COL_GrayText) + { + crColorize = ::GetSysColor(COLOR_GRAYTEXT); + } + */ // Is the colorize value a flag? if (Color.Empty == crColorize) diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/Skinning/FramelessManager.cs b/src/managed/OpenLiveWriter.ApplicationFramework/Skinning/FramelessManager.cs index d8306ecd..d1654538 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/Skinning/FramelessManager.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/Skinning/FramelessManager.cs @@ -15,553 +15,548 @@ using OpenLiveWriter.Localization; using OpenLiveWriter.Interop.Windows; using Timer=System.Windows.Forms.Timer; - namespace OpenLiveWriter.ApplicationFramework.Skinning { [Obsolete("not needed", true)] - public class FramelessManager : IFrameManager - { + public class FramelessManager : IFrameManager + { + private static event EventHandler AlwaysShowFrameChanged; - private static event EventHandler AlwaysShowFrameChanged; + private SatelliteApplicationForm _form; + private UITheme _uiTheme; + private MinMaxClose minMaxClose; + private SizeBorderHitTester _sizeBorderHitTester = new SizeBorderHitTester(new Size(15, 15), new Size(16,16)); + private ColorizedResources res = ColorizedResources.Instance; + private Timer _mouseFrameTimer; - private SatelliteApplicationForm _form; - private UITheme _uiTheme; - private MinMaxClose minMaxClose; - private SizeBorderHitTester _sizeBorderHitTester = new SizeBorderHitTester(new Size(15, 15), new Size(16,16)); - private ColorizedResources res = ColorizedResources.Instance; - private Timer _mouseFrameTimer; + private int _activationCount = 0; - private int _activationCount = 0; + private bool _inMenuLoop; + private bool _forceFrame = false; + private bool _alwaysShowFrame; + private Size _overrideSize = Size.Empty; + private Command _commandShowMenu; - private bool _inMenuLoop; - private bool _forceFrame = false; - private bool _alwaysShowFrame; - private Size _overrideSize = Size.Empty; - private Command _commandShowMenu; + private const int SYSICON_TOP = 6; + private const int SYSICON_LEFT = 5; - private const int SYSICON_TOP = 6; - private const int SYSICON_LEFT = 5; + const int SIZE_RESTORED =0; + const int SIZE_MINIMIZED =1; + const int SIZE_MAXIMIZED =2; + const int SIZE_MAXSHOW =3; + const int SIZE_MAXHIDE =4; - const int SIZE_RESTORED =0; - const int SIZE_MINIMIZED =1; - const int SIZE_MAXIMIZED =2; - const int SIZE_MAXSHOW =3; - const int SIZE_MAXHIDE =4; + public FramelessManager(SatelliteApplicationForm form) + { + _alwaysShowFrame = AlwaysShowFrame; - public FramelessManager(SatelliteApplicationForm form) - { - _alwaysShowFrame = AlwaysShowFrame; + _form = form; - _form = form; + minMaxClose = new MinMaxClose(); + minMaxClose.Anchor = AnchorStyles.Top | AnchorStyles.Right; + _form.Controls.Add(minMaxClose); - minMaxClose = new MinMaxClose(); - minMaxClose.Anchor = AnchorStyles.Top | AnchorStyles.Right; - _form.Controls.Add(minMaxClose); + _mouseFrameTimer = new Timer(); + _mouseFrameTimer.Interval = 100; + _mouseFrameTimer.Tick += new EventHandler(_mouseFrameTimer_Tick); - _mouseFrameTimer = new Timer(); - _mouseFrameTimer.Interval = 100; - _mouseFrameTimer.Tick += new EventHandler(_mouseFrameTimer_Tick); + _commandShowMenu = new Command(CommandId.ShowMenu); + _commandShowMenu.Latched = AlwaysShowFrame; + _commandShowMenu.Execute += new EventHandler(commandShowMenu_Execute); + // JJA: no longer provide a frameless option + //ApplicationManager.CommandManager.Add(_commandShowMenu); - _commandShowMenu = new Command(CommandId.ShowMenu); - _commandShowMenu.Latched = AlwaysShowFrame; - _commandShowMenu.Execute += new EventHandler(commandShowMenu_Execute); - // JJA: no longer provide a frameless option - //ApplicationManager.CommandManager.Add(_commandShowMenu); + ColorizedResources.GlobalColorizationChanged += new EventHandler(ColorizedResources_GlobalColorizationChanged); - ColorizedResources.GlobalColorizationChanged += new EventHandler(ColorizedResources_GlobalColorizationChanged); + _form.Layout += new LayoutEventHandler(_form_Layout); + _form.Activated += new EventHandler(_form_Activated); + _form.Deactivate += new EventHandler(_form_Deactivate); + _form.SizeChanged += new EventHandler(_form_SizeChanged); + _form.MouseDown +=new MouseEventHandler(_form_MouseDown); + _form.DoubleClick +=new EventHandler(_form_DoubleClick); + _form.Disposed += new EventHandler(_form_Disposed); - _form.Layout += new LayoutEventHandler(_form_Layout); - _form.Activated += new EventHandler(_form_Activated); - _form.Deactivate += new EventHandler(_form_Deactivate); - _form.SizeChanged += new EventHandler(_form_SizeChanged); - _form.MouseDown +=new MouseEventHandler(_form_MouseDown); - _form.DoubleClick +=new EventHandler(_form_DoubleClick); - _form.Disposed += new EventHandler(_form_Disposed); + AlwaysShowFrameChanged += new EventHandler(FramelessManager_AlwaysShowFrameChanged); - AlwaysShowFrameChanged += new EventHandler(FramelessManager_AlwaysShowFrameChanged); + _uiTheme = new UITheme(form); + } - _uiTheme = new UITheme(form); - } + private void commandShowMenu_Execute(object sender, EventArgs e) + { + AlwaysShowFrame = !_commandShowMenu.Latched; + } - private void commandShowMenu_Execute(object sender, EventArgs e) - { - AlwaysShowFrame = !_commandShowMenu.Latched; - } + public bool WndProc(ref Message m) + { + switch ((uint)m.Msg) + { + case 0x031E: // WM_DWMCOMPOSITIONCHANGED + { + // Aero was enabled or disabled. Force the UI to switch to + // the glass or non-glass style. + DisplayHelper.IsCompositionEnabled(true); + ColorizedResources.FireColorChanged(); + break; + } + case WM.SIZE: + { + uint size = (uint) m.LParam.ToInt32(); + switch (m.WParam.ToInt32()) + { + case SIZE_RESTORED: + _overrideSize = new Size((int) (size & 0xFFFF), (int) (size >> 16)); + UpdateFrame(); + break; + case SIZE_MAXIMIZED: + UpdateFrame(); + break; + case SIZE_MAXHIDE: + case SIZE_MINIMIZED: + case SIZE_MAXSHOW: + break; + } + break; + } + case WM.NCHITTEST: + { + // Handling this message gives us an easy way to make + // areas of the client region behave as elements of the + // non-client region. For example, the edges of the form + // can act as sizers. - public bool WndProc(ref Message m) - { - switch ((uint)m.Msg) - { - case 0x031E: // WM_DWMCOMPOSITIONCHANGED - { - // Aero was enabled or disabled. Force the UI to switch to - // the glass or non-glass style. - DisplayHelper.IsCompositionEnabled(true); - ColorizedResources.FireColorChanged(); - break; - } - case WM.SIZE: - { - uint size = (uint) m.LParam.ToInt32(); - switch (m.WParam.ToInt32()) - { - case SIZE_RESTORED: - _overrideSize = new Size((int) (size & 0xFFFF), (int) (size >> 16)); - UpdateFrame(); - break; - case SIZE_MAXIMIZED: - UpdateFrame(); - break; - case SIZE_MAXHIDE: - case SIZE_MINIMIZED: - case SIZE_MAXSHOW: - break; - } - break; - } - case WM.NCHITTEST: - { - // Handling this message gives us an easy way to make - // areas of the client region behave as elements of the - // non-client region. For example, the edges of the form - // can act as sizers. + Point p = _form.PointToClient(new Point(m.LParam.ToInt32())); - Point p = _form.PointToClient(new Point(m.LParam.ToInt32())); + if (_form.ClientRectangle.Contains(p)) + { + // only override the behavior if the mouse is within the client area - if (_form.ClientRectangle.Contains(p)) - { - // only override the behavior if the mouse is within the client area + if (Frameless) + { + int result = _sizeBorderHitTester.Test(_form.ClientSize, p); + if (result != -1) + { + m.Result = new IntPtr(result); + return true; + } + } - if (Frameless) - { - int result = _sizeBorderHitTester.Test(_form.ClientSize, p); - if (result != -1) - { - m.Result = new IntPtr(result); - return true; - } - } + if ( !PointInSystemIcon(p) ) + { + // The rest of the visible areas of the form act like + // the caption (click and drag to move, double-click to + // maximize/restore). + m.Result = new IntPtr(HT.CAPTION); + return true; + } + } + break; + } - if ( !PointInSystemIcon(p) ) - { - // The rest of the visible areas of the form act like - // the caption (click and drag to move, double-click to - // maximize/restore). - m.Result = new IntPtr(HT.CAPTION); - return true; - } - } - break; - } + case WM.ENTERMENULOOP: + if ( Control.MouseButtons == MouseButtons.None ) + { + _inMenuLoop = true; + ForceFrame = true; + } + break; + case WM.EXITMENULOOP: + if (_inMenuLoop) + { + _inMenuLoop = false; + if (!IsMouseInFrame()) + ForceFrame = false; + else + _mouseFrameTimer.Start(); + } + break; - case WM.ENTERMENULOOP: - if ( Control.MouseButtons == MouseButtons.None ) - { - _inMenuLoop = true; - ForceFrame = true; - } - break; - case WM.EXITMENULOOP: - if (_inMenuLoop) - { - _inMenuLoop = false; - if (!IsMouseInFrame()) - ForceFrame = false; - else - _mouseFrameTimer.Start(); - } - break; + } + return false; + } - } - return false; - } + private bool PointInSystemIcon(Point clientPoint) + { + return false; + //return new Rectangle(SYSICON_LEFT, SYSICON_TOP, res.LogoImage.Width, res.LogoImage.Height).Contains(clientPoint) ; + } - private bool PointInSystemIcon(Point clientPoint) - { - return false; - //return new Rectangle(SYSICON_LEFT, SYSICON_TOP, res.LogoImage.Width, res.LogoImage.Height).Contains(clientPoint) ; - } + private bool ForceFrame + { + get { return _forceFrame; } + set + { + if (_forceFrame != value) + { + _forceFrame = value; + UpdateFrame(); + _form.Update(); + } + } + } - private bool ForceFrame - { - get { return _forceFrame; } - set - { - if (_forceFrame != value) - { - _forceFrame = value; - UpdateFrame(); - _form.Update(); - } - } - } + public static bool AlwaysShowFrame + { + // JJA: no longer provide a frameless option + get { return true; } + //get { return ApplicationEnvironment.PreferencesSettingsRoot.GetSubSettings("Appearance").GetBoolean(SatelliteApplicationForm.SHOW_FRAME_KEY, false); } + set + { + ApplicationEnvironment.PreferencesSettingsRoot.GetSubSettings("Appearance").SetBoolean(SatelliteApplicationForm.SHOW_FRAME_KEY, value); + if (AlwaysShowFrameChanged != null) + AlwaysShowFrameChanged(null, EventArgs.Empty); + } + } - public static bool AlwaysShowFrame - { - // JJA: no longer provide a frameless option - get { return true; } - //get { return ApplicationEnvironment.PreferencesSettingsRoot.GetSubSettings("Appearance").GetBoolean(SatelliteApplicationForm.SHOW_FRAME_KEY, false); } - set - { - ApplicationEnvironment.PreferencesSettingsRoot.GetSubSettings("Appearance").SetBoolean(SatelliteApplicationForm.SHOW_FRAME_KEY, value); - if (AlwaysShowFrameChanged != null) - AlwaysShowFrameChanged(null, EventArgs.Empty); - } - } + public bool Frameless + { + // JJA: no longer provide a frameless option + get { return false; } + //get { return !_alwaysShowFrame && !_forceFrame && _form.WindowState != FormWindowState.Maximized && !_uiTheme.ForceShowFrame; } + } - public bool Frameless - { - // JJA: no longer provide a frameless option - get { return false; } - //get { return !_alwaysShowFrame && !_forceFrame && _form.WindowState != FormWindowState.Maximized && !_uiTheme.ForceShowFrame; } - } + private void _form_Layout(object sender, LayoutEventArgs e) + { - private void _form_Layout(object sender, LayoutEventArgs e) - { + // align the min/max/close button to the top-right of the form + minMaxClose.Left = _form.ClientSize.Width - minMaxClose.Width - 6; + minMaxClose.Top = 0; + } - // align the min/max/close button to the top-right of the form - minMaxClose.Left = _form.ClientSize.Width - minMaxClose.Width - 6; - minMaxClose.Top = 0; - } + private void UpdateFrame() + { + minMaxClose.Visible = Frameless; - private void UpdateFrame() - { - minMaxClose.Visible = Frameless; + if (Frameless) + { + SetRoundedRegion(_form, _overrideSize); + _wasFrameless = true ; + } + else + { + // don't set a null region if we were never frameless + // to begin with (eliminates the black corners that + // appear when you set the region ot null) + if ( _wasFrameless ) + _form.Region = null; + } - if (Frameless) - { - SetRoundedRegion(_form, _overrideSize); - _wasFrameless = true ; - } - else - { - // don't set a null region if we were never frameless - // to begin with (eliminates the black corners that - // appear when you set the region ot null) - if ( _wasFrameless ) - _form.Region = null; - } + _form.UpdateFramelessState(Frameless) ; - _form.UpdateFramelessState(Frameless) ; + _form.PerformLayout(); + _form.Invalidate(false); + } + private bool _wasFrameless = false ; - _form.PerformLayout(); - _form.Invalidate(false); - } - private bool _wasFrameless = false ; + public static void SetRoundedRegion(Form form, Size overrideSize) + { + int width, height; + if (overrideSize == Size.Empty) + { + width = form.ClientSize.Width; + height = form.ClientSize.Height; + } + else + { + width = overrideSize.Width; + height = overrideSize.Height; + } - public static void SetRoundedRegion(Form form, Size overrideSize) - { - int width, height; - if (overrideSize == Size.Empty) - { - width = form.ClientSize.Width; - height = form.ClientSize.Height; - } - else - { - width = overrideSize.Width; - height = overrideSize.Height; - } + Region r = new Region(new Rectangle(3, 0, width - 6, height)); + r.Union(new Rectangle(2, 1, width - 4, height - 2)); + r.Union(new Rectangle(1, 2, width - 2, height - 4)); + r.Union(new Rectangle(0, 3, width, height - 6)); - Region r = new Region(new Rectangle(3, 0, width - 6, height)); - r.Union(new Rectangle(2, 1, width - 4, height - 2)); - r.Union(new Rectangle(1, 2, width - 2, height - 4)); - r.Union(new Rectangle(0, 3, width, height - 6)); + RECT rect = new RECT(); + User32.GetWindowRect(form.Handle, ref rect); + Point windowScreenPos = RectangleHelper.Convert(rect).Location; + Point clientScreenPos = form.PointToScreen(new Point(0, 0)); - RECT rect = new RECT(); - User32.GetWindowRect(form.Handle, ref rect); - Point windowScreenPos = RectangleHelper.Convert(rect).Location; - Point clientScreenPos = form.PointToScreen(new Point(0, 0)); + r.Translate(clientScreenPos.X - windowScreenPos.X, clientScreenPos.Y - windowScreenPos.Y); - r.Translate(clientScreenPos.X - windowScreenPos.X, clientScreenPos.Y - windowScreenPos.Y); + form.Region = r; + } - form.Region = r; - } + public void PaintBackground(PaintEventArgs e) + { + //using (new QuickTimer("Paint frameless app window. Clip: " + e.ClipRectangle.ToString())) + { + Graphics g = e.Graphics; + g.InterpolationMode = InterpolationMode.Low; + g.CompositingMode = CompositingMode.SourceCopy; - public void PaintBackground(PaintEventArgs e) - { - //using (new QuickTimer("Paint frameless app window. Clip: " + e.ClipRectangle.ToString())) - { - Graphics g = e.Graphics; - g.InterpolationMode = InterpolationMode.Low; - g.CompositingMode = CompositingMode.SourceCopy; + Color light = res.FrameGradientLight; - Color light = res.FrameGradientLight; + int width = _form.ClientSize.Width; + int height = _form.ClientSize.Height; - int width = _form.ClientSize.Width; - int height = _form.ClientSize.Height; + using (Brush b = new SolidBrush(light)) + g.FillRectangle(b, 0, 0, width, height); - using (Brush b = new SolidBrush(light)) - g.FillRectangle(b, 0, 0, width, height); + // border + if ( Frameless ) + res.AppOutlineBorder.DrawBorder(g, _form.ClientRectangle); - // border - if ( Frameless ) - res.AppOutlineBorder.DrawBorder(g, _form.ClientRectangle); + g.CompositingMode = CompositingMode.SourceOver; + g.CompositingQuality = CompositingQuality.HighSpeed; - g.CompositingMode = CompositingMode.SourceOver; - g.CompositingQuality = CompositingQuality.HighSpeed; - - Rectangle footerRect = new Rectangle( - 0, - _form.ClientSize.Height - _form.DockPadding.Bottom, - _form.ClientSize.Width, - _form.DockPadding.Bottom); - if (e.ClipRectangle.IntersectsWith(footerRect)) + Rectangle footerRect = new Rectangle( + 0, + _form.ClientSize.Height - _form.DockPadding.Bottom, + _form.ClientSize.Width, + _form.DockPadding.Bottom); + if (e.ClipRectangle.IntersectsWith(footerRect)) res.AppFooterBackground.DrawBorder(g, footerRect); //GraphicsHelper.TileFillUnscaledImageHorizontally(g, res.FooterBackground, footerRect); - Rectangle toolbarRect = new Rectangle( - _form.DockPadding.Left, - _form.DockPadding.Top, - _form.ClientSize.Width - _form.DockPadding.Left - _form.DockPadding.Right, - res.ToolbarBorder.MinimumHeight - ); - + Rectangle toolbarRect = new Rectangle( + _form.DockPadding.Left, + _form.DockPadding.Top, + _form.ClientSize.Width - _form.DockPadding.Left - _form.DockPadding.Right, + res.ToolbarBorder.MinimumHeight + ); if (e.ClipRectangle.IntersectsWith(toolbarRect)) - { + { res.ToolbarBorder.DrawBorder(g, toolbarRect); - } + } // draw vapor #if VAPOR - Rectangle appVapor = AppVaporRectangle; - if (e.ClipRectangle.IntersectsWith(appVapor)) - { - if (appVapor.Width == res.VaporImage.Width) - { - // NOTE: Try to bring Gdi painting back for performance (check with Joe on this) - //GdiPaint.BitBlt(g, minMaxClose.Faded ? res.VaporImageFadedHbitmap : res.VaporImageHbitmap, new Rectangle(Point.Empty, appVapor.Size), appVapor.Location); - g.DrawImage(minMaxClose.Faded ? res.VaporImageFaded : res.VaporImage, appVapor); - } - else - { - g.DrawImage(minMaxClose.Faded ? res.VaporImageFaded : res.VaporImage, appVapor); - } - } + Rectangle appVapor = AppVaporRectangle; + if (e.ClipRectangle.IntersectsWith(appVapor)) + { + if (appVapor.Width == res.VaporImage.Width) + { + // NOTE: Try to bring Gdi painting back for performance (check with Joe on this) + //GdiPaint.BitBlt(g, minMaxClose.Faded ? res.VaporImageFadedHbitmap : res.VaporImageHbitmap, new Rectangle(Point.Empty, appVapor.Size), appVapor.Location); + g.DrawImage(minMaxClose.Faded ? res.VaporImageFaded : res.VaporImage, appVapor); + } + else + { + g.DrawImage(minMaxClose.Faded ? res.VaporImageFaded : res.VaporImage, appVapor); + } + } #endif - - g.CompositingQuality = CompositingQuality.HighQuality; + g.CompositingQuality = CompositingQuality.HighQuality; /* - if (Frameless) - { - // gripper - g.DrawImage(res.GripperImage, width - 15, height - 15, res.GripperImage.Width, res.GripperImage.Height); + if (Frameless) + { + // gripper + g.DrawImage(res.GripperImage, width - 15, height - 15, res.GripperImage.Width, res.GripperImage.Height); - // draw window caption - //g.DrawIcon(ApplicationEnvironment.ProductIconSmall, 5, 6); - g.DrawImage(res.LogoImage, SYSICON_LEFT, SYSICON_TOP, res.LogoImage.Width, res.LogoImage.Height); + // draw window caption + //g.DrawIcon(ApplicationEnvironment.ProductIconSmall, 5, 6); + g.DrawImage(res.LogoImage, SYSICON_LEFT, SYSICON_TOP, res.LogoImage.Width, res.LogoImage.Height); - // determine caption font - NONCLIENTMETRICS metrics = new NONCLIENTMETRICS(); - metrics.cbSize = Marshal.SizeOf(metrics); - User32.SystemParametersInfo(SPI.GETNONCLIENTMETRICS, 0, ref metrics, 0); - using ( Font font = new Font( - metrics.lfCaptionFont.lfFaceName, - Math.Min(-metrics.lfCaptionFont.lfHeight, 13), - (metrics.lfCaptionFont.lfItalic > 0 ? FontStyle.Italic : FontStyle.Regular) | - (metrics.lfCaptionFont.lfWeight >= 700 ? FontStyle.Bold : FontStyle.Regular), - GraphicsUnit.World)) - { - using ( Brush brush = new SolidBrush(!minMaxClose.Faded ? Color.White : Color.FromArgb(140, Color.White)) ) - { - // draw caption - g.DrawString( - ApplicationEnvironment.ProductName, - font, - brush, - 22, 5 ); - } - } - } + // determine caption font + NONCLIENTMETRICS metrics = new NONCLIENTMETRICS(); + metrics.cbSize = Marshal.SizeOf(metrics); + User32.SystemParametersInfo(SPI.GETNONCLIENTMETRICS, 0, ref metrics, 0); + using ( Font font = new Font( + metrics.lfCaptionFont.lfFaceName, + Math.Min(-metrics.lfCaptionFont.lfHeight, 13), + (metrics.lfCaptionFont.lfItalic > 0 ? FontStyle.Italic : FontStyle.Regular) | + (metrics.lfCaptionFont.lfWeight >= 700 ? FontStyle.Bold : FontStyle.Regular), + GraphicsUnit.World)) + { + using ( Brush brush = new SolidBrush(!minMaxClose.Faded ? Color.White : Color.FromArgb(140, Color.White)) ) + { + // draw caption + g.DrawString( + ApplicationEnvironment.ProductName, + font, + brush, + 22, 5 ); + } + } + } */ - } - } + } + } - private void _form_Activated(object sender, EventArgs e) - { - if (++_activationCount == 1) - { - minMaxClose.Faded = false; - _form.Invalidate(false); - } - } + private void _form_Activated(object sender, EventArgs e) + { + if (++_activationCount == 1) + { + minMaxClose.Faded = false; + _form.Invalidate(false); + } + } - private void _form_Deactivate(object sender, EventArgs e) - { - if (--_activationCount == 0) - { - minMaxClose.Faded = true; - _form.Invalidate(false); - } - } + private void _form_Deactivate(object sender, EventArgs e) + { + if (--_activationCount == 0) + { + minMaxClose.Faded = true; + _form.Invalidate(false); + } + } - private void _mouseFrameTimer_Tick(object sender, EventArgs e) - { - if (_inMenuLoop) - { - _mouseFrameTimer.Stop(); - } - else if (!IsMouseInFrame()) - { - ForceFrame = false; - _mouseFrameTimer.Stop(); - } - } + private void _mouseFrameTimer_Tick(object sender, EventArgs e) + { + if (_inMenuLoop) + { + _mouseFrameTimer.Stop(); + } + else if (!IsMouseInFrame()) + { + ForceFrame = false; + _mouseFrameTimer.Stop(); + } + } - private bool IsMouseInFrame() - { + private bool IsMouseInFrame() + { - return false; - /* - RECT rect = new RECT(); - User32.GetWindowRect(_form.Handle, ref rect); - Rectangle windowRect = RectangleHelper.Convert(rect); - return - windowRect.Contains(Control.MousePosition) && - !_form.ClientRectangle.Contains(_form.PointToClient(Control.MousePosition)); - */ - } + return false; + /* + RECT rect = new RECT(); + User32.GetWindowRect(_form.Handle, ref rect); + Rectangle windowRect = RectangleHelper.Convert(rect); + return + windowRect.Contains(Control.MousePosition) && + !_form.ClientRectangle.Contains(_form.PointToClient(Control.MousePosition)); + */ + } - private void _form_SizeChanged(object sender, EventArgs e) - { - _overrideSize = Size.Empty; - } + private void _form_SizeChanged(object sender, EventArgs e) + { + _overrideSize = Size.Empty; + } - private void ColorizedResources_GlobalColorizationChanged(object sender, EventArgs e) - { - try - { - if ( ControlHelper.ControlCanHandleInvoke(_form) ) - { - _form.BeginInvoke(new ThreadStart(RefreshColors)); - } - } - catch (Exception ex) - { - Trace.Fail(ex.ToString()); - } - } + private void ColorizedResources_GlobalColorizationChanged(object sender, EventArgs e) + { + try + { + if ( ControlHelper.ControlCanHandleInvoke(_form) ) + { + _form.BeginInvoke(new ThreadStart(RefreshColors)); + } + } + catch (Exception ex) + { + Trace.Fail(ex.ToString()); + } + } - private void RefreshColors() - { - ColorizedResources colRes = ColorizedResources.Instance; - colRes.Refresh(); - colRes.FireColorizationChanged(); - User32.SendMessage(_form.Handle, WM.NCPAINT, new UIntPtr(1), IntPtr.Zero ) ; - _form.Invalidate(true); - _form.Update(); - } + private void RefreshColors() + { + ColorizedResources colRes = ColorizedResources.Instance; + colRes.Refresh(); + colRes.FireColorizationChanged(); + User32.SendMessage(_form.Handle, WM.NCPAINT, new UIntPtr(1), IntPtr.Zero ) ; + _form.Invalidate(true); + _form.Update(); + } - private void _form_Disposed(object sender, EventArgs e) - { - ColorizedResources.GlobalColorizationChanged -= new EventHandler(ColorizedResources_GlobalColorizationChanged); - AlwaysShowFrameChanged -= new EventHandler(FramelessManager_AlwaysShowFrameChanged); - } + private void _form_Disposed(object sender, EventArgs e) + { + ColorizedResources.GlobalColorizationChanged -= new EventHandler(ColorizedResources_GlobalColorizationChanged); + AlwaysShowFrameChanged -= new EventHandler(FramelessManager_AlwaysShowFrameChanged); + } - private void FramelessManager_AlwaysShowFrameChanged(object sender, EventArgs e) - { - if (_form.IsDisposed) - { - return; - } + private void FramelessManager_AlwaysShowFrameChanged(object sender, EventArgs e) + { + if (_form.IsDisposed) + { + return; + } - if (_form.InvokeRequired) - { - _form.BeginInvoke(new EventHandler(FramelessManager_AlwaysShowFrameChanged), new object[] {sender, e}); - return; - } - _alwaysShowFrame = - ApplicationEnvironment.PreferencesSettingsRoot.GetSubSettings("Appearance").GetBoolean(SatelliteApplicationForm.SHOW_FRAME_KEY, false); - UpdateFrame(); - _form.Update(); - _commandShowMenu.Latched = _alwaysShowFrame; + if (_form.InvokeRequired) + { + _form.BeginInvoke(new EventHandler(FramelessManager_AlwaysShowFrameChanged), new object[] {sender, e}); + return; + } + _alwaysShowFrame = + ApplicationEnvironment.PreferencesSettingsRoot.GetSubSettings("Appearance").GetBoolean(SatelliteApplicationForm.SHOW_FRAME_KEY, false); + UpdateFrame(); + _form.Update(); + _commandShowMenu.Latched = _alwaysShowFrame; - Command commandMenu = ApplicationManager.CommandManager.Get(CommandId.Menu); - if (commandMenu != null) - commandMenu.On = !_alwaysShowFrame; - } + Command commandMenu = ApplicationManager.CommandManager.Get(CommandId.Menu); + if (commandMenu != null) + commandMenu.On = !_alwaysShowFrame; + } - private void _hideFrame_Click(object sender, EventArgs e) - { - AlwaysShowFrame = false; - } + private void _hideFrame_Click(object sender, EventArgs e) + { + AlwaysShowFrame = false; + } - /// - /// Prevents the vapor from appearing faded while the mini form is visible. - /// This should only be used if the mini form will disappear when it loses - /// focus (deactivated), otherwise the main form will be painted as activated - /// even when it may not be. - /// - public void AddOwnedForm(Form f) - { - _form_Activated(this, EventArgs.Empty); - } + /// + /// Prevents the vapor from appearing faded while the mini form is visible. + /// This should only be used if the mini form will disappear when it loses + /// focus (deactivated), otherwise the main form will be painted as activated + /// even when it may not be. + /// + public void AddOwnedForm(Form f) + { + _form_Activated(this, EventArgs.Empty); + } - /// - /// Restore normal painting. - /// - public void RemoveOwnedForm(Form f) - { - _form_Deactivate(this, EventArgs.Empty); - } + /// + /// Restore normal painting. + /// + public void RemoveOwnedForm(Form f) + { + _form_Deactivate(this, EventArgs.Empty); + } + private void _form_MouseDown(object sender, MouseEventArgs e) + { + /* JJA: Couldn't get both single and double-click working (would almost never + * get the second click, presumably because the menu was up). We have decided + * for the time being that double-click to close is a more important gesture + * (for what it is worth, Windows Media Player also supports ONLY double-click + * and not single-click). If we want to support both it is probably possible + * however it will take some WndProc hacking. + * + if ( PointInSystemIcon( _form.PointToClient(Control.MousePosition) ) ) + { + // handle single-click + Point menuPoint = _form.PointToScreen(new Point(0, _form.DockPadding.Top)) ; + IntPtr hSystemMenu = User32.GetSystemMenu(_form.Handle, false) ; + int iCmd = User32.TrackPopupMenu(hSystemMenu, TPM.RETURNCMD | TPM.LEFTBUTTON, menuPoint.X, menuPoint.Y, 0, _form.Handle, IntPtr.Zero ) ; + if ( iCmd != 0 ) + { + User32.SendMessage(_form.Handle, WM.SYSCOMMAND, new IntPtr(iCmd), MessageHelper.MAKELONG(Control.MousePosition.X, Control.MousePosition.Y)) ; + } + } + */ + } - private void _form_MouseDown(object sender, MouseEventArgs e) - { - /* JJA: Couldn't get both single and double-click working (would almost never - * get the second click, presumably because the menu was up). We have decided - * for the time being that double-click to close is a more important gesture - * (for what it is worth, Windows Media Player also supports ONLY double-click - * and not single-click). If we want to support both it is probably possible - * however it will take some WndProc hacking. - * - if ( PointInSystemIcon( _form.PointToClient(Control.MousePosition) ) ) - { - // handle single-click - Point menuPoint = _form.PointToScreen(new Point(0, _form.DockPadding.Top)) ; - IntPtr hSystemMenu = User32.GetSystemMenu(_form.Handle, false) ; - int iCmd = User32.TrackPopupMenu(hSystemMenu, TPM.RETURNCMD | TPM.LEFTBUTTON, menuPoint.X, menuPoint.Y, 0, _form.Handle, IntPtr.Zero ) ; - if ( iCmd != 0 ) - { - User32.SendMessage(_form.Handle, WM.SYSCOMMAND, new IntPtr(iCmd), MessageHelper.MAKELONG(Control.MousePosition.X, Control.MousePosition.Y)) ; - } - } - */ - } + private void _form_DoubleClick(object sender, EventArgs e) + { + if ( PointInSystemIcon( _form.PointToClient(Control.MousePosition) ) ) + _form.Close() ; + } - private void _form_DoubleClick(object sender, EventArgs e) - { - if ( PointInSystemIcon( _form.PointToClient(Control.MousePosition) ) ) - _form.Close() ; - } - - private class UITheme : ControlUITheme - { - public bool ForceShowFrame; - //private FramelessManager _framelessManager; + private class UITheme : ControlUITheme + { + public bool ForceShowFrame; + //private FramelessManager _framelessManager; // public UITheme(Control control, FramelessManager framelessManager) : base(control, false) public UITheme(Control control) : base(control, false) - { - //_framelessManager = framelessManager; - ApplyTheme(); - } + { + //_framelessManager = framelessManager; + ApplyTheme(); + } - protected override void ApplyTheme(bool highContrast) - { - ForceShowFrame = highContrast; + protected override void ApplyTheme(bool highContrast) + { + ForceShowFrame = highContrast; //if(_framelessManager._form.Created) //{ // _framelessManager.UpdateFrame(); // _framelessManager._form.Update(); //} - } - } - } + } + } + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/Skinning/HiddenMenuFrameManager.cs b/src/managed/OpenLiveWriter.ApplicationFramework/Skinning/HiddenMenuFrameManager.cs index 855a9dce..1cf07543 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/Skinning/HiddenMenuFrameManager.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/Skinning/HiddenMenuFrameManager.cs @@ -15,279 +15,267 @@ using Timer=System.Windows.Forms.Timer; namespace OpenLiveWriter.ApplicationFramework.Skinning { - public class HiddenMenuFrameManager : IFrameManager - { - private static event EventHandler AlwaysShowMenuChanged; + public class HiddenMenuFrameManager : IFrameManager + { + private static event EventHandler AlwaysShowMenuChanged; - private SatelliteApplicationForm _form; - private ColorizedResources res = ColorizedResources.Instance; - private Timer _mouseFrameTimer; + private SatelliteApplicationForm _form; + private ColorizedResources res = ColorizedResources.Instance; + private Timer _mouseFrameTimer; + + private bool _inMenuLoop; + private bool _forceMenu = false; + private bool _alwaysShowMenu; + private Command _commandShowMenu; + + const int SIZE_RESTORED =0; + const int SIZE_MINIMIZED =1; + const int SIZE_MAXIMIZED =2; + const int SIZE_MAXSHOW =3; + const int SIZE_MAXHIDE =4; + + public HiddenMenuFrameManager(SatelliteApplicationForm form) + { + _alwaysShowMenu = AlwaysShowMenu; + + _form = form; + _form.Load +=new EventHandler(_form_Load); + + _mouseFrameTimer = new Timer(); + _mouseFrameTimer.Interval = 100; + _mouseFrameTimer.Tick += new EventHandler(_mouseFrameTimer_Tick); + + _commandShowMenu = new Command(CommandId.ShowMenu); + _commandShowMenu.Latched = AlwaysShowMenu; + _commandShowMenu.Execute += new EventHandler(commandShowMenu_Execute); + ApplicationManager.CommandManager.Add(_commandShowMenu); + + ColorizedResources.GlobalColorizationChanged += new EventHandler(ColorizedResources_GlobalColorizationChanged); + _form.Disposed += new EventHandler(_form_Disposed); + + AlwaysShowMenuChanged += new EventHandler(HiddenMenuFrameManager_AlwaysShowMenuChanged); + } + + private void commandShowMenu_Execute(object sender, EventArgs e) + { + AlwaysShowMenu = !_commandShowMenu.Latched; + } + + public bool WndProc(ref Message m) + { + switch ((uint)m.Msg) + { + case WM.NCHITTEST: + { + Point p = _form.PointToClient(new Point(m.LParam.ToInt32())); + + if (_form.ClientRectangle.Contains(p)) + { + // gripper + Size gripperSize = new Size(15,15); + if (new Rectangle( + _form.ClientSize.Width - gripperSize.Width, + _form.ClientSize.Height - gripperSize.Height, + gripperSize.Width, + gripperSize.Height).Contains(p)) + { + m.Result = new IntPtr(HT.BOTTOMRIGHT) ; + return true ; + } + } + + break; + } + + case WM.ENTERMENULOOP: + _inMenuLoop = true; + ForceMenu = true; + break; + case WM.EXITMENULOOP: + _inMenuLoop = false; + if (!IsMouseInFrame()) + ForceMenu = false; + else + _mouseFrameTimer.Start(); + break; + } + return false; + } + + private bool ForceMenu + { + get { return _forceMenu; } + set + { + if (_forceMenu != value) + { + // set value + _forceMenu = value; + + // update appearance + UpdateMenuVisibility(); + + // attempt to force accelerators (this isn't working!) + /* + int stateChange = _forceFrame ? UIS.CLEAR : UIS.SET ; + User32.SendMessage(_form.Handle, WM.CHANGEUISTATE, new UIntPtr(Convert.ToUInt32( + MessageHelper.MAKELONG(stateChange, UISF.HIDEACCEL).ToInt32())), IntPtr.Zero); + //_form.Update(); + */ + } + } + } + + public static bool AlwaysShowMenu + { + get { return ApplicationEnvironment.PreferencesSettingsRoot.GetSubSettings("Appearance").GetBoolean(SatelliteApplicationForm.SHOW_FRAME_KEY, false); } + set + { + ApplicationEnvironment.PreferencesSettingsRoot.GetSubSettings("Appearance").SetBoolean(SatelliteApplicationForm.SHOW_FRAME_KEY, value); + if (AlwaysShowMenuChanged != null) + AlwaysShowMenuChanged(null, EventArgs.Empty); + } + } - private bool _inMenuLoop; - private bool _forceMenu = false; - private bool _alwaysShowMenu; - private Command _commandShowMenu; + private void UpdateMenuVisibility() + { + //_form.ShowMainMenu = _alwaysShowMenu || _forceMenu ; + } - const int SIZE_RESTORED =0; - const int SIZE_MINIMIZED =1; - const int SIZE_MAXIMIZED =2; - const int SIZE_MAXSHOW =3; - const int SIZE_MAXHIDE =4; + public void PaintBackground(PaintEventArgs e) + { + Graphics g = e.Graphics; + g.InterpolationMode = InterpolationMode.Low; + g.CompositingMode = CompositingMode.SourceCopy; - public HiddenMenuFrameManager(SatelliteApplicationForm form) - { - _alwaysShowMenu = AlwaysShowMenu; + Color light = res.FrameGradientLight; - _form = form; - _form.Load +=new EventHandler(_form_Load); + int width = _form.ClientSize.Width; + int height = _form.ClientSize.Height; - _mouseFrameTimer = new Timer(); - _mouseFrameTimer.Interval = 100; - _mouseFrameTimer.Tick += new EventHandler(_mouseFrameTimer_Tick); + using (Brush b = new SolidBrush(light)) + g.FillRectangle(b, 0, 0, width, height); - _commandShowMenu = new Command(CommandId.ShowMenu); - _commandShowMenu.Latched = AlwaysShowMenu; - _commandShowMenu.Execute += new EventHandler(commandShowMenu_Execute); - ApplicationManager.CommandManager.Add(_commandShowMenu); + g.CompositingMode = CompositingMode.SourceOver; + g.CompositingQuality = CompositingQuality.HighSpeed; - ColorizedResources.GlobalColorizationChanged += new EventHandler(ColorizedResources_GlobalColorizationChanged); - _form.Disposed += new EventHandler(_form_Disposed); + Rectangle bodyFrameRect = new Rectangle( + _form.DockPadding.Left - 5, + _form.DockPadding.Top, + _form.ClientSize.Width - _form.DockPadding.Right - _form.DockPadding.Left + 5 + 5, + _form.ClientSize.Height - _form.DockPadding.Top - _form.DockPadding.Bottom + 7); + if (e.ClipRectangle.IntersectsWith(bodyFrameRect)) + res.AppBodyFrameBorder.DrawBorder(g, bodyFrameRect); - AlwaysShowMenuChanged += new EventHandler(HiddenMenuFrameManager_AlwaysShowMenuChanged); - } + Rectangle toolbarRect = new Rectangle( + _form.DockPadding.Left - 1, + _form.DockPadding.Top, + _form.ClientSize.Width - _form.DockPadding.Left - _form.DockPadding.Right + 2, + res.ToolbarBorder.MinimumHeight + ); + if (e.ClipRectangle.IntersectsWith(toolbarRect)) + res.ToolbarBorder.DrawBorder(g, toolbarRect); - private void commandShowMenu_Execute(object sender, EventArgs e) - { - AlwaysShowMenu = !_commandShowMenu.Latched; - } + g.CompositingQuality = CompositingQuality.HighQuality; - public bool WndProc(ref Message m) - { - switch ((uint)m.Msg) - { - case WM.NCHITTEST: - { - Point p = _form.PointToClient(new Point(m.LParam.ToInt32())); + // gripper + g.DrawImage(res.GripperImage, width - 15, height - 15, res.GripperImage.Width, res.GripperImage.Height); - if (_form.ClientRectangle.Contains(p)) - { - // gripper - Size gripperSize = new Size(15,15); - if (new Rectangle( - _form.ClientSize.Width - gripperSize.Width, - _form.ClientSize.Height - gripperSize.Height, - gripperSize.Width, - gripperSize.Height).Contains(p)) - { - m.Result = new IntPtr(HT.BOTTOMRIGHT) ; - return true ; - } - } + } - break; - } + private void _mouseFrameTimer_Tick(object sender, EventArgs e) + { + if (_inMenuLoop) + { + _mouseFrameTimer.Stop(); + } + else if (!IsMouseInFrame()) + { + ForceMenu = false; + _mouseFrameTimer.Stop(); + } + } - case WM.ENTERMENULOOP: - _inMenuLoop = true; - ForceMenu = true; - break; - case WM.EXITMENULOOP: - _inMenuLoop = false; - if (!IsMouseInFrame()) - ForceMenu = false; - else - _mouseFrameTimer.Start(); - break; - } - return false; - } + private bool IsMouseInFrame() + { + RECT rect = new RECT(); + User32.GetWindowRect(_form.Handle, ref rect); + Rectangle windowRect = RectangleHelper.Convert(rect); + return + windowRect.Contains(Control.MousePosition) && + !_form.ClientRectangle.Contains(_form.PointToClient(Control.MousePosition)); + } - private bool ForceMenu - { - get { return _forceMenu; } - set - { - if (_forceMenu != value) - { - // set value - _forceMenu = value; + private void ColorizedResources_GlobalColorizationChanged(object sender, EventArgs e) + { + try + { + if ( ControlHelper.ControlCanHandleInvoke(_form) ) + { + _form.BeginInvoke(new ThreadStart(RefreshColors)); + } + } + catch (Exception ex) + { + Trace.Fail(ex.ToString()); + } + } - // update appearance - UpdateMenuVisibility(); + private void RefreshColors() + { + ColorizedResources colRes = ColorizedResources.Instance; + colRes.Refresh(); + colRes.FireColorizationChanged(); + _form.Invalidate(true); + _form.Update(); + } - // attempt to force accelerators (this isn't working!) - /* - int stateChange = _forceFrame ? UIS.CLEAR : UIS.SET ; - User32.SendMessage(_form.Handle, WM.CHANGEUISTATE, new UIntPtr(Convert.ToUInt32( - MessageHelper.MAKELONG(stateChange, UISF.HIDEACCEL).ToInt32())), IntPtr.Zero); - //_form.Update(); - */ - } - } - } + private void _form_Load(object sender, EventArgs e) + { + UpdateMenuVisibility() ; + } + private void _form_Disposed(object sender, EventArgs e) + { + ColorizedResources.GlobalColorizationChanged -= new EventHandler(ColorizedResources_GlobalColorizationChanged); + AlwaysShowMenuChanged -= new EventHandler(HiddenMenuFrameManager_AlwaysShowMenuChanged); + } - public static bool AlwaysShowMenu - { - get { return ApplicationEnvironment.PreferencesSettingsRoot.GetSubSettings("Appearance").GetBoolean(SatelliteApplicationForm.SHOW_FRAME_KEY, false); } - set - { - ApplicationEnvironment.PreferencesSettingsRoot.GetSubSettings("Appearance").SetBoolean(SatelliteApplicationForm.SHOW_FRAME_KEY, value); - if (AlwaysShowMenuChanged != null) - AlwaysShowMenuChanged(null, EventArgs.Empty); - } - } + private void HiddenMenuFrameManager_AlwaysShowMenuChanged(object sender, EventArgs e) + { + if (_form.IsDisposed) + { + return; + } + if (_form.InvokeRequired) + { + _form.BeginInvoke(new EventHandler(HiddenMenuFrameManager_AlwaysShowMenuChanged), new object[] {sender, e}); + return; + } + _alwaysShowMenu = + ApplicationEnvironment.PreferencesSettingsRoot.GetSubSettings("Appearance").GetBoolean(SatelliteApplicationForm.SHOW_FRAME_KEY, false); + UpdateMenuVisibility(); + _form.Update(); + _commandShowMenu.Latched = _alwaysShowMenu; + Command commandMenu = ApplicationManager.CommandManager.Get(CommandId.Menu); + if (commandMenu != null) + commandMenu.On = !_alwaysShowMenu; + } - private void UpdateMenuVisibility() - { - //_form.ShowMainMenu = _alwaysShowMenu || _forceMenu ; - } + public void AddOwnedForm(Form f) + { + User32.SendMessage(_form.Handle, WM.ACTIVATE, new UIntPtr(1), IntPtr.Zero ) ; + } + /// + /// Restore normal painting. + /// + public void RemoveOwnedForm(Form f) + { + } - public void PaintBackground(PaintEventArgs e) - { - Graphics g = e.Graphics; - g.InterpolationMode = InterpolationMode.Low; - g.CompositingMode = CompositingMode.SourceCopy; - - Color light = res.FrameGradientLight; - - int width = _form.ClientSize.Width; - int height = _form.ClientSize.Height; - - - using (Brush b = new SolidBrush(light)) - g.FillRectangle(b, 0, 0, width, height); - - - g.CompositingMode = CompositingMode.SourceOver; - g.CompositingQuality = CompositingQuality.HighSpeed; - - - Rectangle bodyFrameRect = new Rectangle( - _form.DockPadding.Left - 5, - _form.DockPadding.Top, - _form.ClientSize.Width - _form.DockPadding.Right - _form.DockPadding.Left + 5 + 5, - _form.ClientSize.Height - _form.DockPadding.Top - _form.DockPadding.Bottom + 7); - if (e.ClipRectangle.IntersectsWith(bodyFrameRect)) - res.AppBodyFrameBorder.DrawBorder(g, bodyFrameRect); - - - Rectangle toolbarRect = new Rectangle( - _form.DockPadding.Left - 1, - _form.DockPadding.Top, - _form.ClientSize.Width - _form.DockPadding.Left - _form.DockPadding.Right + 2, - res.ToolbarBorder.MinimumHeight - ); - if (e.ClipRectangle.IntersectsWith(toolbarRect)) - res.ToolbarBorder.DrawBorder(g, toolbarRect); - - - g.CompositingQuality = CompositingQuality.HighQuality; - - // gripper - g.DrawImage(res.GripperImage, width - 15, height - 15, res.GripperImage.Width, res.GripperImage.Height); - - } - - - private void _mouseFrameTimer_Tick(object sender, EventArgs e) - { - if (_inMenuLoop) - { - _mouseFrameTimer.Stop(); - } - else if (!IsMouseInFrame()) - { - ForceMenu = false; - _mouseFrameTimer.Stop(); - } - } - - private bool IsMouseInFrame() - { - RECT rect = new RECT(); - User32.GetWindowRect(_form.Handle, ref rect); - Rectangle windowRect = RectangleHelper.Convert(rect); - return - windowRect.Contains(Control.MousePosition) && - !_form.ClientRectangle.Contains(_form.PointToClient(Control.MousePosition)); - } - - private void ColorizedResources_GlobalColorizationChanged(object sender, EventArgs e) - { - try - { - if ( ControlHelper.ControlCanHandleInvoke(_form) ) - { - _form.BeginInvoke(new ThreadStart(RefreshColors)); - } - } - catch (Exception ex) - { - Trace.Fail(ex.ToString()); - } - } - - private void RefreshColors() - { - ColorizedResources colRes = ColorizedResources.Instance; - colRes.Refresh(); - colRes.FireColorizationChanged(); - _form.Invalidate(true); - _form.Update(); - } - - private void _form_Load(object sender, EventArgs e) - { - UpdateMenuVisibility() ; - } - - private void _form_Disposed(object sender, EventArgs e) - { - ColorizedResources.GlobalColorizationChanged -= new EventHandler(ColorizedResources_GlobalColorizationChanged); - AlwaysShowMenuChanged -= new EventHandler(HiddenMenuFrameManager_AlwaysShowMenuChanged); - } - - - private void HiddenMenuFrameManager_AlwaysShowMenuChanged(object sender, EventArgs e) - { - if (_form.IsDisposed) - { - return; - } - - if (_form.InvokeRequired) - { - _form.BeginInvoke(new EventHandler(HiddenMenuFrameManager_AlwaysShowMenuChanged), new object[] {sender, e}); - return; - } - _alwaysShowMenu = - ApplicationEnvironment.PreferencesSettingsRoot.GetSubSettings("Appearance").GetBoolean(SatelliteApplicationForm.SHOW_FRAME_KEY, false); - UpdateMenuVisibility(); - _form.Update(); - _commandShowMenu.Latched = _alwaysShowMenu; - - Command commandMenu = ApplicationManager.CommandManager.Get(CommandId.Menu); - if (commandMenu != null) - commandMenu.On = !_alwaysShowMenu; - } - - - public void AddOwnedForm(Form f) - { - User32.SendMessage(_form.Handle, WM.ACTIVATE, new UIntPtr(1), IntPtr.Zero ) ; - } - - /// - /// Restore normal painting. - /// - public void RemoveOwnedForm(Form f) - { - } - - } + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/SplitterTrackingIndicator.cs b/src/managed/OpenLiveWriter.ApplicationFramework/SplitterTrackingIndicator.cs index 76d83348..870626c4 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/SplitterTrackingIndicator.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/SplitterTrackingIndicator.cs @@ -13,210 +13,210 @@ using Project31.CoreServices; namespace Project31.ApplicationFramework { - /// - /// Provides a "tracking indicator" for use in splitter bars. - /// - internal class SplitterTrackingIndicator - { - /// - /// SRCCOPY ROP. - /// - private const int SRCCOPY = 0x00cc0020; + /// + /// Provides a "tracking indicator" for use in splitter bars. + /// + internal class SplitterTrackingIndicator + { + /// + /// SRCCOPY ROP. + /// + private const int SRCCOPY = 0x00cc0020; - /// - /// DCX_PARENTCLIP option for GetDCEx. - /// - private const int DCX_PARENTCLIP = 0x00000020; + /// + /// DCX_PARENTCLIP option for GetDCEx. + /// + private const int DCX_PARENTCLIP = 0x00000020; - /// - /// Valid indicator. Used to ensure that calls to Begin, Update and End are valid when - /// they are made. - /// - private bool valid = false; + /// + /// Valid indicator. Used to ensure that calls to Begin, Update and End are valid when + /// they are made. + /// + private bool valid = false; - /// - /// Control into which the tracking indicator will be drawn. - /// - private Control control; + /// + /// Control into which the tracking indicator will be drawn. + /// + private Control control; - /// - /// Graphics object for the control into which the tracking indicator will be drawn. - /// - private Graphics controlGraphics; + /// + /// Graphics object for the control into which the tracking indicator will be drawn. + /// + private Graphics controlGraphics; - /// - /// DC for the control into which the tracking indicator will be drawn. - /// - private IntPtr controlDC; + /// + /// DC for the control into which the tracking indicator will be drawn. + /// + private IntPtr controlDC; - /// - /// The capture bitmap. Used to capture the portion of the control that is being - /// overwritten by the tracking indicator so that it can be restored when the - /// tracking indicator is moved to a new location. - /// - private Bitmap captureBitmap; + /// + /// The capture bitmap. Used to capture the portion of the control that is being + /// overwritten by the tracking indicator so that it can be restored when the + /// tracking indicator is moved to a new location. + /// + private Bitmap captureBitmap; - /// - /// Last capture location where the tracking indicator was drawn. - /// - private Point lastCaptureLocation; + /// + /// Last capture location where the tracking indicator was drawn. + /// + private Point lastCaptureLocation; - /// - /// The tracking indicator bitmap. - /// - private Bitmap trackingIndicatorBitmap; + /// + /// The tracking indicator bitmap. + /// + private Bitmap trackingIndicatorBitmap; - /// - /// DllImport of Win32 GetDCEx. - /// - [DllImport("user32.dll")] - public static extern IntPtr GetDCEx(IntPtr hWnd, IntPtr region, System.Int32 dw); + /// + /// DllImport of Win32 GetDCEx. + /// + [DllImport("user32.dll")] + public static extern IntPtr GetDCEx(IntPtr hWnd, IntPtr region, System.Int32 dw); - /// - /// DllImport of GDI BitBlt. - /// - [DllImport("gdi32.dll")] - private static extern bool BitBlt( IntPtr hdcDest, // handle to destination DC (device context) - int nXDest, // x-coord of destination upper-left corner - int nYDest, // y-coord of destination upper-left corner - int nWidth, // width of destination rectangle - int nHeight, // height of destination rectangle - IntPtr hdcSrc, // handle to source DC - int nXSrc, // x-coordinate of source upper-left corner - int nYSrc, // y-coordinate of source upper-left corner - System.Int32 dwRop);// raster operation code + /// + /// DllImport of GDI BitBlt. + /// + [DllImport("gdi32.dll")] + private static extern bool BitBlt( IntPtr hdcDest, // handle to destination DC (device context) + int nXDest, // x-coord of destination upper-left corner + int nYDest, // y-coord of destination upper-left corner + int nWidth, // width of destination rectangle + int nHeight, // height of destination rectangle + IntPtr hdcSrc, // handle to source DC + int nXSrc, // x-coordinate of source upper-left corner + int nYSrc, // y-coordinate of source upper-left corner + System.Int32 dwRop);// raster operation code - /// - /// DllImport of Win32 ReleaseDC. - /// - [System.Runtime.InteropServices.DllImportAttribute("user32.dll")] - private static extern bool ReleaseDC(IntPtr hWnd, IntPtr dc); + /// + /// DllImport of Win32 ReleaseDC. + /// + [System.Runtime.InteropServices.DllImportAttribute("user32.dll")] + private static extern bool ReleaseDC(IntPtr hWnd, IntPtr dc); - /// - /// Initializes a new instance of the SplitterTrackingIndicator class. - /// - public SplitterTrackingIndicator() - { - } + /// + /// Initializes a new instance of the SplitterTrackingIndicator class. + /// + public SplitterTrackingIndicator() + { + } - /// - /// Begin a tracking indicator in the specified control using the specified rectangle. - /// - /// The control into which the tracking indicator will be drawn. - /// Rectangle structure that represents the tracking indicator rectangle, relative to the upper-left corner of the control into which it will be drawn. - public void Begin(Control control, Rectangle rectangle) - { - // Can't Begin twice. - Debug.Assert(!valid, "Invalid nested Begin", "You must first call the End method of a SplitterTrackingIndicator before calling its Begin method again."); - if (valid) - End(); + /// + /// Begin a tracking indicator in the specified control using the specified rectangle. + /// + /// The control into which the tracking indicator will be drawn. + /// Rectangle structure that represents the tracking indicator rectangle, relative to the upper-left corner of the control into which it will be drawn. + public void Begin(Control control, Rectangle rectangle) + { + // Can't Begin twice. + Debug.Assert(!valid, "Invalid nested Begin", "You must first call the End method of a SplitterTrackingIndicator before calling its Begin method again."); + if (valid) + End(); - // Save away the control. We need this so we can call ReleaseDC later on. - this.control = control; + // Save away the control. We need this so we can call ReleaseDC later on. + this.control = control; - // Get a DC for the "visible region" the specified control. Children are not clipped - // for this DC, which allows us to draw the tracking indicator over them. - controlDC = GetDCEx(control.Handle, System.IntPtr.Zero, DCX_PARENTCLIP); + // Get a DC for the "visible region" the specified control. Children are not clipped + // for this DC, which allows us to draw the tracking indicator over them. + controlDC = GetDCEx(control.Handle, System.IntPtr.Zero, DCX_PARENTCLIP); - // Get a graphics object for the DC. - controlGraphics = Graphics.FromHdc(controlDC); + // Get a graphics object for the DC. + controlGraphics = Graphics.FromHdc(controlDC); - // Instantiate the capture bitmap. - captureBitmap = new Bitmap(rectangle.Width, rectangle.Height); + // Instantiate the capture bitmap. + captureBitmap = new Bitmap(rectangle.Width, rectangle.Height); - // Instantiate and paint the tracking indicator bitmap. - trackingIndicatorBitmap = new Bitmap(rectangle.Width, rectangle.Height); - Graphics trackingIndicatorBitmapGraphics = Graphics.FromImage(trackingIndicatorBitmap); - HatchBrush hatchBrush = new HatchBrush( HatchStyle.Percent50, - Color.FromArgb(128, Color.Black), - Color.FromArgb(128, Color.White)); - trackingIndicatorBitmapGraphics.FillRectangle(hatchBrush, new Rectangle(0, 0, rectangle.Width, rectangle.Height)); - hatchBrush.Dispose(); - trackingIndicatorBitmapGraphics.Dispose(); + // Instantiate and paint the tracking indicator bitmap. + trackingIndicatorBitmap = new Bitmap(rectangle.Width, rectangle.Height); + Graphics trackingIndicatorBitmapGraphics = Graphics.FromImage(trackingIndicatorBitmap); + HatchBrush hatchBrush = new HatchBrush( HatchStyle.Percent50, + Color.FromArgb(128, Color.Black), + Color.FromArgb(128, Color.White)); + trackingIndicatorBitmapGraphics.FillRectangle(hatchBrush, new Rectangle(0, 0, rectangle.Width, rectangle.Height)); + hatchBrush.Dispose(); + trackingIndicatorBitmapGraphics.Dispose(); - // Draw the new tracking indicator. - DrawTrackingIndicator(rectangle.Location); + // Draw the new tracking indicator. + DrawTrackingIndicator(rectangle.Location); - // Valid now. - valid = true; - } + // Valid now. + valid = true; + } - /// - /// Update the location of the tracking indicator. - /// - /// The new location of the tracking indicator. - public void Update(Point location) - { - // Can't Update without a Begin. - Debug.Assert(valid, "Invalid Update", "You must first call the Begin method of a SplitterTrackingIndicator before calling its Update method."); - if (!valid) - return; + /// + /// Update the location of the tracking indicator. + /// + /// The new location of the tracking indicator. + public void Update(Point location) + { + // Can't Update without a Begin. + Debug.Assert(valid, "Invalid Update", "You must first call the Begin method of a SplitterTrackingIndicator before calling its Update method."); + if (!valid) + return; - // Undraw the last tracking indicator. - UndrawLastTrackingIndicator(); + // Undraw the last tracking indicator. + UndrawLastTrackingIndicator(); - // Draw the new tracking indicator. - DrawTrackingIndicator(location); - } + // Draw the new tracking indicator. + DrawTrackingIndicator(location); + } - /// - /// End the tracking indicator. - /// - public void End() - { - // Can't Update without a Begin. - Debug.Assert(valid, "Invalid End", "You must first call the Begin method of a SplitterTrackingIndicator before calling its End method."); - if (!valid) - return; + /// + /// End the tracking indicator. + /// + public void End() + { + // Can't Update without a Begin. + Debug.Assert(valid, "Invalid End", "You must first call the Begin method of a SplitterTrackingIndicator before calling its End method."); + if (!valid) + return; - // Undraw the last tracking indicator. - UndrawLastTrackingIndicator(); + // Undraw the last tracking indicator. + UndrawLastTrackingIndicator(); - // Cleanup the capture bitmap. - captureBitmap.Dispose(); + // Cleanup the capture bitmap. + captureBitmap.Dispose(); - // Dispose of the graphics context and DC for the control. - controlGraphics.Dispose(); - ReleaseDC(control.Handle, controlDC); + // Dispose of the graphics context and DC for the control. + controlGraphics.Dispose(); + ReleaseDC(control.Handle, controlDC); - // Not valid anymore. - valid = false; - } + // Not valid anymore. + valid = false; + } - /// - /// "Undraw" the last tracking indicator. - /// - private void UndrawLastTrackingIndicator() - { - controlGraphics.DrawImageUnscaled(captureBitmap, lastCaptureLocation); - } + /// + /// "Undraw" the last tracking indicator. + /// + private void UndrawLastTrackingIndicator() + { + controlGraphics.DrawImageUnscaled(captureBitmap, lastCaptureLocation); + } - /// - /// Draw the tracking indicator. - /// - private void DrawTrackingIndicator(Point location) - { - // BitBlt the contents of the specified rectangle of the control to the capture bitmap. - Graphics captureBitmapGraphics = Graphics.FromImage(captureBitmap); - System.IntPtr captureBitmapDC = captureBitmapGraphics.GetHdc(); - BitBlt( captureBitmapDC, // handle to destination DC (device context) - 0, // x-coord of destination upper-left corner - 0, // y-coord of destination upper-left corner - captureBitmap.Width, // width of destination rectangle - captureBitmap.Height, // height of destination rectangle - controlDC, // handle to source DC - location.X, // x-coordinate of source upper-left corner - location.Y, // y-coordinate of source upper-left corner - SRCCOPY); // raster operation code - captureBitmapGraphics.ReleaseHdc(captureBitmapDC); - captureBitmapGraphics.Dispose(); + /// + /// Draw the tracking indicator. + /// + private void DrawTrackingIndicator(Point location) + { + // BitBlt the contents of the specified rectangle of the control to the capture bitmap. + Graphics captureBitmapGraphics = Graphics.FromImage(captureBitmap); + System.IntPtr captureBitmapDC = captureBitmapGraphics.GetHdc(); + BitBlt( captureBitmapDC, // handle to destination DC (device context) + 0, // x-coord of destination upper-left corner + 0, // y-coord of destination upper-left corner + captureBitmap.Width, // width of destination rectangle + captureBitmap.Height, // height of destination rectangle + controlDC, // handle to source DC + location.X, // x-coordinate of source upper-left corner + location.Y, // y-coordinate of source upper-left corner + SRCCOPY); // raster operation code + captureBitmapGraphics.ReleaseHdc(captureBitmapDC); + captureBitmapGraphics.Dispose(); - // Draw the tracking indicator bitmap. - controlGraphics.DrawImageUnscaled(trackingIndicatorBitmap, location); + // Draw the tracking indicator bitmap. + controlGraphics.DrawImageUnscaled(trackingIndicatorBitmap, location); - // Remember the last capture location. UndrawLastTrackingIndicator uses this value - // to undraw this tracking indicator at this location. - lastCaptureLocation = location; - } - } + // Remember the last capture location. UndrawLastTrackingIndicator uses this value + // to undraw this tracking indicator at this location. + lastCaptureLocation = location; + } + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/TabLightweightControl.cs b/src/managed/OpenLiveWriter.ApplicationFramework/TabLightweightControl.cs index 12a7c63d..37eac0d1 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/TabLightweightControl.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/TabLightweightControl.cs @@ -1154,7 +1154,6 @@ namespace OpenLiveWriter.ApplicationFramework #endregion Private Methods & Properties - #region Accessibility protected override void AddAccessibleControlsToList(ArrayList list) { diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/TabPageCommandBarLightweightControl.cs b/src/managed/OpenLiveWriter.ApplicationFramework/TabPageCommandBarLightweightControl.cs index 021437ad..a5fe127e 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/TabPageCommandBarLightweightControl.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/TabPageCommandBarLightweightControl.cs @@ -11,93 +11,93 @@ using System.Windows.Forms; namespace Project31.ApplicationFramework { - /// - /// ApplicationCommandBar lightweight control. Provides the CommandBarLightweightControl for - /// the ApplicationWorkspace. - /// - public class TabPageCommandBarLightweightControl : CommandBarLightweightControl - { - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; + /// + /// ApplicationCommandBar lightweight control. Provides the CommandBarLightweightControl for + /// the ApplicationWorkspace. + /// + public class TabPageCommandBarLightweightControl : CommandBarLightweightControl + { + /// + /// Required designer variable. + /// + private System.ComponentModel.Container components = null; - /// - /// Initializes a new instance of the ApplicationCommandBarLightweightControl class. - /// - public TabPageCommandBarLightweightControl() - { - // This call is required by the Windows.Forms Form Designer. - InitializeComponent(); - } + /// + /// Initializes a new instance of the ApplicationCommandBarLightweightControl class. + /// + public TabPageCommandBarLightweightControl() + { + // This call is required by the Windows.Forms Form Designer. + InitializeComponent(); + } - /// - /// Initializes a new instance of the ApplicationCommandBarLightweightControl class. - /// - /// - public TabPageCommandBarLightweightControl(System.ComponentModel.IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); - } + /// + /// Initializes a new instance of the ApplicationCommandBarLightweightControl class. + /// + /// + public TabPageCommandBarLightweightControl(System.ComponentModel.IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - components = new System.ComponentModel.Container(); - } - #endregion + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + } + #endregion - /// - /// Raises the Paint event. - /// - /// A PaintEventArgs that contains the event data. - protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) - { - // Fill the background. - if (ApplicationManager.ApplicationStyle.TabPageCommandBarTopColor == ApplicationManager.ApplicationStyle.TabPageCommandBarBottomColor) - using (SolidBrush solidBrush = new SolidBrush(ApplicationManager.ApplicationStyle.TabPageCommandBarTopColor)) - e.Graphics.FillRectangle(solidBrush, VirtualClientRectangle); - else - using (LinearGradientBrush linearGradientBrush = new LinearGradientBrush(VirtualClientRectangle, ApplicationManager.ApplicationStyle.TabPageCommandBarTopColor, ApplicationManager.ApplicationStyle.TabPageCommandBarBottomColor, LinearGradientMode.Vertical)) - e.Graphics.FillRectangle(linearGradientBrush, VirtualClientRectangle); + /// + /// Raises the Paint event. + /// + /// A PaintEventArgs that contains the event data. + protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) + { + // Fill the background. + if (ApplicationManager.ApplicationStyle.TabPageCommandBarTopColor == ApplicationManager.ApplicationStyle.TabPageCommandBarBottomColor) + using (SolidBrush solidBrush = new SolidBrush(ApplicationManager.ApplicationStyle.TabPageCommandBarTopColor)) + e.Graphics.FillRectangle(solidBrush, VirtualClientRectangle); + else + using (LinearGradientBrush linearGradientBrush = new LinearGradientBrush(VirtualClientRectangle, ApplicationManager.ApplicationStyle.TabPageCommandBarTopColor, ApplicationManager.ApplicationStyle.TabPageCommandBarBottomColor, LinearGradientMode.Vertical)) + e.Graphics.FillRectangle(linearGradientBrush, VirtualClientRectangle); - // Draw the bottom line highlight color. - using (SolidBrush solidBrush = new SolidBrush(ApplicationManager.ApplicationStyle.TabPageCommandBarHighlightColor)) - e.Graphics.FillRectangle(solidBrush, 0, 0, 1, VirtualHeight-1); + // Draw the bottom line highlight color. + using (SolidBrush solidBrush = new SolidBrush(ApplicationManager.ApplicationStyle.TabPageCommandBarHighlightColor)) + e.Graphics.FillRectangle(solidBrush, 0, 0, 1, VirtualHeight-1); - // Draw the bottom line lowlight color. - using (SolidBrush solidBrush = new SolidBrush(ApplicationManager.ApplicationStyle.TabPageCommandBarLowlightColor)) - e.Graphics.FillRectangle(solidBrush, 0, VirtualHeight-2, VirtualWidth, 1); + // Draw the bottom line lowlight color. + using (SolidBrush solidBrush = new SolidBrush(ApplicationManager.ApplicationStyle.TabPageCommandBarLowlightColor)) + e.Graphics.FillRectangle(solidBrush, 0, VirtualHeight-2, VirtualWidth, 1); - // Draw the bottom line highlight color. - using (SolidBrush solidBrush = new SolidBrush(ApplicationManager.ApplicationStyle.TabPageCommandBarHighlightColor)) - e.Graphics.FillRectangle(solidBrush, 0, VirtualHeight-1, VirtualWidth, 1); + // Draw the bottom line highlight color. + using (SolidBrush solidBrush = new SolidBrush(ApplicationManager.ApplicationStyle.TabPageCommandBarHighlightColor)) + e.Graphics.FillRectangle(solidBrush, 0, VirtualHeight-1, VirtualWidth, 1); - // Call the base class's method so that registered delegates receive the event. - base.OnPaint(e); - } - } + // Call the base class's method so that registered delegates receive the event. + base.OnPaint(e); + } + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/TabSelectorLightweightControl.cs b/src/managed/OpenLiveWriter.ApplicationFramework/TabSelectorLightweightControl.cs index 50b7abce..9e3cbbda 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/TabSelectorLightweightControl.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/TabSelectorLightweightControl.cs @@ -372,12 +372,12 @@ namespace OpenLiveWriter.ApplicationFramework // With localized tab text, we can't afford to waste any space /* - tabWidth += PAD*4; - if (!bitmapRectangle.IsEmpty) - bitmapRectangle.X += PAD*2; - if (!textLayoutRectangle.IsEmpty) - textLayoutRectangle.X += PAD*2; - */ + tabWidth += PAD*4; + if (!bitmapRectangle.IsEmpty) + bitmapRectangle.X += PAD*2; + if (!textLayoutRectangle.IsEmpty) + textLayoutRectangle.X += PAD*2; + */ } // Set the virtual size. @@ -508,44 +508,44 @@ namespace OpenLiveWriter.ApplicationFramework graphics.FillRectangle(linearGradientBrush, faceRectangle); #if THREEDEE - // Draw the highlight inside the tab selector. - Color highlightColor; - if (tabEntry.IsSelected) - highlightColor = TabEntry.TabPageControl.ApplicationStyle.ActiveTabHighlightColor; - else - highlightColor = TabEntry.TabPageControl.ApplicationStyle.InactiveTabHighlightColor; - using (SolidBrush solidBrush = new SolidBrush(highlightColor)) - { - // Draw the top edge. - graphics.FillRectangle( solidBrush, - faceRectangle.X, - faceRectangle.Y, - faceRectangle.Width-1, - 1); + // Draw the highlight inside the tab selector. + Color highlightColor; + if (tabEntry.IsSelected) + highlightColor = TabEntry.TabPageControl.ApplicationStyle.ActiveTabHighlightColor; + else + highlightColor = TabEntry.TabPageControl.ApplicationStyle.InactiveTabHighlightColor; + using (SolidBrush solidBrush = new SolidBrush(highlightColor)) + { + // Draw the top edge. + graphics.FillRectangle( solidBrush, + faceRectangle.X, + faceRectangle.Y, + faceRectangle.Width-1, + 1); - // Draw the left edge. - graphics.FillRectangle( solidBrush, - faceRectangle.X, - faceRectangle.Y+1, - 1, - faceRectangle.Height-(tabEntry.IsSelected ? 2 : 1)); - } + // Draw the left edge. + graphics.FillRectangle( solidBrush, + faceRectangle.X, + faceRectangle.Y+1, + 1, + faceRectangle.Height-(tabEntry.IsSelected ? 2 : 1)); + } - // Draw the lowlight inside the tab selector. - Color lowlightColor; - if (tabEntry.IsSelected) - lowlightColor = TabEntry.TabPageControl.ApplicationStyle.ActiveTabLowlightColor; - else - lowlightColor = TabEntry.TabPageControl.ApplicationStyle.InactiveTabLowlightColor; - using (SolidBrush solidBrush = new SolidBrush(lowlightColor)) - { - // Draw the right edge. - graphics.FillRectangle( solidBrush, - faceRectangle.Right-1, - faceRectangle.Y+1, - 1, - faceRectangle.Height-(tabEntry.IsSelected ? 2 : 1)); - } + // Draw the lowlight inside the tab selector. + Color lowlightColor; + if (tabEntry.IsSelected) + lowlightColor = TabEntry.TabPageControl.ApplicationStyle.ActiveTabLowlightColor; + else + lowlightColor = TabEntry.TabPageControl.ApplicationStyle.InactiveTabLowlightColor; + using (SolidBrush solidBrush = new SolidBrush(lowlightColor)) + { + // Draw the right edge. + graphics.FillRectangle( solidBrush, + faceRectangle.Right-1, + faceRectangle.Y+1, + 1, + faceRectangle.Height-(tabEntry.IsSelected ? 2 : 1)); + } #endif // Draw the edges of the tab selector. diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/TabWorkPaneLightweightControl.cs b/src/managed/OpenLiveWriter.ApplicationFramework/TabWorkPaneLightweightControl.cs index 64ec5de7..6958a4a7 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/TabWorkPaneLightweightControl.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/TabWorkPaneLightweightControl.cs @@ -14,149 +14,149 @@ using Project31.CoreServices; namespace Project31.ApplicationFramework { - /// - /// - /// - internal class TabWorkPaneLightweightControl : LightweightControl - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components; + /// + /// + /// + internal class TabWorkPaneLightweightControl : LightweightControl + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components; - // The control list. - private ArrayList tabControls = new ArrayList(); + // The control list. + private ArrayList tabControls = new ArrayList(); - /// - /// Initializes a new instance of the TabWorkPaneLightweightControl class. - /// - public TabWorkPaneLightweightControl(System.ComponentModel.IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); - } + /// + /// Initializes a new instance of the TabWorkPaneLightweightControl class. + /// + public TabWorkPaneLightweightControl(System.ComponentModel.IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); + } - /// - /// Initializes a new instance of the TabWorkPaneLightweightControl class. - /// - public TabWorkPaneLightweightControl() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); - } + /// + /// Initializes a new instance of the TabWorkPaneLightweightControl class. + /// + public TabWorkPaneLightweightControl() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); + } - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); - } + } - /// - /// - /// - /// The tab number. - /// The control for the tab number. - public void SetTab(int tabNumber, Control tabControl) - { + /// + /// + /// + /// The tab number. + /// The control for the tab number. + public void SetTab(int tabNumber, Control tabControl) + { #if false - if (control != null && Parent != null && Parent.Controls.Contains(control)) - Parent.Controls.Remove(control); - control = value; - PerformLayout(); - Invalidate(); + if (control != null && Parent != null && Parent.Controls.Contains(control)) + Parent.Controls.Remove(control); + control = value; + PerformLayout(); + Invalidate(); #endif - } + } - public void RemoveTabControl(int tab) - { + public void RemoveTabControl(int tab) + { #if false - if (control != null && Parent != null && Parent.Controls.Contains(control)) - Parent.Controls.Remove(control); - control = value; - PerformLayout(); - Invalidate(); + if (control != null && Parent != null && Parent.Controls.Contains(control)) + Parent.Controls.Remove(control); + control = value; + PerformLayout(); + Invalidate(); #endif - } + } - public void SetActiveTab(int tab) - { - } + public void SetActiveTab(int tab) + { + } - /// - /// Gets the command bar rectangle. - /// - private Rectangle CommandBarRectangle - { - get - { - return new Rectangle( 0, - 0, - VirtualWidth, - 20); - } - } + /// + /// Gets the command bar rectangle. + /// + private Rectangle CommandBarRectangle + { + get + { + return new Rectangle( 0, + 0, + VirtualWidth, + 20); + } + } - /// - /// Gets the control rectangle. - /// - private Rectangle ControlRectangle - { - get - { - return new Rectangle( 0, - 20, - VirtualWidth, - VirtualHeight-20); - } - } + /// + /// Gets the control rectangle. + /// + private Rectangle ControlRectangle + { + get + { + return new Rectangle( 0, + 20, + VirtualWidth, + VirtualHeight-20); + } + } - /// - /// Raises the Layout event. - /// - /// An EventArgs that contains the event data. - protected override void OnLayout(System.EventArgs e) - { - // Call the base class's method so registered delegates receive the event. - base.OnLayout(e); + /// + /// Raises the Layout event. + /// + /// An EventArgs that contains the event data. + protected override void OnLayout(System.EventArgs e) + { + // Call the base class's method so registered delegates receive the event. + base.OnLayout(e); - // Set the bounds of the command bar lightweight control. - //commandBarLightweightControl.VirtualBounds = CommandBarRectangle; + // Set the bounds of the command bar lightweight control. + //commandBarLightweightControl.VirtualBounds = CommandBarRectangle; #if false - // - if (control != null) - { - if (Parent != null && !Parent.Controls.Contains(control)) - { - Parent.Controls.Add(control); - if (control is ICommandBarProvider) - commandBarLightweightControl.CommandBarDefinition = ((ICommandBarProvider)control).CommandBarDefinition; - } - control.Bounds = VirtualClientRectangleToParent(ControlRectangle); - } + // + if (control != null) + { + if (Parent != null && !Parent.Controls.Contains(control)) + { + Parent.Controls.Add(control); + if (control is ICommandBarProvider) + commandBarLightweightControl.CommandBarDefinition = ((ICommandBarProvider)control).CommandBarDefinition; + } + control.Bounds = VirtualClientRectangleToParent(ControlRectangle); + } #endif - } + } - /// - /// Raises the Paint event. - /// - /// A PaintEventArgs that contains the event data. - protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) - { + /// + /// Raises the Paint event. + /// + /// A PaintEventArgs that contains the event data. + protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) + { - // Call the base class's method so that registered delegates receive the event. - base.OnPaint(e); - } - } + // Call the base class's method so that registered delegates receive the event. + base.OnPaint(e); + } + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/VerticalTrackingIndicator.cs b/src/managed/OpenLiveWriter.ApplicationFramework/VerticalTrackingIndicator.cs index ce210db6..faf13bc0 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/VerticalTrackingIndicator.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/VerticalTrackingIndicator.cs @@ -13,210 +13,210 @@ using Project31.CoreServices; namespace Project31.ApplicationFramework { - /// - /// Provides a "vertical tracking indicator" for use in splitter bars. - /// - internal class VerticalTrackingIndicator - { - /// - /// SRCCOPY ROP. - /// - private const int SRCCOPY = 0x00cc0020; + /// + /// Provides a "vertical tracking indicator" for use in splitter bars. + /// + internal class VerticalTrackingIndicator + { + /// + /// SRCCOPY ROP. + /// + private const int SRCCOPY = 0x00cc0020; - /// - /// DCX_PARENTCLIP option for GetDCEx. - /// - private const int DCX_PARENTCLIP = 0x00000020; + /// + /// DCX_PARENTCLIP option for GetDCEx. + /// + private const int DCX_PARENTCLIP = 0x00000020; - /// - /// Valid indicator. Used to ensure that calls to Begin, Update and End are valid when - /// they are made. - /// - private bool valid = false; + /// + /// Valid indicator. Used to ensure that calls to Begin, Update and End are valid when + /// they are made. + /// + private bool valid = false; - /// - /// Control into which the tracking indicator will be drawn. - /// - private Control control; + /// + /// Control into which the tracking indicator will be drawn. + /// + private Control control; - /// - /// Graphics object for the control into which the tracking indicator will be drawn. - /// - private Graphics controlGraphics; + /// + /// Graphics object for the control into which the tracking indicator will be drawn. + /// + private Graphics controlGraphics; - /// - /// DC for the control into which the tracking indicator will be drawn. - /// - private IntPtr controlDC; + /// + /// DC for the control into which the tracking indicator will be drawn. + /// + private IntPtr controlDC; - /// - /// The capture bitmap. Used to capture the portion of the control that is being - /// overwritten by the tracking indicator so that it can be restored when the - /// tracking indicator is moved to a new location. - /// - private Bitmap captureBitmap; + /// + /// The capture bitmap. Used to capture the portion of the control that is being + /// overwritten by the tracking indicator so that it can be restored when the + /// tracking indicator is moved to a new location. + /// + private Bitmap captureBitmap; - /// - /// Last capture location where the tracking indicator was drawn. - /// - private Point lastCaptureLocation; + /// + /// Last capture location where the tracking indicator was drawn. + /// + private Point lastCaptureLocation; - /// - /// The tracking indicator bitmap. - /// - private Bitmap trackingIndicatorBitmap; + /// + /// The tracking indicator bitmap. + /// + private Bitmap trackingIndicatorBitmap; - /// - /// DllImport of Win32 GetDCEx. - /// - [DllImport("user32.dll")] - public static extern IntPtr GetDCEx(IntPtr hWnd, IntPtr region, System.Int32 dw); + /// + /// DllImport of Win32 GetDCEx. + /// + [DllImport("user32.dll")] + public static extern IntPtr GetDCEx(IntPtr hWnd, IntPtr region, System.Int32 dw); - /// - /// DllImport of GDI BitBlt. - /// - [DllImport("gdi32.dll")] - private static extern bool BitBlt( IntPtr hdcDest, // handle to destination DC (device context) - int nXDest, // x-coord of destination upper-left corner - int nYDest, // y-coord of destination upper-left corner - int nWidth, // width of destination rectangle - int nHeight, // height of destination rectangle - IntPtr hdcSrc, // handle to source DC - int nXSrc, // x-coordinate of source upper-left corner - int nYSrc, // y-coordinate of source upper-left corner - System.Int32 dwRop);// raster operation code + /// + /// DllImport of GDI BitBlt. + /// + [DllImport("gdi32.dll")] + private static extern bool BitBlt( IntPtr hdcDest, // handle to destination DC (device context) + int nXDest, // x-coord of destination upper-left corner + int nYDest, // y-coord of destination upper-left corner + int nWidth, // width of destination rectangle + int nHeight, // height of destination rectangle + IntPtr hdcSrc, // handle to source DC + int nXSrc, // x-coordinate of source upper-left corner + int nYSrc, // y-coordinate of source upper-left corner + System.Int32 dwRop);// raster operation code - /// - /// DllImport of Win32 ReleaseDC. - /// - [System.Runtime.InteropServices.DllImportAttribute("user32.dll")] - private static extern bool ReleaseDC(IntPtr hWnd, IntPtr dc); + /// + /// DllImport of Win32 ReleaseDC. + /// + [System.Runtime.InteropServices.DllImportAttribute("user32.dll")] + private static extern bool ReleaseDC(IntPtr hWnd, IntPtr dc); - /// - /// Initializes a new instance of the VerticalTrackingIndicator class. - /// - public VerticalTrackingIndicator() - { - } + /// + /// Initializes a new instance of the VerticalTrackingIndicator class. + /// + public VerticalTrackingIndicator() + { + } - /// - /// Begin a tracking indicator in the specified control using the specified rectangle. - /// - /// The control into which the tracking indicator will be drawn. - /// Rectangle structure that represents the tracking indicator rectangle, relative to the upper-left corner of the control into which it will be drawn. - public void Begin(Control control, Rectangle rectangle) - { - // Can't Begin twice. - Debug.Assert(!valid, "Invalid nested Begin", "You must first call the End method of a VerticalTrackingIndicator before calling its Begin method again."); - if (valid) - End(); + /// + /// Begin a tracking indicator in the specified control using the specified rectangle. + /// + /// The control into which the tracking indicator will be drawn. + /// Rectangle structure that represents the tracking indicator rectangle, relative to the upper-left corner of the control into which it will be drawn. + public void Begin(Control control, Rectangle rectangle) + { + // Can't Begin twice. + Debug.Assert(!valid, "Invalid nested Begin", "You must first call the End method of a VerticalTrackingIndicator before calling its Begin method again."); + if (valid) + End(); - // Save away the control. We need this so we can call ReleaseDC later on. - this.control = control; + // Save away the control. We need this so we can call ReleaseDC later on. + this.control = control; - // Get a DC for the "visible region" the specified control. Children are not clipped - // for this DC, which allows us to draw the tracking indicator over them. - controlDC = GetDCEx(control.Handle, System.IntPtr.Zero, DCX_PARENTCLIP); + // Get a DC for the "visible region" the specified control. Children are not clipped + // for this DC, which allows us to draw the tracking indicator over them. + controlDC = GetDCEx(control.Handle, System.IntPtr.Zero, DCX_PARENTCLIP); - // Get a graphics object for the DC. - controlGraphics = Graphics.FromHdc(controlDC); + // Get a graphics object for the DC. + controlGraphics = Graphics.FromHdc(controlDC); - // Instantiate the capture bitmap. - captureBitmap = new Bitmap(rectangle.Width, rectangle.Height); + // Instantiate the capture bitmap. + captureBitmap = new Bitmap(rectangle.Width, rectangle.Height); - // Instantiate and paint the tracking indicator bitmap. - trackingIndicatorBitmap = new Bitmap(rectangle.Width, rectangle.Height); - Graphics trackingIndicatorBitmapGraphics = Graphics.FromImage(trackingIndicatorBitmap); - HatchBrush hatchBrush = new HatchBrush( HatchStyle.Percent50, - Color.FromArgb(128, Color.Black), - Color.FromArgb(128, Color.White)); - trackingIndicatorBitmapGraphics.FillRectangle(hatchBrush, new Rectangle(0, 0, rectangle.Width, rectangle.Height)); - hatchBrush.Dispose(); - trackingIndicatorBitmapGraphics.Dispose(); + // Instantiate and paint the tracking indicator bitmap. + trackingIndicatorBitmap = new Bitmap(rectangle.Width, rectangle.Height); + Graphics trackingIndicatorBitmapGraphics = Graphics.FromImage(trackingIndicatorBitmap); + HatchBrush hatchBrush = new HatchBrush( HatchStyle.Percent50, + Color.FromArgb(128, Color.Black), + Color.FromArgb(128, Color.White)); + trackingIndicatorBitmapGraphics.FillRectangle(hatchBrush, new Rectangle(0, 0, rectangle.Width, rectangle.Height)); + hatchBrush.Dispose(); + trackingIndicatorBitmapGraphics.Dispose(); - // Draw the new tracking indicator. - DrawTrackingIndicator(rectangle.Location); + // Draw the new tracking indicator. + DrawTrackingIndicator(rectangle.Location); - // Valid now. - valid = true; - } + // Valid now. + valid = true; + } - /// - /// Update the location of the tracking indicator. - /// - /// The new location of the tracking indicator. - public void Update(Point location) - { - // Can't Update without a Begin. - Debug.Assert(valid, "Invalid Update", "You must first call the Begin method of a VerticalTrackingIndicator before calling its Update method."); - if (!valid) - return; + /// + /// Update the location of the tracking indicator. + /// + /// The new location of the tracking indicator. + public void Update(Point location) + { + // Can't Update without a Begin. + Debug.Assert(valid, "Invalid Update", "You must first call the Begin method of a VerticalTrackingIndicator before calling its Update method."); + if (!valid) + return; - // Undraw the last tracking indicator. - UndrawLastTrackingIndicator(); + // Undraw the last tracking indicator. + UndrawLastTrackingIndicator(); - // Draw the new tracking indicator. - DrawTrackingIndicator(location); - } + // Draw the new tracking indicator. + DrawTrackingIndicator(location); + } - /// - /// End the tracking indicator. - /// - public void End() - { - // Can't Update without a Begin. - Debug.Assert(valid, "Invalid End", "You must first call the Begin method of a VerticalTrackingIndicator before calling its End method."); - if (!valid) - return; + /// + /// End the tracking indicator. + /// + public void End() + { + // Can't Update without a Begin. + Debug.Assert(valid, "Invalid End", "You must first call the Begin method of a VerticalTrackingIndicator before calling its End method."); + if (!valid) + return; - // Undraw the last tracking indicator. - UndrawLastTrackingIndicator(); + // Undraw the last tracking indicator. + UndrawLastTrackingIndicator(); - // Cleanup the capture bitmap. - captureBitmap.Dispose(); + // Cleanup the capture bitmap. + captureBitmap.Dispose(); - // Dispose of the graphics context and DC for the control. - controlGraphics.Dispose(); - ReleaseDC(control.Handle, controlDC); + // Dispose of the graphics context and DC for the control. + controlGraphics.Dispose(); + ReleaseDC(control.Handle, controlDC); - // Not valid anymore. - valid = false; - } + // Not valid anymore. + valid = false; + } - /// - /// "Undraw" the last tracking indicator. - /// - private void UndrawLastTrackingIndicator() - { - controlGraphics.DrawImageUnscaled(captureBitmap, lastCaptureLocation); - } + /// + /// "Undraw" the last tracking indicator. + /// + private void UndrawLastTrackingIndicator() + { + controlGraphics.DrawImageUnscaled(captureBitmap, lastCaptureLocation); + } - /// - /// Draw the tracking indicator. - /// - private void DrawTrackingIndicator(Point location) - { - // BitBlt the contents of the specified rectangle of the control to the capture bitmap. - Graphics captureBitmapGraphics = Graphics.FromImage(captureBitmap); - System.IntPtr captureBitmapDC = captureBitmapGraphics.GetHdc(); - BitBlt( captureBitmapDC, // handle to destination DC (device context) - 0, // x-coord of destination upper-left corner - 0, // y-coord of destination upper-left corner - captureBitmap.Width, // width of destination rectangle - captureBitmap.Height, // height of destination rectangle - controlDC, // handle to source DC - location.X, // x-coordinate of source upper-left corner - location.Y, // y-coordinate of source upper-left corner - SRCCOPY); // raster operation code - captureBitmapGraphics.ReleaseHdc(captureBitmapDC); - captureBitmapGraphics.Dispose(); + /// + /// Draw the tracking indicator. + /// + private void DrawTrackingIndicator(Point location) + { + // BitBlt the contents of the specified rectangle of the control to the capture bitmap. + Graphics captureBitmapGraphics = Graphics.FromImage(captureBitmap); + System.IntPtr captureBitmapDC = captureBitmapGraphics.GetHdc(); + BitBlt( captureBitmapDC, // handle to destination DC (device context) + 0, // x-coord of destination upper-left corner + 0, // y-coord of destination upper-left corner + captureBitmap.Width, // width of destination rectangle + captureBitmap.Height, // height of destination rectangle + controlDC, // handle to source DC + location.X, // x-coordinate of source upper-left corner + location.Y, // y-coordinate of source upper-left corner + SRCCOPY); // raster operation code + captureBitmapGraphics.ReleaseHdc(captureBitmapDC); + captureBitmapGraphics.Dispose(); - // Draw the tracking indicator bitmap. - controlGraphics.DrawImageUnscaled(trackingIndicatorBitmap, location); + // Draw the tracking indicator bitmap. + controlGraphics.DrawImageUnscaled(trackingIndicatorBitmap, location); - // Remember the last capture location. UndrawLastTrackingIndicator uses this value - // to undraw this tracking indicator at this location. - lastCaptureLocation = location; - } - } + // Remember the last capture location. UndrawLastTrackingIndicator uses this value + // to undraw this tracking indicator at this location. + lastCaptureLocation = location; + } + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/WorkPaneLightweightControl.cs b/src/managed/OpenLiveWriter.ApplicationFramework/WorkPaneLightweightControl.cs index adf3a548..0a38ef9e 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/WorkPaneLightweightControl.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/WorkPaneLightweightControl.cs @@ -13,277 +13,277 @@ using Project31.CoreServices; namespace Project31.ApplicationFramework { - /// - /// Lightweight work pane control. - /// - internal class WorkPaneLightweightControl : LightweightControl - { - /// - /// Top left bitmap. - /// - private static Bitmap topLeftBitmap = ResourceHelper.LoadAssemblyResourceBitmap("Images.Application.WorkPaneTopLeft.png"); + /// + /// Lightweight work pane control. + /// + internal class WorkPaneLightweightControl : LightweightControl + { + /// + /// Top left bitmap. + /// + private static Bitmap topLeftBitmap = ResourceHelper.LoadAssemblyResourceBitmap("Images.Application.WorkPaneTopLeft.png"); - /// - /// Top right bitmap. - /// - private static Bitmap topRightBitmap = ResourceHelper.LoadAssemblyResourceBitmap("Images.Application.WorkPaneTopRight.png"); + /// + /// Top right bitmap. + /// + private static Bitmap topRightBitmap = ResourceHelper.LoadAssemblyResourceBitmap("Images.Application.WorkPaneTopRight.png"); - /// - /// Bottom left bitmap. - /// - private static Bitmap bottomLeftBitmap = ResourceHelper.LoadAssemblyResourceBitmap("Images.Application.WorkPaneBottomLeft.png"); + /// + /// Bottom left bitmap. + /// + private static Bitmap bottomLeftBitmap = ResourceHelper.LoadAssemblyResourceBitmap("Images.Application.WorkPaneBottomLeft.png"); - /// - /// Bottom right bitmap. - /// - private static Bitmap bottomRightBitmap = ResourceHelper.LoadAssemblyResourceBitmap("Images.Application.WorkPaneBottomRight.png"); + /// + /// Bottom right bitmap. + /// + private static Bitmap bottomRightBitmap = ResourceHelper.LoadAssemblyResourceBitmap("Images.Application.WorkPaneBottomRight.png"); - /// - /// Top bitmap. - /// - private static Bitmap topBitmap = ResourceHelper.LoadAssemblyResourceBitmap("Images.Application.WorkPaneTop.png"); + /// + /// Top bitmap. + /// + private static Bitmap topBitmap = ResourceHelper.LoadAssemblyResourceBitmap("Images.Application.WorkPaneTop.png"); - /// - /// Bottom bitmap. - /// - private static Bitmap bottomBitmap = ResourceHelper.LoadAssemblyResourceBitmap("Images.Application.WorkPaneBottom.png"); + /// + /// Bottom bitmap. + /// + private static Bitmap bottomBitmap = ResourceHelper.LoadAssemblyResourceBitmap("Images.Application.WorkPaneBottom.png"); - /// - /// Left bitmap. - /// - private static Bitmap leftBitmap = ResourceHelper.LoadAssemblyResourceBitmap("Images.Application.WorkPaneLeft.png"); + /// + /// Left bitmap. + /// + private static Bitmap leftBitmap = ResourceHelper.LoadAssemblyResourceBitmap("Images.Application.WorkPaneLeft.png"); - /// - /// Right bitmap. - /// - private static Bitmap rightBitmap = ResourceHelper.LoadAssemblyResourceBitmap("Images.Application.WorkPaneRight.png"); + /// + /// Right bitmap. + /// + private static Bitmap rightBitmap = ResourceHelper.LoadAssemblyResourceBitmap("Images.Application.WorkPaneRight.png"); - /// - /// The command bar lightweight control. - /// - private Project31.ApplicationFramework.CommandBarLightweightControl commandBarLightweightControl; + /// + /// The command bar lightweight control. + /// + private Project31.ApplicationFramework.CommandBarLightweightControl commandBarLightweightControl; - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components; + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components; - /// - /// The control. - /// - private Control control; + /// + /// The control. + /// + private Control control; - /// - /// Gets or sets the control. - /// - public Control Control - { - get - { - return control; - } - set - { - if (control != null && Parent != null && Parent.Controls.Contains(control)) - Parent.Controls.Remove(control); - control = value; - PerformLayout(); - Invalidate(); - } - } + /// + /// Gets or sets the control. + /// + public Control Control + { + get + { + return control; + } + set + { + if (control != null && Parent != null && Parent.Controls.Contains(control)) + Parent.Controls.Remove(control); + control = value; + PerformLayout(); + Invalidate(); + } + } - /// - /// Initializes a new instance of the WorkPaneLightweightControl class. - /// - public WorkPaneLightweightControl(System.ComponentModel.IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); - } + /// + /// Initializes a new instance of the WorkPaneLightweightControl class. + /// + public WorkPaneLightweightControl(System.ComponentModel.IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); + } - /// - /// Initializes a new instance of the WorkPaneLightweightControl class. - /// - public WorkPaneLightweightControl() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); - } + /// + /// Initializes a new instance of the WorkPaneLightweightControl class. + /// + public WorkPaneLightweightControl() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); + } - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - this.commandBarLightweightControl = new Project31.ApplicationFramework.CommandBarLightweightControl(this.components); - // - // commandBarLightweightControl - // - this.commandBarLightweightControl.LightweightControlContainerControl = this; + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.commandBarLightweightControl = new Project31.ApplicationFramework.CommandBarLightweightControl(this.components); + // + // commandBarLightweightControl + // + this.commandBarLightweightControl.LightweightControlContainerControl = this; - } + } - /// - /// Gets the command bar rectangle. - /// - private Rectangle CommandBarRectangle - { - get - { - return new Rectangle( topLeftBitmap.Width, - topBitmap.Height, - VirtualWidth-(topLeftBitmap.Width+topRightBitmap.Width), - topLeftBitmap.Height-topBitmap.Height); - } - } + /// + /// Gets the command bar rectangle. + /// + private Rectangle CommandBarRectangle + { + get + { + return new Rectangle( topLeftBitmap.Width, + topBitmap.Height, + VirtualWidth-(topLeftBitmap.Width+topRightBitmap.Width), + topLeftBitmap.Height-topBitmap.Height); + } + } - /// - /// Gets the control rectangle. - /// - private Rectangle ControlRectangle - { - get - { - return new Rectangle( leftBitmap.Width, - topLeftBitmap.Height, - VirtualWidth-(leftBitmap.Width+rightBitmap.Width+1), - VirtualHeight-(topLeftBitmap.Height+bottomBitmap.Height+1)); - } - } + /// + /// Gets the control rectangle. + /// + private Rectangle ControlRectangle + { + get + { + return new Rectangle( leftBitmap.Width, + topLeftBitmap.Height, + VirtualWidth-(leftBitmap.Width+rightBitmap.Width+1), + VirtualHeight-(topLeftBitmap.Height+bottomBitmap.Height+1)); + } + } - /// - /// Raises the Layout event. - /// - /// An EventArgs that contains the event data. - protected override void OnLayout(System.EventArgs e) - { - // Call the base class's method so registered delegates receive the event. - base.OnLayout(e); + /// + /// Raises the Layout event. + /// + /// An EventArgs that contains the event data. + protected override void OnLayout(System.EventArgs e) + { + // Call the base class's method so registered delegates receive the event. + base.OnLayout(e); - // Set the bounds of the command bar lightweight control. - commandBarLightweightControl.VirtualBounds = CommandBarRectangle; + // Set the bounds of the command bar lightweight control. + commandBarLightweightControl.VirtualBounds = CommandBarRectangle; - if (control != null) - { - if (Parent != null && !Parent.Controls.Contains(control)) - { - Parent.Controls.Add(control); - if (control is ICommandBarProvider) - commandBarLightweightControl.CommandBarDefinition = ((ICommandBarProvider)control).CommandBarDefinition; - } - control.Bounds = VirtualClientRectangleToParent(ControlRectangle); - } - } + if (control != null) + { + if (Parent != null && !Parent.Controls.Contains(control)) + { + Parent.Controls.Add(control); + if (control is ICommandBarProvider) + commandBarLightweightControl.CommandBarDefinition = ((ICommandBarProvider)control).CommandBarDefinition; + } + control.Bounds = VirtualClientRectangleToParent(ControlRectangle); + } + } - /// - /// Raises the Paint event. - /// - /// A PaintEventArgs that contains the event data. - protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) - { - // Create a rectangle representing the header area to be filled. - Rectangle headerRectangle = new Rectangle( 0, - 0, - VirtualWidth-(topLeftBitmap.Width+topRightBitmap.Width), - topLeftBitmap.Height-1); + /// + /// Raises the Paint event. + /// + /// A PaintEventArgs that contains the event data. + protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) + { + // Create a rectangle representing the header area to be filled. + Rectangle headerRectangle = new Rectangle( 0, + 0, + VirtualWidth-(topLeftBitmap.Width+topRightBitmap.Width), + topLeftBitmap.Height-1); - if (!headerRectangle.IsEmpty) - { - // Construct an offscreen bitmap. - Bitmap bitmap = new Bitmap(headerRectangle.Width, headerRectangle.Height); - Graphics bitmapGraphics = Graphics.FromImage(bitmap); - LinearGradientBrush linearGradientBrush = new LinearGradientBrush( headerRectangle, - Color.FromArgb(231, 231, 232), - Color.FromArgb(185, 218, 233), - LinearGradientMode.Horizontal); - bitmapGraphics.FillRectangle(linearGradientBrush, headerRectangle); - linearGradientBrush.Dispose(); - bitmapGraphics.Dispose(); - e.Graphics.DrawImageUnscaled(bitmap, topLeftBitmap.Width, 1); - } + if (!headerRectangle.IsEmpty) + { + // Construct an offscreen bitmap. + Bitmap bitmap = new Bitmap(headerRectangle.Width, headerRectangle.Height); + Graphics bitmapGraphics = Graphics.FromImage(bitmap); + LinearGradientBrush linearGradientBrush = new LinearGradientBrush( headerRectangle, + Color.FromArgb(231, 231, 232), + Color.FromArgb(185, 218, 233), + LinearGradientMode.Horizontal); + bitmapGraphics.FillRectangle(linearGradientBrush, headerRectangle); + linearGradientBrush.Dispose(); + bitmapGraphics.Dispose(); + e.Graphics.DrawImageUnscaled(bitmap, topLeftBitmap.Width, 1); + } - // Fill in the client rectangle. - Rectangle clientArea = new Rectangle( leftBitmap.Width-1, - topLeftBitmap.Height, - VirtualWidth-((leftBitmap.Width-1)+rightBitmap.Width), - VirtualHeight-(topLeftBitmap.Height+bottomBitmap.Height)); - e.Graphics.FillRectangle(System.Drawing.Brushes.White, clientArea); + // Fill in the client rectangle. + Rectangle clientArea = new Rectangle( leftBitmap.Width-1, + topLeftBitmap.Height, + VirtualWidth-((leftBitmap.Width-1)+rightBitmap.Width), + VirtualHeight-(topLeftBitmap.Height+bottomBitmap.Height)); + e.Graphics.FillRectangle(System.Drawing.Brushes.White, clientArea); - // Draw the border. - DrawBorder(e.Graphics); + // Draw the border. + DrawBorder(e.Graphics); - // Call the base class's method so that registered delegates receive the event. - base.OnPaint(e); - } + // Call the base class's method so that registered delegates receive the event. + base.OnPaint(e); + } - /// - /// Helper to draw the work pane border. - /// - /// Graphics context into which the border is drawn. - private void DrawBorder(Graphics graphics) - { - // Draw the top left corner of the border. - if (topLeftBitmap != null) - graphics.DrawImageUnscaled(topLeftBitmap, 0, 0); + /// + /// Helper to draw the work pane border. + /// + /// Graphics context into which the border is drawn. + private void DrawBorder(Graphics graphics) + { + // Draw the top left corner of the border. + if (topLeftBitmap != null) + graphics.DrawImageUnscaled(topLeftBitmap, 0, 0); - // Draw the top right corner of the border. - if (topRightBitmap != null) - graphics.DrawImageUnscaled(topRightBitmap, VirtualWidth-topRightBitmap.Width, 0); + // Draw the top right corner of the border. + if (topRightBitmap != null) + graphics.DrawImageUnscaled(topRightBitmap, VirtualWidth-topRightBitmap.Width, 0); - // Draw the bottom left corner of the border. - if (bottomLeftBitmap != null) - graphics.DrawImageUnscaled(bottomLeftBitmap, 0, VirtualHeight-bottomLeftBitmap.Height); + // Draw the bottom left corner of the border. + if (bottomLeftBitmap != null) + graphics.DrawImageUnscaled(bottomLeftBitmap, 0, VirtualHeight-bottomLeftBitmap.Height); - // Draw the bottom right corner of the border. - if (bottomRightBitmap != null) - graphics.DrawImageUnscaled(bottomRightBitmap, VirtualWidth-bottomRightBitmap.Width, VirtualHeight-bottomRightBitmap.Height); + // Draw the bottom right corner of the border. + if (bottomRightBitmap != null) + graphics.DrawImageUnscaled(bottomRightBitmap, VirtualWidth-bottomRightBitmap.Width, VirtualHeight-bottomRightBitmap.Height); - // Fill the top. - if (topBitmap != null) - { - Rectangle fillRectangle = new Rectangle(topLeftBitmap.Width, - 0, - VirtualWidth-(topLeftBitmap.Width+topRightBitmap.Width), - topBitmap.Height); - GraphicsHelper.TileFillUnscaledImageHorizontally(graphics, topBitmap, fillRectangle); - } + // Fill the top. + if (topBitmap != null) + { + Rectangle fillRectangle = new Rectangle(topLeftBitmap.Width, + 0, + VirtualWidth-(topLeftBitmap.Width+topRightBitmap.Width), + topBitmap.Height); + GraphicsHelper.TileFillUnscaledImageHorizontally(graphics, topBitmap, fillRectangle); + } - // Fill the left. - if (leftBitmap != null) - { - Rectangle fillRectangle = new Rectangle(0, - topLeftBitmap.Height, - leftBitmap.Width, - VirtualHeight-(topLeftBitmap.Height+bottomLeftBitmap.Height)); - GraphicsHelper.TileFillUnscaledImageVertically(graphics, leftBitmap, fillRectangle); - } + // Fill the left. + if (leftBitmap != null) + { + Rectangle fillRectangle = new Rectangle(0, + topLeftBitmap.Height, + leftBitmap.Width, + VirtualHeight-(topLeftBitmap.Height+bottomLeftBitmap.Height)); + GraphicsHelper.TileFillUnscaledImageVertically(graphics, leftBitmap, fillRectangle); + } - // Fill the right. - if (rightBitmap != null) - { - Rectangle fillRectangle = new Rectangle(VirtualWidth-rightBitmap.Width, - topRightBitmap.Height, - rightBitmap.Width, - VirtualHeight-(topRightBitmap.Height+bottomRightBitmap.Height)); - GraphicsHelper.TileFillUnscaledImageVertically(graphics, rightBitmap, fillRectangle); - } + // Fill the right. + if (rightBitmap != null) + { + Rectangle fillRectangle = new Rectangle(VirtualWidth-rightBitmap.Width, + topRightBitmap.Height, + rightBitmap.Width, + VirtualHeight-(topRightBitmap.Height+bottomRightBitmap.Height)); + GraphicsHelper.TileFillUnscaledImageVertically(graphics, rightBitmap, fillRectangle); + } - // Fill the bottom. - if (bottomBitmap != null) - { - Rectangle fillRectangle = new Rectangle(bottomLeftBitmap.Width, - VirtualHeight-bottomBitmap.Height, - VirtualWidth-(bottomLeftBitmap.Width+bottomRightBitmap.Width), - bottomBitmap.Height); - GraphicsHelper.TileFillUnscaledImageHorizontally(graphics, bottomBitmap, fillRectangle); - } - } - } + // Fill the bottom. + if (bottomBitmap != null) + { + Rectangle fillRectangle = new Rectangle(bottomLeftBitmap.Width, + VirtualHeight-bottomBitmap.Height, + VirtualWidth-(bottomLeftBitmap.Width+bottomRightBitmap.Width), + bottomBitmap.Height); + GraphicsHelper.TileFillUnscaledImageHorizontally(graphics, bottomBitmap, fillRectangle); + } + } + } } diff --git a/src/managed/OpenLiveWriter.ApplicationFramework/WorkspaceColumnPaneEmptyControl.cs b/src/managed/OpenLiveWriter.ApplicationFramework/WorkspaceColumnPaneEmptyControl.cs index 10bbe0e7..86ffa9ce 100644 --- a/src/managed/OpenLiveWriter.ApplicationFramework/WorkspaceColumnPaneEmptyControl.cs +++ b/src/managed/OpenLiveWriter.ApplicationFramework/WorkspaceColumnPaneEmptyControl.cs @@ -10,54 +10,54 @@ using System.Windows.Forms; namespace Project31.ApplicationFramework { - /// - /// Summary description for WorkspaceColumnPaneEmptyControl. - /// - public class WorkspaceColumnPaneEmptyControl : System.Windows.Forms.UserControl - { - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; + /// + /// Summary description for WorkspaceColumnPaneEmptyControl. + /// + public class WorkspaceColumnPaneEmptyControl : System.Windows.Forms.UserControl + { + /// + /// Required designer variable. + /// + private System.ComponentModel.Container components = null; - public WorkspaceColumnPaneEmptyControl() - { - // This call is required by the Windows.Forms Form Designer. - InitializeComponent(); + public WorkspaceColumnPaneEmptyControl() + { + // This call is required by the Windows.Forms Form Designer. + InitializeComponent(); - // TODO: Add any initialization after the InitializeComponent call + // TODO: Add any initialization after the InitializeComponent call - } + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // WorkspaceColumnPaneEmptyControl - // - this.BackColor = System.Drawing.SystemColors.Window; - this.Name = "WorkspaceColumnPaneEmptyControl"; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // WorkspaceColumnPaneEmptyControl + // + this.BackColor = System.Drawing.SystemColors.Window; + this.Name = "WorkspaceColumnPaneEmptyControl"; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.BlogClient/Blog.cs b/src/managed/OpenLiveWriter.BlogClient/Blog.cs index d890943f..e5667ff3 100644 --- a/src/managed/OpenLiveWriter.BlogClient/Blog.cs +++ b/src/managed/OpenLiveWriter.BlogClient/Blog.cs @@ -417,7 +417,6 @@ namespace OpenLiveWriter.BlogClient } } - public BlogPost[] GetRecentPosts(int maxPosts, bool includeCategories) { BlogPost[] recentPosts = BlogClient.GetRecentPosts(_settings.HostBlogId, maxPosts, includeCategories, null); @@ -599,7 +598,6 @@ namespace OpenLiveWriter.BlogClient return blogPost; } - public void DeletePost(string postId, bool isPage, bool publish) { if (isPage) diff --git a/src/managed/OpenLiveWriter.BlogClient/BlogClientUIContext.cs b/src/managed/OpenLiveWriter.BlogClient/BlogClientUIContext.cs index 4681d017..e8887a2d 100644 --- a/src/managed/OpenLiveWriter.BlogClient/BlogClientUIContext.cs +++ b/src/managed/OpenLiveWriter.BlogClient/BlogClientUIContext.cs @@ -40,7 +40,6 @@ namespace OpenLiveWriter.BlogClient private ISynchronizeInvoke _invokeTarget; } - /// /// Class used to install and remove (on dispose) the UI context for the currently /// running thread. To enforce the idiom of install/remove this is the ONLY @@ -88,7 +87,6 @@ namespace OpenLiveWriter.BlogClient } - /// /// Class which allows blog-client code at any level in the stack and on /// any thread to show a modal dialog on the main UI thread. In order to diff --git a/src/managed/OpenLiveWriter.BlogClient/BlogProviderButtonDescription.cs b/src/managed/OpenLiveWriter.BlogClient/BlogProviderButtonDescription.cs index e587e268..97f5016d 100644 --- a/src/managed/OpenLiveWriter.BlogClient/BlogProviderButtonDescription.cs +++ b/src/managed/OpenLiveWriter.BlogClient/BlogProviderButtonDescription.cs @@ -215,7 +215,6 @@ namespace OpenLiveWriter.BlogClient } } - public class BlogProviderButtonNotification : IBlogProviderButtonNotification { public BlogProviderButtonNotification(TimeSpan pollingInterval, string notificationText, Bitmap notificationImage, bool clearNotificationOnClick) diff --git a/src/managed/OpenLiveWriter.BlogClient/BlogSettings.cs b/src/managed/OpenLiveWriter.BlogClient/BlogSettings.cs index 63ef004d..983f6ef2 100644 --- a/src/managed/OpenLiveWriter.BlogClient/BlogSettings.cs +++ b/src/managed/OpenLiveWriter.BlogClient/BlogSettings.cs @@ -468,7 +468,6 @@ namespace OpenLiveWriter.BlogClient } private BlogCredentials _blogCredentials; - public IBlogProviderButtonDescription[] ButtonDescriptions { get @@ -622,7 +621,7 @@ namespace OpenLiveWriter.BlogClient /// /// Make sure to own _keywordsLock before calling this property /// - private XmlSettingsPersister KeywordPersister + private XmlSettingsPersister KeywordPersister { get { @@ -696,7 +695,7 @@ namespace OpenLiveWriter.BlogClient /// /// The path to an xml file in the %APPDATA% folder that contains keywords for the current blog /// - private string KeywordPath + private string KeywordPath { get { @@ -711,7 +710,6 @@ namespace OpenLiveWriter.BlogClient } } - private BlogPostCategory[] LegacyCategories { get @@ -839,7 +837,6 @@ namespace OpenLiveWriter.BlogClient private const string PAGE_PARENT_ID = "ParentId"; private readonly static object _pagesLock = new object(); - public FileUploadSupport FileUploadSupport { get @@ -886,9 +883,9 @@ namespace OpenLiveWriter.BlogClient } /// - /// Delete this profile - /// - public void Delete() + /// Delete this profile + /// + public void Delete() { // dispose the profile Dispose(); @@ -1005,7 +1002,6 @@ namespace OpenLiveWriter.BlogClient Trace.Fail(String.Format(CultureInfo.InvariantCulture, "Failed to dispose BlogSettings!!! BlogId: {0} // BlogName: {1}", Id, BlogName)); } - public IBlogFileUploadSettings FileUpload { get @@ -1028,7 +1024,6 @@ namespace OpenLiveWriter.BlogClient } private SettingsPersisterHelper _settings; - #region Class Configuration (location of settings, etc) public static SettingsPersisterHelper GetProviderButtonsSettingsKey(string blogId) @@ -1180,7 +1175,6 @@ namespace OpenLiveWriter.BlogClient private SettingsPersisterHelper _settingsRoot; } - public class BlogFileUploadSettings : IBlogFileUploadSettings, IDisposable { public BlogFileUploadSettings(SettingsPersisterHelper settings) @@ -1188,7 +1182,6 @@ namespace OpenLiveWriter.BlogClient _settings = settings; } - public string GetValue(string name) { return _settings.GetString(name, String.Empty); diff --git a/src/managed/OpenLiveWriter.BlogClient/Clients/AtomEntry.cs b/src/managed/OpenLiveWriter.BlogClient/Clients/AtomEntry.cs index e9194c79..1f27b6e1 100644 --- a/src/managed/OpenLiveWriter.BlogClient/Clients/AtomEntry.cs +++ b/src/managed/OpenLiveWriter.BlogClient/Clients/AtomEntry.cs @@ -243,16 +243,16 @@ T (?\d{2}) (\. (?\d+) )? (? - (?Z) - | - (? - (?[+-]) - (?\d{2}) - (?: - \:? - (?\d{2}) - )? - ) + (?Z) + | + (? + (?[+-]) + (?\d{2}) + (?: + \:? + (?\d{2}) + )? + ) ) $", RegexOptions.IgnorePatternWhitespace); diff --git a/src/managed/OpenLiveWriter.BlogClient/Clients/AtomProtocolVersion.cs b/src/managed/OpenLiveWriter.BlogClient/Clients/AtomProtocolVersion.cs index 925a95b3..fcddd275 100644 --- a/src/managed/OpenLiveWriter.BlogClient/Clients/AtomProtocolVersion.cs +++ b/src/managed/OpenLiveWriter.BlogClient/Clients/AtomProtocolVersion.cs @@ -247,11 +247,11 @@ namespace OpenLiveWriter.BlogClient.Clients private bool SchemesEqual(string scheme1, string scheme2) { /* - if (scheme1 == null) - scheme1 = ""; - if (scheme2 == null) - scheme2 = ""; - */ + if (scheme1 == null) + scheme1 = ""; + if (scheme2 == null) + scheme2 = ""; + */ return string.Equals(scheme1, scheme2); } diff --git a/src/managed/OpenLiveWriter.BlogClient/Clients/BlogClientLoginControl.cs b/src/managed/OpenLiveWriter.BlogClient/Clients/BlogClientLoginControl.cs index b38088a1..22b09927 100644 --- a/src/managed/OpenLiveWriter.BlogClient/Clients/BlogClientLoginControl.cs +++ b/src/managed/OpenLiveWriter.BlogClient/Clients/BlogClientLoginControl.cs @@ -211,7 +211,6 @@ namespace OpenLiveWriter.BlogClient.Clients set { checkBoxSavePassword.Checked = value; } } - public ICredentialsDomain Domain { get { return _domain; } diff --git a/src/managed/OpenLiveWriter.BlogClient/Clients/BlogClientManager.cs b/src/managed/OpenLiveWriter.BlogClient/Clients/BlogClientManager.cs index c72ca717..fe6d260d 100644 --- a/src/managed/OpenLiveWriter.BlogClient/Clients/BlogClientManager.cs +++ b/src/managed/OpenLiveWriter.BlogClient/Clients/BlogClientManager.cs @@ -98,12 +98,10 @@ namespace OpenLiveWriter.BlogClient.Clients blogClient.OverrideOptions(userOptions); } - // return the blog client return blogClient; } - private class OptionOverrideReader { public OptionOverrideReader(IDictionary optionOverrides) diff --git a/src/managed/OpenLiveWriter.BlogClient/Clients/BloggerAtomClient.cs b/src/managed/OpenLiveWriter.BlogClient/Clients/BloggerAtomClient.cs index a25b2a30..14586d73 100644 --- a/src/managed/OpenLiveWriter.BlogClient/Clients/BloggerAtomClient.cs +++ b/src/managed/OpenLiveWriter.BlogClient/Clients/BloggerAtomClient.cs @@ -955,7 +955,6 @@ namespace OpenLiveWriter.BlogClient.Clients ShowError(MessageId.BloggerError, TranslateError(error)); } - } throw new BlogClientAuthenticationException(error, TranslateError(error)); } diff --git a/src/managed/OpenLiveWriter.BlogClient/Clients/BloggerCompatibleClient.cs b/src/managed/OpenLiveWriter.BlogClient/Clients/BloggerCompatibleClient.cs index 873d50b2..599b2381 100644 --- a/src/managed/OpenLiveWriter.BlogClient/Clients/BloggerCompatibleClient.cs +++ b/src/managed/OpenLiveWriter.BlogClient/Clients/BloggerCompatibleClient.cs @@ -133,7 +133,6 @@ namespace OpenLiveWriter.BlogClient.Clients new XmlRpcBoolean(publish)); } - protected const string APP_KEY = "0123456789ABCDEF"; } } diff --git a/src/managed/OpenLiveWriter.BlogClient/Clients/CredentialsHelper.cs b/src/managed/OpenLiveWriter.BlogClient/Clients/CredentialsHelper.cs index 42796663..2444189e 100644 --- a/src/managed/OpenLiveWriter.BlogClient/Clients/CredentialsHelper.cs +++ b/src/managed/OpenLiveWriter.BlogClient/Clients/CredentialsHelper.cs @@ -118,109 +118,109 @@ namespace OpenLiveWriter.BlogClient.Clients } #if false - /// - /// Summary description for CredentialsHelper. - /// - public class CredentialsHelper - { - private CredentialsHelper() - { - } + /// + /// Summary description for CredentialsHelper. + /// + public class CredentialsHelper + { + private CredentialsHelper() + { + } - public static BlogCredentialsRefreshCallback GetRefreshCallback() - { - return new BlogCredentialsRefreshCallback(RefreshCredentials); - } + public static BlogCredentialsRefreshCallback GetRefreshCallback() + { + return new BlogCredentialsRefreshCallback(RefreshCredentials); + } - private static BlogCredentialsRefreshResult RefreshCredentials(IBlogClientUIContext owner, ref string username, ref string password, ref object authToken) - { - BlogCredentialsRefreshResult refreshResult; - if(authToken != null || - (username != String.Empty && username != null && password != String.Empty && password != null)) - { - refreshResult = BlogCredentialsRefreshResult.OK; - } - else - { - //Some of the required credential values are missing, so prompt for them if there is - //a UI context available - if(owner == null) - refreshResult = BlogCredentialsRefreshResult.Abort; - else - { - PromptHelper promptHelper = new PromptHelper(owner, ref username, ref password); - if(owner.InvokeRequired) - owner.Invoke(new InvokeInUIThreadDelegate(promptHelper.ShowPrompt), new object[0]); - else - promptHelper.ShowPrompt(); + private static BlogCredentialsRefreshResult RefreshCredentials(IBlogClientUIContext owner, ref string username, ref string password, ref object authToken) + { + BlogCredentialsRefreshResult refreshResult; + if(authToken != null || + (username != String.Empty && username != null && password != String.Empty && password != null)) + { + refreshResult = BlogCredentialsRefreshResult.OK; + } + else + { + //Some of the required credential values are missing, so prompt for them if there is + //a UI context available + if(owner == null) + refreshResult = BlogCredentialsRefreshResult.Abort; + else + { + PromptHelper promptHelper = new PromptHelper(owner, ref username, ref password); + if(owner.InvokeRequired) + owner.Invoke(new InvokeInUIThreadDelegate(promptHelper.ShowPrompt), new object[0]); + else + promptHelper.ShowPrompt(); - username = promptHelper.Username; - password = promptHelper.Password; - refreshResult = promptHelper.Result; - } - } + username = promptHelper.Username; + password = promptHelper.Password; + refreshResult = promptHelper.Result; + } + } - if(refreshResult != BlogCredentialsRefreshResult.Cancel && refreshResult != BlogCredentialsRefreshResult.Abort) - { - //save the login time in the authtoken - authToken = DateTime.Now; - } - return refreshResult; - } + if(refreshResult != BlogCredentialsRefreshResult.Cancel && refreshResult != BlogCredentialsRefreshResult.Abort) + { + //save the login time in the authtoken + authToken = DateTime.Now; + } + return refreshResult; + } - public class PromptHelper - { - private IWin32Window owner; - private string _username; - private string _password; - private BlogCredentialsRefreshResult _result; - public PromptHelper(IWin32Window owner, ref string username, ref string password) - { - this.owner = owner; - _username = username; - _password = password; - } + public class PromptHelper + { + private IWin32Window owner; + private string _username; + private string _password; + private BlogCredentialsRefreshResult _result; + public PromptHelper(IWin32Window owner, ref string username, ref string password) + { + this.owner = owner; + _username = username; + _password = password; + } - public void ShowPrompt() - { - BlogCredentialsRefreshResult refreshResult; - using (BlogClientLoginDialog form = new BlogClientLoginDialog()) - { - if(_username != null) - form.UserName = _username; - if(_password != null) - form.Password = _password; + public void ShowPrompt() + { + BlogCredentialsRefreshResult refreshResult; + using (BlogClientLoginDialog form = new BlogClientLoginDialog()) + { + if(_username != null) + form.UserName = _username; + if(_password != null) + form.Password = _password; - DialogResult dialogResult = form.ShowDialog(owner) ; - if (dialogResult == DialogResult.OK) - { - _username = form.UserName; - _password = form.Password; - refreshResult = form.SavePassword - ? BlogCredentialsRefreshResult.SaveUsernameAndPassword - : BlogCredentialsRefreshResult.SaveUsername; - } - else - refreshResult = BlogCredentialsRefreshResult.Cancel; - } - _result = refreshResult; - } + DialogResult dialogResult = form.ShowDialog(owner) ; + if (dialogResult == DialogResult.OK) + { + _username = form.UserName; + _password = form.Password; + refreshResult = form.SavePassword + ? BlogCredentialsRefreshResult.SaveUsernameAndPassword + : BlogCredentialsRefreshResult.SaveUsername; + } + else + refreshResult = BlogCredentialsRefreshResult.Cancel; + } + _result = refreshResult; + } - public string Username - { - get { return _username; } - } + public string Username + { + get { return _username; } + } - public string Password - { - get { return _password; } - } + public string Password + { + get { return _password; } + } - public BlogCredentialsRefreshResult Result - { - get { return _result; } - } - } - } + public BlogCredentialsRefreshResult Result + { + get { return _result; } + } + } + } #endif } diff --git a/src/managed/OpenLiveWriter.BlogClient/Clients/LiveJournalClient.cs b/src/managed/OpenLiveWriter.BlogClient/Clients/LiveJournalClient.cs index 8f74c50f..51d25c44 100644 --- a/src/managed/OpenLiveWriter.BlogClient/Clients/LiveJournalClient.cs +++ b/src/managed/OpenLiveWriter.BlogClient/Clients/LiveJournalClient.cs @@ -27,7 +27,6 @@ namespace OpenLiveWriter.BlogClient.Clients { } - protected override void ConfigureClientOptions(BlogClientOptions clientOptions) { clientOptions.SupportsFileUpload = true; @@ -137,7 +136,6 @@ namespace OpenLiveWriter.BlogClient.Clients return (BlogPost[])posts.ToArray(typeof(BlogPost)); } - public override string NewPost(string blogId, BlogPost post, INewCategoryContext newCategoryContext, bool publish) { if (!publish && !Options.SupportsPostAsDraft) @@ -159,7 +157,6 @@ namespace OpenLiveWriter.BlogClient.Clients return result.InnerText; } - public override bool EditPost(string blogId, BlogPost post, INewCategoryContext newCategoryContext, bool publish) { if (!publish && !Options.SupportsPostAsDraft) diff --git a/src/managed/OpenLiveWriter.BlogClient/Clients/MetaweblogClient.cs b/src/managed/OpenLiveWriter.BlogClient/Clients/MetaweblogClient.cs index 2fd39d12..457ac0ed 100644 --- a/src/managed/OpenLiveWriter.BlogClient/Clients/MetaweblogClient.cs +++ b/src/managed/OpenLiveWriter.BlogClient/Clients/MetaweblogClient.cs @@ -215,7 +215,6 @@ namespace OpenLiveWriter.BlogClient.Clients return null; } - public override BlogPost[] GetRecentPosts(string blogId, int maxPosts, bool includeCategories, DateTime? now) { // call the method @@ -422,7 +421,6 @@ namespace OpenLiveWriter.BlogClient.Clients return MetaweblogEditPost(blogId, post, publish); } - public override BlogPost GetPost(string blogId, string postId) { // call method @@ -734,7 +732,6 @@ namespace OpenLiveWriter.BlogClient.Clients return ParseCategories(result, "wp.suggestCategories"); } - private BlogPostCategory[] ParseCategories(XmlNode result, string methodName) { // parse the results @@ -1204,7 +1201,6 @@ namespace OpenLiveWriter.BlogClient.Clients } - protected virtual void BlogPostReadFilter(BlogPost blogPost) { } diff --git a/src/managed/OpenLiveWriter.BlogClient/Clients/SharePointClient.cs b/src/managed/OpenLiveWriter.BlogClient/Clients/SharePointClient.cs index 48efb2ea..db3e3a13 100644 --- a/src/managed/OpenLiveWriter.BlogClient/Clients/SharePointClient.cs +++ b/src/managed/OpenLiveWriter.BlogClient/Clients/SharePointClient.cs @@ -249,7 +249,6 @@ namespace OpenLiveWriter.BlogClient.Clients fileName = FileHelper.GetValidAnsiFileName(fileName, fileName.Length); - //calculate the ListService endpoint based on the API URL. Note that the postAPI URL format //changed between M1 and M2, so we need try to calculate the API URL using both formats. //TODO: Once we ship final and the M1 timebomb expires, we should drop the M1 check. diff --git a/src/managed/OpenLiveWriter.BlogClient/Clients/SixApartAtomClient.cs b/src/managed/OpenLiveWriter.BlogClient/Clients/SixApartAtomClient.cs index ccd9184b..892f4bf5 100644 --- a/src/managed/OpenLiveWriter.BlogClient/Clients/SixApartAtomClient.cs +++ b/src/managed/OpenLiveWriter.BlogClient/Clients/SixApartAtomClient.cs @@ -12,74 +12,74 @@ using OpenLiveWriter.Extensibility.BlogClient; namespace OpenLiveWriter.BlogClient.Clients { - [BlogClient("SixApartAtom")] - public class SixApartAtomClient : AtomClient - { - public SixApartAtomClient(Uri postApiUrl, IBlogCredentialsAccessor credentials, PostFormatOptions postFormatOptions) - : base(AtomProtocolVersion.V03, postApiUrl, credentials, postFormatOptions) - { - } + [BlogClient("SixApartAtom")] + public class SixApartAtomClient : AtomClient + { + public SixApartAtomClient(Uri postApiUrl, IBlogCredentialsAccessor credentials, PostFormatOptions postFormatOptions) + : base(AtomProtocolVersion.V03, postApiUrl, credentials, postFormatOptions) + { + } - public override bool VerifyCredentials() - { - // TODO - return true; - } + public override bool VerifyCredentials() + { + // TODO + return true; + } - public override BlogClientCapabilities Capabilities { get { return BlogClientCapabilities.Categories | BlogClientCapabilities.MultipleCategories; } } + public override BlogClientCapabilities Capabilities { get { return BlogClientCapabilities.Categories | BlogClientCapabilities.MultipleCategories; } } - public override BlogPostCategory[] GetCategories(string blogId) - { + public override BlogPostCategory[] GetCategories(string blogId) + { /* - // get the introspection doc that will lead us to the categories URI - XmlDocument insDoc = xmlRestRequestHelper.Get("http://www.typepad.com/t/atom/weblog", RequestFilter); + // get the introspection doc that will lead us to the categories URI + XmlDocument insDoc = xmlRestRequestHelper.Get("http://www.typepad.com/t/atom/weblog", RequestFilter); */ - throw new NotImplementedException(); - } + throw new NotImplementedException(); + } - protected override HttpRequestFilter RequestFilter - { - get - { - return new HttpRequestFilter(WsseFilter); - } - } + protected override HttpRequestFilter RequestFilter + { + get + { + return new HttpRequestFilter(WsseFilter); + } + } - protected override void Populate(BlogPost post, XmlNode node) - { - base.Populate(post, node); - XmlElement catEl = _atomVer.CreateCategoryElement(node.OwnerDocument, "flimflam"); - node.AppendChild(catEl); - } + protected override void Populate(BlogPost post, XmlNode node) + { + base.Populate(post, node); + XmlElement catEl = _atomVer.CreateCategoryElement(node.OwnerDocument, "flimflam"); + node.AppendChild(catEl); + } - private void WsseFilter(HttpWebRequest request) - { - string username = "joe@unknown.com";//Credentials.Username; - string password = "abc123";//Credentials.Password; + private void WsseFilter(HttpWebRequest request) + { + string username = "joe@unknown.com";//Credentials.Username; + string password = "abc123";//Credentials.Password; - string nonce = Guid.NewGuid().ToString("d"); - string created = DateTimeHelper.UtcNow.ToString("yyyy-MM-ddTHH:mm:ssZ", DateTimeFormatInfo.InvariantInfo); - byte[] stringToHash = Encoding.UTF8.GetBytes(nonce + created + password); - byte[] bytes = SHA1Managed.Create().ComputeHash(stringToHash); - string digest = Convert.ToBase64String(bytes); + string nonce = Guid.NewGuid().ToString("d"); + string created = DateTimeHelper.UtcNow.ToString("yyyy-MM-ddTHH:mm:ssZ", DateTimeFormatInfo.InvariantInfo); + byte[] stringToHash = Encoding.UTF8.GetBytes(nonce + created + password); + byte[] bytes = SHA1Managed.Create().ComputeHash(stringToHash); + string digest = Convert.ToBase64String(bytes); - string headerValue = string.Format("UsernameToken Username=\"{0}\", PasswordDigest=\"{1}\", Created=\"{2}\", Nonce=\"{3}\"", - username, - digest, - created, - nonce); - if (headerValue.IndexOfAny(new char[] {'\r', '\n'}) >= 0) - throw new BlogClientAuthenticationException("ProtocolViolation", "Protocol violation, EOL characters are not allowed in WSSE headers"); - request.Headers.Add("X-WSSE", headerValue); - } + string headerValue = string.Format("UsernameToken Username=\"{0}\", PasswordDigest=\"{1}\", Created=\"{2}\", Nonce=\"{3}\"", + username, + digest, + created, + nonce); + if (headerValue.IndexOfAny(new char[] {'\r', '\n'}) >= 0) + throw new BlogClientAuthenticationException("ProtocolViolation", "Protocol violation, EOL characters are not allowed in WSSE headers"); + request.Headers.Add("X-WSSE", headerValue); + } - protected override void EnsureLoggedIn() - { - } + protected override void EnsureLoggedIn() + { + } - public override BlogInfo[] GetUsersBlogs() - { - throw new NotImplementedException(); - } - } + public override BlogInfo[] GetUsersBlogs() + { + throw new NotImplementedException(); + } + } } diff --git a/src/managed/OpenLiveWriter.BlogClient/Clients/XmlRpcBlogClient.cs b/src/managed/OpenLiveWriter.BlogClient/Clients/XmlRpcBlogClient.cs index 7dbaad39..67324b3d 100644 --- a/src/managed/OpenLiveWriter.BlogClient/Clients/XmlRpcBlogClient.cs +++ b/src/managed/OpenLiveWriter.BlogClient/Clients/XmlRpcBlogClient.cs @@ -181,7 +181,6 @@ namespace OpenLiveWriter.BlogClient.Clients // so don't count on the code executing if the method is overriden! } - public virtual BlogPostCategory[] SuggestCategories(string blogId, string partialCategoryName) { throw new BlogClientMethodUnsupportedException("SuggestCategories"); @@ -280,7 +279,6 @@ namespace OpenLiveWriter.BlogClient.Clients protected abstract BlogClientProviderException ExceptionForFault(string faultCode, string faultString); - protected XmlRpcArray ArrayFromStrings(string[] strings) { ArrayList stringValues = new ArrayList(); @@ -297,7 +295,6 @@ namespace OpenLiveWriter.BlogClient.Clients return String.Empty; } - /// /// Parse a date returned from a weblog. Returns the parsed date as a UTC DateTime value. /// If the date does not have a timezone designator then it will be presumed to be in the diff --git a/src/managed/OpenLiveWriter.BlogClient/Detection/BlogEditingTemplateDetector.cs b/src/managed/OpenLiveWriter.BlogClient/Detection/BlogEditingTemplateDetector.cs index ebe7c74c..74027b5a 100644 --- a/src/managed/OpenLiveWriter.BlogClient/Detection/BlogEditingTemplateDetector.cs +++ b/src/managed/OpenLiveWriter.BlogClient/Detection/BlogEditingTemplateDetector.cs @@ -89,7 +89,6 @@ namespace OpenLiveWriter.BlogClient.Detection } - private IBlogClientUIContext _uiContext; public BlogEditingTemplateDetector(IBlogClientUIContext uiContext, Control parentControl, IBlogSettingsAccessor blogSettings, bool probeForManifest) @@ -672,7 +671,6 @@ namespace OpenLiveWriter.BlogClient.Detection BlogEditingTemplateStrategy templateStrategy = BlogEditingTemplateStrategies.GetTemplateStrategy(BlogEditingTemplateStrategies.StrategyType.FramedWysiwyg); - // execution context private Control _parentControl; private bool _contextSet = false; diff --git a/src/managed/OpenLiveWriter.BlogClient/Detection/BlogServiceDetector.cs b/src/managed/OpenLiveWriter.BlogClient/Detection/BlogServiceDetector.cs index c0f75979..6927c53a 100644 --- a/src/managed/OpenLiveWriter.BlogClient/Detection/BlogServiceDetector.cs +++ b/src/managed/OpenLiveWriter.BlogClient/Detection/BlogServiceDetector.cs @@ -576,9 +576,9 @@ namespace OpenLiveWriter.BlogClient.Detection } /*private string DiscoverPostApiUrl(string baseUrl, string blogPath) - { + { - }*/ + }*/ /// /// Verifies the user credentials and determines whether SharePoint is configure to use HTTP or MetaWeblog authentication diff --git a/src/managed/OpenLiveWriter.BlogClient/Detection/BlogSettingsDetector.cs b/src/managed/OpenLiveWriter.BlogClient/Detection/BlogSettingsDetector.cs index 766828b5..98a51a66 100644 --- a/src/managed/OpenLiveWriter.BlogClient/Detection/BlogSettingsDetector.cs +++ b/src/managed/OpenLiveWriter.BlogClient/Detection/BlogSettingsDetector.cs @@ -494,7 +494,6 @@ namespace OpenLiveWriter.BlogClient.Detection } } - private WriterEditingManifest SafeDownloadEditingManifest() { WriterEditingManifest editingManifest = null; @@ -565,5 +564,4 @@ namespace OpenLiveWriter.BlogClient.Detection } } - } diff --git a/src/managed/OpenLiveWriter.BlogClient/Detection/DisplayMessages/TempPostDeleteFailedDisplayMessage.cs b/src/managed/OpenLiveWriter.BlogClient/Detection/DisplayMessages/TempPostDeleteFailedDisplayMessage.cs index 82ea4139..f80215b2 100644 --- a/src/managed/OpenLiveWriter.BlogClient/Detection/DisplayMessages/TempPostDeleteFailedDisplayMessage.cs +++ b/src/managed/OpenLiveWriter.BlogClient/Detection/DisplayMessages/TempPostDeleteFailedDisplayMessage.cs @@ -6,72 +6,72 @@ using OpenLiveWriter.Controls; namespace OpenLiveWriter.BlogClient.Detection.DisplayMessages { - /// - /// Summary description for DeleteSingleItemDisplayMessage. - /// - public class TempPostDeleteFailedDisplayMessage : DisplayMessage - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for DeleteSingleItemDisplayMessage. + /// + public class TempPostDeleteFailedDisplayMessage : DisplayMessage + { + /// + /// Required designer variable. + /// + private Container components = null; - public TempPostDeleteFailedDisplayMessage(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public TempPostDeleteFailedDisplayMessage(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - // - // - // - } + // + // + // + } - public TempPostDeleteFailedDisplayMessage() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public TempPostDeleteFailedDisplayMessage() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // TempPostDeleteFailedDisplayMessage - // - this.Text = "The temporary post made to your blog to aid in style detection could not be deleted.\n\n" + - "You will need to delete this post manually."; - this.Title = "Unable to Delete Style Detection Post"; - this.Type = DisplayMessageType.Warning; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // TempPostDeleteFailedDisplayMessage + // + this.Text = "The temporary post made to your blog to aid in style detection could not be deleted.\n\n" + + "You will need to delete this post manually."; + this.Title = "Unable to Delete Style Detection Post"; + this.Type = DisplayMessageType.Warning; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.BlogClient/Detection/DisplayMessages/TempPostPermissionDisplayMessage.cs b/src/managed/OpenLiveWriter.BlogClient/Detection/DisplayMessages/TempPostPermissionDisplayMessage.cs index 28cfbf1c..a761b147 100644 --- a/src/managed/OpenLiveWriter.BlogClient/Detection/DisplayMessages/TempPostPermissionDisplayMessage.cs +++ b/src/managed/OpenLiveWriter.BlogClient/Detection/DisplayMessages/TempPostPermissionDisplayMessage.cs @@ -6,78 +6,78 @@ using OpenLiveWriter.Controls; namespace OpenLiveWriter.BlogClient.Detection.DisplayMessages { - /// - /// Summary description for TempPostPermissionDisplayMessage. - /// - public class TempPostPermissionDisplayMessage : DisplayMessage - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for TempPostPermissionDisplayMessage. + /// + public class TempPostPermissionDisplayMessage : DisplayMessage + { + /// + /// Required designer variable. + /// + private Container components = null; - public TempPostPermissionDisplayMessage(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public TempPostPermissionDisplayMessage(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - // - // - // - } + // + // + // + } - public TempPostPermissionDisplayMessage() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public TempPostPermissionDisplayMessage() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // TempPostPermissionDisplayMessage - // - this.Buttons = System.Windows.Forms.MessageBoxButtons.YesNo; - this.Text = @"{0} allows you to edit using the visual style of your + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // TempPostPermissionDisplayMessage + // + this.Buttons = System.Windows.Forms.MessageBoxButtons.YesNo; + this.Text = @"{0} allows you to edit using the visual style of your weblog. This lets you see what your posts will look like online while you are editing them. In order to enable this feature, Writer needs to create and delete a temporary post on your weblog. Would you like Writer to publish a temporary post to detect your weblog's style?"; - this.Title = "Allow Writer to Create a Temporary Post?"; - this.Type = OpenLiveWriter.Controls.DisplayMessageType.Question; + this.Title = "Allow Writer to Create a Temporary Post?"; + this.Type = OpenLiveWriter.Controls.DisplayMessageType.Question; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.BlogClient/Detection/DisplayMessages/TemplateDownloadFailedDisplayMessage.cs b/src/managed/OpenLiveWriter.BlogClient/Detection/DisplayMessages/TemplateDownloadFailedDisplayMessage.cs index adb1d361..d0e57dbe 100644 --- a/src/managed/OpenLiveWriter.BlogClient/Detection/DisplayMessages/TemplateDownloadFailedDisplayMessage.cs +++ b/src/managed/OpenLiveWriter.BlogClient/Detection/DisplayMessages/TemplateDownloadFailedDisplayMessage.cs @@ -6,72 +6,72 @@ using OpenLiveWriter.Controls; namespace OpenLiveWriter.BlogClient.Detection.DisplayMessages { - /// - /// Summary description for DeleteSingleItemDisplayMessage. - /// - public class TemplateDownloadFailedDisplayMessage : DisplayMessage - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for DeleteSingleItemDisplayMessage. + /// + public class TemplateDownloadFailedDisplayMessage : DisplayMessage + { + /// + /// Required designer variable. + /// + private Container components = null; - public TemplateDownloadFailedDisplayMessage(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public TemplateDownloadFailedDisplayMessage(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - // - // - // - } + // + // + // + } - public TemplateDownloadFailedDisplayMessage() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public TemplateDownloadFailedDisplayMessage() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // WeblogAuthenticationErrorDisplayMessage - // - this.Text = "The style template used for editing your weblog\nposts could not be downloaded.\n\n" + - "You will be able to post to this Weblog, but the editor\nwill not use your blog's style."; - this.Title = "Unable to Download Template"; - this.Type = DisplayMessageType.Warning; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // WeblogAuthenticationErrorDisplayMessage + // + this.Text = "The style template used for editing your weblog\nposts could not be downloaded.\n\n" + + "You will be able to post to this Weblog, but the editor\nwill not use your blog's style."; + this.Title = "Unable to Download Template"; + this.Type = DisplayMessageType.Warning; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.BlogClient/Detection/DisplayMessages/UnexpectedErrorDisplayMessage.cs b/src/managed/OpenLiveWriter.BlogClient/Detection/DisplayMessages/UnexpectedErrorDisplayMessage.cs index 17f5bd31..a8e055be 100644 --- a/src/managed/OpenLiveWriter.BlogClient/Detection/DisplayMessages/UnexpectedErrorDisplayMessage.cs +++ b/src/managed/OpenLiveWriter.BlogClient/Detection/DisplayMessages/UnexpectedErrorDisplayMessage.cs @@ -6,64 +6,64 @@ using OpenLiveWriter.Controls; namespace OpenLiveWriter.BlogClient.Detection.DisplayMessages { - /// - /// Summary description for DeleteSingleItemDisplayMessage. - /// - public class UnexpectedErrorDisplayMessage : DisplayMessage - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for DeleteSingleItemDisplayMessage. + /// + public class UnexpectedErrorDisplayMessage : DisplayMessage + { + /// + /// Required designer variable. + /// + private Container components = null; - public UnexpectedErrorDisplayMessage(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public UnexpectedErrorDisplayMessage(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - } + } - public UnexpectedErrorDisplayMessage() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public UnexpectedErrorDisplayMessage() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - } + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // UnexpectedErrorDisplayMessage - // - this.Text = "An unexpected error occurred while attempting to detect weblog settings:{0}{1}"; - this.Title = "Unexpected Error Occurred"; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // UnexpectedErrorDisplayMessage + // + this.Text = "An unexpected error occurred while attempting to detect weblog settings:{0}{1}"; + this.Title = "Unexpected Error Occurred"; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.BlogClient/Detection/DisplayMessages/WeblogAuthenticationErrorDisplayMessage.cs b/src/managed/OpenLiveWriter.BlogClient/Detection/DisplayMessages/WeblogAuthenticationErrorDisplayMessage.cs index 3ec0be10..945f4cd3 100644 --- a/src/managed/OpenLiveWriter.BlogClient/Detection/DisplayMessages/WeblogAuthenticationErrorDisplayMessage.cs +++ b/src/managed/OpenLiveWriter.BlogClient/Detection/DisplayMessages/WeblogAuthenticationErrorDisplayMessage.cs @@ -6,72 +6,72 @@ using OpenLiveWriter.Controls; namespace OpenLiveWriter.BlogClient.Detection.DisplayMessages { - /// - /// Summary description for DeleteSingleItemDisplayMessage. - /// - public class WeblogAuthenticationErrorDisplayMessage : DisplayMessage - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for DeleteSingleItemDisplayMessage. + /// + public class WeblogAuthenticationErrorDisplayMessage : DisplayMessage + { + /// + /// Required designer variable. + /// + private Container components = null; - public WeblogAuthenticationErrorDisplayMessage(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public WeblogAuthenticationErrorDisplayMessage(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - // - // - // - } + // + // + // + } - public WeblogAuthenticationErrorDisplayMessage() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public WeblogAuthenticationErrorDisplayMessage() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // WeblogAuthenticationErrorDisplayMessage - // - this.Text = "The weblog account could not be accessed using the specified username and p" + - "assword.{0}Please ensure that these values are correct before proceeding."; - this.Title = "Invalid Username or Password"; - this.Type = DisplayMessageType.Warning; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // WeblogAuthenticationErrorDisplayMessage + // + this.Text = "The weblog account could not be accessed using the specified username and p" + + "assword.{0}Please ensure that these values are correct before proceeding."; + this.Title = "Invalid Username or Password"; + this.Type = DisplayMessageType.Warning; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.BlogClient/Detection/DisplayMessages/WeblogConnectionErrorDisplayMessage.cs b/src/managed/OpenLiveWriter.BlogClient/Detection/DisplayMessages/WeblogConnectionErrorDisplayMessage.cs index 0b8ea8c0..c4f967d2 100644 --- a/src/managed/OpenLiveWriter.BlogClient/Detection/DisplayMessages/WeblogConnectionErrorDisplayMessage.cs +++ b/src/managed/OpenLiveWriter.BlogClient/Detection/DisplayMessages/WeblogConnectionErrorDisplayMessage.cs @@ -6,73 +6,73 @@ using OpenLiveWriter.Controls; namespace OpenLiveWriter.BlogClient.Detection.DisplayMessages { - /// - /// Summary description for DeleteSingleItemDisplayMessage. - /// - public class WeblogConnectionErrorDisplayMessage : DisplayMessage - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for DeleteSingleItemDisplayMessage. + /// + public class WeblogConnectionErrorDisplayMessage : DisplayMessage + { + /// + /// Required designer variable. + /// + private Container components = null; - public WeblogConnectionErrorDisplayMessage(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public WeblogConnectionErrorDisplayMessage(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - // - // - // - } + // + // + // + } - public WeblogConnectionErrorDisplayMessage() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public WeblogConnectionErrorDisplayMessage() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // WeblogConnectionErrorDisplayMessage - // - this.DefaultButton = System.Windows.Forms.MessageBoxDefaultButton.Button2; - this.Text = "An error occured while attempting to connect to your weblog:{0}{1}{0}You must cor" + - "rect this error before proceeding."; - this.Title = "Error Connecting to Weblog"; - this.Type = DisplayMessageType.Warning; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // WeblogConnectionErrorDisplayMessage + // + this.DefaultButton = System.Windows.Forms.MessageBoxDefaultButton.Button2; + this.Text = "An error occured while attempting to connect to your weblog:{0}{1}{0}You must cor" + + "rect this error before proceeding."; + this.Title = "Error Connecting to Weblog"; + this.Type = DisplayMessageType.Warning; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.BlogClient/Detection/DisplayMessages/WeblogNoAccountsOnServerDisplayMessage.cs b/src/managed/OpenLiveWriter.BlogClient/Detection/DisplayMessages/WeblogNoAccountsOnServerDisplayMessage.cs index 860324f9..922201cd 100644 --- a/src/managed/OpenLiveWriter.BlogClient/Detection/DisplayMessages/WeblogNoAccountsOnServerDisplayMessage.cs +++ b/src/managed/OpenLiveWriter.BlogClient/Detection/DisplayMessages/WeblogNoAccountsOnServerDisplayMessage.cs @@ -6,73 +6,73 @@ using OpenLiveWriter.Controls; namespace OpenLiveWriter.BlogClient.Detection.DisplayMessages { - /// - /// Summary description for DeleteSingleItemDisplayMessage. - /// - public class WeblogNoAccountsOnServerDisplayMessage : DisplayMessage - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for DeleteSingleItemDisplayMessage. + /// + public class WeblogNoAccountsOnServerDisplayMessage : DisplayMessage + { + /// + /// Required designer variable. + /// + private Container components = null; - public WeblogNoAccountsOnServerDisplayMessage(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public WeblogNoAccountsOnServerDisplayMessage(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - // - // - // - } + // + // + // + } - public WeblogNoAccountsOnServerDisplayMessage() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public WeblogNoAccountsOnServerDisplayMessage() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // WeblogNoAccountsOnServerDisplayMessage - // - this.Text = "A successful connection was made to your account however the server{0}reported th" + - "at you do not currently have an active weblog. Please ensure{0}that your account" + - " with this provider is current before proceeding."; - this.Title = "No Weblogs Found on Server"; - this.Type = DisplayMessageType.Warning; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // WeblogNoAccountsOnServerDisplayMessage + // + this.Text = "A successful connection was made to your account however the server{0}reported th" + + "at you do not currently have an active weblog. Please ensure{0}that your account" + + " with this provider is current before proceeding."; + this.Title = "No Weblogs Found on Server"; + this.Type = DisplayMessageType.Warning; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.BlogClient/Detection/DisplayMessages/WeblogUrlNotFoundDisplayMessage.cs b/src/managed/OpenLiveWriter.BlogClient/Detection/DisplayMessages/WeblogUrlNotFoundDisplayMessage.cs index adfdeb3e..582806cb 100644 --- a/src/managed/OpenLiveWriter.BlogClient/Detection/DisplayMessages/WeblogUrlNotFoundDisplayMessage.cs +++ b/src/managed/OpenLiveWriter.BlogClient/Detection/DisplayMessages/WeblogUrlNotFoundDisplayMessage.cs @@ -6,72 +6,72 @@ using OpenLiveWriter.Controls; namespace OpenLiveWriter.BlogClient.Detection.DisplayMessages { - /// - /// Summary description for DeleteSingleItemDisplayMessage. - /// - public class WeblogUrlNotFoundDisplayMessage : DisplayMessage - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for DeleteSingleItemDisplayMessage. + /// + public class WeblogUrlNotFoundDisplayMessage : DisplayMessage + { + /// + /// Required designer variable. + /// + private Container components = null; - public WeblogUrlNotFoundDisplayMessage(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public WeblogUrlNotFoundDisplayMessage(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - // - // - // - } + // + // + // + } - public WeblogUrlNotFoundDisplayMessage() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public WeblogUrlNotFoundDisplayMessage() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // WeblogPostUrlNotFoundDisplayMessage - // - this.Text = "The server has reported that the following URL could not be found:{0}{1}{0}Pleas" + - "e ensure that you have specified a valid and reachable URL."; - this.Title = "Weblog URL Not Found"; - this.Type = DisplayMessageType.Warning; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // WeblogPostUrlNotFoundDisplayMessage + // + this.Text = "The server has reported that the following URL could not be found:{0}{1}{0}Pleas" + + "e ensure that you have specified a valid and reachable URL."; + this.Title = "Weblog URL Not Found"; + this.Type = DisplayMessageType.Warning; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.BlogClient/Detection/LazyHomepageDownloader.cs b/src/managed/OpenLiveWriter.BlogClient/Detection/LazyHomepageDownloader.cs index 1b903547..5c6e0b47 100644 --- a/src/managed/OpenLiveWriter.BlogClient/Detection/LazyHomepageDownloader.cs +++ b/src/managed/OpenLiveWriter.BlogClient/Detection/LazyHomepageDownloader.cs @@ -92,7 +92,7 @@ namespace OpenLiveWriter.BlogClient.Detection /// /// The homepage HTML without sanitization or relative URL escaping applied. /// - public string OriginalHtml + public string OriginalHtml { get { diff --git a/src/managed/OpenLiveWriter.BlogClient/Detection/RsdServiceDetector.cs b/src/managed/OpenLiveWriter.BlogClient/Detection/RsdServiceDetector.cs index c594a86a..99f16050 100644 --- a/src/managed/OpenLiveWriter.BlogClient/Detection/RsdServiceDetector.cs +++ b/src/managed/OpenLiveWriter.BlogClient/Detection/RsdServiceDetector.cs @@ -65,7 +65,6 @@ namespace OpenLiveWriter.BlogClient.Detection } - /// /// Try to extract the EditUri (RSD file URI) from the passed DOM /// @@ -142,13 +141,13 @@ namespace OpenLiveWriter.BlogClient.Detection if (UrlHelper.UrlsAreEqual(reader.NamespaceURI, WINDOWS_LIVE_WRITER_NAMESPACE)) { /* - switch ( reader.LocalName.ToLower() ) - { - case "manifestlink": - rsdServiceDescription.WriterManifestUrl = reader.ReadString().Trim() ; - break; - } - */ + switch ( reader.LocalName.ToLower() ) + { + case "manifestlink": + rsdServiceDescription.WriterManifestUrl = reader.ReadString().Trim() ; + break; + } + */ } // standard rsd elements else diff --git a/src/managed/OpenLiveWriter.BlogClient/Detection/WriterEditingManifest.cs b/src/managed/OpenLiveWriter.BlogClient/Detection/WriterEditingManifest.cs index f446fb13..a28a5e85 100644 --- a/src/managed/OpenLiveWriter.BlogClient/Detection/WriterEditingManifest.cs +++ b/src/managed/OpenLiveWriter.BlogClient/Detection/WriterEditingManifest.cs @@ -14,7 +14,6 @@ using OpenLiveWriter.CoreServices; using OpenLiveWriter.Extensibility.BlogClient; using mshtml; - namespace OpenLiveWriter.BlogClient.Detection { @@ -211,7 +210,6 @@ namespace OpenLiveWriter.BlogClient.Detection return String.Empty; } - public WriterEditingManifestDownloadInfo DownloadInfo { get @@ -473,7 +471,6 @@ namespace OpenLiveWriter.BlogClient.Detection return imageBytes; } - private Bitmap DownloadImage(string imageUrl, string basePath) { // non-url base path means embedded resource diff --git a/src/managed/OpenLiveWriter.BlogClient/PostFormatOptions.cs b/src/managed/OpenLiveWriter.BlogClient/PostFormatOptions.cs index ce04cadd..1f72f348 100644 --- a/src/managed/OpenLiveWriter.BlogClient/PostFormatOptions.cs +++ b/src/managed/OpenLiveWriter.BlogClient/PostFormatOptions.cs @@ -8,77 +8,77 @@ using OpenLiveWriter.Extensibility.BlogClient; namespace OpenLiveWriter.BlogClient { - /// - /// Class which provides post-formatting instructions to a blog-client. Note that - /// the information conveyed in this class should only be optional overrides of - /// default behavior, since in many cases blog-clients are created without the - /// context required to pass them PostFormatOptions (such as during detection). - /// In this case the client is passed PostFormatOptions.Unknown (see below). - /// Properties within this class should always default to null or String.Empty - /// and only contain values to override standard behavior. - /// - /// The expected source for optional behavioral overrides is the updatable - /// BlogProviders.xml file. We therefore provide a convenience constructor - /// for the class which takes an IBlogProviderDescription. - /// - public class PostFormatOptions - { - public static PostFormatOptions Unknown = new PostFormatOptions(); + /// + /// Class which provides post-formatting instructions to a blog-client. Note that + /// the information conveyed in this class should only be optional overrides of + /// default behavior, since in many cases blog-clients are created without the + /// context required to pass them PostFormatOptions (such as during detection). + /// In this case the client is passed PostFormatOptions.Unknown (see below). + /// Properties within this class should always default to null or String.Empty + /// and only contain values to override standard behavior. + /// + /// The expected source for optional behavioral overrides is the updatable + /// BlogProviders.xml file. We therefore provide a convenience constructor + /// for the class which takes an IBlogProviderDescription. + /// + public class PostFormatOptions + { + public static PostFormatOptions Unknown = new PostFormatOptions(); - private PostFormatOptions() - { - } + private PostFormatOptions() + { + } - public PostFormatOptions(IBlogProviderOptions blogProviderOptions) - { - DateFormatOverride = blogProviderOptions.PostDateFormat ; - SupportsCustomDate = blogProviderOptions.SupportsCustomDate ; - UseLocalTime = blogProviderOptions.UseLocalTime ; - UnescapedTitles = blogProviderOptions.UnescapedTitles ; - AllowPostAsDraft = blogProviderOptions.SupportsPostAsDraft != SupportsFeature.No; - ContentFilter = blogProviderOptions.ContentFilter; - } + public PostFormatOptions(IBlogProviderOptions blogProviderOptions) + { + DateFormatOverride = blogProviderOptions.PostDateFormat ; + SupportsCustomDate = blogProviderOptions.SupportsCustomDate ; + UseLocalTime = blogProviderOptions.UseLocalTime ; + UnescapedTitles = blogProviderOptions.UnescapedTitles ; + AllowPostAsDraft = blogProviderOptions.SupportsPostAsDraft != SupportsFeature.No; + ContentFilter = blogProviderOptions.ContentFilter; + } - public string DateFormatOverride - { - get { return _dateFormatOverride; } - set { _dateFormatOverride = value; } - } - private string _dateFormatOverride = String.Empty; + public string DateFormatOverride + { + get { return _dateFormatOverride; } + set { _dateFormatOverride = value; } + } + private string _dateFormatOverride = String.Empty; - public SupportsFeature SupportsCustomDate - { - get { return _supportsCustomDate; } - set { _supportsCustomDate = value; } - } - private SupportsFeature _supportsCustomDate = SupportsFeature.Unknown; + public SupportsFeature SupportsCustomDate + { + get { return _supportsCustomDate; } + set { _supportsCustomDate = value; } + } + private SupportsFeature _supportsCustomDate = SupportsFeature.Unknown; - public bool AllowPostAsDraft - { - get { return _allowPostAsDraft; } - set { _allowPostAsDraft = value; } - } - private bool _allowPostAsDraft = true; + public bool AllowPostAsDraft + { + get { return _allowPostAsDraft; } + set { _allowPostAsDraft = value; } + } + private bool _allowPostAsDraft = true; - public bool UseLocalTime - { - get { return _useLocalTime; } - set { _useLocalTime = value; } - } - private bool _useLocalTime = false; + public bool UseLocalTime + { + get { return _useLocalTime; } + set { _useLocalTime = value; } + } + private bool _useLocalTime = false; - public bool UnescapedTitles - { - get { return _unescapedTitles; } - set { _unescapedTitles = value; } - } - private bool _unescapedTitles = false; + public bool UnescapedTitles + { + get { return _unescapedTitles; } + set { _unescapedTitles = value; } + } + private bool _unescapedTitles = false; - public string ContentFilter - { - get { return _contentFilter; } - set { _contentFilter = value; } - } - private string _contentFilter = String.Empty; - } + public string ContentFilter + { + get { return _contentFilter; } + set { _contentFilter = value; } + } + private string _contentFilter = String.Empty; + } } diff --git a/src/managed/OpenLiveWriter.BlogClient/Providers/BlogProvider.cs b/src/managed/OpenLiveWriter.BlogClient/Providers/BlogProvider.cs index 00169738..637b009d 100644 --- a/src/managed/OpenLiveWriter.BlogClient/Providers/BlogProvider.cs +++ b/src/managed/OpenLiveWriter.BlogClient/Providers/BlogProvider.cs @@ -591,7 +591,6 @@ namespace OpenLiveWriter.BlogClient.Providers private StreamWriter _output; } - private static string ReadText(string textValue, string defaultValue) { if (textValue != null) @@ -823,7 +822,6 @@ namespace OpenLiveWriter.BlogClient.Providers protected abstract void WriteOption(string name, string value); } - public class BlogProviderDescription : IBlogProviderDescription { public BlogProviderDescription( @@ -999,7 +997,6 @@ namespace OpenLiveWriter.BlogClient.Providers return null; } - public virtual IBlogClientOptions ConstructBlogOptions(IBlogClientOptions defaultOptions) { return defaultOptions; diff --git a/src/managed/OpenLiveWriter.BlogClient/Providers/BlogProviderFromXml.cs b/src/managed/OpenLiveWriter.BlogClient/Providers/BlogProviderFromXml.cs index 2827f823..bda4edee 100644 --- a/src/managed/OpenLiveWriter.BlogClient/Providers/BlogProviderFromXml.cs +++ b/src/managed/OpenLiveWriter.BlogClient/Providers/BlogProviderFromXml.cs @@ -125,7 +125,6 @@ namespace OpenLiveWriter.BlogClient.Providers private Hashtable _options = new Hashtable(); - private static string NodeText(XmlNode node) { if (node != null) diff --git a/src/managed/OpenLiveWriter.BrowserControl/ExplorerBrowserCommands.cs b/src/managed/OpenLiveWriter.BrowserControl/ExplorerBrowserCommands.cs index 2cc68537..11853350 100644 --- a/src/managed/OpenLiveWriter.BrowserControl/ExplorerBrowserCommands.cs +++ b/src/managed/OpenLiveWriter.BrowserControl/ExplorerBrowserCommands.cs @@ -279,7 +279,6 @@ namespace OpenLiveWriter.BrowserControl } } - /// /// Command for Add Favorites... /// @@ -364,7 +363,6 @@ namespace OpenLiveWriter.BrowserControl } } - /// /// Implementation of BrowserCommand for commands that can be accessed /// using IWebBrowser2.ExecWB. @@ -426,7 +424,6 @@ namespace OpenLiveWriter.BrowserControl private OLECMDID m_cmdID; } - /// /// Implementation of BrowserCommand for command that can be accessed through the /// IE private command group (find, view source, internet options). Note that @@ -570,7 +567,6 @@ namespace OpenLiveWriter.BrowserControl } } - /// /// ID of private command /// diff --git a/src/managed/OpenLiveWriter.BrowserControl/ExplorerBrowserControl.cs b/src/managed/OpenLiveWriter.BrowserControl/ExplorerBrowserControl.cs index ea9e8849..730bd8d9 100644 --- a/src/managed/OpenLiveWriter.BrowserControl/ExplorerBrowserControl.cs +++ b/src/managed/OpenLiveWriter.BrowserControl/ExplorerBrowserControl.cs @@ -277,7 +277,6 @@ namespace OpenLiveWriter.BrowserControl set { WinInet.WorkOffline = value; } } - /// /// Navigate to the specified URL /// @@ -523,7 +522,6 @@ namespace OpenLiveWriter.BrowserControl StatusTextChanged(this, e); } - /// /// Event that fires when the EncryptionLevel property changes /// @@ -572,7 +570,6 @@ namespace OpenLiveWriter.BrowserControl NewWindow2(this, e); } - /// /// Clean up any resources being used. /// @@ -586,7 +583,6 @@ namespace OpenLiveWriter.BrowserControl base.Dispose(disposing); } - /// /// Helper function to initialize the browser and add it to the /// client area of the UserControl (it fills the entire area) @@ -854,7 +850,6 @@ namespace OpenLiveWriter.BrowserControl OnEncryptionLevelChanged(EventArgs.Empty); } - /// /// Event handler for CommandStateChange -- update our internal command states /// then re-fire this event to listeners. diff --git a/src/managed/OpenLiveWriter.BrowserControl/IBrowserControl.cs b/src/managed/OpenLiveWriter.BrowserControl/IBrowserControl.cs index 4dd913b9..87bcbc0f 100644 --- a/src/managed/OpenLiveWriter.BrowserControl/IBrowserControl.cs +++ b/src/managed/OpenLiveWriter.BrowserControl/IBrowserControl.cs @@ -32,7 +32,6 @@ namespace OpenLiveWriter.BrowserControl /// string Title { get; } - /// /// StatusText (normally displayed in status bar). You should retreive/update /// this value whenever the StatusTextChanged event is fired. @@ -94,7 +93,6 @@ namespace OpenLiveWriter.BrowserControl /// URL to navigate to void Navigate(string url); - /// /// Navigate to the specified URL using the specified options /// @@ -102,7 +100,6 @@ namespace OpenLiveWriter.BrowserControl /// navigate using new top level window void Navigate(string url, bool newWindow); - /// /// Determine if a command is enabled /// @@ -110,14 +107,12 @@ namespace OpenLiveWriter.BrowserControl /// true if the command is enabled, otherwise false bool IsEnabled(BrowserCommand command); - /// /// Execute a command /// /// unique ID of command void Execute(BrowserCommand command); - /// /// Force refresh of the state of the browser commands /// @@ -218,7 +213,6 @@ namespace OpenLiveWriter.BrowserControl Largest = 4 } - /// /// Event arguments for events that communicate state about browser documents /// diff --git a/src/managed/OpenLiveWriter.Controls/ApplicationDialog.cs b/src/managed/OpenLiveWriter.Controls/ApplicationDialog.cs index f9747182..6a5d74d4 100644 --- a/src/managed/OpenLiveWriter.Controls/ApplicationDialog.cs +++ b/src/managed/OpenLiveWriter.Controls/ApplicationDialog.cs @@ -52,7 +52,6 @@ namespace OpenLiveWriter.Controls base.OnClosed(e); } - /// /// Handle OnLoad -- set standard icon /// diff --git a/src/managed/OpenLiveWriter.Controls/BrowseButton.cs b/src/managed/OpenLiveWriter.Controls/BrowseButton.cs index 00548830..5ce716ab 100644 --- a/src/managed/OpenLiveWriter.Controls/BrowseButton.cs +++ b/src/managed/OpenLiveWriter.Controls/BrowseButton.cs @@ -6,57 +6,57 @@ using System.Windows.Forms; namespace OpenLiveWriter.Controls { - public class BrowseButton : Button - { - private IContainer components = null; + public class BrowseButton : Button + { + private IContainer components = null; - public BrowseButton() - { - // This call is required by the Windows Form Designer. - InitializeComponent(); + public BrowseButton() + { + // This call is required by the Windows Form Designer. + InitializeComponent(); - // TODO: Add any initialization after the InitializeComponent call - } + // TODO: Add any initialization after the InitializeComponent call + } - public BrowseButton(IContainer container) : base() - { - // This call is required by the Windows Form Designer. - InitializeComponent(); + public BrowseButton(IContainer container) : base() + { + // This call is required by the Windows Form Designer. + InitializeComponent(); - // TODO: Add any initialization after the InitializeComponent call - } + // TODO: Add any initialization after the InitializeComponent call + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if (components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if (components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // BrowseButton - // - this.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.Size = new System.Drawing.Size(22, 21); - this.Text = "..."; + #region Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // BrowseButton + // + this.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.Size = new System.Drawing.Size(22, 21); + this.Text = "..."; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.Controls/BrowserMiniForm.cs b/src/managed/OpenLiveWriter.Controls/BrowserMiniForm.cs index dec5288d..71109dff 100644 --- a/src/managed/OpenLiveWriter.Controls/BrowserMiniForm.cs +++ b/src/managed/OpenLiveWriter.Controls/BrowserMiniForm.cs @@ -111,22 +111,22 @@ namespace OpenLiveWriter.Controls using (StreamWriter writer = new StreamWriter(progressPagePath, false, Encoding.UTF8)) { writer.Write(@" - - - -
-
- -

- - {3} - -

-
-
- - - ", bodyHeight, progressTop, animationGifName, HtmlUtils.EscapeEntities(progressText)); + + + +
+
+ +

+ + {3} + +

+
+
+ + + ", bodyHeight, progressTop, animationGifName, HtmlUtils.EscapeEntities(progressText)); } } diff --git a/src/managed/OpenLiveWriter.Controls/ComboBoxRel.cs b/src/managed/OpenLiveWriter.Controls/ComboBoxRel.cs index 1992a2e1..5fd5d4c5 100644 --- a/src/managed/OpenLiveWriter.Controls/ComboBoxRel.cs +++ b/src/managed/OpenLiveWriter.Controls/ComboBoxRel.cs @@ -40,6 +40,5 @@ namespace OpenLiveWriter.Controls } } - } } diff --git a/src/managed/OpenLiveWriter.Controls/DelayedAnimatedProgressDialog.cs b/src/managed/OpenLiveWriter.Controls/DelayedAnimatedProgressDialog.cs index 76794bba..99dcf844 100644 --- a/src/managed/OpenLiveWriter.Controls/DelayedAnimatedProgressDialog.cs +++ b/src/managed/OpenLiveWriter.Controls/DelayedAnimatedProgressDialog.cs @@ -41,25 +41,25 @@ namespace OpenLiveWriter.Controls // TECHNIQUE THAT DOES NOT STARVE THE UI THREAD. DO NOT UNDER ANY CONDITIONS RESTORE // THIS CODE!!!!!! /* - // start out by polling the get post operation for completion for the delay interval - using ( new WaitCursor() ) - { - const int SPLICE_MS = 100 ; - int waitMs = 0 ; - while( waitMs < delayMs ) - { - if ( asyncOperation.IsDone ) - { - return ; - } - else - { - Thread.Sleep(SPLICE_MS); - waitMs += SPLICE_MS ; - } - } - } - */ + // start out by polling the get post operation for completion for the delay interval + using ( new WaitCursor() ) + { + const int SPLICE_MS = 100 ; + int waitMs = 0 ; + while( waitMs < delayMs ) + { + if ( asyncOperation.IsDone ) + { + return ; + } + else + { + Thread.Sleep(SPLICE_MS); + waitMs += SPLICE_MS ; + } + } + } + */ // got past the delay interval, need to signup for events and show the dialog _asyncOperation = asyncOperation; diff --git a/src/managed/OpenLiveWriter.Controls/DisplayMessageDesigner.cs b/src/managed/OpenLiveWriter.Controls/DisplayMessageDesigner.cs index 7bf2bc52..205ea0d9 100644 --- a/src/managed/OpenLiveWriter.Controls/DisplayMessageDesigner.cs +++ b/src/managed/OpenLiveWriter.Controls/DisplayMessageDesigner.cs @@ -4,39 +4,39 @@ using System.Windows.Forms.Design; namespace OpenLiveWriter.Controls { - public class DisplayMessageDesigner : ComponentDocumentDesigner - { - // Stores reference to the LocalizationExtenderProvider this designer adds, in order to remove it on Dispose. - private LocalizationExtenderProvider localizationExtenderProvider; + public class DisplayMessageDesigner : ComponentDocumentDesigner + { + // Stores reference to the LocalizationExtenderProvider this designer adds, in order to remove it on Dispose. + private LocalizationExtenderProvider localizationExtenderProvider; - // Adds a LocalizationExtenderProvider for the component this designer is initialized to support. - public override void Initialize(IComponent component) - { - base.Initialize(component); + // Adds a LocalizationExtenderProvider for the component this designer is initialized to support. + public override void Initialize(IComponent component) + { + base.Initialize(component); - // If no extender from this designer is active... - if( localizationExtenderProvider == null ) - { - // Adds a LocalizationExtenderProvider that provides localization support properties to the specified component. - localizationExtenderProvider = new LocalizationExtenderProvider(component.Site, component); - localizationExtenderProvider.SetLocalizable(component, true); - } - } + // If no extender from this designer is active... + if( localizationExtenderProvider == null ) + { + // Adds a LocalizationExtenderProvider that provides localization support properties to the specified component. + localizationExtenderProvider = new LocalizationExtenderProvider(component.Site, component); + localizationExtenderProvider.SetLocalizable(component, true); + } + } - // If a LocalizationExtenderProvider has been added, removes the extender provider. - protected override void Dispose(bool disposing) - { - base.Dispose(disposing); + // If a LocalizationExtenderProvider has been added, removes the extender provider. + protected override void Dispose(bool disposing) + { + base.Dispose(disposing); - // If an extender has been added, remove it - if( localizationExtenderProvider != null ) - { - // Disposes of the extender provider. The extender - // provider removes itself from the extender provider - // service when it is disposed. - localizationExtenderProvider.Dispose(); - localizationExtenderProvider = null; - } - } - } + // If an extender has been added, remove it + if( localizationExtenderProvider != null ) + { + // Disposes of the extender provider. The extender + // provider removes itself from the extender provider + // service when it is disposed. + localizationExtenderProvider.Dispose(); + localizationExtenderProvider = null; + } + } + } } diff --git a/src/managed/OpenLiveWriter.Controls/ImageCropControl.Designer.cs b/src/managed/OpenLiveWriter.Controls/ImageCropControl.Designer.cs index 7d6ed9ba..a51472b5 100644 --- a/src/managed/OpenLiveWriter.Controls/ImageCropControl.Designer.cs +++ b/src/managed/OpenLiveWriter.Controls/ImageCropControl.Designer.cs @@ -1,36 +1,36 @@ namespace OpenLiveWriter.Controls { - partial class ImageCropControl - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; + partial class ImageCropControl + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } - #region Component Designer generated code + #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - components = new System.ComponentModel.Container(); - } + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + } - #endregion - } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.Controls/InformationBox.cs b/src/managed/OpenLiveWriter.Controls/InformationBox.cs index e949972f..a99d2382 100644 --- a/src/managed/OpenLiveWriter.Controls/InformationBox.cs +++ b/src/managed/OpenLiveWriter.Controls/InformationBox.cs @@ -12,425 +12,425 @@ using Project31.Interop.Windows; namespace Project31.Controls { - /// - /// Displays an information box. This class is very similar to System.Windows.Forms.MessageBox - /// with the exception being that InformationBox is designed to be used as a base form. - /// - public class InformationBox : System.Windows.Forms.Form - { - /// - /// The body background bitmap. - /// - private static Bitmap bodyBackgroundBitmap = ResourceHelper.LoadAssemblyResourceBitmap("Images.BodyBackground.png"); + /// + /// Displays an information box. This class is very similar to System.Windows.Forms.MessageBox + /// with the exception being that InformationBox is designed to be used as a base form. + /// + public class InformationBox : System.Windows.Forms.Form + { + /// + /// The body background bitmap. + /// + private static Bitmap bodyBackgroundBitmap = ResourceHelper.LoadAssemblyResourceBitmap("Images.BodyBackground.png"); - /// - /// Information box type enumeration. Specifies which type of information box to display. - /// - public enum InformationBoxType - { - /// - /// - /// - Information, + /// + /// Information box type enumeration. Specifies which type of information box to display. + /// + public enum InformationBoxType + { + /// + /// + /// + Information, - /// - /// - /// - Warning, + /// + /// + /// + Warning, - /// - /// - /// - Error - } + /// + /// + /// + Error + } - /// - /// GetWindowLong and SetWindowLong. This stuff moves soon... - /// - private Project31.Controls.LabelControl labelControlText; - private Project31.Controls.CheckBoxControl checkBoxControlAgain; - private System.Windows.Forms.Button buttonOK; - private System.Windows.Forms.Button buttonCancel; - private System.Windows.Forms.Button buttonYes; - private System.Windows.Forms.Button buttonNo; - private System.Windows.Forms.Button buttonAbort; - private System.Windows.Forms.Button buttonRetry; - private System.Windows.Forms.Button buttonIgnore; - private System.Windows.Forms.PictureBox pictureBoxError; - private System.Windows.Forms.PictureBox pictureBoxWarning; + /// + /// GetWindowLong and SetWindowLong. This stuff moves soon... + /// + private Project31.Controls.LabelControl labelControlText; + private Project31.Controls.CheckBoxControl checkBoxControlAgain; + private System.Windows.Forms.Button buttonOK; + private System.Windows.Forms.Button buttonCancel; + private System.Windows.Forms.Button buttonYes; + private System.Windows.Forms.Button buttonNo; + private System.Windows.Forms.Button buttonAbort; + private System.Windows.Forms.Button buttonRetry; + private System.Windows.Forms.Button buttonIgnore; + private System.Windows.Forms.PictureBox pictureBoxError; + private System.Windows.Forms.PictureBox pictureBoxWarning; - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; + /// + /// Required designer variable. + /// + private System.ComponentModel.Container components = null; - /// - /// The information box type. - /// - private InformationBoxType type; + /// + /// The information box type. + /// + private InformationBoxType type; - /// - /// Gets or sets the information box type. - /// - [ - Category("Appearance"), - Localizable(false), - Description("Specifies the the information box type.") - ] - public InformationBoxType Type - { - get - { - return type; - } - set - { - type = value; - } - } + /// + /// Gets or sets the information box type. + /// + [ + Category("Appearance"), + Localizable(false), + Description("Specifies the the information box type.") + ] + public InformationBoxType Type + { + get + { + return type; + } + set + { + type = value; + } + } - /// - /// The information box buttons. - /// - private MessageBoxButtons buttons; + /// + /// The information box buttons. + /// + private MessageBoxButtons buttons; - /// - /// Gets or sets the information box buttons. - /// - [ - Category("Appearance"), - Localizable(false), - Description("Specifies the the information box buttons.") - ] - public MessageBoxButtons Buttons - { - get - { - return buttons; - } - set - { - buttons = value; - } - } + /// + /// Gets or sets the information box buttons. + /// + [ + Category("Appearance"), + Localizable(false), + Description("Specifies the the information box buttons.") + ] + public MessageBoxButtons Buttons + { + get + { + return buttons; + } + set + { + buttons = value; + } + } - /// - /// The text to display in the title bar of the information box. - /// - private string informationBoxTitle; + /// + /// The text to display in the title bar of the information box. + /// + private string informationBoxTitle; - /// - /// Gets or sets the text to display in the title bar of the information box. - /// - [ - Category("Appearance"), - Localizable(true), - Description("The text to display in the title bar of the information box.") - ] - public string InformationBoxTitle - { - get - { - return informationBoxTitle; - } - set - { - informationBoxTitle = value; - } - } + /// + /// Gets or sets the text to display in the title bar of the information box. + /// + [ + Category("Appearance"), + Localizable(true), + Description("The text to display in the title bar of the information box.") + ] + public string InformationBoxTitle + { + get + { + return informationBoxTitle; + } + set + { + informationBoxTitle = value; + } + } - /// - /// The text to display in the information box. - /// - private string informationBoxText; + /// + /// The text to display in the information box. + /// + private string informationBoxText; - /// - /// Gets or sets the text to display in the information box. - /// - [ - Category("Appearance"), - Localizable(true), - Description("Specifies the text to display in the information box.") - ] - public string InformationBoxText - { - get - { - return informationBoxText; - } - set - { - informationBoxText = value; - } - } + /// + /// Gets or sets the text to display in the information box. + /// + [ + Category("Appearance"), + Localizable(true), + Description("Specifies the text to display in the information box.") + ] + public string InformationBoxText + { + get + { + return informationBoxText; + } + set + { + informationBoxText = value; + } + } - /// - /// Initializes a new instances of the InformationBox class. - /// - public InformationBox() - { - // - // Required for Windows Form Designer support - // - InitializeComponent(); + /// + /// Initializes a new instances of the InformationBox class. + /// + public InformationBox() + { + // + // Required for Windows Form Designer support + // + InitializeComponent(); - // Initialize the object. - InitializeObject(); - } + // Initialize the object. + InitializeObject(); + } - /// - /// Initializes a new instances of the PropertyEditorForm class. - /// - private void InitializeObject() - { - // Turn off CS_CLIPCHILDREN. - User32.SetWindowLong(Handle, GWL.STYLE, User32.GetWindowLong(Handle, GWL.STYLE) & ~WS.CLIPCHILDREN); + /// + /// Initializes a new instances of the PropertyEditorForm class. + /// + private void InitializeObject() + { + // Turn off CS_CLIPCHILDREN. + User32.SetWindowLong(Handle, GWL.STYLE, User32.GetWindowLong(Handle, GWL.STYLE) & ~WS.CLIPCHILDREN); - // Turn on double buffered painting. - SetStyle(ControlStyles.UserPaint, true); - SetStyle(ControlStyles.DoubleBuffer, true); - SetStyle(ControlStyles.AllPaintingInWmPaint, true); - } + // Turn on double buffered painting. + SetStyle(ControlStyles.UserPaint, true); + SetStyle(ControlStyles.DoubleBuffer, true); + SetStyle(ControlStyles.AllPaintingInWmPaint, true); + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(InformationBox)); - this.buttonOK = new System.Windows.Forms.Button(); - this.pictureBoxError = new System.Windows.Forms.PictureBox(); - this.labelControlText = new Project31.Controls.LabelControl(); - this.buttonCancel = new System.Windows.Forms.Button(); - this.checkBoxControlAgain = new Project31.Controls.CheckBoxControl(); - this.buttonYes = new System.Windows.Forms.Button(); - this.buttonNo = new System.Windows.Forms.Button(); - this.buttonAbort = new System.Windows.Forms.Button(); - this.buttonRetry = new System.Windows.Forms.Button(); - this.buttonIgnore = new System.Windows.Forms.Button(); - this.pictureBoxWarning = new System.Windows.Forms.PictureBox(); - this.SuspendLayout(); - // - // buttonOK - // - this.buttonOK.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left); - this.buttonOK.Font = new System.Drawing.Font("Verdana", 8.25F); - this.buttonOK.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.buttonOK.Location = new System.Drawing.Point(6, 92); - this.buttonOK.Name = "buttonOK"; - this.buttonOK.TabIndex = 0; - this.buttonOK.Text = "&OK"; - this.buttonOK.Visible = false; - // - // pictureBoxError - // - this.pictureBoxError.Image = ((System.Drawing.Bitmap)(resources.GetObject("pictureBoxError.Image"))); - this.pictureBoxError.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.pictureBoxError.Location = new System.Drawing.Point(12, 12); - this.pictureBoxError.Name = "pictureBoxError"; - this.pictureBoxError.Size = new System.Drawing.Size(39, 40); - this.pictureBoxError.TabIndex = 2; - this.pictureBoxError.TabStop = false; - // - // labelControlText - // - this.labelControlText.BackColor = System.Drawing.Color.Transparent; - this.labelControlText.Font = new System.Drawing.Font("Verdana", 8.25F); - this.labelControlText.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.labelControlText.Location = new System.Drawing.Point(57, 12); - this.labelControlText.Name = "labelControlText"; - this.labelControlText.Size = new System.Drawing.Size(325, 40); - this.labelControlText.TabIndex = 3; - this.labelControlText.Text = "Text."; - this.labelControlText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // buttonCancel - // - this.buttonCancel.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left); - this.buttonCancel.Font = new System.Drawing.Font("Verdana", 8.25F); - this.buttonCancel.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.buttonCancel.Location = new System.Drawing.Point(6, 115); - this.buttonCancel.Name = "buttonCancel"; - this.buttonCancel.TabIndex = 5; - this.buttonCancel.Text = "&Cancel"; - this.buttonCancel.Visible = false; - // - // checkBoxControlAgain - // - this.checkBoxControlAgain.Font = new System.Drawing.Font("Verdana", 8.25F); - this.checkBoxControlAgain.Location = new System.Drawing.Point(57, 62); - this.checkBoxControlAgain.Name = "checkBoxControlAgain"; - this.checkBoxControlAgain.Size = new System.Drawing.Size(288, 18); - this.checkBoxControlAgain.TabIndex = 4; - this.checkBoxControlAgain.Text = "Again."; - // - // buttonYes - // - this.buttonYes.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left); - this.buttonYes.Font = new System.Drawing.Font("Verdana", 8.25F); - this.buttonYes.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.buttonYes.Location = new System.Drawing.Point(81, 92); - this.buttonYes.Name = "buttonYes"; - this.buttonYes.TabIndex = 6; - this.buttonYes.Text = "&Yes"; - this.buttonYes.Visible = false; - // - // buttonNo - // - this.buttonNo.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left); - this.buttonNo.Font = new System.Drawing.Font("Verdana", 8.25F); - this.buttonNo.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.buttonNo.Location = new System.Drawing.Point(81, 115); - this.buttonNo.Name = "buttonNo"; - this.buttonNo.TabIndex = 7; - this.buttonNo.Text = "&No"; - this.buttonNo.Visible = false; - // - // buttonAbort - // - this.buttonAbort.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left); - this.buttonAbort.Font = new System.Drawing.Font("Verdana", 8.25F); - this.buttonAbort.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.buttonAbort.Location = new System.Drawing.Point(156, 92); - this.buttonAbort.Name = "buttonAbort"; - this.buttonAbort.TabIndex = 8; - this.buttonAbort.Text = "&Abort"; - this.buttonAbort.Visible = false; - // - // buttonRetry - // - this.buttonRetry.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left); - this.buttonRetry.Font = new System.Drawing.Font("Verdana", 8.25F); - this.buttonRetry.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.buttonRetry.Location = new System.Drawing.Point(156, 115); - this.buttonRetry.Name = "buttonRetry"; - this.buttonRetry.TabIndex = 9; - this.buttonRetry.Text = "&Retry"; - this.buttonRetry.Visible = false; - // - // buttonIgnore - // - this.buttonIgnore.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left); - this.buttonIgnore.Font = new System.Drawing.Font("Verdana", 8.25F); - this.buttonIgnore.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.buttonIgnore.Location = new System.Drawing.Point(156, 138); - this.buttonIgnore.Name = "buttonIgnore"; - this.buttonIgnore.TabIndex = 10; - this.buttonIgnore.Text = "&Ignore"; - this.buttonIgnore.Visible = false; - // - // pictureBoxWarning - // - this.pictureBoxWarning.Image = ((System.Drawing.Bitmap)(resources.GetObject("pictureBoxWarning.Image"))); - this.pictureBoxWarning.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.pictureBoxWarning.Location = new System.Drawing.Point(12, 12); - this.pictureBoxWarning.Name = "pictureBoxWarning"; - this.pictureBoxWarning.Size = new System.Drawing.Size(39, 40); - this.pictureBoxWarning.TabIndex = 11; - this.pictureBoxWarning.TabStop = false; - // - // InformationBox - // - this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); - this.ClientSize = new System.Drawing.Size(394, 164); - this.Controls.AddRange(new System.Windows.Forms.Control[] { - this.buttonIgnore, - this.buttonRetry, - this.buttonAbort, - this.buttonNo, - this.buttonYes, - this.buttonCancel, - this.checkBoxControlAgain, - this.labelControlText, - this.buttonOK, - this.pictureBoxWarning, - this.pictureBoxError}); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "InformationBox"; - this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; - this.Text = "Title"; - this.ResumeLayout(false); + #region Windows Form Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(InformationBox)); + this.buttonOK = new System.Windows.Forms.Button(); + this.pictureBoxError = new System.Windows.Forms.PictureBox(); + this.labelControlText = new Project31.Controls.LabelControl(); + this.buttonCancel = new System.Windows.Forms.Button(); + this.checkBoxControlAgain = new Project31.Controls.CheckBoxControl(); + this.buttonYes = new System.Windows.Forms.Button(); + this.buttonNo = new System.Windows.Forms.Button(); + this.buttonAbort = new System.Windows.Forms.Button(); + this.buttonRetry = new System.Windows.Forms.Button(); + this.buttonIgnore = new System.Windows.Forms.Button(); + this.pictureBoxWarning = new System.Windows.Forms.PictureBox(); + this.SuspendLayout(); + // + // buttonOK + // + this.buttonOK.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left); + this.buttonOK.Font = new System.Drawing.Font("Verdana", 8.25F); + this.buttonOK.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.buttonOK.Location = new System.Drawing.Point(6, 92); + this.buttonOK.Name = "buttonOK"; + this.buttonOK.TabIndex = 0; + this.buttonOK.Text = "&OK"; + this.buttonOK.Visible = false; + // + // pictureBoxError + // + this.pictureBoxError.Image = ((System.Drawing.Bitmap)(resources.GetObject("pictureBoxError.Image"))); + this.pictureBoxError.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.pictureBoxError.Location = new System.Drawing.Point(12, 12); + this.pictureBoxError.Name = "pictureBoxError"; + this.pictureBoxError.Size = new System.Drawing.Size(39, 40); + this.pictureBoxError.TabIndex = 2; + this.pictureBoxError.TabStop = false; + // + // labelControlText + // + this.labelControlText.BackColor = System.Drawing.Color.Transparent; + this.labelControlText.Font = new System.Drawing.Font("Verdana", 8.25F); + this.labelControlText.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.labelControlText.Location = new System.Drawing.Point(57, 12); + this.labelControlText.Name = "labelControlText"; + this.labelControlText.Size = new System.Drawing.Size(325, 40); + this.labelControlText.TabIndex = 3; + this.labelControlText.Text = "Text."; + this.labelControlText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // buttonCancel + // + this.buttonCancel.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left); + this.buttonCancel.Font = new System.Drawing.Font("Verdana", 8.25F); + this.buttonCancel.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.buttonCancel.Location = new System.Drawing.Point(6, 115); + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.TabIndex = 5; + this.buttonCancel.Text = "&Cancel"; + this.buttonCancel.Visible = false; + // + // checkBoxControlAgain + // + this.checkBoxControlAgain.Font = new System.Drawing.Font("Verdana", 8.25F); + this.checkBoxControlAgain.Location = new System.Drawing.Point(57, 62); + this.checkBoxControlAgain.Name = "checkBoxControlAgain"; + this.checkBoxControlAgain.Size = new System.Drawing.Size(288, 18); + this.checkBoxControlAgain.TabIndex = 4; + this.checkBoxControlAgain.Text = "Again."; + // + // buttonYes + // + this.buttonYes.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left); + this.buttonYes.Font = new System.Drawing.Font("Verdana", 8.25F); + this.buttonYes.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.buttonYes.Location = new System.Drawing.Point(81, 92); + this.buttonYes.Name = "buttonYes"; + this.buttonYes.TabIndex = 6; + this.buttonYes.Text = "&Yes"; + this.buttonYes.Visible = false; + // + // buttonNo + // + this.buttonNo.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left); + this.buttonNo.Font = new System.Drawing.Font("Verdana", 8.25F); + this.buttonNo.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.buttonNo.Location = new System.Drawing.Point(81, 115); + this.buttonNo.Name = "buttonNo"; + this.buttonNo.TabIndex = 7; + this.buttonNo.Text = "&No"; + this.buttonNo.Visible = false; + // + // buttonAbort + // + this.buttonAbort.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left); + this.buttonAbort.Font = new System.Drawing.Font("Verdana", 8.25F); + this.buttonAbort.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.buttonAbort.Location = new System.Drawing.Point(156, 92); + this.buttonAbort.Name = "buttonAbort"; + this.buttonAbort.TabIndex = 8; + this.buttonAbort.Text = "&Abort"; + this.buttonAbort.Visible = false; + // + // buttonRetry + // + this.buttonRetry.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left); + this.buttonRetry.Font = new System.Drawing.Font("Verdana", 8.25F); + this.buttonRetry.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.buttonRetry.Location = new System.Drawing.Point(156, 115); + this.buttonRetry.Name = "buttonRetry"; + this.buttonRetry.TabIndex = 9; + this.buttonRetry.Text = "&Retry"; + this.buttonRetry.Visible = false; + // + // buttonIgnore + // + this.buttonIgnore.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left); + this.buttonIgnore.Font = new System.Drawing.Font("Verdana", 8.25F); + this.buttonIgnore.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.buttonIgnore.Location = new System.Drawing.Point(156, 138); + this.buttonIgnore.Name = "buttonIgnore"; + this.buttonIgnore.TabIndex = 10; + this.buttonIgnore.Text = "&Ignore"; + this.buttonIgnore.Visible = false; + // + // pictureBoxWarning + // + this.pictureBoxWarning.Image = ((System.Drawing.Bitmap)(resources.GetObject("pictureBoxWarning.Image"))); + this.pictureBoxWarning.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.pictureBoxWarning.Location = new System.Drawing.Point(12, 12); + this.pictureBoxWarning.Name = "pictureBoxWarning"; + this.pictureBoxWarning.Size = new System.Drawing.Size(39, 40); + this.pictureBoxWarning.TabIndex = 11; + this.pictureBoxWarning.TabStop = false; + // + // InformationBox + // + this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); + this.ClientSize = new System.Drawing.Size(394, 164); + this.Controls.AddRange(new System.Windows.Forms.Control[] { + this.buttonIgnore, + this.buttonRetry, + this.buttonAbort, + this.buttonNo, + this.buttonYes, + this.buttonCancel, + this.checkBoxControlAgain, + this.labelControlText, + this.buttonOK, + this.pictureBoxWarning, + this.pictureBoxError}); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "InformationBox"; + this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; + this.Text = "Title"; + this.ResumeLayout(false); - } - #endregion + } + #endregion - /// - /// Displays an information box. - /// - /// One of the DialogResult values. - public new DialogResult ShowDialog() - { - // Layout the controls. - LayoutControls(); + /// + /// Displays an information box. + /// + /// One of the DialogResult values. + public new DialogResult ShowDialog() + { + // Layout the controls. + LayoutControls(); - // Show the dialog. - return base.ShowDialog(); - } + // Show the dialog. + return base.ShowDialog(); + } - /// - /// Displays an information box. - /// - /// The IWin32Window the message box will display in front of. - /// One of the DialogResult values. - public new DialogResult ShowDialog(IWin32Window owner) - { - // Layout the controls. - LayoutControls(); + /// + /// Displays an information box. + /// + /// The IWin32Window the message box will display in front of. + /// One of the DialogResult values. + public new DialogResult ShowDialog(IWin32Window owner) + { + // Layout the controls. + LayoutControls(); - // Show the dialog. - return base.ShowDialog(owner); - } + // Show the dialog. + return base.ShowDialog(owner); + } - /// - /// Raises the PaintBackground event. - /// - /// A PaintEventArgs that contains the event data. - protected override void OnPaintBackground(System.Windows.Forms.PaintEventArgs e) - { - base.OnPaintBackground(e); + /// + /// Raises the PaintBackground event. + /// + /// A PaintEventArgs that contains the event data. + protected override void OnPaintBackground(System.Windows.Forms.PaintEventArgs e) + { + base.OnPaintBackground(e); - // Fill the dialog body. - GraphicsHelper.TileFillScaledImageHorizontally( e.Graphics, - bodyBackgroundBitmap, - ClientRectangle); - } + // Fill the dialog body. + GraphicsHelper.TileFillScaledImageHorizontally( e.Graphics, + bodyBackgroundBitmap, + ClientRectangle); + } - /// - /// Layout controls. - /// - private void LayoutControls() - { - switch (Type) - { - case InformationBoxType.Information: - break; + /// + /// Layout controls. + /// + private void LayoutControls() + { + switch (Type) + { + case InformationBoxType.Information: + break; - case InformationBoxType.Warning: - break; + case InformationBoxType.Warning: + break; - case InformationBoxType.Error: - break; - } - } - } + case InformationBoxType.Error: + break; + } + } + } } diff --git a/src/managed/OpenLiveWriter.Controls/LightweightControl.cs b/src/managed/OpenLiveWriter.Controls/LightweightControl.cs index 3fafb014..784ee758 100644 --- a/src/managed/OpenLiveWriter.Controls/LightweightControl.cs +++ b/src/managed/OpenLiveWriter.Controls/LightweightControl.cs @@ -1585,14 +1585,14 @@ namespace OpenLiveWriter.Controls } #if false - /// - /// Raises the DragEnter event. - /// - /// A DragEventArgs that contains the event data. - internal void RaiseDragEnter(DragEventArgs e) - { - OnDragEnter(e); - } + /// + /// Raises the DragEnter event. + /// + /// A DragEventArgs that contains the event data. + internal void RaiseDragEnter(DragEventArgs e) + { + OnDragEnter(e); + } #endif /// @@ -1605,14 +1605,14 @@ namespace OpenLiveWriter.Controls } #if false - /// - /// Raises the DragLeave event. - /// - /// An EventArgs that contains the event data. - internal void RaiseDragLeave(EventArgs e) - { - OnDragLeave(e); - } + /// + /// Raises the DragLeave event. + /// + /// An EventArgs that contains the event data. + internal void RaiseDragLeave(EventArgs e) + { + OnDragLeave(e); + } #endif /// @@ -1851,14 +1851,14 @@ namespace OpenLiveWriter.Controls } #if false - /// - /// Raises the DragEnter event. - /// - /// A DragEventArgs that contains the event data. - protected virtual void OnDragEnter(DragEventArgs e) - { - RaiseEvent(DragEnterEventKey, e); - } + /// + /// Raises the DragEnter event. + /// + /// A DragEventArgs that contains the event data. + protected virtual void OnDragEnter(DragEventArgs e) + { + RaiseEvent(DragEnterEventKey, e); + } #endif /// @@ -1871,14 +1871,14 @@ namespace OpenLiveWriter.Controls } #if false - /// - /// Raises the DragLeave event. - /// - /// An EventArgs that contains the event data. - protected virtual void OnDragLeave(EventArgs e) - { - RaiseEvent(DragLeaveEventKey, e); - } + /// + /// Raises the DragLeave event. + /// + /// An EventArgs that contains the event data. + protected virtual void OnDragLeave(EventArgs e) + { + RaiseEvent(DragLeaveEventKey, e); + } #endif /// @@ -2064,8 +2064,8 @@ namespace OpenLiveWriter.Controls // causes anything applied to the lightweight control's virtual client // rectangle to be mapped to the lightweight control's on-screen bounds. GraphicsContainer graphicsContainer = e.Graphics.BeginContainer(/*lightweightControl.VirtualBounds, - lightweightControlVirtualClientRectangle, - GraphicsUnit.Pixel*/); + lightweightControlVirtualClientRectangle, + GraphicsUnit.Pixel*/); e.Graphics.TranslateTransform(lightweightControl.VirtualBounds.Location.X, lightweightControl.VirtualBounds.Location.Y); // Clip the graphics context to prevent the lightweight control from drawing @@ -2364,12 +2364,12 @@ namespace OpenLiveWriter.Controls get { /*ILightweightControlContainerControl parent = _control.lightweightControlContainerControl; - if(parent is Control) - return ((Control) parent).AccessibilityObject; - else if(parent is LightweightControl) - return ((LightweightControl) parent).AccessibilityObject; - else - return null;*/ + if(parent is Control) + return ((Control) parent).AccessibilityObject; + else if(parent is LightweightControl) + return ((LightweightControl) parent).AccessibilityObject; + else + return null;*/ Control parent = _control.Parent; if (parent != null) diff --git a/src/managed/OpenLiveWriter.Controls/LightweightControlContainerControl.cs b/src/managed/OpenLiveWriter.Controls/LightweightControlContainerControl.cs index 9a7c7664..6e6c9fa7 100644 --- a/src/managed/OpenLiveWriter.Controls/LightweightControlContainerControl.cs +++ b/src/managed/OpenLiveWriter.Controls/LightweightControlContainerControl.cs @@ -480,20 +480,20 @@ namespace OpenLiveWriter.Controls } #if false - /// - /// Gets or sets the shortcut menu associated with the control. - /// - public override ContextMenu ContextMenu - { - get - { - return base.ContextMenu; - } - set - { - base.ContextMenu = contextMenu = value; - } - } + /// + /// Gets or sets the shortcut menu associated with the control. + /// + public override ContextMenu ContextMenu + { + get + { + return base.ContextMenu; + } + set + { + base.ContextMenu = contextMenu = value; + } + } #endif /// @@ -1545,11 +1545,11 @@ namespace OpenLiveWriter.Controls // Set the mouse lightweight control. mouseLightweightControl = value; #if false - // The mouse lightweight control's context menu becomes this control's context menu. - if (mouseLightweightControl != null && mouseLightweightControl.ContextMenu != null) - base.ContextMenu = mouseLightweightControl.ContextMenu; - else - base.ContextMenu = contextMenu; + // The mouse lightweight control's context menu becomes this control's context menu. + if (mouseLightweightControl != null && mouseLightweightControl.ContextMenu != null) + base.ContextMenu = mouseLightweightControl.ContextMenu; + else + base.ContextMenu = contextMenu; #endif } } diff --git a/src/managed/OpenLiveWriter.Controls/LineBevelControl.cs b/src/managed/OpenLiveWriter.Controls/LineBevelControl.cs index 8592b242..e852bf43 100644 --- a/src/managed/OpenLiveWriter.Controls/LineBevelControl.cs +++ b/src/managed/OpenLiveWriter.Controls/LineBevelControl.cs @@ -8,69 +8,69 @@ using OpenLiveWriter.CoreServices; namespace OpenLiveWriter.Controls { - /// - /// Draws a beveled line. - /// - public class LineBevelControl : UserControl - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Draws a beveled line. + /// + public class LineBevelControl : UserControl + { + /// + /// Required designer variable. + /// + private Container components = null; - public LineBevelControl() - { - // This call is required by the Windows.Forms Form Designer. - InitializeComponent(); + public LineBevelControl() + { + // This call is required by the Windows.Forms Form Designer. + InitializeComponent(); - // TODO: Add any initialization after the InitializeComponent call - TabStop = false; - } + // TODO: Add any initialization after the InitializeComponent call + TabStop = false; + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // LineBevelControl - // - this.Name = "LineBevelControl"; - this.Size = new System.Drawing.Size(150, 12); + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // LineBevelControl + // + this.Name = "LineBevelControl"; + this.Size = new System.Drawing.Size(150, 12); - } - #endregion + } + #endregion - protected override void OnPaint(PaintEventArgs e) - { - Rectangle bevelRectangle = new Rectangle(0, Utility.CenterMinZero(bevel.Height, ClientRectangle.Height), ClientRectangle.Width, bevel.Height); - GraphicsHelper.TileFillUnscaledImageHorizontally(e.Graphics, bevel, bevelRectangle); - } - private readonly Bitmap bevel = ResourceHelper.LoadAssemblyResourceBitmap("Images.Application.GroupLabelBevel.png"); + protected override void OnPaint(PaintEventArgs e) + { + Rectangle bevelRectangle = new Rectangle(0, Utility.CenterMinZero(bevel.Height, ClientRectangle.Height), ClientRectangle.Width, bevel.Height); + GraphicsHelper.TileFillUnscaledImageHorizontally(e.Graphics, bevel, bevelRectangle); + } + private readonly Bitmap bevel = ResourceHelper.LoadAssemblyResourceBitmap("Images.Application.GroupLabelBevel.png"); - protected override void OnPaintBackground(PaintEventArgs pevent) - { - //paint the bevel background - using(Brush fillBrush = new SolidBrush(BackColor)) - pevent.Graphics.FillRectangle(fillBrush, ClientRectangle); - } + protected override void OnPaintBackground(PaintEventArgs pevent) + { + //paint the bevel background + using(Brush fillBrush = new SolidBrush(BackColor)) + pevent.Graphics.FillRectangle(fillBrush, ClientRectangle); + } - } + } } diff --git a/src/managed/OpenLiveWriter.Controls/OpenImageDialog.cs b/src/managed/OpenLiveWriter.Controls/OpenImageDialog.cs index 4d441515..7ed588e7 100644 --- a/src/managed/OpenLiveWriter.Controls/OpenImageDialog.cs +++ b/src/managed/OpenLiveWriter.Controls/OpenImageDialog.cs @@ -8,190 +8,186 @@ using OpenLiveWriter.Interop.Windows; namespace OpenLiveWriter.Controls { - /// - /// Wraps OpenFileDialog components to create an "Open Image" dialog that defaults - /// to the shell Thumbnail view - /// - public class OpenImageDialog : IDisposable - { - public OpenImageDialog() - { - // create the open file dialog - _openFileDialog = new OpenFileDialog(); + /// + /// Wraps OpenFileDialog components to create an "Open Image" dialog that defaults + /// to the shell Thumbnail view + /// + public class OpenImageDialog : IDisposable + { + public OpenImageDialog() + { + // create the open file dialog + _openFileDialog = new OpenFileDialog(); - // set some defaults appropriate for images - _openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures); - _openFileDialog.Filter = "Images Files (*.gif, *.jpg, *.jpeg, *.png)|*.gif;*.jpg;*.jpeg;*.png|All Files (*.*)|*.*" ; - _openFileDialog.CheckFileExists = true ; - _openFileDialog.CheckPathExists = true ; - _openFileDialog.DereferenceLinks = true ; - _openFileDialog.Multiselect = false ; - _openFileDialog.ValidateNames = true ; - } + // set some defaults appropriate for images + _openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures); + _openFileDialog.Filter = "Images Files (*.gif, *.jpg, *.jpeg, *.png)|*.gif;*.jpg;*.jpeg;*.png|All Files (*.*)|*.*" ; + _openFileDialog.CheckFileExists = true ; + _openFileDialog.CheckPathExists = true ; + _openFileDialog.DereferenceLinks = true ; + _openFileDialog.Multiselect = false ; + _openFileDialog.ValidateNames = true ; + } - public void Dispose() - { - if ( _openFileDialog != null ) - { - _openFileDialog.Dispose(); - _openFileDialog = null ; - } - } + public void Dispose() + { + if ( _openFileDialog != null ) + { + _openFileDialog.Dispose(); + _openFileDialog = null ; + } + } - /// - /// Provide passthrough for accessing properties of FileDialog - /// - public OpenFileDialog FileDialog - { - get - { - return _openFileDialog ; - } - } + /// + /// Provide passthrough for accessing properties of FileDialog + /// + public OpenFileDialog FileDialog + { + get + { + return _openFileDialog ; + } + } - /// - /// Show the dialog w/ appropriate hooks to change size and default view - /// - /// - /// - public DialogResult ShowDialog(IWin32Window parent) - { - // show the dialog (customizations happen in the DialogCreated event handler) - using (OpenFileDialogCreationListener creationListener = new OpenFileDialogCreationListener(parent) ) - { - // listen for creation of the dialog, when this happens we customize the - // appearance and behavior of the dialog as desired - creationListener.DialogCreated +=new EventHandler(creationListener_DialogCreated); + /// + /// Show the dialog w/ appropriate hooks to change size and default view + /// + /// + /// + public DialogResult ShowDialog(IWin32Window parent) + { + // show the dialog (customizations happen in the DialogCreated event handler) + using (OpenFileDialogCreationListener creationListener = new OpenFileDialogCreationListener(parent) ) + { + // listen for creation of the dialog, when this happens we customize the + // appearance and behavior of the dialog as desired + creationListener.DialogCreated +=new EventHandler(creationListener_DialogCreated); - // show the dialog and return the result - return _openFileDialog.ShowDialog(parent) ; - } - } + // show the dialog and return the result + return _openFileDialog.ShowDialog(parent) ; + } + } + + private void creationListener_DialogCreated(object sender, EventArgs e) + { + // get the dialog's handle + IntPtr hDialog = (sender as OpenFileDialogCreationListener).DialogHandle ; + + // switch to thumbnail view + SwitchToThumbnailView( hDialog ) ; + + // make the dialog larger so it shows 3 rows of thumbnails + PositionDialog( hDialog ) ; + } + + private void SwitchToThumbnailView( IntPtr hDialog ) + { + // This hack is based on the knowledge that within the standard open file dialog + // there is a control w/ class "SHELLDLL_DefView" which implements standard + // shell right-pane viewing. Documentation for the existence of this window can + // be found at: http://msdn.microsoft.com/msdnmag/issues/04/03/CQA/ + + // get handle of the special control + IntPtr hListView = User32.FindWindowEx(hDialog, IntPtr.Zero, "SHELLDLL_DefView", ""); + + // This control implements a set of WM_COMMAND messages which correspond to + // menu items on its view menu. By using Spy++ you can reverse engineer this + // enumeration (this is also described in the article referenced above). + + // send the message + User32.SendMessage(hListView, WM_COMMAND, FCIDM_SHVIEW.THUMBNAIL, IntPtr.Zero); + + // NOTE: there is at least one report from a developer of this technique not working + // (see comments at http://www.thecodeproject.com/cs/miscctrl/FileDialogExtender.asp). + // it is very likely that this technique is fragile accross OS version and/or + // installed shell customizations. + } + + private void PositionDialog( IntPtr hDialog ) + { + // desired dialog dimensions + const int DIALOG_HEIGHT = 565 ; + const int DIALOG_WIDTH = 650 ; + + // get existing dimensions + RECT dialogRect = new RECT(); + User32.GetWindowRect(hDialog, ref dialogRect ) ; + + // grow window size (note: will result in slightly off-center window however + // if we try to center the window it will flash/flicker while being moved) + User32.MoveWindow(hDialog, dialogRect.left, dialogRect.top, + DIALOG_WIDTH, + DIALOG_HEIGHT, + true ) ; + } + + private OpenFileDialog _openFileDialog = null ; + + // wm command message + private const uint WM_COMMAND = 0x0111 ; + + // reverse-engineered command codes for SHELLDLL_DefView + private class FCIDM_SHVIEW + { + public static readonly UIntPtr LARGEICON = new UIntPtr(0x7029) ; + public static readonly UIntPtr SMALLICON = new UIntPtr(0x702A) ; + public static readonly UIntPtr LIST = new UIntPtr(0x702B) ; + public static readonly UIntPtr REPORT = new UIntPtr(0x702C) ; + public static readonly UIntPtr THUMBNAIL = new UIntPtr(0x702D) ; + public static readonly UIntPtr TILE = new UIntPtr(0x702E) ; + } - private void creationListener_DialogCreated(object sender, EventArgs e) - { - // get the dialog's handle - IntPtr hDialog = (sender as OpenFileDialogCreationListener).DialogHandle ; + /// + /// Hook to detect the creation and window handle of the dialog. + /// + private class OpenFileDialogCreationListener : IDisposable + { + public OpenFileDialogCreationListener( IWin32Window parent ) + { + _subClasser = new WindowSubClasser(parent, new WndProcDelegate(WndProc)); + _subClasser.Install(); + } - // switch to thumbnail view - SwitchToThumbnailView( hDialog ) ; + public IntPtr WndProc( IntPtr hWnd, uint uMsg, UIntPtr wParam, IntPtr lParam ) + { + // detect the dialog's creation and record its window handle + if ( uMsg == WM_ENTERIDLE && wParam == MSGF_DIALOGBOX ) + { + // only do this once + if ( _dialogHandle == IntPtr.Zero ) + { + _dialogHandle = lParam ; - // make the dialog larger so it shows 3 rows of thumbnails - PositionDialog( hDialog ) ; - } + if ( DialogCreated != null ) + DialogCreated( this, EventArgs.Empty ) ; + } + } + return _subClasser.CallBaseWindowProc(hWnd, uMsg, wParam, lParam); + } - private void SwitchToThumbnailView( IntPtr hDialog ) - { - // This hack is based on the knowledge that within the standard open file dialog - // there is a control w/ class "SHELLDLL_DefView" which implements standard - // shell right-pane viewing. Documentation for the existence of this window can - // be found at: http://msdn.microsoft.com/msdnmag/issues/04/03/CQA/ + private WindowSubClasser _subClasser; - // get handle of the special control - IntPtr hListView = User32.FindWindowEx(hDialog, IntPtr.Zero, "SHELLDLL_DefView", ""); + public void Dispose() + { + _subClasser.Remove(); + } - // This control implements a set of WM_COMMAND messages which correspond to - // menu items on its view menu. By using Spy++ you can reverse engineer this - // enumeration (this is also described in the article referenced above). + public event EventHandler DialogCreated ; - // send the message - User32.SendMessage(hListView, WM_COMMAND, FCIDM_SHVIEW.THUMBNAIL, IntPtr.Zero); + public IntPtr DialogHandle + { + get + { + return _dialogHandle ; + } + } + private IntPtr _dialogHandle = IntPtr.Zero ; - // NOTE: there is at least one report from a developer of this technique not working - // (see comments at http://www.thecodeproject.com/cs/miscctrl/FileDialogExtender.asp). - // it is very likely that this technique is fragile accross OS version and/or - // installed shell customizations. - } + private const int WM_ENTERIDLE = 0x0121 ; + private static readonly UIntPtr MSGF_DIALOGBOX = UIntPtr.Zero ; + } - private void PositionDialog( IntPtr hDialog ) - { - // desired dialog dimensions - const int DIALOG_HEIGHT = 565 ; - const int DIALOG_WIDTH = 650 ; - - // get existing dimensions - RECT dialogRect = new RECT(); - User32.GetWindowRect(hDialog, ref dialogRect ) ; - - // grow window size (note: will result in slightly off-center window however - // if we try to center the window it will flash/flicker while being moved) - User32.MoveWindow(hDialog, dialogRect.left, dialogRect.top, - DIALOG_WIDTH, - DIALOG_HEIGHT, - true ) ; - } - - private OpenFileDialog _openFileDialog = null ; - - // wm command message - private const uint WM_COMMAND = 0x0111 ; - - // reverse-engineered command codes for SHELLDLL_DefView - private class FCIDM_SHVIEW - { - public static readonly UIntPtr LARGEICON = new UIntPtr(0x7029) ; - public static readonly UIntPtr SMALLICON = new UIntPtr(0x702A) ; - public static readonly UIntPtr LIST = new UIntPtr(0x702B) ; - public static readonly UIntPtr REPORT = new UIntPtr(0x702C) ; - public static readonly UIntPtr THUMBNAIL = new UIntPtr(0x702D) ; - public static readonly UIntPtr TILE = new UIntPtr(0x702E) ; - } - - - - /// - /// Hook to detect the creation and window handle of the dialog. - /// - private class OpenFileDialogCreationListener : IDisposable - { - public OpenFileDialogCreationListener( IWin32Window parent ) - { - _subClasser = new WindowSubClasser(parent, new WndProcDelegate(WndProc)); - _subClasser.Install(); - } - - public IntPtr WndProc( IntPtr hWnd, uint uMsg, UIntPtr wParam, IntPtr lParam ) - { - // detect the dialog's creation and record its window handle - if ( uMsg == WM_ENTERIDLE && wParam == MSGF_DIALOGBOX ) - { - // only do this once - if ( _dialogHandle == IntPtr.Zero ) - { - _dialogHandle = lParam ; - - if ( DialogCreated != null ) - DialogCreated( this, EventArgs.Empty ) ; - } - } - - return _subClasser.CallBaseWindowProc(hWnd, uMsg, wParam, lParam); - } - - private WindowSubClasser _subClasser; - - public void Dispose() - { - _subClasser.Remove(); - } - - public event EventHandler DialogCreated ; - - public IntPtr DialogHandle - { - get - { - return _dialogHandle ; - } - } - private IntPtr _dialogHandle = IntPtr.Zero ; - - private const int WM_ENTERIDLE = 0x0121 ; - private static readonly UIntPtr MSGF_DIALOGBOX = UIntPtr.Zero ; - } - - - } + } } diff --git a/src/managed/OpenLiveWriter.Controls/PositionContextMenuEventArgs.cs b/src/managed/OpenLiveWriter.Controls/PositionContextMenuEventArgs.cs index 1d7d5388..0ff3cb85 100644 --- a/src/managed/OpenLiveWriter.Controls/PositionContextMenuEventArgs.cs +++ b/src/managed/OpenLiveWriter.Controls/PositionContextMenuEventArgs.cs @@ -5,58 +5,58 @@ using System; namespace Project31.Controls { - /// - /// Provides data for the PositionContextMenu events. - /// - public class PositionContextMenuEventArgs : System.EventArgs - { - /// - /// The horizontal position of the context menu, in screen coordinates. - /// - private int x; + /// + /// Provides data for the PositionContextMenu events. + /// + public class PositionContextMenuEventArgs : System.EventArgs + { + /// + /// The horizontal position of the context menu, in screen coordinates. + /// + private int x; - /// - /// The vertical position of the context menu, in screen coordinates. - /// - private int y; + /// + /// The vertical position of the context menu, in screen coordinates. + /// + private int y; - /// - /// Gets or sets the horizontal position of the context menu, in screen coordinates. - /// - public int X - { - get - { - return x; - } - set - { - x = value; - } - } + /// + /// Gets or sets the horizontal position of the context menu, in screen coordinates. + /// + public int X + { + get + { + return x; + } + set + { + x = value; + } + } - /// - /// Gets or sets the vertical position of the context menu, in screen coordinates. - /// - public int Y - { - get - { - return y; - } - set - { - y = value; - } - } + /// + /// Gets or sets the vertical position of the context menu, in screen coordinates. + /// + public int Y + { + get + { + return y; + } + set + { + y = value; + } + } - /// - /// Initializes a new instance of the PositionContextMenuEventArgs class. - /// - public PositionContextMenuEventArgs(int x, int y) - { - this.x = x; - this.y = y; - } - } + /// + /// Initializes a new instance of the PositionContextMenuEventArgs class. + /// + public PositionContextMenuEventArgs(int x, int y) + { + this.x = x; + this.y = y; + } + } } diff --git a/src/managed/OpenLiveWriter.Controls/SidebarListBox.cs b/src/managed/OpenLiveWriter.Controls/SidebarListBox.cs index 713237b7..5166b180 100644 --- a/src/managed/OpenLiveWriter.Controls/SidebarListBox.cs +++ b/src/managed/OpenLiveWriter.Controls/SidebarListBox.cs @@ -15,7 +15,7 @@ namespace OpenLiveWriter.Controls /// Type T is the type of the objects each entry in the list will hold. /// /// - public class SidebarListBox : ListBox + public class SidebarListBox : ListBox { #region Initialization and Cleanup @@ -136,7 +136,6 @@ namespace OpenLiveWriter.Controls // draw caption g.DrawText(item.Name, e.Font, layoutRectangle, textColor, TextFormatFlags.EndEllipsis | TextFormatFlags.HorizontalCenter | TextFormatFlags.WordBreak); - // draw focus rectange if necessary e.DrawFocusRectangle(); } @@ -177,7 +176,6 @@ namespace OpenLiveWriter.Controls return ScaleY(LARGE_TOP_INSET) + ScaleY(40) + ScaleY(ELEMENT_PADDING) + textHeight + ScaleY(LARGE_BOTTOM_INSET); } - #endregion #region Accessibility diff --git a/src/managed/OpenLiveWriter.Controls/TrackingToolTip.cs b/src/managed/OpenLiveWriter.Controls/TrackingToolTip.cs index 81e2dc71..388b8371 100644 --- a/src/managed/OpenLiveWriter.Controls/TrackingToolTip.cs +++ b/src/managed/OpenLiveWriter.Controls/TrackingToolTip.cs @@ -243,7 +243,6 @@ namespace OpenLiveWriter.Controls GC.KeepAlive(this); } - /// /// Dispose the tool /// @@ -290,6 +289,5 @@ namespace OpenLiveWriter.Controls } } - } diff --git a/src/managed/OpenLiveWriter.Controls/TransparentLinkLabel.cs b/src/managed/OpenLiveWriter.Controls/TransparentLinkLabel.cs index dadba86f..22d73da6 100644 --- a/src/managed/OpenLiveWriter.Controls/TransparentLinkLabel.cs +++ b/src/managed/OpenLiveWriter.Controls/TransparentLinkLabel.cs @@ -7,13 +7,13 @@ using System.Windows.Forms; namespace OpenLiveWriter.Controls { - public class TransparentLinkLabel : LinkLabel - { - public TransparentLinkLabel() - { - SetStyle(ControlStyles.SupportsTransparentBackColor, true); - BackColor = Color.Transparent ; - FlatStyle = FlatStyle.System ; - } - } + public class TransparentLinkLabel : LinkLabel + { + public TransparentLinkLabel() + { + SetStyle(ControlStyles.SupportsTransparentBackColor, true); + BackColor = Color.Transparent ; + FlatStyle = FlatStyle.System ; + } + } } diff --git a/src/managed/OpenLiveWriter.Controls/Wizard/WizardController.cs b/src/managed/OpenLiveWriter.Controls/Wizard/WizardController.cs index c905a6f7..6b9c28de 100644 --- a/src/managed/OpenLiveWriter.Controls/Wizard/WizardController.cs +++ b/src/managed/OpenLiveWriter.Controls/Wizard/WizardController.cs @@ -384,7 +384,6 @@ namespace OpenLiveWriter.Controls.Wizard } } - private string nextButtonLabel; /// /// Sets the text on the Next Button. diff --git a/src/managed/OpenLiveWriter.CoreServices/AppIconCache.cs b/src/managed/OpenLiveWriter.CoreServices/AppIconCache.cs index 9b658235..8eec47f1 100644 --- a/src/managed/OpenLiveWriter.CoreServices/AppIconCache.cs +++ b/src/managed/OpenLiveWriter.CoreServices/AppIconCache.cs @@ -14,75 +14,75 @@ using Project31.Interop.Windows; namespace Project31.CoreServices { - /// - /// A utility that loads and caches Icons - /// - [Obsolete("Use ShellHelper Icon methods instead (produce more correct/complete results)", true )] - public class AppIconCache - { - /// - /// Gets an Icon based upon the progId of a particular application - /// - /// The progId for which is locate the Icon - /// The appropriate default Icon - public static Icon GetIconFromProgId(string progId) - { - if (progId == null || !m_icons.ContainsKey(progId)) - { - IntPtr hInstance = Marshal.GetHINSTANCE(typeof(AppIconCache).Module); + /// + /// A utility that loads and caches Icons + /// + [Obsolete("Use ShellHelper Icon methods instead (produce more correct/complete results)", true )] + public class AppIconCache + { + /// + /// Gets an Icon based upon the progId of a particular application + /// + /// The progId for which is locate the Icon + /// The appropriate default Icon + public static Icon GetIconFromProgId(string progId) + { + if (progId == null || !m_icons.ContainsKey(progId)) + { + IntPtr hInstance = Marshal.GetHINSTANCE(typeof(AppIconCache).Module); - string IconPath = GetDefaultIconPath(progId); - if (IconPath != null) - { - string[] iconInfo = IconPath.Split(','); - IntPtr hIcon = Shell32.ExtractIcon(hInstance, iconInfo[0], Convert.ToInt32(iconInfo[1])); - Icon icon = Icon.FromHandle(hIcon); - if (progId == null) - return icon; - m_icons[progId] = icon; - } - else - { - if (progId == null) - return null; - m_icons[progId] = null; - } - } - return (Icon) m_icons[progId]; - } + string IconPath = GetDefaultIconPath(progId); + if (IconPath != null) + { + string[] iconInfo = IconPath.Split(','); + IntPtr hIcon = Shell32.ExtractIcon(hInstance, iconInfo[0], Convert.ToInt32(iconInfo[1])); + Icon icon = Icon.FromHandle(hIcon); + if (progId == null) + return icon; + m_icons[progId] = icon; + } + else + { + if (progId == null) + return null; + m_icons[progId] = null; + } + } + return (Icon) m_icons[progId]; + } - public static Icon GetUnknownIcon() - { - return GetIconFromProgId(null); - } + public static Icon GetUnknownIcon() + { + return GetIconFromProgId(null); + } - /// - /// Gets the path and index to a default icon based upon a progId - /// - /// The progId - /// A string representing the path to the default icon - private static string GetDefaultIconPath(string progId) - { - if (progId == null) - { - return Environment.SystemDirectory + @"\Shell32.dll,0"; - } + /// + /// Gets the path and index to a default icon based upon a progId + /// + /// The progId + /// A string representing the path to the default icon + private static string GetDefaultIconPath(string progId) + { + if (progId == null) + { + return Environment.SystemDirectory + @"\Shell32.dll,0"; + } - string iconPath = null; - RegistryKey progKey = Registry.ClassesRoot.OpenSubKey(progId); - if (progKey != null) - { - RegistryKey openKey = progKey.OpenSubKey("DefaultIcon"); - if (openKey != null) - iconPath = (string) openKey.GetValue(null); - } - return iconPath; - } + string iconPath = null; + RegistryKey progKey = Registry.ClassesRoot.OpenSubKey(progId); + if (progKey != null) + { + RegistryKey openKey = progKey.OpenSubKey("DefaultIcon"); + if (openKey != null) + iconPath = (string) openKey.GetValue(null); + } + return iconPath; + } - /// - /// Cached set of application icons - /// - private static Hashtable m_icons = Hashtable.Synchronized(new Hashtable()); - } + /// + /// Cached set of application icons + /// + private static Hashtable m_icons = Hashtable.Synchronized(new Hashtable()); + } } diff --git a/src/managed/OpenLiveWriter.CoreServices/ApplicationEnvironment.cs b/src/managed/OpenLiveWriter.CoreServices/ApplicationEnvironment.cs index 6457b50c..e17a06bc 100644 --- a/src/managed/OpenLiveWriter.CoreServices/ApplicationEnvironment.cs +++ b/src/managed/OpenLiveWriter.CoreServices/ApplicationEnvironment.cs @@ -434,7 +434,7 @@ namespace OpenLiveWriter.CoreServices #if DEBUG _logFilePath = Environment.GetFolderPath(Environment.SpecialFolder.Personal); #else - _logFilePath = LocalApplicationDataDirectory ; + _logFilePath = LocalApplicationDataDirectory ; #endif _logFilePath = Path.Combine(_logFilePath, String.Format(CultureInfo.InvariantCulture, "{0}.log", ProductName)); diff --git a/src/managed/OpenLiveWriter.CoreServices/AsyncOperation.cs b/src/managed/OpenLiveWriter.CoreServices/AsyncOperation.cs index 9e4db24d..de9f6268 100644 --- a/src/managed/OpenLiveWriter.CoreServices/AsyncOperation.cs +++ b/src/managed/OpenLiveWriter.CoreServices/AsyncOperation.cs @@ -229,7 +229,6 @@ namespace OpenLiveWriter.CoreServices /// public event ProgressUpdatedEventHandler ProgressUpdated; - /// /// The ISynchronizeTarget supplied during construction - this can /// be used by deriving classes which wish to add their own events. @@ -422,7 +421,6 @@ namespace OpenLiveWriter.CoreServices } } - // Utility function for firing an event through the target. // It uses C#'s variable length parameter list support // to build the parameter list. @@ -466,7 +464,6 @@ namespace OpenLiveWriter.CoreServices { } } - /// /// Delegeate for handling Progress notification /// diff --git a/src/managed/OpenLiveWriter.CoreServices/BitmapHelper.cs b/src/managed/OpenLiveWriter.CoreServices/BitmapHelper.cs index 740be5f8..4adb7fd0 100644 --- a/src/managed/OpenLiveWriter.CoreServices/BitmapHelper.cs +++ b/src/managed/OpenLiveWriter.CoreServices/BitmapHelper.cs @@ -6,44 +6,44 @@ using System.Drawing; namespace Project31.CoreServices { - /// - /// Bitmap operation helper. - /// - public class BitmapHelper - { - /// - /// Initializes a new instance of the BitmapHelper class. - /// - private BitmapHelper() - { - } + /// + /// Bitmap operation helper. + /// + public class BitmapHelper + { + /// + /// Initializes a new instance of the BitmapHelper class. + /// + private BitmapHelper() + { + } - /// - /// Converts the input bitmap into a grayscale bitmap. The input bitmap is not modified. - /// - /// Input bitmap. - /// Grayscale version of the input bitmap. - public static Bitmap ToGrayscale(Bitmap input) - { - // Create the output bitmap. - Bitmap output = new Bitmap(input.Width, input.Height); + /// + /// Converts the input bitmap into a grayscale bitmap. The input bitmap is not modified. + /// + /// Input bitmap. + /// Grayscale version of the input bitmap. + public static Bitmap ToGrayscale(Bitmap input) + { + // Create the output bitmap. + Bitmap output = new Bitmap(input.Width, input.Height); - // Convert the pixels. - for (int x = 0; x < output.Width; x++) - for (int y = 0; y < output.Height; y++) - { - // Get the input pixel color. - Color color = input.GetPixel(x, y); + // Convert the pixels. + for (int x = 0; x < output.Width; x++) + for (int y = 0; y < output.Height; y++) + { + // Get the input pixel color. + Color color = input.GetPixel(x, y); - // Compute the grayscale value as the average of the RGB values. - byte grayscale = (byte)(((int)color.R + (int)color.G + (int)color.B)/3); + // Compute the grayscale value as the average of the RGB values. + byte grayscale = (byte)(((int)color.R + (int)color.G + (int)color.B)/3); - // Set the output pixel. - output.SetPixel(x, y, Color.FromArgb(color.A, grayscale, grayscale, grayscale)); - } + // Set the output pixel. + output.SetPixel(x, y, Color.FromArgb(color.A, grayscale, grayscale, grayscale)); + } - // Done. Return the output bitmap. - return output; - } - } + // Done. Return the output bitmap. + return output; + } + } } diff --git a/src/managed/OpenLiveWriter.CoreServices/CancelableStream.cs b/src/managed/OpenLiveWriter.CoreServices/CancelableStream.cs index c0ebca10..3e6bc8c3 100644 --- a/src/managed/OpenLiveWriter.CoreServices/CancelableStream.cs +++ b/src/managed/OpenLiveWriter.CoreServices/CancelableStream.cs @@ -20,7 +20,6 @@ namespace OpenLiveWriter.CoreServices _innerStream = innerStream; } - public override bool CanRead { get diff --git a/src/managed/OpenLiveWriter.CoreServices/ColorHelper.cs b/src/managed/OpenLiveWriter.CoreServices/ColorHelper.cs index 51fba3fa..64ce655d 100644 --- a/src/managed/OpenLiveWriter.CoreServices/ColorHelper.cs +++ b/src/managed/OpenLiveWriter.CoreServices/ColorHelper.cs @@ -51,7 +51,6 @@ namespace OpenLiveWriter.CoreServices } - /// /// Adjusts the brightness of the specified color. Works like the Photoshop Hue/Saturation /// dialog box. diff --git a/src/managed/OpenLiveWriter.CoreServices/CommandLineHelper.cs b/src/managed/OpenLiveWriter.CoreServices/CommandLineHelper.cs index f14df35f..aaabf5b5 100644 --- a/src/managed/OpenLiveWriter.CoreServices/CommandLineHelper.cs +++ b/src/managed/OpenLiveWriter.CoreServices/CommandLineHelper.cs @@ -9,66 +9,66 @@ namespace OpenLiveWriter.CoreServices { #if FALSE // imprve code coverage number /// - /// Summary description for CommandLineHelper. - /// - public class CommandLineHelper - { - public static string DropFirstArg(string cmdLine, out string firstArg) - { - char[] ws = {' ', '\t'}; + /// Summary description for CommandLineHelper. + /// + public class CommandLineHelper + { + public static string DropFirstArg(string cmdLine, out string firstArg) + { + char[] ws = {' ', '\t'}; - cmdLine = cmdLine.TrimStart(ws); + cmdLine = cmdLine.TrimStart(ws); - const int STATE_BEGIN = 0; - const int STATE_INARG = 1; - const int STATE_INQARG = 2; + const int STATE_BEGIN = 0; + const int STATE_INARG = 1; + const int STATE_INQARG = 2; - int state = STATE_BEGIN; + int state = STATE_BEGIN; - for (int i = 0; i < cmdLine.Length; i++) - { - char c = cmdLine[i]; - switch (state) - { - case STATE_BEGIN: - switch (c) - { - case '"': - state = STATE_INQARG; - break; - case ' ': - case '\t': - break; - default: - state = STATE_INARG; - break; - } - break; - case STATE_INARG: - switch (c) - { - case '"': - state = STATE_INQARG; - break; - case ' ': - case '\t': - firstArg = cmdLine.Substring(0, i); - return cmdLine.Substring(i+1).TrimStart(ws); - } - break; - case STATE_INQARG: - switch (c) - { - case '"': - firstArg = cmdLine.Substring(0, i+1); - return cmdLine.Substring(i+1).TrimStart(ws); - } - break; - } - } - firstArg = cmdLine; - return ""; - } - } + for (int i = 0; i < cmdLine.Length; i++) + { + char c = cmdLine[i]; + switch (state) + { + case STATE_BEGIN: + switch (c) + { + case '"': + state = STATE_INQARG; + break; + case ' ': + case '\t': + break; + default: + state = STATE_INARG; + break; + } + break; + case STATE_INARG: + switch (c) + { + case '"': + state = STATE_INQARG; + break; + case ' ': + case '\t': + firstArg = cmdLine.Substring(0, i); + return cmdLine.Substring(i+1).TrimStart(ws); + } + break; + case STATE_INQARG: + switch (c) + { + case '"': + firstArg = cmdLine.Substring(0, i+1); + return cmdLine.Substring(i+1).TrimStart(ws); + } + break; + } + } + firstArg = cmdLine; + return ""; + } + } #endif } diff --git a/src/managed/OpenLiveWriter.CoreServices/ComponentRootDesigner.cs b/src/managed/OpenLiveWriter.CoreServices/ComponentRootDesigner.cs index e5cafc70..adf3b2fa 100644 --- a/src/managed/OpenLiveWriter.CoreServices/ComponentRootDesigner.cs +++ b/src/managed/OpenLiveWriter.CoreServices/ComponentRootDesigner.cs @@ -5,38 +5,38 @@ using System.Windows.Forms.Design; namespace OpenLiveWriter.CoreServices { - public class ComponentRootDesigner : ComponentDocumentDesigner - { - // Stores reference to the LocalizationExtenderProvider this designer adds, in order to remove it on Dispose. - private LocalizationExtenderProvider localizationExtenderProvider; + public class ComponentRootDesigner : ComponentDocumentDesigner + { + // Stores reference to the LocalizationExtenderProvider this designer adds, in order to remove it on Dispose. + private LocalizationExtenderProvider localizationExtenderProvider; - // Adds a LocalizationExtenderProvider for the component this designer is initialized to support. - public override void Initialize(IComponent component) - { - base.Initialize(component); + // Adds a LocalizationExtenderProvider for the component this designer is initialized to support. + public override void Initialize(IComponent component) + { + base.Initialize(component); - // If no extender from this designer is active... - if (localizationExtenderProvider == null) - { - // Adds a LocalizationExtenderProvider that provides localization support properties to the specified component. - localizationExtenderProvider = new LocalizationExtenderProvider(component.Site, component); - } - } + // If no extender from this designer is active... + if (localizationExtenderProvider == null) + { + // Adds a LocalizationExtenderProvider that provides localization support properties to the specified component. + localizationExtenderProvider = new LocalizationExtenderProvider(component.Site, component); + } + } - // If a LocalizationExtenderProvider has been added, removes the extender provider. - protected override void Dispose(bool disposing) - { - base.Dispose(disposing); + // If a LocalizationExtenderProvider has been added, removes the extender provider. + protected override void Dispose(bool disposing) + { + base.Dispose(disposing); - // If an extender has been added, remove it - if (localizationExtenderProvider != null) - { - // Disposes of the extender provider. The extender - // provider removes itself from the extender provider - // service when it is disposed. - localizationExtenderProvider.Dispose(); - localizationExtenderProvider = null; - } - } - } + // If an extender has been added, remove it + if (localizationExtenderProvider != null) + { + // Disposes of the extender provider. The extender + // provider removes itself from the extender provider + // service when it is disposed. + localizationExtenderProvider.Dispose(); + localizationExtenderProvider = null; + } + } + } } diff --git a/src/managed/OpenLiveWriter.CoreServices/ControlHelper.cs b/src/managed/OpenLiveWriter.CoreServices/ControlHelper.cs index 8d74a7b9..a18b057a 100644 --- a/src/managed/OpenLiveWriter.CoreServices/ControlHelper.cs +++ b/src/managed/OpenLiveWriter.CoreServices/ControlHelper.cs @@ -105,7 +105,6 @@ namespace OpenLiveWriter.CoreServices return scale; } - /// /// Walks a tree of controls, executing the provided delegate on /// each control it encounters. diff --git a/src/managed/OpenLiveWriter.CoreServices/DataObject/DataObjectMeister.cs b/src/managed/OpenLiveWriter.CoreServices/DataObject/DataObjectMeister.cs index 9ad42e3d..79005336 100644 --- a/src/managed/OpenLiveWriter.CoreServices/DataObject/DataObjectMeister.cs +++ b/src/managed/OpenLiveWriter.CoreServices/DataObject/DataObjectMeister.cs @@ -158,7 +158,6 @@ namespace OpenLiveWriter.CoreServices } private Hashtable m_metaData = new Hashtable(); - public LightWeightHTMLDocumentData LightWeightHTMLDocumentData { get diff --git a/src/managed/OpenLiveWriter.CoreServices/DataObject/FileContentsHelper.cs b/src/managed/OpenLiveWriter.CoreServices/DataObject/FileContentsHelper.cs index 020d8652..d55726b8 100644 --- a/src/managed/OpenLiveWriter.CoreServices/DataObject/FileContentsHelper.cs +++ b/src/managed/OpenLiveWriter.CoreServices/DataObject/FileContentsHelper.cs @@ -108,7 +108,6 @@ namespace OpenLiveWriter.CoreServices } } - /// /// TYMEDs supported by CF_FILECONTENTS /// diff --git a/src/managed/OpenLiveWriter.CoreServices/DataObject/FileDataObject.cs b/src/managed/OpenLiveWriter.CoreServices/DataObject/FileDataObject.cs index a77fc6ac..b6cc6c10 100644 --- a/src/managed/OpenLiveWriter.CoreServices/DataObject/FileDataObject.cs +++ b/src/managed/OpenLiveWriter.CoreServices/DataObject/FileDataObject.cs @@ -5,21 +5,21 @@ using System.Windows.Forms; namespace OpenLiveWriter.CoreServices { - /// - /// Summary description for FileDataObject. - /// - public class FileDataObject : DataObjectBase - { + /// + /// Summary description for FileDataObject. + /// + public class FileDataObject : DataObjectBase + { - /// - /// Creates a new fileDataObject based upon a string array of paths - /// - /// The paths to the files from which to - /// construct the file data object. - public FileDataObject(string[] paths) - { - IDataObject = new DataObject(DataFormats.FileDrop, paths); - } - } + /// + /// Creates a new fileDataObject based upon a string array of paths + /// + /// The paths to the files from which to + /// construct the file data object. + public FileDataObject(string[] paths) + { + IDataObject = new DataObject(DataFormats.FileDrop, paths); + } + } } diff --git a/src/managed/OpenLiveWriter.CoreServices/DataObject/FileItemFromFileContents.cs b/src/managed/OpenLiveWriter.CoreServices/DataObject/FileItemFromFileContents.cs index 2c8732d5..9f66ec55 100644 --- a/src/managed/OpenLiveWriter.CoreServices/DataObject/FileItemFromFileContents.cs +++ b/src/managed/OpenLiveWriter.CoreServices/DataObject/FileItemFromFileContents.cs @@ -248,7 +248,6 @@ namespace OpenLiveWriter.CoreServices File.Copy(srcFileName, destFileName); } - /// /// Copy a global memory block into a file /// diff --git a/src/managed/OpenLiveWriter.CoreServices/DataObject/HTMLData.cs b/src/managed/OpenLiveWriter.CoreServices/DataObject/HTMLData.cs index b4e533c2..471a4d28 100644 --- a/src/managed/OpenLiveWriter.CoreServices/DataObject/HTMLData.cs +++ b/src/managed/OpenLiveWriter.CoreServices/DataObject/HTMLData.cs @@ -444,7 +444,6 @@ namespace OpenLiveWriter.CoreServices // Hashtable caches headers as they get read private Hashtable m_HTMLFormatHeaders = new Hashtable(StringComparer.OrdinalIgnoreCase); - /// /// Helper function to extract and UTF8-decode the underlying CF_HTML. /// @@ -486,7 +485,6 @@ namespace OpenLiveWriter.CoreServices } private byte[] m_HTMLBytes; - /// /// Retrieves the bytes representing the data in the HTML format of the HTMLData's /// IDataObject. diff --git a/src/managed/OpenLiveWriter.CoreServices/DataObject/OleDataObject.cs b/src/managed/OpenLiveWriter.CoreServices/DataObject/OleDataObject.cs index ee15046c..0bf5de9e 100644 --- a/src/managed/OpenLiveWriter.CoreServices/DataObject/OleDataObject.cs +++ b/src/managed/OpenLiveWriter.CoreServices/DataObject/OleDataObject.cs @@ -213,7 +213,6 @@ namespace OpenLiveWriter.CoreServices return null; } - /// /// Converter helper function to extract a field from an object /// This code Asserts the ReflectionPermission so that it can reflect over diff --git a/src/managed/OpenLiveWriter.CoreServices/DataObject/OleDataObjectImpl.cs b/src/managed/OpenLiveWriter.CoreServices/DataObject/OleDataObjectImpl.cs index 9053fb5e..56697063 100644 --- a/src/managed/OpenLiveWriter.CoreServices/DataObject/OleDataObjectImpl.cs +++ b/src/managed/OpenLiveWriter.CoreServices/DataObject/OleDataObjectImpl.cs @@ -147,7 +147,6 @@ namespace OpenLiveWriter.CoreServices return DATA_S.SAMEFORMATETC; } - /// /// Provides the source data object with data described by a FORMATETC /// structure and an STGMEDIUM structure @@ -285,7 +284,6 @@ namespace OpenLiveWriter.CoreServices return OLE_E.ADVISENOTSUPPORTED; } - /// /// Private helper method to find an existing data format /// @@ -391,7 +389,6 @@ namespace OpenLiveWriter.CoreServices } - /// /// Class which represents a data entry being managed by this class /// @@ -406,7 +403,6 @@ namespace OpenLiveWriter.CoreServices public STGMEDIUM stgm = new STGMEDIUM(); } - /// /// Implementation of IEnumFORMATETC for OleDataEntry list /// @@ -453,7 +449,6 @@ namespace OpenLiveWriter.CoreServices return HRESULT.S_FALSE; } - /// /// Skip the next celt entries /// @@ -498,7 +493,6 @@ namespace OpenLiveWriter.CoreServices /// private int currentItem = -1; - } } diff --git a/src/managed/OpenLiveWriter.CoreServices/DataObject/OleStgMedium.cs b/src/managed/OpenLiveWriter.CoreServices/DataObject/OleStgMedium.cs index 8ded6aa2..4a2bf722 100644 --- a/src/managed/OpenLiveWriter.CoreServices/DataObject/OleStgMedium.cs +++ b/src/managed/OpenLiveWriter.CoreServices/DataObject/OleStgMedium.cs @@ -312,5 +312,4 @@ namespace OpenLiveWriter.CoreServices private Storage m_storage = null; } - } diff --git a/src/managed/OpenLiveWriter.CoreServices/DataObject/SearchReferrerChain.cs b/src/managed/OpenLiveWriter.CoreServices/DataObject/SearchReferrerChain.cs index deba48da..419e801a 100644 --- a/src/managed/OpenLiveWriter.CoreServices/DataObject/SearchReferrerChain.cs +++ b/src/managed/OpenLiveWriter.CoreServices/DataObject/SearchReferrerChain.cs @@ -9,296 +9,294 @@ using Microsoft.Win32; namespace Project31.CoreServices { - /// - /// A referrer chain holds a table of referrers for urls - /// - [Serializable] - public class SearchReferrerChain - { - /// - /// The namespace that holds the referrer chain - /// - public static string REFERRER_NAMESPACE = "Project31"; + /// + /// A referrer chain holds a table of referrers for urls + /// + [Serializable] + public class SearchReferrerChain + { + /// + /// The namespace that holds the referrer chain + /// + public static string REFERRER_NAMESPACE = "Project31"; - /// - /// The name that holds the referrer chain - /// - public static string REFERRER_NAME = "ReferrerChain"; + /// + /// The name that holds the referrer chain + /// + public static string REFERRER_NAME = "ReferrerChain"; - /// - /// Constructs a new referrer chain - /// - private SearchReferrerChain() - { - } + /// + /// Constructs a new referrer chain + /// + private SearchReferrerChain() + { + } - private static SearchReferrerChain singleton = new SearchReferrerChain(); - public static SearchReferrerChain Instance - { - get - { - return singleton; - } - } - private static ExplorerUrlTracker explorerUrlTracker = new ExplorerUrlTracker(); + private static SearchReferrerChain singleton = new SearchReferrerChain(); + public static SearchReferrerChain Instance + { + get + { + return singleton; + } + } + private static ExplorerUrlTracker explorerUrlTracker = new ExplorerUrlTracker(); - /// - /// Adds an entry to the referrerChain. Note that entries are only added to the referrer chain - /// if they are either a search or parented by something already in the referrer chain. - /// - /// The url to add - /// The url's referrer - public void Add(string url, string referrer) - { - if (referrer == null) - referrer = string.Empty; + /// + /// Adds an entry to the referrerChain. Note that entries are only added to the referrer chain + /// if they are either a search or parented by something already in the referrer chain. + /// + /// The url to add + /// The url's referrer + public void Add(string url, string referrer) + { + if (referrer == null) + referrer = string.Empty; - // Add the item if it is a search or a descendant of a search - if (IsSearchUrl(url)) - explorerUrlTracker.AddUrl(new ExplorerUrlTracker.UrlInfo(url, null)); - else if ( ContainsReferrer(referrer) ) - explorerUrlTracker.AddUrl(new ExplorerUrlTracker.UrlInfo(url, referrer)); - } + // Add the item if it is a search or a descendant of a search + if (IsSearchUrl(url)) + explorerUrlTracker.AddUrl(new ExplorerUrlTracker.UrlInfo(url, null)); + else if ( ContainsReferrer(referrer) ) + explorerUrlTracker.AddUrl(new ExplorerUrlTracker.UrlInfo(url, referrer)); + } - /// - /// Finds a search spec for a given url. - /// - /// The url to find the search spec for - /// The matching searc spec, null if no search spec could be found. - public SearchSpec FindSearchSpec(string url) - { - string parent = FindParent(url, m_urlList.Length - 1); + /// + /// Finds a search spec for a given url. + /// + /// The url to find the search spec for + /// The matching searc spec, null if no search spec could be found. + public SearchSpec FindSearchSpec(string url) + { + string parent = FindParent(url, m_urlList.Length - 1); - // Only return a search spec if the url isn't itself a search - if (parent != url) - return GetSearchSpec(parent); - else - return null; - } + // Only return a search spec if the url isn't itself a search + if (parent != url) + return GetSearchSpec(parent); + else + return null; + } + /// + /// Tests the url against the system provided search descriptors and returns the first matching + /// search spec (if any). + /// + /// The url to test + /// The first matching spec, null if no search spec could be matched + private SearchSpec GetSearchSpec(string url) + { + SearchSpec searchSpec = null; + foreach (SearchDescriptor searchDescriptor in SearchDescriptors) + { + if (IsSearchUrl(url, searchDescriptor)) + { + string keywords = (string)UrlHelper.GetQueryParams(url)[searchDescriptor.KeyWordQueryParam]; - /// - /// Tests the url against the system provided search descriptors and returns the first matching - /// search spec (if any). - /// - /// The url to test - /// The first matching spec, null if no search spec could be matched - private SearchSpec GetSearchSpec(string url) - { - SearchSpec searchSpec = null; - foreach (SearchDescriptor searchDescriptor in SearchDescriptors) - { - if (IsSearchUrl(url, searchDescriptor)) - { - string keywords = (string)UrlHelper.GetQueryParams(url)[searchDescriptor.KeyWordQueryParam]; + searchSpec = new SearchSpec(); + searchSpec.SearchProviderName = searchDescriptor.SearchProviderName; + searchSpec.SearchUrl = url; + searchSpec.Keywords = keywords.Split('+'); + break; + } - searchSpec = new SearchSpec(); - searchSpec.SearchProviderName = searchDescriptor.SearchProviderName; - searchSpec.SearchUrl = url; - searchSpec.Keywords = keywords.Split('+'); - break; - } + } + return searchSpec; + } - } - return searchSpec; - } + /// + /// Determines if the url is a search url + /// + /// the url to test + /// true if the url is a search url, otherwise false + private bool IsSearchUrl(string url) + { + if (GetSearchSpec(url) != null) + return true; + else + return false; + } - /// - /// Determines if the url is a search url - /// - /// the url to test - /// true if the url is a search url, otherwise false - private bool IsSearchUrl(string url) - { - if (GetSearchSpec(url) != null) - return true; - else - return false; - } + /// + /// Determines if a search url is a specific search + /// + /// The url to test + /// The search descriptor to use to determine if the url + /// is a search + /// true if the url is a search, otherwise false + private bool IsSearchUrl(string url, SearchDescriptor searchDescriptor) + { + Hashtable t = UrlHelper.GetQueryParams(url); + Uri uri = new Uri(url); + if (uri.GetLeftPart(UriPartial.Path).IndexOf(searchDescriptor.BaseUrlMatch) > -1 + && UrlHelper.GetQueryParams(url).ContainsKey(searchDescriptor.KeyWordQueryParam)) + return true; + else + return false; + } + /// + /// Finds the parent of the url + /// + /// The url to find the parent of + /// The location in the referrers to start looking (reverse lookup) + /// The parent url + private string FindParent(string url, int startingIndex) + { + string referrer = string.Empty; + int urlIndex = GetUrlIndex(url, startingIndex); + if (urlIndex > -1) + referrer = m_urlList[urlIndex].Referrer; - /// - /// Determines if a search url is a specific search - /// - /// The url to test - /// The search descriptor to use to determine if the url - /// is a search - /// true if the url is a search, otherwise false - private bool IsSearchUrl(string url, SearchDescriptor searchDescriptor) - { - Hashtable t = UrlHelper.GetQueryParams(url); - Uri uri = new Uri(url); - if (uri.GetLeftPart(UriPartial.Path).IndexOf(searchDescriptor.BaseUrlMatch) > -1 - && UrlHelper.GetQueryParams(url).ContainsKey(searchDescriptor.KeyWordQueryParam)) - return true; - else - return false; - } + if (referrer == string.Empty) + return url; + else + return FindParent(referrer, urlIndex); + } - /// - /// Finds the parent of the url - /// - /// The url to find the parent of - /// The location in the referrers to start looking (reverse lookup) - /// The parent url - private string FindParent(string url, int startingIndex) - { - string referrer = string.Empty; - int urlIndex = GetUrlIndex(url, startingIndex); - if (urlIndex > -1) - referrer = m_urlList[urlIndex].Referrer; + /// + /// Searches the referrer list for a specific url. Note that this searches + /// backwards through the list from the given starting index. + /// + /// The url to locate + /// The index in the referrers at which to start looking + /// The index to the url, -1 if the url couldn't be found + private int GetUrlIndex(string url, int startingIndex) + { + int urlIndex = -1; - if (referrer == string.Empty) - return url; - else - return FindParent(referrer, urlIndex); - } + for (int i = startingIndex; i > -1; i--) + { + if (m_urlList[i].Url == url) + { + urlIndex = i; + break; + } - /// - /// Searches the referrer list for a specific url. Note that this searches - /// backwards through the list from the given starting index. - /// - /// The url to locate - /// The index in the referrers at which to start looking - /// The index to the url, -1 if the url couldn't be found - private int GetUrlIndex(string url, int startingIndex) - { - int urlIndex = -1; + } + return urlIndex; + } - for (int i = startingIndex; i > -1; i--) - { - if (m_urlList[i].Url == url) - { - urlIndex = i; - break; - } + /// + /// Determines whether the referrer list contains a specific referrer + /// + /// The refrerrer + /// true if it contains the referrer, otherwise false + private bool ContainsReferrer(string referrer) + { + bool containsReferrer = false; + foreach (ExplorerUrlTracker.UrlInfo urlInfo in m_urlList) + { + if (urlInfo.Url == referrer) + { + containsReferrer = true; + break; + } + } + return containsReferrer; + } - } - return urlIndex; - } + /// + /// The list of referrers + /// + private ExplorerUrlTracker.UrlInfo[] m_urlList + { + get + { + return explorerUrlTracker.GetUrlHistory(); + } + } - /// - /// Determines whether the referrer list contains a specific referrer - /// - /// The refrerrer - /// true if it contains the referrer, otherwise false - private bool ContainsReferrer(string referrer) - { - bool containsReferrer = false; - foreach (ExplorerUrlTracker.UrlInfo urlInfo in m_urlList) - { - if (urlInfo.Url == referrer) - { - containsReferrer = true; - break; - } - } - return containsReferrer; - } + /// + /// The search descriptors to use when matching + /// + private SearchDescriptor[] SearchDescriptors + { + get + { + if (m_searchDescriptors == null) + m_searchDescriptors = GetSearchDescriptors(); + return m_searchDescriptors; + } + } + private SearchDescriptor[] m_searchDescriptors; - /// - /// The list of referrers - /// - private ExplorerUrlTracker.UrlInfo[] m_urlList - { - get - { - return explorerUrlTracker.GetUrlHistory(); - } - } + /// + /// Retrieves the search descriptors + /// + /// + private SearchDescriptor[] GetSearchDescriptors() + { + return new SearchDescriptor[] + { + new SearchDescriptor("Google", @"google.com", @"q"), + new SearchDescriptor("Teoma", @"teoma.com/search", @"q"), + new SearchDescriptor("AllTheWeb", @"alltheweb.com/search", @"q"), + new SearchDescriptor("Lycos", @"lycos.com", @"query"), + new SearchDescriptor("EBay", @"ebay.com/search", @"query"), + new SearchDescriptor("Yahoo", @"yahoo.com", @"p"), + new SearchDescriptor("Overture", @"overture.com/d/search", @"Keywords"), + new SearchDescriptor("Alta Vista", @"altavista.com/web/results", @"q"), + new SearchDescriptor("DayPop", @"daypop.com/search", @"q") + }; + } + } - /// - /// The search descriptors to use when matching - /// - private SearchDescriptor[] SearchDescriptors - { - get - { - if (m_searchDescriptors == null) - m_searchDescriptors = GetSearchDescriptors(); - return m_searchDescriptors; - } - } - private SearchDescriptor[] m_searchDescriptors; + /// + /// A Search Descriptor provides the information to process + /// a url and determine whether it is a search (and parse keywords) + /// + [Serializable] + internal class SearchDescriptor + { + /// + /// constructs a new search descriptor + /// + /// The human readable name of the search engine + /// The portion of the url that will determine a + /// match (in combination with the keywordqueryparam) + /// The queryparam that holds the keywords + public SearchDescriptor(string name, string baseUrlMatch, string keyWordQueryParam) + { + m_searchProviderName = name; + m_baseUrlMatch = baseUrlMatch; + m_keyWordQueryParam = keyWordQueryParam; + } - /// - /// Retrieves the search descriptors - /// - /// - private SearchDescriptor[] GetSearchDescriptors() - { - return new SearchDescriptor[] - { - new SearchDescriptor("Google", @"google.com", @"q"), - new SearchDescriptor("Teoma", @"teoma.com/search", @"q"), - new SearchDescriptor("AllTheWeb", @"alltheweb.com/search", @"q"), - new SearchDescriptor("Lycos", @"lycos.com", @"query"), - new SearchDescriptor("EBay", @"ebay.com/search", @"query"), - new SearchDescriptor("Yahoo", @"yahoo.com", @"p"), - new SearchDescriptor("Overture", @"overture.com/d/search", @"Keywords"), - new SearchDescriptor("Alta Vista", @"altavista.com/web/results", @"q"), - new SearchDescriptor("DayPop", @"daypop.com/search", @"q") - }; - } - } + /// + /// The human readable name of the search engine + /// + public string SearchProviderName + { + get + { + return m_searchProviderName; + } + } + private string m_searchProviderName; - /// - /// A Search Descriptor provides the information to process - /// a url and determine whether it is a search (and parse keywords) - /// - [Serializable] - internal class SearchDescriptor - { - /// - /// constructs a new search descriptor - /// - /// The human readable name of the search engine - /// The portion of the url that will determine a - /// match (in combination with the keywordqueryparam) - /// The queryparam that holds the keywords - public SearchDescriptor(string name, string baseUrlMatch, string keyWordQueryParam) - { - m_searchProviderName = name; - m_baseUrlMatch = baseUrlMatch; - m_keyWordQueryParam = keyWordQueryParam; - } + /// + /// The portion of the url that will determine a + /// match (in combination with the keywordqueryparam) + /// + public string BaseUrlMatch + { + get + { + return m_baseUrlMatch; + } + } + private string m_baseUrlMatch; - /// - /// The human readable name of the search engine - /// - public string SearchProviderName - { - get - { - return m_searchProviderName; - } - } - private string m_searchProviderName; - - /// - /// The portion of the url that will determine a - /// match (in combination with the keywordqueryparam) - /// - public string BaseUrlMatch - { - get - { - return m_baseUrlMatch; - } - } - private string m_baseUrlMatch; - - /// - /// The queryparam that holds the keywords - /// - public string KeyWordQueryParam - { - get - { - return m_keyWordQueryParam; - } - } - private string m_keyWordQueryParam; - } + /// + /// The queryparam that holds the keywords + /// + public string KeyWordQueryParam + { + get + { + return m_keyWordQueryParam; + } + } + private string m_keyWordQueryParam; + } } diff --git a/src/managed/OpenLiveWriter.CoreServices/DataObject/TextData.cs b/src/managed/OpenLiveWriter.CoreServices/DataObject/TextData.cs index 6083ea0f..e376c538 100644 --- a/src/managed/OpenLiveWriter.CoreServices/DataObject/TextData.cs +++ b/src/managed/OpenLiveWriter.CoreServices/DataObject/TextData.cs @@ -34,7 +34,6 @@ namespace OpenLiveWriter.CoreServices return null; } - /// /// The title of the Text DataObject /// diff --git a/src/managed/OpenLiveWriter.CoreServices/DelayedCancellableSignal.cs b/src/managed/OpenLiveWriter.CoreServices/DelayedCancellableSignal.cs index 0fb82275..ec047a83 100644 --- a/src/managed/OpenLiveWriter.CoreServices/DelayedCancellableSignal.cs +++ b/src/managed/OpenLiveWriter.CoreServices/DelayedCancellableSignal.cs @@ -88,48 +88,48 @@ namespace OpenLiveWriter.CoreServices #region deprecated /* - private DateTime lastCancellation = DateTime.MinValue; - private ManualResetEvent theLock = new ManualResetEvent(false); - private LinkedList timers = new LinkedList(); + private DateTime lastCancellation = DateTime.MinValue; + private ManualResetEvent theLock = new ManualResetEvent(false); + private LinkedList timers = new LinkedList(); - public DelayedCancellableSignal() - { - } + public DelayedCancellableSignal() + { + } - public void Wait() - { - theLock.WaitOne(); - } + public void Wait() + { + theLock.WaitOne(); + } - public void SignalLater(int milliseconds) - { - Timer t = new Timer(new TimerCallback(MaybeSignal), DateTime.Now, milliseconds, -1); - timers.Add(t); - } + public void SignalLater(int milliseconds) + { + Timer t = new Timer(new TimerCallback(MaybeSignal), DateTime.Now, milliseconds, -1); + timers.Add(t); + } - public void SignalNow() - { - MaybeSignal(DateTime.Now); - } + public void SignalNow() + { + MaybeSignal(DateTime.Now); + } - private void MaybeSignal(object state) - { - Timer t = (Timer)state; - DateTime dateTimeOriginated = (DateTime)state; - if (dateTimeOriginated.CompareTo(lastCancellation) > 0) - DoSignal(); - } + private void MaybeSignal(object state) + { + Timer t = (Timer)state; + DateTime dateTimeOriginated = (DateTime)state; + if (dateTimeOriginated.CompareTo(lastCancellation) > 0) + DoSignal(); + } - private void DoSignal() - { - theLock.Set(); - } + private void DoSignal() + { + theLock.Set(); + } - public void CancelAllSignals() - { - lastCancellation = DateTime.Now; - } - */ + public void CancelAllSignals() + { + lastCancellation = DateTime.Now; + } + */ #endregion } } diff --git a/src/managed/OpenLiveWriter.CoreServices/Diagnostics/ApplicationDiagnostics.cs b/src/managed/OpenLiveWriter.CoreServices/Diagnostics/ApplicationDiagnostics.cs index e767a06e..a59bea28 100644 --- a/src/managed/OpenLiveWriter.CoreServices/Diagnostics/ApplicationDiagnostics.cs +++ b/src/managed/OpenLiveWriter.CoreServices/Diagnostics/ApplicationDiagnostics.cs @@ -28,9 +28,9 @@ namespace OpenLiveWriter.CoreServices.Diagnostics verboseLogging = true; allowUnsafeCertificates = true; #else - testMode = false; - verboseLogging = false; - allowUnsafeCertificates = false; + testMode = false; + verboseLogging = false; + allowUnsafeCertificates = false; #endif } public static bool TestMode @@ -176,7 +176,7 @@ namespace OpenLiveWriter.CoreServices.Diagnostics #if DEBUG return new DiagnosticsConsole(bufferingTraceListener, title); #else - throw new NotSupportedException("Diagnostic console is only available in debug mode"); + throw new NotSupportedException("Diagnostic console is only available in debug mode"); #endif } } diff --git a/src/managed/OpenLiveWriter.CoreServices/Diagnostics/LogFileTraceListener.cs b/src/managed/OpenLiveWriter.CoreServices/Diagnostics/LogFileTraceListener.cs index a82a2295..63d9ac41 100644 --- a/src/managed/OpenLiveWriter.CoreServices/Diagnostics/LogFileTraceListener.cs +++ b/src/managed/OpenLiveWriter.CoreServices/Diagnostics/LogFileTraceListener.cs @@ -41,15 +41,15 @@ namespace OpenLiveWriter.CoreServices.Diagnostics #if DEBUG private int LOG_FILE_SIZE_THRESHOLD = 5000000; #else - private const int LOG_FILE_SIZE_THRESHOLD = 1000000; + private const int LOG_FILE_SIZE_THRESHOLD = 1000000; #endif private FileLogger logger; /// - /// The facility. - /// - private string facility; + /// The facility. + /// + private string facility; /// /// The ID of the current process. diff --git a/src/managed/OpenLiveWriter.CoreServices/Diagnostics/MemoryDiagnostics.cs b/src/managed/OpenLiveWriter.CoreServices/Diagnostics/MemoryDiagnostics.cs index 9a7e159a..bddecd4d 100644 --- a/src/managed/OpenLiveWriter.CoreServices/Diagnostics/MemoryDiagnostics.cs +++ b/src/managed/OpenLiveWriter.CoreServices/Diagnostics/MemoryDiagnostics.cs @@ -9,129 +9,129 @@ using System.IO; namespace OpenLiveWriter.CoreServices.Diagnostics { - /// - /// MemoryDiagnostics class. - /// - public class MemoryDiagnostics - { - private class RegisteredObject - { - private WeakReference weakReference; - private StackTrace stackTrace; + /// + /// MemoryDiagnostics class. + /// + public class MemoryDiagnostics + { + private class RegisteredObject + { + private WeakReference weakReference; + private StackTrace stackTrace; - /// - /// Initializes a new instance of the RegisteredObject class. - /// - /// The object being registered. - public RegisteredObject(object value) - { - Debug.WriteLine("Registering object "+value.GetType()); - weakReference = new WeakReference(value, false); - stackTrace = new StackTrace(2, true); - } + /// + /// Initializes a new instance of the RegisteredObject class. + /// + /// The object being registered. + public RegisteredObject(object value) + { + Debug.WriteLine("Registering object "+value.GetType()); + weakReference = new WeakReference(value, false); + stackTrace = new StackTrace(2, true); + } - public bool IsAlive - { - get - { - return weakReference.IsAlive; - } - } + public bool IsAlive + { + get + { + return weakReference.IsAlive; + } + } - public object Value - { - get - { - return weakReference.Target; - } - } + public object Value + { + get + { + return weakReference.Target; + } + } - public StackTrace StackTrace - { - get - { - return stackTrace; - } - } + public StackTrace StackTrace + { + get + { + return stackTrace; + } + } - public override string ToString() - { - if (IsAlive) - return weakReference.Target.ToString(); - else - return base.ToString (); - } + public override string ToString() + { + if (IsAlive) + return weakReference.Target.ToString(); + else + return base.ToString (); + } - } + } - /// - /// The bitmap cache. - /// - [ThreadStatic] - private static ArrayList objectList; + /// + /// The bitmap cache. + /// + [ThreadStatic] + private static ArrayList objectList; - /// - /// Initializes a new instance of the MemoryDiagnostics class. - /// - private MemoryDiagnostics() - { - } + /// + /// Initializes a new instance of the MemoryDiagnostics class. + /// + private MemoryDiagnostics() + { + } - public static void RegisterObject(object value) - { + public static void RegisterObject(object value) + { #if true - if (objectList == null) - { - lock(typeof(MemoryDiagnostics)) - { - if (objectList == null) - objectList = new ArrayList(); - } - } + if (objectList == null) + { + lock(typeof(MemoryDiagnostics)) + { + if (objectList == null) + objectList = new ArrayList(); + } + } - lock(objectList) - objectList.Add(new RegisteredObject(value)); + lock(objectList) + objectList.Add(new RegisteredObject(value)); #endif - } + } - public static void GenerateLeakReport() - { - if (objectList == null) - return; + public static void GenerateLeakReport() + { + if (objectList == null) + return; - GC.Collect(); - GC.WaitForPendingFinalizers(); - GC.Collect(); + GC.Collect(); + GC.WaitForPendingFinalizers(); + GC.Collect(); - // Get a stream writer on the file. - bool firstLeak = true; - string leaksFile = String.Format(CultureInfo.InvariantCulture, "c:\\{0} Leaks.log", ApplicationEnvironment.ProductName); - if (File.Exists(leaksFile)) - File.Delete(leaksFile); - using (StreamWriter streamWriter = File.AppendText(leaksFile)) - { - foreach (RegisteredObject registeredObject in objectList) - { - if (registeredObject.IsAlive) - { - if (firstLeak) - { - streamWriter.WriteLine("Memory Leak Report"); - firstLeak = false; - } + // Get a stream writer on the file. + bool firstLeak = true; + string leaksFile = String.Format(CultureInfo.InvariantCulture, "c:\\{0} Leaks.log", ApplicationEnvironment.ProductName); + if (File.Exists(leaksFile)) + File.Delete(leaksFile); + using (StreamWriter streamWriter = File.AppendText(leaksFile)) + { + foreach (RegisteredObject registeredObject in objectList) + { + if (registeredObject.IsAlive) + { + if (firstLeak) + { + streamWriter.WriteLine("Memory Leak Report"); + firstLeak = false; + } - streamWriter.WriteLine("Leak Detected"); - streamWriter.WriteLine("Type: "+registeredObject.Value.GetType().ToString()); - streamWriter.WriteLine("Value: "+registeredObject.Value.ToString()); - streamWriter.WriteLine("Stack Trace:"); - streamWriter.WriteLine(registeredObject.StackTrace.ToString()); - } - } - if (!firstLeak) - streamWriter.WriteLine("End Memory Leak Report"); - } - if (!firstLeak) - Process.Start(leaksFile); - } - } + streamWriter.WriteLine("Leak Detected"); + streamWriter.WriteLine("Type: "+registeredObject.Value.GetType().ToString()); + streamWriter.WriteLine("Value: "+registeredObject.Value.ToString()); + streamWriter.WriteLine("Stack Trace:"); + streamWriter.WriteLine(registeredObject.StackTrace.ToString()); + } + } + if (!firstLeak) + streamWriter.WriteLine("End Memory Leak Report"); + } + if (!firstLeak) + Process.Start(leaksFile); + } + } } diff --git a/src/managed/OpenLiveWriter.CoreServices/Diagnostics/UnexpectedErrorDialog.cs b/src/managed/OpenLiveWriter.CoreServices/Diagnostics/UnexpectedErrorDialog.cs index b6c51d12..eb4cdfbb 100644 --- a/src/managed/OpenLiveWriter.CoreServices/Diagnostics/UnexpectedErrorDialog.cs +++ b/src/managed/OpenLiveWriter.CoreServices/Diagnostics/UnexpectedErrorDialog.cs @@ -313,7 +313,6 @@ namespace OpenLiveWriter.CoreServices.Diagnostics } private string m_diagnosticsFilePath = null; - private static void WriteMemoryStatus(TextWriter writer) { try @@ -361,5 +360,4 @@ namespace OpenLiveWriter.CoreServices.Diagnostics private readonly Exception m_rootCause; } - } diff --git a/src/managed/OpenLiveWriter.CoreServices/Diagnostics/UnexpectedErrorMessage.cs b/src/managed/OpenLiveWriter.CoreServices/Diagnostics/UnexpectedErrorMessage.cs index ce03159f..d8e63ef8 100644 --- a/src/managed/OpenLiveWriter.CoreServices/Diagnostics/UnexpectedErrorMessage.cs +++ b/src/managed/OpenLiveWriter.CoreServices/Diagnostics/UnexpectedErrorMessage.cs @@ -123,7 +123,6 @@ namespace OpenLiveWriter.CoreServices.Diagnostics } #endregion - /// /// Show with just an exception /// diff --git a/src/managed/OpenLiveWriter.CoreServices/Diagnostics/UnexpectedErrorMessageDesigner.cs b/src/managed/OpenLiveWriter.CoreServices/Diagnostics/UnexpectedErrorMessageDesigner.cs index 43da7dd2..3735a610 100644 --- a/src/managed/OpenLiveWriter.CoreServices/Diagnostics/UnexpectedErrorMessageDesigner.cs +++ b/src/managed/OpenLiveWriter.CoreServices/Diagnostics/UnexpectedErrorMessageDesigner.cs @@ -7,39 +7,39 @@ using System.Windows.Forms.Design; namespace OpenLiveWriter.CoreServices.Diagnostics { - public class UnexpectedErrorMessageDesigner : ComponentDocumentDesigner - { - // Stores reference to the LocalizationExtenderProvider this designer adds, in order to remove it on Dispose. - private CodeDomLocalizationProvider codeDomLocalizationProvider; + public class UnexpectedErrorMessageDesigner : ComponentDocumentDesigner + { + // Stores reference to the LocalizationExtenderProvider this designer adds, in order to remove it on Dispose. + private CodeDomLocalizationProvider codeDomLocalizationProvider; - // Adds a LocalizationExtenderProvider for the component this designer is initialized to support. - public override void Initialize(IComponent component) - { - base.Initialize(component); + // Adds a LocalizationExtenderProvider for the component this designer is initialized to support. + public override void Initialize(IComponent component) + { + base.Initialize(component); - // If no extender from this designer is active... + // If no extender from this designer is active... if (codeDomLocalizationProvider == null) - { - // Adds a LocalizationExtenderProvider that provides localization support properties to the specified component. + { + // Adds a LocalizationExtenderProvider that provides localization support properties to the specified component. codeDomLocalizationProvider = new CodeDomLocalizationProvider(component.Site, component); codeDomLocalizationProvider.SetLocalizable(component, true); - } - } + } + } - // If a LocalizationExtenderProvider has been added, removes the extender provider. - protected override void Dispose(bool disposing) - { - base.Dispose(disposing); + // If a LocalizationExtenderProvider has been added, removes the extender provider. + protected override void Dispose(bool disposing) + { + base.Dispose(disposing); - // If an extender has been added, remove it + // If an extender has been added, remove it if (codeDomLocalizationProvider != null) - { - // Disposes of the extender provider. The extender - // provider removes itself from the extender provider - // service when it is disposed. + { + // Disposes of the extender provider. The extender + // provider removes itself from the extender provider + // service when it is disposed. codeDomLocalizationProvider.Dispose(); codeDomLocalizationProvider = null; - } - } - } + } + } + } } diff --git a/src/managed/OpenLiveWriter.CoreServices/DirectoryHelper.cs b/src/managed/OpenLiveWriter.CoreServices/DirectoryHelper.cs index b4efe662..fcd3a5b5 100644 --- a/src/managed/OpenLiveWriter.CoreServices/DirectoryHelper.cs +++ b/src/managed/OpenLiveWriter.CoreServices/DirectoryHelper.cs @@ -50,7 +50,6 @@ namespace OpenLiveWriter.CoreServices return lister.GetFiles(); } - /// /// Recursively copy the contents of one directory to another. Note that this method /// provides a thin-layer over file system calls -- low-level file system exceptions @@ -86,7 +85,6 @@ namespace OpenLiveWriter.CoreServices copier.Copy(); } - /// /// Determine whether a path is a network volume or not. Note that non network /// volumes may be of several types. diff --git a/src/managed/OpenLiveWriter.CoreServices/Exceptor.cs b/src/managed/OpenLiveWriter.CoreServices/Exceptor.cs index fc716758..5416c460 100644 --- a/src/managed/OpenLiveWriter.CoreServices/Exceptor.cs +++ b/src/managed/OpenLiveWriter.CoreServices/Exceptor.cs @@ -8,79 +8,78 @@ using System.Diagnostics; namespace Project31.CoreServices { - /// - /// Represents errors that occur during application execution. - /// - public class Exceptor : System.ComponentModel.Component - { - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; + /// + /// Represents errors that occur during application execution. + /// + public class Exceptor : System.ComponentModel.Component + { + /// + /// Required designer variable. + /// + private System.ComponentModel.Container components = null; - /// - /// The message template. - /// - private string messageTemplate; + /// + /// The message template. + /// + private string messageTemplate; - /// - /// Gets or sets the message template. - /// - public string MessageTemplate - { - get - { - return messageTemplate; - } - set - { - messageTemplate = value; - } - } + /// + /// Gets or sets the message template. + /// + public string MessageTemplate + { + get + { + return messageTemplate; + } + set + { + messageTemplate = value; + } + } - /// - /// Initializes a new instance of the Exceptor class. - /// - /// - public Exceptor(System.ComponentModel.IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + /// + /// Initializes a new instance of the Exceptor class. + /// + /// + public Exceptor(System.ComponentModel.IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - // - // TODO: Add any constructor code after InitializeComponent call - // - } + // + // TODO: Add any constructor code after InitializeComponent call + // + } - /// - /// Initializes a new instance of the Exceptor class. - /// - public Exceptor() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + /// + /// Initializes a new instance of the Exceptor class. + /// + public Exceptor() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // TODO: Add any constructor code after InitializeComponent call - // - } + // + // TODO: Add any constructor code after InitializeComponent call + // + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - components = new System.ComponentModel.Container(); - } - #endregion + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + } + #endregion - - } + } } diff --git a/src/managed/OpenLiveWriter.CoreServices/FileHelper.cs b/src/managed/OpenLiveWriter.CoreServices/FileHelper.cs index 28d5f65c..b1a4015d 100644 --- a/src/managed/OpenLiveWriter.CoreServices/FileHelper.cs +++ b/src/managed/OpenLiveWriter.CoreServices/FileHelper.cs @@ -48,12 +48,12 @@ namespace OpenLiveWriter.CoreServices int[] NET_CODES = { 0x0040, // network name no longer available - 0x0035, // bad net path - 0x0033, // ERROR_REM_NOT_LIST - 0x0036, // network busy - 0x0037, // DEV_NOT_EXIST - // see http://msdn.microsoft.com/library/en-us/debug/base/system_error_codes__1000-1299_.asp - 1203, + 0x0035, // bad net path + 0x0033, // ERROR_REM_NOT_LIST + 0x0036, // network busy + 0x0037, // DEV_NOT_EXIST + // see http://msdn.microsoft.com/library/en-us/debug/base/system_error_codes__1000-1299_.asp + 1203, 1222, 1225, 1226, diff --git a/src/managed/OpenLiveWriter.CoreServices/GraphicsHelper.cs b/src/managed/OpenLiveWriter.CoreServices/GraphicsHelper.cs index fd5776ee..d49ffda8 100644 --- a/src/managed/OpenLiveWriter.CoreServices/GraphicsHelper.cs +++ b/src/managed/OpenLiveWriter.CoreServices/GraphicsHelper.cs @@ -163,24 +163,24 @@ namespace OpenLiveWriter.CoreServices return new Rectangle[] { - // top left - new Rectangle(left, top, leftWidth, topHeight), - // top center - new Rectangle(center, top, centerWidth, topHeight), - // top right - new Rectangle(right, top, rightWidth, topHeight), - // left - new Rectangle(left, middle, leftWidth, middleHeight), + // top left + new Rectangle(left, top, leftWidth, topHeight), + // top center + new Rectangle(center, top, centerWidth, topHeight), + // top right + new Rectangle(right, top, rightWidth, topHeight), + // left + new Rectangle(left, middle, leftWidth, middleHeight), // middle new Rectangle(center, middle, centerWidth, middleHeight), - // right - new Rectangle(right, middle, rightWidth, middleHeight), - // bottom left - new Rectangle(left, bottom, leftWidth, bottomHeight), - // bottom center - new Rectangle(center, bottom, centerWidth, bottomHeight), - // bottom right - new Rectangle(right, bottom, rightWidth, bottomHeight) + // right + new Rectangle(right, middle, rightWidth, middleHeight), + // bottom left + new Rectangle(left, bottom, leftWidth, bottomHeight), + // bottom center + new Rectangle(center, bottom, centerWidth, bottomHeight), + // bottom right + new Rectangle(right, bottom, rightWidth, bottomHeight) }; } diff --git a/src/managed/OpenLiveWriter.CoreServices/HTML/AsyncHTMLMetaDataRequest.cs b/src/managed/OpenLiveWriter.CoreServices/HTML/AsyncHTMLMetaDataRequest.cs index 5bc08d02..b9c936f5 100644 --- a/src/managed/OpenLiveWriter.CoreServices/HTML/AsyncHTMLMetaDataRequest.cs +++ b/src/managed/OpenLiveWriter.CoreServices/HTML/AsyncHTMLMetaDataRequest.cs @@ -7,88 +7,88 @@ using mshtml; namespace OpenLiveWriter.CoreServices { - /// - /// AsyncHTMLMetaDataRequest is an asynchronous mechanism for retrieving - /// MetaData for a given URL. - /// - public class AsyncHTMLMetaDataRequest - { - /// - /// Constructs a new Asynchronous HTML MetaDataRequest - /// - /// - public AsyncHTMLMetaDataRequest(string url) - { - m_url = url; - m_webRequest = new AsyncWebRequestWithCache(url); - } + /// + /// AsyncHTMLMetaDataRequest is an asynchronous mechanism for retrieving + /// MetaData for a given URL. + /// + public class AsyncHTMLMetaDataRequest + { + /// + /// Constructs a new Asynchronous HTML MetaDataRequest + /// + /// + public AsyncHTMLMetaDataRequest(string url) + { + m_url = url; + m_webRequest = new AsyncWebRequestWithCache(url); + } - /// - /// The MetaData. This is null until the MetaData has been retrieved - /// - public HTMLMetaData MetaData = null; + /// + /// The MetaData. This is null until the MetaData has been retrieved + /// + public HTMLMetaData MetaData = null; - /// - /// Event that is fired when the MetaData has been retrieved - /// - public event EventHandler MetaDataComplete; - protected void OnMetaDataComplete(EventArgs e) - { - if (MetaDataComplete != null) - MetaDataComplete(this, e); - } + /// + /// Event that is fired when the MetaData has been retrieved + /// + public event EventHandler MetaDataComplete; + protected void OnMetaDataComplete(EventArgs e) + { + if (MetaDataComplete != null) + MetaDataComplete(this, e); + } - /// - /// Begins the metadata retrieval for a url - /// - public void BeginGetMetaData() - { - isRunning = true; - m_webRequest.RequestComplete += new EventHandler(WebRequestComplete); - m_webRequest.StartRequest(); - } + /// + /// Begins the metadata retrieval for a url + /// + public void BeginGetMetaData() + { + isRunning = true; + m_webRequest.RequestComplete += new EventHandler(WebRequestComplete); + m_webRequest.StartRequest(); + } - /// - /// Cancels the retrieval of meta data - /// - public void Cancel() - { - if (isRunning) - m_webRequest.Cancel(); - } + /// + /// Cancels the retrieval of meta data + /// + public void Cancel() + { + if (isRunning) + m_webRequest.Cancel(); + } - /// - /// Event handler that is called when the Async Web request is complete - /// - private void WebRequestComplete(object send, EventArgs e) - { - IHTMLDocument2 htmlDoc = null; - Stream stream = m_webRequest.ResponseStream; - if (stream != null) - { - using(StreamReader reader = new StreamReader(stream)) - { - htmlDoc = HTMLDocumentHelper.StringToHTMLDoc(reader.ReadToEnd(), m_url); - } - if (htmlDoc != null) - { - MetaData = new HTMLMetaData(htmlDoc); - } - } - FireMetaDataComplete(); - } + /// + /// Event handler that is called when the Async Web request is complete + /// + private void WebRequestComplete(object send, EventArgs e) + { + IHTMLDocument2 htmlDoc = null; + Stream stream = m_webRequest.ResponseStream; + if (stream != null) + { + using(StreamReader reader = new StreamReader(stream)) + { + htmlDoc = HTMLDocumentHelper.StringToHTMLDoc(reader.ReadToEnd(), m_url); + } + if (htmlDoc != null) + { + MetaData = new HTMLMetaData(htmlDoc); + } + } + FireMetaDataComplete(); + } - /// - /// Helper method that notifies of request completion - /// - private void FireMetaDataComplete() - { - OnMetaDataComplete(EventArgs.Empty); - isRunning = false; - } + /// + /// Helper method that notifies of request completion + /// + private void FireMetaDataComplete() + { + OnMetaDataComplete(EventArgs.Empty); + isRunning = false; + } - private bool isRunning = false; - private AsyncWebRequestWithCache m_webRequest; - private string m_url; - } + private bool isRunning = false; + private AsyncWebRequestWithCache m_webRequest; + private string m_url; + } } diff --git a/src/managed/OpenLiveWriter.CoreServices/HTML/AsyncPageDownload.cs b/src/managed/OpenLiveWriter.CoreServices/HTML/AsyncPageDownload.cs index 0137499d..37d1a99c 100644 --- a/src/managed/OpenLiveWriter.CoreServices/HTML/AsyncPageDownload.cs +++ b/src/managed/OpenLiveWriter.CoreServices/HTML/AsyncPageDownload.cs @@ -12,225 +12,222 @@ using System.Text.RegularExpressions; namespace Project31.CoreServices { - /// - /// Summary description for AsyncPageDownload. - /// - public class AsyncPageDownload : AsyncOperation - { + /// + /// Summary description for AsyncPageDownload. + /// + public class AsyncPageDownload : AsyncOperation + { + + /// + /// Downloads a page and all its references into a Site Storage + /// + /// The url of the page to download + /// The storage into which to store the page and its references + /// The rootfile name for the ISiteStorage + /// An object implementing the + /// ISynchronizeInvoke interface. All events will be delivered + /// through this target, ensuring that they are delivered to the + /// correct thread. + public AsyncPageDownload( + string url, + ISiteStorage storage, + string rootFileName, + ISynchronizeInvoke target) : this (url, storage, rootFileName, "", target) + { + } + + /// + /// Downloads a page and all its references into a Site Storage + /// + /// The IHTMLDocument2 to storage with its references + /// The storage into which to store the page and its references + /// The rootfile name for the ISiteStorage + /// An object implementing the + /// ISynchronizeInvoke interface. All events will be delivered + /// through this target, ensuring that they are delivered to the + /// correct thread. + public AsyncPageDownload(IHTMLDocument2 document, + ISiteStorage storage, string rootFileName, ISynchronizeInvoke target) : + this (document, storage, rootFileName, "", target) + { + } + + /// + /// Actually downloads the files (note that it is synchronous) + /// + protected override void DoWork() + { + if (CancelRequested) + { + AcknowledgeCancel(); + return; + } + + // If the base document hasn't been populated, go get it + if (m_htmlDocument == null) + m_htmlDocument = HTMLDocumentHelper.GetHTMLDocFromURL(m_url); + + if (CancelRequested) + { + AcknowledgeCancel(); + return; + } + + // Get a list of referenced URLs from the document + Hashtable urlList = HTMLDocumentHelper.GetResourceUrlsFromDocument(m_htmlDocument); + + if (CancelRequested) + { + AcknowledgeCancel(); + return; + } + + // Get the HTML from this document- we'll use this as the base HTML and replace + // paths inside of it. + string finalHTML = HTMLDocumentHelper.HTMLDocToString(m_htmlDocument); + + IEnumerator urlEnum = urlList.GetEnumerator(); + while (urlEnum.MoveNext()) + { + DictionaryEntry element = (DictionaryEntry) urlEnum.Current; + string url = (string)element.Key; + string urlType = (string)element.Value; + + string fullUrl = HTMLDocumentHelper.EscapeRelativeURL(m_url, url); + string fileName = FileHelper.GetValidFileName(Path.GetFileName(new Uri(fullUrl).AbsolutePath)); + string relativePath; + + if (fileName != string.Empty) + { + if (urlType != HTMLTokens.Frame && urlType != HTMLTokens.IFrame) + { + relativePath = "referencedFiles/" + fileName; + WebRequestWithCache request = new WebRequestWithCache(fullUrl); + + // Add the html document to the site Storage. + using (Stream requestStream = request.GetResponseStream()) + { + if (requestStream != null) + { + using (Stream fileStream = + m_siteStorage.Open(m_rootPath + relativePath, AccessMode.Write)) + { + StreamHelper.Transfer(requestStream, fileStream, 8192, true); + } + } + } + } + else + { + fileName = Path.GetFileNameWithoutExtension(fileName) + ".htm"; + relativePath = "referencedFiles/" + fileName; + + AsyncPageDownload frameDownload = + new AsyncPageDownload(fullUrl, + m_siteStorage, + fileName, + m_rootPath + "referencedFiles/", + this.Target); + frameDownload.Start(); + frameDownload.WaitUntilDone(); + + // Regular expressions would allow more flexibility here, but note that + // characters like ? / & have meaning in regular expressions and so need + // to be escaped + } + finalHTML = finalHTML.Replace(UrlHelper.CleanUpUrl(url), relativePath); + } + if (CancelRequested) + { + AcknowledgeCancel(); + return; + } + } + + // Escape any high ascii characters + finalHTML = HTMLDocumentHelper.EscapeHighAscii(finalHTML.ToCharArray()); + + // Add the html document to the site Storage. + Stream htmlStream = m_siteStorage.Open(m_rootPath + m_rootFile, AccessMode.Write); + + using (StreamWriter writer = new StreamWriter(htmlStream, Encoding.UTF8)) + { + writer.Write(finalHTML); + } + m_siteStorage.RootFile = m_rootFile; + } + + /// + /// Downloads a page and all its references into a Site Storage + /// + /// The url of the page to download + /// The storage into which to store the page and its references + /// The rootfile name for the ISiteStorage + /// The path in which to place the items in the ISiteStorage + /// An object implementing the + /// ISynchronizeInvoke interface. All events will be delivered + /// through this target, ensuring that they are delivered to the + /// correct thread. + private AsyncPageDownload( + string url, + ISiteStorage storage, + string rootFileName, + string storageRootPath, + ISynchronizeInvoke target) : base (target) + { + m_url = url; + m_siteStorage = storage; + m_rootFile = rootFileName; + m_rootPath = storageRootPath; + } - /// - /// Downloads a page and all its references into a Site Storage - /// - /// The url of the page to download - /// The storage into which to store the page and its references - /// The rootfile name for the ISiteStorage - /// An object implementing the - /// ISynchronizeInvoke interface. All events will be delivered - /// through this target, ensuring that they are delivered to the - /// correct thread. - public AsyncPageDownload( - string url, - ISiteStorage storage, - string rootFileName, - ISynchronizeInvoke target) : this (url, storage, rootFileName, "", target) - { - } + /// + /// Downloads a page and all its references into a Site Storage + /// + /// The IHTMLDocument2 to storage with its references + /// The storage into which to store the page and its references + /// The rootfile name for the ISiteStorage + /// The path in which to place the items in the ISiteStorage + /// An object implementing the + /// ISynchronizeInvoke interface. All events will be delivered + /// through this target, ensuring that they are delivered to the + /// correct thread. + private AsyncPageDownload(IHTMLDocument2 document, + ISiteStorage storage, string rootFileName, string storageRootPath, ISynchronizeInvoke target) : + base (target) + { + m_url = document.url; + m_htmlDocument = document; + m_siteStorage = storage; + m_rootFile = rootFileName; + m_rootPath = storageRootPath; + } - /// - /// Downloads a page and all its references into a Site Storage - /// - /// The IHTMLDocument2 to storage with its references - /// The storage into which to store the page and its references - /// The rootfile name for the ISiteStorage - /// An object implementing the - /// ISynchronizeInvoke interface. All events will be delivered - /// through this target, ensuring that they are delivered to the - /// correct thread. - public AsyncPageDownload(IHTMLDocument2 document, - ISiteStorage storage, string rootFileName, ISynchronizeInvoke target) : - this (document, storage, rootFileName, "", target) - { - } + /// + /// The base IHTMLDocument2 + /// + private IHTMLDocument2 m_htmlDocument; - /// - /// Actually downloads the files (note that it is synchronous) - /// - protected override void DoWork() - { - if (CancelRequested) - { - AcknowledgeCancel(); - return; - } + /// + /// The Site Storage into which to write the page and contents + /// + private ISiteStorage m_siteStorage; - // If the base document hasn't been populated, go get it - if (m_htmlDocument == null) - m_htmlDocument = HTMLDocumentHelper.GetHTMLDocFromURL(m_url); + /// + /// The url of the root document + /// + private string m_url; - if (CancelRequested) - { - AcknowledgeCancel(); - return; - } + /// + /// The rootfile name for this document + /// + private string m_rootFile; - // Get a list of referenced URLs from the document - Hashtable urlList = HTMLDocumentHelper.GetResourceUrlsFromDocument(m_htmlDocument); - - if (CancelRequested) - { - AcknowledgeCancel(); - return; - } - - // Get the HTML from this document- we'll use this as the base HTML and replace - // paths inside of it. - string finalHTML = HTMLDocumentHelper.HTMLDocToString(m_htmlDocument); - - IEnumerator urlEnum = urlList.GetEnumerator(); - while (urlEnum.MoveNext()) - { - DictionaryEntry element = (DictionaryEntry) urlEnum.Current; - string url = (string)element.Key; - string urlType = (string)element.Value; - - - string fullUrl = HTMLDocumentHelper.EscapeRelativeURL(m_url, url); - string fileName = FileHelper.GetValidFileName(Path.GetFileName(new Uri(fullUrl).AbsolutePath)); - string relativePath; - - if (fileName != string.Empty) - { - if (urlType != HTMLTokens.Frame && urlType != HTMLTokens.IFrame) - { - relativePath = "referencedFiles/" + fileName; - WebRequestWithCache request = new WebRequestWithCache(fullUrl); - - // Add the html document to the site Storage. - using (Stream requestStream = request.GetResponseStream()) - { - if (requestStream != null) - { - using (Stream fileStream = - m_siteStorage.Open(m_rootPath + relativePath, AccessMode.Write)) - { - StreamHelper.Transfer(requestStream, fileStream, 8192, true); - } - } - } - } - else - { - fileName = Path.GetFileNameWithoutExtension(fileName) + ".htm"; - relativePath = "referencedFiles/" + fileName; - - AsyncPageDownload frameDownload = - new AsyncPageDownload(fullUrl, - m_siteStorage, - fileName, - m_rootPath + "referencedFiles/", - this.Target); - frameDownload.Start(); - frameDownload.WaitUntilDone(); - - // Regular expressions would allow more flexibility here, but note that - // characters like ? / & have meaning in regular expressions and so need - // to be escaped - } - finalHTML = finalHTML.Replace(UrlHelper.CleanUpUrl(url), relativePath); - } - if (CancelRequested) - { - AcknowledgeCancel(); - return; - } - } - - // Escape any high ascii characters - finalHTML = HTMLDocumentHelper.EscapeHighAscii(finalHTML.ToCharArray()); - - // Add the html document to the site Storage. - Stream htmlStream = m_siteStorage.Open(m_rootPath + m_rootFile, AccessMode.Write); - - using (StreamWriter writer = new StreamWriter(htmlStream, Encoding.UTF8)) - { - writer.Write(finalHTML); - } - m_siteStorage.RootFile = m_rootFile; - } - - /// - /// Downloads a page and all its references into a Site Storage - /// - /// The url of the page to download - /// The storage into which to store the page and its references - /// The rootfile name for the ISiteStorage - /// The path in which to place the items in the ISiteStorage - /// An object implementing the - /// ISynchronizeInvoke interface. All events will be delivered - /// through this target, ensuring that they are delivered to the - /// correct thread. - private AsyncPageDownload( - string url, - ISiteStorage storage, - string rootFileName, - string storageRootPath, - ISynchronizeInvoke target) : base (target) - { - m_url = url; - m_siteStorage = storage; - m_rootFile = rootFileName; - m_rootPath = storageRootPath; - } - - - - /// - /// Downloads a page and all its references into a Site Storage - /// - /// The IHTMLDocument2 to storage with its references - /// The storage into which to store the page and its references - /// The rootfile name for the ISiteStorage - /// The path in which to place the items in the ISiteStorage - /// An object implementing the - /// ISynchronizeInvoke interface. All events will be delivered - /// through this target, ensuring that they are delivered to the - /// correct thread. - private AsyncPageDownload(IHTMLDocument2 document, - ISiteStorage storage, string rootFileName, string storageRootPath, ISynchronizeInvoke target) : - base (target) - { - m_url = document.url; - m_htmlDocument = document; - m_siteStorage = storage; - m_rootFile = rootFileName; - m_rootPath = storageRootPath; - } - - /// - /// The base IHTMLDocument2 - /// - private IHTMLDocument2 m_htmlDocument; - - /// - /// The Site Storage into which to write the page and contents - /// - private ISiteStorage m_siteStorage; - - /// - /// The url of the root document - /// - private string m_url; - - /// - /// The rootfile name for this document - /// - private string m_rootFile; - - /// - /// The base bath in the storage - /// - private string m_rootPath; - } + /// + /// The base bath in the storage + /// + private string m_rootPath; + } } diff --git a/src/managed/OpenLiveWriter.CoreServices/HTML/DocumentVisitor.cs b/src/managed/OpenLiveWriter.CoreServices/HTML/DocumentVisitor.cs index 986aa40a..46c9805d 100644 --- a/src/managed/OpenLiveWriter.CoreServices/HTML/DocumentVisitor.cs +++ b/src/managed/OpenLiveWriter.CoreServices/HTML/DocumentVisitor.cs @@ -122,7 +122,6 @@ namespace OpenLiveWriter.CoreServices.HTML protected virtual void OnText(IHTMLTextElement el) { } - private const int INDENT_SPACES = 4; private StringBuilder indent = new StringBuilder(""); private void IncreaseIndent() diff --git a/src/managed/OpenLiveWriter.CoreServices/HTML/HTMLBalancer.cs b/src/managed/OpenLiveWriter.CoreServices/HTML/HTMLBalancer.cs index 9fef5beb..925b679a 100644 --- a/src/managed/OpenLiveWriter.CoreServices/HTML/HTMLBalancer.cs +++ b/src/managed/OpenLiveWriter.CoreServices/HTML/HTMLBalancer.cs @@ -300,46 +300,46 @@ namespace OpenLiveWriter.CoreServices } #if FALSE - public static void Test() - { - Verify(Balance("test", 13), ""); - Verify(Balance("test", 13), ""); + public static void Test() + { + Verify(Balance("test", 13), ""); + Verify(Balance("test", 13), ""); - Verify(Balance("test", 100), "test"); - Verify(Balance("test", 100), "test"); - Verify(Balance("test", 100), "test"); + Verify(Balance("test", 100), "test"); + Verify(Balance("test", 100), "test"); + Verify(Balance("test", 100), "test"); - Verify(Balance("test", 10), ""); - Verify(Balance("test", 10), ""); - Verify(Balance("abcd▪efghijklmnop", 7), "abcd"); - Verify(Balance("abcd▪efg", 17), "abcd▪"); - Verify(Balance("abcd▪efg", 34, new DoubleCostFilter()), "abcd▪"); + Verify(Balance("test", 10), ""); + Verify(Balance("test", 10), ""); + Verify(Balance("abcd▪efghijklmnop", 7), "abcd"); + Verify(Balance("abcd▪efg", 17), "abcd▪"); + Verify(Balance("abcd▪efg", 34, new DoubleCostFilter()), "abcd▪"); - Verify(Balance("
", int.MaxValue), "
"); - Verify(BalanceForUrl("test", 20), "tes"); + Verify(Balance("
", int.MaxValue), "
"); + Verify(BalanceForUrl("test", 20), "tes"); - Verify(Balance("test", 2, new TextOnlyCostFilter()), "te"); - Verify(Balance("test test", 8, new TextOnlyCostFilter()), "test"); - } + Verify(Balance("test", 2, new TextOnlyCostFilter()), "te"); + Verify(Balance("test test", 8, new TextOnlyCostFilter()), "test"); + } - private static void Verify(string a, string b) - { - if (a != b) - throw new Exception(a + " != " + b); - } + private static void Verify(string a, string b) + { + if (a != b) + throw new Exception(a + " != " + b); + } - private class DoubleCostFilter : HTMLBalancerCostFilter - { - public override int ElementCost(Element el) - { - return el.ToString().Length * 2; - } + private class DoubleCostFilter : HTMLBalancerCostFilter + { + public override int ElementCost(Element el) + { + return el.ToString().Length * 2; + } - protected override int CharCost(char c) - { - return 2; - } - } + protected override int CharCost(char c) + { + return 2; + } + } #endif } } diff --git a/src/managed/OpenLiveWriter.CoreServices/HTML/HTMLDocumentHelper.cs b/src/managed/OpenLiveWriter.CoreServices/HTML/HTMLDocumentHelper.cs index 50a9fdd9..f7117fe6 100644 --- a/src/managed/OpenLiveWriter.CoreServices/HTML/HTMLDocumentHelper.cs +++ b/src/managed/OpenLiveWriter.CoreServices/HTML/HTMLDocumentHelper.cs @@ -68,11 +68,11 @@ namespace OpenLiveWriter.CoreServices html = html.Replace("url(" + UrlHelper.CleanUpUrl(url) + ")", "Url(" + newUrl + ")"); // url(_) html = html.Replace("url( " + UrlHelper.CleanUpUrl(url) + " )", "Url(" + newUrl + ")"); // url( _ ) #else - string pattern1 = @"(=?\s*(?:'|"")?)(" + Regex.Escape(cleanedUpUrl) + @")((?:""|')?\s*>?)"; - html = Regex.Replace(html, pattern1, new MatchEvaluator(helper.MatchEvaluator1)); + string pattern1 = @"(=?\s*(?:'|"")?)(" + Regex.Escape(cleanedUpUrl) + @")((?:""|')?\s*>?)"; + html = Regex.Replace(html, pattern1, new MatchEvaluator(helper.MatchEvaluator1)); - string pattern2 = @"url\(\s*" + Regex.Escape(cleanedUpUrl) + @"\s*\)"; - html = Regex.Replace(html, pattern2, "Url(" + newUrl + ")", RegexOptions.IgnoreCase); + string pattern2 = @"url\(\s*" + Regex.Escape(cleanedUpUrl) + @"\s*\)"; + html = Regex.Replace(html, pattern2, "Url(" + newUrl + ")", RegexOptions.IgnoreCase); #endif // HACK: Bug 1380. Be careful, because there can be some crazy things, like escaped tabs in URLs! @@ -91,13 +91,13 @@ namespace OpenLiveWriter.CoreServices html = html.Replace("url(" + HttpUtility.UrlDecode(UrlHelper.CleanUpUrl(url)) + ")", "Url(" + newUrl + ")"); html = html.Replace("url( " + HttpUtility.UrlDecode(UrlHelper.CleanUpUrl(url)) + " )", "Url(" + newUrl + ")"); #else - string decodedUrl = HttpUtility.UrlDecode(cleanedUpUrl); + string decodedUrl = HttpUtility.UrlDecode(cleanedUpUrl); - string pattern3 = @"(=?\s*(?:'|"")?)(" + Regex.Escape(decodedUrl) + @")((?:""|')?\s*>?)"; - html = Regex.Replace(html, pattern3, new MatchEvaluator(helper.MatchEvaluator1)); + string pattern3 = @"(=?\s*(?:'|"")?)(" + Regex.Escape(decodedUrl) + @")((?:""|')?\s*>?)"; + html = Regex.Replace(html, pattern3, new MatchEvaluator(helper.MatchEvaluator1)); - string pattern4 = @"url\(\s*" + Regex.Escape(decodedUrl) + @"\s*\)"; - html = Regex.Replace(html, pattern4, "Url(" + newUrl + ")", RegexOptions.IgnoreCase); + string pattern4 = @"url\(\s*" + Regex.Escape(decodedUrl) + @"\s*\)"; + html = Regex.Replace(html, pattern4, "Url(" + newUrl + ")", RegexOptions.IgnoreCase); #endif // When an absolute path doesn't end with a file or a slash (i.e. http://www.realultimatepower.net) @@ -323,7 +323,6 @@ namespace OpenLiveWriter.CoreServices return htmlText; } - /// /// Gets the body text for a given url /// @@ -350,7 +349,6 @@ namespace OpenLiveWriter.CoreServices } - /// /// /// @@ -509,7 +507,6 @@ namespace OpenLiveWriter.CoreServices } - /// /// Converts an HTML string into an IHTMLDocument2 /// @@ -664,7 +661,6 @@ namespace OpenLiveWriter.CoreServices return url; } - /// /// Structure of special headers that may begin the HTML at the beginning of an /// HTMLDocument, but be omitted from the DOM @@ -1386,7 +1382,6 @@ namespace OpenLiveWriter.CoreServices } } - private static string GetParamValue(IHTMLElement param, string[] attributesToSearch) { string relativePath = null; diff --git a/src/managed/OpenLiveWriter.CoreServices/HTML/HTMLElementHelper.cs b/src/managed/OpenLiveWriter.CoreServices/HTML/HTMLElementHelper.cs index 5666e34e..0ba36088 100644 --- a/src/managed/OpenLiveWriter.CoreServices/HTML/HTMLElementHelper.cs +++ b/src/managed/OpenLiveWriter.CoreServices/HTML/HTMLElementHelper.cs @@ -460,7 +460,6 @@ namespace OpenLiveWriter.CoreServices return newElement; } - /// /// Helper method to remove an element from a document /// diff --git a/src/managed/OpenLiveWriter.CoreServices/HTML/HTMLThinner.cs b/src/managed/OpenLiveWriter.CoreServices/HTML/HTMLThinner.cs index 822830ee..cde908df 100644 --- a/src/managed/OpenLiveWriter.CoreServices/HTML/HTMLThinner.cs +++ b/src/managed/OpenLiveWriter.CoreServices/HTML/HTMLThinner.cs @@ -11,269 +11,266 @@ using OpenLiveWriter.CoreServices.Progress; namespace OpenLiveWriter.CoreServices { - /// - /// Summary description for HTMLThinner. - /// - public class HTMLThinner - { - private class TickableProgressTick : ProgressTick - { - public TickableProgressTick(IProgressHost progress, int totalTicks) : base(progress, 100, 100) - { - _totalTicks = totalTicks; - } - private int _totalTicks = -1; - private int _currentTicks = 0; + /// + /// Summary description for HTMLThinner. + /// + public class HTMLThinner + { + private class TickableProgressTick : ProgressTick + { + public TickableProgressTick(IProgressHost progress, int totalTicks) : base(progress, 100, 100) + { + _totalTicks = totalTicks; + } + private int _totalTicks = -1; + private int _currentTicks = 0; - public void Tick() - { - this.UpdateProgress(Math.Min(_currentTicks++,_totalTicks), _totalTicks); - } - } + public void Tick() + { + this.UpdateProgress(Math.Min(_currentTicks++,_totalTicks), _totalTicks); + } + } + public static string Thin(IHTMLElement startElement) + { + return Thin(startElement, false, SilentProgressHost.Instance); + } - public static string Thin(IHTMLElement startElement) - { - return Thin(startElement, false, SilentProgressHost.Instance); - } + public static string Thin(IHTMLElement startElement, IProgressHost progressHost) + { + return Thin(startElement, false, progressHost); + } - public static string Thin(IHTMLElement startElement, IProgressHost progressHost) - { - return Thin(startElement, false, progressHost); - } + public static string Thin(IHTMLElement startElement, bool preserveImages) + { + return Thin(startElement, preserveImages, SilentProgressHost.Instance); + } - public static string Thin(IHTMLElement startElement, bool preserveImages) - { - return Thin(startElement, preserveImages, SilentProgressHost.Instance); - } + public static string Thin(IHTMLElement startElement, bool preserveImages, IProgressHost progressHost) + { + StringBuilder escapedText = new StringBuilder(); + if (startElement != null) + { + IHTMLElementCollection elements = (IHTMLElementCollection)startElement.all; + TickableProgressTick progress = new TickableProgressTick(progressHost, elements.length + 1); + IHTMLDOMNode startNode = (IHTMLDOMNode) startElement; + StripChildNodes(startNode, escapedText, preserveImages, progress); + } + return escapedText.ToString(); + } - public static string Thin(IHTMLElement startElement, bool preserveImages, IProgressHost progressHost) - { - StringBuilder escapedText = new StringBuilder(); - if (startElement != null) - { - IHTMLElementCollection elements = (IHTMLElementCollection)startElement.all; - TickableProgressTick progress = new TickableProgressTick(progressHost, elements.length + 1); - IHTMLDOMNode startNode = (IHTMLDOMNode) startElement; - StripChildNodes(startNode, escapedText, preserveImages, progress); - } - return escapedText.ToString(); - } + /// + /// Used as a part of HTML thinning to remove extraneous child nodes from an HTMLDOMNode + /// + /// The node whose children should be stripped + /// An HTML string with the DOMNodes cleaned out + private static void StripChildNodes(IHTMLDOMNode node, StringBuilder escapedText, bool preserveImages, TickableProgressTick progress) + { - /// - /// Used as a part of HTML thinning to remove extraneous child nodes from an HTMLDOMNode - /// - /// The node whose children should be stripped - /// An HTML string with the DOMNodes cleaned out - private static void StripChildNodes(IHTMLDOMNode node, StringBuilder escapedText, bool preserveImages, TickableProgressTick progress) - { + // is this a text node? If so, just get the text and return it + if (node.nodeType == HTMLDocumentHelper.HTMLDOMNodeTypes.TextNode) + escapedText.Append(HttpUtility.HtmlEncode(node.nodeValue.ToString())); + else + { + progress.Tick(); + bool tagStillOpen = false; + ArrayList preserveTags = PreserveTags; + if (preserveImages) + preserveTags = PreserveTagsWithImages; - // is this a text node? If so, just get the text and return it - if (node.nodeType == HTMLDocumentHelper.HTMLDOMNodeTypes.TextNode) - escapedText.Append(HttpUtility.HtmlEncode(node.nodeValue.ToString())); - else - { - progress.Tick(); - bool tagStillOpen = false; - ArrayList preserveTags = PreserveTags; - if (preserveImages) - preserveTags = PreserveTagsWithImages; + // if we're in an element node (a tag) and we should preserve the tag, + // append it to the returned text + if (preserveTags.Contains(node.nodeName)) + { + // Append the opening tag element, with any extraneous + // attributes stripped + escapedText.Append("<" + node.nodeName); + StripAttributes((IHTMLElement)node, escapedText); - // if we're in an element node (a tag) and we should preserve the tag, - // append it to the returned text - if (preserveTags.Contains(node.nodeName)) - { - // Append the opening tag element, with any extraneous - // attributes stripped - escapedText.Append("<" + node.nodeName); - StripAttributes((IHTMLElement)node, escapedText); + // if the element has no children, we can simply close out the tag + if (!node.hasChildNodes()) + { + if (node.nodeName == HTMLTokens.IFrame) + escapedText.Append(">"); + else + escapedText.Append("/>"); + } + else // the element has children, leave the tag open + { + escapedText.Append(">"); + tagStillOpen = true; + } + } + else if (ReplaceTags.Contains(node.nodeName)) + { + // If there are no children, just emit the replacement tag + if (!node.hasChildNodes()) + { + // Replace the tag + escapedText.Append("<" + (string)ReplaceTags[node.nodeName] + "/>"); + } + else + { + if (!IsChildlessTag((string)ReplaceTags[node.nodeName])) + { + escapedText.Append("<" + (string)ReplaceTags[node.nodeName] + ">"); + } + // Since there are children, we're going to emit the replacement + // tag at the end of this node + tagStillOpen = true; + } + } - // if the element has no children, we can simply close out the tag - if (!node.hasChildNodes()) - { - if (node.nodeName == HTMLTokens.IFrame) - escapedText.Append(">"); - else - escapedText.Append("/>"); - } - else // the element has children, leave the tag open - { - escapedText.Append(">"); - tagStillOpen = true; - } - } - else if (ReplaceTags.Contains(node.nodeName)) - { - // If there are no children, just emit the replacement tag - if (!node.hasChildNodes()) - { - // Replace the tag - escapedText.Append("<" + (string)ReplaceTags[node.nodeName] + "/>"); - } - else - { - if (!IsChildlessTag((string)ReplaceTags[node.nodeName])) - { - escapedText.Append("<" + (string)ReplaceTags[node.nodeName] + ">"); - } - // Since there are children, we're going to emit the replacement - // tag at the end of this node - tagStillOpen = true; - } - } + if (node.firstChild != null) + { + StripChildNodes(node.firstChild, escapedText, preserveImages, progress); + } - if (node.firstChild != null) - { - StripChildNodes(node.firstChild, escapedText, preserveImages, progress); - } + // put a closing tag in for the current element (because we left it open in case of children) + if (tagStillOpen) + { + if (PreserveTags.Contains(node.nodeName)) + escapedText.Append(""); + else if (ReplaceTags.Contains(node.nodeName)) + { + if (!IsChildlessTag((string)ReplaceTags[node.nodeName])) + escapedText.Append(""); + else + escapedText.Append("<" + (string)ReplaceTags[node.nodeName] + "/>"); + } + } + } - // put a closing tag in for the current element (because we left it open in case of children) - if (tagStillOpen) - { - if (PreserveTags.Contains(node.nodeName)) - escapedText.Append(""); - else if (ReplaceTags.Contains(node.nodeName)) - { - if (!IsChildlessTag((string)ReplaceTags[node.nodeName])) - escapedText.Append(""); - else - escapedText.Append("<" + (string)ReplaceTags[node.nodeName] + "/>"); - } - } - } + if (node.nextSibling != null) + { + StripChildNodes(node.nextSibling, escapedText, preserveImages, progress); + } + } - if (node.nextSibling != null) - { - StripChildNodes(node.nextSibling, escapedText, preserveImages, progress); - } - } + /// + /// Remove any extraneous attributes from an Attribute Collection + /// + /// The attribute collection + /// a string representing the attributes with extraneous attributes removed + public static void StripAttributes(IHTMLElement element, StringBuilder escapedText) + { + foreach (string attr in PreserveAttributes) + { - /// - /// Remove any extraneous attributes from an Attribute Collection - /// - /// The attribute collection - /// a string representing the attributes with extraneous attributes removed - public static void StripAttributes(IHTMLElement element, StringBuilder escapedText) - { - foreach (string attr in PreserveAttributes) - { + object attrObject = element.getAttribute(attr, 2); //note: use 2 as param to get pure attr value + string attrValue = null; + if (attrObject != null) + attrValue = attrObject.ToString(); - object attrObject = element.getAttribute(attr, 2); //note: use 2 as param to get pure attr value - string attrValue = null; - if (attrObject != null) - attrValue = attrObject.ToString(); + if (attrValue != null && attrValue != string.Empty) + { + escapedText.Append(" " + attr.ToUpper(CultureInfo.InvariantCulture) + "=\"" + attrValue + "\""); + } + } + } - if (attrValue != null && attrValue != string.Empty) - { - escapedText.Append(" " + attr.ToUpper(CultureInfo.InvariantCulture) + "=\"" + attrValue + "\""); - } - } - } + private static bool IsChildlessTag(string tagName) + { + return tagName == HTMLTokens.Br; + } - private static bool IsChildlessTag(string tagName) - { - return tagName == HTMLTokens.Br; - } + /// + /// The list of tags that will be preserved when the HTML is thinned. + /// + private static ArrayList PreserveTags + { + get + { + if (m_preserveTags == null) + { + m_preserveTags = new ArrayList(); + m_preserveTags.Add(HTMLTokens.A); + m_preserveTags.Add(HTMLTokens.P); + m_preserveTags.Add(HTMLTokens.Br); + m_preserveTags.Add(HTMLTokens.Form); + m_preserveTags.Add(HTMLTokens.Input); + m_preserveTags.Add(HTMLTokens.Select); + m_preserveTags.Add(HTMLTokens.Option); + m_preserveTags.Add(HTMLTokens.Ilayer); + m_preserveTags.Add(HTMLTokens.Meta); + m_preserveTags.Add(HTMLTokens.Head); + m_preserveTags.Add(HTMLTokens.Body); + m_preserveTags.Add(HTMLTokens.Div); + m_preserveTags.Add(HTMLTokens.IFrame); + m_preserveTags.Add(HTMLTokens.Pre); + } + return m_preserveTags; + } + } + private static ArrayList m_preserveTags; + private static ArrayList PreserveTagsWithImages + { + get + { + if (m_preserveTagsWithImages == null) + { + m_preserveTagsWithImages = new ArrayList(); + foreach (string s in PreserveTags) + m_preserveTagsWithImages.Add(s); + m_preserveTagsWithImages.Add(HTMLTokens.Img); + } + return m_preserveTagsWithImages; + } + } + private static ArrayList m_preserveTagsWithImages; - /// - /// The list of tags that will be preserved when the HTML is thinned. - /// - private static ArrayList PreserveTags - { - get - { - if (m_preserveTags == null) - { - m_preserveTags = new ArrayList(); - m_preserveTags.Add(HTMLTokens.A); - m_preserveTags.Add(HTMLTokens.P); - m_preserveTags.Add(HTMLTokens.Br); - m_preserveTags.Add(HTMLTokens.Form); - m_preserveTags.Add(HTMLTokens.Input); - m_preserveTags.Add(HTMLTokens.Select); - m_preserveTags.Add(HTMLTokens.Option); - m_preserveTags.Add(HTMLTokens.Ilayer); - m_preserveTags.Add(HTMLTokens.Meta); - m_preserveTags.Add(HTMLTokens.Head); - m_preserveTags.Add(HTMLTokens.Body); - m_preserveTags.Add(HTMLTokens.Div); - m_preserveTags.Add(HTMLTokens.IFrame); - m_preserveTags.Add(HTMLTokens.Pre); - } - return m_preserveTags; - } - } - private static ArrayList m_preserveTags; + /// + /// A table of tags and their replacements when thinning + /// + private static Hashtable ReplaceTags + { + get + { + if (m_replaceTags == null) + { + m_replaceTags = new Hashtable(); + m_replaceTags.Add(HTMLTokens.H1, HTMLTokens.P); + m_replaceTags.Add(HTMLTokens.H2, HTMLTokens.P); + m_replaceTags.Add(HTMLTokens.H3, HTMLTokens.P); + m_replaceTags.Add(HTMLTokens.H4, HTMLTokens.P); + m_replaceTags.Add(HTMLTokens.H5, HTMLTokens.P); + m_replaceTags.Add(HTMLTokens.H6, HTMLTokens.P); + m_replaceTags.Add(HTMLTokens.Hr, HTMLTokens.P); + m_replaceTags.Add(HTMLTokens.Li, HTMLTokens.Br); + m_replaceTags.Add(HTMLTokens.Dt, HTMLTokens.Br); + m_replaceTags.Add(HTMLTokens.Dd, HTMLTokens.Br); + m_replaceTags.Add(HTMLTokens.Menu, HTMLTokens.P); + m_replaceTags.Add(HTMLTokens.Ul, HTMLTokens.P); + m_replaceTags.Add(HTMLTokens.Ol, HTMLTokens.P); + m_replaceTags.Add(HTMLTokens.Dir, HTMLTokens.P); + m_replaceTags.Add(HTMLTokens.Dl, HTMLTokens.P); + m_replaceTags.Add(HTMLTokens.Blockquote, HTMLTokens.P); - private static ArrayList PreserveTagsWithImages - { - get - { - if (m_preserveTagsWithImages == null) - { - m_preserveTagsWithImages = new ArrayList(); - foreach (string s in PreserveTags) - m_preserveTagsWithImages.Add(s); - m_preserveTagsWithImages.Add(HTMLTokens.Img); - } - return m_preserveTagsWithImages; - } - } - private static ArrayList m_preserveTagsWithImages; + } + return m_replaceTags; + } + } + private static Hashtable m_replaceTags; - /// - /// A table of tags and their replacements when thinning - /// - private static Hashtable ReplaceTags - { - get - { - if (m_replaceTags == null) - { - m_replaceTags = new Hashtable(); - m_replaceTags.Add(HTMLTokens.H1, HTMLTokens.P); - m_replaceTags.Add(HTMLTokens.H2, HTMLTokens.P); - m_replaceTags.Add(HTMLTokens.H3, HTMLTokens.P); - m_replaceTags.Add(HTMLTokens.H4, HTMLTokens.P); - m_replaceTags.Add(HTMLTokens.H5, HTMLTokens.P); - m_replaceTags.Add(HTMLTokens.H6, HTMLTokens.P); - m_replaceTags.Add(HTMLTokens.Hr, HTMLTokens.P); - m_replaceTags.Add(HTMLTokens.Li, HTMLTokens.Br); - m_replaceTags.Add(HTMLTokens.Dt, HTMLTokens.Br); - m_replaceTags.Add(HTMLTokens.Dd, HTMLTokens.Br); - m_replaceTags.Add(HTMLTokens.Menu, HTMLTokens.P); - m_replaceTags.Add(HTMLTokens.Ul, HTMLTokens.P); - m_replaceTags.Add(HTMLTokens.Ol, HTMLTokens.P); - m_replaceTags.Add(HTMLTokens.Dir, HTMLTokens.P); - m_replaceTags.Add(HTMLTokens.Dl, HTMLTokens.P); - m_replaceTags.Add(HTMLTokens.Blockquote, HTMLTokens.P); + /// + /// The list of attributes that should be preserved + /// + private static ArrayList PreserveAttributes + { + get + { + if (m_preserveAttributes == null) + { + m_preserveAttributes = new ArrayList( + new string[]{HTMLTokens.Href,HTMLTokens.Name,HTMLTokens.Value,HTMLTokens.Action,HTMLTokens.Method, + HTMLTokens.Enctype,HTMLTokens.Size,HTMLTokens.Type,HTMLTokens.Src, HTMLTokens.Content, HTMLTokens.HttpEquiv, + HTMLTokens.Height, HTMLTokens.Width, HTMLTokens.Alt}); + } + return m_preserveAttributes; + } + } + private static ArrayList m_preserveAttributes; - } - return m_replaceTags; - } - } - private static Hashtable m_replaceTags; - - /// - /// The list of attributes that should be preserved - /// - private static ArrayList PreserveAttributes - { - get - { - if (m_preserveAttributes == null) - { - m_preserveAttributes = new ArrayList( - new string[]{HTMLTokens.Href,HTMLTokens.Name,HTMLTokens.Value,HTMLTokens.Action,HTMLTokens.Method, - HTMLTokens.Enctype,HTMLTokens.Size,HTMLTokens.Type,HTMLTokens.Src, HTMLTokens.Content, HTMLTokens.HttpEquiv, - HTMLTokens.Height, HTMLTokens.Width, HTMLTokens.Alt}); - } - return m_preserveAttributes; - } - } - private static ArrayList m_preserveAttributes; - - - } + } } diff --git a/src/managed/OpenLiveWriter.CoreServices/HTML/HtmlCleaner.cs b/src/managed/OpenLiveWriter.CoreServices/HTML/HtmlCleaner.cs index 39e3d14a..ae8570c1 100644 --- a/src/managed/OpenLiveWriter.CoreServices/HTML/HtmlCleaner.cs +++ b/src/managed/OpenLiveWriter.CoreServices/HTML/HtmlCleaner.cs @@ -9,23 +9,22 @@ using OpenLiveWriter.HtmlParser.Parser; namespace OpenLiveWriter.CoreServices.HTML { /* - HTML enters the PostEditor "from the wild" in 4 ways: + HTML enters the PostEditor "from the wild" in 4 ways: - - HTML marshalling (HtmlHandler.DoInsertData). This entry point calls the HtmlGenerationService - CleanupHtml method the PostEditor implementation of which calls PostEditorHtmlCleaner.CleanupHtml + - HTML marshalling (HtmlHandler.DoInsertData). This entry point calls the HtmlGenerationService + CleanupHtml method the PostEditor implementation of which calls PostEditorHtmlCleaner.CleanupHtml - - LC marshalling (LiveClipboardHtmlFormatHandler.DoInsertData). This entry point calls - PostEditorHtmlCleaner.RemoveScripts to remove only scripts, the assumption being that - LC presentations only need security transformations not formatting transformations. + - LC marshalling (LiveClipboardHtmlFormatHandler.DoInsertData). This entry point calls + PostEditorHtmlCleaner.RemoveScripts to remove only scripts, the assumption being that + LC presentations only need security transformations not formatting transformations. - - - Plugins can insert HTML in two places. Simple content sources (ultimately) go through - BlogPostHtmlEditor.InsertHtml, which ultimately calls HtmlEditorControl.InsertContent. - Smart content sources call SmartContentInsertionHelper to do their insertion. Both of - these paths allow "raw" access to HTML insertion. We will ultimately need to provide a - service to plugins to do security and formatting oriented transformations of HTML - that they retreive "from the wild". - */ + - Plugins can insert HTML in two places. Simple content sources (ultimately) go through + BlogPostHtmlEditor.InsertHtml, which ultimately calls HtmlEditorControl.InsertContent. + Smart content sources call SmartContentInsertionHelper to do their insertion. Both of + these paths allow "raw" access to HTML insertion. We will ultimately need to provide a + service to plugins to do security and formatting oriented transformations of HTML + that they retreive "from the wild". + */ public class HtmlCleaner { diff --git a/src/managed/OpenLiveWriter.CoreServices/HTML/LightWeightHTMLDocument.cs b/src/managed/OpenLiveWriter.CoreServices/HTML/LightWeightHTMLDocument.cs index 7095eba8..90f40cc4 100644 --- a/src/managed/OpenLiveWriter.CoreServices/HTML/LightWeightHTMLDocument.cs +++ b/src/managed/OpenLiveWriter.CoreServices/HTML/LightWeightHTMLDocument.cs @@ -683,7 +683,6 @@ namespace OpenLiveWriter.CoreServices base.OnEndTag(tag); } - protected override void OnText(Text text) { if (_nextTextIsTitleText) diff --git a/src/managed/OpenLiveWriter.CoreServices/HTML/LightWeightHTMLReplacer.cs b/src/managed/OpenLiveWriter.CoreServices/HTML/LightWeightHTMLReplacer.cs index dd8ed492..e6d9a9dc 100644 --- a/src/managed/OpenLiveWriter.CoreServices/HTML/LightWeightHTMLReplacer.cs +++ b/src/managed/OpenLiveWriter.CoreServices/HTML/LightWeightHTMLReplacer.cs @@ -106,7 +106,6 @@ namespace OpenLiveWriter.CoreServices return html; } - private int _scriptDepth = 0; protected override void OnBeginTag(BeginTag tag) { @@ -393,7 +392,6 @@ namespace OpenLiveWriter.CoreServices } } - //check substitution Urls return value; } @@ -407,7 +405,6 @@ namespace OpenLiveWriter.CoreServices } private static string[] _jscriptAttributes = new string[] { "onload", "onclick", "onblur", "onchange", "onerror", "onfocus", "onmouseout", "onmouseover", "onreset", "onsubmit", "onselect", "onunload", "onmousedown", "onmouseup", "ondblclick", "onmousemove", "onkeypress", "onkeydown", "onkeyup", }; - private void ModifyMetaDataAsNecessary(BeginTag tag) { if (_metaData == null) @@ -506,5 +503,4 @@ namespace OpenLiveWriter.CoreServices private static string[] _permittedBeforeBody = new string[] { HTMLTokens.Html, HTMLTokens.Head, HTMLTokens.Title, HTMLTokens.Script, HTMLTokens.Style, HTMLTokens.Meta, HTMLTokens.Link, HTMLTokens.Object, HTMLTokens.Base, HTMLTokens.Frame, HTMLTokens.FrameSet, HTMLTokens.NoScript }; } - } diff --git a/src/managed/OpenLiveWriter.CoreServices/HTML/LightWeightHTMLThinner.cs b/src/managed/OpenLiveWriter.CoreServices/HTML/LightWeightHTMLThinner.cs index 5530faee..335a5d89 100644 --- a/src/managed/OpenLiveWriter.CoreServices/HTML/LightWeightHTMLThinner.cs +++ b/src/managed/OpenLiveWriter.CoreServices/HTML/LightWeightHTMLThinner.cs @@ -8,284 +8,284 @@ using OpenLiveWriter.HtmlParser.Parser; namespace OpenLiveWriter.CoreServices { - /// - /// Summary description for LightweightHTMLThinner. - /// - public class LightWeightHTMLThinner : LightWeightHTMLReplacer - { - [Flags] - public enum ThinnerBehavior - { - ThinForPage = 1, - ThinForSnippet = 2, - PreserveImages = 4 - } + /// + /// Summary description for LightweightHTMLThinner. + /// + public class LightWeightHTMLThinner : LightWeightHTMLReplacer + { + [Flags] + public enum ThinnerBehavior + { + ThinForPage = 1, + ThinForSnippet = 2, + PreserveImages = 4 + } - public static string ThinHTML(string html) - { - return ThinHTML(html, ThinnerBehavior.ThinForPage); - } + public static string ThinHTML(string html) + { + return ThinHTML(html, ThinnerBehavior.ThinForPage); + } - public static string ThinHTML(string html, string url) - { - return ThinHTML(html, url, ThinnerBehavior.ThinForPage); - } + public static string ThinHTML(string html, string url) + { + return ThinHTML(html, url, ThinnerBehavior.ThinForPage); + } - public static string ThinHTML(string html, ThinnerBehavior behavior) - { - return ThinHTML(html, null, behavior); - } + public static string ThinHTML(string html, ThinnerBehavior behavior) + { + return ThinHTML(html, null, behavior); + } - public static string ThinHTML(string html, string url, ThinnerBehavior behavior) - { - LightWeightHTMLThinner thinner = new LightWeightHTMLThinner(html, url, behavior); - return thinner.DoReplace(); - } + public static string ThinHTML(string html, string url, ThinnerBehavior behavior) + { + LightWeightHTMLThinner thinner = new LightWeightHTMLThinner(html, url, behavior); + return thinner.DoReplace(); + } - private LightWeightHTMLThinner(string html, string url, ThinnerBehavior behavior) : base(html, url) - { - _behavior = behavior; - } - private ThinnerBehavior _behavior; + private LightWeightHTMLThinner(string html, string url, ThinnerBehavior behavior) : base(html, url) + { + _behavior = behavior; + } + private ThinnerBehavior _behavior; - private ArrayList TagsToPreserve - { - get - { - if (_tagsToPreserve == null) - { - if ((_behavior & ThinnerBehavior.ThinForPage) == ThinnerBehavior.ThinForPage) - _tagsToPreserve = (ArrayList)PreserveTagsForPage.Clone(); - else - _tagsToPreserve = (ArrayList)PreserveTagsForSnippets.Clone(); + private ArrayList TagsToPreserve + { + get + { + if (_tagsToPreserve == null) + { + if ((_behavior & ThinnerBehavior.ThinForPage) == ThinnerBehavior.ThinForPage) + _tagsToPreserve = (ArrayList)PreserveTagsForPage.Clone(); + else + _tagsToPreserve = (ArrayList)PreserveTagsForSnippets.Clone(); - if ((_behavior & ThinnerBehavior.PreserveImages) == ThinnerBehavior.PreserveImages) - _tagsToPreserve = IncludeImages(_tagsToPreserve); - } - return _tagsToPreserve; - } - } - private ArrayList _tagsToPreserve = null; + if ((_behavior & ThinnerBehavior.PreserveImages) == ThinnerBehavior.PreserveImages) + _tagsToPreserve = IncludeImages(_tagsToPreserve); + } + return _tagsToPreserve; + } + } + private ArrayList _tagsToPreserve = null; - protected override void OnBeginTag(BeginTag tag) - { - if (tag.NameEquals(HTMLTokens.Title) && !tag.Complete) - _inTitle = true; + protected override void OnBeginTag(BeginTag tag) + { + if (tag.NameEquals(HTMLTokens.Title) && !tag.Complete) + _inTitle = true; - if (TagsToPreserve.Contains(tag.Name.ToUpper(CultureInfo.InvariantCulture))) - { - EmitTagAndAttributes(tag.Name, tag); - } - else if (ReplaceTags.ContainsKey(tag.Name.ToUpper(CultureInfo.InvariantCulture))) - { - EmitTagAndAttributes((string)ReplaceTags[tag.Name.ToUpper(CultureInfo.InvariantCulture)], tag); - } - } + if (TagsToPreserve.Contains(tag.Name.ToUpper(CultureInfo.InvariantCulture))) + { + EmitTagAndAttributes(tag.Name, tag); + } + else if (ReplaceTags.ContainsKey(tag.Name.ToUpper(CultureInfo.InvariantCulture))) + { + EmitTagAndAttributes((string)ReplaceTags[tag.Name.ToUpper(CultureInfo.InvariantCulture)], tag); + } + } - private bool _inTitle = false; + private bool _inTitle = false; - protected override string InsertSpecialHeaders(string html) - { - return html; - } + protected override string InsertSpecialHeaders(string html) + { + return html; + } - private void EmitTagAndAttributes(string tagName, Tag tag) - { - BeginTag beginTag = tag as BeginTag; - if (beginTag != null) - { - Emit(string.Format(CultureInfo.InvariantCulture, "<{0}", tagName)); - foreach (Attr attr in beginTag.Attributes) - if (PreserveAttributes.Contains(attr.Name.ToUpper(CultureInfo.InvariantCulture))) - Emit(" " + attr.ToString()); - if (beginTag.Complete) - Emit("/"); - Emit(">"); - } - else - { - if (tagName.ToUpper(CultureInfo.InvariantCulture) != HTMLTokens.Br && tagName.ToUpper(CultureInfo.InvariantCulture) != HTMLTokens.Img) - Emit(string.Format(CultureInfo.InvariantCulture, "", tagName)); - } - } + private void EmitTagAndAttributes(string tagName, Tag tag) + { + BeginTag beginTag = tag as BeginTag; + if (beginTag != null) + { + Emit(string.Format(CultureInfo.InvariantCulture, "<{0}", tagName)); + foreach (Attr attr in beginTag.Attributes) + if (PreserveAttributes.Contains(attr.Name.ToUpper(CultureInfo.InvariantCulture))) + Emit(" " + attr.ToString()); + if (beginTag.Complete) + Emit("/"); + Emit(">"); + } + else + { + if (tagName.ToUpper(CultureInfo.InvariantCulture) != HTMLTokens.Br && tagName.ToUpper(CultureInfo.InvariantCulture) != HTMLTokens.Img) + Emit(string.Format(CultureInfo.InvariantCulture, "", tagName)); + } + } - protected override void OnEndTag(EndTag tag) - { - if (tag.Implicit) - return; - if (tag.NameEquals(HTMLTokens.Title)) - _inTitle = false; + protected override void OnEndTag(EndTag tag) + { + if (tag.Implicit) + return; + if (tag.NameEquals(HTMLTokens.Title)) + _inTitle = false; - if (TagsToPreserve.Contains(tag.Name.ToUpper(CultureInfo.InvariantCulture))) - EmitTagAndAttributes(tag.Name, tag); - else if (ReplaceTags.ContainsKey(tag.Name.ToUpper(CultureInfo.InvariantCulture))) - { - EmitTagAndAttributes((string)ReplaceTags[tag.Name.ToUpper(CultureInfo.InvariantCulture)], tag); - } - } + if (TagsToPreserve.Contains(tag.Name.ToUpper(CultureInfo.InvariantCulture))) + EmitTagAndAttributes(tag.Name, tag); + else if (ReplaceTags.ContainsKey(tag.Name.ToUpper(CultureInfo.InvariantCulture))) + { + EmitTagAndAttributes((string)ReplaceTags[tag.Name.ToUpper(CultureInfo.InvariantCulture)], tag); + } + } - protected override void OnComment(Comment comment) - { - base.OnComment (comment); - } + protected override void OnComment(Comment comment) + { + base.OnComment (comment); + } - protected override void OnMarkupDirective(MarkupDirective markupDirective) - { - } + protected override void OnMarkupDirective(MarkupDirective markupDirective) + { + } - protected override void OnScriptComment(ScriptComment scriptComment) - { - } + protected override void OnScriptComment(ScriptComment scriptComment) + { + } - protected override void OnScriptLiteral(ScriptLiteral literal) - { - } + protected override void OnScriptLiteral(ScriptLiteral literal) + { + } - protected override void OnScriptText(ScriptText scriptText) - { - } + protected override void OnScriptText(ScriptText scriptText) + { + } - protected override void OnStyleLiteral(StyleLiteral literal) - { - } + protected override void OnStyleLiteral(StyleLiteral literal) + { + } - protected override void OnStyleText(StyleText text) - { - } + protected override void OnStyleText(StyleText text) + { + } - protected override void OnStyleUrl(StyleUrl styleUrl) - { - } + protected override void OnStyleUrl(StyleUrl styleUrl) + { + } - protected override void OnDocumentBegin() - { - } + protected override void OnDocumentBegin() + { + } - protected override void OnDocumentEnd() - { - } + protected override void OnDocumentEnd() + { + } - protected override void OnText(Text text) - { - if (_inTitle) - return; + protected override void OnText(Text text) + { + if (_inTitle) + return; - string textToEmit = text.RawText; - textToEmit = textToEmit.Replace("\n", " "); - textToEmit = textToEmit.Replace("\r", " "); - textToEmit = textToEmit.Replace("\r\n", " "); - Emit(textToEmit); - } + string textToEmit = text.RawText; + textToEmit = textToEmit.Replace("\n", " "); + textToEmit = textToEmit.Replace("\r", " "); + textToEmit = textToEmit.Replace("\r\n", " "); + Emit(textToEmit); + } - protected override void OnStyleImport(StyleImport styleImport) - { + protected override void OnStyleImport(StyleImport styleImport) + { - } + } - /// - /// A table of tags and their replacements when thinning - /// - private static Hashtable ReplaceTags - { - get - { - if (m_replaceTags == null) - { - m_replaceTags = new Hashtable(); - m_replaceTags.Add(HTMLTokens.H1, HTMLTokens.P); - m_replaceTags.Add(HTMLTokens.H2, HTMLTokens.P); - m_replaceTags.Add(HTMLTokens.H3, HTMLTokens.P); - m_replaceTags.Add(HTMLTokens.H4, HTMLTokens.P); - m_replaceTags.Add(HTMLTokens.H5, HTMLTokens.P); - m_replaceTags.Add(HTMLTokens.H6, HTMLTokens.P); - m_replaceTags.Add(HTMLTokens.Hr, HTMLTokens.P); - m_replaceTags.Add(HTMLTokens.Li, HTMLTokens.Br); - m_replaceTags.Add(HTMLTokens.Dt, HTMLTokens.Br); - m_replaceTags.Add(HTMLTokens.Dd, HTMLTokens.Br); - m_replaceTags.Add(HTMLTokens.Menu, HTMLTokens.P); - m_replaceTags.Add(HTMLTokens.Ul, HTMLTokens.P); - m_replaceTags.Add(HTMLTokens.Ol, HTMLTokens.P); - m_replaceTags.Add(HTMLTokens.Dir, HTMLTokens.P); - m_replaceTags.Add(HTMLTokens.Dl, HTMLTokens.P); - m_replaceTags.Add(HTMLTokens.Blockquote, HTMLTokens.P); + /// + /// A table of tags and their replacements when thinning + /// + private static Hashtable ReplaceTags + { + get + { + if (m_replaceTags == null) + { + m_replaceTags = new Hashtable(); + m_replaceTags.Add(HTMLTokens.H1, HTMLTokens.P); + m_replaceTags.Add(HTMLTokens.H2, HTMLTokens.P); + m_replaceTags.Add(HTMLTokens.H3, HTMLTokens.P); + m_replaceTags.Add(HTMLTokens.H4, HTMLTokens.P); + m_replaceTags.Add(HTMLTokens.H5, HTMLTokens.P); + m_replaceTags.Add(HTMLTokens.H6, HTMLTokens.P); + m_replaceTags.Add(HTMLTokens.Hr, HTMLTokens.P); + m_replaceTags.Add(HTMLTokens.Li, HTMLTokens.Br); + m_replaceTags.Add(HTMLTokens.Dt, HTMLTokens.Br); + m_replaceTags.Add(HTMLTokens.Dd, HTMLTokens.Br); + m_replaceTags.Add(HTMLTokens.Menu, HTMLTokens.P); + m_replaceTags.Add(HTMLTokens.Ul, HTMLTokens.P); + m_replaceTags.Add(HTMLTokens.Ol, HTMLTokens.P); + m_replaceTags.Add(HTMLTokens.Dir, HTMLTokens.P); + m_replaceTags.Add(HTMLTokens.Dl, HTMLTokens.P); + m_replaceTags.Add(HTMLTokens.Blockquote, HTMLTokens.P); - } - return m_replaceTags; - } - } - private static Hashtable m_replaceTags = null; + } + return m_replaceTags; + } + } + private static Hashtable m_replaceTags = null; - /// - /// The list of attributes that should be preserved - /// - private static ArrayList PreserveAttributes - { - get - { - if (m_preserveAttributes == null) - { - m_preserveAttributes = new ArrayList( - new string[]{HTMLTokens.Href,HTMLTokens.Name,HTMLTokens.Value,HTMLTokens.Action,HTMLTokens.Method, - HTMLTokens.Enctype,HTMLTokens.Size,HTMLTokens.Type,HTMLTokens.Src, HTMLTokens.Content, HTMLTokens.HttpEquiv, - HTMLTokens.Height, HTMLTokens.Width, HTMLTokens.Alt}); - } - return m_preserveAttributes; - } - } - private static ArrayList m_preserveAttributes = null; + /// + /// The list of attributes that should be preserved + /// + private static ArrayList PreserveAttributes + { + get + { + if (m_preserveAttributes == null) + { + m_preserveAttributes = new ArrayList( + new string[]{HTMLTokens.Href,HTMLTokens.Name,HTMLTokens.Value,HTMLTokens.Action,HTMLTokens.Method, + HTMLTokens.Enctype,HTMLTokens.Size,HTMLTokens.Type,HTMLTokens.Src, HTMLTokens.Content, HTMLTokens.HttpEquiv, + HTMLTokens.Height, HTMLTokens.Width, HTMLTokens.Alt}); + } + return m_preserveAttributes; + } + } + private static ArrayList m_preserveAttributes = null; - /// - /// The list of tags that should be preserved by the thinner, including images - /// - private ArrayList IncludeImages(ArrayList tagList) - { - tagList.Add(HTMLTokens.Img); - return tagList; - } + /// + /// The list of tags that should be preserved by the thinner, including images + /// + private ArrayList IncludeImages(ArrayList tagList) + { + tagList.Add(HTMLTokens.Img); + return tagList; + } - private static ArrayList PreserveTagsForPage - { - get - { - if (_preserverTagsForPage == null) - { - _preserverTagsForPage = new ArrayList(); - foreach (string s in PreserveTagsForSnippets) - _preserverTagsForPage.Add(s); - _preserverTagsForPage.Add(HTMLTokens.Meta); - _preserverTagsForPage.Add(HTMLTokens.Head); - _preserverTagsForPage.Add(HTMLTokens.Body); - } - return _preserverTagsForPage; - } - } - private static ArrayList _preserverTagsForPage; + private static ArrayList PreserveTagsForPage + { + get + { + if (_preserverTagsForPage == null) + { + _preserverTagsForPage = new ArrayList(); + foreach (string s in PreserveTagsForSnippets) + _preserverTagsForPage.Add(s); + _preserverTagsForPage.Add(HTMLTokens.Meta); + _preserverTagsForPage.Add(HTMLTokens.Head); + _preserverTagsForPage.Add(HTMLTokens.Body); + } + return _preserverTagsForPage; + } + } + private static ArrayList _preserverTagsForPage; - /// - /// The list of tags that will be preserved when the HTML is thinned. - /// - private static ArrayList PreserveTagsForSnippets - { - get - { - if (m_preserveTags == null) - { - m_preserveTags = new ArrayList(); - m_preserveTags.Add(HTMLTokens.A); - m_preserveTags.Add(HTMLTokens.P); - m_preserveTags.Add(HTMLTokens.Br); - m_preserveTags.Add(HTMLTokens.Form); - m_preserveTags.Add(HTMLTokens.Input); - m_preserveTags.Add(HTMLTokens.Select); - m_preserveTags.Add(HTMLTokens.Option); - m_preserveTags.Add(HTMLTokens.Ilayer); - m_preserveTags.Add(HTMLTokens.Div); - m_preserveTags.Add(HTMLTokens.IFrame); - m_preserveTags.Add(HTMLTokens.Pre); - } - return m_preserveTags; - } - } - private static ArrayList m_preserveTags = null; - } + /// + /// The list of tags that will be preserved when the HTML is thinned. + /// + private static ArrayList PreserveTagsForSnippets + { + get + { + if (m_preserveTags == null) + { + m_preserveTags = new ArrayList(); + m_preserveTags.Add(HTMLTokens.A); + m_preserveTags.Add(HTMLTokens.P); + m_preserveTags.Add(HTMLTokens.Br); + m_preserveTags.Add(HTMLTokens.Form); + m_preserveTags.Add(HTMLTokens.Input); + m_preserveTags.Add(HTMLTokens.Select); + m_preserveTags.Add(HTMLTokens.Option); + m_preserveTags.Add(HTMLTokens.Ilayer); + m_preserveTags.Add(HTMLTokens.Div); + m_preserveTags.Add(HTMLTokens.IFrame); + m_preserveTags.Add(HTMLTokens.Pre); + } + return m_preserveTags; + } + } + private static ArrayList m_preserveTags = null; + } } diff --git a/src/managed/OpenLiveWriter.CoreServices/HTML/LightweightCSSIterator.cs b/src/managed/OpenLiveWriter.CoreServices/HTML/LightweightCSSIterator.cs index 902bb140..779e5a2b 100644 --- a/src/managed/OpenLiveWriter.CoreServices/HTML/LightweightCSSIterator.cs +++ b/src/managed/OpenLiveWriter.CoreServices/HTML/LightweightCSSIterator.cs @@ -73,6 +73,5 @@ namespace OpenLiveWriter.CoreServices protected virtual void OnStyleText(StyleText styleText) { } - } } diff --git a/src/managed/OpenLiveWriter.CoreServices/HTML/WebPageDownloader.cs b/src/managed/OpenLiveWriter.CoreServices/HTML/WebPageDownloader.cs index 75039626..b6a4594b 100644 --- a/src/managed/OpenLiveWriter.CoreServices/HTML/WebPageDownloader.cs +++ b/src/managed/OpenLiveWriter.CoreServices/HTML/WebPageDownloader.cs @@ -15,169 +15,162 @@ using Project31.BrowserControl ; using mshtml ; - namespace Project31.CoreServices { - public class WebPageDownloader : IDisposable, IOleClientSite - { - /// - /// Initialize the downloader - /// - public WebPageDownloader() - { - // create the undelrying control - browserControl = new ExplorerBrowserControl() ; + public class WebPageDownloader : IDisposable, IOleClientSite + { + /// + /// Initialize the downloader + /// + public WebPageDownloader() + { + // create the undelrying control + browserControl = new ExplorerBrowserControl() ; - // set us as the client site - // http://www.codeproject.com/books/0764549146_8.asp - // http://discuss.develop.com/archives/wa.exe?A2=ind0205A&L=DOTNET&D=0&P=15756 - IOleObject oleObject = (IOleObject)browserControl.Browser ; - oleObject.SetClientSite( this ) ; + // set us as the client site + // http://www.codeproject.com/books/0764549146_8.asp + // http://discuss.develop.com/archives/wa.exe?A2=ind0205A&L=DOTNET&D=0&P=15756 + IOleObject oleObject = (IOleObject)browserControl.Browser ; + oleObject.SetClientSite( this ) ; - // configure options - browserControl.Browser.Silent = true ; + // configure options + browserControl.Browser.Silent = true ; - // subscribe to events - browserControl.ProgressChange +=new BrowserProgressChangeEventHandler(browserControl_ProgressChange); - browserControl.DocumentComplete +=new BrowserDocumentEventHandler(browserControl_DocumentComplete); - browserControl.NewWindow2 +=new Project31.BrowserControl.DWebBrowserEvents2_NewWindow2EventHandler(browserControl_NewWindow2); - } + // subscribe to events + browserControl.ProgressChange +=new BrowserProgressChangeEventHandler(browserControl_ProgressChange); + browserControl.DocumentComplete +=new BrowserDocumentEventHandler(browserControl_DocumentComplete); + browserControl.NewWindow2 +=new Project31.BrowserControl.DWebBrowserEvents2_NewWindow2EventHandler(browserControl_NewWindow2); + } + + /// + /// Download from the specified URL + /// + /// + public void DownloadFromUrl( string url ) + { + browserControl.Navigate( url, false ) ; + } - /// - /// Download from the specified URL - /// - /// - public void DownloadFromUrl( string url ) - { - browserControl.Navigate( url, false ) ; - } + /// + /// Event which indicates that the download is complete + /// + public event EventHandler DownloadComplete ; + /// + /// Event which fires when total download progress is updated + /// + public event ProgressUpdatedEventHandler ProgressUpdated ; + /// + /// Get the underlying document that the control has downloaded (only + /// available after DownloadComplete fires) + /// + public IHTMLDocument2 HTMLDocument + { + get { return (IHTMLDocument2)browserControl.Document; } - /// - /// Event which indicates that the download is complete - /// - public event EventHandler DownloadComplete ; + } + /// + /// Cleanup resources + /// + public void Dispose() + { + if ( browserControl != null ) + browserControl.Dispose() ; + } - /// - /// Event which fires when total download progress is updated - /// - public event ProgressUpdatedEventHandler ProgressUpdated ; + /// + /// Respond to the AMBIENT_DLCONTROL disp-id by returning our download-control flags + /// + /// + [DispId(MSHTML_DISPID.AMBIENT_DLCONTROL)] + public int AmbientDLControl() + { + return DLCTL.DOWNLOADONLY | DLCTL.NO_CLIENTPULL | + DLCTL.NO_JAVA | DLCTL.NO_DLACTIVEXCTLS | + DLCTL.NO_RUNACTIVEXCTLS | DLCTL.SILENT ; + } - /// - /// Get the underlying document that the control has downloaded (only - /// available after DownloadComplete fires) - /// - public IHTMLDocument2 HTMLDocument - { - get { return (IHTMLDocument2)browserControl.Document; } + /// + /// Handle document complete event + /// + /// sender + /// event args + private void browserControl_DocumentComplete(object sender, BrowserDocumentEventArgs e) + { + // verify ready-state complete + Debug.Assert( browserControl.Browser.ReadyState == tagREADYSTATE.READYSTATE_COMPLETE ) ; - } + // propagate event + if ( DownloadComplete != null ) + DownloadComplete( this, EventArgs.Empty ) ; + } - /// - /// Cleanup resources - /// - public void Dispose() - { - if ( browserControl != null ) - browserControl.Dispose() ; - } + /// + /// Handle new window event (prevent all pop-up windows from displaying) + /// + /// sender + /// event args + private void browserControl_NewWindow2(object sender, DWebBrowserEvents2_NewWindow2Event e) + { + // prevent pop-ups! + e.cancel = true ; + } + /// + /// Handle progress changed event + /// + /// sender + /// event args + private void browserControl_ProgressChange(object sender, BrowserProgressChangeEventArgs e) + { + if ( ProgressUpdated != null ) + { + ProgressUpdatedEventArgs ea = new ProgressUpdatedEventArgs( + Convert.ToInt32(e.Progress), Convert.ToInt32(e.ProgressMax), String.Empty ) ; + ProgressUpdated( this, ea ) ; + } + } - /// - /// Respond to the AMBIENT_DLCONTROL disp-id by returning our download-control flags - /// - /// - [DispId(MSHTML_DISPID.AMBIENT_DLCONTROL)] - public int AmbientDLControl() - { - return DLCTL.DOWNLOADONLY | DLCTL.NO_CLIENTPULL | - DLCTL.NO_JAVA | DLCTL.NO_DLACTIVEXCTLS | - DLCTL.NO_RUNACTIVEXCTLS | DLCTL.SILENT ; - } + #region IOleClientSite Members + void IOleClientSite.SaveObject() + { + } - /// - /// Handle document complete event - /// - /// sender - /// event args - private void browserControl_DocumentComplete(object sender, BrowserDocumentEventArgs e) - { - // verify ready-state complete - Debug.Assert( browserControl.Browser.ReadyState == tagREADYSTATE.READYSTATE_COMPLETE ) ; + int IOleClientSite.GetMoniker(OLEGETMONIKER dwAssign, OLEWHICHMK dwWhichMoniker, out UCOMIMoniker ppmk) + { + ppmk = null; + return HRESULT.E_NOTIMPL ; + } - // propagate event - if ( DownloadComplete != null ) - DownloadComplete( this, EventArgs.Empty ) ; - } + int IOleClientSite.GetContainer(out IOleContainer ppContainer) + { + ppContainer = null ; + return HRESULT.E_NOINTERFACE; + } - /// - /// Handle new window event (prevent all pop-up windows from displaying) - /// - /// sender - /// event args - private void browserControl_NewWindow2(object sender, DWebBrowserEvents2_NewWindow2Event e) - { - // prevent pop-ups! - e.cancel = true ; - } + void IOleClientSite.ShowObject() + { + } - /// - /// Handle progress changed event - /// - /// sender - /// event args - private void browserControl_ProgressChange(object sender, BrowserProgressChangeEventArgs e) - { - if ( ProgressUpdated != null ) - { - ProgressUpdatedEventArgs ea = new ProgressUpdatedEventArgs( - Convert.ToInt32(e.Progress), Convert.ToInt32(e.ProgressMax), String.Empty ) ; - ProgressUpdated( this, ea ) ; - } - } + void IOleClientSite.OnShowWindow(bool fShow) + { + } + int IOleClientSite.RequestNewObjectLayout() + { + return HRESULT.E_NOTIMPL ; + } - #region IOleClientSite Members + #endregion - void IOleClientSite.SaveObject() - { - } - - int IOleClientSite.GetMoniker(OLEGETMONIKER dwAssign, OLEWHICHMK dwWhichMoniker, out UCOMIMoniker ppmk) - { - ppmk = null; - return HRESULT.E_NOTIMPL ; - } - - int IOleClientSite.GetContainer(out IOleContainer ppContainer) - { - ppContainer = null ; - return HRESULT.E_NOINTERFACE; - } - - void IOleClientSite.ShowObject() - { - } - - void IOleClientSite.OnShowWindow(bool fShow) - { - } - - int IOleClientSite.RequestNewObjectLayout() - { - return HRESULT.E_NOTIMPL ; - } - - #endregion - - /// - /// Embedded web browser - /// - private ExplorerBrowserControl browserControl = null ; - } + /// + /// Embedded web browser + /// + private ExplorerBrowserControl browserControl = null ; + } } diff --git a/src/managed/OpenLiveWriter.CoreServices/HtmlScreenCaptureCore.cs b/src/managed/OpenLiveWriter.CoreServices/HtmlScreenCaptureCore.cs index 016e88a1..e99b8c18 100644 --- a/src/managed/OpenLiveWriter.CoreServices/HtmlScreenCaptureCore.cs +++ b/src/managed/OpenLiveWriter.CoreServices/HtmlScreenCaptureCore.cs @@ -141,7 +141,6 @@ namespace OpenLiveWriter.CoreServices return bitmap; } - [STAThread] private void ThreadMain(ConditionVariable signal, string[] ids) { @@ -552,7 +551,6 @@ namespace OpenLiveWriter.CoreServices _browserControl.Height = originalHeight; } - // fire event to see if the Bitmap is ready using (Bitmap bitmap = HtmlScreenCaptureCore.TakeSnapshot((IViewObject)_browserControl.Document, _browserControl.Width, _browserControl.Height)) { diff --git a/src/managed/OpenLiveWriter.CoreServices/IconHelper.cs b/src/managed/OpenLiveWriter.CoreServices/IconHelper.cs index a90ce14f..9c3f8538 100644 --- a/src/managed/OpenLiveWriter.CoreServices/IconHelper.cs +++ b/src/managed/OpenLiveWriter.CoreServices/IconHelper.cs @@ -9,108 +9,106 @@ using OpenLiveWriter.Interop.Windows; namespace OpenLiveWriter.CoreServices { - /// - /// Summary description for IconHelper. - /// - public class IconHelper - { - public static Bitmap GetBitmapForIcon(Icon icon) - { - using (IconInfo iconInfo = new IconInfo(icon)) - { - if (!iconInfo.Info.fIcon) - return null; // this is a cursor! + /// + /// Summary description for IconHelper. + /// + public class IconHelper + { + public static Bitmap GetBitmapForIcon(Icon icon) + { + using (IconInfo iconInfo = new IconInfo(icon)) + { + if (!iconInfo.Info.fIcon) + return null; // this is a cursor! - if (iconInfo.BitmapStruct.bmBitsPixel!=32) - return Bitmap.FromHicon(icon.Handle); // no alpha blending, so use regular .Net + if (iconInfo.BitmapStruct.bmBitsPixel!=32) + return Bitmap.FromHicon(icon.Handle); // no alpha blending, so use regular .Net - Bitmap iconBitmap = Bitmap.FromHbitmap(iconInfo.Info.hbmColor); + Bitmap iconBitmap = Bitmap.FromHbitmap(iconInfo.Info.hbmColor); - // get broken bitmap (broken - pixelformat doesn't specify alpha channel, even though the alpha data is there), - // copy to a new bitmap with a healthy (includes the alpha channel) pixelformat - Bitmap transparentBitmap; - using (LockedBitMap lockedBitmap = new LockedBitMap(iconBitmap)) - { - transparentBitmap = new Bitmap(lockedBitmap.Data.Width, lockedBitmap.Data.Height, lockedBitmap.Data.Stride, PixelFormat.Format32bppArgb, lockedBitmap.Data.Scan0); - } - return transparentBitmap; - } - } + // get broken bitmap (broken - pixelformat doesn't specify alpha channel, even though the alpha data is there), + // copy to a new bitmap with a healthy (includes the alpha channel) pixelformat + Bitmap transparentBitmap; + using (LockedBitMap lockedBitmap = new LockedBitMap(iconBitmap)) + { + transparentBitmap = new Bitmap(lockedBitmap.Data.Width, lockedBitmap.Data.Height, lockedBitmap.Data.Stride, PixelFormat.Format32bppArgb, lockedBitmap.Data.Scan0); + } + return transparentBitmap; + } + } - private class LockedBitMap : IDisposable - { - public LockedBitMap(Bitmap bitmapToLock) - { - _bitmapToLock = bitmapToLock; - _bitmapData = bitmapToLock.LockBits(new Rectangle(0, 0, bitmapToLock.Width, bitmapToLock.Height), - ImageLockMode.ReadOnly, bitmapToLock.PixelFormat); + private class LockedBitMap : IDisposable + { + public LockedBitMap(Bitmap bitmapToLock) + { + _bitmapToLock = bitmapToLock; + _bitmapData = bitmapToLock.LockBits(new Rectangle(0, 0, bitmapToLock.Width, bitmapToLock.Height), + ImageLockMode.ReadOnly, bitmapToLock.PixelFormat); - } - private BitmapData _bitmapData; - private Bitmap _bitmapToLock; + } + private BitmapData _bitmapData; + private Bitmap _bitmapToLock; - public BitmapData Data - { - get - { - return _bitmapData; - } - } + public BitmapData Data + { + get + { + return _bitmapData; + } + } - public void Dispose() - { - _bitmapToLock.UnlockBits(_bitmapData); - } + public void Dispose() + { + _bitmapToLock.UnlockBits(_bitmapData); + } + } - } + private class IconInfo : IDisposable + { + public IconInfo(Icon icon) + { + User32.GetIconInfo(icon.Handle, out _iconInfo); - private class IconInfo : IDisposable - { - public IconInfo(Icon icon) - { - User32.GetIconInfo(icon.Handle, out _iconInfo); + int size = Marshal.SizeOf(typeof(BITMAP)); - int size = Marshal.SizeOf(typeof(BITMAP)); + IntPtr ptr = Marshal.AllocCoTaskMem(size); + try + { + Gdi32.GetObject(Info.hbmColor, size , ptr); + _bitmapStruct = (BITMAP)Marshal.PtrToStructure(ptr, typeof(BITMAP)); + } + finally + { + Marshal.FreeCoTaskMem(ptr); + } + } - IntPtr ptr = Marshal.AllocCoTaskMem(size); - try - { - Gdi32.GetObject(Info.hbmColor, size , ptr); - _bitmapStruct = (BITMAP)Marshal.PtrToStructure(ptr, typeof(BITMAP)); - } - finally - { - Marshal.FreeCoTaskMem(ptr); - } - } + public User32.ICONINFO Info + { + get + { + return _iconInfo; + } + } - public User32.ICONINFO Info - { - get - { - return _iconInfo; - } - } + public BITMAP BitmapStruct + { + get + { + return _bitmapStruct; + } + } + private BITMAP _bitmapStruct; - public BITMAP BitmapStruct - { - get - { - return _bitmapStruct; - } - } - private BITMAP _bitmapStruct; + public void Dispose() + { + Gdi32.DeleteObject(_iconInfo.hbmColor); + Gdi32.DeleteObject(_iconInfo.hbmMask); + } + private User32.ICONINFO _iconInfo; - public void Dispose() - { - Gdi32.DeleteObject(_iconInfo.hbmColor); - Gdi32.DeleteObject(_iconInfo.hbmMask); - } - - private User32.ICONINFO _iconInfo; - - } - } + } + } } diff --git a/src/managed/OpenLiveWriter.CoreServices/ImageHelper2.cs b/src/managed/OpenLiveWriter.CoreServices/ImageHelper2.cs index f6f1cb26..de4604be 100644 --- a/src/managed/OpenLiveWriter.CoreServices/ImageHelper2.cs +++ b/src/managed/OpenLiveWriter.CoreServices/ImageHelper2.cs @@ -581,16 +581,16 @@ namespace OpenLiveWriter.CoreServices } /* - ColorPalette p = bitmap.Palette; - bool seenTransparent = false; - foreach (Color c in p.Entries) - { - if (c.A == 0) - { - Trace.Assert(!seenTransparent); - seenTransparent = true; - } - } + ColorPalette p = bitmap.Palette; + bool seenTransparent = false; + foreach (Color c in p.Entries) + { + if (c.A == 0) + { + Trace.Assert(!seenTransparent); + seenTransparent = true; + } + } */ } diff --git a/src/managed/OpenLiveWriter.CoreServices/Instrumentor.cs b/src/managed/OpenLiveWriter.CoreServices/Instrumentor.cs index 48b529aa..98b444b9 100644 --- a/src/managed/OpenLiveWriter.CoreServices/Instrumentor.cs +++ b/src/managed/OpenLiveWriter.CoreServices/Instrumentor.cs @@ -10,198 +10,197 @@ using Microsoft.Win32; namespace OpenLiveWriter.CoreServices { - //usage: - //Instrumentor.IncrementCounter(Instrumentor.COUNTERNAME); - //handles creating the registry keys and opt in stuff, so you don't have to + //usage: + //Instrumentor.IncrementCounter(Instrumentor.COUNTERNAME); + //handles creating the registry keys and opt in stuff, so you don't have to - /// - /// Summary description for Intrumentor. - /// - public class Instrumentor - { - public const string WRITER_OPENED = "wr"; - public const string LINKS = "lk"; - public const string IMAGES = "im"; - public const string MAPS = "ma"; - public const string PLUG_INS_COUNT = "pc"; - public const string PLUG_INS_LIST = "pl"; - public const string SOURCE_CODE_VIEW = "sv"; - public const string NO_STYLE_EDIT = "ns"; - public const string EDIT_OLD_POST = "ep"; - public const string DEFAULT_BLOG_PROVIDER = "db"; + /// + /// Summary description for Intrumentor. + /// + public class Instrumentor + { + public const string WRITER_OPENED = "wr"; + public const string LINKS = "lk"; + public const string IMAGES = "im"; + public const string MAPS = "ma"; + public const string PLUG_INS_COUNT = "pc"; + public const string PLUG_INS_LIST = "pl"; + public const string SOURCE_CODE_VIEW = "sv"; + public const string NO_STYLE_EDIT = "ns"; + public const string EDIT_OLD_POST = "ep"; + public const string DEFAULT_BLOG_PROVIDER = "db"; - private const string ALWAYS_SEND = "n"; - private const string OPT_IN_ONLY = "o"; + private const string ALWAYS_SEND = "n"; + private const string OPT_IN_ONLY = "o"; - private readonly static string instrumentationReportKey; + private readonly static string instrumentationReportKey; - private static bool SearchLoggerWorks = false; + private static bool SearchLoggerWorks = false; - static Instrumentor() - { - try - { - using (RegistryKey slVersionKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\MSN Apps\\SL", false)) - { - if (slVersionKey != null) - { - string version = (string)slVersionKey.GetValue("Version"); - int minorVersionNum = Int32.Parse(version.Substring(version.LastIndexOf('.') + 1), CultureInfo.InvariantCulture); - int majorVersionNum = Int32.Parse(version.Substring(0,version.IndexOf('.')), CultureInfo.InvariantCulture); - if (majorVersionNum >= 3 && minorVersionNum >= 1458) - { - SearchLoggerWorks = true; - } - } - } + static Instrumentor() + { + try + { + using (RegistryKey slVersionKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\MSN Apps\\SL", false)) + { + if (slVersionKey != null) + { + string version = (string)slVersionKey.GetValue("Version"); + int minorVersionNum = Int32.Parse(version.Substring(version.LastIndexOf('.') + 1), CultureInfo.InvariantCulture); + int majorVersionNum = Int32.Parse(version.Substring(0,version.IndexOf('.')), CultureInfo.InvariantCulture); + if (majorVersionNum >= 3 && minorVersionNum >= 1458) + { + SearchLoggerWorks = true; + } + } + } - if (SearchLoggerWorks) - { - string hkcu = string.Empty; - if (Environment.OSVersion.Version.Major >= 6) - { - // Under Vista Protected Mode, this is the low-integrity root - hkcu = @"Software\AppDataLow\"; - } - instrumentationReportKey = hkcu + @"Software\Microsoft\MSN Apps\Open Live Writer\SL"; - } - else - { - instrumentationReportKey = null; - } - } - catch (Exception ex) - { - Trace.Fail("Exception while writing instrumentation values to registry: " + ex.ToString()); - } - } + if (SearchLoggerWorks) + { + string hkcu = string.Empty; + if (Environment.OSVersion.Version.Major >= 6) + { + // Under Vista Protected Mode, this is the low-integrity root + hkcu = @"Software\AppDataLow\"; + } + instrumentationReportKey = hkcu + @"Software\Microsoft\MSN Apps\Open Live Writer\SL"; + } + else + { + instrumentationReportKey = null; + } + } + catch (Exception ex) + { + Trace.Fail("Exception while writing instrumentation values to registry: " + ex.ToString()); + } + } - public static void IncrementCounter(string keyName) - { - string regKey = GetKeyName(keyName); + public static void IncrementCounter(string keyName) + { + string regKey = GetKeyName(keyName); - //check that AL key exists--if not, add it - //check that specific key exists--if not, add it - //increment specific key - try - { - if (SearchLoggerWorks) - { - using ( RegistryKey reportingKey = Registry.CurrentUser.CreateSubKey(instrumentationReportKey) ) - { - if ( reportingKey != null ) - { - int currentVal = (int)reportingKey.GetValue(regKey, 0); - currentVal++; - reportingKey.SetValue(regKey, currentVal); - } - else - { - Debug.Fail("Unable to open Onfolio instrumentation reporting registry key") ; - } - } - } - } - catch (Exception ex) - { - Trace.Fail("Exception while writing instrumentation values to registry: " + ex.ToString()); - } - } + //check that AL key exists--if not, add it + //check that specific key exists--if not, add it + //increment specific key + try + { + if (SearchLoggerWorks) + { + using ( RegistryKey reportingKey = Registry.CurrentUser.CreateSubKey(instrumentationReportKey) ) + { + if ( reportingKey != null ) + { + int currentVal = (int)reportingKey.GetValue(regKey, 0); + currentVal++; + reportingKey.SetValue(regKey, currentVal); + } + else + { + Debug.Fail("Unable to open Onfolio instrumentation reporting registry key") ; + } + } + } + } + catch (Exception ex) + { + Trace.Fail("Exception while writing instrumentation values to registry: " + ex.ToString()); + } + } - public static void SetKeyValue(string keyName, object keyValue) - { - string regKey = GetKeyName(keyName); + public static void SetKeyValue(string keyName, object keyValue) + { + string regKey = GetKeyName(keyName); - //check that AL key exists--if not, add it - //check that specific key exists--if not, add it - try - { - if (SearchLoggerWorks) - { - using ( RegistryKey reportingKey = Registry.CurrentUser.CreateSubKey(instrumentationReportKey) ) - { - if ( reportingKey != null ) - { - reportingKey.SetValue(regKey, keyValue); - } - else - { - Debug.Fail("Unable to open Onfolio instrumentation reporting registry key") ; - } - } - } - } - catch (Exception ex) - { - Trace.Fail("Exception while writing instrumentation values to registry: " + ex.ToString()); - } - } + //check that AL key exists--if not, add it + //check that specific key exists--if not, add it + try + { + if (SearchLoggerWorks) + { + using ( RegistryKey reportingKey = Registry.CurrentUser.CreateSubKey(instrumentationReportKey) ) + { + if ( reportingKey != null ) + { + reportingKey.SetValue(regKey, keyValue); + } + else + { + Debug.Fail("Unable to open Onfolio instrumentation reporting registry key") ; + } + } + } + } + catch (Exception ex) + { + Trace.Fail("Exception while writing instrumentation values to registry: " + ex.ToString()); + } + } - public static void AddItemToList(string keyName, string item) - { - string regKey = GetKeyName(keyName); + public static void AddItemToList(string keyName, string item) + { + string regKey = GetKeyName(keyName); - //check that AL key exists--if not, add it - //check that specific key exists--if not, add it - try - { - if (SearchLoggerWorks) - { - using ( RegistryKey reportingKey = Registry.CurrentUser.CreateSubKey(instrumentationReportKey) ) - { - if ( reportingKey != null ) - { - string newVal = EscapeString(item); - String currentVal = (String)reportingKey.GetValue(regKey, ""); - if (currentVal != "") - { - //add this item if it isn't in the list - if (currentVal.IndexOf(newVal) < 0) - { - currentVal += "," + newVal; - } - } - else - { - //new list, set to item - currentVal = newVal; - } - reportingKey.SetValue(regKey, currentVal); - } - else - { - Debug.Fail("Unable to open Writer instrumentation reporting registry key") ; - } - } - } - } - catch (Exception ex) - { - Trace.Fail("Exception while writing instrumentation values to registry: " + ex.ToString()); - } - } + //check that AL key exists--if not, add it + //check that specific key exists--if not, add it + try + { + if (SearchLoggerWorks) + { + using ( RegistryKey reportingKey = Registry.CurrentUser.CreateSubKey(instrumentationReportKey) ) + { + if ( reportingKey != null ) + { + string newVal = EscapeString(item); + String currentVal = (String)reportingKey.GetValue(regKey, ""); + if (currentVal != "") + { + //add this item if it isn't in the list + if (currentVal.IndexOf(newVal) < 0) + { + currentVal += "," + newVal; + } + } + else + { + //new list, set to item + currentVal = newVal; + } + reportingKey.SetValue(regKey, currentVal); + } + else + { + Debug.Fail("Unable to open Writer instrumentation reporting registry key") ; + } + } + } + } + catch (Exception ex) + { + Trace.Fail("Exception while writing instrumentation values to registry: " + ex.ToString()); + } + } - private static string GetKeyName(string keyName) - { - string regKey = keyName; - //the final letter of the key name determines whether it is opt-in only or not - //right now everything is opt in only - regKey += OPT_IN_ONLY; - return regKey; - } + private static string GetKeyName(string keyName) + { + string regKey = keyName; + //the final letter of the key name determines whether it is opt-in only or not + //right now everything is opt in only + regKey += OPT_IN_ONLY; + return regKey; + } - private static string EscapeString(string val) - { - if (val == null) - return ""; + private static string EscapeString(string val) + { + if (val == null) + return ""; - // optimize for common case - if (val.IndexOf('\t') == -1 && val.IndexOf('\n') == -1 && val.IndexOf('\"') == -1) - return "\"" + val + "\""; + // optimize for common case + if (val.IndexOf('\t') == -1 && val.IndexOf('\n') == -1 && val.IndexOf('\"') == -1) + return "\"" + val + "\""; - return "\"" + val.Replace("\"", "\"\"") + "\""; - } - } + return "\"" + val.Replace("\"", "\"\"") + "\""; + } + } } - diff --git a/src/managed/OpenLiveWriter.CoreServices/KeyboardHook.cs b/src/managed/OpenLiveWriter.CoreServices/KeyboardHook.cs index a0400c48..d100587b 100644 --- a/src/managed/OpenLiveWriter.CoreServices/KeyboardHook.cs +++ b/src/managed/OpenLiveWriter.CoreServices/KeyboardHook.cs @@ -63,7 +63,6 @@ namespace OpenLiveWriter.CoreServices /// public bool IsInstalled { get { return m_hHook != IntPtr.Zero; } } - /// /// Remove the keyboard hook /// diff --git a/src/managed/OpenLiveWriter.CoreServices/Layout/LayoutHelper.cs b/src/managed/OpenLiveWriter.CoreServices/Layout/LayoutHelper.cs index ae19759c..2d19bd1b 100644 --- a/src/managed/OpenLiveWriter.CoreServices/Layout/LayoutHelper.cs +++ b/src/managed/OpenLiveWriter.CoreServices/Layout/LayoutHelper.cs @@ -50,7 +50,7 @@ namespace OpenLiveWriter.CoreServices.Layout /// /// Naturalizes height, then distributes vertically ACCORDING TO THE ORDER YOU PASSED THEM IN /// - public static void NaturalizeHeightAndDistribute(int pixelsBetween, params object[] controls) + public static void NaturalizeHeightAndDistribute(int pixelsBetween, params object[] controls) { NaturalizeHeight(controls); DistributeVertically(pixelsBetween, false, controls); diff --git a/src/managed/OpenLiveWriter.CoreServices/LinkedList.cs b/src/managed/OpenLiveWriter.CoreServices/LinkedList.cs index 8d255441..058a8545 100644 --- a/src/managed/OpenLiveWriter.CoreServices/LinkedList.cs +++ b/src/managed/OpenLiveWriter.CoreServices/LinkedList.cs @@ -385,13 +385,13 @@ namespace OpenLiveWriter.CoreServices } #if FALSE - public string String - { - get - { - return this.ToString(); - } - } + public string String + { + get + { + return this.ToString(); + } + } #endif } } diff --git a/src/managed/OpenLiveWriter.CoreServices/Mime/MimeHelper.cs b/src/managed/OpenLiveWriter.CoreServices/Mime/MimeHelper.cs index f5cea8af..254d9aeb 100644 --- a/src/managed/OpenLiveWriter.CoreServices/Mime/MimeHelper.cs +++ b/src/managed/OpenLiveWriter.CoreServices/Mime/MimeHelper.cs @@ -33,7 +33,6 @@ namespace OpenLiveWriter.CoreServices return GetContentType(fileExtension, null); } - /// /// This sets the content type value in the registry for a given file /// extension @@ -60,7 +59,6 @@ namespace OpenLiveWriter.CoreServices } - /// /// Application/octet-stream content type, a good default for /// unrecognized content types. @@ -508,41 +506,41 @@ namespace OpenLiveWriter.CoreServices /// private static int[,,] QPStateTable = { - // SCANNING - { + // SCANNING + { {OUTPUT,PENDING}, // Legal Ascii - {OUTPUT_ESCAPED,PENDING}, // Illegal Ascii - {OUTPUT,PENDING}, // WriteSpace - {NONE,LOOK_FOR_LF}, // CarriageReturn - {OUTPUT_CRLF, SCANNING} // Linefeed - }, + {OUTPUT_ESCAPED,PENDING}, // Illegal Ascii + {OUTPUT,PENDING}, // WriteSpace + {NONE,LOOK_FOR_LF}, // CarriageReturn + {OUTPUT_CRLF, SCANNING} // Linefeed + }, - // LOOK_FOR_LF - { + // LOOK_FOR_LF + { {CRLF_AND_PUTBACK, SCANNING}, // Legal Ascii - {CRLF_AND_PUTBACK, SCANNING}, // Illegal Ascii - {CRLF_AND_PUTBACK, SCANNING}, // WhiteSpace - {CRLF_AND_PUTBACK, SCANNING}, // CarriageReturn - {OUTPUT_CRLF, SCANNING} // Linefeed - }, + {CRLF_AND_PUTBACK, SCANNING}, // Illegal Ascii + {CRLF_AND_PUTBACK, SCANNING}, // WhiteSpace + {CRLF_AND_PUTBACK, SCANNING}, // CarriageReturn + {OUTPUT_CRLF, SCANNING} // Linefeed + }, - // REDZONE - { + // REDZONE + { {OUTPUT, END_OF_LINE}, // Legal Ascii - {OUTPUT_ESCAPED, END_OF_LINE}, // Illegal Ascii - {OUTPUT_ESCAPED, END_OF_LINE}, // WhiteSpace - {NONE, LOOK_FOR_LF}, // CarriageReturn - {OUTPUT_CRLF, SCANNING} // Linefeed - }, + {OUTPUT_ESCAPED, END_OF_LINE}, // Illegal Ascii + {OUTPUT_ESCAPED, END_OF_LINE}, // WhiteSpace + {NONE, LOOK_FOR_LF}, // CarriageReturn + {OUTPUT_CRLF, SCANNING} // Linefeed + }, - // END_OF_LINE - { + // END_OF_LINE + { {SOFT_CRLF_AND_PUTBACK, SCANNING}, // Legal Ascii - {SOFT_CRLF_AND_PUTBACK, SCANNING}, // Illegal Ascii - {SOFT_CRLF_AND_PUTBACK, SCANNING}, // WhiteSpace - {NONE, LOOK_FOR_LF}, // CarriageReturn - {OUTPUT_CRLF, SCANNING} // Linefeed - } + {SOFT_CRLF_AND_PUTBACK, SCANNING}, // Illegal Ascii + {SOFT_CRLF_AND_PUTBACK, SCANNING}, // WhiteSpace + {NONE, LOOK_FOR_LF}, // CarriageReturn + {OUTPUT_CRLF, SCANNING} // Linefeed + } }; #endregion diff --git a/src/managed/OpenLiveWriter.CoreServices/PathHelper.cs b/src/managed/OpenLiveWriter.CoreServices/PathHelper.cs index ba2f3a2e..fbe2dd25 100644 --- a/src/managed/OpenLiveWriter.CoreServices/PathHelper.cs +++ b/src/managed/OpenLiveWriter.CoreServices/PathHelper.cs @@ -27,33 +27,33 @@ namespace OpenLiveWriter.CoreServices } #if FALSE - // not localized - public static string GetPrettyPath(string path, bool hideExtensionsForKnowTypes) - { - if (path == null) - return null; + // not localized + public static string GetPrettyPath(string path, bool hideExtensionsForKnowTypes) + { + if (path == null) + return null; - // obtain special paths. - string myDocumentsPath = (Environment.GetFolderPath(Environment.SpecialFolder.Personal)+Path.DirectorySeparatorChar).ToLower() ; - string desktopPath = (Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory)+Path.DirectorySeparatorChar).ToLower() ; + // obtain special paths. + string myDocumentsPath = (Environment.GetFolderPath(Environment.SpecialFolder.Personal)+Path.DirectorySeparatorChar).ToLower() ; + string desktopPath = (Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory)+Path.DirectorySeparatorChar).ToLower() ; - // default to pretty path being the same as base path - string prettyPath = path ; + // default to pretty path being the same as base path + string prettyPath = path ; - if ( prettyPath.ToLower().StartsWith(myDocumentsPath) ) - prettyPath = "My Documents\\" + prettyPath.Substring( myDocumentsPath.Length ) ; + if ( prettyPath.ToLower().StartsWith(myDocumentsPath) ) + prettyPath = "My Documents\\" + prettyPath.Substring( myDocumentsPath.Length ) ; - // also check for the desktop - else if ( prettyPath.ToLower().StartsWith(desktopPath) ) - prettyPath = "Desktop\\" + prettyPath.Substring( desktopPath.Length ) ; + // also check for the desktop + else if ( prettyPath.ToLower().StartsWith(desktopPath) ) + prettyPath = "Desktop\\" + prettyPath.Substring( desktopPath.Length ) ; - // if we should hide the extension, do so. - if (hideExtensionsForKnowTypes) - prettyPath = Path.Combine(Path.GetDirectoryName(prettyPath), Path.GetFileNameWithoutExtension(prettyPath)); + // if we should hide the extension, do so. + if (hideExtensionsForKnowTypes) + prettyPath = Path.Combine(Path.GetDirectoryName(prettyPath), Path.GetFileNameWithoutExtension(prettyPath)); - // return the pretty path - return prettyPath ; - } + // return the pretty path + return prettyPath ; + } #endif public static bool PathsEqual(string file1, string file2) diff --git a/src/managed/OpenLiveWriter.CoreServices/Progress/MultipartAsyncOperation.cs b/src/managed/OpenLiveWriter.CoreServices/Progress/MultipartAsyncOperation.cs index ce4d157d..12695626 100644 --- a/src/managed/OpenLiveWriter.CoreServices/Progress/MultipartAsyncOperation.cs +++ b/src/managed/OpenLiveWriter.CoreServices/Progress/MultipartAsyncOperation.cs @@ -62,7 +62,6 @@ namespace OpenLiveWriter.CoreServices.Progress AddProgressOperation(operation, null, completed, tickSize); } - /// /// Adds a new ProgressOperation to the list of work to perform and assigns the operation /// the number of ticks that it should take up in the overall operation. diff --git a/src/managed/OpenLiveWriter.CoreServices/QuickTimer.cs b/src/managed/OpenLiveWriter.CoreServices/QuickTimer.cs index 165744a7..61f96543 100644 --- a/src/managed/OpenLiveWriter.CoreServices/QuickTimer.cs +++ b/src/managed/OpenLiveWriter.CoreServices/QuickTimer.cs @@ -40,11 +40,11 @@ namespace OpenLiveWriter.CoreServices double time = timer.ElapsedTime(); Debug.WriteLine("QuickTimer: [" + label + "] " + time + "ms"); #else - // This is only here to prevent the compiler from warning that label isn't in use - // The label is only present in release because if we completely empty this class - // in release, a placeholder is generated by asmmeta, and that placeholder causes - // asmmeta to vary between release and debug - Debug.WriteLine("QuickTimer: [" + label + "] - no timing information"); + // This is only here to prevent the compiler from warning that label isn't in use + // The label is only present in release because if we completely empty this class + // in release, a placeholder is generated by asmmeta, and that placeholder causes + // asmmeta to vary between release and debug + Debug.WriteLine("QuickTimer: [" + label + "] - no timing information"); #endif } diff --git a/src/managed/OpenLiveWriter.CoreServices/ResourceFileDownloader.cs b/src/managed/OpenLiveWriter.CoreServices/ResourceFileDownloader.cs index 8ed770b2..cc58489d 100644 --- a/src/managed/OpenLiveWriter.CoreServices/ResourceFileDownloader.cs +++ b/src/managed/OpenLiveWriter.CoreServices/ResourceFileDownloader.cs @@ -92,7 +92,6 @@ namespace OpenLiveWriter.CoreServices } } - /// /// Initialize the downloader with the appropriate paths and options /// @@ -119,7 +118,6 @@ namespace OpenLiveWriter.CoreServices return GetResource(Assembly.GetCallingAssembly(), name, resourceUrl, contentType, requiredFreshnessDays, timeoutMs); } - /// /// Get and process a resource (see comment on GetResource for more info on resources) /// This method attempts to load the resource normally (i.e. from the network). If @@ -281,7 +279,6 @@ namespace OpenLiveWriter.CoreServices } } - /// /// Get the specified resource from the local cache /// @@ -302,7 +299,6 @@ namespace OpenLiveWriter.CoreServices } - private void SafeDeleteLocalCacheFile(Assembly assembly, string resourceName) { try diff --git a/src/managed/OpenLiveWriter.CoreServices/Settings/ISettingsPersister.cs b/src/managed/OpenLiveWriter.CoreServices/Settings/ISettingsPersister.cs index 721fc439..86877bd3 100644 --- a/src/managed/OpenLiveWriter.CoreServices/Settings/ISettingsPersister.cs +++ b/src/managed/OpenLiveWriter.CoreServices/Settings/ISettingsPersister.cs @@ -71,8 +71,7 @@ namespace OpenLiveWriter.CoreServices.Settings /// /// An IDisposable that should be disposed when /// the batch operation completes, OR NULL. - IDisposable BatchUpdate(); - + IDisposable BatchUpdate(); /// /// Determine whether the specified sub-settings exists diff --git a/src/managed/OpenLiveWriter.CoreServices/Settings/MemorySettingsPersister.cs b/src/managed/OpenLiveWriter.CoreServices/Settings/MemorySettingsPersister.cs index 87a6b9ba..40a1d001 100644 --- a/src/managed/OpenLiveWriter.CoreServices/Settings/MemorySettingsPersister.cs +++ b/src/managed/OpenLiveWriter.CoreServices/Settings/MemorySettingsPersister.cs @@ -101,7 +101,6 @@ namespace OpenLiveWriter.CoreServices.Settings { } - private string[] CollectionToSortedStringArray(ICollection foo) { string[] names = new string[data.Count]; diff --git a/src/managed/OpenLiveWriter.CoreServices/Settings/RegistryCodec.cs b/src/managed/OpenLiveWriter.CoreServices/Settings/RegistryCodec.cs index 8f255a44..337aacc4 100644 --- a/src/managed/OpenLiveWriter.CoreServices/Settings/RegistryCodec.cs +++ b/src/managed/OpenLiveWriter.CoreServices/Settings/RegistryCodec.cs @@ -35,14 +35,14 @@ namespace OpenLiveWriter.CoreServices.Settings /// Any Codec that is not part of this list will never get called. /// private Codec[] codecs = { - // common types up top - new StringCodec(), + // common types up top + new StringCodec(), new BooleanCodec(), new Int32Codec(), new DoubleCodec(), new Int64Codec(), - // now all other primitive types - new SByteCodec(), + // now all other primitive types + new SByteCodec(), new ByteCodec(), new CharCodec(), new Int16Codec(), @@ -51,15 +51,15 @@ namespace OpenLiveWriter.CoreServices.Settings new UInt64Codec(), new FloatCodec(), new DecimalCodec(), - // date-time - new DateTimeCodec(), + // date-time + new DateTimeCodec(), new RectangleCodec(), new PointCodec(), new SizeCodec(), new SizeFCodec(), new MultiStringCodec(), - // catch-all case - new SerializableCodec() + // catch-all case + new SerializableCodec() }; /// @@ -68,7 +68,6 @@ namespace OpenLiveWriter.CoreServices.Settings /// private Hashtable codecCache = new Hashtable(); - /// /// Take a native value and return a registry-ready representation. /// diff --git a/src/managed/OpenLiveWriter.CoreServices/Settings/RegistrySettingsPersister.cs b/src/managed/OpenLiveWriter.CoreServices/Settings/RegistrySettingsPersister.cs index 39d7a4b5..6cf7c92a 100644 --- a/src/managed/OpenLiveWriter.CoreServices/Settings/RegistrySettingsPersister.cs +++ b/src/managed/OpenLiveWriter.CoreServices/Settings/RegistrySettingsPersister.cs @@ -87,7 +87,6 @@ namespace OpenLiveWriter.CoreServices.Settings private bool haveLoggedFailedDefault = false; private bool haveLoggedFailedGetKey = false; - /// /// Low-level get (returns null if the value doesn't exist). /// diff --git a/src/managed/OpenLiveWriter.CoreServices/Settings/SettingsPersisterHelper.cs b/src/managed/OpenLiveWriter.CoreServices/Settings/SettingsPersisterHelper.cs index 23bf094b..6a3ee428 100644 --- a/src/managed/OpenLiveWriter.CoreServices/Settings/SettingsPersisterHelper.cs +++ b/src/managed/OpenLiveWriter.CoreServices/Settings/SettingsPersisterHelper.cs @@ -80,7 +80,6 @@ namespace OpenLiveWriter.CoreServices.Settings } } - /// /// Get the names of available settings. /// @@ -627,7 +626,6 @@ namespace OpenLiveWriter.CoreServices.Settings settingsPersister.UnsetSubSettingsTree(name); } - /// /// Returns a SettingsPersisterHelper for the first RegistryKeySpec that exists /// in the registry, or null if the registry doesn't contain any of them. diff --git a/src/managed/OpenLiveWriter.CoreServices/ShellHelper.cs b/src/managed/OpenLiveWriter.CoreServices/ShellHelper.cs index a32fc6d2..9bd8d516 100644 --- a/src/managed/OpenLiveWriter.CoreServices/ShellHelper.cs +++ b/src/managed/OpenLiveWriter.CoreServices/ShellHelper.cs @@ -71,7 +71,6 @@ namespace OpenLiveWriter.CoreServices return propStore; } - /// /// For a file extension (with leading period) and a verb (or null for default /// verb), returns the (full?) path to the executable file that is assigned to diff --git a/src/managed/OpenLiveWriter.CoreServices/SiteStorage/FileBasedSiteStorage.cs b/src/managed/OpenLiveWriter.CoreServices/SiteStorage/FileBasedSiteStorage.cs index 439a6915..9e612f67 100644 --- a/src/managed/OpenLiveWriter.CoreServices/SiteStorage/FileBasedSiteStorage.cs +++ b/src/managed/OpenLiveWriter.CoreServices/SiteStorage/FileBasedSiteStorage.cs @@ -60,13 +60,11 @@ namespace OpenLiveWriter.CoreServices fileFilter = filter; } - /// /// File system path that contains the site. /// public string BasePath { get { return m_basePath; } } - /// /// Method called by base class SupportingFiles implementation /// @@ -93,7 +91,6 @@ namespace OpenLiveWriter.CoreServices } } - /// /// Test to see whether the specified file already exists /// @@ -106,7 +103,6 @@ namespace OpenLiveWriter.CoreServices return File.Exists(fullPath); } - /// /// Retrieve a Stream for the given path (Read or Write access can be specified). /// Stream.Close() should be called when you are finished using the Stream. diff --git a/src/managed/OpenLiveWriter.CoreServices/SiteStorage/ISiteStorage.cs b/src/managed/OpenLiveWriter.CoreServices/SiteStorage/ISiteStorage.cs index f03e47df..9274a66d 100644 --- a/src/managed/OpenLiveWriter.CoreServices/SiteStorage/ISiteStorage.cs +++ b/src/managed/OpenLiveWriter.CoreServices/SiteStorage/ISiteStorage.cs @@ -61,5 +61,4 @@ namespace OpenLiveWriter.CoreServices Write }; - } diff --git a/src/managed/OpenLiveWriter.CoreServices/SiteStorage/SiteStorageBase.cs b/src/managed/OpenLiveWriter.CoreServices/SiteStorage/SiteStorageBase.cs index 446689ec..ed6be0fb 100644 --- a/src/managed/OpenLiveWriter.CoreServices/SiteStorage/SiteStorageBase.cs +++ b/src/managed/OpenLiveWriter.CoreServices/SiteStorage/SiteStorageBase.cs @@ -145,7 +145,6 @@ namespace OpenLiveWriter.CoreServices static char[] mimeInvalid = new char[] { }; // both ( and ) were protected, but I couldn't replicate a problem w/parens in Content headers. - // storage for root file name private string m_rootFile = null; diff --git a/src/managed/OpenLiveWriter.CoreServices/SiteStorage/TempFileSiteStorage.cs b/src/managed/OpenLiveWriter.CoreServices/SiteStorage/TempFileSiteStorage.cs index 71d99844..852aa971 100644 --- a/src/managed/OpenLiveWriter.CoreServices/SiteStorage/TempFileSiteStorage.cs +++ b/src/managed/OpenLiveWriter.CoreServices/SiteStorage/TempFileSiteStorage.cs @@ -75,7 +75,6 @@ namespace OpenLiveWriter.CoreServices { } - /// /// Recursively delete all files contained in the temporary directory /// @@ -107,7 +106,6 @@ namespace OpenLiveWriter.CoreServices } } - // Helper function to generate a temporary site path name private static string GetTemporarySitePath(string prefix, string tempDirectory) { diff --git a/src/managed/OpenLiveWriter.CoreServices/StringTokenizer.cs b/src/managed/OpenLiveWriter.CoreServices/StringTokenizer.cs index 15488096..b8620150 100644 --- a/src/managed/OpenLiveWriter.CoreServices/StringTokenizer.cs +++ b/src/managed/OpenLiveWriter.CoreServices/StringTokenizer.cs @@ -8,125 +8,125 @@ using System.Text; namespace Project31.CoreServices { - /// - /// Breaks a string into tokens according to one or more delimiters. - /// - public class StringTokenizer : IEnumerable, IEnumerator - { - private readonly string stringValue; - private readonly bool returnDelimiters; - private readonly string[] delimiters; + /// + /// Breaks a string into tokens according to one or more delimiters. + /// + public class StringTokenizer : IEnumerable, IEnumerator + { + private readonly string stringValue; + private readonly bool returnDelimiters; + private readonly string[] delimiters; - private int offset; - private int len; + private int offset; + private int len; - public StringTokenizer(string stringValue, bool returnDelimiters, params string[] delimiters) - { - foreach (string delimiter in delimiters) - { - if (delimiter == null || delimiter == string.Empty) - { - Trace.Fail("Null or empty string cannot be used as delimiter"); - throw new ArgumentOutOfRangeException("Null or empty string cannot be used as delimiter"); - } - } + public StringTokenizer(string stringValue, bool returnDelimiters, params string[] delimiters) + { + foreach (string delimiter in delimiters) + { + if (delimiter == null || delimiter == string.Empty) + { + Trace.Fail("Null or empty string cannot be used as delimiter"); + throw new ArgumentOutOfRangeException("Null or empty string cannot be used as delimiter"); + } + } - this.stringValue = stringValue; - this.returnDelimiters = returnDelimiters; - this.delimiters = delimiters; + this.stringValue = stringValue; + this.returnDelimiters = returnDelimiters; + this.delimiters = delimiters; - this.offset = 0; - this.len = 0; - } + this.offset = 0; + this.len = 0; + } - /// - /// Initializes a tokenizer; delimiters will not be returned. - /// - /// The string to be tokenized. - /// The strings that delimit tokens. - public StringTokenizer(string stringValue, params string[] delimiters) : this(stringValue, false, delimiters) - { - } + /// + /// Initializes a tokenizer; delimiters will not be returned. + /// + /// The string to be tokenized. + /// The strings that delimit tokens. + public StringTokenizer(string stringValue, params string[] delimiters) : this(stringValue, false, delimiters) + { + } - public bool MoveNext() - { - retry: + public bool MoveNext() + { + retry: - offset += len; - len = 0; - if (offset >= stringValue.Length) - return false; + offset += len; + len = 0; + if (offset >= stringValue.Length) + return false; - int delimStart; - int delimLen; - FindFirstDelimiter(offset, out delimStart, out delimLen); + int delimStart; + int delimLen; + FindFirstDelimiter(offset, out delimStart, out delimLen); - if (delimStart == offset) - { - len = delimLen; - if (returnDelimiters) - return true; - else - goto retry; // same as calling return MoveNext(), but without using up the stack - } - else - { - len = delimStart - offset; - return true; - } - } + if (delimStart == offset) + { + len = delimLen; + if (returnDelimiters) + return true; + else + goto retry; // same as calling return MoveNext(), but without using up the stack + } + else + { + len = delimStart - offset; + return true; + } + } - /// - /// Finds the first delimiter from startIndex on. - /// If none found, offset will be greater than stringValue.Length - /// and len will be -1. - /// - private void FindFirstDelimiter(int startIndex, out int offset, out int len) - { - for (offset = startIndex; offset < stringValue.Length; offset++) - { - len = DetectDelimiter(offset); - if (len != -1) - return; - } - len = -1; - } + /// + /// Finds the first delimiter from startIndex on. + /// If none found, offset will be greater than stringValue.Length + /// and len will be -1. + /// + private void FindFirstDelimiter(int startIndex, out int offset, out int len) + { + for (offset = startIndex; offset < stringValue.Length; offset++) + { + len = DetectDelimiter(offset); + if (len != -1) + return; + } + len = -1; + } - private int DetectDelimiter(int offset) - { - int lenLeft = stringValue.Length - offset; - foreach (string delimiter in delimiters) - { - // not enough space for this delimiter - if (lenLeft < delimiter.Length) - continue; + private int DetectDelimiter(int offset) + { + int lenLeft = stringValue.Length - offset; + foreach (string delimiter in delimiters) + { + // not enough space for this delimiter + if (lenLeft < delimiter.Length) + continue; - if (stringValue.Substring(offset, delimiter.Length) == delimiter) - return delimiter.Length; - } - return -1; - } + if (stringValue.Substring(offset, delimiter.Length) == delimiter) + return delimiter.Length; + } + return -1; + } - public void Reset() - { - this.offset = 0; - this.len = 0; - } + public void Reset() + { + this.offset = 0; + this.len = 0; + } - public IEnumerator GetEnumerator() - { - return this; - } + public IEnumerator GetEnumerator() + { + return this; + } - public object Current - { - get - { - if (len == 0) - throw new InvalidOperationException(); + public object Current + { + get + { + if (len == 0) + throw new InvalidOperationException(); - return stringValue.Substring(offset, len); - } - } - } + return stringValue.Substring(offset, len); + } + } + } } diff --git a/src/managed/OpenLiveWriter.CoreServices/TransientDirectory.cs b/src/managed/OpenLiveWriter.CoreServices/TransientDirectory.cs index 76e8918d..47c55fa0 100644 --- a/src/managed/OpenLiveWriter.CoreServices/TransientDirectory.cs +++ b/src/managed/OpenLiveWriter.CoreServices/TransientDirectory.cs @@ -54,44 +54,44 @@ namespace OpenLiveWriter.CoreServices } /* - public int MaxChildPath(StringBuilder buffer) - { - buffer.Append(Path.DirectorySeparatorChar); - buffer.Append(name); + public int MaxChildPath(StringBuilder buffer) + { + buffer.Append(Path.DirectorySeparatorChar); + buffer.Append(name); - int startPos = buffer.Length; - int currLen = 0; - int depth = 0; + int startPos = buffer.Length; + int currLen = 0; + int depth = 0; - StringBuilder maxChildPath = new StringBuilder(); - StringBuilder currChildPath = new StringBuilder(); - foreach (TransientFileSystemItem child in children) - { - int tmpDepth = child.MaxChildPath(currChildPath); - if (currChildPath.Length > currLen && tmpDepth > depth) - { - if (currLen != 0) - { - buffer.Remove(startPos, currLen); - } - buffer.Append(currChildPath.ToString()); - currLen = currChildPath.Length; - depth = tmpDepth; - } - else - { - currChildPath.Remove(0, currChildPath.Length); - } - Debug.Assert(currChildPath.Length == 0, "Programming error: currChildPath != 0"); - } - if (maxChildPath.Length > 0) - { - buffer.Append(maxChildPath.ToString()); - } + StringBuilder maxChildPath = new StringBuilder(); + StringBuilder currChildPath = new StringBuilder(); + foreach (TransientFileSystemItem child in children) + { + int tmpDepth = child.MaxChildPath(currChildPath); + if (currChildPath.Length > currLen && tmpDepth > depth) + { + if (currLen != 0) + { + buffer.Remove(startPos, currLen); + } + buffer.Append(currChildPath.ToString()); + currLen = currChildPath.Length; + depth = tmpDepth; + } + else + { + currChildPath.Remove(0, currChildPath.Length); + } + Debug.Assert(currChildPath.Length == 0, "Programming error: currChildPath != 0"); + } + if (maxChildPath.Length > 0) + { + buffer.Append(maxChildPath.ToString()); + } - return ++depth; - } - */ + return ++depth; + } + */ public FileSystemInfo Create(DirectoryInfo destination) { diff --git a/src/managed/OpenLiveWriter.CoreServices/TreeSet.cs b/src/managed/OpenLiveWriter.CoreServices/TreeSet.cs index 0c1ec7aa..4a8daa5d 100644 --- a/src/managed/OpenLiveWriter.CoreServices/TreeSet.cs +++ b/src/managed/OpenLiveWriter.CoreServices/TreeSet.cs @@ -446,69 +446,67 @@ namespace OpenLiveWriter.CoreServices #endregion - - #if TEST - /// - /// Brute-force correctness test of insert/delete operations. - /// - public static void Test() - { - TreeSet ts = new TreeSet(); - int count = 0; + /// + /// Brute-force correctness test of insert/delete operations. + /// + public static void Test() + { + TreeSet ts = new TreeSet(); + int count = 0; - for (int loops = 0; ; loops++) - { - count += ts.AddAll(RandomArrayList(100000 - ts.Count)); + for (int loops = 0; ; loops++) + { + count += ts.AddAll(RandomArrayList(100000 - ts.Count)); - InOrder(ts); + InOrder(ts); - ArrayList data = ts.ToArrayList(); + ArrayList data = ts.ToArrayList(); - RandomizeOrder(ref data); + RandomizeOrder(ref data); - for (int i = 0; i < 50000 && i < data.Count; i++) - { - if (ts.Remove(data[i])) - count--; - } + for (int i = 0; i < 50000 && i < data.Count; i++) + { + if (ts.Remove(data[i])) + count--; + } - Debug.Assert(count == ts.Count); - InOrder(ts); + Debug.Assert(count == ts.Count); + InOrder(ts); - if ((loops % 10) == 0) - Console.WriteLine("So far so good: " + loops + " " + count); - } - } + if ((loops % 10) == 0) + Console.WriteLine("So far so good: " + loops + " " + count); + } + } - public static void InOrder(TreeSet tree) - { - object last = null; - foreach (object o in tree) - { - if (last != null) - Debug.Assert(((IComparable)last).CompareTo(o) < 0, "Out of order"); - } - } + public static void InOrder(TreeSet tree) + { + object last = null; + foreach (object o in tree) + { + if (last != null) + Debug.Assert(((IComparable)last).CompareTo(o) < 0, "Out of order"); + } + } - public static void RandomizeOrder(ref ArrayList list) - { - Hashtable table = new Hashtable(list.Count); - foreach (object o in list) - table[o] = string.Empty; - list = new ArrayList(table.Keys); - } + public static void RandomizeOrder(ref ArrayList list) + { + Hashtable table = new Hashtable(list.Count); + foreach (object o in list) + table[o] = string.Empty; + list = new ArrayList(table.Keys); + } - public static ArrayList RandomArrayList(int size) - { - Random r = new Random(); + public static ArrayList RandomArrayList(int size) + { + Random r = new Random(); - ArrayList al = new ArrayList(size); - for (int i = 0; i < size; i++) - al.Add(r.Next()); + ArrayList al = new ArrayList(size); + for (int i = 0; i < size; i++) + al.Add(r.Next()); - return al; - } + return al; + } #endif } } diff --git a/src/managed/OpenLiveWriter.CoreServices/Trie.cs b/src/managed/OpenLiveWriter.CoreServices/Trie.cs index 5da13317..72113561 100644 --- a/src/managed/OpenLiveWriter.CoreServices/Trie.cs +++ b/src/managed/OpenLiveWriter.CoreServices/Trie.cs @@ -119,5 +119,4 @@ namespace OpenLiveWriter.CoreServices private T _value; } - } diff --git a/src/managed/OpenLiveWriter.CoreServices/UI/GdiPaint.cs b/src/managed/OpenLiveWriter.CoreServices/UI/GdiPaint.cs index 3816f4a9..2c4bf058 100644 --- a/src/managed/OpenLiveWriter.CoreServices/UI/GdiPaint.cs +++ b/src/managed/OpenLiveWriter.CoreServices/UI/GdiPaint.cs @@ -7,37 +7,37 @@ using OpenLiveWriter.Interop.Windows; namespace OpenLiveWriter.CoreServices.UI { - public class GdiPaint - { - public static void BitBlt(Graphics g, IntPtr hObject, Rectangle srcRect, Point destPoint) - { - IntPtr pTarget = g.GetHdc(); - try - { - IntPtr pSource = Gdi32.CreateCompatibleDC(pTarget); - try - { - IntPtr pOrig = Gdi32.SelectObject(pSource, hObject); - try - { - Gdi32.BitBlt(pTarget, destPoint.X, destPoint.Y, srcRect.Width, srcRect.Height, pSource, srcRect.X, srcRect.Y, - Gdi32.TernaryRasterOperations.SRCCOPY); - } - finally - { - Gdi32.SelectObject(pSource, pOrig); - } - } - finally - { - Gdi32.DeleteDC(pSource); - } - } - finally - { - g.ReleaseHdc(pTarget); - } + public class GdiPaint + { + public static void BitBlt(Graphics g, IntPtr hObject, Rectangle srcRect, Point destPoint) + { + IntPtr pTarget = g.GetHdc(); + try + { + IntPtr pSource = Gdi32.CreateCompatibleDC(pTarget); + try + { + IntPtr pOrig = Gdi32.SelectObject(pSource, hObject); + try + { + Gdi32.BitBlt(pTarget, destPoint.X, destPoint.Y, srcRect.Width, srcRect.Height, pSource, srcRect.X, srcRect.Y, + Gdi32.TernaryRasterOperations.SRCCOPY); + } + finally + { + Gdi32.SelectObject(pSource, pOrig); + } + } + finally + { + Gdi32.DeleteDC(pSource); + } + } + finally + { + g.ReleaseHdc(pTarget); + } - } - } + } + } } diff --git a/src/managed/OpenLiveWriter.CoreServices/WebRequest/AsyncWebRequestWithCache.cs b/src/managed/OpenLiveWriter.CoreServices/WebRequest/AsyncWebRequestWithCache.cs index 4f6e6900..f37a1178 100644 --- a/src/managed/OpenLiveWriter.CoreServices/WebRequest/AsyncWebRequestWithCache.cs +++ b/src/managed/OpenLiveWriter.CoreServices/WebRequest/AsyncWebRequestWithCache.cs @@ -8,77 +8,77 @@ using OpenLiveWriter.Interop.Windows; namespace OpenLiveWriter.CoreServices { - /// - /// WebRequestHelper provides a mechanism for retrieve web data synchronously and - /// asynchronously. It includes the capability to automatically check the local - /// internet explorer cache for improved performance. - /// - public class AsyncWebRequestWithCache - { - /// - /// The Reponse Stream returned by the WebRequestHelper - /// - public Stream ResponseStream; + /// + /// WebRequestHelper provides a mechanism for retrieve web data synchronously and + /// asynchronously. It includes the capability to automatically check the local + /// internet explorer cache for improved performance. + /// + public class AsyncWebRequestWithCache + { + /// + /// The Reponse Stream returned by the WebRequestHelper + /// + public Stream ResponseStream; - /// - /// Event called when an ansychronous request is completed. - /// - public event EventHandler RequestComplete; - protected void OnRequestComplete(EventArgs e) - { - if (RequestComplete != null) - RequestComplete(this, e); - } + /// + /// Event called when an ansychronous request is completed. + /// + public event EventHandler RequestComplete; + protected void OnRequestComplete(EventArgs e) + { + if (RequestComplete != null) + RequestComplete(this, e); + } - /// - /// Constructs a new WebRequestHelper - /// - /// The url to which the request will be made - public AsyncWebRequestWithCache(string url) - { - m_url = url; - } + /// + /// Constructs a new WebRequestHelper + /// + /// The url to which the request will be made + public AsyncWebRequestWithCache(string url) + { + m_url = url; + } - /// - /// Begins an asynchronous request using default cache and timeout behaviour. - /// - public void StartRequest() - { - StartRequest(CacheSettings.CHECKCACHE); - } + /// + /// Begins an asynchronous request using default cache and timeout behaviour. + /// + public void StartRequest() + { + StartRequest(CacheSettings.CHECKCACHE); + } - /// - /// Begins an asynchronous request using the default timeout - /// - /// true to cache, otherwise false - public void StartRequest(CacheSettings cacheSettings) - { - StartRequest(cacheSettings, DEFAULT_TIMEOUT_MS); - } + /// + /// Begins an asynchronous request using the default timeout + /// + /// true to cache, otherwise false + public void StartRequest(CacheSettings cacheSettings) + { + StartRequest(cacheSettings, DEFAULT_TIMEOUT_MS); + } - /// - /// Begins an asynchronous request - /// - /// true to use cache, otherwise false - /// timeout, in milliseconds - public void StartRequest(CacheSettings cacheSettings, int timeOut) - { - requestRunning = true; + /// + /// Begins an asynchronous request + /// + /// true to use cache, otherwise false + /// timeout, in milliseconds + public void StartRequest(CacheSettings cacheSettings, int timeOut) + { + requestRunning = true; - // Check the cache - if (cacheSettings != CacheSettings.NOCACHE) - { - Internet_Cache_Entry_Info cacheInfo; - if (WinInet.GetUrlCacheEntryInfo(m_url, out cacheInfo)) - { - ResponseStream = new FileStream(cacheInfo.lpszLocalFileName, FileMode.Open, FileAccess.Read); - FireRequestComplete(); - } - } + // Check the cache + if (cacheSettings != CacheSettings.NOCACHE) + { + Internet_Cache_Entry_Info cacheInfo; + if (WinInet.GetUrlCacheEntryInfo(m_url, out cacheInfo)) + { + ResponseStream = new FileStream(cacheInfo.lpszLocalFileName, FileMode.Open, FileAccess.Read); + FireRequestComplete(); + } + } - // Make an async request - if (ResponseStream == null && cacheSettings != CacheSettings.CACHEONLY) - { + // Make an async request + if (ResponseStream == null && cacheSettings != CacheSettings.CACHEONLY) + { try { m_webRequest = HttpRequestHelper.CreateHttpWebRequest(m_url, true); @@ -91,74 +91,74 @@ namespace OpenLiveWriter.CoreServices m_webRequest.Timeout = timeOut; m_webRequest.BeginGetResponse(new AsyncCallback(RequestCompleteHandler), new object()); - } - } + } + } - /// - /// Cancels a running a synchronous request - /// - public void Cancel() - { - if (requestRunning) - m_webRequest.Abort(); - } + /// + /// Cancels a running a synchronous request + /// + public void Cancel() + { + if (requestRunning) + m_webRequest.Abort(); + } - /// - /// Handles completed asynchronous webRequest - /// - private void RequestCompleteHandler( - IAsyncResult ar - ) - { - WebResponse response = m_webRequest.EndGetResponse(ar); - ResponseStream = response.GetResponseStream(); - FireRequestComplete(); - } + /// + /// Handles completed asynchronous webRequest + /// + private void RequestCompleteHandler( + IAsyncResult ar + ) + { + WebResponse response = m_webRequest.EndGetResponse(ar); + ResponseStream = response.GetResponseStream(); + FireRequestComplete(); + } - /// - /// Helper method that notifies of request completion - /// - private void FireRequestComplete() - { - OnRequestComplete(EventArgs.Empty); - requestRunning = false; - } + /// + /// Helper method that notifies of request completion + /// + private void FireRequestComplete() + { + OnRequestComplete(EventArgs.Empty); + requestRunning = false; + } - /// - /// The web request - /// - private WebRequest m_webRequest; + /// + /// The web request + /// + private WebRequest m_webRequest; - /// - /// The url - /// - public string Url - { - get - { - return m_url; - } - } - private string m_url; + /// + /// The url + /// + public string Url + { + get + { + return m_url; + } + } + private string m_url; - /// - /// Indicated whether the request is actually running - /// - private bool requestRunning = false; + /// + /// Indicated whether the request is actually running + /// + private bool requestRunning = false; - /// - /// default timeout for request - /// - private static int DEFAULT_TIMEOUT_MS = 20000; + /// + /// default timeout for request + /// + private static int DEFAULT_TIMEOUT_MS = 20000; - /// - /// Cache settings control how the cache is checked. - /// - public enum CacheSettings - { - CHECKCACHE, - NOCACHE, - CACHEONLY - } - } + /// + /// Cache settings control how the cache is checked. + /// + public enum CacheSettings + { + CHECKCACHE, + NOCACHE, + CACHEONLY + } + } } diff --git a/src/managed/OpenLiveWriter.CoreServices/WebRequest/HTMLDocumentDownloader.cs b/src/managed/OpenLiveWriter.CoreServices/WebRequest/HTMLDocumentDownloader.cs index 13fbc221..a9bcdbeb 100644 --- a/src/managed/OpenLiveWriter.CoreServices/WebRequest/HTMLDocumentDownloader.cs +++ b/src/managed/OpenLiveWriter.CoreServices/WebRequest/HTMLDocumentDownloader.cs @@ -13,7 +13,6 @@ using OpenLiveWriter.CoreServices.Progress; namespace OpenLiveWriter.CoreServices { - /// /// Gets HTMLDocuments for a given URL. It gets two versions of the Document, /// one that can be used to get a list of references in the Document and one that @@ -259,7 +258,6 @@ namespace OpenLiveWriter.CoreServices } } - #region IDisposable Members /// diff --git a/src/managed/OpenLiveWriter.CoreServices/WebRequest/HttpRequestHelper.cs b/src/managed/OpenLiveWriter.CoreServices/WebRequest/HttpRequestHelper.cs index 3ebe7b71..0375dd68 100644 --- a/src/managed/OpenLiveWriter.CoreServices/WebRequest/HttpRequestHelper.cs +++ b/src/managed/OpenLiveWriter.CoreServices/WebRequest/HttpRequestHelper.cs @@ -61,7 +61,6 @@ namespace OpenLiveWriter.CoreServices return true; } - public static void TrackResponseClosing(ref HttpWebRequest req) { CloseTrackingHttpWebRequest.Wrap(ref req); diff --git a/src/managed/OpenLiveWriter.CoreServices/WebRequest/InternetShortCut.cs b/src/managed/OpenLiveWriter.CoreServices/WebRequest/InternetShortCut.cs index 257bc185..22862aa6 100644 --- a/src/managed/OpenLiveWriter.CoreServices/WebRequest/InternetShortCut.cs +++ b/src/managed/OpenLiveWriter.CoreServices/WebRequest/InternetShortCut.cs @@ -7,38 +7,38 @@ using Project31.Interop.Com.SHDocVw ; namespace Project31.CoreServices { - /// - /// InternetShortcut is a class for generating and manipulating internet shortcut files - /// - public class InternetShortcut - { - /// - /// Constructs a new instance of internetshortcut - /// - public InternetShortcut() - { - // Note that we tried marking this class with the Comimport and Guid attributes, - // but when we did that, the type couldn't be loaded. The below works around that. - Type isType = Type.GetTypeFromCLSID(new Guid("fbf23b40-e3f0-101b-8488-00aa003e56f8")) ; - internetShortcut = Activator.CreateInstance(isType) ; - } + /// + /// InternetShortcut is a class for generating and manipulating internet shortcut files + /// + public class InternetShortcut + { + /// + /// Constructs a new instance of internetshortcut + /// + public InternetShortcut() + { + // Note that we tried marking this class with the Comimport and Guid attributes, + // but when we did that, the type couldn't be loaded. The below works around that. + Type isType = Type.GetTypeFromCLSID(new Guid("fbf23b40-e3f0-101b-8488-00aa003e56f8")) ; + internetShortcut = Activator.CreateInstance(isType) ; + } - /// - /// Writes a url file representing the current navigation state of a browser - /// - /// The IWebBrowser2 for which to write the url file - /// The path to the url file - public void WriteForBrowser( IWebBrowser2 browser, string filePath ) - { - IObjectWithSite site = internetShortcut as IObjectWithSite ; - site.SetSite( browser ) ; - IPersistFile file = internetShortcut as IPersistFile ; - file.Save( filePath, false ) ; - } + /// + /// Writes a url file representing the current navigation state of a browser + /// + /// The IWebBrowser2 for which to write the url file + /// The path to the url file + public void WriteForBrowser( IWebBrowser2 browser, string filePath ) + { + IObjectWithSite site = internetShortcut as IObjectWithSite ; + site.SetSite( browser ) ; + IPersistFile file = internetShortcut as IPersistFile ; + file.Save( filePath, false ) ; + } - /// - /// holds the internetshortcut object (COM) - /// - private object internetShortcut ; - } + /// + /// holds the internetshortcut object (COM) + /// + private object internetShortcut ; + } } diff --git a/src/managed/OpenLiveWriter.CoreServices/WebRequest/MultiThreadedPageDownloader.cs b/src/managed/OpenLiveWriter.CoreServices/WebRequest/MultiThreadedPageDownloader.cs index 0396c71f..6ce21945 100644 --- a/src/managed/OpenLiveWriter.CoreServices/WebRequest/MultiThreadedPageDownloader.cs +++ b/src/managed/OpenLiveWriter.CoreServices/WebRequest/MultiThreadedPageDownloader.cs @@ -15,144 +15,144 @@ using Project31.CoreServices.Progress; namespace Project31.CoreServices { - public class DownloadResults - { + public class DownloadResults + { - public DownloadResults() - { - } + public DownloadResults() + { + } - public void AddResult(string url, string filePath) - { - if (!_result.ContainsKey(url)) - { - _result.Add(url, filePath); - } - } + public void AddResult(string url, string filePath) + { + if (!_result.ContainsKey(url)) + { + _result.Add(url, filePath); + } + } - public string GetFilePathForUrl(string url) - { - return (string)_result[url]; - } + public string GetFilePathForUrl(string url) + { + return (string)_result[url]; + } - private Hashtable _result = new Hashtable(); + private Hashtable _result = new Hashtable(); - } - /// - /// Summary description for MultiThreadedPageDownloader. - /// - public class MultiThreadedPageDownloader - { + } + /// + /// Summary description for MultiThreadedPageDownloader. + /// + public class MultiThreadedPageDownloader + { - public MultiThreadedPageDownloader(IProgressHost progressHost) : this(2, progressHost) - { + public MultiThreadedPageDownloader(IProgressHost progressHost) : this(2, progressHost) + { - } + } - public MultiThreadedPageDownloader(int threadCount, IProgressHost progressHost) - { - _threadCount = threadCount; - _progressHost = progressHost; - } - private int _threadCount = 2; - private IProgressHost _progressHost; - private Hashtable _urlsToDownload = new Hashtable(); + public MultiThreadedPageDownloader(int threadCount, IProgressHost progressHost) + { + _threadCount = threadCount; + _progressHost = progressHost; + } + private int _threadCount = 2; + private IProgressHost _progressHost; + private Hashtable _urlsToDownload = new Hashtable(); - public void AddUrl(string url, int timeout) - { - if (!_urlsToDownload.ContainsKey(url)) - _urlsToDownload.Add(url, timeout); - } + public void AddUrl(string url, int timeout) + { + if (!_urlsToDownload.ContainsKey(url)) + _urlsToDownload.Add(url, timeout); + } - private ThreadSafeQueue _downloadQueue = new ThreadSafeQueue(); + private ThreadSafeQueue _downloadQueue = new ThreadSafeQueue(); - public DownloadResults Download() - { - TickableProgressTick tickableProgress = new TickableProgressTick(_progressHost, _urlsToDownload.Count); + public DownloadResults Download() + { + TickableProgressTick tickableProgress = new TickableProgressTick(_progressHost, _urlsToDownload.Count); - Hashtable workItems = new Hashtable(); - foreach (string url in _urlsToDownload.Keys) - { - DownloadWorkItem workItem = new DownloadWorkItem(url, (int)_urlsToDownload[url], tickableProgress); - workItems.Add(url, workItem); - _downloadQueue.Enqueue(workItem); - } + Hashtable workItems = new Hashtable(); + foreach (string url in _urlsToDownload.Keys) + { + DownloadWorkItem workItem = new DownloadWorkItem(url, (int)_urlsToDownload[url], tickableProgress); + workItems.Add(url, workItem); + _downloadQueue.Enqueue(workItem); + } - ParallelExecution execution = new - ParallelExecution(new ThreadStart(DoWork), _threadCount); - execution.Execute(); + ParallelExecution execution = new + ParallelExecution(new ThreadStart(DoWork), _threadCount); + execution.Execute(); - DownloadResults results = new DownloadResults(); - foreach (string url in workItems.Keys) - { - results.AddResult(url, ((DownloadWorkItem)workItems[url]).FilePath); - } - return results; - } + DownloadResults results = new DownloadResults(); + foreach (string url in workItems.Keys) + { + results.AddResult(url, ((DownloadWorkItem)workItems[url]).FilePath); + } + return results; + } - private void DoWork() - { - while (true) - { - if (_progressHost.CancelRequested) - throw new OperationCancelledException(); + private void DoWork() + { + while (true) + { + if (_progressHost.CancelRequested) + throw new OperationCancelledException(); - bool success; - DownloadWorkItem workItem = - (DownloadWorkItem)_downloadQueue.TryDequeue(out success); - if (!success) - return; // no more work in queue; this thread is done + bool success; + DownloadWorkItem workItem = + (DownloadWorkItem)_downloadQueue.TryDequeue(out success); + if (!success) + return; // no more work in queue; this thread is done - try - { - workItem.Download(); - } - catch(Exception e) - { - Trace.WriteLine("Error downloading link while importing favorites: " + e.ToString()); - } - } - } + try + { + workItem.Download(); + } + catch(Exception e) + { + Trace.WriteLine("Error downloading link while importing favorites: " + e.ToString()); + } + } + } - private class DownloadWorkItem - { - public DownloadWorkItem(string url, int timeout, - TickableProgressTick tickableProgress) - { - _url = url; - _timeout = timeout; - _tickableProgress = tickableProgress; - } - private string _url; - private int _timeout; - private TickableProgressTick _tickableProgress; + private class DownloadWorkItem + { + public DownloadWorkItem(string url, int timeout, + TickableProgressTick tickableProgress) + { + _url = url; + _timeout = timeout; + _tickableProgress = tickableProgress; + } + private string _url; + private int _timeout; + private TickableProgressTick _tickableProgress; - public void Download() - { - _tickableProgress.Message("Indexing " + _url); - string filePath = TempFileManager.Instance.CreateTempFile(); - WebRequestWithCache request = new WebRequestWithCache(_url); + public void Download() + { + _tickableProgress.Message("Indexing " + _url); + string filePath = TempFileManager.Instance.CreateTempFile(); + WebRequestWithCache request = new WebRequestWithCache(_url); - Stream response = request.GetResponseStream(WebRequestWithCache.CacheSettings.CHECKCACHE,_timeout); - FileStream fileStream = new FileStream(filePath, FileMode.Open); - using (response) - using (fileStream) - StreamHelper.Transfer(response, fileStream); + Stream response = request.GetResponseStream(WebRequestWithCache.CacheSettings.CHECKCACHE,_timeout); + FileStream fileStream = new FileStream(filePath, FileMode.Open); + using (response) + using (fileStream) + StreamHelper.Transfer(response, fileStream); - _filePath = filePath; + _filePath = filePath; - _tickableProgress.Tick(); - } + _tickableProgress.Tick(); + } - public string FilePath - { - get - { - return _filePath; - } - } - private string _filePath = null; - } + public string FilePath + { + get + { + return _filePath; + } + } + private string _filePath = null; + } - } + } } diff --git a/src/managed/OpenLiveWriter.CoreServices/WebRequest/PageToDownload.cs b/src/managed/OpenLiveWriter.CoreServices/WebRequest/PageToDownload.cs index fa91178f..f078064a 100644 --- a/src/managed/OpenLiveWriter.CoreServices/WebRequest/PageToDownload.cs +++ b/src/managed/OpenLiveWriter.CoreServices/WebRequest/PageToDownload.cs @@ -267,7 +267,6 @@ namespace OpenLiveWriter.CoreServices } private LightWeightHTMLDocument _lightweightHTMLDocument = null; - /// /// /// diff --git a/src/managed/OpenLiveWriter.CoreServices/WebRequest/UrlDownloadToFile.cs b/src/managed/OpenLiveWriter.CoreServices/WebRequest/UrlDownloadToFile.cs index ee1a5f3a..39f4d516 100644 --- a/src/managed/OpenLiveWriter.CoreServices/WebRequest/UrlDownloadToFile.cs +++ b/src/managed/OpenLiveWriter.CoreServices/WebRequest/UrlDownloadToFile.cs @@ -78,7 +78,6 @@ namespace OpenLiveWriter.CoreServices return urlDownloadToFile.FilePath; } - public enum DownloadActions { GET, @@ -151,7 +150,6 @@ namespace OpenLiveWriter.CoreServices private NetworkCredential _networkCredential = null; private string _cookieString = null; - public DownloadActions DownloadAction { get @@ -567,7 +565,6 @@ namespace OpenLiveWriter.CoreServices LOG(iface, method); } - #endregion } diff --git a/src/managed/OpenLiveWriter.CoreServices/WebRequest/UrlHelper.cs b/src/managed/OpenLiveWriter.CoreServices/WebRequest/UrlHelper.cs index 210f9a51..f2bfc030 100644 --- a/src/managed/OpenLiveWriter.CoreServices/WebRequest/UrlHelper.cs +++ b/src/managed/OpenLiveWriter.CoreServices/WebRequest/UrlHelper.cs @@ -126,51 +126,51 @@ namespace OpenLiveWriter.CoreServices // The only downside of using the Uri above is that it doesn't handle UNC paths of the form: // \\?\UNC\... - // allocate buffer to hold url - uint bufferSize = 4096 ; - StringBuilder buffer = new StringBuilder(Convert.ToInt32(bufferSize)) ; + // allocate buffer to hold url + uint bufferSize = 4096 ; + StringBuilder buffer = new StringBuilder(Convert.ToInt32(bufferSize)) ; - // normalize the url - int result = Shlwapi.UrlCreateFromPath( path, buffer, ref bufferSize, 0 ) ; + // normalize the url + int result = Shlwapi.UrlCreateFromPath( path, buffer, ref bufferSize, 0 ) ; - // successfully converted - if ( result == HRESULT.S_OK ) - { - // return URL converted to a .NET URL encoded value - string url = buffer.ToString(); - url = ShlwapiFileUrlToDotnetEncodedUrl(url); //fixes bug 47859 + // successfully converted + if ( result == HRESULT.S_OK ) + { + // return URL converted to a .NET URL encoded value + string url = buffer.ToString(); + url = ShlwapiFileUrlToDotnetEncodedUrl(url); //fixes bug 47859 - try - { - if(new FileInfo(path).FullName != new FileInfo(new Uri(url).LocalPath).FullName) - { - Trace.Fail("Possible bug encoding/decoding path: " + path); - } - } - catch(Exception ex) - { - Trace.Fail("Exception while checking path encoding. Original path: " + path + " url from Shlwapi: " + url); - throw ex; - } - return url; - } - // didn't need conversion - else if ( result == HRESULT.S_FALSE ) + try + { + if(new FileInfo(path).FullName != new FileInfo(new Uri(url).LocalPath).FullName) + { + Trace.Fail("Possible bug encoding/decoding path: " + path); + } + } + catch(Exception ex) + { + Trace.Fail("Exception while checking path encoding. Original path: " + path + " url from Shlwapi: " + url); + throw ex; + } + return url; + } + // didn't need conversion + else if ( result == HRESULT.S_FALSE ) - { - // docs say that even if we don't need conversion it will - // copy the buffer we passed it to the result - Debug.Assert( path.Equals(buffer.ToString()) ); + { + // docs say that even if we don't need conversion it will + // copy the buffer we passed it to the result + Debug.Assert( path.Equals(buffer.ToString()) ); - // return start url - return path ; - } - // unxpected error occurred! - else - { - throw new - COMException( "Error calling UrlCreateFromPath for path " + path, result ) ; - } + // return start url + return path ; + } + // unxpected error occurred! + else + { + throw new + COMException( "Error calling UrlCreateFromPath for path " + path, result ) ; + } #endif } @@ -328,28 +328,28 @@ namespace OpenLiveWriter.CoreServices else return false; #if false - // TODO: For some reason, IsvalidURL is always returning 1 (S_FALSE) - // no matter what URL you pass into the sucker. - // Handle only the base URL - if (url.IndexOf("?") > -1) - url = url.Substring(0, url.IndexOf("?")); + // TODO: For some reason, IsvalidURL is always returning 1 (S_FALSE) + // no matter what URL you pass into the sucker. + // Handle only the base URL + if (url.IndexOf("?") > -1) + url = url.Substring(0, url.IndexOf("?")); - int hResult = UrlMon.IsValidURL( - IntPtr.Zero, - url, - 0); + int hResult = UrlMon.IsValidURL( + IntPtr.Zero, + url, + 0); - switch (hResult) - { - case HRESULT.S_OK: - return true; - case HRESULT.E_INVALIDARG: - Trace.Log("IsUrl returned HRESULT.E_INVALIDARG for this url: " + url); - return false; - case HRESULT.S_FALSE: - default: - return false; - } + switch (hResult) + { + case HRESULT.S_OK: + return true; + case HRESULT.E_INVALIDARG: + Trace.Log("IsUrl returned HRESULT.E_INVALIDARG for this url: " + url); + return false; + case HRESULT.S_FALSE: + default: + return false; + } #endif } @@ -795,7 +795,6 @@ namespace OpenLiveWriter.CoreServices return string.Format(CultureInfo.InvariantCulture, "\r\n", url.Length, url); } - public static bool IsUrlLinkable(string url) { if (UrlHelper.IsUrl(url)) diff --git a/src/managed/OpenLiveWriter.CoreServices/WebRequest/WebPageCapture.cs b/src/managed/OpenLiveWriter.CoreServices/WebRequest/WebPageCapture.cs index c6e728b3..e8860c74 100644 --- a/src/managed/OpenLiveWriter.CoreServices/WebRequest/WebPageCapture.cs +++ b/src/managed/OpenLiveWriter.CoreServices/WebRequest/WebPageCapture.cs @@ -11,147 +11,145 @@ using OpenLiveWriter.CoreServices.Progress; namespace OpenLiveWriter.CoreServices { - public class WebPageCapture - { + public class WebPageCapture + { - public WebPageCapture(string targetUrl, string destinationPath) - { - _targetUrl = targetUrl ; - _destinationPath = destinationPath ; - } + public WebPageCapture(string targetUrl, string destinationPath) + { + _targetUrl = targetUrl ; + _destinationPath = destinationPath ; + } - public string TargetUrl - { - get { return _targetUrl; } - } - private string _targetUrl ; + public string TargetUrl + { + get { return _targetUrl; } + } + private string _targetUrl ; - public string DestinationPath - { - get { return _destinationPath; } - } - private string _destinationPath ; + public string DestinationPath + { + get { return _destinationPath; } + } + private string _destinationPath ; + public string Capture(int timeoutMs) + { + // flag indicating whether we should continue with the capture + bool continueCapture = true ; - public string Capture(int timeoutMs) - { - // flag indicating whether we should continue with the capture - bool continueCapture = true ; + // request the page + HttpWebResponse response = RequestPage(TargetUrl, timeoutMs); + OnHeadersReceived(response.Headers, ref continueCapture) ; + if ( !continueCapture ) + throw new OperationCancelledException() ; - // request the page - HttpWebResponse response = RequestPage(TargetUrl, timeoutMs); - OnHeadersReceived(response.Headers, ref continueCapture) ; - if ( !continueCapture ) - throw new OperationCancelledException() ; + // transfer it to a stream + MemoryStream pageStream = new MemoryStream(); + using ( Stream responseStream = response.GetResponseStream() ) + StreamHelper.Transfer(responseStream, pageStream); + pageStream.Seek(0, SeekOrigin.Begin) ; - // transfer it to a stream - MemoryStream pageStream = new MemoryStream(); - using ( Stream responseStream = response.GetResponseStream() ) - StreamHelper.Transfer(responseStream, pageStream); - pageStream.Seek(0, SeekOrigin.Begin) ; + // allow filter on content + OnContentReceived( new StreamReader(pageStream).ReadToEnd(), ref continueCapture ) ; + if ( !continueCapture ) + throw new OperationCancelledException() ; + pageStream.Seek(0, SeekOrigin.Begin) ; - // allow filter on content - OnContentReceived( new StreamReader(pageStream).ReadToEnd(), ref continueCapture ) ; - if ( !continueCapture ) - throw new OperationCancelledException() ; - pageStream.Seek(0, SeekOrigin.Begin) ; + // Read the stream into a lightweight HTML doc. We use from LightWeightHTMLDocument.FromIHTMLDocument2 + // instead of LightWeightHTMLDocument.FromStream because from stream improperly shoves a saveFrom declaration + // above the docType (bug 289357) + IHTMLDocument2 doc = HTMLDocumentHelper.StreamToHTMLDoc(pageStream, TargetUrl, false); + LightWeightHTMLDocument ldoc = LightWeightHTMLDocument.FromIHTMLDocument2(doc, TargetUrl, true); - // Read the stream into a lightweight HTML doc. We use from LightWeightHTMLDocument.FromIHTMLDocument2 - // instead of LightWeightHTMLDocument.FromStream because from stream improperly shoves a saveFrom declaration - // above the docType (bug 289357) - IHTMLDocument2 doc = HTMLDocumentHelper.StreamToHTMLDoc(pageStream, TargetUrl, false); - LightWeightHTMLDocument ldoc = LightWeightHTMLDocument.FromIHTMLDocument2(doc, TargetUrl, true); + // download references + FileBasedSiteStorage siteStorage = new FileBasedSiteStorage(DestinationPath, "index.htm"); + PageToDownload page = new PageToDownload(ldoc, TargetUrl, siteStorage.RootFile); + PageAndReferenceDownloader downloader = new PageAndReferenceDownloader(new PageToDownload[]{page}, siteStorage) ; + downloader.Download(new TimeoutProgressHost(timeoutMs)) ; - // download references - FileBasedSiteStorage siteStorage = new FileBasedSiteStorage(DestinationPath, "index.htm"); - PageToDownload page = new PageToDownload(ldoc, TargetUrl, siteStorage.RootFile); - PageAndReferenceDownloader downloader = new PageAndReferenceDownloader(new PageToDownload[]{page}, siteStorage) ; - downloader.Download(new TimeoutProgressHost(timeoutMs)) ; + // return path to captured page + return Path.Combine(DestinationPath, siteStorage.RootFile) ; + } - // return path to captured page - return Path.Combine(DestinationPath, siteStorage.RootFile) ; - } + public string SafeCapture(int timeoutMs) + { + try + { + return Capture(timeoutMs) ; + } + catch + { + return null ; + } + } + protected virtual void OnHeadersReceived(WebHeaderCollection headers, ref bool continueCapture) + { + } - public string SafeCapture(int timeoutMs) - { - try - { - return Capture(timeoutMs) ; - } - catch - { - return null ; - } - } + protected virtual void OnContentReceived(string content, ref bool continueCapture) + { + } - protected virtual void OnHeadersReceived(WebHeaderCollection headers, ref bool continueCapture) - { - } + private HttpWebResponse RequestPage(string targetUrl, int timeoutMs) + { + try + { + return HttpRequestHelper.SendRequest(targetUrl, timeoutMs); + } + catch(WebResponseTimeoutException) + { + // convert "special" timed out exception into conventional .net timed out exception + throw new OperationTimedOutException() ; + } + } - protected virtual void OnContentReceived(string content, ref bool continueCapture) - { - } + private class TimeoutProgressHost : IProgressHost + { + private DateTime _timeoutTime ; - private HttpWebResponse RequestPage(string targetUrl, int timeoutMs) - { - try - { - return HttpRequestHelper.SendRequest(targetUrl, timeoutMs); - } - catch(WebResponseTimeoutException) - { - // convert "special" timed out exception into conventional .net timed out exception - throw new OperationTimedOutException() ; - } - } + public TimeoutProgressHost(int timeoutMs) + { + _timeoutTime = DateTime.Now.AddMilliseconds(timeoutMs) ; + } - private class TimeoutProgressHost : IProgressHost - { - private DateTime _timeoutTime ; + private void CheckForTimeout() + { + if ( DateTime.Now.CompareTo(_timeoutTime) > 0 ) + throw new OperationTimedOutException(); + } - public TimeoutProgressHost(int timeoutMs) - { - _timeoutTime = DateTime.Now.AddMilliseconds(timeoutMs) ; - } + public void UpdateProgress(int complete, int total, string message) + { + CheckForTimeout() ; + } - private void CheckForTimeout() - { - if ( DateTime.Now.CompareTo(_timeoutTime) > 0 ) - throw new OperationTimedOutException(); - } + public void UpdateProgress(int complete, int total) + { + CheckForTimeout() ; + } - public void UpdateProgress(int complete, int total, string message) - { - CheckForTimeout() ; - } + public void UpdateProgress(string message) + { + CheckForTimeout() ; + } - public void UpdateProgress(int complete, int total) - { - CheckForTimeout() ; - } + public bool CancelRequested + { + get + { + return false; + } + } - public void UpdateProgress(string message) - { - CheckForTimeout() ; - } + public double ProgressCompletionPercentage + { + get + { + return 0; + } + } + } - public bool CancelRequested - { - get - { - return false; - } - } - - public double ProgressCompletionPercentage - { - get - { - return 0; - } - } - } - - } + } } diff --git a/src/managed/OpenLiveWriter.CoreServices/WebRequest/WebPageDownloader.cs b/src/managed/OpenLiveWriter.CoreServices/WebRequest/WebPageDownloader.cs index 81f54c9d..1f7d97bd 100644 --- a/src/managed/OpenLiveWriter.CoreServices/WebRequest/WebPageDownloader.cs +++ b/src/managed/OpenLiveWriter.CoreServices/WebRequest/WebPageDownloader.cs @@ -217,7 +217,6 @@ namespace OpenLiveWriter.CoreServices OnDownloadComplete(e); } - /// /// Handle new window event (prevent all pop-up windows from displaying) /// @@ -435,7 +434,6 @@ namespace OpenLiveWriter.CoreServices #endregion - public class WebPageDownloaderResult { public static WebPageDownloaderResult Ok = new WebPageDownloaderResult(-1); @@ -498,7 +496,6 @@ namespace OpenLiveWriter.CoreServices } - public class WebPageDownloaderException : Exception { public WebPageDownloaderException(string message, string finalUrl) : this(-1, message, finalUrl) @@ -531,5 +528,4 @@ namespace OpenLiveWriter.CoreServices } } - } diff --git a/src/managed/OpenLiveWriter.CoreServices/WebRequest/WebProxySettings.cs b/src/managed/OpenLiveWriter.CoreServices/WebRequest/WebProxySettings.cs index ce0b7e15..465643d3 100644 --- a/src/managed/OpenLiveWriter.CoreServices/WebRequest/WebProxySettings.cs +++ b/src/managed/OpenLiveWriter.CoreServices/WebRequest/WebProxySettings.cs @@ -79,7 +79,6 @@ namespace OpenLiveWriter.CoreServices #region Class Configuration (location of settings, etc) - private static SettingsPersisterHelper WriteSettingsKey { get @@ -138,5 +137,4 @@ namespace OpenLiveWriter.CoreServices } - } diff --git a/src/managed/OpenLiveWriter.CoreServices/WebRequest/WebRequestWithCache.cs b/src/managed/OpenLiveWriter.CoreServices/WebRequest/WebRequestWithCache.cs index 1cb991b3..e121676f 100644 --- a/src/managed/OpenLiveWriter.CoreServices/WebRequest/WebRequestWithCache.cs +++ b/src/managed/OpenLiveWriter.CoreServices/WebRequest/WebRequestWithCache.cs @@ -124,7 +124,6 @@ namespace OpenLiveWriter.CoreServices if (m_url == null) return null; - if (WebRequest is HttpWebRequest) { HttpWebRequest thisRequest = (HttpWebRequest)WebRequest; diff --git a/src/managed/OpenLiveWriter.CoreServices/WindowSubClasser.cs b/src/managed/OpenLiveWriter.CoreServices/WindowSubClasser.cs index f19bcdae..165a086f 100644 --- a/src/managed/OpenLiveWriter.CoreServices/WindowSubClasser.cs +++ b/src/managed/OpenLiveWriter.CoreServices/WindowSubClasser.cs @@ -74,7 +74,6 @@ namespace OpenLiveWriter.CoreServices return User32.CallWindowProc(m_baseWndProc, hWnd, uMsg, wParam, lParam); } - // implementation data private IWin32Window _window; private WndProcDelegate m_wndProcDelegate; diff --git a/src/managed/OpenLiveWriter.CoreServices/XmlRpcClient.cs b/src/managed/OpenLiveWriter.CoreServices/XmlRpcClient.cs index 08e54531..04e322c9 100644 --- a/src/managed/OpenLiveWriter.CoreServices/XmlRpcClient.cs +++ b/src/managed/OpenLiveWriter.CoreServices/XmlRpcClient.cs @@ -223,7 +223,6 @@ namespace OpenLiveWriter.CoreServices private string _transportEncoding; } - public abstract class XmlRpcValue { protected XmlRpcValue(object value) @@ -405,7 +404,6 @@ namespace OpenLiveWriter.CoreServices } } - public class XmlRpcStruct : XmlRpcValue { /// @@ -567,7 +565,6 @@ namespace OpenLiveWriter.CoreServices public readonly string Response; } - /// /// Utility class used to write elements /// diff --git a/src/managed/OpenLiveWriter.Extensibility/BlogClient/BlogClientException.cs b/src/managed/OpenLiveWriter.Extensibility/BlogClient/BlogClientException.cs index 8c1368b1..4d116a87 100644 --- a/src/managed/OpenLiveWriter.Extensibility/BlogClient/BlogClientException.cs +++ b/src/managed/OpenLiveWriter.Extensibility/BlogClient/BlogClientException.cs @@ -225,4 +225,3 @@ namespace OpenLiveWriter.Extensibility.BlogClient } } - diff --git a/src/managed/OpenLiveWriter.Extensibility/BlogClient/BlogPostCategory.cs b/src/managed/OpenLiveWriter.Extensibility/BlogClient/BlogPostCategory.cs index cb5c63e2..e341b418 100644 --- a/src/managed/OpenLiveWriter.Extensibility/BlogClient/BlogPostCategory.cs +++ b/src/managed/OpenLiveWriter.Extensibility/BlogClient/BlogPostCategory.cs @@ -109,7 +109,6 @@ namespace OpenLiveWriter.Extensibility.BlogClient return String.Compare(Name, category.Name, StringComparison.Ordinal); } - public object Clone() { return new BlogPostCategory(Id, Name, Parent); diff --git a/src/managed/OpenLiveWriter.Extensibility/BlogClient/IBlogClient.cs b/src/managed/OpenLiveWriter.Extensibility/BlogClient/IBlogClient.cs index dad63aa4..7008da92 100644 --- a/src/managed/OpenLiveWriter.Extensibility/BlogClient/IBlogClient.cs +++ b/src/managed/OpenLiveWriter.Extensibility/BlogClient/IBlogClient.cs @@ -39,7 +39,6 @@ namespace OpenLiveWriter.Extensibility.BlogClient private readonly string _protocolName; } - public interface IBlogClient { string ProtocolName { get; } @@ -183,6 +182,5 @@ namespace OpenLiveWriter.Extensibility.BlogClient private string _id; private string _name; - } } diff --git a/src/managed/OpenLiveWriter.Extensibility/ImageEditing/IImageDecorator.cs b/src/managed/OpenLiveWriter.Extensibility/ImageEditing/IImageDecorator.cs index 40d9aed9..3abb6cb6 100644 --- a/src/managed/OpenLiveWriter.Extensibility/ImageEditing/IImageDecorator.cs +++ b/src/managed/OpenLiveWriter.Extensibility/ImageEditing/IImageDecorator.cs @@ -9,69 +9,69 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.Extensibility.ImageEditing { #if SUPPORT_PLUGINS - [AttributeUsage(AttributeTargets.Class, AllowMultiple=false, Inherited=true)] - public class ImageDecoratorAttribute : Attribute - { - public ImageDecoratorAttribute(string name) - { - Name = name; - } + [AttributeUsage(AttributeTargets.Class, AllowMultiple=false, Inherited=true)] + public class ImageDecoratorAttribute : Attribute + { + public ImageDecoratorAttribute(string name) + { + Name = name; + } - /// - /// The display name to show in the image effects list. - /// - public string Name - { - get { return name; } - set { name = value; } - } + /// + /// The display name to show in the image effects list. + /// + public string Name + { + get { return name; } + set { name = value; } + } - /// - /// The unique ID to assign a decorator. - /// - public string Id - { - get { return id; } - set { id = value; } - } + /// + /// The unique ID to assign a decorator. + /// + public string Id + { + get { return id; } + set { id = value; } + } - /// - /// The decorator group to assign a decorator to. - /// - [Obsolete("Groups need to have separate names and IDs in order to be properly localizable. This should become GroupId.", true)] - public string Group - { - get { return group; } - set { group = value; } - } + /// + /// The decorator group to assign a decorator to. + /// + [Obsolete("Groups need to have separate names and IDs in order to be properly localizable. This should become GroupId.", true)] + public string Group + { + get { return group; } + set { group = value; } + } - /// - /// If true, then the decorator supports an editor control that should be display if the user - /// wants to customize the decorator's behavior. - /// - public bool Editable - { - get { return editable; } - set { editable = value; } - } + /// + /// If true, then the decorator supports an editor control that should be display if the user + /// wants to customize the decorator's behavior. + /// + public bool Editable + { + get { return editable; } + set { editable = value; } + } - /// - /// If true, then the decorator and its current settings can be applied by default if the user - /// saves an set of applied image effects as the default. If false, then the decorator will not - /// be included in the set of effects to apply to images by default. - /// - public bool Defaultable - { - get { return defaultable; } - set { defaultable = value; } - } + /// + /// If true, then the decorator and its current settings can be applied by default if the user + /// saves an set of applied image effects as the default. If false, then the decorator will not + /// be included in the set of effects to apply to images by default. + /// + public bool Defaultable + { + get { return defaultable; } + set { defaultable = value; } + } - private string name; - private string id; - private string group; - private bool editable; - private bool defaultable; - } + private string name; + private string id; + private string group; + private bool editable; + private bool defaultable; + } #endif /// diff --git a/src/managed/OpenLiveWriter.Extensibility/ImageServices/IImageUploadSettingsEditorContext.cs b/src/managed/OpenLiveWriter.Extensibility/ImageServices/IImageUploadSettingsEditorContext.cs index d89285ce..bbff0d30 100644 --- a/src/managed/OpenLiveWriter.Extensibility/ImageServices/IImageUploadSettingsEditorContext.cs +++ b/src/managed/OpenLiveWriter.Extensibility/ImageServices/IImageUploadSettingsEditorContext.cs @@ -5,11 +5,11 @@ using OpenLiveWriter.Api; namespace OpenLiveWriter.Extensibility.ImageServices { - /// - /// Summary description for IImageUploadSettingsEditorContext. - /// - public interface IImageUploadSettingsEditorContext - { - IProperties ImageUploadSettings { get; } - } + /// + /// Summary description for IImageUploadSettingsEditorContext. + /// + public interface IImageUploadSettingsEditorContext + { + IProperties ImageUploadSettings { get; } + } } diff --git a/src/managed/OpenLiveWriter.Extensibility/ImageServices/ImageFileUploadSettingsEditor.cs b/src/managed/OpenLiveWriter.Extensibility/ImageServices/ImageFileUploadSettingsEditor.cs index 7e3d9160..dd13f7cc 100644 --- a/src/managed/OpenLiveWriter.Extensibility/ImageServices/ImageFileUploadSettingsEditor.cs +++ b/src/managed/OpenLiveWriter.Extensibility/ImageServices/ImageFileUploadSettingsEditor.cs @@ -10,98 +10,98 @@ using OpenLiveWriter.Extensibility.ImageServices; namespace OpenLiveWriter.Extensibility.ImageServices { - /// - /// Base editor control for editing file upload settings for an individual image file. - /// - public class ImageFileUploadSettingsEditor : UserControl - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Base editor control for editing file upload settings for an individual image file. + /// + public class ImageFileUploadSettingsEditor : UserControl + { + /// + /// Required designer variable. + /// + private Container components = null; - public ImageFileUploadSettingsEditor() - { - // This call is required by the Windows.Forms Form Designer. - InitializeComponent(); + public ImageFileUploadSettingsEditor() + { + // This call is required by the Windows.Forms Form Designer. + InitializeComponent(); - // set the background color - BackColor = ApplicationManager.ApplicationStyle.ActiveTabBottomColor ; - ApplicationStyleManager.ApplicationStyleChanged += new EventHandler(ApplicationManager_ApplicationStyleChanged); - } + // set the background color + BackColor = ApplicationManager.ApplicationStyle.ActiveTabBottomColor ; + ApplicationStyleManager.ApplicationStyleChanged += new EventHandler(ApplicationManager_ApplicationStyleChanged); + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - ApplicationStyleManager.ApplicationStyleChanged -= new EventHandler(ApplicationManager_ApplicationStyleChanged); - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + ApplicationStyleManager.ApplicationStyleChanged -= new EventHandler(ApplicationManager_ApplicationStyleChanged); + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - components = new System.ComponentModel.Container(); - } - #endregion + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + } + #endregion - /// - /// Hook that allows subclasses to refresh their cached appearance settings. - /// - protected virtual void LoadAppearanceSettings() - { - BackColor = ApplicationManager.ApplicationStyle.ActiveTabBottomColor ; - } + /// + /// Hook that allows subclasses to refresh their cached appearance settings. + /// + protected virtual void LoadAppearanceSettings() + { + BackColor = ApplicationManager.ApplicationStyle.ActiveTabBottomColor ; + } - private void ApplicationManager_ApplicationStyleChanged(object sender, EventArgs e) - { - LoadAppearanceSettings(); - PerformLayout(); - Invalidate(); - } + private void ApplicationManager_ApplicationStyleChanged(object sender, EventArgs e) + { + LoadAppearanceSettings(); + PerformLayout(); + Invalidate(); + } - protected enum ControlState { Uninitialized, Loading, Loaded }; - protected ControlState EditorState - { - get{ return _loadedState; } - } - private ControlState _loadedState = ControlState.Uninitialized; + protected enum ControlState { Uninitialized, Loading, Loaded }; + protected ControlState EditorState + { + get{ return _loadedState; } + } + private ControlState _loadedState = ControlState.Uninitialized; - public void LoadEditor(IImageUploadSettingsEditorContext context) - { - _loadedState = ControlState.Loading; - _context = context; - LoadEditor(); - _loadedState = ControlState.Loaded; - } + public void LoadEditor(IImageUploadSettingsEditorContext context) + { + _loadedState = ControlState.Loading; + _context = context; + LoadEditor(); + _loadedState = ControlState.Loaded; + } - /// - /// Hook to allow subclasses to initialize the editor after the editor context has been set. - /// - protected virtual void LoadEditor() - { + /// + /// Hook to allow subclasses to initialize the editor after the editor context has been set. + /// + protected virtual void LoadEditor() + { - } + } - internal protected IImageUploadSettingsEditorContext EditorContext - { - get - { - return _context; - } - } - private IImageUploadSettingsEditorContext _context; - } + internal protected IImageUploadSettingsEditorContext EditorContext + { + get + { + return _context; + } + } + private IImageUploadSettingsEditorContext _context; + } } diff --git a/src/managed/OpenLiveWriter.Extensibility/ImageServices/ImageService.cs b/src/managed/OpenLiveWriter.Extensibility/ImageServices/ImageService.cs index 0d2fa679..bd9c4611 100644 --- a/src/managed/OpenLiveWriter.Extensibility/ImageServices/ImageService.cs +++ b/src/managed/OpenLiveWriter.Extensibility/ImageServices/ImageService.cs @@ -7,53 +7,53 @@ using OpenLiveWriter.Extensibility.ImageServices; namespace OpenLiveWriter.Extensibility.ImageServices { - public interface IImageFile - { - int Width {get; } - int Height {get; } - string FilePath { get; } - ImageEmbedType ImageEmbedType { get; } - } + public interface IImageFile + { + int Width {get; } + int Height {get; } + string FilePath { get; } + ImageEmbedType ImageEmbedType { get; } + } - public interface IImageUploadResult - { - string ImageUrl { get; } - } + public interface IImageUploadResult + { + string ImageUrl { get; } + } - public interface IUploadImageContext - { - IImageFile[] UploadImageFiles {get; } - IProperties ImageFileUploadSettings { get; } - //IImageFile GenerateImageFile(int width, int height, ImageGenerationFlags flags); - } + public interface IUploadImageContext + { + IImageFile[] UploadImageFiles {get; } + IProperties ImageFileUploadSettings { get; } + //IImageFile GenerateImageFile(int width, int height, ImageGenerationFlags flags); + } - public interface IImageServiceUploader - { - void Connect(); - void Disconnect(); - IImageUploadResult[] UploadImages(IUploadImageContext uploadImageContext); - } + public interface IImageServiceUploader + { + void Connect(); + void Disconnect(); + IImageUploadResult[] UploadImages(IUploadImageContext uploadImageContext); + } - public interface IImageService - { - /// - /// Create an image service uploader instance. - /// - /// - /// - IImageServiceUploader CreateImageServiceUploader(IProperties imageServiceSettings); + public interface IImageService + { + /// + /// Create an image service uploader instance. + /// + /// + /// + IImageServiceUploader CreateImageServiceUploader(IProperties imageServiceSettings); - /// - /// Create an editor for customizing the image service settings. - /// - /// - ImageServiceSettingsEditor CreateImageServiceSettingsEditor(); + /// + /// Create an editor for customizing the image service settings. + /// + /// + ImageServiceSettingsEditor CreateImageServiceSettingsEditor(); - /// - /// Create an editor for customizing the upload settings for an individual image file. - /// - /// - ImageFileUploadSettingsEditor CreateImageFileUploadSettingsEditor(); - } + /// + /// Create an editor for customizing the upload settings for an individual image file. + /// + /// + ImageFileUploadSettingsEditor CreateImageFileUploadSettingsEditor(); + } } diff --git a/src/managed/OpenLiveWriter.Extensibility/ImageServices/ImageServiceSettingsEditor.cs b/src/managed/OpenLiveWriter.Extensibility/ImageServices/ImageServiceSettingsEditor.cs index 1f6a4b7c..9964bfb3 100644 --- a/src/managed/OpenLiveWriter.Extensibility/ImageServices/ImageServiceSettingsEditor.cs +++ b/src/managed/OpenLiveWriter.Extensibility/ImageServices/ImageServiceSettingsEditor.cs @@ -7,78 +7,78 @@ using OpenLiveWriter.Api; namespace OpenLiveWriter.Extensibility.ImageServices { - /// - /// Summary description for ImageServiceImageSettingsEditor. - /// - public class ImageServiceSettingsEditor: UserControl - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for ImageServiceImageSettingsEditor. + /// + public class ImageServiceSettingsEditor: UserControl + { + /// + /// Required designer variable. + /// + private Container components = null; - public ImageServiceSettingsEditor() - { - // This call is required by the Windows.Forms Form Designer. - InitializeComponent(); - } + public ImageServiceSettingsEditor() + { + // This call is required by the Windows.Forms Form Designer. + InitializeComponent(); + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - components = new System.ComponentModel.Container(); - } - #endregion + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + } + #endregion - protected enum ControlState { Uninitialized, Loading, Loaded }; - protected ControlState EditorState - { - get{ return _loadedState; } - } - private ControlState _loadedState = ControlState.Uninitialized; + protected enum ControlState { Uninitialized, Loading, Loaded }; + protected ControlState EditorState + { + get{ return _loadedState; } + } + private ControlState _loadedState = ControlState.Uninitialized; - public void LoadEditor(IProperties imageServiceSettings) - { - _loadedState = ControlState.Loading; - _imageServiceSettings = imageServiceSettings; - LoadEditor(); - _loadedState = ControlState.Loaded; - } + public void LoadEditor(IProperties imageServiceSettings) + { + _loadedState = ControlState.Loading; + _imageServiceSettings = imageServiceSettings; + LoadEditor(); + _loadedState = ControlState.Loaded; + } - /// - /// Hook to allow subclasses to initialize the editor after the editor context has been set. - /// - protected virtual void LoadEditor() - { + /// + /// Hook to allow subclasses to initialize the editor after the editor context has been set. + /// + protected virtual void LoadEditor() + { - } + } - internal protected IProperties ImageServiceSettings - { - get - { - return _imageServiceSettings; - } - } - private IProperties _imageServiceSettings; - } + internal protected IProperties ImageServiceSettings + { + get + { + return _imageServiceSettings; + } + } + private IProperties _imageServiceSettings; + } } diff --git a/src/managed/OpenLiveWriter.Extensibility/ImageServices/ImageUploadResult.cs b/src/managed/OpenLiveWriter.Extensibility/ImageServices/ImageUploadResult.cs index 55ebdfdf..d70c6051 100644 --- a/src/managed/OpenLiveWriter.Extensibility/ImageServices/ImageUploadResult.cs +++ b/src/managed/OpenLiveWriter.Extensibility/ImageServices/ImageUploadResult.cs @@ -5,24 +5,24 @@ using OpenLiveWriter.Extensibility.ImageServices; namespace OpenLiveWriter.Extensibility.ImageServices { - public class ImageUploadResult : IImageUploadResult - { - public ImageUploadResult(string imageUrl) - { - _imageUrl = imageUrl; - } + public class ImageUploadResult : IImageUploadResult + { + public ImageUploadResult(string imageUrl) + { + _imageUrl = imageUrl; + } - public string ImageUrl - { - get - { - return _imageUrl; - } - set - { - _imageUrl = value; - } - } - private string _imageUrl; - } + public string ImageUrl + { + get + { + return _imageUrl; + } + set + { + _imageUrl = value; + } + } + private string _imageUrl; + } } diff --git a/src/managed/OpenLiveWriter.FileDestinations/DestinationProfile.cs b/src/managed/OpenLiveWriter.FileDestinations/DestinationProfile.cs index a1dd5997..a79fd457 100644 --- a/src/managed/OpenLiveWriter.FileDestinations/DestinationProfile.cs +++ b/src/managed/OpenLiveWriter.FileDestinations/DestinationProfile.cs @@ -80,7 +80,6 @@ namespace OpenLiveWriter.FileDestinations } } - private string ftpServer = ""; /// /// The hostname of the FTP server @@ -161,7 +160,6 @@ namespace OpenLiveWriter.FileDestinations } } - public override string ToString() { return Name; diff --git a/src/managed/OpenLiveWriter.FileDestinations/DestinationProfileManager.cs b/src/managed/OpenLiveWriter.FileDestinations/DestinationProfileManager.cs index 90d25039..3e4acac1 100644 --- a/src/managed/OpenLiveWriter.FileDestinations/DestinationProfileManager.cs +++ b/src/managed/OpenLiveWriter.FileDestinations/DestinationProfileManager.cs @@ -28,7 +28,6 @@ namespace OpenLiveWriter.FileDestinations #region Destination Settings Management - public bool HasProfile(string key) { if (key == string.Empty) @@ -154,7 +153,6 @@ namespace OpenLiveWriter.FileDestinations } } - /// /// Returns the registry subtree for a specified profile. /// @@ -169,7 +167,6 @@ namespace OpenLiveWriter.FileDestinations #endregion - #region Class Configuration (location of settings, etc) /// @@ -188,7 +185,6 @@ namespace OpenLiveWriter.FileDestinations #endregion - #region Constants // root key diff --git a/src/managed/OpenLiveWriter.FileDestinations/FileDestination.cs b/src/managed/OpenLiveWriter.FileDestinations/FileDestination.cs index 6dd56812..4b03e093 100644 --- a/src/managed/OpenLiveWriter.FileDestinations/FileDestination.cs +++ b/src/managed/OpenLiveWriter.FileDestinations/FileDestination.cs @@ -91,7 +91,6 @@ namespace OpenLiveWriter.FileDestinations if (CopyFile(fromPath, toPath, overWrite)) break; - // Wait and then retry copyfile attempts++; @@ -115,7 +114,6 @@ namespace OpenLiveWriter.FileDestinations } - /// /// This method is called to make a connection to the destination /// diff --git a/src/managed/OpenLiveWriter.FileDestinations/FileSystemDestination.cs b/src/managed/OpenLiveWriter.FileDestinations/FileSystemDestination.cs index b48b5dd2..f5c374cc 100644 --- a/src/managed/OpenLiveWriter.FileDestinations/FileSystemDestination.cs +++ b/src/managed/OpenLiveWriter.FileDestinations/FileSystemDestination.cs @@ -40,7 +40,6 @@ namespace OpenLiveWriter.FileDestinations } } - /// /// Copies files to a local destination /// diff --git a/src/managed/OpenLiveWriter.FileDestinations/WebPublish/WebPublishMessageDesigner.cs b/src/managed/OpenLiveWriter.FileDestinations/WebPublish/WebPublishMessageDesigner.cs index 846ac0a9..99129c2c 100644 --- a/src/managed/OpenLiveWriter.FileDestinations/WebPublish/WebPublishMessageDesigner.cs +++ b/src/managed/OpenLiveWriter.FileDestinations/WebPublish/WebPublishMessageDesigner.cs @@ -4,39 +4,39 @@ using System.Windows.Forms.Design; namespace OpenLiveWriter.FileDestinations { - public class WebPublishMessageDesigner : ComponentDocumentDesigner - { - // Stores reference to the LocalizationExtenderProvider this designer adds, in order to remove it on Dispose. - private LocalizationExtenderProvider localizationExtenderProvider; + public class WebPublishMessageDesigner : ComponentDocumentDesigner + { + // Stores reference to the LocalizationExtenderProvider this designer adds, in order to remove it on Dispose. + private LocalizationExtenderProvider localizationExtenderProvider; - // Adds a LocalizationExtenderProvider for the component this designer is initialized to support. - public override void Initialize(IComponent component) - { - base.Initialize(component); + // Adds a LocalizationExtenderProvider for the component this designer is initialized to support. + public override void Initialize(IComponent component) + { + base.Initialize(component); - // If no extender from this designer is active... - if( localizationExtenderProvider == null ) - { - // Adds a LocalizationExtenderProvider that provides localization support properties to the specified component. - localizationExtenderProvider = new LocalizationExtenderProvider(component.Site, component); - localizationExtenderProvider.SetLocalizable(component, true); - } - } + // If no extender from this designer is active... + if( localizationExtenderProvider == null ) + { + // Adds a LocalizationExtenderProvider that provides localization support properties to the specified component. + localizationExtenderProvider = new LocalizationExtenderProvider(component.Site, component); + localizationExtenderProvider.SetLocalizable(component, true); + } + } - // If a LocalizationExtenderProvider has been added, removes the extender provider. - protected override void Dispose(bool disposing) - { - base.Dispose(disposing); + // If a LocalizationExtenderProvider has been added, removes the extender provider. + protected override void Dispose(bool disposing) + { + base.Dispose(disposing); - // If an extender has been added, remove it - if( localizationExtenderProvider != null ) - { - // Disposes of the extender provider. The extender - // provider removes itself from the extender provider - // service when it is disposed. - localizationExtenderProvider.Dispose(); - localizationExtenderProvider = null; - } - } - } + // If an extender has been added, remove it + if( localizationExtenderProvider != null ) + { + // Disposes of the extender provider. The extender + // provider removes itself from the extender provider + // service when it is disposed. + localizationExtenderProvider.Dispose(); + localizationExtenderProvider = null; + } + } + } } diff --git a/src/managed/OpenLiveWriter.FileDestinations/WebPublish/WebPublishMessages/ConnectionTimeoutWebPublishMessage.cs b/src/managed/OpenLiveWriter.FileDestinations/WebPublish/WebPublishMessages/ConnectionTimeoutWebPublishMessage.cs index 040d7687..463d4350 100644 --- a/src/managed/OpenLiveWriter.FileDestinations/WebPublish/WebPublishMessages/ConnectionTimeoutWebPublishMessage.cs +++ b/src/managed/OpenLiveWriter.FileDestinations/WebPublish/WebPublishMessages/ConnectionTimeoutWebPublishMessage.cs @@ -3,40 +3,38 @@ namespace OpenLiveWriter.FileDestinations { - /// - /// Summary description for TargetPathNotFound. - /// - public class ConnectionTimeoutWebPublishMessage : WebPublishMessage - { + /// + /// Summary description for TargetPathNotFound. + /// + public class ConnectionTimeoutWebPublishMessage : WebPublishMessage + { + public ConnectionTimeoutWebPublishMessage(params object[] textFormatArgs) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - public ConnectionTimeoutWebPublishMessage(params object[] textFormatArgs) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + // set text format args if they were specified + TextFormatArgs = textFormatArgs ; + } - // set text format args if they were specified - TextFormatArgs = textFormatArgs ; - } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // ConnectionTimeoutWebPublishMessage + // + this.Text = "Unable to establish a connection with the FTP server."; + this.Title = "Connection Timed Out"; - - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // ConnectionTimeoutWebPublishMessage - // - this.Text = "Unable to establish a connection with the FTP server."; - this.Title = "Connection Timed Out"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.FileDestinations/WebPublish/WebPublishMessages/FtpServerUnavailableWebPublishMessage.cs b/src/managed/OpenLiveWriter.FileDestinations/WebPublish/WebPublishMessages/FtpServerUnavailableWebPublishMessage.cs index ea592514..2ed7b7ab 100644 --- a/src/managed/OpenLiveWriter.FileDestinations/WebPublish/WebPublishMessages/FtpServerUnavailableWebPublishMessage.cs +++ b/src/managed/OpenLiveWriter.FileDestinations/WebPublish/WebPublishMessages/FtpServerUnavailableWebPublishMessage.cs @@ -3,40 +3,38 @@ namespace OpenLiveWriter.FileDestinations { - /// - /// Summary description for TargetPathNotFound. - /// - public class FtpServerUnavailableWebPublishMessage : WebPublishMessage - { + /// + /// Summary description for TargetPathNotFound. + /// + public class FtpServerUnavailableWebPublishMessage : WebPublishMessage + { + public FtpServerUnavailableWebPublishMessage(params object[] textFormatArgs) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - public FtpServerUnavailableWebPublishMessage(params object[] textFormatArgs) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + // set text format args if they were specified + TextFormatArgs = textFormatArgs ; + } - // set text format args if they were specified - TextFormatArgs = textFormatArgs ; - } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // FtpServerUnavailableWebPublishMessage + // + this.Text = "The specified hostname does not appear to be running an FTP server"; + this.Title = "FTP Server Unavailable"; - - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // FtpServerUnavailableWebPublishMessage - // - this.Text = "The specified hostname does not appear to be running an FTP server"; - this.Title = "FTP Server Unavailable"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.FileDestinations/WebPublish/WebPublishMessages/InvalidHostnameWebPublishMessage.cs b/src/managed/OpenLiveWriter.FileDestinations/WebPublish/WebPublishMessages/InvalidHostnameWebPublishMessage.cs index 1d77449e..24232e3c 100644 --- a/src/managed/OpenLiveWriter.FileDestinations/WebPublish/WebPublishMessages/InvalidHostnameWebPublishMessage.cs +++ b/src/managed/OpenLiveWriter.FileDestinations/WebPublish/WebPublishMessages/InvalidHostnameWebPublishMessage.cs @@ -3,40 +3,38 @@ namespace OpenLiveWriter.FileDestinations { - /// - /// Summary description for TargetPathNotFound. - /// - public class InvalidHostnameWebPublishMessage : WebPublishMessage - { + /// + /// Summary description for TargetPathNotFound. + /// + public class InvalidHostnameWebPublishMessage : WebPublishMessage + { + public InvalidHostnameWebPublishMessage(params object[] textFormatArgs) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - public InvalidHostnameWebPublishMessage(params object[] textFormatArgs) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + // set text format args if they were specified + TextFormatArgs = textFormatArgs ; + } - // set text format args if they were specified - TextFormatArgs = textFormatArgs ; - } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // InvalidHostnameWebPublishMessage + // + this.Text = "The specified hostname does not exist."; + this.Title = "Hostname Not Found"; - - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // InvalidHostnameWebPublishMessage - // - this.Text = "The specified hostname does not exist."; - this.Title = "Hostname Not Found"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.FileDestinations/WebPublish/WebPublishMessages/LoginFailedWebPublishMessage.cs b/src/managed/OpenLiveWriter.FileDestinations/WebPublish/WebPublishMessages/LoginFailedWebPublishMessage.cs index ab43a4c2..48575268 100644 --- a/src/managed/OpenLiveWriter.FileDestinations/WebPublish/WebPublishMessages/LoginFailedWebPublishMessage.cs +++ b/src/managed/OpenLiveWriter.FileDestinations/WebPublish/WebPublishMessages/LoginFailedWebPublishMessage.cs @@ -3,40 +3,38 @@ namespace OpenLiveWriter.FileDestinations { - /// - /// Summary description for TargetPathNotFound. - /// - public class LoginFailedWebPublishMessage : WebPublishMessage - { + /// + /// Summary description for TargetPathNotFound. + /// + public class LoginFailedWebPublishMessage : WebPublishMessage + { + public LoginFailedWebPublishMessage(params object[] textFormatArgs) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - public LoginFailedWebPublishMessage(params object[] textFormatArgs) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + // set text format args if they were specified + TextFormatArgs = textFormatArgs ; + } - // set text format args if they were specified - TextFormatArgs = textFormatArgs ; - } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // LoginFailedWebPublishMessage + // + this.Text = "Login failed. Please check your username and password."; + this.Title = "Login Failed"; - - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // LoginFailedWebPublishMessage - // - this.Text = "Login failed. Please check your username and password."; - this.Title = "Login Failed"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.FileDestinations/WebPublish/WebPublishMessages/NoSuchPublishFolderWebPublishMessage.cs b/src/managed/OpenLiveWriter.FileDestinations/WebPublish/WebPublishMessages/NoSuchPublishFolderWebPublishMessage.cs index 03a9ddc2..81c283e8 100644 --- a/src/managed/OpenLiveWriter.FileDestinations/WebPublish/WebPublishMessages/NoSuchPublishFolderWebPublishMessage.cs +++ b/src/managed/OpenLiveWriter.FileDestinations/WebPublish/WebPublishMessages/NoSuchPublishFolderWebPublishMessage.cs @@ -3,40 +3,38 @@ namespace OpenLiveWriter.FileDestinations { - /// - /// Summary description for TargetPathNotFound. - /// - public class NoSuchPublishFolderWebPublishMessage : WebPublishMessage - { + /// + /// Summary description for TargetPathNotFound. + /// + public class NoSuchPublishFolderWebPublishMessage : WebPublishMessage + { + public NoSuchPublishFolderWebPublishMessage(params object[] textFormatArgs) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - public NoSuchPublishFolderWebPublishMessage(params object[] textFormatArgs) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + // set text format args if they were specified + TextFormatArgs = textFormatArgs ; + } - // set text format args if they were specified - TextFormatArgs = textFormatArgs ; - } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // NoSuchPublishFolderWebPublishMessage + // + this.Text = "The specified publish folder does not exist."; + this.Title = "Publish Folder Does Not Exist"; - - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // NoSuchPublishFolderWebPublishMessage - // - this.Text = "The specified publish folder does not exist."; - this.Title = "Publish Folder Does Not Exist"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.FileDestinations/WebPublish/WebPublishMessages/PublishFailedWebPublishMessage.cs b/src/managed/OpenLiveWriter.FileDestinations/WebPublish/WebPublishMessages/PublishFailedWebPublishMessage.cs index 13d0fa7c..1935d00e 100644 --- a/src/managed/OpenLiveWriter.FileDestinations/WebPublish/WebPublishMessages/PublishFailedWebPublishMessage.cs +++ b/src/managed/OpenLiveWriter.FileDestinations/WebPublish/WebPublishMessages/PublishFailedWebPublishMessage.cs @@ -3,40 +3,38 @@ namespace OpenLiveWriter.FileDestinations { - /// - /// Summary description for TargetPathNotFound. - /// - public class PublishFailedWebPublishMessage : WebPublishMessage - { + /// + /// Summary description for TargetPathNotFound. + /// + public class PublishFailedWebPublishMessage : WebPublishMessage + { + public PublishFailedWebPublishMessage(params object[] textFormatArgs) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - public PublishFailedWebPublishMessage(params object[] textFormatArgs) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + // set text format args if they were specified + TextFormatArgs = textFormatArgs ; + } - // set text format args if they were specified - TextFormatArgs = textFormatArgs ; - } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // PublishFailedWebPublishMessage + // + this.Text = "A publishing error occurred: {0}"; + this.Title = "Publishing Error"; - - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // PublishFailedWebPublishMessage - // - this.Text = "A publishing error occurred: {0}"; - this.Title = "Publishing Error"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.FileDestinations/WebPublish/WebPublishSettings.cs b/src/managed/OpenLiveWriter.FileDestinations/WebPublish/WebPublishSettings.cs index 9873600e..557ae953 100644 --- a/src/managed/OpenLiveWriter.FileDestinations/WebPublish/WebPublishSettings.cs +++ b/src/managed/OpenLiveWriter.FileDestinations/WebPublish/WebPublishSettings.cs @@ -46,7 +46,6 @@ namespace OpenLiveWriter.FileDestinations } private WebPublishDestination webPublishDestination = new WebPublishDestination(null); - /// /// Publish path /// @@ -72,7 +71,6 @@ namespace OpenLiveWriter.FileDestinations } private string publishPath = String.Empty; - public string FullPublishPath { get @@ -118,20 +116,17 @@ namespace OpenLiveWriter.FileDestinations } } - /// /// Notify users that the publishing destination has changed /// public event EventHandler DestinationChanged; - /// /// Notify users that the publish folder has changed /// public event EventHandler PublishPathChanged; - /// /// Cleans up the file separators in a path name based on whether the current /// destination type is FTP or Windows. diff --git a/src/managed/OpenLiveWriter.FileDestinations/WebPublish/WebPublishUtils.cs b/src/managed/OpenLiveWriter.FileDestinations/WebPublish/WebPublishUtils.cs index 8b41c092..f4772abf 100644 --- a/src/managed/OpenLiveWriter.FileDestinations/WebPublish/WebPublishUtils.cs +++ b/src/managed/OpenLiveWriter.FileDestinations/WebPublish/WebPublishUtils.cs @@ -54,7 +54,6 @@ namespace OpenLiveWriter.FileDestinations return dest; } - /// /// Translate an exception into an error message /// diff --git a/src/managed/OpenLiveWriter.FileDestinations/WinInetFTPFileDestination.cs b/src/managed/OpenLiveWriter.FileDestinations/WinInetFTPFileDestination.cs index 6be7c44c..f4b9740b 100644 --- a/src/managed/OpenLiveWriter.FileDestinations/WinInetFTPFileDestination.cs +++ b/src/managed/OpenLiveWriter.FileDestinations/WinInetFTPFileDestination.cs @@ -51,7 +51,6 @@ namespace OpenLiveWriter.FileDestinations { } - /// /// FTP Destination constructor, specify FTP port. /// @@ -73,7 +72,6 @@ namespace OpenLiveWriter.FileDestinations m_ftpPort = ftpPort; } - /// /// FTP Destination constructor, specify FTP port. /// @@ -498,7 +496,6 @@ namespace OpenLiveWriter.FileDestinations } } - /// /// Disconnect from the FTP Server /// @@ -589,7 +586,6 @@ namespace OpenLiveWriter.FileDestinations } } - /// /// Throws the correct Site Destination exception for a given WinInet Error Code. /// This attempts to map common WinInet errors to corresponding Destination errors. diff --git a/src/managed/OpenLiveWriter.HtmlEditor/Commands/CommandSpellCheck.cs b/src/managed/OpenLiveWriter.HtmlEditor/Commands/CommandSpellCheck.cs index 53a8faf2..3c4879b2 100644 --- a/src/managed/OpenLiveWriter.HtmlEditor/Commands/CommandSpellCheck.cs +++ b/src/managed/OpenLiveWriter.HtmlEditor/Commands/CommandSpellCheck.cs @@ -6,67 +6,67 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.HtmlEditor.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandSpellCheck : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandCopy. + /// + public class CommandSpellCheck : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandSpellCheck(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public CommandSpellCheck(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - } + } - public CommandSpellCheck() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandSpellCheck() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - } + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandSpellCheck - // - this.ContextMenuPath = ""; - this.Identifier = "Onfolio.Core.HtmlEditor.Commands.SpellCheck"; - this.MainMenuPath = "Too&ls@9/Check &Spelling...@100"; - this.Shortcut = System.Windows.Forms.Shortcut.ShiftF7; - this.Text = "Check Spelling"; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandSpellCheck + // + this.ContextMenuPath = ""; + this.Identifier = "Onfolio.Core.HtmlEditor.Commands.SpellCheck"; + this.MainMenuPath = "Too&ls@9/Check &Spelling...@100"; + this.Shortcut = System.Windows.Forms.Shortcut.ShiftF7; + this.Text = "Check Spelling"; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.HtmlEditor/Controls/SourceCodeContextMenuDefinition.cs b/src/managed/OpenLiveWriter.HtmlEditor/Controls/SourceCodeContextMenuDefinition.cs index b39935f5..2c4a4adf 100644 --- a/src/managed/OpenLiveWriter.HtmlEditor/Controls/SourceCodeContextMenuDefinition.cs +++ b/src/managed/OpenLiveWriter.HtmlEditor/Controls/SourceCodeContextMenuDefinition.cs @@ -6,112 +6,112 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.HtmlEditor.Controls { - /// - /// Summary description for SourceCodeContextMenuDefinition. - /// - public class SourceCodeContextMenuDefinition : CommandContextMenuDefinition - { - private MenuDefinitionEntryCommand menuDefinitionEntryCommandCut; - private MenuDefinitionEntryCommand menuDefinitionEntryCommandCopy; - private MenuDefinitionEntryCommand menuDefinitionEntryCommandPaste; - private MenuDefinitionEntryCommand menuDefinitionEntryCommandPasteSpecial; - private MenuDefinitionEntryCommand menuDefinitionEntryCommandSelectAll; - private MenuDefinitionEntryCommand menuDefinitionEntryCommandInsertLink; + /// + /// Summary description for SourceCodeContextMenuDefinition. + /// + public class SourceCodeContextMenuDefinition : CommandContextMenuDefinition + { + private MenuDefinitionEntryCommand menuDefinitionEntryCommandCut; + private MenuDefinitionEntryCommand menuDefinitionEntryCommandCopy; + private MenuDefinitionEntryCommand menuDefinitionEntryCommandPaste; + private MenuDefinitionEntryCommand menuDefinitionEntryCommandPasteSpecial; + private MenuDefinitionEntryCommand menuDefinitionEntryCommandSelectAll; + private MenuDefinitionEntryCommand menuDefinitionEntryCommandInsertLink; - private IContainer components; + private IContainer components; - public SourceCodeContextMenuDefinition(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); - } + public SourceCodeContextMenuDefinition(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); + } - public SourceCodeContextMenuDefinition() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); - } + public SourceCodeContextMenuDefinition() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - this.menuDefinitionEntryCommandCut = new OpenLiveWriter.ApplicationFramework.MenuDefinitionEntryCommand(this.components); - this.menuDefinitionEntryCommandCopy = new OpenLiveWriter.ApplicationFramework.MenuDefinitionEntryCommand(this.components); - this.menuDefinitionEntryCommandPaste = new OpenLiveWriter.ApplicationFramework.MenuDefinitionEntryCommand(this.components); - this.menuDefinitionEntryCommandPasteSpecial = new OpenLiveWriter.ApplicationFramework.MenuDefinitionEntryCommand(this.components); - this.menuDefinitionEntryCommandSelectAll = new OpenLiveWriter.ApplicationFramework.MenuDefinitionEntryCommand(this.components); - this.menuDefinitionEntryCommandInsertLink = new OpenLiveWriter.ApplicationFramework.MenuDefinitionEntryCommand(this.components); - // - // menuDefinitionEntryCommandCut - // - this.menuDefinitionEntryCommandCut.CommandIdentifier = "MindShare.ApplicationCore.Commands.Cut"; - this.menuDefinitionEntryCommandCut.SeparatorAfter = false; - this.menuDefinitionEntryCommandCut.SeparatorBefore = false; - // - // menuDefinitionEntryCommandCopy - // - this.menuDefinitionEntryCommandCopy.CommandIdentifier = "MindShare.ApplicationCore.Commands.Copy"; - this.menuDefinitionEntryCommandCopy.SeparatorAfter = false; - this.menuDefinitionEntryCommandCopy.SeparatorBefore = false; - // - // menuDefinitionEntryCommandPaste - // - this.menuDefinitionEntryCommandPaste.CommandIdentifier = "MindShare.ApplicationCore.Commands.Paste"; - this.menuDefinitionEntryCommandPaste.SeparatorAfter = false; - this.menuDefinitionEntryCommandPaste.SeparatorBefore = false; - // - // menuDefinitionEntryCommandPasteSpecial - // - this.menuDefinitionEntryCommandPasteSpecial.CommandIdentifier = "MindShare.ApplicationCore.Commands.PasteSpecial"; - this.menuDefinitionEntryCommandPasteSpecial.SeparatorAfter = false; - this.menuDefinitionEntryCommandPasteSpecial.SeparatorBefore = false; - // - // menuDefinitionEntryCommandSelectAll - // - this.menuDefinitionEntryCommandSelectAll.CommandIdentifier = "MindShare.ApplicationCore.Commands.SelectAll"; - this.menuDefinitionEntryCommandSelectAll.SeparatorAfter = true; - this.menuDefinitionEntryCommandSelectAll.SeparatorBefore = true; - // - // menuDefinitionEntryCommandInsertLink - // - this.menuDefinitionEntryCommandInsertLink.CommandIdentifier = "OpenLiveWriter.ApplicationFramework.Commands.InsertLink"; - this.menuDefinitionEntryCommandInsertLink.SeparatorAfter = true; - this.menuDefinitionEntryCommandInsertLink.SeparatorBefore = true; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.menuDefinitionEntryCommandCut = new OpenLiveWriter.ApplicationFramework.MenuDefinitionEntryCommand(this.components); + this.menuDefinitionEntryCommandCopy = new OpenLiveWriter.ApplicationFramework.MenuDefinitionEntryCommand(this.components); + this.menuDefinitionEntryCommandPaste = new OpenLiveWriter.ApplicationFramework.MenuDefinitionEntryCommand(this.components); + this.menuDefinitionEntryCommandPasteSpecial = new OpenLiveWriter.ApplicationFramework.MenuDefinitionEntryCommand(this.components); + this.menuDefinitionEntryCommandSelectAll = new OpenLiveWriter.ApplicationFramework.MenuDefinitionEntryCommand(this.components); + this.menuDefinitionEntryCommandInsertLink = new OpenLiveWriter.ApplicationFramework.MenuDefinitionEntryCommand(this.components); + // + // menuDefinitionEntryCommandCut + // + this.menuDefinitionEntryCommandCut.CommandIdentifier = "MindShare.ApplicationCore.Commands.Cut"; + this.menuDefinitionEntryCommandCut.SeparatorAfter = false; + this.menuDefinitionEntryCommandCut.SeparatorBefore = false; + // + // menuDefinitionEntryCommandCopy + // + this.menuDefinitionEntryCommandCopy.CommandIdentifier = "MindShare.ApplicationCore.Commands.Copy"; + this.menuDefinitionEntryCommandCopy.SeparatorAfter = false; + this.menuDefinitionEntryCommandCopy.SeparatorBefore = false; + // + // menuDefinitionEntryCommandPaste + // + this.menuDefinitionEntryCommandPaste.CommandIdentifier = "MindShare.ApplicationCore.Commands.Paste"; + this.menuDefinitionEntryCommandPaste.SeparatorAfter = false; + this.menuDefinitionEntryCommandPaste.SeparatorBefore = false; + // + // menuDefinitionEntryCommandPasteSpecial + // + this.menuDefinitionEntryCommandPasteSpecial.CommandIdentifier = "MindShare.ApplicationCore.Commands.PasteSpecial"; + this.menuDefinitionEntryCommandPasteSpecial.SeparatorAfter = false; + this.menuDefinitionEntryCommandPasteSpecial.SeparatorBefore = false; + // + // menuDefinitionEntryCommandSelectAll + // + this.menuDefinitionEntryCommandSelectAll.CommandIdentifier = "MindShare.ApplicationCore.Commands.SelectAll"; + this.menuDefinitionEntryCommandSelectAll.SeparatorAfter = true; + this.menuDefinitionEntryCommandSelectAll.SeparatorBefore = true; + // + // menuDefinitionEntryCommandInsertLink + // + this.menuDefinitionEntryCommandInsertLink.CommandIdentifier = "OpenLiveWriter.ApplicationFramework.Commands.InsertLink"; + this.menuDefinitionEntryCommandInsertLink.SeparatorAfter = true; + this.menuDefinitionEntryCommandInsertLink.SeparatorBefore = true; - this.Entries.AddRange(new OpenLiveWriter.ApplicationFramework.MenuDefinitionEntry[] { - this.menuDefinitionEntryCommandCut, - this.menuDefinitionEntryCommandCopy, - this.menuDefinitionEntryCommandPaste, - this.menuDefinitionEntryCommandPasteSpecial, - this.menuDefinitionEntryCommandSelectAll, - this.menuDefinitionEntryCommandInsertLink}); + this.Entries.AddRange(new OpenLiveWriter.ApplicationFramework.MenuDefinitionEntry[] { + this.menuDefinitionEntryCommandCut, + this.menuDefinitionEntryCommandCopy, + this.menuDefinitionEntryCommandPaste, + this.menuDefinitionEntryCommandPasteSpecial, + this.menuDefinitionEntryCommandSelectAll, + this.menuDefinitionEntryCommandInsertLink}); - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.HtmlEditor/Debugging/StyleDebugger.cs b/src/managed/OpenLiveWriter.HtmlEditor/Debugging/StyleDebugger.cs index fdb7b8c2..2d0e31af 100644 --- a/src/managed/OpenLiveWriter.HtmlEditor/Debugging/StyleDebugger.cs +++ b/src/managed/OpenLiveWriter.HtmlEditor/Debugging/StyleDebugger.cs @@ -20,280 +20,278 @@ namespace OpenLiveWriter.HtmlEditor.Debugging #if DEBUG_STYLES - private ColumnHeader columnHeaderStyleName; - private ColumnHeader columnHeaderStyleValue; - private ListView listViewStyle; - private Button buttonLoad; - /// - /// Required designer variable. - /// - private Container components = null; + private ColumnHeader columnHeaderStyleName; + private ColumnHeader columnHeaderStyleValue; + private ListView listViewStyle; + private Button buttonLoad; + /// + /// Required designer variable. + /// + private Container components = null; - public StyleDebugger() - { - Init(); - } + public StyleDebugger() + { + Init(); + } - /*public StyleDebugger(IWin32Window parentFrame) : base(parentFrame) - { - Init(); + /*public StyleDebugger(IWin32Window parentFrame) : base(parentFrame) + { + Init(); - }*/ + }*/ - private void Init() - { - InitializeComponent(); - InitStyleItems(); - } + private void Init() + { + InitializeComponent(); + InitStyleItems(); + } - public static void ShowDebugger(IWin32Window parentFrame, MshtmlEditorEx editor) - { - StyleDebugger styleDebugger = new StyleDebugger(); - styleDebugger.MshtmlEditor = editor; - styleDebugger.Location = new Point(0, 0); - styleDebugger.Show(); - styleDebugger.BringToFront(); - } + public static void ShowDebugger(IWin32Window parentFrame, MshtmlEditorEx editor) + { + StyleDebugger styleDebugger = new StyleDebugger(); + styleDebugger.MshtmlEditor = editor; + styleDebugger.Location = new Point(0, 0); + styleDebugger.Show(); + styleDebugger.BringToFront(); + } #region Style list items - private void InitStyleItems() - { - //load the style list items - AddStyleItem("color", new StyleExtractor(GetColor)); - AddStyleItem("font-size", new StyleExtractor(GetFontSize)); - AddStyleItem("font-family", new StyleExtractor(GetFontFamily)); - AddStyleItem("font-style", new StyleExtractor(GetFontStyle)); - AddStyleItem("font-variant", new StyleExtractor(GetFontVariant)); - AddStyleItem("font-weight", new StyleExtractor(GetFontWeight)); - AddStyleItem("padding", new StyleExtractor(GetPadding)); - AddStyleItem("margin", new StyleExtractor(GetMargin)); - } - private delegate object StyleExtractor(IHTMLCurrentStyle style); + private void InitStyleItems() + { + //load the style list items + AddStyleItem("color", new StyleExtractor(GetColor)); + AddStyleItem("font-size", new StyleExtractor(GetFontSize)); + AddStyleItem("font-family", new StyleExtractor(GetFontFamily)); + AddStyleItem("font-style", new StyleExtractor(GetFontStyle)); + AddStyleItem("font-variant", new StyleExtractor(GetFontVariant)); + AddStyleItem("font-weight", new StyleExtractor(GetFontWeight)); + AddStyleItem("padding", new StyleExtractor(GetPadding)); + AddStyleItem("margin", new StyleExtractor(GetMargin)); + } + private delegate object StyleExtractor(IHTMLCurrentStyle style); - private object GetColor(IHTMLCurrentStyle style){ return style.color; } - private object GetFontSize(IHTMLCurrentStyle style){ return style.fontSize; } - private object GetFontFamily(IHTMLCurrentStyle style){ return style.fontFamily; } - private object GetFontStyle(IHTMLCurrentStyle style){ return style.fontStyle; } - private object GetFontVariant(IHTMLCurrentStyle style){ return style.fontVariant; } - private object GetFontWeight(IHTMLCurrentStyle style){ return style.fontWeight; } - private object GetPadding(IHTMLCurrentStyle style){ return style.padding; } - private object GetMargin(IHTMLCurrentStyle style){ return style.margin; } + private object GetColor(IHTMLCurrentStyle style){ return style.color; } + private object GetFontSize(IHTMLCurrentStyle style){ return style.fontSize; } + private object GetFontFamily(IHTMLCurrentStyle style){ return style.fontFamily; } + private object GetFontStyle(IHTMLCurrentStyle style){ return style.fontStyle; } + private object GetFontVariant(IHTMLCurrentStyle style){ return style.fontVariant; } + private object GetFontWeight(IHTMLCurrentStyle style){ return style.fontWeight; } + private object GetPadding(IHTMLCurrentStyle style){ return style.padding; } + private object GetMargin(IHTMLCurrentStyle style){ return style.margin; } - private void AddStyleItem(string name, StyleExtractor extractor) - { - listViewStyle.Items.Add(new StyleListItem(name, extractor)); - } + private void AddStyleItem(string name, StyleExtractor extractor) + { + listViewStyle.Items.Add(new StyleListItem(name, extractor)); + } - private void RefreshStyleItems(IHTMLCurrentStyle style) - { - //listViewStyle.BeginUpdate(); - foreach(StyleListItem item in listViewStyle.Items) - item.RefreshStyle(style); - //listViewStyle.EndUpdate(); - } + private void RefreshStyleItems(IHTMLCurrentStyle style) + { + //listViewStyle.BeginUpdate(); + foreach(StyleListItem item in listViewStyle.Items) + item.RefreshStyle(style); + //listViewStyle.EndUpdate(); + } #endregion - - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.listViewStyle = new System.Windows.Forms.ListView(); - this.columnHeaderStyleName = new System.Windows.Forms.ColumnHeader(); - this.columnHeaderStyleValue = new System.Windows.Forms.ColumnHeader(); - this.buttonLoad = new System.Windows.Forms.Button(); - this.SuspendLayout(); - // - // listViewStyle - // - this.listViewStyle.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.listViewStyle.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.columnHeaderStyleName, - this.columnHeaderStyleValue}); - this.listViewStyle.Location = new System.Drawing.Point(4, 4); - this.listViewStyle.Name = "listViewStyle"; - this.listViewStyle.Size = new System.Drawing.Size(284, 332); - this.listViewStyle.TabIndex = 0; - this.listViewStyle.View = System.Windows.Forms.View.Details; - // - // columnHeaderStyleName - // - this.columnHeaderStyleName.Text = "Attribute"; - this.columnHeaderStyleName.Width = 98; - // - // columnHeaderStyleValue - // - this.columnHeaderStyleValue.Text = "Value"; - this.columnHeaderStyleValue.Width = 149; - // - // buttonLoad - // - this.buttonLoad.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonLoad.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.buttonLoad.Location = new System.Drawing.Point(204, 344); - this.buttonLoad.Name = "buttonLoad"; - this.buttonLoad.TabIndex = 1; - this.buttonLoad.Text = "Load Style"; - this.buttonLoad.Click += new System.EventHandler(this.buttonLoad_Click); - // - // StyleDebugger - // - this.AutoScaleBaseSize = new System.Drawing.Size(5, 14); - this.ClientSize = new System.Drawing.Size(292, 374); - this.Controls.Add(this.buttonLoad); - this.Controls.Add(this.listViewStyle); - this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.Name = "StyleDebugger"; - this.Text = "StyleDebugger"; - this.ResumeLayout(false); + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.listViewStyle = new System.Windows.Forms.ListView(); + this.columnHeaderStyleName = new System.Windows.Forms.ColumnHeader(); + this.columnHeaderStyleValue = new System.Windows.Forms.ColumnHeader(); + this.buttonLoad = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // listViewStyle + // + this.listViewStyle.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.listViewStyle.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.columnHeaderStyleName, + this.columnHeaderStyleValue}); + this.listViewStyle.Location = new System.Drawing.Point(4, 4); + this.listViewStyle.Name = "listViewStyle"; + this.listViewStyle.Size = new System.Drawing.Size(284, 332); + this.listViewStyle.TabIndex = 0; + this.listViewStyle.View = System.Windows.Forms.View.Details; + // + // columnHeaderStyleName + // + this.columnHeaderStyleName.Text = "Attribute"; + this.columnHeaderStyleName.Width = 98; + // + // columnHeaderStyleValue + // + this.columnHeaderStyleValue.Text = "Value"; + this.columnHeaderStyleValue.Width = 149; + // + // buttonLoad + // + this.buttonLoad.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.buttonLoad.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.buttonLoad.Location = new System.Drawing.Point(204, 344); + this.buttonLoad.Name = "buttonLoad"; + this.buttonLoad.TabIndex = 1; + this.buttonLoad.Text = "Load Style"; + this.buttonLoad.Click += new System.EventHandler(this.buttonLoad_Click); + // + // StyleDebugger + // + this.AutoScaleBaseSize = new System.Drawing.Size(5, 14); + this.ClientSize = new System.Drawing.Size(292, 374); + this.Controls.Add(this.buttonLoad); + this.Controls.Add(this.listViewStyle); + this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); + this.Name = "StyleDebugger"; + this.Text = "StyleDebugger"; + this.ResumeLayout(false); - } + } #endregion - public MshtmlEditorEx MshtmlEditor - { - get { return mshtmlEditor; } - set { mshtmlEditor = value; } - } - private MshtmlEditorEx mshtmlEditor; + public MshtmlEditorEx MshtmlEditor + { + get { return mshtmlEditor; } + set { mshtmlEditor = value; } + } + private MshtmlEditorEx mshtmlEditor; - private void buttonLoad_Click(object sender, EventArgs e) - { - MarkupRange selection = GetSelectedMarkupRange(); - if(selection.IsEmpty()) - { - this.listViewStyle.Enabled = true; + private void buttonLoad_Click(object sender, EventArgs e) + { + MarkupRange selection = GetSelectedMarkupRange(); + if(selection.IsEmpty()) + { + this.listViewStyle.Enabled = true; - IHTMLElement2 element = (IHTMLElement2)selection.Start.CurrentScope; - IHTMLCurrentStyle style = element.currentStyle; - RefreshStyleItems(style); - } - else - { - this.listViewStyle.Enabled = false; - } - } + IHTMLElement2 element = (IHTMLElement2)selection.Start.CurrentScope; + IHTMLCurrentStyle style = element.currentStyle; + RefreshStyleItems(style); + } + else + { + this.listViewStyle.Enabled = false; + } + } - private MshtmlMarkupServices MarkupServices - { - get - { - return mshtmlEditor.MshtmlControl.MarkupServices; - } - } + private MshtmlMarkupServices MarkupServices + { + get + { + return mshtmlEditor.MshtmlControl.MarkupServices; + } + } - private IHTMLDocument2 HTMLDocument - { - get - { - return mshtmlEditor.HTMLDocument; - } - } + private IHTMLDocument2 HTMLDocument + { + get + { + return mshtmlEditor.HTMLDocument; + } + } - /// - /// Get current selection pointers - /// - /// selection pointers - public MarkupRange GetSelectedMarkupRange() - { - return MarkupServices.CreateMarkupRange( SelectedRange ) ; - } + /// + /// Get current selection pointers + /// + /// selection pointers + public MarkupRange GetSelectedMarkupRange() + { + return MarkupServices.CreateMarkupRange( SelectedRange ) ; + } + /// + /// Currently selected range (null if there is no selection) + /// + private IHTMLTxtRange SelectedRange + { + get + { + // get hte selection + IHTMLSelectionObject selection = HTMLDocument.selection ; + if ( selection == null ) + { + return null ; + } - /// - /// Currently selected range (null if there is no selection) - /// - private IHTMLTxtRange SelectedRange - { - get - { - // get hte selection - IHTMLSelectionObject selection = HTMLDocument.selection ; - if ( selection == null ) - { - return null ; - } + // see what type of range is selected + object range = selection.createRange() ; + if ( range is IHTMLTxtRange ) + { + return range as IHTMLTxtRange ; + } + else if ( range is IHTMLControlRange ) + { + // we only support single-selection so a "control-range" can always + // be converted into a single-element text range + IHTMLControlRange controlRange = range as IHTMLControlRange ; + if ( controlRange.length == 1) + { + //bug fix 1793: use markup services to select the range of markup because the + //IHTMLTxtRange.moveToElementText() operation doesn't create a reasonable + //selection range for selections within an anchor (thumbnails, etc) + IHTMLElement selectedElement = controlRange.item(0); + MarkupRange markupRange = MarkupServices.CreateMarkupRange(selectedElement); + if(selectedElement.parentElement.tagName == "A") + { + //expand the selection to include the anchor if there is no content between + //the selected element and its anchor. + markupRange.MoveOutwardIfNoContent(); + } - // see what type of range is selected - object range = selection.createRange() ; - if ( range is IHTMLTxtRange ) - { - return range as IHTMLTxtRange ; - } - else if ( range is IHTMLControlRange ) - { - // we only support single-selection so a "control-range" can always - // be converted into a single-element text range - IHTMLControlRange controlRange = range as IHTMLControlRange ; - if ( controlRange.length == 1) - { - //bug fix 1793: use markup services to select the range of markup because the - //IHTMLTxtRange.moveToElementText() operation doesn't create a reasonable - //selection range for selections within an anchor (thumbnails, etc) - IHTMLElement selectedElement = controlRange.item(0); - MarkupRange markupRange = MarkupServices.CreateMarkupRange(selectedElement); - if(selectedElement.parentElement.tagName == "A") - { - //expand the selection to include the anchor if there is no content between - //the selected element and its anchor. - markupRange.MoveOutwardIfNoContent(); - } + //return the precisely positioned text range + return markupRange.ToTextRange(); + } + else + { + Debug.Fail( "Length of control range not equal to 1 (value was " + controlRange.length.ToString() ) ; + return null ; + } + } + else // null or unexpected range type + { + return null ; + } + } + } + private class StyleListItem : ListViewItem + { + string _name; + StyleExtractor _extractor; + public StyleListItem(string name, StyleExtractor extractor) + { + _name = name; + _extractor = extractor; + SubItems.Add(""); + SubItems.Add(""); + } - //return the precisely positioned text range - return markupRange.ToTextRange(); - } - else - { - Debug.Fail( "Length of control range not equal to 1 (value was " + controlRange.length.ToString() ) ; - return null ; - } - } - else // null or unexpected range type - { - return null ; - } - } - } - private class StyleListItem : ListViewItem - { - string _name; - StyleExtractor _extractor; - public StyleListItem(string name, StyleExtractor extractor) - { - _name = name; - _extractor = extractor; - SubItems.Add(""); - SubItems.Add(""); - } - - public void RefreshStyle(IHTMLCurrentStyle style) - { - object val = _extractor(style); - SubItems[0].Text = _name; - SubItems[1].Text = val != null ? val.ToString() : ""; - } - } + public void RefreshStyle(IHTMLCurrentStyle style) + { + object val = _extractor(style); + SubItems[0].Text = _name; + SubItems[1].Text = val != null ? val.ToString() : ""; + } + } #endif } diff --git a/src/managed/OpenLiveWriter.HtmlEditor/DisplayMessages/FinishedSearchingDocumentDisplayMessage.cs b/src/managed/OpenLiveWriter.HtmlEditor/DisplayMessages/FinishedSearchingDocumentDisplayMessage.cs index 3a19f95b..e352dd4c 100644 --- a/src/managed/OpenLiveWriter.HtmlEditor/DisplayMessages/FinishedSearchingDocumentDisplayMessage.cs +++ b/src/managed/OpenLiveWriter.HtmlEditor/DisplayMessages/FinishedSearchingDocumentDisplayMessage.cs @@ -9,61 +9,61 @@ using OpenLiveWriter.Controls; namespace OpenLiveWriter.HtmlEditor.DisplayMessages { - public class FinishedSearchingDocumentDisplayMessage : DisplayMessage - { - /// - /// Required designer variable. - /// - private Container components = null; + public class FinishedSearchingDocumentDisplayMessage : DisplayMessage + { + /// + /// Required designer variable. + /// + private Container components = null; - public FinishedSearchingDocumentDisplayMessage(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public FinishedSearchingDocumentDisplayMessage(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - } + } - public FinishedSearchingDocumentDisplayMessage() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public FinishedSearchingDocumentDisplayMessage() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - } + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // FinishedSearchingDocumentDisplayMessage - // - this.Text = "Finished searching the document."; - this.Title = "Find"; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // FinishedSearchingDocumentDisplayMessage + // + this.Text = "Finished searching the document."; + this.Title = "Find"; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.HtmlEditor/DisplayMessages/NotLinkableDisplayMessage.cs b/src/managed/OpenLiveWriter.HtmlEditor/DisplayMessages/NotLinkableDisplayMessage.cs index ef81f504..84783763 100644 --- a/src/managed/OpenLiveWriter.HtmlEditor/DisplayMessages/NotLinkableDisplayMessage.cs +++ b/src/managed/OpenLiveWriter.HtmlEditor/DisplayMessages/NotLinkableDisplayMessage.cs @@ -10,63 +10,63 @@ using OpenLiveWriter.Controls; namespace OpenLiveWriter.HtmlEditor.DisplayMessages { - public class NotLinkableDisplayMessage : DisplayMessage - { - /// - /// Required designer variable. - /// - private Container components = null; + public class NotLinkableDisplayMessage : DisplayMessage + { + /// + /// Required designer variable. + /// + private Container components = null; - public NotLinkableDisplayMessage(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public NotLinkableDisplayMessage(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - } + } - public NotLinkableDisplayMessage() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public NotLinkableDisplayMessage() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - } + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // NotLinkableDisplayMessage - // - this.Type = DisplayMessageType.Information; - this.Buttons = MessageBoxButtons.OK; - this.Text = "Your selection cannot be hyperlinked. Please select text, or click on an image."; - this.Title = "Cannot Add Link to Selection"; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // NotLinkableDisplayMessage + // + this.Type = DisplayMessageType.Information; + this.Buttons = MessageBoxButtons.OK; + this.Text = "Your selection cannot be hyperlinked. Please select text, or click on an image."; + this.Title = "Cannot Add Link to Selection"; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.HtmlEditor/DisplayMessages/PasteSpecialInvalidDataDisplayMessage.cs b/src/managed/OpenLiveWriter.HtmlEditor/DisplayMessages/PasteSpecialInvalidDataDisplayMessage.cs index 8651247e..5bb4af45 100644 --- a/src/managed/OpenLiveWriter.HtmlEditor/DisplayMessages/PasteSpecialInvalidDataDisplayMessage.cs +++ b/src/managed/OpenLiveWriter.HtmlEditor/DisplayMessages/PasteSpecialInvalidDataDisplayMessage.cs @@ -6,72 +6,72 @@ using OpenLiveWriter.Controls; namespace OpenLiveWriter.HtmlEditor.DisplayMessages { - /// - /// Summary description for PasteSpecialInvalidDataDisplayMessage. - /// - public class PasteSpecialInvalidDataDisplayMessage : DisplayMessage - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for PasteSpecialInvalidDataDisplayMessage. + /// + public class PasteSpecialInvalidDataDisplayMessage : DisplayMessage + { + /// + /// Required designer variable. + /// + private Container components = null; - public PasteSpecialInvalidDataDisplayMessage(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public PasteSpecialInvalidDataDisplayMessage(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - // - // - // - } + // + // + // + } - public PasteSpecialInvalidDataDisplayMessage() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public PasteSpecialInvalidDataDisplayMessage() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // PasteSpecialInvalidDataDisplayMessage - // - this.Buttons = System.Windows.Forms.MessageBoxButtons.OK; - this.Text = "Paste Special can only be used with HTML and text data."; - this.Title = "Invalid Data Selection"; - this.Type = DisplayMessageType.Information; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // PasteSpecialInvalidDataDisplayMessage + // + this.Buttons = System.Windows.Forms.MessageBoxButtons.OK; + this.Text = "Paste Special can only be used with HTML and text data."; + this.Title = "Invalid Data Selection"; + this.Type = DisplayMessageType.Information; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.HtmlEditor/EditorLinkNavigator.cs b/src/managed/OpenLiveWriter.HtmlEditor/EditorLinkNavigator.cs index f0894f4c..1c6d6c97 100644 --- a/src/managed/OpenLiveWriter.HtmlEditor/EditorLinkNavigator.cs +++ b/src/managed/OpenLiveWriter.HtmlEditor/EditorLinkNavigator.cs @@ -192,7 +192,6 @@ namespace OpenLiveWriter.HtmlEditor } } - /// /// Handle TranslateAccelerator to update feedback on cursor and to clear the /// tooltip for ALT-TAB, CTL-HOME, etc. @@ -268,7 +267,6 @@ namespace OpenLiveWriter.HtmlEditor } } - /// /// Clear any existing link feedback /// @@ -294,7 +292,6 @@ namespace OpenLiveWriter.HtmlEditor UpdateCursor(); } - /// /// Update the status bar /// @@ -415,7 +412,6 @@ namespace OpenLiveWriter.HtmlEditor } } - /// /// Gets the parent link element (if any) for the passed element /// @@ -470,7 +466,6 @@ namespace OpenLiveWriter.HtmlEditor public readonly IHTMLElement DelayElement; } - /// /// editor context we are attached to /// diff --git a/src/managed/OpenLiveWriter.HtmlEditor/HtmlEditorControl.cs b/src/managed/OpenLiveWriter.HtmlEditor/HtmlEditorControl.cs index 8cc619c7..4d70f960 100644 --- a/src/managed/OpenLiveWriter.HtmlEditor/HtmlEditorControl.cs +++ b/src/managed/OpenLiveWriter.HtmlEditor/HtmlEditorControl.cs @@ -439,7 +439,6 @@ namespace OpenLiveWriter.HtmlEditor } } - /// /// Returns the Html generation service. /// @@ -1034,7 +1033,6 @@ namespace OpenLiveWriter.HtmlEditor # region Command Initialization - private IMshtmlCommand GetMshtmlCommand(uint key) { return _mshtmlEditor.Commands[key] as IMshtmlCommand; @@ -1164,7 +1162,7 @@ namespace OpenLiveWriter.HtmlEditor mshtmlEditorDragAndDropTarget.Initialize(EditorControl); #if DEBUG_STYLES - // StyleDebugger.ShowDebugger(_mainFrameWindow, MshtmlEditor); + // StyleDebugger.ShowDebugger(_mainFrameWindow, MshtmlEditor); #endif // one-time init _initialDocumentLoaded = true; @@ -1280,9 +1278,8 @@ namespace OpenLiveWriter.HtmlEditor // global processing for Mouse Up (none for the time being ) } - #if SELECTION_DEBUG - private SelectionDebugDialog SelectionDebugDialog; + private SelectionDebugDialog SelectionDebugDialog; #endif private void DocumentEvents_SelectionChanged(object sender, EventArgs e) { @@ -1482,10 +1479,8 @@ namespace OpenLiveWriter.HtmlEditor ele.innerHTML = CurrentDefaultFont.ApplyFont(""); } - IHTMLElement finalElement = FindFontElement(true); - if (finalElement == null) { finalElement = FindFontElement(false); @@ -1581,7 +1576,6 @@ namespace OpenLiveWriter.HtmlEditor } - #endregion #region Spell Checking Helpers @@ -1693,7 +1687,6 @@ namespace OpenLiveWriter.HtmlEditor } } - protected MarkupRange CleanUpRange() { MarkupRange mRange = null; @@ -2650,7 +2643,6 @@ namespace OpenLiveWriter.HtmlEditor start.PopGravity(); } - if (allowNewLineInsert && TidyWhitespace) { try @@ -3231,7 +3223,6 @@ namespace OpenLiveWriter.HtmlEditor } } - public virtual void EmptySelection() { if (HTMLDocument.readyState == "complete" && HTMLDocument.selection != null) @@ -4795,7 +4786,6 @@ namespace OpenLiveWriter.HtmlEditor } } - MshtmlMarkupServices IHtmlEditorComponentContext.MarkupServices { get @@ -5040,7 +5030,6 @@ namespace OpenLiveWriter.HtmlEditor } } - public void Undo() { try @@ -5255,7 +5244,6 @@ namespace OpenLiveWriter.HtmlEditor GetMshtmlCommand(IDM.COPY).Execute(); } - private static bool ClipboardHasData { get diff --git a/src/managed/OpenLiveWriter.HtmlEditor/HtmlEditorElementBehavior.cs b/src/managed/OpenLiveWriter.HtmlEditor/HtmlEditorElementBehavior.cs index 1d9165bb..0d6bfb88 100644 --- a/src/managed/OpenLiveWriter.HtmlEditor/HtmlEditorElementBehavior.cs +++ b/src/managed/OpenLiveWriter.HtmlEditor/HtmlEditorElementBehavior.cs @@ -39,7 +39,6 @@ namespace OpenLiveWriter.HtmlEditor UpdateSelectionState(); } - public bool Selected { get diff --git a/src/managed/OpenLiveWriter.HtmlEditor/HtmlEditorElementBehaviorManager.cs b/src/managed/OpenLiveWriter.HtmlEditor/HtmlEditorElementBehaviorManager.cs index 30a8952a..003e91ae 100644 --- a/src/managed/OpenLiveWriter.HtmlEditor/HtmlEditorElementBehaviorManager.cs +++ b/src/managed/OpenLiveWriter.HtmlEditor/HtmlEditorElementBehaviorManager.cs @@ -10,119 +10,118 @@ using mshtml; namespace Onfolio.Core.HtmlEditor { - public class HtmlEditorElementBehaviorManager : IDisposable - { - public HtmlEditorElementBehaviorManager(IHtmlEditorComponentContext editorContext) - { - _editorContext = editorContext ; - _editorContext.SelectionChanged +=new EventHandler(_editorContext_SelectionChanged); - } + public class HtmlEditorElementBehaviorManager : IDisposable + { + public HtmlEditorElementBehaviorManager(IHtmlEditorComponentContext editorContext) + { + _editorContext = editorContext ; + _editorContext.SelectionChanged +=new EventHandler(_editorContext_SelectionChanged); + } - public void Dispose() - { - if ( _activeBehaviors != null ) - { - _editorContext.SelectionChanged -=new EventHandler(_editorContext_SelectionChanged); + public void Dispose() + { + if ( _activeBehaviors != null ) + { + _editorContext.SelectionChanged -=new EventHandler(_editorContext_SelectionChanged); - // all of the elements left in the activeBehaviors list are no longer in the document - // so we should dispose and remove them from the list - foreach ( HtmlEditorElementBehavior elementBehavior in _activeBehaviors.Values ) - elementBehavior.DetachFromElement(); - _activeBehaviors.Clear(); - _activeBehaviors = null ; - } - } + // all of the elements left in the activeBehaviors list are no longer in the document + // so we should dispose and remove them from the list + foreach ( HtmlEditorElementBehavior elementBehavior in _activeBehaviors.Values ) + elementBehavior.DetachFromElement(); + _activeBehaviors.Clear(); + _activeBehaviors = null ; + } + } - public void RegisterBehavior( string appliesToTag, Type behaviorType ) - { - lock(this) - { - _globalElementBehaviors[appliesToTag] = behaviorType ; - } - } + public void RegisterBehavior( string appliesToTag, Type behaviorType ) + { + lock(this) + { + _globalElementBehaviors[appliesToTag] = behaviorType ; + } + } - public void RegisterBehavior( IHTMLElement element, HtmlEditorElementBehavior behavior) - { - lock(this) - { - _activeBehaviors[element] = behavior; - _elementBehaviors[element] = behavior; - } - } + public void RegisterBehavior( IHTMLElement element, HtmlEditorElementBehavior behavior) + { + lock(this) + { + _activeBehaviors[element] = behavior; + _elementBehaviors[element] = behavior; + } + } - public void RefreshBehaviors(IHTMLDocument2 document) - { - lock(this) - { - // get interface needed for element enumeration - IHTMLDocument3 document3 = (IHTMLDocument3)document ; + public void RefreshBehaviors(IHTMLDocument2 document) + { + lock(this) + { + // get interface needed for element enumeration + IHTMLDocument3 document3 = (IHTMLDocument3)document ; - // build new list of active behaviors - Hashtable newActiveBehaviors = new Hashtable(); + // build new list of active behaviors + Hashtable newActiveBehaviors = new Hashtable(); - //register global behaviors - IDictionaryEnumerator behaviorEnumerator = _globalElementBehaviors.GetEnumerator() ; - while (behaviorEnumerator.MoveNext()) - { - string tagName = (string)behaviorEnumerator.Key ; - foreach( IHTMLElement element in document3.getElementsByTagName(tagName)) - { - // if the element is already assigned an active behavior then move it - if ( _activeBehaviors.ContainsKey(element) ) - { - newActiveBehaviors[element] = _activeBehaviors[element] ; - _activeBehaviors.Remove(element); - } - else // otherwise create a new behavior and add it - { - HtmlEditorElementBehavior elementBehavior = (HtmlEditorElementBehavior)Activator.CreateInstance( - (Type)behaviorEnumerator.Value, new object[] { element, _editorContext} ) ; - newActiveBehaviors[element] = elementBehavior ; - } - } - } + //register global behaviors + IDictionaryEnumerator behaviorEnumerator = _globalElementBehaviors.GetEnumerator() ; + while (behaviorEnumerator.MoveNext()) + { + string tagName = (string)behaviorEnumerator.Key ; + foreach( IHTMLElement element in document3.getElementsByTagName(tagName)) + { + // if the element is already assigned an active behavior then move it + if ( _activeBehaviors.ContainsKey(element) ) + { + newActiveBehaviors[element] = _activeBehaviors[element] ; + _activeBehaviors.Remove(element); + } + else // otherwise create a new behavior and add it + { + HtmlEditorElementBehavior elementBehavior = (HtmlEditorElementBehavior)Activator.CreateInstance( + (Type)behaviorEnumerator.Value, new object[] { element, _editorContext} ) ; + newActiveBehaviors[element] = elementBehavior ; + } + } + } - //register element behaviors - behaviorEnumerator = _elementBehaviors.GetEnumerator() ; - while (behaviorEnumerator.MoveNext()) - { - IHTMLElement element = (IHTMLElement)behaviorEnumerator.Key ; - // if the element is already assigned an active behavior then move it - if ( _activeBehaviors.ContainsKey(element) ) - { - newActiveBehaviors[element] = _activeBehaviors[element] ; - _activeBehaviors.Remove(element); - } - else // otherwise create a new behavior and add it - { - Debug.Fail("illegal state: element behavior is not in the _activeBehaviors table"); - } - } + //register element behaviors + behaviorEnumerator = _elementBehaviors.GetEnumerator() ; + while (behaviorEnumerator.MoveNext()) + { + IHTMLElement element = (IHTMLElement)behaviorEnumerator.Key ; + // if the element is already assigned an active behavior then move it + if ( _activeBehaviors.ContainsKey(element) ) + { + newActiveBehaviors[element] = _activeBehaviors[element] ; + _activeBehaviors.Remove(element); + } + else // otherwise create a new behavior and add it + { + Debug.Fail("illegal state: element behavior is not in the _activeBehaviors table"); + } + } - // all of the elements left in the activeBehaviors list are no longer in the document - // so we should dispose and remove them from the list - foreach ( HtmlEditorElementBehavior elementBehavior in _activeBehaviors.Values ) - elementBehavior.DetachFromElement(); - _activeBehaviors.Clear(); + // all of the elements left in the activeBehaviors list are no longer in the document + // so we should dispose and remove them from the list + foreach ( HtmlEditorElementBehavior elementBehavior in _activeBehaviors.Values ) + elementBehavior.DetachFromElement(); + _activeBehaviors.Clear(); - // swap for new list - _activeBehaviors = newActiveBehaviors ; - } - } + // swap for new list + _activeBehaviors = newActiveBehaviors ; + } + } + private void _editorContext_SelectionChanged(object sender, EventArgs e) + { + // update 'active' state of behaviors based on whether they contain the selection + MarkupRange selectedRange = _editorContext.GetSelectedMarkupRange() ; + foreach ( HtmlEditorElementBehavior elementBehavior in _activeBehaviors.Values ) + elementBehavior.SelectionChanged(selectedRange); + } - private void _editorContext_SelectionChanged(object sender, EventArgs e) - { - // update 'active' state of behaviors based on whether they contain the selection - MarkupRange selectedRange = _editorContext.GetSelectedMarkupRange() ; - foreach ( HtmlEditorElementBehavior elementBehavior in _activeBehaviors.Values ) - elementBehavior.SelectionChanged(selectedRange); - } + private Hashtable _globalElementBehaviors = new Hashtable(); + private Hashtable _elementBehaviors = new Hashtable(); + private Hashtable _activeBehaviors = new Hashtable(); + private IHtmlEditorComponentContext _editorContext; - private Hashtable _globalElementBehaviors = new Hashtable(); - private Hashtable _elementBehaviors = new Hashtable(); - private Hashtable _activeBehaviors = new Hashtable(); - private IHtmlEditorComponentContext _editorContext; - - } + } } diff --git a/src/managed/OpenLiveWriter.HtmlEditor/HtmlSourceEditorFindTextForm.cs b/src/managed/OpenLiveWriter.HtmlEditor/HtmlSourceEditorFindTextForm.cs index 5c842844..1d092273 100644 --- a/src/managed/OpenLiveWriter.HtmlEditor/HtmlSourceEditorFindTextForm.cs +++ b/src/managed/OpenLiveWriter.HtmlEditor/HtmlSourceEditorFindTextForm.cs @@ -71,7 +71,6 @@ namespace OpenLiveWriter.HtmlEditor DisplayHelper.AutoFitSystemRadioButton(radioButtonUp, 0, int.MaxValue); radioButtonDown.Left = radioButtonUp.Right + distance; - using (new AutoGrow(this, AnchorStyles.Bottom | AnchorStyles.Right, false)) { int oldTop = radioButtonDown.Top; @@ -82,9 +81,9 @@ namespace OpenLiveWriter.HtmlEditor } /// - /// Clean up any resources being used. - /// - protected override void Dispose(bool disposing) + /// Clean up any resources being used. + /// + protected override void Dispose(bool disposing) { if (disposing) { @@ -96,7 +95,6 @@ namespace OpenLiveWriter.HtmlEditor base.Dispose(disposing); } - private void textBoxFindWhat_TextChanged(object sender, System.EventArgs e) { buttonFindNext.Enabled = textBoxFindWhat.Text.Length != 0; @@ -245,6 +243,5 @@ namespace OpenLiveWriter.HtmlEditor } #endregion - } } diff --git a/src/managed/OpenLiveWriter.HtmlEditor/IHtmlEditorComponentContext.cs b/src/managed/OpenLiveWriter.HtmlEditor/IHtmlEditorComponentContext.cs index 20a36645..3a999a78 100644 --- a/src/managed/OpenLiveWriter.HtmlEditor/IHtmlEditorComponentContext.cs +++ b/src/managed/OpenLiveWriter.HtmlEditor/IHtmlEditorComponentContext.cs @@ -256,7 +256,5 @@ namespace OpenLiveWriter.HtmlEditor public delegate void HtmlEditorSelectionOperationEventHandler(HtmlEditorSelectionOperationEventArgs ea); - } - diff --git a/src/managed/OpenLiveWriter.HtmlEditor/Linking/Commands/CommandAddToGlossary.cs b/src/managed/OpenLiveWriter.HtmlEditor/Linking/Commands/CommandAddToGlossary.cs index 7ccdad59..6fc6f437 100644 --- a/src/managed/OpenLiveWriter.HtmlEditor/Linking/Commands/CommandAddToGlossary.cs +++ b/src/managed/OpenLiveWriter.HtmlEditor/Linking/Commands/CommandAddToGlossary.cs @@ -7,56 +7,55 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.HtmlEditor.Linking.Commands { - /// - /// Summary description for CommandAddToGlossary. - /// - public class CommandAddToGlossary : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandAddToGlossary. + /// + public class CommandAddToGlossary : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandAddToGlossary(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandAddToGlossary(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandAddToGlossary() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandAddToGlossary() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandAddToGlossary - // - this.ContextMenuPath = "&Add to Glossary@104"; - this.Identifier = "OpenLiveWriter.HtmlEditor.Linking.Commands.CommandAddToGlossary"; - this.Text = "Add To Glossary"; - this.MenuText = "&Add to Glossary"; - } - #endregion - } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandAddToGlossary + // + this.ContextMenuPath = "&Add to Glossary@104"; + this.Identifier = "OpenLiveWriter.HtmlEditor.Linking.Commands.CommandAddToGlossary"; + this.Text = "Add To Glossary"; + this.MenuText = "&Add to Glossary"; + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.HtmlEditor/Linking/DisplayMessages/AlertNoEntryDisplayMessage.cs b/src/managed/OpenLiveWriter.HtmlEditor/Linking/DisplayMessages/AlertNoEntryDisplayMessage.cs index c4f7f5b7..ceaa1047 100644 --- a/src/managed/OpenLiveWriter.HtmlEditor/Linking/DisplayMessages/AlertNoEntryDisplayMessage.cs +++ b/src/managed/OpenLiveWriter.HtmlEditor/Linking/DisplayMessages/AlertNoEntryDisplayMessage.cs @@ -7,65 +7,65 @@ using OpenLiveWriter.Controls; namespace OpenLiveWriter.HtmlEditor.Linking.DisplayMessages { - /// - /// Summary description for AlertNoEntryDisplayMessage. - /// - public class AlertNoEntryDisplayMessage : DisplayMessage - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for AlertNoEntryDisplayMessage. + /// + public class AlertNoEntryDisplayMessage : DisplayMessage + { + /// + /// Required designer variable. + /// + private Container components = null; - public AlertNoEntryDisplayMessage(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public AlertNoEntryDisplayMessage(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - } + } - public AlertNoEntryDisplayMessage() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); - } + public AlertNoEntryDisplayMessage() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // AlertNoEntryDisplayMessage - // - this.Buttons = System.Windows.Forms.MessageBoxButtons.OK; - this.Text = "There is no glossary entry for that link term."; - this.Title = "No Entry Found"; - this.Type = DisplayMessageType.Information; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // AlertNoEntryDisplayMessage + // + this.Buttons = System.Windows.Forms.MessageBoxButtons.OK; + this.Text = "There is no glossary entry for that link term."; + this.Title = "No Entry Found"; + this.Type = DisplayMessageType.Information; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.HtmlEditor/Linking/DisplayMessages/ConfirmDeleteEntryDisplayMessage.cs b/src/managed/OpenLiveWriter.HtmlEditor/Linking/DisplayMessages/ConfirmDeleteEntryDisplayMessage.cs index 9c34d478..019b686c 100644 --- a/src/managed/OpenLiveWriter.HtmlEditor/Linking/DisplayMessages/ConfirmDeleteEntryDisplayMessage.cs +++ b/src/managed/OpenLiveWriter.HtmlEditor/Linking/DisplayMessages/ConfirmDeleteEntryDisplayMessage.cs @@ -7,65 +7,65 @@ using OpenLiveWriter.Controls; namespace OpenLiveWriter.HtmlEditor.Linking.DisplayMessages { - /// - /// Summary description for ConfirmDeleteEntryDisplayMessage. - /// - public class ConfirmDeleteEntryDisplayMessage : DisplayMessage - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for ConfirmDeleteEntryDisplayMessage. + /// + public class ConfirmDeleteEntryDisplayMessage : DisplayMessage + { + /// + /// Required designer variable. + /// + private Container components = null; - public ConfirmDeleteEntryDisplayMessage(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public ConfirmDeleteEntryDisplayMessage(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - } + } - public ConfirmDeleteEntryDisplayMessage() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); - } + public ConfirmDeleteEntryDisplayMessage() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // ConfirmDeleteEntryDisplayMessage - // - this.Buttons = System.Windows.Forms.MessageBoxButtons.YesNo; - this.Text = "Are you sure that you want to delete the selected glossary entry?"; - this.Title = "Confirm Delete"; - this.Type = DisplayMessageType.Question; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // ConfirmDeleteEntryDisplayMessage + // + this.Buttons = System.Windows.Forms.MessageBoxButtons.YesNo; + this.Text = "Are you sure that you want to delete the selected glossary entry?"; + this.Title = "Confirm Delete"; + this.Type = DisplayMessageType.Question; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.HtmlEditor/Linking/DisplayMessages/ConfirmReplaceEntryDisplayMessage.cs b/src/managed/OpenLiveWriter.HtmlEditor/Linking/DisplayMessages/ConfirmReplaceEntryDisplayMessage.cs index d12f96ee..4e86dbc8 100644 --- a/src/managed/OpenLiveWriter.HtmlEditor/Linking/DisplayMessages/ConfirmReplaceEntryDisplayMessage.cs +++ b/src/managed/OpenLiveWriter.HtmlEditor/Linking/DisplayMessages/ConfirmReplaceEntryDisplayMessage.cs @@ -7,65 +7,65 @@ using OpenLiveWriter.Controls; namespace OpenLiveWriter.HtmlEditor.Linking.DisplayMessages { - /// - /// Summary description for ConfirmReplaceEntryDisplayMessage. - /// - public class ConfirmReplaceEntryDisplayMessage : DisplayMessage - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for ConfirmReplaceEntryDisplayMessage. + /// + public class ConfirmReplaceEntryDisplayMessage : DisplayMessage + { + /// + /// Required designer variable. + /// + private Container components = null; - public ConfirmReplaceEntryDisplayMessage(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public ConfirmReplaceEntryDisplayMessage(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - } + } - public ConfirmReplaceEntryDisplayMessage() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); - } + public ConfirmReplaceEntryDisplayMessage() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // ConfirmReplaceEntryDisplayMessage - // - this.Buttons = System.Windows.Forms.MessageBoxButtons.YesNo; - this.Text = "Are you sure you want to replace the current entry for that text?"; - this.Title = "Confirm Replace"; - this.Type = DisplayMessageType.Question; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // ConfirmReplaceEntryDisplayMessage + // + this.Buttons = System.Windows.Forms.MessageBoxButtons.YesNo; + this.Text = "Are you sure you want to replace the current entry for that text?"; + this.Title = "Confirm Replace"; + this.Type = DisplayMessageType.Question; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.HtmlEditor/Linking/DisplayMessages/EntryFoundDisplayMessage.cs b/src/managed/OpenLiveWriter.HtmlEditor/Linking/DisplayMessages/EntryFoundDisplayMessage.cs index 939e0e2f..6de67b94 100644 --- a/src/managed/OpenLiveWriter.HtmlEditor/Linking/DisplayMessages/EntryFoundDisplayMessage.cs +++ b/src/managed/OpenLiveWriter.HtmlEditor/Linking/DisplayMessages/EntryFoundDisplayMessage.cs @@ -7,65 +7,65 @@ using OpenLiveWriter.Controls; namespace OpenLiveWriter.HtmlEditor.Linking.DisplayMessages { - /// - /// Summary description for EntryFoundDisplayMessage. - /// - public class EntryFoundDisplayMessage : DisplayMessage - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for EntryFoundDisplayMessage. + /// + public class EntryFoundDisplayMessage : DisplayMessage + { + /// + /// Required designer variable. + /// + private Container components = null; - public EntryFoundDisplayMessage(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public EntryFoundDisplayMessage(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - } + } - public EntryFoundDisplayMessage() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); - } + public EntryFoundDisplayMessage() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // EntryFoundDisplayMessage - // - this.Buttons = System.Windows.Forms.MessageBoxButtons.YesNo; - this.Text = "Found a matching entry with link text {0} and URL {1}. \r\n\r\nDo you want to use this link information?"; - this.Title = "Entry Found"; - this.Type = DisplayMessageType.Question; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // EntryFoundDisplayMessage + // + this.Buttons = System.Windows.Forms.MessageBoxButtons.YesNo; + this.Text = "Found a matching entry with link text {0} and URL {1}. \r\n\r\nDo you want to use this link information?"; + this.Title = "Entry Found"; + this.Type = DisplayMessageType.Question; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.HtmlEditor/Linking/DisplayMessages/SelectEntryDisplayMessage.cs b/src/managed/OpenLiveWriter.HtmlEditor/Linking/DisplayMessages/SelectEntryDisplayMessage.cs index fbfc7350..e386a150 100644 --- a/src/managed/OpenLiveWriter.HtmlEditor/Linking/DisplayMessages/SelectEntryDisplayMessage.cs +++ b/src/managed/OpenLiveWriter.HtmlEditor/Linking/DisplayMessages/SelectEntryDisplayMessage.cs @@ -7,65 +7,65 @@ using OpenLiveWriter.Controls; namespace OpenLiveWriter.HtmlEditor.Linking.DisplayMessages { - /// - /// Summary description for EntryFoundDisplayMessage. - /// - public class SelectEntryDisplayMessage : DisplayMessage - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for EntryFoundDisplayMessage. + /// + public class SelectEntryDisplayMessage : DisplayMessage + { + /// + /// Required designer variable. + /// + private Container components = null; - public SelectEntryDisplayMessage(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public SelectEntryDisplayMessage(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - } + } - public SelectEntryDisplayMessage() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); - } + public SelectEntryDisplayMessage() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // SelectEntryDisplayMessage - // - this.Buttons = System.Windows.Forms.MessageBoxButtons.OK; - this.Text = "Please select a link from the glossary."; - this.Title = "Select Link"; - this.Type = DisplayMessageType.Information; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // SelectEntryDisplayMessage + // + this.Buttons = System.Windows.Forms.MessageBoxButtons.OK; + this.Text = "Please select a link from the glossary."; + this.Title = "Select Link"; + this.Type = DisplayMessageType.Information; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.HtmlEditor/Linking/GlossaryManagementControl.cs b/src/managed/OpenLiveWriter.HtmlEditor/Linking/GlossaryManagementControl.cs index a0722aef..1c6cb343 100644 --- a/src/managed/OpenLiveWriter.HtmlEditor/Linking/GlossaryManagementControl.cs +++ b/src/managed/OpenLiveWriter.HtmlEditor/Linking/GlossaryManagementControl.cs @@ -260,7 +260,6 @@ namespace OpenLiveWriter.HtmlEditor.Linking } - private void DeleteSelectedEntry() { if (SelectedEntry == null) diff --git a/src/managed/OpenLiveWriter.HtmlEditor/Linking/GlossaryManager.cs b/src/managed/OpenLiveWriter.HtmlEditor/Linking/GlossaryManager.cs index 17c88a34..94d99700 100644 --- a/src/managed/OpenLiveWriter.HtmlEditor/Linking/GlossaryManager.cs +++ b/src/managed/OpenLiveWriter.HtmlEditor/Linking/GlossaryManager.cs @@ -529,5 +529,4 @@ namespace OpenLiveWriter.HtmlEditor.Linking } } - } diff --git a/src/managed/OpenLiveWriter.HtmlEditor/Linking/HyperlinkForm.cs b/src/managed/OpenLiveWriter.HtmlEditor/Linking/HyperlinkForm.cs index 68483279..376b38b4 100644 --- a/src/managed/OpenLiveWriter.HtmlEditor/Linking/HyperlinkForm.cs +++ b/src/managed/OpenLiveWriter.HtmlEditor/Linking/HyperlinkForm.cs @@ -411,7 +411,6 @@ namespace OpenLiveWriter.HtmlEditor.Linking } private const string HTTP_PREFIX = "http://"; - /// /// Clean up any resources being used. /// diff --git a/src/managed/OpenLiveWriter.HtmlEditor/Linking/HyperlinkingContextMenuDefinition.cs b/src/managed/OpenLiveWriter.HtmlEditor/Linking/HyperlinkingContextMenuDefinition.cs index b92d5d3b..f4241220 100644 --- a/src/managed/OpenLiveWriter.HtmlEditor/Linking/HyperlinkingContextMenuDefinition.cs +++ b/src/managed/OpenLiveWriter.HtmlEditor/Linking/HyperlinkingContextMenuDefinition.cs @@ -9,77 +9,77 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.HtmlEditor.Linking { - /// - /// - public class HyperlinkingContextMenuDefinition : CommandContextMenuDefinition - { - private MenuDefinitionEntryCommand menuDefinitionEntryCommandRecentPost; - private MenuDefinitionEntryCommand menuDefinitionEntryCommandGlossary; + /// + /// + public class HyperlinkingContextMenuDefinition : CommandContextMenuDefinition + { + private MenuDefinitionEntryCommand menuDefinitionEntryCommandRecentPost; + private MenuDefinitionEntryCommand menuDefinitionEntryCommandGlossary; - private IContainer components; + private IContainer components; - public HyperlinkingContextMenuDefinition(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); - } + public HyperlinkingContextMenuDefinition(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); + } - public HyperlinkingContextMenuDefinition() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); - } + public HyperlinkingContextMenuDefinition() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); - this.menuDefinitionEntryCommandRecentPost = new OpenLiveWriter.ApplicationFramework.MenuDefinitionEntryCommand(this.components); - this.menuDefinitionEntryCommandGlossary = new OpenLiveWriter.ApplicationFramework.MenuDefinitionEntryCommand(this.components); - // - // menuDefinitionEntryCommandRecentPost - // - this.menuDefinitionEntryCommandRecentPost.CommandIdentifier = "OpenLiveWriter.PostEditor.OpenPost.CommandRecentPost"; - this.menuDefinitionEntryCommandRecentPost.SeparatorAfter = false; - this.menuDefinitionEntryCommandRecentPost.SeparatorBefore = false; - // - // menuDefinitionEntryCommandGlossary - // - this.menuDefinitionEntryCommandGlossary.CommandIdentifier = "OpenLiveWriter.HtmlEditor.Linking.Commands.CommandGlossary"; - this.menuDefinitionEntryCommandGlossary.SeparatorAfter = false; - this.menuDefinitionEntryCommandGlossary.SeparatorBefore = false; - // - // LinkingContextMenuDefinition - // - this.Entries.AddRange(new OpenLiveWriter.ApplicationFramework.MenuDefinitionEntry[] { - this.menuDefinitionEntryCommandRecentPost, - this.menuDefinitionEntryCommandGlossary}); - } - #endregion - } + this.menuDefinitionEntryCommandRecentPost = new OpenLiveWriter.ApplicationFramework.MenuDefinitionEntryCommand(this.components); + this.menuDefinitionEntryCommandGlossary = new OpenLiveWriter.ApplicationFramework.MenuDefinitionEntryCommand(this.components); + // + // menuDefinitionEntryCommandRecentPost + // + this.menuDefinitionEntryCommandRecentPost.CommandIdentifier = "OpenLiveWriter.PostEditor.OpenPost.CommandRecentPost"; + this.menuDefinitionEntryCommandRecentPost.SeparatorAfter = false; + this.menuDefinitionEntryCommandRecentPost.SeparatorBefore = false; + // + // menuDefinitionEntryCommandGlossary + // + this.menuDefinitionEntryCommandGlossary.CommandIdentifier = "OpenLiveWriter.HtmlEditor.Linking.Commands.CommandGlossary"; + this.menuDefinitionEntryCommandGlossary.SeparatorAfter = false; + this.menuDefinitionEntryCommandGlossary.SeparatorBefore = false; + // + // LinkingContextMenuDefinition + // + this.Entries.AddRange(new OpenLiveWriter.ApplicationFramework.MenuDefinitionEntry[] { + this.menuDefinitionEntryCommandRecentPost, + this.menuDefinitionEntryCommandGlossary}); + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.HtmlEditor/Marshalling/DataFormatHandler.cs b/src/managed/OpenLiveWriter.HtmlEditor/Marshalling/DataFormatHandler.cs index d77c2d56..d1ad9add 100644 --- a/src/managed/OpenLiveWriter.HtmlEditor/Marshalling/DataFormatHandler.cs +++ b/src/managed/OpenLiveWriter.HtmlEditor/Marshalling/DataFormatHandler.cs @@ -35,7 +35,6 @@ namespace OpenLiveWriter.HtmlEditor.Marshalling } - /// /// Optional notification that we are beginning a drag operation /// @@ -95,7 +94,6 @@ namespace OpenLiveWriter.HtmlEditor.Marshalling return DragDropEffects.None; } - /// /// Support copy as default with optional shift-key override to move /// @@ -122,7 +120,6 @@ namespace OpenLiveWriter.HtmlEditor.Marshalling return effects; } - /// /// Support move as default with optional control-key override to copy /// diff --git a/src/managed/OpenLiveWriter.HtmlEditor/Marshalling/DataFormatHandlerRegistry.cs b/src/managed/OpenLiveWriter.HtmlEditor/Marshalling/DataFormatHandlerRegistry.cs index 0bebd3a7..aba36d96 100644 --- a/src/managed/OpenLiveWriter.HtmlEditor/Marshalling/DataFormatHandlerRegistry.cs +++ b/src/managed/OpenLiveWriter.HtmlEditor/Marshalling/DataFormatHandlerRegistry.cs @@ -78,13 +78,13 @@ namespace OpenLiveWriter.HtmlEditor.Marshalling } /*public void Register( Type dataFormatHandlerType, DataObjectFilter filter ) - { - // register the data format handler - lock(dataFormatHandlerFactories) - { - dataFormatHandlerFactories.Add(new DataObjectFilterFormatFactory(filter, dataFormatHandlerType)); - } - }*/ + { + // register the data format handler + lock(dataFormatHandlerFactories) + { + dataFormatHandlerFactories.Add(new DataObjectFilterFormatFactory(filter, dataFormatHandlerType)); + } + }*/ public void Register(params IDataFormatHandlerFactory[] dataFormatFactories) { diff --git a/src/managed/OpenLiveWriter.HtmlEditor/Marshalling/Data_Handlers/FileHandler.cs b/src/managed/OpenLiveWriter.HtmlEditor/Marshalling/Data_Handlers/FileHandler.cs index 3375ffb4..aa79afd7 100644 --- a/src/managed/OpenLiveWriter.HtmlEditor/Marshalling/Data_Handlers/FileHandler.cs +++ b/src/managed/OpenLiveWriter.HtmlEditor/Marshalling/Data_Handlers/FileHandler.cs @@ -44,7 +44,6 @@ namespace OpenLiveWriter.HtmlEditor.Marshalling.Data_Handlers } } - /// /// Grabs HTML copied in the clipboard and pastes it into the document (pulls in a copy of embedded content too) /// diff --git a/src/managed/OpenLiveWriter.HtmlEditor/Marshalling/Data_Handlers/FreeTextHandler.cs b/src/managed/OpenLiveWriter.HtmlEditor/Marshalling/Data_Handlers/FreeTextHandler.cs index b78e8c40..cd31cf39 100644 --- a/src/managed/OpenLiveWriter.HtmlEditor/Marshalling/Data_Handlers/FreeTextHandler.cs +++ b/src/managed/OpenLiveWriter.HtmlEditor/Marshalling/Data_Handlers/FreeTextHandler.cs @@ -88,7 +88,6 @@ namespace OpenLiveWriter.HtmlEditor.Marshalling.Data_Handlers } } - /// /// Release any reference to HTML Caret /// @@ -97,7 +96,6 @@ namespace OpenLiveWriter.HtmlEditor.Marshalling.Data_Handlers currentCaretLocation = null; } - /// /// Notify the data format handler that data was dropped and should be inserted into /// the document at whatever insert location the handler has internally tracked. diff --git a/src/managed/OpenLiveWriter.HtmlEditor/Marshalling/DragDropTarget.cs b/src/managed/OpenLiveWriter.HtmlEditor/Marshalling/DragDropTarget.cs index ace79b5e..25f86826 100644 --- a/src/managed/OpenLiveWriter.HtmlEditor/Marshalling/DragDropTarget.cs +++ b/src/managed/OpenLiveWriter.HtmlEditor/Marshalling/DragDropTarget.cs @@ -125,7 +125,6 @@ namespace OpenLiveWriter.HtmlEditor.Marshalling } - /// /// Handle the DragOver event for the presentation editor /// @@ -202,7 +201,6 @@ namespace OpenLiveWriter.HtmlEditor.Marshalling } } - #endregion #region Private Helper Methods diff --git a/src/managed/OpenLiveWriter.HtmlEditor/Marshalling/HtmlEditorDataFormatHandler.cs b/src/managed/OpenLiveWriter.HtmlEditor/Marshalling/HtmlEditorDataFormatHandler.cs index 70c50fb8..f2880dcb 100644 --- a/src/managed/OpenLiveWriter.HtmlEditor/Marshalling/HtmlEditorDataFormatHandler.cs +++ b/src/managed/OpenLiveWriter.HtmlEditor/Marshalling/HtmlEditorDataFormatHandler.cs @@ -29,7 +29,6 @@ namespace OpenLiveWriter.HtmlEditor.Marshalling /// protected abstract bool DoInsertData(DataAction action, MarkupPointer begin, MarkupPointer end); - /// /// Presentation editor context for handling data /// diff --git a/src/managed/OpenLiveWriter.HtmlEditor/Marshalling/MshtmlEditorDragAndDropTarget.cs b/src/managed/OpenLiveWriter.HtmlEditor/Marshalling/MshtmlEditorDragAndDropTarget.cs index 089cc0ce..3487f523 100644 --- a/src/managed/OpenLiveWriter.HtmlEditor/Marshalling/MshtmlEditorDragAndDropTarget.cs +++ b/src/managed/OpenLiveWriter.HtmlEditor/Marshalling/MshtmlEditorDragAndDropTarget.cs @@ -88,7 +88,6 @@ namespace OpenLiveWriter.HtmlEditor.Marshalling #endregion - #region Drag and Drop Event Handlers /// @@ -126,7 +125,6 @@ namespace OpenLiveWriter.HtmlEditor.Marshalling CallMshtmlDragEnter(e, false, false); } - /// /// Handle the DragOver event for the presentation editor /// @@ -190,7 +188,6 @@ namespace OpenLiveWriter.HtmlEditor.Marshalling #endregion - #region Delegation of Drag and Drop Events to MSHTML /// @@ -283,7 +280,6 @@ namespace OpenLiveWriter.HtmlEditor.Marshalling } } - /// /// Helper to cal the Mshtml DragDrop routine using .NET DragEventArgs /// @@ -342,7 +338,6 @@ namespace OpenLiveWriter.HtmlEditor.Marshalling return oleDataObject ?? emptyDataObject; } - /// /// Helper to provide drop feedback /// @@ -358,7 +353,6 @@ namespace OpenLiveWriter.HtmlEditor.Marshalling return DragDropEffects.None; } - /// /// Helper to convert .NET drop-effect into Win32 drop effect /// @@ -422,7 +416,6 @@ namespace OpenLiveWriter.HtmlEditor.Marshalling #endregion - #region Implementation of IDropTarget // NOTE: while we do technically replace the MSHTML IDropTarget interface with our own, diff --git a/src/managed/OpenLiveWriter.HtmlEditor/PropertyEditingMiniForm.cs b/src/managed/OpenLiveWriter.HtmlEditor/PropertyEditingMiniForm.cs index 4a65bc56..0ec725c4 100644 --- a/src/managed/OpenLiveWriter.HtmlEditor/PropertyEditingMiniForm.cs +++ b/src/managed/OpenLiveWriter.HtmlEditor/PropertyEditingMiniForm.cs @@ -15,190 +15,188 @@ using Project31.ApplicationFramework; namespace Onfolio.Core.HtmlEditor { - public class PropertyEditingMiniForm : MiniForm - { - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; + public class PropertyEditingMiniForm : MiniForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.Container components = null; - private BitmapButton _closeButton ; + private BitmapButton _closeButton ; - private Bitmap _closeButtonEnabled = ResourceHelper.LoadAssemblyResourceBitmap("Images.CloseEnabled.png") ; - private Bitmap _closeButtonSelected = ResourceHelper.LoadAssemblyResourceBitmap("Images.CloseSelected.png") ; - private Bitmap _closeButtonPushed = ResourceHelper.LoadAssemblyResourceBitmap("Images.ClosePushed.png") ; - private Bitmap _closeButtonDisabled = ResourceHelper.LoadAssemblyResourceBitmap(Images.CloseInactive.png") ; + private Bitmap _closeButtonEnabled = ResourceHelper.LoadAssemblyResourceBitmap("Images.CloseEnabled.png") ; + private Bitmap _closeButtonSelected = ResourceHelper.LoadAssemblyResourceBitmap("Images.CloseSelected.png") ; + private Bitmap _closeButtonPushed = ResourceHelper.LoadAssemblyResourceBitmap("Images.ClosePushed.png") ; + private Bitmap _closeButtonDisabled = ResourceHelper.LoadAssemblyResourceBitmap(Images.CloseInactive.png") ; - public PropertyEditingMiniForm() - : this(new DesignModeMainFrameWindow()) - { - } + public PropertyEditingMiniForm() + : this(new DesignModeMainFrameWindow()) + { + } - public PropertyEditingMiniForm(IMainFrameWindow mainFrameWindow) - { - // - // Required for Windows Form Designer support - // - InitializeComponent(); + public PropertyEditingMiniForm(IMainFrameWindow mainFrameWindow) + { + // + // Required for Windows Form Designer support + // + InitializeComponent(); - // hide when user clicks away - DismissOnDeactivate = true ; + // hide when user clicks away + DismissOnDeactivate = true ; - // initialize close button - _closeButton = new BitmapButton() ; - _closeButton.BitmapDisabled = _closeButtonDisabled ; - _closeButton.BitmapEnabled = _closeButtonEnabled ; - _closeButton.BitmapPushed = _closeButtonPushed ; - _closeButton.BitmapSelected = _closeButtonSelected ; - _closeButton.ButtonStyle = ButtonStyle.Bitmap ; - _closeButton.ToolTip = "Close" ; - _closeButton.Width = _closeButtonEnabled.Width ; - _closeButton.Height = _closeButtonEnabled.Height; - _closeButton.Top = 2 ; - _closeButton.Left = Width - _closeButton.Width - 1 ; - _closeButton.Anchor = AnchorStyles.Top | AnchorStyles.Right ; - _closeButton.Click +=new EventHandler(_closeButton_Click); - Controls.Add(_closeButton) ; + // initialize close button + _closeButton = new BitmapButton() ; + _closeButton.BitmapDisabled = _closeButtonDisabled ; + _closeButton.BitmapEnabled = _closeButtonEnabled ; + _closeButton.BitmapPushed = _closeButtonPushed ; + _closeButton.BitmapSelected = _closeButtonSelected ; + _closeButton.ButtonStyle = ButtonStyle.Bitmap ; + _closeButton.ToolTip = "Close" ; + _closeButton.Width = _closeButtonEnabled.Width ; + _closeButton.Height = _closeButtonEnabled.Height; + _closeButton.Top = 2 ; + _closeButton.Left = Width - _closeButton.Width - 1 ; + _closeButton.Anchor = AnchorStyles.Top | AnchorStyles.Right ; + _closeButton.Click +=new EventHandler(_closeButton_Click); + Controls.Add(_closeButton) ; - // subscribe to appearance changed - ApplicationManager.ApplicationStyleChanged +=new EventHandler(ApplicationManager_ApplicationStyleChanged); + // subscribe to appearance changed + ApplicationManager.ApplicationStyleChanged +=new EventHandler(ApplicationManager_ApplicationStyleChanged); - // update appearance - SyncAppearanceToApplicationStyle() ; - } + // update appearance + SyncAppearanceToApplicationStyle() ; + } - private void _closeButton_Click( object sender, EventArgs ea ) - { - Close() ; - } + private void _closeButton_Click( object sender, EventArgs ea ) + { + Close() ; + } + protected override void OnPaint(PaintEventArgs e) + { + base.OnPaint (e); - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint (e); + // draw the background + e.Graphics.FillRectangle(_backgroundBrush, ClientRectangle); - // draw the background - e.Graphics.FillRectangle(_backgroundBrush, ClientRectangle); + // calculate title metrics + const int TEXT_LEFT_OFFSET = 2 ; + const int TEXT_TOP_OFFSET = 2 ; + float fontHeight = ApplicationManager.ApplicationStyle.NormalApplicationFont.GetHeight(e.Graphics) ; + int titleHeight = Convert.ToInt32(fontHeight) + TEXT_TOP_OFFSET + 1; - // calculate title metrics - const int TEXT_LEFT_OFFSET = 2 ; - const int TEXT_TOP_OFFSET = 2 ; - float fontHeight = ApplicationManager.ApplicationStyle.NormalApplicationFont.GetHeight(e.Graphics) ; - int titleHeight = Convert.ToInt32(fontHeight) + TEXT_TOP_OFFSET + 1; + // draw the title area + e.Graphics.FillRectangle( _titleBarBrush, new Rectangle( 1, 1, Width-2, titleHeight ) ); - // draw the title area - e.Graphics.FillRectangle( _titleBarBrush, new Rectangle( 1, 1, Width-2, titleHeight ) ); + // draw the border + e.Graphics.DrawRectangle( _borderPen, new Rectangle(0,0, Width-1, Height-1) ) ; + e.Graphics.DrawLine( _borderPen, 1, titleHeight + 1, Width-2, titleHeight + 1 ); - // draw the border - e.Graphics.DrawRectangle( _borderPen, new Rectangle(0,0, Width-1, Height-1) ) ; - e.Graphics.DrawLine( _borderPen, 1, titleHeight + 1, Width-2, titleHeight + 1 ); + // draw the text + e.Graphics.DrawString( Text, ApplicationManager.ApplicationStyle.NormalApplicationFont, _textBrush, new PointF(TEXT_LEFT_OFFSET,TEXT_TOP_OFFSET) ) ; + } - // draw the text - e.Graphics.DrawString( Text, ApplicationManager.ApplicationStyle.NormalApplicationFont, _textBrush, new PointF(TEXT_LEFT_OFFSET,TEXT_TOP_OFFSET) ) ; - } + private void ApplicationManager_ApplicationStyleChanged(object sender, EventArgs e) + { + SyncAppearanceToApplicationStyle() ; + PerformLayout() ; + Invalidate() ; + } - private void ApplicationManager_ApplicationStyleChanged(object sender, EventArgs e) - { - SyncAppearanceToApplicationStyle() ; - PerformLayout() ; - Invalidate() ; - } + private void SyncAppearanceToApplicationStyle() + { + _closeButton.BackColor = ApplicationManager.ApplicationStyle.PrimaryWorkspaceCommandBarBottomColor; - private void SyncAppearanceToApplicationStyle() - { - _closeButton.BackColor = ApplicationManager.ApplicationStyle.PrimaryWorkspaceCommandBarBottomColor; + if ( _backgroundBrush != null ) + _backgroundBrush.Dispose(); + _backgroundBrush = new SolidBrush(Color.FromArgb(246,243,240)) ; - if ( _backgroundBrush != null ) - _backgroundBrush.Dispose(); - _backgroundBrush = new SolidBrush(Color.FromArgb(246,243,240)) ; + if ( _titleBarBrush != null ) + _titleBarBrush.Dispose(); + _titleBarBrush = new SolidBrush(ApplicationManager.ApplicationStyle.PrimaryWorkspaceCommandBarBottomColor) ; - if ( _titleBarBrush != null ) - _titleBarBrush.Dispose(); - _titleBarBrush = new SolidBrush(ApplicationManager.ApplicationStyle.PrimaryWorkspaceCommandBarBottomColor) ; + if ( _borderPen != null ) + _borderPen.Dispose(); + _borderPen = new Pen(ApplicationManager.ApplicationStyle.PrimaryWorkspaceCommandBarBottomBevelFirstLineColor) ; - if ( _borderPen != null ) - _borderPen.Dispose(); - _borderPen = new Pen(ApplicationManager.ApplicationStyle.PrimaryWorkspaceCommandBarBottomBevelFirstLineColor) ; + if ( _textBrush != null ) + _textBrush.Dispose(); + _textBrush = new SolidBrush(ApplicationManager.ApplicationStyle.PrimaryWorkspaceCommandBarTextColor) ; + } + private Brush _backgroundBrush ; + private Brush _titleBarBrush ; + private Pen _borderPen ; + private Brush _textBrush ; - if ( _textBrush != null ) - _textBrush.Dispose(); - _textBrush = new SolidBrush(ApplicationManager.ApplicationStyle.PrimaryWorkspaceCommandBarTextColor) ; - } - private Brush _backgroundBrush ; - private Brush _titleBarBrush ; - private Pen _borderPen ; - private Brush _textBrush ; + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if ( _backgroundBrush != null ) + _backgroundBrush.Dispose(); + if ( _titleBarBrush != null ) + _titleBarBrush.Dispose(); + if ( _borderPen != null ) + _borderPen.Dispose(); + if ( _textBrush != null ) + _textBrush.Dispose(); - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if ( _backgroundBrush != null ) - _backgroundBrush.Dispose(); - if ( _titleBarBrush != null ) - _titleBarBrush.Dispose(); - if ( _borderPen != null ) - _borderPen.Dispose(); - if ( _textBrush != null ) - _textBrush.Dispose(); + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /* + private class ParentFrameEventMonitor : NativeWindow, IDisposable + { + public ParentFrameEventMonitor( IWin32Window parentWindow ) + { + AssignHandle(parentWindow.Handle); + } - /* - private class ParentFrameEventMonitor : NativeWindow, IDisposable - { - public ParentFrameEventMonitor( IWin32Window parentWindow ) - { - AssignHandle(parentWindow.Handle); - } + public void Dispose() + { + ReleaseHandle() ; + } - public void Dispose() - { - ReleaseHandle() ; - } + protected override void WndProc(ref Message m) + { + // always allow default processing + base.WndProc (ref m); - protected override void WndProc(ref Message m) - { - // always allow default processing - base.WndProc (ref m); + if ( m.Msg == WM.ACTIVATE ) + { - if ( m.Msg == WM.ACTIVATE ) - { + // detect switching between the two forms + if ( lParam == Handle ) + switchedBetweenForms = true ; + else + switchedBetweenForms = false ; - // detect switching between the two forms - if ( lParam == Handle ) - switchedBetweenForms = true ; - else - switchedBetweenForms = false ; + } - } + } + } + */ - } - } - */ + #region Windows Form Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.Size = new System.Drawing.Size(300,300); + this.Text = "PropertyEditingMiniForm"; + } + #endregion - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - this.Size = new System.Drawing.Size(300,300); - this.Text = "PropertyEditingMiniForm"; - } - #endregion - - - } + } } diff --git a/src/managed/OpenLiveWriter.HtmlEditor/WordCountForm.cs b/src/managed/OpenLiveWriter.HtmlEditor/WordCountForm.cs index ed2d5e11..56f0393b 100644 --- a/src/managed/OpenLiveWriter.HtmlEditor/WordCountForm.cs +++ b/src/managed/OpenLiveWriter.HtmlEditor/WordCountForm.cs @@ -54,7 +54,6 @@ namespace OpenLiveWriter.HtmlEditor gbTableHeader.Text = Res.Get(StringId.Statistics); } - } protected override void OnLoad(EventArgs e) @@ -77,7 +76,6 @@ namespace OpenLiveWriter.HtmlEditor DisplayHelper.AutoFitSystemButton(buttonClose, buttonClose.Width, int.MaxValue); } - private void btnClose_Click(object sender, EventArgs e) { this.Close(); diff --git a/src/managed/OpenLiveWriter.HtmlParser/Parser/HtmlExtractor.cs b/src/managed/OpenLiveWriter.HtmlParser/Parser/HtmlExtractor.cs index aa19c35b..36f86f03 100644 --- a/src/managed/OpenLiveWriter.HtmlParser/Parser/HtmlExtractor.cs +++ b/src/managed/OpenLiveWriter.HtmlParser/Parser/HtmlExtractor.cs @@ -39,7 +39,7 @@ namespace OpenLiveWriter.HtmlParser.Parser /// /// Returns the underlying parser that the HtmlExtractor is wrapping. /// - public SimpleHtmlParser Parser + public SimpleHtmlParser Parser { get { return parser; } } @@ -47,7 +47,7 @@ namespace OpenLiveWriter.HtmlParser.Parser /// /// Indicates whether the last match succeeded. /// - public bool Success + public bool Success { get { @@ -59,7 +59,7 @@ namespace OpenLiveWriter.HtmlParser.Parser /// Gets the element that was last matched. If the last /// match failed, then returns null. /// - public Element Element + public Element Element { get { @@ -76,7 +76,7 @@ namespace OpenLiveWriter.HtmlParser.Parser /// /// if (ex.Seek(...).Success || ex.Reset().Seek(...).Success) { ... } /// - public HtmlExtractor Reset() + public HtmlExtractor Reset() { lastMatch = null; parser = new SimpleHtmlParser(html); @@ -114,26 +114,26 @@ namespace OpenLiveWriter.HtmlParser.Parser /// Seeks forward from the current position for the criterion. /// /// If the seek fails, the parser will be positioned at the end of the file--all - /// future seeks will also fail (until Reset() is called). + /// future seeks will also fail (until Reset() is called). /// - /// - /// Can be either a begin tag or end tag, or a run of text, or a comment. - /// - /// Examples of start tags: - /// (any anchor tag) - /// (any anchor tag that has at least one "name" attribute (with or without value) - /// (any anchor tag that has a name attribute whose value is "title") - /// - /// Example of end tag: - /// (any end anchor tag) - /// - /// Examples of invalid criteria: - /// (only one criterion allowed per seek; chain Seek() calls if necessary) - /// foo (only begin tags and end tags are allowed) - /// - /// TODO: Allow regular expression matching on attribute values, e.g. - /// - public HtmlExtractor Seek(string criterion) + /// + /// Can be either a begin tag or end tag, or a run of text, or a comment. + /// + /// Examples of start tags: + /// (any anchor tag) + /// (any anchor tag that has at least one "name" attribute (with or without value) + /// (any anchor tag that has a name attribute whose value is "title") + /// + /// Example of end tag: + /// (any end anchor tag) + /// + /// Examples of invalid criteria: + /// (only one criterion allowed per seek; chain Seek() calls if necessary) + /// foo (only begin tags and end tags are allowed) + /// + /// TODO: Allow regular expression matching on attribute values, e.g. + /// + public HtmlExtractor Seek(string criterion) { lastMatch = null; @@ -188,12 +188,12 @@ namespace OpenLiveWriter.HtmlParser.Parser return HtmlUtils.HTMLToPlainText(parser.CollectHtmlUntil(endTagName)); /* - string text = parser.CollectTextUntil(endTagName); - if (convertToPlainText && text != null) - return HtmlUtils.HTMLToPlainText(text); - else - return text; - */ + string text = parser.CollectTextUntil(endTagName); + if (convertToPlainText && text != null) + return HtmlUtils.HTMLToPlainText(text); + else + return text; + */ } /// diff --git a/src/managed/OpenLiveWriter.HtmlParser/Parser/JavascriptParser.cs b/src/managed/OpenLiveWriter.HtmlParser/Parser/JavascriptParser.cs index f455f86d..775e9a1b 100644 --- a/src/managed/OpenLiveWriter.HtmlParser/Parser/JavascriptParser.cs +++ b/src/managed/OpenLiveWriter.HtmlParser/Parser/JavascriptParser.cs @@ -123,6 +123,5 @@ namespace OpenLiveWriter.HtmlParser.Parser } } - } } diff --git a/src/managed/OpenLiveWriter.HtmlParser/Parser/SimpleHtmlParser.cs b/src/managed/OpenLiveWriter.HtmlParser/Parser/SimpleHtmlParser.cs index 36099109..d3749d97 100644 --- a/src/managed/OpenLiveWriter.HtmlParser/Parser/SimpleHtmlParser.cs +++ b/src/managed/OpenLiveWriter.HtmlParser/Parser/SimpleHtmlParser.cs @@ -404,16 +404,16 @@ namespace OpenLiveWriter.HtmlParser.Parser { Match match = stopAt.Match(data, offset); /* - if (!match.Success) - { - // Failure. If an end tag is never encountered, the - // begin tag does not count. - // We can remove this whole clause if we want to behave - // more like IE than Gecko. - retval = string.Empty; - return 0; - } - */ + if (!match.Success) + { + // Failure. If an end tag is never encountered, the + // begin tag does not count. + // We can remove this whole clause if we want to behave + // more like IE than Gecko. + retval = string.Empty; + return 0; + } + */ int end = match.Success ? match.Index : data.Length; @@ -459,11 +459,11 @@ namespace OpenLiveWriter.HtmlParser.Parser public Match Match(int pos) { /* We need to reexecute the search under any of these three conditions: - * - * 1) The search has never been run - * 2) The last search successfully matched before it got to the desired position - * 3) The last search was started past the desired position - */ + * + * 1) The search has never been run + * 2) The last search successfully matched before it got to the desired position + * 3) The last search was started past the desired position + */ if (lastMatch == null || (lastMatch.Success && lastMatch.Index < pos) || lastStartOffset > pos) { #if DEBUG @@ -503,7 +503,7 @@ namespace OpenLiveWriter.HtmlParser.Parser /// String.Substring is very expensive, so we avoid calling it /// until the caller demands it. /// - internal class LazySubstring + internal class LazySubstring { private readonly string baseString; private readonly int offset; diff --git a/src/managed/OpenLiveWriter.InternalWriterPlugin/Controls/MapBirdsEyeZoomControl.cs b/src/managed/OpenLiveWriter.InternalWriterPlugin/Controls/MapBirdsEyeZoomControl.cs index c9cff832..c5ce1fdc 100644 --- a/src/managed/OpenLiveWriter.InternalWriterPlugin/Controls/MapBirdsEyeZoomControl.cs +++ b/src/managed/OpenLiveWriter.InternalWriterPlugin/Controls/MapBirdsEyeZoomControl.cs @@ -192,4 +192,3 @@ namespace OpenLiveWriter.InternalWriterPlugin.Controls } } - diff --git a/src/managed/OpenLiveWriter.InternalWriterPlugin/Controls/MapPushpinForm.cs b/src/managed/OpenLiveWriter.InternalWriterPlugin/Controls/MapPushpinForm.cs index 3b3d62c5..86210e5e 100644 --- a/src/managed/OpenLiveWriter.InternalWriterPlugin/Controls/MapPushpinForm.cs +++ b/src/managed/OpenLiveWriter.InternalWriterPlugin/Controls/MapPushpinForm.cs @@ -145,7 +145,6 @@ namespace OpenLiveWriter.InternalWriterPlugin.Controls } - /// /// Clean up any resources being used. /// diff --git a/src/managed/OpenLiveWriter.InternalWriterPlugin/MapContentSource.cs b/src/managed/OpenLiveWriter.InternalWriterPlugin/MapContentSource.cs index 291aaa26..9129de62 100644 --- a/src/managed/OpenLiveWriter.InternalWriterPlugin/MapContentSource.cs +++ b/src/managed/OpenLiveWriter.InternalWriterPlugin/MapContentSource.cs @@ -81,7 +81,6 @@ namespace OpenLiveWriter.InternalWriterPlugin } } - private string GenerateHtml(ISmartContent content, bool editor, string blogId) { MapSettings settings = new MapSettings(content.Properties); diff --git a/src/managed/OpenLiveWriter.InternalWriterPlugin/MapForm.cs b/src/managed/OpenLiveWriter.InternalWriterPlugin/MapForm.cs index f381738e..3144c788 100644 --- a/src/managed/OpenLiveWriter.InternalWriterPlugin/MapForm.cs +++ b/src/managed/OpenLiveWriter.InternalWriterPlugin/MapForm.cs @@ -134,7 +134,6 @@ namespace OpenLiveWriter.InternalWriterPlugin Size = _mapOptions.DefaultDialogSize; - using (LayoutHelper.SuspendAnchoring(mapControl, mapTipControl, buttonOK, buttonCancel)) { LayoutHelper.FixupOKCancel(buttonOK, buttonCancel); diff --git a/src/managed/OpenLiveWriter.InternalWriterPlugin/MapSidebarControl.cs b/src/managed/OpenLiveWriter.InternalWriterPlugin/MapSidebarControl.cs index 063eed3e..454c580f 100644 --- a/src/managed/OpenLiveWriter.InternalWriterPlugin/MapSidebarControl.cs +++ b/src/managed/OpenLiveWriter.InternalWriterPlugin/MapSidebarControl.cs @@ -127,7 +127,6 @@ namespace OpenLiveWriter.InternalWriterPlugin VirtualTransparency.VirtualPaint(this, pevent); } - private void ShowCustomizeMapDialog() { using (new WaitCursor()) @@ -386,7 +385,6 @@ namespace OpenLiveWriter.InternalWriterPlugin private static readonly string CUSTOM_MARGINS = Res.Get(StringId.MapCustomMargins); } - #region Component Designer generated code /// /// Required method for Designer support - do not modify @@ -702,6 +700,5 @@ namespace OpenLiveWriter.InternalWriterPlugin upDown.Select(0, upDown.Text.Length); } - } } diff --git a/src/managed/OpenLiveWriter.Interop.Mshtml/mshtml/DispDOMChildrenCollection.cs b/src/managed/OpenLiveWriter.Interop.Mshtml/mshtml/DispDOMChildrenCollection.cs index f3e153cc..4f33b533 100644 --- a/src/managed/OpenLiveWriter.Interop.Mshtml/mshtml/DispDOMChildrenCollection.cs +++ b/src/managed/OpenLiveWriter.Interop.Mshtml/mshtml/DispDOMChildrenCollection.cs @@ -8,7 +8,7 @@ namespace mshtml using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; - using System.Runtime.InteropServices.CustomMarshalers; + using System.Runtime.InteropServices.CustomMarshalers; [ComImport, DefaultMember("item"), TypeLibType((short) 0x1010), InterfaceType((short) 2), Guid("3050F577-98B5-11CF-BB82-00AA00BDCE0B")] public interface DispDOMChildrenCollection diff --git a/src/managed/OpenLiveWriter.Interop.Mshtml/mshtml/DispHTMLAreasCollection.cs b/src/managed/OpenLiveWriter.Interop.Mshtml/mshtml/DispHTMLAreasCollection.cs index 565cdd51..4f7bb8a6 100644 --- a/src/managed/OpenLiveWriter.Interop.Mshtml/mshtml/DispHTMLAreasCollection.cs +++ b/src/managed/OpenLiveWriter.Interop.Mshtml/mshtml/DispHTMLAreasCollection.cs @@ -8,7 +8,7 @@ namespace mshtml using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; - using System.Runtime.InteropServices.CustomMarshalers; + using System.Runtime.InteropServices.CustomMarshalers; [ComImport, Guid("3050F56A-98B5-11CF-BB82-00AA00BDCE0B"), InterfaceType((short) 2), TypeLibType((short) 0x1010), DefaultMember("item")] public interface DispHTMLAreasCollection diff --git a/src/managed/OpenLiveWriter.Interop.Mshtml/mshtml/DispHTMLAttributeCollection.cs b/src/managed/OpenLiveWriter.Interop.Mshtml/mshtml/DispHTMLAttributeCollection.cs index 3f2761bf..fb4d15e1 100644 --- a/src/managed/OpenLiveWriter.Interop.Mshtml/mshtml/DispHTMLAttributeCollection.cs +++ b/src/managed/OpenLiveWriter.Interop.Mshtml/mshtml/DispHTMLAttributeCollection.cs @@ -8,7 +8,7 @@ namespace mshtml using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; - using System.Runtime.InteropServices.CustomMarshalers; + using System.Runtime.InteropServices.CustomMarshalers; [ComImport, InterfaceType((short) 2), TypeLibType((short) 0x1010), DefaultMember("item"), Guid("3050F56C-98B5-11CF-BB82-00AA00BDCE0B")] public interface DispHTMLAttributeCollection diff --git a/src/managed/OpenLiveWriter.Interop.Mshtml/mshtml/DispHTMLElementCollection.cs b/src/managed/OpenLiveWriter.Interop.Mshtml/mshtml/DispHTMLElementCollection.cs index e5a6c573..88c37806 100644 --- a/src/managed/OpenLiveWriter.Interop.Mshtml/mshtml/DispHTMLElementCollection.cs +++ b/src/managed/OpenLiveWriter.Interop.Mshtml/mshtml/DispHTMLElementCollection.cs @@ -8,7 +8,7 @@ namespace mshtml using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; - using System.Runtime.InteropServices.CustomMarshalers; + using System.Runtime.InteropServices.CustomMarshalers; [ComImport, Guid("3050F56B-98B5-11CF-BB82-00AA00BDCE0B"), InterfaceType((short) 2), DefaultMember("item"), TypeLibType((short) 0x1010)] public interface DispHTMLElementCollection diff --git a/src/managed/OpenLiveWriter.Interop.Mshtml/mshtml/DispHTMLFormElement.cs b/src/managed/OpenLiveWriter.Interop.Mshtml/mshtml/DispHTMLFormElement.cs index dbe7bc9b..61debcfc 100644 --- a/src/managed/OpenLiveWriter.Interop.Mshtml/mshtml/DispHTMLFormElement.cs +++ b/src/managed/OpenLiveWriter.Interop.Mshtml/mshtml/DispHTMLFormElement.cs @@ -8,7 +8,7 @@ namespace mshtml using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; - using System.Runtime.InteropServices.CustomMarshalers; + using System.Runtime.InteropServices.CustomMarshalers; [ComImport, Guid("3050F510-98B5-11CF-BB82-00AA00BDCE0B"), InterfaceType((short) 2), DefaultMember("item"), TypeLibType((short) 0x1010)] public interface DispHTMLFormElement diff --git a/src/managed/OpenLiveWriter.Interop.Mshtml/mshtml/DispHTMLSelectElement.cs b/src/managed/OpenLiveWriter.Interop.Mshtml/mshtml/DispHTMLSelectElement.cs index 6717de51..5341aaa7 100644 --- a/src/managed/OpenLiveWriter.Interop.Mshtml/mshtml/DispHTMLSelectElement.cs +++ b/src/managed/OpenLiveWriter.Interop.Mshtml/mshtml/DispHTMLSelectElement.cs @@ -8,7 +8,7 @@ namespace mshtml using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; - using System.Runtime.InteropServices.CustomMarshalers; + using System.Runtime.InteropServices.CustomMarshalers; [ComImport, TypeLibType((short) 0x1010), InterfaceType((short) 2), DefaultMember("item"), Guid("3050F531-98B5-11CF-BB82-00AA00BDCE0B")] public interface DispHTMLSelectElement diff --git a/src/managed/OpenLiveWriter.Interop.Mshtml/mshtml/IBlockFormats.cs b/src/managed/OpenLiveWriter.Interop.Mshtml/mshtml/IBlockFormats.cs index fc0a2592..ab732660 100644 --- a/src/managed/OpenLiveWriter.Interop.Mshtml/mshtml/IBlockFormats.cs +++ b/src/managed/OpenLiveWriter.Interop.Mshtml/mshtml/IBlockFormats.cs @@ -8,7 +8,7 @@ namespace mshtml using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; - using System.Runtime.InteropServices.CustomMarshalers; + using System.Runtime.InteropServices.CustomMarshalers; [ComImport, DefaultMember("item"), Guid("3050F830-98B5-11CF-BB82-00AA00BDCE0B"), TypeLibType((short) 0x1000)] public interface IBlockFormats : IEnumerable diff --git a/src/managed/OpenLiveWriter.Interop.Mshtml/mshtml/IFontNames.cs b/src/managed/OpenLiveWriter.Interop.Mshtml/mshtml/IFontNames.cs index 75be4a97..da1e9cef 100644 --- a/src/managed/OpenLiveWriter.Interop.Mshtml/mshtml/IFontNames.cs +++ b/src/managed/OpenLiveWriter.Interop.Mshtml/mshtml/IFontNames.cs @@ -8,7 +8,7 @@ namespace mshtml using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; - using System.Runtime.InteropServices.CustomMarshalers; + using System.Runtime.InteropServices.CustomMarshalers; [ComImport, TypeLibType((short) 0x1000), DefaultMember("item"), Guid("3050F839-98B5-11CF-BB82-00AA00BDCE0B")] public interface IFontNames : IEnumerable diff --git a/src/managed/OpenLiveWriter.Interop.Mshtml/mshtml/IHTMLAreasCollection.cs b/src/managed/OpenLiveWriter.Interop.Mshtml/mshtml/IHTMLAreasCollection.cs index 4fdca7bd..2b660b9a 100644 --- a/src/managed/OpenLiveWriter.Interop.Mshtml/mshtml/IHTMLAreasCollection.cs +++ b/src/managed/OpenLiveWriter.Interop.Mshtml/mshtml/IHTMLAreasCollection.cs @@ -8,7 +8,7 @@ namespace mshtml using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; - using System.Runtime.InteropServices.CustomMarshalers; + using System.Runtime.InteropServices.CustomMarshalers; [ComImport, Guid("3050F383-98B5-11CF-BB82-00AA00BDCE0B"), TypeLibType((short) 0x1040), DefaultMember("item")] public interface IHTMLAreasCollection : IEnumerable diff --git a/src/managed/OpenLiveWriter.Interop.Mshtml/mshtml/IHTMLFontNamesCollection.cs b/src/managed/OpenLiveWriter.Interop.Mshtml/mshtml/IHTMLFontNamesCollection.cs index 682bd4af..8f73004b 100644 --- a/src/managed/OpenLiveWriter.Interop.Mshtml/mshtml/IHTMLFontNamesCollection.cs +++ b/src/managed/OpenLiveWriter.Interop.Mshtml/mshtml/IHTMLFontNamesCollection.cs @@ -8,7 +8,7 @@ namespace mshtml using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; - using System.Runtime.InteropServices.CustomMarshalers; + using System.Runtime.InteropServices.CustomMarshalers; [ComImport, DefaultMember("item"), TypeLibType((short) 0x1040), Guid("3050F376-98B5-11CF-BB82-00AA00BDCE0B")] public interface IHTMLFontNamesCollection : IEnumerable diff --git a/src/managed/OpenLiveWriter.Interop.Mshtml/mshtml/IHTMLFontSizesCollection.cs b/src/managed/OpenLiveWriter.Interop.Mshtml/mshtml/IHTMLFontSizesCollection.cs index aa879f01..cb6f622d 100644 --- a/src/managed/OpenLiveWriter.Interop.Mshtml/mshtml/IHTMLFontSizesCollection.cs +++ b/src/managed/OpenLiveWriter.Interop.Mshtml/mshtml/IHTMLFontSizesCollection.cs @@ -8,7 +8,7 @@ namespace mshtml using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; - using System.Runtime.InteropServices.CustomMarshalers; + using System.Runtime.InteropServices.CustomMarshalers; [ComImport, Guid("3050F377-98B5-11CF-BB82-00AA00BDCE0B"), TypeLibType((short) 0x1040), DefaultMember("item")] public interface IHTMLFontSizesCollection : IEnumerable diff --git a/src/managed/OpenLiveWriter.Interop.Mshtml/mshtml/IHTMLIPrintCollection.cs b/src/managed/OpenLiveWriter.Interop.Mshtml/mshtml/IHTMLIPrintCollection.cs index b108966a..69783a4c 100644 --- a/src/managed/OpenLiveWriter.Interop.Mshtml/mshtml/IHTMLIPrintCollection.cs +++ b/src/managed/OpenLiveWriter.Interop.Mshtml/mshtml/IHTMLIPrintCollection.cs @@ -8,7 +8,7 @@ namespace mshtml using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; - using System.Runtime.InteropServices.CustomMarshalers; + using System.Runtime.InteropServices.CustomMarshalers; [ComImport, DefaultMember("item"), Guid("3050F6B5-98B5-11CF-BB82-00AA00BDCE0B"), TypeLibType((short) 0x1040)] public interface IHTMLIPrintCollection : IEnumerable diff --git a/src/managed/OpenLiveWriter.Interop.Mshtml/mshtml/IHTMLTxtRangeCollection.cs b/src/managed/OpenLiveWriter.Interop.Mshtml/mshtml/IHTMLTxtRangeCollection.cs index 517fa300..de97a009 100644 --- a/src/managed/OpenLiveWriter.Interop.Mshtml/mshtml/IHTMLTxtRangeCollection.cs +++ b/src/managed/OpenLiveWriter.Interop.Mshtml/mshtml/IHTMLTxtRangeCollection.cs @@ -8,7 +8,7 @@ namespace mshtml using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; - using System.Runtime.InteropServices.CustomMarshalers; + using System.Runtime.InteropServices.CustomMarshalers; [ComImport, TypeLibType((short) 0x1040), Guid("3050F7ED-98B5-11CF-BB82-00AA00BDCE0B"), DefaultMember("item")] public interface IHTMLTxtRangeCollection : IEnumerable diff --git a/src/managed/OpenLiveWriter.Interop/Com/ActiveDocuments/IContinueCallback.cs b/src/managed/OpenLiveWriter.Interop/Com/ActiveDocuments/IContinueCallback.cs index 0373cf3a..b03bd054 100644 --- a/src/managed/OpenLiveWriter.Interop/Com/ActiveDocuments/IContinueCallback.cs +++ b/src/managed/OpenLiveWriter.Interop/Com/ActiveDocuments/IContinueCallback.cs @@ -5,21 +5,21 @@ using System.Runtime.InteropServices; namespace OpenLiveWriter.Interop.Com.ActiveDocuments { - /// - /// - /// - [ComImport] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - [Guid("b722bcca-4e68-101b-a2bc-00aa00404770")] - public interface IContinueCallback - { - [PreserveSig] - int FContinue() ; + /// + /// + /// + [ComImport] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + [Guid("b722bcca-4e68-101b-a2bc-00aa00404770")] + public interface IContinueCallback + { + [PreserveSig] + int FContinue() ; [PreserveSig] - int FContinuePrinting( - [In] int nCntPrinted, - [In] int nCurPage, - [In, MarshalAs(UnmanagedType.LPWStr)] string pwszPrintStatus ) ; - } + int FContinuePrinting( + [In] int nCntPrinted, + [In] int nCurPage, + [In, MarshalAs(UnmanagedType.LPWStr)] string pwszPrintStatus ) ; + } } diff --git a/src/managed/OpenLiveWriter.Interop/Com/ActiveDocuments/IOleInPlaceFrame.cs b/src/managed/OpenLiveWriter.Interop/Com/ActiveDocuments/IOleInPlaceFrame.cs index 9b357cdb..4a151155 100644 --- a/src/managed/OpenLiveWriter.Interop/Com/ActiveDocuments/IOleInPlaceFrame.cs +++ b/src/managed/OpenLiveWriter.Interop/Com/ActiveDocuments/IOleInPlaceFrame.cs @@ -60,7 +60,6 @@ namespace OpenLiveWriter.Interop.Com.ActiveDocuments [In] UInt16 wID); } - /// /// The OLEMENUGROUPWIDTHS structure is the mechanism for building a shared menu. /// It indicates the number of menu items in each of the six menu groups of a menu diff --git a/src/managed/OpenLiveWriter.Interop/Com/ActiveDocuments/IOleInPlaceSite.cs b/src/managed/OpenLiveWriter.Interop/Com/ActiveDocuments/IOleInPlaceSite.cs index 952e0112..117fae5e 100644 --- a/src/managed/OpenLiveWriter.Interop/Com/ActiveDocuments/IOleInPlaceSite.cs +++ b/src/managed/OpenLiveWriter.Interop/Com/ActiveDocuments/IOleInPlaceSite.cs @@ -51,7 +51,6 @@ namespace OpenLiveWriter.Interop.Com.ActiveDocuments [In] ref RECT lprcPosRect); } - public struct OLEINPLACEFRAMEINFO { public uint cb; diff --git a/src/managed/OpenLiveWriter.Interop/Com/ComHelper.cs b/src/managed/OpenLiveWriter.Interop/Com/ComHelper.cs index dd23773b..1f53597c 100644 --- a/src/managed/OpenLiveWriter.Interop/Com/ComHelper.cs +++ b/src/managed/OpenLiveWriter.Interop/Com/ComHelper.cs @@ -107,17 +107,17 @@ namespace OpenLiveWriter.Interop.Com rkCategories.CreateSubKey(categoryIID.ToString("B")); /* - // "New school" COM-based method for registering as a category - // implementor. Why don't we use this? First, it is incompatible - // with Win95 and NT prior to SP3. Second, when trying to use it - // to unregister a category we got a mysterious FileNotFound exception - // that the ICatManager documentattion implies should never happen. - // This was enough to scare us off of the bus..... - // - ICatRegister cr = (ICatRegister) new StdComponentCategoriesMgr(); - cr.RegisterClassImplCategories( - ref guid, 1, new Guid[] { categoryIID } ); - */ + // "New school" COM-based method for registering as a category + // implementor. Why don't we use this? First, it is incompatible + // with Win95 and NT prior to SP3. Second, when trying to use it + // to unregister a category we got a mysterious FileNotFound exception + // that the ICatManager documentattion implies should never happen. + // This was enough to scare us off of the bus..... + // + ICatRegister cr = (ICatRegister) new StdComponentCategoriesMgr(); + cr.RegisterClassImplCategories( + ref guid, 1, new Guid[] { categoryIID } ); + */ } } diff --git a/src/managed/OpenLiveWriter.Interop/Com/ComTypes.cs b/src/managed/OpenLiveWriter.Interop/Com/ComTypes.cs index 688dffd5..8185966f 100644 --- a/src/managed/OpenLiveWriter.Interop/Com/ComTypes.cs +++ b/src/managed/OpenLiveWriter.Interop/Com/ComTypes.cs @@ -61,7 +61,6 @@ namespace OpenLiveWriter.Interop.Com public const int E_POINTER = unchecked((int)0x80004003); } - /// /// Common OLE error codes /// diff --git a/src/managed/OpenLiveWriter.Interop/Com/DragDropAlphaBlender.cs b/src/managed/OpenLiveWriter.Interop/Com/DragDropAlphaBlender.cs index 4ffe4ecb..752bb228 100644 --- a/src/managed/OpenLiveWriter.Interop/Com/DragDropAlphaBlender.cs +++ b/src/managed/OpenLiveWriter.Interop/Com/DragDropAlphaBlender.cs @@ -7,166 +7,163 @@ using OpenLiveWriter.Interop.Windows; namespace OpenLiveWriter.Interop.Com { - /// - /// Helper class that implements the IDropSourceHelper and IDropTargetHelper - /// interfaces (cast the DragDropAlphaBlender) to these interfaces to get access - /// to them). Note that this class is only useful when working with native Ole - /// data objects (which .NET does not) so by and large it won't help us unless - /// we bypass all of .NET's data objects and work 100% with native Ole data - /// objects. - /// - [ComImport] - [Guid("4657278A-411B-11d2-839A-00C04FD918D0")] - public class DragDropAlphaBlender {} // implements IDropSourceHelper and IDropTargetHelper + /// + /// Helper class that implements the IDropSourceHelper and IDropTargetHelper + /// interfaces (cast the DragDropAlphaBlender) to these interfaces to get access + /// to them). Note that this class is only useful when working with native Ole + /// data objects (which .NET does not) so by and large it won't help us unless + /// we bypass all of .NET's data objects and work 100% with native Ole data + /// objects. + /// + [ComImport] + [Guid("4657278A-411B-11d2-839A-00C04FD918D0")] + public class DragDropAlphaBlender {} // implements IDropSourceHelper and IDropTargetHelper - /// - /// This interface allows drop targets to display a drag image while the image - /// is over the target window. This interface is implemented by DragDropHelper. - /// NOTE: The Data object must support IDataObject::SetData with multiple data - /// types and GetData must implement data type cloning(Including HGLOBAL), not - /// just aliasing. MFC does do this, not sure if .NET does.... - /// NOTE: Minimum OS requirements for this feature are Win2K and WinME. - /// - [ComImport] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - [Guid("4657278B-411B-11d2-839A-00C04FD918D0")] - public interface IDropTargetHelper - { - /// - /// Notifies the drag-image manager that the drop target's IDropTarget::DragEnter - /// method has been called. - /// - /// [in] Target's window handle. - /// [in] Pointer to the data object's IDataObject - /// interface. - /// [in] POINT structure pointer that was received in the - /// IDropTarget::DragEnter method's pt parameter - /// [in] Value pointed to by the IDropTarget::DragEnter - /// method's pdwEffect parameter. - void DragEnter( - [In] IntPtr hwndTarget, - [In, MarshalAs(UnmanagedType.IUnknown)] object pDataObject, - [In] ref POINT ppt, - [In] DROPEFFECT dwEffect ) ; + /// + /// This interface allows drop targets to display a drag image while the image + /// is over the target window. This interface is implemented by DragDropHelper. + /// NOTE: The Data object must support IDataObject::SetData with multiple data + /// types and GetData must implement data type cloning(Including HGLOBAL), not + /// just aliasing. MFC does do this, not sure if .NET does.... + /// NOTE: Minimum OS requirements for this feature are Win2K and WinME. + /// + [ComImport] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + [Guid("4657278B-411B-11d2-839A-00C04FD918D0")] + public interface IDropTargetHelper + { + /// + /// Notifies the drag-image manager that the drop target's IDropTarget::DragEnter + /// method has been called. + /// + /// [in] Target's window handle. + /// [in] Pointer to the data object's IDataObject + /// interface. + /// [in] POINT structure pointer that was received in the + /// IDropTarget::DragEnter method's pt parameter + /// [in] Value pointed to by the IDropTarget::DragEnter + /// method's pdwEffect parameter. + void DragEnter( + [In] IntPtr hwndTarget, + [In, MarshalAs(UnmanagedType.IUnknown)] object pDataObject, + [In] ref POINT ppt, + [In] DROPEFFECT dwEffect ) ; - /// - /// Notifies the drag-image manager that the drop target's - /// IDropTarget::DragLeave method has been called. - /// - void DragLeave() ; + /// + /// Notifies the drag-image manager that the drop target's + /// IDropTarget::DragLeave method has been called. + /// + void DragLeave() ; - /// - /// Notifies the drag-image manager that the drop target's - /// IDropTarget::DragOver method has been called. - /// - /// [in] POINT structure pointer that was received in the - /// IDropTarget::DragOver method's pt parameter. - /// [in] Value pointed to by the IDropTarget::DragOver - /// method's pdwEffect parameter. - void DragOver( - [In] ref POINT ppt, - [In] DROPEFFECT dwEffect ); + /// + /// Notifies the drag-image manager that the drop target's + /// IDropTarget::DragOver method has been called. + /// + /// [in] POINT structure pointer that was received in the + /// IDropTarget::DragOver method's pt parameter. + /// [in] Value pointed to by the IDropTarget::DragOver + /// method's pdwEffect parameter. + void DragOver( + [In] ref POINT ppt, + [In] DROPEFFECT dwEffect ); - /// - /// Notifies the drag-image manager that the drop target's IDropTarget::Drop - /// method has been called. - /// - /// [in] Pointer to the data object's IDataObject - /// interface. - /// [in] POINT structure pointer that was received in the - /// IDropTarget::Drop method's pt parameter - /// [in] Value pointed to by the IDropTarget::Drop - /// method's pdwEffect parameter. - void Drop( - [In, MarshalAs(UnmanagedType.IUnknown)] object pDataObject, - [In] ref POINT ppt, - [In] DROPEFFECT dwEffect ) ; + /// + /// Notifies the drag-image manager that the drop target's IDropTarget::Drop + /// method has been called. + /// + /// [in] Pointer to the data object's IDataObject + /// interface. + /// [in] POINT structure pointer that was received in the + /// IDropTarget::Drop method's pt parameter + /// [in] Value pointed to by the IDropTarget::Drop + /// method's pdwEffect parameter. + void Drop( + [In, MarshalAs(UnmanagedType.IUnknown)] object pDataObject, + [In] ref POINT ppt, + [In] DROPEFFECT dwEffect ) ; - /// - /// Notifies the drag-image manager to show or hide the drag image. - /// This method is provided for showing/hiding the Drag image in low color - /// depth video modes. When painting to a window that is currently being - /// dragged over (i.e. For indicating a selection) you need to hide the - /// drag image by calling this method passing FALSE. After the window is - /// done painting, Show the image again by passing TRUE. /// - /// - /// [in] Boolean value that is set to TRUE to show the - /// drag image, and FALSE to hide it. - void Show( - [In, MarshalAs(UnmanagedType.Bool)] bool fShow ) ; - } + /// + /// Notifies the drag-image manager to show or hide the drag image. + /// This method is provided for showing/hiding the Drag image in low color + /// depth video modes. When painting to a window that is currently being + /// dragged over (i.e. For indicating a selection) you need to hide the + /// drag image by calling this method passing FALSE. After the window is + /// done painting, Show the image again by passing TRUE. /// + /// + /// [in] Boolean value that is set to TRUE to show the + /// drag image, and FALSE to hide it. + void Show( + [In, MarshalAs(UnmanagedType.Bool)] bool fShow ) ; + } - /// - /// This interface is exposed by the Shell to allow an application to specify - /// the image that will be displayed during a Shell drag-and-drop operation. - /// This interface is implemented by DragDropHelper. - /// - [ComImport] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - [Guid("DE5BF786-477A-11d2-839D-00C04FD918D0")] - public interface IDragSourceHelper - { - /// - /// Initializes the drag-image manager for a windowless control. - /// - /// [in] SHDRAGIMAGE structure that contains information - /// about the bitmap. - /// [in] Pointer to the data object's IDataObject - /// interface. - void InitializeFromBitmap( - [In] ref SHDRAGIMAGE pshdi, - [In, MarshalAs(UnmanagedType.IUnknown)] object pDataObject ); + /// + /// This interface is exposed by the Shell to allow an application to specify + /// the image that will be displayed during a Shell drag-and-drop operation. + /// This interface is implemented by DragDropHelper. + /// + [ComImport] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + [Guid("DE5BF786-477A-11d2-839D-00C04FD918D0")] + public interface IDragSourceHelper + { + /// + /// Initializes the drag-image manager for a windowless control. + /// + /// [in] SHDRAGIMAGE structure that contains information + /// about the bitmap. + /// [in] Pointer to the data object's IDataObject + /// interface. + void InitializeFromBitmap( + [In] ref SHDRAGIMAGE pshdi, + [In, MarshalAs(UnmanagedType.IUnknown)] object pDataObject ); + + /// + /// Initializes the drag-image manager for a control with a window. + /// DragDropHelper will send a DI_GETDRAGIMAGE message to the specified + /// window. DI_GETDRAGIMAGE is defined in DI.GETDRAGIMAGE and must be + /// registered with RegisterWindowMessage. When the window specified + /// by hwnd receives the DI_GETDRAGIMAGE message, the lParam value + /// will hold a pointer to an SHDRAGIMAGE structure. The handler should + /// fill the structure with the drag image bitmap information. + /// + /// [in] Handle to the window that will receive the + /// DI_GETDRAGIMAGE message. + /// [in] Pointer to a POINT structure that specifies + /// the location of the cursor within the drag image. The structure should + /// contain the offset from the upper-left corner of the drag image to the + /// location of the cursor. + /// [in] Pointer to the data object's IDataObject + /// interface + void InitializeFromWindow( + [In] IntPtr hwnd, + [In] ref POINT ppt, + [In, MarshalAs(UnmanagedType.IUnknown)] object pDataObject ); + } - /// - /// Initializes the drag-image manager for a control with a window. - /// DragDropHelper will send a DI_GETDRAGIMAGE message to the specified - /// window. DI_GETDRAGIMAGE is defined in DI.GETDRAGIMAGE and must be - /// registered with RegisterWindowMessage. When the window specified - /// by hwnd receives the DI_GETDRAGIMAGE message, the lParam value - /// will hold a pointer to an SHDRAGIMAGE structure. The handler should - /// fill the structure with the drag image bitmap information. - /// - /// [in] Handle to the window that will receive the - /// DI_GETDRAGIMAGE message. - /// [in] Pointer to a POINT structure that specifies - /// the location of the cursor within the drag image. The structure should - /// contain the offset from the upper-left corner of the drag image to the - /// location of the cursor. - /// [in] Pointer to the data object's IDataObject - /// interface - void InitializeFromWindow( - [In] IntPtr hwnd, - [In] ref POINT ppt, - [In, MarshalAs(UnmanagedType.IUnknown)] object pDataObject ); - } + /// + /// Structure used to define a drag image + /// + [StructLayout(LayoutKind.Sequential, Pack=8)] // corresponds to #include in ShObj.h + public struct SHDRAGIMAGE + { + SIZE sizeDragImage; // OUT - The length and Width of the rendered image + POINT ptOffset; // OUT - The Offset from the mouse cursor to the upper left corner of the image + IntPtr hbmpDragImage; // OUT - The Bitmap containing the rendered drag images + uint crColorKey; // OUT - The COLORREF that has been blitted to the background of the images + } ; - - - /// - /// Structure used to define a drag image - /// - [StructLayout(LayoutKind.Sequential, Pack=8)] // corresponds to #include in ShObj.h - public struct SHDRAGIMAGE - { - SIZE sizeDragImage; // OUT - The length and Width of the rendered image - POINT ptOffset; // OUT - The Offset from the mouse cursor to the upper left corner of the image - IntPtr hbmpDragImage; // OUT - The Bitmap containing the rendered drag images - uint crColorKey; // OUT - The COLORREF that has been blitted to the background of the images - } ; - - - /// - /// Drag Image related window messages - /// - public struct DI - { - /// - /// This is sent to a window to get the rendered images to a bitmap (used - /// with IDragSourceHelper.InitializeFromWindow). Call RegisterWindowMessage - /// to get the ID - /// - public const string GETDRAGIMAGE = "ShellGetDragImage" ; - } + /// + /// Drag Image related window messages + /// + public struct DI + { + /// + /// This is sent to a window to get the rendered images to a bitmap (used + /// with IDragSourceHelper.InitializeFromWindow). Call RegisterWindowMessage + /// to get the ID + /// + public const string GETDRAGIMAGE = "ShellGetDragImage" ; + } } diff --git a/src/managed/OpenLiveWriter.Interop/Com/IDeskBand.cs b/src/managed/OpenLiveWriter.Interop/Com/IDeskBand.cs index 0abee22a..8ee36a07 100644 --- a/src/managed/OpenLiveWriter.Interop/Com/IDeskBand.cs +++ b/src/managed/OpenLiveWriter.Interop/Com/IDeskBand.cs @@ -113,7 +113,6 @@ namespace OpenLiveWriter.Interop.Com public Int32 crBkgnd; }; - /// /// Mask which determines which DESKBANDINFO fields are being requested /// @@ -183,7 +182,6 @@ namespace OpenLiveWriter.Interop.Com TRANSPARENT = 0x0004 } - /// /// Mode of operation for a band object /// diff --git a/src/managed/OpenLiveWriter.Interop/Com/IEnumFORMATETC.cs b/src/managed/OpenLiveWriter.Interop/Com/IEnumFORMATETC.cs index 806601cb..f97e5e1d 100644 --- a/src/managed/OpenLiveWriter.Interop/Com/IEnumFORMATETC.cs +++ b/src/managed/OpenLiveWriter.Interop/Com/IEnumFORMATETC.cs @@ -20,12 +20,12 @@ namespace OpenLiveWriter.Interop.Com IntPtr pceltFetched); /* - [PreserveSig] - int Next( - uint celt, - IntPtr rgelt, - IntPtr pceltFetched); - */ + [PreserveSig] + int Next( + uint celt, + IntPtr rgelt, + IntPtr pceltFetched); + */ [PreserveSig] int Skip(uint celt); @@ -37,4 +37,3 @@ namespace OpenLiveWriter.Interop.Com } - diff --git a/src/managed/OpenLiveWriter.Interop/Com/IExtractImage.cs b/src/managed/OpenLiveWriter.Interop/Com/IExtractImage.cs index 5edfb484..1bbdd848 100644 --- a/src/managed/OpenLiveWriter.Interop/Com/IExtractImage.cs +++ b/src/managed/OpenLiveWriter.Interop/Com/IExtractImage.cs @@ -44,4 +44,3 @@ namespace OpenLiveWriter.Interop.Com } - diff --git a/src/managed/OpenLiveWriter.Interop/Com/IInternetProtocol.cs b/src/managed/OpenLiveWriter.Interop/Com/IInternetProtocol.cs index 6a19d374..00aa0ff0 100644 --- a/src/managed/OpenLiveWriter.Interop/Com/IInternetProtocol.cs +++ b/src/managed/OpenLiveWriter.Interop/Com/IInternetProtocol.cs @@ -223,7 +223,6 @@ namespace OpenLiveWriter.Interop.Com void UnlockRequest(); } - /// /// This interface receives the reports and binding data from the asynchronous /// pluggable protocol. It is a free-threaded interface and can be called from @@ -284,7 +283,6 @@ namespace OpenLiveWriter.Interop.Com [In, MarshalAs(UnmanagedType.LPWStr)] string szStatusText); } - /// /// This interface is implemented by the system and provides data that the protocol /// might need to bind successfully. @@ -417,7 +415,6 @@ namespace OpenLiveWriter.Interop.Com [In] uint dwReserved); } - /// /// Contains state information about the protocol that is transparent to the /// transaction handler. @@ -445,7 +442,6 @@ namespace OpenLiveWriter.Interop.Com public uint cbData; } - /// /// Contains additional information on the requested binding operation. The /// meaning of this structure is specific to the type of asynchronous moniker. @@ -553,7 +549,6 @@ namespace OpenLiveWriter.Interop.Com public uint dwReserved; } - /// /// Contains values that determine the use of URL encoding during the binding /// operation. @@ -573,7 +568,6 @@ namespace OpenLiveWriter.Interop.Com URLENCODEDEXTRAINFO = 0x00000002 }; - /// /// Contains values that specify an action, such as an HTTP request, to be /// performed during the binding operation. @@ -703,7 +697,6 @@ namespace OpenLiveWriter.Interop.Com PTR_BIND_CONTEXT } - /// /// Contains the flags that control the asynchronous pluggable protocol handler. /// diff --git a/src/managed/OpenLiveWriter.Interop/Com/IOleCommandTarget.cs b/src/managed/OpenLiveWriter.Interop/Com/IOleCommandTarget.cs index 865a3c6f..8438d754 100644 --- a/src/managed/OpenLiveWriter.Interop/Com/IOleCommandTarget.cs +++ b/src/managed/OpenLiveWriter.Interop/Com/IOleCommandTarget.cs @@ -8,66 +8,65 @@ namespace OpenLiveWriter.Interop.Com { /* - /// - /// Generic COM/OLE command dispatching interface - /// - [ComImport] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - [Guid("b722bccb-4e68-101b-a2bc-00aa00404770")] - public interface IOleCommandTargetTest - { - /// - /// Queries the object for the status of one or more commands generated by user - /// interface events. Note that because we couldn't get COM interop to correctly - /// marshall the array of OLECMDs, our declaration of this interface supports - /// only querying for status on a single-command. This is not a problem as almost - /// all instances where you would implement IOleCommandTarget are for a single - /// command. Implementations should ASSERT that cCmds is 1 - /// - /// Unique identifier of the command group; can be NULL to - /// specify the standard group. All the commands that are passed in the prgCmds - /// array must belong to the group specified by pguidCmdGroup - /// The number of commands in the prgCmds array. For this - /// interface declaration (which doesn't support arrays of OLECMD) this value - /// MUST always be 1. - /// Reference to the command that is being queried for - /// its status -- this parameter should be filled in with the appropriate - /// values. - /// Pointer to an OLECMDTEXT structure in which to return - /// name and/or status information of a single command. Can be NULL to indicate - /// that the caller does not need this information. Note that because of - /// marshalling issues w/ the OLECMDTEXT structure (can't figure out how to - /// marshall it correctly) we required that this parameter be NULL (implementations - /// should Assert on this). Note that IE currently passes NULL for this parameter - /// for custom toolbar button implementations. - void QueryStatus( - IntPtr pguidCmdGroup, - uint cCmds, - IntPtr prgCmds, - IntPtr pCmdText); - - /// - /// Executes a specified command or displays help for a command - /// - /// Pointer to unique identifier of the command group; can be - /// NULL to specify the standard group - /// The command to be executed. This command must belong to the - /// group specified with pguidCmdGroup - /// Values taken from the OLECMDEXECOPT enumeration, which - /// describe how the object should execute the command - /// Pointer to a VARIANTARG structure containing input arguments. - /// Can be NULL - /// Pointer to a VARIANTARG structure to receive command output. - /// Can be NULL. - void Exec( - IntPtr pguidCmdGroup, - uint nCmdID, - OLECMDEXECOPT nCmdexecopt, - IntPtr pvaIn, - IntPtr pvaOut ) ; - } - */ + /// + /// Generic COM/OLE command dispatching interface + /// + [ComImport] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + [Guid("b722bccb-4e68-101b-a2bc-00aa00404770")] + public interface IOleCommandTargetTest + { + /// + /// Queries the object for the status of one or more commands generated by user + /// interface events. Note that because we couldn't get COM interop to correctly + /// marshall the array of OLECMDs, our declaration of this interface supports + /// only querying for status on a single-command. This is not a problem as almost + /// all instances where you would implement IOleCommandTarget are for a single + /// command. Implementations should ASSERT that cCmds is 1 + /// + /// Unique identifier of the command group; can be NULL to + /// specify the standard group. All the commands that are passed in the prgCmds + /// array must belong to the group specified by pguidCmdGroup + /// The number of commands in the prgCmds array. For this + /// interface declaration (which doesn't support arrays of OLECMD) this value + /// MUST always be 1. + /// Reference to the command that is being queried for + /// its status -- this parameter should be filled in with the appropriate + /// values. + /// Pointer to an OLECMDTEXT structure in which to return + /// name and/or status information of a single command. Can be NULL to indicate + /// that the caller does not need this information. Note that because of + /// marshalling issues w/ the OLECMDTEXT structure (can't figure out how to + /// marshall it correctly) we required that this parameter be NULL (implementations + /// should Assert on this). Note that IE currently passes NULL for this parameter + /// for custom toolbar button implementations. + void QueryStatus( + IntPtr pguidCmdGroup, + uint cCmds, + IntPtr prgCmds, + IntPtr pCmdText); + /// + /// Executes a specified command or displays help for a command + /// + /// Pointer to unique identifier of the command group; can be + /// NULL to specify the standard group + /// The command to be executed. This command must belong to the + /// group specified with pguidCmdGroup + /// Values taken from the OLECMDEXECOPT enumeration, which + /// describe how the object should execute the command + /// Pointer to a VARIANTARG structure containing input arguments. + /// Can be NULL + /// Pointer to a VARIANTARG structure to receive command output. + /// Can be NULL. + void Exec( + IntPtr pguidCmdGroup, + uint nCmdID, + OLECMDEXECOPT nCmdexecopt, + IntPtr pvaIn, + IntPtr pvaOut ) ; + } + */ /// /// Generic COM/OLE command dispatching interface @@ -187,7 +186,6 @@ namespace OpenLiveWriter.Interop.Com [In, Out] ref object pvaOut); } - /// /// Generic COM/OLE command dispatching interface. This version of the declaration /// allows for the passing of NULL for the input parmaeter and object for the diff --git a/src/managed/OpenLiveWriter.Interop/Com/IOleDataObject.cs b/src/managed/OpenLiveWriter.Interop/Com/IOleDataObject.cs index 9ad1474e..2360f932 100644 --- a/src/managed/OpenLiveWriter.Interop/Com/IOleDataObject.cs +++ b/src/managed/OpenLiveWriter.Interop/Com/IOleDataObject.cs @@ -160,7 +160,6 @@ namespace OpenLiveWriter.Interop.Com int EnumDAdvise(ref IntPtr ppEnumAdvise); } - /// /// Clipboard format strings /// @@ -174,7 +173,6 @@ namespace OpenLiveWriter.Interop.Com public const short UNICODETEXT = 13; } - /// /// EnumFormatEtc data-direction enumeration /// @@ -195,7 +193,6 @@ namespace OpenLiveWriter.Interop.Com public const int SAMEFORMATETC = unchecked((int)0x00040130L); } - /// /// Error codes returned by IDataObject methods /// @@ -214,7 +211,6 @@ namespace OpenLiveWriter.Interop.Com public const int TYMED = unchecked((int)0x80040069); } - /// /// The FORMATETC structure is a generalized Clipboard format. It is enhanced to /// encompass a target device, the aspect or view of the data, and a storage @@ -268,7 +264,6 @@ namespace OpenLiveWriter.Interop.Com public TYMED tymed; } - /// /// This structure is a generalized global memory handle used for data transfer /// operations by the IAdviseSink, IDataObject, and IOleCache interfaces diff --git a/src/managed/OpenLiveWriter.Interop/Com/IServiceProvider.cs b/src/managed/OpenLiveWriter.Interop/Com/IServiceProvider.cs index d78f788e..bfd85d28 100644 --- a/src/managed/OpenLiveWriter.Interop/Com/IServiceProvider.cs +++ b/src/managed/OpenLiveWriter.Interop/Com/IServiceProvider.cs @@ -28,7 +28,6 @@ namespace OpenLiveWriter.Interop.Com [Out, MarshalAs(UnmanagedType.Interface)] out Object Obj); } - /// /// Generic access mechanism to locate a GUID identified service. /// diff --git a/src/managed/OpenLiveWriter.Interop/Com/StreamMarshaler.cs b/src/managed/OpenLiveWriter.Interop/Com/StreamMarshaler.cs index 8887d2ac..04718e32 100644 --- a/src/managed/OpenLiveWriter.Interop/Com/StreamMarshaler.cs +++ b/src/managed/OpenLiveWriter.Interop/Com/StreamMarshaler.cs @@ -68,7 +68,6 @@ namespace OpenLiveWriter.Interop.Com return -1; } - // Marshal Managed to Native /// /// Marshals managed data to native diff --git a/src/managed/OpenLiveWriter.Interop/Com/StructuredStorage/IStorage.cs b/src/managed/OpenLiveWriter.Interop/Com/StructuredStorage/IStorage.cs index 1aee250f..239c5013 100644 --- a/src/managed/OpenLiveWriter.Interop/Com/StructuredStorage/IStorage.cs +++ b/src/managed/OpenLiveWriter.Interop/Com/StructuredStorage/IStorage.cs @@ -46,7 +46,6 @@ namespace OpenLiveWriter.Interop.Com.StructuredStorage out ComStream ppstm ); - /// /// Opens an existing stream object within this storage object in the specified access mode. /// diff --git a/src/managed/OpenLiveWriter.Interop/Com/StructuredStorage/Storage.cs b/src/managed/OpenLiveWriter.Interop/Com/StructuredStorage/Storage.cs index d817d8a2..8ed63ac1 100644 --- a/src/managed/OpenLiveWriter.Interop/Com/StructuredStorage/Storage.cs +++ b/src/managed/OpenLiveWriter.Interop/Com/StructuredStorage/Storage.cs @@ -394,13 +394,13 @@ namespace OpenLiveWriter.Interop.Com.StructuredStorage } #if FALSE - /// - /// Storage finalizer - /// - ~Storage() - { - //Debug.Assert(storage == null, "Object not disposed properly - Use Close or Dispose!"); - } + /// + /// Storage finalizer + /// + ~Storage() + { + //Debug.Assert(storage == null, "Object not disposed properly - Use Close or Dispose!"); + } #endif /// @@ -674,7 +674,6 @@ namespace OpenLiveWriter.Interop.Com.StructuredStorage } } - /// /// The storage's IStorage /// @@ -779,11 +778,9 @@ namespace OpenLiveWriter.Interop.Com.StructuredStorage return true; } - private IStorage storage; } - /// /// The IStorageOpener for compound files /// @@ -899,7 +896,6 @@ namespace OpenLiveWriter.Interop.Com.StructuredStorage } } - /// /// The StorageModes used when getting Storage and streams. /// diff --git a/src/managed/OpenLiveWriter.Interop/Com/StructuredStorage/StorageErrors.cs b/src/managed/OpenLiveWriter.Interop/Com/StructuredStorage/StorageErrors.cs index 2bca0cda..772b2e5e 100644 --- a/src/managed/OpenLiveWriter.Interop/Com/StructuredStorage/StorageErrors.cs +++ b/src/managed/OpenLiveWriter.Interop/Com/StructuredStorage/StorageErrors.cs @@ -364,10 +364,10 @@ namespace OpenLiveWriter.Interop.Com.StructuredStorage /*++ - MessageId's 0x0305 - 0x031f (inclusive) are reserved for **STORAGE** - copy protection errors. + MessageId's 0x0305 - 0x031f (inclusive) are reserved for **STORAGE** + copy protection errors. - --*/ + --*/ // // MessageId: STG_E_STATUS_COPY_PROTECTION_FAILURE // diff --git a/src/managed/OpenLiveWriter.Interop/Windows/Advapi32.cs b/src/managed/OpenLiveWriter.Interop/Windows/Advapi32.cs index 4e0a25fa..a8a4338f 100644 --- a/src/managed/OpenLiveWriter.Interop/Windows/Advapi32.cs +++ b/src/managed/OpenLiveWriter.Interop/Windows/Advapi32.cs @@ -24,7 +24,6 @@ namespace OpenLiveWriter.Interop.Windows UIntPtr hKey ); - [DllImport("Advapi32.dll", SetLastError = true)] public static extern int RegNotifyChangeKeyValue( UIntPtr hKey, diff --git a/src/managed/OpenLiveWriter.Interop/Windows/Crypt32.cs b/src/managed/OpenLiveWriter.Interop/Windows/Crypt32.cs index 3a525a68..eb29b276 100644 --- a/src/managed/OpenLiveWriter.Interop/Windows/Crypt32.cs +++ b/src/managed/OpenLiveWriter.Interop/Windows/Crypt32.cs @@ -139,7 +139,6 @@ namespace OpenLiveWriter.Interop.Windows } } - [DllImport("Crypt32.dll", SetLastError = true)] public static extern bool CryptProtectData( ref DATA_BLOB pDataIn, diff --git a/src/managed/OpenLiveWriter.Interop/Windows/Kernel32.cs b/src/managed/OpenLiveWriter.Interop/Windows/Kernel32.cs index 1ce656ed..83f69cc6 100644 --- a/src/managed/OpenLiveWriter.Interop/Windows/Kernel32.cs +++ b/src/managed/OpenLiveWriter.Interop/Windows/Kernel32.cs @@ -67,7 +67,6 @@ namespace OpenLiveWriter.Interop.Windows int dwMaximumWorkingSetSize ); - [DllImport("kernel32.dll")] public static extern bool Beep(int frequency, int duration); @@ -206,7 +205,6 @@ namespace OpenLiveWriter.Interop.Windows IntPtr lpExclude, IntPtr lpReserved); - /// /// Get an error code for the last error on this thread. /// IntPtr can be converted to a 32 bit Int. diff --git a/src/managed/OpenLiveWriter.Interop/Windows/Mapi32.cs b/src/managed/OpenLiveWriter.Interop/Windows/Mapi32.cs index 61a753d9..9201143f 100644 --- a/src/managed/OpenLiveWriter.Interop/Windows/Mapi32.cs +++ b/src/managed/OpenLiveWriter.Interop/Windows/Mapi32.cs @@ -6,176 +6,175 @@ using System.Runtime.InteropServices; namespace OpenLiveWriter.Interop.Windows { - /// - /// Summary description for Mapi32. - /// - public class Mapi32 - { - // Mapi functions, structures, and constants (based on declarations found - // in Microsoft Knowledge Base Article Q315653, SAMPLE: SimpleMAPIAssembly - // Demonstrates Use of Simple MAPI from a .NET Application at: - // http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q315653 + /// + /// Summary description for Mapi32. + /// + public class Mapi32 + { + // Mapi functions, structures, and constants (based on declarations found + // in Microsoft Knowledge Base Article Q315653, SAMPLE: SimpleMAPIAssembly + // Demonstrates Use of Simple MAPI from a .NET Application at: + // http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q315653 - /// - /// DLL to load MAPI entry points from - /// - private const string MAPIDLL = "mapi32.dll"; + /// + /// DLL to load MAPI entry points from + /// + private const string MAPIDLL = "mapi32.dll"; - /// - /// Begins a Simple MAPI session, loading the default message store provider - /// - [DllImport(MAPIDLL, CharSet=CharSet.Ansi)] - public static extern int MAPILogon( - int ulUIParam, - string lpszProfileName, - string lpszPassword, - int flFlags, - int ulReserved, - out int lplhSession); + /// + /// Begins a Simple MAPI session, loading the default message store provider + /// + [DllImport(MAPIDLL, CharSet=CharSet.Ansi)] + public static extern int MAPILogon( + int ulUIParam, + string lpszProfileName, + string lpszPassword, + int flFlags, + int ulReserved, + out int lplhSession); - /// - /// Ends a session with the messaging system. - /// - [DllImport(MAPIDLL, CharSet=CharSet.Ansi)] - public static extern int MAPILogoff( - int lhSession, - int ulUIParam, - int flFlags, - int ulReserved); + /// + /// Ends a session with the messaging system. + /// + [DllImport(MAPIDLL, CharSet=CharSet.Ansi)] + public static extern int MAPILogoff( + int lhSession, + int ulUIParam, + int flFlags, + int ulReserved); - /// - /// Sends a message using the messaging system. - /// - [DllImport(MAPIDLL, CharSet=CharSet.Ansi)] - public static extern int MAPISendMail( - int lhSession, - int ulUIParam, - IntPtr /*MapiMessage*/ lpMessage, - int flFlags, - int ulReserved); + /// + /// Sends a message using the messaging system. + /// + [DllImport(MAPIDLL, CharSet=CharSet.Ansi)] + public static extern int MAPISendMail( + int lhSession, + int ulUIParam, + IntPtr /*MapiMessage*/ lpMessage, + int flFlags, + int ulReserved); - } + } - /// - /// Structure that contains information about a MAPI mail messsage - /// - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] - public struct MapiMessage - { - public int ulReserved; - public String lpszSubject; - public String lpszNoteText; - public String lpszMessageType; - public String lpszDateReceived; - public String lpszConversationID; - public int flFlags; - public IntPtr lpOriginator; - public int nRecipCount; - public IntPtr lpRecips; - public int nFileCount; - public IntPtr /*MapiFileDesc[]*/ lpFiles; - }; + /// + /// Structure that contains information about a MAPI mail messsage + /// + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] + public struct MapiMessage + { + public int ulReserved; + public String lpszSubject; + public String lpszNoteText; + public String lpszMessageType; + public String lpszDateReceived; + public String lpszConversationID; + public int flFlags; + public IntPtr lpOriginator; + public int nRecipCount; + public IntPtr lpRecips; + public int nFileCount; + public IntPtr /*MapiFileDesc[]*/ lpFiles; + }; - /// - /// Structure that contains the MAPI recipient descriptor - /// - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] - public struct MapiRecipDesc - { - public int ulReserved; - public int ulReciptClass; - public String lpszName; - public String lpszAddress; - public int ulEIDSize; - public IntPtr lpEntryID; - } + /// + /// Structure that contains the MAPI recipient descriptor + /// + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] + public struct MapiRecipDesc + { + public int ulReserved; + public int ulReciptClass; + public String lpszName; + public String lpszAddress; + public int ulEIDSize; + public IntPtr lpEntryID; + } - /// - /// Structure that contains MAPI file attachment descriptor - /// - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] - public struct MapiFileDesc - { - public int ulReserved; - public int flFlags; - public int nPosition; - public String lpszPathName; - public String lpszFileName; - public IntPtr /*MapiFileTagExt*/ lpFileType; - }; + /// + /// Structure that contains MAPI file attachment descriptor + /// + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] + public struct MapiFileDesc + { + public int ulReserved; + public int flFlags; + public int nPosition; + public String lpszPathName; + public String lpszFileName; + public IntPtr /*MapiFileTagExt*/ lpFileType; + }; - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] - public struct MapiFileTagExt - { - public int Reserved; /* Reserved, must be zero. */ - public int cbTag; /* Size (in bytes) of */ - public String szTag; /* X.400 OID for this attachment type */ - public int cbEncoding; /* Size (in bytes) of */ - public String szEncoding; /* X.400 OID for this attachment's encoding */ - }; + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] + public struct MapiFileTagExt + { + public int Reserved; /* Reserved, must be zero. */ + public int cbTag; /* Size (in bytes) of */ + public String szTag; /* X.400 OID for this attachment type */ + public int cbEncoding; /* Size (in bytes) of */ + public String szEncoding; /* X.400 OID for this attachment's encoding */ + }; - /// - /// Structure containing MAPI error constants - /// - public struct MAPI - { - public const int SUCCESS_SUCCESS = 0; + /// + /// Structure containing MAPI error constants + /// + public struct MAPI + { + public const int SUCCESS_SUCCESS = 0; - public const int E_USER_ABORT = 1; - public const int E_FAILURE = 2; - public const int E_LOGIN_FAILURE = 3; - public const int E_DISK_FULL = 4; - public const int E_INSUFFICIENT_MEMORY = 5; - public const int E_BLK_TOO_SMALL = 6; - public const int E_TOO_MANY_SESSIONS = 8; - public const int E_TOO_MANY_FILES = 9; - public const int E_TOO_MANY_RECIPIENTS = 10; - public const int E_ATTACHMENT_NOT_FOUND = 11; - public const int E_ATTACHMENT_OPEN_FAILURE = 12; - public const int E_ATTACHMENT_WRITE_FAILURE = 13; - public const int E_UNKNOWN_RECIPIENT = 14; - public const int E_BAD_RECIPTYPE = 15; - public const int E_NO_MESSAGES = 16; - public const int E_INVALID_MESSAGE = 17; - public const int E_TEXT_TOO_LARGE = 18; - public const int E_INVALID_SESSION = 19; - public const int E_TYPE_NOT_SUPPORTED = 20; - public const int E_AMBIGUOUS_RECIPIENT = 21; - public const int E_MESSAGE_IN_USE = 22; - public const int E_NETWORK_FAILURE = 23; - public const int E_INVALID_EDITFIELDS = 24; - public const int E_INVALID_RECIPS = 25; - public const int E_NOT_SUPPORTED = 26; - public const int E_NO_LIBRARY = 999; - public const int E_INVALID_PARAMETER = 998; + public const int E_USER_ABORT = 1; + public const int E_FAILURE = 2; + public const int E_LOGIN_FAILURE = 3; + public const int E_DISK_FULL = 4; + public const int E_INSUFFICIENT_MEMORY = 5; + public const int E_BLK_TOO_SMALL = 6; + public const int E_TOO_MANY_SESSIONS = 8; + public const int E_TOO_MANY_FILES = 9; + public const int E_TOO_MANY_RECIPIENTS = 10; + public const int E_ATTACHMENT_NOT_FOUND = 11; + public const int E_ATTACHMENT_OPEN_FAILURE = 12; + public const int E_ATTACHMENT_WRITE_FAILURE = 13; + public const int E_UNKNOWN_RECIPIENT = 14; + public const int E_BAD_RECIPTYPE = 15; + public const int E_NO_MESSAGES = 16; + public const int E_INVALID_MESSAGE = 17; + public const int E_TEXT_TOO_LARGE = 18; + public const int E_INVALID_SESSION = 19; + public const int E_TYPE_NOT_SUPPORTED = 20; + public const int E_AMBIGUOUS_RECIPIENT = 21; + public const int E_MESSAGE_IN_USE = 22; + public const int E_NETWORK_FAILURE = 23; + public const int E_INVALID_EDITFIELDS = 24; + public const int E_INVALID_RECIPS = 25; + public const int E_NOT_SUPPORTED = 26; + public const int E_NO_LIBRARY = 999; + public const int E_INVALID_PARAMETER = 998; - public const int ORIG = 0; - public const int TO = 1; - public const int CC = 2; - public const int BCC = 3; + public const int ORIG = 0; + public const int TO = 1; + public const int CC = 2; + public const int BCC = 3; + public const int UNREAD = 1; + public const int RECEIPT_REQUESTED = 2; + public const int SENT = 4; - public const int UNREAD = 1; - public const int RECEIPT_REQUESTED = 2; - public const int SENT = 4; + public const int LOGON_UI = 0x1; + public const int NEW_SESSION = 0x2; + public const int DIALOG = 0x8; - public const int LOGON_UI = 0x1; - public const int NEW_SESSION = 0x2; - public const int DIALOG = 0x8; + public const int UNREAD_ONLY = 0x20; + public const int EXTENDED = 0x20; + public const int ENVELOPE_ONLY = 0x40; + public const int PEEK = 0x80; + public const int GUARANTEE_FIFO = 0x100; + public const int BODY_AS_FILE = 0x200; + public const int AB_NOMODIFY = 0x400; + public const int SUPPRESS_ATTACH = 0x800; + public const int FORCE_DOWNLOAD = 0x1000; + public const int LONG_MSGID = 0x4000; + public const int PASSWORD_UI = 0x20000; - public const int UNREAD_ONLY = 0x20; - public const int EXTENDED = 0x20; - public const int ENVELOPE_ONLY = 0x40; - public const int PEEK = 0x80; - public const int GUARANTEE_FIFO = 0x100; - public const int BODY_AS_FILE = 0x200; - public const int AB_NOMODIFY = 0x400; - public const int SUPPRESS_ATTACH = 0x800; - public const int FORCE_DOWNLOAD = 0x1000; - public const int LONG_MSGID = 0x4000; - public const int PASSWORD_UI = 0x20000; - - public const int OLE = 0x1; - public const int OLE_STATIC = 0x2; - } + public const int OLE = 0x1; + public const int OLE_STATIC = 0x2; + } } diff --git a/src/managed/OpenLiveWriter.Interop/Windows/Mpr.cs b/src/managed/OpenLiveWriter.Interop/Windows/Mpr.cs index f42e6f54..b25cdbf3 100644 --- a/src/managed/OpenLiveWriter.Interop/Windows/Mpr.cs +++ b/src/managed/OpenLiveWriter.Interop/Windows/Mpr.cs @@ -7,82 +7,82 @@ using System.Runtime.InteropServices; namespace OpenLiveWriter.Interop.Windows { - public class Mpr - { - public const int UNIVERSAL_NAME_INFO_LEVEL = 0x00000001; + public class Mpr + { + public const int UNIVERSAL_NAME_INFO_LEVEL = 0x00000001; - [DllImport("mpr.dll", CharSet=CharSet.Auto)] - public static extern int WNetGetUniversalName( - [In, MarshalAs(UnmanagedType.LPTStr)] string lpLocalPath, - [In] int dwInfoLevel, - [In] IntPtr buffer, - [In, Out] ref int bufferSize); + [DllImport("mpr.dll", CharSet=CharSet.Auto)] + public static extern int WNetGetUniversalName( + [In, MarshalAs(UnmanagedType.LPTStr)] string lpLocalPath, + [In] int dwInfoLevel, + [In] IntPtr buffer, + [In, Out] ref int bufferSize); - public struct UNIVERSAL_NAME_INFO - { - [MarshalAs(UnmanagedType.LPTStr)] public string lpUniversalName; - } + public struct UNIVERSAL_NAME_INFO + { + [MarshalAs(UnmanagedType.LPTStr)] public string lpUniversalName; + } - /// - /// Get the UNC path of a file/dir on a locally mounted network share. - /// Returns null if the path cannot be mapped to UNC for any reason. - /// - public static string GetUniversalName(string path) - { - return GetUniversalName(path, 100); - } + /// + /// Get the UNC path of a file/dir on a locally mounted network share. + /// Returns null if the path cannot be mapped to UNC for any reason. + /// + public static string GetUniversalName(string path) + { + return GetUniversalName(path, 100); + } - protected static string GetUniversalName(string path, int bufferSize) - { - IntPtr buffer = IntPtr.Zero ; - try - { - buffer = Marshal.AllocHGlobal(bufferSize) ; + protected static string GetUniversalName(string path, int bufferSize) + { + IntPtr buffer = IntPtr.Zero ; + try + { + buffer = Marshal.AllocHGlobal(bufferSize) ; - int oldBufferSize = bufferSize; + int oldBufferSize = bufferSize; - int errorCode = - WNetGetUniversalName(path, UNIVERSAL_NAME_INFO_LEVEL, buffer, ref bufferSize); + int errorCode = + WNetGetUniversalName(path, UNIVERSAL_NAME_INFO_LEVEL, buffer, ref bufferSize); - if (errorCode == ERROR.SUCCESS) - { - // all clear - UNIVERSAL_NAME_INFO uni = - (UNIVERSAL_NAME_INFO) Marshal.PtrToStructure( buffer, typeof(UNIVERSAL_NAME_INFO) ) ; + if (errorCode == ERROR.SUCCESS) + { + // all clear + UNIVERSAL_NAME_INFO uni = + (UNIVERSAL_NAME_INFO) Marshal.PtrToStructure( buffer, typeof(UNIVERSAL_NAME_INFO) ) ; - return uni.lpUniversalName ; - } - else if (errorCode == ERROR.MORE_DATA) - { - Debug.Assert( bufferSize > oldBufferSize ) ; + return uni.lpUniversalName ; + } + else if (errorCode == ERROR.MORE_DATA) + { + Debug.Assert( bufferSize > oldBufferSize ) ; - // more data avilable.... - return GetUniversalName(path,bufferSize); - } - else - { - // error occurred... probably invalid path or device went away + // more data avilable.... + return GetUniversalName(path,bufferSize); + } + else + { + // error occurred... probably invalid path or device went away - // Call Debug.Fail on unexpected errors - switch (errorCode) - { - // these two errors are expected - case ERROR.BAD_DEVICE: - case ERROR.NOT_CONNECTED: - break; - default: - Debug.WriteLine("Encountered error " + errorCode + " while trying to get universal name for " + path); - break; - } + // Call Debug.Fail on unexpected errors + switch (errorCode) + { + // these two errors are expected + case ERROR.BAD_DEVICE: + case ERROR.NOT_CONNECTED: + break; + default: + Debug.WriteLine("Encountered error " + errorCode + " while trying to get universal name for " + path); + break; + } - return null; - } - } - finally - { - if (buffer != IntPtr.Zero) - Marshal.FreeHGlobal(buffer); - } - } - } + return null; + } + } + finally + { + if (buffer != IntPtr.Zero) + Marshal.FreeHGlobal(buffer); + } + } + } } diff --git a/src/managed/OpenLiveWriter.Interop/Windows/Psapi.cs b/src/managed/OpenLiveWriter.Interop/Windows/Psapi.cs index 98705320..eadf0784 100644 --- a/src/managed/OpenLiveWriter.Interop/Windows/Psapi.cs +++ b/src/managed/OpenLiveWriter.Interop/Windows/Psapi.cs @@ -23,7 +23,6 @@ namespace OpenLiveWriter.Interop.Windows uint nSize ); - [DllImport("psapi.dll", SetLastError = true, CharSet = CharSet.Auto)] public static extern bool EnumProcessModules( IntPtr hProcess, diff --git a/src/managed/OpenLiveWriter.Interop/Windows/Shell32.cs b/src/managed/OpenLiveWriter.Interop/Windows/Shell32.cs index f6aab3ae..0bec8455 100644 --- a/src/managed/OpenLiveWriter.Interop/Windows/Shell32.cs +++ b/src/managed/OpenLiveWriter.Interop/Windows/Shell32.cs @@ -102,7 +102,6 @@ namespace OpenLiveWriter.Interop.Windows public static extern void GetCurrentProcessExplicitAppUserModelID( [Out(), MarshalAs(UnmanagedType.LPWStr)] out string AppID); - [DllImport("shell32.dll")] public static extern int SHGetPropertyStoreForWindow( IntPtr hwnd, diff --git a/src/managed/OpenLiveWriter.Interop/Windows/Shlwapi.cs b/src/managed/OpenLiveWriter.Interop/Windows/Shlwapi.cs index 6cc2a304..a651d441 100644 --- a/src/managed/OpenLiveWriter.Interop/Windows/Shlwapi.cs +++ b/src/managed/OpenLiveWriter.Interop/Windows/Shlwapi.cs @@ -85,7 +85,6 @@ namespace OpenLiveWriter.Interop.Windows [In] uint dwReserved); - /// /// Searches for and retrieves a file association-related string from the registry. /// @@ -226,5 +225,4 @@ namespace OpenLiveWriter.Interop.Windows public const uint AUTOAPPEND_FORCE_OFF = 0x80000000; // Ignore the registry default and force the feature off. (Also know as AutoComplete) } - } diff --git a/src/managed/OpenLiveWriter.Interop/Windows/User32.cs b/src/managed/OpenLiveWriter.Interop/Windows/User32.cs index e18e92bc..f20cac83 100644 --- a/src/managed/OpenLiveWriter.Interop/Windows/User32.cs +++ b/src/managed/OpenLiveWriter.Interop/Windows/User32.cs @@ -102,7 +102,6 @@ namespace OpenLiveWriter.Interop.Windows bool bErase // erase state ); - [DllImport("User32.dll")] public static extern bool UpdateWindow( IntPtr hWnd // handle to window @@ -132,7 +131,6 @@ namespace OpenLiveWriter.Interop.Windows [DllImport("User32.dll")] public static extern bool IsWindowVisible(IntPtr hWnd); - [DllImport("User32.dll", CharSet = CharSet.Auto)] public static extern bool SetWindowText( IntPtr hWnd, @@ -310,7 +308,6 @@ namespace OpenLiveWriter.Interop.Windows [DllImport("user32.dll", SetLastError = true)] public static extern bool UnregisterHotKey(IntPtr hWnd, int id); - [DllImport("User32.dll")] public static extern bool PeekMessage(out MSG lpMsg, IntPtr hWnd, uint wMsgFilterMin, uint wMsgFilterMax, uint wRemoveMsg); @@ -418,7 +415,6 @@ namespace OpenLiveWriter.Interop.Windows [DllImport("user32.dll")] public static extern bool EnableMenuItem(IntPtr hMenu, uint uIDEnableItem, uint uEnable); - /// /// Registers a new clipboard format. This format can then be used as a valid /// clipboard format. Return value is an integer id representing the format. @@ -740,7 +736,6 @@ namespace OpenLiveWriter.Interop.Windows /// public delegate IntPtr WndProcDelegate(IntPtr hWnd, uint uMsg, IntPtr wParam, IntPtr lParam); - public struct WINDOWPLACEMENT { public uint length; @@ -778,7 +773,6 @@ namespace OpenLiveWriter.Interop.Windows public const uint DISABLED = 0x00000002; } - public struct PM { public const uint NOREMOVE = 0x0000; @@ -979,7 +973,6 @@ namespace OpenLiveWriter.Interop.Windows public const int HELP = 9; } - public struct WPF { public const int RESTORETOMAXIMIZED = 0x0002; @@ -1039,7 +1032,6 @@ namespace OpenLiveWriter.Interop.Windows } - /// /// Window field offsets for GetWindowLong(). /// @@ -1335,7 +1327,6 @@ namespace OpenLiveWriter.Interop.Windows public static readonly IntPtr MESSAGE = new IntPtr(-3); } - /// /// Hook codes passed to HookDelegate /// @@ -1675,5 +1666,4 @@ namespace OpenLiveWriter.Interop.Windows public IntPtr ipFile; }; - } diff --git a/src/managed/OpenLiveWriter.Interop/Windows/WinInet.cs b/src/managed/OpenLiveWriter.Interop/Windows/WinInet.cs index 56ceb86d..6b859cda 100644 --- a/src/managed/OpenLiveWriter.Interop/Windows/WinInet.cs +++ b/src/managed/OpenLiveWriter.Interop/Windows/WinInet.cs @@ -523,7 +523,6 @@ namespace OpenLiveWriter.Interop.Windows } - /// /// Enumeration of WinInet option flags /// @@ -869,7 +868,6 @@ namespace OpenLiveWriter.Interop.Windows public const int HTTP = 3; } - /// /// Error codes that can be returned for WinInet Errors. /// Use kernel32 GetLastError() to get the last error on the thread diff --git a/src/managed/OpenLiveWriter.Interop/Windows/WinMm.cs b/src/managed/OpenLiveWriter.Interop/Windows/WinMm.cs index 138743d6..d9aeff7e 100644 --- a/src/managed/OpenLiveWriter.Interop/Windows/WinMm.cs +++ b/src/managed/OpenLiveWriter.Interop/Windows/WinMm.cs @@ -5,46 +5,45 @@ using System.Runtime.InteropServices; namespace OpenLiveWriter.Interop.Windows { - /// - /// Summary description for WinMm. - /// - public class WinMm - { + /// + /// Summary description for WinMm. + /// + public class WinMm + { - public static void PlaySoundFile(string filePath) - { - PlaySound(filePath, 0, SND.ALIAS|SND.NOWAIT|SND.FILENAME); - } + public static void PlaySoundFile(string filePath) + { + PlaySound(filePath, 0, SND.ALIAS|SND.NOWAIT|SND.FILENAME); + } - public static void PlaySystemSound(string soundName) - { - PlaySound(soundName, 0, SND.ASYNC|SND.NOWAIT|SND.ALIAS); - } + public static void PlaySystemSound(string soundName) + { + PlaySound(soundName, 0, SND.ASYNC|SND.NOWAIT|SND.ALIAS); + } - [DllImport("WinMm.dll")] - public static extern void PlaySound( - string pszSound, uint hmod, uint fdwSound); + [DllImport("WinMm.dll")] + public static extern void PlaySound( + string pszSound, uint hmod, uint fdwSound); + /// + /// Enumeration of internet states + /// + public struct SND + { + public const uint SYNC = 0x0000; /* play synchronously (default) */ + public const uint ASYNC = 0x0001; /* play asynchronously */ + public const uint NODEFAULT = 0x0002; /* silence (!default) if sound not found */ + public const uint MEMORY = 0x0004; /* pszSound points to a memory file */ + public const uint LOOP = 0x0008; /* loop the sound until next sndPlaySound */ + public const uint NOSTOP = 0x0010; /* don't stop any currently playing sound */ - /// - /// Enumeration of internet states - /// - public struct SND - { - public const uint SYNC = 0x0000; /* play synchronously (default) */ - public const uint ASYNC = 0x0001; /* play asynchronously */ - public const uint NODEFAULT = 0x0002; /* silence (!default) if sound not found */ - public const uint MEMORY = 0x0004; /* pszSound points to a memory file */ - public const uint LOOP = 0x0008; /* loop the sound until next sndPlaySound */ - public const uint NOSTOP = 0x0010; /* don't stop any currently playing sound */ - - public const uint NOWAIT = 0x00002000; /* don't wait if the driver is busy */ - public const uint ALIAS = 0x00010000; /* name is a registry alias */ - public const uint ALIAS_ID = 0x00110000; /* alias is a predefined ID */ - public const uint FILENAME = 0x00020000; /* name is file name */ - public const uint RESOURCE = 0x00040004; /* name is resource name or atom */ - public const uint PURGE = 0x0040; /* purge non-static events for task */ - public const uint APPLICATION = 0x0080; /* look for application specific association */ - } - } + public const uint NOWAIT = 0x00002000; /* don't wait if the driver is busy */ + public const uint ALIAS = 0x00010000; /* name is a registry alias */ + public const uint ALIAS_ID = 0x00110000; /* alias is a predefined ID */ + public const uint FILENAME = 0x00020000; /* name is file name */ + public const uint RESOURCE = 0x00040004; /* name is resource name or atom */ + public const uint PURGE = 0x0040; /* purge non-static events for task */ + public const uint APPLICATION = 0x0080; /* look for application specific association */ + } + } } diff --git a/src/managed/OpenLiveWriter.Localization/Bidi/BidiHelper.cs b/src/managed/OpenLiveWriter.Localization/Bidi/BidiHelper.cs index 9d178519..ecea1080 100644 --- a/src/managed/OpenLiveWriter.Localization/Bidi/BidiHelper.cs +++ b/src/managed/OpenLiveWriter.Localization/Bidi/BidiHelper.cs @@ -172,7 +172,6 @@ namespace OpenLiveWriter.Localization.Bidi return mirrored; } - } } diff --git a/src/managed/OpenLiveWriter.Localization/CultureHelper.cs b/src/managed/OpenLiveWriter.Localization/CultureHelper.cs index a08c3a2a..ef909e15 100644 --- a/src/managed/OpenLiveWriter.Localization/CultureHelper.cs +++ b/src/managed/OpenLiveWriter.Localization/CultureHelper.cs @@ -28,7 +28,7 @@ namespace OpenLiveWriter.Localization /// Applies the given culture name to the current thread. /// /// - public static void ApplyUICulture(string cultureName) + public static void ApplyUICulture(string cultureName) { if (cultureName == null) { diff --git a/src/managed/OpenLiveWriter.Mshtml/MarkupPointer.cs b/src/managed/OpenLiveWriter.Mshtml/MarkupPointer.cs index 48f4e1ec..e52e4c58 100644 --- a/src/managed/OpenLiveWriter.Mshtml/MarkupPointer.cs +++ b/src/managed/OpenLiveWriter.Mshtml/MarkupPointer.cs @@ -276,7 +276,6 @@ namespace OpenLiveWriter.Mshtml PointerRaw.Left(move, out context.Context, out context.Element, IntPtr.Zero, IntPtr.Zero); } - public IHTMLElement SeekElementLeft(IHTMLElementFilter filter) { return SeekElementLeft(filter, null); @@ -330,7 +329,6 @@ namespace OpenLiveWriter.Mshtml } - /// /// Moves the pointer adjacent to an element. /// diff --git a/src/managed/OpenLiveWriter.Mshtml/MshtmlCommands.cs b/src/managed/OpenLiveWriter.Mshtml/MshtmlCommands.cs index f35e6c1a..7748a4ef 100644 --- a/src/managed/OpenLiveWriter.Mshtml/MshtmlCommands.cs +++ b/src/managed/OpenLiveWriter.Mshtml/MshtmlCommands.cs @@ -58,7 +58,6 @@ namespace OpenLiveWriter.Mshtml /// output parameter void Execute(OLECMDEXECOPT execOption, object input, ref object output); - /// /// Get the value of the command /// @@ -66,7 +65,6 @@ namespace OpenLiveWriter.Mshtml object GetValue(); } - /// /// Core command set exposed by MSHTML /// @@ -195,7 +193,6 @@ namespace OpenLiveWriter.Mshtml private IOleCommandTargetWithExecParams commandTarget; } - /// /// Class which implements access to an MSHTML command that is defined as /// part of the core command set @@ -260,7 +257,6 @@ namespace OpenLiveWriter.Mshtml } } - /// /// Execute the command without parameters /// @@ -325,7 +321,6 @@ namespace OpenLiveWriter.Mshtml } - /// /// Get the value of the command /// @@ -373,7 +368,6 @@ namespace OpenLiveWriter.Mshtml } - /// /// Constant representing the Guid of the MSHTML core command set /// diff --git a/src/managed/OpenLiveWriter.Mshtml/MshtmlControl.cs b/src/managed/OpenLiveWriter.Mshtml/MshtmlControl.cs index e1e178b6..1364af0d 100644 --- a/src/managed/OpenLiveWriter.Mshtml/MshtmlControl.cs +++ b/src/managed/OpenLiveWriter.Mshtml/MshtmlControl.cs @@ -164,7 +164,6 @@ namespace OpenLiveWriter.Mshtml _editMode = editMode; } - /// /// Load the contents of the Mshtml control from a URL /// @@ -303,7 +302,6 @@ namespace OpenLiveWriter.Mshtml } bool _editMode = false; - /// /// Get or set the HTML text contents of the control /// @@ -582,10 +580,8 @@ namespace OpenLiveWriter.Mshtml #endregion - #region Command Execution - /// /// Execute an MSHTML command /// @@ -625,10 +621,8 @@ namespace OpenLiveWriter.Mshtml } } - #endregion - #region Helpers for Initialization and Release of MSHTML /// @@ -1176,7 +1170,6 @@ namespace OpenLiveWriter.Mshtml ComHelper.Return(HRESULT.E_NOTIMPL); } - /// /// Sets and displays status text about the in-place object in the container's /// frame window status line. @@ -1542,7 +1535,6 @@ namespace OpenLiveWriter.Mshtml } - /// /// Handle OnGotFocus so that when the parent UserControl receives /// input focus via the keyboard we can forward the focus on to the diff --git a/src/managed/OpenLiveWriter.Mshtml/MshtmlDocumentEvents.cs b/src/managed/OpenLiveWriter.Mshtml/MshtmlDocumentEvents.cs index 824de48b..54fcc3e1 100644 --- a/src/managed/OpenLiveWriter.Mshtml/MshtmlDocumentEvents.cs +++ b/src/managed/OpenLiveWriter.Mshtml/MshtmlDocumentEvents.cs @@ -243,7 +243,6 @@ namespace OpenLiveWriter.Mshtml } private event HtmlEventHandler DoubleClickEventHandler; - /// /// Event raised when the mouse is pressed down. /// @@ -463,7 +462,6 @@ namespace OpenLiveWriter.Mshtml LostFocusEventHandler(this, EventArgs.Empty); } - ///////////////////////////////////////////////////////////////////////////////// // HTMLDocumentEvents2 no-op event handlers -- As we need to handle the various // events we will fill in the implementations. NOTE that even though the MSDN diff --git a/src/managed/OpenLiveWriter.Mshtml/MshtmlEditor.cs b/src/managed/OpenLiveWriter.Mshtml/MshtmlEditor.cs index b8486fee..14ed4ba3 100644 --- a/src/managed/OpenLiveWriter.Mshtml/MshtmlEditor.cs +++ b/src/managed/OpenLiveWriter.Mshtml/MshtmlEditor.cs @@ -154,7 +154,6 @@ namespace OpenLiveWriter.Mshtml base.Dispose(disposing); } - /// /// Watch for document being complete to do the remainder of our /// initialization (some initialization can only be done once the @@ -332,7 +331,6 @@ editingOption.Key, editingOption.Value, ex.ToString())); IsDirty = false; } - #endregion #region Public Properties @@ -946,7 +944,6 @@ editingOption.Key, editingOption.Value, ex.ToString())); ppDispatch = IntPtr.Zero; } - /// /// Delegate to DragAndDropManager for GetDropTarget /// @@ -993,7 +990,6 @@ editingOption.Key, editingOption.Value, ex.ToString())); return HRESULT.S_FALSE; } - #endregion #region Implementation of IHTMLEditDesigner @@ -1058,7 +1054,6 @@ editingOption.Key, editingOption.Value, ex.ToString())); return false; } - /// /// Custom processing for keyboard input /// diff --git a/src/managed/OpenLiveWriter.Mshtml/MshtmlElementBehavior.cs b/src/managed/OpenLiveWriter.Mshtml/MshtmlElementBehavior.cs index f2bfdd70..0c3b4bef 100644 --- a/src/managed/OpenLiveWriter.Mshtml/MshtmlElementBehavior.cs +++ b/src/managed/OpenLiveWriter.Mshtml/MshtmlElementBehavior.cs @@ -108,7 +108,7 @@ namespace OpenLiveWriter.Mshtml /// that methods that may be called after a behavior has been detached (i.e. event handlers) check to make /// sure the behavior is still attached and the associated HTMLElement is not null before executing. /// - public bool Attached + public bool Attached { get { diff --git a/src/managed/OpenLiveWriter.Mshtml/Mshtml_Interop/ICustomDoc.cs b/src/managed/OpenLiveWriter.Mshtml/Mshtml_Interop/ICustomDoc.cs index f39d2719..e3403f1f 100644 --- a/src/managed/OpenLiveWriter.Mshtml/Mshtml_Interop/ICustomDoc.cs +++ b/src/managed/OpenLiveWriter.Mshtml/Mshtml_Interop/ICustomDoc.cs @@ -18,4 +18,3 @@ namespace OpenLiveWriter.Mshtml } } - diff --git a/src/managed/OpenLiveWriter.Mshtml/Mshtml_Interop/IDocHostShowUIBaseImpl.cs b/src/managed/OpenLiveWriter.Mshtml/Mshtml_Interop/IDocHostShowUIBaseImpl.cs index 2b9beae6..ffc0cce3 100644 --- a/src/managed/OpenLiveWriter.Mshtml/Mshtml_Interop/IDocHostShowUIBaseImpl.cs +++ b/src/managed/OpenLiveWriter.Mshtml/Mshtml_Interop/IDocHostShowUIBaseImpl.cs @@ -30,4 +30,3 @@ namespace OpenLiveWriter.Mshtml } - diff --git a/src/managed/OpenLiveWriter.Mshtml/Mshtml_Interop/IInternetSecurityManager.cs b/src/managed/OpenLiveWriter.Mshtml/Mshtml_Interop/IInternetSecurityManager.cs index 92b17918..4e0c5291 100644 --- a/src/managed/OpenLiveWriter.Mshtml/Mshtml_Interop/IInternetSecurityManager.cs +++ b/src/managed/OpenLiveWriter.Mshtml/Mshtml_Interop/IInternetSecurityManager.cs @@ -223,7 +223,7 @@ namespace OpenLiveWriter.Mshtml.Mshtml_Interop #endregion #if false - MIDL_INTERFACE("79eac9ee-baf9-11ce-8c82-00aa004ba90b") + MIDL_INTERFACE("79eac9ee-baf9-11ce-8c82-00aa004ba90b") IInternetSecurityManager : public IUnknown { public: diff --git a/src/managed/OpenLiveWriter.PostEditor/AboutForm.cs b/src/managed/OpenLiveWriter.PostEditor/AboutForm.cs index bec6f17d..403b3379 100644 --- a/src/managed/OpenLiveWriter.PostEditor/AboutForm.cs +++ b/src/managed/OpenLiveWriter.PostEditor/AboutForm.cs @@ -39,8 +39,8 @@ namespace OpenLiveWriter.PostEditor // Copyright notices are not to be localized. string[] credits = { - /* XmpMetadata.cs */ "Portions Copyright © 2011 Omar Shahine, licensed under Creative Commons Attribution 3.0 Unported License.", - /* Brian Lambert */ "Portions Copyright © 2003 Brian Lambert, used with permission of the author under the MIT License.", + /* XmpMetadata.cs */ "Portions Copyright © 2011 Omar Shahine, licensed under Creative Commons Attribution 3.0 Unported License.", + /* Brian Lambert */ "Portions Copyright © 2003 Brian Lambert, used with permission of the author under the MIT License.", }; public AboutForm() @@ -116,7 +116,6 @@ namespace OpenLiveWriter.PostEditor } } - /// /// Clean up any resources being used. /// diff --git a/src/managed/OpenLiveWriter.PostEditor/AfterPublishFileUploadFailedForm.cs b/src/managed/OpenLiveWriter.PostEditor/AfterPublishFileUploadFailedForm.cs index 0e988ef7..4569ca18 100644 --- a/src/managed/OpenLiveWriter.PostEditor/AfterPublishFileUploadFailedForm.cs +++ b/src/managed/OpenLiveWriter.PostEditor/AfterPublishFileUploadFailedForm.cs @@ -152,6 +152,5 @@ namespace OpenLiveWriter.PostEditor } #endregion - } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Autoreplace/AutoreplacePreferences.cs b/src/managed/OpenLiveWriter.PostEditor/Autoreplace/AutoreplacePreferences.cs index 6715715e..69ca7113 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Autoreplace/AutoreplacePreferences.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Autoreplace/AutoreplacePreferences.cs @@ -99,6 +99,5 @@ namespace OpenLiveWriter.PostEditor.Autoreplace AutoreplaceSettings.EnableEmoticonsReplacement = EnableEmoticonsReplacement; } - } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Autoreplace/AutoreplaceSettings.cs b/src/managed/OpenLiveWriter.PostEditor/Autoreplace/AutoreplaceSettings.cs index 913ba3d7..ba2fe325 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Autoreplace/AutoreplaceSettings.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Autoreplace/AutoreplaceSettings.cs @@ -155,7 +155,6 @@ namespace OpenLiveWriter.PostEditor.Autoreplace private const string EMOTICONS = "Emoticons"; } - public class AutoreplacePhrase { public AutoreplacePhrase(string phrase, string replaceValue) diff --git a/src/managed/OpenLiveWriter.PostEditor/BlogPostEditingManager.cs b/src/managed/OpenLiveWriter.PostEditor/BlogPostEditingManager.cs index 9d18bb6f..a705b643 100644 --- a/src/managed/OpenLiveWriter.PostEditor/BlogPostEditingManager.cs +++ b/src/managed/OpenLiveWriter.PostEditor/BlogPostEditingManager.cs @@ -692,7 +692,6 @@ namespace OpenLiveWriter.PostEditor #region Private Helpers - private void DispatchEditPost(BlogPost blogPost) { DispatchEditPost(new BlogPostEditingContext(BlogId, blogPost), true); @@ -1362,7 +1361,6 @@ namespace OpenLiveWriter.PostEditor } } - private bool ValidateSupportingFileUsage() { if (Blog.SupportsImageUpload == SupportsFeature.No) diff --git a/src/managed/OpenLiveWriter.PostEditor/BlogPostExtensionDataList.cs b/src/managed/OpenLiveWriter.PostEditor/BlogPostExtensionDataList.cs index 3e40ad3e..928bbbb4 100644 --- a/src/managed/OpenLiveWriter.PostEditor/BlogPostExtensionDataList.cs +++ b/src/managed/OpenLiveWriter.PostEditor/BlogPostExtensionDataList.cs @@ -114,13 +114,11 @@ namespace OpenLiveWriter.PostEditor RemoveExtensionData(removeId); } - public IExtensionData GetOrCreateExtensionData(string id) { return GetExtensionData(id) ?? CreateExtensionData(id); } - public int Count { get @@ -149,7 +147,6 @@ namespace OpenLiveWriter.PostEditor } } - public interface IExtensionData { BlogPostSettingsBag Settings { get; } diff --git a/src/managed/OpenLiveWriter.PostEditor/BlogPostSupportingFileStorage.cs b/src/managed/OpenLiveWriter.PostEditor/BlogPostSupportingFileStorage.cs index f2ac1547..909312e8 100644 --- a/src/managed/OpenLiveWriter.PostEditor/BlogPostSupportingFileStorage.cs +++ b/src/managed/OpenLiveWriter.PostEditor/BlogPostSupportingFileStorage.cs @@ -146,5 +146,4 @@ namespace OpenLiveWriter.PostEditor private DirectoryInfo _storageDirectory; } - } diff --git a/src/managed/OpenLiveWriter.PostEditor/BlogProviderButtons/BlogProviderButton.cs b/src/managed/OpenLiveWriter.PostEditor/BlogProviderButtons/BlogProviderButton.cs index a6c5aaa9..7a093faa 100644 --- a/src/managed/OpenLiveWriter.PostEditor/BlogProviderButtons/BlogProviderButton.cs +++ b/src/managed/OpenLiveWriter.PostEditor/BlogProviderButtons/BlogProviderButton.cs @@ -146,7 +146,6 @@ namespace OpenLiveWriter.PostEditor.BlogProviderButtons _settingsKey.SetDateTime(NOTIFICATION_POLLING_TIME, DateTimeHelper.UtcNow); } - public Size ContentDisplaySize { get @@ -220,7 +219,6 @@ namespace OpenLiveWriter.PostEditor.BlogProviderButtons } } - private string NotificationUrl { get diff --git a/src/managed/OpenLiveWriter.PostEditor/BlogProviderButtons/BlogProviderButtonCommandBar.cs b/src/managed/OpenLiveWriter.PostEditor/BlogProviderButtons/BlogProviderButtonCommandBar.cs index 256fc8bf..fee3cbea 100644 --- a/src/managed/OpenLiveWriter.PostEditor/BlogProviderButtons/BlogProviderButtonCommandBar.cs +++ b/src/managed/OpenLiveWriter.PostEditor/BlogProviderButtons/BlogProviderButtonCommandBar.cs @@ -12,80 +12,79 @@ using OpenLiveWriter.ApplicationFramework.Skinning; namespace OpenLiveWriter.PostEditor.BlogProviderButtons { - internal sealed class BlogProviderButtonCommandBarInfo - { - public const int MaximumProviderCommands = 4 ; - public const string ProviderCommandFormat = "BlogProviderButtonsProviderCommand{0}" ; - } + internal sealed class BlogProviderButtonCommandBarInfo + { + public const int MaximumProviderCommands = 4 ; + public const string ProviderCommandFormat = "BlogProviderButtonsProviderCommand{0}" ; + } // @RIBBON TODO: Remove obsolete code [Obsolete] - internal class BlogProviderButtonCommandBarControl : TransparentCommandBarControl - { - public BlogProviderButtonCommandBarControl() - : base( new BlogProviderButtonCommandBarLightweightControl(), CommandBarDefinition.Create(_providerCommandIds.ToArray())) - { - } + internal class BlogProviderButtonCommandBarControl : TransparentCommandBarControl + { + public BlogProviderButtonCommandBarControl() + : base( new BlogProviderButtonCommandBarLightweightControl(), CommandBarDefinition.Create(_providerCommandIds.ToArray())) + { + } - protected override void OnPaintBackground(System.Windows.Forms.PaintEventArgs pevent) - { - base.OnPaintBackground (pevent); + protected override void OnPaintBackground(System.Windows.Forms.PaintEventArgs pevent) + { + base.OnPaintBackground (pevent); - Graphics g = pevent.Graphics; - g.ResetClip(); - g.ResetTransform(); + Graphics g = pevent.Graphics; + g.ResetClip(); + g.ResetTransform(); - if(!ColorizedResources.UseSystemColors) - { - using (Brush b = new SolidBrush(Color.FromArgb(64, Color.White))) - g.FillRectangle(b, ClientRectangle); - } - } + if(!ColorizedResources.UseSystemColors) + { + using (Brush b = new SolidBrush(Color.FromArgb(64, Color.White))) + g.FillRectangle(b, ClientRectangle); + } + } - public Size DesiredSize - { - get - { - return _commandBar.DefaultVirtualSize ; - } - } + public Size DesiredSize + { + get + { + return _commandBar.DefaultVirtualSize ; + } + } - public bool HasButtons - { - get - { - Command firstButtonCommand = ApplicationManager.CommandManager.Get(String.Format(CultureInfo.InvariantCulture, BlogProviderButtonCommandBarInfo.ProviderCommandFormat, 0)) ; - return firstButtonCommand.On ; - } - } + public bool HasButtons + { + get + { + Command firstButtonCommand = ApplicationManager.CommandManager.Get(String.Format(CultureInfo.InvariantCulture, BlogProviderButtonCommandBarInfo.ProviderCommandFormat, 0)) ; + return firstButtonCommand.On ; + } + } + static BlogProviderButtonCommandBarControl() + { + for (int i=0; i /// - private void ConnectToBlog(Blog blog) + private void ConnectToBlog(Blog blog) { items.Clear(); UpdateInvalidationState(PropertyKeys.ItemsSource, InvalidationState.Pending); @@ -251,7 +250,7 @@ namespace OpenLiveWriter.PostEditor.BlogProviderButtons /// Must be called under the protection of _commandsLock. /// /// - private void DisableCommand(Command command) + private void DisableCommand(Command command) { command.On = false; if (command.Tag != null) @@ -272,7 +271,7 @@ namespace OpenLiveWriter.PostEditor.BlogProviderButtons /// Must be called under the protection _commandsLock. /// /// - private void RemoveDropDownMenu(Command command) + private void RemoveDropDownMenu(Command command) { command.CommandBarButtonContextMenuHandler = null; command.CommandBarButtonContextMenuDropDown = false; diff --git a/src/managed/OpenLiveWriter.PostEditor/BlogProviderButtons/BlogProviderButtonNotificationSink.cs b/src/managed/OpenLiveWriter.PostEditor/BlogProviderButtons/BlogProviderButtonNotificationSink.cs index ef02ba08..770e9c89 100644 --- a/src/managed/OpenLiveWriter.PostEditor/BlogProviderButtons/BlogProviderButtonNotificationSink.cs +++ b/src/managed/OpenLiveWriter.PostEditor/BlogProviderButtons/BlogProviderButtonNotificationSink.cs @@ -188,7 +188,6 @@ namespace OpenLiveWriter.PostEditor.BlogProviderButtons private static Hashtable _buttonNotificationListeners = new Hashtable(); - private string _blogId; private string _hostBlogId; private string _homepageUrl; diff --git a/src/managed/OpenLiveWriter.PostEditor/Commands/CommandAddWeblog.cs b/src/managed/OpenLiveWriter.PostEditor/Commands/CommandAddWeblog.cs index 71659912..eb558054 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Commands/CommandAddWeblog.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Commands/CommandAddWeblog.cs @@ -6,58 +6,57 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.PostEditor.Commands { - /// - /// Summary description for CommandClose. - /// - public class CommandAddWeblog : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandClose. + /// + public class CommandAddWeblog : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandAddWeblog(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandAddWeblog(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandAddWeblog() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandAddWeblog() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandViewWeblog + // + this.ContextMenuPath = "&Add Weblog Account...@2000"; + this.Identifier = "OpenLiveWriter.PostEditor.Commands.AddWeblog"; + this.MainMenuPath = "&Weblog@7/-&Add Weblog Account...@2000"; + this.MenuText = "&Add Weblog Account..."; + this.Text = "Add Weblog Account..."; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandViewWeblog - // - this.ContextMenuPath = "&Add Weblog Account...@2000"; - this.Identifier = "OpenLiveWriter.PostEditor.Commands.AddWeblog"; - this.MainMenuPath = "&Weblog@7/-&Add Weblog Account...@2000"; - this.MenuText = "&Add Weblog Account..."; - this.Text = "Add Weblog Account..."; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Commands/CommandConfigureWeblog.cs b/src/managed/OpenLiveWriter.PostEditor/Commands/CommandConfigureWeblog.cs index 7cf817e9..e1c4c83a 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Commands/CommandConfigureWeblog.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Commands/CommandConfigureWeblog.cs @@ -6,57 +6,56 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.PostEditor.Commands { - /// - /// Summary description for CommandClose. - /// - public class CommandConfigureWeblog : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandClose. + /// + public class CommandConfigureWeblog : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandConfigureWeblog(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandConfigureWeblog(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandConfigureWeblog() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandConfigureWeblog() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandConfigureWeblog + // + this.ContextMenuPath = "&Edit Weblog Settings...@52"; + this.Identifier = "OpenLiveWriter.PostEditor.Commands.ConfigureWeblog"; + this.MainMenuPath = "&Weblog@7/-&Edit Weblog Settings...-@52"; + this.MenuText = "&Edit Weblog Settings..."; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandConfigureWeblog - // - this.ContextMenuPath = "&Edit Weblog Settings...@52"; - this.Identifier = "OpenLiveWriter.PostEditor.Commands.ConfigureWeblog"; - this.MainMenuPath = "&Weblog@7/-&Edit Weblog Settings...-@52"; - this.MenuText = "&Edit Weblog Settings..."; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Commands/CommandDeleteDraft.cs b/src/managed/OpenLiveWriter.PostEditor/Commands/CommandDeleteDraft.cs index f4e531f2..66bb9fd8 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Commands/CommandDeleteDraft.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Commands/CommandDeleteDraft.cs @@ -6,57 +6,56 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.PostEditor.Commands { - /// - /// Summary description for CommandClose. - /// - public class CommandDeleteDraft : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandClose. + /// + public class CommandDeleteDraft : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandDeleteDraft(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandDeleteDraft(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandDeleteDraft() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandDeleteDraft() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandSavePost + // + this.CommandBarButtonText = "Delete Draft"; + this.Identifier = "OpenLiveWriter.PostEditor.DeleteDraft"; + this.MainMenuPath = "&File@0/-Dele&te Draft...@40"; + this.Text = "Delete Local Draft"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandSavePost - // - this.CommandBarButtonText = "Delete Draft"; - this.Identifier = "OpenLiveWriter.PostEditor.DeleteDraft"; - this.MainMenuPath = "&File@0/-Dele&te Draft...@40"; - this.Text = "Delete Local Draft"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Commands/CommandDiagnosticsConsole.cs b/src/managed/OpenLiveWriter.PostEditor/Commands/CommandDiagnosticsConsole.cs index 2ed6aaf3..0fe4a8ca 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Commands/CommandDiagnosticsConsole.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Commands/CommandDiagnosticsConsole.cs @@ -6,71 +6,71 @@ using System.ComponentModel; namespace OpenLiveWriter.PostEditor.Commands { - /// - /// Summary description for CommandDiagnosticsConsole. - /// - public class CommandDiagnosticsConsole : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandDiagnosticsConsole. + /// + public class CommandDiagnosticsConsole : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandDiagnosticsConsole(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public CommandDiagnosticsConsole(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandDiagnosticsConsole() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandDiagnosticsConsole() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandDiagnosticsConsole - // - this.Identifier = "OpenLiveWriter.PostEditor.Commands.DiagnosticsConsole"; - this.MenuText = "Show Diagnostics Console"; - this.Text = "Show Diagnostics Console"; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandDiagnosticsConsole + // + this.Identifier = "OpenLiveWriter.PostEditor.Commands.DiagnosticsConsole"; + this.MenuText = "Show Diagnostics Console"; + this.Text = "Show Diagnostics Console"; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Commands/CommandForceWatson.cs b/src/managed/OpenLiveWriter.PostEditor/Commands/CommandForceWatson.cs index 4c30011a..3662de55 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Commands/CommandForceWatson.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Commands/CommandForceWatson.cs @@ -6,71 +6,71 @@ using System.ComponentModel; namespace OpenLiveWriter.PostEditor.Commands { - /// - /// Summary description for CommandForceWatson. - /// - public class CommandForceWatson : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandForceWatson. + /// + public class CommandForceWatson : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandForceWatson(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public CommandForceWatson(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandForceWatson() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandForceWatson() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandForceWatson - // - this.Identifier = "OpenLiveWriter.PostEditor.Commands.ForceWatson"; - this.MenuText = "Force Watson"; - this.Text = "Force Watson"; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandForceWatson + // + this.Identifier = "OpenLiveWriter.PostEditor.Commands.ForceWatson"; + this.MenuText = "Force Watson"; + this.Text = "Force Watson"; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Commands/CommandInsertMenu.cs b/src/managed/OpenLiveWriter.PostEditor/Commands/CommandInsertMenu.cs index 0eb0ffa0..f1ab6913 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Commands/CommandInsertMenu.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Commands/CommandInsertMenu.cs @@ -9,55 +9,54 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.PostEditor.Commands { - /// - /// Summary description for CommandInsertMenu. - /// - public class CommandInsertMenu : Command - { - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; + /// + /// Summary description for CommandInsertMenu. + /// + public class CommandInsertMenu : Command + { + /// + /// Required designer variable. + /// + private System.ComponentModel.Container components = null; - public CommandInsertMenu(System.ComponentModel.IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandInsertMenu(System.ComponentModel.IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // TODO: Add any constructor code after InitializeComponent call - // - } + // + // TODO: Add any constructor code after InitializeComponent call + // + } - public CommandInsertMenu() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandInsertMenu() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // TODO: Add any constructor code after InitializeComponent call - // - } + // + // TODO: Add any constructor code after InitializeComponent call + // + } - - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandInsertMenu - // - this.CommandBarButtonText = "Insert"; - this.Identifier = "OpenLiveWriter.PostEditor.Commands.InsertMenu"; - this.Text = "Insert"; - } - #endregion - } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandInsertMenu + // + this.CommandBarButtonText = "Insert"; + this.Identifier = "OpenLiveWriter.PostEditor.Commands.InsertMenu"; + this.Text = "Insert"; + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Commands/CommandNewPage.cs b/src/managed/OpenLiveWriter.PostEditor/Commands/CommandNewPage.cs index d2e9a744..01c4a184 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Commands/CommandNewPage.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Commands/CommandNewPage.cs @@ -7,56 +7,55 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.PostEditor.Commands { - public class CommandNewPage : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + public class CommandNewPage : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandNewPage(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandNewPage(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandNewPage() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandNewPage() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandNewPost + // + this.CommandBarButtonText = "New"; + this.Identifier = "OpenLiveWriter.PostEditor.NewPage"; + this.MainMenuPath = "&File@0/New &Page@12"; + this.Shortcut = System.Windows.Forms.Shortcut.CtrlG; + this.MenuText = "New &Page"; + this.Text = "New Page"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandNewPost - // - this.CommandBarButtonText = "New"; - this.Identifier = "OpenLiveWriter.PostEditor.NewPage"; - this.MainMenuPath = "&File@0/New &Page@12"; - this.Shortcut = System.Windows.Forms.Shortcut.CtrlG; - this.MenuText = "New &Page"; - this.Text = "New Page"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Commands/CommandOpenDrafts.cs b/src/managed/OpenLiveWriter.PostEditor/Commands/CommandOpenDrafts.cs index de713912..0087b235 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Commands/CommandOpenDrafts.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Commands/CommandOpenDrafts.cs @@ -9,50 +9,49 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.PostEditor.Commands { - /// - /// Summary description for CommandOpenDrafts. - /// - public class CommandOpenDrafts : Command - { - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; + /// + /// Summary description for CommandOpenDrafts. + /// + public class CommandOpenDrafts : Command + { + /// + /// Required designer variable. + /// + private System.ComponentModel.Container components = null; - public CommandOpenDrafts(System.ComponentModel.IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandOpenDrafts(System.ComponentModel.IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // TODO: Add any constructor code after InitializeComponent call - // - } + // + // TODO: Add any constructor code after InitializeComponent call + // + } - public CommandOpenDrafts() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandOpenDrafts() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // TODO: Add any constructor code after InitializeComponent call - // - } + // + // TODO: Add any constructor code after InitializeComponent call + // + } - - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.Identifier = "OpenLiveWriter.PostEditor.OpenDrafts"; - } - #endregion - } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.Identifier = "OpenLiveWriter.PostEditor.OpenDrafts"; + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Commands/CommandOpenPost.cs b/src/managed/OpenLiveWriter.PostEditor/Commands/CommandOpenPost.cs index eaaaaf15..e31676d9 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Commands/CommandOpenPost.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Commands/CommandOpenPost.cs @@ -6,58 +6,57 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.PostEditor.Commands { - /// - /// Summary description for CommandClose. - /// - public class CommandOpenPost : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandClose. + /// + public class CommandOpenPost : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandOpenPost(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandOpenPost(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandOpenPost() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandOpenPost() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandOpenPost + // + this.CommandBarButtonText = "Open"; + this.Identifier = "OpenLiveWriter.PostEditor.OpenPost"; + this.MainMenuPath = "&File@0/&Open...@15"; + this.Shortcut = System.Windows.Forms.Shortcut.CtrlO; + this.Text = "Open"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandOpenPost - // - this.CommandBarButtonText = "Open"; - this.Identifier = "OpenLiveWriter.PostEditor.OpenPost"; - this.MainMenuPath = "&File@0/&Open...@15"; - this.Shortcut = System.Windows.Forms.Shortcut.CtrlO; - this.Text = "Open"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Commands/CommandOpenRecentPosts.cs b/src/managed/OpenLiveWriter.PostEditor/Commands/CommandOpenRecentPosts.cs index d14cfa47..01e3dedf 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Commands/CommandOpenRecentPosts.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Commands/CommandOpenRecentPosts.cs @@ -9,50 +9,49 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.PostEditor.Commands { - /// - /// Summary description for CommandOpenRecentPosts. - /// - public class CommandOpenRecentPosts : Command - { - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; + /// + /// Summary description for CommandOpenRecentPosts. + /// + public class CommandOpenRecentPosts : Command + { + /// + /// Required designer variable. + /// + private System.ComponentModel.Container components = null; - public CommandOpenRecentPosts(System.ComponentModel.IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandOpenRecentPosts(System.ComponentModel.IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // TODO: Add any constructor code after InitializeComponent call - // - } + // + // TODO: Add any constructor code after InitializeComponent call + // + } - public CommandOpenRecentPosts() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandOpenRecentPosts() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // TODO: Add any constructor code after InitializeComponent call - // - } + // + // TODO: Add any constructor code after InitializeComponent call + // + } - - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.Identifier = "OpenLiveWriter.PostEditor.OpenRecentPosts"; - } - #endregion - } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.Identifier = "OpenLiveWriter.PostEditor.OpenRecentPosts"; + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Commands/CommandPostAndPublish.cs b/src/managed/OpenLiveWriter.PostEditor/Commands/CommandPostAndPublish.cs index f1d7f26d..14653de0 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Commands/CommandPostAndPublish.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Commands/CommandPostAndPublish.cs @@ -6,60 +6,59 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.PostEditor.Commands { - /// - /// Summary description for CommandClose. - /// - public class CommandPostAndPublish : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandClose. + /// + public class CommandPostAndPublish : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandPostAndPublish(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandPostAndPublish(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandPostAndPublish() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandPostAndPublish() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandPostAndPublish + // + this.CommandBarButtonText = "Publish"; + this.ContextMenuPath = "-P&ublish to Weblog@100"; + this.Identifier = "OpenLiveWriter.PostAndPublish"; + this.MainMenuPath = "&File@0/-P&ublish to Weblog@100"; + this.MenuText = "P&ublish to Weblog"; + this.Shortcut = System.Windows.Forms.Shortcut.CtrlP; + this.Text = "Publish to Weblog"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandPostAndPublish - // - this.CommandBarButtonText = "Publish"; - this.ContextMenuPath = "-P&ublish to Weblog@100"; - this.Identifier = "OpenLiveWriter.PostAndPublish"; - this.MainMenuPath = "&File@0/-P&ublish to Weblog@100"; - this.MenuText = "P&ublish to Weblog"; - this.Shortcut = System.Windows.Forms.Shortcut.CtrlP; - this.Text = "Publish to Weblog"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Commands/CommandPostAsDraft.cs b/src/managed/OpenLiveWriter.PostEditor/Commands/CommandPostAsDraft.cs index ce901b1e..28e354ff 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Commands/CommandPostAsDraft.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Commands/CommandPostAsDraft.cs @@ -6,58 +6,57 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.PostEditor.Commands { - /// - /// Summary description for CommandClose. - /// - public class CommandPostAsDraft : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandClose. + /// + public class CommandPostAsDraft : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandPostAsDraft(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandPostAsDraft(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandPostAsDraft() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandPostAsDraft() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandPostAsDraft + // + this.ContextMenuPath = "Post &Draft to Weblog@101"; + this.Identifier = "OpenLiveWriter.PostAsDraft"; + this.MainMenuPath = "&File@0/Post &Draft to Weblog@35"; + this.MenuText = "Post &Draft to Weblog"; + this.Text = "Post Draft to Weblog"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandPostAsDraft - // - this.ContextMenuPath = "Post &Draft to Weblog@101"; - this.Identifier = "OpenLiveWriter.PostAsDraft"; - this.MainMenuPath = "&File@0/Post &Draft to Weblog@35"; - this.MenuText = "Post &Draft to Weblog"; - this.Text = "Post Draft to Weblog"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Commands/CommandPostAsDraftAndEditOnline.cs b/src/managed/OpenLiveWriter.PostEditor/Commands/CommandPostAsDraftAndEditOnline.cs index 626df83d..1a05628d 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Commands/CommandPostAsDraftAndEditOnline.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Commands/CommandPostAsDraftAndEditOnline.cs @@ -6,58 +6,57 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.PostEditor.Commands { - /// - /// Summary description for CommandClose. - /// - public class CommandPostAsDraftAndEditOnline : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandClose. + /// + public class CommandPostAsDraftAndEditOnline : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandPostAsDraftAndEditOnline(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandPostAsDraftAndEditOnline(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandPostAsDraftAndEditOnline() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandPostAsDraftAndEditOnline() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandPostAsDraft + // + this.ContextMenuPath = "Post Draft and &Edit Online@102"; + this.Identifier = "OpenLiveWriter.PostAsDraftAndEditOnline"; + this.MainMenuPath = "&File@0/Post &Draft and &Edit Online@36"; + this.MenuText = "Post Draft and &Edit Online"; + this.Text = "Post Draft and Edit Online"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandPostAsDraft - // - this.ContextMenuPath = "Post Draft and &Edit Online@102"; - this.Identifier = "OpenLiveWriter.PostAsDraftAndEditOnline"; - this.MainMenuPath = "&File@0/Post &Draft and &Edit Online@36"; - this.MenuText = "Post Draft and &Edit Online"; - this.Text = "Post Draft and Edit Online"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Commands/CommandPostProperties.cs b/src/managed/OpenLiveWriter.PostEditor/Commands/CommandPostProperties.cs index 5b26de5d..6a86e9bd 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Commands/CommandPostProperties.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Commands/CommandPostProperties.cs @@ -6,59 +6,58 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.PostEditor.Commands { - /// - /// Summary description for CommandClose. - /// - public class CommandPostProperties : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandClose. + /// + public class CommandPostProperties : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandPostProperties(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandPostProperties(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandPostProperties() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandPostProperties() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandPostProperties - // - this.ContextMenuPath = "-&Properties@300"; - this.Identifier = "OpenLiveWriter.PostEditor.Commands.PostProperties"; - this.MainMenuPath = "&View@2/&Properties@150"; - this.MenuText = "&Properties"; - this.Shortcut = System.Windows.Forms.Shortcut.F2; - this.Text = "Properties"; - this.SuppressMenuBitmap = true; - } - #endregion - } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandPostProperties + // + this.ContextMenuPath = "-&Properties@300"; + this.Identifier = "OpenLiveWriter.PostEditor.Commands.PostProperties"; + this.MainMenuPath = "&View@2/&Properties@150"; + this.MenuText = "&Properties"; + this.Shortcut = System.Windows.Forms.Shortcut.F2; + this.Text = "Properties"; + this.SuppressMenuBitmap = true; + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Commands/CommandPreferences.cs b/src/managed/OpenLiveWriter.PostEditor/Commands/CommandPreferences.cs index b90f2f81..98f15dc2 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Commands/CommandPreferences.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Commands/CommandPreferences.cs @@ -7,53 +7,52 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.PostEditor.Commands { - public class CommandPreferences : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + public class CommandPreferences : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandPreferences(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandPreferences(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandPreferences() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandPreferences() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandConfigureWeblog + // + this.Identifier = "OpenLiveWriter.PostEditor.Commands.Preferences"; + this.MainMenuPath = "&Tools@7/-&Preferences...@900"; + this.MenuText = "&Preferences..."; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandConfigureWeblog - // - this.Identifier = "OpenLiveWriter.PostEditor.Commands.Preferences"; - this.MainMenuPath = "&Tools@7/-&Preferences...@900"; - this.MenuText = "&Preferences..."; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Commands/CommandSavePost.cs b/src/managed/OpenLiveWriter.PostEditor/Commands/CommandSavePost.cs index f269d2ac..b6345de8 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Commands/CommandSavePost.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Commands/CommandSavePost.cs @@ -6,59 +6,58 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.PostEditor.Commands { - /// - /// Summary description for CommandClose. - /// - public class CommandSavePost : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandClose. + /// + public class CommandSavePost : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandSavePost(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandSavePost(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandSavePost() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandSavePost() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandSavePost + // + this.CommandBarButtonText = "Save Draft"; + this.Identifier = "OpenLiveWriter.PostEditor.SavePost"; + this.MainMenuPath = "&File@0/-&Save Local Draft@30"; + this.MenuText = "&Save Local Draft"; + this.Shortcut = System.Windows.Forms.Shortcut.CtrlS; + this.Text = "Save Local Draft"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandSavePost - // - this.CommandBarButtonText = "Save Draft"; - this.Identifier = "OpenLiveWriter.PostEditor.SavePost"; - this.MainMenuPath = "&File@0/-&Save Local Draft@30"; - this.MenuText = "&Save Local Draft"; - this.Shortcut = System.Windows.Forms.Shortcut.CtrlS; - this.Text = "Save Local Draft"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Commands/CommandToolsMenu.cs b/src/managed/OpenLiveWriter.PostEditor/Commands/CommandToolsMenu.cs index 0434879b..29b9ded7 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Commands/CommandToolsMenu.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Commands/CommandToolsMenu.cs @@ -9,56 +9,55 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.PostEditor.Commands { - /// - /// Summary description for CommandToolsMenu. - /// - public class CommandToolsMenu : Command - { - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; + /// + /// Summary description for CommandToolsMenu. + /// + public class CommandToolsMenu : Command + { + /// + /// Required designer variable. + /// + private System.ComponentModel.Container components = null; - public CommandToolsMenu(System.ComponentModel.IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandToolsMenu(System.ComponentModel.IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // TODO: Add any constructor code after InitializeComponent call - // - } + // + // TODO: Add any constructor code after InitializeComponent call + // + } - public CommandToolsMenu() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandToolsMenu() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // TODO: Add any constructor code after InitializeComponent call - // - } + // + // TODO: Add any constructor code after InitializeComponent call + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandToolsMenu + // + this.CommandBarButtonText = "Tools"; + this.Identifier = "OpenLiveWriter.PostEditor.ToolsMenu"; + this.Text = "Tools"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandToolsMenu - // - this.CommandBarButtonText = "Tools"; - this.Identifier = "OpenLiveWriter.PostEditor.ToolsMenu"; - this.Text = "Tools"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Commands/CommandUpdateWeblogStyle.cs b/src/managed/OpenLiveWriter.PostEditor/Commands/CommandUpdateWeblogStyle.cs index a62ce8ce..7fbf1485 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Commands/CommandUpdateWeblogStyle.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Commands/CommandUpdateWeblogStyle.cs @@ -6,57 +6,56 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.PostEditor.Commands { - /// - /// Summary description for CommandClose. - /// - public class CommandUpdateWeblogStyle : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandClose. + /// + public class CommandUpdateWeblogStyle : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandUpdateWeblogStyle(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandUpdateWeblogStyle(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandUpdateWeblogStyle() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandUpdateWeblogStyle() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandConfigureWeblog + // + this.ContextMenuPath = "&Update Weblog Style@57"; + this.Identifier = "OpenLiveWriter.PostEditor.Commands.UpdateWeblogStyle"; + this.MainMenuPath = "&View@2/-&Update Weblog Style-@120"; + this.MenuText = "&Update Weblog Style"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandConfigureWeblog - // - this.ContextMenuPath = "&Update Weblog Style@57"; - this.Identifier = "OpenLiveWriter.PostEditor.Commands.UpdateWeblogStyle"; - this.MainMenuPath = "&View@2/-&Update Weblog Style-@120"; - this.MenuText = "&Update Weblog Style"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Commands/CommandUseTemplateForEditting.cs b/src/managed/OpenLiveWriter.PostEditor/Commands/CommandUseTemplateForEditting.cs index e45fad43..11e6fd2f 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Commands/CommandUseTemplateForEditting.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Commands/CommandUseTemplateForEditting.cs @@ -6,57 +6,56 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.PostEditor.Commands { - /// - /// Summary description for CommandClose. - /// - public class CommandUseTemplateForEditting : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandClose. + /// + public class CommandUseTemplateForEditting : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandUseTemplateForEditting(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandUseTemplateForEditting(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandUseTemplateForEditting() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandUseTemplateForEditting() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandConfigureWeblog + // + this.ContextMenuPath = "Author in Weblog &Style@60"; + this.Identifier = "OpenLiveWriter.PostEditor.Commands.UseTemplateForEditting"; + this.MainMenuPath = "&Weblog@7/Author in Weblog &Style-@60"; + this.MenuText = "Author in Weblog &Style"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandConfigureWeblog - // - this.ContextMenuPath = "Author in Weblog &Style@60"; - this.Identifier = "OpenLiveWriter.PostEditor.Commands.UseTemplateForEditting"; - this.MainMenuPath = "&Weblog@7/Author in Weblog &Style-@60"; - this.MenuText = "Author in Weblog &Style"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Commands/CommandViewPostAfterPublish.cs b/src/managed/OpenLiveWriter.PostEditor/Commands/CommandViewPostAfterPublish.cs index 0ffe5529..87b04099 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Commands/CommandViewPostAfterPublish.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Commands/CommandViewPostAfterPublish.cs @@ -6,57 +6,56 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.PostEditor.Commands { - /// - /// Summary description for CommandClose. - /// - public class CommandViewPostAfterPublish : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandClose. + /// + public class CommandViewPostAfterPublish : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandViewPostAfterPublish(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandViewPostAfterPublish(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandViewPostAfterPublish() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandViewPostAfterPublish() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandPostAndPublish + // + this.Identifier = "OpenLiveWriter.ViewPostAfterPublish"; + this.MenuText = "&View Post After Publishing"; + this.Text = "View Post After Publishing"; + this.MainMenuPath = "&File@0/-&View Post After Publishing@105"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandPostAndPublish - // - this.Identifier = "OpenLiveWriter.ViewPostAfterPublish"; - this.MenuText = "&View Post After Publishing"; - this.Text = "View Post After Publishing"; - this.MainMenuPath = "&File@0/-&View Post After Publishing@105"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Commands/CommandViewWeblog.cs b/src/managed/OpenLiveWriter.PostEditor/Commands/CommandViewWeblog.cs index 321595b8..033f9fa4 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Commands/CommandViewWeblog.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Commands/CommandViewWeblog.cs @@ -6,58 +6,57 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.PostEditor.Commands { - /// - /// Summary description for CommandClose. - /// - public class CommandViewWeblog : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandClose. + /// + public class CommandViewWeblog : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandViewWeblog(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandViewWeblog(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandViewWeblog() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandViewWeblog() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandViewWeblog + // + this.ContextMenuPath = "&View Weblog@50"; + this.Identifier = "OpenLiveWriter.PostEditor.Commands.ViewWeblog"; + this.MainMenuPath = "&Weblog@7/&View Weblog@50"; + this.MenuText = "&View Weblog"; + this.Text = "View Weblog"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandViewWeblog - // - this.ContextMenuPath = "&View Weblog@50"; - this.Identifier = "OpenLiveWriter.PostEditor.Commands.ViewWeblog"; - this.MainMenuPath = "&Weblog@7/&View Weblog@50"; - this.MenuText = "&View Weblog"; - this.Text = "View Weblog"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Commands/CommandViewWeblogAdmin.cs b/src/managed/OpenLiveWriter.PostEditor/Commands/CommandViewWeblogAdmin.cs index e2190df7..c3195f91 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Commands/CommandViewWeblogAdmin.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Commands/CommandViewWeblogAdmin.cs @@ -6,58 +6,57 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.PostEditor.Commands { - /// - /// Summary description for CommandClose. - /// - public class CommandViewWeblogAdmin : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandClose. + /// + public class CommandViewWeblogAdmin : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandViewWeblogAdmin(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandViewWeblogAdmin(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandViewWeblogAdmin() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandViewWeblogAdmin() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandViewWeblog + // + this.ContextMenuPath = "&Manage Weblog@51"; + this.Identifier = "OpenLiveWriter.PostEditor.Commands.ViewWeblogAdmin"; + this.MainMenuPath = "&Weblog@7/&Manage Weblog@51"; + this.MenuText = "&Manage Weblog"; + this.Text = "Manage Weblog"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandViewWeblog - // - this.ContextMenuPath = "&Manage Weblog@51"; - this.Identifier = "OpenLiveWriter.PostEditor.Commands.ViewWeblogAdmin"; - this.MainMenuPath = "&Weblog@7/&Manage Weblog@51"; - this.MenuText = "&Manage Weblog"; - this.Text = "Manage Weblog"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Commands/CommandWeblogMenu.cs b/src/managed/OpenLiveWriter.PostEditor/Commands/CommandWeblogMenu.cs index ce5c7efd..52fc07c9 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Commands/CommandWeblogMenu.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Commands/CommandWeblogMenu.cs @@ -11,60 +11,58 @@ using OpenLiveWriter.ApplicationFramework.Skinning; namespace OpenLiveWriter.PostEditor.Commands { - /// - /// Summary description for CommandClose. - /// - public class CommandWeblogMenu : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandClose. + /// + public class CommandWeblogMenu : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandWeblogMenu(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandWeblogMenu(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandWeblogMenu() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandWeblogMenu() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandWeblogMenu + // + this.CommandBarButtonText = "Weblog"; + this.Identifier = "OpenLiveWriter.PostEditor.Commands.WeblogMenu"; + this.MenuText = ""; + this.Text = "Weblog"; + + } + #endregion - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandWeblogMenu - // - this.CommandBarButtonText = "Weblog"; - this.Identifier = "OpenLiveWriter.PostEditor.Commands.WeblogMenu"; - this.MenuText = ""; - this.Text = "Weblog"; - - } - #endregion - - - - } + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Configuration/Accounts/DisplayMessages/ConfirmRemoveWeblogDisplayMessage.cs b/src/managed/OpenLiveWriter.PostEditor/Configuration/Accounts/DisplayMessages/ConfirmRemoveWeblogDisplayMessage.cs index 16e1f905..0c8d669d 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Configuration/Accounts/DisplayMessages/ConfirmRemoveWeblogDisplayMessage.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Configuration/Accounts/DisplayMessages/ConfirmRemoveWeblogDisplayMessage.cs @@ -6,65 +6,65 @@ using OpenLiveWriter.Controls; namespace OpenLiveWriter.PostEditor.Configuration.Accounts.DisplayMessages { - /// - /// Summary description for DeleteSingleItemDisplayMessage. - /// - public class ConfirmRemoveWeblogDisplayMessage : DisplayMessage - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for DeleteSingleItemDisplayMessage. + /// + public class ConfirmRemoveWeblogDisplayMessage : DisplayMessage + { + /// + /// Required designer variable. + /// + private Container components = null; - public ConfirmRemoveWeblogDisplayMessage(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public ConfirmRemoveWeblogDisplayMessage(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - } + } - public ConfirmRemoveWeblogDisplayMessage() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); - } + public ConfirmRemoveWeblogDisplayMessage() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // ConfirmRemoveWeblogDisplayMessage - // - this.Buttons = System.Windows.Forms.MessageBoxButtons.YesNo; - this.Text = "Are you sure that you want to delete the selected weblog?"; - this.Title = "Confirm Delete"; - this.Type = DisplayMessageType.Question; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // ConfirmRemoveWeblogDisplayMessage + // + this.Buttons = System.Windows.Forms.MessageBoxButtons.YesNo; + this.Text = "Are you sure that you want to delete the selected weblog?"; + this.Title = "Confirm Delete"; + this.Type = DisplayMessageType.Question; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Configuration/Accounts/WeblogAccountListView.cs b/src/managed/OpenLiveWriter.PostEditor/Configuration/Accounts/WeblogAccountListView.cs index dd474284..295beb2d 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Configuration/Accounts/WeblogAccountListView.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Configuration/Accounts/WeblogAccountListView.cs @@ -125,7 +125,6 @@ namespace OpenLiveWriter.PostEditor.Configuration.Accounts } - /// /// Clean up any resources being used. /// diff --git a/src/managed/OpenLiveWriter.PostEditor/Configuration/Accounts/WeblogAccountManagementControl.cs b/src/managed/OpenLiveWriter.PostEditor/Configuration/Accounts/WeblogAccountManagementControl.cs index f3deb20e..20ad6977 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Configuration/Accounts/WeblogAccountManagementControl.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Configuration/Accounts/WeblogAccountManagementControl.cs @@ -119,7 +119,6 @@ namespace OpenLiveWriter.PostEditor.Configuration.Accounts EditSelectedWeblog(); } - private void buttonView_Click(object sender, EventArgs e) { try @@ -194,7 +193,6 @@ namespace OpenLiveWriter.PostEditor.Configuration.Accounts } - private void DeleteSelectedWeblog() { if (SelectedWeblog == null) @@ -220,7 +218,6 @@ namespace OpenLiveWriter.PostEditor.Configuration.Accounts } } - private BlogSettings SelectedWeblog { get @@ -348,7 +345,6 @@ namespace OpenLiveWriter.PostEditor.Configuration.Accounts } #endregion - /// /// Hook that allows for processing just after a new blog has been created. /// diff --git a/src/managed/OpenLiveWriter.PostEditor/Configuration/Accounts/WeblogAccountManagementForm.cs b/src/managed/OpenLiveWriter.PostEditor/Configuration/Accounts/WeblogAccountManagementForm.cs index 51db101a..1c050dd4 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Configuration/Accounts/WeblogAccountManagementForm.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Configuration/Accounts/WeblogAccountManagementForm.cs @@ -11,90 +11,90 @@ using OpenLiveWriter.PostEditor; namespace OpenLiveWriter.PostEditor.Configuration.Accounts { - /// - /// Summary description for WeblogAccountManagementForm. - /// - public class WeblogAccountManagementForm : ApplicationDialog - { - private System.Windows.Forms.Button buttonClose; - private OpenLiveWriter.PostEditor.Configuration.Accounts.WeblogAccountManagementControl weblogAccountManagementControl1; - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; + /// + /// Summary description for WeblogAccountManagementForm. + /// + public class WeblogAccountManagementForm : ApplicationDialog + { + private System.Windows.Forms.Button buttonClose; + private OpenLiveWriter.PostEditor.Configuration.Accounts.WeblogAccountManagementControl weblogAccountManagementControl1; + /// + /// Required designer variable. + /// + private System.ComponentModel.Container components = null; - public WeblogAccountManagementForm(IBlogPostEditingSite editingSite) - { - // - // Required for Windows Form Designer support - // - InitializeComponent(); + public WeblogAccountManagementForm(IBlogPostEditingSite editingSite) + { + // + // Required for Windows Form Designer support + // + InitializeComponent(); - weblogAccountManagementControl1.EditingSite = editingSite ; - } + weblogAccountManagementControl1.EditingSite = editingSite ; + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.buttonClose = new System.Windows.Forms.Button(); - this.weblogAccountManagementControl1 = new OpenLiveWriter.PostEditor.Configuration.Accounts.WeblogAccountManagementControl(); - this.SuspendLayout(); - // - // buttonClose - // - this.buttonClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonClose.DialogResult = System.Windows.Forms.DialogResult.OK; - this.buttonClose.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.buttonClose.Location = new System.Drawing.Point(279, 264); - this.buttonClose.Name = "buttonClose"; - this.buttonClose.TabIndex = 1; - this.buttonClose.Text = "Close"; - // - // weblogAccountManagementControl1 - // - this.weblogAccountManagementControl1.BlogSettingsEditors = null; - this.weblogAccountManagementControl1.EditingSite = null; - this.weblogAccountManagementControl1.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.weblogAccountManagementControl1.Location = new System.Drawing.Point(9, 10); - this.weblogAccountManagementControl1.Name = "weblogAccountManagementControl1"; - this.weblogAccountManagementControl1.Size = new System.Drawing.Size(345, 245); - this.weblogAccountManagementControl1.TabIndex = 0; - // - // WeblogAccountManagementForm - // - this.AutoScaleBaseSize = new System.Drawing.Size(5, 14); - this.CancelButton = this.buttonClose; - this.ClientSize = new System.Drawing.Size(362, 294); - this.ControlBox = false; - this.Controls.Add(this.weblogAccountManagementControl1); - this.Controls.Add(this.buttonClose); - this.Location = new System.Drawing.Point(0, 0); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "WeblogAccountManagementForm"; - this.Text = "Accounts"; - this.ResumeLayout(false); + #region Windows Form Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.buttonClose = new System.Windows.Forms.Button(); + this.weblogAccountManagementControl1 = new OpenLiveWriter.PostEditor.Configuration.Accounts.WeblogAccountManagementControl(); + this.SuspendLayout(); + // + // buttonClose + // + this.buttonClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonClose.DialogResult = System.Windows.Forms.DialogResult.OK; + this.buttonClose.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.buttonClose.Location = new System.Drawing.Point(279, 264); + this.buttonClose.Name = "buttonClose"; + this.buttonClose.TabIndex = 1; + this.buttonClose.Text = "Close"; + // + // weblogAccountManagementControl1 + // + this.weblogAccountManagementControl1.BlogSettingsEditors = null; + this.weblogAccountManagementControl1.EditingSite = null; + this.weblogAccountManagementControl1.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); + this.weblogAccountManagementControl1.Location = new System.Drawing.Point(9, 10); + this.weblogAccountManagementControl1.Name = "weblogAccountManagementControl1"; + this.weblogAccountManagementControl1.Size = new System.Drawing.Size(345, 245); + this.weblogAccountManagementControl1.TabIndex = 0; + // + // WeblogAccountManagementForm + // + this.AutoScaleBaseSize = new System.Drawing.Size(5, 14); + this.CancelButton = this.buttonClose; + this.ClientSize = new System.Drawing.Size(362, 294); + this.ControlBox = false; + this.Controls.Add(this.weblogAccountManagementControl1); + this.Controls.Add(this.buttonClose); + this.Location = new System.Drawing.Point(0, 0); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "WeblogAccountManagementForm"; + this.Text = "Accounts"; + this.ResumeLayout(false); - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Configuration/Accounts/WeblogAccountPreferencesPanel.cs b/src/managed/OpenLiveWriter.PostEditor/Configuration/Accounts/WeblogAccountPreferencesPanel.cs index f6e63bca..4ecd22c3 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Configuration/Accounts/WeblogAccountPreferencesPanel.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Configuration/Accounts/WeblogAccountPreferencesPanel.cs @@ -177,7 +177,6 @@ namespace OpenLiveWriter.PostEditor.Configuration.Accounts } #endregion - #region IBlogPostEditingSitePreferences Members public IBlogPostEditingSite EditingSite diff --git a/src/managed/OpenLiveWriter.PostEditor/Configuration/Settings/AccountPanel.cs b/src/managed/OpenLiveWriter.PostEditor/Configuration/Settings/AccountPanel.cs index 28c038e1..26fa7644 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Configuration/Settings/AccountPanel.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Configuration/Settings/AccountPanel.cs @@ -102,7 +102,6 @@ namespace OpenLiveWriter.PostEditor.Configuration.Settings textBoxPassword.Text = TemporaryBlogSettings.Credentials.Password; } - public override bool PrepareSave(SwitchToPanel switchToPanel) { // validate that we have a post api url diff --git a/src/managed/OpenLiveWriter.PostEditor/Configuration/Settings/AdvancedPanel.cs b/src/managed/OpenLiveWriter.PostEditor/Configuration/Settings/AdvancedPanel.cs index af4ec636..1369f83f 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Configuration/Settings/AdvancedPanel.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Configuration/Settings/AdvancedPanel.cs @@ -116,7 +116,6 @@ namespace OpenLiveWriter.PostEditor.Configuration.Settings string userOverride = (string)TemporaryBlogSettings.UserOptionOverrides[BlogClientOptions.CHARACTER_SET]; string homepageOverride = (string)TemporaryBlogSettings.HomePageOverrides[BlogClientOptions.CHARACTER_SET]; - if (!String.IsNullOrEmpty(blogOverride)) defaultEncoding = String.Format(CultureInfo.CurrentCulture, defaultEncoding, blogOverride); else if (!String.IsNullOrEmpty(homepageOverride)) @@ -225,7 +224,6 @@ namespace OpenLiveWriter.PostEditor.Configuration.Settings ? StringHelper.ToBool(TemporaryBlogSettings.OptionOverrides[BlogClientOptions.REQUIRES_XHTML].ToString(), optionOverride) : optionOverride; - int currentOption = 0; // default: unspecified, use OptionOverride if (TemporaryBlogSettings.UserOptionOverrides.Contains(BlogClientOptions.REQUIRES_XHTML)) { diff --git a/src/managed/OpenLiveWriter.PostEditor/Configuration/Settings/DisplayMessages/FtpSettingsRequiredDisplayMessage.cs b/src/managed/OpenLiveWriter.PostEditor/Configuration/Settings/DisplayMessages/FtpSettingsRequiredDisplayMessage.cs index 530e82ac..70215e3d 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Configuration/Settings/DisplayMessages/FtpSettingsRequiredDisplayMessage.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Configuration/Settings/DisplayMessages/FtpSettingsRequiredDisplayMessage.cs @@ -7,59 +7,59 @@ using OpenLiveWriter.Controls; namespace OpenLiveWriter.PostEditor.Configuration.Settings.DisplayMessages { - public class FtpSettingsRequiredDisplayMessage : DisplayMessage - { - /// - /// Required designer variable. - /// - private Container components = null; + public class FtpSettingsRequiredDisplayMessage : DisplayMessage + { + /// + /// Required designer variable. + /// + private Container components = null; - public FtpSettingsRequiredDisplayMessage(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public FtpSettingsRequiredDisplayMessage(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - } + } - public FtpSettingsRequiredDisplayMessage() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public FtpSettingsRequiredDisplayMessage() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - } + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.Text = "If you choose to upload images to an FTP server you must speicfy the settings for the destination server."; - this.Title = "FTP Settings Required"; - this.Type = DisplayMessageType.Warning; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.Text = "If you choose to upload images to an FTP server you must speicfy the settings for the destination server."; + this.Title = "FTP Settings Required"; + this.Type = DisplayMessageType.Warning; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Configuration/Settings/FTPSettingsForm.cs b/src/managed/OpenLiveWriter.PostEditor/Configuration/Settings/FTPSettingsForm.cs index e0b4e262..8477b2ed 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Configuration/Settings/FTPSettingsForm.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Configuration/Settings/FTPSettingsForm.cs @@ -87,7 +87,6 @@ namespace OpenLiveWriter.PostEditor.Configuration.Settings // save reference to settings _ftpSettings = ftpSettings; - // populate controls _originalHostname = ftpSettings.FtpServer; textBoxHostName.Text = ftpSettings.FtpServer; diff --git a/src/managed/OpenLiveWriter.PostEditor/Configuration/Settings/ImagesPanel.cs b/src/managed/OpenLiveWriter.PostEditor/Configuration/Settings/ImagesPanel.cs index 587fed70..9db52a9c 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Configuration/Settings/ImagesPanel.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Configuration/Settings/ImagesPanel.cs @@ -115,7 +115,6 @@ namespace OpenLiveWriter.PostEditor.Configuration.Settings } - private FileUploadSupport FileUploadSupport { get @@ -263,6 +262,5 @@ namespace OpenLiveWriter.PostEditor.Configuration.Settings } #endregion - } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Configuration/Settings/WeblogSettingsPanel.cs b/src/managed/OpenLiveWriter.PostEditor/Configuration/Settings/WeblogSettingsPanel.cs index beecee6e..097c30ba 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Configuration/Settings/WeblogSettingsPanel.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Configuration/Settings/WeblogSettingsPanel.cs @@ -16,7 +16,6 @@ namespace OpenLiveWriter.PostEditor.Configuration.Settings /// private System.ComponentModel.Container components = null; - private TemporaryBlogSettings _targetBlogSettings; private TemporaryBlogSettings _editableBlogSettings; @@ -68,7 +67,6 @@ namespace OpenLiveWriter.PostEditor.Configuration.Settings } private bool _settingsModified = false; - /// /// Clean up any resources being used. /// diff --git a/src/managed/OpenLiveWriter.PostEditor/Configuration/TemporaryBlogSettings.cs b/src/managed/OpenLiveWriter.PostEditor/Configuration/TemporaryBlogSettings.cs index b8c65212..81199f81 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Configuration/TemporaryBlogSettings.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Configuration/TemporaryBlogSettings.cs @@ -78,7 +78,6 @@ namespace OpenLiveWriter.PostEditor.Configuration } } - public void Save(BlogSettings settings) { settings.HostBlogId = this.HostBlogId; @@ -373,7 +372,6 @@ namespace OpenLiveWriter.PostEditor.Configuration } } - public string ProviderId { get { return _providerId; } @@ -435,7 +433,6 @@ namespace OpenLiveWriter.PostEditor.Configuration } } - public BlogPostCategory[] Categories { get @@ -898,7 +895,6 @@ namespace OpenLiveWriter.PostEditor.Configuration private Hashtable _values = new Hashtable(); - public object Clone() { TemporaryFileUploadSettings newSettings = new TemporaryFileUploadSettings(); @@ -913,4 +909,3 @@ namespace OpenLiveWriter.PostEditor.Configuration } - diff --git a/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/BlogProviderAccountWizard.cs b/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/BlogProviderAccountWizard.cs index b5fa7250..e9a4af79 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/BlogProviderAccountWizard.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/BlogProviderAccountWizard.cs @@ -317,5 +317,4 @@ namespace OpenLiveWriter.PostEditor.Configuration.Wizard } } - } diff --git a/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/DisplayMessages/ErrorConnectingDisplayMessage.cs b/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/DisplayMessages/ErrorConnectingDisplayMessage.cs index 02aa2b94..bde0786a 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/DisplayMessages/ErrorConnectingDisplayMessage.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/DisplayMessages/ErrorConnectingDisplayMessage.cs @@ -7,62 +7,62 @@ using OpenLiveWriter.Controls; namespace OpenLiveWriter.PostEditor.Configuration.Wizard.DisplayMessages { - public class ErrorConnectingDisplayMessage : DisplayMessage - { - /// - /// Required designer variable. - /// - private Container components = null; + public class ErrorConnectingDisplayMessage : DisplayMessage + { + /// + /// Required designer variable. + /// + private Container components = null; - public ErrorConnectingDisplayMessage(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public ErrorConnectingDisplayMessage(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - } + } - public ErrorConnectingDisplayMessage() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public ErrorConnectingDisplayMessage() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - } + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // UsernameAndPasswordRequiredDisplayMessage - // - this.Text = "An error occurred while attempting to connect to the remote server."; - this.Title = "Error Connecting"; - this.Type = DisplayMessageType.Warning; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // UsernameAndPasswordRequiredDisplayMessage + // + this.Text = "An error occurred while attempting to connect to the remote server."; + this.Title = "Error Connecting"; + this.Type = DisplayMessageType.Warning; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/DisplayMessages/ErrorConnectingPromptContinueDisplayMessage.cs b/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/DisplayMessages/ErrorConnectingPromptContinueDisplayMessage.cs index 7c307b8c..533f632b 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/DisplayMessages/ErrorConnectingPromptContinueDisplayMessage.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/DisplayMessages/ErrorConnectingPromptContinueDisplayMessage.cs @@ -7,64 +7,64 @@ using OpenLiveWriter.Controls; namespace OpenLiveWriter.PostEditor.Configuration.Wizard.DisplayMessages { - public class ErrorConnectingPromptContinueDisplayMessage : DisplayMessage - { - /// - /// Required designer variable. - /// - private Container components = null; + public class ErrorConnectingPromptContinueDisplayMessage : DisplayMessage + { + /// + /// Required designer variable. + /// + private Container components = null; - public ErrorConnectingPromptContinueDisplayMessage(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public ErrorConnectingPromptContinueDisplayMessage(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - } + } - public ErrorConnectingPromptContinueDisplayMessage() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public ErrorConnectingPromptContinueDisplayMessage() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - } + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // MappingVerificationFailedDisplayMessage - // - this.Buttons = System.Windows.Forms.MessageBoxButtons.YesNo; - this.DefaultButton = System.Windows.Forms.MessageBoxDefaultButton.Button2; - this.Text = "The remote server could not be contacted to verify the settings. Do you want to continue anyway?"; - this.Title = "Error Connecting"; - this.Type = OpenLiveWriter.Controls.DisplayMessageType.Question; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // MappingVerificationFailedDisplayMessage + // + this.Buttons = System.Windows.Forms.MessageBoxButtons.YesNo; + this.DefaultButton = System.Windows.Forms.MessageBoxDefaultButton.Button2; + this.Text = "The remote server could not be contacted to verify the settings. Do you want to continue anyway?"; + this.Title = "Error Connecting"; + this.Type = OpenLiveWriter.Controls.DisplayMessageType.Question; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/DisplayMessages/HomepageUrlRequiredDisplayMessage.cs b/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/DisplayMessages/HomepageUrlRequiredDisplayMessage.cs index 3a181d0f..bf9c5502 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/DisplayMessages/HomepageUrlRequiredDisplayMessage.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/DisplayMessages/HomepageUrlRequiredDisplayMessage.cs @@ -6,65 +6,65 @@ using OpenLiveWriter.Controls; namespace OpenLiveWriter.PostEditor.Configuration.Wizard.DisplayMessages { - /// - /// Summary description for DeleteSingleItemDisplayMessage. - /// - public class HomepageUrlRequiredDisplayMessage : DisplayMessage - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for DeleteSingleItemDisplayMessage. + /// + public class HomepageUrlRequiredDisplayMessage : DisplayMessage + { + /// + /// Required designer variable. + /// + private Container components = null; - public HomepageUrlRequiredDisplayMessage(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public HomepageUrlRequiredDisplayMessage(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - } + } - public HomepageUrlRequiredDisplayMessage() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public HomepageUrlRequiredDisplayMessage() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - } + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // HomepageUrlRequiredDisplayMessage - // - this.Text = "Please enter your Weblog\'s Homepage URL to continue."; - this.Title = "Homepage Url Required"; - this.Type = OpenLiveWriter.Controls.DisplayMessageType.Warning; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // HomepageUrlRequiredDisplayMessage + // + this.Text = "Please enter your Weblog\'s Homepage URL to continue."; + this.Title = "Homepage Url Required"; + this.Type = OpenLiveWriter.Controls.DisplayMessageType.Warning; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/DisplayMessages/HostNameRequiredDisplayMessage.cs b/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/DisplayMessages/HostNameRequiredDisplayMessage.cs index 860ad290..20ce172b 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/DisplayMessages/HostNameRequiredDisplayMessage.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/DisplayMessages/HostNameRequiredDisplayMessage.cs @@ -7,62 +7,62 @@ using OpenLiveWriter.Controls; namespace OpenLiveWriter.PostEditor.Configuration.Wizard.DisplayMessages { - public class HostNameRequiredDisplayMessage : DisplayMessage - { - /// - /// Required designer variable. - /// - private Container components = null; + public class HostNameRequiredDisplayMessage : DisplayMessage + { + /// + /// Required designer variable. + /// + private Container components = null; - public HostNameRequiredDisplayMessage(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public HostNameRequiredDisplayMessage(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - } + } - public HostNameRequiredDisplayMessage() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public HostNameRequiredDisplayMessage() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - } + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // UsernameAndPasswordRequiredDisplayMessage - // - this.Text = "Please enter a hostname to continue."; - this.Title = "Hostname Required"; - this.Type = DisplayMessageType.Warning; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // UsernameAndPasswordRequiredDisplayMessage + // + this.Text = "Please enter a hostname to continue."; + this.Title = "Hostname Required"; + this.Type = DisplayMessageType.Warning; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/DisplayMessages/LoginFailedDisplayMessage.cs b/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/DisplayMessages/LoginFailedDisplayMessage.cs index fd97b448..64544ad1 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/DisplayMessages/LoginFailedDisplayMessage.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/DisplayMessages/LoginFailedDisplayMessage.cs @@ -7,62 +7,62 @@ using OpenLiveWriter.Controls; namespace OpenLiveWriter.PostEditor.Configuration.Wizard.DisplayMessages { - public class LoginFailedDisplayMessage : DisplayMessage - { - /// - /// Required designer variable. - /// - private Container components = null; + public class LoginFailedDisplayMessage : DisplayMessage + { + /// + /// Required designer variable. + /// + private Container components = null; - public LoginFailedDisplayMessage(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public LoginFailedDisplayMessage(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - } + } - public LoginFailedDisplayMessage() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public LoginFailedDisplayMessage() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - } + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // UsernameAndPasswordRequiredDisplayMessage - // - this.Text = "{0} was not able to login to the remote server using the username and password.\r\n\r\nPlease check that the information is correct and try again."; - this.Title = "Login Failed"; - this.Type = DisplayMessageType.Warning; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // UsernameAndPasswordRequiredDisplayMessage + // + this.Text = "{0} was not able to login to the remote server using the username and password.\r\n\r\nPlease check that the information is correct and try again."; + this.Title = "Login Failed"; + this.Type = DisplayMessageType.Warning; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/DisplayMessages/MappingVerificationFailedDisplayMessage.cs b/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/DisplayMessages/MappingVerificationFailedDisplayMessage.cs index ac83e7e4..4b5efbd6 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/DisplayMessages/MappingVerificationFailedDisplayMessage.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/DisplayMessages/MappingVerificationFailedDisplayMessage.cs @@ -7,64 +7,64 @@ using OpenLiveWriter.Controls; namespace OpenLiveWriter.PostEditor.Configuration.Wizard.DisplayMessages { - public class MappingVerificationFailedDisplayMessage : DisplayMessage - { - /// - /// Required designer variable. - /// - private Container components = null; + public class MappingVerificationFailedDisplayMessage : DisplayMessage + { + /// + /// Required designer variable. + /// + private Container components = null; - public MappingVerificationFailedDisplayMessage(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public MappingVerificationFailedDisplayMessage(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - } + } - public MappingVerificationFailedDisplayMessage() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public MappingVerificationFailedDisplayMessage() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - } + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // MappingVerificationFailedDisplayMessage - // - this.Buttons = System.Windows.Forms.MessageBoxButtons.YesNo; - this.DefaultButton = System.Windows.Forms.MessageBoxDefaultButton.Button2; - this.Text = "The URL mapping could not be verified. Do you want to continue anyway?"; - this.Title = "Mapping Verification Failed"; - this.Type = OpenLiveWriter.Controls.DisplayMessageType.Question; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // MappingVerificationFailedDisplayMessage + // + this.Buttons = System.Windows.Forms.MessageBoxButtons.YesNo; + this.DefaultButton = System.Windows.Forms.MessageBoxDefaultButton.Button2; + this.Text = "The URL mapping could not be verified. Do you want to continue anyway?"; + this.Title = "Mapping Verification Failed"; + this.Type = OpenLiveWriter.Controls.DisplayMessageType.Question; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/DisplayMessages/RequiredFieldOmittedDisplayMessage.cs b/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/DisplayMessages/RequiredFieldOmittedDisplayMessage.cs index f2e8d079..78ee9b16 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/DisplayMessages/RequiredFieldOmittedDisplayMessage.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/DisplayMessages/RequiredFieldOmittedDisplayMessage.cs @@ -11,69 +11,69 @@ using OpenLiveWriter.Controls; namespace OpenLiveWriter.PostEditor.Configuration.Wizard.DisplayMessages { - public class RequiredFieldOmittedDisplayMessage : DisplayMessage - { - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; + public class RequiredFieldOmittedDisplayMessage : DisplayMessage + { + /// + /// Required designer variable. + /// + private System.ComponentModel.Container components = null; - public RequiredFieldOmittedDisplayMessage(System.ComponentModel.IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public RequiredFieldOmittedDisplayMessage(System.ComponentModel.IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - // - // TODO: Add any constructor code after InitializeComponent call - // - } + // + // TODO: Add any constructor code after InitializeComponent call + // + } - public RequiredFieldOmittedDisplayMessage() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public RequiredFieldOmittedDisplayMessage() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // TODO: Add any constructor code after InitializeComponent call - // - } + // + // TODO: Add any constructor code after InitializeComponent call + // + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // RequiredFieldOmittedDisplayMessage - // - this.Text = "You must enter a value for the {0} field in order{1}to configure weblog publishin" + - "g."; - this.Title = "Required Field Missing"; - this.Type = DisplayMessageType.Warning; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // RequiredFieldOmittedDisplayMessage + // + this.Text = "You must enter a value for the {0} field in order{1}to configure weblog publishin" + + "g."; + this.Title = "Required Field Missing"; + this.Type = DisplayMessageType.Warning; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/DisplayMessages/ServerParameterNotSpecifiedDisplayMessage.cs b/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/DisplayMessages/ServerParameterNotSpecifiedDisplayMessage.cs index 2e4e0aa6..4a9b22ed 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/DisplayMessages/ServerParameterNotSpecifiedDisplayMessage.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/DisplayMessages/ServerParameterNotSpecifiedDisplayMessage.cs @@ -6,66 +6,66 @@ using OpenLiveWriter.Controls; namespace OpenLiveWriter.PostEditor.Configuration.Wizard.DisplayMessages { - /// - /// Summary description for DeleteSingleItemDisplayMessage. - /// - public class ServerParameterNotSpecifiedDisplayMessage : DisplayMessage - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for DeleteSingleItemDisplayMessage. + /// + public class ServerParameterNotSpecifiedDisplayMessage : DisplayMessage + { + /// + /// Required designer variable. + /// + private Container components = null; - public ServerParameterNotSpecifiedDisplayMessage(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public ServerParameterNotSpecifiedDisplayMessage(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - } + } - public ServerParameterNotSpecifiedDisplayMessage() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); - } + public ServerParameterNotSpecifiedDisplayMessage() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // ServerParameterNotSpecifiedDisplayMessage - // - this.Text = "You need to customize the Weblog API URL before proceeding.{0}The following value" + - "s were not customized:{0}{0}{1}{0}{0}Please change these values to whatever is a" + - "ppropriate for{0}your weblog server."; - this.Title = "Weblog API URL Requires Customization"; - this.Type = DisplayMessageType.Warning; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // ServerParameterNotSpecifiedDisplayMessage + // + this.Text = "You need to customize the Weblog API URL before proceeding.{0}The following value" + + "s were not customized:{0}{0}{1}{0}{0}Please change these values to whatever is a" + + "ppropriate for{0}your weblog server."; + this.Title = "Weblog API URL Requires Customization"; + this.Type = DisplayMessageType.Warning; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/DisplayMessages/SpacesBlogNotFoundDisplayMessage.cs b/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/DisplayMessages/SpacesBlogNotFoundDisplayMessage.cs index 0c307bed..09b42824 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/DisplayMessages/SpacesBlogNotFoundDisplayMessage.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/DisplayMessages/SpacesBlogNotFoundDisplayMessage.cs @@ -7,63 +7,63 @@ using OpenLiveWriter.Controls; namespace OpenLiveWriter.PostEditor.Configuration.Wizard.DisplayMessages { - public class SpacesBlogNotFoundDisplayMessage : DisplayMessage - { - /// - /// Required designer variable. - /// - private Container components = null; + public class SpacesBlogNotFoundDisplayMessage : DisplayMessage + { + /// + /// Required designer variable. + /// + private Container components = null; - public SpacesBlogNotFoundDisplayMessage(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public SpacesBlogNotFoundDisplayMessage(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - } + } - public SpacesBlogNotFoundDisplayMessage() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public SpacesBlogNotFoundDisplayMessage() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - } + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // SpacesBlogNotFoundDisplayMessage - // - this.Text = "{0} could not locate a Windows Live Space for this user.\r\nPlease set up a Wind" + - "ows Live Space before continuing."; - this.Title = "No Space Found"; - this.Type = OpenLiveWriter.Controls.DisplayMessageType.Warning; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // SpacesBlogNotFoundDisplayMessage + // + this.Text = "{0} could not locate a Windows Live Space for this user.\r\nPlease set up a Wind" + + "ows Live Space before continuing."; + this.Title = "No Space Found"; + this.Type = OpenLiveWriter.Controls.DisplayMessageType.Warning; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/DisplayMessages/SpacesHomepageUrlInvalidDisplayMessage.cs b/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/DisplayMessages/SpacesHomepageUrlInvalidDisplayMessage.cs index 43dca808..6236ee39 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/DisplayMessages/SpacesHomepageUrlInvalidDisplayMessage.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/DisplayMessages/SpacesHomepageUrlInvalidDisplayMessage.cs @@ -7,63 +7,63 @@ using OpenLiveWriter.Controls; namespace OpenLiveWriter.PostEditor.Configuration.Wizard.DisplayMessages { - public class SpacesHomepageUrlInvalidDisplayMessage : DisplayMessage - { - /// - /// Required designer variable. - /// - private Container components = null; + public class SpacesHomepageUrlInvalidDisplayMessage : DisplayMessage + { + /// + /// Required designer variable. + /// + private Container components = null; - public SpacesHomepageUrlInvalidDisplayMessage(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public SpacesHomepageUrlInvalidDisplayMessage(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - } + } - public SpacesHomepageUrlInvalidDisplayMessage() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public SpacesHomepageUrlInvalidDisplayMessage() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - } + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // SpacesHomepageUrlInvalidDisplayMessage - // - this.Text = "The specified URL does not appear to be valid Spaces homepage.\r\nPlease enter a va" + - "lid Spaces URL or set up a Windows Live Space before continuing."; - this.Title = "Invalid Spaces URL Found"; - this.Type = OpenLiveWriter.Controls.DisplayMessageType.Warning; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // SpacesHomepageUrlInvalidDisplayMessage + // + this.Text = "The specified URL does not appear to be valid Spaces homepage.\r\nPlease enter a va" + + "lid Spaces URL or set up a Windows Live Space before continuing."; + this.Title = "Invalid Spaces URL Found"; + this.Type = OpenLiveWriter.Controls.DisplayMessageType.Warning; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/DisplayMessages/SpacesHomepageUrlRequiredDisplayMessage.cs b/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/DisplayMessages/SpacesHomepageUrlRequiredDisplayMessage.cs index 06eb6b6f..a0c2f53c 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/DisplayMessages/SpacesHomepageUrlRequiredDisplayMessage.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/DisplayMessages/SpacesHomepageUrlRequiredDisplayMessage.cs @@ -6,65 +6,65 @@ using OpenLiveWriter.Controls; namespace OpenLiveWriter.PostEditor.Configuration.Wizard.DisplayMessages { - /// - /// Summary description for DeleteSingleItemDisplayMessage. - /// - public class SpacesHomepageUrlRequiredDisplayMessage : DisplayMessage - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for DeleteSingleItemDisplayMessage. + /// + public class SpacesHomepageUrlRequiredDisplayMessage : DisplayMessage + { + /// + /// Required designer variable. + /// + private Container components = null; - public SpacesHomepageUrlRequiredDisplayMessage(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public SpacesHomepageUrlRequiredDisplayMessage(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - } + } - public SpacesHomepageUrlRequiredDisplayMessage() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public SpacesHomepageUrlRequiredDisplayMessage() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - } + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // SpacesHomepageUrlRequiredDisplayMessage - // - this.Text = "Please enter your Spaces\' Homepage URL to continue."; - this.Title = "Homepage Url Required"; - this.Type = OpenLiveWriter.Controls.DisplayMessageType.Warning; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // SpacesHomepageUrlRequiredDisplayMessage + // + this.Text = "Please enter your Spaces\' Homepage URL to continue."; + this.Title = "Homepage Url Required"; + this.Type = OpenLiveWriter.Controls.DisplayMessageType.Warning; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/DisplayMessages/UnknownLoginErrorDisplayMessage.cs b/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/DisplayMessages/UnknownLoginErrorDisplayMessage.cs index bdf2a8bd..3476086b 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/DisplayMessages/UnknownLoginErrorDisplayMessage.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/DisplayMessages/UnknownLoginErrorDisplayMessage.cs @@ -7,69 +7,69 @@ using OpenLiveWriter.Controls; namespace OpenLiveWriter.PostEditor.Configuration.Wizard.DisplayMessages { - public class UnknownLoginErrrorDisplayMessage : DisplayMessage - { - /// - /// Required designer variable. - /// - private Container components = null; + public class UnknownLoginErrrorDisplayMessage : DisplayMessage + { + /// + /// Required designer variable. + /// + private Container components = null; - public UnknownLoginErrrorDisplayMessage(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public UnknownLoginErrrorDisplayMessage(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - InitMessage(); - } + InitMessage(); + } - public UnknownLoginErrrorDisplayMessage() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public UnknownLoginErrrorDisplayMessage() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - InitMessage(); - } + InitMessage(); + } - private void InitMessage() - { - Text = - "An unexpected error occurred while trying to login to the remote server.\r\n\r\nIf you have a proxy or firewall configured, please make sure your system\r\nis properly configured to allow this program to connect to the remote\r\nserver."; - } + private void InitMessage() + { + Text = + "An unexpected error occurred while trying to login to the remote server.\r\n\r\nIf you have a proxy or firewall configured, please make sure your system\r\nis properly configured to allow this program to connect to the remote\r\nserver."; + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // UnknownLoginErrrorDisplayMessage - // - this.Text = ""; - this.Title = "Login Failed"; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // UnknownLoginErrrorDisplayMessage + // + this.Text = ""; + this.Title = "Login Failed"; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/DisplayMessages/UrlMappingRequiredDisplayMessage.cs b/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/DisplayMessages/UrlMappingRequiredDisplayMessage.cs index 11fdf43a..3f4d7ea2 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/DisplayMessages/UrlMappingRequiredDisplayMessage.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/DisplayMessages/UrlMappingRequiredDisplayMessage.cs @@ -7,62 +7,62 @@ using OpenLiveWriter.Controls; namespace OpenLiveWriter.PostEditor.Configuration.Wizard.DisplayMessages { - public class UrlMappingRequiredDisplayMessage : DisplayMessage - { - /// - /// Required designer variable. - /// - private Container components = null; + public class UrlMappingRequiredDisplayMessage : DisplayMessage + { + /// + /// Required designer variable. + /// + private Container components = null; - public UrlMappingRequiredDisplayMessage(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public UrlMappingRequiredDisplayMessage(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - } + } - public UrlMappingRequiredDisplayMessage() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public UrlMappingRequiredDisplayMessage() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - } + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // UsernameAndPasswordRequiredDisplayMessage - // - this.Text = "Please enter a URL mapping to continue."; - this.Title = "URL Mapping Required"; - this.Type = DisplayMessageType.Warning; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // UsernameAndPasswordRequiredDisplayMessage + // + this.Text = "Please enter a URL mapping to continue."; + this.Title = "URL Mapping Required"; + this.Type = DisplayMessageType.Warning; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/DisplayMessages/UsernameAndPasswordRequiredDisplayMessage.cs b/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/DisplayMessages/UsernameAndPasswordRequiredDisplayMessage.cs index b3a71838..b0ef1071 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/DisplayMessages/UsernameAndPasswordRequiredDisplayMessage.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/DisplayMessages/UsernameAndPasswordRequiredDisplayMessage.cs @@ -7,62 +7,62 @@ using OpenLiveWriter.Controls; namespace OpenLiveWriter.PostEditor.Configuration.Wizard.DisplayMessages { - public class UsernameAndPasswordRequiredDisplayMessage : DisplayMessage - { - /// - /// Required designer variable. - /// - private Container components = null; + public class UsernameAndPasswordRequiredDisplayMessage : DisplayMessage + { + /// + /// Required designer variable. + /// + private Container components = null; - public UsernameAndPasswordRequiredDisplayMessage(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public UsernameAndPasswordRequiredDisplayMessage(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - } + } - public UsernameAndPasswordRequiredDisplayMessage() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public UsernameAndPasswordRequiredDisplayMessage() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - } + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // UsernameAndPasswordRequiredDisplayMessage - // - this.Text = "Please enter a username and password to continue."; - this.Title = "Username and Password Required"; - this.Type = DisplayMessageType.Warning; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // UsernameAndPasswordRequiredDisplayMessage + // + this.Text = "Please enter a username and password to continue."; + this.Title = "Username and Password Required"; + this.Type = DisplayMessageType.Warning; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/WeblogConfigurationWizardController.cs b/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/WeblogConfigurationWizardController.cs index 7c03f69d..acb9f70d 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/WeblogConfigurationWizardController.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/WeblogConfigurationWizardController.cs @@ -79,7 +79,6 @@ namespace OpenLiveWriter.PostEditor.Configuration.Wizard return controller.EditWeblogTemporarySettings(owner); } - private WeblogConfigurationWizardController(TemporaryBlogSettings settings) : base() { @@ -228,7 +227,6 @@ namespace OpenLiveWriter.PostEditor.Configuration.Wizard _authenticationRequired = showAuthenticationStep; } - private void AddConfirmationStep() { addWizardStep( @@ -588,7 +586,6 @@ namespace OpenLiveWriter.PostEditor.Configuration.Wizard _temporarySettings.Credentials); } - void OnSelectProviderCompleted(Object stepControl) { // get reference to panel @@ -616,7 +613,6 @@ namespace OpenLiveWriter.PostEditor.Configuration.Wizard } } - #endregion #region Select Blog Panel diff --git a/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/WeblogConfigurationWizardPanelBasicInfo.cs b/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/WeblogConfigurationWizardPanelBasicInfo.cs index 720c8143..e03b0adf 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/WeblogConfigurationWizardPanelBasicInfo.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/WeblogConfigurationWizardPanelBasicInfo.cs @@ -348,7 +348,6 @@ namespace OpenLiveWriter.PostEditor.Configuration.Wizard } - } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/WeblogConfigurationWizardPanelBlogType.cs b/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/WeblogConfigurationWizardPanelBlogType.cs index 48ed8f92..22eb0fed 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/WeblogConfigurationWizardPanelBlogType.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/WeblogConfigurationWizardPanelBlogType.cs @@ -213,7 +213,6 @@ namespace OpenLiveWriter.PostEditor.Configuration.Wizard } } - private class WeblogType { public WeblogType(IBlogProviderAccountWizardDescription providerAccountWizard) @@ -268,7 +267,6 @@ namespace OpenLiveWriter.PostEditor.Configuration.Wizard private IBlogProviderAccountWizardDescription _providerAccountWizard; } - /// /// Clean up any resources being used. /// diff --git a/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/WeblogConfigurationWizardPanelConfirmation.cs b/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/WeblogConfigurationWizardPanelConfirmation.cs index 038c8cb8..12a4a08f 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/WeblogConfigurationWizardPanelConfirmation.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/WeblogConfigurationWizardPanelConfirmation.cs @@ -166,7 +166,6 @@ namespace OpenLiveWriter.PostEditor.Configuration.Wizard return true; } - private void buttonEditWeblogSettings_Click(object sender, System.EventArgs e) { try @@ -181,9 +180,9 @@ namespace OpenLiveWriter.PostEditor.Configuration.Wizard } /// - /// Clean up any resources being used. - /// - protected override void Dispose(bool disposing) + /// Clean up any resources being used. + /// + protected override void Dispose(bool disposing) { if (disposing) { diff --git a/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/WeblogConfigurationWizardPanelSelectProvider.cs b/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/WeblogConfigurationWizardPanelSelectProvider.cs index 78ac12bb..5d7e0de4 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/WeblogConfigurationWizardPanelSelectProvider.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/WeblogConfigurationWizardPanelSelectProvider.cs @@ -316,7 +316,6 @@ namespace OpenLiveWriter.PostEditor.Configuration.Wizard } #endregion - private class BlogProviderDescriptionProxy : IBlogProviderDescription { public BlogProviderDescriptionProxy(IBlogProviderDescription provider) @@ -423,7 +422,6 @@ namespace OpenLiveWriter.PostEditor.Configuration.Wizard } - } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/WeblogConfigurationWizardPanelSharePointAuthentication.cs b/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/WeblogConfigurationWizardPanelSharePointAuthentication.cs index fc0995bf..6c84291b 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/WeblogConfigurationWizardPanelSharePointAuthentication.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/WeblogConfigurationWizardPanelSharePointAuthentication.cs @@ -183,16 +183,16 @@ namespace OpenLiveWriter.PostEditor.Configuration.Wizard #endregion /*public string Username - { - get{ return textBoxUsername.Text.Trim(); } - set{ textBoxUsername.Text = value; } - } + { + get{ return textBoxUsername.Text.Trim(); } + set{ textBoxUsername.Text = value; } + } - public string Password - { - get{ return textBoxPassword.Text.Trim(); } - set{ textBoxPassword.Text = value; } - }*/ + public string Password + { + get{ return textBoxPassword.Text.Trim(); } + set{ textBoxPassword.Text = value; } + }*/ public override bool ValidatePanel() { diff --git a/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/WeblogConfigurationWizardPanelWelcome.cs b/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/WeblogConfigurationWizardPanelWelcome.cs index 797e76b1..95918c09 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/WeblogConfigurationWizardPanelWelcome.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/WeblogConfigurationWizardPanelWelcome.cs @@ -134,6 +134,5 @@ namespace OpenLiveWriter.PostEditor.Configuration.Wizard } #endregion - } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/WeblogHomepageUrlControl.cs b/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/WeblogHomepageUrlControl.cs index 843ef832..0db0effb 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/WeblogHomepageUrlControl.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/WeblogHomepageUrlControl.cs @@ -85,7 +85,6 @@ namespace OpenLiveWriter.PostEditor.Configuration.Wizard public event EventHandler Changed; - /// /// Clean up any resources being used. /// diff --git a/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/WizardAutoDetectionOperations.cs b/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/WizardAutoDetectionOperations.cs index 44065bab..741b7607 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/WizardAutoDetectionOperations.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/WizardAutoDetectionOperations.cs @@ -288,6 +288,5 @@ namespace OpenLiveWriter.PostEditor.Configuration.Wizard } - } diff --git a/src/managed/OpenLiveWriter.PostEditor/ContentEditor/ContentEditor.cs b/src/managed/OpenLiveWriter.PostEditor/ContentEditor/ContentEditor.cs index 30c2f3b3..8b3612bd 100644 --- a/src/managed/OpenLiveWriter.PostEditor/ContentEditor/ContentEditor.cs +++ b/src/managed/OpenLiveWriter.PostEditor/ContentEditor/ContentEditor.cs @@ -415,7 +415,6 @@ namespace OpenLiveWriter.PostEditor CommandManager.Add(commandInsertFile); #endif - CommandManager.Add(new CommandRecentPost()); CommandManager.Add(CommandId.WordCount, new EventHandler(WordCount_Execute)); if (ApplicationDiagnostics.TestMode) @@ -956,7 +955,6 @@ namespace OpenLiveWriter.PostEditor { FixCommands((e as EditableRegionFocusChangedEventArgs).IsFullyEditable); - Debug.Assert(_textEditingCommandDispatcher != null, "ContentEditor was not setup correctly, an editor got focus before command were created."); _textEditingCommandDispatcher.TitleFocusChanged(); @@ -1586,7 +1584,6 @@ namespace OpenLiveWriter.PostEditor } } - public void InsertLink(string url, string linkText, string linkTitle, string rel, bool newWindow) { _currentEditor.InsertLink(url, linkText, linkTitle, rel, newWindow); @@ -2194,7 +2191,6 @@ namespace OpenLiveWriter.PostEditor _insertImageDialogWin7.InitialDirectory = null; } - // Check to see if the user actually selected anything if (imageFiles != null && imageFiles.Length > 0) { @@ -2284,7 +2280,6 @@ namespace OpenLiveWriter.PostEditor ShellHelper.LaunchUrl(GLink.Instance.DownloadPlugins); } - private void _normalHtmlContentEditor_HelpRequest(object sender, EventArgs e) { // execute the system help command @@ -2355,7 +2350,6 @@ namespace OpenLiveWriter.PostEditor FixCommandEvent(fullyEditableActive); } - public bool FullyEditableRegionActive { get @@ -2897,13 +2891,11 @@ namespace OpenLiveWriter.PostEditor private Panel _editorContainer; private bool _focusedRegionSupportsFormattingCommands; - private IContainer components = new Container(); private Timer wordCountTimer; private RefreshableContentManager _refreshSmartContentManager; - private BlogEditingTemplate GetSurroundingContent() { // surrounding content based on standard header and footer @@ -3207,7 +3199,6 @@ namespace OpenLiveWriter.PostEditor element = null; } - // If we found an image or smart content, try to get the alignment off of it if (element != null) { diff --git a/src/managed/OpenLiveWriter.PostEditor/ContentEditor/ContentEditorProxy.cs b/src/managed/OpenLiveWriter.PostEditor/ContentEditor/ContentEditorProxy.cs index 5d1cfdfb..47d3bff7 100644 --- a/src/managed/OpenLiveWriter.PostEditor/ContentEditor/ContentEditorProxy.cs +++ b/src/managed/OpenLiveWriter.PostEditor/ContentEditor/ContentEditorProxy.cs @@ -433,7 +433,6 @@ namespace OpenLiveWriter.PostEditor return publishDocument; } - public void SetSize(int width, int height) { panel.Size = new Size(width, height); diff --git a/src/managed/OpenLiveWriter.PostEditor/ContentEditor/IContentEditor.cs b/src/managed/OpenLiveWriter.PostEditor/ContentEditor/IContentEditor.cs index 81283b26..5232064a 100644 --- a/src/managed/OpenLiveWriter.PostEditor/ContentEditor/IContentEditor.cs +++ b/src/managed/OpenLiveWriter.PostEditor/ContentEditor/IContentEditor.cs @@ -140,7 +140,7 @@ namespace OpenLiveWriter.PostEditor /// /// Turns off spelling checking--for example, user selected "None" for dictionary /// - void DisableSpelling(); + void DisableSpelling(); /// /// Releases resources and shuts down the editor. diff --git a/src/managed/OpenLiveWriter.PostEditor/ContentEditor/IContentEditorFactory.cs b/src/managed/OpenLiveWriter.PostEditor/ContentEditor/IContentEditorFactory.cs index c137b1f3..6fa7c239 100644 --- a/src/managed/OpenLiveWriter.PostEditor/ContentEditor/IContentEditorFactory.cs +++ b/src/managed/OpenLiveWriter.PostEditor/ContentEditor/IContentEditorFactory.cs @@ -130,7 +130,6 @@ namespace OpenLiveWriter.PostEditor PlainText = 8 } - [Flags] [Guid("ac667254-1b9d-4db8-83da-b026c730eff2")] [ComVisible(true)] diff --git a/src/managed/OpenLiveWriter.PostEditor/ContentSources/Common/MediaInsertForm.cs b/src/managed/OpenLiveWriter.PostEditor/ContentSources/Common/MediaInsertForm.cs index be2fbb6d..2dd63e39 100644 --- a/src/managed/OpenLiveWriter.PostEditor/ContentSources/Common/MediaInsertForm.cs +++ b/src/managed/OpenLiveWriter.PostEditor/ContentSources/Common/MediaInsertForm.cs @@ -40,7 +40,6 @@ namespace OpenLiveWriter.PostEditor.ContentSources.Common public const string EventName = "Inserting Media"; - public MediaInsertForm(List sources, string blogID, int selectedTab, MediaSmartContent content, string title, bool showCopyright) : this(sources, blogID, selectedTab, content, title, showCopyright, false) { diff --git a/src/managed/OpenLiveWriter.PostEditor/ContentSources/Common/PanelLoginControl.cs b/src/managed/OpenLiveWriter.PostEditor/ContentSources/Common/PanelLoginControl.cs index 0e238fc2..01ecacc9 100644 --- a/src/managed/OpenLiveWriter.PostEditor/ContentSources/Common/PanelLoginControl.cs +++ b/src/managed/OpenLiveWriter.PostEditor/ContentSources/Common/PanelLoginControl.cs @@ -166,7 +166,6 @@ namespace OpenLiveWriter.PostEditor.ContentSources.Common LayoutHelper.NaturalizeHeightAndDistribute(15, ckBoxSavePassword, btnLogin); } - if (BidiHelper.IsRightToLeft) { btnLogin.Left = txtPassword.Left; @@ -442,7 +441,6 @@ namespace OpenLiveWriter.PostEditor.ContentSources.Common Refresh(); } - private void Login() { string username = txtUsername.Text.Trim(); diff --git a/src/managed/OpenLiveWriter.PostEditor/ContentSources/ContentSourceManager.cs b/src/managed/OpenLiveWriter.PostEditor/ContentSources/ContentSourceManager.cs index 01a847bc..ef78431a 100644 --- a/src/managed/OpenLiveWriter.PostEditor/ContentSources/ContentSourceManager.cs +++ b/src/managed/OpenLiveWriter.PostEditor/ContentSources/ContentSourceManager.cs @@ -345,7 +345,6 @@ namespace OpenLiveWriter.PostEditor.ContentSources internal const int IMAGE_WIDTH = 16; internal const int IMAGE_HEIGHT = 16; - private string VerifyAttributeValue(Type pluginType, object attribute, string attributeField, string attributeValue) { if (attributeValue != null && attributeValue != String.Empty) @@ -732,7 +731,6 @@ namespace OpenLiveWriter.PostEditor.ContentSources } } - public static string MakeContainingElementId(string sourceId, string contentBlockId) { return String.Format(CultureInfo.InvariantCulture, "{0}:{1}:{2}", SMART_CONTENT_ID_PREFIX, sourceId, contentBlockId); @@ -820,7 +818,6 @@ namespace OpenLiveWriter.PostEditor.ContentSources } } - /// /// Returns true if the element className is a structured block. /// diff --git a/src/managed/OpenLiveWriter.PostEditor/ContentSources/SmartContentInsertionHelper.cs b/src/managed/OpenLiveWriter.PostEditor/ContentSources/SmartContentInsertionHelper.cs index ef702e9c..f9fdcdf6 100644 --- a/src/managed/OpenLiveWriter.PostEditor/ContentSources/SmartContentInsertionHelper.cs +++ b/src/managed/OpenLiveWriter.PostEditor/ContentSources/SmartContentInsertionHelper.cs @@ -143,7 +143,6 @@ namespace OpenLiveWriter.PostEditor.ContentSources MarkupRange stagingRange = MarkupServices.CreateMarkupRange(sc1, sc2); stagingRange.MoveToElement(doc.body, false); - //IE7 hack: fixes bug 305512. Note that this will destroy the inner content of the element, //so make sure it is called before the refreshed content is inserted. BeforeInsertInvalidateHackForIE7(element); diff --git a/src/managed/OpenLiveWriter.PostEditor/ContentSources/UrlContentRetreivalWithProgress.cs b/src/managed/OpenLiveWriter.PostEditor/ContentSources/UrlContentRetreivalWithProgress.cs index e24aaa70..49579f75 100644 --- a/src/managed/OpenLiveWriter.PostEditor/ContentSources/UrlContentRetreivalWithProgress.cs +++ b/src/managed/OpenLiveWriter.PostEditor/ContentSources/UrlContentRetreivalWithProgress.cs @@ -249,4 +249,3 @@ namespace OpenLiveWriter.PostEditor.ContentSources } } - diff --git a/src/managed/OpenLiveWriter.PostEditor/ContentSources/UrlContentRetreivalWithProgressDialog.cs b/src/managed/OpenLiveWriter.PostEditor/ContentSources/UrlContentRetreivalWithProgressDialog.cs index 7c4f6ea1..af829601 100644 --- a/src/managed/OpenLiveWriter.PostEditor/ContentSources/UrlContentRetreivalWithProgressDialog.cs +++ b/src/managed/OpenLiveWriter.PostEditor/ContentSources/UrlContentRetreivalWithProgressDialog.cs @@ -27,7 +27,6 @@ namespace OpenLiveWriter.PostEditor.ContentSources /// private System.ComponentModel.Container components = null; - public UrlContentRetreivalWithProgressDialog(ContentSourceInfo contentSourceInfo) { // @@ -88,7 +87,6 @@ namespace OpenLiveWriter.PostEditor.ContentSources Close(); } - protected override void OnActivated(EventArgs e) { base.OnActivated(e); diff --git a/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/ConfirmDeletePostDisplayMessage.cs b/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/ConfirmDeletePostDisplayMessage.cs index 897f30e6..f1f3895a 100644 --- a/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/ConfirmDeletePostDisplayMessage.cs +++ b/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/ConfirmDeletePostDisplayMessage.cs @@ -6,69 +6,69 @@ using OpenLiveWriter.Controls; namespace OpenLiveWriter.PostEditor.DisplayMessages { - public class ConfirmDeletePostDisplayMessage : DisplayMessage - { - /// - /// Required designer variable. - /// - private Container components = null; + public class ConfirmDeletePostDisplayMessage : DisplayMessage + { + /// + /// Required designer variable. + /// + private Container components = null; - public ConfirmDeletePostDisplayMessage(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public ConfirmDeletePostDisplayMessage(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - // - // - // - } + // + // + // + } - public ConfirmDeletePostDisplayMessage() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public ConfirmDeletePostDisplayMessage() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // ConfirmDeletePostDisplayMessage - // - this.Buttons = System.Windows.Forms.MessageBoxButtons.YesNo; - this.Text = "Are you sure you want to delete the {0} \"{1}\"?"; - this.Title = "Confirm Delete"; - this.Type = DisplayMessageType.Warning; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // ConfirmDeletePostDisplayMessage + // + this.Buttons = System.Windows.Forms.MessageBoxButtons.YesNo; + this.Text = "Are you sure you want to delete the {0} \"{1}\"?"; + this.Title = "Confirm Delete"; + this.Type = DisplayMessageType.Warning; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/IncompatiblePostInfoTypeDisplayMessage.cs b/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/IncompatiblePostInfoTypeDisplayMessage.cs index 5603ee37..2e6dc72f 100644 --- a/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/IncompatiblePostInfoTypeDisplayMessage.cs +++ b/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/IncompatiblePostInfoTypeDisplayMessage.cs @@ -6,71 +6,71 @@ using OpenLiveWriter.Controls; namespace OpenLiveWriter.PostEditor.DisplayMessages { - /// - /// Summary description for DeleteSingleItemDisplayMessage. - /// - public class IncompatiblePostInfoTypeDisplayMessage : DisplayMessage - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for DeleteSingleItemDisplayMessage. + /// + public class IncompatiblePostInfoTypeDisplayMessage : DisplayMessage + { + /// + /// Required designer variable. + /// + private Container components = null; - public IncompatiblePostInfoTypeDisplayMessage(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public IncompatiblePostInfoTypeDisplayMessage(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - // - // - // - } + // + // + // + } - public IncompatiblePostInfoTypeDisplayMessage() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public IncompatiblePostInfoTypeDisplayMessage() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // IncompatiblePostInfoTypeDisplayMessage - // - this.Text = "An internal error occurred (incompatible blog post info type). Unable to " + - "open the selected post."; - this.Title = "Internal Error"; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // IncompatiblePostInfoTypeDisplayMessage + // + this.Text = "An internal error occurred (incompatible blog post info type). Unable to " + + "open the selected post."; + this.Title = "Internal Error"; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/NoPostSelectedDisplayMessage.cs b/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/NoPostSelectedDisplayMessage.cs index 0c35d927..57acfad7 100644 --- a/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/NoPostSelectedDisplayMessage.cs +++ b/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/NoPostSelectedDisplayMessage.cs @@ -6,71 +6,71 @@ using OpenLiveWriter.Controls; namespace OpenLiveWriter.PostEditor.DisplayMessages { - /// - /// Summary description for DeleteSingleItemDisplayMessage. - /// - public class NoPostSelectedDisplayMessage : DisplayMessage - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for DeleteSingleItemDisplayMessage. + /// + public class NoPostSelectedDisplayMessage : DisplayMessage + { + /// + /// Required designer variable. + /// + private Container components = null; - public NoPostSelectedDisplayMessage(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public NoPostSelectedDisplayMessage(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - // - // - // - } + // + // + // + } - public NoPostSelectedDisplayMessage() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public NoPostSelectedDisplayMessage() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // NoPostSelectedDisplayMessage - // - this.Text = "You must select a post to open before proceeding."; - this.Title = "No Post Selected"; - this.Type = DisplayMessageType.Warning; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // NoPostSelectedDisplayMessage + // + this.Text = "You must select a post to open before proceeding."; + this.Title = "No Post Selected"; + this.Type = DisplayMessageType.Warning; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/NoTitleSpecifiedDisplayMessage.cs b/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/NoTitleSpecifiedDisplayMessage.cs index 4a63ebc2..e77e8df7 100644 --- a/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/NoTitleSpecifiedDisplayMessage.cs +++ b/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/NoTitleSpecifiedDisplayMessage.cs @@ -6,71 +6,71 @@ using OpenLiveWriter.Controls; namespace OpenLiveWriter.PostEditor.DisplayMessages { - /// - /// Summary description for DeleteSingleItemDisplayMessage. - /// - public class NoTitleSpecifiedDisplayMessage : DisplayMessage - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for DeleteSingleItemDisplayMessage. + /// + public class NoTitleSpecifiedDisplayMessage : DisplayMessage + { + /// + /// Required designer variable. + /// + private Container components = null; - public NoTitleSpecifiedDisplayMessage(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public NoTitleSpecifiedDisplayMessage(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - // - // - // - } + // + // + // + } - public NoTitleSpecifiedDisplayMessage() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public NoTitleSpecifiedDisplayMessage() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // NoTitleSpecifiedDisplayMessage - // - this.Text = "You must provide a title for the post before saving or publishing it."; - this.Title = "No Title Specified"; - this.Type = DisplayMessageType.Warning; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // NoTitleSpecifiedDisplayMessage + // + this.Text = "You must provide a title for the post before saving or publishing it."; + this.Title = "No Title Specified"; + this.Type = DisplayMessageType.Warning; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/NonImageTypeFileSelectedDisplayMessage.cs b/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/NonImageTypeFileSelectedDisplayMessage.cs index bfeadae1..def48bf7 100644 --- a/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/NonImageTypeFileSelectedDisplayMessage.cs +++ b/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/NonImageTypeFileSelectedDisplayMessage.cs @@ -6,68 +6,68 @@ using OpenLiveWriter.Controls; namespace OpenLiveWriter.PostEditor.DisplayMessages { - public class NonImageTypeFileSelectedDisplayMessage : DisplayMessage - { - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; + public class NonImageTypeFileSelectedDisplayMessage : DisplayMessage + { + /// + /// Required designer variable. + /// + private System.ComponentModel.Container components = null; - public NonImageTypeFileSelectedDisplayMessage(System.ComponentModel.IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public NonImageTypeFileSelectedDisplayMessage(System.ComponentModel.IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - // - // TODO: Add any constructor code after InitializeComponent call - // - } + // + // TODO: Add any constructor code after InitializeComponent call + // + } - public NonImageTypeFileSelectedDisplayMessage() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public NonImageTypeFileSelectedDisplayMessage() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // TODO: Add any constructor code after InitializeComponent call - // - } + // + // TODO: Add any constructor code after InitializeComponent call + // + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // NonImageTypeFileSelectedDisplayMessage - // - this.Text = "The file {0} is not an image. Only image file types can be inserted."; - this.Title = "File Is Not An Image"; - this.Type = DisplayMessageType.Warning; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // NonImageTypeFileSelectedDisplayMessage + // + this.Text = "The file {0} is not an image. Only image file types can be inserted."; + this.Title = "File Is Not An Image"; + this.Type = DisplayMessageType.Warning; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/PluginStatusChangedDisplayMessage.cs b/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/PluginStatusChangedDisplayMessage.cs index cd999788..0ff5bc5f 100644 --- a/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/PluginStatusChangedDisplayMessage.cs +++ b/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/PluginStatusChangedDisplayMessage.cs @@ -7,69 +7,69 @@ using OpenLiveWriter.Controls; namespace OpenLiveWriter.PostEditor.DisplayMessages { - public class PluginStatusChangedDisplayMessage : DisplayMessage - { - /// - /// Required designer variable. - /// - private Container components = null; + public class PluginStatusChangedDisplayMessage : DisplayMessage + { + /// + /// Required designer variable. + /// + private Container components = null; - public PluginStatusChangedDisplayMessage(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public PluginStatusChangedDisplayMessage(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - // - // - // - } + // + // + // + } - public PluginStatusChangedDisplayMessage() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public PluginStatusChangedDisplayMessage() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // PluginStatusChangedDisplayMessage - // - this.Text = "You have chosen to enable or disable plugins. For these changes\nto take effect yo" + - "u need to restart the application."; - this.Title = "Plugin Status"; - this.Type = OpenLiveWriter.Controls.DisplayMessageType.Information; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // PluginStatusChangedDisplayMessage + // + this.Text = "You have chosen to enable or disable plugins. For these changes\nto take effect yo" + + "u need to restart the application."; + this.Title = "Plugin Status"; + this.Type = OpenLiveWriter.Controls.DisplayMessageType.Information; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/PostFileInvalidDisplayMessage.cs b/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/PostFileInvalidDisplayMessage.cs index 5793ddd5..aa60ca31 100644 --- a/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/PostFileInvalidDisplayMessage.cs +++ b/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/PostFileInvalidDisplayMessage.cs @@ -6,70 +6,70 @@ using OpenLiveWriter.Controls; namespace OpenLiveWriter.PostEditor.DisplayMessages { - /// - /// Summary description for DeleteSingleItemDisplayMessage. - /// - public class PostFileInvalidDisplayMessage : DisplayMessage - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for DeleteSingleItemDisplayMessage. + /// + public class PostFileInvalidDisplayMessage : DisplayMessage + { + /// + /// Required designer variable. + /// + private Container components = null; - public PostFileInvalidDisplayMessage(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public PostFileInvalidDisplayMessage(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - // - // - // - } + // + // + // + } - public PostFileInvalidDisplayMessage() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public PostFileInvalidDisplayMessage() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // IncompatiblePostInfoTypeDisplayMessage - // - this.Text = "The specified post file ({0}) is not a valid weblog post so it could not be opened."; - this.Title = "Post File Invalid"; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // IncompatiblePostInfoTypeDisplayMessage + // + this.Text = "The specified post file ({0}) is not a valid weblog post so it could not be opened."; + this.Title = "Post File Invalid"; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/PostFileNoExistDisplayMessage.cs b/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/PostFileNoExistDisplayMessage.cs index 73fb3eae..89a015bb 100644 --- a/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/PostFileNoExistDisplayMessage.cs +++ b/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/PostFileNoExistDisplayMessage.cs @@ -6,70 +6,70 @@ using OpenLiveWriter.Controls; namespace OpenLiveWriter.PostEditor.DisplayMessages { - /// - /// Summary description for DeleteSingleItemDisplayMessage. - /// - public class PostFileNoExistDisplayMessage : DisplayMessage - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for DeleteSingleItemDisplayMessage. + /// + public class PostFileNoExistDisplayMessage : DisplayMessage + { + /// + /// Required designer variable. + /// + private Container components = null; - public PostFileNoExistDisplayMessage(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public PostFileNoExistDisplayMessage(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - // - // - // - } + // + // + // + } - public PostFileNoExistDisplayMessage() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public PostFileNoExistDisplayMessage() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // IncompatiblePostInfoTypeDisplayMessage - // - this.Text = "The specified post file ({0}) does not exist."; - this.Title = "Post File Does Not Exist"; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // IncompatiblePostInfoTypeDisplayMessage + // + this.Text = "The specified post file ({0}) does not exist."; + this.Title = "Post File Does Not Exist"; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/QueryForCreateEditorTemplateDisplayMessage.cs b/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/QueryForCreateEditorTemplateDisplayMessage.cs index db558a8d..1b3d0514 100644 --- a/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/QueryForCreateEditorTemplateDisplayMessage.cs +++ b/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/QueryForCreateEditorTemplateDisplayMessage.cs @@ -6,73 +6,73 @@ using OpenLiveWriter.Controls; namespace OpenLiveWriter.PostEditor.DisplayMessages { - /// - /// Summary description for DeleteSingleItemDisplayMessage. - /// - public class QueryForCreateEditorTemplateDisplayMessage : DisplayMessage - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for DeleteSingleItemDisplayMessage. + /// + public class QueryForCreateEditorTemplateDisplayMessage : DisplayMessage + { + /// + /// Required designer variable. + /// + private Container components = null; - public QueryForCreateEditorTemplateDisplayMessage(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public QueryForCreateEditorTemplateDisplayMessage(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - // - // - // - } + // + // + // + } - public QueryForCreateEditorTemplateDisplayMessage() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public QueryForCreateEditorTemplateDisplayMessage() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // QueryForCreateEditorTemplateDisplayMessage - // - this.Buttons = System.Windows.Forms.MessageBoxButtons.YesNo; - this.Text = "Would you like to generate an authoring template that matches the style of your b" + - "log?"; - this.Title = "Generate Authoring Template"; - this.Type = DisplayMessageType.Question; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // QueryForCreateEditorTemplateDisplayMessage + // + this.Buttons = System.Windows.Forms.MessageBoxButtons.YesNo; + this.Text = "Would you like to generate an authoring template that matches the style of your b" + + "log?"; + this.Title = "Generate Authoring Template"; + this.Type = DisplayMessageType.Question; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/QueryForUnpostedEntryDisplayMessage.cs b/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/QueryForUnpostedEntryDisplayMessage.cs index d980e613..ab43d795 100644 --- a/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/QueryForUnpostedEntryDisplayMessage.cs +++ b/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/QueryForUnpostedEntryDisplayMessage.cs @@ -6,73 +6,73 @@ using OpenLiveWriter.Controls; namespace OpenLiveWriter.PostEditor.DisplayMessages { - /// - /// Summary description for DeleteSingleItemDisplayMessage. - /// - public class QueryForUnpostedEntryDisplayMessage : DisplayMessage - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for DeleteSingleItemDisplayMessage. + /// + public class QueryForUnpostedEntryDisplayMessage : DisplayMessage + { + /// + /// Required designer variable. + /// + private Container components = null; - public QueryForUnpostedEntryDisplayMessage(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public QueryForUnpostedEntryDisplayMessage(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - // - // - // - } + // + // + // + } - public QueryForUnpostedEntryDisplayMessage() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public QueryForUnpostedEntryDisplayMessage() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // QueryForUnpostedEntryDisplayMessage - // - this.Buttons = System.Windows.Forms.MessageBoxButtons.YesNoCancel; - this.Text = "The weblog entry you are editing has not been posted.{0}{0}Do you want to post a " + - "draft of the entry now?"; - this.Title = "Post Entry as Draft"; - this.Type = DisplayMessageType.Question; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // QueryForUnpostedEntryDisplayMessage + // + this.Buttons = System.Windows.Forms.MessageBoxButtons.YesNoCancel; + this.Text = "The weblog entry you are editing has not been posted.{0}{0}Do you want to post a " + + "draft of the entry now?"; + this.Title = "Post Entry as Draft"; + this.Type = DisplayMessageType.Question; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/QueryForUnpublishedEntryDisplayMessage.cs b/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/QueryForUnpublishedEntryDisplayMessage.cs index 9ff1800b..08ee461a 100644 --- a/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/QueryForUnpublishedEntryDisplayMessage.cs +++ b/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/QueryForUnpublishedEntryDisplayMessage.cs @@ -6,73 +6,73 @@ using OpenLiveWriter.Controls; namespace OpenLiveWriter.PostEditor.DisplayMessages { - /// - /// Summary description for DeleteSingleItemDisplayMessage. - /// - public class QueryForUnpublishedEntryDisplayMessage : DisplayMessage - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for DeleteSingleItemDisplayMessage. + /// + public class QueryForUnpublishedEntryDisplayMessage : DisplayMessage + { + /// + /// Required designer variable. + /// + private Container components = null; - public QueryForUnpublishedEntryDisplayMessage(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public QueryForUnpublishedEntryDisplayMessage(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - // - // - // - } + // + // + // + } - public QueryForUnpublishedEntryDisplayMessage() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public QueryForUnpublishedEntryDisplayMessage() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // QueryForUnpublishedEntryDisplayMessage - // - this.Buttons = System.Windows.Forms.MessageBoxButtons.YesNoCancel; - this.Text = "You have posted this weblog entry as a draft.{0}{0}Do you want to publish it now?" + - ""; - this.Title = "Publish Entry"; - this.Type = DisplayMessageType.Question; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // QueryForUnpublishedEntryDisplayMessage + // + this.Buttons = System.Windows.Forms.MessageBoxButtons.YesNoCancel; + this.Text = "You have posted this weblog entry as a draft.{0}{0}Do you want to publish it now?" + + ""; + this.Title = "Publish Entry"; + this.Type = DisplayMessageType.Question; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/QueryForUnsavedChangesDisplayMessage.cs b/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/QueryForUnsavedChangesDisplayMessage.cs index 510dd6ef..8c952156 100644 --- a/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/QueryForUnsavedChangesDisplayMessage.cs +++ b/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/QueryForUnsavedChangesDisplayMessage.cs @@ -6,73 +6,73 @@ using OpenLiveWriter.Controls; namespace OpenLiveWriter.PostEditor.DisplayMessages { - /// - /// Summary description for DeleteSingleItemDisplayMessage. - /// - public class QueryForUnsavedChangesDisplayMessage : DisplayMessage - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for DeleteSingleItemDisplayMessage. + /// + public class QueryForUnsavedChangesDisplayMessage : DisplayMessage + { + /// + /// Required designer variable. + /// + private Container components = null; - public QueryForUnsavedChangesDisplayMessage(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public QueryForUnsavedChangesDisplayMessage(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - // - // - // - } + // + // + // + } - public QueryForUnsavedChangesDisplayMessage() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public QueryForUnsavedChangesDisplayMessage() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // QueryForUnsavedChangesDisplayMessage - // - this.Buttons = System.Windows.Forms.MessageBoxButtons.YesNoCancel; - this.Text = "There are unsaved changes to this post.{0}Do you want to save the changes before " + - "proceeding?"; - this.Title = "Save Changes"; - this.Type = DisplayMessageType.Question; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // QueryForUnsavedChangesDisplayMessage + // + this.Buttons = System.Windows.Forms.MessageBoxButtons.YesNoCancel; + this.Text = "There are unsaved changes to this post.{0}Do you want to save the changes before " + + "proceeding?"; + this.Title = "Save Changes"; + this.Type = DisplayMessageType.Question; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/SpellCheckCancelledStillPostDisplayMessage.cs b/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/SpellCheckCancelledStillPostDisplayMessage.cs index 304e6d0e..d4910114 100644 --- a/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/SpellCheckCancelledStillPostDisplayMessage.cs +++ b/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/SpellCheckCancelledStillPostDisplayMessage.cs @@ -6,72 +6,72 @@ using OpenLiveWriter.Controls; namespace OpenLiveWriter.PostEditor.DisplayMessages { - /// - /// Summary description for DeleteSingleItemDisplayMessage. - /// - public class SpellCheckCancelledStillPostDisplayMessage : DisplayMessage - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for DeleteSingleItemDisplayMessage. + /// + public class SpellCheckCancelledStillPostDisplayMessage : DisplayMessage + { + /// + /// Required designer variable. + /// + private Container components = null; - public SpellCheckCancelledStillPostDisplayMessage(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public SpellCheckCancelledStillPostDisplayMessage(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - // - // - // - } + // + // + // + } - public SpellCheckCancelledStillPostDisplayMessage() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public SpellCheckCancelledStillPostDisplayMessage() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // QueryForUnsavedChangesDisplayMessage - // - this.Buttons = System.Windows.Forms.MessageBoxButtons.YesNo; - this.Text = "The spell check was cancelled.{0}Do you still want to publish this post?"; - this.Title = "Spell Check Cancelled"; - this.Type = DisplayMessageType.Question; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // QueryForUnsavedChangesDisplayMessage + // + this.Buttons = System.Windows.Forms.MessageBoxButtons.YesNo; + this.Text = "The spell check was cancelled.{0}Do you still want to publish this post?"; + this.Title = "Spell Check Cancelled"; + this.Type = DisplayMessageType.Question; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/TagReminderDisplayMessage.cs b/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/TagReminderDisplayMessage.cs index 3bdb2939..1c88d5ec 100644 --- a/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/TagReminderDisplayMessage.cs +++ b/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/TagReminderDisplayMessage.cs @@ -8,63 +8,63 @@ using OpenLiveWriter.Controls; namespace OpenLiveWriter.PostEditor.DisplayMessages { - public class TagReminderDisplayMessage : DisplayMessage - { - /// - /// Required designer variable. - /// - private Container components = null; + public class TagReminderDisplayMessage : DisplayMessage + { + /// + /// Required designer variable. + /// + private Container components = null; - public TagReminderDisplayMessage(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public TagReminderDisplayMessage(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - } + } - public TagReminderDisplayMessage() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); - } + public TagReminderDisplayMessage() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // ConfirmDeleteEntryDisplayMessage - // - this.Buttons = System.Windows.Forms.MessageBoxButtons.YesNo; - this.DefaultButton = System.Windows.Forms.MessageBoxDefaultButton.Button2 ; - this.Text = "You have not added tags to this post.{0}Do you still want to continue with publishing?"; - this.Title = "Tagging Reminder"; - this.Type = DisplayMessageType.Question; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // ConfirmDeleteEntryDisplayMessage + // + this.Buttons = System.Windows.Forms.MessageBoxButtons.YesNo; + this.DefaultButton = System.Windows.Forms.MessageBoxDefaultButton.Button2 ; + this.Text = "You have not added tags to this post.{0}Do you still want to continue with publishing?"; + this.Title = "Tagging Reminder"; + this.Type = DisplayMessageType.Question; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/UnsupportedFileUploadsMessage.cs b/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/UnsupportedFileUploadsMessage.cs index 959177bd..71706d4b 100644 --- a/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/UnsupportedFileUploadsMessage.cs +++ b/src/managed/OpenLiveWriter.PostEditor/DisplayMessages/UnsupportedFileUploadsMessage.cs @@ -9,173 +9,170 @@ using OpenLiveWriter.Localization.Bidi; namespace OpenLiveWriter.PostEditor.DisplayMessages { - /// - /// Summary description for UnsupportedFileUploadsMessage. - /// - public class UnsupportedFileUploadsMessage : BaseForm - { - private PictureBox pictureBox1; - private Label label1; - private ColumnHeader columnHeaderFile; - private Button buttonCancel; - private Button buttonOK; - private ListView listViewFiles; - private System.Windows.Forms.Label label2; - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for UnsupportedFileUploadsMessage. + /// + public class UnsupportedFileUploadsMessage : BaseForm + { + private PictureBox pictureBox1; + private Label label1; + private ColumnHeader columnHeaderFile; + private Button buttonCancel; + private Button buttonOK; + private ListView listViewFiles; + private System.Windows.Forms.Label label2; + /// + /// Required designer variable. + /// + private Container components = null; - public UnsupportedFileUploadsMessage(string[] files) - { - // - // Required for Windows Form Designer support - // - InitializeComponent(); + public UnsupportedFileUploadsMessage(string[] files) + { + // + // Required for Windows Form Designer support + // + InitializeComponent(); - this.label1.Text = Res.Get(StringId.NoFileUploadText); - this.buttonCancel.Text = Res.Get(StringId.No); - this.buttonOK.Text = Res.Get(StringId.Yes); - this.label2.Text = Res.Get(StringId.NoFileUploadPrompt); - this.Text = Res.Get(StringId.NoFileUploadTitle); + this.label1.Text = Res.Get(StringId.NoFileUploadText); + this.buttonCancel.Text = Res.Get(StringId.No); + this.buttonOK.Text = Res.Get(StringId.Yes); + this.label2.Text = Res.Get(StringId.NoFileUploadPrompt); + this.Text = Res.Get(StringId.NoFileUploadTitle); - listViewFiles.BeginUpdate(); - listViewFiles.Items.Clear(); - foreach(string file in files) - listViewFiles.Items.Add(file); - listViewFiles.EndUpdate(); - } + listViewFiles.BeginUpdate(); + listViewFiles.Items.Clear(); + foreach(string file in files) + listViewFiles.Items.Add(file); + listViewFiles.EndUpdate(); + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } + #region Windows Form Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(UnsupportedFileUploadsMessage)); + this.pictureBox1 = new System.Windows.Forms.PictureBox(); + this.label1 = new System.Windows.Forms.Label(); + this.listViewFiles = new System.Windows.Forms.ListView(); + this.columnHeaderFile = new System.Windows.Forms.ColumnHeader(); + this.buttonCancel = new System.Windows.Forms.Button(); + this.buttonOK = new System.Windows.Forms.Button(); + this.label2 = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // pictureBox1 + // + this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image"))); + this.pictureBox1.Location = new System.Drawing.Point(8, 12); + this.pictureBox1.Name = "pictureBox1"; + this.pictureBox1.Size = new System.Drawing.Size(44, 40); + this.pictureBox1.TabIndex = 0; + this.pictureBox1.TabStop = false; + // + // label1 + // + this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.label1.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.label1.Location = new System.Drawing.Point(52, 16); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(286, 28); + this.label1.TabIndex = 1; + this.label1.Text = "The following images cannot be published because image uploading has not been con" + + "figured for this weblog:"; + // + // listViewFiles + // + this.listViewFiles.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.listViewFiles.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.columnHeaderFile}); + this.listViewFiles.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None; + this.listViewFiles.Location = new System.Drawing.Point(52, 52); + this.listViewFiles.Name = "listViewFiles"; + this.listViewFiles.RightToLeftLayout = BidiHelper.IsRightToLeft; + this.listViewFiles.Size = new System.Drawing.Size(286, 120); + this.listViewFiles.TabIndex = 2; + this.listViewFiles.View = System.Windows.Forms.View.List; + // + // columnHeaderFile + // + this.columnHeaderFile.Text = ""; + this.columnHeaderFile.Width = 328; + // + // buttonCancel + // + this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.buttonCancel.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.buttonCancel.Location = new System.Drawing.Point(262, 214); + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.TabIndex = 4; + this.buttonCancel.Text = "No"; + // + // buttonOK + // + this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonOK.DialogResult = System.Windows.Forms.DialogResult.OK; + this.buttonOK.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.buttonOK.Location = new System.Drawing.Point(182, 214); + this.buttonOK.Name = "buttonOK"; + this.buttonOK.TabIndex = 3; + this.buttonOK.Text = "Yes"; + // + // label2 + // + this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.label2.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.label2.Location = new System.Drawing.Point(52, 182); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(282, 28); + this.label2.TabIndex = 5; + this.label2.Text = "Would you like to configure the image upload settings for your weblog now?"; + // + // UnsupportedFileUploadsMessage + // + this.AutoScaleBaseSize = new System.Drawing.Size(5, 14); + this.ClientSize = new System.Drawing.Size(346, 244); + this.Controls.Add(this.label2); + this.Controls.Add(this.buttonCancel); + this.Controls.Add(this.buttonOK); + this.Controls.Add(this.listViewFiles); + this.Controls.Add(this.label1); + this.Controls.Add(this.pictureBox1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "UnsupportedFileUploadsMessage"; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Image Upload Not Configured"; + this.ResumeLayout(false); - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(UnsupportedFileUploadsMessage)); - this.pictureBox1 = new System.Windows.Forms.PictureBox(); - this.label1 = new System.Windows.Forms.Label(); - this.listViewFiles = new System.Windows.Forms.ListView(); - this.columnHeaderFile = new System.Windows.Forms.ColumnHeader(); - this.buttonCancel = new System.Windows.Forms.Button(); - this.buttonOK = new System.Windows.Forms.Button(); - this.label2 = new System.Windows.Forms.Label(); - this.SuspendLayout(); - // - // pictureBox1 - // - this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image"))); - this.pictureBox1.Location = new System.Drawing.Point(8, 12); - this.pictureBox1.Name = "pictureBox1"; - this.pictureBox1.Size = new System.Drawing.Size(44, 40); - this.pictureBox1.TabIndex = 0; - this.pictureBox1.TabStop = false; - // - // label1 - // - this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.label1.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.label1.Location = new System.Drawing.Point(52, 16); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(286, 28); - this.label1.TabIndex = 1; - this.label1.Text = "The following images cannot be published because image uploading has not been con" + - "figured for this weblog:"; - // - // listViewFiles - // - this.listViewFiles.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.listViewFiles.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.columnHeaderFile}); - this.listViewFiles.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None; - this.listViewFiles.Location = new System.Drawing.Point(52, 52); - this.listViewFiles.Name = "listViewFiles"; - this.listViewFiles.RightToLeftLayout = BidiHelper.IsRightToLeft; - this.listViewFiles.Size = new System.Drawing.Size(286, 120); - this.listViewFiles.TabIndex = 2; - this.listViewFiles.View = System.Windows.Forms.View.List; - // - // columnHeaderFile - // - this.columnHeaderFile.Text = ""; - this.columnHeaderFile.Width = 328; - // - // buttonCancel - // - this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.buttonCancel.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.buttonCancel.Location = new System.Drawing.Point(262, 214); - this.buttonCancel.Name = "buttonCancel"; - this.buttonCancel.TabIndex = 4; - this.buttonCancel.Text = "No"; - // - // buttonOK - // - this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonOK.DialogResult = System.Windows.Forms.DialogResult.OK; - this.buttonOK.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.buttonOK.Location = new System.Drawing.Point(182, 214); - this.buttonOK.Name = "buttonOK"; - this.buttonOK.TabIndex = 3; - this.buttonOK.Text = "Yes"; - // - // label2 - // - this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.label2.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.label2.Location = new System.Drawing.Point(52, 182); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(282, 28); - this.label2.TabIndex = 5; - this.label2.Text = "Would you like to configure the image upload settings for your weblog now?"; - // - // UnsupportedFileUploadsMessage - // - this.AutoScaleBaseSize = new System.Drawing.Size(5, 14); - this.ClientSize = new System.Drawing.Size(346, 244); - this.Controls.Add(this.label2); - this.Controls.Add(this.buttonCancel); - this.Controls.Add(this.buttonOK); - this.Controls.Add(this.listViewFiles); - this.Controls.Add(this.label1); - this.Controls.Add(this.pictureBox1); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "UnsupportedFileUploadsMessage"; - this.ShowInTaskbar = false; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Image Upload Not Configured"; - this.ResumeLayout(false); - - } - #endregion + } + #endregion - - - } + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/FileUploadFailedForm.cs b/src/managed/OpenLiveWriter.PostEditor/FileUploadFailedForm.cs index 12946ef5..3469bc04 100644 --- a/src/managed/OpenLiveWriter.PostEditor/FileUploadFailedForm.cs +++ b/src/managed/OpenLiveWriter.PostEditor/FileUploadFailedForm.cs @@ -203,6 +203,5 @@ namespace OpenLiveWriter.PostEditor } #endregion - } } diff --git a/src/managed/OpenLiveWriter.PostEditor/IBlogPostEditor.cs b/src/managed/OpenLiveWriter.PostEditor/IBlogPostEditor.cs index 4f620ace..9bb58f8e 100644 --- a/src/managed/OpenLiveWriter.PostEditor/IBlogPostEditor.cs +++ b/src/managed/OpenLiveWriter.PostEditor/IBlogPostEditor.cs @@ -67,12 +67,12 @@ namespace OpenLiveWriter.PostEditor /// /// Notification that the application is now closed /// - void OnClosed(); + void OnClosed(); /// /// Notification that current blog post is closed /// - void OnPostClosed(); + void OnPostClosed(); } public class BlogPostSaveOptions @@ -92,11 +92,11 @@ namespace OpenLiveWriter.PostEditor } /// - /// This class is a dummy that is put into the list of editors so that when a change is made - /// external to any editor inside the manager, the manager has an editor to put the dirty flag to - /// true. - /// - internal class ForceDirtyPostEditor : IBlogPostEditor + /// This class is a dummy that is put into the list of editors so that when a change is made + /// external to any editor inside the manager, the manager has an editor to put the dirty flag to + /// true. + /// + internal class ForceDirtyPostEditor : IBlogPostEditor { void IBlogPostEditor.Initialize(IBlogPostEditingContext editingContext, IBlogClientOptions clientOptions) { diff --git a/src/managed/OpenLiveWriter.PostEditor/ImageInsertion/DisplayMessages/NoPreviewAvailableDisplayMessage.cs b/src/managed/OpenLiveWriter.PostEditor/ImageInsertion/DisplayMessages/NoPreviewAvailableDisplayMessage.cs index 28495e84..252c2724 100644 --- a/src/managed/OpenLiveWriter.PostEditor/ImageInsertion/DisplayMessages/NoPreviewAvailableDisplayMessage.cs +++ b/src/managed/OpenLiveWriter.PostEditor/ImageInsertion/DisplayMessages/NoPreviewAvailableDisplayMessage.cs @@ -6,65 +6,65 @@ using OpenLiveWriter.Controls; namespace OpenLiveWriter.PostEditor.ImageInsertion.DisplayMessages { - /// - /// Summary description for NoPreviewAvailableDisplayMessage. - /// - public class NoPreviewAvailableDisplayMessage : DisplayMessage - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for NoPreviewAvailableDisplayMessage. + /// + public class NoPreviewAvailableDisplayMessage : DisplayMessage + { + /// + /// Required designer variable. + /// + private Container components = null; - public NoPreviewAvailableDisplayMessage(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public NoPreviewAvailableDisplayMessage(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - } + } - public NoPreviewAvailableDisplayMessage() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); - } + public NoPreviewAvailableDisplayMessage() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // NoPreviewAvailableDisplayMessage - // - this.Buttons = System.Windows.Forms.MessageBoxButtons.OK; - this.Text = "Preview is currently unavailable. Please check the entered URL and your network connection."; - this.Title = "Preview Unavailable"; - this.Type = DisplayMessageType.Information; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // NoPreviewAvailableDisplayMessage + // + this.Buttons = System.Windows.Forms.MessageBoxButtons.OK; + this.Text = "Preview is currently unavailable. Please check the entered URL and your network connection."; + this.Title = "Preview Unavailable"; + this.Type = DisplayMessageType.Information; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/InlineEditField.cs b/src/managed/OpenLiveWriter.PostEditor/InlineEditField.cs index 18f4d908..907905c7 100644 --- a/src/managed/OpenLiveWriter.PostEditor/InlineEditField.cs +++ b/src/managed/OpenLiveWriter.PostEditor/InlineEditField.cs @@ -36,7 +36,6 @@ namespace OpenLiveWriter.PostEditor _undoRedoCheck = undoRedoCheck; } - public string TextValue { // The innerText may contain a shortened form of the title diff --git a/src/managed/OpenLiveWriter.PostEditor/JumpList/JumpListCustomCategory.cs b/src/managed/OpenLiveWriter.PostEditor/JumpList/JumpListCustomCategory.cs index e129cdf7..75d8ae85 100644 --- a/src/managed/OpenLiveWriter.PostEditor/JumpList/JumpListCustomCategory.cs +++ b/src/managed/OpenLiveWriter.PostEditor/JumpList/JumpListCustomCategory.cs @@ -59,7 +59,6 @@ namespace OpenLiveWriter.PostEditor.JumpList } } - /// /// Add JumpList items for this category /// diff --git a/src/managed/OpenLiveWriter.PostEditor/LiveClipboard/LiveClipboardManager.cs b/src/managed/OpenLiveWriter.PostEditor/LiveClipboard/LiveClipboardManager.cs index eb1a8278..30473431 100644 --- a/src/managed/OpenLiveWriter.PostEditor/LiveClipboard/LiveClipboardManager.cs +++ b/src/managed/OpenLiveWriter.PostEditor/LiveClipboard/LiveClipboardManager.cs @@ -219,7 +219,6 @@ namespace OpenLiveWriter.PostEditor.LiveClipboard } } - public static ContentSourceInfo[] GetContentSourcesForFormat(LiveClipboardFormat format) { ArrayList contentSources = new ArrayList(); diff --git a/src/managed/OpenLiveWriter.PostEditor/LiveClipboard/LiveClipboardPreferences.cs b/src/managed/OpenLiveWriter.PostEditor/LiveClipboard/LiveClipboardPreferences.cs index 2eccee55..709c4066 100644 --- a/src/managed/OpenLiveWriter.PostEditor/LiveClipboard/LiveClipboardPreferences.cs +++ b/src/managed/OpenLiveWriter.PostEditor/LiveClipboard/LiveClipboardPreferences.cs @@ -23,6 +23,5 @@ namespace OpenLiveWriter.PostEditor.LiveClipboard } - } } diff --git a/src/managed/OpenLiveWriter.PostEditor/LiveClipboard/LiveClipboardPreferencesPanel.cs b/src/managed/OpenLiveWriter.PostEditor/LiveClipboard/LiveClipboardPreferencesPanel.cs index c6fd6e9b..a01d67ea 100644 --- a/src/managed/OpenLiveWriter.PostEditor/LiveClipboard/LiveClipboardPreferencesPanel.cs +++ b/src/managed/OpenLiveWriter.PostEditor/LiveClipboard/LiveClipboardPreferencesPanel.cs @@ -485,6 +485,5 @@ namespace OpenLiveWriter.PostEditor.LiveClipboard } #endregion - } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Mail/WindowsLiveMailContentTarget.cs b/src/managed/OpenLiveWriter.PostEditor/Mail/WindowsLiveMailContentTarget.cs index f914c45d..ca068c0e 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Mail/WindowsLiveMailContentTarget.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Mail/WindowsLiveMailContentTarget.cs @@ -108,5 +108,4 @@ namespace OpenLiveWriter.Mail } } - } diff --git a/src/managed/OpenLiveWriter.PostEditor/OpenPost/BlogPostListBox.cs b/src/managed/OpenLiveWriter.PostEditor/OpenPost/BlogPostListBox.cs index a456c67e..a3d5e8e7 100644 --- a/src/managed/OpenLiveWriter.PostEditor/OpenPost/BlogPostListBox.cs +++ b/src/managed/OpenLiveWriter.PostEditor/OpenPost/BlogPostListBox.cs @@ -116,7 +116,6 @@ namespace OpenLiveWriter.PostEditor.OpenPost } private bool _showPages = false; - public PostInfo SelectedPost { get diff --git a/src/managed/OpenLiveWriter.PostEditor/OpenPost/BlogPostSourceListBox.cs b/src/managed/OpenLiveWriter.PostEditor/OpenPost/BlogPostSourceListBox.cs index f81eb5bd..88436d2d 100644 --- a/src/managed/OpenLiveWriter.PostEditor/OpenPost/BlogPostSourceListBox.cs +++ b/src/managed/OpenLiveWriter.PostEditor/OpenPost/BlogPostSourceListBox.cs @@ -239,7 +239,6 @@ namespace OpenLiveWriter.PostEditor.OpenPost } } - #endregion #region Accessibility @@ -411,7 +410,6 @@ namespace OpenLiveWriter.PostEditor.OpenPost private const int ELEMENT_PADDING = 3; private const int TITLE_LINES = 2; - // view mode private bool _showLargeIcons; diff --git a/src/managed/OpenLiveWriter.PostEditor/OpenPost/BlogPostSourceListView.cs b/src/managed/OpenLiveWriter.PostEditor/OpenPost/BlogPostSourceListView.cs index 459356c0..437f9781 100644 --- a/src/managed/OpenLiveWriter.PostEditor/OpenPost/BlogPostSourceListView.cs +++ b/src/managed/OpenLiveWriter.PostEditor/OpenPost/BlogPostSourceListView.cs @@ -11,117 +11,112 @@ using OpenLiveWriter.Interop.Windows; namespace OpenLiveWriter.PostEditor.OpenPost { - public class BlogPostSourceListView : ListView - { - public BlogPostSourceListView() - { - } + public class BlogPostSourceListView : ListView + { + public BlogPostSourceListView() + { + } + // separate initialize to prevent this code from executing in the designer + public void Initialize() + { + View = View.LargeIcon ; + MultiSelect = false ; + HideSelection = false ; + LabelEdit = false ; + LabelWrap = true ; - // separate initialize to prevent this code from executing in the designer - public void Initialize() - { - View = View.LargeIcon ; - MultiSelect = false ; - HideSelection = false ; - LabelEdit = false ; - LabelWrap = true ; + _imageList = new ImageList(); + _imageList.ImageSize = new Size(IMAGE_HEIGHT,IMAGE_WIDTH); + _imageList.ColorDepth = ColorDepth.Depth32Bit ; + _imageList.Images.Add( ResourceHelper.LoadAssemblyResourceBitmap("OpenPost.Images.SelectDraftPostings.png") ) ; + _imageList.Images.Add( ResourceHelper.LoadAssemblyResourceBitmap("OpenPost.Images.SelectRecentPostings.png") ) ; + _imageList.Images.Add( ResourceHelper.LoadAssemblyResourceBitmap("OpenPost.Images.SelectWebLogPostings.png") ) ; + LargeImageList = _imageList ; - _imageList = new ImageList(); - _imageList.ImageSize = new Size(IMAGE_HEIGHT,IMAGE_WIDTH); - _imageList.ColorDepth = ColorDepth.Depth32Bit ; - _imageList.Images.Add( ResourceHelper.LoadAssemblyResourceBitmap("OpenPost.Images.SelectDraftPostings.png") ) ; - _imageList.Images.Add( ResourceHelper.LoadAssemblyResourceBitmap("OpenPost.Images.SelectRecentPostings.png") ) ; - _imageList.Images.Add( ResourceHelper.LoadAssemblyResourceBitmap("OpenPost.Images.SelectWebLogPostings.png") ) ; - LargeImageList = _imageList ; + // apply initial sizing + UpdateIconSize() ; - // apply initial sizing - UpdateIconSize() ; + AddPostSource( new LocalDraftsPostSource(), DRAFT_IMAGE_INDEX ) ; + AddPostSource( new LocalRecentPostsPostSource(), RECENT_POSTS_IMAGE_INDEX ) ; - AddPostSource( new LocalDraftsPostSource(), DRAFT_IMAGE_INDEX ) ; - AddPostSource( new LocalRecentPostsPostSource(), RECENT_POSTS_IMAGE_INDEX ) ; + foreach ( string blogId in BlogSettings.GetBlogIds() ) + AddPostSource( new RemoteWeblogBlogPostSource(blogId), WEBLOG_IMAGE_INDEX ) ; - foreach ( string blogId in BlogSettings.GetBlogIds() ) - AddPostSource( new RemoteWeblogBlogPostSource(blogId), WEBLOG_IMAGE_INDEX ) ; + // call again to reflect scrollbars that may now exist + UpdateIconSize() ; + } - // call again to reflect scrollbars that may now exist - UpdateIconSize() ; - } + protected override void OnSizeChanged(EventArgs e) + { + base.OnSizeChanged (e); + UpdateIconSize() ; + } + private void UpdateIconSize() + { + int width = Width - 8 ; // prevent horizontal scrollbar + if ( ControlHelper.ControlHasVerticalScrollbar(this) ) + width -= SystemInformation.VerticalScrollBarWidth ; - protected override void OnSizeChanged(EventArgs e) - { - base.OnSizeChanged (e); - UpdateIconSize() ; - } + const int ICON_PADDING = 10; + int height = Convert.ToInt32(IMAGE_HEIGHT + (Font.GetHeight() * 2)) + ICON_PADDING ; + const uint LVM_FIRST = 0x1000 ; + const uint LVM_SETICONSPACING = (LVM_FIRST + 53) ; + User32.SendMessage( Handle, LVM_SETICONSPACING, UIntPtr.Zero, MessageHelper.MAKELONG(width,height) ) ; + } - private void UpdateIconSize() - { - int width = Width - 8 ; // prevent horizontal scrollbar - if ( ControlHelper.ControlHasVerticalScrollbar(this) ) - width -= SystemInformation.VerticalScrollBarWidth ; + protected override void Dispose(bool disposing) + { + if (disposing) + { + _imageList.Dispose() ; - const int ICON_PADDING = 10; - int height = Convert.ToInt32(IMAGE_HEIGHT + (Font.GetHeight() * 2)) + ICON_PADDING ; + } + base.Dispose (disposing); + } - const uint LVM_FIRST = 0x1000 ; - const uint LVM_SETICONSPACING = (LVM_FIRST + 53) ; - User32.SendMessage( Handle, LVM_SETICONSPACING, UIntPtr.Zero, MessageHelper.MAKELONG(width,height) ) ; - } + public void SelectDrafts() + { + Items[0].Selected = true ; + } + public void SelectRecentPosts() + { + Items[1].Selected = true ; + } - protected override void Dispose(bool disposing) - { - if (disposing) - { - _imageList.Dispose() ; + public IPostEditorPostSource SelectedPostSource + { + get + { + IPostEditorPostSource postSource = null ; + foreach ( ListViewItem item in SelectedItems ) + { + postSource = item.Tag as IPostEditorPostSource ; + break; + } + return postSource ; + } + } - } - base.Dispose (disposing); - } + private void AddPostSource( IPostEditorPostSource postSource, int imageIndex ) + { + ListViewItem item = new ListViewItem(); + item.Text = postSource.Name ; + item.Tag = postSource ; + item.ImageIndex = imageIndex ; + Items.Add(item) ; + } + private ImageList _imageList ; + private const int DRAFT_IMAGE_INDEX = 0 ; + private const int RECENT_POSTS_IMAGE_INDEX = 1; + private const int WEBLOG_IMAGE_INDEX = 2 ; - public void SelectDrafts() - { - Items[0].Selected = true ; - } + private const int IMAGE_WIDTH = 32 ; + private const int IMAGE_HEIGHT = 32 ; - public void SelectRecentPosts() - { - Items[1].Selected = true ; - } - - public IPostEditorPostSource SelectedPostSource - { - get - { - IPostEditorPostSource postSource = null ; - foreach ( ListViewItem item in SelectedItems ) - { - postSource = item.Tag as IPostEditorPostSource ; - break; - } - return postSource ; - } - } - - private void AddPostSource( IPostEditorPostSource postSource, int imageIndex ) - { - ListViewItem item = new ListViewItem(); - item.Text = postSource.Name ; - item.Tag = postSource ; - item.ImageIndex = imageIndex ; - Items.Add(item) ; - } - - private ImageList _imageList ; - private const int DRAFT_IMAGE_INDEX = 0 ; - private const int RECENT_POSTS_IMAGE_INDEX = 1; - private const int WEBLOG_IMAGE_INDEX = 2 ; - - private const int IMAGE_WIDTH = 32 ; - private const int IMAGE_HEIGHT = 32 ; - - } + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/OpenPost/MissingPostLinkForm.cs b/src/managed/OpenLiveWriter.PostEditor/OpenPost/MissingPostLinkForm.cs index 940726da..88a9a737 100644 --- a/src/managed/OpenLiveWriter.PostEditor/OpenPost/MissingPostLinkForm.cs +++ b/src/managed/OpenLiveWriter.PostEditor/OpenPost/MissingPostLinkForm.cs @@ -15,136 +15,136 @@ using OpenLiveWriter.PostEditor ; namespace OpenLiveWriter.PostEditor.OpenPost { - /// - /// Summary description for MissingPostLinkForm. - /// - public class MissingPostLinkForm : ApplicationDialog - { - private System.Windows.Forms.Button buttonOK; - private System.Windows.Forms.PictureBox pictureBoxError; - private System.Windows.Forms.Label labelTitle; - private System.Windows.Forms.Label labelExplanation; - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; + /// + /// Summary description for MissingPostLinkForm. + /// + public class MissingPostLinkForm : ApplicationDialog + { + private System.Windows.Forms.Button buttonOK; + private System.Windows.Forms.PictureBox pictureBoxError; + private System.Windows.Forms.Label labelTitle; + private System.Windows.Forms.Label labelExplanation; + /// + /// Required designer variable. + /// + private System.ComponentModel.Container components = null; - public MissingPostLinkForm(PostInfo postInfo) - { - // - // Required for Windows Form Designer support - // - InitializeComponent(); + public MissingPostLinkForm(PostInfo postInfo) + { + // + // Required for Windows Form Designer support + // + InitializeComponent(); - this.buttonOK.Text = Res.Get(StringId.OKButtonText); - this.labelTitle.Text = Res.Get(StringId.MissingPostLinkCaption); - this.labelExplanation.Text = Res.Get(StringId.MissingPostLinkExplanation); - this.Text = Res.Get(StringId.MissingPostLinkTitle); + this.buttonOK.Text = Res.Get(StringId.OKButtonText); + this.labelTitle.Text = Res.Get(StringId.MissingPostLinkCaption); + this.labelExplanation.Text = Res.Get(StringId.MissingPostLinkExplanation); + this.Text = Res.Get(StringId.MissingPostLinkTitle); - this.labelTitle.Font = Res.GetFont(FontSize.XLarge, FontStyle.Bold); - string entityName = postInfo.IsPage ? Res.Get(StringId.Page) : Res.Get(StringId.Post) ; - string entityNameLower = postInfo.IsPage ? Res.Get(StringId.PageLower) : Res.Get(StringId.PostLower) ; + this.labelTitle.Font = Res.GetFont(FontSize.XLarge, FontStyle.Bold); + string entityName = postInfo.IsPage ? Res.Get(StringId.Page) : Res.Get(StringId.Post) ; + string entityNameLower = postInfo.IsPage ? Res.Get(StringId.PageLower) : Res.Get(StringId.PostLower) ; - labelTitle.Text = String.Format(CultureInfo.CurrentCulture, labelTitle.Text, entityName ) ; - labelExplanation.Text = String.Format(CultureInfo.CurrentCulture, labelExplanation.Text, entityNameLower, ApplicationEnvironment.ProductName) ; - } + labelTitle.Text = String.Format(CultureInfo.CurrentCulture, labelTitle.Text, entityName ) ; + labelExplanation.Text = String.Format(CultureInfo.CurrentCulture, labelExplanation.Text, entityNameLower, ApplicationEnvironment.ProductName) ; + } - protected override void OnLoad(EventArgs e) - { - base.OnLoad (e); + protected override void OnLoad(EventArgs e) + { + base.OnLoad (e); - using (new AutoGrow(this, AnchorStyles.Bottom, true)) - { - LayoutHelper.NaturalizeHeightAndDistribute(8, labelTitle, labelExplanation); - LayoutHelper.FitControlsBelow(12, labelExplanation); - } - } + using (new AutoGrow(this, AnchorStyles.Bottom, true)) + { + LayoutHelper.NaturalizeHeightAndDistribute(8, labelTitle, labelExplanation); + LayoutHelper.FitControlsBelow(12, labelExplanation); + } + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(MissingPostLinkForm)); - this.buttonOK = new System.Windows.Forms.Button(); - this.pictureBoxError = new System.Windows.Forms.PictureBox(); - this.labelTitle = new System.Windows.Forms.Label(); - this.labelExplanation = new System.Windows.Forms.Label(); - this.SuspendLayout(); - // - // buttonOK - // - this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonOK.DialogResult = System.Windows.Forms.DialogResult.OK; - this.buttonOK.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.buttonOK.Location = new System.Drawing.Point(130, 152); - this.buttonOK.Name = "buttonOK"; - this.buttonOK.TabIndex = 4; - this.buttonOK.Text = "OK"; - // - // pictureBoxError - // - this.pictureBoxError.Image = ((System.Drawing.Image)(resources.GetObject("pictureBoxError.Image"))); - this.pictureBoxError.Location = new System.Drawing.Point(10, 10); - this.pictureBoxError.Name = "pictureBoxError"; - this.pictureBoxError.Size = new System.Drawing.Size(39, 40); - this.pictureBoxError.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; - this.pictureBoxError.TabIndex = 5; - this.pictureBoxError.TabStop = false; - // - // labelTitle - // - this.labelTitle.Font = Res.GetFont(FontSize.XLarge, FontStyle.Bold); - this.labelTitle.Location = new System.Drawing.Point(61, 21); - this.labelTitle.Name = "labelTitle"; - this.labelTitle.Size = new System.Drawing.Size(237, 23); - this.labelTitle.TabIndex = 6; - this.labelTitle.Text = "No Link Available for {0}"; - // - // labelExplanation - // - this.labelExplanation.Location = new System.Drawing.Point(61, 48); - this.labelExplanation.Name = "labelExplanation"; - this.labelExplanation.Size = new System.Drawing.Size(260, 96); - this.labelExplanation.TabIndex = 7; - this.labelExplanation.Text = @"There is no link available for the selected {0}. This may be because your weblog service does not make {0} links available to {1}. You may be able to resolve this problem by redetecting your weblog account configuration using the Accounts panel of the Weblog Settings dialog."; - // - // MissingPostLinkForm - // - this.AcceptButton = this.buttonOK; - this.CancelButton = this.buttonOK; - this.AutoScaleBaseSize = new System.Drawing.Size(5, 14); - this.ClientSize = new System.Drawing.Size(335, 184); - this.ControlBox = false; - this.Controls.Add(this.labelExplanation); - this.Controls.Add(this.labelTitle); - this.Controls.Add(this.pictureBoxError); - this.Controls.Add(this.buttonOK); - this.Location = new System.Drawing.Point(0, 0); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "MissingPostLinkForm"; - this.Text = "No Link Available"; - this.ResumeLayout(false); + #region Windows Form Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(MissingPostLinkForm)); + this.buttonOK = new System.Windows.Forms.Button(); + this.pictureBoxError = new System.Windows.Forms.PictureBox(); + this.labelTitle = new System.Windows.Forms.Label(); + this.labelExplanation = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // buttonOK + // + this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonOK.DialogResult = System.Windows.Forms.DialogResult.OK; + this.buttonOK.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.buttonOK.Location = new System.Drawing.Point(130, 152); + this.buttonOK.Name = "buttonOK"; + this.buttonOK.TabIndex = 4; + this.buttonOK.Text = "OK"; + // + // pictureBoxError + // + this.pictureBoxError.Image = ((System.Drawing.Image)(resources.GetObject("pictureBoxError.Image"))); + this.pictureBoxError.Location = new System.Drawing.Point(10, 10); + this.pictureBoxError.Name = "pictureBoxError"; + this.pictureBoxError.Size = new System.Drawing.Size(39, 40); + this.pictureBoxError.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; + this.pictureBoxError.TabIndex = 5; + this.pictureBoxError.TabStop = false; + // + // labelTitle + // + this.labelTitle.Font = Res.GetFont(FontSize.XLarge, FontStyle.Bold); + this.labelTitle.Location = new System.Drawing.Point(61, 21); + this.labelTitle.Name = "labelTitle"; + this.labelTitle.Size = new System.Drawing.Size(237, 23); + this.labelTitle.TabIndex = 6; + this.labelTitle.Text = "No Link Available for {0}"; + // + // labelExplanation + // + this.labelExplanation.Location = new System.Drawing.Point(61, 48); + this.labelExplanation.Name = "labelExplanation"; + this.labelExplanation.Size = new System.Drawing.Size(260, 96); + this.labelExplanation.TabIndex = 7; + this.labelExplanation.Text = @"There is no link available for the selected {0}. This may be because your weblog service does not make {0} links available to {1}. You may be able to resolve this problem by redetecting your weblog account configuration using the Accounts panel of the Weblog Settings dialog."; + // + // MissingPostLinkForm + // + this.AcceptButton = this.buttonOK; + this.CancelButton = this.buttonOK; + this.AutoScaleBaseSize = new System.Drawing.Size(5, 14); + this.ClientSize = new System.Drawing.Size(335, 184); + this.ControlBox = false; + this.Controls.Add(this.labelExplanation); + this.Controls.Add(this.labelTitle); + this.Controls.Add(this.pictureBoxError); + this.Controls.Add(this.buttonOK); + this.Location = new System.Drawing.Point(0, 0); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "MissingPostLinkForm"; + this.Text = "No Link Available"; + this.ResumeLayout(false); - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/OpenPost/OpenPostForm.cs b/src/managed/OpenLiveWriter.PostEditor/OpenPost/OpenPostForm.cs index 5da1fded..bb89e86b 100644 --- a/src/managed/OpenLiveWriter.PostEditor/OpenPost/OpenPostForm.cs +++ b/src/managed/OpenLiveWriter.PostEditor/OpenPost/OpenPostForm.cs @@ -437,7 +437,6 @@ namespace OpenLiveWriter.PostEditor.OpenPost // This width depends on the contents of the combo, which are dynamic DisplayHelper.AutoFitSystemCombo(comboBoxPosts, 0, int.MaxValue, false); - int HPADDING = GetHpadding(); int x; @@ -530,7 +529,6 @@ namespace OpenLiveWriter.PostEditor.OpenPost PostEditorSettings.OpenPostFormSize = Size; } - private void SaveNumberOfPostsSettings() { // get post data/context to save @@ -857,7 +855,6 @@ namespace OpenLiveWriter.PostEditor.OpenPost } #endregion - private Button buttonOK; private Button buttonCancel; private BlogPostSourceListBox listBoxPostSources; @@ -896,4 +893,3 @@ namespace OpenLiveWriter.PostEditor.OpenPost } } - diff --git a/src/managed/OpenLiveWriter.PostEditor/OpenPost/SelectPostLinkForm.cs b/src/managed/OpenLiveWriter.PostEditor/OpenPost/SelectPostLinkForm.cs index d3672a11..cc312b73 100644 --- a/src/managed/OpenLiveWriter.PostEditor/OpenPost/SelectPostLinkForm.cs +++ b/src/managed/OpenLiveWriter.PostEditor/OpenPost/SelectPostLinkForm.cs @@ -84,7 +84,6 @@ namespace OpenLiveWriter.PostEditor.OpenPost } } - /// /// Clean up any resources being used. /// diff --git a/src/managed/OpenLiveWriter.PostEditor/PluginSettingsAdaptor.cs b/src/managed/OpenLiveWriter.PostEditor/PluginSettingsAdaptor.cs index 1be03f83..87995843 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PluginSettingsAdaptor.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PluginSettingsAdaptor.cs @@ -95,7 +95,6 @@ namespace OpenLiveWriter.PostEditor RemoveSubProperties(subPropertyName); } - public string[] Names { get { return SettingsHelper.GetNames(); } @@ -114,7 +113,6 @@ namespace OpenLiveWriter.PostEditor } } - public IProperties GetSubProperties(string key) { return new PluginSettingsAdaptor(SettingsHelper.GetSubSettings(key)); diff --git a/src/managed/OpenLiveWriter.PostEditor/PostDeleteHelper.cs b/src/managed/OpenLiveWriter.PostEditor/PostDeleteHelper.cs index 59ae9391..fb11605a 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostDeleteHelper.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostDeleteHelper.cs @@ -69,7 +69,6 @@ namespace OpenLiveWriter.PostEditor } } - public static bool SafeDeleteLocalPost(string blogId, string postId) { try diff --git a/src/managed/OpenLiveWriter.PostEditor/PostEditorFile.cs b/src/managed/OpenLiveWriter.PostEditor/PostEditorFile.cs index 1fac8f83..6f9199a2 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostEditorFile.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostEditorFile.cs @@ -206,7 +206,6 @@ namespace OpenLiveWriter.PostEditor #region Initialization Helpers - private PostEditorFile(DirectoryInfo targetDirectory) { TargetDirectory = targetDirectory; @@ -617,7 +616,6 @@ namespace OpenLiveWriter.PostEditor return TargetFile.GetHashCode(); } - #endregion #region Helpers for managing post file names, etc. @@ -913,7 +911,6 @@ namespace OpenLiveWriter.PostEditor } } - private void WritePingUrls(XmlTextWriter writer, object pingUrls) { writer.WriteStartElement(PING_URLS_ELEMENT); @@ -1642,7 +1639,6 @@ namespace OpenLiveWriter.PostEditor } } - private static void WriteBlogPostSettingsBag(XmlTextWriter writer, BlogPostSettingsBag settings, string name) { writer.WriteStartElement(SETTINGS_BAG_ELEMENT); diff --git a/src/managed/OpenLiveWriter.PostEditor/PostEditorFormCommandBarDefinition.cs b/src/managed/OpenLiveWriter.PostEditor/PostEditorFormCommandBarDefinition.cs index 69a68ffc..9410be07 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostEditorFormCommandBarDefinition.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostEditorFormCommandBarDefinition.cs @@ -6,78 +6,78 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.PostEditor { - public class PostEditorFormCommandBarDefinition : CommandBarDefinition - { - public PostEditorFormCommandBarDefinition() + public class PostEditorFormCommandBarDefinition : CommandBarDefinition + { + public PostEditorFormCommandBarDefinition() - { - // required for designer support - InitializeComponent() ; + { + // required for designer support + InitializeComponent() ; - } - private CommandBarButtonEntry commandBarButtonEntryPostAndPublish; - private CommandBarButtonEntry commandBarButtonEntrySavePost; - private CommandBarButtonEntry commandBarButtonEntryNewPost; - private CommandBarButtonEntry commandBarButtonEntryOpenPost; - private CommandBarButtonEntry commandBarButtonEntryWeblogMenu; - private CommandBarSeparatorEntry commandBarSeparatorEntry3; - private CommandBarSeparatorEntry commandBarSeparatorEntry4; - private OpenLiveWriter.ApplicationFramework.CommandBarButtonEntry commandBarButtonEntryHtmlView; + } + private CommandBarButtonEntry commandBarButtonEntryPostAndPublish; + private CommandBarButtonEntry commandBarButtonEntrySavePost; + private CommandBarButtonEntry commandBarButtonEntryNewPost; + private CommandBarButtonEntry commandBarButtonEntryOpenPost; + private CommandBarButtonEntry commandBarButtonEntryWeblogMenu; + private CommandBarSeparatorEntry commandBarSeparatorEntry3; + private CommandBarSeparatorEntry commandBarSeparatorEntry4; + private OpenLiveWriter.ApplicationFramework.CommandBarButtonEntry commandBarButtonEntryHtmlView; - private IContainer components; + private IContainer components; - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - this.commandBarButtonEntryPostAndPublish = new OpenLiveWriter.ApplicationFramework.CommandBarButtonEntry(this.components); - this.commandBarButtonEntrySavePost = new OpenLiveWriter.ApplicationFramework.CommandBarButtonEntry(this.components); - this.commandBarButtonEntryNewPost = new OpenLiveWriter.ApplicationFramework.CommandBarButtonEntry(this.components); - this.commandBarButtonEntryOpenPost = new OpenLiveWriter.ApplicationFramework.CommandBarButtonEntry(this.components); - this.commandBarButtonEntryWeblogMenu = new OpenLiveWriter.ApplicationFramework.CommandBarButtonEntry(this.components); - this.commandBarSeparatorEntry3 = new OpenLiveWriter.ApplicationFramework.CommandBarSeparatorEntry(this.components); - this.commandBarSeparatorEntry4 = new OpenLiveWriter.ApplicationFramework.CommandBarSeparatorEntry(this.components); - this.commandBarButtonEntryHtmlView = new OpenLiveWriter.ApplicationFramework.CommandBarButtonEntry(this.components); - // - // commandBarButtonEntryPostAndPublish - // - this.commandBarButtonEntryPostAndPublish.CommandIdentifier = "OpenLiveWriter.PostAndPublish"; - // - // commandBarButtonEntrySavePost - // - this.commandBarButtonEntrySavePost.CommandIdentifier = "OpenLiveWriter.PostEditor.SavePost"; - // - // commandBarButtonEntryNewPost - // - this.commandBarButtonEntryNewPost.CommandIdentifier = "OpenLiveWriter.PostEditor.NewPost"; - // - // commandBarButtonEntryOpenPost - // - this.commandBarButtonEntryOpenPost.CommandIdentifier = "OpenLiveWriter.PostEditor.OpenPost"; - // - // commandBarButtonEntryWeblogMenu - // - this.commandBarButtonEntryWeblogMenu.CommandIdentifier = "OpenLiveWriter.PostEditor.Commands.WeblogMenu"; - // - // commandBarButtonEntryHtmlView - // - this.commandBarButtonEntryHtmlView.CommandIdentifier = "OpenLiveWriter.PostEditor.Commands.PostHtmlEditing.HtmlViewMenu"; - // - // PostEditorFormCommandBarDefinition - // - this.LeftCommandBarEntries.AddRange(new OpenLiveWriter.ApplicationFramework.CommandBarEntry[] { - this.commandBarButtonEntryNewPost, - //this.commandBarSeparatorEntry1, - this.commandBarButtonEntryOpenPost, - //this.commandBarSeparatorEntry2, - this.commandBarButtonEntrySavePost, - this.commandBarSeparatorEntry3, - this.commandBarButtonEntryHtmlView, - this.commandBarSeparatorEntry4, - this.commandBarButtonEntryPostAndPublish}); - this.RightCommandBarEntries.AddRange(new OpenLiveWriter.ApplicationFramework.CommandBarEntry[] { - this.commandBarButtonEntryWeblogMenu}); + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.commandBarButtonEntryPostAndPublish = new OpenLiveWriter.ApplicationFramework.CommandBarButtonEntry(this.components); + this.commandBarButtonEntrySavePost = new OpenLiveWriter.ApplicationFramework.CommandBarButtonEntry(this.components); + this.commandBarButtonEntryNewPost = new OpenLiveWriter.ApplicationFramework.CommandBarButtonEntry(this.components); + this.commandBarButtonEntryOpenPost = new OpenLiveWriter.ApplicationFramework.CommandBarButtonEntry(this.components); + this.commandBarButtonEntryWeblogMenu = new OpenLiveWriter.ApplicationFramework.CommandBarButtonEntry(this.components); + this.commandBarSeparatorEntry3 = new OpenLiveWriter.ApplicationFramework.CommandBarSeparatorEntry(this.components); + this.commandBarSeparatorEntry4 = new OpenLiveWriter.ApplicationFramework.CommandBarSeparatorEntry(this.components); + this.commandBarButtonEntryHtmlView = new OpenLiveWriter.ApplicationFramework.CommandBarButtonEntry(this.components); + // + // commandBarButtonEntryPostAndPublish + // + this.commandBarButtonEntryPostAndPublish.CommandIdentifier = "OpenLiveWriter.PostAndPublish"; + // + // commandBarButtonEntrySavePost + // + this.commandBarButtonEntrySavePost.CommandIdentifier = "OpenLiveWriter.PostEditor.SavePost"; + // + // commandBarButtonEntryNewPost + // + this.commandBarButtonEntryNewPost.CommandIdentifier = "OpenLiveWriter.PostEditor.NewPost"; + // + // commandBarButtonEntryOpenPost + // + this.commandBarButtonEntryOpenPost.CommandIdentifier = "OpenLiveWriter.PostEditor.OpenPost"; + // + // commandBarButtonEntryWeblogMenu + // + this.commandBarButtonEntryWeblogMenu.CommandIdentifier = "OpenLiveWriter.PostEditor.Commands.WeblogMenu"; + // + // commandBarButtonEntryHtmlView + // + this.commandBarButtonEntryHtmlView.CommandIdentifier = "OpenLiveWriter.PostEditor.Commands.PostHtmlEditing.HtmlViewMenu"; + // + // PostEditorFormCommandBarDefinition + // + this.LeftCommandBarEntries.AddRange(new OpenLiveWriter.ApplicationFramework.CommandBarEntry[] { + this.commandBarButtonEntryNewPost, + //this.commandBarSeparatorEntry1, + this.commandBarButtonEntryOpenPost, + //this.commandBarSeparatorEntry2, + this.commandBarButtonEntrySavePost, + this.commandBarSeparatorEntry3, + this.commandBarButtonEntryHtmlView, + this.commandBarSeparatorEntry4, + this.commandBarButtonEntryPostAndPublish}); + this.RightCommandBarEntries.AddRange(new OpenLiveWriter.ApplicationFramework.CommandBarEntry[] { + this.commandBarButtonEntryWeblogMenu}); - } + } - } + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/PostEditorFormCommandBarDefinition2.cs b/src/managed/OpenLiveWriter.PostEditor/PostEditorFormCommandBarDefinition2.cs index 7f528cb6..7d8b0fa7 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostEditorFormCommandBarDefinition2.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostEditorFormCommandBarDefinition2.cs @@ -6,176 +6,175 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.PostEditor { - public class PostEditorFormCommandBarDefinition2 : CommandBarDefinition - { - public PostEditorFormCommandBarDefinition2() - { - // required for designer support - InitializeComponent() ; + public class PostEditorFormCommandBarDefinition2 : CommandBarDefinition + { + public PostEditorFormCommandBarDefinition2() + { + // required for designer support + InitializeComponent() ; - } + } - private CommandBarButtonEntry commandBarButtonEntryBold; - private CommandBarButtonEntry commandBarButtonEntryItalic; - private CommandBarButtonEntry commandBarButtonEntryUnderline; - private CommandBarSeparatorEntry commandBarSeparatorEntry1; - private CommandBarButtonEntry commandBarButtonEntryBullets; - private CommandBarButtonEntry commandBarButtonEntryNumbers; - private CommandBarSeparatorEntry commandBarSeparatorEntry3; - private CommandBarButtonEntry commandBarButtonEntryInsertLink; - private CommandBarButtonEntry commandBarButtonEntryNormalView ; - private CommandBarButtonEntry commandBarButtonEntryCodeView ; + private CommandBarButtonEntry commandBarButtonEntryBold; + private CommandBarButtonEntry commandBarButtonEntryItalic; + private CommandBarButtonEntry commandBarButtonEntryUnderline; + private CommandBarSeparatorEntry commandBarSeparatorEntry1; + private CommandBarButtonEntry commandBarButtonEntryBullets; + private CommandBarButtonEntry commandBarButtonEntryNumbers; + private CommandBarSeparatorEntry commandBarSeparatorEntry3; + private CommandBarButtonEntry commandBarButtonEntryInsertLink; + private CommandBarButtonEntry commandBarButtonEntryNormalView ; + private CommandBarButtonEntry commandBarButtonEntryCodeView ; // private CommandBarButtonEntry commandBarButtonEntryPostProperties ; - private CommandBarSeparatorEntry commandBarSeparatorEntry2; - private CommandBarSeparatorEntry commandBarSeparatorEntry4; - private CommandBarSeparatorEntry commandBarSeparatorEntry5; + private CommandBarSeparatorEntry commandBarSeparatorEntry2; + private CommandBarSeparatorEntry commandBarSeparatorEntry4; + private CommandBarSeparatorEntry commandBarSeparatorEntry5; // internal CommandBarControlEntry commandBarControlEntryCategories; - internal CommandBarControlEntry commandBarControlEntryStyle; + internal CommandBarControlEntry commandBarControlEntryStyle; // private CommandBarButtonEntry commandBarButtonEntryInsertPicture; - private OpenLiveWriter.ApplicationFramework.CommandBarButtonEntry commandBarButtonEntryStrikethrough; - private OpenLiveWriter.ApplicationFramework.CommandBarButtonEntry commandBarButtonEntryBlockquote; - private OpenLiveWriter.ApplicationFramework.CommandBarButtonEntry commandBarButtonEntryRemoveLink; - private CommandBarButtonEntry commandBarButtonEntrySpellCheck; + private OpenLiveWriter.ApplicationFramework.CommandBarButtonEntry commandBarButtonEntryStrikethrough; + private OpenLiveWriter.ApplicationFramework.CommandBarButtonEntry commandBarButtonEntryBlockquote; + private OpenLiveWriter.ApplicationFramework.CommandBarButtonEntry commandBarButtonEntryRemoveLink; + private CommandBarButtonEntry commandBarButtonEntrySpellCheck; // private CommandBarSeparatorEntry commandBarSeparatorEntry6; - private OpenLiveWriter.ApplicationFramework.CommandBarButtonEntry commandBarButtonEntryTableMenu; - private OpenLiveWriter.ApplicationFramework.CommandBarSeparatorEntry commandBarSeparatorEntry7; + private OpenLiveWriter.ApplicationFramework.CommandBarButtonEntry commandBarButtonEntryTableMenu; + private OpenLiveWriter.ApplicationFramework.CommandBarSeparatorEntry commandBarSeparatorEntry7; - private IContainer components; + private IContainer components; - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - this.commandBarButtonEntryBold = new OpenLiveWriter.ApplicationFramework.CommandBarButtonEntry(this.components); - this.commandBarButtonEntryItalic = new OpenLiveWriter.ApplicationFramework.CommandBarButtonEntry(this.components); - this.commandBarButtonEntryUnderline = new OpenLiveWriter.ApplicationFramework.CommandBarButtonEntry(this.components); - this.commandBarSeparatorEntry1 = new OpenLiveWriter.ApplicationFramework.CommandBarSeparatorEntry(this.components); - this.commandBarButtonEntryBullets = new OpenLiveWriter.ApplicationFramework.CommandBarButtonEntry(this.components); - this.commandBarButtonEntryNumbers = new OpenLiveWriter.ApplicationFramework.CommandBarButtonEntry(this.components); - this.commandBarButtonEntryBlockquote = new OpenLiveWriter.ApplicationFramework.CommandBarButtonEntry(this.components); - this.commandBarSeparatorEntry3 = new OpenLiveWriter.ApplicationFramework.CommandBarSeparatorEntry(this.components); + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.commandBarButtonEntryBold = new OpenLiveWriter.ApplicationFramework.CommandBarButtonEntry(this.components); + this.commandBarButtonEntryItalic = new OpenLiveWriter.ApplicationFramework.CommandBarButtonEntry(this.components); + this.commandBarButtonEntryUnderline = new OpenLiveWriter.ApplicationFramework.CommandBarButtonEntry(this.components); + this.commandBarSeparatorEntry1 = new OpenLiveWriter.ApplicationFramework.CommandBarSeparatorEntry(this.components); + this.commandBarButtonEntryBullets = new OpenLiveWriter.ApplicationFramework.CommandBarButtonEntry(this.components); + this.commandBarButtonEntryNumbers = new OpenLiveWriter.ApplicationFramework.CommandBarButtonEntry(this.components); + this.commandBarButtonEntryBlockquote = new OpenLiveWriter.ApplicationFramework.CommandBarButtonEntry(this.components); + this.commandBarSeparatorEntry3 = new OpenLiveWriter.ApplicationFramework.CommandBarSeparatorEntry(this.components); // this.commandBarButtonEntryFontColor = new OpenLiveWriter.ApplicationFramework.CommandBarButtonEntry(this.components); - this.commandBarButtonEntryInsertLink = new OpenLiveWriter.ApplicationFramework.CommandBarButtonEntry(this.components); - this.commandBarButtonEntryNormalView = new OpenLiveWriter.ApplicationFramework.CommandBarButtonEntry(this.components); - this.commandBarButtonEntryCodeView = new OpenLiveWriter.ApplicationFramework.CommandBarButtonEntry(this.components); + this.commandBarButtonEntryInsertLink = new OpenLiveWriter.ApplicationFramework.CommandBarButtonEntry(this.components); + this.commandBarButtonEntryNormalView = new OpenLiveWriter.ApplicationFramework.CommandBarButtonEntry(this.components); + this.commandBarButtonEntryCodeView = new OpenLiveWriter.ApplicationFramework.CommandBarButtonEntry(this.components); // this.commandBarButtonEntryPostProperties = new OpenLiveWriter.ApplicationFramework.CommandBarButtonEntry(this.components); - this.commandBarSeparatorEntry2 = new OpenLiveWriter.ApplicationFramework.CommandBarSeparatorEntry(this.components); - this.commandBarSeparatorEntry4 = new OpenLiveWriter.ApplicationFramework.CommandBarSeparatorEntry(this.components); - this.commandBarSeparatorEntry5 = new OpenLiveWriter.ApplicationFramework.CommandBarSeparatorEntry(this.components); + this.commandBarSeparatorEntry2 = new OpenLiveWriter.ApplicationFramework.CommandBarSeparatorEntry(this.components); + this.commandBarSeparatorEntry4 = new OpenLiveWriter.ApplicationFramework.CommandBarSeparatorEntry(this.components); + this.commandBarSeparatorEntry5 = new OpenLiveWriter.ApplicationFramework.CommandBarSeparatorEntry(this.components); // this.commandBarControlEntryCategories = new OpenLiveWriter.ApplicationFramework.CommandBarControlEntry(this.components); - this.commandBarControlEntryStyle = new OpenLiveWriter.ApplicationFramework.CommandBarControlEntry(this.components); + this.commandBarControlEntryStyle = new OpenLiveWriter.ApplicationFramework.CommandBarControlEntry(this.components); // this.commandBarButtonEntryInsertPicture = new OpenLiveWriter.ApplicationFramework.CommandBarButtonEntry(this.components); - this.commandBarButtonEntryStrikethrough = new OpenLiveWriter.ApplicationFramework.CommandBarButtonEntry(this.components); - this.commandBarButtonEntryRemoveLink = new OpenLiveWriter.ApplicationFramework.CommandBarButtonEntry(this.components); - this.commandBarButtonEntrySpellCheck = new OpenLiveWriter.ApplicationFramework.CommandBarButtonEntry(this.components); + this.commandBarButtonEntryStrikethrough = new OpenLiveWriter.ApplicationFramework.CommandBarButtonEntry(this.components); + this.commandBarButtonEntryRemoveLink = new OpenLiveWriter.ApplicationFramework.CommandBarButtonEntry(this.components); + this.commandBarButtonEntrySpellCheck = new OpenLiveWriter.ApplicationFramework.CommandBarButtonEntry(this.components); // this.commandBarSeparatorEntry6 = new OpenLiveWriter.ApplicationFramework.CommandBarSeparatorEntry(this.components); - this.commandBarButtonEntryTableMenu = new OpenLiveWriter.ApplicationFramework.CommandBarButtonEntry(this.components); - this.commandBarSeparatorEntry7 = new OpenLiveWriter.ApplicationFramework.CommandBarSeparatorEntry(this.components); - // - // commandBarButtonEntryBold - // - this.commandBarButtonEntryBold.CommandIdentifier = "MindShare.ApplicationCore.Commands.Bold"; - // - // commandBarButtonEntryItalic - // - this.commandBarButtonEntryItalic.CommandIdentifier = "MindShare.ApplicationCore.Commands.Italic"; - // - // commandBarButtonEntryUnderline - // - this.commandBarButtonEntryUnderline.CommandIdentifier = "MindShare.ApplicationCore.Commands.Underline"; - // - // commandBarButtonEntryBullets - // - this.commandBarButtonEntryBullets.CommandIdentifier = "MindShare.ApplicationCore.Commands.Bullets"; - // - // commandBarButtonEntryNumbers - // - this.commandBarButtonEntryNumbers.CommandIdentifier = "MindShare.ApplicationCore.Commands.Numbers"; - // - // commandBarButtonEntryBlockquote - // - this.commandBarButtonEntryBlockquote.CommandIdentifier = "MindShare.ApplicationCore.Commands.Blockquote"; - // - // commandBarButtonEntryFontColor - // + this.commandBarButtonEntryTableMenu = new OpenLiveWriter.ApplicationFramework.CommandBarButtonEntry(this.components); + this.commandBarSeparatorEntry7 = new OpenLiveWriter.ApplicationFramework.CommandBarSeparatorEntry(this.components); + // + // commandBarButtonEntryBold + // + this.commandBarButtonEntryBold.CommandIdentifier = "MindShare.ApplicationCore.Commands.Bold"; + // + // commandBarButtonEntryItalic + // + this.commandBarButtonEntryItalic.CommandIdentifier = "MindShare.ApplicationCore.Commands.Italic"; + // + // commandBarButtonEntryUnderline + // + this.commandBarButtonEntryUnderline.CommandIdentifier = "MindShare.ApplicationCore.Commands.Underline"; + // + // commandBarButtonEntryBullets + // + this.commandBarButtonEntryBullets.CommandIdentifier = "MindShare.ApplicationCore.Commands.Bullets"; + // + // commandBarButtonEntryNumbers + // + this.commandBarButtonEntryNumbers.CommandIdentifier = "MindShare.ApplicationCore.Commands.Numbers"; + // + // commandBarButtonEntryBlockquote + // + this.commandBarButtonEntryBlockquote.CommandIdentifier = "MindShare.ApplicationCore.Commands.Blockquote"; + // + // commandBarButtonEntryFontColor + // // this.commandBarButtonEntryFontColor.CommandIdentifier = "MindShare.ApplicationCore.Commands.FontColor"; - // - // commandBarButtonEntryInsertLink - // - this.commandBarButtonEntryInsertLink.CommandIdentifier = "OpenLiveWriter.ApplicationFramework.Commands.InsertLink"; - // - // commandBarButtonEntryNormalView - // - this.commandBarButtonEntryNormalView.CommandIdentifier = "OpenLiveWriter.PostEditor.PostHtmlEditing.Commands.ViewNormal"; - // - // commandBarButtonEntryCodeView - // - this.commandBarButtonEntryCodeView.CommandIdentifier = "OpenLiveWriter.PostEditor.PostHtmlEditing.Commands.ViewCode"; - // - // commandBarButtonEntryPostProperties - // + // + // commandBarButtonEntryInsertLink + // + this.commandBarButtonEntryInsertLink.CommandIdentifier = "OpenLiveWriter.ApplicationFramework.Commands.InsertLink"; + // + // commandBarButtonEntryNormalView + // + this.commandBarButtonEntryNormalView.CommandIdentifier = "OpenLiveWriter.PostEditor.PostHtmlEditing.Commands.ViewNormal"; + // + // commandBarButtonEntryCodeView + // + this.commandBarButtonEntryCodeView.CommandIdentifier = "OpenLiveWriter.PostEditor.PostHtmlEditing.Commands.ViewCode"; + // + // commandBarButtonEntryPostProperties + // // this.commandBarButtonEntryPostProperties.CommandIdentifier = "OpenLiveWriter.PostEditor.Commands.PostProperties"; - // - // commandBarControlEntryCategories - // + // + // commandBarControlEntryCategories + // // this.commandBarControlEntryCategories.Control = null; - // - // commandBarControlEntryStyle - // - this.commandBarControlEntryStyle.Control = null; - // - // commandBarButtonEntryInsertPicture - // + // + // commandBarControlEntryStyle + // + this.commandBarControlEntryStyle.Control = null; + // + // commandBarButtonEntryInsertPicture + // // this.commandBarButtonEntryInsertPicture.CommandIdentifier = "OpenLiveWriter.PostEditor.Commands.PostHtmlEditing.InsertPicture"; - // - // commandBarButtonEntryStrikethrough - // - this.commandBarButtonEntryStrikethrough.CommandIdentifier = "MindShare.ApplicationCore.Commands.Strikethrough"; - // - // commandBarButtonEntryRemoveLink - // - this.commandBarButtonEntryRemoveLink.CommandIdentifier = "OpenLiveWriter.PostEditor.Commands.PostHtmlEditing.CommandRemoveLink"; - // - // commandBarButtonEntrySpellCheck - // - this.commandBarButtonEntrySpellCheck.CommandIdentifier = "MindShare.ApplicationCore.Commands.CheckSpelling"; - // - // commandBarButtonEntryTableMenu - // - this.commandBarButtonEntryTableMenu.CommandIdentifier = "OpenLiveWriter.PostEditor.Tables.Commands.TableMenu"; - // - // PostEditorFormCommandBarDefinition2 - // - this.LeftCommandBarEntries.AddRange(new OpenLiveWriter.ApplicationFramework.CommandBarEntry[] { - this.commandBarControlEntryStyle, - this.commandBarButtonEntryBold, - this.commandBarButtonEntryItalic, - this.commandBarButtonEntryUnderline, - this.commandBarButtonEntryStrikethrough, + // + // commandBarButtonEntryStrikethrough + // + this.commandBarButtonEntryStrikethrough.CommandIdentifier = "MindShare.ApplicationCore.Commands.Strikethrough"; + // + // commandBarButtonEntryRemoveLink + // + this.commandBarButtonEntryRemoveLink.CommandIdentifier = "OpenLiveWriter.PostEditor.Commands.PostHtmlEditing.CommandRemoveLink"; + // + // commandBarButtonEntrySpellCheck + // + this.commandBarButtonEntrySpellCheck.CommandIdentifier = "MindShare.ApplicationCore.Commands.CheckSpelling"; + // + // commandBarButtonEntryTableMenu + // + this.commandBarButtonEntryTableMenu.CommandIdentifier = "OpenLiveWriter.PostEditor.Tables.Commands.TableMenu"; + // + // PostEditorFormCommandBarDefinition2 + // + this.LeftCommandBarEntries.AddRange(new OpenLiveWriter.ApplicationFramework.CommandBarEntry[] { + this.commandBarControlEntryStyle, + this.commandBarButtonEntryBold, + this.commandBarButtonEntryItalic, + this.commandBarButtonEntryUnderline, + this.commandBarButtonEntryStrikethrough, // this.commandBarButtonEntryFontColor, - this.commandBarSeparatorEntry1, - this.commandBarButtonEntryNumbers, - this.commandBarButtonEntryBullets, - this.commandBarSeparatorEntry2, - this.commandBarButtonEntryBlockquote, - this.commandBarSeparatorEntry3, - this.commandBarButtonEntryInsertLink, - this.commandBarButtonEntryRemoveLink, + this.commandBarSeparatorEntry1, + this.commandBarButtonEntryNumbers, + this.commandBarButtonEntryBullets, + this.commandBarSeparatorEntry2, + this.commandBarButtonEntryBlockquote, + this.commandBarSeparatorEntry3, + this.commandBarButtonEntryInsertLink, + this.commandBarButtonEntryRemoveLink, // this.commandBarButtonEntryInsertPicture, - this.commandBarSeparatorEntry7, - this.commandBarButtonEntryTableMenu, - this.commandBarSeparatorEntry5, - this.commandBarButtonEntrySpellCheck, + this.commandBarSeparatorEntry7, + this.commandBarButtonEntryTableMenu, + this.commandBarSeparatorEntry5, + this.commandBarButtonEntrySpellCheck, // this.commandBarSeparatorEntry6, // this.commandBarButtonEntryPostProperties, - }); + }); /* - this.RightCommandBarEntries.AddRange(new OpenLiveWriter.ApplicationFramework.CommandBarEntry[] { - this.commandBarControlEntryCategories}); + this.RightCommandBarEntries.AddRange(new OpenLiveWriter.ApplicationFramework.CommandBarEntry[] { + this.commandBarControlEntryCategories}); */ - } + } - - } + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/PostEditorInitializer.cs b/src/managed/OpenLiveWriter.PostEditor/PostEditorInitializer.cs index 05592a71..3844af1c 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostEditorInitializer.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostEditorInitializer.cs @@ -7,18 +7,18 @@ using OpenLiveWriter.PostEditor.ContentSources; namespace OpenLiveWriter.PostEditor { - public sealed class PostEditorInitializer - { - /// - /// global initializaiton which may show error dialogs or cause - /// failure of the entire product to load - /// - public static bool Initialize() - { - // can show error dialog if plugin has missing or incorrect attributes - ContentSourceManager.Initialize(); + public sealed class PostEditorInitializer + { + /// + /// global initializaiton which may show error dialogs or cause + /// failure of the entire product to load + /// + public static bool Initialize() + { + // can show error dialog if plugin has missing or incorrect attributes + ContentSourceManager.Initialize(); - return true ; - } - } + return true ; + } + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/PostEditorMainControl.cs b/src/managed/OpenLiveWriter.PostEditor/PostEditorMainControl.cs index a9e53cfd..138677b1 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostEditorMainControl.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostEditorMainControl.cs @@ -100,7 +100,6 @@ namespace OpenLiveWriter.PostEditor private Container components = new Container(); #endregion - #region Initialization/Disposal public PostEditorMainControl(IMainFrameWindow mainFrameWindow, IBlogPostEditingContext editingContext) @@ -572,7 +571,6 @@ namespace OpenLiveWriter.PostEditor private PostEditorMainControl _parent; } - private void InitializePostPropertyEditors() { _styleComboControl = new HtmlStylePicker(this._htmlEditor); @@ -1204,7 +1202,6 @@ namespace OpenLiveWriter.PostEditor } } - void IBlogPostEditingSite.ConfigureWeblogFtpUpload(string blogId) { if (WeblogSettingsManager.EditFtpImageUpload(FindForm(), blogId)) diff --git a/src/managed/OpenLiveWriter.PostEditor/PostEditorPluginManager.cs b/src/managed/OpenLiveWriter.PostEditor/PostEditorPluginManager.cs index 0df2041f..b89da8fb 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostEditorPluginManager.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostEditorPluginManager.cs @@ -25,8 +25,8 @@ namespace OpenLiveWriter.PostEditor /// private Type[] SupportedPluginTypes = new Type[] { - // Note to developers: add a type here for each plugin interface type supported. - typeof(WriterPlugin) + // Note to developers: add a type here for each plugin interface type supported. + typeof(WriterPlugin) }; #region Public Methods diff --git a/src/managed/OpenLiveWriter.PostEditor/PostEditorPostSource.cs b/src/managed/OpenLiveWriter.PostEditor/PostEditorPostSource.cs index af74b660..4331a413 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostEditorPostSource.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostEditorPostSource.cs @@ -195,7 +195,6 @@ namespace OpenLiveWriter.PostEditor } } - public class RemoteWeblogBlogPostSource : IPostEditorPostSource { public RemoteWeblogBlogPostSource(string blogId) @@ -248,7 +247,6 @@ namespace OpenLiveWriter.PostEditor } } - public bool SupportsDelete { get @@ -422,7 +420,6 @@ namespace OpenLiveWriter.PostEditor private BlogPost[] _blogPosts; } - /// /// Chooser source for local blog storage /// @@ -649,7 +646,6 @@ namespace OpenLiveWriter.PostEditor } private static readonly RecentPostRequest _all = new RecentPostRequest(ALL_POSTS); - public string DisplayName { get { return _displayName; } @@ -686,5 +682,4 @@ namespace OpenLiveWriter.PostEditor public const int ALL_POSTS = Int32.MaxValue; } - } diff --git a/src/managed/OpenLiveWriter.PostEditor/PostEditorPreferencesPanel.cs b/src/managed/OpenLiveWriter.PostEditor/PostEditorPreferencesPanel.cs index a5629975..7ddb3e59 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostEditorPreferencesPanel.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostEditorPreferencesPanel.cs @@ -138,7 +138,6 @@ namespace OpenLiveWriter.PostEditor _wordCountPreferences.Save(); } - private void checkBoxViewWeblog_CheckedChanged(object sender, EventArgs e) { _postEditorPreferences.ViewPostAfterPublish = checkBoxViewWeblog.Checked; @@ -404,6 +403,5 @@ namespace OpenLiveWriter.PostEditor } #endregion - } } diff --git a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Behaviors/BehaviorDragDropSource.cs b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Behaviors/BehaviorDragDropSource.cs index f96234f5..19eda5ed 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Behaviors/BehaviorDragDropSource.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Behaviors/BehaviorDragDropSource.cs @@ -105,7 +105,6 @@ namespace OpenLiveWriter.PostEditor.PostHtmlEditing.Behaviors return false; } - // /// Pre-process mouse messages to detect drag-and-drop of selections /// diff --git a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/BlogPostHtmlEditor.cs b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/BlogPostHtmlEditor.cs index 3e042953..bc71a6c6 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/BlogPostHtmlEditor.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/BlogPostHtmlEditor.cs @@ -457,7 +457,6 @@ namespace OpenLiveWriter.PostEditor.PostHtmlEditing private Command _commandClosePreview; - protected override void ManageCommandsForEditingMode() { base.ManageCommandsForEditingMode(); diff --git a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/BlogPostHtmlEditorControl.cs b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/BlogPostHtmlEditorControl.cs index 7c2c9fdc..8f38787e 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/BlogPostHtmlEditorControl.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/BlogPostHtmlEditorControl.cs @@ -671,7 +671,6 @@ namespace OpenLiveWriter.PostEditor.PostHtmlEditing InvalidatePostBodyElement(); } - /// /// Removes editing styles that are known to cause buggy editing. /// @@ -1200,7 +1199,6 @@ namespace OpenLiveWriter.PostEditor.PostHtmlEditing } } - public string GetEditedTitleHtml() { if (_titleBehavior != null && TitleBehavior.ElementBehaviorAttached) diff --git a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/BlogPostHtmlEditorSettingsEditor.cs b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/BlogPostHtmlEditorSettingsEditor.cs index 407db2e6..a292e109 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/BlogPostHtmlEditorSettingsEditor.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/BlogPostHtmlEditorSettingsEditor.cs @@ -8,78 +8,78 @@ using OpenLiveWriter.PostEditor.Configuration; namespace OpenLiveWriter.PostEditor.PostHtmlEditing { - /// - /// Summary description for ImageServiceSettingsEditor. - /// - public class BlogPostHtmlEditorSettingsEditor : IBlogSettingsEditor - { - public BlogPostHtmlEditorSettingsEditor() - { - } + /// + /// Summary description for ImageServiceSettingsEditor. + /// + public class BlogPostHtmlEditorSettingsEditor : IBlogSettingsEditor + { + public BlogPostHtmlEditorSettingsEditor() + { + } - private BlogPostHtmlEditorSettingsEditorControl HtmlEditorSettingsControl - { - get - { - if(_htmlEditorSettingsControl == null) - { - _htmlEditorSettingsControl = new BlogPostHtmlEditorSettingsEditorControl(); - _htmlEditorSettingsControl.SettingsChanged += new EventHandler(_htmlEditorSettingsControl_SettingsChanged); - } - return _htmlEditorSettingsControl; - } - } - private BlogPostHtmlEditorSettingsEditorControl _htmlEditorSettingsControl; + private BlogPostHtmlEditorSettingsEditorControl HtmlEditorSettingsControl + { + get + { + if(_htmlEditorSettingsControl == null) + { + _htmlEditorSettingsControl = new BlogPostHtmlEditorSettingsEditorControl(); + _htmlEditorSettingsControl.SettingsChanged += new EventHandler(_htmlEditorSettingsControl_SettingsChanged); + } + return _htmlEditorSettingsControl; + } + } + private BlogPostHtmlEditorSettingsEditorControl _htmlEditorSettingsControl; - public event EventHandler SettingsChanged; - protected void OnSettingsChanged(EventArgs evt) - { - if(SettingsChanged != null) - { - SettingsChanged(this, evt); - } - } + public event EventHandler SettingsChanged; + protected void OnSettingsChanged(EventArgs evt) + { + if(SettingsChanged != null) + { + SettingsChanged(this, evt); + } + } - private BlogSettings _settings; - bool _initing; - public void Init(BlogSettings settings) - { - _initing = true; - _settings = settings; - HtmlEditorSettingsControl.LoadSettings(settings); - _initing = false; - } + private BlogSettings _settings; + bool _initing; + public void Init(BlogSettings settings) + { + _initing = true; + _settings = settings; + HtmlEditorSettingsControl.LoadSettings(settings); + _initing = false; + } - public Control EditorControl - { - get { return HtmlEditorSettingsControl; } - } + public Control EditorControl + { + get { return HtmlEditorSettingsControl; } + } - public void ApplySettings() - { - HtmlEditorSettingsControl.ApplySettings(_settings); - } + public void ApplySettings() + { + HtmlEditorSettingsControl.ApplySettings(_settings); + } - public string Title - { - get { return "Editor"; } - } + public string Title + { + get { return "Editor"; } + } - public virtual void Dispose() - { - if(_htmlEditorSettingsControl != null) - { - _htmlEditorSettingsControl.SettingsChanged -= new EventHandler(_htmlEditorSettingsControl_SettingsChanged); - _htmlEditorSettingsControl.Dispose(); - _htmlEditorSettingsControl = null; - } - _settings = null; - } + public virtual void Dispose() + { + if(_htmlEditorSettingsControl != null) + { + _htmlEditorSettingsControl.SettingsChanged -= new EventHandler(_htmlEditorSettingsControl_SettingsChanged); + _htmlEditorSettingsControl.Dispose(); + _htmlEditorSettingsControl = null; + } + _settings = null; + } - private void _htmlEditorSettingsControl_SettingsChanged(object sender, EventArgs e) - { - if(!_initing) - OnSettingsChanged(e); - } - } + private void _htmlEditorSettingsControl_SettingsChanged(object sender, EventArgs e) + { + if(!_initing) + OnSettingsChanged(e); + } + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/BlogPostHtmlEditorSettingsEditorControl.cs b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/BlogPostHtmlEditorSettingsEditorControl.cs index 420115d2..183d3f42 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/BlogPostHtmlEditorSettingsEditorControl.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/BlogPostHtmlEditorSettingsEditorControl.cs @@ -12,173 +12,173 @@ using OpenLiveWriter.CoreServices.Progress; namespace OpenLiveWriter.PostEditor.PostHtmlEditing { - /// - /// Summary description for ImageServiceSettingsEditorControl. - /// - public class BlogPostHtmlEditorSettingsEditorControl : UserControl - { - private Button buttonLoadTemplate; - private Label label2; - private Label label1; - private TextBox textBoxTemplate; - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for ImageServiceSettingsEditorControl. + /// + public class BlogPostHtmlEditorSettingsEditorControl : UserControl + { + private Button buttonLoadTemplate; + private Label label2; + private Label label1; + private TextBox textBoxTemplate; + /// + /// Required designer variable. + /// + private Container components = null; - public BlogPostHtmlEditorSettingsEditorControl() - { - // This call is required by the Windows.Forms Form Designer. - InitializeComponent(); + public BlogPostHtmlEditorSettingsEditorControl() + { + // This call is required by the Windows.Forms Form Designer. + InitializeComponent(); - } + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.buttonLoadTemplate = new System.Windows.Forms.Button(); - this.label2 = new System.Windows.Forms.Label(); - this.label1 = new System.Windows.Forms.Label(); - this.textBoxTemplate = new System.Windows.Forms.TextBox(); - this.SuspendLayout(); - // - // buttonLoadTemplate - // - this.buttonLoadTemplate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonLoadTemplate.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.buttonLoadTemplate.Location = new System.Drawing.Point(232, 196); - this.buttonLoadTemplate.Name = "buttonLoadTemplate"; - this.buttonLoadTemplate.Size = new System.Drawing.Size(112, 23); - this.buttonLoadTemplate.TabIndex = 19; - this.buttonLoadTemplate.Text = "Download template"; - this.buttonLoadTemplate.Click += new System.EventHandler(this.buttonLoadTemplate_Click); - // - // label2 - // - this.label2.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.label2.Location = new System.Drawing.Point(0, 0); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(104, 16); - this.label2.TabIndex = 20; - this.label2.Text = "Template:"; - // - // label1 - // - this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.label1.Location = new System.Drawing.Point(0, 160); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(344, 48); - this.label1.TabIndex = 23; - this.label1.Text = "Download an editing template based on your weblog. This will post a temporary it" + - "em to your blog that can be used to detect the editing styles for items posted t" + - "o your blog."; - // - // textBoxTemplate - // - this.textBoxTemplate.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.textBoxTemplate.Location = new System.Drawing.Point(0, 16); - this.textBoxTemplate.Multiline = true; - this.textBoxTemplate.Name = "textBoxTemplate"; - this.textBoxTemplate.ScrollBars = System.Windows.Forms.ScrollBars.Both; - this.textBoxTemplate.Size = new System.Drawing.Size(344, 136); - this.textBoxTemplate.TabIndex = 24; - this.textBoxTemplate.Text = ""; - this.textBoxTemplate.TextChanged += new System.EventHandler(this.textBoxTemplate_TextChanged); - // - // BlogPostHtmlEditorSettingsEditorControl - // - this.Controls.Add(this.textBoxTemplate); - this.Controls.Add(this.buttonLoadTemplate); - this.Controls.Add(this.label2); - this.Controls.Add(this.label1); - this.Name = "BlogPostHtmlEditorSettingsEditorControl"; - this.Size = new System.Drawing.Size(344, 252); - this.ResumeLayout(false); + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.buttonLoadTemplate = new System.Windows.Forms.Button(); + this.label2 = new System.Windows.Forms.Label(); + this.label1 = new System.Windows.Forms.Label(); + this.textBoxTemplate = new System.Windows.Forms.TextBox(); + this.SuspendLayout(); + // + // buttonLoadTemplate + // + this.buttonLoadTemplate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.buttonLoadTemplate.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.buttonLoadTemplate.Location = new System.Drawing.Point(232, 196); + this.buttonLoadTemplate.Name = "buttonLoadTemplate"; + this.buttonLoadTemplate.Size = new System.Drawing.Size(112, 23); + this.buttonLoadTemplate.TabIndex = 19; + this.buttonLoadTemplate.Text = "Download template"; + this.buttonLoadTemplate.Click += new System.EventHandler(this.buttonLoadTemplate_Click); + // + // label2 + // + this.label2.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.label2.Location = new System.Drawing.Point(0, 0); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(104, 16); + this.label2.TabIndex = 20; + this.label2.Text = "Template:"; + // + // label1 + // + this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.label1.Location = new System.Drawing.Point(0, 160); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(344, 48); + this.label1.TabIndex = 23; + this.label1.Text = "Download an editing template based on your weblog. This will post a temporary it" + + "em to your blog that can be used to detect the editing styles for items posted t" + + "o your blog."; + // + // textBoxTemplate + // + this.textBoxTemplate.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textBoxTemplate.Location = new System.Drawing.Point(0, 16); + this.textBoxTemplate.Multiline = true; + this.textBoxTemplate.Name = "textBoxTemplate"; + this.textBoxTemplate.ScrollBars = System.Windows.Forms.ScrollBars.Both; + this.textBoxTemplate.Size = new System.Drawing.Size(344, 136); + this.textBoxTemplate.TabIndex = 24; + this.textBoxTemplate.Text = ""; + this.textBoxTemplate.TextChanged += new System.EventHandler(this.textBoxTemplate_TextChanged); + // + // BlogPostHtmlEditorSettingsEditorControl + // + this.Controls.Add(this.textBoxTemplate); + this.Controls.Add(this.buttonLoadTemplate); + this.Controls.Add(this.label2); + this.Controls.Add(this.label1); + this.Name = "BlogPostHtmlEditorSettingsEditorControl"; + this.Size = new System.Drawing.Size(344, 252); + this.ResumeLayout(false); - } - #endregion + } + #endregion - public event EventHandler SettingsChanged; - public void OnSettingsChanged(EventArgs evt) - { - if(SettingsChanged != null) - SettingsChanged(this, evt); - } + public event EventHandler SettingsChanged; + public void OnSettingsChanged(EventArgs evt) + { + if(SettingsChanged != null) + SettingsChanged(this, evt); + } - internal void LoadSettings(BlogSettings settings) - { - //blog template - _id = settings.Id; - using(PostHtmlEditingSettings blogTemplate = new PostHtmlEditingSettings(settings.Id)) - { - _templateFile = blogTemplate.EditorTemplateHtmlFile; - textBoxTemplate.Text = blogTemplate.EditorTemplateHtml; - } - } + internal void LoadSettings(BlogSettings settings) + { + //blog template + _id = settings.Id; + using(PostHtmlEditingSettings blogTemplate = new PostHtmlEditingSettings(settings.Id)) + { + _templateFile = blogTemplate.EditorTemplateHtmlFile; + textBoxTemplate.Text = blogTemplate.EditorTemplateHtml; + } + } - public void ApplySettings(BlogSettings settings) - { - //blog template - using(PostHtmlEditingSettings editingSettings = new PostHtmlEditingSettings(settings.Id)) - { - editingSettings.EditorTemplateHtmlFile = _templateFile; - editingSettings.EditorTemplateHtml = textBoxTemplate.Text; - } - } + public void ApplySettings(BlogSettings settings) + { + //blog template + using(PostHtmlEditingSettings editingSettings = new PostHtmlEditingSettings(settings.Id)) + { + editingSettings.EditorTemplateHtmlFile = _templateFile; + editingSettings.EditorTemplateHtml = textBoxTemplate.Text; + } + } - private string _id; - private string _templateFile; - private void buttonLoadTemplate_Click(object sender, EventArgs e) - { - BlogSettings settings = BlogSettings.ForBlogId(_id); + private string _id; + private string _templateFile; + private void buttonLoadTemplate_Click(object sender, EventArgs e) + { + BlogSettings settings = BlogSettings.ForBlogId(_id); - try - { - _templateFile = BlogTemplateDetector.DetectTemplate(this, settings ) ; + try + { + _templateFile = BlogTemplateDetector.DetectTemplate(this, settings ) ; - using(TextReader reader = new StreamReader(_templateFile, Encoding.UTF8)) - textBoxTemplate.Text = reader.ReadToEnd(); - } - catch(OperationCancelledException) - { - //user cancelled call. - } - catch(Exception ex) - { - MessageBox.Show("Error: " + ex.Message ) ; - } + using(TextReader reader = new StreamReader(_templateFile, Encoding.UTF8)) + textBoxTemplate.Text = reader.ReadToEnd(); + } + catch(OperationCancelledException) + { + //user cancelled call. + } + catch(Exception ex) + { + MessageBox.Show("Error: " + ex.Message ) ; + } - } + } - private void textBoxTemplate_TextChanged(object sender, EventArgs e) - { - OnSettingsChanged(EventArgs.Empty) ; - } + private void textBoxTemplate_TextChanged(object sender, EventArgs e) + { + OnSettingsChanged(EventArgs.Empty) ; + } - private void cbAllowMaximizedEditing_CheckedChanged(object sender, EventArgs e) - { - OnSettingsChanged(EventArgs.Empty) ; - } - } + private void cbAllowMaximizedEditing_CheckedChanged(object sender, EventArgs e) + { + OnSettingsChanged(EventArgs.Empty) ; + } + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandClipboardMenu.cs b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandClipboardMenu.cs index 93c30968..156dc08a 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandClipboardMenu.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandClipboardMenu.cs @@ -9,54 +9,53 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.PostEditor.PostHtmlEditing.Commands { - /// - /// Summary description for CommandClipboardMenu. - /// - public class CommandClipboardMenu : Command - { - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; + /// + /// Summary description for CommandClipboardMenu. + /// + public class CommandClipboardMenu : Command + { + /// + /// Required designer variable. + /// + private System.ComponentModel.Container components = null; - public CommandClipboardMenu(System.ComponentModel.IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandClipboardMenu(System.ComponentModel.IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // TODO: Add any constructor code after InitializeComponent call - // - } + // + // TODO: Add any constructor code after InitializeComponent call + // + } - public CommandClipboardMenu() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandClipboardMenu() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // TODO: Add any constructor code after InitializeComponent call - // - } + // + // TODO: Add any constructor code after InitializeComponent call + // + } - - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandClipboardMenu - // - this.Identifier = "OpenLiveWriter.PostEditor.Commands.PostHtmlEditing.ClipboardMenu"; - this.Text = "Clipboard"; - } - #endregion - } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandClipboardMenu + // + this.Identifier = "OpenLiveWriter.PostEditor.Commands.PostHtmlEditing.ClipboardMenu"; + this.Text = "Clipboard"; + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandEditLink.cs b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandEditLink.cs index bf8eb6ca..ae140aa4 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandEditLink.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandEditLink.cs @@ -6,57 +6,56 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.PostEditor.PostHtmlEditing.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandEditLink : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandCopy. + /// + public class CommandEditLink : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandEditLink(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandEditLink(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandEditLink() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandEditLink() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandCut + // + this.ContextMenuPath = "&Edit Link@101"; + this.Identifier = "OpenLiveWriter.PostEditor.Commands.PostHtmlEditing.CommandEditLink"; + this.Text = "Edit Link"; + this.MenuText = "&Edit Link"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandCut - // - this.ContextMenuPath = "&Edit Link@101"; - this.Identifier = "OpenLiveWriter.PostEditor.Commands.PostHtmlEditing.CommandEditLink"; - this.Text = "Edit Link"; - this.MenuText = "&Edit Link"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandHtmlViewMenu.cs b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandHtmlViewMenu.cs index 24f2e054..8ef45ec2 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandHtmlViewMenu.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandHtmlViewMenu.cs @@ -6,57 +6,56 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.PostEditor.PostHtmlEditing.Commands { - /// - /// Summary description for CommandClose. - /// - public class CommandHtmlViewMenu : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandClose. + /// + public class CommandHtmlViewMenu : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandHtmlViewMenu(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandHtmlViewMenu(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandHtmlViewMenu() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandHtmlViewMenu() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandHtmlViewMenu + // + this.CommandBarButtonText = "View"; + this.Identifier = "OpenLiveWriter.PostEditor.Commands.PostHtmlEditing.HtmlViewMenu"; + this.MenuText = "View"; + this.Text = "Change View Mode"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandHtmlViewMenu - // - this.CommandBarButtonText = "View"; - this.Identifier = "OpenLiveWriter.PostEditor.Commands.PostHtmlEditing.HtmlViewMenu"; - this.MenuText = "View"; - this.Text = "Change View Mode"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandImageBrightness.cs b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandImageBrightness.cs index 2eeead5a..de7f201d 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandImageBrightness.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandImageBrightness.cs @@ -6,52 +6,51 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.PostEditor.PostHtmlEditing.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandImageBrightness : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandCopy. + /// + public class CommandImageBrightness : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandImageBrightness(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandImageBrightness(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - } + } - public CommandImageBrightness() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandImageBrightness() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - } + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandImageBrightness + // + this.ContextMenuPath = ""; + this.Identifier = "OpenLiveWriter.PostEditor.Commands.PostHtmlEditing.ImageBrightness"; + this.MainMenuPath = ""; + this.Text = "Adjust image brightness"; + this.VisibleOnMainMenu = false; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandImageBrightness - // - this.ContextMenuPath = ""; - this.Identifier = "OpenLiveWriter.PostEditor.Commands.PostHtmlEditing.ImageBrightness"; - this.MainMenuPath = ""; - this.Text = "Adjust image brightness"; - this.VisibleOnMainMenu = false; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandImageDecoratorAddMenu.cs b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandImageDecoratorAddMenu.cs index e428dee2..52f3b9ea 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandImageDecoratorAddMenu.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandImageDecoratorAddMenu.cs @@ -6,57 +6,56 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.PostEditor.PostHtmlEditing.Commands { - /// - /// Summary description for CommandImageDecoratorAddMenu. - /// - public class CommandImageDecoratorAddMenu : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandImageDecoratorAddMenu. + /// + public class CommandImageDecoratorAddMenu : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandImageDecoratorAddMenu(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandImageDecoratorAddMenu(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandImageDecoratorAddMenu() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandImageDecoratorAddMenu() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandImageDecoratorAddMenu + // + this.CommandBarButtonText = ""; + this.Identifier = "OpenLiveWriter.PostEditor.Commands.PostHtmlEditing.ImageEditing.AddDecorator"; + this.MenuText = ""; + this.Text = "Add Effect"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandImageDecoratorAddMenu - // - this.CommandBarButtonText = ""; - this.Identifier = "OpenLiveWriter.PostEditor.Commands.PostHtmlEditing.ImageEditing.AddDecorator"; - this.MenuText = ""; - this.Text = "Add Effect"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandImageDecoratorApply.cs b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandImageDecoratorApply.cs index 09e33a8e..94c8ec5f 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandImageDecoratorApply.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandImageDecoratorApply.cs @@ -6,58 +6,57 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.PostEditor.PostHtmlEditing.Commands { - /// - /// Summary description for CommandImageDecoratorApply. - /// - public class CommandImageDecoratorApply : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandImageDecoratorApply. + /// + public class CommandImageDecoratorApply : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandImageDecoratorApply(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandImageDecoratorApply(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandImageDecoratorApply() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandImageDecoratorApply() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandImageDecoratorApply + // + this.CommandBarButtonText = ""; + this.Identifier = "OpenLiveWriter.PostEditor.Commands.PostHtmlEditing.ImageEditing.ImageDecoratorApp" + + "ly"; + this.MenuText = ""; + this.Text = "Apply Effect"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandImageDecoratorApply - // - this.CommandBarButtonText = ""; - this.Identifier = "OpenLiveWriter.PostEditor.Commands.PostHtmlEditing.ImageEditing.ImageDecoratorApp" + - "ly"; - this.MenuText = ""; - this.Text = "Apply Effect"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandImageDecoratorRemove.cs b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandImageDecoratorRemove.cs index 8e618797..8f6e24ab 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandImageDecoratorRemove.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandImageDecoratorRemove.cs @@ -6,57 +6,56 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.PostEditor.PostHtmlEditing.Commands { - /// - /// Summary description for CommandImageDecoratorRemove. - /// - public class CommandImageDecoratorRemove : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandImageDecoratorRemove. + /// + public class CommandImageDecoratorRemove : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandImageDecoratorRemove(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandImageDecoratorRemove(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandImageDecoratorRemove() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandImageDecoratorRemove() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandImageDecoratorRemove + // + this.CommandBarButtonText = ""; + this.Identifier = "OpenLiveWriter.PostEditor.Commands.PostHtmlEditing.ImageEditing.RemoveDecorator"; + this.MenuText = ""; + this.Text = "Remove Effect"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandImageDecoratorRemove - // - this.CommandBarButtonText = ""; - this.Identifier = "OpenLiveWriter.PostEditor.Commands.PostHtmlEditing.ImageEditing.RemoveDecorator"; - this.MenuText = ""; - this.Text = "Remove Effect"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandImageReset.cs b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandImageReset.cs index 90c0bf27..0ec379f6 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandImageReset.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandImageReset.cs @@ -6,52 +6,51 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.PostEditor.PostHtmlEditing.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandImageReset : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandCopy. + /// + public class CommandImageReset : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandImageReset(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandImageReset(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - } + } - public CommandImageReset() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandImageReset() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - } + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandImageReset + // + this.ContextMenuPath = ""; + this.Identifier = "OpenLiveWriter.PostEditor.Commands.PostHtmlEditing.ImageReset"; + this.MainMenuPath = ""; + this.Text = "Reset image"; + this.VisibleOnMainMenu = false; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandImageReset - // - this.ContextMenuPath = ""; - this.Identifier = "OpenLiveWriter.PostEditor.Commands.PostHtmlEditing.ImageReset"; - this.MainMenuPath = ""; - this.Text = "Reset image"; - this.VisibleOnMainMenu = false; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandImageRotate.cs b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandImageRotate.cs index 9038f5ff..23d76361 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandImageRotate.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandImageRotate.cs @@ -6,52 +6,51 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.PostEditor.PostHtmlEditing.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandImageRotate : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandCopy. + /// + public class CommandImageRotate : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandImageRotate(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandImageRotate(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - } + } - public CommandImageRotate() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandImageRotate() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - } + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandImageRotate + // + this.ContextMenuPath = ""; + this.Identifier = "OpenLiveWriter.PostEditor.Commands.PostHtmlEditing.ImageRotate"; + this.MainMenuPath = ""; + this.Text = "Rotate"; + this.VisibleOnMainMenu = false; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandImageRotate - // - this.ContextMenuPath = ""; - this.Identifier = "OpenLiveWriter.PostEditor.Commands.PostHtmlEditing.ImageRotate"; - this.MainMenuPath = ""; - this.Text = "Rotate"; - this.VisibleOnMainMenu = false; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandImageSaveDefaults.cs b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandImageSaveDefaults.cs index 81f286ea..4240b8d7 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandImageSaveDefaults.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandImageSaveDefaults.cs @@ -6,52 +6,51 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.PostEditor.PostHtmlEditing.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandImageSaveDefaults : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandCopy. + /// + public class CommandImageSaveDefaults : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandImageSaveDefaults(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandImageSaveDefaults(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - } + } - public CommandImageSaveDefaults() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandImageSaveDefaults() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - } + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandImageSaveDefaults + // + this.ContextMenuPath = ""; + this.Identifier = "OpenLiveWriter.PostEditor.Commands.PostHtmlEditing.ImageSaveDefaults"; + this.MainMenuPath = ""; + this.Text = "Save image settings as defaults"; + this.VisibleOnMainMenu = false; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandImageSaveDefaults - // - this.ContextMenuPath = ""; - this.Identifier = "OpenLiveWriter.PostEditor.Commands.PostHtmlEditing.ImageSaveDefaults"; - this.MainMenuPath = ""; - this.Text = "Save image settings as defaults"; - this.VisibleOnMainMenu = false; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandInsertExtendedEntry.cs b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandInsertExtendedEntry.cs index 3ae471f4..2c638a1d 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandInsertExtendedEntry.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandInsertExtendedEntry.cs @@ -7,51 +7,50 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.PostEditor.PostHtmlEditing.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandInsertExtendedEntry : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandCopy. + /// + public class CommandInsertExtendedEntry : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandInsertExtendedEntry(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); - } + public CommandInsertExtendedEntry(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); + } - public CommandInsertExtendedEntry() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); - } + public CommandInsertExtendedEntry() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandInsertExtendedEntry + // + this.ContextMenuPath = ""; + this.Identifier = "OpenLiveWriter.PostEditor.Commands.PostHtmlEditing.InsertExtendedEntry"; + this.MainMenuPath = "F&ormat@5/-&Split Post@600"; + this.MenuText = "Split Post"; + this.Text = "Split Post"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandInsertExtendedEntry - // - this.ContextMenuPath = ""; - this.Identifier = "OpenLiveWriter.PostEditor.Commands.PostHtmlEditing.InsertExtendedEntry"; - this.MainMenuPath = "F&ormat@5/-&Split Post@600"; - this.MenuText = "Split Post"; - this.Text = "Split Post"; + } + #endregion - } - #endregion - - } + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandInsertFile.cs b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandInsertFile.cs index cae4ecb5..13d7d3da 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandInsertFile.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandInsertFile.cs @@ -6,52 +6,51 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.PostEditor.PostHtmlEditing.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandInsertFile : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandCopy. + /// + public class CommandInsertFile : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandInsertFile(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandInsertFile(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - } + } - public CommandInsertFile() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandInsertFile() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - } + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandInsertFile + // + this.ContextMenuPath = ""; + this.Identifier = "OpenLiveWriter.PostEditor.Commands.PostHtmlEditing.InsertFile"; + this.MainMenuPath = "&Insert@4/&File...@125"; + this.Shortcut = System.Windows.Forms.Shortcut.CtrlM; + this.Text = "Insert File"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandInsertFile - // - this.ContextMenuPath = ""; - this.Identifier = "OpenLiveWriter.PostEditor.Commands.PostHtmlEditing.InsertFile"; - this.MainMenuPath = "&Insert@4/&File...@125"; - this.Shortcut = System.Windows.Forms.Shortcut.CtrlM; - this.Text = "Insert File"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandInsertLinkToOnfolioItem.cs b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandInsertLinkToOnfolioItem.cs index 7a60d2c5..6d6164c0 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandInsertLinkToOnfolioItem.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandInsertLinkToOnfolioItem.cs @@ -6,67 +6,67 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.PostEditor.PostHtmlEditing.Commands { - /// - /// Summary description for CommandInsertLinkToOnfolioItem. - /// - public class CommandInsertLinkToOnfolioItem : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandInsertLinkToOnfolioItem. + /// + public class CommandInsertLinkToOnfolioItem : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandInsertLinkToOnfolioItem(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public CommandInsertLinkToOnfolioItem(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - } + } - public CommandInsertLinkToOnfolioItem() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandInsertLinkToOnfolioItem() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - } + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandInsertLinkToOnfolioItem - // - this.ContextMenuPath = ""; - this.Identifier = "OpenLiveWriter.PostEditor.PostHtmlEditing.Commands.InsertLinkToOnfolioItem"; - this.MainMenuPath = "&Insert@4/Link to &Onfolio Item...@200"; - this.Shortcut = System.Windows.Forms.Shortcut.CtrlL; - this.Text = "Insert Link to Onfolio Item"; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandInsertLinkToOnfolioItem + // + this.ContextMenuPath = ""; + this.Identifier = "OpenLiveWriter.PostEditor.PostHtmlEditing.Commands.InsertLinkToOnfolioItem"; + this.MainMenuPath = "&Insert@4/Link to &Onfolio Item...@200"; + this.Shortcut = System.Windows.Forms.Shortcut.CtrlL; + this.Text = "Insert Link to Onfolio Item"; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandInsertOnfolioItem.cs b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandInsertOnfolioItem.cs index 8b4414ac..6cdba277 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandInsertOnfolioItem.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandInsertOnfolioItem.cs @@ -6,68 +6,68 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.PostEditor.PostHtmlEditing.Commands { - /// - /// Summary description for CommandInsertOnfolioItem. - /// - public class CommandInsertOnfolioItem : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandInsertOnfolioItem. + /// + public class CommandInsertOnfolioItem : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandInsertOnfolioItem(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public CommandInsertOnfolioItem(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - } + } - public CommandInsertOnfolioItem() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandInsertOnfolioItem() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - } + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandInsertOnfolioItem - // - this.ContextMenuPath = ""; - this.Identifier = "OpenLiveWriter.PostEditor.PostHtmlEditing.Commands.InsertOnfolioItem"; - this.MainMenuPath = "&Insert@4/Onfolio &Item...@150"; - this.Shortcut = System.Windows.Forms.Shortcut.CtrlJ; - this.Text = "Insert Onfolio Item"; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandInsertOnfolioItem + // + this.ContextMenuPath = ""; + this.Identifier = "OpenLiveWriter.PostEditor.PostHtmlEditing.Commands.InsertOnfolioItem"; + this.MainMenuPath = "&Insert@4/Onfolio &Item...@150"; + this.Shortcut = System.Windows.Forms.Shortcut.CtrlJ; + this.Text = "Insert Onfolio Item"; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandInsertPicture.cs b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandInsertPicture.cs index 2ffc6107..ec87c620 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandInsertPicture.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandInsertPicture.cs @@ -6,52 +6,51 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.PostEditor.PostHtmlEditing.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandInsertPicture : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandCopy. + /// + public class CommandInsertPicture : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandInsertPicture(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandInsertPicture(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - } + } - public CommandInsertPicture() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandInsertPicture() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - } + } - - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandInsertPicture - // - this.ContextMenuPath = ""; - this.Identifier = "OpenLiveWriter.PostEditor.Commands.PostHtmlEditing.InsertPicture"; - this.MainMenuPath = "&Insert@4/&Picture...-@150"; - this.Shortcut = System.Windows.Forms.Shortcut.CtrlL; - this.Text = "Insert Picture"; - this.MenuText = "Picture..."; - } - #endregion - } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandInsertPicture + // + this.ContextMenuPath = ""; + this.Identifier = "OpenLiveWriter.PostEditor.Commands.PostHtmlEditing.InsertPicture"; + this.MainMenuPath = "&Insert@4/&Picture...-@150"; + this.Shortcut = System.Windows.Forms.Shortcut.CtrlL; + this.Text = "Insert Picture"; + this.MenuText = "Picture..."; + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandInsertPictureUrl.cs b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandInsertPictureUrl.cs index ceff31b4..ee07be96 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandInsertPictureUrl.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandInsertPictureUrl.cs @@ -6,51 +6,50 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.PostEditor.PostHtmlEditing.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandInsertPictureUrl : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandCopy. + /// + public class CommandInsertPictureUrl : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandInsertPictureUrl(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandInsertPictureUrl(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - } + } - public CommandInsertPictureUrl() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandInsertPictureUrl() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - } + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandInsertPictureUrl + // + this.ContextMenuPath = ""; + this.Identifier = "OpenLiveWriter.PostEditor.Commands.PostHtmlEditing.InsertPictureUrl"; + this.MainMenuPath = "&Insert@4/Picture From &Web...@101"; + this.Text = "Insert Picture From Web"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandInsertPictureUrl - // - this.ContextMenuPath = ""; - this.Identifier = "OpenLiveWriter.PostEditor.Commands.PostHtmlEditing.InsertPictureUrl"; - this.MainMenuPath = "&Insert@4/Picture From &Web...@101"; - this.Text = "Insert Picture From Web"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandOpenLink.cs b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandOpenLink.cs index e3c4eccc..47b014f2 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandOpenLink.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandOpenLink.cs @@ -6,56 +6,55 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.PostEditor.PostHtmlEditing.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandOpenLink : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandCopy. + /// + public class CommandOpenLink : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandOpenLink(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandOpenLink(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandOpenLink() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandOpenLink() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandCut - // - this.ContextMenuPath = "&Open Link@100"; - this.Identifier = "OpenLiveWriter.PostEditor.Commands.PostHtmlEditing.CommandOpenLink"; - this.Text = "Open Link"; - this.MenuText = "&Open Link"; - } - #endregion - } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandCut + // + this.ContextMenuPath = "&Open Link@100"; + this.Identifier = "OpenLiveWriter.PostEditor.Commands.PostHtmlEditing.CommandOpenLink"; + this.Text = "Open Link"; + this.MenuText = "&Open Link"; + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandRemoveLink.cs b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandRemoveLink.cs index 5379bd3c..479fac55 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandRemoveLink.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandRemoveLink.cs @@ -6,60 +6,59 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.PostEditor.PostHtmlEditing.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandRemoveLink : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandCopy. + /// + public class CommandRemoveLink : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandRemoveLink(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandRemoveLink(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandRemoveLink() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandRemoveLink() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandRemoveLink + // + this.ContextMenuPath = "&Remove Link@102"; + this.Identifier = "OpenLiveWriter.PostEditor.Commands.PostHtmlEditing.CommandRemoveLink"; + this.MainMenuPath = "&Insert@4/&Remove Link-@300"; + this.MenuText = "&Remove Link"; + this.Shortcut = System.Windows.Forms.Shortcut.CtrlR; + this.Text = "Remove Link"; + this.VisibleOnMainMenu = false; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandRemoveLink - // - this.ContextMenuPath = "&Remove Link@102"; - this.Identifier = "OpenLiveWriter.PostEditor.Commands.PostHtmlEditing.CommandRemoveLink"; - this.MainMenuPath = "&Insert@4/&Remove Link-@300"; - this.MenuText = "&Remove Link"; - this.Shortcut = System.Windows.Forms.Shortcut.CtrlR; - this.Text = "Remove Link"; - this.VisibleOnMainMenu = false; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandViewCode.cs b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandViewCode.cs index 201e8e60..1f9d730d 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandViewCode.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandViewCode.cs @@ -6,60 +6,59 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.PostEditor.PostHtmlEditing.Commands { - /// - /// Summary description for CommandClose. - /// - public class CommandViewCode : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandClose. + /// + public class CommandViewCode : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandViewCode(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandViewCode(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandViewCode() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandViewCode() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandViewCode + // + this.ContextMenuPath = "&HTML Code@105"; + this.Identifier = "OpenLiveWriter.PostEditor.PostHtmlEditing.Commands.ViewCode"; + this.MainMenuPath = "&View@2/&HTML Code@105"; + this.MenuText = "&HTML Code"; + this.Shortcut = System.Windows.Forms.Shortcut.ShiftF11 ; + this.Text = "HTML Code View"; + this.SuppressMenuBitmap = true; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandViewCode - // - this.ContextMenuPath = "&HTML Code@105"; - this.Identifier = "OpenLiveWriter.PostEditor.PostHtmlEditing.Commands.ViewCode"; - this.MainMenuPath = "&View@2/&HTML Code@105"; - this.MenuText = "&HTML Code"; - this.Shortcut = System.Windows.Forms.Shortcut.ShiftF11 ; - this.Text = "HTML Code View"; - this.SuppressMenuBitmap = true; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandViewImageProperties.cs b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandViewImageProperties.cs index ccaa37d0..61a6a80b 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandViewImageProperties.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandViewImageProperties.cs @@ -6,58 +6,57 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.PostEditor.PostHtmlEditing.Commands { - /// - /// Summary description for CommandClose. - /// - public class CommandViewImageProperties : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandClose. + /// + public class CommandViewImageProperties : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandViewImageProperties(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandViewImageProperties(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandViewImageProperties() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandViewImageProperties() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandViewImageProperties + // + this.ContextMenuPath = "P&roperties@310"; + this.Identifier = "OpenLiveWriter.PostEditor.PostHtmlEditing.Commands.ImageProperties"; + this.MainMenuPath = "&View@2/P&roperties@310"; + this.MenuText = "Show P&roperties"; + this.Text = "Properties"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandViewImageProperties - // - this.ContextMenuPath = "P&roperties@310"; - this.Identifier = "OpenLiveWriter.PostEditor.PostHtmlEditing.Commands.ImageProperties"; - this.MainMenuPath = "&View@2/P&roperties@310"; - this.MenuText = "Show P&roperties"; - this.Text = "Properties"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandViewNormal.cs b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandViewNormal.cs index 20e0e55d..81617c43 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandViewNormal.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandViewNormal.cs @@ -6,59 +6,58 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.PostEditor.PostHtmlEditing.Commands { - /// - /// Summary description for CommandClose. - /// - public class CommandViewNormal : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandClose. + /// + public class CommandViewNormal : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandViewNormal(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandViewNormal(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandViewNormal() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandViewNormal() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandViewNormal - // - this.ContextMenuPath = "&Normal@100"; - this.Identifier = "OpenLiveWriter.PostEditor.PostHtmlEditing.Commands.ViewNormal"; - this.MainMenuPath = "&View@2/&Normal@100"; - this.MenuText = "&Normal"; - this.Shortcut = System.Windows.Forms.Shortcut.CtrlF11 ; - this.Text = "Normal View"; - this.SuppressMenuBitmap = true; - } - #endregion - } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandViewNormal + // + this.ContextMenuPath = "&Normal@100"; + this.Identifier = "OpenLiveWriter.PostEditor.PostHtmlEditing.Commands.ViewNormal"; + this.MainMenuPath = "&View@2/&Normal@100"; + this.MenuText = "&Normal"; + this.Shortcut = System.Windows.Forms.Shortcut.CtrlF11 ; + this.Text = "Normal View"; + this.SuppressMenuBitmap = true; + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandViewSidebar.cs b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandViewSidebar.cs index 2868e47c..955093a2 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandViewSidebar.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandViewSidebar.cs @@ -7,58 +7,57 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.PostEditor.PostHtmlEditing.Commands { - /// - /// Summary description for CommandClose. - /// - public class CommandViewSidebar : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandClose. + /// + public class CommandViewSidebar : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandViewSidebar(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandViewSidebar(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandViewSidebar() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandViewSidebar() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandViewSidebar - // - this.ContextMenuPath = "Side&bar@100"; - this.Identifier = "OpenLiveWriter.PostEditor.PostHtmlEditing.Commands.ViewSidebar"; - this.MainMenuPath = "&View@2/Side&bar@140"; - this.MenuText = "Side&bar"; - this.Text = "Normal View"; - this.Shortcut = Shortcut.F9; - } - #endregion - } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandViewSidebar + // + this.ContextMenuPath = "Side&bar@100"; + this.Identifier = "OpenLiveWriter.PostEditor.PostHtmlEditing.Commands.ViewSidebar"; + this.MainMenuPath = "&View@2/Side&bar@140"; + this.MenuText = "Side&bar"; + this.Text = "Normal View"; + this.Shortcut = Shortcut.F9; + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandViewWebLayout.cs b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandViewWebLayout.cs index 542ba100..5d0c729e 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandViewWebLayout.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandViewWebLayout.cs @@ -6,59 +6,58 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.PostEditor.PostHtmlEditing.Commands { - /// - /// Summary description for CommandClose. - /// - public class CommandViewWebLayout : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandClose. + /// + public class CommandViewWebLayout : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandViewWebLayout(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandViewWebLayout(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandViewWebLayout() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandViewWebLayout() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandViewWebpage + // + this.ContextMenuPath = ""; + this.Identifier = "OpenLiveWriter.PostEditor.PostHtmlEditing.Commands.ViewWebLayout"; + this.MainMenuPath = "&View@2/Web &Layout@101"; + this.MenuText = "Web &Layout"; + this.Shortcut = System.Windows.Forms.Shortcut.F11 ; + this.Text = "Web Layout"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandViewWebpage - // - this.ContextMenuPath = ""; - this.Identifier = "OpenLiveWriter.PostEditor.PostHtmlEditing.Commands.ViewWebLayout"; - this.MainMenuPath = "&View@2/Web &Layout@101"; - this.MenuText = "Web &Layout"; - this.Shortcut = System.Windows.Forms.Shortcut.F11 ; - this.Text = "Web Layout"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandViewWebPreview.cs b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandViewWebPreview.cs index 9f1bea65..6f59d9d9 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandViewWebPreview.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Commands/CommandViewWebPreview.cs @@ -6,59 +6,58 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.PostEditor.PostHtmlEditing.Commands { - /// - /// Summary description for CommandClose. - /// - public class CommandViewWebPreview : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandClose. + /// + public class CommandViewWebPreview : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandViewWebPreview(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandViewWebPreview(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandViewWebPreview() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandViewWebPreview() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandViewPreview + // + this.ContextMenuPath = "&Web Preview@100"; + this.Identifier = "OpenLiveWriter.PostEditor.PostHtmlEditing.Commands.ViewPreview"; + this.MainMenuPath = "&View@2/&Web Preview@103"; + this.MenuText = "&Web Preview"; + this.Shortcut = System.Windows.Forms.Shortcut.F12 ; + this.Text = "Web Preview"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandViewPreview - // - this.ContextMenuPath = "&Web Preview@100"; - this.Identifier = "OpenLiveWriter.PostEditor.PostHtmlEditing.Commands.ViewPreview"; - this.MainMenuPath = "&View@2/&Web Preview@103"; - this.MenuText = "&Web Preview"; - this.Shortcut = System.Windows.Forms.Shortcut.F12 ; - this.Text = "Web Preview"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/DebugElementBehavior.cs b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/DebugElementBehavior.cs index 7a19f36f..e9472d56 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/DebugElementBehavior.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/DebugElementBehavior.cs @@ -10,41 +10,41 @@ using OpenLiveWriter.Interop.Windows; namespace OpenLiveWriter.PostEditor.PostHtmlEditing { - internal class DebugElementBehavior : EditableRegionElementBehavior - { - public DebugElementBehavior(IHtmlEditorComponentContext editorContext, IHTMLElement prevEditableRegion, IHTMLElement nextEditableRegion) - : base(editorContext, prevEditableRegion, nextEditableRegion) - { - } + internal class DebugElementBehavior : EditableRegionElementBehavior + { + public DebugElementBehavior(IHtmlEditorComponentContext editorContext, IHTMLElement prevEditableRegion, IHTMLElement nextEditableRegion) + : base(editorContext, prevEditableRegion, nextEditableRegion) + { + } - protected override void OnElementAttached() - { - //PaintRegionBorder = Color.Blue; - base.OnElementAttached (); - } + protected override void OnElementAttached() + { + //PaintRegionBorder = Color.Blue; + base.OnElementAttached (); + } - protected override void OnElementDetached() - { - base.OnElementDetached (); - } + protected override void OnElementDetached() + { + base.OnElementDetached (); + } - public override void GetPainterInfo(ref _HTML_PAINTER_INFO pInfo) - { - base.GetPainterInfo(ref pInfo); - } + public override void GetPainterInfo(ref _HTML_PAINTER_INFO pInfo) + { + base.GetPainterInfo(ref pInfo); + } - public override void OnDraw(Graphics g, Rectangle drawBounds, RECT rcBounds, RECT rcUpdate, int lDrawFlags, IntPtr hdc, IntPtr pvDrawObject) - { - IHTMLElement2 element2 = HTMLElement as IHTMLElement2; - //g.DrawRectangle(new Pen(Color.Red, 1), GetPaintRectangle(GetClientRectangle(ELEMENT_REGION.CONTENT), rcBounds)); - //g.DrawRectangle(new Pen(Color.Orange, 1), GetPaintRectangle(GetClientRectangle(ELEMENT_REGION.BORDER), rcBounds)); - //g.DrawRectangle(new Pen(Color.Blue, 1), GetPaintRectangle(GetClientRectangle(ELEMENT_REGION.PADDING), rcBounds)); - //g.DrawRectangle(new Pen(Color.Gold, 1), GetPaintRectangle(GetClientRectangle(ELEMENT_REGION.MARGIN), rcBounds)); + public override void OnDraw(Graphics g, Rectangle drawBounds, RECT rcBounds, RECT rcUpdate, int lDrawFlags, IntPtr hdc, IntPtr pvDrawObject) + { + IHTMLElement2 element2 = HTMLElement as IHTMLElement2; + //g.DrawRectangle(new Pen(Color.Red, 1), GetPaintRectangle(GetClientRectangle(ELEMENT_REGION.CONTENT), rcBounds)); + //g.DrawRectangle(new Pen(Color.Orange, 1), GetPaintRectangle(GetClientRectangle(ELEMENT_REGION.BORDER), rcBounds)); + //g.DrawRectangle(new Pen(Color.Blue, 1), GetPaintRectangle(GetClientRectangle(ELEMENT_REGION.PADDING), rcBounds)); + //g.DrawRectangle(new Pen(Color.Gold, 1), GetPaintRectangle(GetClientRectangle(ELEMENT_REGION.MARGIN), rcBounds)); - //highlight the line that the caret is currently placed on. - //Rectangle lineRect = GetPaintRectangle(GetLineClientRectangle(EditorContext.SelectedMarkupRange.Start), rcBounds); - //g.DrawRectangle(new Pen(Color.Violet, 1), lineRect); - } - } + //highlight the line that the caret is currently placed on. + //Rectangle lineRect = GetPaintRectangle(GetLineClientRectangle(EditorContext.SelectedMarkupRange.Start), rcBounds); + //g.DrawRectangle(new Pen(Color.Violet, 1), lineRect); + } + } } #endif diff --git a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/EditableRegionElementBehavior.cs b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/EditableRegionElementBehavior.cs index 713a0930..5ed0e1f3 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/EditableRegionElementBehavior.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/EditableRegionElementBehavior.cs @@ -625,7 +625,6 @@ namespace OpenLiveWriter.PostEditor.PostHtmlEditing return GetLineClientRectangle(pointer); } - /// /// Returns the bounds of line that the pointer is positioned within in client-based coordinates. /// diff --git a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/EditableSmartContent.cs b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/EditableSmartContent.cs index 5f24eac8..5748b119 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/EditableSmartContent.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/EditableSmartContent.cs @@ -87,7 +87,6 @@ namespace OpenLiveWriter.PostEditor.PostHtmlEditing _smartContentElement.id = ContentSourceManager.MakeContainingElementId(_contentSourceId, _smartContentId); SmartContentInsertionHelper.InsertEditorHtmlIntoElement(_contentSourceContext, _contentSource, _smartContent, _smartContentElement); - //reinit the smart content so it is re-cloned MakeSmartContentEditable(); } diff --git a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ElementBehaviorManager.cs b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ElementBehaviorManager.cs index 0aecbf26..2b58b6c8 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ElementBehaviorManager.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ElementBehaviorManager.cs @@ -117,12 +117,12 @@ namespace OpenLiveWriter.PostEditor.PostHtmlEditing // HTML required to make runtime bound behaviors work (GUID value is irrelevant) /* - + - - */ + + */ private LazyLoader _getBehaviorStyles; public string BehaviorStyles diff --git a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ExtendedHtmlEditorMashallingHandler.cs b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ExtendedHtmlEditorMashallingHandler.cs index 1290516d..f016a957 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ExtendedHtmlEditorMashallingHandler.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ExtendedHtmlEditorMashallingHandler.cs @@ -60,7 +60,6 @@ namespace OpenLiveWriter.PostEditor.PostHtmlEditing _unhandledDropTarget = unhandledDropTarget; } - protected override IDataFormatHandlerFactory[] CreateDataFormatFactories() { if (IsPlainTextOnly) @@ -69,7 +68,7 @@ namespace OpenLiveWriter.PostEditor.PostHtmlEditing new DelegateBasedDataFormatHandlerFactory(CreateInternalSmartContentFormatHandler, InternalSmartContentFormatHandler.CanCreateFrom), new DelegateBasedDataFormatHandlerFactory(CreateTextDataFormatHandler, CanCreateFromTextFilter), new DelegateBasedDataFormatHandlerFactory(CreateUnhandledFormatHandler, UnhandledDropTarget.CanCreateFrom) // This always needs to be the last handler - }; + }; return new IDataFormatHandlerFactory[]{ new DelegateBasedDataFormatHandlerFactory(CreateEmlMessageFormatHandler, EmlMessageHandler.CanCreateFrom), @@ -82,16 +81,16 @@ namespace OpenLiveWriter.PostEditor.PostHtmlEditing new DelegateBasedDataFormatHandlerFactory(CreateImageFileFormatHandler, data => !_blogEditor.ShouldComposeHostHandlePhotos() && ImageFileFormatHandler.CanCreateFrom(data)), new DelegateBasedDataFormatHandlerFactory(CreateTableDataFormatHandler, CanCreateTableDataFormatHandler), #if SUPPORT_FILES - new DelegateBasedDataFormatHandlerFactory(CreateFileDataFormatHandler, new DataObjectFilter(CanCreateFileFormatHandler)), + new DelegateBasedDataFormatHandlerFactory(CreateFileDataFormatHandler, new DataObjectFilter(CanCreateFileFormatHandler)), #endif - new DelegateBasedDataFormatHandlerFactory(CreateHtmlDataFormatHandler, CanCreateHtmlFormatHandler), + new DelegateBasedDataFormatHandlerFactory(CreateHtmlDataFormatHandler, CanCreateHtmlFormatHandler), new DelegateBasedDataFormatHandlerFactory(CreateImageClipboardFormatHandler, CanCreateImageDataFormatHandler), new DelegateBasedDataFormatHandlerFactory(CreateEmbedDataFormatHandler, CanCreateEmbedFormatHandler ), new DelegateBasedDataFormatHandlerFactory(CreateVideoFileFormatHandler, VideoFileFormatHandler.CanCreateFrom), new DelegateBasedDataFormatHandlerFactory(CreateImageFolderFormatHandler, data => !_blogEditor.ShouldComposeHostHandlePhotos() && ImageFolderFormatHandler.CanCreateFrom(data)), new DelegateBasedDataFormatHandlerFactory(CreateTextDataFormatHandler, CanCreateFromTextFilter), new DelegateBasedDataFormatHandlerFactory(CreateUnhandledFormatHandler, UnhandledDropTarget.CanCreateFrom) // This always needs to be the last handler - }; + }; } // special text filter that screens out LiveClipboard data @@ -458,7 +457,6 @@ namespace OpenLiveWriter.PostEditor.PostHtmlEditing } } - internal class InternalSmartContentFormatHandler : FreeTextHandler { IContentSourceSite _contentSourceSite; diff --git a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/HtmlSourceEditorSettings.cs b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/HtmlSourceEditorSettings.cs index 850c8751..30346e50 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/HtmlSourceEditorSettings.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/HtmlSourceEditorSettings.cs @@ -8,7 +8,6 @@ namespace OpenLiveWriter.PostEditor.PostHtmlEditing public sealed class HtmlSourceEditorSettings { - internal static SettingsPersisterHelper SettingsKey = PostEditorSettings.SettingsKey.GetSubSettings("HtmlSourceEditor"); } } diff --git a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/IBlogPostSpellCheckingContext.cs b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/IBlogPostSpellCheckingContext.cs index bd4c5f8b..6901afe4 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/IBlogPostSpellCheckingContext.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/IBlogPostSpellCheckingContext.cs @@ -5,11 +5,11 @@ using System; namespace OpenLiveWriter.PostEditor.PostHtmlEditing { - /// - /// Spelling checking services for the HTML Editor. - /// - public interface IBlogPostSpellCheckingContext - { - string PostSpellingContextDirectory { get; } - } + /// + /// Spelling checking services for the HTML Editor. + /// + public interface IBlogPostSpellCheckingContext + { + string PostSpellingContextDirectory { get; } + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ImageEditing/Decorators/CropEditor.cs b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ImageEditing/Decorators/CropEditor.cs index d714446d..166bfcf9 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ImageEditing/Decorators/CropEditor.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ImageEditing/Decorators/CropEditor.cs @@ -134,7 +134,6 @@ namespace OpenLiveWriter.PostEditor.PostHtmlEditing.ImageEditing.Decorators imageCropControl.Select(); - //int minWidth = buttonRotate.Right + width + (form.ClientSize.Width - buttonOK.Left) + SystemInformation.FrameBorderSize.Width * 2; //form.MinimumSize = new Size(minWidth, form.MinimumSize.Height); } diff --git a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ImageEditing/Decorators/WarmEditor.cs b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ImageEditing/Decorators/WarmEditor.cs index f0024c0a..2d0a7f95 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ImageEditing/Decorators/WarmEditor.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ImageEditing/Decorators/WarmEditor.cs @@ -13,141 +13,140 @@ using OpenLiveWriter.Localization.Bidi; namespace OpenLiveWriter.PostEditor.PostHtmlEditing.ImageEditing.Decorators { public class WarmEditor : ImageDecoratorEditor, ISupportsRightAndLeftArrows - { - private TrackBar trackBarWarmth; - private Label label1; - private Label label2; + { + private TrackBar trackBarWarmth; + private Label label1; + private Label label2; - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Required designer variable. + /// + private Container components = null; - public WarmEditor() - { - // This call is required by the Windows.Forms Form Designer. - InitializeComponent(); + public WarmEditor() + { + // This call is required by the Windows.Forms Form Designer. + InitializeComponent(); - this.label1.Text = Res.Get(StringId.ColorTempCooler); - this.label2.Text = Res.Get(StringId.ColorTempWarmer); - } + this.label1.Text = Res.Get(StringId.ColorTempCooler); + this.label2.Text = Res.Get(StringId.ColorTempWarmer); + } - protected override void LoadEditor() - { - base.LoadEditor (); - WarmSettings = new WarmDecorator.WarmDecoratorSettings(Settings); + protected override void LoadEditor() + { + base.LoadEditor (); + WarmSettings = new WarmDecorator.WarmDecoratorSettings(Settings); - this.trackBarWarmth.Value = (int) (WarmSettings.WarmthPosition * 500f); - trackBarWarmth.SmallChange = trackBarWarmth.Maximum/20; + this.trackBarWarmth.Value = (int) (WarmSettings.WarmthPosition * 500f); + trackBarWarmth.SmallChange = trackBarWarmth.Maximum/20; trackBarWarmth.LargeChange = trackBarWarmth.Maximum / 5; - BidiHelper.RtlLayoutFixup(this); - label1.Top = label2.Top = trackBarWarmth.Bottom ; + label1.Top = label2.Top = trackBarWarmth.Bottom ; AccessibleName = ControlHelper.ToAccessibleName(Res.Get(StringId.DecoratorColorTemp)); - trackBarWarmth.AccessibleName = ControlHelper.ToAccessibleName(Res.Get(StringId.DecoratorColorTemp)); - } + trackBarWarmth.AccessibleName = ControlHelper.ToAccessibleName(Res.Get(StringId.DecoratorColorTemp)); + } - private WarmDecorator.WarmDecoratorSettings WarmSettings; + private WarmDecorator.WarmDecoratorSettings WarmSettings; - protected override void OnSaveSettings() - { - base.OnSaveSettings(); - float newWarmth = trackBarWarmth.Value/500f; - if(WarmSettings.WarmthPosition != newWarmth) - { - WarmSettings.WarmthPosition = newWarmth; - } - } + protected override void OnSaveSettings() + { + base.OnSaveSettings(); + float newWarmth = trackBarWarmth.Value/500f; + if(WarmSettings.WarmthPosition != newWarmth) + { + WarmSettings.WarmthPosition = newWarmth; + } + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.trackBarWarmth = new System.Windows.Forms.TrackBar(); - this.label1 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - ((System.ComponentModel.ISupportInitialize)(this.trackBarWarmth)).BeginInit(); - this.SuspendLayout(); - // - // trackBarWarmth - // - this.trackBarWarmth.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.trackBarWarmth.Location = new System.Drawing.Point(0, 16); - this.trackBarWarmth.Maximum = 100; - this.trackBarWarmth.Minimum = -100; - this.trackBarWarmth.Name = "trackBarWarmth"; - this.trackBarWarmth.Size = new System.Drawing.Size(215, 45); - this.trackBarWarmth.TabIndex = 1; - this.trackBarWarmth.TickFrequency = 50; + #region Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.trackBarWarmth = new System.Windows.Forms.TrackBar(); + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + ((System.ComponentModel.ISupportInitialize)(this.trackBarWarmth)).BeginInit(); + this.SuspendLayout(); + // + // trackBarWarmth + // + this.trackBarWarmth.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.trackBarWarmth.Location = new System.Drawing.Point(0, 16); + this.trackBarWarmth.Maximum = 100; + this.trackBarWarmth.Minimum = -100; + this.trackBarWarmth.Name = "trackBarWarmth"; + this.trackBarWarmth.Size = new System.Drawing.Size(215, 45); + this.trackBarWarmth.TabIndex = 1; + this.trackBarWarmth.TickFrequency = 50; this.trackBarWarmth.KeyUp += new System.Windows.Forms.KeyEventHandler(this.trackBarWarmth_KeyUp); - this.trackBarWarmth.ValueChanged += new System.EventHandler(this.trackBarWarmth_ValueChanged); - // - // label1 - // - this.label1.Location = new System.Drawing.Point(0, 61); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(100, 43); - this.label1.TabIndex = 2; - this.label1.Text = "Cooler"; - // - // label2 - // - this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.label2.Location = new System.Drawing.Point(120, 61); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(88, 43); - this.label2.TabIndex = 3; - this.label2.Text = "Warmer"; - this.label2.TextAlign = System.Drawing.ContentAlignment.TopRight; - // - // WarmEditor - // - this.Controls.Add(this.trackBarWarmth); - this.Controls.Add(this.label1); - this.Controls.Add(this.label2); - this.Name = "WarmEditor"; + this.trackBarWarmth.ValueChanged += new System.EventHandler(this.trackBarWarmth_ValueChanged); + // + // label1 + // + this.label1.Location = new System.Drawing.Point(0, 61); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(100, 43); + this.label1.TabIndex = 2; + this.label1.Text = "Cooler"; + // + // label2 + // + this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.label2.Location = new System.Drawing.Point(120, 61); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(88, 43); + this.label2.TabIndex = 3; + this.label2.Text = "Warmer"; + this.label2.TextAlign = System.Drawing.ContentAlignment.TopRight; + // + // WarmEditor + // + this.Controls.Add(this.trackBarWarmth); + this.Controls.Add(this.label1); + this.Controls.Add(this.label2); + this.Name = "WarmEditor"; this.RightToLeft = BidiHelper.IsRightToLeft ? RightToLeft.Yes : RightToLeft.No; - this.Size = new System.Drawing.Size(216, 160); - ((System.ComponentModel.ISupportInitialize)(this.trackBarWarmth)).EndInit(); - this.ResumeLayout(false); + this.Size = new System.Drawing.Size(216, 160); + ((System.ComponentModel.ISupportInitialize)(this.trackBarWarmth)).EndInit(); + this.ResumeLayout(false); - } - #endregion + } + #endregion - private void trackBarWarmth_KeyUp(object sender, KeyEventArgs e) - { + private void trackBarWarmth_KeyUp(object sender, KeyEventArgs e) + { if(e.KeyCode == Keys.Left) { trackBarWarmth.Value = Math.Max(trackBarWarmth.Value - trackBarWarmth.SmallChange, trackBarWarmth.Minimum); } - } + } - private void trackBarWarmth_ValueChanged(object sender, EventArgs e) - { - SaveSettingsAndApplyDecorator(); - } + private void trackBarWarmth_ValueChanged(object sender, EventArgs e) + { + SaveSettingsAndApplyDecorator(); + } - } + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ImageEditing/ImageBorderPickerControl.cs b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ImageEditing/ImageBorderPickerControl.cs index 09a2f5d6..03afcce5 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ImageEditing/ImageBorderPickerControl.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ImageEditing/ImageBorderPickerControl.cs @@ -63,7 +63,6 @@ namespace OpenLiveWriter.PostEditor.PostHtmlEditing borderImage = comboItem.Image; } - // determine state bool selected = (e.State & DrawItemState.Selected) > 0; diff --git a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ImageEditing/ImageDecoratorEditorForm.cs b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ImageEditing/ImageDecoratorEditorForm.cs index 5a623eb8..a7ba3c77 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ImageEditing/ImageDecoratorEditorForm.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ImageEditing/ImageDecoratorEditorForm.cs @@ -25,8 +25,8 @@ namespace OpenLiveWriter.PostEditor.PostHtmlEditing /// private Container components = null; /* - private Size offsetFromOwner; - */ + private Size offsetFromOwner; + */ public ImageDecoratorEditorForm() { @@ -49,9 +49,9 @@ namespace OpenLiveWriter.PostEditor.PostHtmlEditing } /* - (this.Owner as MainFrameSatelliteWindow).LocationFixed -=new EventHandler(Owner_LocationChanged); - (this.Owner as MainFrameSatelliteWindow).CloseFixed -=new EventHandler(Owner_Closed); - */ + (this.Owner as MainFrameSatelliteWindow).LocationFixed -=new EventHandler(Owner_LocationChanged); + (this.Owner as MainFrameSatelliteWindow).CloseFixed -=new EventHandler(Owner_Closed); + */ } base.Dispose(disposing); } @@ -132,61 +132,60 @@ namespace OpenLiveWriter.PostEditor.PostHtmlEditing } /* - public void SetOwner(Form owner) - { - this.Owner = owner; - this.Location = new Point(owner.Location.X + 100, owner.Location.Y + 100); - (owner as MainFrameSatelliteWindow).LocationFixed +=new EventHandler(Owner_LocationChanged); - (owner as MainFrameSatelliteWindow).CloseFixed +=new EventHandler(Owner_Closed); - } + public void SetOwner(Form owner) + { + this.Owner = owner; + this.Location = new Point(owner.Location.X + 100, owner.Location.Y + 100); + (owner as MainFrameSatelliteWindow).LocationFixed +=new EventHandler(Owner_LocationChanged); + (owner as MainFrameSatelliteWindow).CloseFixed +=new EventHandler(Owner_Closed); + } + protected override void OnLocationChanged(EventArgs e) + { + // update frame offset + Point frameTopRight = GetFrameTopRight() ; + offsetFromOwner = new Size(Left - frameTopRight.X, Top - frameTopRight.Y ); + } - protected override void OnLocationChanged(EventArgs e) - { - // update frame offset - Point frameTopRight = GetFrameTopRight() ; - offsetFromOwner = new Size(Left - frameTopRight.X, Top - frameTopRight.Y ); - } + private Point GetFrameTopRight() + { + Point frameTopRight = this.Owner.Location ; + frameTopRight.Offset(this.Owner.Size.Width,0) ; + return frameTopRight ; + } - private Point GetFrameTopRight() - { - Point frameTopRight = this.Owner.Location ; - frameTopRight.Offset(this.Owner.Size.Width,0) ; - return frameTopRight ; - } + private void Owner_Closed(object sender, EventArgs e) + { + this.Close(); + } - private void Owner_Closed(object sender, EventArgs e) - { - this.Close(); - } + private void Owner_LocationChanged(object sender, EventArgs e) + { + Point location = GetFrameTopRight() ; + Size frameOffset = offsetFromOwner ; + location.Offset(frameOffset.Width, frameOffset.Height); - private void Owner_LocationChanged(object sender, EventArgs e) - { - Point location = GetFrameTopRight() ; - Size frameOffset = offsetFromOwner ; - location.Offset(frameOffset.Width, frameOffset.Height); + Location = EnsureOnScreen(location) ; + } - Location = EnsureOnScreen(location) ; - } + private Point EnsureOnScreen(Point location) + { + int left = 0; + int right = 0; + foreach (Screen currentScreen in Screen.AllScreens) + { + Rectangle currentScreenBounds = currentScreen.Bounds; + left = Math.Min(left, currentScreenBounds.Left); + right = Math.Max(right, currentScreenBounds.Right); + } - private Point EnsureOnScreen(Point location) - { - int left = 0; - int right = 0; - foreach (Screen currentScreen in Screen.AllScreens) - { - Rectangle currentScreenBounds = currentScreen.Bounds; - left = Math.Min(left, currentScreenBounds.Left); - right = Math.Max(right, currentScreenBounds.Right); - } + if (location.X > right) + location.X = right - Width; + else if (location.X < left) + location.X = left; - if (location.X > right) - location.X = right - Width; - else if (location.X < left) - location.X = left; - - return location; - } - */ + return location; + } + */ } } diff --git a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ImageEditing/ImageDecoratorsManager.cs b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ImageEditing/ImageDecoratorsManager.cs index efcec994..2e548d61 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ImageEditing/ImageDecoratorsManager.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ImageEditing/ImageDecoratorsManager.cs @@ -50,8 +50,8 @@ namespace OpenLiveWriter.PostEditor.PostHtmlEditing new ImageDecorator(PhotoBorderDecorator.Id, Res.Get(StringId.DecoratorPhotopaper), typeof(PhotoBorderDecorator), BORDER_GROUP, true, false, true, false), new ImageDecorator(ReflectionBorderDecorator.Id, Res.Get(StringId.DecoratorReflection), typeof(ReflectionBorderDecorator), BORDER_GROUP, true, false, true, false), new ImageDecorator(RoundedCornersBorderDecorator.Id, Res.Get(StringId.DecoratorRoundedCorners), typeof(RoundedCornersBorderDecorator), BORDER_GROUP, true, false, true, false), - //new ImageDecorator(SoftShadowBorderDecorator.Id, "Soft Shadow", typeof(SoftShadowBorderDecorator), true, false, true, false), - new ImageDecorator(ThinSolidBorderDecorator.Id, Res.Get(StringId.DecoratorSolid1px), typeof(ThinSolidBorderDecorator), BORDER_GROUP, true, false, true, false), + //new ImageDecorator(SoftShadowBorderDecorator.Id, "Soft Shadow", typeof(SoftShadowBorderDecorator), true, false, true, false), + new ImageDecorator(ThinSolidBorderDecorator.Id, Res.Get(StringId.DecoratorSolid1px), typeof(ThinSolidBorderDecorator), BORDER_GROUP, true, false, true, false), new ImageDecorator(ThickSolidBorderDecorator.Id, Res.Get(StringId.DecoratorSolid3px), typeof(ThickSolidBorderDecorator), BORDER_GROUP, true, false, true, false), }); ImageDecoratorGroup colors = new ImageDecoratorGroup(ADJUST_COLOR_GROUP, false, @@ -166,23 +166,23 @@ namespace OpenLiveWriter.PostEditor.PostHtmlEditing private void RegisterImageDecoratorPlugins() { #if SUPPORT_PLUGINS - Type[] pluginImplTypes = PostEditorPluginManager.Instance.GetPlugins(typeof(IImageDecorator)); - foreach(Type pluginImplType in pluginImplTypes) - { - object[] attrs = pluginImplType.GetCustomAttributes(typeof(ImageDecoratorAttribute), true); - if(attrs.Length > 0) - { - ImageDecoratorAttribute decAttr = (ImageDecoratorAttribute)attrs[0]; - AddDecorator( - decAttr.Group != null ? decAttr.Group : DefaultGroupName, - new ImageDecorator( - decAttr.Id != null ? decAttr.Id : pluginImplType.FullName, - decAttr.Name, - pluginImplType, false)); - } - else - AddDecorator(DefaultGroupName, new ImageDecorator(pluginImplType.FullName, pluginImplType.Name, pluginImplType, false)); - } + Type[] pluginImplTypes = PostEditorPluginManager.Instance.GetPlugins(typeof(IImageDecorator)); + foreach(Type pluginImplType in pluginImplTypes) + { + object[] attrs = pluginImplType.GetCustomAttributes(typeof(ImageDecoratorAttribute), true); + if(attrs.Length > 0) + { + ImageDecoratorAttribute decAttr = (ImageDecoratorAttribute)attrs[0]; + AddDecorator( + decAttr.Group != null ? decAttr.Group : DefaultGroupName, + new ImageDecorator( + decAttr.Id != null ? decAttr.Id : pluginImplType.FullName, + decAttr.Name, + pluginImplType, false)); + } + else + AddDecorator(DefaultGroupName, new ImageDecorator(pluginImplType.FullName, pluginImplType.Name, pluginImplType, false)); + } #endif } diff --git a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ImageEditing/ImageEditingPropertyForm.cs b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ImageEditing/ImageEditingPropertyForm.cs index 6d86e0e2..d2e64b3b 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ImageEditing/ImageEditingPropertyForm.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ImageEditing/ImageEditingPropertyForm.cs @@ -14,320 +14,319 @@ using Project31.ApplicationFramework; namespace Onfolio.Writer.PostEditor.PostHtmlEditing { - public class ImageEditingPropertyForm : MainFrameSatelliteWindow, IImagePropertyEditingContext - { - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = new Container(); + public class ImageEditingPropertyForm : MainFrameSatelliteWindow, IImagePropertyEditingContext + { + /// + /// Required designer variable. + /// + private System.ComponentModel.Container components = new Container(); - private IHtmlEditorComponentContext _editorContext ; - private IBlogPostImageDataContext _imageDataContext; - private Onfolio.Writer.PostEditor.PostHtmlEditing.ImagePropertyEditorControl imagePropertyEditorControl1; - private Onfolio.Writer.PostEditor.PostHtmlEditing.ImageEditingPropertyStatusbar imageEditingPropertyStatusbar1; - private CreateFileCallback _createFileCallback ; + private IHtmlEditorComponentContext _editorContext ; + private IBlogPostImageDataContext _imageDataContext; + private Onfolio.Writer.PostEditor.PostHtmlEditing.ImagePropertyEditorControl imagePropertyEditorControl1; + private Onfolio.Writer.PostEditor.PostHtmlEditing.ImageEditingPropertyStatusbar imageEditingPropertyStatusbar1; + private CreateFileCallback _createFileCallback ; + #region Initialization/Singleton - #region Initialization/Singleton + public static void Initialize(IHtmlEditorComponentContext editorContext, IBlogPostImageDataContext dataContext, CreateFileCallback callback) + { + // initialize one form per-thread + if ( _imagePropertyForm == null ) + { + _imagePropertyForm = new ImageEditingPropertyForm() ; + _imagePropertyForm.Init(editorContext, dataContext, callback); + } + } - public static void Initialize(IHtmlEditorComponentContext editorContext, IBlogPostImageDataContext dataContext, CreateFileCallback callback) - { - // initialize one form per-thread - if ( _imagePropertyForm == null ) - { - _imagePropertyForm = new ImageEditingPropertyForm() ; - _imagePropertyForm.Init(editorContext, dataContext, callback); - } - } + public static ImageEditingPropertyForm Instance + { + get + { + return _imagePropertyForm ; + } + } - public static ImageEditingPropertyForm Instance - { - get - { - return _imagePropertyForm ; - } - } + [ThreadStatic] + private static ImageEditingPropertyForm _imagePropertyForm ; - [ThreadStatic] - private static ImageEditingPropertyForm _imagePropertyForm ; + public ImageEditingPropertyForm() + { + InitializeComponent() ; + } - public ImageEditingPropertyForm() - { - InitializeComponent() ; - } + #endregion - #endregion + #region Interaction with base (MainFrameSatelliteWindow) - #region Interaction with base (MainFrameSatelliteWindow) + private void Init(IHtmlEditorComponentContext editorContext, IBlogPostImageDataContext dataContext, CreateFileCallback callback) + { + _editorContext = editorContext ; + _editorContext.SelectionChanged +=new EventHandler(_editorContext_SelectionChanged); + _imageDataContext = dataContext; - private void Init(IHtmlEditorComponentContext editorContext, IBlogPostImageDataContext dataContext, CreateFileCallback callback) - { - _editorContext = editorContext ; - _editorContext.SelectionChanged +=new EventHandler(_editorContext_SelectionChanged); - _imageDataContext = dataContext; + _createFileCallback = callback ; - _createFileCallback = callback ; + this.imagePropertyEditorControl1.Init(dataContext); - this.imagePropertyEditorControl1.Init(dataContext); + base.Init(editorContext.MainFrameWindow, typeof(CommandViewImageProperties)) ; + } - base.Init(editorContext.MainFrameWindow, typeof(CommandViewImageProperties)) ; - } + protected override void OnBeforeShow() + { + base.OnBeforeShow(); + ImagePropertyHandler.RefreshView(); + } - protected override void OnBeforeShow() - { - base.OnBeforeShow(); - ImagePropertyHandler.RefreshView(); - } + protected override bool AutoUpdateActivationSetting + { + get { return ImageEditingSettings.AutoSavePropertiesActivationState ; } + } - protected override bool AutoUpdateActivationSetting - { - get { return ImageEditingSettings.AutoSavePropertiesActivationState ; } - } + protected override bool ShowWhenEditContextActivated + { + get { return ImageEditingSettings.ShowPropertiesOnImageSelection ; } + set { ImageEditingSettings.ShowPropertiesOnImageSelection = value ; } + } - protected override bool ShowWhenEditContextActivated - { - get { return ImageEditingSettings.ShowPropertiesOnImageSelection ; } - set { ImageEditingSettings.ShowPropertiesOnImageSelection = value ; } - } + protected override Size MainFrameTopRightOffset + { + get { return ImageEditingSettings.PropertiesMainFrameTopRightOffset ; } + set { ImageEditingSettings.PropertiesMainFrameTopRightOffset = value ; } + } - protected override Size MainFrameTopRightOffset - { - get { return ImageEditingSettings.PropertiesMainFrameTopRightOffset ; } - set { ImageEditingSettings.PropertiesMainFrameTopRightOffset = value ; } - } + #endregion - #endregion + private ImageEditingTabPageControl[] TabPages + { + get + { + return this.imagePropertyEditorControl1.TabPages; + } + } - private ImageEditingTabPageControl[] TabPages - { - get - { - return this.imagePropertyEditorControl1.TabPages; - } - } + private void _editorContext_SelectionChanged(object sender, EventArgs e) + { + RefreshImage(); + } - private void _editorContext_SelectionChanged(object sender, EventArgs e) - { - RefreshImage(); - } + public IHTMLImgElement SelectedImage + { + get { return _selectedImage; } + } + private IHTMLImgElement _selectedImage ; - public IHTMLImgElement SelectedImage - { - get { return _selectedImage; } - } - private IHTMLImgElement _selectedImage ; + private bool SelectionIsImage + { + get + { + return _selectedImage != null ; + } + } - private bool SelectionIsImage - { - get - { - return _selectedImage != null ; - } - } + private ImageEditingPropertyHandler ImagePropertyHandler + { + get + { + if (_imagePropertyHandler == null) + { + Debug.Assert(SelectedImage != null, "No image selected!"); + _imagePropertyHandler = new ImageEditingPropertyHandler( + this, _createFileCallback, _imageDataContext ); + } + return _imagePropertyHandler ; + } + } + private ImageEditingPropertyHandler _imagePropertyHandler ; - private ImageEditingPropertyHandler ImagePropertyHandler - { - get - { - if (_imagePropertyHandler == null) - { - Debug.Assert(SelectedImage != null, "No image selected!"); - _imagePropertyHandler = new ImageEditingPropertyHandler( - this, _createFileCallback, _imageDataContext ); - } - return _imagePropertyHandler ; - } - } - private ImageEditingPropertyHandler _imagePropertyHandler ; + public ImagePropertiesInfo ImagePropertiesInfo + { + get + { + return _imageInfo; + } + set + { + _imageInfo = value; - public ImagePropertiesInfo ImagePropertiesInfo - { - get - { - return _imageInfo; - } - set - { - _imageInfo = value; + //unsubscribe from change event while the image info is being updated. + foreach(ImageEditingTabPageControl tabPage in TabPages) + tabPage.ImagePropertyChanged -= new ImagePropertyEventHandler(tabPage_ImagePropertyChanged); + imagePropertyEditorControl1.ImagePropertyChanged -= new ImagePropertyEventHandler(tabPage_ImagePropertyChanged); - //unsubscribe from change event while the image info is being updated. - foreach(ImageEditingTabPageControl tabPage in TabPages) - tabPage.ImagePropertyChanged -= new ImagePropertyEventHandler(tabPage_ImagePropertyChanged); - imagePropertyEditorControl1.ImagePropertyChanged -= new ImagePropertyEventHandler(tabPage_ImagePropertyChanged); + ManageCommands(); - ManageCommands(); + foreach(ImageEditingTabPageControl tabPage in TabPages) + tabPage.ImageInfo = _imageInfo; - foreach(ImageEditingTabPageControl tabPage in TabPages) - tabPage.ImageInfo = _imageInfo; + imagePropertyEditorControl1.ImageInfo = _imageInfo; - imagePropertyEditorControl1.ImageInfo = _imageInfo; + //re-subscribe to change events so they can be rebroadcast + foreach(ImageEditingTabPageControl tabPage in TabPages) + tabPage.ImagePropertyChanged += new ImagePropertyEventHandler(tabPage_ImagePropertyChanged); + imagePropertyEditorControl1.ImagePropertyChanged += new ImagePropertyEventHandler(tabPage_ImagePropertyChanged); - //re-subscribe to change events so they can be rebroadcast - foreach(ImageEditingTabPageControl tabPage in TabPages) - tabPage.ImagePropertyChanged += new ImagePropertyEventHandler(tabPage_ImagePropertyChanged); - imagePropertyEditorControl1.ImagePropertyChanged += new ImagePropertyEventHandler(tabPage_ImagePropertyChanged); + imageEditingPropertyStatusbar1.SetImageStatus(_imageInfo.ImageSourceUri.ToString(), + _imageInfo.ImageSourceUri.IsFile ? ImageEditingPropertyStatusbar.IMAGE_TYPE.LOCAL_IMAGE : + ImageEditingPropertyStatusbar.IMAGE_TYPE.WEB_IMAGE + ); - imageEditingPropertyStatusbar1.SetImageStatus(_imageInfo.ImageSourceUri.ToString(), - _imageInfo.ImageSourceUri.IsFile ? ImageEditingPropertyStatusbar.IMAGE_TYPE.LOCAL_IMAGE : - ImageEditingPropertyStatusbar.IMAGE_TYPE.WEB_IMAGE - ); + } + } + private ImagePropertiesInfo _imageInfo; - } - } - private ImagePropertiesInfo _imageInfo; + /// + /// Manages the commands assocatiated with image editing. + /// + private void ManageCommands() + { + if(_imageDataContext != null) + { + for(int i=0; i<_imageDataContext.DecoratorsManager.ImageDecoratorGroups.Length; i++) + { + ImageDecoratorGroup imageDecoratorGroup = _imageDataContext.DecoratorsManager.ImageDecoratorGroups[i]; + foreach(ImageDecorator imageDecorator in imageDecoratorGroup.ImageDecorators) + { + if(_imageInfo == null || _imageInfo.ImageSourceUri.IsFile || imageDecorator.IsWebImageSupported) + imageDecorator.Command.Enabled = true; + else + imageDecorator.Command.Enabled = false; + } + } + } + } - /// - /// Manages the commands assocatiated with image editing. - /// - private void ManageCommands() - { - if(_imageDataContext != null) - { - for(int i=0; i<_imageDataContext.DecoratorsManager.ImageDecoratorGroups.Length; i++) - { - ImageDecoratorGroup imageDecoratorGroup = _imageDataContext.DecoratorsManager.ImageDecoratorGroups[i]; - foreach(ImageDecorator imageDecorator in imageDecoratorGroup.ImageDecorators) - { - if(_imageInfo == null || _imageInfo.ImageSourceUri.IsFile || imageDecorator.IsWebImageSupported) - imageDecorator.Command.Enabled = true; - else - imageDecorator.Command.Enabled = false; - } - } - } - } + /// + /// Forces a reload of the image's properties. This is useful for refreshing the form when the image + /// properties have been changed externally. + /// + public void RefreshImage() + { + // update selected image (null if none is selected) + _selectedImage = _editorContext.SelectedImage ; - /// - /// Forces a reload of the image's properties. This is useful for refreshing the form when the image - /// properties have been changed externally. - /// - public void RefreshImage() - { - // update selected image (null if none is selected) - _selectedImage = _editorContext.SelectedImage ; + // update display + EditContextActivated = SelectionIsImage ; + } - // update display - EditContextActivated = SelectionIsImage ; - } + public event EventHandler SaveDefaultsRequested + { + add + { + imagePropertyEditorControl1.SaveDefaultsRequested += value; + } + remove + { + imagePropertyEditorControl1.SaveDefaultsRequested -= value; + } + } + public event EventHandler ResetToDefaultsRequested + { + add + { + imagePropertyEditorControl1.ResetToDefaultsRequested += value; + } + remove + { + imagePropertyEditorControl1.ResetToDefaultsRequested -= value; + } + } - public event EventHandler SaveDefaultsRequested - { - add - { - imagePropertyEditorControl1.SaveDefaultsRequested += value; - } - remove - { - imagePropertyEditorControl1.SaveDefaultsRequested -= value; - } - } - public event EventHandler ResetToDefaultsRequested - { - add - { - imagePropertyEditorControl1.ResetToDefaultsRequested += value; - } - remove - { - imagePropertyEditorControl1.ResetToDefaultsRequested -= value; - } - } + public event ImagePropertyEventHandler ImagePropertyChanged; + protected virtual void OnImagePropertyChanged(ImagePropertyEvent evt) + { + if(ImagePropertyChanged != null) + { + ImagePropertyChanged(this, evt); + } - public event ImagePropertyEventHandler ImagePropertyChanged; - protected virtual void OnImagePropertyChanged(ImagePropertyEvent evt) - { - if(ImagePropertyChanged != null) - { - ImagePropertyChanged(this, evt); - } + //notify the tabs that the image properties have changed so that they can update themselves. + foreach(ImageEditingTabPageControl tabPage in TabPages) + { + tabPage.HandleImagePropertyChangedEvent(evt); + } + } - //notify the tabs that the image properties have changed so that they can update themselves. - foreach(ImageEditingTabPageControl tabPage in TabPages) - { - tabPage.HandleImagePropertyChangedEvent(evt); - } - } + private void tabPage_ImagePropertyChanged(object source, ImagePropertyEvent evt) + { + OnImagePropertyChanged(evt); + } - private void tabPage_ImagePropertyChanged(object source, ImagePropertyEvent evt) - { - OnImagePropertyChanged(evt); - } + public void UpdateInlineImageSize(Size newSize, ImageDecoratorInvocationSource invocationSource) + { + if(!Visible) + { + //refresh the ImagePropertiesInfo object since it doesn't get refreshed automatically when + //the form is hidden. + ImagePropertyHandler.RefreshView(); + } - public void UpdateInlineImageSize(Size newSize, ImageDecoratorInvocationSource invocationSource) - { - if(!Visible) - { - //refresh the ImagePropertiesInfo object since it doesn't get refreshed automatically when - //the form is hidden. - ImagePropertyHandler.RefreshView(); - } + ImagePropertiesInfo.InlineImageSize = newSize; + ImagePropertyChanged(this, new ImagePropertyEvent(ImagePropertyType.InlineSize, ImagePropertiesInfo, invocationSource)); + RefreshImage(); + } - ImagePropertiesInfo.InlineImageSize = newSize; - ImagePropertyChanged(this, new ImagePropertyEvent(ImagePropertyType.InlineSize, ImagePropertiesInfo, invocationSource)); - RefreshImage(); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + #region Designer Generated Code - #region Designer Generated Code + private void InitializeComponent() + { + this.imagePropertyEditorControl1 = new Onfolio.Writer.PostEditor.PostHtmlEditing.ImagePropertyEditorControl(); + this.imageEditingPropertyStatusbar1 = new Onfolio.Writer.PostEditor.PostHtmlEditing.ImageEditingPropertyStatusbar(); + ((System.ComponentModel.ISupportInitialize)(this.imagePropertyEditorControl1)).BeginInit(); + this.SuspendLayout(); + // + // imagePropertyEditorControl1 + // + this.imagePropertyEditorControl1.AllowDragDropAutoScroll = false; + this.imagePropertyEditorControl1.AllPaintingInWmPaint = true; + this.imagePropertyEditorControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.imagePropertyEditorControl1.BackColor = System.Drawing.SystemColors.Control; + this.imagePropertyEditorControl1.ImageInfo = null; + this.imagePropertyEditorControl1.Location = new System.Drawing.Point(0, 0); + this.imagePropertyEditorControl1.Name = "imagePropertyEditorControl1"; + this.imagePropertyEditorControl1.Size = new System.Drawing.Size(236, 335); + this.imagePropertyEditorControl1.TabIndex = 0; + this.imagePropertyEditorControl1.TopLayoutMargin = 2; + // + // imageEditingPropertyStatusbar1 + // + this.imageEditingPropertyStatusbar1.Dock = System.Windows.Forms.DockStyle.Bottom; + this.imageEditingPropertyStatusbar1.Location = new System.Drawing.Point(0, 334); + this.imageEditingPropertyStatusbar1.Name = "imageEditingPropertyStatusbar1"; + this.imageEditingPropertyStatusbar1.Size = new System.Drawing.Size(236, 24); + this.imageEditingPropertyStatusbar1.TabIndex = 1; + this.imageEditingPropertyStatusbar1.TabStop = false; + // + // ImageEditingPropertyForm + // + this.AutoScaleBaseSize = new System.Drawing.Size(5, 14); + this.ClientSize = new System.Drawing.Size(236, 358); + this.Controls.Add(this.imageEditingPropertyStatusbar1); + this.Controls.Add(this.imagePropertyEditorControl1); + this.Name = "ImageEditingPropertyForm"; + this.Text = "Image Properties"; + ((System.ComponentModel.ISupportInitialize)(this.imagePropertyEditorControl1)).EndInit(); + this.ResumeLayout(false); - private void InitializeComponent() - { - this.imagePropertyEditorControl1 = new Onfolio.Writer.PostEditor.PostHtmlEditing.ImagePropertyEditorControl(); - this.imageEditingPropertyStatusbar1 = new Onfolio.Writer.PostEditor.PostHtmlEditing.ImageEditingPropertyStatusbar(); - ((System.ComponentModel.ISupportInitialize)(this.imagePropertyEditorControl1)).BeginInit(); - this.SuspendLayout(); - // - // imagePropertyEditorControl1 - // - this.imagePropertyEditorControl1.AllowDragDropAutoScroll = false; - this.imagePropertyEditorControl1.AllPaintingInWmPaint = true; - this.imagePropertyEditorControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.imagePropertyEditorControl1.BackColor = System.Drawing.SystemColors.Control; - this.imagePropertyEditorControl1.ImageInfo = null; - this.imagePropertyEditorControl1.Location = new System.Drawing.Point(0, 0); - this.imagePropertyEditorControl1.Name = "imagePropertyEditorControl1"; - this.imagePropertyEditorControl1.Size = new System.Drawing.Size(236, 335); - this.imagePropertyEditorControl1.TabIndex = 0; - this.imagePropertyEditorControl1.TopLayoutMargin = 2; - // - // imageEditingPropertyStatusbar1 - // - this.imageEditingPropertyStatusbar1.Dock = System.Windows.Forms.DockStyle.Bottom; - this.imageEditingPropertyStatusbar1.Location = new System.Drawing.Point(0, 334); - this.imageEditingPropertyStatusbar1.Name = "imageEditingPropertyStatusbar1"; - this.imageEditingPropertyStatusbar1.Size = new System.Drawing.Size(236, 24); - this.imageEditingPropertyStatusbar1.TabIndex = 1; - this.imageEditingPropertyStatusbar1.TabStop = false; - // - // ImageEditingPropertyForm - // - this.AutoScaleBaseSize = new System.Drawing.Size(5, 14); - this.ClientSize = new System.Drawing.Size(236, 358); - this.Controls.Add(this.imageEditingPropertyStatusbar1); - this.Controls.Add(this.imagePropertyEditorControl1); - this.Name = "ImageEditingPropertyForm"; - this.Text = "Image Properties"; - ((System.ComponentModel.ISupportInitialize)(this.imagePropertyEditorControl1)).EndInit(); - this.ResumeLayout(false); + } - } - - #endregion - } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ImageEditing/ImageEditingPropertyHandler.cs b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ImageEditing/ImageEditingPropertyHandler.cs index 1e11a64c..6fad3cc3 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ImageEditing/ImageEditingPropertyHandler.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ImageEditing/ImageEditingPropertyHandler.cs @@ -135,7 +135,6 @@ namespace OpenLiveWriter.PostEditor.PostHtmlEditing return info; } - private IHTMLElement ImgElement { get diff --git a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ImageEditing/ImageEditingPropertySidebar.cs b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ImageEditing/ImageEditingPropertySidebar.cs index 7465b2a1..88cd5478 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ImageEditing/ImageEditingPropertySidebar.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ImageEditing/ImageEditingPropertySidebar.cs @@ -14,379 +14,373 @@ using OpenLiveWriter.CoreServices; namespace OpenLiveWriter.PostEditor.PostHtmlEditing { - public class ImageEditingPropertySidebar : Panel, IImagePropertyEditingContext - { - /// - /// Required designer variable. - /// - private Container components = new Container(); + public class ImageEditingPropertySidebar : Panel, IImagePropertyEditingContext + { + /// + /// Required designer variable. + /// + private Container components = new Container(); - private IHtmlEditorComponentContext _editorContext ; - private IBlogPostImageDataContext _imageDataContext; - private ImageEditingPropertyTitlebar imageEditingPropertyTitlebar; - private ImagePropertyEditorControl imagePropertyEditorControl; - private ImageEditingPropertyStatusbar imageEditingPropertyStatusbar; - private CreateFileCallback _createFileCallback ; + private IHtmlEditorComponentContext _editorContext ; + private IBlogPostImageDataContext _imageDataContext; + private ImageEditingPropertyTitlebar imageEditingPropertyTitlebar; + private ImagePropertyEditorControl imagePropertyEditorControl; + private ImageEditingPropertyStatusbar imageEditingPropertyStatusbar; + private CreateFileCallback _createFileCallback ; - #region Initialization/Singleton + #region Initialization/Singleton - public static void Initialize(IHtmlEditorComponentContext editorContext, IBlogPostImageDataContext dataContext, CreateFileCallback callback) - { - // initialize one form per-thread - if ( _imagePropertySidebar == null ) - { - _imagePropertySidebar = new ImageEditingPropertySidebar() ; - _imagePropertySidebar.Init(editorContext, dataContext, callback); - } - } + public static void Initialize(IHtmlEditorComponentContext editorContext, IBlogPostImageDataContext dataContext, CreateFileCallback callback) + { + // initialize one form per-thread + if ( _imagePropertySidebar == null ) + { + _imagePropertySidebar = new ImageEditingPropertySidebar() ; + _imagePropertySidebar.Init(editorContext, dataContext, callback); + } + } - public static ImageEditingPropertySidebar Instance - { - get - { - return _imagePropertySidebar ; - } - } + public static ImageEditingPropertySidebar Instance + { + get + { + return _imagePropertySidebar ; + } + } - [ThreadStatic] - private static ImageEditingPropertySidebar _imagePropertySidebar ; + [ThreadStatic] + private static ImageEditingPropertySidebar _imagePropertySidebar ; - public ImageEditingPropertySidebar() - { - InitializeDockPadding() ; - InitializeControls(); - AdjustLayoutForLargeFonts() ; - } + public ImageEditingPropertySidebar() + { + InitializeDockPadding() ; + InitializeControls(); + AdjustLayoutForLargeFonts() ; + } - private void InitializeControls() - { - SuspendLayout() ; + private void InitializeControls() + { + SuspendLayout() ; - Size = new Size(236, 400) ; + Size = new Size(236, 400) ; - imageEditingPropertyTitlebar = new ImageEditingPropertyTitlebar(); - imageEditingPropertyTitlebar.Dock = DockStyle.Top; - imageEditingPropertyTitlebar.TabIndex = 0; - imageEditingPropertyTitlebar.TabStop = false; - imageEditingPropertyTitlebar.HideTitleBarClicked +=new EventHandler(imageEditingPropertyTitlebar_HideTitleBarClicked); + imageEditingPropertyTitlebar = new ImageEditingPropertyTitlebar(); + imageEditingPropertyTitlebar.Dock = DockStyle.Top; + imageEditingPropertyTitlebar.TabIndex = 0; + imageEditingPropertyTitlebar.TabStop = false; + imageEditingPropertyTitlebar.HideTitleBarClicked +=new EventHandler(imageEditingPropertyTitlebar_HideTitleBarClicked); - imagePropertyEditorControl = new ImagePropertyEditorControl(); - imagePropertyEditorControl.AllowDragDropAutoScroll = false; - imagePropertyEditorControl.AllPaintingInWmPaint = true; - imagePropertyEditorControl.Dock = DockStyle.Fill ; - imagePropertyEditorControl.ImageInfo = null; - imagePropertyEditorControl.Location = new Point(0, 25); - imagePropertyEditorControl.Size = new Size(236, 335); - imagePropertyEditorControl.TabIndex = 1; - imagePropertyEditorControl.TopLayoutMargin = 2; + imagePropertyEditorControl = new ImagePropertyEditorControl(); + imagePropertyEditorControl.AllowDragDropAutoScroll = false; + imagePropertyEditorControl.AllPaintingInWmPaint = true; + imagePropertyEditorControl.Dock = DockStyle.Fill ; + imagePropertyEditorControl.ImageInfo = null; + imagePropertyEditorControl.Location = new Point(0, 25); + imagePropertyEditorControl.Size = new Size(236, 335); + imagePropertyEditorControl.TabIndex = 1; + imagePropertyEditorControl.TopLayoutMargin = 2; - imageEditingPropertyStatusbar = new ImageEditingPropertyStatusbar(); - imageEditingPropertyStatusbar.Dock = DockStyle.Bottom; - imageEditingPropertyStatusbar.Size = new Size(236, 24); - imageEditingPropertyStatusbar.TabIndex = 2; - imageEditingPropertyStatusbar.TabStop = false; + imageEditingPropertyStatusbar = new ImageEditingPropertyStatusbar(); + imageEditingPropertyStatusbar.Dock = DockStyle.Bottom; + imageEditingPropertyStatusbar.Size = new Size(236, 24); + imageEditingPropertyStatusbar.TabIndex = 2; + imageEditingPropertyStatusbar.TabStop = false; - Controls.Add(imagePropertyEditorControl); - Controls.Add(imageEditingPropertyTitlebar); - Controls.Add(imageEditingPropertyStatusbar); + Controls.Add(imagePropertyEditorControl); + Controls.Add(imageEditingPropertyTitlebar); + Controls.Add(imageEditingPropertyStatusbar); - ResumeLayout(false); - } + ResumeLayout(false); + } + #endregion - #endregion + #region Public Interface - #region Public Interface + /// + /// Make the form visible / update its appearance based on current selection + /// + public void ShowSidebar() + { + // refresh the view + RefreshImage(); - /// - /// Make the form visible / update its appearance based on current selection - /// - public void ShowSidebar() - { - // refresh the view - RefreshImage(); + // manage UI + ManageVisibilityOfEditingUI() ; - // manage UI - ManageVisibilityOfEditingUI() ; + if ( !Visible ) + { + // show the form + Show() ; + } + } - if ( !Visible ) - { - // show the form - Show() ; - } - } + private void _editorContext_SelectionChanged(object sender, EventArgs e) + { + RefreshImage(); - private void _editorContext_SelectionChanged(object sender, EventArgs e) - { - RefreshImage(); + // manage UI + ManageVisibilityOfEditingUI() ; + } - // manage UI - ManageVisibilityOfEditingUI() ; - } + private void ManageVisibilityOfEditingUI() + { + // show/hide property UI as appropriate + SuspendLayout() ; + imagePropertyEditorControl.Visible = SelectionIsImage ; + imageEditingPropertyStatusbar.Visible = SelectionIsImage ; + ResumeLayout(true) ; + } - private void ManageVisibilityOfEditingUI() - { - // show/hide property UI as appropriate - SuspendLayout() ; - imagePropertyEditorControl.Visible = SelectionIsImage ; - imageEditingPropertyStatusbar.Visible = SelectionIsImage ; - ResumeLayout(true) ; - } + public void HideSidebar() + { + Visible = false ; + } + + private void imageEditingPropertyTitlebar_HideTitleBarClicked(object sender, EventArgs e) + { + HideSidebar() ; + } + + #endregion + + private void Init(IHtmlEditorComponentContext editorContext, IBlogPostImageDataContext dataContext, CreateFileCallback callback) + { + _editorContext = editorContext ; + _editorContext.SelectionChanged +=new EventHandler(_editorContext_SelectionChanged); + _imageDataContext = dataContext; + + _createFileCallback = callback ; + + this.imagePropertyEditorControl.Init(dataContext); + } + + private ImageEditingTabPageControl[] TabPages + { + get + { + return this.imagePropertyEditorControl.TabPages; + } + } - public void HideSidebar() - { - Visible = false ; - } + IHTMLImgElement IImagePropertyEditingContext.SelectedImage + { + get { return _selectedImage; } + } + private IHTMLImgElement _selectedImage ; - private void imageEditingPropertyTitlebar_HideTitleBarClicked(object sender, EventArgs e) - { - HideSidebar() ; - } + private bool SelectionIsImage + { + get + { + return _selectedImage != null ; + } + } - #endregion + private ImageEditingPropertyHandler ImagePropertyHandler + { + get + { + if (_imagePropertyHandler == null) + { + Debug.Assert(_selectedImage != null, "No image selected!"); + _imagePropertyHandler = new ImageEditingPropertyHandler( + this, _createFileCallback, _imageDataContext ); + } + return _imagePropertyHandler ; + } + } + private ImageEditingPropertyHandler _imagePropertyHandler ; - private void Init(IHtmlEditorComponentContext editorContext, IBlogPostImageDataContext dataContext, CreateFileCallback callback) - { - _editorContext = editorContext ; - _editorContext.SelectionChanged +=new EventHandler(_editorContext_SelectionChanged); - _imageDataContext = dataContext; + public ImagePropertiesInfo ImagePropertiesInfo + { + get + { + return _imageInfo; + } + set + { + _imageInfo = value; - _createFileCallback = callback ; + //unsubscribe from change event while the image info is being updated. + foreach(ImageEditingTabPageControl tabPage in TabPages) + tabPage.ImagePropertyChanged -= new ImagePropertyEventHandler(tabPage_ImagePropertyChanged); + imagePropertyEditorControl.ImagePropertyChanged -= new ImagePropertyEventHandler(tabPage_ImagePropertyChanged); - this.imagePropertyEditorControl.Init(dataContext); - } + ManageCommands(); + foreach(ImageEditingTabPageControl tabPage in TabPages) + tabPage.ImageInfo = _imageInfo; - private ImageEditingTabPageControl[] TabPages - { - get - { - return this.imagePropertyEditorControl.TabPages; - } - } + imagePropertyEditorControl.ImageInfo = _imageInfo; + //re-subscribe to change events so they can be rebroadcast + foreach(ImageEditingTabPageControl tabPage in TabPages) + tabPage.ImagePropertyChanged += new ImagePropertyEventHandler(tabPage_ImagePropertyChanged); + imagePropertyEditorControl.ImagePropertyChanged += new ImagePropertyEventHandler(tabPage_ImagePropertyChanged); + imageEditingPropertyStatusbar.SetImageStatus(_imageInfo.ImageSourceUri.ToString(), + _imageInfo.ImageSourceUri.IsFile ? ImageEditingPropertyStatusbar.IMAGE_TYPE.LOCAL_IMAGE : + ImageEditingPropertyStatusbar.IMAGE_TYPE.WEB_IMAGE + ); + } + } + private ImagePropertiesInfo _imageInfo; - IHTMLImgElement IImagePropertyEditingContext.SelectedImage - { - get { return _selectedImage; } - } - private IHTMLImgElement _selectedImage ; + /// + /// Manages the commands assocatiated with image editing. + /// + private void ManageCommands() + { + if(_imageDataContext != null) + { + for(int i=0; i<_imageDataContext.DecoratorsManager.ImageDecoratorGroups.Length; i++) + { + ImageDecoratorGroup imageDecoratorGroup = _imageDataContext.DecoratorsManager.ImageDecoratorGroups[i]; + foreach(ImageDecorator imageDecorator in imageDecoratorGroup.ImageDecorators) + { + if(_imageInfo == null || _imageInfo.ImageSourceUri.IsFile || imageDecorator.IsWebImageSupported) + imageDecorator.Command.Enabled = true; + else + imageDecorator.Command.Enabled = false; + } + } + } + } - private bool SelectionIsImage - { - get - { - return _selectedImage != null ; - } - } + /// + /// Forces a reload of the image's properties. This is useful for refreshing the form when the image + /// properties have been changed externally. + /// + private void RefreshImage() + { + // update selected image (null if none is selected) + _selectedImage = _editorContext.SelectedImage ; - private ImageEditingPropertyHandler ImagePropertyHandler - { - get - { - if (_imagePropertyHandler == null) - { - Debug.Assert(_selectedImage != null, "No image selected!"); - _imagePropertyHandler = new ImageEditingPropertyHandler( - this, _createFileCallback, _imageDataContext ); - } - return _imagePropertyHandler ; - } - } - private ImageEditingPropertyHandler _imagePropertyHandler ; + // refresh the view + if ( SelectionIsImage ) + ImagePropertyHandler.RefreshView(); + } - public ImagePropertiesInfo ImagePropertiesInfo - { - get - { - return _imageInfo; - } - set - { - _imageInfo = value; + public event EventHandler SaveDefaultsRequested + { + add + { + imagePropertyEditorControl.SaveDefaultsRequested += value; + } + remove + { + imagePropertyEditorControl.SaveDefaultsRequested -= value; + } + } + public event EventHandler ResetToDefaultsRequested + { + add + { + imagePropertyEditorControl.ResetToDefaultsRequested += value; + } + remove + { + imagePropertyEditorControl.ResetToDefaultsRequested -= value; + } + } - //unsubscribe from change event while the image info is being updated. - foreach(ImageEditingTabPageControl tabPage in TabPages) - tabPage.ImagePropertyChanged -= new ImagePropertyEventHandler(tabPage_ImagePropertyChanged); - imagePropertyEditorControl.ImagePropertyChanged -= new ImagePropertyEventHandler(tabPage_ImagePropertyChanged); + public event ImagePropertyEventHandler ImagePropertyChanged; + protected virtual void OnImagePropertyChanged(ImagePropertyEvent evt) + { + if(ImagePropertyChanged != null) + { + ImagePropertyChanged(this, evt); + } - ManageCommands(); + //notify the tabs that the image properties have changed so that they can update themselves. + foreach(ImageEditingTabPageControl tabPage in TabPages) + { + tabPage.HandleImagePropertyChangedEvent(evt); + } + } - foreach(ImageEditingTabPageControl tabPage in TabPages) - tabPage.ImageInfo = _imageInfo; + private void tabPage_ImagePropertyChanged(object source, ImagePropertyEvent evt) + { + OnImagePropertyChanged(evt); + } - imagePropertyEditorControl.ImageInfo = _imageInfo; + public void UpdateInlineImageSize(Size newSize, ImageDecoratorInvocationSource invocationSource) + { + ImagePropertiesInfo imagePropertiesInfo = (this as IImagePropertyEditingContext).ImagePropertiesInfo ; + imagePropertiesInfo.InlineImageSize = newSize; + ImagePropertyChanged(this, new ImagePropertyEvent(ImagePropertyType.InlineSize, imagePropertiesInfo, invocationSource)); + RefreshImage(); + } - //re-subscribe to change events so they can be rebroadcast - foreach(ImageEditingTabPageControl tabPage in TabPages) - tabPage.ImagePropertyChanged += new ImagePropertyEventHandler(tabPage_ImagePropertyChanged); - imagePropertyEditorControl.ImagePropertyChanged += new ImagePropertyEventHandler(tabPage_ImagePropertyChanged); + private const int TOP_INSET = 1 ; + private const int LEFT_INSET = 5 ; + private const int RIGHT_INSET = 1 ; + private const int BOTTOM_INSET = 1 ; - imageEditingPropertyStatusbar.SetImageStatus(_imageInfo.ImageSourceUri.ToString(), - _imageInfo.ImageSourceUri.IsFile ? ImageEditingPropertyStatusbar.IMAGE_TYPE.LOCAL_IMAGE : - ImageEditingPropertyStatusbar.IMAGE_TYPE.WEB_IMAGE - ); + private void InitializeDockPadding() + { + DockPadding.Top = TOP_INSET ; + DockPadding.Left = LEFT_INSET ; + DockPadding.Right = RIGHT_INSET ; + DockPadding.Bottom = BOTTOM_INSET ; + } - } - } - private ImagePropertiesInfo _imageInfo; + protected override void OnPaint(PaintEventArgs e) + { + base.OnPaint (e); - /// - /// Manages the commands assocatiated with image editing. - /// - private void ManageCommands() - { - if(_imageDataContext != null) - { - for(int i=0; i<_imageDataContext.DecoratorsManager.ImageDecoratorGroups.Length; i++) - { - ImageDecoratorGroup imageDecoratorGroup = _imageDataContext.DecoratorsManager.ImageDecoratorGroups[i]; - foreach(ImageDecorator imageDecorator in imageDecoratorGroup.ImageDecorators) - { - if(_imageInfo == null || _imageInfo.ImageSourceUri.IsFile || imageDecorator.IsWebImageSupported) - imageDecorator.Command.Enabled = true; - else - imageDecorator.Command.Enabled = false; - } - } - } - } + // draw the border + Rectangle borderRectangle = new Rectangle( + ClientRectangle.Left + LEFT_INSET - 1, + ClientRectangle.Top + TOP_INSET - 1, + ClientRectangle.Width - LEFT_INSET - RIGHT_INSET + 1, + ClientRectangle.Height - TOP_INSET - BOTTOM_INSET + 1) ; + using ( Pen pen = new Pen(ApplicationManager.ApplicationStyle.PrimaryWorkspaceCommandBarBottomBevelFirstLineColor) ) + e.Graphics.DrawRectangle( pen, borderRectangle ) ; - /// - /// Forces a reload of the image's properties. This is useful for refreshing the form when the image - /// properties have been changed externally. - /// - private void RefreshImage() - { - // update selected image (null if none is selected) - _selectedImage = _editorContext.SelectedImage ; + // draw the no image selected message + Font textFont = ApplicationManager.ApplicationStyle.NormalApplicationFont ; + string noImageSelected = "No image selected" ; + SizeF textSize = e.Graphics.MeasureString(noImageSelected, textFont) ; + Color textColor = Color.FromArgb(200, ApplicationManager.ApplicationStyle.PrimaryWorkspaceCommandBarTextColor); + using ( Brush brush = new SolidBrush(textColor) ) + e.Graphics.DrawString( "No image selected", textFont, brush, new PointF((Width/2)-(textSize.Width/2),100)); + } - // refresh the view - if ( SelectionIsImage ) - ImagePropertyHandler.RefreshView(); - } + private void AdjustLayoutForLargeFonts() + { + // see if we need to adjust our width for non-standard DPI (large fonts) + const double DESIGNTIME_DPI = 96 ; + double dpiX = Convert.ToDouble(DisplayHelper.PixelsPerLogicalInchX) ; + if ( dpiX > DESIGNTIME_DPI ) + { + // adjust scale ration for percentage of toolbar containing text + const double TEXT_PERCENT = 0.0 ; // currently has no text + double scaleRatio = (1-TEXT_PERCENT) + ((TEXT_PERCENT*dpiX)/DESIGNTIME_DPI) ; - public event EventHandler SaveDefaultsRequested - { - add - { - imagePropertyEditorControl.SaveDefaultsRequested += value; - } - remove - { - imagePropertyEditorControl.SaveDefaultsRequested -= value; - } - } - public event EventHandler ResetToDefaultsRequested - { - add - { - imagePropertyEditorControl.ResetToDefaultsRequested += value; - } - remove - { - imagePropertyEditorControl.ResetToDefaultsRequested -= value; - } - } + // change width as appropriate + Width = Convert.ToInt32( Convert.ToDouble(Width) * scaleRatio ) ; + } + } - public event ImagePropertyEventHandler ImagePropertyChanged; - protected virtual void OnImagePropertyChanged(ImagePropertyEvent evt) - { - if(ImagePropertyChanged != null) - { - ImagePropertyChanged(this, evt); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - //notify the tabs that the image properties have changed so that they can update themselves. - foreach(ImageEditingTabPageControl tabPage in TabPages) - { - tabPage.HandleImagePropertyChangedEvent(evt); - } - } - - private void tabPage_ImagePropertyChanged(object source, ImagePropertyEvent evt) - { - OnImagePropertyChanged(evt); - } - - public void UpdateInlineImageSize(Size newSize, ImageDecoratorInvocationSource invocationSource) - { - ImagePropertiesInfo imagePropertiesInfo = (this as IImagePropertyEditingContext).ImagePropertiesInfo ; - imagePropertiesInfo.InlineImageSize = newSize; - ImagePropertyChanged(this, new ImagePropertyEvent(ImagePropertyType.InlineSize, imagePropertiesInfo, invocationSource)); - RefreshImage(); - } - - private const int TOP_INSET = 1 ; - private const int LEFT_INSET = 5 ; - private const int RIGHT_INSET = 1 ; - private const int BOTTOM_INSET = 1 ; - - private void InitializeDockPadding() - { - DockPadding.Top = TOP_INSET ; - DockPadding.Left = LEFT_INSET ; - DockPadding.Right = RIGHT_INSET ; - DockPadding.Bottom = BOTTOM_INSET ; - } - - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint (e); - - // draw the border - Rectangle borderRectangle = new Rectangle( - ClientRectangle.Left + LEFT_INSET - 1, - ClientRectangle.Top + TOP_INSET - 1, - ClientRectangle.Width - LEFT_INSET - RIGHT_INSET + 1, - ClientRectangle.Height - TOP_INSET - BOTTOM_INSET + 1) ; - using ( Pen pen = new Pen(ApplicationManager.ApplicationStyle.PrimaryWorkspaceCommandBarBottomBevelFirstLineColor) ) - e.Graphics.DrawRectangle( pen, borderRectangle ) ; - - // draw the no image selected message - Font textFont = ApplicationManager.ApplicationStyle.NormalApplicationFont ; - string noImageSelected = "No image selected" ; - SizeF textSize = e.Graphics.MeasureString(noImageSelected, textFont) ; - Color textColor = Color.FromArgb(200, ApplicationManager.ApplicationStyle.PrimaryWorkspaceCommandBarTextColor); - using ( Brush brush = new SolidBrush(textColor) ) - e.Graphics.DrawString( "No image selected", textFont, brush, new PointF((Width/2)-(textSize.Width/2),100)); - } - - private void AdjustLayoutForLargeFonts() - { - // see if we need to adjust our width for non-standard DPI (large fonts) - const double DESIGNTIME_DPI = 96 ; - double dpiX = Convert.ToDouble(DisplayHelper.PixelsPerLogicalInchX) ; - if ( dpiX > DESIGNTIME_DPI ) - { - // adjust scale ration for percentage of toolbar containing text - const double TEXT_PERCENT = 0.0 ; // currently has no text - double scaleRatio = (1-TEXT_PERCENT) + ((TEXT_PERCENT*dpiX)/DESIGNTIME_DPI) ; - - // change width as appropriate - Width = Convert.ToInt32( Convert.ToDouble(Width) * scaleRatio ) ; - } - } - - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } - - - } + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ImageEditing/ImageEditingPropertyStatusbar.cs b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ImageEditing/ImageEditingPropertyStatusbar.cs index c2d74df3..8b1569d6 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ImageEditing/ImageEditingPropertyStatusbar.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ImageEditing/ImageEditingPropertyStatusbar.cs @@ -12,144 +12,144 @@ using OpenLiveWriter.CoreServices; namespace OpenLiveWriter.PostEditor.PostHtmlEditing { - /// - /// Summary description for ImageEditingPropertyStatusbar. - /// - internal class ImageEditingPropertyStatusbar : UserControl - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for ImageEditingPropertyStatusbar. + /// + internal class ImageEditingPropertyStatusbar : UserControl + { + /// + /// Required designer variable. + /// + private Container components = null; - public ImageEditingPropertyStatusbar() - { - // This call is required by the Windows.Forms Form Designer. - InitializeComponent(); + public ImageEditingPropertyStatusbar() + { + // This call is required by the Windows.Forms Form Designer. + InitializeComponent(); - // enable double buffered painting. - SetStyle(ControlStyles.UserPaint, true); - SetStyle(ControlStyles.DoubleBuffer, true); - SetStyle(ControlStyles.AllPaintingInWmPaint, true); + // enable double buffered painting. + SetStyle(ControlStyles.UserPaint, true); + SetStyle(ControlStyles.DoubleBuffer, true); + SetStyle(ControlStyles.AllPaintingInWmPaint, true); - // set height - Height = SystemInformation.ToolWindowCaptionHeight ; + // set height + Height = SystemInformation.ToolWindowCaptionHeight ; - // does not accept tab - TabStop = false ; + // does not accept tab + TabStop = false ; - _stringFormat = new StringFormat(StringFormatFlags.NoWrap); - _stringFormat.Trimming = StringTrimming.EllipsisPath; + _stringFormat = new StringFormat(StringFormatFlags.NoWrap); + _stringFormat.Trimming = StringTrimming.EllipsisPath; - // set the background color - //BackColor = ApplicationManager.ApplicationStyle.ActiveTabTopColor ; - ApplicationStyleManager.ApplicationStyleChanged += new EventHandler(ApplicationManager_ApplicationStyleChanged); - } + // set the background color + //BackColor = ApplicationManager.ApplicationStyle.ActiveTabTopColor ; + ApplicationStyleManager.ApplicationStyleChanged += new EventHandler(ApplicationManager_ApplicationStyleChanged); + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - components = new System.ComponentModel.Container(); - } - #endregion + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + } + #endregion - internal enum IMAGE_TYPE { LOCAL_IMAGE, WEB_IMAGE }; - public void SetImageStatus(string imagePath, IMAGE_TYPE imageType) - { - imagePath = Path.GetFileName(imagePath.Replace("/", "\\")); - _statusText = String.Format("{0}: {1}", imageType == IMAGE_TYPE.LOCAL_IMAGE ? "Local image": "Web image", imagePath); - PerformLayout(); - Invalidate(); - } + internal enum IMAGE_TYPE { LOCAL_IMAGE, WEB_IMAGE }; + public void SetImageStatus(string imagePath, IMAGE_TYPE imageType) + { + imagePath = Path.GetFileName(imagePath.Replace("/", "\\")); + _statusText = String.Format("{0}: {1}", imageType == IMAGE_TYPE.LOCAL_IMAGE ? "Local image": "Web image", imagePath); + PerformLayout(); + Invalidate(); + } - protected override void OnLayout(LayoutEventArgs levent) - { - base.OnLayout (levent); + protected override void OnLayout(LayoutEventArgs levent) + { + base.OnLayout (levent); - // calculate the rectangle we will paint within - _controlRectangle = new Rectangle(0,0,Width, Height) ; + // calculate the rectangle we will paint within + _controlRectangle = new Rectangle(0,0,Width, Height) ; - _image = localImage; - int IMAGE_TOP_OFFSET = TOP_OFFSET ; - int IMAGE_LEFT_OFFSET = TOP_OFFSET ; - _imageRectangle = new Rectangle(IMAGE_LEFT_OFFSET, IMAGE_TOP_OFFSET, _image.Width, _image.Height ); + _image = localImage; + int IMAGE_TOP_OFFSET = TOP_OFFSET ; + int IMAGE_LEFT_OFFSET = TOP_OFFSET ; + _imageRectangle = new Rectangle(IMAGE_LEFT_OFFSET, IMAGE_TOP_OFFSET, _image.Width, _image.Height ); - //calculate the text rectangle - int TEXT_TOP_OFFSET = TOP_OFFSET+2 ; - int TEXT_LEFT_MARGIN = 0 ; - int TEXT_LEFT_OFFSET = _imageRectangle.Right + TEXT_LEFT_MARGIN ; + //calculate the text rectangle + int TEXT_TOP_OFFSET = TOP_OFFSET+2 ; + int TEXT_LEFT_MARGIN = 0 ; + int TEXT_LEFT_OFFSET = _imageRectangle.Right + TEXT_LEFT_MARGIN ; - _textRectangle = new Rectangle(TEXT_LEFT_OFFSET, TEXT_TOP_OFFSET, _controlRectangle.Width-TEXT_LEFT_OFFSET,_controlRectangle.Height-TEXT_TOP_OFFSET); + _textRectangle = new Rectangle(TEXT_LEFT_OFFSET, TEXT_TOP_OFFSET, _controlRectangle.Width-TEXT_LEFT_OFFSET,_controlRectangle.Height-TEXT_TOP_OFFSET); - // make sure the control is repainted - Invalidate() ; - } + // make sure the control is repainted + Invalidate() ; + } - protected override void OnPaint(PaintEventArgs e) - { + protected override void OnPaint(PaintEventArgs e) + { - Color backgroundColor = ApplicationManager.ApplicationStyle.ActiveTabBottomColor ; - using ( Brush brush = new SolidBrush(backgroundColor) ) - e.Graphics.FillRectangle( brush, _controlRectangle ) ; + Color backgroundColor = ApplicationManager.ApplicationStyle.ActiveTabBottomColor ; + using ( Brush brush = new SolidBrush(backgroundColor) ) + e.Graphics.FillRectangle( brush, _controlRectangle ) ; - // draw the border - using ( Pen pen = new Pen(ApplicationManager.ApplicationStyle.PrimaryWorkspaceCommandBarBottomBevelFirstLineColor) ) - { - e.Graphics.DrawLine(pen, _controlRectangle.Left, _controlRectangle.Top, _controlRectangle.Width, _controlRectangle.Top); - e.Graphics.DrawLine(pen, _controlRectangle.Left, _controlRectangle.Bottom, _controlRectangle.Width, _controlRectangle.Bottom); - //e.Graphics.DrawRectangle( pen, _controlRectangle ) ; - } + // draw the border + using ( Pen pen = new Pen(ApplicationManager.ApplicationStyle.PrimaryWorkspaceCommandBarBottomBevelFirstLineColor) ) + { + e.Graphics.DrawLine(pen, _controlRectangle.Left, _controlRectangle.Top, _controlRectangle.Width, _controlRectangle.Top); + e.Graphics.DrawLine(pen, _controlRectangle.Left, _controlRectangle.Bottom, _controlRectangle.Width, _controlRectangle.Bottom); + //e.Graphics.DrawRectangle( pen, _controlRectangle ) ; + } - // draw the image - e.Graphics.DrawImage( _image, _imageRectangle.Left, _imageRectangle.Top ) ; + // draw the image + e.Graphics.DrawImage( _image, _imageRectangle.Left, _imageRectangle.Top ) ; - // draw the text - using ( Brush brush = new SolidBrush(ApplicationManager.ApplicationStyle.PrimaryWorkspaceCommandBarTextColor) ) - e.Graphics.DrawString( _statusText ,ApplicationManager.ApplicationStyle.NormalApplicationFont, brush, - new RectangleF(_textRectangle.X, _textRectangle.Y, _textRectangle.Width, _textRectangle.Height), - _stringFormat); - } - private string _statusText = "Local image: "; - private StringFormat _stringFormat; - private Rectangle _controlRectangle ; - private Rectangle _imageRectangle ; - private Rectangle _textRectangle ; - private Image _image; - private static readonly int TOP_OFFSET = SatelliteApplicationForm.WorkspaceInset; + // draw the text + using ( Brush brush = new SolidBrush(ApplicationManager.ApplicationStyle.PrimaryWorkspaceCommandBarTextColor) ) + e.Graphics.DrawString( _statusText ,ApplicationManager.ApplicationStyle.NormalApplicationFont, brush, + new RectangleF(_textRectangle.X, _textRectangle.Y, _textRectangle.Width, _textRectangle.Height), + _stringFormat); + } + private string _statusText = "Local image: "; + private StringFormat _stringFormat; + private Rectangle _controlRectangle ; + private Rectangle _imageRectangle ; + private Rectangle _textRectangle ; + private Image _image; + private static readonly int TOP_OFFSET = SatelliteApplicationForm.WorkspaceInset; - //status bar image - private const string IMAGE_PATH = "PostHtmlEditing.ImageEditing.Images." ; - private Bitmap localImage = ResourceHelper.LoadAssemblyResourceBitmap( IMAGE_PATH + "LocalImage.png") ; - private Bitmap webImage = ResourceHelper.LoadAssemblyResourceBitmap( IMAGE_PATH + "WebImage.png") ; + //status bar image + private const string IMAGE_PATH = "PostHtmlEditing.ImageEditing.Images." ; + private Bitmap localImage = ResourceHelper.LoadAssemblyResourceBitmap( IMAGE_PATH + "LocalImage.png") ; + private Bitmap webImage = ResourceHelper.LoadAssemblyResourceBitmap( IMAGE_PATH + "WebImage.png") ; - private void UpdateAppearance() - { - PerformLayout(); - Invalidate(); - } + private void UpdateAppearance() + { + PerformLayout(); + Invalidate(); + } - private void ApplicationManager_ApplicationStyleChanged(object sender, EventArgs e) - { - UpdateAppearance(); - } - } + private void ApplicationManager_ApplicationStyleChanged(object sender, EventArgs e) + { + UpdateAppearance(); + } + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ImageEditing/ImageEditingPropertyTitlebar.cs b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ImageEditing/ImageEditingPropertyTitlebar.cs index 507bb595..c7c37fe5 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ImageEditing/ImageEditingPropertyTitlebar.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ImageEditing/ImageEditingPropertyTitlebar.cs @@ -12,145 +12,141 @@ using OpenLiveWriter.CoreServices; namespace OpenLiveWriter.PostEditor.PostHtmlEditing { - public class ImageEditingPropertyTitlebar : Panel - { - private const int TOP_INSET = 2; + public class ImageEditingPropertyTitlebar : Panel + { + private const int TOP_INSET = 2; - public ImageEditingPropertyTitlebar() - { - // enable double buffered painting. - SetStyle(ControlStyles.UserPaint, true); - SetStyle(ControlStyles.DoubleBuffer, true); - SetStyle(ControlStyles.AllPaintingInWmPaint, true); + public ImageEditingPropertyTitlebar() + { + // enable double buffered painting. + SetStyle(ControlStyles.UserPaint, true); + SetStyle(ControlStyles.DoubleBuffer, true); + SetStyle(ControlStyles.AllPaintingInWmPaint, true); - // set height based on system metrics - Height = SystemInformation.ToolWindowCaptionHeight ; + // set height based on system metrics + Height = SystemInformation.ToolWindowCaptionHeight ; - // initialize down button - closeButton = new BitmapButton() ; - closeButton.BitmapDisabled = closeButtonDisabled ; - closeButton.BitmapEnabled = closeButtonEnabled ; - closeButton.BitmapPushed = closeButtonPushed ; - closeButton.BitmapSelected = closeButtonSelected ; - closeButton.ButtonStyle = ButtonStyle.Bitmap ; - closeButton.ToolTip = "Hide Image Properties" ; - closeButton.Width = closeButtonEnabled.Width ; - closeButton.Height = closeButtonEnabled.Height; - closeButton.Top = TOP_INSET - 1; - closeButton.Left = Width - closeButton.Width - TOP_INSET ; - closeButton.Anchor = AnchorStyles.Top | AnchorStyles.Right ; - closeButton.Click +=new EventHandler(closeButton_Click); - Controls.Add(closeButton) ; + // initialize down button + closeButton = new BitmapButton() ; + closeButton.BitmapDisabled = closeButtonDisabled ; + closeButton.BitmapEnabled = closeButtonEnabled ; + closeButton.BitmapPushed = closeButtonPushed ; + closeButton.BitmapSelected = closeButtonSelected ; + closeButton.ButtonStyle = ButtonStyle.Bitmap ; + closeButton.ToolTip = "Hide Image Properties" ; + closeButton.Width = closeButtonEnabled.Width ; + closeButton.Height = closeButtonEnabled.Height; + closeButton.Top = TOP_INSET - 1; + closeButton.Left = Width - closeButton.Width - TOP_INSET ; + closeButton.Anchor = AnchorStyles.Top | AnchorStyles.Right ; + closeButton.Click +=new EventHandler(closeButton_Click); + Controls.Add(closeButton) ; - // manage appearance - ApplicationStyleManager.ApplicationStyleChanged += new EventHandler(ApplicationManager_ApplicationStyleChanged); - UpdateAppearance() ; - } + // manage appearance + ApplicationStyleManager.ApplicationStyleChanged += new EventHandler(ApplicationManager_ApplicationStyleChanged); + UpdateAppearance() ; + } - private void UpdateAppearance() - { - closeButton.BackColor = ApplicationManager.ApplicationStyle.PrimaryWorkspaceCommandBarBottomColor ; + private void UpdateAppearance() + { + closeButton.BackColor = ApplicationManager.ApplicationStyle.PrimaryWorkspaceCommandBarBottomColor ; - PerformLayout(); - Invalidate(); - } + PerformLayout(); + Invalidate(); + } - /* - protected override void OnPaintBackground(PaintEventArgs pevent) - { + /* + protected override void OnPaintBackground(PaintEventArgs pevent) + { - } - */ + } + */ + protected override void OnPaint(PaintEventArgs e) + { + base.OnPaint (e); - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint (e); + // draw the background + using ( Brush brush = new SolidBrush(ApplicationManager.ApplicationStyle.PrimaryWorkspaceCommandBarBottomColor) ) + e.Graphics.FillRectangle( brush, ClientRectangle ) ; - // draw the background - using ( Brush brush = new SolidBrush(ApplicationManager.ApplicationStyle.PrimaryWorkspaceCommandBarBottomColor) ) - e.Graphics.FillRectangle( brush, ClientRectangle ) ; + // draw the border + using ( Pen pen = new Pen(ApplicationManager.ApplicationStyle.PrimaryWorkspaceCommandBarBottomBevelFirstLineColor) ) + e.Graphics.DrawLine(pen, 0, Height-1, Width-1, Height-1); - // draw the border - using ( Pen pen = new Pen(ApplicationManager.ApplicationStyle.PrimaryWorkspaceCommandBarBottomBevelFirstLineColor) ) - e.Graphics.DrawLine(pen, 0, Height-1, Width-1, Height-1); + // draw the text + int TEXT_TOP_INSET = TOP_INSET ; + using ( Brush brush = new SolidBrush(ApplicationManager.ApplicationStyle.PrimaryWorkspaceCommandBarTextColor) ) + e.Graphics.DrawString( "Image Properties",ApplicationManager.ApplicationStyle.NormalApplicationFont, brush, new PointF(1,TEXT_TOP_INSET) ) ; - // draw the text - int TEXT_TOP_INSET = TOP_INSET ; - using ( Brush brush = new SolidBrush(ApplicationManager.ApplicationStyle.PrimaryWorkspaceCommandBarTextColor) ) - e.Graphics.DrawString( "Image Properties",ApplicationManager.ApplicationStyle.NormalApplicationFont, brush, new PointF(1,TEXT_TOP_INSET) ) ; + } - } + /// + /// Close event (indicates that the user has hit the close button and wants + /// the tray hidden) + /// + public event EventHandler HideTitleBarClicked ; + /// + /// Fires the Close event + /// + /// event args + protected virtual void OnHideTitleBarClicked( EventArgs ea ) + { + if ( HideTitleBarClicked != null ) + HideTitleBarClicked( this, ea ) ; + } - /// - /// Close event (indicates that the user has hit the close button and wants - /// the tray hidden) - /// - public event EventHandler HideTitleBarClicked ; + /// + /// Handle close button click event + /// + /// sender + /// event args + private void closeButton_Click(object sender, EventArgs e) + { + OnHideTitleBarClicked( EventArgs.Empty ) ; + } + /// + /// Handle appearance preference changes. + /// + /// + /// + private void ApplicationManager_ApplicationStyleChanged(object sender, EventArgs e) + { + UpdateAppearance() ; + } - /// - /// Fires the Close event - /// - /// event args - protected virtual void OnHideTitleBarClicked( EventArgs ea ) - { - if ( HideTitleBarClicked != null ) - HideTitleBarClicked( this, ea ) ; - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + ApplicationStyleManager.ApplicationStyleChanged -= new EventHandler(ApplicationManager_ApplicationStyleChanged); + } + base.Dispose( disposing ); + } - /// - /// Handle close button click event - /// - /// sender - /// event args - private void closeButton_Click(object sender, EventArgs e) - { - OnHideTitleBarClicked( EventArgs.Empty ) ; - } + // tray compontents + private BitmapButton closeButton ; - /// - /// Handle appearance preference changes. - /// - /// - /// - private void ApplicationManager_ApplicationStyleChanged(object sender, EventArgs e) - { - UpdateAppearance() ; - } + /// + /// Embedded components + /// + private Container components = new Container(); - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - ApplicationStyleManager.ApplicationStyleChanged -= new EventHandler(ApplicationManager_ApplicationStyleChanged); - } - base.Dispose( disposing ); - } - - - // tray compontents - private BitmapButton closeButton ; - - /// - /// Embedded components - /// - private Container components = new Container(); - - // close button images - private const string TRAY_IMAGE_PATH = "Images." ; - private Bitmap closeButtonDisabled = ResourceHelper.LoadAssemblyResourceBitmap( TRAY_IMAGE_PATH + "CloseButtonDisabled.png") ; - private Bitmap closeButtonEnabled = ResourceHelper.LoadAssemblyResourceBitmap( TRAY_IMAGE_PATH + "CloseButtonEnabled.png") ; - private Bitmap closeButtonPushed = ResourceHelper.LoadAssemblyResourceBitmap( TRAY_IMAGE_PATH + "CloseButtonPushed.png") ; - private Bitmap closeButtonSelected = ResourceHelper.LoadAssemblyResourceBitmap( TRAY_IMAGE_PATH + "CloseButtonSelected.png") ; - } + // close button images + private const string TRAY_IMAGE_PATH = "Images." ; + private Bitmap closeButtonDisabled = ResourceHelper.LoadAssemblyResourceBitmap( TRAY_IMAGE_PATH + "CloseButtonDisabled.png") ; + private Bitmap closeButtonEnabled = ResourceHelper.LoadAssemblyResourceBitmap( TRAY_IMAGE_PATH + "CloseButtonEnabled.png") ; + private Bitmap closeButtonPushed = ResourceHelper.LoadAssemblyResourceBitmap( TRAY_IMAGE_PATH + "CloseButtonPushed.png") ; + private Bitmap closeButtonSelected = ResourceHelper.LoadAssemblyResourceBitmap( TRAY_IMAGE_PATH + "CloseButtonSelected.png") ; + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ImageEditing/ImagePropertyEditorControl.cs b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ImageEditing/ImagePropertyEditorControl.cs index 4ae5c2af..8cdc0428 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ImageEditing/ImagePropertyEditorControl.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/ImageEditing/ImagePropertyEditorControl.cs @@ -14,282 +14,281 @@ using OpenLiveWriter.ApplicationFramework.ApplicationStyles; namespace OpenLiveWriter.PostEditor.PostHtmlEditing { - /// - /// Hosts the tab control for the image property editing form. - /// - public class ImagePropertyEditorControl : PrimaryWorkspaceControl - { - /// - /// Required designer variable. - /// - private Container components = null; - private PrimaryWorkspaceWorkspaceCommandBarLightweightControl commandBarLightweightControl; + /// + /// Hosts the tab control for the image property editing form. + /// + public class ImagePropertyEditorControl : PrimaryWorkspaceControl + { + /// + /// Required designer variable. + /// + private Container components = null; + private PrimaryWorkspaceWorkspaceCommandBarLightweightControl commandBarLightweightControl; - private TabLightweightControl tabLightweightControl; - private ImageTabPageImageControl imageTabPageImage; - private ImageTabPageLayoutControl imageTabPageLayout; - private ImageTabPageEffectsControl imageTabPageEffects; - private ImageTabPageUploadControl imageTabPageUpload; + private TabLightweightControl tabLightweightControl; + private ImageTabPageImageControl imageTabPageImage; + private ImageTabPageLayoutControl imageTabPageLayout; + private ImageTabPageEffectsControl imageTabPageEffects; + private ImageTabPageUploadControl imageTabPageUpload; - public ImagePropertyEditorControl() - { - // This call is required by the Windows.Forms Form Designer. - InitializeComponent(); + public ImagePropertyEditorControl() + { + // This call is required by the Windows.Forms Form Designer. + InitializeComponent(); - // configure look and behavior - AllowDragDropAutoScroll = false; - AllPaintingInWmPaint = true; - TopLayoutMargin = 2; + // configure look and behavior + AllowDragDropAutoScroll = false; + AllPaintingInWmPaint = true; + TopLayoutMargin = 2; - ApplicationStyleManager.ApplicationStyleChanged += new EventHandler(ApplicationManager_ApplicationStyleChanged); + ApplicationStyleManager.ApplicationStyleChanged += new EventHandler(ApplicationManager_ApplicationStyleChanged); - // initialize tab lightweight control - tabLightweightControl = new TabLightweightControl(this.components) ; - tabLightweightControl.DrawSideAndBottomTabPageBorders = false ; - tabLightweightControl.SmallTabs = true ; - } + // initialize tab lightweight control + tabLightweightControl = new TabLightweightControl(this.components) ; + tabLightweightControl.DrawSideAndBottomTabPageBorders = false ; + tabLightweightControl.SmallTabs = true ; + } - public void Init(IBlogPostImageDataContext dataContext) - { + public void Init(IBlogPostImageDataContext dataContext) + { - _imageDataContext = dataContext; - // initialization constants - const int TOP_INSET = 2; + _imageDataContext = dataContext; + // initialization constants + const int TOP_INSET = 2; - imageTabPageImage = new ImageTabPageImageControl() ; - imageTabPageLayout = new ImageTabPageLayoutControl() ; - imageTabPageEffects = new ImageTabPageEffectsControl() ; - imageTabPageUpload = new ImageTabPageUploadControl() ; + imageTabPageImage = new ImageTabPageImageControl() ; + imageTabPageLayout = new ImageTabPageLayoutControl() ; + imageTabPageEffects = new ImageTabPageEffectsControl() ; + imageTabPageUpload = new ImageTabPageUploadControl() ; - _tabPages = new ImageEditingTabPageControl[]{imageTabPageLayout, imageTabPageImage, imageTabPageEffects, imageTabPageUpload}; - for(int i=0; i<_tabPages.Length; i++) - { - ImageEditingTabPageControl tabPage = _tabPages[i]; - tabPage.DecoratorsManager = dataContext.DecoratorsManager; - tabPage.TabStop = false ; - tabPage.TabIndex = i ; - Controls.Add( tabPage ) ; - tabLightweightControl.SetTab( i, tabPage ) ; - } + _tabPages = new ImageEditingTabPageControl[]{imageTabPageLayout, imageTabPageImage, imageTabPageEffects, imageTabPageUpload}; + for(int i=0; i<_tabPages.Length; i++) + { + ImageEditingTabPageControl tabPage = _tabPages[i]; + tabPage.DecoratorsManager = dataContext.DecoratorsManager; + tabPage.TabStop = false ; + tabPage.TabIndex = i ; + Controls.Add( tabPage ) ; + tabLightweightControl.SetTab( i, tabPage ) ; + } - // initial appearance of editor - tabLightweightControl.SelectedTabNumber = 0 ; + // initial appearance of editor + tabLightweightControl.SelectedTabNumber = 0 ; - InitializeCommands(); - InitializeToolbar(); + InitializeCommands(); + InitializeToolbar(); - _imageDataContext.DecoratorsManager.GetImageDecorator(BrightnessDecorator.Id).Command.StateChanged += new EventHandler(Command_StateChanged); + _imageDataContext.DecoratorsManager.GetImageDecorator(BrightnessDecorator.Id).Command.StateChanged += new EventHandler(Command_StateChanged); - // configure primary workspace - // configure primary workspace - SuspendLayout() ; - TopLayoutMargin = TOP_INSET; - LeftColumn.UpperPane.LightweightControl = tabLightweightControl; - CenterColumn.Visible = false; - RightColumn.Visible = false; - ResumeLayout() ; - } - IBlogPostImageDataContext _imageDataContext; + // configure primary workspace + // configure primary workspace + SuspendLayout() ; + TopLayoutMargin = TOP_INSET; + LeftColumn.UpperPane.LightweightControl = tabLightweightControl; + CenterColumn.Visible = false; + RightColumn.Visible = false; + ResumeLayout() ; + } + IBlogPostImageDataContext _imageDataContext; + private void InitializeCommands() + { + commandContextManager = new CommandContextManager(ApplicationManager.CommandManager); + commandContextManager.BeginUpdate() ; - private void InitializeCommands() - { - commandContextManager = new CommandContextManager(ApplicationManager.CommandManager); - commandContextManager.BeginUpdate() ; + commandImageBrightness = new CommandImageBrightness(components) ; + commandImageBrightness.Tag = _imageDataContext.DecoratorsManager.GetImageDecorator(BrightnessDecorator.Id); + commandImageBrightness.Execute += new EventHandler(commandImageDecorator_Execute); + commandContextManager.AddCommand( commandImageBrightness, CommandContext.Normal) ; - commandImageBrightness = new CommandImageBrightness(components) ; - commandImageBrightness.Tag = _imageDataContext.DecoratorsManager.GetImageDecorator(BrightnessDecorator.Id); - commandImageBrightness.Execute += new EventHandler(commandImageDecorator_Execute); - commandContextManager.AddCommand( commandImageBrightness, CommandContext.Normal) ; + commandImageRotate = new CommandImageRotate(components) ; + commandImageRotate.Execute += new EventHandler(commandImageRotate_Execute); + commandContextManager.AddCommand( commandImageRotate, CommandContext.Normal) ; - commandImageRotate = new CommandImageRotate(components) ; - commandImageRotate.Execute += new EventHandler(commandImageRotate_Execute); - commandContextManager.AddCommand( commandImageRotate, CommandContext.Normal) ; + commandImageReset = new CommandImageReset(components) ; + commandImageReset.Execute += new EventHandler(commandImageReset_Execute); + commandContextManager.AddCommand( commandImageReset, CommandContext.Normal) ; - commandImageReset = new CommandImageReset(components) ; - commandImageReset.Execute += new EventHandler(commandImageReset_Execute); - commandContextManager.AddCommand( commandImageReset, CommandContext.Normal) ; + commandImageSaveDefaults = new CommandImageSaveDefaults(components) ; + commandImageSaveDefaults.Execute += new EventHandler(commandImageSaveDefaults_Execute); + commandContextManager.AddCommand( commandImageSaveDefaults, CommandContext.Normal) ; - commandImageSaveDefaults = new CommandImageSaveDefaults(components) ; - commandImageSaveDefaults.Execute += new EventHandler(commandImageSaveDefaults_Execute); - commandContextManager.AddCommand( commandImageSaveDefaults, CommandContext.Normal) ; + commandContextManager.EndUpdate() ; + } + CommandContextManager commandContextManager; + Command commandImageBrightness; + Command commandImageRotate; + Command commandImageReset; + Command commandImageSaveDefaults; - commandContextManager.EndUpdate() ; - } - CommandContextManager commandContextManager; - Command commandImageBrightness; - Command commandImageRotate; - Command commandImageReset; - Command commandImageSaveDefaults; + private void InitializeToolbar() + { + CommandBarButtonEntry commandBarButtonEntryImageBrightness = new CommandBarButtonEntry(components) ; + commandBarButtonEntryImageBrightness.CommandIdentifier = commandImageBrightness.Identifier ; - private void InitializeToolbar() - { - CommandBarButtonEntry commandBarButtonEntryImageBrightness = new CommandBarButtonEntry(components) ; - commandBarButtonEntryImageBrightness.CommandIdentifier = commandImageBrightness.Identifier ; + CommandBarButtonEntry commandBarButtonEntryImageRotate = new CommandBarButtonEntry(components) ; + commandBarButtonEntryImageRotate.CommandIdentifier = commandImageRotate.Identifier ; - CommandBarButtonEntry commandBarButtonEntryImageRotate = new CommandBarButtonEntry(components) ; - commandBarButtonEntryImageRotate.CommandIdentifier = commandImageRotate.Identifier ; + CommandBarButtonEntry commandBarButtonEntryImageReset = new CommandBarButtonEntry(components) ; + commandBarButtonEntryImageReset.CommandIdentifier = commandImageReset.Identifier ; - CommandBarButtonEntry commandBarButtonEntryImageReset = new CommandBarButtonEntry(components) ; - commandBarButtonEntryImageReset.CommandIdentifier = commandImageReset.Identifier ; + CommandBarButtonEntry commandBarButtonEntryImageSaveDefaults = new CommandBarButtonEntry(components) ; + commandBarButtonEntryImageSaveDefaults.CommandIdentifier = commandImageSaveDefaults.Identifier ; - CommandBarButtonEntry commandBarButtonEntryImageSaveDefaults = new CommandBarButtonEntry(components) ; - commandBarButtonEntryImageSaveDefaults.CommandIdentifier = commandImageSaveDefaults.Identifier ; + CommandBarDefinition commandBarDefinition = new CommandBarDefinition(components) ; + commandBarDefinition.LeftCommandBarEntries.Add( commandBarButtonEntryImageRotate ) ; + commandBarDefinition.LeftCommandBarEntries.Add( commandBarButtonEntryImageBrightness ) ; - CommandBarDefinition commandBarDefinition = new CommandBarDefinition(components) ; - commandBarDefinition.LeftCommandBarEntries.Add( commandBarButtonEntryImageRotate ) ; - commandBarDefinition.LeftCommandBarEntries.Add( commandBarButtonEntryImageBrightness ) ; + commandBarDefinition.RightCommandBarEntries.Add( commandBarButtonEntryImageReset ) ; + commandBarDefinition.RightCommandBarEntries.Add( commandBarButtonEntryImageSaveDefaults ) ; - commandBarDefinition.RightCommandBarEntries.Add( commandBarButtonEntryImageReset ) ; - commandBarDefinition.RightCommandBarEntries.Add( commandBarButtonEntryImageSaveDefaults ) ; + commandBarLightweightControl = new PrimaryWorkspaceWorkspaceCommandBarLightweightControl(components) ; + commandBarLightweightControl.LightweightControlContainerControl = this ; - commandBarLightweightControl = new PrimaryWorkspaceWorkspaceCommandBarLightweightControl(components) ; - commandBarLightweightControl.LightweightControlContainerControl = this ; + commandBarLightweightControl.CommandManager = ApplicationManager.CommandManager ; + commandBarLightweightControl.CommandBarDefinition = commandBarDefinition ; + } - commandBarLightweightControl.CommandManager = ApplicationManager.CommandManager ; - commandBarLightweightControl.CommandBarDefinition = commandBarDefinition ; - } + public override CommandBarLightweightControl FirstCommandBarLightweightControl + { + get + { + return commandBarLightweightControl; + } + } - public override CommandBarLightweightControl FirstCommandBarLightweightControl - { - get - { - return commandBarLightweightControl; - } - } + public event EventHandler SaveDefaultsRequested; + public event EventHandler ResetToDefaultsRequested; - public event EventHandler SaveDefaultsRequested; - public event EventHandler ResetToDefaultsRequested; + public event ImagePropertyEventHandler ImagePropertyChanged; + private void ApplyImageDecorations() + { + ApplyImageDecorations(ImageDecoratorInvocationSource.ImagePropertiesEditor); + } + private void ApplyImageDecorations(ImageDecoratorInvocationSource source) + { + if(ImagePropertyChanged != null) + { + ImagePropertyChanged(this, new ImagePropertyEvent(ImagePropertyType.Decorators, this.ImageInfo, source)); + } + } + public ImagePropertiesInfo ImageInfo + { + get + { + return imageInfo; + } + set + { + if(imageInfo != value) + { + imageInfo = value; - public event ImagePropertyEventHandler ImagePropertyChanged; - private void ApplyImageDecorations() - { - ApplyImageDecorations(ImageDecoratorInvocationSource.ImagePropertiesEditor); - } - private void ApplyImageDecorations(ImageDecoratorInvocationSource source) - { - if(ImagePropertyChanged != null) - { - ImagePropertyChanged(this, new ImagePropertyEvent(ImagePropertyType.Decorators, this.ImageInfo, source)); - } - } - public ImagePropertiesInfo ImageInfo - { - get - { - return imageInfo; - } - set - { - if(imageInfo != value) - { - imageInfo = value; + //disable the image rotate command if the image is not a local image. + commandImageRotate.Enabled = imageInfo != null && imageInfo.ImageSourceUri.IsFile; - //disable the image rotate command if the image is not a local image. - commandImageRotate.Enabled = imageInfo != null && imageInfo.ImageSourceUri.IsFile; + imageTabPageUpload.Visible = (this._imageDataContext != null) && (this._imageDataContext.ImageServiceId != null); + } + } + } + public ImagePropertiesInfo imageInfo; - imageTabPageUpload.Visible = (this._imageDataContext != null) && (this._imageDataContext.ImageServiceId != null); - } - } - } - public ImagePropertiesInfo imageInfo; + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } + ApplicationStyleManager.ApplicationStyleChanged -= new EventHandler(ApplicationManager_ApplicationStyleChanged); + } + base.Dispose( disposing ); + } - ApplicationStyleManager.ApplicationStyleChanged -= new EventHandler(ApplicationManager_ApplicationStyleChanged); - } - base.Dispose( disposing ); - } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + } + #endregion - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - components = new System.ComponentModel.Container(); - } - #endregion + internal ImageEditingTabPageControl[] TabPages + { + get + { + return _tabPages; + } + } + private ImageEditingTabPageControl[] _tabPages = new ImageEditingTabPageControl[0]; - internal ImageEditingTabPageControl[] TabPages - { - get - { - return _tabPages; - } - } - private ImageEditingTabPageControl[] _tabPages = new ImageEditingTabPageControl[0]; + private void UpdateAppearance() + { + PerformLayout(); + Invalidate(); + } - private void UpdateAppearance() - { - PerformLayout(); - Invalidate(); - } + protected override void OnPaintBackground(PaintEventArgs pevent) + { + using ( Brush brush = new SolidBrush(ApplicationManager.ApplicationStyle.PrimaryWorkspaceCommandBarBottomColor) ) + pevent.Graphics.FillRectangle( brush, ClientRectangle ) ; + } - protected override void OnPaintBackground(PaintEventArgs pevent) - { - using ( Brush brush = new SolidBrush(ApplicationManager.ApplicationStyle.PrimaryWorkspaceCommandBarBottomColor) ) - pevent.Graphics.FillRectangle( brush, ClientRectangle ) ; - } + /// + /// Handle appearance preference changes. + /// + /// + /// + private void ApplicationManager_ApplicationStyleChanged(object sender, EventArgs e) + { + UpdateAppearance() ; + } - /// - /// Handle appearance preference changes. - /// - /// - /// - private void ApplicationManager_ApplicationStyleChanged(object sender, EventArgs e) - { - UpdateAppearance() ; - } + private void commandImageDecorator_Execute(object sender, EventArgs e) + { + ImageDecorator imageDecorator = ((ImageDecorator)((Command)sender).Tag); - private void commandImageDecorator_Execute(object sender, EventArgs e) - { - ImageDecorator imageDecorator = ((ImageDecorator)((Command)sender).Tag); + //perform the execution so that the decorator is added to the list of active decorators + imageDecorator.Command.PerformExecute(); - //perform the execution so that the decorator is added to the list of active decorators - imageDecorator.Command.PerformExecute(); + //since this command was invoked explicitly via a command button, display the editor dialog. + ImageDecoratorHelper.ShowImageDecoratorEditorDialog( FindForm(), imageDecorator, ImageInfo, new ApplyDecoratorCallback(ApplyImageDecorations) ); + } - //since this command was invoked explicitly via a command button, display the editor dialog. - ImageDecoratorHelper.ShowImageDecoratorEditorDialog( FindForm(), imageDecorator, ImageInfo, new ApplyDecoratorCallback(ApplyImageDecorations) ); - } + private void commandImageRotate_Execute(object sender, EventArgs e) + { + ImageInfo.ImageRotation = ImageDecoratorUtils.GetFlipTypeRotated90(ImageInfo.ImageRotation); + ApplyImageDecorations(); + } - private void commandImageRotate_Execute(object sender, EventArgs e) - { - ImageInfo.ImageRotation = ImageDecoratorUtils.GetFlipTypeRotated90(ImageInfo.ImageRotation); - ApplyImageDecorations(); - } + private void commandImageReset_Execute(object sender, EventArgs e) + { + if(ResetToDefaultsRequested != null) + { + ResetToDefaultsRequested(this, EventArgs.Empty); + } + ApplyImageDecorations(ImageDecoratorInvocationSource.Reset); + } - private void commandImageReset_Execute(object sender, EventArgs e) - { - if(ResetToDefaultsRequested != null) - { - ResetToDefaultsRequested(this, EventArgs.Empty); - } - ApplyImageDecorations(ImageDecoratorInvocationSource.Reset); - } + private void commandImageSaveDefaults_Execute(object sender, EventArgs e) + { + if(SaveDefaultsRequested != null) + { + SaveDefaultsRequested(this, EventArgs.Empty); + } + } - private void commandImageSaveDefaults_Execute(object sender, EventArgs e) - { - if(SaveDefaultsRequested != null) - { - SaveDefaultsRequested(this, EventArgs.Empty); - } - } - - private void Command_StateChanged(object sender, EventArgs e) - { - commandImageBrightness.Enabled = _imageDataContext.DecoratorsManager.GetImageDecorator(BrightnessDecorator.Id).Command.Enabled; - } - } + private void Command_StateChanged(object sender, EventArgs e) + { + commandImageBrightness.Enabled = _imageDataContext.DecoratorsManager.GetImageDecorator(BrightnessDecorator.Id).Command.Enabled; + } + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/PostTitleEditingElementBehavior.cs b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/PostTitleEditingElementBehavior.cs index ce60eaac..8ad78734 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/PostTitleEditingElementBehavior.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/PostTitleEditingElementBehavior.cs @@ -87,7 +87,6 @@ namespace OpenLiveWriter.PostEditor.PostHtmlEditing } } - public event EventHandler TitleChanged; protected virtual void OnTitleChanged(EventArgs evt) { diff --git a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/PropertiesEditingElementBehavior.cs b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/PropertiesEditingElementBehavior.cs index 01c800e0..f2cd5ea5 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/PropertiesEditingElementBehavior.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/PropertiesEditingElementBehavior.cs @@ -14,156 +14,152 @@ using OpenLiveWriter.Mshtml; namespace OpenLiveWriter.PostEditor.PostHtmlEditing { - public abstract class PropertiesEditingElementBehavior : HtmlEditorElementBehavior - { + public abstract class PropertiesEditingElementBehavior : HtmlEditorElementBehavior + { - public PropertiesEditingElementBehavior(IHtmlEditorComponentContext editorContext) - : base(editorContext) - { - } + public PropertiesEditingElementBehavior(IHtmlEditorComponentContext editorContext) + : base(editorContext) + { + } - protected override void OnElementAttached() - { - base.OnElementAttached (); + protected override void OnElementAttached() + { + base.OnElementAttached (); - EditorContext.PreHandleEvent +=new HtmlEditDesignerEventHandler(EditorContext_PreHandleEvent); - } + EditorContext.PreHandleEvent +=new HtmlEditDesignerEventHandler(EditorContext_PreHandleEvent); + } - protected override void OnSelectedChanged() - { - // make sure we paint the dongle - Invalidate(_widgetArea) ; - } + protected override void OnSelectedChanged() + { + // make sure we paint the dongle + Invalidate(_widgetArea) ; + } - public override void GetPainterInfo(ref _HTML_PAINTER_INFO pInfo) - { - // ensure we paint above everything (including selection handles) - pInfo.lFlags = (int)_HTML_PAINTER.HTMLPAINTER_OPAQUE ; - pInfo.lZOrder = (int)_HTML_PAINT_ZORDER.HTMLPAINT_ZORDER_WINDOW_TOP ; + public override void GetPainterInfo(ref _HTML_PAINTER_INFO pInfo) + { + // ensure we paint above everything (including selection handles) + pInfo.lFlags = (int)_HTML_PAINTER.HTMLPAINTER_OPAQUE ; + pInfo.lZOrder = (int)_HTML_PAINT_ZORDER.HTMLPAINT_ZORDER_WINDOW_TOP ; - // expand to the right to accomodate our widget - pInfo.rcExpand.top = 0 ; - pInfo.rcExpand.bottom = 0 ; - pInfo.rcExpand.left = 0 ; - pInfo.rcExpand.right = _widgetEnabled.Width - WIDGET_HORIZONTAL_OVERLAY ; - } + // expand to the right to accomodate our widget + pInfo.rcExpand.top = 0 ; + pInfo.rcExpand.bottom = 0 ; + pInfo.rcExpand.left = 0 ; + pInfo.rcExpand.right = _widgetEnabled.Width - WIDGET_HORIZONTAL_OVERLAY ; + } - protected virtual bool WidgetActive - { - get - { - return Selected; - } - } + protected virtual bool WidgetActive + { + get + { + return Selected; + } + } + private int EditorContext_PreHandleEvent(int inEvtDispId, IHTMLEventObj pIEventObj) + { + if ( Selected ) + { + if ( inEvtDispId == DISPID_HTMLELEMENTEVENTS2.ONMOUSEMOVE ) + { + MouseInWidget = ClientPointInWidget(pIEventObj.clientX, pIEventObj.clientY) ; + } - private int EditorContext_PreHandleEvent(int inEvtDispId, IHTMLEventObj pIEventObj) - { - if ( Selected ) - { - if ( inEvtDispId == DISPID_HTMLELEMENTEVENTS2.ONMOUSEMOVE ) - { - MouseInWidget = ClientPointInWidget(pIEventObj.clientX, pIEventObj.clientY) ; - } + else if ( inEvtDispId == DISPID_HTMLELEMENTEVENTS2.ONMOUSEDOWN ) + { + if ( WidgetActive && MouseInWidget ) + { + // show the properties form + ShowProperties() ; - else if ( inEvtDispId == DISPID_HTMLELEMENTEVENTS2.ONMOUSEDOWN ) - { - if ( WidgetActive && MouseInWidget ) - { - // show the properties form - ShowProperties() ; + // eat the click + return HRESULT.S_OK ; + } + } + } - // eat the click - return HRESULT.S_OK ; - } - } - } + return HRESULT.S_FALSE; + } - return HRESULT.S_FALSE; - } + protected virtual void ShowProperties() + { + Invalidate(_widgetArea); + } + private Rectangle CalculateWidgetScreenBounds() + { + // translate local location to client location + POINT localLocation = new POINT(); + localLocation.x = _widgetLocation.X ; + localLocation.y = _widgetLocation.Y ; + POINT clientLocation = new POINT(); + HTMLPaintSite.TransformLocalToGlobal(localLocation, ref clientLocation); - protected virtual void ShowProperties() - { - Invalidate(_widgetArea); - } + Point screenLocation = EditorContext.PointToScreen(new Point(clientLocation.x, clientLocation.y)) ; + return new Rectangle(screenLocation, new Size(_widgetArea.Width, _widgetArea.Height) ); + } - private Rectangle CalculateWidgetScreenBounds() - { - // translate local location to client location - POINT localLocation = new POINT(); - localLocation.x = _widgetLocation.X ; - localLocation.y = _widgetLocation.Y ; - POINT clientLocation = new POINT(); - HTMLPaintSite.TransformLocalToGlobal(localLocation, ref clientLocation); + private bool MouseInWidget + { + get + { + return _mouseInWidget ; + } + set + { + if ( _mouseInWidget != value ) + { + _mouseInWidget = value ; - Point screenLocation = EditorContext.PointToScreen(new Point(clientLocation.x, clientLocation.y)) ; - return new Rectangle(screenLocation, new Size(_widgetArea.Width, _widgetArea.Height) ); - } + Invalidate(_widgetArea) ; + } - private bool MouseInWidget - { - get - { - return _mouseInWidget ; - } - set - { - if ( _mouseInWidget != value ) - { - _mouseInWidget = value ; + // set the arrow if the mouse in the widget + if ( _mouseInWidget ) + Cursor.Current = Cursors.Arrow ; - Invalidate(_widgetArea) ; - } + // toggle cursor override appropriately + EditorContext.OverrideCursor = _mouseInWidget ; + } + } + private bool _mouseInWidget ; - // set the arrow if the mouse in the widget - if ( _mouseInWidget ) - Cursor.Current = Cursors.Arrow ; + private bool ClientPointInWidget( int x, int y ) + { + // calculate mouse position in local coordinates + POINT clientMouseLocation = new POINT(); + clientMouseLocation.x = x ; + clientMouseLocation.y = y ; + POINT localMouseLocation = new POINT(); + HTMLPaintSite.TransformGlobalToLocal( clientMouseLocation, ref localMouseLocation ) ; - // toggle cursor override appropriately - EditorContext.OverrideCursor = _mouseInWidget ; - } - } - private bool _mouseInWidget ; + // is the mouse in the widget? + return _widgetArea.Contains( localMouseLocation.x, localMouseLocation.y ) ; + } + public override void OnResize(SIZE size) + { + _elementSize = new Size(size.cx, size.cy) ; + _widgetLocation = new Point(_elementSize.Width - _widgetEnabled.Width, WIDGET_VERTICAL_OFFSET) ; + _widgetArea = new Rectangle( _widgetLocation, _widgetEnabled.Size ); + } - private bool ClientPointInWidget( int x, int y ) - { - // calculate mouse position in local coordinates - POINT clientMouseLocation = new POINT(); - clientMouseLocation.x = x ; - clientMouseLocation.y = y ; - POINT localMouseLocation = new POINT(); - HTMLPaintSite.TransformGlobalToLocal( clientMouseLocation, ref localMouseLocation ) ; + public override void Draw(RECT rcBounds, RECT rcUpdate, int lDrawFlags, IntPtr hdc, IntPtr pvDrawObject) + { + if ( WidgetActive ) + { + using ( Graphics g = Graphics.FromHdc(hdc) ) + { + g.DrawImage( MouseInWidget ? _widgetSelected : _widgetEnabled, + rcBounds.right-_widgetEnabled.Width, rcBounds.top + WIDGET_VERTICAL_OFFSET ); + } + } + } - // is the mouse in the widget? - return _widgetArea.Contains( localMouseLocation.x, localMouseLocation.y ) ; - } - - - public override void OnResize(SIZE size) - { - _elementSize = new Size(size.cx, size.cy) ; - _widgetLocation = new Point(_elementSize.Width - _widgetEnabled.Width, WIDGET_VERTICAL_OFFSET) ; - _widgetArea = new Rectangle( _widgetLocation, _widgetEnabled.Size ); - } - - public override void Draw(RECT rcBounds, RECT rcUpdate, int lDrawFlags, IntPtr hdc, IntPtr pvDrawObject) - { - if ( WidgetActive ) - { - using ( Graphics g = Graphics.FromHdc(hdc) ) - { - g.DrawImage( MouseInWidget ? _widgetSelected : _widgetEnabled, - rcBounds.right-_widgetEnabled.Width, rcBounds.top + WIDGET_VERTICAL_OFFSET ); - } - } - } - - protected void InvalidateWidget() - { - Invalidate(_widgetArea) ; - } + protected void InvalidateWidget() + { + Invalidate(_widgetArea) ; + } protected override void Dispose(bool disposeManagedResources) { @@ -181,14 +177,14 @@ namespace OpenLiveWriter.PostEditor.PostHtmlEditing base.Dispose(disposeManagedResources); } - private Size _elementSize ; - private Point _widgetLocation ; - private Rectangle _widgetArea ; + private Size _elementSize ; + private Point _widgetLocation ; + private Rectangle _widgetArea ; private bool _disposed; - private const int WIDGET_HORIZONTAL_OVERLAY = 5 ; - private const int WIDGET_VERTICAL_OFFSET = 5 ; - private Bitmap _widgetEnabled = ResourceHelper.LoadAssemblyResourceBitmap("PostHtmlEditing.Images.PropertiesHandleEnabled.png", true) ; - private Bitmap _widgetSelected = ResourceHelper.LoadAssemblyResourceBitmap("PostHtmlEditing.Images.PropertiesHandleSelected.png", true) ; - } + private const int WIDGET_HORIZONTAL_OVERLAY = 5 ; + private const int WIDGET_VERTICAL_OFFSET = 5 ; + private Bitmap _widgetEnabled = ResourceHelper.LoadAssemblyResourceBitmap("PostHtmlEditing.Images.PropertiesHandleEnabled.png", true) ; + private Bitmap _widgetSelected = ResourceHelper.LoadAssemblyResourceBitmap("PostHtmlEditing.Images.PropertiesHandleSelected.png", true) ; + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Sidebar/ContentSourceSidebarControl.cs b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Sidebar/ContentSourceSidebarControl.cs index 69b9384c..9cbcb23f 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Sidebar/ContentSourceSidebarControl.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Sidebar/ContentSourceSidebarControl.cs @@ -56,7 +56,6 @@ namespace OpenLiveWriter.PostEditor.PostHtmlEditing.Sidebar } } - public override void UpdateView(object htmlSelection, bool force) { if (htmlSelection == null) //true when the a non-smartcontent element is selected diff --git a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Sidebar/DefaultSidebarControl.cs b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Sidebar/DefaultSidebarControl.cs index b74a9fd0..b764dbff 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Sidebar/DefaultSidebarControl.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Sidebar/DefaultSidebarControl.cs @@ -27,69 +27,69 @@ using OpenLiveWriter.PostEditor.ImageInsertion.WebImages; namespace OpenLiveWriter.PostEditor.PostHtmlEditing.Sidebar { - public class DefaultSidebarControl : SidebarControl - { - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; + public class DefaultSidebarControl : SidebarControl + { + /// + /// Required designer variable. + /// + private System.ComponentModel.Container components = null; - public DefaultSidebarControl(ISidebarContext sidebarContext, IBlogPostEditingSite postEditingSite) - { - // This call is required by the Windows.Forms Form Designer. - InitializeComponent(); + public DefaultSidebarControl(ISidebarContext sidebarContext, IBlogPostEditingSite postEditingSite) + { + // This call is required by the Windows.Forms Form Designer. + InitializeComponent(); - // record the post management context and subscribe to the post list changed event - _postEditingSite = postEditingSite ; + // record the post management context and subscribe to the post list changed event + _postEditingSite = postEditingSite ; - // subscribe to changes that require us to re-layout the sidebar - _postEditingSite.WeblogChanged +=new WeblogHandler(_postEditingSite_WeblogChanged); - _postEditingSite.WeblogSettingsChanged +=new WeblogSettingsChangedHandler(_postEditingSite_WeblogSettingsChanged); - _postEditingSite.FrameWindow.Layout +=new LayoutEventHandler(FrameWindow_Layout); - _postEditingSite.PostListChanged +=new EventHandler(_postEditingSite_PostListChanged); - ContentSourceManager.GlobalContentSourceListChanged +=new EventHandler(ContentSourceManager_GlobalContentSourceListChanged); + // subscribe to changes that require us to re-layout the sidebar + _postEditingSite.WeblogChanged +=new WeblogHandler(_postEditingSite_WeblogChanged); + _postEditingSite.WeblogSettingsChanged +=new WeblogSettingsChangedHandler(_postEditingSite_WeblogSettingsChanged); + _postEditingSite.FrameWindow.Layout +=new LayoutEventHandler(FrameWindow_Layout); + _postEditingSite.PostListChanged +=new EventHandler(_postEditingSite_PostListChanged); + ContentSourceManager.GlobalContentSourceListChanged +=new EventHandler(ContentSourceManager_GlobalContentSourceListChanged); - // add the tooltip - _toolTip = new ToolTip2(components); - _toolTip.InitialDelay = 750 ; + // add the tooltip + _toolTip = new ToolTip2(components); + _toolTip.InitialDelay = 750 ; - // set the caption - Text = ApplicationEnvironment.ProductName; - AccessibleName = Res.Get(StringId.SidebarPanel) ; + // set the caption + Text = ApplicationEnvironment.ProductName; + AccessibleName = Res.Get(StringId.SidebarPanel) ; - // Turn on double buffered painting. - SetStyle(ControlStyles.UserPaint, true); - SetStyle(ControlStyles.DoubleBuffer, true); - SetStyle(ControlStyles.AllPaintingInWmPaint, true); + // Turn on double buffered painting. + SetStyle(ControlStyles.UserPaint, true); + SetStyle(ControlStyles.DoubleBuffer, true); + SetStyle(ControlStyles.AllPaintingInWmPaint, true); - // initialize components - //_weblogPanelHeader = new PanelHeader(this, WEBLOG_PANEL_CAPTION); - // _weblogPanelBody = new PanelBody(); - // _weblogHeader = new WeblogHeader(this, _weblogPanelBody) ; - // _viewWeblogCommand = new LinkCommand(this, _toolTip, CommandId.ViewWeblog.ToString()); - // _viewWeblogCommand.Name = "ViewWeblog"; - // _viewWeblogAdminCommand = new LinkCommand(this, _toolTip, CommandId.ViewWeblogAdmin.ToString()); - // _viewWeblogAdminCommand.Name = "ViewWeblogAdmin"; + // initialize components + //_weblogPanelHeader = new PanelHeader(this, WEBLOG_PANEL_CAPTION); + // _weblogPanelBody = new PanelBody(); + // _weblogHeader = new WeblogHeader(this, _weblogPanelBody) ; + // _viewWeblogCommand = new LinkCommand(this, _toolTip, CommandId.ViewWeblog.ToString()); + // _viewWeblogCommand.Name = "ViewWeblog"; + // _viewWeblogAdminCommand = new LinkCommand(this, _toolTip, CommandId.ViewWeblogAdmin.ToString()); + // _viewWeblogAdminCommand.Name = "ViewWeblogAdmin"; _headerControl = new SidebarHeaderControl(); - _openPanelHeader = new PanelHeader(this, OPEN_PANEL_CAPTION) ; - _openPanelBody = new PanelBody(); - _draftsSectionHeader = new SectionHeader(this, DRAFTS_SECTION_CAPTION, SidebarColors.FirstSectionBottomColor ); - _draftsPostList = new DraftPostList(this, _toolTip, DRAFTS_SECTION_CAPTION); - _draftsPostList.PostSelected +=new PostEventHandler(_draftsPostList_PostSelected); - _draftsPostList.PostDeleteRequested +=new PostEventHandler(_draftsPostList_PostDeleteRequested); - _openDraftCommand = new LinkCommand(this, "PostHtmlEditing.Sidebar.Images.OpenPost.png", MORE_DRAFTS_CAPTION, MORE_DRAFTS_ACCNAME, _toolTip, MORE_DRAFTS_TOOLTIP, CommandId.OpenDrafts.ToString()); - _recentPostsSectionHeader = new SectionHeader(this, RECENT_POSTS_SECTION_CAPTION, SidebarColors.SecondSectionBottomColor ); - _recentPostList = new RecentPostList(this, _toolTip, RECENT_POSTS_SECTION_CAPTION); - _recentPostList.PostSelected +=new PostEventHandler(_recentPostList_PostSelected); - _openPostCommand = new LinkCommand(this, "PostHtmlEditing.Sidebar.Images.OpenPost.png", MORE_POSTS_CAPTION, MORE_POSTS_ACCNAME, _toolTip, MORE_POSTS_TOOLTIP, CommandId.OpenRecentPosts.ToString()); - _insertPanelHeader = new PanelHeader(this, INSERT_PANEL_CAPTION); - _insertPanelBody = new PanelBody(); - _insertLinkCommand = new LinkCommand(this, "PostHtmlEditing.Sidebar.Images.InsertLink.png", INSERT_LINK_CAPTION, INSERT_LINK_ACCNAME, _toolTip, INSERT_LINK_TOOLTIP, CommandId.InsertLink.ToString()); - _insertPictureCommand = new LinkCommand(this, "BlogThis.ItemTypes.Images.ImageItem.png", INSERT_PICTURE_CAPTION, INSERT_PICTURE_ACCNAME, _toolTip, INSERT_PICTURE_TOOLTIP, CommandId.InsertPictureFromFile.ToString()); + _openPanelHeader = new PanelHeader(this, OPEN_PANEL_CAPTION) ; + _openPanelBody = new PanelBody(); + _draftsSectionHeader = new SectionHeader(this, DRAFTS_SECTION_CAPTION, SidebarColors.FirstSectionBottomColor ); + _draftsPostList = new DraftPostList(this, _toolTip, DRAFTS_SECTION_CAPTION); + _draftsPostList.PostSelected +=new PostEventHandler(_draftsPostList_PostSelected); + _draftsPostList.PostDeleteRequested +=new PostEventHandler(_draftsPostList_PostDeleteRequested); + _openDraftCommand = new LinkCommand(this, "PostHtmlEditing.Sidebar.Images.OpenPost.png", MORE_DRAFTS_CAPTION, MORE_DRAFTS_ACCNAME, _toolTip, MORE_DRAFTS_TOOLTIP, CommandId.OpenDrafts.ToString()); + _recentPostsSectionHeader = new SectionHeader(this, RECENT_POSTS_SECTION_CAPTION, SidebarColors.SecondSectionBottomColor ); + _recentPostList = new RecentPostList(this, _toolTip, RECENT_POSTS_SECTION_CAPTION); + _recentPostList.PostSelected +=new PostEventHandler(_recentPostList_PostSelected); + _openPostCommand = new LinkCommand(this, "PostHtmlEditing.Sidebar.Images.OpenPost.png", MORE_POSTS_CAPTION, MORE_POSTS_ACCNAME, _toolTip, MORE_POSTS_TOOLTIP, CommandId.OpenRecentPosts.ToString()); + _insertPanelHeader = new PanelHeader(this, INSERT_PANEL_CAPTION); + _insertPanelBody = new PanelBody(); + _insertLinkCommand = new LinkCommand(this, "PostHtmlEditing.Sidebar.Images.InsertLink.png", INSERT_LINK_CAPTION, INSERT_LINK_ACCNAME, _toolTip, INSERT_LINK_TOOLTIP, CommandId.InsertLink.ToString()); + _insertPictureCommand = new LinkCommand(this, "BlogThis.ItemTypes.Images.ImageItem.png", INSERT_PICTURE_CAPTION, INSERT_PICTURE_ACCNAME, _toolTip, INSERT_PICTURE_TOOLTIP, CommandId.InsertPictureFromFile.ToString()); - ContentSourceInfo csi = ContentSourceManager.GetContentSourceInfoById(PhotoAlbumContentSource.ID); + ContentSourceInfo csi = ContentSourceManager.GetContentSourceInfoById(PhotoAlbumContentSource.ID); if (csi != null) { _insertPhotoAlbumCommand = new LinkCommand(this, csi.Image, @@ -112,22 +112,22 @@ namespace OpenLiveWriter.PostEditor.PostHtmlEditing.Sidebar } _insertTableCommand = new LinkCommand(this, "Tables.Commands.Images.CommandInsertTableCommandBarButtonBitmapEnabled.png", INSERT_TABLE_CAPTION, INSERT_TABLE_ACCNAME, _toolTip, INSERT_TABLE_TOOLTIP, CommandId.InsertTable.ToString()); - _contentInsertCommands = new ContentInsertCommands(this, _toolTip, LINK_COMMAND_PADDING, int.MaxValue); - _separator2 = new SeparatorControl(); + _contentInsertCommands = new ContentInsertCommands(this, _toolTip, LINK_COMMAND_PADDING, int.MaxValue); + _separator2 = new SeparatorControl(); Controls.Add(_separator2); - Controls.Add(_headerControl); + Controls.Add(_headerControl); - UpdatePostLists() ; - } + UpdatePostLists() ; + } - public override bool HasStatusBar - { - get - { - return false ; - } - } + public override bool HasStatusBar + { + get + { + return false ; + } + } protected override void OnSizeChanged(EventArgs e) { @@ -147,9 +147,8 @@ namespace OpenLiveWriter.PostEditor.PostHtmlEditing.Sidebar RefreshLayout(); } - private void RefreshLayout(bool blogChanged) - { + { // no-op if we do not have an active weblog // (solves order of initialization problem) if (_postEditingSite.CurrentAccountId == null) @@ -250,1291 +249,1270 @@ namespace OpenLiveWriter.PostEditor.PostHtmlEditing.Sidebar bounds.Height += SECTION_SPACING; _insertPanelBody.Layout(bounds, _contentInsertCommands.Bounds.Bottom + INSERT_EXTRA_BOTTOM_PAD); - BidiHelper.RtlLayoutFixup(this); + BidiHelper.RtlLayoutFixup(this); MinimumSize = new Size(0, _insertPanelBody.Bounds.Bottom + INSERT_EXTRA_BOTTOM_PAD); Refresh(); - } + } - protected override void OnPaint(PaintEventArgs e) - { - try - { - // alias graphics object - BidiGraphics g = new BidiGraphics(e.Graphics, ClientRectangle) ; + protected override void OnPaint(PaintEventArgs e) + { + try + { + // alias graphics object + BidiGraphics g = new BidiGraphics(e.Graphics, ClientRectangle) ; - _openPanelHeader.Paint(g); - _openPanelBody.Paint(g); + _openPanelHeader.Paint(g); + _openPanelBody.Paint(g); - _draftsSectionHeader.Paint(g); - _draftsPostList.Paint(g); - if (ShouldShowMoreDrafts) - _openDraftCommand.Paint(g); + _draftsSectionHeader.Paint(g); + _draftsPostList.Paint(g); + if (ShouldShowMoreDrafts) + _openDraftCommand.Paint(g); - _recentPostsSectionHeader.Paint(g); - _recentPostList.Paint(g); - if (ShouldShowMoreRecentPosts) - _openPostCommand.Paint(g); + _recentPostsSectionHeader.Paint(g); + _recentPostList.Paint(g); + if (ShouldShowMoreRecentPosts) + _openPostCommand.Paint(g); - _insertPanelHeader.Paint(g); - _insertPanelBody.Paint(g); + _insertPanelHeader.Paint(g); + _insertPanelBody.Paint(g); - _insertLinkCommand.Paint(g); - _insertPictureCommand.Paint(g); + _insertLinkCommand.Paint(g); + _insertPictureCommand.Paint(g); if (_insertPhotoAlbumCommand != null) - _insertPhotoAlbumCommand.Paint(g); + _insertPhotoAlbumCommand.Paint(g); if (_insertWebImage != null) _insertWebImage.Paint(g); - _insertTableCommand.Paint(g); - _contentInsertCommands.Paint(g); + _insertTableCommand.Paint(g); + _contentInsertCommands.Paint(g); - } - catch(Exception ex) - { - Trace.Fail("Unexpected exception: " + ex.ToString()) ; - } - } + } + catch(Exception ex) + { + Trace.Fail("Unexpected exception: " + ex.ToString()) ; + } + } + private void _postEditingSite_WeblogChanged(string blogId) + { + RefreshLayout(true); + } - private void _postEditingSite_WeblogChanged(string blogId) - { - RefreshLayout(true); - } + private void _postEditingSite_WeblogSettingsChanged(string blogId, bool templateChanged) + { + RefreshLayout(true); + } - private void _postEditingSite_WeblogSettingsChanged(string blogId, bool templateChanged) - { - RefreshLayout(true); - } - - - private void _postEditingSite_PostListChanged(object sender, EventArgs e) - { + private void _postEditingSite_PostListChanged(object sender, EventArgs e) + { RefreshLayout(); - } + } - private void ContentSourceManager_GlobalContentSourceListChanged(object sender, EventArgs e) - { - if ( ControlHelper.ControlCanHandleInvoke(this) ) - BeginInvoke(new InvokeInUIThreadDelegate(HandleContentSourceListChanged)) ; - } + private void ContentSourceManager_GlobalContentSourceListChanged(object sender, EventArgs e) + { + if ( ControlHelper.ControlCanHandleInvoke(this) ) + BeginInvoke(new InvokeInUIThreadDelegate(HandleContentSourceListChanged)) ; + } - private void HandleContentSourceListChanged() - { - _contentInsertCommands.RefreshContentSourceCommands(); - RefreshLayout() ; - } + private void HandleContentSourceListChanged() + { + _contentInsertCommands.RefreshContentSourceCommands(); + RefreshLayout() ; + } - private void _draftsPostList_PostSelected(PostInfo post) - { - WindowCascadeHelper.SetNextOpenedLocation(_postEditingSite.FrameWindow.Location); - _postEditingSite.OpenLocalPost(post); - } + private void _draftsPostList_PostSelected(PostInfo post) + { + WindowCascadeHelper.SetNextOpenedLocation(_postEditingSite.FrameWindow.Location); + _postEditingSite.OpenLocalPost(post); + } - private void _draftsPostList_PostDeleteRequested(PostInfo post) - { - _postEditingSite.DeleteLocalPost(post) ; - UpdatePostLists() ; - } + private void _draftsPostList_PostDeleteRequested(PostInfo post) + { + _postEditingSite.DeleteLocalPost(post) ; + UpdatePostLists() ; + } private void FrameWindow_Layout(object sender, EventArgs e) { } - private void _recentPostList_PostSelected(PostInfo post) - { - WindowCascadeHelper.SetNextOpenedLocation(_postEditingSite.FrameWindow.Location); - _postEditingSite.OpenLocalPost(post); - } + private void _recentPostList_PostSelected(PostInfo post) + { + WindowCascadeHelper.SetNextOpenedLocation(_postEditingSite.FrameWindow.Location); + _postEditingSite.OpenLocalPost(post); + } - private void UpdatePostLists() - { - PostInfo[] drafts = PostListCache.Drafts; - PostInfo[] recentPosts = PostListCache.RecentPosts; - _draftsPostList.SetPosts(drafts); - _recentPostList.SetPosts(recentPosts); - _shouldShowMoreDrafts = drafts.Length > PostList.MAX_POSTS; - _shouldShowMoreRecentPosts = recentPosts.Length > PostList.MAX_POSTS; - } + private void UpdatePostLists() + { + PostInfo[] drafts = PostListCache.Drafts; + PostInfo[] recentPosts = PostListCache.RecentPosts; + _draftsPostList.SetPosts(drafts); + _recentPostList.SetPosts(recentPosts); + _shouldShowMoreDrafts = drafts.Length > PostList.MAX_POSTS; + _shouldShowMoreRecentPosts = recentPosts.Length > PostList.MAX_POSTS; + } - private bool _shouldShowMoreDrafts; - private bool _shouldShowMoreRecentPosts; + private bool _shouldShowMoreDrafts; + private bool _shouldShowMoreRecentPosts; - private bool ShouldShowMoreRecentPosts - { - get { return _shouldShowMoreRecentPosts; } - } + private bool ShouldShowMoreRecentPosts + { + get { return _shouldShowMoreRecentPosts; } + } - private bool ShouldShowMoreDrafts - { - get { return _shouldShowMoreDrafts; } - } + private bool ShouldShowMoreDrafts + { + get { return _shouldShowMoreDrafts; } + } // private PanelHeader _weblogPanelHeader; - // private WeblogHeader _weblogHeader ; - // private PanelBody _weblogPanelBody ; - // private LinkCommand _viewWeblogCommand ; - // private LinkCommand _viewWeblogAdminCommand ; - // private BlogProviderButtonCommandBarControl _blogProviderButtonCommandBar ; - private SidebarHeaderControl _headerControl; + // private WeblogHeader _weblogHeader ; + // private PanelBody _weblogPanelBody ; + // private LinkCommand _viewWeblogCommand ; + // private LinkCommand _viewWeblogAdminCommand ; + // private BlogProviderButtonCommandBarControl _blogProviderButtonCommandBar ; + private SidebarHeaderControl _headerControl; private PanelHeader _openPanelHeader; - private PanelBody _openPanelBody; - private SectionHeader _draftsSectionHeader ; - private PostList _draftsPostList ; - private SectionHeader _recentPostsSectionHeader ; - private PostList _recentPostList ; - private LinkCommand _openDraftCommand ; - private LinkCommand _openPostCommand ; - private PanelHeader _insertPanelHeader ; - private PanelBody _insertPanelBody; - private LinkCommand _insertLinkCommand ; - private LinkCommand _insertPictureCommand ; - private LinkCommand _insertPhotoAlbumCommand ; - private LinkCommand _insertTableCommand ; + private PanelBody _openPanelBody; + private SectionHeader _draftsSectionHeader ; + private PostList _draftsPostList ; + private SectionHeader _recentPostsSectionHeader ; + private PostList _recentPostList ; + private LinkCommand _openDraftCommand ; + private LinkCommand _openPostCommand ; + private PanelHeader _insertPanelHeader ; + private PanelBody _insertPanelBody; + private LinkCommand _insertLinkCommand ; + private LinkCommand _insertPictureCommand ; + private LinkCommand _insertPhotoAlbumCommand ; + private LinkCommand _insertTableCommand ; private LinkCommand _insertWebImage; - private ContentInsertCommands _contentInsertCommands ; + private ContentInsertCommands _contentInsertCommands ; private SeparatorControl _separator2; - private ToolTip2 _toolTip ; - private IBlogPostEditingSite _postEditingSite ; + private ToolTip2 _toolTip ; + private IBlogPostEditingSite _postEditingSite ; - private const int PANEL_TOP_INSET = 2 ; - internal const int PANEL_HORIZONTAL_INSET = 10 ; - private const int PANEL_SECTION_PADDING = 10; - private const int PANEL_SECTION_PADDING_FIRST = 1; - internal const int LINK_COMMAND_PADDING = 5 ; - private const int INSERT_EXTRA_BOTTOM_PAD = 0 ; - private const int OPEN_COMMAND_PADDING = 3 ; - private const int OPEN_COMMAND_LEFT_OFFSET = 20 ; - private const int SECTION_SPACING = 8; - private const int SECONDARY_HEADER_INSET = 3; - private const int TERTIARY_INSET = 3; + private const int PANEL_TOP_INSET = 2 ; + internal const int PANEL_HORIZONTAL_INSET = 10 ; + private const int PANEL_SECTION_PADDING = 10; + private const int PANEL_SECTION_PADDING_FIRST = 1; + internal const int LINK_COMMAND_PADDING = 5 ; + private const int INSERT_EXTRA_BOTTOM_PAD = 0 ; + private const int OPEN_COMMAND_PADDING = 3 ; + private const int OPEN_COMMAND_LEFT_OFFSET = 20 ; + private const int SECTION_SPACING = 8; + private const int SECONDARY_HEADER_INSET = 3; + private const int TERTIARY_INSET = 3; + private string WEBLOG_PANEL_CAPTION = Res.Get(StringId.Weblog) ; + private string OPEN_PANEL_CAPTION = Res.Get(StringId.Open) ; + private string DRAFTS_SECTION_CAPTION = Res.Get(StringId.Drafts) ; + private string RECENT_POSTS_SECTION_CAPTION = Res.Get(StringId.RecentlyPosted) ; + private string MORE_DRAFTS_CAPTION = Res.Get(StringId.MoreDotDotDot) ; + private string MORE_DRAFTS_ACCNAME = Res.Get(StringId.MoreDrafts) ; + private string MORE_DRAFTS_TOOLTIP = Res.Get(StringId.MoreDraftsTooltip) ; + private string MORE_POSTS_CAPTION = Res.Get(StringId.MoreDotDotDot) ; + private string MORE_POSTS_ACCNAME = Res.Get(StringId.MorePosts) ; + private string MORE_POSTS_TOOLTIP = Res.Get(StringId.MorePostsTooltip) ; + private string INSERT_PANEL_CAPTION = Res.Get(StringId.Insert) ; + private string INSERT_LINK_CAPTION = Res.Get(StringId.InsertLinkDotDotDot) ; + private string INSERT_LINK_ACCNAME = Res.Get(StringId.InsertLink) ; + private string INSERT_LINK_TOOLTIP = Res.Get(StringId.InsertLinkTooltip) ; + private string INSERT_PICTURE_CAPTION = Res.Get(StringId.InsertPictureDotDotDot) ; + private string INSERT_PICTURE_ACCNAME = Res.Get(StringId.InsertPicture) ; + private string INSERT_PICTURE_TOOLTIP = Res.Get(StringId.InsertPictureTooltip) ; + private string INSERT_TABLE_CAPTION = Res.Get(StringId.InsertTableDotDotDot) ; + private string INSERT_TABLE_ACCNAME = Res.Get(StringId.InsertTable) ; + private string INSERT_TABLE_TOOLTIP = Res.Get(StringId.InsertTableTooltip) ; - private string WEBLOG_PANEL_CAPTION = Res.Get(StringId.Weblog) ; - private string OPEN_PANEL_CAPTION = Res.Get(StringId.Open) ; - private string DRAFTS_SECTION_CAPTION = Res.Get(StringId.Drafts) ; - private string RECENT_POSTS_SECTION_CAPTION = Res.Get(StringId.RecentlyPosted) ; - private string MORE_DRAFTS_CAPTION = Res.Get(StringId.MoreDotDotDot) ; - private string MORE_DRAFTS_ACCNAME = Res.Get(StringId.MoreDrafts) ; - private string MORE_DRAFTS_TOOLTIP = Res.Get(StringId.MoreDraftsTooltip) ; - private string MORE_POSTS_CAPTION = Res.Get(StringId.MoreDotDotDot) ; - private string MORE_POSTS_ACCNAME = Res.Get(StringId.MorePosts) ; - private string MORE_POSTS_TOOLTIP = Res.Get(StringId.MorePostsTooltip) ; - private string INSERT_PANEL_CAPTION = Res.Get(StringId.Insert) ; - private string INSERT_LINK_CAPTION = Res.Get(StringId.InsertLinkDotDotDot) ; - private string INSERT_LINK_ACCNAME = Res.Get(StringId.InsertLink) ; - private string INSERT_LINK_TOOLTIP = Res.Get(StringId.InsertLinkTooltip) ; - private string INSERT_PICTURE_CAPTION = Res.Get(StringId.InsertPictureDotDotDot) ; - private string INSERT_PICTURE_ACCNAME = Res.Get(StringId.InsertPicture) ; - private string INSERT_PICTURE_TOOLTIP = Res.Get(StringId.InsertPictureTooltip) ; - private string INSERT_TABLE_CAPTION = Res.Get(StringId.InsertTableDotDotDot) ; - private string INSERT_TABLE_ACCNAME = Res.Get(StringId.InsertTable) ; - private string INSERT_TABLE_TOOLTIP = Res.Get(StringId.InsertTableTooltip) ; + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } + _postEditingSite.WeblogChanged -= new WeblogHandler(_postEditingSite_WeblogChanged); + _postEditingSite.WeblogSettingsChanged -= new WeblogSettingsChangedHandler(_postEditingSite_WeblogSettingsChanged); + _postEditingSite.FrameWindow.Layout -= new LayoutEventHandler(FrameWindow_Layout); + _postEditingSite.PostListChanged -= new EventHandler(_postEditingSite_PostListChanged); + ContentSourceManager.GlobalContentSourceListChanged -= new EventHandler(ContentSourceManager_GlobalContentSourceListChanged); - _postEditingSite.WeblogChanged -= new WeblogHandler(_postEditingSite_WeblogChanged); - _postEditingSite.WeblogSettingsChanged -= new WeblogSettingsChangedHandler(_postEditingSite_WeblogSettingsChanged); - _postEditingSite.FrameWindow.Layout -= new LayoutEventHandler(FrameWindow_Layout); - _postEditingSite.PostListChanged -= new EventHandler(_postEditingSite_PostListChanged); - ContentSourceManager.GlobalContentSourceListChanged -= new EventHandler(ContentSourceManager_GlobalContentSourceListChanged); + _openPanelHeader.Dispose(); + _insertPanelHeader.Dispose(); + } + base.Dispose( disposing ); + } - _openPanelHeader.Dispose(); - _insertPanelHeader.Dispose(); - } - base.Dispose( disposing ); - } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + } + #endregion + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - components = new System.ComponentModel.Container(); - } - #endregion + internal class ContentInsertCommands + { + public ContentInsertCommands(Control parent, ToolTip parentToolTip, int linkCommandPadding, int maxCommands) + { + // save reference to parent and command padding + _parent = parent ; + _linkCommandPadding = linkCommandPadding ; + _maxCommands = maxCommands ; + _parentToolTip = parentToolTip ; - } + // update list of content-source commands + RefreshContentSourceCommands() ; + } - internal class ContentInsertCommands - { + public void RefreshContentSourceCommands() + { + _parent.SuspendLayout() ; + try + { + // clear existing commands + foreach ( LinkCommand linkCommand in _contentSourceCommands ) + linkCommand.Dispose() ; + _contentSourceCommands.Clear(); - public ContentInsertCommands(Control parent, ToolTip parentToolTip, int linkCommandPadding, int maxCommands) - { - // save reference to parent and command padding - _parent = parent ; - _linkCommandPadding = linkCommandPadding ; - _maxCommands = maxCommands ; - _parentToolTip = parentToolTip ; + if ( _addPluginCommand != null ) + { + _addPluginCommand.Dispose(); + _addPluginCommand = null ; + } - // update list of content-source commands - RefreshContentSourceCommands() ; - } + // get the commands + ContentSourceInfo[] contentSources = GetSidebarContentSources(_maxCommands) ; - public void RefreshContentSourceCommands() - { - _parent.SuspendLayout() ; - try - { - // clear existing commands - foreach ( LinkCommand linkCommand in _contentSourceCommands ) - linkCommand.Dispose() ; - _contentSourceCommands.Clear(); - - if ( _addPluginCommand != null ) - { - _addPluginCommand.Dispose(); - _addPluginCommand = null ; - } - - // get the commands - ContentSourceInfo[] contentSources = GetSidebarContentSources(_maxCommands) ; - - // add a link comment for each source - foreach (ContentSourceInfo contentSourceInfo in contentSources) - { + // add a link comment for each source + foreach (ContentSourceInfo contentSourceInfo in contentSources) + { if (contentSourceInfo.Id == PhotoAlbumContentSource.ID || contentSourceInfo.Id == WebImageContentSource.ID) continue; - LinkCommand linkCommand = new LinkCommand( - _parent, - contentSourceInfo.Image, - String.Format(CultureInfo.CurrentCulture, Res.Get(StringId.PluginInsertSidebarText), contentSourceInfo.InsertableContentSourceSidebarText), - String.Format(CultureInfo.CurrentCulture, Res.Get(StringId.PluginInsertSidebarText), contentSourceInfo.InsertableContentSourceSidebarText), - _parentToolTip, - null, //String.Format(CultureInfo.CurrentCulture, Res.Get(StringId.PluginInsertSidebarTooltip), contentSourceInfo.InsertableContentSourceMenuText), - contentSourceInfo.Id ) ; + LinkCommand linkCommand = new LinkCommand( + _parent, + contentSourceInfo.Image, + String.Format(CultureInfo.CurrentCulture, Res.Get(StringId.PluginInsertSidebarText), contentSourceInfo.InsertableContentSourceSidebarText), + String.Format(CultureInfo.CurrentCulture, Res.Get(StringId.PluginInsertSidebarText), contentSourceInfo.InsertableContentSourceSidebarText), + _parentToolTip, + null, //String.Format(CultureInfo.CurrentCulture, Res.Get(StringId.PluginInsertSidebarTooltip), contentSourceInfo.InsertableContentSourceMenuText), + contentSourceInfo.Id ) ; - _contentSourceCommands.Add(linkCommand) ; - } + _contentSourceCommands.Add(linkCommand) ; + } - // create add-plugin command - if (MarketizationOptions.IsFeatureEnabled(MarketizationOptions.Feature.WLGallery)) - { - Command addPluginCommand = ApplicationManager.CommandManager.Get(CommandId.AddPlugin) ; - _addPluginCommand = new LinkCommand(_parent, _parentToolTip, addPluginCommand.Identifier); - } - } - finally - { - _parent.ResumeLayout(); - } - } + // create add-plugin command + if (MarketizationOptions.IsFeatureEnabled(MarketizationOptions.Feature.WLGallery)) + { + Command addPluginCommand = ApplicationManager.CommandManager.Get(CommandId.AddPlugin) ; + _addPluginCommand = new LinkCommand(_parent, _parentToolTip, addPluginCommand.Identifier); + } + } + finally + { + _parent.ResumeLayout(); + } + } - public Rectangle Bounds = new Rectangle(); + public Rectangle Bounds = new Rectangle(); - public void Layout(Point startLocation) - { - Bounds.Location = startLocation ; - Bounds.Height = startLocation.Y - Bounds.Location.Y; + public void Layout(Point startLocation) + { + Bounds.Location = startLocation ; + Bounds.Height = startLocation.Y - Bounds.Location.Y; int floor = int.MaxValue; //_parent.ClientSize.Height - 50; - for (int i = 0; i < _contentSourceCommands.Count; i++) - { - LinkCommand linkCommand = (LinkCommand) _contentSourceCommands[i]; + for (int i = 0; i < _contentSourceCommands.Count; i++) + { + LinkCommand linkCommand = (LinkCommand) _contentSourceCommands[i]; - if (startLocation.Y > floor) - { - for (int j = i; j < _contentSourceCommands.Count; j++) - ((LinkCommand)_contentSourceCommands[j]).Visible = false; - break; - } + if (startLocation.Y > floor) + { + for (int j = i; j < _contentSourceCommands.Count; j++) + ((LinkCommand)_contentSourceCommands[j]).Visible = false; + break; + } - _laidOutContentCommands = true ; + _laidOutContentCommands = true ; - linkCommand.Visible = true; - // layout the link command - linkCommand.Layout(startLocation); + linkCommand.Visible = true; + // layout the link command + linkCommand.Layout(startLocation); - // update start location for next iteration - startLocation = new Point(startLocation.X, linkCommand.Bounds.Bottom + _linkCommandPadding); + // update start location for next iteration + startLocation = new Point(startLocation.X, linkCommand.Bounds.Bottom + _linkCommandPadding); - // update bounds - Bounds.Width = linkCommand.Bounds.Width ; - Bounds.Height = startLocation.Y - Bounds.Location.Y ; - } + // update bounds + Bounds.Width = linkCommand.Bounds.Width ; + Bounds.Height = startLocation.Y - Bounds.Location.Y ; + } - if ( _laidOutContentCommands && MarketizationOptions.IsFeatureEnabled(MarketizationOptions.Feature.WLGallery)) - { - // add the "add a plugin" command and update height - _addPluginCommand.Layout(new Point(startLocation.X, startLocation.Y + ADD_PLUGIN_PAD)); - Bounds.Height = _addPluginCommand.Bounds.Bottom - Bounds.Location.Y - _linkCommandPadding + 2; - } - } - private const int ADD_PLUGIN_PAD = 3 ; - private bool _laidOutContentCommands = false ; + if ( _laidOutContentCommands && MarketizationOptions.IsFeatureEnabled(MarketizationOptions.Feature.WLGallery)) + { + // add the "add a plugin" command and update height + _addPluginCommand.Layout(new Point(startLocation.X, startLocation.Y + ADD_PLUGIN_PAD)); + Bounds.Height = _addPluginCommand.Bounds.Bottom - Bounds.Location.Y - _linkCommandPadding + 2; + } + } + private const int ADD_PLUGIN_PAD = 3 ; + private bool _laidOutContentCommands = false ; - public void Paint(BidiGraphics g) - { - foreach ( LinkCommand linkCommand in _contentSourceCommands ) - linkCommand.Paint(g); + public void Paint(BidiGraphics g) + { + foreach ( LinkCommand linkCommand in _contentSourceCommands ) + linkCommand.Paint(g); - if (MarketizationOptions.IsFeatureEnabled(MarketizationOptions.Feature.WLGallery)) - { - int y = _addPluginCommand.Bounds.Y - ADD_PLUGIN_PAD ; - using ( Pen pen = PanelBody.CreateBorderPen() ) - g.DrawLine(pen, _addPluginCommand.Bounds.X, y, _parent.Right - _addPluginCommand.Bounds.X, y); + if (MarketizationOptions.IsFeatureEnabled(MarketizationOptions.Feature.WLGallery)) + { + int y = _addPluginCommand.Bounds.Y - ADD_PLUGIN_PAD ; + using ( Pen pen = PanelBody.CreateBorderPen() ) + g.DrawLine(pen, _addPluginCommand.Bounds.X, y, _parent.Right - _addPluginCommand.Bounds.X, y); - _addPluginCommand.Paint(g); - } - } + _addPluginCommand.Paint(g); + } + } - private ContentSourceInfo[] GetSidebarContentSources(int maxSources) - { - ArrayList sidebarContentSources = new ArrayList(); - if ( maxSources <= ContentSourceManager.BuiltInInsertableContentSources.Length ) - { - // clip the list of standard spources if necessary - for( int i=0; i i ) + { + string postType = posts[i].IsPage ? Res.Get(StringId.Page) : Res.Get(StringId.Post); + LinkLabels[i].AccessibleName = string.Format(CultureInfo.CurrentCulture, AccessibilityNameFormat, postType); + DeleteButtons[i].AccessibleName = string.Format(CultureInfo.CurrentCulture, Res.Get(StringId.DeleteSomething), LinkLabels[i].AccessibleName); - - internal abstract class PostList - { - public PostList(Control parent, ToolTip toolTip, string title) - { - _parent = parent ; - _toolTip = toolTip ; - _title = title ; - } - - public void SetPosts(PostInfo[] posts) - { - // copy posts into link labels - for ( int i=0; i i ) - { - string postType = posts[i].IsPage ? Res.Get(StringId.Page) : Res.Get(StringId.Post); - LinkLabels[i].AccessibleName = string.Format(CultureInfo.CurrentCulture, AccessibilityNameFormat, postType); - DeleteButtons[i].AccessibleName = string.Format(CultureInfo.CurrentCulture, Res.Get(StringId.DeleteSomething), LinkLabels[i].AccessibleName); - - LinkLabels[i].Text = posts[i].Title ; - string tooltipText = FormatToolTipText(posts[i]); - LinkLabels[i].AccessibleDescription = tooltipText; + LinkLabels[i].Text = posts[i].Title ; + string tooltipText = FormatToolTipText(posts[i]); + LinkLabels[i].AccessibleDescription = tooltipText; LinkLabels[i].LinkColor = ColorizedResources.Instance.SidebarLinkColor; - _toolTip.SetToolTip(LinkLabels[i], tooltipText); - LinkLabels[i].Tag = posts[i] ; - LinkLabels[i].Visible = true ; - _toolTip.SetToolTip(DeleteButtons[i], DeleteButtonToolTip); - DeleteButtons[i].Tag = posts[i] ; - DeleteButtons[i].Visible = true ; - DeleteButtons[i].AccessibleDescription = string.Format(CultureInfo.CurrentCulture, Res.Get(StringId.DeleteSomething), posts[i].Title); - } - else - { - LinkLabels[i].Text = String.Empty ; - LinkLabels[i].Tag = null ; - LinkLabels[i].Visible = false ; - DeleteButtons[i].Tag = null ; - DeleteButtons[i].Visible = false ; - } - } + _toolTip.SetToolTip(LinkLabels[i], tooltipText); + LinkLabels[i].Tag = posts[i] ; + LinkLabels[i].Visible = true ; + _toolTip.SetToolTip(DeleteButtons[i], DeleteButtonToolTip); + DeleteButtons[i].Tag = posts[i] ; + DeleteButtons[i].Visible = true ; + DeleteButtons[i].AccessibleDescription = string.Format(CultureInfo.CurrentCulture, Res.Get(StringId.DeleteSomething), posts[i].Title); + } + else + { + LinkLabels[i].Text = String.Empty ; + LinkLabels[i].Tag = null ; + LinkLabels[i].Visible = false ; + DeleteButtons[i].Tag = null ; + DeleteButtons[i].Visible = false ; + } + } - // note whether we have posts to display - _havePostsToDisplay = posts.Length > 0 ; - } + // note whether we have posts to display + _havePostsToDisplay = posts.Length > 0 ; + } - public event PostEventHandler PostSelected ; + public event PostEventHandler PostSelected ; - public event PostEventHandler PostDeleteRequested ; + public event PostEventHandler PostDeleteRequested ; - public Rectangle Bounds = new Rectangle(); + public Rectangle Bounds = new Rectangle(); private const int POSTLIST_INDENT = 15; - public void Layout(Point startLocation) - { - // make sure the link labels have a parent - Init() ; + public void Layout(Point startLocation) + { + // make sure the link labels have a parent + Init() ; - // initialize the bounds - Bounds.Location = startLocation ; - Bounds.Size = new Size( _parent.Width - startLocation.X, 0); + // initialize the bounds + Bounds.Location = startLocation ; + Bounds.Size = new Size( _parent.Width - startLocation.X, 0); - if ( _havePostsToDisplay ) - { - // position the visible link labels - int currentLocationY = startLocation.Y + LINK_TEXT_PADDING; - for (int i=0; i /// Clean up any resources being used. /// diff --git a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Sidebar/HtmlEditorSidebarTitle.cs b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Sidebar/HtmlEditorSidebarTitle.cs index 8c4b99f4..3bd50ce6 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Sidebar/HtmlEditorSidebarTitle.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Sidebar/HtmlEditorSidebarTitle.cs @@ -18,172 +18,169 @@ using OpenLiveWriter.Localization.Bidi; namespace OpenLiveWriter.PostEditor.PostHtmlEditing.Sidebar { - internal class HtmlEditorSidebarTitle : Panel - { - private const int TOP_INSET = 2; + internal class HtmlEditorSidebarTitle : Panel + { + private const int TOP_INSET = 2; - private BitmapButton buttonChevron; - private SidebarTitleUITheme _uiTheme; + private BitmapButton buttonChevron; + private SidebarTitleUITheme _uiTheme; - public HtmlEditorSidebarTitle() - { - // enable double buffered painting. - SetStyle(ControlStyles.UserPaint, true); - SetStyle(ControlStyles.DoubleBuffer, true); - SetStyle(ControlStyles.AllPaintingInWmPaint, true); + public HtmlEditorSidebarTitle() + { + // enable double buffered painting. + SetStyle(ControlStyles.UserPaint, true); + SetStyle(ControlStyles.DoubleBuffer, true); + SetStyle(ControlStyles.AllPaintingInWmPaint, true); - Height = 30; + Height = 30; - buttonChevron = new BitmapButton(this.components); - buttonChevron.ButtonStyle = ButtonStyle.Bitmap; - buttonChevron.ButtonText = Res.Get(StringId.HideSidebar); - buttonChevron.ToolTip = Res.Get(StringId.HideSidebar); - buttonChevron.Click += new EventHandler(ClickHandler); - buttonChevron.AccessibleName = Res.Get(StringId.HideSidebar); - buttonChevron.TabStop = true; - buttonChevron.TabIndex = 0; - buttonChevron.RightToLeft = (BidiHelper.IsRightToLeft ? RightToLeft.No : RightToLeft.Yes); - buttonChevron.AllowMirroring = true; - Controls.Add(buttonChevron); + buttonChevron = new BitmapButton(this.components); + buttonChevron.ButtonStyle = ButtonStyle.Bitmap; + buttonChevron.ButtonText = Res.Get(StringId.HideSidebar); + buttonChevron.ToolTip = Res.Get(StringId.HideSidebar); + buttonChevron.Click += new EventHandler(ClickHandler); + buttonChevron.AccessibleName = Res.Get(StringId.HideSidebar); + buttonChevron.TabStop = true; + buttonChevron.TabIndex = 0; + buttonChevron.RightToLeft = (BidiHelper.IsRightToLeft ? RightToLeft.No : RightToLeft.Yes); + buttonChevron.AllowMirroring = true; + Controls.Add(buttonChevron); + Click += new EventHandler(ClickHandler); - Click += new EventHandler(ClickHandler); + //create the UI theme + _uiTheme = new SidebarTitleUITheme(this); - //create the UI theme - _uiTheme = new SidebarTitleUITheme(this); + buttonChevron.Bounds = + RectangleHelper.Center(_uiTheme.bmpChevronRight.Size, new Rectangle(0, 0, 20, ClientSize.Height), false); + } - buttonChevron.Bounds = - RectangleHelper.Center(_uiTheme.bmpChevronRight.Size, new Rectangle(0, 0, 20, ClientSize.Height), false); - } + public void UpdateTitle( string titleText ) + { + Text = titleText ; + Invalidate(); + } - public void UpdateTitle( string titleText ) - { - Text = titleText ; - Invalidate(); - } - - protected override void OnPaint(PaintEventArgs e) - { - BidiGraphics g = new BidiGraphics(e.Graphics, ClientRectangle); + protected override void OnPaint(PaintEventArgs e) + { + BidiGraphics g = new BidiGraphics(e.Graphics, ClientRectangle); using (Brush b = new SolidBrush(ColorizedResources.Instance.BorderDarkColor)) - g.FillRectangle(b, ClientRectangle); + g.FillRectangle(b, ClientRectangle); - TextFormatFlags tf = TextFormatFlags.VerticalCenter; - int width = g.MeasureText(Text, Font).Width; + TextFormatFlags tf = TextFormatFlags.VerticalCenter; + int width = g.MeasureText(Text, Font).Width; g.DrawText(Text, Font, new Rectangle(20, -1, width, ClientSize.Height), _uiTheme.TextColor, tf); - } + } + /// + /// Close event (indicates that the user has hit the close button and wants + /// the tray hidden) + /// + public event EventHandler HideTitleBarClicked ; - /// - /// Close event (indicates that the user has hit the close button and wants - /// the tray hidden) - /// - public event EventHandler HideTitleBarClicked ; + /// + /// Fires the Close event + /// + /// event args + protected virtual void OnHideTitleBarClicked( EventArgs ea ) + { + if ( HideTitleBarClicked != null ) + HideTitleBarClicked( this, ea ) ; + } + /// + /// Handle close button click event + /// + /// sender + /// event args + private void ClickHandler(object sender, EventArgs e) + { + OnHideTitleBarClicked( EventArgs.Empty ) ; + } - /// - /// Fires the Close event - /// - /// event args - protected virtual void OnHideTitleBarClicked( EventArgs ea ) - { - if ( HideTitleBarClicked != null ) - HideTitleBarClicked( this, ea ) ; - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - /// - /// Handle close button click event - /// - /// sender - /// event args - private void ClickHandler(object sender, EventArgs e) - { - OnHideTitleBarClicked( EventArgs.Empty ) ; - } + private class SidebarTitleUITheme : ControlUITheme + { + private Bitmap bmpChevronRightBase = ResourceHelper.LoadAssemblyResourceBitmap("PostHtmlEditing.Sidebar.Images.ChevronRight.png"); + internal Bitmap bmpChevronRight; + private Bitmap bmpChevronRightHover = ResourceHelper.LoadAssemblyResourceBitmap("PostHtmlEditing.Sidebar.Images.ChevronRightHover.png"); + private Color _textColor; + private HtmlEditorSidebarTitle _sidebarTitleControl; + public SidebarTitleUITheme(HtmlEditorSidebarTitle sidebarTitleControl) : base(sidebarTitleControl, false) + { + _sidebarTitleControl = sidebarTitleControl; + ColorizedResources.Instance.ColorizationChanged += new EventHandler(ColorizationChanged); + ApplyTheme(); + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + protected override void Dispose() + { + ColorizedResources.Instance.ColorizationChanged -= new EventHandler(ColorizationChanged); + } - private class SidebarTitleUITheme : ControlUITheme - { - private Bitmap bmpChevronRightBase = ResourceHelper.LoadAssemblyResourceBitmap("PostHtmlEditing.Sidebar.Images.ChevronRight.png"); - internal Bitmap bmpChevronRight; - private Bitmap bmpChevronRightHover = ResourceHelper.LoadAssemblyResourceBitmap("PostHtmlEditing.Sidebar.Images.ChevronRightHover.png"); - private Color _textColor; - private HtmlEditorSidebarTitle _sidebarTitleControl; - public SidebarTitleUITheme(HtmlEditorSidebarTitle sidebarTitleControl) : base(sidebarTitleControl, false) - { - _sidebarTitleControl = sidebarTitleControl; - ColorizedResources.Instance.ColorizationChanged += new EventHandler(ColorizationChanged); - ApplyTheme(); - } + protected override void ApplyTheme(bool highContrast) + { + if(bmpChevronRight != null && bmpChevronRight != bmpChevronRightBase) + bmpChevronRight.Dispose(); - protected override void Dispose() - { - ColorizedResources.Instance.ColorizationChanged -= new EventHandler(ColorizationChanged); - } + if(highContrast) + { + _textColor = SystemColors.ControlText; + _sidebarTitleControl.buttonChevron.BackColor = SystemColors.Control; - protected override void ApplyTheme(bool highContrast) - { - if(bmpChevronRight != null && bmpChevronRight != bmpChevronRightBase) - bmpChevronRight.Dispose(); + //convert the chevon's White color to the Window Text color (fixes bug 437444) + bmpChevronRight = new Bitmap(bmpChevronRightBase); + ColorMap colorMap = new ColorMap(); + colorMap.OldColor = Color.White; + colorMap.NewColor = SystemColors.WindowText; + ImageHelper.ConvertColors(bmpChevronRight, colorMap); + } + else + { + _textColor = Color.White; + _sidebarTitleControl.buttonChevron.BackColor = ColorizedResources.Instance.SidebarHeaderBackgroundColor; + bmpChevronRight = bmpChevronRightBase; + } - if(highContrast) - { - _textColor = SystemColors.ControlText; - _sidebarTitleControl.buttonChevron.BackColor = SystemColors.Control; + _sidebarTitleControl.buttonChevron.BackColor = ColorizedResources.Instance.SidebarHeaderBackgroundColor; + _sidebarTitleControl.buttonChevron.BitmapEnabled = bmpChevronRight; + _sidebarTitleControl.buttonChevron.BitmapSelected = bmpChevronRightHover; + _sidebarTitleControl.buttonChevron.BitmapPushed = bmpChevronRightHover; + } - //convert the chevon's White color to the Window Text color (fixes bug 437444) - bmpChevronRight = new Bitmap(bmpChevronRightBase); - ColorMap colorMap = new ColorMap(); - colorMap.OldColor = Color.White; - colorMap.NewColor = SystemColors.WindowText; - ImageHelper.ConvertColors(bmpChevronRight, colorMap); - } - else - { - _textColor = Color.White; - _sidebarTitleControl.buttonChevron.BackColor = ColorizedResources.Instance.SidebarHeaderBackgroundColor; - bmpChevronRight = bmpChevronRightBase; - } + private void ColorizationChanged(object sender, EventArgs e) + { + _sidebarTitleControl.buttonChevron.BackColor = ColorizedResources.Instance.SidebarHeaderBackgroundColor; + } - _sidebarTitleControl.buttonChevron.BackColor = ColorizedResources.Instance.SidebarHeaderBackgroundColor; - _sidebarTitleControl.buttonChevron.BitmapEnabled = bmpChevronRight; - _sidebarTitleControl.buttonChevron.BitmapSelected = bmpChevronRightHover; - _sidebarTitleControl.buttonChevron.BitmapPushed = bmpChevronRightHover; - } + public Color TextColor { get { return _textColor; }} + } - private void ColorizationChanged(object sender, EventArgs e) - { - _sidebarTitleControl.buttonChevron.BackColor = ColorizedResources.Instance.SidebarHeaderBackgroundColor; - } + /// + /// Embedded components + /// + private Container components = new Container(); - public Color TextColor { get { return _textColor; }} - } - - /// - /// Embedded components - /// - private Container components = new Container(); - - // close button images - private const string IMAGE_RESOURCE_PATH = "Images." ; - private Bitmap closeButtonDisabled = ResourceHelper.LoadAssemblyResourceBitmap( IMAGE_RESOURCE_PATH + "CloseButtonDisabled.png") ; - private Bitmap closeButtonEnabled = ResourceHelper.LoadAssemblyResourceBitmap( IMAGE_RESOURCE_PATH + "CloseButtonEnabled.png") ; - private Bitmap closeButtonPushed = ResourceHelper.LoadAssemblyResourceBitmap( IMAGE_RESOURCE_PATH + "CloseButtonPushed.png") ; - private Bitmap closeButtonSelected = ResourceHelper.LoadAssemblyResourceBitmap( IMAGE_RESOURCE_PATH + "CloseButtonSelected.png") ; - } + // close button images + private const string IMAGE_RESOURCE_PATH = "Images." ; + private Bitmap closeButtonDisabled = ResourceHelper.LoadAssemblyResourceBitmap( IMAGE_RESOURCE_PATH + "CloseButtonDisabled.png") ; + private Bitmap closeButtonEnabled = ResourceHelper.LoadAssemblyResourceBitmap( IMAGE_RESOURCE_PATH + "CloseButtonEnabled.png") ; + private Bitmap closeButtonPushed = ResourceHelper.LoadAssemblyResourceBitmap( IMAGE_RESOURCE_PATH + "CloseButtonPushed.png") ; + private Bitmap closeButtonSelected = ResourceHelper.LoadAssemblyResourceBitmap( IMAGE_RESOURCE_PATH + "CloseButtonSelected.png") ; + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Sidebar/SidebarGutter.cs b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Sidebar/SidebarGutter.cs index fcab2ee2..33c69baf 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Sidebar/SidebarGutter.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/Sidebar/SidebarGutter.cs @@ -15,108 +15,107 @@ using OpenLiveWriter.Localization.Bidi; namespace OpenLiveWriter.PostEditor.PostHtmlEditing.Sidebar { - /// - /// Summary description for SidebarGutter. - /// - public class SidebarGutter : System.Windows.Forms.UserControl - { - const int BLOCK_HEIGHT = 30; + /// + /// Summary description for SidebarGutter. + /// + public class SidebarGutter : System.Windows.Forms.UserControl + { + const int BLOCK_HEIGHT = 30; - private Bitmap bitmapChevronLeft = ResourceHelper.LoadAssemblyResourceBitmap("PostHtmlEditing.Sidebar.Images.ChevronLeft.png"); - private Bitmap bitmapChevronLeftHover = ResourceHelper.LoadAssemblyResourceBitmap("PostHtmlEditing.Sidebar.Images.ChevronLeftHover.png"); + private Bitmap bitmapChevronLeft = ResourceHelper.LoadAssemblyResourceBitmap("PostHtmlEditing.Sidebar.Images.ChevronLeft.png"); + private Bitmap bitmapChevronLeftHover = ResourceHelper.LoadAssemblyResourceBitmap("PostHtmlEditing.Sidebar.Images.ChevronLeftHover.png"); - private BitmapButton buttonChevron; + private BitmapButton buttonChevron; - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; + /// + /// Required designer variable. + /// + private System.ComponentModel.Container components = null; - public SidebarGutter() - { - // This call is required by the Windows.Forms Form Designer. - InitializeComponent(); + public SidebarGutter() + { + // This call is required by the Windows.Forms Form Designer. + InitializeComponent(); - buttonChevron = new BitmapButton(this.components); - ColorizedResources.Instance.ColorizationChanged += new EventHandler(ColorizationChanged); - buttonChevron.BackColor = ColorizedResources.Instance.SidebarHeaderBackgroundColor; - buttonChevron.BitmapEnabled = bitmapChevronLeft; - buttonChevron.BitmapSelected = bitmapChevronLeftHover; - buttonChevron.BitmapPushed = bitmapChevronLeftHover; - buttonChevron.Bounds = - RectangleHelper.Center(new Size(10, 9), new Rectangle(0, 0, ClientSize.Width, BLOCK_HEIGHT), false); - buttonChevron.ButtonStyle = ButtonStyle.Bitmap; - buttonChevron.ButtonText = Res.Get(StringId.ShowSidebar); - buttonChevron.ToolTip = Res.Get(StringId.ShowSidebar); - buttonChevron.Click += new EventHandler(buttonChevron_Click); - buttonChevron.AccessibleName = Res.Get(StringId.ShowSidebar); - buttonChevron.TabStop = true; - buttonChevron.TabIndex = 0; + buttonChevron = new BitmapButton(this.components); + ColorizedResources.Instance.ColorizationChanged += new EventHandler(ColorizationChanged); + buttonChevron.BackColor = ColorizedResources.Instance.SidebarHeaderBackgroundColor; + buttonChevron.BitmapEnabled = bitmapChevronLeft; + buttonChevron.BitmapSelected = bitmapChevronLeftHover; + buttonChevron.BitmapPushed = bitmapChevronLeftHover; + buttonChevron.Bounds = + RectangleHelper.Center(new Size(10, 9), new Rectangle(0, 0, ClientSize.Width, BLOCK_HEIGHT), false); + buttonChevron.ButtonStyle = ButtonStyle.Bitmap; + buttonChevron.ButtonText = Res.Get(StringId.ShowSidebar); + buttonChevron.ToolTip = Res.Get(StringId.ShowSidebar); + buttonChevron.Click += new EventHandler(buttonChevron_Click); + buttonChevron.AccessibleName = Res.Get(StringId.ShowSidebar); + buttonChevron.TabStop = true; + buttonChevron.TabIndex = 0; buttonChevron.RightToLeft = (BidiHelper.IsRightToLeft ? RightToLeft.No : RightToLeft.Yes); - buttonChevron.AllowMirroring = true; - Controls.Add(buttonChevron); - AccessibleRole = AccessibleRole.PushButton; - } + buttonChevron.AllowMirroring = true; + Controls.Add(buttonChevron); + AccessibleRole = AccessibleRole.PushButton; + } - protected override void OnResize(EventArgs e) - { - base.OnResize (e); - Invalidate(); - } + protected override void OnResize(EventArgs e) + { + base.OnResize (e); + Invalidate(); + } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + ColorizedResources.Instance.ColorizationChanged -= new EventHandler(ColorizationChanged); + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - ColorizedResources.Instance.ColorizationChanged -= new EventHandler(ColorizationChanged); - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new Container(); + // + // SidebarGutter + // + this.Name = "SidebarGutter"; + this.Size = new System.Drawing.Size(12, 150); - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new Container(); - // - // SidebarGutter - // - this.Name = "SidebarGutter"; - this.Size = new System.Drawing.Size(12, 150); + } + #endregion - } - #endregion - - protected override void OnPaintBackground(PaintEventArgs e) - { - ColorizedResources colRes = ColorizedResources.Instance; - Color blockColor = colRes.SidebarHeaderBackgroundColor; + protected override void OnPaintBackground(PaintEventArgs e) + { + ColorizedResources colRes = ColorizedResources.Instance; + Color blockColor = colRes.SidebarHeaderBackgroundColor; using (Brush b = new SolidBrush(colRes.SidebarGradientBottomColor)) - e.Graphics.FillRectangle(b, ClientRectangle); - using (Brush b = new SolidBrush(blockColor)) - e.Graphics.FillRectangle(b, 0, 0, ClientSize.Width, BLOCK_HEIGHT); - } + e.Graphics.FillRectangle(b, ClientRectangle); + using (Brush b = new SolidBrush(blockColor)) + e.Graphics.FillRectangle(b, 0, 0, ClientSize.Width, BLOCK_HEIGHT); + } - private void buttonChevron_Click(object sender, EventArgs e) - { - OnClick(EventArgs.Empty); - } + private void buttonChevron_Click(object sender, EventArgs e) + { + OnClick(EventArgs.Empty); + } - private void ColorizationChanged(object sender, EventArgs e) - { - buttonChevron.BackColor = ColorizedResources.Instance.SidebarHeaderBackgroundColor; - } - } + private void ColorizationChanged(object sender, EventArgs e) + { + buttonChevron.BackColor = ColorizedResources.Instance.SidebarHeaderBackgroundColor; + } + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/SmartContentContextMenuDefinition.cs b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/SmartContentContextMenuDefinition.cs index d20c20ca..4949dd06 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/SmartContentContextMenuDefinition.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostHtmlEditing/SmartContentContextMenuDefinition.cs @@ -18,10 +18,10 @@ namespace OpenLiveWriter.PostEditor.PostHtmlEditing Entries.Add(CommandId.CopyCommand, false, false); Entries.Add(CommandId.Paste, false, true); /* - Entries.Add(CommandId.AlignLeft, false, false); - Entries.Add(CommandId.AlignCenter, false, false); - Entries.Add(CommandId.AlignRight, false, false); - */ + Entries.Add(CommandId.AlignLeft, false, false); + Entries.Add(CommandId.AlignCenter, false, false); + Entries.Add(CommandId.AlignRight, false, false); + */ } } } diff --git a/src/managed/OpenLiveWriter.PostEditor/PostPropertyEditing/CategoryControl/CategoryDisplayCheckControl.cs b/src/managed/OpenLiveWriter.PostEditor/PostPropertyEditing/CategoryControl/CategoryDisplayCheckControl.cs index 865ec20b..ff51b2e8 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostPropertyEditing/CategoryControl/CategoryDisplayCheckControl.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostPropertyEditing/CategoryControl/CategoryDisplayCheckControl.cs @@ -11,172 +11,171 @@ using OpenLiveWriter.HtmlParser.Parser; namespace OpenLiveWriter.PostEditor.PostPropertyEditing.CategoryControl { - internal interface ICategorySelectorControl - { - BlogPostCategory Category - { - get; - } + internal interface ICategorySelectorControl + { + BlogPostCategory Category + { + get; + } - bool Selected - { - get; set; - } + bool Selected + { + get; set; + } - Control Control - { - get; - } + Control Control + { + get; + } - event EventHandler SelectedChanged; - } + event EventHandler SelectedChanged; + } - internal class CategorySelectorControlFactory - { + internal class CategorySelectorControlFactory + { - private static CategorySelectorControlFactory _categorySelectionControlFactory; + private static CategorySelectorControlFactory _categorySelectionControlFactory; - public static CategorySelectorControlFactory Instance - { - get - { - if (_categorySelectionControlFactory == null) - _categorySelectionControlFactory = new CategorySelectorControlFactory(); - return _categorySelectionControlFactory; - } - } + public static CategorySelectorControlFactory Instance + { + get + { + if (_categorySelectionControlFactory == null) + _categorySelectionControlFactory = new CategorySelectorControlFactory(); + return _categorySelectionControlFactory; + } + } - public ICategorySelectorControl GetControl(BlogPostCategory category, bool multiSelect) - { - if (multiSelect) - return new CategoryCheckSelectorControl(category); - else - return new CategoryRadioSelectorControl(category); - } - } + public ICategorySelectorControl GetControl(BlogPostCategory category, bool multiSelect) + { + if (multiSelect) + return new CategoryCheckSelectorControl(category); + else + return new CategoryRadioSelectorControl(category); + } + } - internal class CategoryRadioSelectorControl: RadioButton, ICategorySelectorControl - { + internal class CategoryRadioSelectorControl: RadioButton, ICategorySelectorControl + { - public CategoryRadioSelectorControl(BlogPostCategory category) : base() - { - FlatStyle = FlatStyle.System; - _category = category; - } + public CategoryRadioSelectorControl(BlogPostCategory category) : base() + { + FlatStyle = FlatStyle.System; + _category = category; + } - protected override void OnCreateControl() - { - base.OnCreateControl(); - TextAlign = ContentAlignment.TopLeft ; // prevent wrapping - string categoryText = HtmlUtils.UnEscapeEntities(Category.Name, HtmlUtils.UnEscapeMode.Default); - Text = categoryText.Replace("&", "&&") ; - using ( Graphics g = CreateGraphics() ) - Height = Math.Max((int)Math.Ceiling(DisplayHelper.ScaleY(18)), Convert.ToInt32(Font.GetHeight(g))); - } + protected override void OnCreateControl() + { + base.OnCreateControl(); + TextAlign = ContentAlignment.TopLeft ; // prevent wrapping + string categoryText = HtmlUtils.UnEscapeEntities(Category.Name, HtmlUtils.UnEscapeMode.Default); + Text = categoryText.Replace("&", "&&") ; + using ( Graphics g = CreateGraphics() ) + Height = Math.Max((int)Math.Ceiling(DisplayHelper.ScaleY(18)), Convert.ToInt32(Font.GetHeight(g))); + } - #region ICategorySelectorControl Members + #region ICategorySelectorControl Members - public BlogPostCategory Category - { - get - { - return _category; - } - } - private BlogPostCategory _category; + public BlogPostCategory Category + { + get + { + return _category; + } + } + private BlogPostCategory _category; - public bool Selected - { - get - { - return Checked; - } - set - { - Checked = value; - } - } + public bool Selected + { + get + { + return Checked; + } + set + { + Checked = value; + } + } - public Control Control - { - get - { - return this; - } - } + public Control Control + { + get + { + return this; + } + } - public event EventHandler SelectedChanged; - protected override void OnCheckedChanged(EventArgs e) - { - if (SelectedChanged != null) - SelectedChanged(this, e); - base.OnCheckedChanged (e); - } + public event EventHandler SelectedChanged; + protected override void OnCheckedChanged(EventArgs e) + { + if (SelectedChanged != null) + SelectedChanged(this, e); + base.OnCheckedChanged (e); + } - #endregion + #endregion - } + } - internal class CategoryCheckSelectorControl : CheckBox, ICategorySelectorControl - { - public CategoryCheckSelectorControl(BlogPostCategory category) : base() - { - FlatStyle = FlatStyle.System; - _category = category; + internal class CategoryCheckSelectorControl : CheckBox, ICategorySelectorControl + { + public CategoryCheckSelectorControl(BlogPostCategory category) : base() + { + FlatStyle = FlatStyle.System; + _category = category; - } + } - protected override void OnCreateControl() - { - base.OnCreateControl(); - TextAlign = ContentAlignment.TopLeft ; // prevent wrapping - string categoryText = HtmlUtils.UnEscapeEntities(Category.Name, HtmlUtils.UnEscapeMode.Default); - Text = categoryText.Replace("&", "&&") ; - using ( Graphics g = CreateGraphics() ) - Height = Math.Max((int)Math.Ceiling(DisplayHelper.ScaleY(18)), Convert.ToInt32(Font.GetHeight(g))); - } + protected override void OnCreateControl() + { + base.OnCreateControl(); + TextAlign = ContentAlignment.TopLeft ; // prevent wrapping + string categoryText = HtmlUtils.UnEscapeEntities(Category.Name, HtmlUtils.UnEscapeMode.Default); + Text = categoryText.Replace("&", "&&") ; + using ( Graphics g = CreateGraphics() ) + Height = Math.Max((int)Math.Ceiling(DisplayHelper.ScaleY(18)), Convert.ToInt32(Font.GetHeight(g))); + } - #region ICategorySelectorControl Members + #region ICategorySelectorControl Members - public BlogPostCategory Category - { - get - { - return _category; - } - } - private BlogPostCategory _category; + public BlogPostCategory Category + { + get + { + return _category; + } + } + private BlogPostCategory _category; - public bool Selected - { - get - { - return Checked; - } - set - { - Checked = value; - } - } + public bool Selected + { + get + { + return Checked; + } + set + { + Checked = value; + } + } - public Control Control - { - get - { - return this; - } - } + public Control Control + { + get + { + return this; + } + } - public event EventHandler SelectedChanged; - protected override void OnCheckedChanged(EventArgs e) - { - if (SelectedChanged != null) - SelectedChanged(this, e); - base.OnCheckedChanged (e); - } + public event EventHandler SelectedChanged; + protected override void OnCheckedChanged(EventArgs e) + { + if (SelectedChanged != null) + SelectedChanged(this, e); + base.OnCheckedChanged (e); + } - - #endregion - } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/PostPropertyEditing/CategoryControl/CategoryDisplayFormM1.cs b/src/managed/OpenLiveWriter.PostEditor/PostPropertyEditing/CategoryControl/CategoryDisplayFormM1.cs index 4e71af15..9dd4a879 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostPropertyEditing/CategoryControl/CategoryDisplayFormM1.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostPropertyEditing/CategoryControl/CategoryDisplayFormM1.cs @@ -22,229 +22,223 @@ using OpenLiveWriter.Localization.Bidi; namespace OpenLiveWriter.PostEditor.PostPropertyEditing.CategoryControl { - /// - /// Summary description for CategoryDisplayForm. - /// - internal class CategoryDisplayFormM1 : MiniForm - { - public CategoryDisplayFormM1(Control parentControl, CategoryContext categoryContext) - { - SuppressAutoRtlFixup = true; - // save references and signup for changed event - _parentControl = parentControl; - _categoryContext = categoryContext; - _categoryContext.Changed += new CategoryContext.CategoryChangedEventHandler(_categoryContext_Changed); + /// + /// Summary description for CategoryDisplayForm. + /// + internal class CategoryDisplayFormM1 : MiniForm + { + public CategoryDisplayFormM1(Control parentControl, CategoryContext categoryContext) + { + SuppressAutoRtlFixup = true; + // save references and signup for changed event + _parentControl = parentControl; + _categoryContext = categoryContext; + _categoryContext.Changed += new CategoryContext.CategoryChangedEventHandler(_categoryContext_Changed); - // standard designer stuff - InitializeComponent(); + // standard designer stuff + InitializeComponent(); - this.buttonAdd.Text = Res.Get(StringId.AddButton2); + this.buttonAdd.Text = Res.Get(StringId.AddButton2); - // mini form behavior - DismissOnDeactivate = true; + // mini form behavior + DismissOnDeactivate = true; - // dynamic background colors based on theme - BackColor = ColorizedResources.Instance.FrameGradientLight ; - categoryRefreshControl.BackColor = ColorizedResources.Instance.FrameGradientLight ; - categoryContainerControl.BackColor = SystemColors.Window ; + // dynamic background colors based on theme + BackColor = ColorizedResources.Instance.FrameGradientLight ; + categoryRefreshControl.BackColor = ColorizedResources.Instance.FrameGradientLight ; + categoryContainerControl.BackColor = SystemColors.Window ; - // dynamic layout depending upon whether we support adding categories - if ( categoryContext.SupportsAddingCategories ) - { - textBoxAddCategory.MaxLength = categoryContext.MaxCategoryNameLength ; - } - else - { - int gap = categoryContainerControl.Top - panelAddCategory.Top ; - panelAddCategory.Visible = false ; - categoryContainerControl.Top = panelAddCategory.Top + 2 ; - categoryContainerControl.Height += gap ; - } + // dynamic layout depending upon whether we support adding categories + if ( categoryContext.SupportsAddingCategories ) + { + textBoxAddCategory.MaxLength = categoryContext.MaxCategoryNameLength ; + } + else + { + int gap = categoryContainerControl.Top - panelAddCategory.Top ; + panelAddCategory.Visible = false ; + categoryContainerControl.Top = panelAddCategory.Top + 2 ; + categoryContainerControl.Height += gap ; + } - // dynamic layout depending upon whether we support heirarchical categories - if ( !categoryContext.SupportsHierarchicalCategories ) - { - textBoxAddCategory.Width += (comboBoxParent.Right - textBoxAddCategory.Right); - comboBoxParent.Visible = false ; - } + // dynamic layout depending upon whether we support heirarchical categories + if ( !categoryContext.SupportsHierarchicalCategories ) + { + textBoxAddCategory.Width += (comboBoxParent.Right - textBoxAddCategory.Right); + comboBoxParent.Visible = false ; + } - // initialize add textbox - ClearAddTextBox() ; + // initialize add textbox + ClearAddTextBox() ; - // initialize category control - categoryRefreshControl.Initialize(_categoryContext); - } + // initialize category control + categoryRefreshControl.Initialize(_categoryContext); + } - public int MaxDropDownWidth - { - get { return _maxDropDownWidth; } - set { _maxDropDownWidth = value; } - } + public int MaxDropDownWidth + { + get { return _maxDropDownWidth; } + set { _maxDropDownWidth = value; } + } - public int MinDropDownWidth - { - get { return _minDropDownWidth; } - set { _minDropDownWidth = value; } - } + public int MinDropDownWidth + { + get { return _minDropDownWidth; } + set { _minDropDownWidth = value; } + } - private int _maxDropDownWidth = 260; - private int _minDropDownWidth = 104; + private int _maxDropDownWidth = 260; + private int _minDropDownWidth = 104; + protected override void OnLoad(EventArgs e) + { + base.OnLoad(e); - protected override void OnLoad(EventArgs e) - { - base.OnLoad(e); - - RefreshParentCombo(); + RefreshParentCombo(); + if (panelAddCategory.Visible) + { + if (comboBoxParent.Visible) + { + DisplayHelper.AutoFitSystemButton(buttonAdd); + using (new AutoGrow(this, AnchorStyles.Bottom | AnchorStyles.Right, false)) + { + textBoxAddCategory.Width = buttonAdd.Right - textBoxAddCategory.Left; - if (panelAddCategory.Visible) - { - if (comboBoxParent.Visible) - { - DisplayHelper.AutoFitSystemButton(buttonAdd); - using (new AutoGrow(this, AnchorStyles.Bottom | AnchorStyles.Right, false)) - { - textBoxAddCategory.Width = buttonAdd.Right - textBoxAddCategory.Left; + DisplayHelper.AutoFitSystemCombo(comboBoxParent, 0, int.MaxValue, true); + comboBoxParent.Left = textBoxAddCategory.Left; + comboBoxParent.Top = textBoxAddCategory.Bottom + ScaleY(3); + buttonAdd.Top = comboBoxParent.Top + (comboBoxParent.Height - buttonAdd.Height) / 2; + buttonAdd.Left = comboBoxParent.Right + ScaleX(3); - DisplayHelper.AutoFitSystemCombo(comboBoxParent, 0, int.MaxValue, true); - comboBoxParent.Left = textBoxAddCategory.Left; - comboBoxParent.Top = textBoxAddCategory.Bottom + ScaleY(3); - buttonAdd.Top = comboBoxParent.Top + (comboBoxParent.Height - buttonAdd.Height) / 2; - buttonAdd.Left = comboBoxParent.Right + ScaleX(3); + if (buttonAdd.Right > textBoxAddCategory.Right) + { + int deltaX = buttonAdd.Right - textBoxAddCategory.Right; + textBoxAddCategory.Width += deltaX; + using (LayoutHelper.SuspendAnchoring(textBoxAddCategory, buttonAdd, comboBoxParent)) + panelAddCategory.Width += deltaX; + categoryContainerControl.Width += deltaX; + } + else + { + buttonAdd.Left = textBoxAddCategory.Right - buttonAdd.Width; + comboBoxParent.Width = buttonAdd.Left - comboBoxParent.Left - ScaleX(3); + } - if (buttonAdd.Right > textBoxAddCategory.Right) - { - int deltaX = buttonAdd.Right - textBoxAddCategory.Right; - textBoxAddCategory.Width += deltaX; - using (LayoutHelper.SuspendAnchoring(textBoxAddCategory, buttonAdd, comboBoxParent)) - panelAddCategory.Width += deltaX; - categoryContainerControl.Width += deltaX; - } - else - { - buttonAdd.Left = textBoxAddCategory.Right - buttonAdd.Width; - comboBoxParent.Width = buttonAdd.Left - comboBoxParent.Left - ScaleX(3); - } + int deltaY = comboBoxParent.Bottom - textBoxAddCategory.Bottom; + panelAddCategory.Height += deltaY; + categoryContainerControl.Top += deltaY; + categoryRefreshControl.Top += deltaY; + } + } + else + { + using (new AutoGrow(this, AnchorStyles.Right, false)) + { + int deltaX = -buttonAdd.Width + DisplayHelper.AutoFitSystemButton(buttonAdd); + textBoxAddCategory.Width -= deltaX; - int deltaY = comboBoxParent.Bottom - textBoxAddCategory.Bottom; - panelAddCategory.Height += deltaY; - categoryContainerControl.Top += deltaY; - categoryRefreshControl.Top += deltaY; - } - } - else - { - using (new AutoGrow(this, AnchorStyles.Right, false)) - { - int deltaX = -buttonAdd.Width + DisplayHelper.AutoFitSystemButton(buttonAdd); - textBoxAddCategory.Width -= deltaX; - - int desiredWidth = DisplayHelper.MeasureString(textBoxAddCategory, textBoxAddCategory.Text).Width + (int)DisplayHelper.ScaleX(10); - deltaX += desiredWidth - textBoxAddCategory.Width; - if (deltaX > 0) - { - panelAddCategory.Width += deltaX; - categoryContainerControl.Width += deltaX; + int desiredWidth = DisplayHelper.MeasureString(textBoxAddCategory, textBoxAddCategory.Text).Width + (int)DisplayHelper.ScaleX(10); + deltaX += desiredWidth - textBoxAddCategory.Width; + if (deltaX > 0) + { + panelAddCategory.Width += deltaX; + categoryContainerControl.Width += deltaX; // textBoxAddCategory.Width += deltaX; // buttonAdd.Left = textBoxAddCategory.Right + ScaleX(3); // textBoxAddCategory.Width = Math.Max(desiredWidth, textBoxAddCategory.Width); // textBoxAddCategory.Width = buttonAdd.Left - textBoxAddCategory.Left - ScaleX(3); - } - } - } + } + } + } - /*using (LayoutHelper.SuspendAnchoring(comboBoxParent, buttonAdd, textBoxAddCategory, panelAddCategory, categoryContainerControl)) - { - if (comboBoxParent.Visible) - { - deltaW = -comboBoxParent.Width + DisplayHelper.AutoFitSystemCombo(comboBoxParent, 0, int.MaxValue, true); - buttonAdd.Left += deltaW; - } + /*using (LayoutHelper.SuspendAnchoring(comboBoxParent, buttonAdd, textBoxAddCategory, panelAddCategory, categoryContainerControl)) + { + if (comboBoxParent.Visible) + { + deltaW = -comboBoxParent.Width + DisplayHelper.AutoFitSystemCombo(comboBoxParent, 0, int.MaxValue, true); + buttonAdd.Left += deltaW; + } - int oldWidth = buttonAdd.Width; - DisplayHelper.AutoFitSystemButton(buttonAdd); - buttonAdd.Width += (int)DisplayHelper.ScaleX(6); // add some more "air" in the Add button - deltaW += buttonAdd.Width - oldWidth; + int oldWidth = buttonAdd.Width; + DisplayHelper.AutoFitSystemButton(buttonAdd); + buttonAdd.Width += (int)DisplayHelper.ScaleX(6); // add some more "air" in the Add button + deltaW += buttonAdd.Width - oldWidth; - panelAddCategory.Width += deltaW; - categoryContainerControl.Width += deltaW; - Width += deltaW; - }*/ - } + panelAddCategory.Width += deltaW; + categoryContainerControl.Width += deltaW; + Width += deltaW; + }*/ + } - // use design time defaults to drive dynamic layout - _topMargin = categoryContainerControl.Top ; - _bottomMargin = Bottom - categoryContainerControl.Bottom ; + // use design time defaults to drive dynamic layout + _topMargin = categoryContainerControl.Top ; + _bottomMargin = Bottom - categoryContainerControl.Bottom ; - using (new AutoGrow(this, AnchorStyles.Right, false)) - LayoutControls(_categoryContext, true, false); - UpdateSelectedCategories(_categoryContext.SelectedCategories); + using (new AutoGrow(this, AnchorStyles.Right, false)) + LayoutControls(_categoryContext, true, false); + UpdateSelectedCategories(_categoryContext.SelectedCategories); - BidiHelper.RtlLayoutFixup(this); - } + BidiHelper.RtlLayoutFixup(this); + } + private System.Windows.Forms.Panel panelAddCategory; + private System.Windows.Forms.TextBox textBoxAddCategory; + private System.Windows.Forms.Button buttonAdd; + private OpenLiveWriter.PostEditor.PostPropertyEditing.CategoryControl.CategoryRefreshControl categoryRefreshControl; + private ParentCategoryComboBox comboBoxParent; - private System.Windows.Forms.Panel panelAddCategory; - private System.Windows.Forms.TextBox textBoxAddCategory; - private System.Windows.Forms.Button buttonAdd; - private OpenLiveWriter.PostEditor.PostPropertyEditing.CategoryControl.CategoryRefreshControl categoryRefreshControl; - private ParentCategoryComboBox comboBoxParent; + protected override CreateParams CreateParams + { + get + { + CreateParams createParams = base.CreateParams; + + // Borderless windows show in the alt+tab window, so this fakes + // out windows into thinking its a tool window (which doesn't + // show up in the alt+tab window). + createParams.ExStyle |= 0x00000080; // WS_EX_TOOLWINDOW + + return createParams; + } + } - protected override CreateParams CreateParams - { - get - { - CreateParams createParams = base.CreateParams; + protected override bool ProcessCmdKey(ref Message msg, Keys keyData) + { + if ( keyData == Keys.Enter ) + { + if ( textBoxAddCategory.ContainsFocus ) + { + AddCategory() ; + return true ; + } + else if ( categoryContainerControl.ContainsFocus ) + { + Close() ; + return true ; + } + else + { + return false ; + } + } - // Borderless windows show in the alt+tab window, so this fakes - // out windows into thinking its a tool window (which doesn't - // show up in the alt+tab window). - createParams.ExStyle |= 0x00000080; // WS_EX_TOOLWINDOW + else if (keyData == Keys.Escape ) + { + Close(); + return true; + } - return createParams; - } - } + return base.ProcessCmdKey(ref msg, keyData); + } - - - protected override bool ProcessCmdKey(ref Message msg, Keys keyData) - { - if ( keyData == Keys.Enter ) - { - if ( textBoxAddCategory.ContainsFocus ) - { - AddCategory() ; - return true ; - } - else if ( categoryContainerControl.ContainsFocus ) - { - Close() ; - return true ; - } - else - { - return false ; - } - } - - else if (keyData == Keys.Escape ) - { - Close(); - return true; - } - - return base.ProcessCmdKey(ref msg, keyData); - } - - - protected override void OnPaintBackground(PaintEventArgs e) - { - base.OnPaintBackground(e); + protected override void OnPaintBackground(PaintEventArgs e) + { + base.OnPaintBackground(e); // I don't know why this is necessary, but when RightToLeft and RightToLeftLayout // are both true, the rightmost column or two of pixels get clipped unless we @@ -252,725 +246,718 @@ namespace OpenLiveWriter.PostEditor.PostPropertyEditing.CategoryControl e.Graphics.ResetClip(); // draw border around form - using ( Pen pen = new Pen(ColorizedResources.Instance.BorderDarkColor) ) - e.Graphics.DrawRectangle(pen, 0, 0, ClientSize.Width - 1, ClientSize.Height - 1); + using ( Pen pen = new Pen(ColorizedResources.Instance.BorderDarkColor) ) + e.Graphics.DrawRectangle(pen, 0, 0, ClientSize.Width - 1, ClientSize.Height - 1); - // draw border around category control + // draw border around category control Color controlBorderColor = ColorHelper.GetThemeBorderColor(ColorizedResources.Instance.BorderDarkColor) ; - using ( Pen pen = new Pen( controlBorderColor, 1 )) - { - Rectangle categoryRect = categoryContainerControl.Bounds ; - categoryRect.Inflate(1,1); - e.Graphics.DrawRectangle(pen, categoryRect); - } - } + using ( Pen pen = new Pen( controlBorderColor, 1 )) + { + Rectangle categoryRect = categoryContainerControl.Bounds ; + categoryRect.Inflate(1,1); + e.Graphics.DrawRectangle(pen, categoryRect); + } + } + private int _topMargin ; + private int _bottomMargin ; + private Panel categoryContainerControl; - private int _topMargin ; - private int _bottomMargin ; - private Panel categoryContainerControl; + private void LayoutControls(CategoryContext categoryContext, bool sizeForm, bool performRtlLayoutFixup) + { + ClearForm(); + SuspendLayout(); - private void LayoutControls(CategoryContext categoryContext, bool sizeForm, bool performRtlLayoutFixup) - { - ClearForm(); - SuspendLayout(); + // calculate how much room there is above me on the parent form + int parentControlY = _parentControl.PointToScreen(_parentControl.Location).Y ; + Form parentForm = _parentControl.FindForm() ; + int parentFormY = parentForm.PointToScreen(parentForm.ClientRectangle.Location).Y ; + int maxHeight = parentControlY - parentFormY - ScaleY(_topMargin) - ScaleY(_bottomMargin); - // calculate how much room there is above me on the parent form - int parentControlY = _parentControl.PointToScreen(_parentControl.Location).Y ; - Form parentForm = _parentControl.FindForm() ; - int parentFormY = parentForm.PointToScreen(parentForm.ClientRectangle.Location).Y ; - int maxHeight = parentControlY - parentFormY - ScaleY(_topMargin) - ScaleY(_bottomMargin); + // enforce additional constraint (or not, let freedom reign!) + //maxHeight = Math.Min(maxHeight, 400) ; - // enforce additional constraint (or not, let freedom reign!) - //maxHeight = Math.Min(maxHeight, 400) ; + using (PositionManager positionManager = new PositionManager(ScaleX(X_MARGIN), ScaleY(Y_MARGIN + 2), ScaleY(4), ScaleX(MinDropDownWidth), categoryContainerControl.Width, maxHeight, scale)) + { + // add 'none' if we're single selecting categories + if (categoryContext.SelectionMode != CategoryContext.SelectionModes.MultiSelect) + AddCategoryControl(new BlogPostCategoryListItem(new BlogPostCategoryNone(), 0), positionManager); - using (PositionManager positionManager = new PositionManager(ScaleX(X_MARGIN), ScaleY(Y_MARGIN + 2), ScaleY(4), ScaleX(MinDropDownWidth), categoryContainerControl.Width, maxHeight, scale)) - { - // add 'none' if we're single selecting categories - if (categoryContext.SelectionMode != CategoryContext.SelectionModes.MultiSelect) - AddCategoryControl(new BlogPostCategoryListItem(new BlogPostCategoryNone(), 0), positionManager); + // add the other categories + BlogPostCategoryListItem[] categoryListItems = BlogPostCategoryListItem.BuildList(categoryContext.Categories, true) ; + foreach(BlogPostCategoryListItem categoryListItem in categoryListItems) + AddCategoryControl(categoryListItem, positionManager) ; - // add the other categories - BlogPostCategoryListItem[] categoryListItems = BlogPostCategoryListItem.BuildList(categoryContext.Categories, true) ; - foreach(BlogPostCategoryListItem categoryListItem in categoryListItems) - AddCategoryControl(categoryListItem, positionManager) ; + if ( sizeForm ) + PositionAndSizeForm(positionManager); + } + if (performRtlLayoutFixup) + BidiHelper.RtlLayoutFixup(categoryContainerControl); + ResumeLayout(); + } - if ( sizeForm ) - PositionAndSizeForm(positionManager); - } - if (performRtlLayoutFixup) - BidiHelper.RtlLayoutFixup(categoryContainerControl); - ResumeLayout(); - } - - private BlogPostCategory[] GetCategories(CategoryContext context) - { - ArrayList categories = new ArrayList(context.Categories); - categories.Sort(); + private BlogPostCategory[] GetCategories(CategoryContext context) + { + ArrayList categories = new ArrayList(context.Categories); + categories.Sort(); + return (BlogPostCategory[]) categories.ToArray(typeof (BlogPostCategory)); + } - return (BlogPostCategory[]) categories.ToArray(typeof (BlogPostCategory)); - } + private void ClearForm() + { + if (_categoryControls.Count > 0) + { + categoryContainerControl.Controls.Clear(); + _categoryControls.Clear(); + } + } - private void ClearForm() - { - if (_categoryControls.Count > 0) - { - categoryContainerControl.Controls.Clear(); - _categoryControls.Clear(); - } - } + private void AddCategoryControl(BlogPostCategoryListItem categoryListItem, PositionManager positionManager) + { + ICategorySelectorControl catSelector = + CategorySelectorControlFactory.Instance.GetControl(categoryListItem.Category, + (_categoryContext.SelectionMode == + CategoryContext.SelectionModes.MultiSelect)); + catSelector.SelectedChanged += new EventHandler(catSelector_SelectedChanged); - private void AddCategoryControl(BlogPostCategoryListItem categoryListItem, PositionManager positionManager) - { - ICategorySelectorControl catSelector = - CategorySelectorControlFactory.Instance.GetControl(categoryListItem.Category, - (_categoryContext.SelectionMode == - CategoryContext.SelectionModes.MultiSelect)); - catSelector.SelectedChanged += new EventHandler(catSelector_SelectedChanged); + catSelector.Control.Scale(new SizeF(scale.X, scale.Y)); - catSelector.Control.Scale(new SizeF(scale.X, scale.Y)); + positionManager.PositionControl(catSelector.Control, categoryListItem.IndentLevel); - positionManager.PositionControl(catSelector.Control, categoryListItem.IndentLevel); + categoryContainerControl.Controls.Add(catSelector.Control); - categoryContainerControl.Controls.Add(catSelector.Control); + _categoryControls.Add(catSelector.Control); + } - _categoryControls.Add(catSelector.Control); - } + private void PositionAndSizeForm(PositionManager manager) + { + // determine height based on position manager calculations + categoryContainerControl.Height = manager.Height; + Height = manager.Height + ScaleY(_topMargin) + ScaleY(_bottomMargin) ; - private void PositionAndSizeForm(PositionManager manager) - { - // determine height based on position manager calculations - categoryContainerControl.Height = manager.Height; - Height = manager.Height + ScaleY(_topMargin) + ScaleY(_bottomMargin) ; + Point bottomRightCorner = + _parentControl.PointToScreen(new Point(_parentControl.Width - Width, -Height)); + Location = bottomRightCorner; + } - - Point bottomRightCorner = - _parentControl.PointToScreen(new Point(_parentControl.Width - Width, -Height)); - Location = bottomRightCorner; - } - - #region High DPI Scaling + #region High DPI Scaling protected override void ScaleControl(SizeF factor, BoundsSpecified specified) { SaveScaleState(factor.Width, factor.Height); base.ScaleControl(factor, specified); } - protected override void ScaleCore(float dx, float dy) - { - SaveScaleState(dx, dy); - base.ScaleCore(dx, dy); - } - - private void SaveScaleState(float dx, float dy) - { - scale = new PointF(scale.X*dx, scale.Y*dy); - - //synchronize the comboBoxParent item height so it matches the scaled control height. - //Note: ScaleY(3) is padding to deal with mismatches in the way the ItemHeight scales versus its peer controls... - //comboBoxParent.ItemHeight = (int) (comboBoxParent.ItemHeight*dy) + ScaleY(3); - comboBoxParent.ItemHeight = (int) (comboBoxParent.ItemHeight*dy) + (scale.Y == 1f ? 0 : ScaleY(3)); - } - - private PointF scale = new PointF(1f, 1f); - - protected int ScaleX(int x) - { - return (int) (x*scale.X); - } - - protected int ScaleY(int y) - { - return (int) (y*scale.Y); - } - #endregion - - private const int Y_MARGIN = 2; - private const int X_MARGIN = 4; - - private void CommitSelection() - { - ArrayList selectedCategories = new ArrayList(); - foreach (ICategorySelectorControl categoryControl in _categoryControls) - { - if (categoryControl.Selected) - { - if (BlogPostCategoryNone.IsCategoryNone(categoryControl.Category)) - { - selectedCategories.Clear(); - break; - } - else - { - selectedCategories.Add(categoryControl.Category); - } - } - } - _categoryContext.SelectedCategories = (BlogPostCategory[]) selectedCategories.ToArray(typeof (BlogPostCategory)); - } - - private BlogPostCategory[] GetCurrentlySelectedCategories() - { - ArrayList selectedCategories = new ArrayList(); - foreach (ICategorySelectorControl sc in _categoryControls) - { - if (sc.Selected) - { - if (BlogPostCategoryNone.IsCategoryNone(sc.Category)) - { - selectedCategories.Clear(); - break; - } - else - { - selectedCategories.Add(sc.Category); - } - } - } - return (BlogPostCategory[]) selectedCategories.ToArray(typeof (BlogPostCategory)); - } - - private void UpdateSelectedCategories(BlogPostCategory[] selectedCategories) - { - bool focused = false; - foreach (ICategorySelectorControl sc in _categoryControls) - { - if (!focused) - { - sc.Control.Focus(); - focused = true; - } - sc.Selected = false; - } - - if (selectedCategories.Length > 0) - { - foreach (BlogPostCategory c in selectedCategories) - foreach (ICategorySelectorControl sc in _categoryControls) - { - if (c.Id.ToLower(CultureInfo.CurrentCulture) == sc.Category.Id.ToLower(CultureInfo.CurrentCulture) || - c.Name.ToLower(CultureInfo.CurrentCulture) == sc.Category.Name.ToLower(CultureInfo.CurrentCulture) ) - { - sc.Selected = true; - break; - } - } - } - else - { - // scan for special "None" category and select it - foreach (ICategorySelectorControl sc in _categoryControls) - { - if (BlogPostCategoryNone.IsCategoryNone((sc.Category))) - { - sc.Selected = true; - break; - } - } - } - } - - - private void textBoxAddCategory_Enter(object sender, System.EventArgs e) - { - if ( textBoxAddCategory.Text == Res.Get(StringId.CategoryAdd) ) - ActivateAddTextBoxForEdit() ; - } - - private void textBoxAddCategory_Leave(object sender, System.EventArgs e) - { - if ( textBoxAddCategory.Text.Trim() == String.Empty ) - ClearAddTextBox() ; - } - - private void ClearAddTextBox() - { - textBoxAddCategory.ForeColor = SystemColors.GrayText ; - textBoxAddCategory.Text = Res.Get(StringId.CategoryAdd); - } - - private void ActivateAddTextBoxForEdit() - { - textBoxAddCategory.ForeColor = SystemColors.ControlText; - textBoxAddCategory.Text = String.Empty ; - } - - private void buttonAdd_Click(object sender, System.EventArgs e) - { - AddCategory() ; - } - - private void AddCategory() - { - // add the new category - BlogPostCategory newCategory = GetNewCategory() ; - - // see if the "new" category is already in our list - if ( newCategory != null ) - { - ICategorySelectorControl selectorControl = GetCategorySelectorControl(newCategory) ; - - // if there is no existing selector control then add the category - if ( selectorControl == null ) - _categoryContext.AddNewCategory(newCategory); - - // now re-lookup the selector control and select it - selectorControl = GetCategorySelectorControl(newCategory) ; - selectorControl.Selected = true ; - - // ensure the added category is scrolled into view - categoryContainerControl.ScrollControlIntoView(selectorControl.Control); - - // clear the parent combo and update its ui - comboBoxParent.SelectedIndex = 0 ; - UpdateParentComboForeColor() ; - - // setup the text box to add another category if we support multiple categories - if ( _categoryContext.SelectionMode == CategoryContext.SelectionModes.MultiSelect ) - { - ActivateAddTextBoxForEdit() ; - textBoxAddCategory.Focus() ; - } - else - { - ClearAddTextBox() ; - selectorControl.Control.Focus() ; - } - } - } - - - private BlogPostCategory GetNewCategory() - { - if ( textBoxAddCategory.ForeColor == SystemColors.ControlText ) - { - string categoryName = this.textBoxAddCategory.Text.Trim() ; - if ( categoryName != String.Empty ) - { - // see if we have a parent - BlogPostCategory parentCategory = GetParentCategory() ; - if ( parentCategory != null ) - return new BlogPostCategory(categoryName, categoryName, parentCategory.Id); - else - return new BlogPostCategory(categoryName); - } - else - { - return null ; - } - } - else - { - return null ; - } - } - - private ICategorySelectorControl GetCategorySelectorControl(BlogPostCategory category) - { - // scan for control - foreach (ICategorySelectorControl selectorControl in _categoryControls) - { - if ( selectorControl.Category.Id.ToLower(CultureInfo.CurrentCulture) == category.Id.ToLower(CultureInfo.CurrentCulture) || - selectorControl.Category.Name.ToLower(CultureInfo.CurrentCulture) == category.Name.ToLower(CultureInfo.CurrentCulture) ) - { - return selectorControl ; - } - } - - // didn't find it - return null ; - - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.categoryContainerControl = new System.Windows.Forms.Panel(); - this.panelAddCategory = new System.Windows.Forms.Panel(); - this.comboBoxParent = new OpenLiveWriter.PostEditor.PostPropertyEditing.CategoryControl.CategoryDisplayFormM1.ParentCategoryComboBox(); - this.buttonAdd = new System.Windows.Forms.Button(); - this.textBoxAddCategory = new System.Windows.Forms.TextBox(); - this.categoryRefreshControl = new OpenLiveWriter.PostEditor.PostPropertyEditing.CategoryControl.CategoryRefreshControl(); - this.panelAddCategory.SuspendLayout(); - this.SuspendLayout(); - // - // categoryContainerControl - // - this.categoryContainerControl.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.categoryContainerControl.AutoScroll = true; - this.categoryContainerControl.Location = new System.Drawing.Point(7, 33); - this.categoryContainerControl.Name = "categoryContainerControl"; - this.categoryContainerControl.Size = new System.Drawing.Size(189, 72); - this.categoryContainerControl.TabIndex = 0; - // - // panelAddCategory - // - this.panelAddCategory.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.panelAddCategory.Controls.Add(this.comboBoxParent); - this.panelAddCategory.Controls.Add(this.buttonAdd); - this.panelAddCategory.Controls.Add(this.textBoxAddCategory); - this.panelAddCategory.Location = new System.Drawing.Point(6, 5); - this.panelAddCategory.Name = "panelAddCategory"; - this.panelAddCategory.Size = new System.Drawing.Size(194, 25); - this.panelAddCategory.TabIndex = 1; - // - // comboBoxParent - // - this.comboBoxParent.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.comboBoxParent.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; - this.comboBoxParent.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.comboBoxParent.DropDownWidth = 200; - this.comboBoxParent.IntegralHeight = false; - this.comboBoxParent.ItemHeight = 15; - this.comboBoxParent.Location = new System.Drawing.Point(42, 1); - this.comboBoxParent.MaxDropDownItems = 20; - this.comboBoxParent.Name = "comboBoxParent"; - this.comboBoxParent.Size = new System.Drawing.Size(88, 21); - this.comboBoxParent.TabIndex = 1; - this.comboBoxParent.Leave += new System.EventHandler(this.comboBoxParent_Leave); - this.comboBoxParent.Enter += new System.EventHandler(this.comboBoxParent_Enter); - // - // buttonAdd - // - this.buttonAdd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonAdd.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.buttonAdd.Location = new System.Drawing.Point(134, 0); - this.buttonAdd.Name = "buttonAdd"; - this.buttonAdd.Size = new System.Drawing.Size(59, 23); - this.buttonAdd.TabIndex = 2; - this.buttonAdd.Text = "&Add"; - this.buttonAdd.Click += new System.EventHandler(this.buttonAdd_Click); - // - // textBoxAddCategory - // - this.textBoxAddCategory.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.textBoxAddCategory.AutoSize = false; - this.textBoxAddCategory.Location = new System.Drawing.Point(0, 1); - this.textBoxAddCategory.Name = "textBoxAddCategory"; - this.textBoxAddCategory.Size = new System.Drawing.Size(38, 21); - this.textBoxAddCategory.TabIndex = 0; - this.textBoxAddCategory.Text = ""; - this.textBoxAddCategory.Leave += new System.EventHandler(this.textBoxAddCategory_Leave); - this.textBoxAddCategory.Enter += new System.EventHandler(this.textBoxAddCategory_Enter); - // - // categoryRefreshControl - // - this.categoryRefreshControl.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.categoryRefreshControl.BackColor = System.Drawing.SystemColors.ControlLightLight; - this.categoryRefreshControl.Location = new System.Drawing.Point(6, 111); - this.categoryRefreshControl.Name = "categoryRefreshControl"; - this.categoryRefreshControl.Size = new System.Drawing.Size(193, 23); - this.categoryRefreshControl.TabIndex = 2; - // - // CategoryDisplayFormM1 - // - this.AutoScaleBaseSize = new System.Drawing.Size(5, 14); - this.AutoScrollMargin = new System.Drawing.Size(2, 2); - this.BackColor = System.Drawing.SystemColors.ControlLightLight; - this.ClientSize = new System.Drawing.Size(205, 138); - this.ControlBox = false; - this.Controls.Add(this.categoryRefreshControl); - this.Controls.Add(this.panelAddCategory); - this.Controls.Add(this.categoryContainerControl); - this.DismissOnDeactivate = true; - this.DockPadding.All = 1; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "CategoryDisplayFormM1"; - this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; - this.panelAddCategory.ResumeLayout(false); - this.ResumeLayout(false); - - } - - #endregion - - /// - /// Clean up any resources being used. - /// - protected override void Dispose(bool disposing) - { - if (disposing) - { - _categoryContext.Changed -= new CategoryContext.CategoryChangedEventHandler(_categoryContext_Changed); - if (components != null) - { - components.Dispose(); - } - } - base.Dispose(disposing); - } - - private System.ComponentModel.IContainer components = new Container(); - private ArrayList _categoryControls = new ArrayList(); - private CategoryContext _categoryContext; - private Control _parentControl; - - private void catSelector_SelectedChanged(object sender, EventArgs e) - { - CommitSelection(); - } - - private void _categoryContext_Changed(object sender, CategoryContext.CategoryChangedEventArgs e) - { - if (e.ChangeType == CategoryContext.ChangeType.Category || e.ChangeType == CategoryContext.ChangeType.SelectionMode) - { - BlogPostCategory[] selectedCategories = GetCurrentlySelectedCategories(); - LayoutControls(_categoryContext, false, true); - UpdateSelectedCategories(selectedCategories); - RefreshParentCombo() ; - Invalidate() ; - } - } - - private void RefreshParentCombo() - { - // populate "parent" combo - object selectedItem = comboBoxParent.SelectedItem ; - comboBoxParent.Items.Clear(); - comboBoxParent.Items.Add(new ParentCategoryComboItemNone(comboBoxParent)) ; - BlogPostCategoryListItem[] categoryListItems = BlogPostCategoryListItem.BuildList(_categoryContext.BlogCategories, true) ; - foreach(BlogPostCategoryListItem categoryListItem in categoryListItems) - comboBoxParent.Items.Add(new ParentCategoryComboItem(comboBoxParent, categoryListItem.Category, categoryListItem.IndentLevel)) ; - UpdateParentComboForeColor() ; - if ( selectedItem != null && comboBoxParent.Items.Contains(selectedItem)) - comboBoxParent.SelectedItem = selectedItem ; - else - comboBoxParent.SelectedIndex = 0 ; - } - - private BlogPostCategory GetParentCategory() - { - ParentCategoryComboItem parentComboItem = comboBoxParent.SelectedItem as ParentCategoryComboItem ; - if ( parentComboItem != null ) - { - if ( !BlogPostCategoryNone.IsCategoryNone(parentComboItem.Category) ) - return parentComboItem.Category ; - else - return null ; - } - else - { - return null ; - } - } - - private void comboBoxParent_Enter(object sender, System.EventArgs e) - { - comboBoxParent.ForeColor = SystemColors.ControlText; - } - - private void comboBoxParent_Leave(object sender, System.EventArgs e) - { - UpdateParentComboForeColor() ; - } - - private void UpdateParentComboForeColor() - { - if ( GetParentCategory() != null ) - comboBoxParent.ForeColor = SystemColors.ControlText ; - else - comboBoxParent.ForeColor = SystemColors.GrayText ; - } - - private class ParentCategoryComboItem - { - public ParentCategoryComboItem(ComboBox parentCombo, BlogPostCategory category, int indentLevel) - { - _parentCombo = parentCombo ; - _category = category ; - _indentLevel = indentLevel ; - } - - public BlogPostCategory Category - { - get { return _category; } - } - private BlogPostCategory _category ; - - public override bool Equals(object obj) - { - return (obj as ParentCategoryComboItem).Category.Equals(Category) ; - } - - public override int GetHashCode() - { - return Category.GetHashCode() ; - } - - public override string ToString() - { - // default padding - string padding = new String(' ', _indentLevel * 3) ; - - // override if we are selected - if ( !_parentCombo.DroppedDown && (_parentCombo.SelectedItem != null) && this.Equals(_parentCombo.SelectedItem) ) - padding = String.Empty ; - - string categoryName = HtmlUtils.UnEscapeEntities(Category.Name, HtmlUtils.UnEscapeMode.Default) ; - string stringRepresentation = String.Format(CultureInfo.InvariantCulture, "{0}{1}", padding, categoryName) ; - return stringRepresentation ; - } - - private int _indentLevel ; - private ComboBox _parentCombo ; - - } - - private class ParentCategoryComboBox : ComboBox - { - public ParentCategoryComboBox() - { - // prevent editing and showing of drop down - DropDownStyle = ComboBoxStyle.DropDownList ; - - // fully cusotm painting - DrawMode = DrawMode.OwnerDrawFixed ; - IntegralHeight = false ; - } - - protected override void OnDrawItem(DrawItemEventArgs e) - { - if (e.Index != -1) - { - ParentCategoryComboItem comboItem = Items[e.Index] as ParentCategoryComboItem ; - - e.DrawBackground(); - - // don't indent for main display of category - string text = comboItem.ToString(); - if (e.Bounds.Width < Width) - text = text.Trim() ; - - using ( Brush brush = new SolidBrush(e.ForeColor) ) - e.Graphics.DrawString(text, e.Font, brush, e.Bounds.X, e.Bounds.Y) ; - - e.DrawFocusRectangle(); - } - } - } - - private class ParentCategoryComboItemNone : ParentCategoryComboItem - { - public ParentCategoryComboItemNone(ComboBox parentCombo) - : base(parentCombo, new BlogPostCategoryNone(), 0) - { - } - - public override string ToString() - { - return Res.Get(StringId.CategoryNoParent) ; - } - } - - - private class PositionManager : IDisposable - { - private int _top; - private int _left; - private int _width; - private int _margin; - private ArrayList _controls = new ArrayList(); - private int _maxWidth; - private int _minWidth; - private int _maxHeight ; - private int _enforcedMaxHeight = -1 ; - private PointF _autoScaleSize; - private StringFormat _format; - - public PositionManager(int initialLeft, int initialTop, int scaledMargin, int minWidth, int maxWidth, int maxHeight, PointF autoScaleSize) - { - _left = initialLeft; - _top = initialTop; - _margin = scaledMargin; - _maxWidth = maxWidth; - _minWidth = _width = minWidth; - _maxHeight = maxHeight ; - _autoScaleSize = autoScaleSize; - _format = new StringFormat(); - _format.Trimming = StringTrimming.EllipsisCharacter; - } - - public void PositionControl(Control c, int indentLevel) - { - int INDENT_MARGIN = ScaleX(16) ; - c.Top = _top; - c.Left = _left + (INDENT_MARGIN * indentLevel); - - Graphics g = c.CreateGraphics(); - try - { - int maxWidth = _maxWidth - SystemInformation.VerticalScrollBarWidth - c.Left - _left; - c.Width = maxWidth; - if (c is CheckBox) - DisplayHelper.AutoFitSystemCheckBox((CheckBox)c, 0, maxWidth); - else if (c is RadioButton) - DisplayHelper.AutoFitSystemRadioButton((RadioButton)c, 0, maxWidth); - else - Debug.Fail("Being asked to position a control that isn't a radiobutton or checkbox"); - LayoutHelper.NaturalizeHeight(c); - } - finally - { - g.Dispose(); - } - _width = Math.Max(_width, c.Width); - _controls.Add(c); - - _top = _top + c.Height + _margin; - - // enforce max height if necessary - if ( _enforcedMaxHeight == -1 && _top > _maxHeight ) - _enforcedMaxHeight = _top ; - } - - public int Width - { - get { return _width; } - } - - public int Height - { - get - { - if ( _enforcedMaxHeight != -1 ) - return _enforcedMaxHeight ; - else - return _top + _margin; - } - } - - protected int ScaleX(int x) - { - return (int) (x*_autoScaleSize.X); - } - - protected int ScaleY(int y) - { - return (int) (y*_autoScaleSize.Y); - } - - #region IDisposable Members - - public void Dispose() - { - } - - #endregion - } - - - } + protected override void ScaleCore(float dx, float dy) + { + SaveScaleState(dx, dy); + base.ScaleCore(dx, dy); + } + + private void SaveScaleState(float dx, float dy) + { + scale = new PointF(scale.X*dx, scale.Y*dy); + + //synchronize the comboBoxParent item height so it matches the scaled control height. + //Note: ScaleY(3) is padding to deal with mismatches in the way the ItemHeight scales versus its peer controls... + //comboBoxParent.ItemHeight = (int) (comboBoxParent.ItemHeight*dy) + ScaleY(3); + comboBoxParent.ItemHeight = (int) (comboBoxParent.ItemHeight*dy) + (scale.Y == 1f ? 0 : ScaleY(3)); + } + + private PointF scale = new PointF(1f, 1f); + + protected int ScaleX(int x) + { + return (int) (x*scale.X); + } + + protected int ScaleY(int y) + { + return (int) (y*scale.Y); + } + #endregion + + private const int Y_MARGIN = 2; + private const int X_MARGIN = 4; + + private void CommitSelection() + { + ArrayList selectedCategories = new ArrayList(); + foreach (ICategorySelectorControl categoryControl in _categoryControls) + { + if (categoryControl.Selected) + { + if (BlogPostCategoryNone.IsCategoryNone(categoryControl.Category)) + { + selectedCategories.Clear(); + break; + } + else + { + selectedCategories.Add(categoryControl.Category); + } + } + } + _categoryContext.SelectedCategories = (BlogPostCategory[]) selectedCategories.ToArray(typeof (BlogPostCategory)); + } + + private BlogPostCategory[] GetCurrentlySelectedCategories() + { + ArrayList selectedCategories = new ArrayList(); + foreach (ICategorySelectorControl sc in _categoryControls) + { + if (sc.Selected) + { + if (BlogPostCategoryNone.IsCategoryNone(sc.Category)) + { + selectedCategories.Clear(); + break; + } + else + { + selectedCategories.Add(sc.Category); + } + } + } + return (BlogPostCategory[]) selectedCategories.ToArray(typeof (BlogPostCategory)); + } + + private void UpdateSelectedCategories(BlogPostCategory[] selectedCategories) + { + bool focused = false; + foreach (ICategorySelectorControl sc in _categoryControls) + { + if (!focused) + { + sc.Control.Focus(); + focused = true; + } + sc.Selected = false; + } + + if (selectedCategories.Length > 0) + { + foreach (BlogPostCategory c in selectedCategories) + foreach (ICategorySelectorControl sc in _categoryControls) + { + if (c.Id.ToLower(CultureInfo.CurrentCulture) == sc.Category.Id.ToLower(CultureInfo.CurrentCulture) || + c.Name.ToLower(CultureInfo.CurrentCulture) == sc.Category.Name.ToLower(CultureInfo.CurrentCulture) ) + { + sc.Selected = true; + break; + } + } + } + else + { + // scan for special "None" category and select it + foreach (ICategorySelectorControl sc in _categoryControls) + { + if (BlogPostCategoryNone.IsCategoryNone((sc.Category))) + { + sc.Selected = true; + break; + } + } + } + } + + private void textBoxAddCategory_Enter(object sender, System.EventArgs e) + { + if ( textBoxAddCategory.Text == Res.Get(StringId.CategoryAdd) ) + ActivateAddTextBoxForEdit() ; + } + + private void textBoxAddCategory_Leave(object sender, System.EventArgs e) + { + if ( textBoxAddCategory.Text.Trim() == String.Empty ) + ClearAddTextBox() ; + } + + private void ClearAddTextBox() + { + textBoxAddCategory.ForeColor = SystemColors.GrayText ; + textBoxAddCategory.Text = Res.Get(StringId.CategoryAdd); + } + + private void ActivateAddTextBoxForEdit() + { + textBoxAddCategory.ForeColor = SystemColors.ControlText; + textBoxAddCategory.Text = String.Empty ; + } + + private void buttonAdd_Click(object sender, System.EventArgs e) + { + AddCategory() ; + } + + private void AddCategory() + { + // add the new category + BlogPostCategory newCategory = GetNewCategory() ; + + // see if the "new" category is already in our list + if ( newCategory != null ) + { + ICategorySelectorControl selectorControl = GetCategorySelectorControl(newCategory) ; + + // if there is no existing selector control then add the category + if ( selectorControl == null ) + _categoryContext.AddNewCategory(newCategory); + + // now re-lookup the selector control and select it + selectorControl = GetCategorySelectorControl(newCategory) ; + selectorControl.Selected = true ; + + // ensure the added category is scrolled into view + categoryContainerControl.ScrollControlIntoView(selectorControl.Control); + + // clear the parent combo and update its ui + comboBoxParent.SelectedIndex = 0 ; + UpdateParentComboForeColor() ; + + // setup the text box to add another category if we support multiple categories + if ( _categoryContext.SelectionMode == CategoryContext.SelectionModes.MultiSelect ) + { + ActivateAddTextBoxForEdit() ; + textBoxAddCategory.Focus() ; + } + else + { + ClearAddTextBox() ; + selectorControl.Control.Focus() ; + } + } + } + + private BlogPostCategory GetNewCategory() + { + if ( textBoxAddCategory.ForeColor == SystemColors.ControlText ) + { + string categoryName = this.textBoxAddCategory.Text.Trim() ; + if ( categoryName != String.Empty ) + { + // see if we have a parent + BlogPostCategory parentCategory = GetParentCategory() ; + if ( parentCategory != null ) + return new BlogPostCategory(categoryName, categoryName, parentCategory.Id); + else + return new BlogPostCategory(categoryName); + } + else + { + return null ; + } + } + else + { + return null ; + } + } + + private ICategorySelectorControl GetCategorySelectorControl(BlogPostCategory category) + { + // scan for control + foreach (ICategorySelectorControl selectorControl in _categoryControls) + { + if ( selectorControl.Category.Id.ToLower(CultureInfo.CurrentCulture) == category.Id.ToLower(CultureInfo.CurrentCulture) || + selectorControl.Category.Name.ToLower(CultureInfo.CurrentCulture) == category.Name.ToLower(CultureInfo.CurrentCulture) ) + { + return selectorControl ; + } + } + + // didn't find it + return null ; + + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.categoryContainerControl = new System.Windows.Forms.Panel(); + this.panelAddCategory = new System.Windows.Forms.Panel(); + this.comboBoxParent = new OpenLiveWriter.PostEditor.PostPropertyEditing.CategoryControl.CategoryDisplayFormM1.ParentCategoryComboBox(); + this.buttonAdd = new System.Windows.Forms.Button(); + this.textBoxAddCategory = new System.Windows.Forms.TextBox(); + this.categoryRefreshControl = new OpenLiveWriter.PostEditor.PostPropertyEditing.CategoryControl.CategoryRefreshControl(); + this.panelAddCategory.SuspendLayout(); + this.SuspendLayout(); + // + // categoryContainerControl + // + this.categoryContainerControl.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.categoryContainerControl.AutoScroll = true; + this.categoryContainerControl.Location = new System.Drawing.Point(7, 33); + this.categoryContainerControl.Name = "categoryContainerControl"; + this.categoryContainerControl.Size = new System.Drawing.Size(189, 72); + this.categoryContainerControl.TabIndex = 0; + // + // panelAddCategory + // + this.panelAddCategory.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.panelAddCategory.Controls.Add(this.comboBoxParent); + this.panelAddCategory.Controls.Add(this.buttonAdd); + this.panelAddCategory.Controls.Add(this.textBoxAddCategory); + this.panelAddCategory.Location = new System.Drawing.Point(6, 5); + this.panelAddCategory.Name = "panelAddCategory"; + this.panelAddCategory.Size = new System.Drawing.Size(194, 25); + this.panelAddCategory.TabIndex = 1; + // + // comboBoxParent + // + this.comboBoxParent.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.comboBoxParent.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; + this.comboBoxParent.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBoxParent.DropDownWidth = 200; + this.comboBoxParent.IntegralHeight = false; + this.comboBoxParent.ItemHeight = 15; + this.comboBoxParent.Location = new System.Drawing.Point(42, 1); + this.comboBoxParent.MaxDropDownItems = 20; + this.comboBoxParent.Name = "comboBoxParent"; + this.comboBoxParent.Size = new System.Drawing.Size(88, 21); + this.comboBoxParent.TabIndex = 1; + this.comboBoxParent.Leave += new System.EventHandler(this.comboBoxParent_Leave); + this.comboBoxParent.Enter += new System.EventHandler(this.comboBoxParent_Enter); + // + // buttonAdd + // + this.buttonAdd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.buttonAdd.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.buttonAdd.Location = new System.Drawing.Point(134, 0); + this.buttonAdd.Name = "buttonAdd"; + this.buttonAdd.Size = new System.Drawing.Size(59, 23); + this.buttonAdd.TabIndex = 2; + this.buttonAdd.Text = "&Add"; + this.buttonAdd.Click += new System.EventHandler(this.buttonAdd_Click); + // + // textBoxAddCategory + // + this.textBoxAddCategory.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textBoxAddCategory.AutoSize = false; + this.textBoxAddCategory.Location = new System.Drawing.Point(0, 1); + this.textBoxAddCategory.Name = "textBoxAddCategory"; + this.textBoxAddCategory.Size = new System.Drawing.Size(38, 21); + this.textBoxAddCategory.TabIndex = 0; + this.textBoxAddCategory.Text = ""; + this.textBoxAddCategory.Leave += new System.EventHandler(this.textBoxAddCategory_Leave); + this.textBoxAddCategory.Enter += new System.EventHandler(this.textBoxAddCategory_Enter); + // + // categoryRefreshControl + // + this.categoryRefreshControl.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.categoryRefreshControl.BackColor = System.Drawing.SystemColors.ControlLightLight; + this.categoryRefreshControl.Location = new System.Drawing.Point(6, 111); + this.categoryRefreshControl.Name = "categoryRefreshControl"; + this.categoryRefreshControl.Size = new System.Drawing.Size(193, 23); + this.categoryRefreshControl.TabIndex = 2; + // + // CategoryDisplayFormM1 + // + this.AutoScaleBaseSize = new System.Drawing.Size(5, 14); + this.AutoScrollMargin = new System.Drawing.Size(2, 2); + this.BackColor = System.Drawing.SystemColors.ControlLightLight; + this.ClientSize = new System.Drawing.Size(205, 138); + this.ControlBox = false; + this.Controls.Add(this.categoryRefreshControl); + this.Controls.Add(this.panelAddCategory); + this.Controls.Add(this.categoryContainerControl); + this.DismissOnDeactivate = true; + this.DockPadding.All = 1; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "CategoryDisplayFormM1"; + this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; + this.panelAddCategory.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + /// + /// Clean up any resources being used. + /// + protected override void Dispose(bool disposing) + { + if (disposing) + { + _categoryContext.Changed -= new CategoryContext.CategoryChangedEventHandler(_categoryContext_Changed); + if (components != null) + { + components.Dispose(); + } + } + base.Dispose(disposing); + } + + private System.ComponentModel.IContainer components = new Container(); + private ArrayList _categoryControls = new ArrayList(); + private CategoryContext _categoryContext; + private Control _parentControl; + + private void catSelector_SelectedChanged(object sender, EventArgs e) + { + CommitSelection(); + } + + private void _categoryContext_Changed(object sender, CategoryContext.CategoryChangedEventArgs e) + { + if (e.ChangeType == CategoryContext.ChangeType.Category || e.ChangeType == CategoryContext.ChangeType.SelectionMode) + { + BlogPostCategory[] selectedCategories = GetCurrentlySelectedCategories(); + LayoutControls(_categoryContext, false, true); + UpdateSelectedCategories(selectedCategories); + RefreshParentCombo() ; + Invalidate() ; + } + } + + private void RefreshParentCombo() + { + // populate "parent" combo + object selectedItem = comboBoxParent.SelectedItem ; + comboBoxParent.Items.Clear(); + comboBoxParent.Items.Add(new ParentCategoryComboItemNone(comboBoxParent)) ; + BlogPostCategoryListItem[] categoryListItems = BlogPostCategoryListItem.BuildList(_categoryContext.BlogCategories, true) ; + foreach(BlogPostCategoryListItem categoryListItem in categoryListItems) + comboBoxParent.Items.Add(new ParentCategoryComboItem(comboBoxParent, categoryListItem.Category, categoryListItem.IndentLevel)) ; + UpdateParentComboForeColor() ; + if ( selectedItem != null && comboBoxParent.Items.Contains(selectedItem)) + comboBoxParent.SelectedItem = selectedItem ; + else + comboBoxParent.SelectedIndex = 0 ; + } + + private BlogPostCategory GetParentCategory() + { + ParentCategoryComboItem parentComboItem = comboBoxParent.SelectedItem as ParentCategoryComboItem ; + if ( parentComboItem != null ) + { + if ( !BlogPostCategoryNone.IsCategoryNone(parentComboItem.Category) ) + return parentComboItem.Category ; + else + return null ; + } + else + { + return null ; + } + } + + private void comboBoxParent_Enter(object sender, System.EventArgs e) + { + comboBoxParent.ForeColor = SystemColors.ControlText; + } + + private void comboBoxParent_Leave(object sender, System.EventArgs e) + { + UpdateParentComboForeColor() ; + } + + private void UpdateParentComboForeColor() + { + if ( GetParentCategory() != null ) + comboBoxParent.ForeColor = SystemColors.ControlText ; + else + comboBoxParent.ForeColor = SystemColors.GrayText ; + } + + private class ParentCategoryComboItem + { + public ParentCategoryComboItem(ComboBox parentCombo, BlogPostCategory category, int indentLevel) + { + _parentCombo = parentCombo ; + _category = category ; + _indentLevel = indentLevel ; + } + + public BlogPostCategory Category + { + get { return _category; } + } + private BlogPostCategory _category ; + + public override bool Equals(object obj) + { + return (obj as ParentCategoryComboItem).Category.Equals(Category) ; + } + + public override int GetHashCode() + { + return Category.GetHashCode() ; + } + + public override string ToString() + { + // default padding + string padding = new String(' ', _indentLevel * 3) ; + + // override if we are selected + if ( !_parentCombo.DroppedDown && (_parentCombo.SelectedItem != null) && this.Equals(_parentCombo.SelectedItem) ) + padding = String.Empty ; + + string categoryName = HtmlUtils.UnEscapeEntities(Category.Name, HtmlUtils.UnEscapeMode.Default) ; + string stringRepresentation = String.Format(CultureInfo.InvariantCulture, "{0}{1}", padding, categoryName) ; + return stringRepresentation ; + } + + private int _indentLevel ; + private ComboBox _parentCombo ; + + } + + private class ParentCategoryComboBox : ComboBox + { + public ParentCategoryComboBox() + { + // prevent editing and showing of drop down + DropDownStyle = ComboBoxStyle.DropDownList ; + + // fully cusotm painting + DrawMode = DrawMode.OwnerDrawFixed ; + IntegralHeight = false ; + } + + protected override void OnDrawItem(DrawItemEventArgs e) + { + if (e.Index != -1) + { + ParentCategoryComboItem comboItem = Items[e.Index] as ParentCategoryComboItem ; + + e.DrawBackground(); + + // don't indent for main display of category + string text = comboItem.ToString(); + if (e.Bounds.Width < Width) + text = text.Trim() ; + + using ( Brush brush = new SolidBrush(e.ForeColor) ) + e.Graphics.DrawString(text, e.Font, brush, e.Bounds.X, e.Bounds.Y) ; + + e.DrawFocusRectangle(); + } + } + } + + private class ParentCategoryComboItemNone : ParentCategoryComboItem + { + public ParentCategoryComboItemNone(ComboBox parentCombo) + : base(parentCombo, new BlogPostCategoryNone(), 0) + { + } + + public override string ToString() + { + return Res.Get(StringId.CategoryNoParent) ; + } + } + + private class PositionManager : IDisposable + { + private int _top; + private int _left; + private int _width; + private int _margin; + private ArrayList _controls = new ArrayList(); + private int _maxWidth; + private int _minWidth; + private int _maxHeight ; + private int _enforcedMaxHeight = -1 ; + private PointF _autoScaleSize; + private StringFormat _format; + + public PositionManager(int initialLeft, int initialTop, int scaledMargin, int minWidth, int maxWidth, int maxHeight, PointF autoScaleSize) + { + _left = initialLeft; + _top = initialTop; + _margin = scaledMargin; + _maxWidth = maxWidth; + _minWidth = _width = minWidth; + _maxHeight = maxHeight ; + _autoScaleSize = autoScaleSize; + _format = new StringFormat(); + _format.Trimming = StringTrimming.EllipsisCharacter; + } + + public void PositionControl(Control c, int indentLevel) + { + int INDENT_MARGIN = ScaleX(16) ; + c.Top = _top; + c.Left = _left + (INDENT_MARGIN * indentLevel); + + Graphics g = c.CreateGraphics(); + try + { + int maxWidth = _maxWidth - SystemInformation.VerticalScrollBarWidth - c.Left - _left; + c.Width = maxWidth; + if (c is CheckBox) + DisplayHelper.AutoFitSystemCheckBox((CheckBox)c, 0, maxWidth); + else if (c is RadioButton) + DisplayHelper.AutoFitSystemRadioButton((RadioButton)c, 0, maxWidth); + else + Debug.Fail("Being asked to position a control that isn't a radiobutton or checkbox"); + LayoutHelper.NaturalizeHeight(c); + } + finally + { + g.Dispose(); + } + _width = Math.Max(_width, c.Width); + _controls.Add(c); + + _top = _top + c.Height + _margin; + + // enforce max height if necessary + if ( _enforcedMaxHeight == -1 && _top > _maxHeight ) + _enforcedMaxHeight = _top ; + } + + public int Width + { + get { return _width; } + } + + public int Height + { + get + { + if ( _enforcedMaxHeight != -1 ) + return _enforcedMaxHeight ; + else + return _top + _margin; + } + } + + protected int ScaleX(int x) + { + return (int) (x*_autoScaleSize.X); + } + + protected int ScaleY(int y) + { + return (int) (y*_autoScaleSize.Y); + } + + #region IDisposable Members + + public void Dispose() + { + } + + #endregion + } + + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/PostPropertyEditing/CategoryControl/CategoryDropDownControl.cs b/src/managed/OpenLiveWriter.PostEditor/PostPropertyEditing/CategoryControl/CategoryDropDownControl.cs index 90b0f394..d8d98a4e 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostPropertyEditing/CategoryControl/CategoryDropDownControl.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostPropertyEditing/CategoryControl/CategoryDropDownControl.cs @@ -20,324 +20,321 @@ using OpenLiveWriter.PostEditor.PostPropertyEditing.CategoryControl.DisplayMessa namespace OpenLiveWriter.PostEditor.PostPropertyEditing.CategoryControl { - internal class CategoryDropDownControl : ComboBox, IBlogPostEditor, IBlogCategorySettings - { - #region IBlogPostEditor Members + internal class CategoryDropDownControl : ComboBox, IBlogPostEditor, IBlogCategorySettings + { + #region IBlogPostEditor Members - void IBlogPostEditor.Initialize(IBlogPostEditingContext editingContext) - { - CategoryContext.SelectedCategories = editingContext.BlogPost.Categories ; - toolTipCategories.SetToolTip(this, CategoryContext.FormattedCategoryList); - _isDirty = false ; - } + void IBlogPostEditor.Initialize(IBlogPostEditingContext editingContext) + { + CategoryContext.SelectedCategories = editingContext.BlogPost.Categories ; + toolTipCategories.SetToolTip(this, CategoryContext.FormattedCategoryList); + _isDirty = false ; + } - void IBlogPostEditor.SaveChanges(BlogPost post) - { - post.Categories = CategoryContext.SelectedCategories; - _isDirty = false ; - } + void IBlogPostEditor.SaveChanges(BlogPost post) + { + post.Categories = CategoryContext.SelectedCategories; + _isDirty = false ; + } - private System.Windows.Forms.ToolTip toolTipCategories; + private System.Windows.Forms.ToolTip toolTipCategories; - bool IBlogPostEditor.ValidatePublish() - { - // see if we need to halt publishing to specify a category - if ( Visible ) - { - if ( PostEditorSettings.CategoryReminder && (CategoryContext.Categories.Length > 0) && (CategoryContext.SelectedCategories.Length == 0) ) - { - if ( DisplayMessage.Show(typeof(CategoryReminderDisplayMessage), FindForm(), "\r\n\r\n") == DialogResult.No ) - { - Focus() ; - return false ; - } - } - } + bool IBlogPostEditor.ValidatePublish() + { + // see if we need to halt publishing to specify a category + if ( Visible ) + { + if ( PostEditorSettings.CategoryReminder && (CategoryContext.Categories.Length > 0) && (CategoryContext.SelectedCategories.Length == 0) ) + { + if ( DisplayMessage.Show(typeof(CategoryReminderDisplayMessage), FindForm(), "\r\n\r\n") == DialogResult.No ) + { + Focus() ; + return false ; + } + } + } - // proceed - return true ; - } + // proceed + return true ; + } - void IBlogPostEditor.OnPublishSucceeded(BlogPost blogPost, PostResult postResult) - { + void IBlogPostEditor.OnPublishSucceeded(BlogPost blogPost, PostResult postResult) + { - } + } - bool IBlogPostEditor.IsDirty - { - get - { - return _isDirty ; - } - } - private bool _isDirty = false ; + bool IBlogPostEditor.IsDirty + { + get + { + return _isDirty ; + } + } + private bool _isDirty = false ; - void IBlogPostEditor.OnBlogChanged(Blog newBlog) - { - _targetBlog = newBlog ; + void IBlogPostEditor.OnBlogChanged(Blog newBlog) + { + _targetBlog = newBlog ; - if ( newBlog.ClientOptions.SupportsMultipleCategories ) - CategoryContext.SelectionMode = CategoryContext.SelectionModes.MultiSelect; - else - CategoryContext.SelectionMode = CategoryContext.SelectionModes.SingleSelect; + if ( newBlog.ClientOptions.SupportsMultipleCategories ) + CategoryContext.SelectionMode = CategoryContext.SelectionModes.MultiSelect; + else + CategoryContext.SelectionMode = CategoryContext.SelectionModes.SingleSelect; - CategoryContext.SetBlogCategories(_targetBlog.Categories); - CategoryContext.SelectedCategories = new BlogPostCategory[0]; - } - private Blog _targetBlog ; + CategoryContext.SetBlogCategories(_targetBlog.Categories); + CategoryContext.SelectedCategories = new BlogPostCategory[0]; + } + private Blog _targetBlog ; + void IBlogPostEditor.OnBlogSettingsChanged(bool templateChanged) + { + // make sure we have the lastest categoires (in case the underlying target blog changed) + CategoryContext.SetBlogCategories(_targetBlog.Categories) ; + } - void IBlogPostEditor.OnBlogSettingsChanged(bool templateChanged) - { - // make sure we have the lastest categoires (in case the underlying target blog changed) - CategoryContext.SetBlogCategories(_targetBlog.Categories) ; - } + #endregion - #endregion + public CategoryDropDownControl() : base() + { + // This call is required by the Windows.Forms Form Designer. + InitializeComponent(); - public CategoryDropDownControl() : base() - { - // This call is required by the Windows.Forms Form Designer. - InitializeComponent(); + // prevent editing and showing of drop down + DropDownStyle = ComboBoxStyle.DropDownList ; - // prevent editing and showing of drop down - DropDownStyle = ComboBoxStyle.DropDownList ; + // fully cusotm painting + IntegralHeight = false ; + DrawMode = DrawMode.OwnerDrawFixed ; + Items.Add(String.Empty) ; - // fully cusotm painting - IntegralHeight = false ; - DrawMode = DrawMode.OwnerDrawFixed ; - Items.Add(String.Empty) ; + _categoryContext = new CategoryContext(); + } - _categoryContext = new CategoryContext(); - } + public void Initialize(IWin32Window parentFrame) + { + _parentFrame = parentFrame ; + _categoryContext.BlogCategorySettings = this; + _categoryContext.Changed += new CategoryContext.CategoryChangedEventHandler(_categoryContext_Changed); + } - public void Initialize(IWin32Window parentFrame) - { - _parentFrame = parentFrame ; - _categoryContext.BlogCategorySettings = this; - _categoryContext.Changed += new CategoryContext.CategoryChangedEventHandler(_categoryContext_Changed); - } + // replace standard drop down behavior with category form + protected override void WndProc(ref Message m) + { + if (IsDropDownMessage(m)) + { + DisplayCategoryForm(); + } + else + { + base.WndProc(ref m); + } + } + // replace standard painting behavior + protected override void OnDrawItem(DrawItemEventArgs e) + { + // determine the text color based on whether we have categories + bool hasCategories = _categoryContext.SelectedCategories.Length > 0 ; + Color textColor = hasCategories ? SystemColors.ControlText : SystemColors.GrayText; - // replace standard drop down behavior with category form - protected override void WndProc(ref Message m) - { - if (IsDropDownMessage(m)) - { - DisplayCategoryForm(); - } - else - { - base.WndProc(ref m); - } - } + // draw the text + const int HORIZONTAL_MARGIN = 2 ; + const int VERTICAL_MARGIN = 1 ; + Rectangle textRegion = new Rectangle(new Point(HORIZONTAL_MARGIN, VERTICAL_MARGIN), new Size(Width - 2*HORIZONTAL_MARGIN, Height - 2*VERTICAL_MARGIN) ); + using (Brush textBrush = new SolidBrush(textColor)) + { + e.Graphics.DrawString( + _categoryContext.Text, + Font, textBrush, textRegion, DisplayFormat ); + } - // replace standard painting behavior - protected override void OnDrawItem(DrawItemEventArgs e) - { - // determine the text color based on whether we have categories - bool hasCategories = _categoryContext.SelectedCategories.Length > 0 ; - Color textColor = hasCategories ? SystemColors.ControlText : SystemColors.GrayText; + // draw focus rectangle (only if necessary) + e.DrawFocusRectangle(); + } + private const int MARGIN = 1; - // draw the text - const int HORIZONTAL_MARGIN = 2 ; - const int VERTICAL_MARGIN = 1 ; - Rectangle textRegion = new Rectangle(new Point(HORIZONTAL_MARGIN, VERTICAL_MARGIN), new Size(Width - 2*HORIZONTAL_MARGIN, Height - 2*VERTICAL_MARGIN) ); - using (Brush textBrush = new SolidBrush(textColor)) - { - e.Graphics.DrawString( - _categoryContext.Text, - Font, textBrush, textRegion, DisplayFormat ); - } + BlogPostCategory[] IBlogCategorySettings.RefreshCategories(bool ignoreErrors) + { + try + { + _targetBlog.RefreshCategories(); + } + catch( BlogClientOperationCancelledException ) + { + // show no UI for operation cancelled + Debug.WriteLine("BlogClient operation cancelled"); + } + catch (Exception ex) + { + if(!ignoreErrors) + DisplayableExceptionDisplayForm.Show( _parentFrame, ex ); + } + return _targetBlog.Categories; + } - // draw focus rectangle (only if necessary) - e.DrawFocusRectangle(); - } - private const int MARGIN = 1; + void IBlogCategorySettings.UpdateCategories(BlogPostCategory[] categories) + { + using ( BlogSettings blogSettings = BlogSettings.ForBlogId(_targetBlog.Id) ) + blogSettings.Categories = categories ; + } - BlogPostCategory[] IBlogCategorySettings.RefreshCategories(bool ignoreErrors) - { - try - { - _targetBlog.RefreshCategories(); - } - catch( BlogClientOperationCancelledException ) - { - // show no UI for operation cancelled - Debug.WriteLine("BlogClient operation cancelled"); - } - catch (Exception ex) - { - if(!ignoreErrors) - DisplayableExceptionDisplayForm.Show( _parentFrame, ex ); - } - return _targetBlog.Categories; - } + private CategoryContext CategoryContext + { + get + { + return _categoryContext; + } + } - void IBlogCategorySettings.UpdateCategories(BlogPostCategory[] categories) - { - using ( BlogSettings blogSettings = BlogSettings.ForBlogId(_targetBlog.Id) ) - blogSettings.Categories = categories ; - } + private void DisplayCategoryForm() + { + // If we just dismissed the form, don't display it + if (_recentlyClosedForm) + return; - private CategoryContext CategoryContext - { - get - { - return _categoryContext; - } - } + Focus(); - private void DisplayCategoryForm() - { - // If we just dismissed the form, don't display it - if (_recentlyClosedForm) - return; + _categoryDisplayForm = new CategoryDisplayForm(this, _categoryContext); + //_categoryDisplayForm.MinDropDownWidth = 0; + IMiniFormOwner miniFormOwner = FindForm() as IMiniFormOwner; + if (miniFormOwner != null) + _categoryDisplayForm.FloatAboveOwner(miniFormOwner); + _categoryDisplayForm.Closed += new EventHandler(_categoryDisplayForm_Closed); + _categoryDisplayForm.Show(); + } + private CategoryDisplayFormBase _categoryDisplayForm = null; - Focus(); + private void _categoryContext_Changed(object sender, CategoryContext.CategoryChangedEventArgs e) + { + _isDirty = true ; - _categoryDisplayForm = new CategoryDisplayForm(this, _categoryContext); - //_categoryDisplayForm.MinDropDownWidth = 0; - IMiniFormOwner miniFormOwner = FindForm() as IMiniFormOwner; - if (miniFormOwner != null) - _categoryDisplayForm.FloatAboveOwner(miniFormOwner); - _categoryDisplayForm.Closed += new EventHandler(_categoryDisplayForm_Closed); - _categoryDisplayForm.Show(); - } - private CategoryDisplayFormBase _categoryDisplayForm = null; + toolTipCategories.SetToolTip(this, CategoryContext.FormattedCategoryList); + Invalidate(); + Update(); + } - private void _categoryContext_Changed(object sender, CategoryContext.CategoryChangedEventArgs e) - { - _isDirty = true ; + private void _categoryDisplayForm_Closed(object sender, EventArgs e) + { + // This timer makes it so when you click the control to dismiss the form, + // we don't instantly redisplay the form (same goes for hitting enter) + _recentlyClosedForm = true; + Timer t = new Timer(); + t.Interval = 100; + t.Tick += new EventHandler(t_Tick); + t.Start(); - toolTipCategories.SetToolTip(this, CategoryContext.FormattedCategoryList); - Invalidate(); - Update(); - } + _categoryDisplayForm.Closed -= new EventHandler(_categoryDisplayForm_Closed); + Invalidate(); + } - private void _categoryDisplayForm_Closed(object sender, EventArgs e) - { - // This timer makes it so when you click the control to dismiss the form, - // we don't instantly redisplay the form (same goes for hitting enter) - _recentlyClosedForm = true; - Timer t = new Timer(); - t.Interval = 100; - t.Tick += new EventHandler(t_Tick); - t.Start(); + private void t_Tick(object sender, EventArgs e) + { + _recentlyClosedForm = false; + Timer t = (Timer)sender; + t.Stop(); + t.Tick -= new EventHandler(t_Tick); + t.Dispose(); + } - _categoryDisplayForm.Closed -= new EventHandler(_categoryDisplayForm_Closed); - Invalidate(); - } + private StringFormat DisplayFormat + { + get + { + if (_displayFormat == null) + { + _displayFormat = new StringFormat(); + _displayFormat.Trimming = StringTrimming.EllipsisCharacter; + _displayFormat.Alignment = StringAlignment.Near; + _displayFormat.LineAlignment = StringAlignment.Center; + _displayFormat.FormatFlags = StringFormatFlags.FitBlackBox | StringFormatFlags.LineLimit; - private void t_Tick(object sender, EventArgs e) - { - _recentlyClosedForm = false; - Timer t = (Timer)sender; - t.Stop(); - t.Tick -= new EventHandler(t_Tick); - t.Dispose(); - } + } + return _displayFormat; + } + } + private StringFormat _displayFormat; - private StringFormat DisplayFormat - { - get - { - if (_displayFormat == null) - { - _displayFormat = new StringFormat(); - _displayFormat.Trimming = StringTrimming.EllipsisCharacter; - _displayFormat.Alignment = StringAlignment.Near; - _displayFormat.LineAlignment = StringAlignment.Center; - _displayFormat.FormatFlags = StringFormatFlags.FitBlackBox | StringFormatFlags.LineLimit; + private bool IsDropDownMessage(Message m) + { + // Left Mouse Button + if ( m.Msg == WM.LBUTTONDOWN || m.Msg == WM.LBUTTONDBLCLK ) + { + return true ; + } - } - return _displayFormat; - } - } - private StringFormat _displayFormat; + // F4 + else if ( m.Msg == WM.KEYDOWN ) + { + Keys keyCombo = (Keys)(int)m.WParam & Keys.KeyCode ; - private bool IsDropDownMessage(Message m) - { - // Left Mouse Button - if ( m.Msg == WM.LBUTTONDOWN || m.Msg == WM.LBUTTONDBLCLK ) - { - return true ; - } + if ( keyCombo == Keys.F4 ) + return true ; + else + return false ; + } - // F4 - else if ( m.Msg == WM.KEYDOWN ) - { - Keys keyCombo = (Keys)(int)m.WParam & Keys.KeyCode ; + // Alt+Arrow + else if ( m.Msg == WM.SYSKEYDOWN ) + { + int wparam = m.WParam.ToInt32(); + int lparam = m.LParam.ToInt32(); - if ( keyCombo == Keys.F4 ) - return true ; - else - return false ; - } + if ((wparam == 0x28 && (lparam == 0x21500001 || lparam == 0x20500001)) || //Alt+Down, Alt+NumDown + (wparam == 0x26 && (lparam == 0x21480001 || lparam == 0x20480001))) //Alt+Up, Alt+NumUp + { + return true ; + } + else + { + return false ; + } + } - // Alt+Arrow - else if ( m.Msg == WM.SYSKEYDOWN ) - { - int wparam = m.WParam.ToInt32(); - int lparam = m.LParam.ToInt32(); + // Not a drop-down message + else + { + return false ; + } + } - if ((wparam == 0x28 && (lparam == 0x21500001 || lparam == 0x20500001)) || //Alt+Down, Alt+NumDown - (wparam == 0x26 && (lparam == 0x21480001 || lparam == 0x20480001))) //Alt+Up, Alt+NumUp - { - return true ; - } - else - { - return false ; - } - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - // Not a drop-down message - else - { - return false ; - } - } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.toolTipCategories = new System.Windows.Forms.ToolTip(this.components); + // + // CategoryDropDownControl + // + this.Size = new System.Drawing.Size(138, 48); - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + } + #endregion - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - this.toolTipCategories = new System.Windows.Forms.ToolTip(this.components); - // - // CategoryDropDownControl - // - this.Size = new System.Drawing.Size(138, 48); + private IWin32Window _parentFrame; + private bool _recentlyClosedForm = false; + private System.ComponentModel.IContainer components; + private CategoryContext _categoryContext; - } - #endregion - - private IWin32Window _parentFrame; - private bool _recentlyClosedForm = false; - private System.ComponentModel.IContainer components; - private CategoryContext _categoryContext; - - - } + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/PostPropertyEditing/CategoryControl/CategoryDropDownControlM1.cs b/src/managed/OpenLiveWriter.PostEditor/PostPropertyEditing/CategoryControl/CategoryDropDownControlM1.cs index 2d21cc91..7a1bffd9 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostPropertyEditing/CategoryControl/CategoryDropDownControlM1.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostPropertyEditing/CategoryControl/CategoryDropDownControlM1.cs @@ -261,14 +261,14 @@ namespace OpenLiveWriter.PostEditor.PostPropertyEditing.CategoryControl Focus(); /* - _categoryDisplayForm = new CategoryDisplayFormM1(this, _categoryContext) ; - _categoryDisplayForm.MinDropDownWidth = 0; - IMiniFormOwner miniFormOwner = FindForm() as IMiniFormOwner; - if (miniFormOwner != null) - _categoryDisplayForm.FloatAboveOwner(miniFormOwner); - _categoryDisplayForm.Closed += new EventHandler(_categoryDisplayForm_Closed); - using ( new WaitCursor() ) - _categoryDisplayForm.Show(); + _categoryDisplayForm = new CategoryDisplayFormM1(this, _categoryContext) ; + _categoryDisplayForm.MinDropDownWidth = 0; + IMiniFormOwner miniFormOwner = FindForm() as IMiniFormOwner; + if (miniFormOwner != null) + _categoryDisplayForm.FloatAboveOwner(miniFormOwner); + _categoryDisplayForm.Closed += new EventHandler(_categoryDisplayForm_Closed); + using ( new WaitCursor() ) + _categoryDisplayForm.Show(); */ Point anchor = PointToScreen(new Point(RightToLeft == RightToLeft.Yes ? 0 : ClientSize.Width, ClientSize.Height)); @@ -322,7 +322,6 @@ namespace OpenLiveWriter.PostEditor.PostPropertyEditing.CategoryControl Invalidate(); } - private TextFormatFlags DisplayFormat { get { return TextFormatFlags.EndEllipsis | TextFormatFlags.VerticalCenter | TextFormatFlags.NoPrefix; } diff --git a/src/managed/OpenLiveWriter.PostEditor/PostPropertyEditing/CategoryControl/CategoryRefreshControl.cs b/src/managed/OpenLiveWriter.PostEditor/PostPropertyEditing/CategoryControl/CategoryRefreshControl.cs index 709d084c..b6c2a284 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostPropertyEditing/CategoryControl/CategoryRefreshControl.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostPropertyEditing/CategoryControl/CategoryRefreshControl.cs @@ -12,131 +12,129 @@ using OpenLiveWriter.Localization; namespace OpenLiveWriter.PostEditor.PostPropertyEditing.CategoryControl { - /// - /// Summary description for CategoryRefreshControl. - /// - internal class CategoryRefreshControl : UserControl - { - private BitmapButton buttonRefresh; - private IContainer components; - private CategoryContext _categoryContext; + /// + /// Summary description for CategoryRefreshControl. + /// + internal class CategoryRefreshControl : UserControl + { + private BitmapButton buttonRefresh; + private IContainer components; + private CategoryContext _categoryContext; - public CategoryRefreshControl() - { - // This call is required by the Windows.Forms Form Designer. - InitializeComponent(); - buttonRefresh.ButtonText = Res.Get(StringId.CategoryRefreshList); - this.buttonRefresh.ToolTip = Res.Get(StringId.CategoryRefreshListTooltip); - } + public CategoryRefreshControl() + { + // This call is required by the Windows.Forms Form Designer. + InitializeComponent(); + buttonRefresh.ButtonText = Res.Get(StringId.CategoryRefreshList); + this.buttonRefresh.ToolTip = Res.Get(StringId.CategoryRefreshListTooltip); + } + public void Initialize(CategoryContext context) + { + SuspendLayout(); + buttonRefresh.BitmapDisabled = ResourceHelper.LoadAssemblyResourceBitmap("PostPropertyEditing.CategoryControl.Images.refresh.png"); + buttonRefresh.BitmapEnabled = ResourceHelper.LoadAssemblyResourceBitmap("PostPropertyEditing.CategoryControl.Images.refresh.png"); + buttonRefresh.BitmapPushed = ResourceHelper.LoadAssemblyResourceBitmap("PostPropertyEditing.CategoryControl.Images.refresh.png"); + buttonRefresh.BitmapSelected = ResourceHelper.LoadAssemblyResourceBitmap("PostPropertyEditing.CategoryControl.Images.refreshSelected.png"); + buttonRefresh.TextAlignment = TextAlignment.Right; + buttonRefresh.ButtonStyle = ButtonStyle.Standard; + buttonRefresh.ButtonText = Res.Get(StringId.CategoryRefreshList); + this.buttonRefresh.Size = new Size(94, 22); + buttonRefresh.Click += new EventHandler(buttonRefresh_Click); - public void Initialize(CategoryContext context) - { - SuspendLayout(); - buttonRefresh.BitmapDisabled = ResourceHelper.LoadAssemblyResourceBitmap("PostPropertyEditing.CategoryControl.Images.refresh.png"); - buttonRefresh.BitmapEnabled = ResourceHelper.LoadAssemblyResourceBitmap("PostPropertyEditing.CategoryControl.Images.refresh.png"); - buttonRefresh.BitmapPushed = ResourceHelper.LoadAssemblyResourceBitmap("PostPropertyEditing.CategoryControl.Images.refresh.png"); - buttonRefresh.BitmapSelected = ResourceHelper.LoadAssemblyResourceBitmap("PostPropertyEditing.CategoryControl.Images.refreshSelected.png"); - buttonRefresh.TextAlignment = TextAlignment.Right; - buttonRefresh.ButtonStyle = ButtonStyle.Standard; - buttonRefresh.ButtonText = Res.Get(StringId.CategoryRefreshList); - this.buttonRefresh.Size = new Size(94, 22); - buttonRefresh.Click += new EventHandler(buttonRefresh_Click); + ResumeLayout(false); + _categoryContext = context; - ResumeLayout(false); - _categoryContext = context; + } - } + private void RequestRefresh() + { + _refreshing = true; + using (new WaitCursor()) + _categoryContext.Refresh(); + _refreshing = false; + } + private bool _refreshing = false; - private void RequestRefresh() - { - _refreshing = true; - using (new WaitCursor()) - _categoryContext.Refresh(); - _refreshing = false; - } - private bool _refreshing = false; + protected override void OnMouseUp(MouseEventArgs e) + { + RequestRefresh(); + base.OnMouseUp (e); + } + protected override bool ProcessCmdKey(ref Message msg, Keys keyData) + { + if (keyData == Keys.Enter && !_refreshing) + { + RequestRefresh(); + return true; + } + else if (keyData == Keys.Up) + { + if (Parent != null) + Parent.SelectNextControl(this, false, true, true, true); + return true; + } + else if (keyData == Keys.Down) + { + if (Parent != null) + Parent.SelectNextControl(this, true, true, true, true); + return true; + } + return base.ProcessCmdKey (ref msg, keyData); + } - protected override void OnMouseUp(MouseEventArgs e) - { - RequestRefresh(); - base.OnMouseUp (e); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - protected override bool ProcessCmdKey(ref Message msg, Keys keyData) - { - if (keyData == Keys.Enter && !_refreshing) - { - RequestRefresh(); - return true; - } - else if (keyData == Keys.Up) - { - if (Parent != null) - Parent.SelectNextControl(this, false, true, true, true); - return true; - } - else if (keyData == Keys.Down) - { - if (Parent != null) - Parent.SelectNextControl(this, true, true, true, true); - return true; - } - return base.ProcessCmdKey (ref msg, keyData); - } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.buttonRefresh = new OpenLiveWriter.Controls.BitmapButton(this.components); + this.SuspendLayout(); + // + // buttonRefresh + // + this.buttonRefresh.AutoSizeWidth = true; + this.buttonRefresh.ButtonText = "Refresh List"; + this.buttonRefresh.Location = new System.Drawing.Point(0, 0); + this.buttonRefresh.Name = "buttonRefresh"; + this.buttonRefresh.Size = new System.Drawing.Size(94, 29); + this.buttonRefresh.TabIndex = 0; + this.buttonRefresh.ToolTip = "Refreshes the list of categories."; + // + // CategoryRefreshControl + // + this.BackColor = System.Drawing.SystemColors.ControlLightLight; + this.Controls.Add(this.buttonRefresh); + this.Name = "CategoryRefreshControl"; + this.Size = new System.Drawing.Size(94, 29); + this.ResumeLayout(false); - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + } + #endregion - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - this.buttonRefresh = new OpenLiveWriter.Controls.BitmapButton(this.components); - this.SuspendLayout(); - // - // buttonRefresh - // - this.buttonRefresh.AutoSizeWidth = true; - this.buttonRefresh.ButtonText = "Refresh List"; - this.buttonRefresh.Location = new System.Drawing.Point(0, 0); - this.buttonRefresh.Name = "buttonRefresh"; - this.buttonRefresh.Size = new System.Drawing.Size(94, 29); - this.buttonRefresh.TabIndex = 0; - this.buttonRefresh.ToolTip = "Refreshes the list of categories."; - // - // CategoryRefreshControl - // - this.BackColor = System.Drawing.SystemColors.ControlLightLight; - this.Controls.Add(this.buttonRefresh); - this.Name = "CategoryRefreshControl"; - this.Size = new System.Drawing.Size(94, 29); - this.ResumeLayout(false); + private void buttonRefresh_Click(object sender, EventArgs e) + { + RequestRefresh(); + } - } - #endregion - - private void buttonRefresh_Click(object sender, EventArgs e) - { - RequestRefresh(); - } - - } + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/PostPropertyEditing/CategoryControl/CategorySeparatorControl.cs b/src/managed/OpenLiveWriter.PostEditor/PostPropertyEditing/CategoryControl/CategorySeparatorControl.cs index 62bc816b..fec2134d 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostPropertyEditing/CategoryControl/CategorySeparatorControl.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostPropertyEditing/CategoryControl/CategorySeparatorControl.cs @@ -7,59 +7,59 @@ using System.Windows.Forms; namespace OpenLiveWriter.PostEditor.PostPropertyEditing.CategoryControl { - /// - /// Summary description for CategorySeparatorControl. - /// - internal class CategorySeparatorControl : UserControl - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CategorySeparatorControl. + /// + internal class CategorySeparatorControl : UserControl + { + /// + /// Required designer variable. + /// + private Container components = null; - public CategorySeparatorControl() - { - // This call is required by the Windows.Forms Form Designer. - InitializeComponent(); + public CategorySeparatorControl() + { + // This call is required by the Windows.Forms Form Designer. + InitializeComponent(); - TabStop = false; - } + TabStop = false; + } - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint (e); - e.Graphics.DrawLine(new Pen(SystemBrushes.ControlDarkDark, 1), 0, 0, Width - 8, 0 ); - } + protected override void OnPaint(PaintEventArgs e) + { + base.OnPaint (e); + e.Graphics.DrawLine(new Pen(SystemBrushes.ControlDarkDark, 1), 0, 0, Width - 8, 0 ); + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CategorySeparatorControl - // - this.Name = "CategorySeparatorControl"; - this.Size = new System.Drawing.Size(100, 5); + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CategorySeparatorControl + // + this.Name = "CategorySeparatorControl"; + this.Size = new System.Drawing.Size(100, 5); - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/PostPropertyEditing/CategoryControl/DisplayMessages/CategoryReminderDisplayMessage.cs b/src/managed/OpenLiveWriter.PostEditor/PostPropertyEditing/CategoryControl/DisplayMessages/CategoryReminderDisplayMessage.cs index deba6d42..a7716ece 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PostPropertyEditing/CategoryControl/DisplayMessages/CategoryReminderDisplayMessage.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PostPropertyEditing/CategoryControl/DisplayMessages/CategoryReminderDisplayMessage.cs @@ -8,63 +8,63 @@ using OpenLiveWriter.Controls; namespace OpenLiveWriter.PostEditor.PostPropertyEditing.CategoryControl.DisplayMessages { - public class CategoryReminderDisplayMessage : DisplayMessage - { - /// - /// Required designer variable. - /// - private Container components = null; + public class CategoryReminderDisplayMessage : DisplayMessage + { + /// + /// Required designer variable. + /// + private Container components = null; - public CategoryReminderDisplayMessage(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public CategoryReminderDisplayMessage(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - } + } - public CategoryReminderDisplayMessage() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); - } + public CategoryReminderDisplayMessage() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // ConfirmDeleteEntryDisplayMessage - // - this.Buttons = System.Windows.Forms.MessageBoxButtons.YesNo; - this.DefaultButton = System.Windows.Forms.MessageBoxDefaultButton.Button2 ; - this.Text = "You have not specified categories for this post.{0}Do you still want to continue with publishing?"; - this.Title = "Category Reminder"; - this.Type = DisplayMessageType.Question; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // ConfirmDeleteEntryDisplayMessage + // + this.Buttons = System.Windows.Forms.MessageBoxButtons.YesNo; + this.DefaultButton = System.Windows.Forms.MessageBoxDefaultButton.Button2 ; + this.Text = "You have not specified categories for this post.{0}Do you still want to continue with publishing?"; + this.Title = "Category Reminder"; + this.Type = DisplayMessageType.Question; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/PreferencesHandler.cs b/src/managed/OpenLiveWriter.PostEditor/PreferencesHandler.cs index 814d2e9c..a713ce9c 100644 --- a/src/managed/OpenLiveWriter.PostEditor/PreferencesHandler.cs +++ b/src/managed/OpenLiveWriter.PostEditor/PreferencesHandler.cs @@ -30,7 +30,7 @@ namespace OpenLiveWriter.PostEditor /// /// The name to preferences panel type table. /// - private static Hashtable preferencesPanelTypeTable; + private static Hashtable preferencesPanelTypeTable; public static PreferencesHandler Instance { @@ -59,7 +59,6 @@ namespace OpenLiveWriter.PostEditor ShowPreferences(owner, null, type); } - /// /// A version of show preferences that allows the caller to specify which /// panel should be selected when the dialog opens diff --git a/src/managed/OpenLiveWriter.PostEditor/RecentPostProgressForm.cs b/src/managed/OpenLiveWriter.PostEditor/RecentPostProgressForm.cs index 125f33bf..979007e6 100644 --- a/src/managed/OpenLiveWriter.PostEditor/RecentPostProgressForm.cs +++ b/src/managed/OpenLiveWriter.PostEditor/RecentPostProgressForm.cs @@ -27,7 +27,6 @@ namespace OpenLiveWriter.PostEditor /// private Container components = null; - public RecentPostProgressForm(string entityName) { // @@ -171,6 +170,5 @@ namespace OpenLiveWriter.PostEditor #endregion - } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Tables/CellPropertiesForm.cs b/src/managed/OpenLiveWriter.PostEditor/Tables/CellPropertiesForm.cs index fec20f53..8946bd97 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Tables/CellPropertiesForm.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Tables/CellPropertiesForm.cs @@ -66,7 +66,6 @@ namespace OpenLiveWriter.PostEditor.Tables DialogResult = DialogResult.OK; } - private bool ValidateInput() { return true; @@ -146,6 +145,5 @@ namespace OpenLiveWriter.PostEditor.Tables } #endregion - } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Tables/ColumnWidthControl.cs b/src/managed/OpenLiveWriter.PostEditor/Tables/ColumnWidthControl.cs index 5ab3d300..d90ea1d8 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Tables/ColumnWidthControl.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Tables/ColumnWidthControl.cs @@ -17,16 +17,16 @@ namespace OpenLiveWriter.PostEditor.Tables { /* Why is percent based column sizing not allowed? We want to in all cases let the - * table flow to occupy the width of its container. This provides for both robust - * behavior accross blogs/templates/normal mode and also allows the browser table - * rendering logic to automatically "balance" columns based on their content and - * preferred widths. Percent mode requires that the table be given a fixed width - * (otherwise you end up with a table of essentially zero size). Note that users - * are essentially able to do percent based sizing by providing a set of - * preferred widths to their columns (if the preferred widths exceed the available - * width in the table's parent block then they become relative guidelines for - * sizing the columns). - */ + * table flow to occupy the width of its container. This provides for both robust + * behavior accross blogs/templates/normal mode and also allows the browser table + * rendering logic to automatically "balance" columns based on their content and + * preferred widths. Percent mode requires that the table be given a fixed width + * (otherwise you end up with a table of essentially zero size). Note that users + * are essentially able to do percent based sizing by providing a set of + * preferred widths to their columns (if the preferred widths exceed the available + * width in the table's parent block then they become relative guidelines for + * sizing the columns). + */ public class ColumnWidthControl : System.Windows.Forms.UserControl { @@ -38,7 +38,6 @@ namespace OpenLiveWriter.PostEditor.Tables /// private System.ComponentModel.Container components = null; - public ColumnWidthControl() { // This call is required by the Windows.Forms Form Designer. @@ -59,7 +58,6 @@ namespace OpenLiveWriter.PostEditor.Tables } } - public int ColumnWidth { get @@ -185,9 +183,7 @@ namespace OpenLiveWriter.PostEditor.Tables } #endregion - } - } diff --git a/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandCellProperties.cs b/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandCellProperties.cs index 3e68d405..28055783 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandCellProperties.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandCellProperties.cs @@ -6,57 +6,56 @@ using OpenLiveWriter.ApplicationFramework ; namespace OpenLiveWriter.PostEditor.Tables.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandCellProperties : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandCopy. + /// + public class CommandCellProperties : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandCellProperties(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandCellProperties(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandCellProperties() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandCellProperties() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandFont + // + this.Identifier = "OpenLiveWriter.PostEditor.Tables.Commands.CellProperties"; + this.MainMenuPath = "T&able@6/Cell &Properties...@120"; + this.MenuText = "Cell &Properties..."; + this.Text = "Cell Properties"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandFont - // - this.Identifier = "OpenLiveWriter.PostEditor.Tables.Commands.CellProperties"; - this.MainMenuPath = "T&able@6/Cell &Properties...@120"; - this.MenuText = "Cell &Properties..."; - this.Text = "Cell Properties"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandClearCell.cs b/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandClearCell.cs index 923fee18..70e11503 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandClearCell.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandClearCell.cs @@ -6,57 +6,56 @@ using OpenLiveWriter.ApplicationFramework ; namespace OpenLiveWriter.PostEditor.Tables.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandClearCell : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandCopy. + /// + public class CommandClearCell : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandClearCell(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandClearCell(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandClearCell() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandClearCell() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandClearCell + // + this.Identifier = "OpenLiveWriter.PostEditor.Tables.Commands.ClearCell"; + this.MainMenuPath = "T&able@6/-Cl&ear Cell{0}@320"; + this.MenuText = "Cl&ear Cell{0}"; + this.Text = "Clear Cell"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandClearCell - // - this.Identifier = "OpenLiveWriter.PostEditor.Tables.Commands.ClearCell"; - this.MainMenuPath = "T&able@6/-Cl&ear Cell{0}@320"; - this.MenuText = "Cl&ear Cell{0}"; - this.Text = "Clear Cell"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandColumnProperties.cs b/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandColumnProperties.cs index 7109154e..0fb86639 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandColumnProperties.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandColumnProperties.cs @@ -6,57 +6,56 @@ using OpenLiveWriter.ApplicationFramework ; namespace OpenLiveWriter.PostEditor.Tables.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandColumnProperties : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandCopy. + /// + public class CommandColumnProperties : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandColumnProperties(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandColumnProperties(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandColumnProperties() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandColumnProperties() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandFont + // + this.Identifier = "OpenLiveWriter.PostEditor.Tables.Commands.ColumnProperties"; + this.MainMenuPath = "T&able@6/&Column Properties...@115"; + this.MenuText = "&Column Properties..."; + this.Text = "Column Properties"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandFont - // - this.Identifier = "OpenLiveWriter.PostEditor.Tables.Commands.ColumnProperties"; - this.MainMenuPath = "T&able@6/&Column Properties...@115"; - this.MenuText = "&Column Properties..."; - this.Text = "Column Properties"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandDeleteColumn.cs b/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandDeleteColumn.cs index 87617feb..d3183a06 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandDeleteColumn.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandDeleteColumn.cs @@ -6,57 +6,56 @@ using OpenLiveWriter.ApplicationFramework ; namespace OpenLiveWriter.PostEditor.Tables.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandDeleteColumn : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandCopy. + /// + public class CommandDeleteColumn : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandDeleteColumn(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandDeleteColumn(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandDeleteColumn() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandDeleteColumn() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandDeleteColumn + // + this.Identifier = "OpenLiveWriter.PostEditor.Tables.Commands.DeleteColumn"; + this.MainMenuPath = "T&able@6/Delete Colum&n{0}@310"; + this.MenuText = "Delete Colum&n{0}"; + this.Text = "Delete Column"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandDeleteColumn - // - this.Identifier = "OpenLiveWriter.PostEditor.Tables.Commands.DeleteColumn"; - this.MainMenuPath = "T&able@6/Delete Colum&n{0}@310"; - this.MenuText = "Delete Colum&n{0}"; - this.Text = "Delete Column"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandDeleteRow.cs b/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandDeleteRow.cs index 36616f5e..a7eb05a0 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandDeleteRow.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandDeleteRow.cs @@ -6,57 +6,56 @@ using OpenLiveWriter.ApplicationFramework ; namespace OpenLiveWriter.PostEditor.Tables.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandDeleteRow : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandCopy. + /// + public class CommandDeleteRow : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandDeleteRow(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandDeleteRow(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandDeleteRow() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandDeleteRow() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandDeleteRow + // + this.Identifier = "OpenLiveWriter.PostEditor.Tables.Commands.DeleteRow"; + this.MainMenuPath = "T&able@6/Delete Ro&w{0}@305"; + this.MenuText = "Delete Ro&w{0}"; + this.Text = "Delete Row"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandDeleteRow - // - this.Identifier = "OpenLiveWriter.PostEditor.Tables.Commands.DeleteRow"; - this.MainMenuPath = "T&able@6/Delete Ro&w{0}@305"; - this.MenuText = "Delete Ro&w{0}"; - this.Text = "Delete Row"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandDeleteTable.cs b/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandDeleteTable.cs index 4d8ddc27..2c0193c4 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandDeleteTable.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandDeleteTable.cs @@ -6,54 +6,53 @@ using OpenLiveWriter.ApplicationFramework ; namespace OpenLiveWriter.PostEditor.Tables.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandDeleteTable : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandCopy. + /// + public class CommandDeleteTable : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandDeleteTable(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandDeleteTable(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandDeleteTable() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandDeleteTable() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.Identifier = "OpenLiveWriter.PostEditor.Tables.Commands.DeleteTable"; + this.MainMenuPath = "T&able@6/-&Delete Table...@300"; + this.MenuText = "&Delete Table..."; + this.Text = "Delete Table"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.Identifier = "OpenLiveWriter.PostEditor.Tables.Commands.DeleteTable"; - this.MainMenuPath = "T&able@6/-&Delete Table...@300"; - this.MenuText = "&Delete Table..."; - this.Text = "Delete Table"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandInsertColumnLeft.cs b/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandInsertColumnLeft.cs index 96f50b14..4691f043 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandInsertColumnLeft.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandInsertColumnLeft.cs @@ -6,57 +6,56 @@ using OpenLiveWriter.ApplicationFramework ; namespace OpenLiveWriter.PostEditor.Tables.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandInsertColumnLeft : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandCopy. + /// + public class CommandInsertColumnLeft : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandInsertColumnLeft(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandInsertColumnLeft(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandInsertColumnLeft() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandInsertColumnLeft() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandFont + // + this.Identifier = "OpenLiveWriter.PostEditor.Tables.Commands.InsertColumnLeft"; + this.MainMenuPath = "T&able@6/-Insert Column &Left@250"; + this.MenuText = "Insert Column &Left" ; + this.Text = "Insert Column Left"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandFont - // - this.Identifier = "OpenLiveWriter.PostEditor.Tables.Commands.InsertColumnLeft"; - this.MainMenuPath = "T&able@6/-Insert Column &Left@250"; - this.MenuText = "Insert Column &Left" ; - this.Text = "Insert Column Left"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandInsertColumnRight.cs b/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandInsertColumnRight.cs index 3a810cad..2de38cb4 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandInsertColumnRight.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandInsertColumnRight.cs @@ -6,57 +6,56 @@ using OpenLiveWriter.ApplicationFramework ; namespace OpenLiveWriter.PostEditor.Tables.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandInsertColumnRight : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandCopy. + /// + public class CommandInsertColumnRight : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandInsertColumnRight(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandInsertColumnRight(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandInsertColumnRight() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandInsertColumnRight() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandFont + // + this.Identifier = "OpenLiveWriter.PostEditor.Tables.Commands.InsertColumnRight"; + this.MainMenuPath = "T&able@6/Insert Column Ri&ght@255"; + this.MenuText = "Insert Column Ri&ght" ; + this.Text = "Insert Column Right"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandFont - // - this.Identifier = "OpenLiveWriter.PostEditor.Tables.Commands.InsertColumnRight"; - this.MainMenuPath = "T&able@6/Insert Column Ri&ght@255"; - this.MenuText = "Insert Column Ri&ght" ; - this.Text = "Insert Column Right"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandInsertRowAbove.cs b/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandInsertRowAbove.cs index 7df921c5..4f8b4c82 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandInsertRowAbove.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandInsertRowAbove.cs @@ -6,57 +6,56 @@ using OpenLiveWriter.ApplicationFramework ; namespace OpenLiveWriter.PostEditor.Tables.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandInsertRowAbove : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandCopy. + /// + public class CommandInsertRowAbove : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandInsertRowAbove(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandInsertRowAbove(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandInsertRowAbove() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandInsertRowAbove() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandFont + // + this.Identifier = "OpenLiveWriter.PostEditor.Tables.Commands.InsertRowAbove"; + this.MainMenuPath = "T&able@6/-Insert Row &Above@200"; + this.MenuText = "Insert Row &Above" ; + this.Text = "Insert Row Above"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandFont - // - this.Identifier = "OpenLiveWriter.PostEditor.Tables.Commands.InsertRowAbove"; - this.MainMenuPath = "T&able@6/-Insert Row &Above@200"; - this.MenuText = "Insert Row &Above" ; - this.Text = "Insert Row Above"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandInsertRowBelow.cs b/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandInsertRowBelow.cs index ff556434..980f8314 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandInsertRowBelow.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandInsertRowBelow.cs @@ -6,57 +6,56 @@ using OpenLiveWriter.ApplicationFramework ; namespace OpenLiveWriter.PostEditor.Tables.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandInsertRowBelow : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandCopy. + /// + public class CommandInsertRowBelow : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandInsertRowBelow(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandInsertRowBelow(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandInsertRowBelow() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandInsertRowBelow() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandFont + // + this.Identifier = "OpenLiveWriter.PostEditor.Tables.Commands.InsertRowBelow"; + this.MainMenuPath = "T&able@6/Insert Row &Below@205"; + this.MenuText = "Insert Row &Below" ; + this.Text = "Insert Row Below"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandFont - // - this.Identifier = "OpenLiveWriter.PostEditor.Tables.Commands.InsertRowBelow"; - this.MainMenuPath = "T&able@6/Insert Row &Below@205"; - this.MenuText = "Insert Row &Below" ; - this.Text = "Insert Row Below"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandInsertTable.cs b/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandInsertTable.cs index 64166f8d..a4c13522 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandInsertTable.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandInsertTable.cs @@ -6,57 +6,56 @@ using OpenLiveWriter.ApplicationFramework ; namespace OpenLiveWriter.PostEditor.Tables.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandInsertTable : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandCopy. + /// + public class CommandInsertTable : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandInsertTable(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandInsertTable(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandInsertTable() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandInsertTable() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandInsertTable + // + this.Identifier = "OpenLiveWriter.PostEditor.Tables.Commands.InsertTable"; + this.MainMenuPath = "T&able@6/&Insert Table...-@100"; + this.MenuText = "&Insert Table..."; + this.Text = "Insert Table"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandInsertTable - // - this.Identifier = "OpenLiveWriter.PostEditor.Tables.Commands.InsertTable"; - this.MainMenuPath = "T&able@6/&Insert Table...-@100"; - this.MenuText = "&Insert Table..."; - this.Text = "Insert Table"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandInsertTable2.cs b/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandInsertTable2.cs index edc9a3dc..5ddc10d2 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandInsertTable2.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandInsertTable2.cs @@ -6,57 +6,56 @@ using OpenLiveWriter.ApplicationFramework ; namespace OpenLiveWriter.PostEditor.Tables.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandInsertTable2 : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandCopy. + /// + public class CommandInsertTable2 : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandInsertTable2(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandInsertTable2(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandInsertTable2() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandInsertTable2() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandInsertTable + // + this.Identifier = "OpenLiveWriter.PostEditor.Tables.Commands.InsertTable2"; + this.MainMenuPath = "&Insert@4/&Table...@200"; + this.MenuText = "&Table..."; + this.Text = "Insert Table"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandInsertTable - // - this.Identifier = "OpenLiveWriter.PostEditor.Tables.Commands.InsertTable2"; - this.MainMenuPath = "&Insert@4/&Table...@200"; - this.MenuText = "&Table..."; - this.Text = "Insert Table"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandMoveColumnLeft.cs b/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandMoveColumnLeft.cs index 9f35bce1..cda66fa6 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandMoveColumnLeft.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandMoveColumnLeft.cs @@ -6,56 +6,55 @@ using OpenLiveWriter.ApplicationFramework ; namespace OpenLiveWriter.PostEditor.Tables.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandMoveColumnLeft : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandCopy. + /// + public class CommandMoveColumnLeft : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandMoveColumnLeft(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandMoveColumnLeft(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandMoveColumnLeft() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandMoveColumnLeft() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandFont - // - this.Identifier = "OpenLiveWriter.PostEditor.Tables.Commands.MoveColumnLeft"; - this.MainMenuPath = "T&able@6/Move Column Le&ft@260"; - this.MenuText = "Move Column Le&ft" ; - this.Text = "Move Column Left"; - } - #endregion - } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandFont + // + this.Identifier = "OpenLiveWriter.PostEditor.Tables.Commands.MoveColumnLeft"; + this.MainMenuPath = "T&able@6/Move Column Le&ft@260"; + this.MenuText = "Move Column Le&ft" ; + this.Text = "Move Column Left"; + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandMoveColumnRight.cs b/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandMoveColumnRight.cs index 9214470e..8a4052e5 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandMoveColumnRight.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandMoveColumnRight.cs @@ -6,53 +6,52 @@ using OpenLiveWriter.ApplicationFramework ; namespace OpenLiveWriter.PostEditor.Tables.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandMoveColumnRight : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandCopy. + /// + public class CommandMoveColumnRight : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandMoveColumnRight(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandMoveColumnRight(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandMoveColumnRight() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandMoveColumnRight() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.Identifier = "OpenLiveWriter.PostEditor.Tables.Commands.MoveColumnRight"; - this.MainMenuPath = "T&able@6/Move Column Rig&ht@265"; - this.MenuText = "Move Column Rig&ht" ; - this.Text = "Move Column Right"; - } - #endregion - } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.Identifier = "OpenLiveWriter.PostEditor.Tables.Commands.MoveColumnRight"; + this.MainMenuPath = "T&able@6/Move Column Rig&ht@265"; + this.MenuText = "Move Column Rig&ht" ; + this.Text = "Move Column Right"; + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandMoveRowDown.cs b/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandMoveRowDown.cs index f7c3f1bd..8eea0242 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandMoveRowDown.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandMoveRowDown.cs @@ -6,56 +6,55 @@ using OpenLiveWriter.ApplicationFramework ; namespace OpenLiveWriter.PostEditor.Tables.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandMoveRowDown : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandCopy. + /// + public class CommandMoveRowDown : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandMoveRowDown(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandMoveRowDown(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandMoveRowDown() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandMoveRowDown() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandFont - // - this.Identifier = "OpenLiveWriter.PostEditor.Tables.Commands.MoveRowDown"; - this.MainMenuPath = "T&able@6/Move Row D&own@215"; - this.MenuText = "Move Row D&own" ; - this.Text = "Move Row Down"; - } - #endregion - } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandFont + // + this.Identifier = "OpenLiveWriter.PostEditor.Tables.Commands.MoveRowDown"; + this.MainMenuPath = "T&able@6/Move Row D&own@215"; + this.MenuText = "Move Row D&own" ; + this.Text = "Move Row Down"; + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandMoveRowUp.cs b/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandMoveRowUp.cs index 480c7214..1a9a9815 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandMoveRowUp.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandMoveRowUp.cs @@ -6,56 +6,55 @@ using OpenLiveWriter.ApplicationFramework ; namespace OpenLiveWriter.PostEditor.Tables.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandMoveRowUp : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandCopy. + /// + public class CommandMoveRowUp : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandMoveRowUp(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandMoveRowUp(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandMoveRowUp() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandMoveRowUp() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandFont - // - this.Identifier = "OpenLiveWriter.PostEditor.Tables.Commands.MoveRowUp"; - this.MainMenuPath = "T&able@6/Move Row &Up@210"; - this.MenuText = "Move Row &Up" ; - this.Text = "Move Row Up"; - } - #endregion - } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandFont + // + this.Identifier = "OpenLiveWriter.PostEditor.Tables.Commands.MoveRowUp"; + this.MainMenuPath = "T&able@6/Move Row &Up@210"; + this.MenuText = "Move Row &Up" ; + this.Text = "Move Row Up"; + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandRowProperties.cs b/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandRowProperties.cs index 78740252..325f5fbf 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandRowProperties.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandRowProperties.cs @@ -6,56 +6,55 @@ using OpenLiveWriter.ApplicationFramework ; namespace OpenLiveWriter.PostEditor.Tables.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandRowProperties : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandCopy. + /// + public class CommandRowProperties : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandRowProperties(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandRowProperties(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandRowProperties() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandRowProperties() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandFont - // - this.Identifier = "OpenLiveWriter.PostEditor.Tables.Commands.RowProperties"; - this.MainMenuPath = "T&able@6/&Row Properties...@120"; - this.MenuText = "&Row Properties..."; - this.Text = "Row Properties"; - } - #endregion - } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandFont + // + this.Identifier = "OpenLiveWriter.PostEditor.Tables.Commands.RowProperties"; + this.MainMenuPath = "T&able@6/&Row Properties...@120"; + this.MenuText = "&Row Properties..."; + this.Text = "Row Properties"; + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandTableMenu.cs b/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandTableMenu.cs index 76955c6d..9d430673 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandTableMenu.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandTableMenu.cs @@ -6,56 +6,55 @@ using OpenLiveWriter.ApplicationFramework ; namespace OpenLiveWriter.PostEditor.Tables.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandTableMenu : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandCopy. + /// + public class CommandTableMenu : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandTableMenu(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandTableMenu(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandTableMenu() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandTableMenu() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandInsertTable + // + this.Identifier = "OpenLiveWriter.PostEditor.Tables.Commands.TableMenu"; + this.MenuText = "Table"; + this.Text = "Table"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandInsertTable - // - this.Identifier = "OpenLiveWriter.PostEditor.Tables.Commands.TableMenu"; - this.MenuText = "Table"; - this.Text = "Table"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandTableProperties.cs b/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandTableProperties.cs index cf456c62..bbd4488d 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandTableProperties.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Tables/Commands/CommandTableProperties.cs @@ -6,57 +6,56 @@ using OpenLiveWriter.ApplicationFramework ; namespace OpenLiveWriter.PostEditor.Tables.Commands { - /// - /// Summary description for CommandCopy. - /// - public class CommandTableProperties : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandCopy. + /// + public class CommandTableProperties : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandTableProperties(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandTableProperties(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandTableProperties() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandTableProperties() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandFont + // + this.Identifier = "OpenLiveWriter.PostEditor.Tables.Commands.TableProperties"; + this.MainMenuPath = "T&able@6/&Table Properties...@105"; + this.MenuText = "&Table Properties..."; + this.Text = "Table Properties"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandFont - // - this.Identifier = "OpenLiveWriter.PostEditor.Tables.Commands.TableProperties"; - this.MainMenuPath = "T&able@6/&Table Properties...@105"; - this.MenuText = "&Table Properties..."; - this.Text = "Table Properties"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Tables/DisplayMessages/ConfirmDeleteTableDisplayMessage.cs b/src/managed/OpenLiveWriter.PostEditor/Tables/DisplayMessages/ConfirmDeleteTableDisplayMessage.cs index cd2a143e..e4e25c66 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Tables/DisplayMessages/ConfirmDeleteTableDisplayMessage.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Tables/DisplayMessages/ConfirmDeleteTableDisplayMessage.cs @@ -6,69 +6,69 @@ using OpenLiveWriter.Controls; namespace OpenLiveWriter.PostEditor.Tables.DisplayMessages { - public class ConfirmDeleteTableDisplayMessage : DisplayMessage - { - /// - /// Required designer variable. - /// - private Container components = null; + public class ConfirmDeleteTableDisplayMessage : DisplayMessage + { + /// + /// Required designer variable. + /// + private Container components = null; - public ConfirmDeleteTableDisplayMessage(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public ConfirmDeleteTableDisplayMessage(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - // - // - // - } + // + // + // + } - public ConfirmDeleteTableDisplayMessage() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public ConfirmDeleteTableDisplayMessage() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // ConfirmDeletePostDisplayMessage - // - this.Buttons = System.Windows.Forms.MessageBoxButtons.YesNo; - this.Text = "Are you sure you want to delete the table?"; - this.Title = "Confirm Delete"; - this.Type = DisplayMessageType.Warning; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // ConfirmDeletePostDisplayMessage + // + this.Buttons = System.Windows.Forms.MessageBoxButtons.YesNo; + this.Text = "Are you sure you want to delete the table?"; + this.Title = "Confirm Delete"; + this.Type = DisplayMessageType.Warning; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Tables/DisplayMessages/UnspecifiedValueDisplayMessage.cs b/src/managed/OpenLiveWriter.PostEditor/Tables/DisplayMessages/UnspecifiedValueDisplayMessage.cs index 83b1575b..bf11e626 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Tables/DisplayMessages/UnspecifiedValueDisplayMessage.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Tables/DisplayMessages/UnspecifiedValueDisplayMessage.cs @@ -6,68 +6,68 @@ using OpenLiveWriter.Controls; namespace OpenLiveWriter.PostEditor.Tables.DisplayMessages { - /// - /// Summary description for DeleteSingleItemDisplayMessage. - /// - public class UnspecifiedValueDisplayMessage : DisplayMessage - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for DeleteSingleItemDisplayMessage. + /// + public class UnspecifiedValueDisplayMessage : DisplayMessage + { + /// + /// Required designer variable. + /// + private Container components = null; - public UnspecifiedValueDisplayMessage(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public UnspecifiedValueDisplayMessage(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - // - // - // - } + // + // + // + } - public UnspecifiedValueDisplayMessage() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public UnspecifiedValueDisplayMessage() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.Text = "You must provide a value for the {0} field."; - this.Title = "Required Value Not Specified"; - this.Type = DisplayMessageType.Warning; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.Text = "You must provide a value for the {0} field."; + this.Title = "Required Value Not Specified"; + this.Type = DisplayMessageType.Warning; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Tables/DisplayMessages/ValueExceedsMaximumDisplayMessage.cs b/src/managed/OpenLiveWriter.PostEditor/Tables/DisplayMessages/ValueExceedsMaximumDisplayMessage.cs index fb1be0e6..14a5be8e 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Tables/DisplayMessages/ValueExceedsMaximumDisplayMessage.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Tables/DisplayMessages/ValueExceedsMaximumDisplayMessage.cs @@ -6,68 +6,68 @@ using OpenLiveWriter.Controls; namespace OpenLiveWriter.PostEditor.Tables.DisplayMessages { - /// - /// Summary description for DeleteSingleItemDisplayMessage. - /// - public class ValueExceedsMaximumDisplayMessage : DisplayMessage - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for DeleteSingleItemDisplayMessage. + /// + public class ValueExceedsMaximumDisplayMessage : DisplayMessage + { + /// + /// Required designer variable. + /// + private Container components = null; - public ValueExceedsMaximumDisplayMessage(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public ValueExceedsMaximumDisplayMessage(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - // - // - // - } + // + // + // + } - public ValueExceedsMaximumDisplayMessage() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public ValueExceedsMaximumDisplayMessage() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.Text = "You must enter a value less than {0} for the {1} field."; - this.Title = "Maximum Value Exceeded"; - this.Type = DisplayMessageType.Warning; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.Text = "You must enter a value less than {0} for the {1} field."; + this.Title = "Maximum Value Exceeded"; + this.Type = DisplayMessageType.Warning; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Tables/DisplayMessages/ValueLessThanMinimumDisplayMessage.cs b/src/managed/OpenLiveWriter.PostEditor/Tables/DisplayMessages/ValueLessThanMinimumDisplayMessage.cs index f1604d20..4bc73428 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Tables/DisplayMessages/ValueLessThanMinimumDisplayMessage.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Tables/DisplayMessages/ValueLessThanMinimumDisplayMessage.cs @@ -6,68 +6,68 @@ using OpenLiveWriter.Controls; namespace OpenLiveWriter.PostEditor.Tables.DisplayMessages { - /// - /// Summary description for DeleteSingleItemDisplayMessage. - /// - public class ValueLessThanMinimumDisplayMessage : DisplayMessage - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for DeleteSingleItemDisplayMessage. + /// + public class ValueLessThanMinimumDisplayMessage : DisplayMessage + { + /// + /// Required designer variable. + /// + private Container components = null; - public ValueLessThanMinimumDisplayMessage(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public ValueLessThanMinimumDisplayMessage(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - // - // - // - } + // + // + // + } - public ValueLessThanMinimumDisplayMessage() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public ValueLessThanMinimumDisplayMessage() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.Text = "You must enter a value of at least {0} for the {1} field."; - this.Title = "Value Less Than Minimum"; - this.Type = DisplayMessageType.Warning; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.Text = "You must enter a value of at least {0} for the {1} field."; + this.Title = "Value Less Than Minimum"; + this.Type = DisplayMessageType.Warning; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Tables/DisplayMessages/WidthExceedsMaximumDisplayMessage.cs b/src/managed/OpenLiveWriter.PostEditor/Tables/DisplayMessages/WidthExceedsMaximumDisplayMessage.cs index 3594b1db..7088544e 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Tables/DisplayMessages/WidthExceedsMaximumDisplayMessage.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Tables/DisplayMessages/WidthExceedsMaximumDisplayMessage.cs @@ -6,68 +6,68 @@ using OpenLiveWriter.Controls; namespace OpenLiveWriter.PostEditor.Tables.DisplayMessages { - /// - /// Summary description for DeleteSingleItemDisplayMessage. - /// - public class WidthExceedsMaximumDisplayMessage : DisplayMessage - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for DeleteSingleItemDisplayMessage. + /// + public class WidthExceedsMaximumDisplayMessage : DisplayMessage + { + /// + /// Required designer variable. + /// + private Container components = null; - public WidthExceedsMaximumDisplayMessage(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - container.Add(this); - InitializeComponent(); + public WidthExceedsMaximumDisplayMessage(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + container.Add(this); + InitializeComponent(); - // - // - // - } + // + // + // + } - public WidthExceedsMaximumDisplayMessage() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public WidthExceedsMaximumDisplayMessage() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.Text = "A table cannot have a width larger than the width of its container\n(this table's container is {0} pixels wide)."; - this.Title = "Table Width Exceeds Maximum"; - this.Type = DisplayMessageType.Warning; + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.Text = "A table cannot have a width larger than the width of its container\n(this table's container is {0} pixels wide)."; + this.Title = "Table Width Exceeds Maximum"; + this.Type = DisplayMessageType.Warning; - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Tables/RowPropertiesForm.cs b/src/managed/OpenLiveWriter.PostEditor/Tables/RowPropertiesForm.cs index c18d59ba..756d28fe 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Tables/RowPropertiesForm.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Tables/RowPropertiesForm.cs @@ -308,6 +308,5 @@ namespace OpenLiveWriter.PostEditor.Tables } #endregion - } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Tables/TableAlignmentControl.cs b/src/managed/OpenLiveWriter.PostEditor/Tables/TableAlignmentControl.cs index c4bb22a2..2c92cef3 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Tables/TableAlignmentControl.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Tables/TableAlignmentControl.cs @@ -89,7 +89,6 @@ namespace OpenLiveWriter.PostEditor.Tables comboBoxValue.Items.Remove(option); } - /// /// Clean up any resources being used. /// @@ -157,7 +156,6 @@ namespace OpenLiveWriter.PostEditor.Tables _value = value; } - public string Caption { get { return _caption; } } public object Value { get { return _value; } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Tables/TableCellSelectionTracker.cs b/src/managed/OpenLiveWriter.PostEditor/Tables/TableCellSelectionTracker.cs index 621f705d..c9f3c4fb 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Tables/TableCellSelectionTracker.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Tables/TableCellSelectionTracker.cs @@ -64,6 +64,5 @@ namespace OpenLiveWriter.PostEditor.Tables private ArrayList _lastSelectedCells = new ArrayList(); - } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Tables/TableColorPickerControl.cs b/src/managed/OpenLiveWriter.PostEditor/Tables/TableColorPickerControl.cs index 6887ee35..1d20b33a 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Tables/TableColorPickerControl.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Tables/TableColorPickerControl.cs @@ -11,141 +11,140 @@ using OpenLiveWriter.CoreServices; namespace OpenLiveWriter.PostEditor.Tables { - /// - /// Summary description for TableColorPickerControl. - /// - public class TableColorPickerControl : System.Windows.Forms.UserControl - { - private System.Windows.Forms.Button buttonBrowseColor; - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; + /// + /// Summary description for TableColorPickerControl. + /// + public class TableColorPickerControl : System.Windows.Forms.UserControl + { + private System.Windows.Forms.Button buttonBrowseColor; + /// + /// Required designer variable. + /// + private System.ComponentModel.Container components = null; - public TableColorPickerControl() - { - // This call is required by the Windows.Forms Form Designer. - InitializeComponent(); + public TableColorPickerControl() + { + // This call is required by the Windows.Forms Form Designer. + InitializeComponent(); - } + } - public CellColor CellColor - { - get - { - return _cellColor ; - } - set - { - // null == default - CellColor cellColor = value ; - if ( cellColor == null ) - cellColor = new CellColor(); + public CellColor CellColor + { + get + { + return _cellColor ; + } + set + { + // null == default + CellColor cellColor = value ; + if ( cellColor == null ) + cellColor = new CellColor(); - _cellColor = cellColor ; + _cellColor = cellColor ; - Invalidate() ; - } - } - private CellColor _cellColor = new CellColor(); + Invalidate() ; + } + } + private CellColor _cellColor = new CellColor(); + protected override void OnPaint(PaintEventArgs e) + { + base.OnPaint(e); - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint(e); + Graphics g = e.Graphics ; - Graphics g = e.Graphics ; + // calculate rectangle for color display + Rectangle rectColorDisplay = new Rectangle(0,0, Width-buttonBrowseColor.Width-5, Height-1 ) ; - // calculate rectangle for color display - Rectangle rectColorDisplay = new Rectangle(0,0, Width-buttonBrowseColor.Width-5, Height-1 ) ; + // draw color + if ( CellColor.IsMixed ) + { + using ( Brush brush = new SolidBrush(Color.Yellow) ) + g.FillRectangle(brush, rectColorDisplay); + } + else if (CellColor.Color == Color.Empty ) + { + using ( Brush brush = new SolidBrush(Color.Red) ) + g.FillRectangle(brush, rectColorDisplay); + } + else + { + using ( Brush brush = new SolidBrush(CellColor.Color) ) + g.FillRectangle(brush, rectColorDisplay); + } - // draw color - if ( CellColor.IsMixed ) - { - using ( Brush brush = new SolidBrush(Color.Yellow) ) - g.FillRectangle(brush, rectColorDisplay); - } - else if (CellColor.Color == Color.Empty ) - { - using ( Brush brush = new SolidBrush(Color.Red) ) - g.FillRectangle(brush, rectColorDisplay); - } - else - { - using ( Brush brush = new SolidBrush(CellColor.Color) ) - g.FillRectangle(brush, rectColorDisplay); - } + // draw border + using ( Pen pen = new Pen(ColorHelper.GetThemeBorderColor()) ) + g.DrawRectangle(pen, rectColorDisplay) ; + } - // draw border - using ( Pen pen = new Pen(ColorHelper.GetThemeBorderColor()) ) - g.DrawRectangle(pen, rectColorDisplay) ; - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.buttonBrowseColor = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // buttonBrowseColor + // + this.buttonBrowseColor.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.buttonBrowseColor.Location = new System.Drawing.Point(50, 0); + this.buttonBrowseColor.Name = "buttonBrowseColor"; + this.buttonBrowseColor.Size = new System.Drawing.Size(23, 21); + this.buttonBrowseColor.TabIndex = 1; + this.buttonBrowseColor.Text = "..."; + this.buttonBrowseColor.Click += new System.EventHandler(this.buttonBrowseColor_Click); + // + // TableColorPickerControl + // + this.Controls.Add(this.buttonBrowseColor); + this.Name = "TableColorPickerControl"; + this.Size = new System.Drawing.Size(73, 21); + this.ResumeLayout(false); - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.buttonBrowseColor = new System.Windows.Forms.Button(); - this.SuspendLayout(); - // - // buttonBrowseColor - // - this.buttonBrowseColor.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.buttonBrowseColor.Location = new System.Drawing.Point(50, 0); - this.buttonBrowseColor.Name = "buttonBrowseColor"; - this.buttonBrowseColor.Size = new System.Drawing.Size(23, 21); - this.buttonBrowseColor.TabIndex = 1; - this.buttonBrowseColor.Text = "..."; - this.buttonBrowseColor.Click += new System.EventHandler(this.buttonBrowseColor_Click); - // - // TableColorPickerControl - // - this.Controls.Add(this.buttonBrowseColor); - this.Name = "TableColorPickerControl"; - this.Size = new System.Drawing.Size(73, 21); - this.ResumeLayout(false); + } + #endregion - } - #endregion + private void buttonBrowseColor_Click(object sender, System.EventArgs e) + { + // create the color picker dialog + using (ColorDialog colorDialog = new ColorDialog() ) + { + colorDialog.AllowFullOpen = false; + colorDialog.FullOpen = false; + colorDialog.Color = CellColor.Color ; - private void buttonBrowseColor_Click(object sender, System.EventArgs e) - { - // create the color picker dialog - using (ColorDialog colorDialog = new ColorDialog() ) - { - colorDialog.AllowFullOpen = false; - colorDialog.FullOpen = false; - colorDialog.Color = CellColor.Color ; - - // show the color picker dialog - using ( new WaitCursor() ) - { - if ( colorDialog.ShowDialog(FindForm()) == DialogResult.OK ) - { - // update color - CellColor = new CellColor(colorDialog.Color) ; - } - } - } - } - } + // show the color picker dialog + using ( new WaitCursor() ) + { + if ( colorDialog.ShowDialog(FindForm()) == DialogResult.OK ) + { + // update color + CellColor = new CellColor(colorDialog.Color) ; + } + } + } + } + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Tables/TableColumnSizeEditor.cs b/src/managed/OpenLiveWriter.PostEditor/Tables/TableColumnSizeEditor.cs index d9195506..65f5f19c 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Tables/TableColumnSizeEditor.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Tables/TableColumnSizeEditor.cs @@ -70,7 +70,6 @@ namespace OpenLiveWriter.PostEditor.Tables } } - private int HandleMouseEvent(int inEvtDispId, IHTMLEventObj pIEventObj) { // WinLive 160252: MSHTML throws a COMException with HRESULT 0x8000FFFF (E_UNEXPECTED) when calling @@ -176,7 +175,6 @@ namespace OpenLiveWriter.PostEditor.Tables } - private void OnMouseMove(TableColumnMouseEventArgs ea) { if (_sizingOperation.InProgress) @@ -386,7 +384,6 @@ namespace OpenLiveWriter.PostEditor.Tables ShowSizingCursor(); } - public void EndSizing() { try @@ -432,7 +429,6 @@ namespace OpenLiveWriter.PostEditor.Tables get { return _sizingUndoUnit != null; } } - public void ShowCursor(Cursor cursor) { _editorContext.OverrideCursor = true; @@ -512,7 +508,6 @@ namespace OpenLiveWriter.PostEditor.Tables private HTMLTableColumn _rightColumn = null; private bool _cellWidthsFixed = true; - } internal class TableColumnMouseEventArgs : EventArgs diff --git a/src/managed/OpenLiveWriter.PostEditor/Tables/TableDataFormatHandler.cs b/src/managed/OpenLiveWriter.PostEditor/Tables/TableDataFormatHandler.cs index 657374c2..62a125b0 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Tables/TableDataFormatHandler.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Tables/TableDataFormatHandler.cs @@ -198,6 +198,5 @@ namespace OpenLiveWriter.PostEditor.Tables return null; } - } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Tables/TableEditingElementBehavior.cs b/src/managed/OpenLiveWriter.PostEditor/Tables/TableEditingElementBehavior.cs index 2b0e0201..21070cd8 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Tables/TableEditingElementBehavior.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Tables/TableEditingElementBehavior.cs @@ -25,7 +25,6 @@ namespace OpenLiveWriter.PostEditor.Tables _tableEditingManager = tableEditingManager; } - protected override void OnElementAttached() { base.OnElementAttached(); @@ -317,7 +316,6 @@ namespace OpenLiveWriter.PostEditor.Tables } private TableEditingContext _tableEditingContext; - private void SelectEntireTable() { try @@ -389,5 +387,4 @@ namespace OpenLiveWriter.PostEditor.Tables } - } diff --git a/src/managed/OpenLiveWriter.PostEditor/Tables/TableEditingManager.cs b/src/managed/OpenLiveWriter.PostEditor/Tables/TableEditingManager.cs index 0284b55c..d9fca0c5 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Tables/TableEditingManager.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Tables/TableEditingManager.cs @@ -367,5 +367,4 @@ namespace OpenLiveWriter.PostEditor.Tables } - } diff --git a/src/managed/OpenLiveWriter.PostEditor/Tables/TableEditor.cs b/src/managed/OpenLiveWriter.PostEditor/Tables/TableEditor.cs index 2e4950b8..09cc8db3 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Tables/TableEditor.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Tables/TableEditor.cs @@ -186,7 +186,6 @@ namespace OpenLiveWriter.PostEditor.Tables return tableEditor.InsertRowBelow(); } - public static void MoveRowUp(IHtmlEditorComponentContext editorContext) { MarkupRange selectedMarkupRange = editorContext.Selection.SelectedMarkupRange; @@ -376,7 +375,6 @@ namespace OpenLiveWriter.PostEditor.Tables tableEditor.MakeEmptyCellsNull(); } - #region Construction and Initialization private TableEditor(IHtmlEditorComponentContext editorContext) @@ -390,12 +388,10 @@ namespace OpenLiveWriter.PostEditor.Tables _markupRange = markupRange; } - #endregion #region Table Level Commands - private TableProperties TableProperties { get @@ -494,7 +490,6 @@ namespace OpenLiveWriter.PostEditor.Tables #region Row Level Commands - private RowProperties RowProperties { get @@ -923,10 +918,8 @@ namespace OpenLiveWriter.PostEditor.Tables undoUnit.Commit(); } - } - /// /// Routine to automatically add/remove/restore   to empty cells so that /// these empty cells do not "collapse" when published. @@ -1077,7 +1070,6 @@ namespace OpenLiveWriter.PostEditor.Tables textRange.select(); } - #endregion #region Private Helpers @@ -1213,7 +1205,6 @@ namespace OpenLiveWriter.PostEditor.Tables return verticalAlignment; } - private bool TableParentElementFilter(IHTMLElement e) { if (ElementFilters.BLOCK_ELEMENTS(e)) @@ -1235,7 +1226,6 @@ namespace OpenLiveWriter.PostEditor.Tables return cell as IHTMLTableCell; } - private void DeleteTableIfEmpty() { IHTMLElement tableElement = TableSelection.Table as IHTMLElement; @@ -1248,7 +1238,6 @@ namespace OpenLiveWriter.PostEditor.Tables } - private void InsertAdjacentColumn(HTMLTableColumn column, bool after) { // set the specified alignment for each cell in the column @@ -1282,7 +1271,6 @@ namespace OpenLiveWriter.PostEditor.Tables private MarkupRange _preservedMarkupRange = null; } - #endregion #region Private Data and Constants @@ -1297,7 +1285,6 @@ namespace OpenLiveWriter.PostEditor.Tables } - public class TableCreationParameters { public TableCreationParameters(int rows, int columns, TableProperties properties) diff --git a/src/managed/OpenLiveWriter.PostEditor/Tables/TableHelper.cs b/src/managed/OpenLiveWriter.PostEditor/Tables/TableHelper.cs index 3fe7dd17..ba9dfc43 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Tables/TableHelper.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Tables/TableHelper.cs @@ -112,7 +112,6 @@ namespace OpenLiveWriter.PostEditor.Tables } } - public static int GetRowHeight(IHTMLTableRow row) { IHTMLTableRow2 row2 = row as IHTMLTableRow2; diff --git a/src/managed/OpenLiveWriter.PostEditor/Tables/TablePropertiesForm.cs b/src/managed/OpenLiveWriter.PostEditor/Tables/TablePropertiesForm.cs index f0d27f5d..1a9400a4 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Tables/TablePropertiesForm.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Tables/TablePropertiesForm.cs @@ -170,7 +170,6 @@ namespace OpenLiveWriter.PostEditor.Tables } - private void InitializeFormProperties(TableProperties properties) { BorderSize = properties.BorderSize; @@ -219,7 +218,6 @@ namespace OpenLiveWriter.PostEditor.Tables } } - private void buttonOK_Click(object sender, System.EventArgs e) { if (ValidateInput()) @@ -299,7 +297,6 @@ namespace OpenLiveWriter.PostEditor.Tables return true; } - private bool ValidateTextBoxInteger(string name, TextBox textBox, int maxValue) { string textBoxValue = textBox.Text.Trim(); @@ -398,7 +395,6 @@ namespace OpenLiveWriter.PostEditor.Tables TableEditingSettings.DefaultWidth = parameters.Properties.Width; } - /// /// Clean up any resources being used. /// @@ -662,6 +658,5 @@ namespace OpenLiveWriter.PostEditor.Tables #endregion - } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Tagging/SectionHeader.cs b/src/managed/OpenLiveWriter.PostEditor/Tagging/SectionHeader.cs index d5d8bfbf..4f438ec9 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Tagging/SectionHeader.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Tagging/SectionHeader.cs @@ -10,82 +10,82 @@ using OpenLiveWriter.CoreServices.UI; namespace OpenLiveWriter.PostEditor.Tagging { - class SectionHeader : Control - { - public SectionHeader() - { - _uiTheme = new UITheme(this); - } - public string HeaderText - { - get { return _headerText; } - set - { - _headerText = value; - Invalidate(); - } - } - private string _headerText; + class SectionHeader : Control + { + public SectionHeader() + { + _uiTheme = new UITheme(this); + } + public string HeaderText + { + get { return _headerText; } + set + { + _headerText = value; + Invalidate(); + } + } + private string _headerText; - protected override void OnPaintBackground(PaintEventArgs pevent) - { - // supress background painting to avoid flicker - } + protected override void OnPaintBackground(PaintEventArgs pevent) + { + // supress background painting to avoid flicker + } - protected override void OnPaint(PaintEventArgs e) - { - // draw background - using (Brush brush = new SolidBrush(_uiTheme.BackgroundColor)) - e.Graphics.FillRectangle(brush, ClientRectangle); + protected override void OnPaint(PaintEventArgs e) + { + // draw background + using (Brush brush = new SolidBrush(_uiTheme.BackgroundColor)) + e.Graphics.FillRectangle(brush, ClientRectangle); - // draw corner - if(_uiTheme.DrawImages) - e.Graphics.DrawImage(HeaderCornerImage, 0, 0); + // draw corner + if(_uiTheme.DrawImages) + e.Graphics.DrawImage(HeaderCornerImage, 0, 0); - // draw text - if (_headerText != null) - using (Brush brush = new SolidBrush(_uiTheme.TextColor)) - e.Graphics.DrawString(HeaderText, Font, brush, 3, 1); - } + // draw text + if (_headerText != null) + using (Brush brush = new SolidBrush(_uiTheme.TextColor)) + e.Graphics.DrawString(HeaderText, Font, brush, 3, 1); + } - protected override void OnSizeChanged(EventArgs e) - { - base.OnSizeChanged(e); - Invalidate(); - } + protected override void OnSizeChanged(EventArgs e) + { + base.OnSizeChanged(e); + Invalidate(); + } - private static Bitmap HeaderCornerImage - { - get - { - return ResourceHelper.LoadAssemblyResourceBitmap("Tagging.Images.HeaderCorner.png") ; - } - } + private static Bitmap HeaderCornerImage + { + get + { + return ResourceHelper.LoadAssemblyResourceBitmap("Tagging.Images.HeaderCorner.png") ; + } + } - private UITheme _uiTheme; - private class UITheme : ControlUITheme - { - public Color TextColor; - public Color BackgroundColor; - public bool DrawImages; - public UITheme(Control c) : base(c, true) - { - } + private UITheme _uiTheme; + private class UITheme : ControlUITheme + { + public Color TextColor; + public Color BackgroundColor; + public bool DrawImages; + public UITheme(Control c) : base(c, true) + { + } - protected override void ApplyTheme(bool highContrast) - { - DrawImages = !highContrast; - if(highContrast) - { - TextColor = SystemColors.ControlText; - } - else - { - TextColor = Color.FromArgb(74, 101, 149); - BackgroundColor = Color.FromArgb(147, 176, 235); - } - base.ApplyTheme(highContrast); - } - } - } + protected override void ApplyTheme(bool highContrast) + { + DrawImages = !highContrast; + if(highContrast) + { + TextColor = SystemColors.ControlText; + } + else + { + TextColor = Color.FromArgb(74, 101, 149); + BackgroundColor = Color.FromArgb(147, 176, 235); + } + base.ApplyTheme(highContrast); + } + } + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Tagging/TagContentSource.cs b/src/managed/OpenLiveWriter.PostEditor/Tagging/TagContentSource.cs index bc55d324..25670bb0 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Tagging/TagContentSource.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Tagging/TagContentSource.cs @@ -87,6 +87,5 @@ namespace OpenLiveWriter.PostEditor.Tagging options.ShowDialog(dialogOwner); } - } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Tagging/TagForm.cs b/src/managed/OpenLiveWriter.PostEditor/Tagging/TagForm.cs index 1ef128b4..e4dbd64b 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Tagging/TagForm.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Tagging/TagForm.cs @@ -153,6 +153,5 @@ namespace OpenLiveWriter.PostEditor.Tagging DialogResult = DialogResult.Cancel; } - } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Tagging/TagProvider.cs b/src/managed/OpenLiveWriter.PostEditor/Tagging/TagProvider.cs index 84be310b..60617308 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Tagging/TagProvider.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Tagging/TagProvider.cs @@ -11,7 +11,6 @@ using OpenLiveWriter.Localization; namespace OpenLiveWriter.PostEditor.Tagging { - public class TagProvider : IComparable { private const string DEFAULT_FORMAT = "{1}"; diff --git a/src/managed/OpenLiveWriter.PostEditor/TextEditingCommandDispatcher.cs b/src/managed/OpenLiveWriter.PostEditor/TextEditingCommandDispatcher.cs index 04f80e8b..a7e2c92c 100644 --- a/src/managed/OpenLiveWriter.PostEditor/TextEditingCommandDispatcher.cs +++ b/src/managed/OpenLiveWriter.PostEditor/TextEditingCommandDispatcher.cs @@ -826,7 +826,6 @@ namespace OpenLiveWriter.PostEditor ActiveSimpleTextEditor.Paste(); } - public override void Manage() { Enabled = ActiveSimpleTextEditor.CanPaste; @@ -988,7 +987,6 @@ namespace OpenLiveWriter.PostEditor } } - internal class LetterCommand : OverridableCommand, CommandBarButtonLightweightControl.ICustomButtonBitmapPaint { private char _letter; @@ -1160,7 +1158,6 @@ namespace OpenLiveWriter.PostEditor } } - private class StyleCommand : TextEditingCommand { IHtmlStylePicker _stylePicker; @@ -1267,7 +1264,6 @@ namespace OpenLiveWriter.PostEditor public override string ContextMenuText { get { return Command.MenuText; } } } - private class NumbersCommand : LatchedTextEditingCommand { public override CommandId CommandId { get { return CommandId.Numbers; } } diff --git a/src/managed/OpenLiveWriter.PostEditor/UpdateWeblogProgressForm.cs b/src/managed/OpenLiveWriter.PostEditor/UpdateWeblogProgressForm.cs index ce494fb4..bcf21c89 100644 --- a/src/managed/OpenLiveWriter.PostEditor/UpdateWeblogProgressForm.cs +++ b/src/managed/OpenLiveWriter.PostEditor/UpdateWeblogProgressForm.cs @@ -184,7 +184,6 @@ namespace OpenLiveWriter.PostEditor Location = new Point(parentBounds.Left + ((parentBounds.Width - Width) / 2), parentBounds.Top + (int)(1.5 * Height)); } - private string FormatFormCaption(string entityName, bool publish) { return String.Format(CultureInfo.CurrentCulture, Res.Get(StringId.UpdateWeblogPublish1), publish ? entityName : Res.Get(StringId.UpdateWeblogDraft)); @@ -260,7 +259,6 @@ namespace OpenLiveWriter.PostEditor progressAnimatedBitmap.Start(); } - private void checkBoxViewPost_CheckedChanged(object sender, EventArgs e) { PostEditorSettings.ViewPostAfterPublish = checkBoxViewPost.Checked; @@ -287,7 +285,6 @@ namespace OpenLiveWriter.PostEditor private Bitmap bottomBevelBitmap = ResourceHelper.LoadAssemblyResourceBitmap("Images.PublishAnimation.BottomBevel.png"); - /// /// Clean up any resources being used. /// diff --git a/src/managed/OpenLiveWriter.PostEditor/Video/VideoBrowserForm.cs b/src/managed/OpenLiveWriter.PostEditor/Video/VideoBrowserForm.cs index 62777178..436b7db4 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Video/VideoBrowserForm.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Video/VideoBrowserForm.cs @@ -16,265 +16,264 @@ using OpenLiveWriter.Localization; namespace OpenLiveWriter.PostEditor.Video { - /// - /// Summary description for VideoBrowserForm. - /// - public class VideoBrowserForm : ApplicationDialog - { - private IContainer components = null; + /// + /// Summary description for VideoBrowserForm. + /// + public class VideoBrowserForm : ApplicationDialog + { + private IContainer components = null; - //top tab control - private LightweightControlContainerControl mainTabControl; - private TabLightweightControl tabs; + //top tab control + private LightweightControlContainerControl mainTabControl; + private TabLightweightControl tabs; - //video source info for non local file images - private ArrayList _videoSources; - private VideoSource activeVideoSource = null; + //video source info for non local file images + private ArrayList _videoSources; + private VideoSource activeVideoSource = null; - private Button btnInsert; - private LinkLabel copyrightLinkLabel; - private Button btnCancel; + private Button btnInsert; + private LinkLabel copyrightLinkLabel; + private Button btnCancel; public VideoBrowserForm(ArrayList videoSources, string blogID, int selectedTab) - { - // - // Required for Windows Form Designer support - // - InitializeComponent(); + { + // + // Required for Windows Form Designer support + // + InitializeComponent(); - _videoSources = videoSources; + _videoSources = videoSources; - //set strings - btnInsert.Text = Res.Get(StringId.InsertButtonText); - btnCancel.Text = Res.Get(StringId.CancelButton); - Text = Res.Get(StringId.Plugin_Videos_Select_Video_Form); + //set strings + btnInsert.Text = Res.Get(StringId.InsertButtonText); + btnCancel.Text = Res.Get(StringId.CancelButton); + Text = Res.Get(StringId.Plugin_Videos_Select_Video_Form); - if (!MarketizationOptions.IsFeatureEnabled(MarketizationOptions.Feature.VideoCopyright)) - { - copyrightLinkLabel.Visible = false; - } - else - { - copyrightLinkLabel.Font = Res.GetFont(FontSize.Small, FontStyle.Regular); - copyrightLinkLabel.Text = Res.Get(StringId.Plugin_Video_Copyright_Notice); - string link = MarketizationOptions.GetFeatureParameter(MarketizationOptions.Feature.VideoCopyright, "Glink"); - if (link == null || link == String.Empty) - copyrightLinkLabel.LinkArea = new LinkArea(0,0); - else - copyrightLinkLabel.LinkClicked += copyrightLinkLabel_LinkClicked; - } + if (!MarketizationOptions.IsFeatureEnabled(MarketizationOptions.Feature.VideoCopyright)) + { + copyrightLinkLabel.Visible = false; + } + else + { + copyrightLinkLabel.Font = Res.GetFont(FontSize.Small, FontStyle.Regular); + copyrightLinkLabel.Text = Res.Get(StringId.Plugin_Video_Copyright_Notice); + string link = MarketizationOptions.GetFeatureParameter(MarketizationOptions.Feature.VideoCopyright, "Glink"); + if (link == null || link == String.Empty) + copyrightLinkLabel.LinkArea = new LinkArea(0,0); + else + copyrightLinkLabel.LinkClicked += copyrightLinkLabel_LinkClicked; + } copyrightLinkLabel.LinkColor = SystemColors.HotTrack; - // - // tabs - // - tabs = new TabLightweightControl(); - tabs.VirtualBounds = new Rectangle(0, 5, 450, 485); - tabs.LightweightControlContainerControl = mainTabControl; - tabs.DrawSideAndBottomTabPageBorders = false; + // + // tabs + // + tabs = new TabLightweightControl(); + tabs.VirtualBounds = new Rectangle(0, 5, 450, 485); + tabs.LightweightControlContainerControl = mainTabControl; + tabs.DrawSideAndBottomTabPageBorders = false; tabs.ColorizeBorder = false; - int i = 0; - foreach (VideoSource videoSource in _videoSources) - { - videoSource.BlogId = blogID; - videoSource.Init(); - videoSource.VideoSelected += new EventHandler(videoSource_VideoSelected); - TabPageControl tab = (TabPageControl)videoSource; - tab.TabStop = false; - Controls.Add(tab); - tabs.SetTab(i++, tab); - } + int i = 0; + foreach (VideoSource videoSource in _videoSources) + { + videoSource.BlogId = blogID; + videoSource.Init(); + videoSource.VideoSelected += new EventHandler(videoSource_VideoSelected); + TabPageControl tab = (TabPageControl)videoSource; + tab.TabStop = false; + Controls.Add(tab); + tabs.SetTab(i++, tab); + } - // initial appearance of editor + // initial appearance of editor SetActiveTab(selectedTab); tabs.SelectedTabNumber = selectedTab; - tabs.SelectedTabNumberChanged += new EventHandler(tabs_SelectedTabNumberChanged); + tabs.SelectedTabNumberChanged += new EventHandler(tabs_SelectedTabNumberChanged); - if ( !DesignMode ) - Icon = ApplicationEnvironment.ProductIcon ; + if ( !DesignMode ) + Icon = ApplicationEnvironment.ProductIcon ; - tabs.VirtualLocation = new Point(0, 5); - tabs.VirtualSize = Size; + tabs.VirtualLocation = new Point(0, 5); + tabs.VirtualSize = Size; Width = 510; Height = 570; - } + } - protected override void OnLayout(LayoutEventArgs levent) - { - base.OnLayout (levent); + protected override void OnLayout(LayoutEventArgs levent) + { + base.OnLayout (levent); - if (tabs != null && mainTabControl != null) - tabs.VirtualSize = new Size(mainTabControl.Width, mainTabControl.Height - 5); - } + if (tabs != null && mainTabControl != null) + tabs.VirtualSize = new Size(mainTabControl.Width, mainTabControl.Height - 5); + } - protected override void OnLoad(EventArgs e) - { - base.OnLoad (e); - LayoutHelper.FixupOKCancel(btnInsert, btnCancel); - } + protected override void OnLoad(EventArgs e) + { + base.OnLoad (e); + LayoutHelper.FixupOKCancel(btnInsert, btnCancel); + } + protected override bool ProcessCmdKey(ref Message msg, Keys keyData) + { + tabs.CheckForTabSwitch(keyData); + return base.ProcessCmdKey(ref msg, keyData); + } - protected override bool ProcessCmdKey(ref Message msg, Keys keyData) - { - tabs.CheckForTabSwitch(keyData); - return base.ProcessCmdKey(ref msg, keyData); - } - - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } foreach(VideoSource source in _videoSources) { source.Dispose(); } - } - base.Dispose( disposing ); - } + } + base.Dispose( disposing ); + } - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - this.mainTabControl = new OpenLiveWriter.Controls.LightweightControlContainerControl(); - this.btnInsert = new System.Windows.Forms.Button(); - this.btnCancel = new System.Windows.Forms.Button(); - this.copyrightLinkLabel = new System.Windows.Forms.LinkLabel(); - ((System.ComponentModel.ISupportInitialize)(this.mainTabControl)).BeginInit(); - this.SuspendLayout(); - // - // mainTabControl - // - this.mainTabControl.AllowDragDropAutoScroll = false; - this.mainTabControl.AllPaintingInWmPaint = true; - this.mainTabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.mainTabControl.BackColor = System.Drawing.SystemColors.Control; - this.mainTabControl.Location = new System.Drawing.Point(0, 0); - this.mainTabControl.Name = "mainTabControl"; - this.mainTabControl.Size = new System.Drawing.Size(450, 485); - this.mainTabControl.TabIndex = 14; - // - // btnInsert - // - this.btnInsert.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.btnInsert.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.btnInsert.Location = new System.Drawing.Point(288, 490); - this.btnInsert.Name = "buttonInsert"; - this.btnInsert.TabIndex = 20; - this.btnInsert.Text = "Insert"; - this.btnInsert.Click += new System.EventHandler(this.btnInsert_Click); - // - // btnCancel - // - this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.btnCancel.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.btnCancel.Location = new System.Drawing.Point(368, 490); - this.btnCancel.Name = "buttonCancel"; - this.btnCancel.TabIndex = 21; - this.btnCancel.Text = "Cancel"; - // - // copyrightLinkLabel - // - this.copyrightLinkLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.copyrightLinkLabel.AutoSize = true; - this.copyrightLinkLabel.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.copyrightLinkLabel.Location = new System.Drawing.Point(6, 496); - this.copyrightLinkLabel.Name = "copyrightLinkLabel"; - this.copyrightLinkLabel.Size = new System.Drawing.Size(208, 18); - this.copyrightLinkLabel.TabIndex = 19; - this.copyrightLinkLabel.TabStop = true; - this.copyrightLinkLabel.Text = "Please Respect Copyright"; - // - // VideoBrowserForm - // - this.AcceptButton = this.btnInsert; - this.AutoScaleBaseSize = new System.Drawing.Size(5, 14); - this.CancelButton = this.btnCancel; - this.ClientSize = new System.Drawing.Size(450, 520); - this.Controls.Add(this.copyrightLinkLabel); - this.Controls.Add(this.btnCancel); - this.Controls.Add(this.btnInsert); - this.Controls.Add(this.mainTabControl); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "VideoBrowserForm"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Insert Video"; - ((System.ComponentModel.ISupportInitialize)(this.mainTabControl)).EndInit(); - this.ResumeLayout(false); + #region Windows Form Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.mainTabControl = new OpenLiveWriter.Controls.LightweightControlContainerControl(); + this.btnInsert = new System.Windows.Forms.Button(); + this.btnCancel = new System.Windows.Forms.Button(); + this.copyrightLinkLabel = new System.Windows.Forms.LinkLabel(); + ((System.ComponentModel.ISupportInitialize)(this.mainTabControl)).BeginInit(); + this.SuspendLayout(); + // + // mainTabControl + // + this.mainTabControl.AllowDragDropAutoScroll = false; + this.mainTabControl.AllPaintingInWmPaint = true; + this.mainTabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.mainTabControl.BackColor = System.Drawing.SystemColors.Control; + this.mainTabControl.Location = new System.Drawing.Point(0, 0); + this.mainTabControl.Name = "mainTabControl"; + this.mainTabControl.Size = new System.Drawing.Size(450, 485); + this.mainTabControl.TabIndex = 14; + // + // btnInsert + // + this.btnInsert.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnInsert.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.btnInsert.Location = new System.Drawing.Point(288, 490); + this.btnInsert.Name = "buttonInsert"; + this.btnInsert.TabIndex = 20; + this.btnInsert.Text = "Insert"; + this.btnInsert.Click += new System.EventHandler(this.btnInsert_Click); + // + // btnCancel + // + this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btnCancel.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.btnCancel.Location = new System.Drawing.Point(368, 490); + this.btnCancel.Name = "buttonCancel"; + this.btnCancel.TabIndex = 21; + this.btnCancel.Text = "Cancel"; + // + // copyrightLinkLabel + // + this.copyrightLinkLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.copyrightLinkLabel.AutoSize = true; + this.copyrightLinkLabel.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.copyrightLinkLabel.Location = new System.Drawing.Point(6, 496); + this.copyrightLinkLabel.Name = "copyrightLinkLabel"; + this.copyrightLinkLabel.Size = new System.Drawing.Size(208, 18); + this.copyrightLinkLabel.TabIndex = 19; + this.copyrightLinkLabel.TabStop = true; + this.copyrightLinkLabel.Text = "Please Respect Copyright"; + // + // VideoBrowserForm + // + this.AcceptButton = this.btnInsert; + this.AutoScaleBaseSize = new System.Drawing.Size(5, 14); + this.CancelButton = this.btnCancel; + this.ClientSize = new System.Drawing.Size(450, 520); + this.Controls.Add(this.copyrightLinkLabel); + this.Controls.Add(this.btnCancel); + this.Controls.Add(this.btnInsert); + this.Controls.Add(this.mainTabControl); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "VideoBrowserForm"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Insert Video"; + ((System.ComponentModel.ISupportInitialize)(this.mainTabControl)).EndInit(); + this.ResumeLayout(false); - } - #endregion + } + #endregion - private void SetActiveTab(int num) - { - activeVideoSource = (VideoSource)_videoSources[num]; - activeVideoSource.TabSelected(); - } + private void SetActiveTab(int num) + { + activeVideoSource = (VideoSource)_videoSources[num]; + activeVideoSource.TabSelected(); + } - private void tabs_SelectedTabNumberChanged(object sender, EventArgs e) - { - int tabChosen = ((TabLightweightControl)sender).SelectedTabNumber; - SetActiveTab(tabChosen); - } + private void tabs_SelectedTabNumberChanged(object sender, EventArgs e) + { + int tabChosen = ((TabLightweightControl)sender).SelectedTabNumber; + SetActiveTab(tabChosen); + } - private void btnInsert_Click(object sender, EventArgs e) - { - if (activeVideoSource.ValidateSelection()) - { - DialogResult = DialogResult.OK; - } - } + private void btnInsert_Click(object sender, EventArgs e) + { + if (activeVideoSource.ValidateSelection()) + { + DialogResult = DialogResult.OK; + } + } - public Video SelectedVideo - { - get - { - return activeVideoSource.GetVideoForInsert(); - } - } + public Video SelectedVideo + { + get + { + return activeVideoSource.GetVideoForInsert(); + } + } - private void videoSource_VideoSelected(object sender, EventArgs e) - { - if (activeVideoSource.ValidateSelection()) - { - DialogResult = DialogResult.OK; - } - } + private void videoSource_VideoSelected(object sender, EventArgs e) + { + if (activeVideoSource.ValidateSelection()) + { + DialogResult = DialogResult.OK; + } + } - private void copyrightLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) - { - string link = MarketizationOptions.GetFeatureParameter(MarketizationOptions.Feature.VideoCopyright, "Glink"); - if (link != null && link != String.Empty) - { - try - { - ShellHelper.LaunchUrl( link ); - } - catch( Exception ex ) - { - Trace.Fail( "Unexpected exception navigating to copyright page: " + link + ", " + ex.ToString() ) ; - } - } - } - } + private void copyrightLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + { + string link = MarketizationOptions.GetFeatureParameter(MarketizationOptions.Feature.VideoCopyright, "Glink"); + if (link != null && link != String.Empty) + { + try + { + ShellHelper.LaunchUrl( link ); + } + catch( Exception ex ) + { + Trace.Fail( "Unexpected exception navigating to copyright page: " + link + ", " + ex.ToString() ) ; + } + } + } + } } diff --git a/src/managed/OpenLiveWriter.PostEditor/Video/VideoContentSource.cs b/src/managed/OpenLiveWriter.PostEditor/Video/VideoContentSource.cs index 5b6fe852..9ec5d6c4 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Video/VideoContentSource.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Video/VideoContentSource.cs @@ -262,7 +262,6 @@ namespace OpenLiveWriter.PostEditor.Video } } - #region IContentUpdateFilter Members public bool ShouldUpdateContent(string oldHTML, string newHTML) diff --git a/src/managed/OpenLiveWriter.PostEditor/Video/VideoHelper.cs b/src/managed/OpenLiveWriter.PostEditor/Video/VideoHelper.cs index e7b4de4f..feb4dd41 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Video/VideoHelper.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Video/VideoHelper.cs @@ -12,35 +12,35 @@ using OpenLiveWriter.Localization; namespace OpenLiveWriter.PostEditor.Video { - /// - /// Summary description for VideoHelper. - /// - public class VideoHelper :IDisposable - { + /// + /// Summary description for VideoHelper. + /// + public class VideoHelper :IDisposable + { public const int DEFAULT_TIMEOUT_MS = 15000; - public const string WIDTH = "{width}"; - public const string HEIGHT = "{height}"; - private Bitmap testBitmap = null; - private Color testColor; - private double testPct; - private RectTest rectTest; + public const string WIDTH = "{width}"; + public const string HEIGHT = "{height}"; + private Bitmap testBitmap = null; + private Color testColor; + private double testPct; + private RectTest rectTest; - public static string GenerateEmbedHtml(string embedFormat, Size size) - { - string pattern = embedFormat.Replace(WIDTH, "{0}").Replace(HEIGHT, "{1}"); - return String.Format(pattern, size.Width, size.Height); - } + public static string GenerateEmbedHtml(string embedFormat, Size size) + { + string pattern = embedFormat.Replace(WIDTH, "{0}").Replace(HEIGHT, "{1}"); + return String.Format(pattern, size.Width, size.Height); + } - public Bitmap GetVideoSnapshot(VideoProvider provider, string embedHtml, Size videoSize) - { - try - { - string videoHtml = GenerateEmbedHtml(embedHtml, videoSize); - if (provider != null && provider.UseBackgroundColor != String.Empty) - { - videoHtml = String.Format(CultureInfo.InvariantCulture, "
{1}
", provider.UseBackgroundColor, videoHtml); - } - HtmlScreenCapture htmlScreenCapture = new HtmlScreenCapture(videoHtml, videoSize.Width); + public Bitmap GetVideoSnapshot(VideoProvider provider, string embedHtml, Size videoSize) + { + try + { + string videoHtml = GenerateEmbedHtml(embedHtml, videoSize); + if (provider != null && provider.UseBackgroundColor != String.Empty) + { + videoHtml = String.Format(CultureInfo.InvariantCulture, "
{1}
", provider.UseBackgroundColor, videoHtml); + } + HtmlScreenCapture htmlScreenCapture = new HtmlScreenCapture(videoHtml, videoSize.Width); if (provider != null && provider.RectangleTest != null) { @@ -48,31 +48,31 @@ namespace OpenLiveWriter.PostEditor.Video htmlScreenCapture.HtmlScreenCaptureAvailable += new HtmlScreenCaptureAvailableHandler(htmlScreenCapture_HtmlScreenCaptureAvailable_RectangleTest); } else if (provider != null && provider.SnapshotLoadedOrigColor != Color.Empty) - { - testColor = provider.SnapshotLoadedOrigColor; - testPct = provider.SnapshotLoadedColorPct; - htmlScreenCapture.HtmlScreenCaptureAvailable +=new HtmlScreenCaptureAvailableHandler(htmlScreenCapture_HtmlScreenCaptureAvailable_ColorTest); - } - else - { - testBitmap = null; - htmlScreenCapture.HtmlScreenCaptureAvailable +=new HtmlScreenCaptureAvailableHandler(htmlScreenCapture_HtmlScreenCaptureAvailable_ChangeTest); - } + { + testColor = provider.SnapshotLoadedOrigColor; + testPct = provider.SnapshotLoadedColorPct; + htmlScreenCapture.HtmlScreenCaptureAvailable +=new HtmlScreenCaptureAvailableHandler(htmlScreenCapture_HtmlScreenCaptureAvailable_ColorTest); + } + else + { + testBitmap = null; + htmlScreenCapture.HtmlScreenCaptureAvailable +=new HtmlScreenCaptureAvailableHandler(htmlScreenCapture_HtmlScreenCaptureAvailable_ChangeTest); + } - htmlScreenCapture.MaximumHeight = videoSize.Height; - //we set our own limit to ensure a snapshot is always getting returned + htmlScreenCapture.MaximumHeight = videoSize.Height; + //we set our own limit to ensure a snapshot is always getting returned SetTimeout(DEFAULT_TIMEOUT_MS); Bitmap videoSnapshot = htmlScreenCapture.CaptureHtml(2 * DEFAULT_TIMEOUT_MS); - // return the video - return videoSnapshot ; - } - catch(Exception ex) - { + // return the video + return videoSnapshot ; + } + catch(Exception ex) + { Trace.WriteLine(ex.ToString()); - throw new VideoPluginException(Res.Get(StringId.Plugin_Video_Snapshot_Error_Title), String.Format(Res.Get(StringId.Plugin_Video_Snapshot_Error_Message), ex.Message)) ; - } - } + throw new VideoPluginException(Res.Get(StringId.Plugin_Video_Snapshot_Error_Title), String.Format(Res.Get(StringId.Plugin_Video_Snapshot_Error_Message), ex.Message)) ; + } + } void htmlScreenCapture_HtmlScreenCaptureAvailable_RectangleTest(object sender, HtmlScreenCaptureAvailableEventArgs e) { @@ -96,79 +96,79 @@ namespace OpenLiveWriter.PostEditor.Video e.CaptureCompleted = nonMatchingPixelCount == 0 || TimedOut; } - private DateTime _timeoutTime ; - private void SetTimeout(int ms) - { - _timeoutTime = DateTime.Now.AddMilliseconds(ms) ; - } + private DateTime _timeoutTime ; + private void SetTimeout(int ms) + { + _timeoutTime = DateTime.Now.AddMilliseconds(ms) ; + } - private bool TimedOut - { - get - { - return DateTime.Now > _timeoutTime; - } - } + private bool TimedOut + { + get + { + return DateTime.Now > _timeoutTime; + } + } - private void htmlScreenCapture_HtmlScreenCaptureAvailable_ColorTest(object sender, HtmlScreenCaptureAvailableEventArgs e) - { - const int PLAYER_CONTROL_OFFSET = 30; - // get the bitmap - Bitmap bitmap = e.Bitmap ; + private void htmlScreenCapture_HtmlScreenCaptureAvailable_ColorTest(object sender, HtmlScreenCaptureAvailableEventArgs e) + { + const int PLAYER_CONTROL_OFFSET = 30; + // get the bitmap + Bitmap bitmap = e.Bitmap ; - int pixelCount = 0; - for (int x=0; x - /// Summary description for CommandImageDecoratorApply. - ///
- public class CommandAddToDictionary : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandImageDecoratorApply. + /// + public class CommandAddToDictionary : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandAddToDictionary(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandAddToDictionary(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandAddToDictionary() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandAddToDictionary() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandAddToDictionary + // + this.CommandBarButtonText = ""; + this.Identifier = "OpenLiveWriter.SpellChecker.CommandAddToDictionary"; + this.MenuText = "&Add to Dictionary"; + this.Text = "Add this word to the local dictionary"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandAddToDictionary - // - this.CommandBarButtonText = ""; - this.Identifier = "OpenLiveWriter.SpellChecker.CommandAddToDictionary"; - this.MenuText = "&Add to Dictionary"; - this.Text = "Add this word to the local dictionary"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.SpellChecker/Commands/CommandFixWordSpelling.cs b/src/managed/OpenLiveWriter.SpellChecker/Commands/CommandFixWordSpelling.cs index 290e9a5b..fdaca31c 100644 --- a/src/managed/OpenLiveWriter.SpellChecker/Commands/CommandFixWordSpelling.cs +++ b/src/managed/OpenLiveWriter.SpellChecker/Commands/CommandFixWordSpelling.cs @@ -6,58 +6,57 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.SpellChecker { - /// - /// Summary description for CommandImageDecoratorApply. - /// - public class CommandFixWordSpelling : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandImageDecoratorApply. + /// + public class CommandFixWordSpelling : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandFixWordSpelling(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandFixWordSpelling(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandFixWordSpelling() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandFixWordSpelling() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandFixWordSpelling + // + this.CommandBarButtonText = ""; + this.Identifier = "OpenLiveWriter.SpellChecker.CommandFixWordSpelling"; + this.MenuText = ""; + this.Text = "Change to this"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandFixWordSpelling - // - this.CommandBarButtonText = ""; - this.Identifier = "OpenLiveWriter.SpellChecker.CommandFixWordSpelling"; - this.MenuText = ""; - this.Text = "Change to this"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.SpellChecker/Commands/CommandIgnoreAll.cs b/src/managed/OpenLiveWriter.SpellChecker/Commands/CommandIgnoreAll.cs index 47dd5b2c..44472200 100644 --- a/src/managed/OpenLiveWriter.SpellChecker/Commands/CommandIgnoreAll.cs +++ b/src/managed/OpenLiveWriter.SpellChecker/Commands/CommandIgnoreAll.cs @@ -6,58 +6,57 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.SpellChecker { - /// - /// Summary description for CommandImageDecoratorApply. - /// - public class CommandIgnoreAll : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandImageDecoratorApply. + /// + public class CommandIgnoreAll : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandIgnoreAll(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandIgnoreAll(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandIgnoreAll() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandIgnoreAll() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandIgnoreAll + // + this.CommandBarButtonText = ""; + this.Identifier = "OpenLiveWriter.SpellChecker.CommandIgnoreAll"; + this.MenuText = "&Ignore All"; + this.Text = "Ignore all instances of this word"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandIgnoreAll - // - this.CommandBarButtonText = ""; - this.Identifier = "OpenLiveWriter.SpellChecker.CommandIgnoreAll"; - this.MenuText = "&Ignore All"; - this.Text = "Ignore all instances of this word"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.SpellChecker/Commands/CommandOpenSpellingForm.cs b/src/managed/OpenLiveWriter.SpellChecker/Commands/CommandOpenSpellingForm.cs index 6877d368..cf76a964 100644 --- a/src/managed/OpenLiveWriter.SpellChecker/Commands/CommandOpenSpellingForm.cs +++ b/src/managed/OpenLiveWriter.SpellChecker/Commands/CommandOpenSpellingForm.cs @@ -6,58 +6,57 @@ using OpenLiveWriter.ApplicationFramework; namespace OpenLiveWriter.SpellChecker { - /// - /// Summary description for CommandImageDecoratorApply. - /// - public class CommandOpenSpellingForm : Command - { - /// - /// Required designer variable. - /// - private Container components = null; + /// + /// Summary description for CommandImageDecoratorApply. + /// + public class CommandOpenSpellingForm : Command + { + /// + /// Required designer variable. + /// + private Container components = null; - public CommandOpenSpellingForm(IContainer container) - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandOpenSpellingForm(IContainer container) + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } - public CommandOpenSpellingForm() - { - /// - /// Required for Windows.Forms Class Composition Designer support - /// - InitializeComponent(); + public CommandOpenSpellingForm() + { + /// + /// Required for Windows.Forms Class Composition Designer support + /// + InitializeComponent(); - // - // - // - } + // + // + // + } + #region Component Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + // + // CommandOpenSpellingForm + // + this.CommandBarButtonText = ""; + this.Identifier = "OpenLiveWriter.SpellChecker.CommandOpenSpellingForm"; + this.MenuText = "&Open Spelling Dialog"; + this.Text = "Open the spelling dialog"; - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // CommandOpenSpellingForm - // - this.CommandBarButtonText = ""; - this.Identifier = "OpenLiveWriter.SpellChecker.CommandOpenSpellingForm"; - this.MenuText = "&Open Spelling Dialog"; - this.Text = "Open the spelling dialog"; - - } - #endregion - } + } + #endregion + } } diff --git a/src/managed/OpenLiveWriter.SpellChecker/HighlightSegmentTracker.cs b/src/managed/OpenLiveWriter.SpellChecker/HighlightSegmentTracker.cs index addb308f..845e5b5a 100644 --- a/src/managed/OpenLiveWriter.SpellChecker/HighlightSegmentTracker.cs +++ b/src/managed/OpenLiveWriter.SpellChecker/HighlightSegmentTracker.cs @@ -11,201 +11,201 @@ using OpenLiveWriter.Mshtml; namespace OpenLiveWriter.SpellChecker { - //used to store the highlight segments in a post for tracking spelling changes - public class HighlightSegmentTracker - { - SortedList list; + //used to store the highlight segments in a post for tracking spelling changes + public class HighlightSegmentTracker + { + SortedList list; - private class SegmentDef - { - public IHighlightSegmentRaw segment; - public IMarkupPointerRaw endPtr; - public IMarkupPointerRaw startPtr; - public string word; - public SegmentDef(IHighlightSegmentRaw seg, IMarkupPointerRaw start, IMarkupPointerRaw end, string wd) - { - segment = seg; - startPtr = start; - endPtr = end; - word = wd; - } + private class SegmentDef + { + public IHighlightSegmentRaw segment; + public IMarkupPointerRaw endPtr; + public IMarkupPointerRaw startPtr; + public string word; + public SegmentDef(IHighlightSegmentRaw seg, IMarkupPointerRaw start, IMarkupPointerRaw end, string wd) + { + segment = seg; + startPtr = start; + endPtr = end; + word = wd; + } - } + } - public class MatchingSegment - { - public IHighlightSegmentRaw _segment; - public IMarkupPointerRaw _pointer; - public MatchingSegment(IHighlightSegmentRaw seg, IMarkupPointerRaw pointer) - { - _segment = seg; - _pointer = pointer; - } - } + public class MatchingSegment + { + public IHighlightSegmentRaw _segment; + public IMarkupPointerRaw _pointer; + public MatchingSegment(IHighlightSegmentRaw seg, IMarkupPointerRaw pointer) + { + _segment = seg; + _pointer = pointer; + } + } - //this needs to be on a post by post basis - public HighlightSegmentTracker() - { - list = new SortedList(new MarkupPointerComparer()); - } + //this needs to be on a post by post basis + public HighlightSegmentTracker() + { + list = new SortedList(new MarkupPointerComparer()); + } - //adds a segment to the list - //used when a misspelled word is found - public void AddSegment(IHighlightSegmentRaw segment, string wordHere, IMarkupServicesRaw markupServices) - { - IMarkupPointerRaw start, end; - markupServices.CreateMarkupPointer(out start); - markupServices.CreateMarkupPointer(out end); - segment.GetPointers(start, end); - if (!list.ContainsKey(start)) - list.Add(start, new SegmentDef(segment, start, end, wordHere)); - } + //adds a segment to the list + //used when a misspelled word is found + public void AddSegment(IHighlightSegmentRaw segment, string wordHere, IMarkupServicesRaw markupServices) + { + IMarkupPointerRaw start, end; + markupServices.CreateMarkupPointer(out start); + markupServices.CreateMarkupPointer(out end); + segment.GetPointers(start, end); + if (!list.ContainsKey(start)) + list.Add(start, new SegmentDef(segment, start, end, wordHere)); + } - //find all the segments in a specific range - //used to clear out a section when it is getting rechecked - //need to expand selection from these bounds out around full words - public IHighlightSegmentRaw[] GetSegments(IMarkupPointerRaw start, IMarkupPointerRaw end) - { - if (list.Count == 0) - return null; - int firstSegmentInd = -1; - int lastSegmentInd = list.Count; - bool test; - //find the first segment after the start pointer - do - { - firstSegmentInd++; - //check if we have gone through the whole selection - if (firstSegmentInd >= lastSegmentInd) - return null; - SegmentDef x = (SegmentDef) list.GetByIndex(firstSegmentInd); - start.IsRightOf(x.startPtr, out test); - } while (test); - do - { - lastSegmentInd--; - //check if we have gone through the whole selection - if (lastSegmentInd < firstSegmentInd) - return null; - SegmentDef x = (SegmentDef) list.GetByIndex(lastSegmentInd); - end.IsLeftOf(x.startPtr, out test); - } while (test); - return Subarray(firstSegmentInd, lastSegmentInd); - } + //find all the segments in a specific range + //used to clear out a section when it is getting rechecked + //need to expand selection from these bounds out around full words + public IHighlightSegmentRaw[] GetSegments(IMarkupPointerRaw start, IMarkupPointerRaw end) + { + if (list.Count == 0) + return null; + int firstSegmentInd = -1; + int lastSegmentInd = list.Count; + bool test; + //find the first segment after the start pointer + do + { + firstSegmentInd++; + //check if we have gone through the whole selection + if (firstSegmentInd >= lastSegmentInd) + return null; + SegmentDef x = (SegmentDef) list.GetByIndex(firstSegmentInd); + start.IsRightOf(x.startPtr, out test); + } while (test); + do + { + lastSegmentInd--; + //check if we have gone through the whole selection + if (lastSegmentInd < firstSegmentInd) + return null; + SegmentDef x = (SegmentDef) list.GetByIndex(lastSegmentInd); + end.IsLeftOf(x.startPtr, out test); + } while (test); + return Subarray(firstSegmentInd, lastSegmentInd); + } - public IHighlightSegmentRaw[] ClearAllSegments() - { - return Subarray(0, list.Count - 1); - } + public IHighlightSegmentRaw[] ClearAllSegments() + { + return Subarray(0, list.Count - 1); + } - public delegate bool CheckWordSpelling(string word); + public delegate bool CheckWordSpelling(string word); - //find all the segments with a specific misspelled word - //used to clear for ignore all, add to dictionary - public MatchingSegment[] GetSegments(string word, CheckWordSpelling checkSpelling) - { - ArrayList segments = new ArrayList(); - for (int i = 0; i < list.Count; i++) - { - SegmentDef x = (SegmentDef) list.GetByIndex(i); - //TODO: Change with new cultures added!!! - if (0 == String.Compare(word, x.word, true, CultureInfo.InvariantCulture)) - { - //check spelling--capitalized word may be ok, but not mixed case, etc. - if (!checkSpelling(x.word)) - { - segments.Add(new MatchingSegment(x.segment, x.startPtr)); - } - } - } - return (MatchingSegment[])segments.ToArray(typeof (MatchingSegment)); - } + //find all the segments with a specific misspelled word + //used to clear for ignore all, add to dictionary + public MatchingSegment[] GetSegments(string word, CheckWordSpelling checkSpelling) + { + ArrayList segments = new ArrayList(); + for (int i = 0; i < list.Count; i++) + { + SegmentDef x = (SegmentDef) list.GetByIndex(i); + //TODO: Change with new cultures added!!! + if (0 == String.Compare(word, x.word, true, CultureInfo.InvariantCulture)) + { + //check spelling--capitalized word may be ok, but not mixed case, etc. + if (!checkSpelling(x.word)) + { + segments.Add(new MatchingSegment(x.segment, x.startPtr)); + } + } + } + return (MatchingSegment[])segments.ToArray(typeof (MatchingSegment)); + } - public void RemoveSegment(IMarkupPointerRaw pointer) - { - list.Remove(pointer); - } + public void RemoveSegment(IMarkupPointerRaw pointer) + { + list.Remove(pointer); + } - public MisspelledWordInfo FindSegment(MshtmlMarkupServices markupServices, IMarkupPointerRaw current) - { - //binary search - int start = 0; - int end = list.Count - 1; - int i = Middle(start, end); - while (-1 != i) - { - SegmentDef x = (SegmentDef)list.GetByIndex(i); - bool startTest; - current.IsRightOfOrEqualTo(x.startPtr, out startTest); - if (startTest) - { - bool endTest; - current.IsLeftOfOrEqualTo(x.endPtr, out endTest); - if (endTest) - { - MarkupPointer pStart = markupServices.CreateMarkupPointer(x.startPtr); - MarkupPointer pEnd = markupServices.CreateMarkupPointer(x.endPtr); - MarkupRange range = markupServices.CreateMarkupRange(pStart, pEnd); - //this could be a "phantom" range...no more content due to uncommitted damage or other reasons - //if it is phantom, remove it from the tracker and return null - if (range.Text == null) - { - list.RemoveAt(i); - return null; - } - return new MisspelledWordInfo(range, x.word); - } - start = i + 1; - } - else - { - end = i - 1; - } - i = Middle(start, end); - } - return null; - } + public MisspelledWordInfo FindSegment(MshtmlMarkupServices markupServices, IMarkupPointerRaw current) + { + //binary search + int start = 0; + int end = list.Count - 1; + int i = Middle(start, end); + while (-1 != i) + { + SegmentDef x = (SegmentDef)list.GetByIndex(i); + bool startTest; + current.IsRightOfOrEqualTo(x.startPtr, out startTest); + if (startTest) + { + bool endTest; + current.IsLeftOfOrEqualTo(x.endPtr, out endTest); + if (endTest) + { + MarkupPointer pStart = markupServices.CreateMarkupPointer(x.startPtr); + MarkupPointer pEnd = markupServices.CreateMarkupPointer(x.endPtr); + MarkupRange range = markupServices.CreateMarkupRange(pStart, pEnd); + //this could be a "phantom" range...no more content due to uncommitted damage or other reasons + //if it is phantom, remove it from the tracker and return null + if (range.Text == null) + { + list.RemoveAt(i); + return null; + } + return new MisspelledWordInfo(range, x.word); + } + start = i + 1; + } + else + { + end = i - 1; + } + i = Middle(start, end); + } + return null; + } - private int Middle(int start, int end) - { - if (start <= end) - { - return (int)Math.Floor(Convert.ToDouble((start + end)/2)); - } - return -1; - } + private int Middle(int start, int end) + { + if (start <= end) + { + return (int)Math.Floor(Convert.ToDouble((start + end)/2)); + } + return -1; + } - private IHighlightSegmentRaw[] Subarray(int start, int end) - { - int count = end - start + 1; - IHighlightSegmentRaw[] segments = new IHighlightSegmentRaw[count]; - //fill in array by removing from the list starting at the end, so that - // deleting from the list doesn't change the other indices - for (int i = end; i >= start; i--) - { - segments[--count] = ((SegmentDef) list.GetByIndex(i)).segment; - list.RemoveAt(i); - } - return segments; - } + private IHighlightSegmentRaw[] Subarray(int start, int end) + { + int count = end - start + 1; + IHighlightSegmentRaw[] segments = new IHighlightSegmentRaw[count]; + //fill in array by removing from the list starting at the end, so that + // deleting from the list doesn't change the other indices + for (int i = end; i >= start; i--) + { + segments[--count] = ((SegmentDef) list.GetByIndex(i)).segment; + list.RemoveAt(i); + } + return segments; + } - public void Clear() - { - list.Clear(); - } - } + public void Clear() + { + list.Clear(); + } + } - internal class MarkupPointerComparer : IComparer, System.Collections.Generic.IComparer - { - public int Compare(object x, object y) - { - IMarkupPointerRaw a = (IMarkupPointerRaw) x; - IMarkupPointerRaw b = (IMarkupPointerRaw) y; - return Compare(a, b); - } + internal class MarkupPointerComparer : IComparer, System.Collections.Generic.IComparer + { + public int Compare(object x, object y) + { + IMarkupPointerRaw a = (IMarkupPointerRaw) x; + IMarkupPointerRaw b = (IMarkupPointerRaw) y; + return Compare(a, b); + } - public int Compare(IMarkupPointerRaw a, IMarkupPointerRaw b) - { + public int Compare(IMarkupPointerRaw a, IMarkupPointerRaw b) + { bool test; a.IsEqualTo(b, out test); if (test) return 0; @@ -213,5 +213,5 @@ namespace OpenLiveWriter.SpellChecker if (test) return -1; return 1; } - } + } } diff --git a/src/managed/OpenLiveWriter.SpellChecker/HtmlTextBoxWordRange.cs b/src/managed/OpenLiveWriter.SpellChecker/HtmlTextBoxWordRange.cs index 10e8dc63..8789c1f0 100644 --- a/src/managed/OpenLiveWriter.SpellChecker/HtmlTextBoxWordRange.cs +++ b/src/managed/OpenLiveWriter.SpellChecker/HtmlTextBoxWordRange.cs @@ -10,290 +10,290 @@ using OpenLiveWriter.Mshtml; namespace OpenLiveWriter.SpellChecker { - /// - /// Some test cases: - /// - /// [empty string] - /// all correct words - /// mzispalled wordz - /// "Punctuaation." - /// Apostraphe's - /// 'Apostraphe's' - /// numb3rs - /// 1312 - /// Good - /// - /// Limitations: - /// Doesn't handle mid-word markup (e.g. test) - /// Doesn't correct ALT attributes - /// Doesn't know to ignore http:// and e-mail addresses - /// - public class HtmlTextBoxWordRange : IWordRange - { - private readonly TextBox _textBox; - private readonly WordSource _src; - private readonly int _startAt; - private readonly int _endAt; + /// + /// Some test cases: + /// + /// [empty string] + /// all correct words + /// mzispalled wordz + /// "Punctuaation." + /// Apostraphe's + /// 'Apostraphe's' + /// numb3rs + /// 1312 + /// Good + /// + /// Limitations: + /// Doesn't handle mid-word markup (e.g. test) + /// Doesn't correct ALT attributes + /// Doesn't know to ignore http:// and e-mail addresses + /// + public class HtmlTextBoxWordRange : IWordRange + { + private readonly TextBox _textBox; + private readonly WordSource _src; + private readonly int _startAt; + private readonly int _endAt; - private int _drift = 0; - private TextWithOffsetAndLen _currentWord = null; - private TextWithOffsetAndLen _nextWord; + private int _drift = 0; + private TextWithOffsetAndLen _currentWord = null; + private TextWithOffsetAndLen _nextWord; - public HtmlTextBoxWordRange(TextBox textBox) - { - _textBox = textBox; - _src = new WordSource(new HtmlTextSource(new SimpleHtmlParser(_textBox.Text))); + public HtmlTextBoxWordRange(TextBox textBox) + { + _textBox = textBox; + _src = new WordSource(new HtmlTextSource(new SimpleHtmlParser(_textBox.Text))); - if (_textBox.SelectionLength > 0) - { - _startAt = _textBox.SelectionStart; - _endAt = _startAt + _textBox.SelectionLength; - } - else - { - _startAt = 0; - _endAt = _textBox.TextLength; - } + if (_textBox.SelectionLength > 0) + { + _startAt = _textBox.SelectionStart; + _endAt = _startAt + _textBox.SelectionLength; + } + else + { + _startAt = 0; + _endAt = _textBox.TextLength; + } - AdvanceToStart(); - } + AdvanceToStart(); + } - private void AdvanceToStart() - { - while (null != (_nextWord = _src.Next()) // not at EOD - && (_nextWord.Offset + _nextWord.Len <= _startAt)) // word is entirely before startAt - { - } + private void AdvanceToStart() + { + while (null != (_nextWord = _src.Next()) // not at EOD + && (_nextWord.Offset + _nextWord.Len <= _startAt)) // word is entirely before startAt + { + } - CheckForNextWordPastEnd(); - } + CheckForNextWordPastEnd(); + } - private void CheckForNextWordPastEnd() - { - if (_nextWord != null && _nextWord.Offset >= _endAt) - _nextWord = null; - } + private void CheckForNextWordPastEnd() + { + if (_nextWord != null && _nextWord.Offset >= _endAt) + _nextWord = null; + } - public bool HasNext() - { - return _nextWord != null; - } + public bool HasNext() + { + return _nextWord != null; + } - public void Next() - { - _currentWord = _nextWord; - _nextWord = _src.Next(); - CheckForNextWordPastEnd(); - } + public void Next() + { + _currentWord = _nextWord; + _nextWord = _src.Next(); + CheckForNextWordPastEnd(); + } - public string CurrentWord - { - get - { - return _currentWord.Text; - } - } + public string CurrentWord + { + get + { + return _currentWord.Text; + } + } - public void PlaceCursor() - { - _textBox.Select(_currentWord.Offset - _drift + _currentWord.Len, 0); - } + public void PlaceCursor() + { + _textBox.Select(_currentWord.Offset - _drift + _currentWord.Len, 0); + } - public void Highlight(int offset, int length) - { - _textBox.Select(_currentWord.Offset - _drift + offset, length); - } + public void Highlight(int offset, int length) + { + _textBox.Select(_currentWord.Offset - _drift + offset, length); + } - public void RemoveHighlight() - { - _textBox.Select(_textBox.SelectionStart, 0); - } + public void RemoveHighlight() + { + _textBox.Select(_textBox.SelectionStart, 0); + } - public void Replace(int offset, int length, string newText) - { - newText = HtmlUtils.EscapeEntities(newText); + public void Replace(int offset, int length, string newText) + { + newText = HtmlUtils.EscapeEntities(newText); Highlight(offset, length); - _textBox.SelectedText = newText; - _drift += _currentWord.Len - newText.Length; - } + _textBox.SelectedText = newText; + _drift += _currentWord.Len - newText.Length; + } - public bool IsCurrentWordUrlPart() - { - return false; - } + public bool IsCurrentWordUrlPart() + { + return false; + } - public bool FilterApplies() - { - return false; - } - public bool FilterAppliesRanged(int offset, int length) - { - return false; - } + public bool FilterApplies() + { + return false; + } + public bool FilterAppliesRanged(int offset, int length) + { + return false; + } - private class TextWithOffsetAndLen - { - public readonly string Text; - public readonly int Offset; - public readonly int Len; + private class TextWithOffsetAndLen + { + public readonly string Text; + public readonly int Offset; + public readonly int Len; - public TextWithOffsetAndLen(string text, int offset, int len) - { - this.Text = text; - this.Offset = offset; - this.Len = len; - } - } + public TextWithOffsetAndLen(string text, int offset, int len) + { + this.Text = text; + this.Offset = offset; + this.Len = len; + } + } - private class WordSource - { - [Flags] - private enum CharClass - { - Break = 1, - BoundaryBreak = 2, // only counts as break if at start or end of word - LetterOrNumber = 4, - Letter = LetterOrNumber | 8, - Number = LetterOrNumber | 0x10, + private class WordSource + { + [Flags] + private enum CharClass + { + Break = 1, + BoundaryBreak = 2, // only counts as break if at start or end of word + LetterOrNumber = 4, + Letter = LetterOrNumber | 8, + Number = LetterOrNumber | 0x10, IncludedBreakChar = 0x20 // counts as a break, but is also included in the word - } + } - private HtmlTextSource _src; + private HtmlTextSource _src; - private TextWithOffsetAndLen _curr; - private int _offset = 0; + private TextWithOffsetAndLen _curr; + private int _offset = 0; - public WordSource(HtmlTextSource src) - { - this._src = src; - this._curr = src.Next(); - } + public WordSource(HtmlTextSource src) + { + this._src = src; + this._curr = src.Next(); + } - public TextWithOffsetAndLen Next() - { - while (true) - { - // No chunks left. - if (_curr == null) - return null; + public TextWithOffsetAndLen Next() + { + while (true) + { + // No chunks left. + if (_curr == null) + return null; - // Advance until we get to the next potential start of word. - // Note that this may not turn out to be an actual word, e.g. - // if it is all numbers. - AdvanceUntilWordStart(); + // Advance until we get to the next potential start of word. + // Note that this may not turn out to be an actual word, e.g. + // if it is all numbers. + AdvanceUntilWordStart(); - if (EOS()) // Reached end of this chunk - { - _offset = 0; - _curr = _src.Next(); - continue; // Try again with new chunk (or null, in which case we exit) - } + if (EOS()) // Reached end of this chunk + { + _offset = 0; + _curr = _src.Next(); + continue; // Try again with new chunk (or null, in which case we exit) + } - // Move to the end of the word. Note that BoundaryWordBreak - // characters may not end the word. For example, for the - // string "'that's'" (including single quotes), the word is - // "that's" (note outer single quotes dropped). - int start = _offset; - int endOfWord = _offset; - do - { - int charsToConsume; - CharClass charClass = ClassifyChar(_curr.Text, _offset, out charsToConsume); - if (Test(charClass, CharClass.Break)) - break; - _offset += charsToConsume; + // Move to the end of the word. Note that BoundaryWordBreak + // characters may not end the word. For example, for the + // string "'that's'" (including single quotes), the word is + // "that's" (note outer single quotes dropped). + int start = _offset; + int endOfWord = _offset; + do + { + int charsToConsume; + CharClass charClass = ClassifyChar(_curr.Text, _offset, out charsToConsume); + if (Test(charClass, CharClass.Break)) + break; + _offset += charsToConsume; if (Test(charClass, CharClass.IncludedBreakChar)) { endOfWord = _offset; break; } - if (Test(charClass, CharClass.LetterOrNumber)) - endOfWord = _offset; - } while (!EOS()); + if (Test(charClass, CharClass.LetterOrNumber)) + endOfWord = _offset; + } while (!EOS()); - string substring = _curr.Text.Substring(start, endOfWord - start); - if (substring.Length > 0) - { - return new TextWithOffsetAndLen( - HtmlUtils.UnEscapeEntities(substring, HtmlUtils.UnEscapeMode.NonMarkupText), - _curr.Offset + start, - substring.Length - ); - } - } - } + string substring = _curr.Text.Substring(start, endOfWord - start); + if (substring.Length > 0) + { + return new TextWithOffsetAndLen( + HtmlUtils.UnEscapeEntities(substring, HtmlUtils.UnEscapeMode.NonMarkupText), + _curr.Offset + start, + substring.Length + ); + } + } + } - private void AdvanceUntilWordStart() - { - int charsToConsume; - while (!EOS() && !Test(ClassifyChar(_curr.Text, _offset, out charsToConsume), CharClass.LetterOrNumber)) - _offset += charsToConsume; - } + private void AdvanceUntilWordStart() + { + int charsToConsume; + while (!EOS() && !Test(ClassifyChar(_curr.Text, _offset, out charsToConsume), CharClass.LetterOrNumber)) + _offset += charsToConsume; + } - private bool Test(CharClass val, CharClass comparand) - { - return (val & comparand) == comparand; - } + private bool Test(CharClass val, CharClass comparand) + { + return (val & comparand) == comparand; + } - /// - /// Determines the type of character that is currently pointed to by _offset, - /// - /// - /// - private CharClass ClassifyChar(string strval, int offset, out int charsToConsume) - { - charsToConsume = 1; - char currChar = strval[offset]; + /// + /// Determines the type of character that is currently pointed to by _offset, + /// + /// + /// + private CharClass ClassifyChar(string strval, int offset, out int charsToConsume) + { + charsToConsume = 1; + char currChar = strval[offset]; - if (currChar == '&') - { - int nextSemi = strval.IndexOf(';', offset + 1); - if (nextSemi != -1) - { - int code = HtmlUtils.DecodeEntityReference(strval.Substring(offset + 1, nextSemi - offset - 1)); - if (code != -1) - { - charsToConsume = nextSemi - offset + 1; - currChar = (char)code; - } - } - } + if (currChar == '&') + { + int nextSemi = strval.IndexOf(';', offset + 1); + if (nextSemi != -1) + { + int code = HtmlUtils.DecodeEntityReference(strval.Substring(offset + 1, nextSemi - offset - 1)); + if (code != -1) + { + charsToConsume = nextSemi - offset + 1; + currChar = (char)code; + } + } + } - return + return !WordRangeHelper.IsNonSymbolChar(currChar) ? CharClass.Break : - char.IsLetter(currChar) ? CharClass.Letter : - char.IsNumber(currChar) ? CharClass.Number : - currChar == '\'' ? CharClass.BoundaryBreak : - currChar == '’' ? CharClass.BoundaryBreak : - currChar == '.' ? CharClass.IncludedBreakChar : - CharClass.Break; - } + char.IsLetter(currChar) ? CharClass.Letter : + char.IsNumber(currChar) ? CharClass.Number : + currChar == '\'' ? CharClass.BoundaryBreak : + currChar == '’' ? CharClass.BoundaryBreak : + currChar == '.' ? CharClass.IncludedBreakChar : + CharClass.Break; + } - private bool EOS() - { - return _offset >= _curr.Text.Length; - } - } + private bool EOS() + { + return _offset >= _curr.Text.Length; + } + } - private class HtmlTextSource - { - private SimpleHtmlParser _parser; + private class HtmlTextSource + { + private SimpleHtmlParser _parser; - public HtmlTextSource(SimpleHtmlParser parser) - { - this._parser = parser; - } + public HtmlTextSource(SimpleHtmlParser parser) + { + this._parser = parser; + } - public TextWithOffsetAndLen Next() - { - Element e; - while (null != (e = _parser.Next())) - { - if (e is Text) - return new TextWithOffsetAndLen(e.RawText, e.Offset, e.Length); - } - return null; - } - } - } + public TextWithOffsetAndLen Next() + { + Element e; + while (null != (e = _parser.Next())) + { + if (e is Text) + return new TextWithOffsetAndLen(e.RawText, e.Offset, e.Length); + } + return null; + } + } + } } diff --git a/src/managed/OpenLiveWriter.SpellChecker/IBlogPostSpellCheckingContext.cs b/src/managed/OpenLiveWriter.SpellChecker/IBlogPostSpellCheckingContext.cs index cfa7cb9b..3cce5534 100644 --- a/src/managed/OpenLiveWriter.SpellChecker/IBlogPostSpellCheckingContext.cs +++ b/src/managed/OpenLiveWriter.SpellChecker/IBlogPostSpellCheckingContext.cs @@ -5,16 +5,16 @@ using System; namespace OpenLiveWriter.SpellChecker { - /// - /// Spelling checking services for the HTML Editor. - /// - public interface IBlogPostSpellCheckingContext - { + /// + /// Spelling checking services for the HTML Editor. + /// + public interface IBlogPostSpellCheckingContext + { bool CanSpellCheck { get; } - string PostSpellingContextDirectory { get; } + string PostSpellingContextDirectory { get; } ISpellingChecker SpellingChecker { get; } - string AutoCorrectLexiconFilePath { get; } - event EventHandler SpellingOptionsChanged; - } + string AutoCorrectLexiconFilePath { get; } + event EventHandler SpellingOptionsChanged; + } } diff --git a/src/managed/OpenLiveWriter.SpellChecker/ISpellingChecker.cs b/src/managed/OpenLiveWriter.SpellChecker/ISpellingChecker.cs index 7106c467..dae4a546 100644 --- a/src/managed/OpenLiveWriter.SpellChecker/ISpellingChecker.cs +++ b/src/managed/OpenLiveWriter.SpellChecker/ISpellingChecker.cs @@ -6,88 +6,87 @@ using System.Diagnostics; namespace OpenLiveWriter.SpellChecker { - /// - /// Generic interface implemented by spell checking engines - /// - public interface ISpellingChecker : IDisposable - { - /// - /// Notify the spell checker that we are going to start checking a document - /// and that we would like the user's Ignore All and Replace All commands - /// to be persisted in a context-bound dictionary - /// - /// directory where the - /// spell checker can write a context-bound dictionary (null to not - /// use a context-dictionary) - void StartChecking( string contextDictionaryLocation ) ; + /// + /// Generic interface implemented by spell checking engines + /// + public interface ISpellingChecker : IDisposable + { + /// + /// Notify the spell checker that we are going to start checking a document + /// and that we would like the user's Ignore All and Replace All commands + /// to be persisted in a context-bound dictionary + /// + /// directory where the + /// spell checker can write a context-bound dictionary (null to not + /// use a context-dictionary) + void StartChecking( string contextDictionaryLocation ) ; - - /// - /// Notify the spell checker that we have stopped checking the document - /// - void StopChecking() ; + /// + /// Notify the spell checker that we have stopped checking the document + /// + void StopChecking() ; bool IsInitialized { get; } - /// - /// Check the spelling of the specified word - /// - /// word to check - /// auto or conditional replace word (returned only - /// for certain SpellCheckResult values) - /// check-word result - SpellCheckResult CheckWord(string word, out string otherWord, out int offset, out int length) ; + /// + /// Check the spelling of the specified word + /// + /// word to check + /// auto or conditional replace word (returned only + /// for certain SpellCheckResult values) + /// check-word result + SpellCheckResult CheckWord(string word, out string otherWord, out int offset, out int length) ; - /// - /// Suggest alternate spellings for the specified word - /// - /// word to get suggestions for - /// maximum number of suggestions to return - /// depth of search -- 0 to 100 where larger values - /// indicated a deeper (and longer) search - /// array of spelling suggestions (up to maxSuggestions long) - SpellingSuggestion[] Suggest(string word, short maxSuggestions, short depth ) ; + /// + /// Suggest alternate spellings for the specified word + /// + /// word to get suggestions for + /// maximum number of suggestions to return + /// depth of search -- 0 to 100 where larger values + /// indicated a deeper (and longer) search + /// array of spelling suggestions (up to maxSuggestions long) + SpellingSuggestion[] Suggest(string word, short maxSuggestions, short depth ) ; - /// - /// Add a word to the permenant user-dictionary - /// - /// - void AddToUserDictionary( string word ) ; + /// + /// Add a word to the permenant user-dictionary + /// + /// + void AddToUserDictionary( string word ) ; - event EventHandler WordAdded; + event EventHandler WordAdded; - /// - /// Ignore all subsequent instances of the specified word - /// - /// word to ignore - void IgnoreAll( string word ) ; + /// + /// Ignore all subsequent instances of the specified word + /// + /// word to ignore + void IgnoreAll( string word ) ; - event EventHandler WordIgnored; + event EventHandler WordIgnored; - /// - /// Replace all subsequent instances of the specified word - /// - /// word to replace - /// replacement word - void ReplaceAll( string word, string replaceWith ) ; + /// + /// Replace all subsequent instances of the specified word + /// + /// word to replace + /// replacement word + void ReplaceAll( string word, string replaceWith ) ; - void Reset(); - } + void Reset(); + } - /// - /// Languages supported by the spelling checker - /// - public enum SpellingCheckerLanguage - { - None, - EnglishUS, - EnglishUK, - EnglishCanada, - EnglishAustralia, - Spanish, - German, - GermanReform, - French, + /// + /// Languages supported by the spelling checker + /// + public enum SpellingCheckerLanguage + { + None, + EnglishUS, + EnglishUK, + EnglishCanada, + EnglishAustralia, + Spanish, + German, + GermanReform, + French, Korean, Italian, Dutch, @@ -118,102 +117,101 @@ namespace OpenLiveWriter.SpellChecker SerbianCyrillic, Swedish, Ukrainian, - } + } + /// + /// Possible result codes from check-word call + /// + public enum SpellCheckResult + { + /// + /// Word is correctly spelled + /// + Correct, - /// - /// Possible result codes from check-word call - /// - public enum SpellCheckResult - { - /// - /// Word is correctly spelled - /// - Correct, + /// + /// Word has an auto-replace value (value returned in otherWord parameter) + /// + AutoReplace, - /// - /// Word has an auto-replace value (value returned in otherWord parameter) - /// - AutoReplace, + /// + /// Word has a conditional-replace value (value returned in otherWord parameter) + /// + ConditionalReplace, - /// - /// Word has a conditional-replace value (value returned in otherWord parameter) - /// - ConditionalReplace, + /// + /// Word is incorrectly capitalized + /// + Capitalization, - /// - /// Word is incorrectly capitalized - /// - Capitalization, + /// + /// Word is misspelled + /// + Misspelled + } - /// - /// Word is misspelled - /// - Misspelled - } + /// + /// Suggestion for a misspelled word + /// + public struct SpellingSuggestion + { + /// + /// Initialize with hte appropriate suggestion and score + /// + /// suggestion + /// score + public SpellingSuggestion( string suggestion, short score ) + { + Suggestion = suggestion ; + Score = score ; + } - /// - /// Suggestion for a misspelled word - /// - public struct SpellingSuggestion - { - /// - /// Initialize with hte appropriate suggestion and score - /// - /// suggestion - /// score - public SpellingSuggestion( string suggestion, short score ) - { - Suggestion = suggestion ; - Score = score ; - } + /// + /// Suggested word + /// + public readonly string Suggestion ; - /// - /// Suggested word - /// - public readonly string Suggestion ; + /// + /// Score (0-100 percent where 100 indicates an exact match) + /// + public readonly short Score ; + } - /// - /// Score (0-100 percent where 100 indicates an exact match) - /// - public readonly short Score ; - } + /// + /// Exception that occurs during spell checking + /// + public class SpellingCheckerException : ApplicationException + { + /// + /// Initialize with just an error message + /// + /// + public SpellingCheckerException( string message ) + : this( message, 0 ) + { + } - /// - /// Exception that occurs during spell checking - /// - public class SpellingCheckerException : ApplicationException - { - /// - /// Initialize with just an error message - /// - /// - public SpellingCheckerException( string message ) - : this( message, 0 ) - { - } + /// + /// Initialize with a message and native error + /// + /// error message + /// native error code + public SpellingCheckerException( string message, int nativeError ) + : base( message ) + { + this.nativeError = nativeError ; + } - /// - /// Initialize with a message and native error - /// - /// error message - /// native error code - public SpellingCheckerException( string message, int nativeError ) - : base( message ) - { - this.nativeError = nativeError ; - } + /// + /// Underlying error code from native implementation + /// + public int NativeError { get { return nativeError; } } - /// - /// Underlying error code from native implementation - /// - public int NativeError { get { return nativeError; } } - - /// - /// Underlying native error code - /// - private int nativeError = 0 ; - } + /// + /// Underlying native error code + /// + private int nativeError = 0 ; + } } diff --git a/src/managed/OpenLiveWriter.SpellChecker/IWordRange.cs b/src/managed/OpenLiveWriter.SpellChecker/IWordRange.cs index 1839afc4..1dcd4efe 100644 --- a/src/managed/OpenLiveWriter.SpellChecker/IWordRange.cs +++ b/src/managed/OpenLiveWriter.SpellChecker/IWordRange.cs @@ -8,63 +8,63 @@ using OpenLiveWriter.Mshtml; namespace OpenLiveWriter.SpellChecker { - /// - /// Interface representing a word-range to be spell checked - /// - [Guid("F4FB57BC-5DB2-484A-8CDC-1EA270BE3821")] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - [ComVisible(true)] - public interface IWordRange - { - /// - /// Is there another word in the range? - /// - /// true if there is another word in the range - bool HasNext() ; + /// + /// Interface representing a word-range to be spell checked + /// + [Guid("F4FB57BC-5DB2-484A-8CDC-1EA270BE3821")] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + [ComVisible(true)] + public interface IWordRange + { + /// + /// Is there another word in the range? + /// + /// true if there is another word in the range + bool HasNext() ; - /// - /// Advance to the next word in the range - /// - void Next() ; + /// + /// Advance to the next word in the range + /// + void Next() ; - /// - /// Get the current word - /// - string CurrentWord { get; } + /// + /// Get the current word + /// + string CurrentWord { get; } - /// - /// Place the cursor - /// - void PlaceCursor() ; + /// + /// Place the cursor + /// + void PlaceCursor() ; - /// - /// Highlight the current word, adjusted by the offset and length. - /// The offset and length do not change the current word, - /// they just affect the application of the highlight. - /// - void Highlight(int offset, int length) ; + /// + /// Highlight the current word, adjusted by the offset and length. + /// The offset and length do not change the current word, + /// they just affect the application of the highlight. + /// + void Highlight(int offset, int length) ; - /// - /// Remove highlighting from the range - /// - void RemoveHighlight() ; + /// + /// Remove highlighting from the range + /// + void RemoveHighlight() ; - /// - /// Replace the current word - /// - void Replace(int offset, int length, string newText) ; + /// + /// Replace the current word + /// + void Replace(int offset, int length, string newText) ; - /// - /// Tests the current word to determine if it is part of a URL sequence. - /// - /// - bool IsCurrentWordUrlPart(); + /// + /// Tests the current word to determine if it is part of a URL sequence. + /// + /// + bool IsCurrentWordUrlPart(); - /// - /// Tests the current word to determine if it is contained in smart content. - /// - /// - bool FilterApplies(); + /// + /// Tests the current word to determine if it is contained in smart content. + /// + /// + bool FilterApplies(); /// /// Tests the current word from an offset for a given length to determine if it is contained in smart content. @@ -72,8 +72,8 @@ namespace OpenLiveWriter.SpellChecker /// /// /// - bool FilterAppliesRanged(int offset, int length); - } + bool FilterAppliesRanged(int offset, int length); + } public static class WordRangeHelper { diff --git a/src/managed/OpenLiveWriter.SpellChecker/MisspelledWordInfo.cs b/src/managed/OpenLiveWriter.SpellChecker/MisspelledWordInfo.cs index 8455f78e..3bed2594 100644 --- a/src/managed/OpenLiveWriter.SpellChecker/MisspelledWordInfo.cs +++ b/src/managed/OpenLiveWriter.SpellChecker/MisspelledWordInfo.cs @@ -6,34 +6,34 @@ using OpenLiveWriter.Mshtml; namespace OpenLiveWriter.SpellChecker { - /// - /// Summary description for MisspelledWordInfo. - /// - public class MisspelledWordInfo - { - private MarkupRange _range; - private string _word; + /// + /// Summary description for MisspelledWordInfo. + /// + public class MisspelledWordInfo + { + private MarkupRange _range; + private string _word; - public MisspelledWordInfo(MarkupRange range, string word) - { - _range = range; - _word = word; - } + public MisspelledWordInfo(MarkupRange range, string word) + { + _range = range; + _word = word; + } - public MarkupRange WordRange - { - get - { - return _range; - } - } + public MarkupRange WordRange + { + get + { + return _range; + } + } - public string Word - { - get - { - return _word; - } - } - } + public string Word + { + get + { + return _word; + } + } + } } diff --git a/src/managed/OpenLiveWriter.SpellChecker/MshtmlWordRange.cs b/src/managed/OpenLiveWriter.SpellChecker/MshtmlWordRange.cs index dc2e2583..625d1cc9 100644 --- a/src/managed/OpenLiveWriter.SpellChecker/MshtmlWordRange.cs +++ b/src/managed/OpenLiveWriter.SpellChecker/MshtmlWordRange.cs @@ -12,35 +12,35 @@ using System.Text.RegularExpressions; namespace OpenLiveWriter.SpellChecker { - public delegate void DamageFunction(MarkupRange range); + public delegate void DamageFunction(MarkupRange range); public delegate bool MarkupRangeFilter(MarkupRange range); - /// - /// Implementation of IWordRange for an MSHTML control - /// - public class MshtmlWordRange : IWordRange - { + /// + /// Implementation of IWordRange for an MSHTML control + /// + public class MshtmlWordRange : IWordRange + { MarkupRangeFilter filter = null; - DamageFunction damageFunction = null; + DamageFunction damageFunction = null; - /// - /// Initialize word range for the entire body of the document - /// - /// mshtml control - public MshtmlWordRange(MshtmlControl mshtmlControl) : - this(mshtmlControl.HTMLDocument, false, null, null) - { - } + /// + /// Initialize word range for the entire body of the document + /// + /// mshtml control + public MshtmlWordRange(MshtmlControl mshtmlControl) : + this(mshtmlControl.HTMLDocument, false, null, null) + { + } - /// - /// Initialize word range for the specified markup-range within the document - /// - public MshtmlWordRange(IHTMLDocument document, bool useDocumentSelectionRange, MarkupRangeFilter filter, DamageFunction damageFunction) - { - MshtmlMarkupServices markupServices = new MshtmlMarkupServices((IMarkupServicesRaw)document); - IHTMLDocument2 document2 = (IHTMLDocument2)document; - MarkupRange markupRange; + /// + /// Initialize word range for the specified markup-range within the document + /// + public MshtmlWordRange(IHTMLDocument document, bool useDocumentSelectionRange, MarkupRangeFilter filter, DamageFunction damageFunction) + { + MshtmlMarkupServices markupServices = new MshtmlMarkupServices((IMarkupServicesRaw)document); + IHTMLDocument2 document2 = (IHTMLDocument2)document; + MarkupRange markupRange; if (useDocumentSelectionRange) { markupRange = markupServices.CreateMarkupRange(document2.selection); @@ -51,194 +51,194 @@ namespace OpenLiveWriter.SpellChecker markupRange = markupServices.CreateMarkupRange(document2.body, false); } - Init(document, markupServices, markupRange, filter, damageFunction, useDocumentSelectionRange); - } + Init(document, markupServices, markupRange, filter, damageFunction, useDocumentSelectionRange); + } - /// - /// Initialize word range for the specified markup-range within the document - /// + /// + /// Initialize word range for the specified markup-range within the document + /// public MshtmlWordRange(IHTMLDocument document, MarkupRange markupRange, MarkupRangeFilter filter, DamageFunction damageFunction) - { - MshtmlMarkupServices markupServices = new MshtmlMarkupServices((IMarkupServicesRaw)document); - Init(document, markupServices, markupRange, filter, damageFunction, true); - } + { + MshtmlMarkupServices markupServices = new MshtmlMarkupServices((IMarkupServicesRaw)document); + Init(document, markupServices, markupRange, filter, damageFunction, true); + } private void Init(IHTMLDocument document, MshtmlMarkupServices markupServices, MarkupRange selectionRange, MarkupRangeFilter filter, DamageFunction damageFunction, bool expandRange) - { - // save references - this.htmlDocument = document; - this.markupServices = markupServices; - this.selectionRange = selectionRange; - this.filter = filter; - this.damageFunction = damageFunction; + { + // save references + this.htmlDocument = document; + this.markupServices = markupServices; + this.selectionRange = selectionRange; + this.filter = filter; + this.damageFunction = damageFunction; // If the range is already the body, don't expand it or else it will be the whole document if (expandRange) - ExpandRangeToWordBoundaries(selectionRange); + ExpandRangeToWordBoundaries(selectionRange); // initialize pointer to beginning of selection range - MarkupPointer wordStart = MarkupServices.CreateMarkupPointer(selectionRange.Start); - MarkupPointer wordEnd = MarkupServices.CreateMarkupPointer(selectionRange.Start); + MarkupPointer wordStart = MarkupServices.CreateMarkupPointer(selectionRange.Start); + MarkupPointer wordEnd = MarkupServices.CreateMarkupPointer(selectionRange.Start); - //create the range for holding the current word. - //Be sure to set its gravity so that it stays around text that get replaced. - currentWordRange = MarkupServices.CreateMarkupRange(wordStart, wordEnd); - currentWordRange.Start.Gravity = _POINTER_GRAVITY.POINTER_GRAVITY_Left; - currentWordRange.End.Gravity = _POINTER_GRAVITY.POINTER_GRAVITY_Right; + //create the range for holding the current word. + //Be sure to set its gravity so that it stays around text that get replaced. + currentWordRange = MarkupServices.CreateMarkupRange(wordStart, wordEnd); + currentWordRange.Start.Gravity = _POINTER_GRAVITY.POINTER_GRAVITY_Left; + currentWordRange.End.Gravity = _POINTER_GRAVITY.POINTER_GRAVITY_Right; - currentVirtualPosition = currentWordRange.End.Clone(); - } + currentVirtualPosition = currentWordRange.End.Clone(); + } - public static void ExpandRangeToWordBoundaries(MarkupRange range) - { + public static void ExpandRangeToWordBoundaries(MarkupRange range) + { //adjust the selection so that it entirely covers the first and last words. - range.Start.MoveUnit(_MOVEUNIT_ACTION.MOVEUNIT_NEXTWORDEND); - range.Start.MoveUnit(_MOVEUNIT_ACTION.MOVEUNIT_PREVWORDBEGIN); - range.End.MoveUnit(_MOVEUNIT_ACTION.MOVEUNIT_PREVWORDBEGIN); - range.End.MoveUnit(_MOVEUNIT_ACTION.MOVEUNIT_NEXTWORDEND); - } + range.Start.MoveUnit(_MOVEUNIT_ACTION.MOVEUNIT_NEXTWORDEND); + range.Start.MoveUnit(_MOVEUNIT_ACTION.MOVEUNIT_PREVWORDBEGIN); + range.End.MoveUnit(_MOVEUNIT_ACTION.MOVEUNIT_PREVWORDBEGIN); + range.End.MoveUnit(_MOVEUNIT_ACTION.MOVEUNIT_NEXTWORDEND); + } - public bool IsCurrentWordUrlPart() - { - return IsRangeInUrl(currentWordRange); - } + public bool IsCurrentWordUrlPart() + { + return IsRangeInUrl(currentWordRange); + } - public bool FilterApplies() - { - return filter != null && filter(currentWordRange); - } - public bool FilterAppliesRanged(int offset, int length) - { - MarkupRange adjustedRange = currentWordRange.Clone(); - MarkupHelpers.AdjustMarkupRange(ref stagingTextRange, adjustedRange, offset, length); - return filter != null && filter(adjustedRange); - } + public bool FilterApplies() + { + return filter != null && filter(currentWordRange); + } + public bool FilterAppliesRanged(int offset, int length) + { + MarkupRange adjustedRange = currentWordRange.Clone(); + MarkupHelpers.AdjustMarkupRange(ref stagingTextRange, adjustedRange, offset, length); + return filter != null && filter(adjustedRange); + } - /// - /// Do we have another word in our range? - /// - /// - public bool HasNext() - { - return currentWordRange.End.IsLeftOf(selectionRange.End); - } + /// + /// Do we have another word in our range? + /// + /// + public bool HasNext() + { + return currentWordRange.End.IsLeftOf(selectionRange.End); + } - /// - /// Advance to next word - /// - public void Next() - { + /// + /// Advance to next word + /// + public void Next() + { currentWordRange.End.MoveToPointer(currentVirtualPosition); - do - { - //advance the start pointer to the beginning of next word - if(!currentWordRange.End.IsEqualTo(selectionRange.Start)) //avoids skipping over the first word - { - //fix bug 1848 - move the start to the end pointer before advancing to the next word - //this ensures that the "next begin" is after the current selection. - currentWordRange.Start.MoveToPointer(currentWordRange.End); - currentWordRange.Start.MoveUnit(_MOVEUNIT_ACTION.MOVEUNIT_PREVWORDBEGIN); + do + { + //advance the start pointer to the beginning of next word + if(!currentWordRange.End.IsEqualTo(selectionRange.Start)) //avoids skipping over the first word + { + //fix bug 1848 - move the start to the end pointer before advancing to the next word + //this ensures that the "next begin" is after the current selection. + currentWordRange.Start.MoveToPointer(currentWordRange.End); + currentWordRange.Start.MoveUnit(_MOVEUNIT_ACTION.MOVEUNIT_PREVWORDBEGIN); - currentWordRange.Start.MoveUnit(_MOVEUNIT_ACTION.MOVEUNIT_NEXTWORDBEGIN); - } - else - { - //Special case for putting the start pointer at the beginning of the - //correct word when the selection may or may not be already adjacent - //to the the beginning of the word. - //Note: theoretically, the selection adjustment in the constructor - //guarantees that we will be flush against the first word, so we could - //probably do nothing, but it works, so we'll keep it. - currentWordRange.Start.MoveUnit(_MOVEUNIT_ACTION.MOVEUNIT_NEXTWORDEND); - currentWordRange.Start.MoveUnit(_MOVEUNIT_ACTION.MOVEUNIT_PREVWORDBEGIN); - } + currentWordRange.Start.MoveUnit(_MOVEUNIT_ACTION.MOVEUNIT_NEXTWORDBEGIN); + } + else + { + //Special case for putting the start pointer at the beginning of the + //correct word when the selection may or may not be already adjacent + //to the the beginning of the word. + //Note: theoretically, the selection adjustment in the constructor + //guarantees that we will be flush against the first word, so we could + //probably do nothing, but it works, so we'll keep it. + currentWordRange.Start.MoveUnit(_MOVEUNIT_ACTION.MOVEUNIT_NEXTWORDEND); + currentWordRange.Start.MoveUnit(_MOVEUNIT_ACTION.MOVEUNIT_PREVWORDBEGIN); + } - //advance the end pointer to the end of next word - currentWordRange.End.MoveUnit(_MOVEUNIT_ACTION.MOVEUNIT_NEXTWORDEND); + //advance the end pointer to the end of next word + currentWordRange.End.MoveUnit(_MOVEUNIT_ACTION.MOVEUNIT_NEXTWORDEND); - if(currentWordRange.Start.IsRightOf(currentWordRange.End)) - { - //Note: this was a condition that caused several bugs that caused us to stop - //spell-checking correctly, so this logic is here in case we still have edge - //cases that trigger it. - //This should not occur anymore since we fixed several causes of this - //condition by setting the currentWordRange gravity, and detecting case where - //the selection may or may-not start at the beginning of a word. - Debug.Fail("word start jumped past word end"); + if(currentWordRange.Start.IsRightOf(currentWordRange.End)) + { + //Note: this was a condition that caused several bugs that caused us to stop + //spell-checking correctly, so this logic is here in case we still have edge + //cases that trigger it. + //This should not occur anymore since we fixed several causes of this + //condition by setting the currentWordRange gravity, and detecting case where + //the selection may or may-not start at the beginning of a word. + Debug.Fail("word start jumped past word end"); - //if this occured, it was probably because start was already at the beginning - //of the correct word before it was moved. To resolve this situation, we - //move the start pointer back to the beginning of the word that the end pointer - //is at. Since the End pointer always advances on each iteration, this should not - //cause an infinite loop. The worst case scenario is that we check the same word - //more than once. - currentWordRange.Start.MoveToPointer(currentWordRange.End); - currentWordRange.Start.MoveUnit(_MOVEUNIT_ACTION.MOVEUNIT_PREVWORDBEGIN); - } + //if this occured, it was probably because start was already at the beginning + //of the correct word before it was moved. To resolve this situation, we + //move the start pointer back to the beginning of the word that the end pointer + //is at. Since the End pointer always advances on each iteration, this should not + //cause an infinite loop. The worst case scenario is that we check the same word + //more than once. + currentWordRange.Start.MoveToPointer(currentWordRange.End); + currentWordRange.Start.MoveUnit(_MOVEUNIT_ACTION.MOVEUNIT_PREVWORDBEGIN); + } - } while( MarkupHelpers.GetRangeTextFast(currentWordRange) == null && - currentWordRange.End.IsLeftOf(selectionRange.End)); + } while( MarkupHelpers.GetRangeTextFast(currentWordRange) == null && + currentWordRange.End.IsLeftOf(selectionRange.End)); currentVirtualPosition.MoveToPointer(currentWordRange.End); - if(currentWordRange.End.IsRightOf(selectionRange.End)) - { - //then collapse the range so that CurrentWord returns Empty; - currentWordRange.Start.MoveToPointer(currentWordRange.End); - } + if(currentWordRange.End.IsRightOf(selectionRange.End)) + { + //then collapse the range so that CurrentWord returns Empty; + currentWordRange.Start.MoveToPointer(currentWordRange.End); + } else - { - MarkupRange testRange = currentWordRange.Clone(); + { + MarkupRange testRange = currentWordRange.Clone(); testRange.Collapse(false); testRange.End.MoveUnitBounded(_MOVEUNIT_ACTION.MOVEUNIT_NEXTCHAR, selectionRange.End); if (MarkupHelpers.GetRangeHtmlFast(testRange) == ".") { currentWordRange.End.MoveToPointer(testRange.End); } - } - } + } + } private bool IsRangeInUrl(MarkupRange range) - { - //must have this range cloned, otherwise in some cases IsInsideURL call - // was MOVING the current word range! if "www.foo.com" was in the editor, - // when the final "\"" was the current word, this call MOVED the current - // word range BACK to www.foo.com, then nextWord would get "\"" and a loop - // would occur (bug 411528) - range = range.Clone(); - IMarkupPointer2Raw p2StartRaw = (IMarkupPointer2Raw)range.Start.PointerRaw; - bool insideUrl; - p2StartRaw.IsInsideURL(range.End.PointerRaw, out insideUrl); - return insideUrl; - } + { + //must have this range cloned, otherwise in some cases IsInsideURL call + // was MOVING the current word range! if "www.foo.com" was in the editor, + // when the final "\"" was the current word, this call MOVED the current + // word range BACK to www.foo.com, then nextWord would get "\"" and a loop + // would occur (bug 411528) + range = range.Clone(); + IMarkupPointer2Raw p2StartRaw = (IMarkupPointer2Raw)range.Start.PointerRaw; + bool insideUrl; + p2StartRaw.IsInsideURL(range.End.PointerRaw, out insideUrl); + return insideUrl; + } - /// - /// Get the text of the current word - /// - public string CurrentWord - { - get - { - return currentWordRange.Text ?? ""; - } - } + /// + /// Get the text of the current word + /// + public string CurrentWord + { + get + { + return currentWordRange.Text ?? ""; + } + } - public void PlaceCursor() - { - currentWordRange.Collapse(false); - currentWordRange.ToTextRange().select(); - } + public void PlaceCursor() + { + currentWordRange.Collapse(false); + currentWordRange.ToTextRange().select(); + } - /// - /// Highlight the current word - /// - public void Highlight(int offset, int length) - { - // select word - MarkupRange highlightRange = currentWordRange.Clone(); - MarkupHelpers.AdjustMarkupRange(highlightRange, offset, length); + /// + /// Highlight the current word + /// + public void Highlight(int offset, int length) + { + // select word + MarkupRange highlightRange = currentWordRange.Clone(); + MarkupHelpers.AdjustMarkupRange(highlightRange, offset, length); try { @@ -250,14 +250,14 @@ namespace OpenLiveWriter.SpellChecker if (ce.ErrorCode != unchecked((int)0x800A025E)) throw; } - } + } - /// - /// Remove highlighting from the document - /// - public void RemoveHighlight() - { - // clear document selection + /// + /// Remove highlighting from the document + /// + public void RemoveHighlight() + { + // clear document selection try { ((IHTMLDocument2) (htmlDocument)).selection.empty(); @@ -267,46 +267,46 @@ namespace OpenLiveWriter.SpellChecker if (ce.ErrorCode != unchecked((int)0x800A025E)) throw; } - } + } - /// - /// Replace the text of the current word - /// - public void Replace(int offset, int length, string newText) - { - MarkupRange origRange = currentWordRange.Clone(); - // set the text + /// + /// Replace the text of the current word + /// + public void Replace(int offset, int length, string newText) + { + MarkupRange origRange = currentWordRange.Clone(); + // set the text currentWordRange.Text = StringHelper.Replace(currentWordRange.Text, offset, length, newText); damageFunction(origRange); - } + } - /// - /// Markup services for mshtml control - /// - private MshtmlMarkupServices MarkupServices - { - get { return markupServices; } - } + /// + /// Markup services for mshtml control + /// + private MshtmlMarkupServices MarkupServices + { + get { return markupServices; } + } - /// - /// Control we are providing a word range for - /// - //private MshtmlControl mshtmlControl ; - private IHTMLDocument htmlDocument; - private MshtmlMarkupServices markupServices; + /// + /// Control we are providing a word range for + /// + //private MshtmlControl mshtmlControl ; + private IHTMLDocument htmlDocument; + private MshtmlMarkupServices markupServices; - /// - /// Range over which we are iterating - /// - private MarkupRange selectionRange; + /// + /// Range over which we are iterating + /// + private MarkupRange selectionRange; - public MarkupRange SelectionRange - { - get - { - return selectionRange; - } - } + public MarkupRange SelectionRange + { + get + { + return selectionRange; + } + } /// /// In order to fix the "vs." defect (trailing periods need to @@ -319,19 +319,19 @@ namespace OpenLiveWriter.SpellChecker /// private MarkupPointer currentVirtualPosition; - private IHTMLTxtRange stagingTextRange; + private IHTMLTxtRange stagingTextRange; /// - /// Pointer to current word - /// - private MarkupRange currentWordRange; + /// Pointer to current word + /// + private MarkupRange currentWordRange; - public MarkupRange CurrentWordRange - { - get - { - return currentWordRange; - } - } - } + public MarkupRange CurrentWordRange + { + get + { + return currentWordRange; + } + } + } } diff --git a/src/managed/OpenLiveWriter.SpellChecker/SpellCheckerForm.cs b/src/managed/OpenLiveWriter.SpellChecker/SpellCheckerForm.cs index f62fe422..568e3e30 100644 --- a/src/managed/OpenLiveWriter.SpellChecker/SpellCheckerForm.cs +++ b/src/managed/OpenLiveWriter.SpellChecker/SpellCheckerForm.cs @@ -152,7 +152,6 @@ namespace OpenLiveWriter.SpellChecker return; } - using (new WaitCursor()) { // loop through all of the words in the word-range @@ -302,7 +301,6 @@ namespace OpenLiveWriter.SpellChecker spellingChecker.Reset(); } - /// /// Provide suggestions for the current misspelled word /// @@ -450,7 +448,6 @@ namespace OpenLiveWriter.SpellChecker ContinueSpellCheck(); } - /// /// Handle TextChanged event to update state of buttons /// @@ -484,7 +481,6 @@ namespace OpenLiveWriter.SpellChecker textBoxChangeTo.Text = String.Empty; } - /// /// Double-click of a word in suggestions results in auto-replacement /// @@ -542,7 +538,6 @@ namespace OpenLiveWriter.SpellChecker wordRangeHighlightPending = true; } - /// /// Ensure the form is loaded /// @@ -580,13 +575,13 @@ namespace OpenLiveWriter.SpellChecker } Button[] buttons = { - buttonIgnore, - buttonIgnoreAll, - buttonChange, - buttonChangeAll, - buttonAdd, - buttonCancel - }; + buttonIgnore, + buttonIgnoreAll, + buttonChange, + buttonChangeAll, + buttonAdd, + buttonCancel + }; using (new AutoGrow(this, AnchorStyles.Right, true)) { diff --git a/src/managed/OpenLiveWriter.SpellChecker/SpellCheckingContextMenuDefinition.cs b/src/managed/OpenLiveWriter.SpellChecker/SpellCheckingContextMenuDefinition.cs index e93e3569..aa2ad734 100644 --- a/src/managed/OpenLiveWriter.SpellChecker/SpellCheckingContextMenuDefinition.cs +++ b/src/managed/OpenLiveWriter.SpellChecker/SpellCheckingContextMenuDefinition.cs @@ -12,107 +12,106 @@ using OpenLiveWriter.Mshtml; namespace OpenLiveWriter.SpellChecker { - /// - /// Summary description for SpellCheckingContextMenuDefinition. - /// 1. list of word suggestions - /// 2. static menu with ignore all, add to dictionary (which take word as argument) - /// 3. launch spelling dialog ?? - /// 4. static menu with cut/copy/paste - /// - /// - public class SpellCheckingContextMenuDefinition : CommandContextMenuDefinition - { - public SpellCheckingContextMenuDefinition() : this(null, null) - { - } + /// + /// Summary description for SpellCheckingContextMenuDefinition. + /// 1. list of word suggestions + /// 2. static menu with ignore all, add to dictionary (which take word as argument) + /// 3. launch spelling dialog ?? + /// 4. static menu with cut/copy/paste + /// + /// + public class SpellCheckingContextMenuDefinition : CommandContextMenuDefinition + { + public SpellCheckingContextMenuDefinition() : this(null, null) + { + } - public SpellCheckingContextMenuDefinition(string word, SpellingManager manager) - { - _currentWord = word; - _spellingManager = manager; - Entries.AddRange(GetSpellingSuggestions()); + public SpellCheckingContextMenuDefinition(string word, SpellingManager manager) + { + _currentWord = word; + _spellingManager = manager; + Entries.AddRange(GetSpellingSuggestions()); Entries.Add(CommandId.IgnoreOnce, true, false); Entries.Add(CommandId.IgnoreAll, false, false); - Entries.Add(CommandId.AddToDictionary, false, false); - Entries.Add(CommandId.OpenSpellingForm, false, false); - } + Entries.Add(CommandId.AddToDictionary, false, false); + Entries.Add(CommandId.OpenSpellingForm, false, false); + } - private string _currentWord; - private SpellingManager _spellingManager; + private string _currentWord; + private SpellingManager _spellingManager; - private MenuDefinitionEntryCollection GetSpellingSuggestions() - { - CommandManager commandManager = _spellingManager.CommandManager; - MenuDefinitionEntryCollection listOfSuggestions = new MenuDefinitionEntryCollection(); + private MenuDefinitionEntryCollection GetSpellingSuggestions() + { + CommandManager commandManager = _spellingManager.CommandManager; + MenuDefinitionEntryCollection listOfSuggestions = new MenuDefinitionEntryCollection(); commandManager.SuppressEvents = true; commandManager.BeginUpdate(); - try - { - // provide suggestions - SpellingSuggestion[] suggestions = _spellingManager.SpellingChecker.Suggest(_currentWord, DEFAULT_MAX_SUGGESTIONS, SUGGESTION_DEPTH ) ; - bool foundSuggestion = false; - if ( suggestions.Length > 0 ) - { - // add suggestions to list (stop adding when the quality of scores - // declines precipitously) - short lastScore = suggestions[0].Score ; - for (int i = 0; i < suggestions.Length; i++) - { - SpellingSuggestion suggestion = suggestions[i]; + try + { + // provide suggestions + SpellingSuggestion[] suggestions = _spellingManager.SpellingChecker.Suggest(_currentWord, DEFAULT_MAX_SUGGESTIONS, SUGGESTION_DEPTH ) ; + bool foundSuggestion = false; + if ( suggestions.Length > 0 ) + { + // add suggestions to list (stop adding when the quality of scores + // declines precipitously) + short lastScore = suggestions[0].Score ; + for (int i = 0; i < suggestions.Length; i++) + { + SpellingSuggestion suggestion = suggestions[i]; //note: in some weird cases, like 's, a suggestion is returned but lacks a suggested replacement, so need to check that case - if ( (lastScore-suggestion.Score) < SCORE_GAP_FILTER && (suggestion.Suggestion != null)) - { - Command FixSpellingCommand = new Command(CommandId.FixWordSpelling); - FixSpellingCommand.Identifier += suggestion.Suggestion; - FixSpellingCommand.Text = suggestion.Suggestion; - FixSpellingCommand.MenuText = suggestion.Suggestion; - FixSpellingCommand.Execute += new EventHandler(_spellingManager.fixSpellingApplyCommand_Execute); - FixSpellingCommand.Tag = suggestion.Suggestion; + if ( (lastScore-suggestion.Score) < SCORE_GAP_FILTER && (suggestion.Suggestion != null)) + { + Command FixSpellingCommand = new Command(CommandId.FixWordSpelling); + FixSpellingCommand.Identifier += suggestion.Suggestion; + FixSpellingCommand.Text = suggestion.Suggestion; + FixSpellingCommand.MenuText = suggestion.Suggestion; + FixSpellingCommand.Execute += new EventHandler(_spellingManager.fixSpellingApplyCommand_Execute); + FixSpellingCommand.Tag = suggestion.Suggestion; commandManager.Add(FixSpellingCommand); - listOfSuggestions.Add(FixSpellingCommand.Identifier, false, i == suggestions.Length - 1); - foundSuggestion = true; - } - else - break ; + listOfSuggestions.Add(FixSpellingCommand.Identifier, false, i == suggestions.Length - 1); + foundSuggestion = true; + } + else + break ; - // update last score - lastScore = suggestion.Score ; - } - } - if (!foundSuggestion) - { - Command FixSpellingCommand = new Command(CommandId.FixWordSpelling); - FixSpellingCommand.Enabled = false; + // update last score + lastScore = suggestion.Score ; + } + } + if (!foundSuggestion) + { + Command FixSpellingCommand = new Command(CommandId.FixWordSpelling); + FixSpellingCommand.Enabled = false; commandManager.Add(FixSpellingCommand); - listOfSuggestions.Add(CommandId.FixWordSpelling, false, true); - } - } - finally - { + listOfSuggestions.Add(CommandId.FixWordSpelling, false, true); + } + } + finally + { commandManager.EndUpdate(); commandManager.SuppressEvents = false; - } - return listOfSuggestions; - } + } + return listOfSuggestions; + } + /// + /// Default maximum suggestions to return + /// + private const short DEFAULT_MAX_SUGGESTIONS = 10 ; - /// - /// Default maximum suggestions to return - /// - private const short DEFAULT_MAX_SUGGESTIONS = 10 ; + /// + /// If we detect a gap between scores of this value or greater then + /// we drop the score and all remaining + /// + private const short SCORE_GAP_FILTER = 20 ; - /// - /// If we detect a gap between scores of this value or greater then - /// we drop the score and all remaining - /// - private const short SCORE_GAP_FILTER = 20 ; - - /// - /// Suggestion depth for searching (100 is the maximum) - /// - private const short SUGGESTION_DEPTH = 80 ; - } + /// + /// Suggestion depth for searching (100 is the maximum) + /// + private const short SUGGESTION_DEPTH = 80 ; + } } diff --git a/src/managed/OpenLiveWriter.SpellChecker/SpellingConfigReader.cs b/src/managed/OpenLiveWriter.SpellChecker/SpellingConfigReader.cs index bd2d3589..68522397 100644 --- a/src/managed/OpenLiveWriter.SpellChecker/SpellingConfigReader.cs +++ b/src/managed/OpenLiveWriter.SpellChecker/SpellingConfigReader.cs @@ -14,39 +14,38 @@ using OpenLiveWriter.Localization; namespace OpenLiveWriter.SpellChecker { - internal class SpellingConfigReader - { - private static readonly SpellingLanguageEntry[] languages; - private static readonly SpellingCheckerLanguage defaultLanguage; + internal class SpellingConfigReader + { + private static readonly SpellingLanguageEntry[] languages; + private static readonly SpellingCheckerLanguage defaultLanguage; - public static SpellingLanguageEntry[] Languages - { - get { return languages; } - } + public static SpellingLanguageEntry[] Languages + { + get { return languages; } + } - public static SpellingCheckerLanguage DefaultLanguage - { - get { return defaultLanguage; } - } + public static SpellingCheckerLanguage DefaultLanguage + { + get { return defaultLanguage; } + } - - static SpellingConfigReader() - { + static SpellingConfigReader() + { // TODO:OLW - if (languages == null) - { - languages = new SpellingLanguageEntry[] - { - CreateNullDictionaryLanguage() - }; - } - defaultLanguage = SpellingCheckerLanguage.None; - } + if (languages == null) + { + languages = new SpellingLanguageEntry[] + { + CreateNullDictionaryLanguage() + }; + } + defaultLanguage = SpellingCheckerLanguage.None; + } - private static SpellingLanguageEntry CreateNullDictionaryLanguage() - { - return new SpellingLanguageEntry(SpellingCheckerLanguage.None, 0xFFFF, null, new string[0], "", Res.Get(StringId.DictionaryLanguageNone)); - } - } + private static SpellingLanguageEntry CreateNullDictionaryLanguage() + { + return new SpellingLanguageEntry(SpellingCheckerLanguage.None, 0xFFFF, null, new string[0], "", Res.Get(StringId.DictionaryLanguageNone)); + } + } } diff --git a/src/managed/OpenLiveWriter.SpellChecker/SpellingHighlighter.cs b/src/managed/OpenLiveWriter.SpellChecker/SpellingHighlighter.cs index 25a0e56d..b64bac33 100644 --- a/src/managed/OpenLiveWriter.SpellChecker/SpellingHighlighter.cs +++ b/src/managed/OpenLiveWriter.SpellChecker/SpellingHighlighter.cs @@ -14,205 +14,204 @@ using OpenLiveWriter.Mshtml; namespace OpenLiveWriter.SpellChecker { - public class SpellingHighlighter : IDisposable - { + public class SpellingHighlighter : IDisposable + { - static int TIMER_INTERVAL = 10; - static int NUMBER_OF_WORDS_TO_CHECK = 30; + static int TIMER_INTERVAL = 10; + static int NUMBER_OF_WORDS_TO_CHECK = 30; - private ISpellingChecker _spellingChecker ; + private ISpellingChecker _spellingChecker ; - private IHighlightRenderingServicesRaw _highlightRenderingServices; + private IHighlightRenderingServicesRaw _highlightRenderingServices; - private IDisplayServicesRaw _displayServices; + private IDisplayServicesRaw _displayServices; - private IMarkupServicesRaw _markupServicesRaw; + private IMarkupServicesRaw _markupServicesRaw; - private MshtmlMarkupServices _markupServices; + private MshtmlMarkupServices _markupServices; - private IHTMLDocument4 _htmlDocument; + private IHTMLDocument4 _htmlDocument; - private HighlightSegmentTracker _tracker; + private HighlightSegmentTracker _tracker; - private Queue _workerQueue; + private Queue _workerQueue; - private SpellingTimer _timer; + private SpellingTimer _timer; - private bool _fatalSpellingError = false ; + private bool _fatalSpellingError = false ; - public SpellingHighlighter(ISpellingChecker spellingChecker, IHighlightRenderingServicesRaw highlightRenderingServices, - IDisplayServicesRaw displayServices, IMarkupServicesRaw markupServices, IHTMLDocument4 htmlDocument) - { - _spellingChecker = spellingChecker; - _highlightRenderingServices = highlightRenderingServices; - _displayServices = displayServices; - _markupServicesRaw = markupServices; - _markupServices = new MshtmlMarkupServices(_markupServicesRaw); - _htmlDocument = htmlDocument; - _tracker = new HighlightSegmentTracker(); - //the timer to handle interleaving of spell ghecking - _timer = new SpellingTimer(TIMER_INTERVAL); - _timer.Start(); - _timer.Tick += new EventHandler(_timer_Tick); - _workerQueue = new Queue(); + public SpellingHighlighter(ISpellingChecker spellingChecker, IHighlightRenderingServicesRaw highlightRenderingServices, + IDisplayServicesRaw displayServices, IMarkupServicesRaw markupServices, IHTMLDocument4 htmlDocument) + { + _spellingChecker = spellingChecker; + _highlightRenderingServices = highlightRenderingServices; + _displayServices = displayServices; + _markupServicesRaw = markupServices; + _markupServices = new MshtmlMarkupServices(_markupServicesRaw); + _htmlDocument = htmlDocument; + _tracker = new HighlightSegmentTracker(); + //the timer to handle interleaving of spell ghecking + _timer = new SpellingTimer(TIMER_INTERVAL); + _timer.Start(); + _timer.Tick += new EventHandler(_timer_Tick); + _workerQueue = new Queue(); } - /// - /// Check spelling--called by the damage handler - /// - public void CheckSpelling(MshtmlWordRange range) - { - if ( !_fatalSpellingError ) - { - _timer.Enabled = true; - _workerQueue.Enqueue(range); - if (_workerQueue.Count == 1) - { - //if the queue had been empty, process this range right away - DoWork(); - } - } - } + /// + /// Check spelling--called by the damage handler + /// + public void CheckSpelling(MshtmlWordRange range) + { + if ( !_fatalSpellingError ) + { + _timer.Enabled = true; + _workerQueue.Enqueue(range); + if (_workerQueue.Count == 1) + { + //if the queue had been empty, process this range right away + DoWork(); + } + } + } /// /// Prevents asserts that happen within _timer_Tick from going bonkers; since /// they can happen reentrantly, you can end up with hundreds of assert windows. /// - private bool reentrant = false; + private bool reentrant = false; - private void _timer_Tick(object o, EventArgs args) - { + private void _timer_Tick(object o, EventArgs args) + { if (reentrant) return; - reentrant = true; + reentrant = true; - try - { - if (_workerQueue.Count > 0) - { - DoWork(); - } - else - _timer.Enabled = false; - } - catch(Exception ex) - { - UnexpectedErrorMessage.Show(Win32WindowImpl.ForegroundWin32Window, ex, "Unexpected Error Spell Checking"); + try + { + if (_workerQueue.Count > 0) + { + DoWork(); + } + else + _timer.Enabled = false; + } + catch(Exception ex) + { + UnexpectedErrorMessage.Show(Win32WindowImpl.ForegroundWin32Window, ex, "Unexpected Error Spell Checking"); - Reset() ; + Reset() ; - _fatalSpellingError = true ; - } + _fatalSpellingError = true ; + } finally - { - reentrant = false; - } - } + { + reentrant = false; + } + } + //manages the queue during work + private void DoWork() + { + { + //start processing the first word range, and pop it if we get to the end + if (ProcessWordRange((MshtmlWordRange)_workerQueue.Peek())) + _workerQueue.Dequeue(); + } + } - //manages the queue during work - private void DoWork() - { - { - //start processing the first word range, and pop it if we get to the end - if (ProcessWordRange((MshtmlWordRange)_workerQueue.Peek())) - _workerQueue.Dequeue(); - } - } + //iterates through a word range checking for spelling errors + //return: whether the word range is finished (true) or not + private bool ProcessWordRange(MshtmlWordRange wordRange) + { + if (wordRange.CurrentWordRange.Positioned) + { + //track where we will need to clear; + MarkupPointer start = _markupServices.CreateMarkupPointer(); + start.MoveToPointer(wordRange.CurrentWordRange.End); + ArrayList highlightwords = new ArrayList(NUMBER_OF_WORDS_TO_CHECK); - //iterates through a word range checking for spelling errors - //return: whether the word range is finished (true) or not - private bool ProcessWordRange(MshtmlWordRange wordRange) - { - if (wordRange.CurrentWordRange.Positioned) - { - //track where we will need to clear; - MarkupPointer start = _markupServices.CreateMarkupPointer(); - start.MoveToPointer(wordRange.CurrentWordRange.End); - ArrayList highlightwords = new ArrayList(NUMBER_OF_WORDS_TO_CHECK); - - int i = 0; - //to do....the word range is losing its place when it stays in the queue - while (wordRange.HasNext() && i < NUMBER_OF_WORDS_TO_CHECK ) - { - // advance to the next word - wordRange.Next() ; - // check the spelling - int offset, length; - if (ProcessWord(wordRange, out offset, out length)) - { - MarkupRange highlightRange = wordRange.CurrentWordRange.Clone(); - MarkupHelpers.AdjustMarkupRange(ref stagingTextRange, highlightRange, offset, length); + int i = 0; + //to do....the word range is losing its place when it stays in the queue + while (wordRange.HasNext() && i < NUMBER_OF_WORDS_TO_CHECK ) + { + // advance to the next word + wordRange.Next() ; + // check the spelling + int offset, length; + if (ProcessWord(wordRange, out offset, out length)) + { + MarkupRange highlightRange = wordRange.CurrentWordRange.Clone(); + MarkupHelpers.AdjustMarkupRange(ref stagingTextRange, highlightRange, offset, length); //note: cannot just push the current word range here, as it moves before we get to the highlighting step - highlightwords.Add(highlightRange); - } - i++; - } - MarkupPointer end = wordRange.CurrentWordRange.End; + highlightwords.Add(highlightRange); + } + i++; + } + MarkupPointer end = wordRange.CurrentWordRange.End; - //got our words, clear the checked range and then add the misspellings - ClearRange(start, end); - foreach (MarkupRange word in highlightwords) - { - HighlightWordRange(word); - } + //got our words, clear the checked range and then add the misspellings + ClearRange(start, end); + foreach (MarkupRange word in highlightwords) + { + HighlightWordRange(word); + } - return !wordRange.HasNext(); - } - else - return true; - } + return !wordRange.HasNext(); + } + else + return true; + } - //takes one the first word on the range, and checks it for spelling errors - //***returns true if word is misspelled*** - private bool ProcessWord(MshtmlWordRange word, out int offset, out int length) - { - offset = 0; - length = 0; + //takes one the first word on the range, and checks it for spelling errors + //***returns true if word is misspelled*** + private bool ProcessWord(MshtmlWordRange word, out int offset, out int length) + { + offset = 0; + length = 0; - string otherWord = null; - SpellCheckResult result; - string currentWord = word.CurrentWord; + string otherWord = null; + SpellCheckResult result; + string currentWord = word.CurrentWord; if (!word.IsCurrentWordUrlPart() && !WordRangeHelper.ContainsOnlySymbols(currentWord)) - result = _spellingChecker.CheckWord( currentWord, out otherWord, out offset, out length ) ; - else - result = SpellCheckResult.Correct; + result = _spellingChecker.CheckWord( currentWord, out otherWord, out offset, out length ) ; + else + result = SpellCheckResult.Correct; - if (result != SpellCheckResult.Correct) - { - //note: currently using this to not show any errors in smart content, since the fix isn't - // propogated to the underlying data structure - if (!word.FilterApplies()) - { - return true; - } - } - return false; - } + if (result != SpellCheckResult.Correct) + { + //note: currently using this to not show any errors in smart content, since the fix isn't + // propogated to the underlying data structure + if (!word.FilterApplies()) + { + return true; + } + } + return false; + } - private bool ProcessWord(string word) - { - int offset, length; - string otherWord ; - SpellCheckResult result; - result = _spellingChecker.CheckWord( word, out otherWord, out offset, out length ) ; - if (result == SpellCheckResult.Correct) - { - return false; - } - return true; - } + private bool ProcessWord(string word) + { + int offset, length; + string otherWord ; + SpellCheckResult result; + result = _spellingChecker.CheckWord( word, out otherWord, out offset, out length ) ; + if (result == SpellCheckResult.Correct) + { + return false; + } + return true; + } - /// - /// Highlight the current word range - /// - /// - private IHTMLRenderStyle _highlightWordStyle; - IHTMLRenderStyle HighlightWordStyle - { - get - { + /// + /// Highlight the current word range + /// + /// + private IHTMLRenderStyle _highlightWordStyle; + IHTMLRenderStyle HighlightWordStyle + { + get + { if(_highlightWordStyle == null) { _highlightWordStyle = _htmlDocument.createRenderStyle(null); @@ -223,12 +222,12 @@ namespace OpenLiveWriter.SpellChecker _highlightWordStyle.textBackgroundColor = "transparent"; _highlightWordStyle.textColor = "transparent"; } - return _highlightWordStyle; - } - } + return _highlightWordStyle; + } + } - private void HighlightWordRange(MarkupRange word) - { + private void HighlightWordRange(MarkupRange word) + { try { IHighlightSegmentRaw segment; @@ -250,71 +249,71 @@ namespace OpenLiveWriter.SpellChecker return; throw; } - } + } - private IHTMLTxtRange stagingTextRange; + private IHTMLTxtRange stagingTextRange; - //remove any covered segments from the tracker and clear their highlights - public void ClearRange(MarkupPointer start, MarkupPointer end) - { - IHighlightSegmentRaw[] segments = - _tracker.GetSegments(start.PointerRaw, end.PointerRaw); - if (segments != null) - { - for (int i = 0; i < segments.Length; i++) - { - _highlightRenderingServices.RemoveSegment(segments[i]); - } - } - } + //remove any covered segments from the tracker and clear their highlights + public void ClearRange(MarkupPointer start, MarkupPointer end) + { + IHighlightSegmentRaw[] segments = + _tracker.GetSegments(start.PointerRaw, end.PointerRaw); + if (segments != null) + { + for (int i = 0; i < segments.Length; i++) + { + _highlightRenderingServices.RemoveSegment(segments[i]); + } + } + } - //remove all misspellings from tracker and clear their highlights - //used when turning spell checking on and off - public void Reset() - { - _timer.Enabled = false; - stagingTextRange = null; - _workerQueue.Clear(); - IHighlightSegmentRaw[] allWords = _tracker.ClearAllSegments(); - for (int i = 0; i < allWords.Length; i++) - { - _highlightRenderingServices.RemoveSegment(allWords[i]); - } - } + //remove all misspellings from tracker and clear their highlights + //used when turning spell checking on and off + public void Reset() + { + _timer.Enabled = false; + stagingTextRange = null; + _workerQueue.Clear(); + IHighlightSegmentRaw[] allWords = _tracker.ClearAllSegments(); + for (int i = 0; i < allWords.Length; i++) + { + _highlightRenderingServices.RemoveSegment(allWords[i]); + } + } - //used for ignore all, add to dictionary to remove highlights from new word - public void UnhighlightWord(string word) - { - HighlightSegmentTracker.MatchingSegment[] relevantHighlights = _tracker.GetSegments(word, new HighlightSegmentTracker.CheckWordSpelling(ProcessWord)); - for (int i = 0; i < relevantHighlights.Length; i++) - { - HighlightSegmentTracker.MatchingSegment segment = relevantHighlights[i]; - _highlightRenderingServices.RemoveSegment(segment._segment); - _tracker.RemoveSegment(segment._pointer); - } - } + //used for ignore all, add to dictionary to remove highlights from new word + public void UnhighlightWord(string word) + { + HighlightSegmentTracker.MatchingSegment[] relevantHighlights = _tracker.GetSegments(word, new HighlightSegmentTracker.CheckWordSpelling(ProcessWord)); + for (int i = 0; i < relevantHighlights.Length; i++) + { + HighlightSegmentTracker.MatchingSegment segment = relevantHighlights[i]; + _highlightRenderingServices.RemoveSegment(segment._segment); + _tracker.RemoveSegment(segment._pointer); + } + } - public MisspelledWordInfo FindMisspelling(MarkupPointer markupPointer) - { - return _tracker.FindSegment(_markupServices, markupPointer.PointerRaw); - } + public MisspelledWordInfo FindMisspelling(MarkupPointer markupPointer) + { + return _tracker.FindSegment(_markupServices, markupPointer.PointerRaw); + } - #region IDisposable Members + #region IDisposable Members - public void Dispose() - { - _timer.Stop(); - if (_tracker != null) - _tracker = null; - if (_workerQueue != null) - _workerQueue = null; - } + public void Dispose() + { + _timer.Stop(); + if (_tracker != null) + _tracker = null; + if (_workerQueue != null) + _workerQueue = null; + } - #endregion + #endregion - public void UnhighlightRange(MarkupRange range) - { - IHighlightSegmentRaw[] segments = _tracker.GetSegments(range.Start.PointerRaw, range.End.PointerRaw); + public void UnhighlightRange(MarkupRange range) + { + IHighlightSegmentRaw[] segments = _tracker.GetSegments(range.Start.PointerRaw, range.End.PointerRaw); if (segments == null) { @@ -324,6 +323,6 @@ namespace OpenLiveWriter.SpellChecker foreach (IHighlightSegmentRaw segment in segments) _highlightRenderingServices.RemoveSegment(segment); - } - } + } + } } diff --git a/src/managed/OpenLiveWriter.SpellChecker/SpellingPreferencesPanel.cs b/src/managed/OpenLiveWriter.SpellChecker/SpellingPreferencesPanel.cs index 87a2052d..cff70caa 100644 --- a/src/managed/OpenLiveWriter.SpellChecker/SpellingPreferencesPanel.cs +++ b/src/managed/OpenLiveWriter.SpellChecker/SpellingPreferencesPanel.cs @@ -144,7 +144,6 @@ namespace OpenLiveWriter.SpellChecker LayoutHelper.FixupGroupBox(8, _groupBoxGeneralOptions); } - /// /// Save data /// diff --git a/src/managed/OpenLiveWriter.SpellChecker/SpellingSettings.cs b/src/managed/OpenLiveWriter.SpellChecker/SpellingSettings.cs index 71eb9470..64cf9240 100644 --- a/src/managed/OpenLiveWriter.SpellChecker/SpellingSettings.cs +++ b/src/managed/OpenLiveWriter.SpellChecker/SpellingSettings.cs @@ -158,7 +158,6 @@ namespace OpenLiveWriter.SpellChecker private const string IGNORE_UPPERCASE = "IgnoreUppercase"; private const bool IGNORE_UPPERCASE_DEFAULT = true; - /// /// Ignore words with numbers /// diff --git a/src/managed/OpenLiveWriter.SpellChecker/SpellingTimer.cs b/src/managed/OpenLiveWriter.SpellChecker/SpellingTimer.cs index 3d197f0c..b578168f 100644 --- a/src/managed/OpenLiveWriter.SpellChecker/SpellingTimer.cs +++ b/src/managed/OpenLiveWriter.SpellChecker/SpellingTimer.cs @@ -5,11 +5,11 @@ using System; namespace OpenLiveWriter.SpellChecker { - public class SpellingTimer : System.Windows.Forms.Timer - { - public SpellingTimer(int interval) - { - Interval = interval; - } - } + public class SpellingTimer : System.Windows.Forms.Timer + { + public SpellingTimer(int interval) + { + Interval = interval; + } + } } diff --git a/src/managed/OpenLiveWriter.SpellChecker/TextBoxWordRange.cs b/src/managed/OpenLiveWriter.SpellChecker/TextBoxWordRange.cs index afc3889c..788fc1e1 100644 --- a/src/managed/OpenLiveWriter.SpellChecker/TextBoxWordRange.cs +++ b/src/managed/OpenLiveWriter.SpellChecker/TextBoxWordRange.cs @@ -9,175 +9,175 @@ using OpenLiveWriter.Mshtml; namespace OpenLiveWriter.SpellChecker { - /// - /// IWordRange implementation for Windows Forms text boxes. - /// - public class TextBoxWordRange : IWordRange - { - private readonly TextBox textBox; + /// + /// IWordRange implementation for Windows Forms text boxes. + /// + public class TextBoxWordRange : IWordRange + { + private readonly TextBox textBox; - // pointer for start of current word. - private int startPos; + // pointer for start of current word. + private int startPos; - // pointer for end of current word. - private int endPos; + // pointer for end of current word. + private int endPos; - private bool highlighted; - private string text; + private bool highlighted; + private string text; - // the index of the end of the textbox or selection. - private int limit; + // the index of the end of the textbox or selection. + private int limit; - public TextBoxWordRange(TextBox textBox, bool respectExistingSelection) - { - this.textBox = textBox; - this.text = textBox.Text; + public TextBoxWordRange(TextBox textBox, bool respectExistingSelection) + { + this.textBox = textBox; + this.text = textBox.Text; - this.startPos = -1; - if (textBox.SelectionLength == 0 || !respectExistingSelection) - { - this.endPos = 0; - this.limit = textBox.TextLength; - } - else - { - this.endPos = StartPosForSelection(textBox.SelectionStart); - this.limit = textBox.SelectionStart + textBox.SelectionLength; - } + this.startPos = -1; + if (textBox.SelectionLength == 0 || !respectExistingSelection) + { + this.endPos = 0; + this.limit = textBox.TextLength; + } + else + { + this.endPos = StartPosForSelection(textBox.SelectionStart); + this.limit = textBox.SelectionStart + textBox.SelectionLength; + } - this.highlighted = false; - } + this.highlighted = false; + } - /// - /// Is there another word in the range? - /// - /// true if there is another word in the range - public bool HasNext() - { - return NextWordStart() != -1; - } + /// + /// Is there another word in the range? + /// + /// true if there is another word in the range + public bool HasNext() + { + return NextWordStart() != -1; + } - /// - /// Advance to the next word in the range - /// - public void Next() - { - startPos = NextWordStart(); - endPos = FindEndOfWord(startPos); - } + /// + /// Advance to the next word in the range + /// + public void Next() + { + startPos = NextWordStart(); + endPos = FindEndOfWord(startPos); + } - /// - /// Get the current word - /// - public string CurrentWord - { - get - { - return text.Substring(startPos, endPos - startPos); - } - } + /// + /// Get the current word + /// + public string CurrentWord + { + get + { + return text.Substring(startPos, endPos - startPos); + } + } - public void PlaceCursor() - { - textBox.SelectionStart = endPos; - textBox.SelectionLength = 0; - } + public void PlaceCursor() + { + textBox.SelectionStart = endPos; + textBox.SelectionLength = 0; + } - /// - /// Highlight the current word - /// - public void Highlight(int offset, int length) - { - textBox.SelectionStart = startPos + offset; - textBox.SelectionLength = length; - highlighted = true; - } + /// + /// Highlight the current word + /// + public void Highlight(int offset, int length) + { + textBox.SelectionStart = startPos + offset; + textBox.SelectionLength = length; + highlighted = true; + } - /// - /// Remove highlighting from the range - /// - public void RemoveHighlight() - { - textBox.SelectionLength = 0; - } + /// + /// Remove highlighting from the range + /// + public void RemoveHighlight() + { + textBox.SelectionLength = 0; + } - /// - /// Replace the current word - /// - /// text to replace word with - public void Replace(int offset, int length, string newText ) - { - text = text.Substring(0, startPos) + StringHelper.Replace(CurrentWord, offset, length, newText) + text.Substring(endPos); + /// + /// Replace the current word + /// + /// text to replace word with + public void Replace(int offset, int length, string newText ) + { + text = text.Substring(0, startPos) + StringHelper.Replace(CurrentWord, offset, length, newText) + text.Substring(endPos); - int delta = newText.Length - (endPos - startPos); - limit += delta; - endPos += delta; + int delta = newText.Length - (endPos - startPos); + limit += delta; + endPos += delta; - textBox.Text = text; + textBox.Text = text; - textBox.SelectionStart = startPos; - textBox.SelectionLength = highlighted ? endPos - startPos : 0; - } + textBox.SelectionStart = startPos; + textBox.SelectionLength = highlighted ? endPos - startPos : 0; + } - public bool IsCurrentWordUrlPart() - { - return false; - } + public bool IsCurrentWordUrlPart() + { + return false; + } - public bool FilterApplies() - { - return false; - } + public bool FilterApplies() + { + return false; + } public bool FilterAppliesRanged(int offset, int length) - { - return false; - } + { + return false; + } - private int StartPosForSelection(int selectionStart) - { - if (selectionStart == 0) - return 0; + private int StartPosForSelection(int selectionStart) + { + if (selectionStart == 0) + return 0; - if (!(IsWordChar(text[selectionStart - 1]) && IsWordChar(text[selectionStart]))) - return selectionStart; + if (!(IsWordChar(text[selectionStart - 1]) && IsWordChar(text[selectionStart]))) + return selectionStart; - int lastNonWord = 0; - for (int i = 0; i < selectionStart; i++) - { - if (!IsWordChar(text[i])) - lastNonWord = i; - } - return lastNonWord + 1; - } + int lastNonWord = 0; + for (int i = 0; i < selectionStart; i++) + { + if (!IsWordChar(text[i])) + lastNonWord = i; + } + return lastNonWord + 1; + } - private int NextWordStart() - { - for (int i = endPos; i < limit; i++) - { - if (IsWordChar(text[i])) - return i; - } - return -1; - } + private int NextWordStart() + { + for (int i = endPos; i < limit; i++) + { + if (IsWordChar(text[i])) + return i; + } + return -1; + } - private int FindEndOfWord(int startIndex) - { - if (startIndex == -1 || startIndex >= limit) - return -1; + private int FindEndOfWord(int startIndex) + { + if (startIndex == -1 || startIndex >= limit) + return -1; - Trace.Assert(IsWordChar(text[startIndex]), "Asked to find end of word starting from invalid char " + text[startIndex]); + Trace.Assert(IsWordChar(text[startIndex]), "Asked to find end of word starting from invalid char " + text[startIndex]); - for (int i = startIndex + 1; i < text.Length; i++) - { - if (!IsWordChar(text[i])) - return i; - } - return text.Length; - } + for (int i = startIndex + 1; i < text.Length; i++) + { + if (!IsWordChar(text[i])) + return i; + } + return text.Length; + } - private bool IsWordChar(char c) - { - return char.IsLetterOrDigit(c) || c == '\''; - } - } + private bool IsWordChar(char c) + { + return char.IsLetterOrDigit(c) || c == '\''; + } + } } diff --git a/src/managed/OpenLiveWriter/ApplicationMain.cs b/src/managed/OpenLiveWriter/ApplicationMain.cs index 34bc5701..2cd1bc2b 100644 --- a/src/managed/OpenLiveWriter/ApplicationMain.cs +++ b/src/managed/OpenLiveWriter/ApplicationMain.cs @@ -109,7 +109,6 @@ namespace OpenLiveWriter UrlMon.CoInternetSetFeatureEnabled(FEATURE.DISABLE_NAVIGATION_SOUNDS, INTERNETSETFEATURE.ON_PROCESS, true); } - private static void LoadCulture(string cultureName) { try diff --git a/src/managed/OpenLiveWriter/PaintingTestForm.cs b/src/managed/OpenLiveWriter/PaintingTestForm.cs index d91164ce..c917147d 100644 --- a/src/managed/OpenLiveWriter/PaintingTestForm.cs +++ b/src/managed/OpenLiveWriter/PaintingTestForm.cs @@ -14,270 +14,263 @@ namespace OpenLiveWriter { + /// + /// Summary description for PaintingTestForm. + /// + public class PaintingTestForm : Form + { - /// - /// Summary description for PaintingTestForm. - /// - public class PaintingTestForm : Form - { + class TransparentLinkLabel : LinkLabel + { + public TransparentLinkLabel() + { + SetStyle(ControlStyles.SupportsTransparentBackColor, true); + BackColor = Color.Transparent ; + FlatStyle = FlatStyle.System ; + Cursor = Cursors.Hand ; + LinkBehavior = LinkBehavior.HoverUnderline ; + } - class TransparentLinkLabel : LinkLabel - { - public TransparentLinkLabel() - { - SetStyle(ControlStyles.SupportsTransparentBackColor, true); - BackColor = Color.Transparent ; - FlatStyle = FlatStyle.System ; - Cursor = Cursors.Hand ; - LinkBehavior = LinkBehavior.HoverUnderline ; - } + } + + class TransparentLabel : Label + { + public TransparentLabel() + { + SetStyle(ControlStyles.SupportsTransparentBackColor, true); + BackColor = Color.Transparent ; + } + + } + + private TransparentLinkLabel linkLabel1; + private OpenLiveWriter.PaintingTestForm.TransparentLinkLabel transparentLinkLabel1; + private OpenLiveWriter.PaintingTestForm.TransparentLinkLabel transparentLinkLabel2; + private OpenLiveWriter.PaintingTestForm.TransparentLinkLabel transparentLinkLabel3; + private OpenLiveWriter.PaintingTestForm.TransparentLinkLabel transparentLinkLabel4; + private OpenLiveWriter.PaintingTestForm.TransparentLinkLabel transparentLinkLabel5; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Button button2; + /// + /// Required designer variable. + /// + private System.ComponentModel.Container components = null; + + public static void Main(string[] args) + { + Application.Run(new PaintingTestForm()); + } + + public PaintingTestForm() + { + // + // Required for Windows Form Designer support + // + InitializeComponent(); - } + // Turn off CS_CLIPCHILDREN. + //User32.SetWindowLong(Handle, GWL.STYLE, User32.GetWindowLong(Handle, GWL.STYLE) & ~WS.CLIPCHILDREN); - class TransparentLabel : Label - { - public TransparentLabel() - { - SetStyle(ControlStyles.SupportsTransparentBackColor, true); - BackColor = Color.Transparent ; - } + // Turn on double buffered painting. + SetStyle(ControlStyles.UserPaint, true); + SetStyle(ControlStyles.DoubleBuffer, true); + SetStyle(ControlStyles.AllPaintingInWmPaint, true); + + } + + protected override void OnSizeChanged(EventArgs e) + { + base.OnSizeChanged (e); + Invalidate(); + } + + /* + protected override void OnPaintBackground(PaintEventArgs pevent) + { + + } + */ - } + protected override void OnPaint(PaintEventArgs e) + { + // paint background + using ( Brush brush = new LinearGradientBrush(ClientRectangle, ApplicationManager.ApplicationStyle.PrimaryWorkspaceCommandBarTopColor, ApplicationManager.ApplicationStyle.PrimaryWorkspaceCommandBarBottomColor, LinearGradientMode.Vertical)) + e.Graphics.FillRectangle(brush, ClientRectangle); - private TransparentLinkLabel linkLabel1; - private OpenLiveWriter.PaintingTestForm.TransparentLinkLabel transparentLinkLabel1; - private OpenLiveWriter.PaintingTestForm.TransparentLinkLabel transparentLinkLabel2; - private OpenLiveWriter.PaintingTestForm.TransparentLinkLabel transparentLinkLabel3; - private OpenLiveWriter.PaintingTestForm.TransparentLinkLabel transparentLinkLabel4; - private OpenLiveWriter.PaintingTestForm.TransparentLinkLabel transparentLinkLabel5; - private System.Windows.Forms.Button button1; - private System.Windows.Forms.Button button2; - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; + // paint headers + using ( Brush brush = new SolidBrush(ForeColor) ) + { + e.Graphics.DrawString("Header1", Font, brush, linkLabel1.Left, linkLabel1.Top - 20) ; - public static void Main(string[] args) - { - Application.Run(new PaintingTestForm()); - } + e.Graphics.DrawString("Header2", Font, brush, transparentLinkLabel5.Left, transparentLinkLabel5.Top - 20) ; + } - public PaintingTestForm() - { - // - // Required for Windows Form Designer support - // - InitializeComponent(); + } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } + #region Windows Form Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.linkLabel1 = new OpenLiveWriter.PaintingTestForm.TransparentLinkLabel(); + this.transparentLinkLabel1 = new OpenLiveWriter.PaintingTestForm.TransparentLinkLabel(); + this.transparentLinkLabel2 = new OpenLiveWriter.PaintingTestForm.TransparentLinkLabel(); + this.transparentLinkLabel3 = new OpenLiveWriter.PaintingTestForm.TransparentLinkLabel(); + this.transparentLinkLabel4 = new OpenLiveWriter.PaintingTestForm.TransparentLinkLabel(); + this.transparentLinkLabel5 = new OpenLiveWriter.PaintingTestForm.TransparentLinkLabel(); + this.button1 = new System.Windows.Forms.Button(); + this.button2 = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // linkLabel1 + // + this.linkLabel1.BackColor = System.Drawing.Color.Transparent; + this.linkLabel1.Cursor = System.Windows.Forms.Cursors.Hand; + this.linkLabel1.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.linkLabel1.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline; + this.linkLabel1.Location = new System.Drawing.Point(64, 56); + this.linkLabel1.Name = "linkLabel1"; + this.linkLabel1.Size = new System.Drawing.Size(120, 24); + this.linkLabel1.TabIndex = 0; + this.linkLabel1.TabStop = true; + this.linkLabel1.Text = "linkLabel1"; + // + // transparentLinkLabel1 + // + this.transparentLinkLabel1.BackColor = System.Drawing.Color.Transparent; + this.transparentLinkLabel1.Cursor = System.Windows.Forms.Cursors.Hand; + this.transparentLinkLabel1.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.transparentLinkLabel1.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline; + this.transparentLinkLabel1.Location = new System.Drawing.Point(64, 80); + this.transparentLinkLabel1.Name = "transparentLinkLabel1"; + this.transparentLinkLabel1.Size = new System.Drawing.Size(120, 24); + this.transparentLinkLabel1.TabIndex = 1; + this.transparentLinkLabel1.TabStop = true; + this.transparentLinkLabel1.Text = "transparentLinkLabel1"; + // + // transparentLinkLabel2 + // + this.transparentLinkLabel2.BackColor = System.Drawing.Color.Transparent; + this.transparentLinkLabel2.Cursor = System.Windows.Forms.Cursors.Hand; + this.transparentLinkLabel2.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.transparentLinkLabel2.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline; + this.transparentLinkLabel2.Location = new System.Drawing.Point(64, 104); + this.transparentLinkLabel2.Name = "transparentLinkLabel2"; + this.transparentLinkLabel2.TabIndex = 0; + this.transparentLinkLabel2.TabStop = true; + this.transparentLinkLabel2.Text = "last label"; + // + // transparentLinkLabel3 + // + this.transparentLinkLabel3.BackColor = System.Drawing.Color.Transparent; + this.transparentLinkLabel3.Cursor = System.Windows.Forms.Cursors.Hand; + this.transparentLinkLabel3.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.transparentLinkLabel3.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline; + this.transparentLinkLabel3.Location = new System.Drawing.Point(64, 208); + this.transparentLinkLabel3.Name = "transparentLinkLabel3"; + this.transparentLinkLabel3.TabIndex = 3; + this.transparentLinkLabel3.TabStop = true; + this.transparentLinkLabel3.Text = "last label"; + // + // transparentLinkLabel4 + // + this.transparentLinkLabel4.BackColor = System.Drawing.Color.Transparent; + this.transparentLinkLabel4.Cursor = System.Windows.Forms.Cursors.Hand; + this.transparentLinkLabel4.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.transparentLinkLabel4.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline; + this.transparentLinkLabel4.Location = new System.Drawing.Point(64, 184); + this.transparentLinkLabel4.Name = "transparentLinkLabel4"; + this.transparentLinkLabel4.Size = new System.Drawing.Size(120, 24); + this.transparentLinkLabel4.TabIndex = 4; + this.transparentLinkLabel4.TabStop = true; + this.transparentLinkLabel4.Text = "transparentLinkLabel4"; + // + // transparentLinkLabel5 + // + this.transparentLinkLabel5.BackColor = System.Drawing.Color.Transparent; + this.transparentLinkLabel5.Cursor = System.Windows.Forms.Cursors.Hand; + this.transparentLinkLabel5.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.transparentLinkLabel5.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline; + this.transparentLinkLabel5.Location = new System.Drawing.Point(64, 160); + this.transparentLinkLabel5.Name = "transparentLinkLabel5"; + this.transparentLinkLabel5.TabIndex = 5; + this.transparentLinkLabel5.TabStop = true; + this.transparentLinkLabel5.Text = "label5"; + // + // button1 + // + this.button1.Location = new System.Drawing.Point(216, 96); + this.button1.Name = "button1"; + this.button1.TabIndex = 6; + this.button1.Text = "Show"; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // button2 + // + this.button2.Location = new System.Drawing.Point(216, 128); + this.button2.Name = "button2"; + this.button2.TabIndex = 7; + this.button2.Text = "Hide"; + this.button2.Click += new System.EventHandler(this.button2_Click); + // + // PaintingTestForm + // + this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); + this.ClientSize = new System.Drawing.Size(304, 266); + this.Controls.Add(this.button2); + this.Controls.Add(this.button1); + this.Controls.Add(this.transparentLinkLabel3); + this.Controls.Add(this.transparentLinkLabel4); + this.Controls.Add(this.transparentLinkLabel5); + this.Controls.Add(this.transparentLinkLabel2); + this.Controls.Add(this.transparentLinkLabel1); + this.Controls.Add(this.linkLabel1); + this.Name = "PaintingTestForm"; + this.Text = "PaintingTestForm"; + this.ResumeLayout(false); - // Turn off CS_CLIPCHILDREN. - //User32.SetWindowLong(Handle, GWL.STYLE, User32.GetWindowLong(Handle, GWL.STYLE) & ~WS.CLIPCHILDREN); + } + #endregion - // Turn on double buffered painting. - SetStyle(ControlStyles.UserPaint, true); - SetStyle(ControlStyles.DoubleBuffer, true); - SetStyle(ControlStyles.AllPaintingInWmPaint, true); + private void button1_Click(object sender, System.EventArgs e) + { + transparentLinkLabel1.Visible = true ; + transparentLinkLabel2.Top += transparentLinkLabel1.Height ; + transparentLinkLabel3.Top += transparentLinkLabel1.Height ; + transparentLinkLabel4.Top += transparentLinkLabel1.Height ; + transparentLinkLabel5.Top += transparentLinkLabel1.Height ; + Invalidate(false); - } + } - protected override void OnSizeChanged(EventArgs e) - { - base.OnSizeChanged (e); - Invalidate(); - } + private void button2_Click(object sender, System.EventArgs e) + { - /* - protected override void OnPaintBackground(PaintEventArgs pevent) - { - - } - */ - - - - protected override void OnPaint(PaintEventArgs e) - { - // paint background - using ( Brush brush = new LinearGradientBrush(ClientRectangle, ApplicationManager.ApplicationStyle.PrimaryWorkspaceCommandBarTopColor, ApplicationManager.ApplicationStyle.PrimaryWorkspaceCommandBarBottomColor, LinearGradientMode.Vertical)) - e.Graphics.FillRectangle(brush, ClientRectangle); - - // paint headers - using ( Brush brush = new SolidBrush(ForeColor) ) - { - e.Graphics.DrawString("Header1", Font, brush, linkLabel1.Left, linkLabel1.Top - 20) ; - - e.Graphics.DrawString("Header2", Font, brush, transparentLinkLabel5.Left, transparentLinkLabel5.Top - 20) ; - } - - - } - - - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } - - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.linkLabel1 = new OpenLiveWriter.PaintingTestForm.TransparentLinkLabel(); - this.transparentLinkLabel1 = new OpenLiveWriter.PaintingTestForm.TransparentLinkLabel(); - this.transparentLinkLabel2 = new OpenLiveWriter.PaintingTestForm.TransparentLinkLabel(); - this.transparentLinkLabel3 = new OpenLiveWriter.PaintingTestForm.TransparentLinkLabel(); - this.transparentLinkLabel4 = new OpenLiveWriter.PaintingTestForm.TransparentLinkLabel(); - this.transparentLinkLabel5 = new OpenLiveWriter.PaintingTestForm.TransparentLinkLabel(); - this.button1 = new System.Windows.Forms.Button(); - this.button2 = new System.Windows.Forms.Button(); - this.SuspendLayout(); - // - // linkLabel1 - // - this.linkLabel1.BackColor = System.Drawing.Color.Transparent; - this.linkLabel1.Cursor = System.Windows.Forms.Cursors.Hand; - this.linkLabel1.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.linkLabel1.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline; - this.linkLabel1.Location = new System.Drawing.Point(64, 56); - this.linkLabel1.Name = "linkLabel1"; - this.linkLabel1.Size = new System.Drawing.Size(120, 24); - this.linkLabel1.TabIndex = 0; - this.linkLabel1.TabStop = true; - this.linkLabel1.Text = "linkLabel1"; - // - // transparentLinkLabel1 - // - this.transparentLinkLabel1.BackColor = System.Drawing.Color.Transparent; - this.transparentLinkLabel1.Cursor = System.Windows.Forms.Cursors.Hand; - this.transparentLinkLabel1.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.transparentLinkLabel1.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline; - this.transparentLinkLabel1.Location = new System.Drawing.Point(64, 80); - this.transparentLinkLabel1.Name = "transparentLinkLabel1"; - this.transparentLinkLabel1.Size = new System.Drawing.Size(120, 24); - this.transparentLinkLabel1.TabIndex = 1; - this.transparentLinkLabel1.TabStop = true; - this.transparentLinkLabel1.Text = "transparentLinkLabel1"; - // - // transparentLinkLabel2 - // - this.transparentLinkLabel2.BackColor = System.Drawing.Color.Transparent; - this.transparentLinkLabel2.Cursor = System.Windows.Forms.Cursors.Hand; - this.transparentLinkLabel2.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.transparentLinkLabel2.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline; - this.transparentLinkLabel2.Location = new System.Drawing.Point(64, 104); - this.transparentLinkLabel2.Name = "transparentLinkLabel2"; - this.transparentLinkLabel2.TabIndex = 0; - this.transparentLinkLabel2.TabStop = true; - this.transparentLinkLabel2.Text = "last label"; - // - // transparentLinkLabel3 - // - this.transparentLinkLabel3.BackColor = System.Drawing.Color.Transparent; - this.transparentLinkLabel3.Cursor = System.Windows.Forms.Cursors.Hand; - this.transparentLinkLabel3.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.transparentLinkLabel3.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline; - this.transparentLinkLabel3.Location = new System.Drawing.Point(64, 208); - this.transparentLinkLabel3.Name = "transparentLinkLabel3"; - this.transparentLinkLabel3.TabIndex = 3; - this.transparentLinkLabel3.TabStop = true; - this.transparentLinkLabel3.Text = "last label"; - // - // transparentLinkLabel4 - // - this.transparentLinkLabel4.BackColor = System.Drawing.Color.Transparent; - this.transparentLinkLabel4.Cursor = System.Windows.Forms.Cursors.Hand; - this.transparentLinkLabel4.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.transparentLinkLabel4.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline; - this.transparentLinkLabel4.Location = new System.Drawing.Point(64, 184); - this.transparentLinkLabel4.Name = "transparentLinkLabel4"; - this.transparentLinkLabel4.Size = new System.Drawing.Size(120, 24); - this.transparentLinkLabel4.TabIndex = 4; - this.transparentLinkLabel4.TabStop = true; - this.transparentLinkLabel4.Text = "transparentLinkLabel4"; - // - // transparentLinkLabel5 - // - this.transparentLinkLabel5.BackColor = System.Drawing.Color.Transparent; - this.transparentLinkLabel5.Cursor = System.Windows.Forms.Cursors.Hand; - this.transparentLinkLabel5.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.transparentLinkLabel5.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline; - this.transparentLinkLabel5.Location = new System.Drawing.Point(64, 160); - this.transparentLinkLabel5.Name = "transparentLinkLabel5"; - this.transparentLinkLabel5.TabIndex = 5; - this.transparentLinkLabel5.TabStop = true; - this.transparentLinkLabel5.Text = "label5"; - // - // button1 - // - this.button1.Location = new System.Drawing.Point(216, 96); - this.button1.Name = "button1"; - this.button1.TabIndex = 6; - this.button1.Text = "Show"; - this.button1.Click += new System.EventHandler(this.button1_Click); - // - // button2 - // - this.button2.Location = new System.Drawing.Point(216, 128); - this.button2.Name = "button2"; - this.button2.TabIndex = 7; - this.button2.Text = "Hide"; - this.button2.Click += new System.EventHandler(this.button2_Click); - // - // PaintingTestForm - // - this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); - this.ClientSize = new System.Drawing.Size(304, 266); - this.Controls.Add(this.button2); - this.Controls.Add(this.button1); - this.Controls.Add(this.transparentLinkLabel3); - this.Controls.Add(this.transparentLinkLabel4); - this.Controls.Add(this.transparentLinkLabel5); - this.Controls.Add(this.transparentLinkLabel2); - this.Controls.Add(this.transparentLinkLabel1); - this.Controls.Add(this.linkLabel1); - this.Name = "PaintingTestForm"; - this.Text = "PaintingTestForm"; - this.ResumeLayout(false); - - } - #endregion - - private void button1_Click(object sender, System.EventArgs e) - { - transparentLinkLabel1.Visible = true ; - transparentLinkLabel2.Top += transparentLinkLabel1.Height ; - transparentLinkLabel3.Top += transparentLinkLabel1.Height ; - transparentLinkLabel4.Top += transparentLinkLabel1.Height ; - transparentLinkLabel5.Top += transparentLinkLabel1.Height ; - Invalidate(false); - - } - - private void button2_Click(object sender, System.EventArgs e) - { - - transparentLinkLabel1.Visible = false ; - transparentLinkLabel2.Top -= transparentLinkLabel1.Height ; - transparentLinkLabel3.Top -= transparentLinkLabel1.Height ; - transparentLinkLabel4.Top -= transparentLinkLabel1.Height ; - transparentLinkLabel5.Top -= transparentLinkLabel1.Height ; - Invalidate(false); - } - } + transparentLinkLabel1.Visible = false ; + transparentLinkLabel2.Top -= transparentLinkLabel1.Height ; + transparentLinkLabel3.Top -= transparentLinkLabel1.Height ; + transparentLinkLabel4.Top -= transparentLinkLabel1.Height ; + transparentLinkLabel5.Top -= transparentLinkLabel1.Height ; + Invalidate(false); + } + } } diff --git a/src/managed/OpenLiveWriter/TestAutoDetection.cs b/src/managed/OpenLiveWriter/TestAutoDetection.cs index 688bbe57..4168bfc4 100644 --- a/src/managed/OpenLiveWriter/TestAutoDetection.cs +++ b/src/managed/OpenLiveWriter/TestAutoDetection.cs @@ -17,243 +17,242 @@ using OpenLiveWriter.Api.BlogClient ; namespace OpenLiveWriter { - /// - /// Summary description for TestAutoDetection. - /// - public class TestAutoDetection : System.Windows.Forms.Form - { + /// + /// Summary description for TestAutoDetection. + /// + public class TestAutoDetection : System.Windows.Forms.Form + { - [STAThread] - public static void Main(string[] args ) - { - ApplicationEnvironment.Initialize(); - Application.Run( new TestAutoDetection() ) ; - } + [STAThread] + public static void Main(string[] args ) + { + ApplicationEnvironment.Initialize(); + Application.Run( new TestAutoDetection() ) ; + } - private System.Windows.Forms.Label label2; - private System.Windows.Forms.Label label3; - private System.Windows.Forms.Label label4; - private System.Windows.Forms.TextBox textBoxResults; - private System.Windows.Forms.Button buttonAutoDetectWeblog; - private System.Windows.Forms.TextBox textBoxPassword; - private System.Windows.Forms.TextBox textBoxUsername; - private OpenLiveWriter.PostEditor.Configuration.WeblogHomepageUrlControl weblogHomepageUrlControl; - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.TextBox textBoxResults; + private System.Windows.Forms.Button buttonAutoDetectWeblog; + private System.Windows.Forms.TextBox textBoxPassword; + private System.Windows.Forms.TextBox textBoxUsername; + private OpenLiveWriter.PostEditor.Configuration.WeblogHomepageUrlControl weblogHomepageUrlControl; + /// + /// Required designer variable. + /// + private System.ComponentModel.Container components = null; - public TestAutoDetection() - { - // - // Required for Windows Form Designer support - // - InitializeComponent(); + public TestAutoDetection() + { + // + // Required for Windows Form Designer support + // + InitializeComponent(); - // - // TODO: Add any constructor code after InitializeComponent call - // - textBoxPassword.PasswordChar = (char) 0x25cf; - } + // + // TODO: Add any constructor code after InitializeComponent call + // + textBoxPassword.PasswordChar = (char) 0x25cf; + } - protected override void OnLoad(EventArgs e) - { - base.OnLoad(e); + protected override void OnLoad(EventArgs e) + { + base.OnLoad(e); - textBoxUsername.Text = settings.GetString("Username", String.Empty) ; - textBoxPassword.Text = settings.GetString("Password", String.Empty ); - weblogHomepageUrlControl.HomepageUrl = settings.GetString("WeblogUrl", String.Empty); - } + textBoxUsername.Text = settings.GetString("Username", String.Empty) ; + textBoxPassword.Text = settings.GetString("Password", String.Empty ); + weblogHomepageUrlControl.HomepageUrl = settings.GetString("WeblogUrl", String.Empty); + } - protected override void OnClosing(CancelEventArgs e) - { - base.OnClosing (e); + protected override void OnClosing(CancelEventArgs e) + { + base.OnClosing (e); - settings.SetString( "Username", textBoxUsername.Text ); - settings.SetString( "Password", textBoxPassword.Text ); - settings.SetString( "WeblogUrl", weblogHomepageUrlControl.HomepageUrl); - } + settings.SetString( "Username", textBoxUsername.Text ); + settings.SetString( "Password", textBoxPassword.Text ); + settings.SetString( "WeblogUrl", weblogHomepageUrlControl.HomepageUrl); + } - private SettingsPersisterHelper settings = ApplicationEnvironment.UserSettingsRoot.GetSubSettings("AutoDetectionTest"); + private SettingsPersisterHelper settings = ApplicationEnvironment.UserSettingsRoot.GetSubSettings("AutoDetectionTest"); - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.label2 = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); - this.textBoxPassword = new System.Windows.Forms.TextBox(); - this.textBoxUsername = new System.Windows.Forms.TextBox(); - this.label4 = new System.Windows.Forms.Label(); - this.weblogHomepageUrlControl = new OpenLiveWriter.PostEditor.Configuration.WeblogHomepageUrlControl(); - this.buttonAutoDetectWeblog = new System.Windows.Forms.Button(); - this.textBoxResults = new System.Windows.Forms.TextBox(); - this.SuspendLayout(); - // - // label2 - // - this.label2.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.label2.Location = new System.Drawing.Point(16, 16); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(288, 40); - this.label2.TabIndex = 18; - this.label2.Text = "Please enter the URL of your Weblog\'s home page and the username and password tha" + - "t you use to log in to your Weblog."; - // - // label3 - // - this.label3.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.label3.Location = new System.Drawing.Point(168, 112); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(128, 13); - this.label3.TabIndex = 16; - this.label3.Text = "&Password:"; - // - // textBoxPassword - // - this.textBoxPassword.Location = new System.Drawing.Point(168, 128); - this.textBoxPassword.Name = "textBoxPassword"; - this.textBoxPassword.PasswordChar = '*'; - this.textBoxPassword.Size = new System.Drawing.Size(136, 20); - this.textBoxPassword.TabIndex = 17; - this.textBoxPassword.Text = ""; - // - // textBoxUsername - // - this.textBoxUsername.Location = new System.Drawing.Point(16, 128); - this.textBoxUsername.Name = "textBoxUsername"; - this.textBoxUsername.Size = new System.Drawing.Size(137, 20); - this.textBoxUsername.TabIndex = 15; - this.textBoxUsername.Text = ""; - // - // label4 - // - this.label4.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.label4.Location = new System.Drawing.Point(16, 112); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(128, 13); - this.label4.TabIndex = 14; - this.label4.Text = "&Username:"; - // - // weblogHomepageUrlControl - // - this.weblogHomepageUrlControl.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.weblogHomepageUrlControl.HomepageUrl = ""; - this.weblogHomepageUrlControl.Location = new System.Drawing.Point(16, 64); - this.weblogHomepageUrlControl.Name = "weblogHomepageUrlControl"; - this.weblogHomepageUrlControl.Size = new System.Drawing.Size(288, 37); - this.weblogHomepageUrlControl.TabIndex = 13; - // - // buttonAutoDetectWeblog - // - this.buttonAutoDetectWeblog.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.buttonAutoDetectWeblog.Location = new System.Drawing.Point(88, 168); - this.buttonAutoDetectWeblog.Name = "buttonAutoDetectWeblog"; - this.buttonAutoDetectWeblog.Size = new System.Drawing.Size(144, 23); - this.buttonAutoDetectWeblog.TabIndex = 19; - this.buttonAutoDetectWeblog.Text = "Auto Detect Weblog..."; - this.buttonAutoDetectWeblog.Click += new System.EventHandler(this.buttonAutoDetectWeblog_Click); - // - // textBoxResults - // - this.textBoxResults.Location = new System.Drawing.Point(16, 208); - this.textBoxResults.Multiline = true; - this.textBoxResults.Name = "textBoxResults"; - this.textBoxResults.Size = new System.Drawing.Size(288, 168); - this.textBoxResults.TabIndex = 20; - this.textBoxResults.Text = ""; - // - // TestAutoDetection - // - this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); - this.ClientSize = new System.Drawing.Size(320, 398); - this.Controls.Add(this.textBoxResults); - this.Controls.Add(this.buttonAutoDetectWeblog); - this.Controls.Add(this.label2); - this.Controls.Add(this.label3); - this.Controls.Add(this.textBoxPassword); - this.Controls.Add(this.textBoxUsername); - this.Controls.Add(this.label4); - this.Controls.Add(this.weblogHomepageUrlControl); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "TestAutoDetection"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "TestAutoDetection"; - this.ResumeLayout(false); + #region Windows Form Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.textBoxPassword = new System.Windows.Forms.TextBox(); + this.textBoxUsername = new System.Windows.Forms.TextBox(); + this.label4 = new System.Windows.Forms.Label(); + this.weblogHomepageUrlControl = new OpenLiveWriter.PostEditor.Configuration.WeblogHomepageUrlControl(); + this.buttonAutoDetectWeblog = new System.Windows.Forms.Button(); + this.textBoxResults = new System.Windows.Forms.TextBox(); + this.SuspendLayout(); + // + // label2 + // + this.label2.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.label2.Location = new System.Drawing.Point(16, 16); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(288, 40); + this.label2.TabIndex = 18; + this.label2.Text = "Please enter the URL of your Weblog\'s home page and the username and password tha" + + "t you use to log in to your Weblog."; + // + // label3 + // + this.label3.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.label3.Location = new System.Drawing.Point(168, 112); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(128, 13); + this.label3.TabIndex = 16; + this.label3.Text = "&Password:"; + // + // textBoxPassword + // + this.textBoxPassword.Location = new System.Drawing.Point(168, 128); + this.textBoxPassword.Name = "textBoxPassword"; + this.textBoxPassword.PasswordChar = '*'; + this.textBoxPassword.Size = new System.Drawing.Size(136, 20); + this.textBoxPassword.TabIndex = 17; + this.textBoxPassword.Text = ""; + // + // textBoxUsername + // + this.textBoxUsername.Location = new System.Drawing.Point(16, 128); + this.textBoxUsername.Name = "textBoxUsername"; + this.textBoxUsername.Size = new System.Drawing.Size(137, 20); + this.textBoxUsername.TabIndex = 15; + this.textBoxUsername.Text = ""; + // + // label4 + // + this.label4.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.label4.Location = new System.Drawing.Point(16, 112); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(128, 13); + this.label4.TabIndex = 14; + this.label4.Text = "&Username:"; + // + // weblogHomepageUrlControl + // + this.weblogHomepageUrlControl.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); + this.weblogHomepageUrlControl.HomepageUrl = ""; + this.weblogHomepageUrlControl.Location = new System.Drawing.Point(16, 64); + this.weblogHomepageUrlControl.Name = "weblogHomepageUrlControl"; + this.weblogHomepageUrlControl.Size = new System.Drawing.Size(288, 37); + this.weblogHomepageUrlControl.TabIndex = 13; + // + // buttonAutoDetectWeblog + // + this.buttonAutoDetectWeblog.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.buttonAutoDetectWeblog.Location = new System.Drawing.Point(88, 168); + this.buttonAutoDetectWeblog.Name = "buttonAutoDetectWeblog"; + this.buttonAutoDetectWeblog.Size = new System.Drawing.Size(144, 23); + this.buttonAutoDetectWeblog.TabIndex = 19; + this.buttonAutoDetectWeblog.Text = "Auto Detect Weblog..."; + this.buttonAutoDetectWeblog.Click += new System.EventHandler(this.buttonAutoDetectWeblog_Click); + // + // textBoxResults + // + this.textBoxResults.Location = new System.Drawing.Point(16, 208); + this.textBoxResults.Multiline = true; + this.textBoxResults.Name = "textBoxResults"; + this.textBoxResults.Size = new System.Drawing.Size(288, 168); + this.textBoxResults.TabIndex = 20; + this.textBoxResults.Text = ""; + // + // TestAutoDetection + // + this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); + this.ClientSize = new System.Drawing.Size(320, 398); + this.Controls.Add(this.textBoxResults); + this.Controls.Add(this.buttonAutoDetectWeblog); + this.Controls.Add(this.label2); + this.Controls.Add(this.label3); + this.Controls.Add(this.textBoxPassword); + this.Controls.Add(this.textBoxUsername); + this.Controls.Add(this.label4); + this.Controls.Add(this.weblogHomepageUrlControl); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "TestAutoDetection"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "TestAutoDetection"; + this.ResumeLayout(false); - } - #endregion + } + #endregion - private void buttonAutoDetectWeblog_Click(object sender, System.EventArgs e) - { - try - { - textBoxResults.Text = String.Empty ; + private void buttonAutoDetectWeblog_Click(object sender, System.EventArgs e) + { + try + { + textBoxResults.Text = String.Empty ; - BlogAccountDetector accountDetector = new BlogAccountDetector(this, this.weblogHomepageUrlControl.HomepageUrl, this.textBoxUsername.Text, this.textBoxPassword.Text); + BlogAccountDetector accountDetector = new BlogAccountDetector(this, this.weblogHomepageUrlControl.HomepageUrl, this.textBoxUsername.Text, this.textBoxPassword.Text); - // setup the progress dialog and kick off the transfer - using (ProgressDialog progress = new ProgressDialog()) - { - // configure progress source - progress.ProgressProvider = accountDetector; + // setup the progress dialog and kick off the transfer + using (ProgressDialog progress = new ProgressDialog()) + { + // configure progress source + progress.ProgressProvider = accountDetector; - // set progress title - progress.Title = Text; - progress.ProgressText = Text ; + // set progress title + progress.Title = Text; + progress.ProgressText = Text ; - // start the publisher (this is a non-blocking call) - accountDetector.Start(); + // start the publisher (this is a non-blocking call) + accountDetector.Start(); - // show the progress dialog - progress.ShowDialog(this); - } + // show the progress dialog + progress.ShowDialog(this); + } - // show error - if ( accountDetector.ErrorOccurred ) - { - accountDetector.ShowLastError(this); - } - else if (!accountDetector.WasCancelled)// ran to completion - { - StringBuilder resultsBuilder = new StringBuilder(); - resultsBuilder.AppendFormat( "Service: {0}\r\nClientApi: {1}\r\nPost URL: {2}\r\nBlogID: {3}\r\n\r\n", - accountDetector.ServiceName, - accountDetector.ClientType, - accountDetector.PostApiUrl, - accountDetector.BlogId ) ; + // show error + if ( accountDetector.ErrorOccurred ) + { + accountDetector.ShowLastError(this); + } + else if (!accountDetector.WasCancelled)// ran to completion + { + StringBuilder resultsBuilder = new StringBuilder(); + resultsBuilder.AppendFormat( "Service: {0}\r\nClientApi: {1}\r\nPost URL: {2}\r\nBlogID: {3}\r\n\r\n", + accountDetector.ServiceName, + accountDetector.ClientType, + accountDetector.PostApiUrl, + accountDetector.BlogId ) ; + foreach ( BlogInfo blog in accountDetector.UsersBlogs ) + resultsBuilder.AppendFormat( "{0} ({1})\r\n", blog.HomepageUrl, blog.Id ) ; - foreach ( BlogInfo blog in accountDetector.UsersBlogs ) - resultsBuilder.AppendFormat( "{0} ({1})\r\n", blog.HomepageUrl, blog.Id ) ; - - textBoxResults.Text = resultsBuilder.ToString() ; - } - } - catch(Exception ex) - { - UnexpectedErrorMessage.Show(ex); - } - } - } + textBoxResults.Text = resultsBuilder.ToString() ; + } + } + catch(Exception ex) + { + UnexpectedErrorMessage.Show(ex); + } + } + } } diff --git a/src/managed/OpenLiveWriter/TestMainForm.cs b/src/managed/OpenLiveWriter/TestMainForm.cs index 3ea68462..7a608bbc 100644 --- a/src/managed/OpenLiveWriter/TestMainForm.cs +++ b/src/managed/OpenLiveWriter/TestMainForm.cs @@ -12,81 +12,81 @@ using OpenLiveWriter.PostEditor.PostHtmlEditing.Maps; namespace OpenLiveWriter { - /// - /// Summary description for TestMainForm. - /// - public class TestMainForm : System.Windows.Forms.Form - { - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; + /// + /// Summary description for TestMainForm. + /// + public class TestMainForm : System.Windows.Forms.Form + { + /// + /// Required designer variable. + /// + private System.ComponentModel.Container components = null; - public TestMainForm() - { - // - // Required for Windows Form Designer support - // - InitializeComponent(); + public TestMainForm() + { + // + // Required for Windows Form Designer support + // + InitializeComponent(); - // - // TODO: Add any constructor code after InitializeComponent call - // - MapControl mapControl = new MapControl(); - mapControl.Dock = DockStyle.Fill; - mapControl.LoadMap("48 Stone Ave., Somerville, MA"); - this.Controls.Add(mapControl); - } + // + // TODO: Add any constructor code after InitializeComponent call + // + MapControl mapControl = new MapControl(); + mapControl.Dock = DockStyle.Fill; + mapControl.LoadMap("48 Stone Ave., Somerville, MA"); + this.Controls.Add(mapControl); + } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } + /// + /// Clean up any resources being used. + /// + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - this.Size = new System.Drawing.Size(300,300); - this.Text = "TestMainForm"; - } - #endregion + #region Windows Form Designer generated code + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.Size = new System.Drawing.Size(300,300); + this.Text = "TestMainForm"; + } + #endregion - [STAThread] - public static void Main(string[] args) - { - try - { - // initialize application environment - ApplicationEnvironment.Initialize(); + [STAThread] + public static void Main(string[] args) + { + try + { + // initialize application environment + ApplicationEnvironment.Initialize(); - //RsdServiceDescription rsdService = RsdServiceDetector.DetectFromRsdUrl("http://localhost/test/foo.rsd", 10000); - //Trace.WriteLine(rsdService.EditingTemplateLink); + //RsdServiceDescription rsdService = RsdServiceDetector.DetectFromRsdUrl("http://localhost/test/foo.rsd", 10000); + //Trace.WriteLine(rsdService.EditingTemplateLink); - Application.Run(new TestMainForm()); + Application.Run(new TestMainForm()); - // launch blogging form - //WeblogConfigurationWizardController.Add(Win32WindowImpl.DesktopWin32Window); - //WeblogConfigurationWizardController.Edit(Win32WindowImpl.DesktopWin32Window, BlogSettings.DefaultBlogId); - } - catch( Exception ex ) - { - UnexpectedErrorMessage.Show( ex ) ; - } - } - } + // launch blogging form + //WeblogConfigurationWizardController.Add(Win32WindowImpl.DesktopWin32Window); + //WeblogConfigurationWizardController.Edit(Win32WindowImpl.DesktopWin32Window, BlogSettings.DefaultBlogId); + } + catch( Exception ex ) + { + UnexpectedErrorMessage.Show( ex ) ; + } + } + } } diff --git a/src/managed/OpenLiveWriter/TestWizardMain.cs b/src/managed/OpenLiveWriter/TestWizardMain.cs index 8e460884..1d291870 100644 --- a/src/managed/OpenLiveWriter/TestWizardMain.cs +++ b/src/managed/OpenLiveWriter/TestWizardMain.cs @@ -12,65 +12,63 @@ using OpenLiveWriter.BlogClient.Detection; using OpenLiveWriter.Api.BlogClient; using OpenLiveWriter.PostEditor.Configuration.Wizard ; - namespace OpenLiveWriter { - /// - /// Summary description for TestWizardMain. - /// - public class TestWizardMain - { - private class TestForm : Form - { + /// + /// Summary description for TestWizardMain. + /// + public class TestWizardMain + { + private class TestForm : Form + { - protected override void OnLoad(EventArgs e) - { - base.OnLoad(e); + protected override void OnLoad(EventArgs e) + { + base.OnLoad(e); + } - } + protected override void OnClick(EventArgs e) + { + base.OnClick (e); - protected override void OnClick(EventArgs e) - { - base.OnClick (e); + try + { + BlogEditingTemplateDetector detector = new BlogEditingTemplateDetector(this); + detector.SetContext( "http://localhost/test/editingTemplate.htm", @"C:\Program Files\Apache Group\Apache\htdocs\test\blogtemplates" ); + detector.DetectTemplate(SilentProgressHost.Instance) ; - try - { - BlogEditingTemplateDetector detector = new BlogEditingTemplateDetector(this); - detector.SetContext( "http://localhost/test/editingTemplate.htm", @"C:\Program Files\Apache Group\Apache\htdocs\test\blogtemplates" ); - detector.DetectTemplate(SilentProgressHost.Instance) ; + Trace.WriteLine(detector.BlogTemplateFile); + } + catch(Exception ex) + { + UnexpectedErrorMessage.Show( ex ) ; + } + } + } - Trace.WriteLine(detector.BlogTemplateFile); - } - catch(Exception ex) - { - UnexpectedErrorMessage.Show( ex ) ; - } - } - } + [STAThread] + public static void Main(string[] args) + { + try + { + // initialize application environment + ApplicationEnvironment.Initialize(); - [STAThread] - public static void Main(string[] args) - { - try - { - // initialize application environment - ApplicationEnvironment.Initialize(); + //RsdServiceDescription rsdService = RsdServiceDetector.DetectFromRsdUrl("http://localhost/test/foo.rsd", 10000); + //Trace.WriteLine(rsdService.EditingTemplateLink); - //RsdServiceDescription rsdService = RsdServiceDetector.DetectFromRsdUrl("http://localhost/test/foo.rsd", 10000); - //Trace.WriteLine(rsdService.EditingTemplateLink); + Application.Run(new TestForm()); - Application.Run(new TestForm()); - - // launch blogging form - //WeblogConfigurationWizardController.Add(Win32WindowImpl.DesktopWin32Window); - //WeblogConfigurationWizardController.Edit(Win32WindowImpl.DesktopWin32Window, BlogSettings.DefaultBlogId); - } - catch( Exception ex ) - { - UnexpectedErrorMessage.Show( ex ) ; - } - } - } + // launch blogging form + //WeblogConfigurationWizardController.Add(Win32WindowImpl.DesktopWin32Window); + //WeblogConfigurationWizardController.Edit(Win32WindowImpl.DesktopWin32Window, BlogSettings.DefaultBlogId); + } + catch( Exception ex ) + { + UnexpectedErrorMessage.Show( ex ) ; + } + } + } }