BadScript 2
Loading...
Searching...
No Matches
Custom_Struct.cs
Go to the documentation of this file.
1// Copyright 2005-2015 Giacomo Stelluti Scala & Contributors. All rights reserved. See License.md in the project root for license information.
2
3using System;
4
6{
7 public class CustomStructOptions
8 {
9 [Option('c', "custom", HelpText = "Custom Type")]
10 public CustomStruct Custom { get; set; }
11 }
12
13 public struct CustomStruct
14 {
15 public string Input { get; set; }
16 public string Server { get; set; }
17 public int Port { get; set; }
18 public CustomStruct(string url)
19 {
20 Input = url;
21 Server = "";
22 Port = 80;
23 var data = url.Split(':');
24 if (data.Length == 2)
25 {
26 Server = data[0];
27 Port = Convert.ToInt32(data[1]);
28 }
29 }
30 }
31
32 public class CustomClassOptions
33 {
34 [Option('c', "custom", HelpText = "Custom Type")]
35 public CustomClass Custom { get; set; }
36 }
37
38 public class CustomClass
39 {
40 public string Input { get; set; }
41 public string Server { get; set; }
42 public int Port { get; set; }
43 public CustomClass(string url)
44 {
45 Input = url;
46 Server = "";
47 Port = 80;
48 var data = url.Split(':');
49 if (data.Length == 2)
50 {
51 Server = data[0];
52 Port = Convert.ToInt32(data[1]);
53 }
54 }
55 }
56}