Ignore:
Timestamp:
Oct 3, 2011, 5:09:51 PM (13 years ago)
Author:
bayral
Message:

rename category to Albums

Location:
extensions/PiwigoLib/PiwigoWpf
Files:
8 added
8 deleted
15 edited

Legend:

Unmodified
Added
Removed
  • extensions/PiwigoLib/PiwigoWpf/App.xaml

    r12015 r12336  
    88        <ObjectDataProvider x:Name="ImagesODP" x:Key="Images" ObjectType="{x:Type piwigo:PwgImageListWPF}"/> <!--IsAsynchronous="True"-->
    99        <ObjectDataProvider x:Name="SessionODP" x:Key="Session" ObjectType="{x:Type piwigo:PwgSessionWPF}" />
    10         <ObjectDataProvider x:Name="CategoriesODP" x:Key="Categories" ObjectType="{x:Type piwigo:PwgRootCategoryListWPF}"/> <!--IsAsynchronous="True"-->
     10        <ObjectDataProvider x:Name="AlbumsODP" x:Key="Albums" ObjectType="{x:Type piwigo:PwgRootAlbumListWPF}"/> <!--IsAsynchronous="True"-->
    1111        <ObjectDataProvider x:Name="TagsODP" x:Key="Tags" ObjectType="{x:Type piwigo:PwgTagListWPF}"/>
    1212        <!--IsAsynchronous="True"-->
  • extensions/PiwigoLib/PiwigoWpf/App.xaml.cs

    r12015 r12336  
    2222             // Model object was created in the app.xaml, so we have to link to them
    2323            PwgModelManager.Instance.Session = (PwgSessionWPF)(this.Resources["Session"] as ObjectDataProvider).Data;
    24             PwgModelManager.Instance.CategoryList = (PwgRootCategoryListWPF)(this.Resources["Categories"] as ObjectDataProvider).Data;
     24            PwgModelManager.Instance.AlbumList = (PwgRootAlbumListWPF)(this.Resources["Albums"] as ObjectDataProvider).Data;
    2525            PwgModelManager.Instance.ImageList = (PwgImageListWPF)(this.Resources["Images"] as ObjectDataProvider).Data;
    2626            PwgModelManager.Instance.TagsList = (PwgTagListWPF)(this.Resources["Tags"] as ObjectDataProvider).Data;
  • extensions/PiwigoLib/PiwigoWpf/Command/PwgCmdConnect.cs

    r12015 r12336  
    3333                }
    3434
    35                 SendUiInfo("Retriving list of Category from server...");
     35                SendUiInfo("Retriving list of Album from server...");
    3636                PwgSessionWPFHelper.AddPwgSessionInfoToPwgSessionWPF(sess, ref sesWPF);
    3737
    38                 PwgCategoryListWPFHelper.InitRootCategory();
     38                PwgAlbumListWPFHelper.InitRootAlbum();
    3939
    40                 List<PwgCategory> lstCat = PwgServiceProvider.Instance.PwgCategoriesService.GetListOfCategory(null, null, null); //(PwgModelManager.Instance.Session.Status == PwgSessionStatusEnum.Guest)
    41                 PwgRootCategoryWPF aRootCatWPF = PwgModelManager.Instance.RootCategoryList;
     40                List<PwgAlbum> lstCat = PwgServiceProvider.Instance.PwgAlbumsService.GetListOfAlbum(null, null, null); //(PwgModelManager.Instance.Session.Status == PwgSessionStatusEnum.Guest)
     41                PwgRootAlbumWPF aRootCatWPF = PwgModelManager.Instance.RootAlbumList;
    4242
    43                 PwgCategoryListWPFHelper.ConvertPwgCategoryListToPwgRootCategoryWPF(lstCat, ref aRootCatWPF);
     43                PwgAlbumListWPFHelper.ConvertPwgAlbumListToPwgRootAlbumWPF(lstCat, ref aRootCatWPF);
    4444                aRootCatWPF.IsExpanded = true;
    4545
  • extensions/PiwigoLib/PiwigoWpf/Command/PwgCmdDisconnect.cs

    r11935 r12336  
    2626                PwgSessionWPFHelper.AddPwgSessionInfoToPwgSessionWPF(sess, ref sesWPF);
    2727
    28                 SendUiInfo("Removing Image and Category ...");
     28                SendUiInfo("Removing Image and Album ...");
    2929                if (PwgModelManager.Instance.ImageList != null)
    3030                {
     
    3232                }
    3333
    34                 if ((PwgModelManager.Instance.CategoryList != null)
    35                     && (PwgModelManager.Instance.RootCategoryList != null))
     34                if ((PwgModelManager.Instance.AlbumList != null)
     35                    && (PwgModelManager.Instance.RootAlbumList != null))
    3636                {
    37                     PwgModelManager.Instance.RootCategoryList.Childrens.Clear();
     37                    PwgModelManager.Instance.RootAlbumList.Childrens.Clear();
    3838                }
    3939
    40                 if (PwgModelManager.Instance.CategoryList != null)
     40                if (PwgModelManager.Instance.AlbumList != null)
    4141                {
    42                     PwgModelManager.Instance.CategoryList.Clear();
     42                    PwgModelManager.Instance.AlbumList.Clear();
    4343                }
    4444
  • extensions/PiwigoLib/PiwigoWpf/Command/PwgCmdGetImageforTag.cs

    r12015 r12336  
    3636                    tagParam = (PwgTagWPF)parameter;
    3737                    SendUiInfo("Setting up cache data...");
    38                     ImageCacheManager.Instance.SetCurrentCategory("Tag-" + tagParam.Name);
     38                    ImageCacheManager.Instance.SetCurrentAlbum("Tag-" + tagParam.Name);
    3939
    4040                    SendUiInfo("Retriving images list from server...");
  • extensions/PiwigoLib/PiwigoWpf/Command/PwgCmdProvider.cs

    r12015 r12336  
    2121                    objICom = PwgCmdDisconnect;
    2222                    break;
    23                 case "PwgCmdGetImageforCategory":
    24                     objICom = PwgCmdGetImageforCategory;
     23                case "PwgCmdGetImageforAlbum":
     24                    objICom = PwgCmdGetImageforAlbum;
    2525                    break;
    26                 case "PwgCmdGetSubCategorieforCategory":
    27                     objICom = PwgCmdGetSubCategorieforCategory;
     26                case "PwgCmdGetSubAlbumforAlbum":
     27                    objICom = PwgCmdGetSubAlbumforAlbum;
    2828                    break;
    2929                case "PwgCmdGetImageforTag":
     
    6363        }
    6464
    65         public static AsyncCommand _pwgCmdGetImageforCategory;
    66         public static AsyncCommand PwgCmdGetImageforCategory
     65        public static AsyncCommand _pwgCmdGetImageforAlbum;
     66        public static AsyncCommand PwgCmdGetImageforAlbum
    6767        {
    6868            get
    6969            {
    70                 if (_pwgCmdGetImageforCategory == null)
     70                if (_pwgCmdGetImageforAlbum == null)
    7171                {
    72                     _pwgCmdGetImageforCategory = new PwgCmdGetImageforCategory();
     72                    _pwgCmdGetImageforAlbum = new PwgCmdGetImageforAlbum();
    7373                }
    74                 return _pwgCmdGetImageforCategory;
     74                return _pwgCmdGetImageforAlbum;
    7575            }
    7676        }
    7777
    78         public static AsyncCommand _pwgCmdGetSubCategorieforCategory;
    79         public static AsyncCommand PwgCmdGetSubCategorieforCategory
     78        public static AsyncCommand _pwgCmdGetSubAlbumforAlbum;
     79        public static AsyncCommand PwgCmdGetSubAlbumforAlbum
    8080        {
    8181            get
    8282            {
    83                 if (_pwgCmdGetSubCategorieforCategory == null)
     83                if (_pwgCmdGetSubAlbumforAlbum == null)
    8484                {
    85                     _pwgCmdGetSubCategorieforCategory = new PwgCmdGetSubCategorieforCategory();
     85                    _pwgCmdGetSubAlbumforAlbum = new PwgCmdGetSubAlbumforAlbum();
    8686                }
    87                 return _pwgCmdGetSubCategorieforCategory;
     87                return _pwgCmdGetSubAlbumforAlbum;
    8888            }
    8989        }
  • extensions/PiwigoLib/PiwigoWpf/DTO/Helper/PwgImageWPFHelper.cs

    r11904 r12336  
    2828                aPwgImageWPF.Width = aPwgImage.Width;
    2929
    30                 if (aPwgImageWPF.Categories == null)
     30                if (aPwgImageWPF.Albums == null)
    3131                {
    32                     aPwgImageWPF.Categories = new System.Collections.ObjectModel.ObservableCollection<PwgCategoryWPF>();
     32                    aPwgImageWPF.Albums = new System.Collections.ObjectModel.ObservableCollection<PwgAlbumWPF>();
    3333                }
    3434                else
    3535                {
    36                     aPwgImageWPF.Categories.Clear();
     36                    aPwgImageWPF.Albums.Clear();
    3737                }
    3838
    39                 foreach (PwgCategoryWPF c in aPwgImageWPF.Categories)
     39                foreach (PwgAlbumWPF c in aPwgImageWPF.Albums)
    4040                {
    41                     aPwgImageWPF.Categories.Add(c);
     41                    aPwgImageWPF.Albums.Add(c);
    4242                }
    4343
  • extensions/PiwigoLib/PiwigoWpf/DTO/Helper/PwgTagListWPFHelper.cs

    r12015 r12336  
    99    public static class PwgTagListWPFHelper
    1010    {
    11         public static void AddPwgTagToList(PwgTag aPwgCategory,
    12                                            ref PwgTagListWPF aPwgCategoryListWPF)
     11        public static void AddPwgTagToList(PwgTag aPwgAlbum,
     12                                           ref PwgTagListWPF aPwgAlbumListWPF)
    1313        {
    14             if (aPwgCategory != null)
     14            if (aPwgAlbum != null)
    1515            {
    16                 if (aPwgCategoryListWPF == null)
     16                if (aPwgAlbumListWPF == null)
    1717                {
    18                     aPwgCategoryListWPF = new PwgTagListWPF();
     18                    aPwgAlbumListWPF = new PwgTagListWPF();
    1919                }
    2020
    2121                PwgTagWPF pwgTag = new PwgTagWPF();
    22                 PwgTagWPFHelper.ConvertPwgTagToPwgTagWPF(aPwgCategory, ref pwgTag);
     22                PwgTagWPFHelper.ConvertPwgTagToPwgTagWPF(aPwgAlbum, ref pwgTag);
    2323
    24                 aPwgCategoryListWPF.Add(pwgTag);
     24                aPwgAlbumListWPF.Add(pwgTag);
    2525            }
    2626        }
  • extensions/PiwigoLib/PiwigoWpf/DTO/LocalPwgImage.cs

    r12262 r12336  
    1414    {
    1515        //FileInfo highResFile, FileInfo lowResFile, FileInfo thumbFile, String imageName, String imageAuthor, DateTime creationDate,
    16         //    String authorComment, List<String> lstCategories, List<String> lstTags, PwgConfidentLevelEnum? confidentLevel
     16        //    String authorComment, List<String> lstAlbums, List<String> lstTags, PwgConfidentLevelEnum? confidentLevel
    1717
    1818        private Int32 _id;
  • extensions/PiwigoLib/PiwigoWpf/DTO/PwgImageWPF.cs

    r11926 r12336  
    112112        }
    113113
    114         //public List<PwgCategoryWPF> Categories { get; set; }
    115         private ObservableCollection<PwgCategoryWPF> _categories;
    116         public ObservableCollection<PwgCategoryWPF> Categories
     114        //public List<PwgAlbumWPF> Albums { get; set; }
     115        private ObservableCollection<PwgAlbumWPF> _Albums;
     116        public ObservableCollection<PwgAlbumWPF> Albums
    117117        {
    118             set { _categories = value; OnPropertyChanged("Categories"); }
    119             get { return _categories; }
     118            set { _Albums = value; OnPropertyChanged("Albums"); }
     119            get { return _Albums; }
    120120        }
    121121        public event PropertyChangedEventHandler PropertyChanged;
  • extensions/PiwigoLib/PiwigoWpf/DTO/PwgModelManager.cs

    r12038 r12336  
    6767            }
    6868
    69             private PwgRootCategoryListWPF _categoryList = new PwgRootCategoryListWPF();
    70             public PwgRootCategoryListWPF CategoryList
     69            private PwgRootAlbumListWPF _AlbumList = new PwgRootAlbumListWPF();
     70            public PwgRootAlbumListWPF AlbumList
    7171            {
    72                 set { _categoryList = value; OnPropertyChanged("CategoryList"); }
    73                 get { return _categoryList; }
     72                set { _AlbumList = value; OnPropertyChanged("AlbumList"); }
     73                get { return _AlbumList; }
    7474            }
    7575
    76             private PwgRootCategoryWPF _rootCategoryList;
    77             public PwgRootCategoryWPF RootCategoryList
     76            private PwgRootAlbumWPF _rootAlbumList;
     77            public PwgRootAlbumWPF RootAlbumList
    7878            {
    79                 set { _rootCategoryList = value; OnPropertyChanged("RootCategoryList"); }
    80                 get { return _rootCategoryList; }
     79                set { _rootAlbumList = value; OnPropertyChanged("RootAlbumList"); }
     80                get { return _rootAlbumList; }
    8181            }
    8282
     
    9696            }
    9797
    98             private LocalPwgCategoryListWPF _localCategoryToImport;
    99             public LocalPwgCategoryListWPF LocalCategoryToImport
     98            private LocalPwgAlbumListWPF _localAlbumToImport;
     99            public LocalPwgAlbumListWPF LocalAlbumToImport
    100100            {
    101                 set { _localCategoryToImport = value; OnPropertyChanged("LocalCategoryToImport"); }
    102                 get { return _localCategoryToImport; }
     101                set { _localAlbumToImport = value; OnPropertyChanged("LocalAlbumToImport"); }
     102                get { return _localAlbumToImport; }
    103103            }
    104104           
  • extensions/PiwigoLib/PiwigoWpf/MainWindow.xaml

    r12015 r12336  
    142142                Grid.Row="1" 
    143143                MinWidth="180" >
    144             <TabItem Header="Categories">
    145             <TreeView Name="listViewCategory
    146                 DataContext="{Binding Source={StaticResource Categories}}"
    147                 ItemsSource="{Binding}"  MouseDoubleClick="listViewCategory_MouseDoubleClick"
    148                 HorizontalAlignment="Left" PreviewMouseDown="listViewCategory_PreviewMouseDown">
     144            <TabItem Header="Albums">
     145            <TreeView Name="listViewAlbum
     146                DataContext="{Binding Source={StaticResource Albums}}"
     147                ItemsSource="{Binding}"  MouseDoubleClick="listViewAlbum_MouseDoubleClick"
     148                HorizontalAlignment="Left" PreviewMouseDown="listViewAlbum_PreviewMouseDown">
    149149                <TreeView.ItemContainerStyle>
    150150                    <!--
     
    188188                <TreeView.Resources>
    189189                    <HierarchicalDataTemplate
    190                     DataType="{x:Type pwgdto:PwgTreeCategoryWPF}"
     190                    DataType="{x:Type pwgdto:PwgTreeAlbumWPF}"
    191191                    ItemsSource="{Binding Childrens}"
    192192                    >
     
    200200                    </HierarchicalDataTemplate>
    201201                    <HierarchicalDataTemplate
    202                 DataType="{x:Type pwgdto:PwgCategoryWPF}"
     202                DataType="{x:Type pwgdto:PwgAlbumWPF}"
    203203                ItemsSource="{Binding Childrens}"
    204204                >
     
    213213                                    <TextBlock Text="{Binding Path=ImagesCount}"/>
    214214                                    <TextBlock Text=" images inside"/>
    215                                     <TextBlock Text="{Binding Path=SubCategoriesCount}"/>
    216                                     <TextBlock Text=" categories inside"/>
     215                                    <TextBlock Text="{Binding Path=SubAlbumsCount}"/>
     216                                    <TextBlock Text=" Albums inside"/>
    217217                                </UniformGrid>
    218218                            </StackPanel.ToolTip>
  • extensions/PiwigoLib/PiwigoWpf/MainWindow.xaml.cs

    r12015 r12336  
    3030        }
    3131
    32         private void listViewCategory_MouseDoubleClick(object sender, MouseButtonEventArgs e)
     32        private void listViewAlbum_MouseDoubleClick(object sender, MouseButtonEventArgs e)
    3333        {
    34             AppHelper.ExecuteCommand<PwgCmdGetImageforCategory>(listViewCategory.SelectedValue);
     34            AppHelper.ExecuteCommand<PwgCmdGetImageforAlbum>(listViewAlbum.SelectedValue);
    3535        }
    3636
    3737        private void listViewImage_SelectionChanged(object sender, SelectionChangedEventArgs e)
    3838        {
    39             if (PwgCmdSelectImageInCategory.Command.CanExecute(sender))
     39            if (PwgCmdSelectImageInAlbum.Command.CanExecute(sender))
    4040            {
    41                 PwgCmdSelectImageInCategory.Command.Execute(sender);
     41                PwgCmdSelectImageInAlbum.Command.Execute(sender);
    4242            }
    4343        }
    4444
    45         private void listViewCategory_PreviewMouseDown(object sender, MouseButtonEventArgs e)
     45        private void listViewAlbum_PreviewMouseDown(object sender, MouseButtonEventArgs e)
    4646        {
    4747            e.Handled = false;
     
    5353            if (dep != null)
    5454            {
    55                 if (((TreeViewItem)dep).DataContext is PwgCategoryWPF)
     55                if (((TreeViewItem)dep).DataContext is PwgAlbumWPF)
    5656                {
    57                     PwgCategoryWPF aCat = (PwgCategoryWPF)((TreeViewItem)dep).DataContext;
     57                    PwgAlbumWPF aCat = (PwgAlbumWPF)((TreeViewItem)dep).DataContext;
    5858
    5959                    if ((e.ChangedButton == MouseButton.Left) && (e.ClickCount == 1))
     
    6262                        if (aCat.Childrens == null)
    6363                        {
    64                             AppHelper.ExecuteCommand<PwgCmdGetSubCategorieforCategory>(aCat);
     64                            AppHelper.ExecuteCommand<PwgCmdGetSubAlbumforAlbum>(aCat);
    6565                        }
    6666                    }
  • extensions/PiwigoLib/PiwigoWpf/PiwigoWpf.csproj

    r12038 r12336  
    7676    </ApplicationDefinition>
    7777    <Compile Include="Command\PwgCmdGetImageforTag.cs" />
    78     <Compile Include="Command\PwgCmdGetSubCategorieforCategory.cs" />
    79     <Compile Include="Command\PwgCmdSelectImageInCategory.cs" />
     78    <Compile Include="Command\PwgCmdGetSubAlbumforAlbum.cs" />
     79    <Compile Include="Command\PwgCmdSelectImageInAlbum.cs" />
    8080    <Compile Include="Command\DelegateCommand.cs" />
    8181    <Compile Include="Command\PwgCmdDeleteTrace.cs" />
    8282    <Compile Include="Command\PwgCmdDisconnect.cs" />
    8383    <Compile Include="Command\PwgCmdEventsConsumer.cs" />
    84     <Compile Include="Command\PwgCmdGetImageforCategory.cs" />
     84    <Compile Include="Command\PwgCmdGetImageforAlbum.cs" />
    8585    <Compile Include="Command\PwgCmdProvider.cs" />
    8686    <Compile Include="Command\PwgCmdConnect.cs" />
     
    9191    <Compile Include="DTO\Helper\PwgImageListWPFHelper.cs" />
    9292    <Compile Include="DTO\Helper\PwgImageWPFHelper.cs" />
    93     <Compile Include="DTO\Helper\PwgCategoryWPFHelper.cs" />
    94     <Compile Include="DTO\Helper\PwgCategoryListWPFHelper.cs" />
     93    <Compile Include="DTO\Helper\PwgAlbumWPFHelper.cs" />
     94    <Compile Include="DTO\Helper\PwgAlbumListWPFHelper.cs" />
    9595    <Compile Include="DTO\Helper\PwgSessionWPFHelper.cs" />
    96     <Compile Include="DTO\LocalPwgCategory.cs" />
     96    <Compile Include="DTO\LocalPwgAlbum.cs" />
    9797    <Compile Include="DTO\LocalPwgImage.cs" />
    9898    <Compile Include="DTO\PwgModelManager.cs" />
     
    117117    <Compile Include="DTO\PwgTagListWPF.cs" />
    118118    <Compile Include="DTO\PwgImageListWPF.cs" />
    119     <Compile Include="DTO\PwgCategoryListWPF.cs" />
    120     <Compile Include="DTO\PwgCategoryWPF.cs" />
     119    <Compile Include="DTO\PwgAlbumListWPF.cs" />
     120    <Compile Include="DTO\PwgTreeAlbumWPF.cs" />
    121121    <Compile Include="DTO\PwgImageWPF.cs" />
    122122    <Compile Include="DTO\PwgSessionWPF.cs" />
  • extensions/PiwigoLib/PiwigoWpf/Services/ImageCacheManager.cs

    r11926 r12336  
    6464            #region DTO
    6565            // local DTO
    66             internal class CategoryDictionnaryItem
     66            internal class AlbumDictionnaryItem
    6767            {
    6868                internal DirectoryInfo BasePath;
    69                 internal String CategorieId;
     69                internal String AlbumId;
    7070            };
    7171
    72             internal class CategoryDictionnary : SortedDictionary<String, CategoryDictionnaryItem> { };
     72            internal class AlbumDictionnary : SortedDictionary<String, AlbumDictionnaryItem> { };
    7373
    7474            internal class ServerDictionnaryItem
    7575            {
    7676                internal DirectoryInfo BasePath;
    77                 internal CategoryDictionnary Categories;
     77                internal AlbumDictionnary Albums;
    7878                internal Uri ServeurUrl;
    7979            };
     
    8686            internal ServerDictionnary _aServerDictionnary;
    8787            internal ServerDictionnaryItem _currentServer;
    88             internal CategoryDictionnaryItem _currentCategory;
     88            internal AlbumDictionnaryItem _currentAlbum;
    8989
    9090            #endregion DTO
     
    100100            }
    101101           
    102             static private String BuildCategoryDirCache(ServerDictionnaryItem server, String CatgeoryId)
    103             {
    104                 String CategoryDirCache = String.Empty;
     102            static private String BuildAlbumDirCache(ServerDictionnaryItem server, String CatgeoryId)
     103            {
     104                String AlbumDirCache = String.Empty;
    105105                if (server != null)
    106106                {
    107                     CategoryDirCache = Path.Combine(server.BasePath.FullName, CatgeoryId.Replace("/", "_"));
     107                    AlbumDirCache = Path.Combine(server.BasePath.FullName, CatgeoryId.Replace("/", "_"));
    108108                }
    109109                else
    110110                {
    111                     throw new ApplicationException ("Current server not set before using category");
    112                 }
    113 
    114                 return CategoryDirCache;
     111                    throw new ApplicationException ("Current server not set before using Album");
     112                }
     113
     114                return AlbumDirCache;
    115115            }
    116116
     
    147147            public void UnsetCurrentServer()
    148148            {
    149                 _currentCategory = null;
     149                _currentAlbum = null;
    150150                _currentServer = null;
    151151            }
     
    171171                        server.ServeurUrl = new Uri(serveurUri);
    172172                        server.BasePath = new DirectoryInfo(currentserverDir);
    173                         server.Categories = new CategoryDictionnary();
     173                        server.Albums = new AlbumDictionnary();
    174174                        _aServerDictionnary.Add(serveurUri, server);
    175175                        _currentServer = server;
     
    180180                        //Create it
    181181                        Directory.CreateDirectory(currentserverDir);
    182                         _currentServer.Categories.Clear();
    183                     }
    184                 }
    185             }
    186 
    187             public void SetCurrentCategory(String CategorieId)
     182                        _currentServer.Albums.Clear();
     183                    }
     184                }
     185            }
     186
     187            public void SetCurrentAlbum(String AlbumId)
    188188            {
    189189                if (_currentServer != null)
     
    191191                    lock (_lock)
    192192                    {
    193                         String currentsCategoryDir = BuildCategoryDirCache(_currentServer, CategorieId);
    194                         if (_currentServer.Categories.ContainsKey(CategorieId))
    195                         {
    196                             _currentCategory = _currentServer.Categories[CategorieId];
     193                        String currentsAlbumDir = BuildAlbumDirCache(_currentServer, AlbumId);
     194                        if (_currentServer.Albums.ContainsKey(AlbumId))
     195                        {
     196                            _currentAlbum = _currentServer.Albums[AlbumId];
    197197                        }
    198198                        else
    199199                        {
    200                             CategoryDictionnaryItem category = new CategoryDictionnaryItem();
    201                             category.BasePath = new DirectoryInfo(currentsCategoryDir);
    202                             category.CategorieId = CategorieId;
    203                             _currentServer.Categories.Add(CategorieId, category);
    204                             _currentCategory = category;
    205                         }
    206 
    207                         if (!Directory.Exists(currentsCategoryDir))
     200                            AlbumDictionnaryItem Album = new AlbumDictionnaryItem();
     201                            Album.BasePath = new DirectoryInfo(currentsAlbumDir);
     202                            Album.AlbumId = AlbumId;
     203                            _currentServer.Albums.Add(AlbumId, Album);
     204                            _currentAlbum = Album;
     205                        }
     206
     207                        if (!Directory.Exists(currentsAlbumDir))
    208208                        {
    209209                            //Create it
    210                             Directory.CreateDirectory(currentsCategoryDir);
     210                            Directory.CreateDirectory(currentsAlbumDir);
    211211                        }
    212212                    }
     
    214214                else
    215215                {
    216                     throw new ApplicationException("Current server not set before using category");
     216                    throw new ApplicationException("Current server not set before using Album");
    217217                }
    218218            }
     
    226226                    }
    227227
    228                     if (_currentCategory != null)
    229                     {
    230                         String localDir = Path.Combine(_currentCategory.BasePath.FullName, strImageType);
     228                    if (_currentAlbum != null)
     229                    {
     230                        String localDir = Path.Combine(_currentAlbum.BasePath.FullName, strImageType);
    231231                        if (!Directory.Exists(localDir))
    232232                        {
     
    277277                    else
    278278                    {
    279                         throw new ApplicationException("Current category not set before using image cache.");
     279                        throw new ApplicationException("Current Album not set before using image cache.");
    280280                    }
    281281                }
Note: See TracChangeset for help on using the changeset viewer.