Esempio n. 1
0
 public UjfChangePeriodForm(UjfApartmentHouseInspection inspection, System.Windows.Forms.IWin32Window owner)
 {
     this.InitializeComponent();
     this.set_Font(Manager.WindowFont);
     this.mOwner = owner;
     this.mInspection = inspection;
 }
        public static InputFormResult ShowModal(System.Windows.Forms.IWin32Window owner, string caption, string title, string defaultText)
        {
            InputForm theForm = new InputForm();

            theForm.InitializeComponent();
            theForm.lblCaption.Text = caption;
            theForm.Text            = title;
            theForm.txtInput.Text   = defaultText;
            theForm.ShowDialog(owner);

            return(GetResult(theForm));
        }
        /// <summary>
        /// Does the login.
        /// </summary>
        /// <param name="window">The window.</param>
        /// <param name="bcApp">The bc application.</param>
        /// <param name="function_code">The function_code.</param>
        /// <param name="isForceChack">if set to <c>true</c> [is force chack].</param>
        /// <returns>Boolean.</returns>
        public static Boolean doLogin(System.Windows.Forms.IWin32Window window, BCApplication bcApp, string function_code, bool isForceChack)//A0.01
        {
            //return true;
            string  loginUserID = bcApp.LoginUserID;
            Boolean hasAuth     = false;

            if (!isForceChack && !SCUtility.isEmpty(loginUserID))
            {
                hasAuth = bcApp.SCApplication.UserBLL.checkUserAuthority(loginUserID, function_code);
            }

            if (hasAuth)
            {
                return(true);
            }

            //            LoginPopupForm loginForm = new LoginPopupForm(function_code);
            //如果已經有人登入了,就必須已切換帳號的方式再次登入
            LoginPopupForm loginForm = new LoginPopupForm(function_code, isForceChack ? false : BCUtility.isLogin(bcApp));

            System.Windows.Forms.DialogResult result = loginForm.ShowDialog(window);
            loginUserID = loginForm.getLoginUserID();
            string loginPassword = loginForm.getLoginPassword();

            if (result == System.Windows.Forms.DialogResult.OK)
            {
                loginForm.Dispose();
            }
            else
            {
                loginForm.Dispose();
                return(false);
            }
            Boolean loginSuccess = false;

            if (!SCUtility.isEmpty(loginUserID))
            {
                loginSuccess = bcApp.SCApplication.UserBLL.checkUserPassword(loginUserID, loginPassword);
            }
            if (loginSuccess)
            {
                bcApp.login(loginUserID);
                hasAuth = bcApp.SCApplication.UserBLL.checkUserAuthority(loginUserID, function_code);
            }

            if (!hasAuth)
            {
                MessageBox.Show(window, BCApplication.getMessageString("NO_AUTHORITY"),
                                BCApplication.getMessageString("WARNING"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }

            return(hasAuth);
        }
        public override System.Windows.Forms.DialogResult CreateContent(System.Windows.Forms.IWin32Window dialogOwner, ref string content)
        {
            using (WebImageForm form = new WebImageForm())
            {
                if (form.ShowDialog() == DialogResult.OK && !String.IsNullOrEmpty(form.ImageUrl))
                {
                    content = String.Format(CultureInfo.InvariantCulture, @"<img wlApplyDefaultMargins=""true"" src=""{0}"" />", HttpUtility.HtmlEncode(form.ImageUrl));
                }

                return(form.DialogResult);
            }
        }
Esempio n. 5
0
        /// <summary>
        /// Show updates.
        /// </summary>
        /// <param name="owner"></param>
        /// <param name="showAddins">Are addIns show or only application updates.</param>
        /// <param name="onlyNew"></param>
        /// <param name="DisabledItems">collection of disabled addins.</param>
        /// <returns></returns>
        public static ProtocolUpdateStatus ShowUpdates(System.Windows.Forms.IWin32Window owner, bool showAddins, bool onlyNew, out string[] DisabledItems)
        {
            GXAddInList            localAddins;
            string                 path = Path.Combine(GXCommon.ProtocolAddInsPath, "updates.xml");
            DataContractSerializer x    = new DataContractSerializer(typeof(GXAddInList));

            lock (m_sync)
            {
                if (!System.IO.File.Exists(path))
                {
                    localAddins = new GXAddInList();
                }
                else
                {
                    try
                    {
                        using (FileStream reader = new FileStream(path, FileMode.Open))
                        {
                            localAddins = (GXAddInList)x.ReadObject(reader);
                        }
                    }
                    catch (Exception)
                    {
                        try
                        {
                            File.Delete(path);
                        }
                        catch
                        {
                            //It's OK if this fails.
                        }
                        localAddins = new GXAddInList();
                    }
                }
            }
            AddInsForm dlg = new AddInsForm(localAddins, showAddins, onlyNew);

            if (dlg.ShowDialog(owner) == System.Windows.Forms.DialogResult.OK)
            {
                List <string> items = new List <string>();
                foreach (GXAddIn it in localAddins)
                {
                    if (it.Type == GXAddInType.AddIn && (it.State & AddInStates.Disabled) != 0)
                    {
                        items.Add(it.Name);
                    }
                }
                DisabledItems = items.ToArray();
                return(dlg.Status);
            }
            DisabledItems = new string[0];
            return(ProtocolUpdateStatus.None);
        }
Esempio n. 6
0
        public System.Windows.Forms.DialogResult ShowDialog(System.Windows.Forms.IWin32Window owner, List <Scale> chrds, frmFretBoard frm)
        {
            m_boardChords = chrds;
            m_fretBoard   = frm;
            lstChords.Items.Clear();
            foreach (Scale s in m_boardChords)
            {
                lstChords.Items.Add(s);
            }

            return(this.ShowDialog(owner));
        }
Esempio n. 7
0
 /// <summary>
 /// Shows missing files when a project is opened.
 /// </summary>
 /// <param name="parent">
 /// Parent form.
 /// </param>
 /// <param name="fileListArray">
 /// Arraylist containing the paths of the missing files.
 /// </param>
 /// <returns></returns>
 public DialogResult ShowMissingFilesDialog(System.Windows.Forms.IWin32Window parent, ArrayList fileListArray)
 {
     infoLabel.Text    = "Following items do not exist! Click OK to remove them from the project.";
     yesButton.Visible = false;
     noButton.Text     = "OK";
     filesList.Items.Clear();
     foreach (string fileName in fileListArray)
     {
         filesList.Items.Add(fileName);
     }
     return(ShowDialog(parent));
 }
Esempio n. 8
0
 public BypassForm(System.Windows.Forms.IWin32Window parent, ManagementForm mf)
 {
     InitializeComponent();
     MainDashboard  = mf;
     this.MdiParent = parent as DashboardForm;
     string[] servers      = Enum.GetNames(typeof(SERVERS));
     string[] servers_mode = Enum.GetNames(typeof(SERVER_MODE));
     comboBoxServer.Items.AddRange(servers);
     comboBoxMode.Items.AddRange(servers_mode);
     comboBoxMode.SelectedIndex   = 0;
     comboBoxServer.SelectedIndex = 0;
 }
Esempio n. 9
0
        static public TranslateBrowser Create(WebTranslate.TranslateBase trans, System.Windows.Forms.IWin32Window parent)
        {
            if (instance != null)
            {
                instance.translate(trans);
                return(instance);
            }
            TranslateBrowser browser = new TranslateBrowser(trans);

            //browser.Show( parent );
            browser.Show(); // 親よりも後ろに配置できる
            return(browser);
        }
Esempio n. 10
0
        private bool ShowUI(System.Windows.Forms.IWin32Window parentWindow)
        {
            HDFSConnectionManagerUIForm frm = new HDFSConnectionManagerUIForm(connectionManager, serviceProvider);

            var result = frm.ShowDialog();

            if (result == DialogResult.OK)
            {
                return(true);
            }

            return(false);
        }
Esempio n. 11
0
 public static bool ShowYesNoMessage(System.Windows.Forms.IWin32Window owner, string text, string caption)
 {
     //string strMsg = MessageBox.Show(owner, text, caption, MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
     if (MessageBox.Show(owner, text, caption, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
     {
         // if (MessageBox.Show(text) == DialogResult.Yes)
         return(true);
     }
     else
     {
         return(false);
     }
 }
        // コンストラクタ(シングルトンなのでprivate)
        private MyDotView(MainForm mF)
        {
            mainform = mF;
            //ここは一番大事!
            mainform.Text = "";

            _WindowHandle  = mF;
            DvCtl          = new DV.Control();
            dPanelFixed    = new DV.GVIEW_PANEL_INFO();
            dPanelBlinking = new DV.GVIEW_PANEL_INFO();
            EquipmentName  = null;
            TextSize       = 0;
            GrpX           = 0; GrpY = 0;
        }
Esempio n. 13
0
        public MainViewModel(MainWindow mainWindow)
        {
            _mainWindow  = mainWindow;
            _win32Window = new WindowWrapper(new WindowInteropHelper(_mainWindow).Handle);

            try
            {
                Initialize();
            }
            catch (Exception ex)
            {
                FlexibleMessageBox.Show($"There was an error getting the Items List\n\n{ex.Message}", $"Items List Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 14
0
 /// <summary>
 /// Show a input dialog and return user input text , if cancel by user , return null.
 /// </summary>
 /// <param name="ParentWindow">parent form</param>
 /// <param name="strTitle">description</param>
 /// <param name="strCaption">caption</param>
 /// <param name="strDefaultValue">initialize value</param>
 /// <returns>text that user input , if canceld , return null</returns>
 public static string InputBox(System.Windows.Forms.IWin32Window ParentWindow, string strTitle, string strCaption, string strDefaultValue)
 {
     using (dlgInputBox dlg = new dlgInputBox())
     {
         dlg.lblTitle.Text = strTitle;
         dlg.Text          = strCaption;
         dlg.TextValue     = strDefaultValue;
         if (dlg.ShowDialog(ParentWindow) == System.Windows.Forms.DialogResult.OK)
         {
             return(dlg.txtInput.Text);
         }
     }
     return(null);
 }
Esempio n. 15
0
        public bool Edit(System.Windows.Forms.IWin32Window parentWindow, Variables vars, Connections cons)
        {
            // Create and display the form for the user interface.
            CouchbaseSourceAdapterUIForm componentEditor = new CouchbaseSourceAdapterUIForm(cons, vars, md);

            DialogResult result = componentEditor.ShowDialog(parentWindow);

            if (result == DialogResult.OK)
            {
                return(true);
            }

            return(false);
        }
Esempio n. 16
0
        /// <summary>
        /// Extends the glass window frame into the client area of the specified window.
        /// </summary>
        /// <param name="window">The <see cref="IWin32Window"/> on which to enable client area glass.</param>
        /// <param name="glassMargin">The the margins to use when extending the frame into the client area.</param>
        /// <remarks>
        /// <para>
        ///   Use negative margins to create the "sheet of glass" effect where the client area is rendered
        ///   as a completely glass surface.
        /// </para>
        /// <para>
        ///   The glass area must be filled with either a black brush or the <see cref="Form.TransparencyKey" /> color
        ///   in order to display correctly. If the <see cref="Form.TransparencyKey"/> method is used, clicks in the
        ///   glass area will "fall through" the window to the window below it. If the black brush method is used, text
        ///   rendered with the <see cref="TextRenderer" /> will not display correctly on the glass area (this includes
        ///   text drawn by most controls). To draw text on the glass area, use <see cref="DrawCompositedText"/>.
        /// </para>
        /// <para>
        ///   This method needs to be called again if the state of the Desktop Window Manager is toggled.
        /// </para>
        /// </remarks>
        /// <exception cref="ArgumentNullException"><paramref name="window"/> is <see langword="null" />.</exception>
        /// <exception cref="NotSupportedException">The current operating system does not support glass, or the Desktop Window Manager is not enabled.</exception>
        public static void ExtendFrameIntoClientArea(this System.Windows.Forms.IWin32Window window, Padding glassMargin)
        {
            if (!IsDwmCompositionEnabled)
            {
                throw new NotSupportedException(Properties.Resources.GlassNotSupportedError);
            }

            if (window == null)
            {
                throw new ArgumentNullException("window");
            }

            NativeMethods.MARGINS margins = new NativeMethods.MARGINS(glassMargin);
            NativeMethods.DwmExtendFrameIntoClientArea(window.Handle, ref margins);
        }
Esempio n. 17
0
        /// <summary>
        /// Extends the glass window frame into the client area of the specified window.
        /// </summary>
        /// <param name="window">The <see cref="IWin32Window"/> on which to enable client area glass.</param>
        /// <param name="glassMargin">The the margins to use when extending the frame into the client area.</param>
        /// <remarks>
        /// <para>
        ///   Use negative margins to create the "sheet of glass" effect where the client area is rendered
        ///   as a completely glass surface.
        /// </para>
        /// <para>
        ///   The glass area must be filled with either a black brush or the <see cref="Form.TransparencyKey" /> color
        ///   in order to display correctly. If the <see cref="Form.TransparencyKey"/> method is used, clicks in the
        ///   glass area will "fall through" the window to the window below it. If the black brush method is used, text
        ///   rendered with the <see cref="TextRenderer" /> will not display correctly on the glass area (this includes
        ///   text drawn by most controls). To draw text on the glass area, use <see cref="DrawCompositedText"/>.
        /// </para>
        /// <para>
        ///   This method needs to be called again if the state of the Desktop Window Manager is toggled.
        /// </para>
        /// </remarks>
        /// <exception cref="ArgumentNullException"><paramref name="window"/> is <see langword="null" />.</exception>
        /// <exception cref="NotSupportedException">The current operating system does not support glass, or the Desktop Window Manager is not enabled.</exception>
        public static void ExtendFrameIntoClientArea(this System.Windows.Forms.IWin32Window window, Padding glassMargin)
        {
            if (!IsDwmCompositionEnabled)
            {
                throw new NotSupportedException("The current operating system does not support glass, or the Desktop Window Manager is not enabled.");
            }

            if (window == null)
            {
                throw new ArgumentNullException("window");
            }

            Natives.MARGINS margins = new Natives.MARGINS(glassMargin);
            Natives.DwmExtendFrameIntoClientArea(window.Handle, ref margins);
        }
Esempio n. 18
0
        /// <summary>
        /// Displays configuration dialog to user.  This allows the user
        /// to generate or configure a unique AmphetaRate id.
        /// </summary>
        /// <param name="parent"></param>
        public void Configure(System.Windows.Forms.IWin32Window parent)
        {
            string amphetaID = this.UserID;

            using (ConfigurationForm form = new ConfigurationForm())
            {
                form.AmphetaRateID = (amphetaID == null ? "" : amphetaID);

                DialogResult result = form.ShowDialog(parent);
                if (result == DialogResult.OK)
                {
                    this.UserID = form.AmphetaRateID;                     //Writes it to the configuration.
                }
            }
        }
Esempio n. 19
0
        static internal void InitSysMenu(System.Windows.Forms.IWin32Window wnd)
        {
            IntPtr sysMenuHandle = About.GetSystemMenu(wnd.Handle, false);

            About.AppendMenu(sysMenuHandle, About.MF_SEPARATOR, new IntPtr(0), string.Empty);
            Assembly crt = Assembly.GetExecutingAssembly();

            object[] attr = crt.GetCustomAttributes(typeof(AssemblyDescriptionAttribute), true);
            AssemblyDescriptionAttribute desc = attr[0] as AssemblyDescriptionAttribute;

            About.AppendMenu(sysMenuHandle, About.MF_STRING, new IntPtr(About.IDM_ABOUT), "About " + desc.Description);
            if (_wndHook == null)
            {
                _wndHook = new MsgHookWindow(wnd);
            }
        }
        /// <summary>
        /// Called when user double clicks the component to edit it.
        /// </summary>
        /// <param name="parentWindow">The parent window.</param>
        /// <param name="variables">The variables.</param>
        /// <param name="connections">The connections.</param>
        /// <returns>Boolean indicating where component has changed.</returns>
        public bool Edit(System.Windows.Forms.IWin32Window parentWindow, Microsoft.SqlServer.Dts.Runtime.Variables variables, Microsoft.SqlServer.Dts.Runtime.Connections connections)
        {
            var dialog = new SetWebsiteAddressDialog();

            var websiteAddressProperty = componentMeta.CustomPropertyCollection["Website Address"];

            dialog.WebsiteAddress = websiteAddressProperty.Value;

            if (dialog.ShowDialog(parentWindow) == DialogResult.OK)
            {
                websiteAddressProperty.Value = dialog.WebsiteAddress;
                return(true);
            }

            return(false);
        }
Esempio n. 21
0
        protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
        {
            IDialogVisualizerService modalService = windowService ?? throw new ApplicationException("This debugger does not support modal visualizers");

            WinForms.IWin32Window parentWindow = windowService as WinForms.IWin32Window ?? throw new ApplicationException("This debugger does not support modal visualizers");

            using (DpiAwareness.EnterDpiScope(DpiAwarenessContext.PerMonitorAwareV2))
            {
                Grid2VisualizerWindow window = new Grid2VisualizerWindow((IVisualizerObjectProvider2)objectProvider);

                window.SetOwner(parentWindow.Handle);
                window.RemoveIcon();
                window.RemoveMinButton();
                window.ShowDialog();
            }
        }
Esempio n. 22
0
        /// <summary>
        /// Shows the dialog
        /// </summary>
        /// <param name="owner">The window to use as the owner</param>
        /// <returns></returns>
        public bool ShowDialog(System.Windows.Forms.IWin32Window owner)
        {
            if (handle != IntPtr.Zero)
            {
                throw new InvalidOperationException();
            }

            BrowseInfo bi = new BrowseInfo();

            if (owner != null)
            {
                bi.hwndOwner = owner.Handle;
            }

            return(ShowDialogInternal(ref bi));
        }
Esempio n. 23
0
        public bool New(System.Windows.Forms.IWin32Window parentWindow, Microsoft.SqlServer.Dts.Runtime.Connections connections, ConnectionManagerUIArgs connectionUIArg)
        {
            IDtsClipboardService clipboardService;

            clipboardService = (IDtsClipboardService)serviceProvider.GetService(typeof(IDtsClipboardService));
            if (clipboardService != null)
            // If connection manager has been copied and pasted, take no action.
            {
                if (clipboardService.IsPasteActive)
                {
                    return(true);
                }
            }

            return(ShowUI(parentWindow));
        }
        /// <summary>
        /// 單純進行Login動作
        /// </summary>
        /// <param name="window">The window.</param>
        /// <param name="bcApp">The bc application.</param>
        /// <returns>Boolean.</returns>
        public static Boolean doLogin(System.Windows.Forms.IWin32Window window, BCApplication bcApp)
        {
            string  loginUserID = bcApp.LoginUserID;
            Boolean hasAuth     = false;

            if (!SCUtility.isEmpty(loginUserID))
            {
                MessageBox.Show(window, BCApplication.getMessageString("Already_Login"),
                                BCApplication.getMessageString("INFO"), MessageBoxButtons.OK, MessageBoxIcon.Information);
                return(false);
            }
            LoginPopupForm loginForm = new LoginPopupForm(BCAppConstants.FUNC_LOGIN);

            System.Windows.Forms.DialogResult result = loginForm.ShowDialog(window);
            loginUserID = loginForm.getLoginUserID();
            string loginPassword = loginForm.getLoginPassword();

            if (result == System.Windows.Forms.DialogResult.OK)
            {
                loginForm.Dispose();
            }
            else
            {
                loginForm.Dispose();
                return(false);
            }
            Boolean loginSuccess = false;

            if (!SCUtility.isEmpty(loginUserID))
            {
                loginSuccess = bcApp.SCApplication.UserBLL.checkUserPassword(loginUserID, loginPassword);
            }
            if (loginSuccess)
            {
                bcApp.login(loginUserID);
                hasAuth = bcApp.SCApplication.UserBLL.checkUserAuthority(loginUserID, BCAppConstants.FUNC_LOGIN);
                MessageBox.Show(window, BCApplication.getMessageString("Log in success."),
                                BCApplication.getMessageString("INFO"), MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            if (!hasAuth)
            {
                MessageBox.Show(window, BCApplication.getMessageString("NO_AUTHORITY"),
                                BCApplication.getMessageString("WARNING"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }

            return(hasAuth);
        }
Esempio n. 25
0
 /// <summary>
 /// Displays the input box as a modal dialog box with the specified owner.
 /// </summary>
 /// <param name="owner">The <see cref="System.Windows.Forms.IWin32Window"/> that will be the owner of the dialog box.</param>
 /// <returns>The <see cref="DialogResult"/></returns>
 public DialogResult ShowDialog(System.Windows.Forms.IWin32Window owner)
 {
     using( InputDialogForm frm = new InputDialogForm() )
     {
         frm.MainInstruction = MainInstruction;
         frm.Content = Content;
         frm.Text = WindowTitle;
         frm.Input = Input;
         frm.UsePasswordMasking = UsePasswordMasking;
         frm.MaxLength = MaxLength;
         frm.OkButtonClicked += new EventHandler<OkButtonClickedEventArgs>(InputBoxForm_OkButtonClicked);
         DialogResult result = frm.ShowDialog(owner);
         if( result == DialogResult.OK )
             Input = frm.Input;
         return result;
     }
 }
Esempio n. 26
0
        /// <summary>
        /// Allows you to add a new record in the Title table.
        /// </summary>
        /// <param name="caller">The IWin32Window this form will display in front of.</param>
        /// <param name="formTitle">Title of this form.</param>
        /// <param name="connectionString">A valid connection string.</param>
        public void AddNewRecord(System.Windows.Forms.IWin32Window caller, string formTitle, string connectionString)
        {
            this.Text = formTitle;

            this.lastKnownConnectionType = Bob.DataClasses.ConnectionType.ConnectionString;
            this.connectionString        = connectionString;

            RequestForeignTables();
            EmptyControls();

            this.Control_Title.HandleTextChanged(null, null);

            Check_cmdOK_Button(null);

            ProcessHiddenAndDisabledControlStatus(true);

            this.ShowDialog(caller);
        }
Esempio n. 27
0
 public void ShowDialog(System.Windows.Forms.IWin32Window Owner)
 {
     if (_ConfigureDialog.ShowDialog(Owner) == DialogResult.OK)
     {
         try
         {
             _Presenter.SaveOptions();
         }
         catch (Exception e)
         {
             Logger.Global.Exception(Module.Source, e);
         }
     }
     else
     {
         _Presenter.CancelOptions();
     }
 }
Esempio n. 28
0
        /// <summary>
        /// Allows you to add a new record in the tblCategory table.
        /// </summary>
        /// <param name="caller">The IWin32Window this form will display in front of.</param>
        /// <param name="formTitle">Title of this form.</param>
        /// <param name="sqlConnection">A valid System.Data.SqlClient.SqlConnection.</param>
        public void AddNewRecord(System.Windows.Forms.IWin32Window caller, string formTitle, System.Data.SqlClient.SqlConnection sqlConnection)
        {
            this.Text = formTitle;

            this.lastKnownConnectionType = OlymarsDemo.DataClasses.ConnectionType.SqlConnection;
            this.sqlConnection           = sqlConnection;

            RequestForeignTables();
            EmptyControls();

            this.Control_Cat_StrName.HandleTextChanged(null, null);

            Check_cmdOK_Button(null);

            ProcessHiddenAndDisabledControlStatus(true);

            this.ShowDialog(caller);
        }
Esempio n. 29
0
        public bool Configuration(System.Windows.Forms.IWin32Window parent)
        {
            if (_working)
            {
                MessageBox.Show(parent, "Konfiguracja jest niedostępna w trakcie działania skryptu korzystającego z tego modułu.", "Uwaga", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return(false);
            }
            ConfigurationDialog cd = new ConfigurationDialog(XMLConfiguration.Load(), _log, this);

            if (cd.ShowDialog(parent) == System.Windows.Forms.DialogResult.OK)
            {
                cd.Configuration.Save();
                _configuration = cd.Configuration;
                LoadVariables();
                return(true);
            }
            return(false);
        }
Esempio n. 30
0
 public static WF.DialogResult ShowMessage(WF.IWin32Window owner = null, string text = null, string caption = null, WF.MessageBoxButtons buttons = WF.MessageBoxButtons.OK, WF.MessageBoxIcon icon = WF.MessageBoxIcon.Information, WF.MessageBoxDefaultButton defaultButton = WF.MessageBoxDefaultButton.Button1)
 {
     if (owner == null)
     {
         owner = GetMainForm();
     }
     if (string.IsNullOrEmpty(text))
     {
         text = "Informace nebyla zadána";
     }
     if (string.IsNullOrEmpty(caption))
     {
         caption = AppTitle;
     }
     if (owner != null && owner is WF.Form form && form.InvokeRequired)
     {
         return((WF.DialogResult)form.Invoke(new Func <WF.IWin32Window, string, string, WF.MessageBoxButtons, WF.MessageBoxIcon, WF.MessageBoxDefaultButton, WF.DialogResult>(_ShowMessage), owner, text, caption, buttons, icon, defaultButton));
     }
        //A0.07 Add Start
        public static Boolean doLogout(System.Windows.Forms.IWin32Window window, WindownApplication app)
        {
            string  loginUserID   = app.LoginUserID;
            Boolean hasLogout     = false;
            var     confirmResult = TipMessage_Request_Light.Show("Are you sure to log out now?");

            if (confirmResult != DialogResult.Yes)
            {
                hasLogout = false;
                return(false);
            }
            else
            {
                app.logoff();
                hasLogout = true;
                TipMessage_Type_Light.Show("", "Logout success!", BCAppConstants.INFO_MSG);
            }
            return(hasLogout);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="OkButtonClickedEventArgs"/> class with the specified input text
 /// and input box window.
 /// </summary>
 /// <param name="input">The current value of the input field on the dialog.</param>
 /// <param name="inputBoxWindow">The input box window.</param>
 public OkButtonClickedEventArgs(string input, System.Windows.Forms.IWin32Window inputBoxWindow)
 {
     _input = input;
     _inputBoxWindow = inputBoxWindow;
 }