source: extensions/PiwigoLib/PiwigoWpf/Command/PwgCmdProvider.cs @ 12336

Last change on this file since 12336 was 12336, checked in by bayral, 12 years ago

rename category to Albums

File size: 3.1 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Windows.Input;
6
7namespace Com.Piwigo.Wpf.Command
8{
9    public static class PwgCmdProvider
10    {
11        public static AsyncCommand GetByType<T>()
12        {
13            AsyncCommand objICom;
14
15            switch (typeof(T).Name)
16            {
17                case "PwgCmdConnect":
18                    objICom = PwgCmdConnect;
19                    break;
20                case "PwgCmdDisconnect":
21                    objICom = PwgCmdDisconnect;
22                    break;
23                case "PwgCmdGetImageforAlbum":
24                    objICom = PwgCmdGetImageforAlbum;
25                    break;
26                case "PwgCmdGetSubAlbumforAlbum":
27                    objICom = PwgCmdGetSubAlbumforAlbum;
28                    break;
29                case "PwgCmdGetImageforTag":
30                    objICom = PwgCmdGetImageforTag;
31                    break;
32                default:
33                    throw new ArgumentException("AsyncCommand GetByType : Command Type unknow.", "Type");
34            }
35
36            return objICom;
37        }
38
39        public static AsyncCommand _pwgCmdConnect;
40        public static AsyncCommand PwgCmdConnect
41        {
42            get
43            {
44                if (_pwgCmdConnect == null)
45                {
46                    _pwgCmdConnect = new PwgCmdConnect();
47                }
48                return _pwgCmdConnect;
49            }
50        }
51
52        public static AsyncCommand _pwgCmdDisconnect;
53        public static AsyncCommand PwgCmdDisconnect
54        {
55            get
56            {
57                if (_pwgCmdDisconnect == null)
58                {
59                    _pwgCmdDisconnect = new PwgCmdDisconnect();
60                }
61                return _pwgCmdDisconnect;
62            }
63        }
64
65        public static AsyncCommand _pwgCmdGetImageforAlbum;
66        public static AsyncCommand PwgCmdGetImageforAlbum
67        {
68            get
69            {
70                if (_pwgCmdGetImageforAlbum == null)
71                {
72                    _pwgCmdGetImageforAlbum = new PwgCmdGetImageforAlbum();
73                }
74                return _pwgCmdGetImageforAlbum;
75            }
76        }
77
78        public static AsyncCommand _pwgCmdGetSubAlbumforAlbum;
79        public static AsyncCommand PwgCmdGetSubAlbumforAlbum
80        {
81            get
82            {
83                if (_pwgCmdGetSubAlbumforAlbum == null)
84                {
85                    _pwgCmdGetSubAlbumforAlbum = new PwgCmdGetSubAlbumforAlbum();
86                }
87                return _pwgCmdGetSubAlbumforAlbum;
88            }
89        }
90
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        }
103    }
104}
Note: See TracBrowser for help on using the repository browser.