/// <summary> /// Solves the dependency rules of a service. /// </summary> /// <param name="context">Current context.</param> /// <param name="lastValue">Old value of the modified argument.</param> /// <param name="dependencyRulesEvent">Event that has been thrown (SetValue, SetEnabled).</param> /// <param name="dependencyRulesAgent">Agent that has thrown the event (User, Internal).</param> public static void ExecuteDependencyRules(IUInputFieldsContext context, object lastValue, DependencyRulesEventLogic dependencyRulesEvent, DependencyRulesAgentLogic dependencyRulesAgent) { // Parameter values. object[] lParameters = new object[4]; lParameters[0] = context; lParameters[1] = lastValue; lParameters[2] = dependencyRulesEvent; lParameters[3] = dependencyRulesAgent; // Parameter types. Type[] lTypes = new Type[4]; lTypes[1] = typeof(object); lTypes[2] = typeof(DependencyRulesEventLogic); lTypes[3] = typeof(DependencyRulesAgentLogic); switch (context.ContextType) { case ContextType.Service: lTypes[0] = typeof(IUServiceContext); ExecuteMethod(GetServiceTypeName(context.ClassName, context.ContainerName), "ExecuteDependencyRules", lTypes, lParameters); break; case ContextType.Filter: lTypes[0] = typeof(IUFilterContext); ExecuteMethod(GetFilterTypeName(context.ClassName, context.ContainerName), "ExecuteDependencyRules", lTypes, lParameters); break; default: break; } }
/// <summary> /// Solves the dependency rules of a service. /// </summary> /// <param name="context">Current context.</param> /// <param name="lastValue">Old value of the modified argument.</param> /// <param name="dependencyRulesEvent">Event that has been thrown (SetValue, SetEnabled).</param> /// <param name="dependencyRulesAgent">Agent that has thrown the event (User, Internal).</param> public static void ExecuteDependencyRules(IUServiceContext context, object lastValue, DependencyRulesEventLogic dependencyRulesEvent, DependencyRulesAgentLogic dependencyRulesAgent) { // Parameter values. object[] lParameters = new object[4]; lParameters[0] = context; lParameters[1] = lastValue; lParameters[2] = dependencyRulesEvent; lParameters[3] = dependencyRulesAgent; // Parameter types. Type[] lTypes = new Type[4]; lTypes[0] = typeof(IUServiceContext); lTypes[1] = typeof(object); lTypes[2] = typeof(DependencyRulesEventLogic); lTypes[3] = typeof(DependencyRulesAgentLogic); ExecuteMethod(GetServiceTypeName(context.ClassName, context.ServiceName), "ExecuteDependencyRules", lTypes, lParameters); }
/// <summary> /// Solves the dependency rules of 'create_instance' inbound arguments, updating the context received as parameter. /// </summary> /// <param name="context">Current context.</param> /// <param name="oldValue">Old value of the modified argument.</param> /// <param name="dependencyRulesEvent">Event that has been thrown (SetValue, SetEnabled).</param> /// <param name="dependencyRulesAgent">Agent that has thrown the event (User, Internal).</param> /// <param name="dependencyRulesCounter">Counter that controls the number of dependency rules executed in order to avoid infinite loops.</param> /// <param name="depRulesCache">Cache in this dependency rule.</param> private static void ExecuteDependencyRules(IUServiceContext context, object oldValue, DependencyRulesEventLogic dependencyRulesEvent, DependencyRulesAgentLogic dependencyRulesAgent, ref int dependencyRulesCounter, DependencyRulesCache depRulesCache) { // Check if the receiver object-valued argument has more than one Oid. if (context.InputFields[context.SelectedInputField].Value is List <Oid> ) { if (((List <Oid>)context.InputFields[context.SelectedInputField].Value).Count > 1) { // If the receiver object-valued argument has more than one Oid, // do not execute dependency rules. return; } } switch (context.SelectedInputField) { default: break; } }
/// <summary> /// Solves the dependency rules of 'create_instance' inbound arguments, updating the context received as parameter. /// </summary> /// <param name="context">Current context.</param> /// <param name="oldValue">Old value of the modified argument.</param> /// <param name="dependencyRulesEvent">Event that has been thrown (SetValue, SetEnabled).</param> /// <param name="dependencyRulesAgent">Agent that has thrown the event (User, Internal).</param> public static void ExecuteDependencyRules(IUServiceContext context, object oldValue, DependencyRulesEventLogic dependencyRulesEvent, DependencyRulesAgentLogic dependencyRulesAgent) { int lDependencyRulesCounter = Properties.Settings.Default.DependencyRulesCounter; DependencyRulesCache depRulesCache = new DependencyRulesCache(); ExecuteDependencyRules(context, oldValue, dependencyRulesEvent, dependencyRulesAgent, ref lDependencyRulesCounter, depRulesCache); }
/// <summary> /// Solves the dependency rules of 'edit_instance' inbound arguments, updating the context received as parameter. /// </summary> /// <param name="context">Current context.</param> /// <param name="oldValue">Old value of the modified argument.</param> /// <param name="dependencyRulesEvent">Event that has been thrown (SetValue, SetEnabled).</param> /// <param name="dependencyRulesAgent">Agent that has thrown the event (User, Internal).</param> public static void ExecuteDependencyRules(IUServiceContext context, object oldValue, DependencyRulesEventLogic dependencyRulesEvent, DependencyRulesAgentLogic dependencyRulesAgent) { int lDependencyRulesCounter = Properties.Settings.Default.DependencyRulesCounter; DependencyRulesCache depRulesCache = new DependencyRulesCache(); ExecuteDependencyRules(context, oldValue, dependencyRulesEvent, dependencyRulesAgent, ref lDependencyRulesCounter, depRulesCache); }
/// <summary> /// Solves the dependency rules of 'edit_instance' inbound arguments, updating the context received as parameter. /// </summary> /// <param name="context">Current context.</param> /// <param name="oldValue">Old value of the modified argument.</param> /// <param name="dependencyRulesEvent">Event that has been thrown (SetValue, SetEnabled).</param> /// <param name="dependencyRulesAgent">Agent that has thrown the event (User, Internal).</param> /// <param name="dependencyRulesCounter">Counter that controls the number of dependency rules executed in order to avoid infinite loops.</param> /// <param name="depRulesCache">Cache in this dependency rule.</param> private static void ExecuteDependencyRules(IUServiceContext context, object oldValue, DependencyRulesEventLogic dependencyRulesEvent, DependencyRulesAgentLogic dependencyRulesAgent, ref int dependencyRulesCounter, DependencyRulesCache depRulesCache) { // Check if the receiver object-valued argument has more than one Oid. if (context.InputFields[context.SelectedInputField].Value is List<Oid>) { if (((List<Oid>)context.InputFields[context.SelectedInputField].Value).Count > 1) { // If the receiver object-valued argument has more than one Oid, // do not execute dependency rules. return; } } switch (context.SelectedInputField) { default: break; } }