[7150] | 1 | using System; |
---|
| 2 | using System.Collections.Generic; |
---|
| 3 | using System.Linq; |
---|
| 4 | using System.Text; |
---|
| 5 | using System.Windows.Input; |
---|
| 6 | |
---|
| 7 | namespace Com.Piwigo.Wpf.Command |
---|
| 8 | { |
---|
[7160] | 9 | public static class PwgCmdProvider |
---|
[7150] | 10 | { |
---|
[11922] | 11 | public static AsyncCommand GetByType<T>() |
---|
[7150] | 12 | { |
---|
[11922] | 13 | AsyncCommand objICom; |
---|
[11911] | 14 | |
---|
| 15 | switch (typeof(T).Name) |
---|
| 16 | { |
---|
| 17 | case "PwgCmdConnect": |
---|
| 18 | objICom = PwgCmdConnect; |
---|
| 19 | break; |
---|
| 20 | case "PwgCmdDisconnect": |
---|
| 21 | objICom = PwgCmdDisconnect; |
---|
| 22 | break; |
---|
[12336] | 23 | case "PwgCmdGetImageforAlbum": |
---|
| 24 | objICom = PwgCmdGetImageforAlbum; |
---|
[11911] | 25 | break; |
---|
[12336] | 26 | case "PwgCmdGetSubAlbumforAlbum": |
---|
| 27 | objICom = PwgCmdGetSubAlbumforAlbum; |
---|
[11935] | 28 | break; |
---|
[12015] | 29 | case "PwgCmdGetImageforTag": |
---|
| 30 | objICom = PwgCmdGetImageforTag; |
---|
| 31 | break; |
---|
[11911] | 32 | default: |
---|
[11935] | 33 | throw new ArgumentException("AsyncCommand GetByType : Command Type unknow.", "Type"); |
---|
[11911] | 34 | } |
---|
| 35 | |
---|
| 36 | return objICom; |
---|
| 37 | } |
---|
| 38 | |
---|
[11922] | 39 | public static AsyncCommand _pwgCmdConnect; |
---|
| 40 | public static AsyncCommand PwgCmdConnect |
---|
[11911] | 41 | { |
---|
[7150] | 42 | get |
---|
| 43 | { |
---|
| 44 | if (_pwgCmdConnect == null) |
---|
| 45 | { |
---|
| 46 | _pwgCmdConnect = new PwgCmdConnect(); |
---|
| 47 | } |
---|
| 48 | return _pwgCmdConnect; |
---|
| 49 | } |
---|
| 50 | } |
---|
[11911] | 51 | |
---|
[11922] | 52 | public static AsyncCommand _pwgCmdDisconnect; |
---|
| 53 | public static AsyncCommand PwgCmdDisconnect |
---|
[11911] | 54 | { |
---|
| 55 | get |
---|
| 56 | { |
---|
| 57 | if (_pwgCmdDisconnect == null) |
---|
| 58 | { |
---|
| 59 | _pwgCmdDisconnect = new PwgCmdDisconnect(); |
---|
| 60 | } |
---|
| 61 | return _pwgCmdDisconnect; |
---|
| 62 | } |
---|
| 63 | } |
---|
| 64 | |
---|
[12336] | 65 | public static AsyncCommand _pwgCmdGetImageforAlbum; |
---|
| 66 | public static AsyncCommand PwgCmdGetImageforAlbum |
---|
[11911] | 67 | { |
---|
| 68 | get |
---|
| 69 | { |
---|
[12336] | 70 | if (_pwgCmdGetImageforAlbum == null) |
---|
[11911] | 71 | { |
---|
[12336] | 72 | _pwgCmdGetImageforAlbum = new PwgCmdGetImageforAlbum(); |
---|
[11911] | 73 | } |
---|
[12336] | 74 | return _pwgCmdGetImageforAlbum; |
---|
[11911] | 75 | } |
---|
| 76 | } |
---|
[11935] | 77 | |
---|
[12336] | 78 | public static AsyncCommand _pwgCmdGetSubAlbumforAlbum; |
---|
| 79 | public static AsyncCommand PwgCmdGetSubAlbumforAlbum |
---|
[11935] | 80 | { |
---|
| 81 | get |
---|
| 82 | { |
---|
[12336] | 83 | if (_pwgCmdGetSubAlbumforAlbum == null) |
---|
[11935] | 84 | { |
---|
[12336] | 85 | _pwgCmdGetSubAlbumforAlbum = new PwgCmdGetSubAlbumforAlbum(); |
---|
[11935] | 86 | } |
---|
[12336] | 87 | return _pwgCmdGetSubAlbumforAlbum; |
---|
[11935] | 88 | } |
---|
| 89 | } |
---|
| 90 | |
---|
[12015] | 91 | public static AsyncCommand _pwgCmdGetImageforTag; |
---|
| 92 | public static AsyncCommand PwgCmdGetImageforTag |
---|
| 93 | { |
---|
| 94 | get |
---|
| 95 | { |
---|
| 96 | if (_pwgCmdGetImageforTag == null) |
---|
| 97 | { |
---|
| 98 | _pwgCmdGetImageforTag = new PwgCmdGetImageforTag(); |
---|
| 99 | } |
---|
| 100 | return _pwgCmdGetImageforTag; |
---|
| 101 | } |
---|
| 102 | } |
---|
[7150] | 103 | } |
---|
| 104 | } |
---|