public MapSizeDialog(DoneCallback callback) { this.callback = callback; Glade.XML app = new Glade.XML("./MapDesigner.glade", "mapsizedialog", ""); app.Autoconnect(this); Init(); }
public MapSizeDialog(DoneCallback callback) { this.callback = callback; Glade.XML app = new Glade.XML(EnvironmentHelper.GetExeDirectory() + "/TerrainEditing.glade", "mapsizedialog", ""); app.Autoconnect(this); Init(); }
public HeightMapSizeDialog( DoneCallback source ) { this.source = source; window = new Window ("Heightmap width and height:"); window.SetDefaultSize (200, 100); Table table = new Table( 3, 2, false ); table.BorderWidth = 20; table.RowSpacing = 20; table.ColumnSpacing = 20; window.Add(table); table.Attach(new Label("Width:"), 0, 1, 0, 1); table.Attach(new Label("Height:"), 0, 1, 1, 2); widthcombo = new Combo(); widthcombo.PopdownStrings = new string[]{"4","8","12","16","20","24","28","32"}; table.Attach(widthcombo, 1, 2, 0, 1); heightcombo = new Combo(); heightcombo.PopdownStrings = new string[]{"4","8","12","16","20","24","28","32"}; table.Attach(heightcombo, 1, 2, 1, 2); Button button = new Button (Stock.Ok); button.Clicked += new EventHandler (OnOkClicked); button.CanDefault = true; table.Attach(button, 1, 2, 2, 3); window.Modal = true; window.ShowAll(); }
private void Done() { if (link.InvokeRequired) { // It's on a different thread, so use Invoke. DoneCallback d = new DoneCallback(Done); this.Invoke(d, new object[] {}); } else { progressBar1.Visible = false; link.Text = UpdateUrl; link.Visible = true; if (UpdateFound) { UpdateLabel.Text = "There is a new version available"; } else { UpdateLabel.Text = "No updates found"; if (AutoClose) this.Close(); } } }
protected void Cancelled(object parameter) { if (DoneCallback != null) { DoneCallback.Invoke(false, parameter); } }
protected void Saved(object parameter) { if (DoneCallback != null) { DoneCallback.Invoke(true, parameter); } }
public Renderer(String regionDir, String outPath, UpdateStatus updateStatus = null, DoneCallback callback = null) { this.regionDir = regionDir; this.outPath = outPath; this.updateStatus = updateStatus; this.callback = callback; }
public static AnimationBehaviour CreateAnimation(this MonoBehaviour monoBehaviour, IAnimationEase ease, float duration, float delay = 0f, string name = null, StartCallback startCallback = null, UpdateCallback updateCallback = null, CancelCallback cancelCallback = null, DoneCallback doneCallback = null, FinishCallback finishCallback = null, bool single = false, bool considerTimeScale = false, object data = null, bool inverse = false) { if (single) { if (string.IsNullOrEmpty(name)) { Debug.Log("Animation can just be single if its name is not empty neither null."); } else { CancelAnimations(monoBehaviour, name); } } var gameObject = monoBehaviour.gameObject; var anim = gameObject.AddComponent <AnimationBehaviour>(); anim.Delay = delay; anim.Name = name; anim.Ease = ease; anim.StartCallback = startCallback; anim.UpdateCallback = updateCallback; anim.FinishCallback = finishCallback; anim.Duration = duration; anim.DoneCallback = doneCallback; anim.CancelCallback = cancelCallback; anim.ConsiderTimeScale = considerTimeScale; anim.Data = data ?? monoBehaviour; anim.Inverse = inverse; anim.Start(); return(anim); }
public HeightMapSizeDialog(DoneCallback source) { this.source = source; window = new Window("Heightmap width and height:"); window.SetDefaultSize(200, 100); Table table = new Table(3, 2, false); table.BorderWidth = 20; table.RowSpacing = 20; table.ColumnSpacing = 20; window.Add(table); table.Attach(new Label("Width:"), 0, 1, 0, 1); table.Attach(new Label("Height:"), 0, 1, 1, 2); widthcombo = new Combo(); widthcombo.PopdownStrings = new string[] { "4", "8", "12", "16", "20", "24", "28", "32" }; table.Attach(widthcombo, 1, 2, 0, 1); heightcombo = new Combo(); heightcombo.PopdownStrings = new string[] { "4", "8", "12", "16", "20", "24", "28", "32" }; table.Attach(heightcombo, 1, 2, 1, 2); Button button = new Button(Stock.Ok); button.Clicked += new EventHandler(OnOkClicked); button.CanDefault = true; table.Attach(button, 1, 2, 2, 3); window.Modal = true; window.ShowAll(); }
void cmd_Exited(object sender, EventArgs e) { if (CommitCount.InvokeRequired) { DoneCallback d = new DoneCallback(SetCount); this.Invoke(d, new object[] { }); } }
// Create a pending HTTP GET request to the server static AsyncHTTPClient CreateJSONRequest(string url, DoneCallback callback) { AsyncHTTPClient client = new AsyncHTTPClient(url); client.header["X-Unity-Session"] = ActiveOrUnauthSessionID + GetToken(); client.doneCallback = WrapJsonCallback(callback); client.Begin(); return(client); }
public static AnimationBehaviour CreateAnimation(this MonoBehaviour monoBehaviour, AnimationEaseType easeType, float duration, float delay = 0f, string name = null, StartCallback startCallback = null, UpdateCallback updateCallback = null, CancelCallback cancelCallback = null, DoneCallback doneCallback = null, FinishCallback finishCallback = null, bool single = false, bool considerTimeScale = false, object data = null, bool inverse = false) { var ease = AnimationHelper.EaseTypeToFunction(easeType); return(CreateAnimation(monoBehaviour, ease, duration, delay, name, startCallback, updateCallback, cancelCallback, doneCallback, finishCallback, single, considerTimeScale, data, inverse)); }
private void Post(string message, DoneCallback callback = null) { // Handles only one request at a time. if (IsRequestPending) { return; } IsRequestPending = true; string postUrl = connection.GeneratePostURL(message); StartCoroutine(ContactServer(postUrl, callback)); }
public void Show(TranslationClient translationClient, string[] selectedLangCodes, bool autoTranlate, DoneCallback callback) { this.callback = callback; Visibility = Visibility.Visible; autoTranlateCheckBox.IsChecked = autoTranlate; if (langs == null) { LoadLangs(translationClient, selectedLangCodes); } else { SelectLangs(selectedLangCodes); } }
private IEnumerator ContactServer(string url, DoneCallback callback = null) { IsResultReady = false; WWW www = new WWW(url); yield return(www); // Computation resumes automatically after www arrives. Result = www.text; IsResultReady = true; IsRequestPending = false; if (callback != null) { callback(); } }
public void StartCalibration(DoneCallback callback) { _callback = callback; if (_dotUnderPen != null) { Destroy(_dotUnderPen.gameObject); } if (_dashedLine != null) { Destroy(_dashedLine.gameObject); } _calibrationPoints.Clear(); _dashedLine = CreateLineRenderer(); _dotUnderPen = CreateCursor(); }
/* TODO: Implement PUT from a filepath in back end curl code * // Create a pending HTTP PUT request to the server * static void CreateJSONRequestPut(string url, string filepath, * DoneCallback callback) { * AsyncHTTPClient job = new AsyncHTTPClient(url, "PUT"); * client.SetUploadFilePath(filepath); * client.header["X-Unity-Session"] = ActiveOrUnauthSessionID + GetToken(); * client.doneCallback = WrapJsonCallback(callback); * client.Begin(); * } */ /* Handle HTTP results and forward them to the original callback. * * This will callback any handler registered for requests that has finished. */ private static AsyncHTTPClient.DoneCallback WrapJsonCallback(DoneCallback callback) { return(delegate(IAsyncHTTPClient job) { if (job.IsDone()) { try { AssetStoreResponse c = ParseContent(job); callback(c); } catch (Exception ex) { Debug.Log("Uncaught exception in async net callback: " + ex.Message); Debug.Log(ex.StackTrace); } } }); }
private void DoneMessage(TimeSpan timeSpan) { var callback = new DoneCallback(t => { MessageBox.Show($"It took {t} to complete.", "Done", MessageBoxButtons.OK, MessageBoxIcon.Information); this.groupBox1.Enabled = true; this.groupBox2.Enabled = true; this.groupBox3.Enabled = true; progressBar1.Value = 0; this.label6.Text = "Ready to convert."; }); Invoke(callback, timeSpan); }
public MapSizeDialog(DoneCallback callback) { this.callback = callback; Glade.XML app = new Glade.XML( EnvironmentHelper.GetExeDirectory() + "/TerrainEditing.glade", "mapsizedialog", "" ); app.Autoconnect(this); Init(); }
void gitCommand_Exited(object sender, EventArgs e) { if (Ok.InvokeRequired) { // It's on a different thread, so use Invoke. DoneCallback d = new DoneCallback(Done); this.Invoke(d, new object[] { }); } else { Done(); } }
public static AnimationBehaviour CreateAnimation <TEase>(this MonoBehaviour monoBehaviour, float duration, float delay = 0f, string name = null, StartCallback startCallback = null, UpdateCallback updateCallback = null, CancelCallback cancelCallback = null, DoneCallback doneCallback = null, FinishCallback finishCallback = null, bool single = false, bool considerTimeScale = true, object data = null, bool inverse = false) where TEase : IAnimationEase, new() { var ease = new TEase(); return(CreateAnimation(monoBehaviour, ease, duration, delay, name, startCallback, updateCallback, cancelCallback, doneCallback, finishCallback, single, considerTimeScale, data, inverse)); }
public static void GetMetaData(AssetStorePublisher publisherAccount, PackageDataSource packageDataSource, DoneCallback callback) { Type doneCallbackType; var doneCallback = CreateCallbackDelegate("DoneCallback", callback, out doneCallbackType); s_Instance.GetRuntimeType().Invoke("GetMetaData", publisherAccount.GetRuntimeObject().Param(), packageDataSource.GetRuntimeObject().Param(), new Parameter(doneCallback, doneCallbackType)); }
public static void UploadAssets(Package package, string localRootGuid, string localRootPath, string projectPath, string draftAssetsPath, DoneCallback callback, AssetStoreClient.ProgressCallback progressCallback) { Type doneCallbackType, clientProgressCallbackType; var doneCallback = CreateCallbackDelegate("DoneCallback", callback, out doneCallbackType); var clientProgressCallback = AssetStoreClient.CreateCallbackDelegate("ProgressCallback", progressCallback, out clientProgressCallbackType); s_Instance.GetRuntimeType().Invoke("UploadAssets", package.GetRuntimeObject().Param(), localRootGuid.Param(), localRootPath.Param(), projectPath.Param(), draftAssetsPath.Param(), new Parameter(doneCallback, doneCallbackType), new Parameter(clientProgressCallback, clientProgressCallbackType)); }
private void gitCountCommitsCommand_Exited(object sender, EventArgs e) { if (Revisions.InvokeRequired) { DoneCallback d = new DoneCallback(SetRowCount); this.Invoke(d, new object[] { }); } }
/// <summary> /// Retrieves all entries from the server. /// </summary> public void GetAllEntries(DoneCallback callback = null) { Get(COMMAND_LOAD_ALL, callback); }
/// <summary> /// Retrieves the last n entry from the server. /// </summary> /// <param name="n">How many entries to retrieve.</param> public void GetLastEntries(int n, DoneCallback callback = null) { Get(COMMAND_LOAD_N + n, callback); }
void gitGetCommitsCommand_Exited(object sender, EventArgs e) { RevisionList = revisionGraphCommand.Revisions; if (Revisions.InvokeRequired) { // It's on a different thread, so use Invoke. DoneCallback d = new DoneCallback(LoadRevisions); this.Invoke(d, new object[] { }); } }
void gitCommands_Exited(object sender, EventArgs e) { if (Unstaged.InvokeRequired) { // It's on a different thread, so use Invoke. DoneCallback d = new DoneCallback(LoadUnstagedOutput); this.Invoke(d, new object[] {}); } else { LoadUnstagedOutput(); } }
/// <summary> /// Retrieves the last entry from the server. /// </summary> public void GetLastEntry(DoneCallback callback = null) { Get(COMMAND_LOAD_LAST, callback); }