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

Last change on this file since 11935 was 11935, checked in by bayral, 13 years ago

root category handled

File size: 2.6 KB
RevLine 
[7150]1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Windows.Input;
6
7namespace 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;
23                case "PwgCmdGetImageforCategory":
24                    objICom = PwgCmdGetImageforCategory;
25                    break;
[11935]26                case "PwgCmdGetSubCategorieforCategory":
27                    objICom = PwgCmdGetSubCategorieforCategory;
28                    break;
[11911]29                default:
[11935]30                    throw new ArgumentException("AsyncCommand GetByType : Command Type unknow.", "Type");
[11911]31            }
32
33            return objICom;
34        }
35
[11922]36        public static AsyncCommand _pwgCmdConnect;
37        public static AsyncCommand PwgCmdConnect
[11911]38        {
[7150]39            get
40            {
41                if (_pwgCmdConnect == null)
42                {
43                    _pwgCmdConnect = new PwgCmdConnect();
44                }
45                return _pwgCmdConnect;
46            }
47        }
[11911]48
[11922]49        public static AsyncCommand _pwgCmdDisconnect;
50        public static AsyncCommand PwgCmdDisconnect
[11911]51        {
52            get
53            {
54                if (_pwgCmdDisconnect == null)
55                {
56                    _pwgCmdDisconnect = new PwgCmdDisconnect();
57                }
58                return _pwgCmdDisconnect;
59            }
60        }
61
[11922]62        public static AsyncCommand _pwgCmdGetImageforCategory;
63        public static AsyncCommand PwgCmdGetImageforCategory
[11911]64        {
65            get
66            {
67                if (_pwgCmdGetImageforCategory == null)
68                {
69                    _pwgCmdGetImageforCategory = new PwgCmdGetImageforCategory();
70                }
71                return _pwgCmdGetImageforCategory;
72            }
73        }
[11935]74
75        public static AsyncCommand _pwgCmdGetSubCategorieforCategory;
76        public static AsyncCommand PwgCmdGetSubCategorieforCategory
77        {
78            get
79            {
80                if (_pwgCmdGetSubCategorieforCategory == null)
81                {
82                    _pwgCmdGetSubCategorieforCategory = new PwgCmdGetSubCategorieforCategory();
83                }
84                return _pwgCmdGetSubCategorieforCategory;
85            }
86        }
87
[7150]88    }
89}
Note: See TracBrowser for help on using the repository browser.