// No used currently
#if false
        private FieldPropertyToken LoadFieldProperty(XmlNode fieldPropertyNode, int index)
        {
            using (this.StackFrame(fieldPropertyNode, index))
            {
                FieldPropertyToken fpt = new FieldPropertyToken();
                List <XmlNode>     unprocessedNodes = new List <XmlNode> ();
                bool success = LoadPropertyBaseHelper(fieldPropertyNode, fpt, unprocessedNodes);

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

                if (success && unprocessedNodes.Count == 0)
                {
                    return(fpt); // success
                }

                return(null); // failure
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Let the view prepare itself for RemoteObjects. This will add "ComputerName" to the
        /// table columns.
        /// </summary>
        /// <param name="so"></param>
        internal override void PrepareForRemoteObjects(PSObject so)
        {
            Diagnostics.Assert(null != so, "so cannot be null");

            // make sure computername property exists.
            Diagnostics.Assert(null != so.Properties[RemotingConstants.ComputerNameNoteProperty],
                               "PrepareForRemoteObjects cannot be called when the object does not contain ComputerName property.");

            if ((dataBaseInfo != null) && (dataBaseInfo.view != null) && (dataBaseInfo.view.mainControl != null))
            {
                _listBody = (ListControlBody)this.dataBaseInfo.view.mainControl.Copy();
                // build up the definition for computer name.
                ListControlItemDefinition cnListItemDefinition = new ListControlItemDefinition();
                cnListItemDefinition.label      = new TextToken();
                cnListItemDefinition.label.text = RemotingConstants.ComputerNameNoteProperty;
                FieldPropertyToken fpt = new FieldPropertyToken();
                fpt.expression = new ExpressionToken(RemotingConstants.ComputerNameNoteProperty, false);
                cnListItemDefinition.formatTokenList.Add(fpt);

                _listBody.defaultEntryDefinition.itemDefinitionList.Add(cnListItemDefinition);
            }
        }
        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 PSPropertyExpression 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);
            }
        }
Esempio n. 4
0
        internal override void PrepareForRemoteObjects(PSObject so)
        {
            PSPropertyInfo local1 = so.Properties[RemotingConstants.ComputerNameNoteProperty];

            if (((base.dataBaseInfo != null) && (base.dataBaseInfo.view != null)) && (base.dataBaseInfo.view.mainControl != null))
            {
                this.tableBody = (TableControlBody)base.dataBaseInfo.view.mainControl.Copy();
                TableRowItemDefinition item  = new TableRowItemDefinition();
                PropertyTokenBase      base2 = new FieldPropertyToken {
                    expression = new ExpressionToken(RemotingConstants.ComputerNameNoteProperty, false)
                };
                item.formatTokenList.Add(base2);
                this.tableBody.defaultDefinition.rowItemDefinitionList.Add(item);
                if (this.tableBody.header.columnHeaderDefinitionList.Count > 0)
                {
                    TableColumnHeaderDefinition definition2 = new TableColumnHeaderDefinition {
                        label = new TextToken()
                    };
                    definition2.label.text = RemotingConstants.ComputerNameNoteProperty;
                    this.tableBody.header.columnHeaderDefinitionList.Add(definition2);
                }
            }
        }
Esempio n. 5
0
        /// <summary>
        /// Let the view prepare itself for RemoteObjects. This will add "ComputerName" to the 
        /// table columns.
        /// </summary>
        /// <param name="so"></param>
        internal override void PrepareForRemoteObjects(PSObject so)
        {
            Diagnostics.Assert(null != so, "so cannot be null");

            // make sure computername property exists.
            Diagnostics.Assert(null != so.Properties[RemotingConstants.ComputerNameNoteProperty],
                "PrepareForRemoteObjects cannot be called when the object does not contain ComputerName property.");

            if ((dataBaseInfo != null) && (dataBaseInfo.view != null) && (dataBaseInfo.view.mainControl != null))
            {
                _listBody = (ListControlBody)this.dataBaseInfo.view.mainControl.Copy();
                // build up the definition for computer name.
                ListControlItemDefinition cnListItemDefinition = new ListControlItemDefinition();
                cnListItemDefinition.label = new TextToken();
                cnListItemDefinition.label.text = RemotingConstants.ComputerNameNoteProperty;
                FieldPropertyToken fpt = new FieldPropertyToken();
                fpt.expression = new ExpressionToken(RemotingConstants.ComputerNameNoteProperty, false);
                cnListItemDefinition.formatTokenList.Add(fpt);


                _listBody.defaultEntryDefinition.itemDefinitionList.Add(cnListItemDefinition);
            }
        }
Esempio n. 6
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;
        }
