Exemplo n.º 1
0
        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();
            lvHistory.FillLastColumn();

            if (Settings.SplitterDistance > 0)
            {
                scMain.SplitterDistance = Settings.SplitterDistance;
            }

            Settings.WindowState.AutoHandleFormState(this);
        }
Exemplo n.º 2
0
        public ImageHistoryForm(string historyPath, ImageHistorySettings settings, Action <string> uploadFile = null, Action <string> editImage = null)
        {
            InitializeComponent();
            tsMain.Renderer = new ToolStripRoundedEdgeRenderer();

            HistoryPath = historyPath;
            Settings    = settings;

            ilvImages.View          = (View)Settings.ViewMode;
            ilvImages.ThumbnailSize = Settings.ThumbnailSize;

            him = new HistoryItemManager(uploadFile, editImage);
            him.GetHistoryItems       += him_GetHistoryItems;
            ilvImages.ContextMenuStrip = him.cmsHistory;

            defaultTitle = Text;

            if (Settings.RememberSearchText)
            {
                tstbSearch.Text = Settings.SearchText;
            }

            ShareXResources.ApplyTheme(this);

            Settings.WindowState.AutoHandleFormState(this);
        }
Exemplo n.º 3
0
        public HistoryForm(string historyPath, int maxItemCount, int splitterDistance = 0)
        {
            HistoryPath  = historyPath;
            MaxItemCount = maxItemCount;

            InitializeComponent();
            Icon = ShareXResources.Icon;
            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();
            him.GetHistoryItems += him_GetHistoryItems;

            pbThumbnail.Reset();
            cbFilenameFilterMethod.SelectedIndex = 0; // Contains
            lvHistory.FillLastColumn();

            if (splitterDistance > 0)
            {
                scMain.SplitterDistance = splitterDistance;
            }
        }
Exemplo n.º 4
0
        public HistoryForm(string historyPath, int maxItemCount, int splitterDistance = 0)
        {
            HistoryPath = historyPath;
            MaxItemCount = maxItemCount;

            InitializeComponent();
            Icon = ShareXResources.Icon;
            defaultTitle = Text;
            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();
            him.GetHistoryItems += him_GetHistoryItems;

            pbThumbnail.Reset();
            cbFilenameFilterMethod.SelectedIndex = 0; // Contains
            lvHistory.FillLastColumn();

            if (splitterDistance > 0)
            {
                scMain.SplitterDistance = splitterDistance;
            }
        }
Exemplo n.º 5
0
        public HistoryForm(string historyPath, int maxItemCount, int splitterDistance = 0, Action <string> uploadFile = null, Action <string> editImage = null)
        {
            HistoryPath  = historyPath;
            MaxItemCount = maxItemCount;

            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 (splitterDistance > 0)
            {
                scMain.SplitterDistance = splitterDistance;
            }
        }
Exemplo n.º 6
0
        public ImageHistoryForm(string historyPath, int viewMode, Size thumbnailSize, int maxItemCount)
        {
            InitializeComponent();
            Icon = ShareXResources.Icon;

            HistoryPath  = historyPath;
            MaxItemCount = maxItemCount;

            ViewMode       = viewMode.Between(0, 3);
            ilvImages.View = (View)ViewMode;

            switch (ilvImages.View)
            {
            default:
            case View.Thumbnails:
                tsmiViewModeThumbnails.RadioCheck();
                break;

            case View.Gallery:
                tsmiViewModeGallery.RadioCheck();
                break;

            case View.Pane:
                tsmiViewModePane.RadioCheck();
                break;
            }

            ThumbnailSize           = thumbnailSize;
            ilvImages.ThumbnailSize = ThumbnailSize;

            switch (ThumbnailSize.Width)
            {
            case 75:
                tsmiThumbnailSize75.RadioCheck();
                break;

            default:
            case 100:
                tsmiThumbnailSize100.RadioCheck();
                break;

            case 150:
                tsmiThumbnailSize150.RadioCheck();
                break;

            case 200:
                tsmiThumbnailSize200.RadioCheck();
                break;

            case 250:
                tsmiThumbnailSize250.RadioCheck();
                break;
            }

            tsbQuickList.Checked = MaxItemCount > 0;

            him = new HistoryItemManager();
            him.GetHistoryItems += him_GetHistoryItems;
        }
