コード例 #1
0
        public static void ShowProgress(eMammalIntegrationWindow window, string msg, int progressCount,
                                        bool isLast = true, bool showProgressBar = true)
        {
            window.LabelProgress.Content = msg;

            window.LabelProgress.Dispatcher.Invoke(() =>
                                                   window.LabelProgress.Visibility = Visibility.Visible, DispatcherPriority.Background);

            if (showProgressBar)
            {
                window.ProgressbarUpdateProgress.Dispatcher.Invoke(() =>
                                                                   window.ProgressbarUpdateProgress.Visibility = Visibility.Visible, DispatcherPriority.Background);
            }

            if (isLast)
            {
                window.ProgressbarUpdateProgress.Dispatcher.Invoke(() =>
                                                                   window.ProgressbarUpdateProgress.Value = progressCount, DispatcherPriority.Normal);
            }
            else
            {
                window.ProgressbarUpdateProgress.Dispatcher.Invoke(() =>
                                                                   window.ProgressbarUpdateProgress.Value = progressCount, DispatcherPriority.Background);
            }
        }
コード例 #2
0
        public static void CheckConnection(eMammalIntegrationWindow window, bool loadProject = false)
        {
            eMammalMySQLOps db = new eMammalMySQLOps();

            bool isConnectionOpen = false;

            while (isConnectionOpen == false)
            {
                Thread.Sleep(200);
                isConnectionOpen = db.OpenConnectionIfNotOpen(true);
            }
            window.Dispatcher.BeginInvoke(new Action(() =>
            {
                Common.SetMessage(window, Constants.DATABASE_AVAILABLE, false, false);

                window.Tab.Visibility = Visibility.Visible;

                if (loadProject)
                {
                    window.Loadproject();
                }

                window.Tab.SelectedIndex = 0;
                window.Tab.IsEnabled     = true;

                window.IsEnabled = true;

                window.ButtonBack.Visibility = Visibility.Hidden;
                window.ReactivateButton(window.ButtonNext);
                window.ReactivateButton(window.ButtonBrowse);
            }));
        }
コード例 #3
0
 public static void HideProgress(eMammalIntegrationWindow window)
 {
     window.LabelProgress.Content    = "";
     window.LabelProgress.Visibility = Visibility.Hidden;
     window.ProgressbarUpdateProgress.Dispatcher.Invoke(() =>
                                                        window.ProgressbarUpdateProgress.Visibility = Visibility.Hidden, DispatcherPriority.Normal);
     window.ProgressbarUpdateProgress.Dispatcher.Invoke(() =>
                                                        window.ProgressbarUpdateProgress.Value = 0, DispatcherPriority.Background);
 }
コード例 #4
0
        public static void SetMessage(eMammalIntegrationWindow window, string msg, bool isError = false, bool showMessageBox = true)
        {
            //window.Visibility = Visibility.Visible;
            //window.TextBlockInfo.Text = msg;
            //TextBlock.Text = msg;

            window.TextBlockInfo.Dispatcher.Invoke(() => window.TextBlockInfo.Visibility = Visibility.Visible, DispatcherPriority.Background);
            window.TextBlockInfo.Dispatcher.Invoke(() => window.TextBlockInfo.Text       = msg, DispatcherPriority.Normal);

            if (isError)
            {
                window.Foreground = new SolidColorBrush(Colors.Red);
            }
            else
            {
                window.Foreground = new SolidColorBrush(Colors.Blue);
            }


            if (showMessageBox)
            {
                SetMessageBox(msg, isError);
            }
        }
コード例 #5
0
 public eMammalIntegration(eMammalIntegrationWindow window)
 {
     this.window = window;
     db          = new eMammalMySQLOps(window);
 }
コード例 #6
0
 public eMammalMySQLOps(eMammalIntegrationWindow window)
 {
     this.window = window;
     connection  = new MySqlConnection(mysqlConnectionstring);
 }