Exemple #1
0
        public string WriteObjectConstructor()
        {
            var           fields     = string.Join(",", Fields.Select(field => field.WriteConstructor()));
            List <string> parameters = new List <string>()
            {
                Name.WrapInQuotes(),
                          Unique.ToBoolString(),
                $"IdfObjectFormat.{Format}",
                          Obsolete.ToBoolString(),
                          MinNumberOfFields == null ? "null" : MinNumberOfFields.Value.ToString(),
                          Required.ToBoolString(),
                $"new List<IdfField> {{{fields}}}",
                          Extensible.ToBoolString(),
                          TotalNumberOfDefinedFields.ToString()
            };

            return($"new IdfObject({string.Join(",", parameters)} )");
        }
Exemple #2
0
        public string WriteConstructor()
        {
            List <string> parameters = new List <string>
            {
                Required.ToBoolString(),
                          Units.WrapInQuotes(),
                          Minimum.ToString(),
                          Maximum.ToString(),
                          Default.WrapInQuotes(),
                          AutoCalculatable.ToBoolString(),
                          AutoSizeable.ToBoolString(),
                $"IdfFieldAlphaNumeric.{AlphaNumeric}",
                WriteKeys(),
                          Name.WrapInQuotes(),
                $"IdfFieldMinMaxType.{MinType}",
                $"IdfFieldMinMaxType.{MaxType}",
                WriteStringList(ReferenceList),
                WriteStringList(ReferenceClassList),
                WriteStringList(ObjectList),
            };

            return
                ($"new IdfField({string.Join(",", parameters)})");
        }