Exemplo n.º 7
0
        public ImageHistoryForm(string historyPath, int viewMode, Size thumbnailSize, Action <string> uploadFile = null, Action <string> editImage = null)
        {
            InitializeComponent();
            Icon = ShareXResources.Icon;

            HistoryPath = historyPath;

            tsMain.Renderer = new CustomToolStripProfessionalRenderer();
            ViewMode        = viewMode.Between(0, 3);
            ilvImages.View  = (View)ViewMode;

            switch (ilvImages.View)
            {
            default:
            case View.Thumbnails:
                tsmiViewModeThumbnails.RadioCheck();
                break;

            case View.Gallery:
                tsmiViewModeGallery.RadioCheck();
                break;

            case View.Pane:
                tsmiViewModePane.RadioCheck();
                break;
            }

            ThumbnailSize           = thumbnailSize;
            ilvImages.ThumbnailSize = ThumbnailSize;

            switch (ThumbnailSize.Width)
            {
            case 75:
                tsmiThumbnailSize75.RadioCheck();
                break;

            default:
            case 100:
                tsmiThumbnailSize100.RadioCheck();
                break;

            case 150:
                tsmiThumbnailSize150.RadioCheck();
                break;

            case 200:
                tsmiThumbnailSize200.RadioCheck();
                break;

            case 250:
                tsmiThumbnailSize250.RadioCheck();
                break;
            }

            him = new HistoryItemManager(uploadFile, editImage);
            him.GetHistoryItems += him_GetHistoryItems;
        }
Exemplo n.º 8
0
        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();

            // 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;

            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;
                }
            }
        }
Exemplo n.º 9
0
        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;
                }
            }
        }
Exemplo n.º 10
0
        public ImageHistoryForm(string historyPath, int viewMode, Size thumbnailSize, int maxItemCount = -1)
        {
            InitializeComponent();
            Text = "ShareX - " + string.Format("Image history: {0}", historyPath);

            HistoryPath = historyPath;
            MaxItemCount = maxItemCount;
            ViewMode = viewMode;
            ThumbnailSize = thumbnailSize;

            tsbQuickList.Checked = MaxItemCount > -1;

            him = new HistoryItemManager();
            him.GetHistoryItems += him_GetHistoryItems;
        }
Exemplo n.º 11
0
        public ImageHistoryForm(string historyPath, int viewMode, Size thumbnailSize, int maxItemCount = -1)
        {
            InitializeComponent();
            Text = "ShareX - " + string.Format("Image history: {0}", historyPath);

            HistoryPath   = historyPath;
            MaxItemCount  = maxItemCount;
            ViewMode      = viewMode;
            ThumbnailSize = thumbnailSize;

            tsbQuickList.Checked = MaxItemCount > -1;

            him = new HistoryItemManager();
            him.GetHistoryItems += him_GetHistoryItems;
        }
Exemplo n.º 12
0
        public HistoryForm(string historyPath, int maxItemCount = -1)
        {
            InitializeComponent();
            Text = "ShareX - " + string.Format(Resources.HistoryForm_HistoryForm_History_, historyPath);

            HistoryPath  = historyPath;
            MaxItemCount = maxItemCount;

            him = new HistoryItemManager();
            him.GetHistoryItems += him_GetHistoryItems;

            pbThumbnail.Reset();
            cbFilenameFilterMethod.SelectedIndex  = 0; // Contains
            cbFilenameFilterCulture.SelectedIndex = 1; // Invariant culture
            cbTypeFilterSelection.SelectedIndex   = 0; // Image
            cbFilenameFilterCulture.Items[0]      = string.Format(Resources.HistoryForm_HistoryForm_Current_culture___0__, CultureInfo.CurrentCulture.Parent.EnglishName);
            lvHistory.FillLastColumn();
        }
