public static T GetRequiredEnumViewState <T>(StateBag viewState, string fieldName) where T : struct { T?returnValue = WebFormsHelper.GetEnumViewState <T>(viewState, fieldName); if (!returnValue.HasValue) { throw new Exception(string.Format("Missing required ViewState {0} value \"{1}\"", typeof(T).Name, fieldName)); } return(returnValue.Value); }
protected T GetEnumViewState <T>(string fieldName, T defaultValue) where T : struct { return(WebFormsHelper.GetEnumViewState <T>(this.ViewState, fieldName, defaultValue)); }
public static T GetEnumViewState <T>(StateBag viewState, string fieldName, T defaultValue) where T : struct { T?returnValue = WebFormsHelper.GetEnumViewState <T>(viewState, fieldName); return(returnValue.GetValueOrDefault(defaultValue)); }
protected T?GetEnumViewState <T>(string fieldName) where T : struct { return(WebFormsHelper.GetEnumViewState <T>(this.ViewState, fieldName)); }