[12256] | 1 | using System; |
---|
| 2 | using System.Collections.Generic; |
---|
| 3 | using System.Text; |
---|
| 4 | using System.ComponentModel; |
---|
| 5 | using Com.Piwigo.Lib.DTO; |
---|
| 6 | |
---|
| 7 | namespace Com.Piwigo.Uploader.DTO |
---|
| 8 | { |
---|
| 9 | public sealed class ModelManager |
---|
| 10 | { |
---|
| 11 | static readonly ModelManagerBase _instance = new ModelManagerBase(); |
---|
| 12 | |
---|
| 13 | // Explicit static constructor to tell C# compiler |
---|
| 14 | // not to mark type as beforefieldinit |
---|
| 15 | static ModelManager() |
---|
| 16 | { |
---|
| 17 | } |
---|
| 18 | |
---|
| 19 | public static ModelManagerBase Instance |
---|
| 20 | { |
---|
| 21 | get |
---|
| 22 | { |
---|
| 23 | return _instance; |
---|
| 24 | } |
---|
| 25 | } |
---|
| 26 | |
---|
| 27 | public class ModelManagerBase |
---|
| 28 | { |
---|
| 29 | public PwgSession sess { get; set; } |
---|
[12336] | 30 | public SelectedPwgAlbumList lstCat { get; set; } |
---|
| 31 | public Int32 PwgAlbumIdSelected { get; set; } |
---|
[12262] | 32 | public LocalAlbumList lstAlbumLocaux { get; set; } |
---|
[12256] | 33 | public Boolean isConnected { get; set; } |
---|
| 34 | public String directoryName { get; set; } |
---|
| 35 | public Uri serveurName { get; set; } |
---|
| 36 | public String userName { get; set; } |
---|
| 37 | public String password { get; set; } |
---|
[12262] | 38 | |
---|
| 39 | public ModelManagerBase() |
---|
| 40 | { |
---|
[12336] | 41 | lstCat = new SelectedPwgAlbumList(); |
---|
[12262] | 42 | lstAlbumLocaux = new LocalAlbumList(); |
---|
| 43 | isConnected = false; |
---|
| 44 | } |
---|
| 45 | |
---|
| 46 | internal void resetLstCat() |
---|
| 47 | { |
---|
| 48 | if (lstCat == null) |
---|
| 49 | { |
---|
[12336] | 50 | lstCat = new SelectedPwgAlbumList(); |
---|
[12262] | 51 | } |
---|
| 52 | else |
---|
| 53 | { |
---|
| 54 | lstCat.Clear(); |
---|
| 55 | } |
---|
[12336] | 56 | lstCat.Add(new SelectedAlbumListItem() { Id = PwgAlbum.RootAlbumId, ShowedValue = "Root album", Data=null, isSelected=true }); |
---|
[12262] | 57 | } |
---|
[12256] | 58 | } |
---|
| 59 | } |
---|
| 60 | } |
---|