Esempio n. 1
0
        internal static string GetExtendedDesc(this Record rec, ISelectionContext selectContext)
        {
            var context = selectContext.Clone();

            try
            {
                context.Record = rec;
                RecordStructure structure = rec.GetStructure();
                if (structure == null)
                {
                    return(string.Empty);
                }

                var s = new StringBuilder();
                s.AppendLine(structure.description);
                foreach (var subrec in rec.SubRecords)
                {
                    if (subrec.Structure == null)
                    {
                        continue;
                    }

                    if (subrec.Structure.elements == null)
                    {
                        return(s.ToString());
                    }

                    if (subrec.Structure.notininfo)
                    {
                        continue;
                    }

                    s.AppendLine();
                    s.Append(subrec.GetFormattedData());
                }

                return(s.ToString());
            }
            finally
            {
                context.Reset();
            }
        }
Esempio n. 2
0
        private string GetExtendedDesc(ISelectionContext selectContext)
        {
            var context = selectContext.Clone();

            try
            {
                context.Record = this;
                RecordStructure rec;
                if (!RecordStructure.Records.TryGetValue(Name, out rec))
                {
                    return(string.Empty);
                }

                var s = new StringBuilder();
                s.AppendLine(rec.description);
                foreach (var subrec in this.SubRecords)
                {
                    if (subrec.Structure == null)
                    {
                        continue;
                    }

                    if (subrec.Structure.elements == null)
                    {
                        return(s.ToString());
                    }

                    if (subrec.Structure.notininfo)
                    {
                        continue;
                    }

                    s.AppendLine();
                    s.Append(subrec.GetFormattedData());
                }

                return(s.ToString());
            }
            finally
            {
                context.Reset();
            }
        }
Esempio n. 3
0
        internal static string GetExtendedDesc(this Record rec, ISelectionContext selectContext)
        {
            var context = selectContext.Clone();
            try
            {
                context.Record = rec;
                RecordStructure structure = rec.GetStructure();
                if (structure == null)
                    return string.Empty;

                var s = new StringBuilder();
                s.AppendLine(structure.description);
                foreach (var subrec in rec.SubRecords)
                {
                    if (subrec.Structure == null)
                    {
                        continue;
                    }

                    if (subrec.Structure.elements == null)
                    {
                        return s.ToString();
                    }

                    if (subrec.Structure.notininfo)
                    {
                        continue;
                    }

                    s.AppendLine();
                    s.Append(subrec.GetFormattedData());
                }

                return s.ToString();
            }
            finally
            {
                context.Reset();
            }
        }
Esempio n. 4
0
        private string GetExtendedDesc(ISelectionContext selectContext)
        {
            var context = selectContext.Clone();
            try
            {
                context.Record = this;
                RecordStructure rec;
                if (!RecordStructure.Records.TryGetValue(Name, out rec))
                {
                    return string.Empty;
                }

                var s = new StringBuilder();
                s.AppendLine(rec.description);
                foreach (var subrec in this.SubRecords)
                {
                    if (subrec.Structure == null)
                    {
                        continue;
                    }

                    if (subrec.Structure.elements == null)
                    {
                        return s.ToString();
                    }

                    if (subrec.Structure.notininfo)
                    {
                        continue;
                    }

                    s.AppendLine();
                    s.Append(subrec.GetFormattedData());
                }

                return s.ToString();
            }
            finally
            {
                context.Reset();
            }
        }