Esempio n. 7
0
        /// <summary>
        /// Load ListItems into ListControlItemDefinition
        /// </summary>
        /// <param name="lved"></param>
        /// <param name="listItems"></param>
        /// <param name="viewIndex"></param>
        /// <param name="typeName"></param>
        private void LoadListControlItemDefinitionsFromObjectModel(ListControlEntryDefinition lved, List<ListControlEntryItem> listItems, int viewIndex, string typeName)
        {
            foreach (ListControlEntryItem listItem in listItems)
            {
                ListControlItemDefinition lvid = new ListControlItemDefinition();

                // Contains:
                //   DisplayEntry --- Expression  cardinality 0..1
                //   Label        --- Label       cardinality 0..1
                if (listItem.DisplayEntry != null)
                {
                    ExpressionToken expression = LoadExpressionFromObjectModel(listItem.DisplayEntry, viewIndex, typeName);
                    if (expression == null)
                    {
                        lved.itemDefinitionList = null;
                        return; // fatal
                    }
                    FieldPropertyToken fpt = new FieldPropertyToken();
                    fpt.expression = expression;
                    fpt.fieldFormattingDirective.formatString = listItem.FormatString;
                    lvid.formatTokenList.Add(fpt);
                }

                if (!String.IsNullOrEmpty(listItem.Label))
                {
                    TextToken tt = new TextToken();
                    tt.text = listItem.Label;
                    lvid.label = tt;
                }

                lved.itemDefinitionList.Add(lvid);
            }

            // we must have at least a definition in th elist
            if (lved.itemDefinitionList.Count == 0)
            {
                //Error: At least one list view item must be specified.
                this.ReportErrorForLoadingFromObjectModel(
                    StringUtil.Format(FormatAndOutXmlLoadingStrings.NoListViewItemInFormattingData, typeName, viewIndex), typeName);
                lved.itemDefinitionList = null;
                return; //fatal
            }
        }
Esempio n. 8
0
        /// <summary>
        /// Load the column items into the TableRowDefinition
        /// </summary>
        /// <param name="trd"></param>
        /// <param name="columns"></param>
        /// <param name="viewIndex"></param>
        /// <param name="typeName"></param>
        private void LoadColumnEntriesFromObjectModel(TableRowDefinition trd, List<TableControlColumn> columns, int viewIndex, string typeName)
        {
            foreach (TableControlColumn column in columns)
            {
                TableRowItemDefinition rid = new TableRowItemDefinition();

                // Contain:
                //   DisplayEntry --- Expression cardinality: 0..1
                //   Alignment    --- Alignment  cardinality: 0..1
                if (column.DisplayEntry != null)
                {
                    ExpressionToken expression = LoadExpressionFromObjectModel(column.DisplayEntry, viewIndex, typeName);
                    if (expression == null)
                    {
                        trd.rowItemDefinitionList = null;
                        return;
                    }
                    FieldPropertyToken fpt = new FieldPropertyToken();
                    fpt.expression = expression;
                    fpt.fieldFormattingDirective.formatString = column.FormatString;
                    rid.formatTokenList.Add(fpt);
                }

                rid.alignment = (int)column.Alignment;
                trd.rowItemDefinitionList.Add(rid);
            }
        }
Esempio n. 9
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);
            }
        }
        // No used currently
#if false
        private FieldPropertyToken LoadFieldProperty (XmlNode fieldPropertyNode, int index)
        {
            using (this.StackFrame (fieldPropertyNode, index))
            {
                FieldPropertyToken fpt = new FieldPropertyToken ();
                List<XmlNode> unprocessedNodes = new List<XmlNode> ();
                bool success = LoadPropertyBaseHelper (fieldPropertyNode, fpt, unprocessedNodes);

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

                if (success && unprocessedNodes.Count == 0)
                {
                    return fpt; // success
                }

                return null; // failure
            }
        }
Esempio n. 11
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
        }
