Ejemplo n.º 1
0
        private WideViewEntry GenerateWideViewEntryFromProperties(PSObject so, int enumerationLimit)
        {
            // compute active properties every time
            if (this.activeAssociationList == null)
            {
                SetUpActiveProperty(so);
            }

            WideViewEntry       wve = new WideViewEntry();
            FormatPropertyField fpf = new FormatPropertyField();

            wve.formatPropertyField = fpf;
            if (this.activeAssociationList.Count > 0)
            {
                // get the first one
                MshResolvedExpressionParameterAssociation a = this.activeAssociationList[0];
                FieldFormattingDirective directive          = null;
                if (a.OriginatingParameter != null)
                {
                    directive = a.OriginatingParameter.GetEntry(FormatParameterDefinitionKeys.FormatStringEntryKey) as FieldFormattingDirective;
                }

                fpf.propertyValue = this.GetExpressionDisplayValue(so, enumerationLimit, a.ResolvedExpression, directive);
            }

            this.activeAssociationList = null;
            return(wve);
        }
Ejemplo n.º 2
0
 private void ProcessCachedGroupOnWide(WideViewHeaderInfo wvhi, List <PacketInfoData> objects)
 {
     if (wvhi.columns == 0)
     {
         int num = 0;
         foreach (PacketInfoData data in objects)
         {
             FormatEntryData data2 = data as FormatEntryData;
             if (data2 != null)
             {
                 WideViewEntry       formatEntryInfo     = data2.formatEntryInfo as WideViewEntry;
                 FormatPropertyField formatPropertyField = formatEntryInfo.formatPropertyField;
                 if (!string.IsNullOrEmpty(formatPropertyField.propertyValue))
                 {
                     int num2 = this.lo.DisplayCells.Length(formatPropertyField.propertyValue);
                     if (num2 > num)
                     {
                         num = num2;
                     }
                 }
             }
         }
         WideFormattingHint hint = new WideFormattingHint {
             maxWidth = num
         };
         this.formattingHint = hint;
     }
 }
Ejemplo n.º 3
0
            /// <summary>
            /// write a row into the table
            /// </summary>
            /// <param name="fed">FormatEntryData to process</param>
            internal override void ProcessPayload(FormatEntryData fed)
            {
                WideViewEntry       wve = fed.formatEntryInfo as WideViewEntry;
                FormatPropertyField fpf = wve.formatPropertyField as FormatPropertyField;

                _buffer.Add(fpf.propertyValue);
                if (_buffer.IsFull)
                {
                    WriteStringBuffer();
                }
            }
Ejemplo n.º 4
0
            internal override void ProcessPayload(FormatEntryData fed)
            {
                WideViewEntry       formatEntryInfo     = fed.formatEntryInfo as WideViewEntry;
                FormatPropertyField formatPropertyField = formatEntryInfo.formatPropertyField;

                this.buffer.Add(formatPropertyField.propertyValue);
                if (this.buffer.IsFull)
                {
                    this.WriteStringBuffer();
                }
            }
Ejemplo n.º 5
0
        private WideViewEntry GenerateWideViewEntryFromDataBaseInfo(PSObject so, int enumerationLimit)
        {
            WideControlBody wideBody = (WideControlBody)this.dataBaseInfo.view.mainControl;

            WideControlEntryDefinition activeWideControlEntryDefinition =
                    GetActiveWideControlEntryDefinition(wideBody, so);

            WideViewEntry wve = new WideViewEntry();
            wve.formatPropertyField = GenerateFormatPropertyField(activeWideControlEntryDefinition.formatTokenList, so, enumerationLimit);

            //wve.alignment = activeWideViewEntryDefinition.alignment;

            return wve;
        }
        private WideViewEntry GenerateWideViewEntryFromDataBaseInfo(PSObject so, int enumerationLimit)
        {
            WideControlBody wideBody = (WideControlBody)this.dataBaseInfo.view.mainControl;

            WideControlEntryDefinition activeWideControlEntryDefinition =
                GetActiveWideControlEntryDefinition(wideBody, so);

            WideViewEntry wve = new WideViewEntry();

            wve.formatPropertyField = GenerateFormatPropertyField(activeWideControlEntryDefinition.formatTokenList, so, enumerationLimit);

            //wve.alignment = activeWideViewEntryDefinition.alignment;

            return(wve);
        }
