Esempio n. 1
0
        override public string ToString()
        {
            StringBuilder sb             = new();
            var           propertyValues = PropertiesService.GetDynamicPropertyValues(this);

            foreach (var propValue in propertyValues)
            {
                dynamic propVal;
                if (propValue.Name == "Type")
                {
                    propVal = Enum.GetName(typeof(SegmentType), propValue.Value);
                }
                else if (propValue.Value is List <string> )
                {
                    foreach (var str in propValue.Value as List <string> )
                    {
                        AppendLine(sb, str, propValue.Name);
                    }
                }
                else
                {
                    propVal = (string)propValue.Value;
                    AppendLine(sb, propVal, propValue.Name);
                }
            }
            return(sb.ToString());
        }