コード例 #1
0
 private List<FormatToken> LoadPropertyEntry(System.Xml.XmlNode propertyEntryNode)
 {
     using (base.StackFrame(propertyEntryNode))
     {
         ViewEntryNodeMatch match = new ViewEntryNodeMatch(this);
         List<System.Xml.XmlNode> unprocessedNodes = new List<System.Xml.XmlNode>();
         if (!match.ProcessExpressionDirectives(propertyEntryNode, unprocessedNodes))
         {
             return null;
         }
         foreach (System.Xml.XmlNode node in unprocessedNodes)
         {
             base.ProcessUnknownNode(node);
         }
         List<FormatToken> list2 = new List<FormatToken>();
         if (match.TextToken != null)
         {
             list2.Add(match.TextToken);
         }
         else
         {
             FieldPropertyToken item = new FieldPropertyToken {
                 expression = match.Expression
             };
             item.fieldFormattingDirective.formatString = match.FormatString;
             list2.Add(item);
         }
         return list2;
     }
 }
コード例 #2
0
 private TableRowItemDefinition LoadColumnEntry(System.Xml.XmlNode columnEntryNode, int index)
 {
     using (base.StackFrame(columnEntryNode, index))
     {
         ViewEntryNodeMatch match = new ViewEntryNodeMatch(this);
         List<System.Xml.XmlNode> unprocessedNodes = new List<System.Xml.XmlNode>();
         if (!match.ProcessExpressionDirectives(columnEntryNode, unprocessedNodes))
         {
             return null;
         }
         TableRowItemDefinition definition = new TableRowItemDefinition();
         bool flag = false;
         foreach (System.Xml.XmlNode node in unprocessedNodes)
         {
             if (base.MatchNodeName(node, "Alignment"))
             {
                 if (flag)
                 {
                     base.ProcessDuplicateNode(node);
                     return null;
                 }
                 flag = true;
                 if (!this.LoadAlignmentValue(node, out definition.alignment))
                 {
                     return null;
                 }
             }
             else
             {
                 base.ProcessUnknownNode(node);
             }
         }
         if (match.TextToken != null)
         {
             definition.formatTokenList.Add(match.TextToken);
         }
         else if (match.Expression != null)
         {
             FieldPropertyToken item = new FieldPropertyToken {
                 expression = match.Expression
             };
             item.fieldFormattingDirective.formatString = match.FormatString;
             definition.formatTokenList.Add(item);
         }
         return definition;
     }
 }
コード例 #3
0
 private ListControlItemDefinition LoadListControlItemDefinition(System.Xml.XmlNode propertyEntryNode)
 {
     using (base.StackFrame(propertyEntryNode))
     {
         ViewEntryNodeMatch match = new ViewEntryNodeMatch(this);
         List<System.Xml.XmlNode> unprocessedNodes = new List<System.Xml.XmlNode>();
         if (!match.ProcessExpressionDirectives(propertyEntryNode, unprocessedNodes))
         {
             return null;
         }
         TextToken token = null;
         ExpressionToken token2 = null;
         bool flag = false;
         bool flag2 = false;
         foreach (System.Xml.XmlNode node in unprocessedNodes)
         {
             if (base.MatchNodeName(node, "ItemSelectionCondition"))
             {
                 if (flag2)
                 {
                     base.ProcessDuplicateNode(node);
                     return null;
                 }
                 flag2 = true;
                 token2 = this.LoadItemSelectionCondition(node);
                 if (token2 == null)
                 {
                     return null;
                 }
             }
             else if (base.MatchNodeNameWithAttributes(node, "Label"))
             {
                 if (flag)
                 {
                     base.ProcessDuplicateNode(node);
                     return null;
                 }
                 flag = true;
                 token = this.LoadLabel(node);
                 if (token == null)
                 {
                     return null;
                 }
             }
             else
             {
                 base.ProcessUnknownNode(node);
             }
         }
         ListControlItemDefinition definition = new ListControlItemDefinition {
             label = token,
             conditionToken = token2
         };
         if (match.TextToken != null)
         {
             definition.formatTokenList.Add(match.TextToken);
         }
         else
         {
             FieldPropertyToken item = new FieldPropertyToken {
                 expression = match.Expression
             };
             item.fieldFormattingDirective.formatString = match.FormatString;
             definition.formatTokenList.Add(item);
         }
         return definition;
     }
 }