Ejemplo n.º 7
0
 private WideViewEntry GenerateWideViewEntryFromProperties(PSObject so, int enumerationLimit)
 {
     if (base.activeAssociationList == null)
     {
         this.SetUpActiveProperty(so);
     }
     WideViewEntry entry = new WideViewEntry();
     FormatPropertyField field = new FormatPropertyField();
     entry.formatPropertyField = field;
     if (base.activeAssociationList.Count > 0)
     {
         MshResolvedExpressionParameterAssociation association = base.activeAssociationList[0];
         FieldFormattingDirective directive = null;
         if (association.OriginatingParameter != null)
         {
             directive = association.OriginatingParameter.GetEntry("formatString") as FieldFormattingDirective;
         }
         field.propertyValue = base.GetExpressionDisplayValue(so, enumerationLimit, association.ResolvedExpression, directive);
     }
     base.activeAssociationList = null;
     return entry;
 }
Ejemplo n.º 8
0
        private void ProcessCachedGroupOnWide(WideViewHeaderInfo wvhi, List <PacketInfoData> objects)
        {
            if (wvhi.columns != 0)
            {
                // columns forced on the client
                return;
            }

            int maxLen = 0;
            int cellCount; // scratch variable

            foreach (PacketInfoData o in objects)
            {
                FormatEntryData fed = o as FormatEntryData;

                if (fed == null)
                {
                    continue;
                }

                WideViewEntry       wve = fed.formatEntryInfo as WideViewEntry;
                FormatPropertyField fpf = wve.formatPropertyField as FormatPropertyField;

                if (!string.IsNullOrEmpty(fpf.propertyValue))
                {
                    cellCount = _lo.DisplayCells.Length(fpf.propertyValue);
                    if (cellCount > maxLen)
                    {
                        maxLen = cellCount;
                    }
                }
            }

            WideFormattingHint hint = new WideFormattingHint();

            hint.maxWidth   = maxLen;
            _formattingHint = hint;
        }
Ejemplo n.º 9
0
        private WideViewEntry GenerateWideViewEntryFromProperties(PSObject so, int enumerationLimit)
        {
            if (base.activeAssociationList == null)
            {
                this.SetUpActiveProperty(so);
            }
            WideViewEntry       entry = new WideViewEntry();
            FormatPropertyField field = new FormatPropertyField();

            entry.formatPropertyField = field;
            if (base.activeAssociationList.Count > 0)
            {
                MshResolvedExpressionParameterAssociation association = base.activeAssociationList[0];
                FieldFormattingDirective directive = null;
                if (association.OriginatingParameter != null)
                {
                    directive = association.OriginatingParameter.GetEntry("formatString") as FieldFormattingDirective;
                }
                field.propertyValue = base.GetExpressionDisplayValue(so, enumerationLimit, association.ResolvedExpression, directive);
            }
            base.activeAssociationList = null;
            return(entry);
        }
Ejemplo n.º 10
0
        private WideViewEntry GenerateWideViewEntryFromProperties(PSObject so, int enumerationLimit)
        {
            // compute active properties every time
            if (this.activeAssociationList == null)
            {
                SetUpActiveProperty(so);
            }

            WideViewEntry wve = new WideViewEntry();
            FormatPropertyField fpf = new FormatPropertyField();

            wve.formatPropertyField = fpf;
            if (this.activeAssociationList.Count > 0)
            {
                // get the first one
                MshResolvedExpressionParameterAssociation a = this.activeAssociationList[0];
                FieldFormattingDirective directive = null;
                if (a.OriginatingParameter != null)
                {
                    directive = a.OriginatingParameter.GetEntry(FormatParameterDefinitionKeys.FormatStringEntryKey) as FieldFormattingDirective;
                }

                fpf.propertyValue = this.GetExpressionDisplayValue(so, enumerationLimit, a.ResolvedExpression, directive);
            }

            this.activeAssociationList = null;
            return wve;
        }