Esempio n. 12
0
 private void LoadListControlItemDefinitionsFromObjectModel(ListControlEntryDefinition lved, List<ListControlEntryItem> listItems, int viewIndex, string typeName)
 {
     foreach (ListControlEntryItem item in listItems)
     {
         ListControlItemDefinition definition = new ListControlItemDefinition();
         if (item.DisplayEntry != null)
         {
             ExpressionToken token = this.LoadExpressionFromObjectModel(item.DisplayEntry, viewIndex, typeName);
             if (token == null)
             {
                 lved.itemDefinitionList = null;
                 return;
             }
             FieldPropertyToken token2 = new FieldPropertyToken {
                 expression = token
             };
             definition.formatTokenList.Add(token2);
         }
         if (!string.IsNullOrEmpty(item.Label))
         {
             TextToken token3 = new TextToken {
                 text = item.Label
             };
             definition.label = token3;
         }
         lved.itemDefinitionList.Add(definition);
     }
     if (lved.itemDefinitionList.Count == 0)
     {
         base.ReportErrorForLoadingFromObjectModel(StringUtil.Format(FormatAndOutXmlLoadingStrings.NoListViewItemInFormattingData, typeName, viewIndex), typeName);
         lved.itemDefinitionList = null;
     }
 }
        private TableHeaderInfo GenerateTableHeaderInfoFromDataBaseInfo(PSObject so)
        {
            TableHeaderInfo thi = new TableHeaderInfo();

            bool dummy;
            List <TableRowItemDefinition> activeRowItemDefinitionList = GetActiveTableRowDefinition(_tableBody, so, out dummy);

            thi.hideHeader   = this.HideHeaders;
            thi.repeatHeader = this.RepeatHeader;

            int col = 0;

            foreach (TableRowItemDefinition rowItem in activeRowItemDefinitionList)
            {
                TableColumnInfo             ci        = new TableColumnInfo();
                TableColumnHeaderDefinition colHeader = null;
                if (_tableBody.header.columnHeaderDefinitionList.Count > 0)
                {
                    colHeader = _tableBody.header.columnHeaderDefinitionList[col];
                }

                if (colHeader != null)
                {
                    ci.width     = colHeader.width;
                    ci.alignment = colHeader.alignment;
                    if (colHeader.label != null)
                    {
                        ci.label = this.dataBaseInfo.db.displayResourceManagerCache.GetTextTokenString(colHeader.label);
                    }
                }

                if (ci.alignment == TextAlignment.Undefined)
                {
                    ci.alignment = rowItem.alignment;
                }

                if (ci.label == null)
                {
                    FormatToken token = null;
                    if (rowItem.formatTokenList.Count > 0)
                    {
                        token = rowItem.formatTokenList[0];
                    }
                    if (token != null)
                    {
                        FieldPropertyToken fpt = token as FieldPropertyToken;
                        if (fpt != null)
                        {
                            ci.label = fpt.expression.expressionValue;
                        }
                        else
                        {
                            TextToken tt = token as TextToken;
                            if (tt != null)
                            {
                                ci.label = this.dataBaseInfo.db.displayResourceManagerCache.GetTextTokenString(tt);
                            }
                        }
                    }
                    else
                    {
                        ci.label = string.Empty;
                    }
                }

                thi.tableColumnInfoList.Add(ci);
                col++;
            }

            return(thi);
        }
Esempio n. 14
0
        /// <summary>
        /// Let the view prepare itself for RemoteObjects. This will add "ComputerName" to the 
        /// table columns.
        /// </summary>
        /// <param name="so"></param>
        internal override void PrepareForRemoteObjects(PSObject so)
        {
            Diagnostics.Assert(null != so, "so cannot be null");

            // make sure computername property exists.
            Diagnostics.Assert(null != so.Properties[RemotingConstants.ComputerNameNoteProperty],
                "PrepareForRemoteObjects cannot be called when the object does not contain ComputerName property.");

            if ((dataBaseInfo != null) && (dataBaseInfo.view != null) && (dataBaseInfo.view.mainControl != null))
            {
                // dont change the original format definition in the database..just make a copy and work
                // with the copy
                _tableBody = (TableControlBody)this.dataBaseInfo.view.mainControl.Copy();

                TableRowItemDefinition cnRowDefinition = new TableRowItemDefinition();
                PropertyTokenBase propToken = new FieldPropertyToken();
                propToken.expression = new ExpressionToken(RemotingConstants.ComputerNameNoteProperty, false);
                cnRowDefinition.formatTokenList.Add(propToken);
                _tableBody.defaultDefinition.rowItemDefinitionList.Add(cnRowDefinition);

                // add header only if there are other header definitions
                if (_tableBody.header.columnHeaderDefinitionList.Count > 0)
                {
                    TableColumnHeaderDefinition cnHeaderDefinition = new TableColumnHeaderDefinition();
                    cnHeaderDefinition.label = new TextToken();
                    cnHeaderDefinition.label.text = RemotingConstants.ComputerNameNoteProperty;
                    _tableBody.header.columnHeaderDefinitionList.Add(cnHeaderDefinition);
                }
            }
        }
Esempio n. 15
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;
            }
        }
Esempio n. 16
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;
            }
        }
