123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- 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<string> CommandLineOptions(params string[] extras)
- {
- var options = new List<string>();
- 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;
- }
- }
- }
|