private IEnumerator<IResult> GetUnitsOfMeasure() { if (UILib.IsDesignMode()) yield break; GetUnitsOfMeasureRequest getUnitOfMeasuresRequest = new GetUnitsOfMeasureRequest(); yield return getUnitOfMeasuresRequest; if (getUnitOfMeasuresRequest.Error != null) { yield return new HandleExceptionResult(getUnitOfMeasuresRequest.Error); yield break; } Instance.UnitsOfMeasure = getUnitOfMeasuresRequest.Result.Clone(); }
public IEnumerable<IResult> LoadViewUnitsOfMeasure() { if (this.HasLoadedUnitsOfMeasure) yield break; GetUnitsOfMeasureRequest getUnitOfMeasuresRequest = new GetUnitsOfMeasureRequest(); yield return getUnitOfMeasuresRequest; if (getUnitOfMeasuresRequest.Error != null) { yield return new HandleExceptionResult(getUnitOfMeasuresRequest.Error); } this.UnitsOfMeasure = getUnitOfMeasuresRequest.Result; UnitsOfMeasureView.UnitOfMeasureGrid.Enable(defaultFocusDelegate); UnitsOfMeasureView.UnitOfMeasureData.Disable(); NotifyOfPropertyChange(() => AssistantUnitOfMeasureMode); this.HasLoadedUnitsOfMeasure = true; }