public static void Configurate() { Configurator.CreateStartMenuDirectory(); Configurator.CreateShortcuts(); view.Dispatcher.Invoke(() => { OnComplite?.Invoke(); }); }
static public void Sorting(int[] array, Func <int, int, bool> comparer) { for (int i = 1; i < array.Length; i++) { int tmp = array[i]; int j = i; while (j > 0 && comparer.Invoke(array[j - 1], tmp)) { array[j] = array[j - 1]; j--; } array[j] = tmp; } OnComplite?.Invoke(); }
private async void Worker() { if (!isActive) { return; } var source = await loader.GetSourceByPage(); var parserA = new HtmlParser(); var document = await parserA.ParseAsync(source); Thread myThread;// = new Thread(new ThreadStart(Count)); var result = parser.Parse(document); OnNewData?.Invoke(this, result); OnComplite?.Invoke(this); isActive = false; }
public void Play(string clipRes, OnComplite onComplete, bool unscaleTime) { anim = gameObject.GetComponent <Animation>(); if (anim == null) { anim = gameObject.AddComponent <Animation>(); } AnimationClip ac = ResLoad.get(clipRes).asset <AnimationClip>(); anim.AddClip(ac, ac.name); if (unscaleTime) { StartCoroutine(Play(ac.name, onComplete)); } else { anim.Play(ac.name); } }
public void SortMyArr <T>(T[] arr, Func <T, T, bool> comp) { if (comp == null) { throw new ArgumentNullException("Array is empty!"); } for (int i = 0; i < arr.Length; i++) { for (int j = i + 1; j < arr.Length; j++) { if (comp(arr[i], arr[j])) { var move = arr[i]; arr[i] = arr[j]; arr[j] = move; } } } OnComplite.Invoke("Done!"); }
private async void Worker() { if (!isActive) { return; } try { var source = await loader.GetSourceByPage(); var parserA = new HtmlParser(); var document = await parserA.ParseAsync(source); var result = parser.Parse(document); OnNewData?.Invoke(this, result); OnComplite?.Invoke(this); isActive = false; } catch (Exception e) { } }
IEnumerator Play(string clipName, OnComplite onComplete) { AnimationState _currState = anim[clipName]; bool isPlaying = true; float _progressTime = 0F; float _timeAtLastFrame = 0F; float _timeAtCurrentFrame = 0F; float deltaTime = 0F; anim.Play(clipName); _timeAtLastFrame = Time.realtimeSinceStartup; while (isPlaying) { _timeAtCurrentFrame = Time.realtimeSinceStartup; deltaTime = _timeAtCurrentFrame - _timeAtLastFrame; _timeAtLastFrame = _timeAtCurrentFrame; _progressTime += deltaTime; _currState.normalizedTime = _progressTime / _currState.length; anim.Sample(); if (_progressTime >= _currState.length) { if (_currState.wrapMode != WrapMode.Loop) { isPlaying = false; } else { _progressTime = 0.0f; } } yield return(null); } if (onComplete != null) { onComplete(); } }
public void Abort() { isActive = false; OnComplite?.Invoke(this); }