本文整理汇总了C#中IUServiceContext.GetInputFieldMultiSelectionAllowed方法的典型用法代码示例。如果您正苦于以下问题:C# IUServiceContext.GetInputFieldMultiSelectionAllowed方法的具体用法?C# IUServiceContext.GetInputFieldMultiSelectionAllowed怎么用?C# IUServiceContext.GetInputFieldMultiSelectionAllowed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IUServiceContext
的用法示例。
在下文中一共展示了IUServiceContext.GetInputFieldMultiSelectionAllowed方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ExecuteLoadFromContext
/// <summary>
/// Initialize the inbound arguments based in the context information.
/// </summary>
/// <param name="context">Current service context.</param>
public static void ExecuteLoadFromContext(IUServiceContext context)
{
int depRulesCounter = Properties.Settings.Default.DependencyRulesCounter;
DependencyRulesCache depRulesCache = new DependencyRulesCache();
// If Exchange information does not exist, none initialization can be done.
if (context == null || context.ExchangeInformation == null)
{
return;
}
// Argument previous value. Common for all of them.
object previousValue;
#region 'this' initialization
// Argument 'this' initialization: 'p_thisPasajero'.
List<Oid> lSelectedOids = null;
ExchangeInfoAction lInfoAction = context.ExchangeInformation as ExchangeInfoAction;
if (lInfoAction != null)
{
lSelectedOids = lInfoAction.SelectedOids;
}
// Check if the selected Oid is an Oid of the 'this' argument class.
if (UtilFunctions.OidsBelongToClass(lSelectedOids, "Pasajero"))
{
if (!context.GetInputFieldMultiSelectionAllowed("p_thisPasajero") && lSelectedOids.Count > 1)
{
lSelectedOids.RemoveRange(1, lSelectedOids.Count - 1);
}
previousValue = context.GetInputFieldValue("p_thisPasajero");
context.SetInputFieldValue("p_thisPasajero", lSelectedOids);
// Check SetValue dependency rules.
context.SelectedInputField = "p_thisPasajero";
ExecuteDependencyRules(context, previousValue, DependencyRulesEventLogic.SetValue, DependencyRulesAgentLogic.Internal, ref depRulesCounter, depRulesCache);
// Check SetEnabled dependency rules.
context.SetInputFieldEnabled("p_thisPasajero", false);
context.SelectedInputField = "p_thisPasajero";
ExecuteDependencyRules(context, true, DependencyRulesEventLogic.SetActive, DependencyRulesAgentLogic.Internal, ref depRulesCounter, depRulesCache);
context.SelectedInputField = string.Empty;
}
#endregion 'this' initialization
#region Aggregation relationships initializations
// Obtain data from the last navigation, in order to initialize object-valued arguments that represent aggregation relationships.
string lLastNavigationRole = context.ExchangeInformation.GetLastNavigationRole();
if (lLastNavigationRole != "")
{
}
#endregion Aggregation relationships initializations
#region Manual initializations
// Search in context for initializations done by programmers, in order to achieve special behaviours.
foreach(KeyValuePair<string,object> argument in context.ExchangeInformation.CustomData)
{
previousValue = context.GetInputFieldValue(argument.Key);
object lCustomArgumentValue = argument.Value;
context.SetInputFieldValue(argument.Key, lCustomArgumentValue);
// Check SetValue dependency rules
context.SelectedInputField = argument.Key;
ExecuteDependencyRules(context, previousValue, DependencyRulesEventLogic.SetValue, DependencyRulesAgentLogic.Internal, ref depRulesCounter, depRulesCache);
context.SelectedInputField = string.Empty;
}
#endregion Manual initializations
#region Arguments initializations taking into account context information
// Initialize object-valued arguments using information in the context stack, only if the argument has not value.
List<Oid> lArgumentValue = null;
// 'p_thisPasajero' argument.
previousValue = context.GetInputFieldValue("p_thisPasajero");
if (previousValue == null)
{
// Search an Oid of the argument class: 'Pasajero'.
lArgumentValue = context.ExchangeInformation.GetOidsOfClass("Pasajero");
if (lArgumentValue != null)
{
context.SetInputFieldValue("p_thisPasajero", lArgumentValue);
// Check SetValue dependency rules.
context.SelectedInputField = "p_thisPasajero";
ExecuteDependencyRules(context, null, DependencyRulesEventLogic.SetValue, DependencyRulesAgentLogic.Internal, ref depRulesCounter, depRulesCache);
context.SelectedInputField = string.Empty;
}
}
#endregion Arguments initializations taking into account context information
}