Changeset 7149


Ignore:
Timestamp:
Oct 10, 2010, 10:45:43 PM (14 years ago)
Author:
bayral
Message:

Piwigolib is now modify for mask the implementation of proxy.
Add start version of piwigo WPF

Location:
extensions/PiwigoLib
Files:
23 edited

Legend:

Unmodified
Added
Removed
  • extensions/PiwigoLib/Piwigo.sln

    r6811 r7149  
    11
    22Microsoft Visual Studio Solution File, Format Version 11.00
    3 # Visual C# Express 2010
     3# Visual Studio 2010
    44Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PiwigoLib", "PiwigoLib\PiwigoLib.csproj", "{64C068C5-DBFE-4712-9081-B9100698F35C}"
    55EndProject
    66Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestPiwigoLib", "TestPiwigoLib\TestPiwigoLib.csproj", "{9B390DE8-884A-433D-828A-C7B969F19924}"
    77EndProject
     8Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PiwigoWpf", "PiwigoWpf\PiwigoWpf.csproj", "{59F7FCF2-858A-406D-92A6-50514BD89B43}"
     9EndProject
    810Global
    911        GlobalSection(SolutionConfigurationPlatforms) = preSolution
    1012                Debug|Any CPU = Debug|Any CPU
     13                Debug|Mixed Platforms = Debug|Mixed Platforms
     14                Debug|x86 = Debug|x86
    1115                Release|Any CPU = Release|Any CPU
     16                Release|Mixed Platforms = Release|Mixed Platforms
     17                Release|x86 = Release|x86
    1218        EndGlobalSection
    1319        GlobalSection(ProjectConfigurationPlatforms) = postSolution
    1420                {64C068C5-DBFE-4712-9081-B9100698F35C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
    1521                {64C068C5-DBFE-4712-9081-B9100698F35C}.Debug|Any CPU.Build.0 = Debug|Any CPU
     22                {64C068C5-DBFE-4712-9081-B9100698F35C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
     23                {64C068C5-DBFE-4712-9081-B9100698F35C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
     24                {64C068C5-DBFE-4712-9081-B9100698F35C}.Debug|x86.ActiveCfg = Debug|Any CPU
    1625                {64C068C5-DBFE-4712-9081-B9100698F35C}.Release|Any CPU.ActiveCfg = Release|Any CPU
    1726                {64C068C5-DBFE-4712-9081-B9100698F35C}.Release|Any CPU.Build.0 = Release|Any CPU
     27                {64C068C5-DBFE-4712-9081-B9100698F35C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
     28                {64C068C5-DBFE-4712-9081-B9100698F35C}.Release|Mixed Platforms.Build.0 = Release|Any CPU
     29                {64C068C5-DBFE-4712-9081-B9100698F35C}.Release|x86.ActiveCfg = Release|Any CPU
    1830                {9B390DE8-884A-433D-828A-C7B969F19924}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
    1931                {9B390DE8-884A-433D-828A-C7B969F19924}.Debug|Any CPU.Build.0 = Debug|Any CPU
     32                {9B390DE8-884A-433D-828A-C7B969F19924}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
     33                {9B390DE8-884A-433D-828A-C7B969F19924}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
     34                {9B390DE8-884A-433D-828A-C7B969F19924}.Debug|x86.ActiveCfg = Debug|Any CPU
    2035                {9B390DE8-884A-433D-828A-C7B969F19924}.Release|Any CPU.ActiveCfg = Release|Any CPU
    2136                {9B390DE8-884A-433D-828A-C7B969F19924}.Release|Any CPU.Build.0 = Release|Any CPU
     37                {9B390DE8-884A-433D-828A-C7B969F19924}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
     38                {9B390DE8-884A-433D-828A-C7B969F19924}.Release|Mixed Platforms.Build.0 = Release|Any CPU
     39                {9B390DE8-884A-433D-828A-C7B969F19924}.Release|x86.ActiveCfg = Release|Any CPU
     40                {59F7FCF2-858A-406D-92A6-50514BD89B43}.Debug|Any CPU.ActiveCfg = Debug|x86
     41                {59F7FCF2-858A-406D-92A6-50514BD89B43}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
     42                {59F7FCF2-858A-406D-92A6-50514BD89B43}.Debug|Mixed Platforms.Build.0 = Debug|x86
     43                {59F7FCF2-858A-406D-92A6-50514BD89B43}.Debug|x86.ActiveCfg = Debug|x86
     44                {59F7FCF2-858A-406D-92A6-50514BD89B43}.Debug|x86.Build.0 = Debug|x86
     45                {59F7FCF2-858A-406D-92A6-50514BD89B43}.Release|Any CPU.ActiveCfg = Release|x86
     46                {59F7FCF2-858A-406D-92A6-50514BD89B43}.Release|Mixed Platforms.ActiveCfg = Release|x86
     47                {59F7FCF2-858A-406D-92A6-50514BD89B43}.Release|Mixed Platforms.Build.0 = Release|x86
     48                {59F7FCF2-858A-406D-92A6-50514BD89B43}.Release|x86.ActiveCfg = Release|x86
     49                {59F7FCF2-858A-406D-92A6-50514BD89B43}.Release|x86.Build.0 = Release|x86
    2250        EndGlobalSection
    2351        GlobalSection(SolutionProperties) = preSolution
  • extensions/PiwigoLib/PiwigoLib/DTO/Helper/PwgEnumHelper.cs

    r3816 r7149  
    99namespace Com.Piwigo.Lib.DTO.Helper
    1010{
    11     public static class PwgEnumHelper<T>
     11    internal static class PwgEnumHelper<T>
    1212    {
    13         public static string stringValueOf(T value)
     13        internal static string stringValueOf(T value)
    1414        {
    1515            FieldInfo fi = value.GetType().GetField(value.ToString());
     
    2525        }
    2626
    27         public static T enumValueOf(string value)
     27        internal static T enumValueOf(string value)
    2828        {
    2929            Type enumType = typeof(T);
  • extensions/PiwigoLib/PiwigoLib/PiwigoLib.csproj

    r6811 r7149  
    7373    <Compile Include="Proxy\PwgProxyException.cs" />
    7474    <Compile Include="Proxy\PwgSessionProxy.cs" />
     75    <Compile Include="IService\IPwgCategoriesService.cs" />
     76    <Compile Include="IService\IPwgImagesService.cs" />
     77    <Compile Include="IService\IPwgSessionService.cs" />
     78    <Compile Include="IService\IPwgSetupService.cs" />
     79    <Compile Include="IService\IPwgTagsService.cs" />
     80    <Compile Include="Service\PwgSetupService.cs" />
     81    <Compile Include="IService\PwgServiceProvider.cs" />
    7582    <Compile Include="Service\PwgCategoriesService.cs" />
    7683    <Compile Include="Service\PwgImagesService.cs" />
    7784    <Compile Include="Service\PwgTagsService.cs" />
    78     <Compile Include="Service\PwgServiceException.cs" />
     85    <Compile Include="DTO\PwgServiceException.cs" />
    7986    <Compile Include="Service\PwgSessionService.cs" />
    8087  </ItemGroup>
  • extensions/PiwigoLib/PiwigoLib/Proxy/Helper/PwgProxyReponseHelper.cs

    r3834 r7149  
    77namespace Com.Piwigo.Lib.Proxy.Helper
    88{
    9     public static class PwgProxyReponseHelper
     9    internal static class PwgProxyReponseHelper
    1010    {
    11         public static void buildQueryFromArray<T>(List<T> values, String paramName, ref Boolean firstOcc, StringBuilder queryStringBuilder)
     11        internal static void buildQueryFromArray<T>(List<T> values, String paramName, ref Boolean firstOcc, StringBuilder queryStringBuilder)
    1212        {
    1313            String FormatString = String.Empty;
     
    3636        }
    3737
    38         public static void buildQueryFromValue<T>(Nullable<T> nullableValue, String paramName, ref Boolean firstOcc, StringBuilder queryStringBuilder)
     38        internal static void buildQueryFromValue<T>(Nullable<T> nullableValue, String paramName, ref Boolean firstOcc, StringBuilder queryStringBuilder)
    3939            where T: struct
    4040        {
     
    4545        }
    4646
    47         public static void buildQueryFromValue<T>(T value, String paramName, ref Boolean firstOcc, StringBuilder queryStringBuilder)
     47        internal static void buildQueryFromValue<T>(T value, String paramName, ref Boolean firstOcc, StringBuilder queryStringBuilder)
    4848        {
    4949            String FormatString = String.Empty;
  • extensions/PiwigoLib/PiwigoLib/Proxy/PwgCategoriesProxy.cs

    r3835 r7149  
    1010namespace Com.Piwigo.Lib.Proxy
    1111{
    12     static class PwgCategoriesProxy
     12    static internal class PwgCategoriesProxy
    1313    {
    1414        /// <summary>
     
    1919        /// <param name="PublicOnly"></param>
    2020        /// <returns></returns>
    21         static public PwgCategoriesProxyResponse pwg_categories_getList(Int32? CategoryId,
     21        static internal PwgCategoriesProxyResponse pwg_categories_getList(Int32? CategoryId,
    2222            Boolean? Recursive, Boolean? PublicOnly)
    2323        {
     
    3333
    3434                response = PwgGenericProxy<PwgCategoriesProxyResponse>.Get(
    35                                 PwgConfigProxy.PwgServeurUriBuilder.Uri,
     35                                PwgConfigProxy.PwgServeurUri,
    3636                                "pwg.categories.getList", data.ToString());
    3737            }
     
    4848        /// </summary>
    4949        /// <returns></returns>
    50         static public PwgCategoriesProxyResponse pwg_categories_getAdminList()
     50        static internal PwgCategoriesProxyResponse pwg_categories_getAdminList()
    5151        {
    5252            PwgCategoriesProxyResponse response = null;
     
    5454            {
    5555                response = PwgGenericProxy<PwgCategoriesProxyResponse>.Get(
    56                                 PwgConfigProxy.PwgServeurUriBuilder.Uri,
     56                                PwgConfigProxy.PwgServeurUri,
    5757                                "pwg.categories.getAdminList", null);
    5858            }
     
    7171        /// <param name="IdUpperCat"></param>
    7272        /// <returns></returns>
    73         static public PwgAddRequestProxyResponse pwg_categories_add(String categorieName, Int32? IdUpperCat)
     73        static internal PwgAddRequestProxyResponse pwg_categories_add(String categorieName, Int32? IdUpperCat)
    7474        {
    7575            PwgAddRequestProxyResponse response = null;
     
    8383
    8484                response = PwgGenericProxy<PwgAddRequestProxyResponse>.Post(
    85                     PwgConfigProxy.PwgServeurUriBuilder.Uri,
     85                    PwgConfigProxy.PwgServeurUri,
    8686                    data.ToString());
    8787            }
     
    101101        /// <param name="categorieComment"></param>
    102102        /// <returns></returns>
    103         static public PwgBaseProxyReponse pwg_categories_setInfo(Int32 IdCat, String categorieName, String categorieComment)
     103        static internal PwgBaseProxyReponse pwg_categories_setInfo(Int32 IdCat, String categorieName, String categorieComment)
    104104        {
    105105            PwgBaseProxyReponse response = null;
     
    114114
    115115                response = PwgGenericProxy<PwgAddRequestProxyResponse>.Post(
    116                     PwgConfigProxy.PwgServeurUriBuilder.Uri,
     116                    PwgConfigProxy.PwgServeurUri,
    117117                    data.ToString());
    118118            }
     
    145145        /// <param name="withThumbnail"></param>
    146146        /// <returns></returns>
    147         static public PwgImagesProxyResponse pwg_categories_getImages(Int32 catId,
     147        static internal PwgImagesProxyResponse pwg_categories_getImages(Int32 catId,
    148148                                                            Boolean? recursive,
    149149                                                            Int32? perPage,
     
    188188
    189189                response = PwgGenericProxy<PwgImagesProxyResponse>.Post(
    190                                 PwgConfigProxy.PwgServeurUriBuilder.Uri,
     190                                PwgConfigProxy.PwgServeurUri,
    191191                                data.ToString());
    192192            }
     
    204204        /// <param name="tagName"></param>
    205205        /// <returns></returns>
    206         static public PwgAddRequestProxyResponse pwg_tag_add(string tagName)
     206        static internal PwgAddRequestProxyResponse pwg_tag_add(string tagName)
    207207        {
    208208            PwgAddRequestProxyResponse response = null;
     
    214214
    215215                response = PwgGenericProxy<PwgAddRequestProxyResponse>.Post(
    216                     PwgConfigProxy.PwgServeurUriBuilder.Uri,
     216                    PwgConfigProxy.PwgServeurUri,
    217217                    data.ToString());
    218218            }
  • extensions/PiwigoLib/PiwigoLib/Proxy/PwgConfigProxy.cs

    r3816 r7149  
    77namespace Com.Piwigo.Lib.Proxy
    88{
    9     public static class PwgConfigProxy
     9    internal static class PwgConfigProxy
    1010    {
    11         public static String PwgUserAgent = "PiwigoLib.GenericProxy";
    12         public static Boolean PwgKeepAlive = false;
    13         public static Int16 PwgTimeOutInSecond = 15;
     11        internal static String PwgUserAgent = "PiwigoLib.GenericProxy";
     12        internal static Boolean PwgKeepAlive = false;
     13        internal static Int16 PwgTimeOutInSecond = 15;
    1414
    15         public static UriBuilder PwgServeurUriBuilder = new UriBuilder(); // store uri piece of the server
     15        internal static Uri PwgServeurUri = null; // store uri piece of the server
    1616
    17         public static CookieContainer cookieContainer = new CookieContainer(); // store cookie as session once
     17        internal static CookieContainer cookieContainer = new CookieContainer(); // store cookie as session once
    1818
    1919    }
  • extensions/PiwigoLib/PiwigoLib/Proxy/PwgGenericProxy.cs

    r3861 r7149  
    1212{
    1313
    14     static public class PwgGenericProxy<T>
     14    static internal class PwgGenericProxy<T>
    1515    {
    16        
    17         public static T Get(Uri address, String methodName, String methodParameter)
     16
     17        internal static T Get(Uri address, String methodName, String methodParameter)
    1818        {
    1919            T ReturnValue = default(T);
     
    7777        }
    7878
    79         public static T Post(Uri address, String data)
     79        internal static T Post(Uri address, String data)
    8080        {
    8181            T ReturnValue = default(T);
     
    144144        }
    145145
    146         public static T DeserializeObject(StreamReader xmlData)
     146        internal static T DeserializeObject(StreamReader xmlData)
    147147        {
    148148            T ReturnValue = default(T);
     
    167167        }
    168168
    169         public static void SerializeToXML(String fileName,T obj  )
     169        internal static void SerializeToXML(String fileName, T obj)
    170170        {
    171171            try
  • extensions/PiwigoLib/PiwigoLib/Proxy/PwgImagesProxy.cs

    r3861 r7149  
    1010namespace Com.Piwigo.Lib.Proxy
    1111{
    12     static class PwgImagesProxy
     12    static internal class PwgImagesProxy
    1313    {
    1414        /// <summary>
     
    1818        /// <param name="imageRate"></param>
    1919        /// <returns></returns>
    20         static public PwgImageRateProxyResponse pwg_images_rate(Int32 imageId, Int32 imageRate)
     20        static internal PwgImageRateProxyResponse pwg_images_rate(Int32 imageId, Int32 imageRate)
    2121        {
    2222            PwgImageRateProxyResponse response = null;
     
    3030
    3131                response = PwgGenericProxy<PwgImageRateProxyResponse>.Post(
    32                     PwgConfigProxy.PwgServeurUriBuilder.Uri,
     32                    PwgConfigProxy.PwgServeurUri,
    3333                    data.ToString());
    3434            }
  • extensions/PiwigoLib/PiwigoLib/Proxy/PwgProxyException.cs

    r3816 r7149  
    66namespace Com.Piwigo.Lib.Proxy
    77{
    8     public sealed class PwgProxyException : ApplicationException
     8    internal sealed class PwgProxyException : ApplicationException
    99    {
    1010        private static String Defaut_Message = "A PwgProxyException occurs...";
    11         public PwgProxyException()
     11        internal PwgProxyException()
    1212            : base(Defaut_Message)
    1313        {
    1414        }
    1515
    16         public PwgProxyException(String message)
     16        internal PwgProxyException(String message)
    1717            : base(Defaut_Message + " " + message)
    1818        {
    1919        }
    2020
    21         public PwgProxyException(String message, Exception innerEx)
     21        internal PwgProxyException(String message, Exception innerEx)
    2222            : base(Defaut_Message + " " + message, innerEx)
    2323        {
  • extensions/PiwigoLib/PiwigoLib/Proxy/PwgSessionProxy.cs

    r3816 r7149  
    99namespace Com.Piwigo.Lib.Proxy
    1010{
    11     static class PwgSessionProxy
     11    static internal class PwgSessionProxy
    1212    {
    13         static public PwgSessionProxyResponse pwg_session_getStatus()
     13        static internal PwgSessionProxyResponse pwg_session_getStatus()
    1414        {
    1515            PwgSessionProxyResponse response = null;
     
    1717            {           
    1818            response = PwgGenericProxy<PwgSessionProxyResponse>.Get(
    19                                 PwgConfigProxy.PwgServeurUriBuilder.Uri,
     19                                PwgConfigProxy.PwgServeurUri,
    2020                                "pwg.session.getStatus", null);
    2121            }
     
    2828        }
    2929
    30         static public PwgSessionProxyResponse pwg_session_login(string UserName, string Password)
     30        static internal PwgSessionProxyResponse pwg_session_login(string UserName, string Password)
    3131        {
    3232            PwgSessionProxyResponse response = null;
     
    4040
    4141                response = PwgGenericProxy<PwgSessionProxyResponse>.Post(
    42                     PwgConfigProxy.PwgServeurUriBuilder.Uri,
     42                    PwgConfigProxy.PwgServeurUri,
    4343                    data.ToString());
    4444            }
     
    5151        }
    5252
    53         static public PwgSessionProxyResponse pwg_session_logout()
     53        static internal PwgSessionProxyResponse pwg_session_logout()
    5454        {
    5555            PwgSessionProxyResponse response = null;
     
    6060
    6161                response = PwgGenericProxy<PwgSessionProxyResponse>.Post(
    62                     PwgConfigProxy.PwgServeurUriBuilder.Uri,
     62                    PwgConfigProxy.PwgServeurUri,
    6363                    data.ToString());
    6464            }
  • extensions/PiwigoLib/PiwigoLib/Proxy/PwgTagsProxy.cs

    r3834 r7149  
    1010namespace Com.Piwigo.Lib.Proxy
    1111{
    12     static class PwgTagsProxy
     12    static internal class PwgTagsProxy
    1313    {
    14         static public PwgTagsProxyResponse pwg_tags_getList(Boolean? sortedByCounter)
     14        static internal PwgTagsProxyResponse pwg_tags_getList(Boolean? sortedByCounter)
    1515        {
    1616            PwgTagsProxyResponse response = null;
     
    2323
    2424                response = PwgGenericProxy<PwgTagsProxyResponse>.Get(
    25                                 PwgConfigProxy.PwgServeurUriBuilder.Uri,
     25                                PwgConfigProxy.PwgServeurUri,
    2626                                "pwg.tags.getList", data.ToString());
    2727            }
     
    3434        }
    3535
    36         static public PwgTagsProxyResponse pwg_tags_getAdminList()
     36        static internal PwgTagsProxyResponse pwg_tags_getAdminList()
    3737        {
    3838            PwgTagsProxyResponse response = null;
     
    4040            {
    4141                response = PwgGenericProxy<PwgTagsProxyResponse>.Get(
    42                                 PwgConfigProxy.PwgServeurUriBuilder.Uri,
     42                                PwgConfigProxy.PwgServeurUri,
    4343                                "pwg.tags.getAdminList", null);
    4444            }
     
    5151        }
    5252
    53         static public PwgImagesProxyResponse pwg_tags_getImages(List<Int32> tagsId,             
     53        static internal PwgImagesProxyResponse pwg_tags_getImages(List<Int32> tagsId,           
    5454                                                                    List<String>    tagsUrlName,
    5555                                                                    List<String>    tagsName,
     
    9898
    9999                response = PwgGenericProxy<PwgImagesProxyResponse>.Post(
    100                                 PwgConfigProxy.PwgServeurUriBuilder.Uri,
     100                                PwgConfigProxy.PwgServeurUri,
    101101                                data.ToString());
    102102            }
     
    108108
    109109        }
    110         static public PwgAddRequestProxyResponse pwg_tag_add(string tagName)
     110        static internal PwgAddRequestProxyResponse pwg_tag_add(string tagName)
    111111        {
    112112            PwgAddRequestProxyResponse response = null;
     
    118118
    119119                response = PwgGenericProxy<PwgAddRequestProxyResponse>.Post(
    120                     PwgConfigProxy.PwgServeurUriBuilder.Uri,
     120                    PwgConfigProxy.PwgServeurUri,
    121121                    data.ToString());
    122122            }
  • extensions/PiwigoLib/PiwigoLib/Proxy/Response/PwgAddRequestProxyResponse.cs

    r3834 r7149  
    1010    [Serializable()]
    1111    [XmlRoot(ElementName = "rsp")]
    12     public class PwgAddRequestProxyResponse : PwgBaseProxyReponse
     12    internal class PwgAddRequestProxyResponse : PwgBaseProxyReponse
    1313    {
    1414        [XmlElement(ElementName="info")]
    15         public String Message { get; set; }
     15        internal String Message { get; set; }
    1616        [XmlElement(ElementName = "id")]
    17         public Int32 NewId { get; set; }
     17        internal Int32 NewId { get; set; }
    1818
    1919    }
  • extensions/PiwigoLib/PiwigoLib/Proxy/Response/PwgBaseProxyReponse.cs

    r3818 r7149  
    1010    [Serializable()]
    1111    [XmlRoot(ElementName = "err")]
    12     public class PwgBaseProxyReponseError
     12    internal class PwgBaseProxyReponseError
    1313    {
    1414        [XmlAttribute(AttributeName = "code")]
    15         public Int32 Code { get; set; }
     15        internal Int32 Code { get; set; }
    1616
    1717        [XmlAttribute(AttributeName = "msg")]
    18         public String Message { get; set; }
     18        internal String Message { get; set; }
    1919    }
    2020
     
    2222    [Serializable()]
    2323    [XmlRoot(ElementName = "rsp")]
    24     public abstract class PwgBaseProxyReponse
     24    internal abstract class PwgBaseProxyReponse
    2525    {
    2626        [XmlAttribute(AttributeName="stat")]
    27         public PwgBaseProxyReponseRetourEnum Retour { get; set; }
     27        internal PwgBaseProxyReponseRetourEnum Retour { get; set; }
    2828
    2929        [XmlElement(ElementName="err")]
    30         public PwgBaseProxyReponseError Erreur { get; set; }
     30        internal PwgBaseProxyReponseError Erreur { get; set; }
    3131
    3232    }
  • extensions/PiwigoLib/PiwigoLib/Proxy/Response/PwgBaseProxyReponseRetourEnum.cs

    r3816 r7149  
    99    [Serializable()]
    1010    [XmlRoot(ElementName = "PwgBaseProxyReponseRetourEnum")]
    11     public enum PwgBaseProxyReponseRetourEnum : int
     11    internal enum PwgBaseProxyReponseRetourEnum : int
    1212    {
    1313        [XmlEnum("unknow")]
  • extensions/PiwigoLib/PiwigoLib/Proxy/Response/PwgCategoriesProxyResponse.cs

    r3834 r7149  
    1010    [Serializable()]
    1111    [XmlRoot(ElementName = "category")]
    12     public class PwgCategoryProxyResponse
     12    internal class PwgCategoryProxyResponse
    1313    {
    1414        [XmlAttribute(AttributeName = "id")]
    15         public Int32 Id { get; set; }
     15        internal Int32 Id { get; set; }
    1616        [XmlElement(ElementName = "uppercats")]
    17         public String UpperCategoryId { get; set; }
     17        internal String UpperCategoryId { get; set; }
    1818        [XmlElement (ElementName = "name")]
    19         public String Name { get; set; }
     19        internal String Name { get; set; }
    2020        [XmlAttribute(AttributeName = "url")]
    21         public String Url { get; set; }
     21        internal String Url { get; set; }
    2222        [XmlAttribute(AttributeName = "nb_images")]
    23         public Int64 ImagesCount { get; set; }
     23        internal Int64 ImagesCount { get; set; }
    2424        [XmlAttribute(AttributeName = "total_nb_images")]
    25         public Int64 DeepImagesCount { get; set; }
     25        internal Int64 DeepImagesCount { get; set; }
    2626        [XmlAttribute(AttributeName = "nb_categories")]
    27         public Int64 SubCategoriesCount { get; set; }
     27        internal Int64 SubCategoriesCount { get; set; }
    2828        [XmlAttribute(AttributeName = "max_date_last")]
    29         public String LastDate { get; set; }
     29        internal String LastDate { get; set; }
    3030    }
    3131
    3232    [Serializable()]
    3333    [XmlRoot(ElementName = "rsp")]
    34     public class PwgCategoriesProxyResponse : PwgBaseProxyReponse
     34    internal class PwgCategoriesProxyResponse : PwgBaseProxyReponse
    3535    {
    3636        [XmlArray("categories")]
    3737        [XmlArrayItem("category")]
    38         public PwgCategoryProxyResponse[] Categories { get; set; }
     38        internal PwgCategoryProxyResponse[] Categories { get; set; }
    3939    }
    4040}
  • extensions/PiwigoLib/PiwigoLib/Proxy/Response/PwgImagesProxyResponse.cs

    r3861 r7149  
    1111    [Serializable()]
    1212    [XmlRoot(ElementName = "rsp")]
    13     public class PwgImageRateProxyResponse : PwgBaseProxyReponse
     13    internal class PwgImageRateProxyResponse : PwgBaseProxyReponse
    1414    {
    1515        [XmlElement("count")]
    16         public Int32 Count { get; set; }
     16        internal Int32 Count { get; set; }
    1717        [XmlElement("average")]
    18         public String Average { get; set; }
     18        internal String Average { get; set; }
    1919        [XmlElement("stdev")]
    20         public String Stdev { get; set; }
     20        internal String Stdev { get; set; }
    2121    }
    2222
    2323    [Serializable()]
    2424    [XmlRoot(ElementName = "categorie")]
    25     public class PwgImageProxyResponse
     25    internal class PwgImageProxyResponse
    2626    {
    2727        [XmlAttribute(AttributeName = "id")]
    28         public Int32 Id { get; set; }
     28        internal Int32 Id { get; set; }
    2929        [XmlAttribute(AttributeName = "width")]
    30         public Int32 Width { get; set; }
     30        internal Int32 Width { get; set; }
    3131        [XmlAttribute(AttributeName = "height")]
    32         public Int32 Height { get; set; }
     32        internal Int32 Height { get; set; }
    3333        [XmlAttribute(AttributeName = "file")]
    34         public String File { get; set; }
     34        internal String File { get; set; }
    3535        [XmlAttribute(AttributeName = "tn_url")]
    36         public String UrlThunb { get; set; }
     36        internal String UrlThunb { get; set; }
    3737        [XmlAttribute(AttributeName = "element_url")]
    38         public String UrlElement { get; set; }
     38        internal String UrlElement { get; set; }
    3939        [XmlAttribute(AttributeName = "high_url")]
    40         public String UrlHighDef { get; set; }
     40        internal String UrlHighDef { get; set; }
    4141        [XmlAttribute(AttributeName = "hit")]
    42         public Int64 Counter { get; set; }
     42        internal Int64 Counter { get; set; }
    4343
    4444        [XmlArray("tags")]
    4545        [XmlArrayItem("tag")]
    46         public PwgTagProxyResponse[] Tags { get; set; }
     46        internal PwgTagProxyResponse[] Tags { get; set; }
    4747
    4848        [XmlArray("categories")]
    4949        [XmlArrayItem("category")]
    50         public PwgCategoryProxyResponse[] Categories { get; set; }
     50        internal PwgCategoryProxyResponse[] Categories { get; set; }
    5151
    5252    }
     
    5454    [Serializable()]
    5555    [XmlRoot(ElementName = "images")]
    56     public class PwgImageListProxyResponse
     56    internal class PwgImageListProxyResponse
    5757    {
    5858        [XmlAttribute("page")]
    59         public Int32 Page;
     59        internal Int32 Page { get; set; }
    6060        [XmlAttribute("per_page")]
    61         public Int32 PerPage;
     61        internal Int32 PerPage { get; set; }
    6262        [XmlAttribute("count")]
    63         public Int32 Count;
     63        internal Int32 Count { get; set; }
    6464
    6565        [XmlElement("image", typeof(PwgImageProxyResponse))]
    66         public PwgImageProxyResponse[] Images { get; set; }
     66        internal PwgImageProxyResponse[] Images { get; set; }
    6767
    6868
     
    7171    [Serializable()]
    7272    [XmlRoot(ElementName = "rsp")]
    73     public class PwgImagesProxyResponse : PwgBaseProxyReponse
     73    internal class PwgImagesProxyResponse : PwgBaseProxyReponse
    7474    {
    7575        [XmlElement("images")]
    76         public PwgImageListProxyResponse ImageList { get; set; }
     76        internal PwgImageListProxyResponse ImageList { get; set; }
    7777    }
    7878
  • extensions/PiwigoLib/PiwigoLib/Proxy/Response/PwgSessionProxyResponse.cs

    r3818 r7149  
    1111    [XmlRoot(ElementName = "rsp")]
    1212
    13     public class PwgSessionProxyResponse : PwgBaseProxyReponse
     13    internal class PwgSessionProxyResponse : PwgBaseProxyReponse
    1414    {
    1515        [XmlElement(ElementName = "username")]
    16         public String UserName { get; set; }
     16        internal String UserName { get; set; }
    1717        [XmlElement(ElementName = "status")]
    18         public string Status { get; set; }
     18        internal string Status { get; set; }
    1919        [XmlElement(ElementName = "template")]
    20         public String Template { get; set; }
     20        internal String Template { get; set; }
    2121        [XmlElement(ElementName = "theme")]
    22         public String Theme { get; set; }
     22        internal String Theme { get; set; }
    2323        [XmlElement(ElementName = "language")]
    24         public String Language { get; set; }
     24        internal String Language { get; set; }
    2525        [XmlElement(ElementName = "charset")]
    26         public String CharSet { get; set; }   
     26        internal String CharSet { get; set; }   
    2727    }
    2828}
  • extensions/PiwigoLib/PiwigoLib/Proxy/Response/PwgTagsProxyResponse.cs

    r3827 r7149  
    1010    [Serializable()]
    1111    [XmlRoot(ElementName = "tag")]
    12     public class PwgTagProxyResponse
     12    internal class PwgTagProxyResponse
    1313    {
    1414        [XmlAttribute(AttributeName = "id")]
    15         public Int32 Id { get; set; }
     15        internal Int32 Id { get; set; }
    1616        [XmlAttribute(AttributeName = "name")]
    17         public String Name { get; set; }
     17        internal String Name { get; set; }
    1818        [XmlAttribute(AttributeName = "url_name")]
    19         public String UrlName { get; set; }
     19        internal String UrlName { get; set; }
    2020        [XmlAttribute(AttributeName = "counter")]
    21         public Int64 Counter { get; set; }
     21        internal Int64 Counter { get; set; }
    2222        [XmlAttribute(AttributeName = "url")]
    23         public String UrlTag { get; set; }
     23        internal String UrlTag { get; set; }
    2424    }
    2525
    2626    [Serializable()]
    2727    [XmlRoot(ElementName = "rsp")]
    28     public class PwgTagsProxyResponse : PwgBaseProxyReponse
     28    internal class PwgTagsProxyResponse : PwgBaseProxyReponse
    2929    {
    3030        //[XmlElement(ElementName = "tags")]
    3131        [XmlArray("tags")]
    3232        [XmlArrayItem("tag")]
    33         public PwgTagProxyResponse[] Tags { get; set; }
     33        internal PwgTagProxyResponse[] Tags { get; set; }
    3434    }
    3535}
  • extensions/PiwigoLib/PiwigoLib/Service/PwgCategoriesService.cs

    r3837 r7149  
    77using Com.Piwigo.Lib.Proxy.Response;
    88using Com.Piwigo.Lib.DTO.Helper;
     9using Com.Piwigo.Lib.IService;
    910
    1011namespace Com.Piwigo.Lib.Service
    1112{
    1213
    13     static public class PwgCategoriesService
     14    internal sealed class PwgCategoriesService : IPwgCategoriesService
    1415    {
    1516        /// <summary>
     
    1819        /// <param name="sortedByCounter"></param>
    1920        /// <returns></returns>
    20         static public List<PwgCategory> GetListOfCategory(Int32? CatgeroryId, Boolean? Recursive, Boolean? PublicOnly)
     21        public List<PwgCategory> GetListOfCategory(Int32? CatgeroryId, Boolean? Recursive, Boolean? PublicOnly)
    2122        {
    2223            List<PwgCategory> returnValue = new List<PwgCategory>();
     
    5556        /// </summary>
    5657        /// <returns></returns>
    57         static public List<PwgCategory> GetAdminListOfCategory()
     58        public List<PwgCategory> GetAdminListOfCategory()
    5859        {
    5960            List<PwgCategory> returnValue = new List<PwgCategory>();
     
    9697        /// <param name="messageInfo">Message returned by the server</param>
    9798        /// <returns>false, if a error occurs</returns>
    98         static public Boolean AddCategory(String categoryName, Int32? upperCatId, ref Int32 newId, ref String messageInfo)
     99        public Boolean AddCategory(String categoryName, Int32? upperCatId, ref Int32 newId, ref String messageInfo)
    99100        {
    100101            Boolean returnValue = false;
     
    139140        /// <param name="categoryComment"></param>
    140141        /// <returns></returns>
    141         static public Boolean UpdateCategoryInfo(Int32 IdCat, String categoryName, String categoryComment)
     142        public Boolean UpdateCategoryInfo(Int32 IdCat, String categoryName, String categoryComment)
    142143        {
    143144            Boolean returnValue = false;
     
    195196        /// <param name="CountReturned"></param>
    196197        /// <returns></returns>
    197         static public List<PwgImage> GetListOfImagesFormCategory(Int32 categoryId,
     198        public List<PwgImage> GetListOfImagesFormCategory(Int32 categoryId,
    198199                                                    Boolean? recursive,
    199200                                                    Int32? perPage,
     
    269270        /// <param name="response"></param>
    270271        /// <param name="session"></param>
    271         static public List<PwgCategory> ConvertProxyResponseToDTO(PwgCategoriesProxyResponse response)
     272        internal static List<PwgCategory> ConvertProxyResponseToDTO(PwgCategoriesProxyResponse response)
    272273        {
    273274            List<PwgCategory> returnValue = new List<PwgCategory>();
     
    287288        /// <param name="response"></param>
    288289        /// <param name="session"></param>
    289         static public PwgCategory ConvertProxyResponseToDTO(PwgCategoryProxyResponse response)
     290        internal static PwgCategory ConvertProxyResponseToDTO(PwgCategoryProxyResponse response)
    290291        {
    291292            PwgCategory returnValue = new PwgCategory();
  • extensions/PiwigoLib/PiwigoLib/Service/PwgImagesService.cs

    r3861 r7149  
    88using Com.Piwigo.Lib.Proxy.Response;
    99using Com.Piwigo.Lib.DTO.Helper;
     10using Com.Piwigo.Lib.IService;
    1011
    1112namespace Com.Piwigo.Lib.Service
    1213{
    1314
    14     static public class PwgImagesService
     15    internal sealed class PwgImagesService : IPwgImagesService
    1516    {
    16         static public PwgImageRate RateImage(Int32 imageId, Int32 imageRate)
     17        public PwgImageRate RateImage(Int32 imageId, Int32 imageRate)
    1718        {
    1819            PwgImageRate returnValue = new PwgImageRate();
     
    5253        /// <param name="response"></param>
    5354        /// <param name="session"></param>
    54         static public PwgImageRate ConvertProxyResponseToDTO(PwgImageRateProxyResponse response)
     55        internal static PwgImageRate ConvertProxyResponseToDTO(PwgImageRateProxyResponse response)
    5556        {
    5657            PwgImageRate returnValue = new PwgImageRate();
     
    8283        /// <param name="response"></param>
    8384        /// <param name="session"></param>
    84         static public void ConvertProxyResponseToDTO(PwgImagesProxyResponse response,
     85        internal static void ConvertProxyResponseToDTO(PwgImagesProxyResponse response,
    8586                                                      List<PwgImage> lstImage,
    8687                                                      ref Int32 Page, ref Int32 PerPagee, ref Int32 Count)
     
    9495        /// <param name="response"></param>
    9596        /// <param name="session"></param>
    96         static public void ConvertProxyResponseToDTO(PwgImageListProxyResponse response,
     97        internal static void ConvertProxyResponseToDTO(PwgImageListProxyResponse response,
    9798                                                      List<PwgImage> lstImage,
    9899                                                      ref Int32 Page, ref Int32 PerPagee, ref Int32 Count)
     
    116117        /// <param name="response"></param>
    117118        /// <param name="session"></param>
    118         static public PwgImage ConvertProxyResponseToDTO(PwgImageProxyResponse response)
     119        internal static PwgImage ConvertProxyResponseToDTO(PwgImageProxyResponse response)
    119120        {
    120121            PwgImage returnValue = new PwgImage();
  • extensions/PiwigoLib/PiwigoLib/Service/PwgSessionService.cs

    r3816 r7149  
    77using Com.Piwigo.Lib.Proxy.Response;
    88using Com.Piwigo.Lib.DTO.Helper;
     9using Com.Piwigo.Lib.IService;
    910
    1011namespace Com.Piwigo.Lib.Service
    1112{
    12  
    13     static public class PwgSessionService
     13
     14    internal sealed class PwgSessionService : IPwgSessionService
    1415    {
    15         static private PwgSession PwgSession = null;
     16        private PwgSession PwgSession = null;
    1617
    1718        /// <summary>
     
    1920        /// </summary>
    2021        /// <returns></returns>
    21         static public PwgSession GetPwgSession()
     22        public PwgSession GetPwgSession()
    2223        {
    2324            if (PwgSession == null)
     
    5960        /// <param name="Password"></param>
    6061        /// <returns></returns>
    61         static public PwgSession Login(String UserName, String Password)
     62        public PwgSession Login(String UserName, String Password)
    6263        {
    6364            PwgSession = null;
     
    8889        }
    8990
    90         static public PwgSession Logout()
     91        public PwgSession Logout()
    9192        {
    9293            PwgSession = null;
     
    121122        /// <param name="response"></param>
    122123        /// <param name="session"></param>
    123         static private void ConvertProxyResponseToDTO(PwgSessionProxyResponse response, ref PwgSession session)
     124        internal static void ConvertProxyResponseToDTO(PwgSessionProxyResponse response, ref PwgSession session)
    124125        {
    125126            if (session == null)
  • extensions/PiwigoLib/PiwigoLib/Service/PwgTagsService.cs

    r3834 r7149  
    77using Com.Piwigo.Lib.Proxy.Response;
    88using Com.Piwigo.Lib.DTO.Helper;
     9using Com.Piwigo.Lib.IService;
    910
    1011namespace Com.Piwigo.Lib.Service
    1112{
    1213
    13     static public class PwgTagsService
     14    internal sealed class PwgTagsService : IPwgTagsService
    1415    {
    1516        /// <summary>
     
    1819        /// <param name="sortedByCounter"></param>
    1920        /// <returns></returns>
    20         static public List<PwgTag> GetListOfTag(Boolean? sortedByCounter)
     21        public List<PwgTag> GetListOfTag(Boolean? sortedByCounter)
    2122        {
    2223            List<PwgTag> returnValue = new List<PwgTag>();
     
    5657        /// <param name="sortedByCounter"></param>
    5758        /// <returns></returns>
    58         static public List<PwgTag> GetAdminListOfTag()
     59        public List<PwgTag> GetAdminListOfTag()
    5960        {
    6061            List<PwgTag> returnValue = new List<PwgTag>();
     
    9495        /// <param name="tagName"></param>
    9596        /// <returns></returns>
    96         static public Boolean AddTag(String tagName, ref Int32 newId, ref String messageInfo)
     97        public Boolean AddTag(String tagName, ref Int32 newId, ref String messageInfo)
    9798        {
    9899            Boolean returnValue = false;
     
    154155        /// <param name="CountReturned"></param>
    155156        /// <returns></returns>
    156         static public List<PwgImage> GetListOfImagesFormTags(List<Int32> tagsId,
     157        public List<PwgImage> GetListOfImagesFormTags(List<Int32> tagsId,
    157158                                                            List<String> tagsUrlName,
    158159                                                            List<String> tagsName,
     
    233234        /// <param name="response"></param>
    234235        /// <param name="session"></param>
    235         static public List<PwgTag> ConvertProxyResponseToDTO(PwgTagsProxyResponse response)
     236        internal static List<PwgTag> ConvertProxyResponseToDTO(PwgTagsProxyResponse response)
    236237        {
    237238            List<PwgTag> returnValue = new List<PwgTag>();
     
    251252        /// <param name="response"></param>
    252253        /// <param name="session"></param>
    253         static public PwgTag ConvertProxyResponseToDTO(PwgTagProxyResponse response)
     254        internal static PwgTag ConvertProxyResponseToDTO(PwgTagProxyResponse response)
    254255        {
    255256            PwgTag returnValue = new PwgTag();
  • extensions/PiwigoLib/TestPiwigoLib/Form1.cs

    r3861 r7149  
    11using System;
    2 using System.Collections.Generic;
    3 using System.ComponentModel;
    4 using System.Data;
    5 using System.Drawing;
    6 using System.Linq;
    7 using System.Text;
    82using System.Windows.Forms;
    93
    10 using Com.Piwigo.Lib.Proxy;
    11 using Com.Piwigo.Lib.Service;
     4using Com.Piwigo.Lib.IService;
    125using Com.Piwigo.Lib.DTO;
    13 using Com.Piwigo.Lib.Proxy.Response;
    146
    157
     
    2921        private void button1_Click(object sender, EventArgs e)
    3022        {
    31             PwgConfigProxy.PwgUserAgent = "TestPiwigoLib";
    32             PwgConfigProxy.PwgServeurUriBuilder.Host = tbServer.Text;
    33             PwgConfigProxy.PwgServeurUriBuilder.Path = "phpwebgallery/ws.php";
    34             PwgConfigProxy.PwgServeurUriBuilder.Scheme = "http://";
     23            UriBuilder urib = new UriBuilder();
     24            urib.Host = tbServer.Text;
     25            urib.Path = "phpwebgallery/ws.php";
     26            urib.Scheme = "http://";
    3527
    36             Console.WriteLine(PwgConfigProxy.PwgServeurUriBuilder.Uri.AbsoluteUri);
     28            PwgServiceProvider.Instance.PwgSetupService.Setup("TestPiwigoLib", null, urib.Uri);
     29
     30
     31            Console.WriteLine(urib.Uri.AbsoluteUri);
    3732
    3833            try
    3934            {
    4035                PwgSession sess = null;
    41                 sess = PwgSessionService.GetPwgSession();
     36                sess = PwgServiceProvider.Instance.PwgSessionService.GetPwgSession();
    4237                Console.WriteLine("user : " + sess.UserName + " " + sess.Status);
    4338
    44                 sess = PwgSessionService.Login(tbUser.Text,tbPassword.Text);
     39                sess = PwgServiceProvider.Instance.PwgSessionService.Login(tbUser.Text, tbPassword.Text);
    4540                Console.WriteLine("user : " + sess.UserName + " " + sess.Status);
    4641
    47                 //Boolean rc = PwgTagsService.AddTag("Loic");
     42                //Boolean rc = PwgServiceProvider.Instance.PwgTagsService.AddTag("Loic");
    4843
    49                 //List<PwgTag> lstTag = PwgTagsService.GetAdminListOfTag();
     44                //List<PwgTag> lstTag = PwgServiceProvider.Instance.PwgTagsService.GetAdminListOfTag();
    5045
    5146                //Int32 Page = 0;
     
    5348                //Int32 Count = 0;
    5449
    55                 //List<PwgImage> lstImg = PwgTagsService.GetListOfImagesFormTags(new List<Int32>() { 1, 7 },
     50                //List<PwgImage> lstImg = PwgServiceProvider.Instance.PwgTagsService.GetListOfImagesFormTags(new List<Int32>() { 1, 7 },
    5651                //    null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null,
    5752                //    ref Page, ref PerPage, ref Count);
    5853
    59                 //List<PwgImage> lstImg = PwgCategoriesService.GetListOfImagesFormCategory(1,
     54                //List<PwgImage> lstImg = PwgServiceProvider.Instance.PwgCategoriesService.GetListOfImagesFormCategory(1,
    6055                //    null, null, null, null, null, null, null, null, null, null, null, null, null, null, null,
    6156                //    ref Page, ref PerPage, ref Count);
     
    6358                //Console.WriteLine("lstImg : Page " + Page.ToString() + " PerPage " + PerPage);
    6459
    65                 //List<PwgCategory> lstCat = PwgCategoriesService.GetAdminListOfCategory();
     60                //List<PwgCategory> lstCat = PwgServiceProvider.Instance.PwgCategoriesService.GetAdminListOfCategory();
    6661
    6762                //Int32 newid = 0;
    6863                //String msg = String.Empty;
    69                 //Boolean rc = PwgCategoriesService.AddCategory("test_cat", 1, ref  newid, ref msg);
     64                //Boolean rc = PwgServiceProvider.Instance.PwgCategoriesService.AddCategory("test_cat", 1, ref  newid, ref msg);
    7065                //Console.WriteLine(String.Format("newid : {0} message : {1}", newid,msg));
    71                 //rc = PwgCategoriesService.UpdateCategoryInfo(newid, "test2", "rename cat");
     66                //rc = PwgServiceProvider.Instance.PwgCategoriesService.UpdateCategoryInfo(newid, "test2", "rename cat");
    7267
    73                 PwgImageRate imgRate = PwgImagesService.RateImage(1, 5);
     68                PwgImageRate imgRate = PwgServiceProvider.Instance.PwgImagesService.RateImage(1, 5);
    7469
    75                 sess = PwgSessionService.Logout();
     70                sess = PwgServiceProvider.Instance.PwgSessionService.Logout();
    7671                Console.WriteLine("user : " + sess.UserName + " " + sess.Status);
    7772            }
Note: See TracChangeset for help on using the changeset viewer.