/// <summary> /// Obtains the ArgumentsList contained in a IUServiceContext. /// </summary> /// <param name="arguments">Context Arguments.</param> /// <param name="argumentTypes">Arguments Types.</param> /// <returns>ArgumentsList contained in the context.</returns> private static ArgumentsList GetArgumentListFromArgumentInfoContext( Dictionary <string, IUContextArgumentInfo> arguments, Dictionary <string, ModelType> argumentTypes) { ArgumentsList lResult = null; if ((arguments != null) && (argumentTypes != null)) { lResult = new ArgumentsList(); foreach (KeyValuePair <string, ModelType> largumentType in argumentTypes) { IUContextArgumentInfo argumentInfo = arguments[largumentType.Key]; if (argumentInfo != null) { if (largumentType.Value == ModelType.Oid) { List <Oid> lOids = argumentInfo.Value as List <Oid>; if (lOids != null && lOids.Count == 1) { lResult.Add(largumentType.Key, largumentType.Value, lOids[0], lOids[0].ClassName); } } else { if (argumentInfo.Value != null) { lResult.Add(largumentType.Key, largumentType.Value, argumentInfo.Value, string.Empty); } } } } } return(lResult); }
/// <summary> /// Obtains the ArgumentsList contained in a IUServiceContext. /// </summary> /// <param name="context">Context the list is obtained from.</param> /// <returns>ArgumentsList contained in the context.</returns> private static ArgumentsList GetArgumentListFromArgumentInfoContext(IUServiceContext context) { Dictionary <string, ModelType> largumentTypes = null; ArgumentsList lResult = null; largumentTypes = Logics.Logic.GetInboundArgumentTypes(context.ClassName, context.ContainerName); if (largumentTypes != null) { lResult = GetArgumentListFromArgumentInfoContext(context.InputFields, largumentTypes); } largumentTypes = Logics.Logic.GetOutboundArgumentTypes(context.ClassName, context.ContainerName); if (largumentTypes != null) { if (context.OutputFields != null && context.OutputFields.Count > 0) { foreach (KeyValuePair <string, ModelType> largumentType in largumentTypes) { object argumentInfo = context.OutputFields[largumentType.Key]; if (argumentInfo != null) { if (largumentType.Value == ModelType.Oid) { List <Oid> lOids = argumentInfo as List <Oid>; if (lOids != null && lOids.Count == 1) { lResult.Add(largumentType.Key, largumentType.Value, lOids[0], lOids[0].ClassName); } } else { if (argumentInfo != null) { lResult.Add(largumentType.Key, largumentType.Value, argumentInfo, string.Empty); } } } } } } if (lResult != null) { return(lResult); } return(null); }
/// <summary> /// Obtains the ArgumentsList contained in a IUServiceContext. /// </summary> /// <param name="arguments">Context Arguments.</param> /// <param name="argumentTypes">Arguments Types.</param> /// <returns>ArgumentsList contained in the context.</returns> private static ArgumentsList GetArgumentListFromArgumentInfoContext( Dictionary<string, IUContextArgumentInfo> arguments, Dictionary<string, ModelType> argumentTypes) { ArgumentsList lResult = null; if ((arguments != null) && (argumentTypes != null)) { lResult = new ArgumentsList(); foreach (KeyValuePair<string, ModelType> largumentType in argumentTypes) { IUContextArgumentInfo argumentInfo = arguments[largumentType.Key]; if (argumentInfo != null) { if (largumentType.Value == ModelType.Oid) { List<Oid> lOids = argumentInfo.Value as List<Oid>; if (lOids != null && lOids.Count == 1) { lResult.Add(largumentType.Key, largumentType.Value, lOids[0], lOids[0].ClassName); } } else { if (argumentInfo.Value != null) { lResult.Add(largumentType.Key, largumentType.Value, argumentInfo.Value, string.Empty); } } } } } return lResult; }