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 "PwgCmdGetImageforAlbum": objICom = PwgCmdGetImageforAlbum; break; case "PwgCmdGetSubAlbumforAlbum": objICom = PwgCmdGetSubAlbumforAlbum; 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 _pwgCmdGetImageforAlbum; public static AsyncCommand PwgCmdGetImageforAlbum { get { if (_pwgCmdGetImageforAlbum == null) { _pwgCmdGetImageforAlbum = new PwgCmdGetImageforAlbum(); } return _pwgCmdGetImageforAlbum; } } public static AsyncCommand _pwgCmdGetSubAlbumforAlbum; public static AsyncCommand PwgCmdGetSubAlbumforAlbum { get { if (_pwgCmdGetSubAlbumforAlbum == null) { _pwgCmdGetSubAlbumforAlbum = new PwgCmdGetSubAlbumforAlbum(); } return _pwgCmdGetSubAlbumforAlbum; } } public static AsyncCommand _pwgCmdGetImageforTag; public static AsyncCommand PwgCmdGetImageforTag { get { if (_pwgCmdGetImageforTag == null) { _pwgCmdGetImageforTag = new PwgCmdGetImageforTag(); } return _pwgCmdGetImageforTag; } } } }