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; } |
---|
30 | public SelectedPwgCategoryList lstCat { get; set; } |
---|
31 | public Int32 PwgCategoryIdSelected { get; set; } |
---|
32 | public LocalAlbumList lstAlbumLocaux { get; set; } |
---|
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; } |
---|
38 | |
---|
39 | public ModelManagerBase() |
---|
40 | { |
---|
41 | lstCat = new SelectedPwgCategoryList(); |
---|
42 | lstAlbumLocaux = new LocalAlbumList(); |
---|
43 | isConnected = false; |
---|
44 | } |
---|
45 | |
---|
46 | internal void resetLstCat() |
---|
47 | { |
---|
48 | if (lstCat == null) |
---|
49 | { |
---|
50 | lstCat = new SelectedPwgCategoryList(); |
---|
51 | } |
---|
52 | else |
---|
53 | { |
---|
54 | lstCat.Clear(); |
---|
55 | } |
---|
56 | lstCat.Add(new SelectedCategoryListItem() { Id = PwgCategory.RootCategoryId, ShowedValue = "Root album", Data=null, isSelected=true }); |
---|
57 | } |
---|
58 | } |
---|
59 | } |
---|
60 | } |
---|