HamBook – Diff between revs 15 and 54

Subversion Repositories:
Rev:
Show entire fileIgnore whitespace
Rev 15 Rev 54
Line 1... Line 1...
1 using System; 1 using System;
2 using System.Collections.Generic; -  
3 using System.Linq; -  
4 using System.Text; -  
5 using System.Threading.Tasks; -  
Line 6... Line 2...
6   2  
7 namespace HamBook.Radios.Generic 3 namespace HamBook.Radios.Generic
8 { 4 {
9 public class RadioStorage 5 public class RadioStorage
10 { -  
11 public int Storage { get; private set; } -  
12   6 {
13 public RadioStorage(string storage) 7 public RadioStorage(string storage)
14 { 8 {
15 Storage = Parse(storage); 9 Storage = Parse(storage);
Line 16... Line 10...
16 } 10 }
17   11  
18 public RadioStorage(int storage) 12 public RadioStorage(int storage)
19 { 13 {
Line -... Line 14...
-   14 Storage = Parse(storage);
-   15 }
20 Storage = Parse(storage); 16  
21 } 17 public int Storage { get; }
22   18  
23 public static bool TryParse(string storage, out RadioStorage radioMode) 19 public static bool TryParse(string storage, out RadioStorage radioMode)
24 { -  
25 switch (storage) 20 {
26 { 21 switch (storage)
27   22 {
28 case "VFO": 23 case "VFO":
29 case "Memory": 24 case "Memory":
Line 55... Line 50...
55   50  
56 private int Parse(string storage) 51 private int Parse(string storage)
57 { 52 {
58 switch (storage) 53 switch (storage)
59 { -  
60   54 {
61 case "VFO": 55 case "VFO":
62 return 0; 56 return 0;
63 case "Memory": 57 case "Memory":
64 return 1; 58 return 1;
Line 115... Line 109...
115 public static implicit operator int(RadioStorage radioMode) 109 public static implicit operator int(RadioStorage radioMode)
116 { 110 {
117 return radioMode.Storage; 111 return radioMode.Storage;
118 } 112 }
119 } 113 }
120 } 114 }
121   115