Exemplo n.º 13
0
        public HistoryForm(string historyPath, int maxItemCount = -1)
        {
            InitializeComponent();
            Text = "sharexl - " + string.Format(Resources.HistoryForm_HistoryForm_History_, historyPath);

            HistoryPath = historyPath;
            MaxItemCount = maxItemCount;

            him = new HistoryItemManager();
            him.GetHistoryItems += him_GetHistoryItems;

            pbThumbnail.Reset();
            cbFilenameFilterMethod.SelectedIndex = 0; // Contains
            cbFilenameFilterCulture.SelectedIndex = 1; // Invariant culture
            cbTypeFilterSelection.SelectedIndex = 0; // Image
            cbFilenameFilterCulture.Items[0] = string.Format(Resources.HistoryForm_HistoryForm_Current_culture___0__, CultureInfo.CurrentCulture.Parent.EnglishName);
            lvHistory.FillLastColumn();
        }
Exemplo n.º 14
0
        public ImageHistoryForm(string historyPath, ImageHistorySettings settings, Action <string> uploadFile = null, Action <string> editImage = null)
        {
            InitializeComponent();
            Icon = ShareXResources.Icon;

            HistoryPath = historyPath;
            Settings    = settings;

            tsMain.Renderer         = new CustomToolStripProfessionalRenderer();
            ilvImages.View          = (View)Settings.ViewMode;
            ilvImages.ThumbnailSize = Settings.ThumbnailSize;

            him = new HistoryItemManager(uploadFile, editImage);
            him.GetHistoryItems += him_GetHistoryItems;

            defaultTitle = Text;

            Settings.WindowState.AutoHandleFormState(this);
        }
Exemplo n.º 15
0
        public ImageHistoryForm(string historyPath, ImageHistorySettings settings, Action <string> uploadFile = null, Action <string> editImage = null)
        {
            InitializeComponent();
            tsMain.Renderer = new ToolStripRoundedEdgeRenderer();

            HistoryPath = historyPath;
            Settings    = settings;

            ilvImages.ThumbnailSize = Settings.ThumbnailSize;

            if (ShareXResources.UseCustomTheme)
            {
                ilvImages.BorderStyle                  = BorderStyle.None;
                ilvImages.Colors.BackColor             = ShareXResources.Theme.DarkBackgroundColor;
                ilvImages.Colors.BorderColor           = ShareXResources.Theme.DarkBackgroundColor;
                ilvImages.Colors.ForeColor             = ShareXResources.Theme.TextColor;
                ilvImages.Colors.ImageInnerBorderColor = Color.Transparent;
                ilvImages.Colors.ImageOuterBorderColor = Color.Transparent;
                ilvImages.Colors.SelectedForeColor     = ShareXResources.Theme.TextColor;
                ilvImages.Colors.UnFocusedForeColor    = ShareXResources.Theme.TextColor;
            }

            him = new HistoryItemManager(uploadFile, editImage);
            him.GetHistoryItems       += him_GetHistoryItems;
            ilvImages.ContextMenuStrip = him.cmsHistory;

            defaultTitle = Text;

            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);
            }
        }
Exemplo n.º 16
0
        public ImageHistoryForm(string historyPath, ImageHistorySettings settings, Action <string> uploadFile = null, Action <string> editImage = null)
        {
            InitializeComponent();
            tsMain.Renderer = new ToolStripRoundedEdgeRenderer();

            HistoryPath = historyPath;
            Settings    = settings;

            ilvImages.View          = (View)Settings.ViewMode;
            ilvImages.ThumbnailSize = Settings.ThumbnailSize;

            if (ShareXResources.ExperimentalDarkTheme)
            {
                ilvImages.BorderStyle               = BorderStyle.None;
                ilvImages.Colors.BackColor          = ShareXResources.Theme.LightBackgroundColor;
                ilvImages.Colors.BorderColor        = ShareXResources.Theme.BorderColor;
                ilvImages.Colors.ForeColor          = ShareXResources.Theme.TextColor;
                ilvImages.Colors.SelectedForeColor  = ShareXResources.Theme.TextColor;
                ilvImages.Colors.UnFocusedForeColor = ShareXResources.Theme.TextColor;
            }

            him = new HistoryItemManager(uploadFile, editImage);
            him.GetHistoryItems       += him_GetHistoryItems;
            ilvImages.ContextMenuStrip = him.cmsHistory;

            defaultTitle = Text;

            if (Settings.RememberSearchText)
            {
                tstbSearch.Text = Settings.SearchText;
            }

            ShareXResources.ApplyTheme(this);

            Settings.WindowState.AutoHandleFormState(this);
        }
