示例#1
0
        public Dictionary <string, string> AddRow()
        {
            var row = new Dictionary <string, string>();

            TableContent.Add(row);

            return(row);
        }
示例#2
0
        //--------------------------------------------------------------------------------------------------------------------------------------
        //--------------------------------------------------------------------------------------------------------------------------------------

        private ParserResult <TTargetClass> CreateTableContent(string[] arguments)
        {
            var instance   = new TTargetClass();
            var exceptions = new List <Exception>();

            //TODO multi Exceptions not solely single.
            foreach (var property in typeof(TTargetClass).GetProperties())
            {
                var cmdDescription = property.GetCustomAttributes <ArkCmdDescAttribute>().Single();
                //TODO

                try
                {
                    var propertyDescription = new FullPropertyDescription(cmdDescription, propertyInfo: property);
                    _tableContent.Add(cmdDescription.FullName, propertyDescription);
                    if (string.IsNullOrEmpty(cmdDescription.ShortName) == false)
                    {
                        _tableContent.Add(cmdDescription.ShortName, propertyDescription);
                    }
                }
                catch (ArgumentException argumentException)
                {
                    exceptions.Add(new PropertyNameDuplicationException("stam"));
                    continue;
                }
                catch (Exception exception)
                {
                    exceptions.Add(exception);
                    continue;
                }

                foreach (var cmdArgs in property.GetCustomAttributes <ArkCmdArgumentsDescAttribute>())
                {
                    _tableContent[cmdDescription.FullName] += cmdArgs;
                }
            }

            return(new ParserResult <TTargetClass>(isSucceeded: !exceptions.Any(), exceptions: exceptions.ToArray(), targetClass: instance));
        }
示例#3
0
 /// <summary>
 /// Adds an empty line on the page, for spacing.
 /// </summary>
 public void AddEmptyRow()
 {
     TableContent.Add(null);
 }