/// <summary> /// Добавить новую дочернюю фоновую задачу /// </summary> /// <param name="name">Наименование</param> /// <returns></returns> public BgTaskProgress AddChildProgress(string name) { BgTaskProgress item = new BgTaskProgress(_syncContext, name); _syncContext.RunAsync(() => { _children.Add(item); }); return(item); }
private void RaiseStateChange(TestTickSourceState state, int count, int total) { if (OnStateChange != null) { if (_syncContext != null) { _syncContext.RunAsync(() => { OnStateChange(state, count, total); }); } else { OnStateChange(state, count, total); } } }