コード例 #4
0
        private ListControlItemDefinition LoadListControlItemDefinition(XmlNode propertyEntryNode)
        {
            using (this.StackFrame(propertyEntryNode))
            {
                // process Mshexpression, format string and text token
                ViewEntryNodeMatch match = new ViewEntryNodeMatch(this);
                List<XmlNode> unprocessedNodes = new List<XmlNode>();
                if (!match.ProcessExpressionDirectives(propertyEntryNode, unprocessedNodes))
                {
                    return null; // fatal error
                }

                // process the remaining nodes
                TextToken labelToken = null;
                ExpressionToken condition = null;
                bool labelNodeFound = false; // cardinality 0..1
                bool itemSelectionConditionNodeFound = false; // cardinality 0..1

                foreach (XmlNode n in unprocessedNodes)
                {
                    if (MatchNodeName(n, XmlTags.ItemSelectionConditionNode))
                    {
                        if (itemSelectionConditionNodeFound)
                        {
                            this.ProcessDuplicateNode(n);
                            return null; // fatal error
                        }
                        itemSelectionConditionNodeFound = true;
                        condition = LoadItemSelectionCondition(n);
                        if (condition == null)
                        {
                            return null; // fatal error
                        }
                    }
                    else if (MatchNodeNameWithAttributes(n, XmlTags.LabelNode))
                    {
                        if (labelNodeFound)
                        {
                            this.ProcessDuplicateNode(n);
                            return null; // fatal error
                        }
                        labelNodeFound = true;
                        labelToken = LoadLabel(n);
                        if (labelToken == null)
                        {
                            return null; // fatal error
                        }
                    }
                    else
                    {
                        this.ProcessUnknownNode(n);
                    }
                }

                // finally build the item to return
                ListControlItemDefinition lvid = new ListControlItemDefinition();

                // add the label
                lvid.label = labelToken;

                // add condition
                lvid.conditionToken = condition;

                // add either the text token or the MshExpression with optional format string
                if (match.TextToken != null)
                {
                    lvid.formatTokenList.Add(match.TextToken);
                }
                else
                {
                    FieldPropertyToken fpt = new FieldPropertyToken();
                    fpt.expression = match.Expression;
                    fpt.fieldFormattingDirective.formatString = match.FormatString;
                    lvid.formatTokenList.Add(fpt);
                }
                return lvid;
            }
        }
コード例 #5
0
        private List<FormatToken> LoadPropertyEntry(XmlNode propertyEntryNode)
        {
            using (this.StackFrame(propertyEntryNode))
            {
                // process Mshexpression, format string and text token
                ViewEntryNodeMatch match = new ViewEntryNodeMatch(this);
                List<XmlNode> unprocessedNodes = new List<XmlNode>();
                if (!match.ProcessExpressionDirectives(propertyEntryNode, unprocessedNodes))
                {
                    return null; // fatal error
                }

                // process the remaining nodes

                foreach (XmlNode n in unprocessedNodes)
                {
                    this.ProcessUnknownNode(n);
                }

                // finally build the item to return
                List<FormatToken> formatTokenList = new List<FormatToken>();

                // add either the text token or the MshExpression with optional format string
                if (match.TextToken != null)
                {
                    formatTokenList.Add(match.TextToken);
                }
                else
                {
                    FieldPropertyToken fpt = new FieldPropertyToken();
                    fpt.expression = match.Expression;
                    fpt.fieldFormattingDirective.formatString = match.FormatString;
                    formatTokenList.Add(fpt);
                }
                return formatTokenList;
            }
        }
コード例 #6
0
        private TableRowItemDefinition LoadColumnEntry(XmlNode columnEntryNode, int index)
        {
            using (this.StackFrame(columnEntryNode, index))
            {
                // process Mshexpression, format string and text token
                ViewEntryNodeMatch match = new ViewEntryNodeMatch(this);
                List<XmlNode> unprocessedNodes = new List<XmlNode>();
                if (!match.ProcessExpressionDirectives(columnEntryNode, unprocessedNodes))
                {
                    return null; // fatal error
                }

                TableRowItemDefinition rid = new TableRowItemDefinition();

                // process the remaining nodes 
                bool alignmentNodeFound = false; // cardinality 0..1
                foreach (XmlNode n in unprocessedNodes)
                {
                    if (MatchNodeName(n, XmlTags.AlignmentNode))
                    {
                        if (alignmentNodeFound)
                        {
                            this.ProcessDuplicateNode(n);
                            return null; // fatal error
                        }

                        alignmentNodeFound = true;
                        if (!LoadAlignmentValue(n, out rid.alignment))
                        {
                            return null; // fatal error
                        }
                    }
                    else
                    {
                        this.ProcessUnknownNode(n);
                    }
                }

                // finally build the item to return
                // add either the text token or the MshExpression with optional format string
                if (match.TextToken != null)
                {
                    rid.formatTokenList.Add(match.TextToken);
                }
                else if (match.Expression != null)
                {
                    FieldPropertyToken fpt = new FieldPropertyToken();
                    fpt.expression = match.Expression;
                    fpt.fieldFormattingDirective.formatString = match.FormatString;
                    rid.formatTokenList.Add(fpt);
                }

                return rid;
            } // using
        }