Exemplo n.º 17
0
        public ImageHistoryForm(string historyPath, int viewMode, Size thumbnailSize, int maxItemCount)
        {
            InitializeComponent();
            Icon = ShareXResources.Icon;

            HistoryPath = historyPath;

            ViewMode = viewMode.Between(0, 3);
            ilvImages.View = (View)ViewMode;

            switch (ilvImages.View)
            {
                default:
                case View.Thumbnails:
                    tsmiViewModeThumbnails.RadioCheck();
                    break;
                case View.Gallery:
                    tsmiViewModeGallery.RadioCheck();
                    break;
                case View.Pane:
                    tsmiViewModePane.RadioCheck();
                    break;
            }

            ThumbnailSize = thumbnailSize;
            ilvImages.ThumbnailSize = ThumbnailSize;

            switch (ThumbnailSize.Width)
            {
                case 75:
                    tsmiThumbnailSize75.RadioCheck();
                    break;
                default:
                case 100:
                    tsmiThumbnailSize100.RadioCheck();
                    break;
                case 150:
                    tsmiThumbnailSize150.RadioCheck();
                    break;
                case 200:
                    tsmiThumbnailSize200.RadioCheck();
                    break;
                case 250:
                    tsmiThumbnailSize250.RadioCheck();
                    break;
            }

            MaxItemCount = maxItemCount;

            if (MaxItemCount <= 0)
            {
                tsmiMaxImageLimit0.RadioCheck();
            }
            else if (MaxItemCount <= 100)
            {
                tsmiMaxImageLimit100.RadioCheck();
            }
            else if (MaxItemCount <= 250)
            {
                tsmiMaxImageLimit250.RadioCheck();
            }
            else
            {
                tsmiMaxImageLimit1000.RadioCheck();
            }

            him = new HistoryItemManager();
            him.GetHistoryItems += him_GetHistoryItems;
        }
Exemplo n.º 18
0
        public ImageHistoryForm(string historyPath, int viewMode, Size thumbnailSize, int maxItemCount, Action <string> uploadFile = null, Action <string> editImage = null)
        {
            InitializeComponent();
            Icon = ShareXResources.Icon;

            HistoryPath = historyPath;

            ViewMode       = viewMode.Between(0, 3);
            ilvImages.View = (View)ViewMode;

            switch (ilvImages.View)
            {
            default:
            case View.Thumbnails:
                tsmiViewModeThumbnails.RadioCheck();
                break;

            case View.Gallery:
                tsmiViewModeGallery.RadioCheck();
                break;

            case View.Pane:
                tsmiViewModePane.RadioCheck();
                break;
            }

            ThumbnailSize           = thumbnailSize;
            ilvImages.ThumbnailSize = ThumbnailSize;

            switch (ThumbnailSize.Width)
            {
            case 75:
                tsmiThumbnailSize75.RadioCheck();
                break;

            default:
            case 100:
                tsmiThumbnailSize100.RadioCheck();
                break;

            case 150:
                tsmiThumbnailSize150.RadioCheck();
                break;

            case 200:
                tsmiThumbnailSize200.RadioCheck();
                break;

            case 250:
                tsmiThumbnailSize250.RadioCheck();
                break;
            }

            MaxItemCount = maxItemCount;

            if (MaxItemCount <= 0)
            {
                tsmiMaxImageLimit0.RadioCheck();
            }
            else if (MaxItemCount <= 100)
            {
                tsmiMaxImageLimit100.RadioCheck();
            }
            else if (MaxItemCount <= 250)
            {
                tsmiMaxImageLimit250.RadioCheck();
            }
            else
            {
                tsmiMaxImageLimit1000.RadioCheck();
            }

            him = new HistoryItemManager(uploadFile, editImage);
            him.GetHistoryItems += him_GetHistoryItems;
        }