using System.Collections.Generic; using System.Linq; using InABox.Core; using PRSClasses; namespace PRSServer { public abstract class ServerProperties : BaseObject { [TextBoxEditor] [Caption("Service Account Username")] [EditorSequence("Advanced",999)] public string Username { get; set; } public ServerProperties() { Name = CoreUtils.Neatify(Type().ToString()); } [TextBoxEditor] [EditorSequence(-1)] public string Name { get; set; } public abstract ServerType Type(); public List CommandLineOptions(params string[] extras) { var options = new List(); var props = DatabaseSchema.Properties(GetType()) .OrderBy(x => x.PropertySequence()); foreach (var prop in props) options.Add( string.Format( "/{0}={1}{2}{1}", prop.Name, prop.PropertyType == typeof(string) ? "\"" : "", prop.Getter()(this) ) ); foreach (var extra in extras) options.Add(extra); return options; } } }