public override void OnEnter(GameManager gameManager) { string message = "Now that you've got some wrestlers, lets put them to work in our first event.\n\nFirst, click the 'Create Event' button on the main screen."; InfoDialog dialog = gameManager.GetGUIManager().InstantiateInfoDialog(); dialog.Initialize("Create your first event!", message, new UnityAction(OnFinished)); }
/// <summary> /// Exports currently selected Excel data to a new MySQL table or appends it to an existing MySQL table. /// </summary> /// <param name="toTableObject">Table to append the data to, if null exports to a new table.</param> /// <returns><c>true</c> if the export/append action was executed, <c>false</c> otherwise.</returns> public bool AppendDataToTable(DbTable toTableObject) { DialogResult dr; if (!(Globals.ThisAddIn.Application.Selection is ExcelInterop.Range exportRange)) { return(false); } if (exportRange.Areas.Count > 1) { InfoDialog.ShowDialog(InfoDialogProperties.GetWarningDialogProperties(Resources.MultipleAreasNotSupportedWarningTitle, Resources.MultipleAreasNotSupportedWarningDetail)); return(false); } Cursor = Cursors.WaitCursor; if (toTableObject != null) { using (var appendDataForm = new AppendDataForm(toTableObject, exportRange, ActiveWorksheet.Name)) { dr = appendDataForm.ShowDialog(); } } else { using (var exportForm = new ExportDataForm(WbConnection, exportRange, ActiveWorksheet.Name)) { dr = exportForm.ShowDialog(); } } Cursor = Cursors.Default; return(dr == DialogResult.OK); }
private void TakeLoggedInAction(FacebookOAuthResult facebookOAuthResult) { if (facebookOAuthResult == null) { // the user closed the FacebookLoginDialog, so do nothing. MessageBox.Show("Cancelled!"); return; } // Even though facebookOAuthResult is not null, it could had been an // OAuth 2.0 error, so make sure to check IsSuccess property always. if (facebookOAuthResult.IsSuccess) { // since our respone_type in FacebookLoginDialog was token, // we got the access_token // The user now has successfully granted permission to our app. var dlg = new InfoDialog(facebookOAuthResult.AccessToken); dlg.ShowDialog(); } else { // for some reason we failed to get the access token. // most likely the user clicked don't allow. MessageBox.Show(facebookOAuthResult.ErrorDescription); } }
static bool ShowUpdatesDialogs(Lcd lcd, Buttons btns, bool showDescriptionDialog) { if (WiFiDevice.IsLinkUp()) { try { InfoDialog dialog = null; if (showDescriptionDialog) { dialog = new InfoDialog(font, lcd, btns, "Checking for updates. Please wait", false); dialog.Show(); } if (UpdateAvailable()) { dialog = new InfoDialog(font, lcd, btns, "Software update available. Visit monobrick.dk", true); } else { dialog = new InfoDialog(font, lcd, btns, "No software updates available", true); } dialog.Show(); } catch { InfoDialog dialog = new InfoDialog(font, lcd, btns, "Failed to check for updates", true); dialog.Show(); } } else { var dialog = new InfoDialog(font, lcd, btns, "WiFi device is not pressent", true); dialog.Show(); } return(false); }
private void button5_Click(object sender, EventArgs e) { InfoDialog obj = new InfoDialog(accessToken); obj.fbLogOut(); this.Close(); }
public static void Main(string[] args) { var dialog = new InfoDialog("Start"); dialog.Show(); Motor motorA = new Motor(MotorPort.OutA); Motor motorD = new Motor(MotorPort.OutD); WaitHandle motorWaitHandle; motorA.Off(); motorD.Off(); IMission[] missions = { new Mission1() }; foreach (var mission in missions) { CurrentLogger.Logger.info($"Starting mission {mission.Name}"); MissionRunner.Run(mission); } return; MissionDevelopment dev = new MissionDevelopment(); dev.Start(); }
public override void OnEnter(GameManager gameManager) { string message = string.Format("Congratulations, it looks like you've got the hang of things. Your roster size has increased to {0}, so hire some more wrestlers and start holding bigger and better events!", gameManager.GetPlayerCompany().maxRosterSize); InfoDialog dialog = gameManager.GetGUIManager().InstantiateInfoDialog(); dialog.Initialize("Moving on up!", message, new UnityAction(OnFinished)); }
internal override void OnStarting(BaseWizardForm wizard) { _wiz = (BaseWizardForm)wizard; ConnectionString = _wiz.ConnectionString; if (!string.IsNullOrEmpty(_wiz.ConnectionString)) { var cnn = new MySqlConnection(_wiz.ConnectionString); try { cnn.Open(); } catch (Exception) { var infoProps = InfoDialogProperties.GetInfoDialogProperties(InfoDialog.InfoType.Error, CommandAreaProperties.ButtonsLayoutType.Generic2Buttons, Resources.ErrorTitle, Resources.ErrorOnConnection); infoProps.CommandAreaProperties.Button1Text = "Retry"; infoProps.CommandAreaProperties.Button1DialogResult = DialogResult.Retry; infoProps.CommandAreaProperties.Button2Text = "Cancel"; infoProps.CommandAreaProperties.Button2DialogResult = DialogResult.Cancel; var infoResult = InfoDialog.ShowDialog(infoProps); if (infoResult.DialogResult == DialogResult.Cancel) { listTables.Enabled = false; } } FillTables(_wiz.ConnectionString); } }
private bool DidDownloadSucceed(UnityWebRequest request, bool showError) { string error = null; if (request.result == UnityWebRequest.Result.ConnectionError || request.result == UnityWebRequest.Result.DataProcessingError) { error = "There was a communication error: " + request.error; } else if (request.result == UnityWebRequest.Result.ProtocolError) { error = "There was an HTTP error: " + request.error; } if (!string.IsNullOrEmpty(error)) { // Failure Debug.Log(error); if (showError) { InfoDialog.Create("", error.ToString()); } return(false); } return(true); }
/// <summary> /// Event delegate method fired before the <see cref="MonitorMySqlServerInstancesDialog"/> dialog is closed. /// </summary> /// <param name="sender">Sender object.</param> /// <param name="e">Event arguments.</param> private void MonitorMySQLServerInstancesDialog_FormClosing(object sender, FormClosingEventArgs e) { if (DialogResult != DialogResult.OK || SelectedWorkbenchConnection == null || WorkbenchConnectionsListView.SelectedItems.Count <= 0 || WorkbenchConnectionsListView.SelectedItems[0].Checked) { ResetChangeCursorDelegate(false); return; } var infoProperties = InfoDialogProperties.GetYesNoDialogProperties( InfoDialog.InfoType.Info, Resources.ConnectionAlreadyInInstancesTitle, Resources.ConnectionAlreadyInInstancesDetail, Resources.ConnectionAlreadyInInstancesSubDetail); infoProperties.CommandAreaProperties.DefaultButton = InfoDialog.DefaultButtonType.Button2; infoProperties.CommandAreaProperties.DefaultButtonTimeout = 30; var infoResult = InfoDialog.ShowDialog(infoProperties); if (infoResult.DialogResult == DialogResult.Yes) { ResetChangeCursorDelegate(false); return; } SelectedWorkbenchConnection = null; e.Cancel = true; }
private async void ButtonSaveColor_Click(object sender, RoutedEventArgs e) { string message; string title; InfoDialogType dialogType = InfoDialogType.Info; if (Employee != null && !string.IsNullOrEmpty(_color)) { var result = await Proxy.ChangeEmployeeForegroundColor(Employee.EmployeeId, _color); if (result) { Proxy.UpdateEmployee(Employee); message = "Die Schriftfarbe Deiner Anmeldeinformationsbox wurde geändert"; title = "Erfolg"; } else { message = "Die Schriftfarbe konnte nicht gespeichert werden"; title = "Fehler"; dialogType = InfoDialogType.Error; } } else { message = "Ein Fehler ist aufgetreten"; title = "Fehler"; dialogType = InfoDialogType.Error; } var dialog = new InfoDialog(message, title, dialogType); await dialog.ShowAsync(); }
/// <summary> /// Event delegate method fired when the button to connect to the database is clicked. /// </summary> /// <param name="sender">Sender object.</param> /// <param name="e">Event arguments.</param> protected void ConnectButtonClick(object sender, EventArgs e) { try { using (var connectDialog = new ConnectDialog()) { connectDialog.Connection = Connection; if (connectDialog.ShowDialog() == DialogResult.Cancel) { return; } // Check if the MySQL Server version supports the X Protocol. if (IsHybrid && !connectDialog.Connection.ServerVersionSupportsXProtocol(false)) { InfoDialog.ShowDialog(InfoDialogProperties.GetWarningDialogProperties(Resources.WarningText, Resources.NewConnectionNotXProtocolCompatibleDetail, null, Resources.NewConnectionNotXProtocolCompatibleMoreInfo)); return; } SetConnection(connectDialog.Connection, connectDialog.ConnectionName); ClearResults(); } } catch (MySqlException ex) { MySqlSourceTrace.WriteAppErrorToLog(ex, Resources.NewConnectionErrorDetail, Resources.NewConnectionErrorSubDetail, true); } }
/// <summary> /// Event delegate method fired when one of the items in the fast-switch connections drop-down menu is clicked. /// </summary> /// <param name="sender">Sender object.</param> /// <param name="e">Event arguments.</param> protected virtual void SwitchConnectionItemClick(object sender, EventArgs e) { var connectionMenuItem = sender as ToolStripMenuItem; if (connectionMenuItem == null) { return; } var parent = connectionMenuItem.GetCurrentParent(); if (parent == null) { return; } var connectionName = connectionMenuItem.Text; var connection = Package.GetMySqlConnection(connectionName); if (connection == null) { // The connection is no longer present in the Server Explorer InfoDialog.ShowDialog(InfoDialogProperties.GetErrorDialogProperties( Resources.Editors_SeConnectionNotFoundTitle, string.Format(Resources.Editors_SeConnectionNotFoundDetail, connectionName))); return; } // Switch to the selected connection SetConnection(connection, connectionName); ClearResults(); }
private void VIEW_MODEL_OnError(ChatMasterControlContext sender, UWPX_UI_Context.Classes.Events.OnErrorEventArgs args) { InfoDialog dialog = new InfoDialog(args.TITLE, args.MESSAGE) { Foreground = new SolidColorBrush(Colors.Red) }; }
/// <summary> /// Imports the selected MySQL procedure's result sets into the active <see cref="ExcelInterop.Worksheet"/>. /// </summary> private bool ImportData() { if (_importDataSet == null) { MiscUtilities.ShowCustomizedErrorDialog(string.Format(Resources.UnableToRetrieveData, "procedure", _dbProcedure.Name)); return(false); } if (_sumOfResultSetsExceedsMaxCompatibilityRows && ProcedureResultSetsImportType == DbProcedure.ProcedureResultSetsImportType.AllResultSetsVertically && _importDataSet.Tables.Count > 1) { InfoDialog.ShowDialog(InfoDialogProperties.GetWarningDialogProperties( Resources.ImportVerticallyExceedsMaxRowsTitleWarning, Resources.ImportVerticallyExceedsMaxRowsDetailWarning)); } Cursor = Cursors.WaitCursor; // Refresh import parameter values _dbProcedure.ImportParameters.AddSummaryRow = AddSummaryFieldsCheckBox.Checked; _dbProcedure.ImportParameters.CreatePivotTable = CreatePivotTableCheckBox.Checked; _dbProcedure.ImportParameters.IncludeColumnNames = IncludeHeadersCheckBox.Checked; _dbProcedure.ImportParameters.IntoNewWorksheet = false; // Import the result sets into Excel bool success = _dbProcedure.ImportData(ProcedureResultSetsImportType, _selectedResultSetIndex, _importDataSet); Cursor = Cursors.Default; return(success); }
public override void OnEnter(GameManager gameManager) { string message = string.Format("Wow, you've made some good progress! Your roster size has increased to {0}, and you can now run TV events to make even more money!", gameManager.GetPlayerCompany().maxRosterSize); InfoDialog dialog = gameManager.GetGUIManager().InstantiateInfoDialog(); dialog.Initialize("Moving on up!", message, new UnityAction(OnFinished)); }
protected void LaunchDebugTarget() { Microsoft.VisualStudio.Shell.ServiceProvider sp = new Microsoft.VisualStudio.Shell.ServiceProvider((IOleServiceProvider)Dte); IVsDebugger dbg = (IVsDebugger)sp.GetService(typeof(SVsShellDebugger)); VsDebugTargetInfo info = new VsDebugTargetInfo(); info.cbSize = (uint)Marshal.SizeOf(info); info.dlo = DEBUG_LAUNCH_OPERATION.DLO_CreateProcess; info.bstrExe = Moniker; info.bstrCurDir = @"C:\"; string connectionString = HierarchyAccessor.Connection.ConnectionSupport.ConnectionString + ";Allow User Variables=true;Allow Zero DateTime=true;"; if (connectionString.IndexOf("password", StringComparison.OrdinalIgnoreCase) == -1) { var connection = (MySqlConnection)HierarchyAccessor.Connection.GetLockedProviderObject(); try { var settings = (MySqlConnectionStringBuilder)connection.GetType().GetProperty("Settings", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).GetValue(connection, null); connectionString += "password="******";Persist Security Info=true;"; } finally { HierarchyAccessor.Connection.UnlockProviderObject(); } } info.bstrArg = connectionString; info.bstrRemoteMachine = null; // Environment.MachineName; // debug locally info.fSendStdoutToOutputWindow = 0; // Let stdout stay with the application. info.clsidCustom = new Guid("{EEEE0740-10F7-4e5f-8BC4-1CC0AC9ED5B0}"); // Set the launching engine the sample engine guid info.grfLaunch = 0; IntPtr pInfo = Marshal.AllocCoTaskMem((int)info.cbSize); Marshal.StructureToPtr(info, pInfo, false); try { int result = dbg.LaunchDebugTargets(1, pInfo); if (result != 0 && result != VSConstants.E_ABORT) { throw new ApplicationException("COM error " + result); } } catch (Exception ex) { InfoDialog.ShowDialog(InfoDialogProperties.GetErrorDialogProperties("Debugger Error", ex.GetBaseException().Message)); } finally { if (pInfo != IntPtr.Zero) { Marshal.FreeCoTaskMem(pInfo); } } }
public async void InfoTap(object parameter) { ContentView v = new InfoDialog(); PopupPage p = new InfoDialogPage(v); InfoTextPopup = (string)parameter; await PopupNavigation.PushAsync(p); }
static bool ShowWebServerMenu(Lcd lcd, Buttons btns) { List <IMenuItem> items = new List <IMenuItem> (); var portItem = new MenuItemWithNumericInput(lcd, "Port", settings.WebServerSettings.Port, 1, ushort.MaxValue); portItem.OnValueChanged += delegate(int value) { new Thread(delegate() { settings.WebServerSettings.Port = value; settings.Save(); }).Start(); }; var startItem = new MenuItemWithCheckBox(lcd, "Start server", WebServer.IsRunning(), delegate(bool running) { webServer = new WebServer(settings.WebServerSettings.Port); bool isRunning = running; if (running) { var dialog = new InfoDialog(font, lcd, btns, "Shutting down Web-Server", false); dialog.Show(); webServer.Stop(); dialog = new InfoDialog(font, lcd, btns, "Web-server Stopped!", true); dialog.Show(); isRunning = false; } else { var dialog = new InfoDialog(font, lcd, btns, "Starting Web-Server Please Wait", false, "Web-Server"); dialog.Show(); webServer.CompilingServer += delegate() { dialog.UpdateMessage("Compiling..."); }; webServer.LoadingPage += delegate() { dialog.UpdateMessage("Loading page"); }; webServer.StartingServer += delegate() { dialog.UpdateMessage("Starting server"); }; if (webServer.Restart()) { dialog = new InfoDialog(font, lcd, btns, "Started successfully at port" + settings.WebServerSettings.Port, true); dialog.Show(); isRunning = true; } else { dialog = new InfoDialog(font, lcd, btns, "Failed to start Web-Servers", true); dialog.Show(); isRunning = false; } } return(isRunning); } ); items.Add(portItem); items.Add(startItem); //Show the menu Menu m = new Menu(font, lcd, btns, "Web Server", items); m.Show(); return(false); }
const int REMOTE_COMMAND_STOP = 's'; // 's' public static void Main() { // 構造体の宣言と初期化 var body = new EV3body(); EV3body.init(ref body); // Bluetooth関係のETロボコン拡張機能を有効にする Brick.InstallETRoboExt(); // リモート接続 NetworkStream connection = connect(); // センサーおよびモータに対して初回アクセスをしておく body.color.Read(); body.sonar.Read(); body.gyro.Read(); body.motorL.SetPower(0); body.motorR.SetPower(0); body.motorT.SetPower(0); body.motorL.ResetTacho(); body.motorR.ResetTacho(); body.motorT.ResetTacho(); Balancer.init(); // スタート待ち wait_start(body, connection); var dialogRun = new InfoDialog("Running", false); dialogRun.Show(); //Wait for enter to be pressed try{ run(body, connection); }catch (Exception) { var dialogE = new InfoDialog("Exception.", false); dialogE.Show(); //Wait for enter to be pressed } body.motorL.Off(); body.motorR.Off(); body.motorT.Off(); // ソケットを閉じる if (connection != null) { connection.Close(); } Lcd.Instance.Clear(); Lcd.Instance.Update(); if (Debugger.IsAttached) { Brick.ExitToMenu(); // MonoBrickメインメニューへ戻る } }
public Dialogs() { // Loop until the user enters the correct information. retry: // Create a Steamp3.UI.InputDialog and display it to the user. InputDialog input = new InputDialog("Please enter your name:", "John Doe"); if (input.ShowDialog() == DialogResult.OK) { // Create a Steamp3.UI.InfoDialog and allow the user to verify. InfoDialog info = new InfoDialog("Are you sure this name is correct?" + Environment.NewLine + input.TextBox.Text, InfoDialog.InfoButtons.YesNo); if (info.ShowDialog() == DialogResult.No) goto retry; // Create another Steamp3.UI.InfoDialog and display it to the user. InfoDialog info2 = new InfoDialog("Hello " + input.TextBox.Text + "!"); info2.ShowDialog(); } }
private void mSubmitButton_Click(object sender, WindowLibrary.Controls.EventArgs e) { ScreenManager.MainWindow.DisableClientControl("Account Login"); string username = mUsername.Text.MysqlEscape(); string password = mPassword.Text.MysqlEscape(); if (username.Length < 4 || password.Length < 4) { InfoDialog msg = new InfoDialog(WindowManager, "Login fehlgeschlagen", "Dein Name und Passwort\nmüssen mindestens 4 Zeichen lang sein!", "Icon.Warning"); msg.Init(); msg.IconVisible = false; msg.BtnOK.ModalResult = EModalResult.None; // any other close the root msg.Closing += new WindowClosingEventHandler(msg_Closed); ScreenManager.MainWindow.Add(msg); return; } DataTable result = Game.MySql.Query("SELECT u.*, g.level, g.name AS groupName FROM `user` AS u LEFT JOIN `groups` AS g ON g.id = u.groupID WHERE u.username = '******' AND u.password = '******'", username, password); if (result.Rows.Count == 0) { InfoDialog msg = new InfoDialog(WindowManager, "Login fehlgeschlagen", "User nicht gefunden!\nBitte überprüfe deinen Username und Passwort\nnoch einmal und versuche es erneut.", "Icon.Error"); msg.Init(); msg.IconVisible = false; msg.BtnOK.ModalResult = EModalResult.None; // any other close the root msg.Closing += new WindowClosingEventHandler(msg_Closed); ScreenManager.MainWindow.Add(msg); return; } ScreenManager.MainWindow.EnableClientControl("Account Login"); Game.Player = new InsaneRO.Cards.Client.Classes.GamePlayer(result.Rows[0]); // switch to control center ScreenManager.AddScreen(new ScreenControlCenter(Game)); ExitScreen(); }
private FileInfo RunQmake(FileInfo mainInfo, string ext, bool recursive, VersionInformation vi) { string name = mainInfo.Name.Remove(mainInfo.Name.IndexOf('.')); FileInfo VCInfo = new FileInfo(mainInfo.DirectoryName + "\\" + name + ext); if (!VCInfo.Exists || DialogResult.Yes == MessageBox.Show(SR.GetString("ExportProject_ProjectExistsRegenerateOrReuse", VCInfo.Name), SR.GetString("ProjectExists"), MessageBoxButtons.YesNo, MessageBoxIcon.Question)) { Messages.PaneMessage(dteObject, "--- (Import): Generating new project of " + mainInfo.Name + " file"); InfoDialog dialog = new InfoDialog(mainInfo.Name); QMake qmake = new QMake(dteObject, mainInfo.FullName, recursive, vi); qmake.CloseEvent += new QMake.ProcessEventHandler(dialog.CloseEventHandler); qmake.PaneMessageDataEvent += new QMake.ProcessEventHandlerArg(this.PaneMessageDataReceived); System.Threading.Thread qmakeThread = new System.Threading.Thread(new ThreadStart(qmake.RunQMake)); qmakeThread.Start(); dialog.ShowDialog(); qmakeThread.Join(); if (qmake.ErrorValue == 0) return VCInfo; } return null; }
protected virtual void OnShowClicked(object sender, System.EventArgs e) { InfoDialog dialog = new InfoDialog(); dialog.Title = "Contents of the Business Object"; dialog.Message = _bindable.Data.BusinessObj.Username + "," + _bindable.Data.BusinessObj.Password + "," + _bindable.Data.BusinessObj.Email + "," + _bindable.Data.BusinessObj.Desk; dialog.Show(); }
private static void ExecuteMatrixInfo(RigEditorViewModel param) { var sb = new StringBuilder(); foreach (RigResource.RigResource.Bone b in param.Manager.Bones) { GetInfo(param.Manager, b, sb); } var dialog = new InfoDialog(sb.ToString(), "Matrix Info"); dialog.ShowDialog(); }
// Constructor AKA entry point of the plug-in (Required). public HelloWorld() { // Create a Steamp3.UI.InfoDialog and display it to the user. InfoDialog info = new InfoDialog("Hello world!"); info.ShowDialog(); }