Ejemplo n.º 1
0
        protected override void OnStartup(StartupEventArgs e)
        {
            ApplicationManager.CrashReportEnabled = true;
            ImageConverterManager.AddConverter(new DefaultImageConverter());
            Configuration.SetImageRendering(Resources);

            Resources.MergedDictionaries.Add(new ResourceDictionary {
                Source = new Uri("pack://application:,,,/" + Assembly.GetEntryAssembly().GetName().Name.Replace(" ", "%20") + ";component/WPF/Styles/GRFEditorStyles.xaml", UriKind.RelativeOrAbsolute)
            });

            if (!Methods.IsWinVistaOrHigher() && Methods.IsWinXPOrHigher())
            {
                // We are on Windows XP, force the style.
                try {
                    Uri uri = new Uri("PresentationFramework.Aero;V3.0.0.0;31bf3856ad364e35;component\\themes/aero.normalcolor.xaml", UriKind.Relative);
                    Resources.MergedDictionaries.Add(LoadComponent(uri) as ResourceDictionary);
                }
                catch { }
            }

            if (!CustomStyles.StyleSet)
            {
                CustomStyles.SetDefault();
            }

            base.OnStartup(e);
        }
Ejemplo n.º 2
0
        protected override void OnStartup(StartupEventArgs e)
        {
            ApplicationManager.CrashReportEnabled = true;
            ImageConverterManager.AddConverter(new DefaultImageConverter());

            Configuration.SetImageRendering(Resources);

            base.OnStartup(e);
        }
Ejemplo n.º 3
0
        protected override void OnStartup(StartupEventArgs e)
        {
            ApplicationManager.CrashReportEnabled = true;
            ImageConverterManager.AddConverter(new DefaultImageConverter());
            Configuration.SetImageRendering(Resources);

            Resources.MergedDictionaries.Add(new ResourceDictionary {
                Source = new Uri("pack://application:,,,/" + Assembly.GetEntryAssembly().GetName().Name.Replace(" ", "%20") + ";component/WPF/Styles/GRFEditorStyles.xaml", UriKind.RelativeOrAbsolute)
            });

            if (!Methods.IsWinVistaOrHigher() && Methods.IsWinXPOrHigher())
            {
                // We are on Windows XP, force the style.
                _installTheme();
            }

            base.OnStartup(e);
        }
Ejemplo n.º 4
0
        protected override void OnStartup(StartupEventArgs e)
        {
            ApplicationManager.CrashReportEnabled = true;
            ImageConverterManager.AddConverter(new DefaultImageConverter());
            Configuration.SetImageRendering(Resources);

            Resources.MergedDictionaries.Add(new ResourceDictionary {
                Source = new Uri("pack://application:,,,/" + Assembly.GetEntryAssembly().GetName().Name.Replace(" ", "%20") + ";component/WPF/Styles/GRFEditorStyles.xaml", UriKind.RelativeOrAbsolute)
            });

            if (SdeAppConfiguration.ThemeIndex == 0)
            {
                Resources.MergedDictionaries.Add(new ResourceDictionary {
                    Source = new Uri("pack://application:,,,/" + Assembly.GetEntryAssembly().GetName().Name.Replace(" ", "%20") + ";component/WPF/Styles/StyleLightBlue.xaml", UriKind.RelativeOrAbsolute)
                });
            }
            else
            {
                Resources.MergedDictionaries.Add(new ResourceDictionary {
                    Source = new Uri("pack://application:,,,/" + Assembly.GetEntryAssembly().GetName().Name.Replace(" ", "%20") + ";component/WPF/Styles/StyleDark.xaml", UriKind.RelativeOrAbsolute)
                });

                ApplicationManager.ImageProcessing = delegate(string name, BitmapFrame img) {
                    if (img == null)
                    {
                        return(null);
                    }

                    if (name.Contains("reset.png"))
                    {
                        Func <byte, byte, byte, byte, Color> shader = delegate(byte A, byte R, byte G, byte B) {
                            return(Color.FromArgb(A, _clamp((R) * 1.8), _clamp(G / 3), _clamp(B / 3)));
                        };

                        return(_applyShader(img, shader));
                    }
                    else if (name.Contains("eye.png") || name.Contains("smallArrow.png"))
                    {
                        Func <byte, byte, byte, byte, Color> shader = delegate(byte A, byte R, byte G, byte B) {
                            return(Color.FromArgb(A, _clamp((255 - R) * 0.8), _clamp((255 - G) * 0.8), _clamp((255 - B) * 0.8)));
                        };

                        return(_applyShader(img, shader));
                    }
                    else if (name.Contains("arrow.png") ||
                             name.Contains("arrowoblique.png"))
                    {
                        Func <byte, byte, byte, byte, Color> shader = delegate(byte A, byte R, byte G, byte B) {
                            return(Color.FromArgb(A, _clamp((255 - R) * 0.8), _clamp((255 - G) * 0.6), 0));
                        };
                        //F68D00
                        return(_applyShader(img, shader));
                    }

                    return(img);
                };
            }

            if (!Methods.IsWinVistaOrHigher() && Methods.IsWinXPOrHigher())
            {
                // We are on Windows XP, force the style.
                _installTheme();
            }

            base.OnStartup(e);
        }