public HistoryForm(string historyPath, HistorySettings settings, Action <string> uploadFile = null, Action <string> editImage = null) { HistoryPath = historyPath; Settings = settings; InitializeComponent(); tsHistory.Renderer = new ToolStripRoundedEdgeRenderer(); defaultTitle = Text; string[] typeNames = Enum.GetNames(typeof(EDataType)); string[] typeTranslations = Helpers.GetLocalizedEnumDescriptions <EDataType>(); typeNamesLocaleLookup = typeNames.Zip(typeTranslations, (key, val) => new { key, val }).ToDictionary(e => e.key, e => e.val); UpdateTitle(); ImageList il = new ImageList(); il.ColorDepth = ColorDepth.Depth32Bit; il.Images.Add(Resources.image); il.Images.Add(Resources.notebook); il.Images.Add(Resources.application_block); il.Images.Add(Resources.globe); lvHistory.SmallImageList = il; him = new HistoryItemManager(uploadFile, editImage, true); him.GetHistoryItems += him_GetHistoryItems; lvHistory.ContextMenuStrip = him.cmsHistory; pbThumbnail.Reset(); lvHistory.FillLastColumn(); scHistoryItemInfo.SplitterWidth = 7; // Because of bug must be assigned here again scHistoryItemInfo.Panel2Collapsed = true; tstbSearch.TextBox.HandleCreated += (sender, e) => tstbSearch.TextBox.SetWatermark(Resources.HistoryForm_Search_Watermark, true); if (Settings.RememberSearchText) { tstbSearch.Text = Settings.SearchText; } ShareXResources.ApplyTheme(this); if (Settings.RememberWindowState) { Settings.WindowState.ApplyFormState(this); if (Settings.SplitterDistance > 0) { scMain.SplitterDistance = Settings.SplitterDistance; } } }
public HistoryForm(string historyPath, HistorySettings settings, Action <string> uploadFile = null, Action <string> editImage = null) { HistoryPath = historyPath; Settings = settings; InitializeComponent(); tsHistory.Renderer = new ToolStripRoundedEdgeRenderer(); defaultTitle = Text; UpdateTitle(); // Mark the Date column as having a date; used for sorting chDateTime.Tag = new DateTime(); ImageList il = new ImageList(); il.ColorDepth = ColorDepth.Depth32Bit; il.Images.Add(Resources.image); il.Images.Add(Resources.notebook); il.Images.Add(Resources.application_block); il.Images.Add(Resources.globe); lvHistory.SmallImageList = il; him = new HistoryItemManager(uploadFile, editImage, true); him.GetHistoryItems += him_GetHistoryItems; lvHistory.ContextMenuStrip = him.cmsHistory; pbThumbnail.Reset(); lvHistory.FillLastColumn(); scHistoryItemInfo.SplitterWidth = 7; // Because of bug must be assigned here again scHistoryItemInfo.Panel2Collapsed = true; if (Settings.RememberSearchText) { tstbSearch.Text = Settings.SearchText; } ShareXResources.ApplyTheme(this); if (Settings.RememberWindowState) { Settings.WindowState.ApplyFormState(this); if (Settings.SplitterDistance > 0) { scMain.SplitterDistance = Settings.SplitterDistance; } } }
public HistoryForm(string historyPath, HistorySettings settings, Action <string> uploadFile = null, Action <string> editImage = null) { HistoryPath = historyPath; Settings = settings; InitializeComponent(); defaultTitle = Text; UpdateTitle(); // Mark the Date column as having a date; used for sorting chDateTime.Tag = new DateTime(); ImageList il = new ImageList(); il.ColorDepth = ColorDepth.Depth32Bit; il.Images.Add(Resources.image); il.Images.Add(Resources.notebook); il.Images.Add(Resources.application_block); il.Images.Add(Resources.globe); lvHistory.SmallImageList = il; him = new HistoryItemManager(uploadFile, editImage); him.GetHistoryItems += him_GetHistoryItems; lvHistory.ContextMenuStrip = him.cmsHistory; pbThumbnail.Reset(); lvHistory.FillLastColumn(); if (Settings.SplitterDistance > 0) { scMain.SplitterDistance = Settings.SplitterDistance; } nudMaxItemCount.SetValue(Settings.MaxItemCount); ShareXResources.ApplyTheme(this); Settings.WindowState.AutoHandleFormState(this); }
public HistoryForm(string historyPath, HistorySettings settings, Action <string> uploadFile = null, Action <string> editImage = null) { HistoryPath = historyPath; Settings = settings; InitializeComponent(); Icon = ShareXResources.Icon; defaultTitle = Text; UpdateTitle(); // Mark the Date column as having a date; used for sorting chDateTime.Tag = new DateTime(); ImageList il = new ImageList(); il.ColorDepth = ColorDepth.Depth32Bit; il.Images.Add(Resources.image); il.Images.Add(Resources.notebook); il.Images.Add(Resources.application_block); il.Images.Add(Resources.globe); lvHistory.SmallImageList = il; him = new HistoryItemManager(uploadFile, editImage); him.GetHistoryItems += him_GetHistoryItems; pbThumbnail.Reset(); cbFilenameFilterMethod.SelectedIndex = 0; // Contains lvHistory.FillLastColumn(); if (Settings.SplitterDistance > 0) { scMain.SplitterDistance = Settings.SplitterDistance; } Settings.WindowState.AutoHandleFormState(this); }