public Guid AsyncStatusChange(string statusText, Cursor cursor) { if (!this.IsHandleCreated) { throw new InvalidOperationException( "Cannot change status when window handle is not created."); } Guid guid = Guid.NewGuid(); DataActionStatusState state = new DataActionStatusState(statusText, cursor); statusTable.Add(guid, state); Status = statusText; Cursor = cursor; return(guid); }
public void AsyncStatusRevert(Guid statusGuid, string revertStatus) { if (!this.IsHandleCreated) { throw new InvalidOperationException( "Cannot revert status when window handle is not created."); } statusTable.Remove(statusGuid); if (statusTable.Count != 0) { DataActionStatusState last = statusTable.Last().Value; Status = last.Message; Cursor = last.Cursor; } else { Status = string.IsNullOrEmpty(revertStatus) ? DefaultStatus : revertStatus; Cursor = Cursors.Default; } }