コード例 #1
0
        /// <summary/>
        public WideControlBuilder AddPropertyEntry(string propertyName, string format = null, IEnumerable <string> entrySelectedByType = null, IEnumerable <DisplayEntry> entrySelectedByCondition = null)
        {
            var entry = new WideControlEntryItem(new DisplayEntry(propertyName, DisplayEntryValueType.Property))
            {
                EntrySelectedBy = EntrySelectedBy.Get(entrySelectedByType, entrySelectedByCondition)
            };

            _control.Entries.Add(entry);
            return(this);
        }
コード例 #2
0
        /// <summary/>
        public WideControlBuilder AddScriptBlockEntry(string scriptBlock, string format = null, IEnumerable <string> entrySelectedByType = null, IEnumerable <DisplayEntry> entrySelectedByCondition = null)
        {
            var entry = new WideControlEntryItem(new DisplayEntry(scriptBlock, DisplayEntryValueType.ScriptBlock))
            {
                EntrySelectedBy = EntrySelectedBy.Get(entrySelectedByType, entrySelectedByCondition)
            };

            _control.Entries.Add(entry);
            return(this);
        }
コード例 #3
0
 private WideControlEntryDefinition LoadWideControlEntryFromObjectModel(WideControlEntryItem wideItem, int viewIndex, string typeName)
 {
     WideControlEntryDefinition definition = new WideControlEntryDefinition();
     if (wideItem.SelectedBy.Count > 0)
     {
         definition.appliesTo = this.LoadAppliesToSectionFromObjectModel(wideItem.SelectedBy);
     }
     ExpressionToken token = this.LoadExpressionFromObjectModel(wideItem.DisplayEntry, viewIndex, typeName);
     if (token == null)
     {
         return null;
     }
     FieldPropertyToken item = new FieldPropertyToken {
         expression = token
     };
     definition.formatTokenList.Add(item);
     return definition;
 }
コード例 #4
0
        /// <summary>
        /// Load WideEntry into WieControlEntryDefinition
        /// </summary>
        /// <param name="wideItem"></param>
        /// <param name="viewIndex"></param>
        /// <param name="typeName"></param>
        /// <returns></returns>
        private WideControlEntryDefinition LoadWideControlEntryFromObjectModel(WideControlEntryItem wideItem, int viewIndex, string typeName)
        {
            WideControlEntryDefinition wved = new WideControlEntryDefinition();

            // Contains:
            //   SelectedBy   --- EntrySelectedBy (TypeName)  cardinality 0..1
            //   DisplayEntry --- WideItem (Expression)       cardinality 1
            // process selectedBy property
            if (wideItem.EntrySelectedBy != null)
            {
                wved.appliesTo = LoadAppliesToSectionFromObjectModel(wideItem.EntrySelectedBy.TypeNames, wideItem.EntrySelectedBy.SelectionCondition);
            }

            // process displayEntry property
            ExpressionToken expression = LoadExpressionFromObjectModel(wideItem.DisplayEntry, viewIndex, typeName);
            if (expression == null)
            {
                return null; // fatal
            }
            FieldPropertyToken fpt = new FieldPropertyToken();
            fpt.expression = expression;
            fpt.fieldFormattingDirective.formatString = wideItem.FormatString;
            wved.formatTokenList.Add(fpt);

            return wved;
        }
コード例 #5
0
 /// <summary/>
 public WideControlBuilder AddPropertyEntry(string propertyName, string format = null, IEnumerable<string> entrySelectedByType = null, IEnumerable<DisplayEntry> entrySelectedByCondition = null)
 {
     var entry = new WideControlEntryItem(new DisplayEntry(propertyName, DisplayEntryValueType.Property))
     {
         EntrySelectedBy = EntrySelectedBy.Get(entrySelectedByType, entrySelectedByCondition)
     };
     _control.Entries.Add(entry);
     return this;
 }
コード例 #6
0
 /// <summary/>
 public WideControlBuilder AddScriptBlockEntry(string scriptBlock, string format = null, IEnumerable<string> entrySelectedByType = null, IEnumerable<DisplayEntry> entrySelectedByCondition = null)
 {
     var entry = new WideControlEntryItem(new DisplayEntry(scriptBlock, DisplayEntryValueType.ScriptBlock))
     {
         EntrySelectedBy = EntrySelectedBy.Get(entrySelectedByType, entrySelectedByCondition)
     };
     _control.Entries.Add(entry);
     return this;
 }