Changeset 7149
- Timestamp:
- Oct 10, 2010, 10:45:43 PM (14 years ago)
- Location:
- extensions/PiwigoLib
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/PiwigoLib/Piwigo.sln
r6811 r7149 1 1 2 2 Microsoft Visual Studio Solution File, Format Version 11.00 3 # Visual C# Express20103 # Visual Studio 2010 4 4 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PiwigoLib", "PiwigoLib\PiwigoLib.csproj", "{64C068C5-DBFE-4712-9081-B9100698F35C}" 5 5 EndProject 6 6 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestPiwigoLib", "TestPiwigoLib\TestPiwigoLib.csproj", "{9B390DE8-884A-433D-828A-C7B969F19924}" 7 7 EndProject 8 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PiwigoWpf", "PiwigoWpf\PiwigoWpf.csproj", "{59F7FCF2-858A-406D-92A6-50514BD89B43}" 9 EndProject 8 10 Global 9 11 GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 12 Debug|Any CPU = Debug|Any CPU 13 Debug|Mixed Platforms = Debug|Mixed Platforms 14 Debug|x86 = Debug|x86 11 15 Release|Any CPU = Release|Any CPU 16 Release|Mixed Platforms = Release|Mixed Platforms 17 Release|x86 = Release|x86 12 18 EndGlobalSection 13 19 GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 20 {64C068C5-DBFE-4712-9081-B9100698F35C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 21 {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 16 25 {64C068C5-DBFE-4712-9081-B9100698F35C}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 26 {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 18 30 {9B390DE8-884A-433D-828A-C7B969F19924}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 31 {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 20 35 {9B390DE8-884A-433D-828A-C7B969F19924}.Release|Any CPU.ActiveCfg = Release|Any CPU 21 36 {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 22 50 EndGlobalSection 23 51 GlobalSection(SolutionProperties) = preSolution -
extensions/PiwigoLib/PiwigoLib/DTO/Helper/PwgEnumHelper.cs
r3816 r7149 9 9 namespace Com.Piwigo.Lib.DTO.Helper 10 10 { 11 publicstatic class PwgEnumHelper<T>11 internal static class PwgEnumHelper<T> 12 12 { 13 publicstatic string stringValueOf(T value)13 internal static string stringValueOf(T value) 14 14 { 15 15 FieldInfo fi = value.GetType().GetField(value.ToString()); … … 25 25 } 26 26 27 publicstatic T enumValueOf(string value)27 internal static T enumValueOf(string value) 28 28 { 29 29 Type enumType = typeof(T); -
extensions/PiwigoLib/PiwigoLib/PiwigoLib.csproj
r6811 r7149 73 73 <Compile Include="Proxy\PwgProxyException.cs" /> 74 74 <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" /> 75 82 <Compile Include="Service\PwgCategoriesService.cs" /> 76 83 <Compile Include="Service\PwgImagesService.cs" /> 77 84 <Compile Include="Service\PwgTagsService.cs" /> 78 <Compile Include=" Service\PwgServiceException.cs" />85 <Compile Include="DTO\PwgServiceException.cs" /> 79 86 <Compile Include="Service\PwgSessionService.cs" /> 80 87 </ItemGroup> -
extensions/PiwigoLib/PiwigoLib/Proxy/Helper/PwgProxyReponseHelper.cs
r3834 r7149 7 7 namespace Com.Piwigo.Lib.Proxy.Helper 8 8 { 9 publicstatic class PwgProxyReponseHelper9 internal static class PwgProxyReponseHelper 10 10 { 11 publicstatic 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) 12 12 { 13 13 String FormatString = String.Empty; … … 36 36 } 37 37 38 publicstatic 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) 39 39 where T: struct 40 40 { … … 45 45 } 46 46 47 publicstatic 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) 48 48 { 49 49 String FormatString = String.Empty; -
extensions/PiwigoLib/PiwigoLib/Proxy/PwgCategoriesProxy.cs
r3835 r7149 10 10 namespace Com.Piwigo.Lib.Proxy 11 11 { 12 static class PwgCategoriesProxy12 static internal class PwgCategoriesProxy 13 13 { 14 14 /// <summary> … … 19 19 /// <param name="PublicOnly"></param> 20 20 /// <returns></returns> 21 static publicPwgCategoriesProxyResponse pwg_categories_getList(Int32? CategoryId,21 static internal PwgCategoriesProxyResponse pwg_categories_getList(Int32? CategoryId, 22 22 Boolean? Recursive, Boolean? PublicOnly) 23 23 { … … 33 33 34 34 response = PwgGenericProxy<PwgCategoriesProxyResponse>.Get( 35 PwgConfigProxy.PwgServeurUri Builder.Uri,35 PwgConfigProxy.PwgServeurUri, 36 36 "pwg.categories.getList", data.ToString()); 37 37 } … … 48 48 /// </summary> 49 49 /// <returns></returns> 50 static publicPwgCategoriesProxyResponse pwg_categories_getAdminList()50 static internal PwgCategoriesProxyResponse pwg_categories_getAdminList() 51 51 { 52 52 PwgCategoriesProxyResponse response = null; … … 54 54 { 55 55 response = PwgGenericProxy<PwgCategoriesProxyResponse>.Get( 56 PwgConfigProxy.PwgServeurUri Builder.Uri,56 PwgConfigProxy.PwgServeurUri, 57 57 "pwg.categories.getAdminList", null); 58 58 } … … 71 71 /// <param name="IdUpperCat"></param> 72 72 /// <returns></returns> 73 static publicPwgAddRequestProxyResponse pwg_categories_add(String categorieName, Int32? IdUpperCat)73 static internal PwgAddRequestProxyResponse pwg_categories_add(String categorieName, Int32? IdUpperCat) 74 74 { 75 75 PwgAddRequestProxyResponse response = null; … … 83 83 84 84 response = PwgGenericProxy<PwgAddRequestProxyResponse>.Post( 85 PwgConfigProxy.PwgServeurUri Builder.Uri,85 PwgConfigProxy.PwgServeurUri, 86 86 data.ToString()); 87 87 } … … 101 101 /// <param name="categorieComment"></param> 102 102 /// <returns></returns> 103 static publicPwgBaseProxyReponse pwg_categories_setInfo(Int32 IdCat, String categorieName, String categorieComment)103 static internal PwgBaseProxyReponse pwg_categories_setInfo(Int32 IdCat, String categorieName, String categorieComment) 104 104 { 105 105 PwgBaseProxyReponse response = null; … … 114 114 115 115 response = PwgGenericProxy<PwgAddRequestProxyResponse>.Post( 116 PwgConfigProxy.PwgServeurUri Builder.Uri,116 PwgConfigProxy.PwgServeurUri, 117 117 data.ToString()); 118 118 } … … 145 145 /// <param name="withThumbnail"></param> 146 146 /// <returns></returns> 147 static publicPwgImagesProxyResponse pwg_categories_getImages(Int32 catId,147 static internal PwgImagesProxyResponse pwg_categories_getImages(Int32 catId, 148 148 Boolean? recursive, 149 149 Int32? perPage, … … 188 188 189 189 response = PwgGenericProxy<PwgImagesProxyResponse>.Post( 190 PwgConfigProxy.PwgServeurUri Builder.Uri,190 PwgConfigProxy.PwgServeurUri, 191 191 data.ToString()); 192 192 } … … 204 204 /// <param name="tagName"></param> 205 205 /// <returns></returns> 206 static publicPwgAddRequestProxyResponse pwg_tag_add(string tagName)206 static internal PwgAddRequestProxyResponse pwg_tag_add(string tagName) 207 207 { 208 208 PwgAddRequestProxyResponse response = null; … … 214 214 215 215 response = PwgGenericProxy<PwgAddRequestProxyResponse>.Post( 216 PwgConfigProxy.PwgServeurUri Builder.Uri,216 PwgConfigProxy.PwgServeurUri, 217 217 data.ToString()); 218 218 } -
extensions/PiwigoLib/PiwigoLib/Proxy/PwgConfigProxy.cs
r3816 r7149 7 7 namespace Com.Piwigo.Lib.Proxy 8 8 { 9 publicstatic class PwgConfigProxy9 internal static class PwgConfigProxy 10 10 { 11 publicstatic String PwgUserAgent = "PiwigoLib.GenericProxy";12 publicstatic Boolean PwgKeepAlive = false;13 publicstatic Int16 PwgTimeOutInSecond = 15;11 internal static String PwgUserAgent = "PiwigoLib.GenericProxy"; 12 internal static Boolean PwgKeepAlive = false; 13 internal static Int16 PwgTimeOutInSecond = 15; 14 14 15 public static UriBuilder PwgServeurUriBuilder = new UriBuilder(); // store uri piece of the server15 internal static Uri PwgServeurUri = null; // store uri piece of the server 16 16 17 publicstatic CookieContainer cookieContainer = new CookieContainer(); // store cookie as session once17 internal static CookieContainer cookieContainer = new CookieContainer(); // store cookie as session once 18 18 19 19 } -
extensions/PiwigoLib/PiwigoLib/Proxy/PwgGenericProxy.cs
r3861 r7149 12 12 { 13 13 14 static publicclass PwgGenericProxy<T>14 static internal class PwgGenericProxy<T> 15 15 { 16 17 publicstatic T Get(Uri address, String methodName, String methodParameter)16 17 internal static T Get(Uri address, String methodName, String methodParameter) 18 18 { 19 19 T ReturnValue = default(T); … … 77 77 } 78 78 79 publicstatic T Post(Uri address, String data)79 internal static T Post(Uri address, String data) 80 80 { 81 81 T ReturnValue = default(T); … … 144 144 } 145 145 146 publicstatic T DeserializeObject(StreamReader xmlData)146 internal static T DeserializeObject(StreamReader xmlData) 147 147 { 148 148 T ReturnValue = default(T); … … 167 167 } 168 168 169 public static void SerializeToXML(String fileName,T obj)169 internal static void SerializeToXML(String fileName, T obj) 170 170 { 171 171 try -
extensions/PiwigoLib/PiwigoLib/Proxy/PwgImagesProxy.cs
r3861 r7149 10 10 namespace Com.Piwigo.Lib.Proxy 11 11 { 12 static class PwgImagesProxy12 static internal class PwgImagesProxy 13 13 { 14 14 /// <summary> … … 18 18 /// <param name="imageRate"></param> 19 19 /// <returns></returns> 20 static publicPwgImageRateProxyResponse pwg_images_rate(Int32 imageId, Int32 imageRate)20 static internal PwgImageRateProxyResponse pwg_images_rate(Int32 imageId, Int32 imageRate) 21 21 { 22 22 PwgImageRateProxyResponse response = null; … … 30 30 31 31 response = PwgGenericProxy<PwgImageRateProxyResponse>.Post( 32 PwgConfigProxy.PwgServeurUri Builder.Uri,32 PwgConfigProxy.PwgServeurUri, 33 33 data.ToString()); 34 34 } -
extensions/PiwigoLib/PiwigoLib/Proxy/PwgProxyException.cs
r3816 r7149 6 6 namespace Com.Piwigo.Lib.Proxy 7 7 { 8 publicsealed class PwgProxyException : ApplicationException8 internal sealed class PwgProxyException : ApplicationException 9 9 { 10 10 private static String Defaut_Message = "A PwgProxyException occurs..."; 11 publicPwgProxyException()11 internal PwgProxyException() 12 12 : base(Defaut_Message) 13 13 { 14 14 } 15 15 16 publicPwgProxyException(String message)16 internal PwgProxyException(String message) 17 17 : base(Defaut_Message + " " + message) 18 18 { 19 19 } 20 20 21 publicPwgProxyException(String message, Exception innerEx)21 internal PwgProxyException(String message, Exception innerEx) 22 22 : base(Defaut_Message + " " + message, innerEx) 23 23 { -
extensions/PiwigoLib/PiwigoLib/Proxy/PwgSessionProxy.cs
r3816 r7149 9 9 namespace Com.Piwigo.Lib.Proxy 10 10 { 11 static class PwgSessionProxy11 static internal class PwgSessionProxy 12 12 { 13 static publicPwgSessionProxyResponse pwg_session_getStatus()13 static internal PwgSessionProxyResponse pwg_session_getStatus() 14 14 { 15 15 PwgSessionProxyResponse response = null; … … 17 17 { 18 18 response = PwgGenericProxy<PwgSessionProxyResponse>.Get( 19 PwgConfigProxy.PwgServeurUri Builder.Uri,19 PwgConfigProxy.PwgServeurUri, 20 20 "pwg.session.getStatus", null); 21 21 } … … 28 28 } 29 29 30 static publicPwgSessionProxyResponse pwg_session_login(string UserName, string Password)30 static internal PwgSessionProxyResponse pwg_session_login(string UserName, string Password) 31 31 { 32 32 PwgSessionProxyResponse response = null; … … 40 40 41 41 response = PwgGenericProxy<PwgSessionProxyResponse>.Post( 42 PwgConfigProxy.PwgServeurUri Builder.Uri,42 PwgConfigProxy.PwgServeurUri, 43 43 data.ToString()); 44 44 } … … 51 51 } 52 52 53 static publicPwgSessionProxyResponse pwg_session_logout()53 static internal PwgSessionProxyResponse pwg_session_logout() 54 54 { 55 55 PwgSessionProxyResponse response = null; … … 60 60 61 61 response = PwgGenericProxy<PwgSessionProxyResponse>.Post( 62 PwgConfigProxy.PwgServeurUri Builder.Uri,62 PwgConfigProxy.PwgServeurUri, 63 63 data.ToString()); 64 64 } -
extensions/PiwigoLib/PiwigoLib/Proxy/PwgTagsProxy.cs
r3834 r7149 10 10 namespace Com.Piwigo.Lib.Proxy 11 11 { 12 static class PwgTagsProxy12 static internal class PwgTagsProxy 13 13 { 14 static publicPwgTagsProxyResponse pwg_tags_getList(Boolean? sortedByCounter)14 static internal PwgTagsProxyResponse pwg_tags_getList(Boolean? sortedByCounter) 15 15 { 16 16 PwgTagsProxyResponse response = null; … … 23 23 24 24 response = PwgGenericProxy<PwgTagsProxyResponse>.Get( 25 PwgConfigProxy.PwgServeurUri Builder.Uri,25 PwgConfigProxy.PwgServeurUri, 26 26 "pwg.tags.getList", data.ToString()); 27 27 } … … 34 34 } 35 35 36 static publicPwgTagsProxyResponse pwg_tags_getAdminList()36 static internal PwgTagsProxyResponse pwg_tags_getAdminList() 37 37 { 38 38 PwgTagsProxyResponse response = null; … … 40 40 { 41 41 response = PwgGenericProxy<PwgTagsProxyResponse>.Get( 42 PwgConfigProxy.PwgServeurUri Builder.Uri,42 PwgConfigProxy.PwgServeurUri, 43 43 "pwg.tags.getAdminList", null); 44 44 } … … 51 51 } 52 52 53 static publicPwgImagesProxyResponse pwg_tags_getImages(List<Int32> tagsId,53 static internal PwgImagesProxyResponse pwg_tags_getImages(List<Int32> tagsId, 54 54 List<String> tagsUrlName, 55 55 List<String> tagsName, … … 98 98 99 99 response = PwgGenericProxy<PwgImagesProxyResponse>.Post( 100 PwgConfigProxy.PwgServeurUri Builder.Uri,100 PwgConfigProxy.PwgServeurUri, 101 101 data.ToString()); 102 102 } … … 108 108 109 109 } 110 static publicPwgAddRequestProxyResponse pwg_tag_add(string tagName)110 static internal PwgAddRequestProxyResponse pwg_tag_add(string tagName) 111 111 { 112 112 PwgAddRequestProxyResponse response = null; … … 118 118 119 119 response = PwgGenericProxy<PwgAddRequestProxyResponse>.Post( 120 PwgConfigProxy.PwgServeurUri Builder.Uri,120 PwgConfigProxy.PwgServeurUri, 121 121 data.ToString()); 122 122 } -
extensions/PiwigoLib/PiwigoLib/Proxy/Response/PwgAddRequestProxyResponse.cs
r3834 r7149 10 10 [Serializable()] 11 11 [XmlRoot(ElementName = "rsp")] 12 publicclass PwgAddRequestProxyResponse : PwgBaseProxyReponse12 internal class PwgAddRequestProxyResponse : PwgBaseProxyReponse 13 13 { 14 14 [XmlElement(ElementName="info")] 15 publicString Message { get; set; }15 internal String Message { get; set; } 16 16 [XmlElement(ElementName = "id")] 17 publicInt32 NewId { get; set; }17 internal Int32 NewId { get; set; } 18 18 19 19 } -
extensions/PiwigoLib/PiwigoLib/Proxy/Response/PwgBaseProxyReponse.cs
r3818 r7149 10 10 [Serializable()] 11 11 [XmlRoot(ElementName = "err")] 12 publicclass PwgBaseProxyReponseError12 internal class PwgBaseProxyReponseError 13 13 { 14 14 [XmlAttribute(AttributeName = "code")] 15 publicInt32 Code { get; set; }15 internal Int32 Code { get; set; } 16 16 17 17 [XmlAttribute(AttributeName = "msg")] 18 publicString Message { get; set; }18 internal String Message { get; set; } 19 19 } 20 20 … … 22 22 [Serializable()] 23 23 [XmlRoot(ElementName = "rsp")] 24 publicabstract class PwgBaseProxyReponse24 internal abstract class PwgBaseProxyReponse 25 25 { 26 26 [XmlAttribute(AttributeName="stat")] 27 publicPwgBaseProxyReponseRetourEnum Retour { get; set; }27 internal PwgBaseProxyReponseRetourEnum Retour { get; set; } 28 28 29 29 [XmlElement(ElementName="err")] 30 publicPwgBaseProxyReponseError Erreur { get; set; }30 internal PwgBaseProxyReponseError Erreur { get; set; } 31 31 32 32 } -
extensions/PiwigoLib/PiwigoLib/Proxy/Response/PwgBaseProxyReponseRetourEnum.cs
r3816 r7149 9 9 [Serializable()] 10 10 [XmlRoot(ElementName = "PwgBaseProxyReponseRetourEnum")] 11 publicenum PwgBaseProxyReponseRetourEnum : int11 internal enum PwgBaseProxyReponseRetourEnum : int 12 12 { 13 13 [XmlEnum("unknow")] -
extensions/PiwigoLib/PiwigoLib/Proxy/Response/PwgCategoriesProxyResponse.cs
r3834 r7149 10 10 [Serializable()] 11 11 [XmlRoot(ElementName = "category")] 12 publicclass PwgCategoryProxyResponse12 internal class PwgCategoryProxyResponse 13 13 { 14 14 [XmlAttribute(AttributeName = "id")] 15 publicInt32 Id { get; set; }15 internal Int32 Id { get; set; } 16 16 [XmlElement(ElementName = "uppercats")] 17 publicString UpperCategoryId { get; set; }17 internal String UpperCategoryId { get; set; } 18 18 [XmlElement (ElementName = "name")] 19 publicString Name { get; set; }19 internal String Name { get; set; } 20 20 [XmlAttribute(AttributeName = "url")] 21 publicString Url { get; set; }21 internal String Url { get; set; } 22 22 [XmlAttribute(AttributeName = "nb_images")] 23 publicInt64 ImagesCount { get; set; }23 internal Int64 ImagesCount { get; set; } 24 24 [XmlAttribute(AttributeName = "total_nb_images")] 25 publicInt64 DeepImagesCount { get; set; }25 internal Int64 DeepImagesCount { get; set; } 26 26 [XmlAttribute(AttributeName = "nb_categories")] 27 publicInt64 SubCategoriesCount { get; set; }27 internal Int64 SubCategoriesCount { get; set; } 28 28 [XmlAttribute(AttributeName = "max_date_last")] 29 publicString LastDate { get; set; }29 internal String LastDate { get; set; } 30 30 } 31 31 32 32 [Serializable()] 33 33 [XmlRoot(ElementName = "rsp")] 34 publicclass PwgCategoriesProxyResponse : PwgBaseProxyReponse34 internal class PwgCategoriesProxyResponse : PwgBaseProxyReponse 35 35 { 36 36 [XmlArray("categories")] 37 37 [XmlArrayItem("category")] 38 publicPwgCategoryProxyResponse[] Categories { get; set; }38 internal PwgCategoryProxyResponse[] Categories { get; set; } 39 39 } 40 40 } -
extensions/PiwigoLib/PiwigoLib/Proxy/Response/PwgImagesProxyResponse.cs
r3861 r7149 11 11 [Serializable()] 12 12 [XmlRoot(ElementName = "rsp")] 13 publicclass PwgImageRateProxyResponse : PwgBaseProxyReponse13 internal class PwgImageRateProxyResponse : PwgBaseProxyReponse 14 14 { 15 15 [XmlElement("count")] 16 publicInt32 Count { get; set; }16 internal Int32 Count { get; set; } 17 17 [XmlElement("average")] 18 publicString Average { get; set; }18 internal String Average { get; set; } 19 19 [XmlElement("stdev")] 20 publicString Stdev { get; set; }20 internal String Stdev { get; set; } 21 21 } 22 22 23 23 [Serializable()] 24 24 [XmlRoot(ElementName = "categorie")] 25 publicclass PwgImageProxyResponse25 internal class PwgImageProxyResponse 26 26 { 27 27 [XmlAttribute(AttributeName = "id")] 28 publicInt32 Id { get; set; }28 internal Int32 Id { get; set; } 29 29 [XmlAttribute(AttributeName = "width")] 30 publicInt32 Width { get; set; }30 internal Int32 Width { get; set; } 31 31 [XmlAttribute(AttributeName = "height")] 32 publicInt32 Height { get; set; }32 internal Int32 Height { get; set; } 33 33 [XmlAttribute(AttributeName = "file")] 34 publicString File { get; set; }34 internal String File { get; set; } 35 35 [XmlAttribute(AttributeName = "tn_url")] 36 publicString UrlThunb { get; set; }36 internal String UrlThunb { get; set; } 37 37 [XmlAttribute(AttributeName = "element_url")] 38 publicString UrlElement { get; set; }38 internal String UrlElement { get; set; } 39 39 [XmlAttribute(AttributeName = "high_url")] 40 publicString UrlHighDef { get; set; }40 internal String UrlHighDef { get; set; } 41 41 [XmlAttribute(AttributeName = "hit")] 42 publicInt64 Counter { get; set; }42 internal Int64 Counter { get; set; } 43 43 44 44 [XmlArray("tags")] 45 45 [XmlArrayItem("tag")] 46 publicPwgTagProxyResponse[] Tags { get; set; }46 internal PwgTagProxyResponse[] Tags { get; set; } 47 47 48 48 [XmlArray("categories")] 49 49 [XmlArrayItem("category")] 50 publicPwgCategoryProxyResponse[] Categories { get; set; }50 internal PwgCategoryProxyResponse[] Categories { get; set; } 51 51 52 52 } … … 54 54 [Serializable()] 55 55 [XmlRoot(ElementName = "images")] 56 publicclass PwgImageListProxyResponse56 internal class PwgImageListProxyResponse 57 57 { 58 58 [XmlAttribute("page")] 59 public Int32 Page;59 internal Int32 Page { get; set; } 60 60 [XmlAttribute("per_page")] 61 public Int32 PerPage;61 internal Int32 PerPage { get; set; } 62 62 [XmlAttribute("count")] 63 public Int32 Count;63 internal Int32 Count { get; set; } 64 64 65 65 [XmlElement("image", typeof(PwgImageProxyResponse))] 66 publicPwgImageProxyResponse[] Images { get; set; }66 internal PwgImageProxyResponse[] Images { get; set; } 67 67 68 68 … … 71 71 [Serializable()] 72 72 [XmlRoot(ElementName = "rsp")] 73 publicclass PwgImagesProxyResponse : PwgBaseProxyReponse73 internal class PwgImagesProxyResponse : PwgBaseProxyReponse 74 74 { 75 75 [XmlElement("images")] 76 publicPwgImageListProxyResponse ImageList { get; set; }76 internal PwgImageListProxyResponse ImageList { get; set; } 77 77 } 78 78 -
extensions/PiwigoLib/PiwigoLib/Proxy/Response/PwgSessionProxyResponse.cs
r3818 r7149 11 11 [XmlRoot(ElementName = "rsp")] 12 12 13 publicclass PwgSessionProxyResponse : PwgBaseProxyReponse13 internal class PwgSessionProxyResponse : PwgBaseProxyReponse 14 14 { 15 15 [XmlElement(ElementName = "username")] 16 publicString UserName { get; set; }16 internal String UserName { get; set; } 17 17 [XmlElement(ElementName = "status")] 18 publicstring Status { get; set; }18 internal string Status { get; set; } 19 19 [XmlElement(ElementName = "template")] 20 publicString Template { get; set; }20 internal String Template { get; set; } 21 21 [XmlElement(ElementName = "theme")] 22 publicString Theme { get; set; }22 internal String Theme { get; set; } 23 23 [XmlElement(ElementName = "language")] 24 publicString Language { get; set; }24 internal String Language { get; set; } 25 25 [XmlElement(ElementName = "charset")] 26 publicString CharSet { get; set; }26 internal String CharSet { get; set; } 27 27 } 28 28 } -
extensions/PiwigoLib/PiwigoLib/Proxy/Response/PwgTagsProxyResponse.cs
r3827 r7149 10 10 [Serializable()] 11 11 [XmlRoot(ElementName = "tag")] 12 publicclass PwgTagProxyResponse12 internal class PwgTagProxyResponse 13 13 { 14 14 [XmlAttribute(AttributeName = "id")] 15 publicInt32 Id { get; set; }15 internal Int32 Id { get; set; } 16 16 [XmlAttribute(AttributeName = "name")] 17 publicString Name { get; set; }17 internal String Name { get; set; } 18 18 [XmlAttribute(AttributeName = "url_name")] 19 publicString UrlName { get; set; }19 internal String UrlName { get; set; } 20 20 [XmlAttribute(AttributeName = "counter")] 21 publicInt64 Counter { get; set; }21 internal Int64 Counter { get; set; } 22 22 [XmlAttribute(AttributeName = "url")] 23 publicString UrlTag { get; set; }23 internal String UrlTag { get; set; } 24 24 } 25 25 26 26 [Serializable()] 27 27 [XmlRoot(ElementName = "rsp")] 28 publicclass PwgTagsProxyResponse : PwgBaseProxyReponse28 internal class PwgTagsProxyResponse : PwgBaseProxyReponse 29 29 { 30 30 //[XmlElement(ElementName = "tags")] 31 31 [XmlArray("tags")] 32 32 [XmlArrayItem("tag")] 33 publicPwgTagProxyResponse[] Tags { get; set; }33 internal PwgTagProxyResponse[] Tags { get; set; } 34 34 } 35 35 } -
extensions/PiwigoLib/PiwigoLib/Service/PwgCategoriesService.cs
r3837 r7149 7 7 using Com.Piwigo.Lib.Proxy.Response; 8 8 using Com.Piwigo.Lib.DTO.Helper; 9 using Com.Piwigo.Lib.IService; 9 10 10 11 namespace Com.Piwigo.Lib.Service 11 12 { 12 13 13 static public classPwgCategoriesService14 internal sealed class PwgCategoriesService : IPwgCategoriesService 14 15 { 15 16 /// <summary> … … 18 19 /// <param name="sortedByCounter"></param> 19 20 /// <returns></returns> 20 staticpublic List<PwgCategory> GetListOfCategory(Int32? CatgeroryId, Boolean? Recursive, Boolean? PublicOnly)21 public List<PwgCategory> GetListOfCategory(Int32? CatgeroryId, Boolean? Recursive, Boolean? PublicOnly) 21 22 { 22 23 List<PwgCategory> returnValue = new List<PwgCategory>(); … … 55 56 /// </summary> 56 57 /// <returns></returns> 57 staticpublic List<PwgCategory> GetAdminListOfCategory()58 public List<PwgCategory> GetAdminListOfCategory() 58 59 { 59 60 List<PwgCategory> returnValue = new List<PwgCategory>(); … … 96 97 /// <param name="messageInfo">Message returned by the server</param> 97 98 /// <returns>false, if a error occurs</returns> 98 staticpublic 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) 99 100 { 100 101 Boolean returnValue = false; … … 139 140 /// <param name="categoryComment"></param> 140 141 /// <returns></returns> 141 staticpublic Boolean UpdateCategoryInfo(Int32 IdCat, String categoryName, String categoryComment)142 public Boolean UpdateCategoryInfo(Int32 IdCat, String categoryName, String categoryComment) 142 143 { 143 144 Boolean returnValue = false; … … 195 196 /// <param name="CountReturned"></param> 196 197 /// <returns></returns> 197 staticpublic List<PwgImage> GetListOfImagesFormCategory(Int32 categoryId,198 public List<PwgImage> GetListOfImagesFormCategory(Int32 categoryId, 198 199 Boolean? recursive, 199 200 Int32? perPage, … … 269 270 /// <param name="response"></param> 270 271 /// <param name="session"></param> 271 static public List<PwgCategory> ConvertProxyResponseToDTO(PwgCategoriesProxyResponse response)272 internal static List<PwgCategory> ConvertProxyResponseToDTO(PwgCategoriesProxyResponse response) 272 273 { 273 274 List<PwgCategory> returnValue = new List<PwgCategory>(); … … 287 288 /// <param name="response"></param> 288 289 /// <param name="session"></param> 289 static public PwgCategory ConvertProxyResponseToDTO(PwgCategoryProxyResponse response)290 internal static PwgCategory ConvertProxyResponseToDTO(PwgCategoryProxyResponse response) 290 291 { 291 292 PwgCategory returnValue = new PwgCategory(); -
extensions/PiwigoLib/PiwigoLib/Service/PwgImagesService.cs
r3861 r7149 8 8 using Com.Piwigo.Lib.Proxy.Response; 9 9 using Com.Piwigo.Lib.DTO.Helper; 10 using Com.Piwigo.Lib.IService; 10 11 11 12 namespace Com.Piwigo.Lib.Service 12 13 { 13 14 14 static public classPwgImagesService15 internal sealed class PwgImagesService : IPwgImagesService 15 16 { 16 staticpublic PwgImageRate RateImage(Int32 imageId, Int32 imageRate)17 public PwgImageRate RateImage(Int32 imageId, Int32 imageRate) 17 18 { 18 19 PwgImageRate returnValue = new PwgImageRate(); … … 52 53 /// <param name="response"></param> 53 54 /// <param name="session"></param> 54 static public PwgImageRate ConvertProxyResponseToDTO(PwgImageRateProxyResponse response)55 internal static PwgImageRate ConvertProxyResponseToDTO(PwgImageRateProxyResponse response) 55 56 { 56 57 PwgImageRate returnValue = new PwgImageRate(); … … 82 83 /// <param name="response"></param> 83 84 /// <param name="session"></param> 84 static public void ConvertProxyResponseToDTO(PwgImagesProxyResponse response,85 internal static void ConvertProxyResponseToDTO(PwgImagesProxyResponse response, 85 86 List<PwgImage> lstImage, 86 87 ref Int32 Page, ref Int32 PerPagee, ref Int32 Count) … … 94 95 /// <param name="response"></param> 95 96 /// <param name="session"></param> 96 static public void ConvertProxyResponseToDTO(PwgImageListProxyResponse response,97 internal static void ConvertProxyResponseToDTO(PwgImageListProxyResponse response, 97 98 List<PwgImage> lstImage, 98 99 ref Int32 Page, ref Int32 PerPagee, ref Int32 Count) … … 116 117 /// <param name="response"></param> 117 118 /// <param name="session"></param> 118 static public PwgImage ConvertProxyResponseToDTO(PwgImageProxyResponse response)119 internal static PwgImage ConvertProxyResponseToDTO(PwgImageProxyResponse response) 119 120 { 120 121 PwgImage returnValue = new PwgImage(); -
extensions/PiwigoLib/PiwigoLib/Service/PwgSessionService.cs
r3816 r7149 7 7 using Com.Piwigo.Lib.Proxy.Response; 8 8 using Com.Piwigo.Lib.DTO.Helper; 9 using Com.Piwigo.Lib.IService; 9 10 10 11 namespace Com.Piwigo.Lib.Service 11 12 { 12 13 static public classPwgSessionService13 14 internal sealed class PwgSessionService : IPwgSessionService 14 15 { 15 staticprivate PwgSession PwgSession = null;16 private PwgSession PwgSession = null; 16 17 17 18 /// <summary> … … 19 20 /// </summary> 20 21 /// <returns></returns> 21 staticpublic PwgSession GetPwgSession()22 public PwgSession GetPwgSession() 22 23 { 23 24 if (PwgSession == null) … … 59 60 /// <param name="Password"></param> 60 61 /// <returns></returns> 61 staticpublic PwgSession Login(String UserName, String Password)62 public PwgSession Login(String UserName, String Password) 62 63 { 63 64 PwgSession = null; … … 88 89 } 89 90 90 staticpublic PwgSession Logout()91 public PwgSession Logout() 91 92 { 92 93 PwgSession = null; … … 121 122 /// <param name="response"></param> 122 123 /// <param name="session"></param> 123 static privatevoid ConvertProxyResponseToDTO(PwgSessionProxyResponse response, ref PwgSession session)124 internal static void ConvertProxyResponseToDTO(PwgSessionProxyResponse response, ref PwgSession session) 124 125 { 125 126 if (session == null) -
extensions/PiwigoLib/PiwigoLib/Service/PwgTagsService.cs
r3834 r7149 7 7 using Com.Piwigo.Lib.Proxy.Response; 8 8 using Com.Piwigo.Lib.DTO.Helper; 9 using Com.Piwigo.Lib.IService; 9 10 10 11 namespace Com.Piwigo.Lib.Service 11 12 { 12 13 13 static public classPwgTagsService14 internal sealed class PwgTagsService : IPwgTagsService 14 15 { 15 16 /// <summary> … … 18 19 /// <param name="sortedByCounter"></param> 19 20 /// <returns></returns> 20 staticpublic List<PwgTag> GetListOfTag(Boolean? sortedByCounter)21 public List<PwgTag> GetListOfTag(Boolean? sortedByCounter) 21 22 { 22 23 List<PwgTag> returnValue = new List<PwgTag>(); … … 56 57 /// <param name="sortedByCounter"></param> 57 58 /// <returns></returns> 58 staticpublic List<PwgTag> GetAdminListOfTag()59 public List<PwgTag> GetAdminListOfTag() 59 60 { 60 61 List<PwgTag> returnValue = new List<PwgTag>(); … … 94 95 /// <param name="tagName"></param> 95 96 /// <returns></returns> 96 staticpublic Boolean AddTag(String tagName, ref Int32 newId, ref String messageInfo)97 public Boolean AddTag(String tagName, ref Int32 newId, ref String messageInfo) 97 98 { 98 99 Boolean returnValue = false; … … 154 155 /// <param name="CountReturned"></param> 155 156 /// <returns></returns> 156 staticpublic List<PwgImage> GetListOfImagesFormTags(List<Int32> tagsId,157 public List<PwgImage> GetListOfImagesFormTags(List<Int32> tagsId, 157 158 List<String> tagsUrlName, 158 159 List<String> tagsName, … … 233 234 /// <param name="response"></param> 234 235 /// <param name="session"></param> 235 static publicList<PwgTag> ConvertProxyResponseToDTO(PwgTagsProxyResponse response)236 internal static List<PwgTag> ConvertProxyResponseToDTO(PwgTagsProxyResponse response) 236 237 { 237 238 List<PwgTag> returnValue = new List<PwgTag>(); … … 251 252 /// <param name="response"></param> 252 253 /// <param name="session"></param> 253 static public PwgTag ConvertProxyResponseToDTO(PwgTagProxyResponse response)254 internal static PwgTag ConvertProxyResponseToDTO(PwgTagProxyResponse response) 254 255 { 255 256 PwgTag returnValue = new PwgTag(); -
extensions/PiwigoLib/TestPiwigoLib/Form1.cs
r3861 r7149 1 1 using 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;8 2 using System.Windows.Forms; 9 3 10 using Com.Piwigo.Lib.Proxy; 11 using Com.Piwigo.Lib.Service; 4 using Com.Piwigo.Lib.IService; 12 5 using Com.Piwigo.Lib.DTO; 13 using Com.Piwigo.Lib.Proxy.Response;14 6 15 7 … … 29 21 private void button1_Click(object sender, EventArgs e) 30 22 { 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://"; 35 27 36 Console.WriteLine(PwgConfigProxy.PwgServeurUriBuilder.Uri.AbsoluteUri); 28 PwgServiceProvider.Instance.PwgSetupService.Setup("TestPiwigoLib", null, urib.Uri); 29 30 31 Console.WriteLine(urib.Uri.AbsoluteUri); 37 32 38 33 try 39 34 { 40 35 PwgSession sess = null; 41 sess = PwgSe ssionService.GetPwgSession();36 sess = PwgServiceProvider.Instance.PwgSessionService.GetPwgSession(); 42 37 Console.WriteLine("user : " + sess.UserName + " " + sess.Status); 43 38 44 sess = PwgSe ssionService.Login(tbUser.Text,tbPassword.Text);39 sess = PwgServiceProvider.Instance.PwgSessionService.Login(tbUser.Text, tbPassword.Text); 45 40 Console.WriteLine("user : " + sess.UserName + " " + sess.Status); 46 41 47 //Boolean rc = Pwg TagsService.AddTag("Loic");42 //Boolean rc = PwgServiceProvider.Instance.PwgTagsService.AddTag("Loic"); 48 43 49 //List<PwgTag> lstTag = Pwg TagsService.GetAdminListOfTag();44 //List<PwgTag> lstTag = PwgServiceProvider.Instance.PwgTagsService.GetAdminListOfTag(); 50 45 51 46 //Int32 Page = 0; … … 53 48 //Int32 Count = 0; 54 49 55 //List<PwgImage> lstImg = Pwg TagsService.GetListOfImagesFormTags(new List<Int32>() { 1, 7 },50 //List<PwgImage> lstImg = PwgServiceProvider.Instance.PwgTagsService.GetListOfImagesFormTags(new List<Int32>() { 1, 7 }, 56 51 // null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 57 52 // ref Page, ref PerPage, ref Count); 58 53 59 //List<PwgImage> lstImg = Pwg CategoriesService.GetListOfImagesFormCategory(1,54 //List<PwgImage> lstImg = PwgServiceProvider.Instance.PwgCategoriesService.GetListOfImagesFormCategory(1, 60 55 // null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 61 56 // ref Page, ref PerPage, ref Count); … … 63 58 //Console.WriteLine("lstImg : Page " + Page.ToString() + " PerPage " + PerPage); 64 59 65 //List<PwgCategory> lstCat = Pwg CategoriesService.GetAdminListOfCategory();60 //List<PwgCategory> lstCat = PwgServiceProvider.Instance.PwgCategoriesService.GetAdminListOfCategory(); 66 61 67 62 //Int32 newid = 0; 68 63 //String msg = String.Empty; 69 //Boolean rc = Pwg CategoriesService.AddCategory("test_cat", 1, ref newid, ref msg);64 //Boolean rc = PwgServiceProvider.Instance.PwgCategoriesService.AddCategory("test_cat", 1, ref newid, ref msg); 70 65 //Console.WriteLine(String.Format("newid : {0} message : {1}", newid,msg)); 71 //rc = Pwg CategoriesService.UpdateCategoryInfo(newid, "test2", "rename cat");66 //rc = PwgServiceProvider.Instance.PwgCategoriesService.UpdateCategoryInfo(newid, "test2", "rename cat"); 72 67 73 PwgImageRate imgRate = Pwg ImagesService.RateImage(1, 5);68 PwgImageRate imgRate = PwgServiceProvider.Instance.PwgImagesService.RateImage(1, 5); 74 69 75 sess = PwgSe ssionService.Logout();70 sess = PwgServiceProvider.Instance.PwgSessionService.Logout(); 76 71 Console.WriteLine("user : " + sess.UserName + " " + sess.Status); 77 72 }
Note: See TracChangeset
for help on using the changeset viewer.