/// <summary> /// Occurs when trigger presentation (magnifying glass) of the object-valued Argument is triggered. /// </summary> /// <param name="sender">Sender object.</param> /// <param name="e">TriggerEventArgs.</param> protected void HandleTriggerExecute(object sender, TriggerEventArgs e) { // Actualize the context. IUContext lContext = null; if (Parent != null) { Parent.UpdateContext(); lContext = Parent.Context; } // Initialize class and service name. string lClassName = string.Empty; string lContainerName = string.Empty; if (IsServiceField) { IUServiceController lServiceController = Parent as IUServiceController; if (lServiceController != null) { lClassName = lServiceController.ClassName; lContainerName = lServiceController.Name; } } else if (IsFilterField) { IUFilterController lFilterController = Parent as IUFilterController; if (lFilterController != null) { IUPopulationContext lPopContext = lFilterController.Parent.Context as IUPopulationContext; lClassName = lPopContext.ClassName; lContainerName = lFilterController.Context.FilterName; lContext = lPopContext; } } // Create exchange information. ExchangeInfoSelectionForward lInfo = new ExchangeInfoSelectionForward( Domain, mSelectionScenario, lClassName, lContainerName, Name, MultiSelectionAllowed, IsNavigationalFilter, lContext); // Launch scenario. ScenarioManager.LaunchSelectionScenario(lInfo, this); }
/// <summary> /// Configures the scenarion depending on the context. /// </summary> /// <param name="context">Context.</param> public override void ConfigureByContext(IUContext context) { IUMasterDetailContext lContext = context as IUMasterDetailContext; if (lContext.Master == null) { return; } // Master Master.ConfigureByContext(lContext.Master); // Details for (int i = 0; i < lContext.Details.Count; i++) { Details[i].ConfigureByContext(lContext.Details[i]); } // Default base.ConfigureByContext(context); }
/// <summary> /// Set argument Controller values from argument Context values. /// </summary> /// <param name="context"></param> public override void ConfigureByContext(IUContext context) { ConfigureInputFieldsByContext(Context); base.ConfigureByContext(context); }
/// <summary> /// Obtains the NavigationalFiltering contained in a IUContext. /// </summary> /// <param name="context">Context the NavigationalFiltering is obtained from.</param> /// <returns>NavigationalFiltering contained in the context.</returns> public static NavigationalFiltering GetNavigationalFiltering(IUContext context) { NavigationalFiltering lResult = null; if (HasNavigationalFiltering(context)) { switch (context.ExchangeInformation.ExchangeType) { case ExchangeType.Navigation: { ExchangeInfoNavigation lExchangeInfo = context.ExchangeInformation as ExchangeInfoNavigation; lResult = new NavigationalFiltering( new SelectedObjectNavigationFiltering( lExchangeInfo.NavigationalFilterIdentity, lExchangeInfo.SelectedOids[0])); } break; case ExchangeType.Action: { ExchangeInfoAction lExchangeInfo = context.ExchangeInformation as ExchangeInfoAction; if ((lExchangeInfo.SelectedOids == null) || (lExchangeInfo.SelectedOids.Count == 0) || (lExchangeInfo.SelectedOids[0] == null)) { IUServiceContext lServiceContext = context.ExchangeInformation.Previous as IUServiceContext; ArgumentsList lArguments = ArgumentsList.GetArgumentsFromContext(lServiceContext); lResult = new NavigationalFiltering( new ServiceIUNavigationFiltering( lExchangeInfo.NavigationalFilterIdentity, lArguments)); } else { lResult = new NavigationalFiltering( new SelectedObjectNavigationFiltering( lExchangeInfo.NavigationalFilterIdentity, lExchangeInfo.SelectedOids[0])); } } break; case ExchangeType.SelectionForward: { ExchangeInfoSelectionForward lExchangeInfo = context.ExchangeInformation as ExchangeInfoSelectionForward; ArgumentsList lArguments = null; IUServiceContext lServiceContext = null; IUPopulationContext lPopulationContext = null; string lClassName = string.Empty; // context is of IUServiceContext type. if (context.ExchangeInformation.Previous.ContextType == ContextType.Service) { lServiceContext = context.ExchangeInformation.Previous as IUServiceContext; lArguments = ArgumentsList.GetArgumentsFromContext(lServiceContext); lClassName = lServiceContext.ClassName; if (string.Compare(lClassName, "Global", true) == 0) { lClassName = string.Empty; } lResult = new NavigationalFiltering( new ArgumentNavigationFiltering( lClassName, lServiceContext.ServiceName, lServiceContext.SelectedInputField, lArguments)); } // context is of lPopulationContext type. if (context.ExchangeInformation.Previous.ContextType == ContextType.Population) { lPopulationContext = context.ExchangeInformation.Previous as IUPopulationContext; lClassName = lPopulationContext.ClassName; string lFilterName = lExchangeInfo.ServiceName; string lFilterVariableName = lExchangeInfo.ArgumentName; lArguments = ArgumentsList.GetArgumentsFromContext(lPopulationContext.Filters[lFilterName]); lResult = new NavigationalFiltering( new FilterVariableNavigationFiltering( lClassName, lFilterName, lFilterVariableName, lArguments)); } } break; case ExchangeType.SelectionBackward: break; default: break; } } return lResult; }
/// <summary> /// Determines if the IUContext has a NavigationalFiltering. /// </summary> /// <param name="context">Context checked if has a NavigationalFiltering.</param> /// <returns>True or false, if has a NavigationalContext within or not.</returns> public static bool HasNavigationalFiltering(IUContext context) { return (context.ExchangeInformation == null ? false : context.ExchangeInformation.NavigationalFilter); }
/// <summary> /// Sets the context data and configurations to arguments controller. /// </summary> /// <param name="context">Reference to Service Context.</param> public override void ConfigureByContext(IUContext context) { IUServiceContext lContext = context as IUServiceContext; //--------------------------- // InBound Arguments. //--------------------------- // If the controller is a controller for inbound arguments. if(!IsOutboundArgumentController) { ConfigureInputFieldsByContext(context as IUInputFieldsContext); } //--------------------------- // OutBound Arguments. //--------------------------- else { // Argument values foreach (ArgumentController lArgument in OutputFields) { // Sets Argument values. lArgument.Value = lContext.GetOutputFieldValue(lArgument.Name); } } // Default base.ConfigureByContext(context); }
/// <summary> /// Initializes a new instance of 'IUServiceController', class name and service name are indicated. /// </summary> /// <param name="name">Name of the Interaction Unit.</param> /// <param name="alias">Alias of the Interaction Unit.</param> /// <param name="idXML">IdXML of the Interaction Unit.</param> /// <param name="agents">List of agents.</param> /// <param name="className">Class name.</param> /// <param name="serviceName">Service name.</param> /// <param name="context">Context.</param> /// <param name="parent">Parent controller.</param> /// <param name="nextPreviousFeature">Indicates whether the Next & Previous feature is enabled or not.</param> public IUServiceController( string name, string alias, string idXML, string[] agents, string className, string interactionUnitServiceName, IUContext context, IUController parent, bool nextPreviousFeature) : base() { // Service Name. Name = name; // Interaction Unit Alias. Alias = alias; // Interaction Unit Identify. IdXML = idXML; List<string> lAgents = new List<string>(agents); Agents = lAgents; // Interaction Unit Class Name. ClassName = className; // Interaction Unit Service Name. InteractionUnitServiceName = interactionUnitServiceName; // Interaction Unit Context. Context = (IUServiceContext)context; // Interaction Unit Parent. Parent = parent; // Allow/Disable next previous feature NextPreviousFeature = nextPreviousFeature; // Allow Input Argument List InputFields = new ArgumentControllerList(); // Allow Output Argument List OutputFields = new ArgumentControllerList(); }
/// <summary> /// Initializes a new instance of 'IUServiceController', class name and service name are indicated. /// </summary> /// <param name="name">Name of the Interaction Unit.</param> /// <param name="alias">Alias of the Interaction Unit.</param> /// <param name="idXML">IdXML of the Interaction Unit.</param> /// <param name="agents">List of agents.</param> /// <param name="className">Class name.</param> /// <param name="serviceName">Service name.</param> /// <param name="context">Context.</param> /// <param name="parent">Parent controller.</param> public IUServiceController(string name, string alias, string idXML, string[] agents, string className, string interactionUnitServiceName, IUContext context, IUController parent) : this(name, alias, idXML, agents, className, interactionUnitServiceName, context, parent, false) { }
/// <summary> /// Configures the scenarion depending on the context. /// </summary> /// <param name="context">Context.</param> public override void ConfigureByContext(IUContext context) { IUMasterDetailContext lContext = context as IUMasterDetailContext; if (lContext.Master == null) return; // Master Master.ConfigureByContext(lContext.Master); // Details for (int i = 0; i < lContext.Details.Count; i++) { Details[i].ConfigureByContext(lContext.Details[i]); } // Default base.ConfigureByContext(context); }
/// <summary> /// Configures the controller from the data context. /// </summary> /// <param name="context">IU context</param> public virtual void ConfigureByContext(IUContext context) { }
/// <summary> /// Obtains the NavigationalFiltering contained in a IUContext. /// </summary> /// <param name="context">Context the NavigationalFiltering is obtained from.</param> /// <returns>NavigationalFiltering contained in the context.</returns> public static NavigationalFiltering GetNavigationalFiltering(IUContext context) { NavigationalFiltering lResult = null; if (HasNavigationalFiltering(context)) { switch (context.ExchangeInformation.ExchangeType) { case ExchangeType.Navigation: { ExchangeInfoNavigation lExchangeInfo = context.ExchangeInformation as ExchangeInfoNavigation; lResult = new NavigationalFiltering( new SelectedObjectNavigationFiltering( lExchangeInfo.NavigationalFilterIdentity, lExchangeInfo.SelectedOids[0])); } break; case ExchangeType.Action: { ExchangeInfoAction lExchangeInfo = context.ExchangeInformation as ExchangeInfoAction; if ((lExchangeInfo.SelectedOids == null) || (lExchangeInfo.SelectedOids.Count == 0) || (lExchangeInfo.SelectedOids[0] == null)) { IUServiceContext lServiceContext = context.ExchangeInformation.Previous as IUServiceContext; ArgumentsList lArguments = ArgumentsList.GetArgumentsFromContext(lServiceContext); lResult = new NavigationalFiltering( new ServiceIUNavigationFiltering( lExchangeInfo.NavigationalFilterIdentity, lArguments)); } else { lResult = new NavigationalFiltering( new SelectedObjectNavigationFiltering( lExchangeInfo.NavigationalFilterIdentity, lExchangeInfo.SelectedOids[0])); } } break; case ExchangeType.SelectionForward: { ExchangeInfoSelectionForward lExchangeInfo = context.ExchangeInformation as ExchangeInfoSelectionForward; ArgumentsList lArguments = null; IUServiceContext lServiceContext = null; IUPopulationContext lPopulationContext = null; string lClassName = string.Empty; // context is of IUServiceContext type. if (context.ExchangeInformation.Previous.ContextType == ContextType.Service) { lServiceContext = context.ExchangeInformation.Previous as IUServiceContext; lArguments = ArgumentsList.GetArgumentsFromContext(lServiceContext); lClassName = lServiceContext.ClassName; if (string.Compare(lClassName, "Global", true) == 0) { lClassName = string.Empty; } lResult = new NavigationalFiltering( new ArgumentNavigationFiltering( lClassName, lServiceContext.ServiceName, lServiceContext.SelectedInputField, lArguments)); } // context is of lPopulationContext type. if (context.ExchangeInformation.Previous.ContextType == ContextType.Population) { lPopulationContext = context.ExchangeInformation.Previous as IUPopulationContext; lClassName = lPopulationContext.ClassName; string lFilterName = lExchangeInfo.ServiceName; string lFilterVariableName = lExchangeInfo.ArgumentName; lArguments = ArgumentsList.GetArgumentsFromContext(lPopulationContext.Filters[lFilterName]); lResult = new NavigationalFiltering( new FilterVariableNavigationFiltering( lClassName, lFilterName, lFilterVariableName, lArguments)); } } break; case ExchangeType.SelectionBackward: break; default: break; } } return(lResult); }
/// <summary> /// Determines if the IUContext has a NavigationalFiltering. /// </summary> /// <param name="context">Context checked if has a NavigationalFiltering.</param> /// <returns>True or false, if has a NavigationalContext within or not.</returns> public static bool HasNavigationalFiltering(IUContext context) { return(context.ExchangeInformation == null ? false : context.ExchangeInformation.NavigationalFilter); }