/// <summary> /// 获取扩展字典值 /// </summary> /// <param name="comData">通用数据</param> /// <param name="key">键</param> /// <returns>扩展字典值</returns> public static object GetExtendValue(this CommonUseData comData, string key) { if (comData == null || string.IsNullOrWhiteSpace(key) || comData.Extend.IsNullOrCount0()) { return(null); } return(comData.Extend.ContainsKey(key) ? comData.Extend[key] : null); }
/// <summary> /// 获取Token,如果里面的为空,则会执行App.GetTokenFunc() /// </summary> /// <param name="comData">通用数据</param> /// <returns>Token</returns> public static string GetToken(this CommonUseData comData) { if (comData == null || string.IsNullOrWhiteSpace(comData.Token)) { return(App.GetTokenFunc != null?App.GetTokenFunc() : null); } else { return(comData.Token); } }
/// <summary> /// 获取事件ID,如果里面的为空,则会执行theOperation.EventId,如果传入的theOperation为null,则会执行 App.TheOperation.EventId /// </summary> /// <param name="comData">通用数据</param> /// <param name="theOperation">本次操作</param> /// <returns>事件ID</returns> public static string GetEventId(this CommonUseData comData, ITheOperation theOperation = null) { if (comData == null || string.IsNullOrWhiteSpace(comData.EventId)) { theOperation = theOperation == null ? App.TheOperation : theOperation; if (theOperation == null) { return(null); } return(theOperation.EventId); } else { return(comData.EventId); } }
/// <summary> /// 获取标签 /// </summary> /// <param name="comData">通用数据</param> /// <returns>扩展字典值</returns> public static object GetTag(this CommonUseData comData) { return(comData == null ? null : comData.Tag); }
/// <summary> /// 获取当前用户 /// </summary> /// <param name="comData">通用数据</param> /// <returns>当前用户</returns> public static object GetCurrUser(this CommonUseData comData) { return(comData != null ? comData.CurrUser : null); }