Ejemplo n.º 1
0
 public MapSizeDialog(DoneCallback callback)
 {
     this.callback = callback;
     Glade.XML app = new Glade.XML("./MapDesigner.glade", "mapsizedialog", "");
     app.Autoconnect(this);
     Init();
 }
Ejemplo n.º 2
0
 public MapSizeDialog(DoneCallback callback)
 {
     this.callback = callback;
     Glade.XML app = new Glade.XML(EnvironmentHelper.GetExeDirectory() + "/TerrainEditing.glade", "mapsizedialog", "");
     app.Autoconnect(this);
     Init();
 }
Ejemplo n.º 3
0
		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();
		}
Ejemplo n.º 4
0
        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();
                }

            }
        }
Ejemplo n.º 5
0
 protected void Cancelled(object parameter)
 {
     if (DoneCallback != null)
     {
         DoneCallback.Invoke(false, parameter);
     }
 }
Ejemplo n.º 6
0
 protected void Saved(object parameter)
 {
     if (DoneCallback != null)
     {
         DoneCallback.Invoke(true, parameter);
     }
 }
Ejemplo n.º 7
0
 public Renderer(String regionDir, String outPath, UpdateStatus updateStatus = null, DoneCallback callback = null)
 {
     this.regionDir    = regionDir;
     this.outPath      = outPath;
     this.updateStatus = updateStatus;
     this.callback     = callback;
 }
Ejemplo n.º 8
0
        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);
        }
Ejemplo n.º 9
0
        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();
        }
Ejemplo n.º 10
0
 public Renderer(String regionDir, String outPath, UpdateStatus updateStatus = null, DoneCallback callback = null)
 {
     this.regionDir = regionDir;
     this.outPath = outPath;
     this.updateStatus = updateStatus;
     this.callback = callback;
 }
Ejemplo n.º 11
0
 void cmd_Exited(object sender, EventArgs e)
 {
     if (CommitCount.InvokeRequired)
     {
         DoneCallback d = new DoneCallback(SetCount);
         this.Invoke(d, new object[] { });
     }
 }
Ejemplo n.º 12
0
        // 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);
        }
Ejemplo n.º 13
0
        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));
        }
Ejemplo n.º 15
0
 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();
            }
        }
Ejemplo n.º 17
0
        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();
        }
Ejemplo n.º 18
0
        /* 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);
                    }
                }
            });
        }
Ejemplo n.º 19
0
        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);
        }
Ejemplo n.º 20
0
 public MapSizeDialog(DoneCallback callback)
 {
     this.callback = callback;
     Glade.XML app = new Glade.XML( EnvironmentHelper.GetExeDirectory() + "/TerrainEditing.glade", "mapsizedialog", "" );
     app.Autoconnect(this);
     Init();
 }
Ejemplo n.º 21
0
 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();
     }
 }
Ejemplo n.º 22
0
        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));
        }
Ejemplo n.º 23
0
 public MapSizeDialog(DoneCallback callback)
 {
     this.callback = callback;
     Glade.XML app = new Glade.XML("./MapDesigner.glade", "mapsizedialog", "");
     app.Autoconnect(this);
     Init();
 }
Ejemplo n.º 24
0
    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));
    }
Ejemplo n.º 25
0
    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));
    }
Ejemplo n.º 26
0
 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);
 }
Ejemplo n.º 29
0
        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[] { });
            }
        }
Ejemplo n.º 30
0
 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);
 }