Esempio n. 17
0
        private TableHeaderInfo GenerateTableHeaderInfoFromDataBaseInfo(PSObject so)
        {
            bool            flag;
            TableHeaderInfo info = new TableHeaderInfo();
            List <TableRowItemDefinition> list = this.GetActiveTableRowDefinition(this.tableBody, so, out flag);

            info.hideHeader = this.HideHeaders;
            int num = 0;

            foreach (TableRowItemDefinition definition in list)
            {
                TableColumnInfo             item        = new TableColumnInfo();
                TableColumnHeaderDefinition definition2 = null;
                if (this.tableBody.header.columnHeaderDefinitionList.Count > 0)
                {
                    definition2 = this.tableBody.header.columnHeaderDefinitionList[num];
                }
                if (definition2 != null)
                {
                    item.width     = definition2.width;
                    item.alignment = definition2.alignment;
                    if (definition2.label != null)
                    {
                        item.label = base.dataBaseInfo.db.displayResourceManagerCache.GetTextTokenString(definition2.label);
                    }
                }
                if (item.alignment == 0)
                {
                    item.alignment = definition.alignment;
                }
                if (item.label == null)
                {
                    FormatToken token = null;
                    if (definition.formatTokenList.Count > 0)
                    {
                        token = definition.formatTokenList[0];
                    }
                    if (token != null)
                    {
                        FieldPropertyToken token2 = token as FieldPropertyToken;
                        if (token2 != null)
                        {
                            item.label = token2.expression.expressionValue;
                        }
                        else
                        {
                            TextToken tt = token as TextToken;
                            if (tt != null)
                            {
                                item.label = base.dataBaseInfo.db.displayResourceManagerCache.GetTextTokenString(tt);
                            }
                        }
                    }
                    else
                    {
                        item.label = "";
                    }
                }
                info.tableColumnInfoList.Add(item);
                num++;
            }
            return(info);
        }
Esempio n. 18
0
 private void LoadColumnEntriesFromObjectModel(TableRowDefinition trd, List<TableControlColumn> columns, int viewIndex, string typeName)
 {
     foreach (TableControlColumn column in columns)
     {
         TableRowItemDefinition item = new TableRowItemDefinition();
         if (column.DisplayEntry != null)
         {
             ExpressionToken token = this.LoadExpressionFromObjectModel(column.DisplayEntry, viewIndex, typeName);
             if (token == null)
             {
                 trd.rowItemDefinitionList = null;
                 break;
             }
             FieldPropertyToken token2 = new FieldPropertyToken {
                 expression = token
             };
             item.formatTokenList.Add(token2);
         }
         item.alignment = (int) column.Alignment;
         trd.rowItemDefinitionList.Add(item);
     }
 }
Esempio n. 19
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;
     }
 }
Esempio n. 20
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;
     }
 }
Esempio n. 21
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;
     }
 }
Esempio n. 22
0
 internal override void PrepareForRemoteObjects(PSObject so)
 {
     PSPropertyInfo local1 = so.Properties[RemotingConstants.ComputerNameNoteProperty];
     if (((base.dataBaseInfo != null) && (base.dataBaseInfo.view != null)) && (base.dataBaseInfo.view.mainControl != null))
     {
         this.listBody = (ListControlBody) base.dataBaseInfo.view.mainControl.Copy();
         ListControlItemDefinition item = new ListControlItemDefinition {
             label = new TextToken()
         };
         item.label.text = RemotingConstants.ComputerNameNoteProperty;
         FieldPropertyToken token = new FieldPropertyToken {
             expression = new ExpressionToken(RemotingConstants.ComputerNameNoteProperty, false)
         };
         item.formatTokenList.Add(token);
         this.listBody.defaultEntryDefinition.itemDefinitionList.Add(item);
     }
 }
Esempio n. 23
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;
 }
Esempio n. 24
0
 internal override void PrepareForRemoteObjects(PSObject so)
 {
     PSPropertyInfo local1 = so.Properties[RemotingConstants.ComputerNameNoteProperty];
     if (((base.dataBaseInfo != null) && (base.dataBaseInfo.view != null)) && (base.dataBaseInfo.view.mainControl != null))
     {
         this.tableBody = (TableControlBody) base.dataBaseInfo.view.mainControl.Copy();
         TableRowItemDefinition item = new TableRowItemDefinition();
         PropertyTokenBase base2 = new FieldPropertyToken {
             expression = new ExpressionToken(RemotingConstants.ComputerNameNoteProperty, false)
         };
         item.formatTokenList.Add(base2);
         this.tableBody.defaultDefinition.rowItemDefinitionList.Add(item);
         if (this.tableBody.header.columnHeaderDefinitionList.Count > 0)
         {
             TableColumnHeaderDefinition definition2 = new TableColumnHeaderDefinition {
                 label = new TextToken()
             };
             definition2.label.text = RemotingConstants.ComputerNameNoteProperty;
             this.tableBody.header.columnHeaderDefinitionList.Add(definition2);
         }
     }
 }