Ejemplo n.º 1
0
        public MainWindow()
        {
            ResourceBinding.Scaling(0.75);
            //Entities DB = new Entities();

            try
            {
                //  var profilesByMME = DB.MME_CODES.Include(m=> m.MME_CODES_TO_PROFILES).Single(m => m.Name == "MME008").MME_CODES_TO_PROFILES.Select(m => m.PROFILE).GroupBy(m => m.PROF_NAME);
//                var highVersionProfiles = profilesByMME.Select(m => m.OrderByDescending(n => n.PROF_VERS).First()).ToList();
            }
            catch (Exception ex)
            {
            }
            InitializeComponent();
        }
Ejemplo n.º 2
0
        public MainWindow()
        {
            ResourceBinding.Scaling(0.60);

            InitializeComponent();
            Cache.Main = this;
            Cache.SelectEditModePage = new SelectEditModePage();

            var navigationService = NavigationService.GetNavigationService(MainFrame);

            MainFrame?.Navigate(Cache.SelectEditModePage);

            //MainFrame.Navigate(new ProfilesPage(new MSSQLDbService(new SqlConnection(@"Data Source=IVAN-PC\SQLEXPRESS01;Initial Catalog=SCME_ResultsDBTest;Integrated Security=true;")), "MME005"));
            //MainFrame?.Navigate(new MatchingProfilesCodesPage(new MSSQLDbService(new SqlConnection(@"Data Source=IVAN-PC\SQLEXPRESS01;Initial Catalog=SCME_ResultsDBTest;Integrated Security=true;"))));
        }
Ejemplo n.º 3
0
        public MainWindow()
        {
            string s = Assembly.GetExecutingAssembly().GetName().Version.ToString();

            Application.Current.DispatcherUnhandledException += DispatcherUnhandledException;
            AppDomain.CurrentDomain.UnhandledException       += CurrentDomainOnUnhandledException;

            try
            {
                //Thread.CurrentThread.CurrentUICulture = new CultureInfo(Settings.Default.Localization);
//                CultureInfo.DefaultThreadCurrentCulture = new CultureInfo(Settings.Default.Localization);
//                Thread.CurrentThread.CurrentCulture = new CultureInfo(Settings.Default.Localization);
//                Thread.CurrentThread.CurrentUICulture = new CultureInfo(Settings.Default.Localization);
//                LanguageProperty.OverrideMetadata(typeof(FrameworkElement), new FrameworkPropertyMetadata(
//                    XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag)));
            }
            catch (Exception ex)
            {
                var dw = new DialogWindow("Localization error", ex.Message);
                dw.ButtonConfig(DialogWindow.EbConfig.OK);
                dw.ShowDialog();
            }

            Cache.Keyboards = new KeyboardLayouts(Path.IsPathRooted(Settings.Default.KeyboardsPath) ? Settings.Default.KeyboardsPath : Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase), Settings.Default.KeyboardsPath));

            ResourceBinding.Scaling(0.60);

            InitializeComponent();

            m_InitialClampLabelContent = clampLabel.Content;

            m_XRed    = (SolidColorBrush)FindResource("xRed1");
            m_XOrange = (SolidColorBrush)FindResource("xOrange1");

            VM.TechPasswordVisibility = Visibility.Collapsed;

            try
            {
                Cache.Main = this;
                if (Settings.Default.WindowIs1280x1024)
                {
                    Top         = SystemParameters.WorkArea.Top;
                    Left        = SystemParameters.WorkArea.Left;
                    Width       = 1280;
                    Height      = 1024;
                    WindowState = WindowState.Normal;
                }
                else
                {
                    if (Settings.Default.NormalWindow)
                    {
                        WindowStyle           = WindowStyle.SingleBorderWindow;
                        WindowStartupLocation = WindowStartupLocation.CenterScreen;
                        ResizeMode            = ResizeMode.CanResize;
                        WindowState           = WindowState.Maximized;
                    }
                    else
                    {
                        Top    = SystemParameters.WorkArea.Top;
                        Left   = SystemParameters.WorkArea.Left;
                        Width  = SystemParameters.WorkArea.Width;
                        Height = SystemParameters.WorkArea.Height;
                    }
                }

                Cache.Storage = new LocalStorage(Settings.Default.StoragePath);
                Cache.Net     = new ControlLogic();

                VM.IsSafetyBreakIconVisible = false;

                RestartRoutine(null, null);
            }
            catch (Exception ex)
            {
                var dw = new DialogWindow(Properties.Resources.ApplicationStartError, ex.Message);
                dw.ButtonConfig(DialogWindow.EbConfig.OK);
                dw.ShowDialog();

                Application.Current.Shutdown(1);
            }

            mainFrame.Navigated  += MainFrameOnNavigated;
            mainFrame.Navigating += MainFrameOnNavigating;
        }