Exemple #1
0
        public AsYouTypeSpellCheck()
        {
            InitializeComponent();

            rtb.Text = @"Some facts about Mark Twain (spelling errors intentional ;-)

A steambat pilot neded a vast knowldege of the ever-chaging river to be able to stop at any of the hundreds of ports and wood-lots along the river banks. Twain meticulosly studied 2,000 miles (3,200 km) of the Mississipi for more than two years before he received his steamboat pilot license in 1859.

While training, Samuel covinced his younger brother Henry to work with him. Heny was killed on June 21, 1858, when the steamboat he was working on, the Pennsylvania, exploded. Twain had foreseen this death in a detailed dream a month earlier, [13] which inspired his interest in parasychology; he was an early member of the Society for Psychical Research.[14] Twain was guilt-strcken over his brother's death and held himself responsible for the rest of his life. However, he continued to work on the river and served as a river pilot until the American Civil War broke out in 1861 and traffic along the Mississipi was curtaled.

Missouri was a slave state and considered by many to be part of the South, and was represented in both the Confederate and Federal governments during the Civil War. When the war began, Twain and his friends formed a Confederate militia (depcted in an 1885 short story, ""The Private History of a Campaign That Failed""), which drilled for only two weeks before disbanding.[15] Twain joinded his brother, Orion, who had been apointed secretary to the teritorial govenor of Nevada, James W. Nye, and headed west.
 
Twain then traveled to San Francisco, California, where he comtinued as a journalist and began lecturing. He met other writers such as Bret Harte, Artemus Ward and Dan DeQuille. An assignment in Hawaii became the basis for his first lectures.[18] In 1867, a local newspaper funded a trip to the Mediterrannean. During his tohr of Europe and the Midddle East, he wrote a popular colection of travel letters wich were compled as The Inocents Abroad in 1869.";

            toolbar.RichTextBox = rtb;

            var spell = new C1SpellChecker();

            rtb.SpellChecker = spell;
            spell.MainDictionary.Load(Application.GetResourceStream(new Uri("/" + new AssemblyName(Assembly.GetExecutingAssembly().FullName).Name + ";component/Resources/C1Spell_en-US.dct", UriKind.Relative)).Stream);

            var theme = new C1ThemeOffice2016White();

            C1Theme.ApplyTheme(LayoutRoot, theme);

            var adornerLayer = AdornerLayer.GetAdornerLayer(LayoutRoot);

            if (adornerLayer != null)
            {
                // this will aplly theme to everything displayed in adorner, including any C1Window instances
                C1Theme.ApplyTheme(adornerLayer, theme);
            }
        }
Exemple #2
0
        private void cmbTheme_SelectedItemChanged(object sender, PropertyChangedEventArgs <object> e)
        {
            C1Theme ribbonTheme = null;
            var     theme       = C1ThemeFactory.GetTheme((C1AvailableThemes)cmbTheme.SelectedItem);

            C1Theme.ApplyTheme(LayoutRoot, theme);

            var adornerLayer = AdornerLayer.GetAdornerLayer(LayoutRoot);

            if (adornerLayer != null)
            {
                // this will aplly theme to everything displayed in adorner, including any C1Window instances
                C1Theme.ApplyTheme(adornerLayer, theme);
            }
            //gallery.CurrentTheme = theme;

            SetRibbonTheme(ribbonTheme, (C1AvailableThemes)cmbTheme.SelectedItem);

            // Application.Current.Resources.MergedDictionaries.Clear();
            Application.Current.Resources.MergedDictionaries.Add(theme.GetNewResourceDictionary());
            if (ribbonTheme != null)
            {
                Application.Current.Resources.MergedDictionaries.Add(ribbonTheme.GetNewResourceDictionary());
            }
            // ribbon.ApplicationMenu.Background = this.Background;
        }
        //----------------------------------------
        #region ** Settings
        private void themeList_SelectionChanged(object sender, C1.WPF.SelectionChangedEventArgs <int> e)
        {
            if (themeList.SelectedItem == null)
            {
                return;
            }

            themeDropDown.IsDropDownOpen = false;
            scheduler.BeginUpdate();

            C1Theme theme = null;

            switch (themeList.SelectedItem.ToString())
            {
            case "Black":
                theme = new C1.WPF.Theming.Office2016.C1ThemeOffice2016Black();
                break;

            case "White":
                theme = new C1.WPF.Theming.Office2016.C1ThemeOffice2016White();
                break;

            case "Colorful":
                theme = new C1.WPF.Theming.Office2016.C1ThemeOffice2016Colorful();
                break;

            case "Dark Gray":
                theme = new C1.WPF.Theming.Office2016.C1ThemeOffice2016DarkGray();
                break;
            }
            C1Theme.ApplyTheme(this, theme);
            var rd = theme.GetNewResourceDictionary();

            scheduler.Theme = calendar.Theme = rd;

            // apply themed FlexGrid style to inherited controls
            var flexGridStyle = rd[typeof(C1.WPF.FlexGrid.C1FlexGrid)] as Style;

            if (flexGridStyle != null)
            {
                agendaView.Style = flexGridStyle;
                tableView.Style  = flexGridStyle;
            }
            var adornerLayer = AdornerLayer.GetAdornerLayer(this);

            if (adornerLayer != null)
            {
                // this will aplly theme to everything displayed in adorner, including any C1Window instances
                C1Theme.ApplyTheme(adornerLayer, theme);
            }
            //     scheduler_LayoutUpdated(null, null);
            scheduler.EndUpdate();
        }
