using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows.Input; namespace Com.Piwigo.Wpf.Command { public static class PwgCmdProvider { public static AsyncCommand GetByType() { AsyncCommand objICom; switch (typeof(T).Name) { case "PwgCmdConnect": objICom = PwgCmdConnect; break; case "PwgCmdDisconnect": objICom = PwgCmdDisconnect; break; case "PwgCmdGetImageforCategory": objICom = PwgCmdGetImageforCategory; break; case "PwgCmdGetSubCategorieforCategory": objICom = PwgCmdGetSubCategorieforCategory; break; case "PwgCmdGetImageforTag": objICom = PwgCmdGetImageforTag; break; default: throw new ArgumentException("AsyncCommand GetByType : Command Type unknow.", "Type"); } return objICom; } public static AsyncCommand _pwgCmdConnect; public static AsyncCommand PwgCmdConnect { get { if (_pwgCmdConnect == null) { _pwgCmdConnect = new PwgCmdConnect(); } return _pwgCmdConnect; } } public static AsyncCommand _pwgCmdDisconnect; public static AsyncCommand PwgCmdDisconnect { get { if (_pwgCmdDisconnect == null) { _pwgCmdDisconnect = new PwgCmdDisconnect(); } return _pwgCmdDisconnect; } } public static AsyncCommand _pwgCmdGetImageforCategory; public static AsyncCommand PwgCmdGetImageforCategory { get { if (_pwgCmdGetImageforCategory == null) { _pwgCmdGetImageforCategory = new PwgCmdGetImageforCategory(); } return _pwgCmdGetImageforCategory; } } public static AsyncCommand _pwgCmdGetSubCategorieforCategory; public static AsyncCommand PwgCmdGetSubCategorieforCategory { get { if (_pwgCmdGetSubCategorieforCategory == null) { _pwgCmdGetSubCategorieforCategory = new PwgCmdGetSubCategorieforCategory(); } return _pwgCmdGetSubCategorieforCategory; } } public static AsyncCommand _pwgCmdGetImageforTag; public static AsyncCommand PwgCmdGetImageforTag { get { if (_pwgCmdGetImageforTag == null) { _pwgCmdGetImageforTag = new PwgCmdGetImageforTag(); } return _pwgCmdGetImageforTag; } } } }