public virtual ServerArgs parseArgs(string[] args) { ServerArgs options = new ServerArgs(); if (!CommandLine.Parser.Default.ParseArguments(args, options)) { return(null); } return(options); }
public MainWindow() { InitializeComponent(); this.MaxWidth = 10000; this.MaxHeight = 10000; this.Loaded += window1Loaded; dataAccess = new DAL(); BindingOperations.EnableCollectionSynchronization(ClientAppList, _listLock); DataGridClients.ItemsSource = ClientAppList; server.ClientConnectedEvent += server_ClientConnectedEvent; server.ClientDisconnectedEvent += server_ClientDisconnectedEvent; server.LogEvent += server_LogEvent; server.Start(null); ClientAppList.CollectionChanged += ClientAppList_CollectionChanged; ClientAppList.ElementContentChanged += ClientAppList_ElementContentChanged; string[] args = Environment.GetCommandLineArgs(); // Set Console Position & dimensions ServerArgs options = new ServerArgs(); options = options.parseArgs(args); if (options.Left > 0 || options.Top > 0) { this.Left = options.Left; this.Top = options.Top; } if (options.Width > 0 || options.Height > 0) { this.Width = options.Width; this.Height = options.Height; } }