Beispiel #1
0
 /// <exclude />
 public override XElement GetWidgetMarkup(ParameterList parameters, string label, HelpDefinition helpDefinition, string bindingSourceName)
 {
     return(StandardWidgetFunctions.BuildStaticCallPopulatedSelectorFormsMarkup(
                parameters,
                label,
                helpDefinition,
                bindingSourceName,
                this.GetType(),
                "GetOptions",
                TypeManager.SerializeType(typeof(T)),
                "Key",
                "Label",
                false,
                true,
                false,
                false));
 }
 /// <exclude />
 public override XElement GetWidgetMarkup(ParameterList parameters, string label, HelpDefinition helpDefinition, string bindingSourceName)
 {
     return(StandardWidgetFunctions.BuildStaticCallPopulatedSelectorFormsMarkup(
                parameters: parameters,
                label: label,
                helpDefinition: helpDefinition,
                bindingSourceName: bindingSourceName,
                optionsGeneratingStaticType: typeof(HomePageSelectorWidgetFunction),
                optionsGeneratingStaticMethodName: nameof(GetHomePages),
                optionsGeneratingStaticMethodParameterValue: null,
                optionsObjectKeyPropertyName: "Key",
                optionsObjectLabelPropertyName: "Label",
                multiSelect: false,
                compactMode: true,
                required: true,
                bindToString: false));
 }
Beispiel #3
0
        public override XElement GetWidgetMarkup(ParameterList parameters, string label, HelpDefinition helpDefinition, string bindingSourceName)
        {
            BaseRuntimeTreeNode runtimeTreeNode = null;

            if (parameters.TryGetParameterRuntimeTreeNode("Options", out runtimeTreeNode))
            {
                string keyFieldName   = parameters.GetParameter <string>("KeyFieldName");
                string labelFieldName = parameters.GetParameter <string>("LabelFieldName");
                bool   multiple       = parameters.GetParameter <bool>("Multiple");
                bool   required       = parameters.GetParameter <bool>("Required");
                bool   compact        = parameters.GetParameter <bool>("Compact");

                XElement optionsDescriptor = new XElement("SelectorOptionsSource",
                                                          new XAttribute("KeyFieldName", parameters.GetParameter <string>("KeyFieldName") ?? ""),
                                                          new XAttribute("LabelFieldName", parameters.GetParameter <string>("LabelFieldName") ?? ""),
                                                          new XElement("TreeNode",
                                                                       runtimeTreeNode.Serialize()));

                return(StandardWidgetFunctions.BuildStaticCallPopulatedSelectorFormsMarkup(
                           parameters,
                           label,
                           helpDefinition,
                           bindingSourceName,
                           this.GetType(),
                           "GetOptions",
                           optionsDescriptor.ToString(),
                           "Key",
                           "Label",
                           multiple,
                           compact,
                           required,
                           true));
            }
            else
            {
                throw new InvalidOperationException("Could not get BaseRuntimeTreeNode for parameter 'Options'.");
            }
        }