Reinforced.Typings.Cli.ExporterConsoleParameters.ExportConsoleParameters C# (CSharp) Method

ExportConsoleParameters() public method

Produces command line arguments suitable for rtcli.exe
public ExportConsoleParameters ( ) : string
return string
        public string ExportConsoleParameters()
        {
            List<string> arguments = new List<string>();

            var props = typeof (ExporterConsoleParameters).GetProperties(BindingFlags.Public | BindingFlags.Instance);
            const string propFormat = "{0}=\"{1}\"";
            foreach (var propertyInfo in props)
            {
                var pi = propertyInfo.GetValue(this);
                if (pi==null) continue;
                if (propertyInfo.PropertyType == (typeof (string[])))
                {
                    var strings = (string[]) pi;
                    if (strings.Length==0) continue;
                    pi = string.Join(";", strings);
                }

                arguments.Add(String.Format(propFormat, propertyInfo.Name, pi));
            }

            return String.Join(" ", arguments);
        }
    }

Usage Example

Exemplo n.º 1
0
        protected override string GenerateCommandLineCommands()
        {
            ExporterConsoleParameters consoleParams = new ExporterConsoleParameters()
            {
                ExportPureTypings = ExportPureTypings,
                WriteWarningComment = WriteWarningComment,
                Hierarchy = Hierarchical,
                TargetDirectory = FixTargetPath(TargetDirectory),
                TargetFile = FixTargetPath(TargetFile),
                References = ExtractReferences(),
                SourceAssemblies = ExtractSourceAssemblies(),
                RootNamespace = RootNamespace,
                CamelCaseForProperties = CamelCaseForProperties,
                CamelCaseForMethods = CamelCaseForMethods,
                DocumentationFilePath = DocumentationFilePath.EndsWith(".xml",StringComparison.InvariantCultureIgnoreCase)?DocumentationFilePath:String.Empty,
                GenerateDocumentation = GenerateDocumentation,
                ConfigurationMethod = ConfigurationMethod
            };

            return consoleParams.ExportConsoleParameters();
        }