예제 #1
0
        public override async Task Execute(params object[] args)
        {
            Color pageColor;

            using (var one = new OneNote(out var page, out _))
            {
                pageColor = page.GetPageColor(out _, out var black);
                if (black)
                {
                    // if Office Black theme, translate to softer Black Shadow
                    pageColor = BasicColors.BlackSmoke;
                }
            }

            var theme = new ThemeProvider().Theme;

            using (var dialog = new StyleDialog(theme, pageColor))
            {
                if (dialog.ShowDialog(owner) == DialogResult.OK)
                {
                    ThemeProvider.Save(dialog.Theme);
                    ThemeProvider.RecordTheme(dialog.Theme.Key);

                    ribbon.Invalidate();
                }
            }

            ribbon.Invalidate();

            await Task.Yield();
        }
예제 #2
0
        public override async Task Execute(params object[] args)
        {
            using (var one = new OneNote(out var page, out _))
            {
                var color = page.GetPageColor(out _, out _);

                using (var dialog = new ChangePageColorDialog(color))
                {
                    if (dialog.ShowDialog(owner) != DialogResult.OK)
                    {
                        return;
                    }

                    UpdatePageColor(page, dialog.PageColor);
                    ThemeProvider.RecordTheme(dialog.ThemeKey);

                    if (dialog.ApplyStyle)
                    {
                        new ApplyStylesCommand().Apply(page);
                    }
                }

                await one.Update(page);
            }
        }
예제 #3
0
        public override async Task Execute(params object[] args)
        {
            var theme = LoadTheme();

            if (theme != null)
            {
                ThemeProvider.RecordTheme(theme.Key);
                ribbon.Invalidate();
            }

            await Task.Yield();
        }