Beispiel #1
0
        private void ChangeLineColor(object sender, System.EventArgs e)
        {
            var location = PointToScreen(colorBox.Location);

            using (var dialog = new UI.MoreColorDialog(Resx.PageColorDialog_Text,
                                                       location.X + colorBox.Bounds.Location.X + (colorBox.Width / 2),
                                                       location.Y - 50))
            {
                dialog.Color = colorBox.BackColor;

                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    colorBox.BackColor = dialog.Color;
                }
            }
        }
Beispiel #2
0
        private Color SelectColor(string title, Rectangle bounds, Color color)
        {
            var location = PointToScreen(toolStrip.Location);

            using (var dialog = new UI.MoreColorDialog(title,
                                                       location.X + bounds.Location.X,
                                                       location.Y + bounds.Height + 4))
            {
                dialog.Color = color;

                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    return(dialog.Color);
                }
            }

            return(Color.Empty);
        }
        private void ChooseCustomColor(object sender, EventArgs e)
        {
            if (initialized && customButton.Checked)
            {
                var location = PointToScreen(customButton.Location);

                using (var dialog = new UI.MoreColorDialog(Resx.PageColorDialog_Text,
                                                           location.X + customButton.Bounds.Location.X + (customButton.Width / 2),
                                                           location.Y - 200))
                {
                    dialog.Color = pageColor;

                    if (dialog.ShowDialog() == DialogResult.OK)
                    {
                        SetCustomOption(dialog.Color);
                    }
                }
            }
        }
Beispiel #4
0
        private void ChooseCustomColor(object sender, LinkLabelLinkClickedEventArgs e)
        {
            var location = PointToScreen(customLink.Location);

            using (var dialog = new UI.MoreColorDialog(Resx.PageColorDialog_Text,
                                                       location.X + customLink.Bounds.Location.X + customLink.Width,
                                                       location.Y - 50))
            {
                dialog.Color = colorsBox.CustomColor;

                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    colorsBox.SetCustomColor(dialog.Color);

                    var provider = new SettingsProvider();
                    var settings = provider.GetCollection("pageTheme");
                    settings.Add("customColor", dialog.Color.ToRGBHtml());
                    provider.SetCollection(settings);
                    provider.Save();
                }
            }
        }