Exemple #4
0
        private void cmbTheme_SelectedItemChanged(object sender, PropertyChangedEventArgs <object> e)
        {
            var theme = C1ThemeFactory.GetTheme((C1AvailableThemes)cmbTheme.SelectedItem);

            C1Theme.ApplyTheme(LayoutRoot, theme);

            var adornerLayer = AdornerLayer.GetAdornerLayer(LayoutRoot);

            if (adornerLayer != null)
            {
                C1Theme.ApplyTheme(adornerLayer, theme);
            }
        }
Exemple #5
0
        private void SetTheme()
        {
            var theme = C1ThemeFactory.GetTheme(C1AvailableThemes.Office2016Colorful);

            C1Theme.ApplyTheme(LayoutRoot, theme);

            var adornerLayer = AdornerLayer.GetAdornerLayer(LayoutRoot);

            if (adornerLayer != null)
            {
                // this will aplly theme to everything displayed in adorner, including any C1Window instances
                C1Theme.ApplyTheme(adornerLayer, theme);
            }
        }
Exemple #6
0
        private void cmbTheme_SelectedItemChanged(object sender, PropertyChangedEventArgs <object> e)
        {
            var theme = C1ThemeFactory.GetTheme((C1AvailableThemes)cmbTheme.SelectedItem);

            C1Theme.ApplyTheme(LayoutRoot, theme);

            var adornerLayer = AdornerLayer.GetAdornerLayer(LayoutRoot);

            if (adornerLayer != null)
            {
                // this will apply theme to everything displayed in adorner, including any C1Window instances
                C1Theme.ApplyTheme(adornerLayer, theme);
            }

            CurrentTheme = theme;
        }
Exemple #7
0
        public MainWindow()
        {
            InitializeComponent();
            this.DataContext = ViewModel.ChartViewModel.Instance;

            this.Loaded += (o, e) =>
            {
                var theme = new C1ThemeExpressionDark();
                C1Theme.ApplyTheme(this, theme);


                ViewModel.ChartViewModel.Instance.MainChart         = financialChart1;
                ViewModel.ChartViewModel.Instance.MainSeries        = mainSeries;
                ViewModel.ChartViewModel.Instance.MainMovingAverage = mainMovingAverage;
                ViewModel.ChartViewModel.Instance.VolumeSeries      = volumeSeries;
                ViewModel.ChartViewModel.Instance.RangeSelector     = rangeSelector;
                ViewModel.ChartViewModel.Instance.AnnotationLayer   = annotationLayer;
                ViewModel.ChartViewModel.Instance.LineMarker        = lineMarker;

                this.rangeSelector.UpperValue = DateTime.Now.ToOADate();
                this.rangeSelector.LowerValue = DateTime.Parse(string.Format("01-01-{0}", DateTime.Now.Year)).ToOADate();

                this.financialChart2.AxisX.Min = new DateTime(2007, 12, 31).ToOADate();
            };

            //Change Line marker color.
            this.lineMarker.Loaded += (o, e) =>
            {
                Brush whiteBrush = new SolidColorBrush(Colors.White);
                IEnumerable <DependencyObject> visuals = GetLineVisual(this.lineMarker);
                foreach (var item in visuals)
                {
                    var line = item as Line;
                    line.Fill = line.Stroke = whiteBrush;
                }
            };
        }