Example #1
0
 private void RestoreResponseLabelUpdate(string Message)
 {
     if (RtReslbl.IsHandleCreated)
     {
         RtReslbl?.Invoke((MethodInvoker)(() =>
         {
             RtReslbl.Text = Message;
             //RtReslbl.Update();
         }));
     }
 }
Example #2
0
 private void RestoreResponseLabelInitialise()
 {
     if (RtReslbl.IsHandleCreated)
     {
         RtReslbl?.Invoke((MethodInvoker)(() =>
         {
             RtReslbl.UseCustomBackColor = true;
             RtReslbl.UseCustomForeColor = true;
             RtReslbl.ForeColor = Color.FromArgb(203, 252, 142);
             RtReslbl.BackColor = Color.FromArgb(31, 72, 20);
             RtReslbl.TextAlign = ContentAlignment.MiddleLeft;
             RtReslbl.FontSize = MetroFramework.MetroLabelSize.Small;
             //RtReslbl.Update();
         }));
     }
 }
Example #3
0
        private void ReDrawUI(string message, string ListboxMessage, Color ForeColor, Color BackColor, ContentAlignment Alignment, bool OverrideListViewForeColor, Color ListViewForeColor)
        {
            if (mtTabctrl.IsHandleCreated)
            {
                mtTabctrl.Invoke((MethodInvoker)(() => {
                    if (mtTabctrl.SelectedTab == mtPagebackup)
                    {
                        AddBackupListView(message);
                        AddBackupListView(string.Concat(Enumerable.Repeat("=", ListboxMessage.Length)));

                        if (OverrideListViewForeColor)
                        {
                            AddBackupListView(ListboxMessage, ListViewForeColor);
                        }
                        else
                        {
                            AddBackupListView(ListboxMessage, BackColor);
                        }

                        AddBackupListView(string.Concat(Enumerable.Repeat("=", ListboxMessage.Length)));

                        if (BckReslbl.IsHandleCreated)
                        {
                            BckReslbl.Invoke((MethodInvoker)(() =>
                            {
                                BckReslbl.UseCustomForeColor = true;
                                BckReslbl.UseCustomBackColor = true;
                                BckReslbl.TextAlign = Alignment;
                                BckReslbl.BackColor = BackColor;
                                BckReslbl.ForeColor = ForeColor;
                                BckReslbl.FontSize = MetroFramework.MetroLabelSize.Medium;
                                BckReslbl.Text = message;
                            }));
                        }


                        mtbtnRestore.Invoke((MethodInvoker)(() => {
                            mtbtnRestore.Visible = false;
                        }));

                        mtbtnBackup.Invoke((MethodInvoker)(() => {
                            mtbtnBackup.Enabled = true;
                            mtbtnBackup.Visible = true;
                        }));
                    }
                    else if (mtTabctrl.SelectedTab == mtPagerestore)
                    {
                        AddRestoreListView(message);
                        AddRestoreListView(string.Concat(Enumerable.Repeat("=", ListboxMessage.Length)));


                        if (OverrideListViewForeColor)
                        {
                            AddRestoreListView(ListboxMessage, ListViewForeColor);
                        }
                        else
                        {
                            AddRestoreListView(ListboxMessage, BackColor);
                        }

                        AddRestoreListView(string.Concat(Enumerable.Repeat("=", ListboxMessage.Length)));

                        if (RtReslbl.IsHandleCreated)
                        {
                            RtReslbl.Invoke((MethodInvoker)(() =>
                            {
                                RtReslbl.UseCustomForeColor = true;
                                RtReslbl.UseCustomBackColor = true;
                                RtReslbl.TextAlign = Alignment;
                                RtReslbl.BackColor = BackColor;
                                RtReslbl.ForeColor = ForeColor;
                                RtReslbl.FontSize = MetroFramework.MetroLabelSize.Medium;
                                RtReslbl.Text = message;
                            }));
                        }

                        mtbtnBackup.Invoke((MethodInvoker)(() => {
                            mtbtnBackup.Visible = false;
                        }));

                        mtbtnRestore.Invoke((MethodInvoker)(() => {
                            mtbtnRestore.Enabled = true;
                            mtbtnRestore.Visible = true;
                        }));
                    }
                    else
                    {
                        if (mtbtnBackup.Visible)
                        {
                            AddBackupListView(message);
                            AddBackupListView(string.Concat(Enumerable.Repeat("=", ListboxMessage.Length)));

                            if (OverrideListViewForeColor)
                            {
                                AddBackupListView(ListboxMessage, ListViewForeColor);
                            }
                            else
                            {
                                AddBackupListView(ListboxMessage, BackColor);
                            }

                            AddBackupListView(string.Concat(Enumerable.Repeat("=", ListboxMessage.Length)));

                            if (BckReslbl.IsHandleCreated)
                            {
                                BckReslbl.Invoke((MethodInvoker)(() =>
                                {
                                    BckReslbl.UseCustomForeColor = true;
                                    BckReslbl.UseCustomBackColor = true;
                                    BckReslbl.TextAlign = Alignment;
                                    BckReslbl.BackColor = BackColor;
                                    BckReslbl.ForeColor = ForeColor;
                                    BckReslbl.FontSize = MetroFramework.MetroLabelSize.Medium;
                                    BckReslbl.Text = message;
                                }));
                            }

                            if (mtbtnBackup.IsHandleCreated)
                            {
                                mtbtnBackup.Invoke((MethodInvoker)(() => mtbtnBackup.Enabled = true));
                            }
                        }
                        else
                        {
                            AddRestoreListView(message);
                            AddRestoreListView(string.Concat(Enumerable.Repeat("=", ListboxMessage.Length)));


                            if (OverrideListViewForeColor)
                            {
                                AddRestoreListView(ListboxMessage, ListViewForeColor);
                            }
                            else
                            {
                                AddRestoreListView(ListboxMessage, BackColor);
                            }

                            AddRestoreListView(string.Concat(Enumerable.Repeat("=", ListboxMessage.Length)));

                            if (RtReslbl.IsHandleCreated)
                            {
                                RtReslbl.Invoke((MethodInvoker)(() =>
                                {
                                    RtReslbl.UseCustomForeColor = true;
                                    RtReslbl.UseCustomBackColor = true;
                                    RtReslbl.TextAlign = Alignment;
                                    RtReslbl.BackColor = BackColor;
                                    RtReslbl.ForeColor = ForeColor;
                                    RtReslbl.FontSize = MetroFramework.MetroLabelSize.Medium;
                                    RtReslbl.Text = message;
                                }));
                            }

                            if (mtbtnRestore.IsHandleCreated)
                            {
                                mtbtnRestore.Invoke((MethodInvoker)(() => mtbtnRestore.Enabled = true));
                            }
                        }
                    }
                }));

                mtTabctrl.Invoke((MethodInvoker)(() => {
                    EnableTabPage(mtPagebackup, true);
                    ShowTabPage(mtTabctrl, mtPagebackup);
                    EnableTabPage(mtPagerestore, true);
                    ShowTabPage(mtTabctrl, mtPagerestore);
                    EnableTabPage(mtPagesettings, true);
                }));
            }

            if (mttxtboxUserID.IsHandleCreated)
            {
                mttxtboxUserID.Invoke((MethodInvoker)(() => mttxtboxUserID.Enabled = true));
            }

            if (mtbtnCancel.IsHandleCreated)
            {
                mtbtnCancel.Invoke((MethodInvoker)(() => mtbtnCancel.Enabled = false));
            }
        }