Example #1
0
        internal string GetDesc(SelectionContext context)
        {
            string start = "[Record]" + Environment.NewLine + GetBaseDesc();
            string end;

            try
            {
                end = GetExtendedDesc(context);
            }
            catch
            {
                end =
                    "Warning: An error occurred while processing the record. It may not conform to the structure defined in RecordStructure.xml";
            }
            if (end == null)
            {
                return(start);
            }
            else
            {
                return(start + Environment.NewLine + Environment.NewLine + "[Formatted information]" +
                       Environment.NewLine + end);
            }
        }
Example #2
0
 private string GetExtendedDesc(SelectionContext selectContext)
 {
     var context = selectContext.Clone();
     try
     {
         context.Record = this;
         RecordStructure rec;
         if (!RecordStructure.Records.TryGetValue(Name, out rec))
             return "";
         var s = new StringBuilder();
         s.AppendLine(rec.description);
         foreach (var subrec in 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.Record = null;
         context.SubRecord = null;
         context.Conditions.Clear();
     }
 }
Example #3
0
 internal string GetDesc(SelectionContext context)
 {
     string start = "[Record]" + Environment.NewLine + GetBaseDesc();
     string end;
     try
     {
         end = GetExtendedDesc(context);
     }
     catch
     {
         end =
             "Warning: An error occurred while processing the record. It may not conform to the structure defined in RecordStructure.xml";
     }
     if (end == null) return start;
     else
         return start + Environment.NewLine + Environment.NewLine + "[Formatted information]" +
                Environment.NewLine + end;
 }