├── .gitignore ├── Gravatar.NET ├── .gitignore ├── Data │ ├── GravatarAddress.cs │ ├── GravatarEnums.cs │ ├── GravatarParameter.cs │ ├── GravatarProfile.cs │ ├── GravatarSaveResponse.cs │ ├── GravatarStruct.cs │ ├── GravatarUrlParameters.cs │ └── GravatarUserImage.cs ├── Exceptions │ └── GravatarExceptions.cs ├── Extensions.cs ├── Gravatar.NET.csproj ├── GravatarConstants.cs ├── GravatarResponseParser.cs ├── GravatarService.Helper.cs ├── GravatarService.cs ├── GravatarServiceRequest.cs ├── GravatarServiceResponse.cs └── Properties │ └── AssemblyInfo.cs ├── GravatarOSC.sln ├── GravatarOSC ├── .gitignore ├── GravatarOSC.csproj ├── HelperMethods.cs ├── OSCPerson.cs ├── OSCProfile.cs ├── OSCProvider.cs ├── OSCSession.cs ├── Other Stuff │ ├── EnableDebugging.reg │ ├── OutlookSocialProvider.dll │ ├── OutlookSocialProvider_1.0.xsd │ └── OutlookSocialProvider_1.1.xsd ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── Resources │ ├── Logo - Copy.jpg │ └── Logo.jpg ├── Schema │ └── SocialProviderSchema.cs ├── SocialProviderSchema.cs └── SocialProviderSchemaIncoming.cs ├── Install32.cmd ├── Install64.cmd ├── Readme.md ├── SocialProvider.reg └── create_package.py /.gitignore: -------------------------------------------------------------------------------- 1 | /*.5.1.ReSharper.user 2 | /*.suo 3 | /_ReSharper.GravatarOSC/ 4 | /.vs/ 5 | -------------------------------------------------------------------------------- /Gravatar.NET/.gitignore: -------------------------------------------------------------------------------- 1 | /bin/ 2 | /obj/ 3 | -------------------------------------------------------------------------------- /Gravatar.NET/Data/GravatarAddress.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.Serialization; 3 | 4 | namespace Gravatar.NET.Data 5 | { 6 | /// 7 | /// Represents a Gravatar account-address parameter 8 | /// 9 | [DataContract] 10 | public class GravatarAddress 11 | { 12 | internal GravatarAddress() { } 13 | 14 | /// 15 | /// The email address 16 | /// 17 | [DataMember] 18 | public string Name { get; internal set; } 19 | 20 | /// 21 | /// The ID if the active image associated with this account 22 | /// 23 | [DataMember] 24 | public string ImageId { get; internal set; } 25 | 26 | /// 27 | /// The details of the active image associated with this account 28 | /// 29 | [DataMember] 30 | public GravatarUserImage Image {get;internal set;} 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Gravatar.NET/Data/GravatarEnums.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Gravatar.NET.Data 4 | { 5 | /// 6 | /// A list of possible Gravatar parameters type 7 | /// 8 | public enum GravatarParType 9 | { 10 | String, 11 | Integer, 12 | Bool, 13 | Array, 14 | Struct 15 | } 16 | 17 | /// 18 | /// A list of possible Gravatar image rating 19 | /// 20 | public enum GravatarImageRating 21 | { 22 | G = 0, 23 | PG = 1, 24 | R = 2, 25 | X = 3 26 | } 27 | 28 | /// 29 | /// A list of possible gravatar default option for not found images 30 | /// 31 | public enum GravatarDefaultUrlOptions 32 | { 33 | /// 34 | /// No default URL option is provided 35 | /// 36 | None, 37 | /// 38 | /// Return the Identicon image if gravatar image not found 39 | /// 40 | Identicon, 41 | /// 42 | /// Return the Monsterid image if gravatar image not found 43 | /// 44 | Monsterid, 45 | /// 46 | /// Return the Wavatar image if gravatar image not found 47 | /// 48 | Wavatar, 49 | /// 50 | /// Return a 404 HTTP error if gravatar image not found 51 | /// 52 | Error, 53 | /// 54 | /// Return the specified image (CustomDefault) if gravatar image not found 55 | /// 56 | Custom 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Gravatar.NET/Data/GravatarParameter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Runtime.Serialization; 4 | 5 | namespace Gravatar.NET.Data 6 | { 7 | [DataContract] 8 | public class GravatarParameter 9 | { 10 | private bool _boolValue; 11 | private int _intValue; 12 | 13 | internal GravatarParameter() { } 14 | 15 | [DataMember] 16 | public string Name { get; set; } 17 | 18 | [DataMember] 19 | public string StringValue { get; set; } 20 | 21 | [DataMember] 22 | public int IntegerValue 23 | { 24 | get { return _intValue; } 25 | set 26 | { 27 | _intValue = value; 28 | StringValue = value.ToString(); 29 | } 30 | } 31 | 32 | [DataMember] 33 | public bool BooleanValue 34 | { 35 | get { return _boolValue; } 36 | set 37 | { 38 | _boolValue = value; 39 | StringValue = value.ToString(); 40 | } 41 | } 42 | 43 | [DataMember] 44 | public IEnumerable ArrayValue { get; set; } 45 | 46 | [DataMember] 47 | public GravatarStruct StructValue { get; set; } 48 | 49 | [DataMember] 50 | public GravatarParType Type { get; set; } 51 | 52 | #region Static Initializers 53 | 54 | public static GravatarParameter NewStringParamter(string name, string value) 55 | { 56 | return new GravatarParameter { Name = name, Type = GravatarParType.String, StringValue = value }; 57 | } 58 | 59 | public static GravatarParameter NewIntegerParameter(string name, int value) 60 | { 61 | return new GravatarParameter { Name = name, Type = GravatarParType.Integer, IntegerValue = value }; 62 | } 63 | 64 | public static GravatarParameter NewArrayParameter(string name, IEnumerable value) 65 | { 66 | return new GravatarParameter { Name = name, Type = GravatarParType.Array, ArrayValue = value }; 67 | } 68 | 69 | public static GravatarParameter NewStructParamater(string name, GravatarStruct value) 70 | { 71 | return new GravatarParameter { Name = name, Type = GravatarParType.Struct, StructValue = value }; 72 | } 73 | 74 | public static GravatarParameter NewBooleanParameter(string name, bool value) 75 | { 76 | return new GravatarParameter { Name = name, Type = GravatarParType.Bool, BooleanValue = value }; 77 | } 78 | 79 | #endregion 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /Gravatar.NET/Data/GravatarProfile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Net; 4 | using System.Xml.Linq; 5 | using Gravatar.NET.Exceptions; 6 | 7 | namespace Gravatar.NET.Data 8 | { 9 | public class GravatarProfile 10 | { 11 | public string ProfileUrl { get; private set; } 12 | public string PreferredUsername { get; set; } 13 | public string ThumbnailUrl { get; set; } 14 | 15 | public string DisplayName { get; set; } 16 | public string GivenName { get; set; } 17 | public string FamilyName { get; set; } 18 | 19 | public string CurrentLocation { get; set; } 20 | 21 | internal GravatarProfile(WebResponse webResponse) { 22 | using (var responseStream = webResponse.GetResponseStream()) 23 | if (responseStream != null) 24 | using (var reader = new StreamReader(responseStream)) 25 | LoadFromXml(reader.ReadToEnd()); 26 | } 27 | 28 | // ReSharper disable PossibleNullReferenceException 29 | private void LoadFromXml(string xmlData) { 30 | try { 31 | var responseXmlDoc = XDocument.Parse(xmlData); 32 | var rspElement = responseXmlDoc.Element("response"); 33 | var entryElement = rspElement.Element("entry"); 34 | 35 | // profileUrl 36 | var profileUrlElement = entryElement.Element("profileUrl"); 37 | if (profileUrlElement != null) 38 | ProfileUrl = profileUrlElement.Value; 39 | 40 | // preferredUsername 41 | var preferredUsernameElement = entryElement.Element("preferredUsername"); 42 | if (preferredUsernameElement != null) 43 | PreferredUsername = preferredUsernameElement.Value; 44 | 45 | // thumbnailUrl 46 | var thumbnailUrlElement = entryElement.Element("thumbnailUrl"); 47 | if (thumbnailUrlElement != null) 48 | ThumbnailUrl = thumbnailUrlElement.Value; 49 | 50 | // displayName 51 | var displayNameElement = entryElement.Element("displayName"); 52 | if (displayNameElement != null) 53 | DisplayName = displayNameElement.Value; 54 | 55 | // currentLocation 56 | var currentLocationElement = entryElement.Element("currentLocation"); 57 | if (currentLocationElement != null) 58 | CurrentLocation = currentLocationElement.Value; 59 | 60 | // name 61 | var nameElement = entryElement.Element("name"); 62 | if (nameElement != null) { 63 | var givenNameElement = nameElement.Element("givenName"); 64 | if (givenNameElement != null) 65 | GivenName = givenNameElement.Value; 66 | 67 | var familyNameElement = nameElement.Element("familyName"); 68 | if (familyNameElement != null) 69 | FamilyName = familyNameElement.Value; 70 | } 71 | 72 | } catch (Exception) { 73 | throw new GravatarInvalidResponseXmlException(); 74 | } 75 | } 76 | // ReSharper restore PossibleNullReferenceException 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /Gravatar.NET/Data/GravatarSaveResponse.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.Serialization; 3 | 4 | namespace Gravatar.NET.Data 5 | { 6 | /// 7 | /// Represents the result of a Save method call 8 | /// 9 | [DataContract] 10 | public class GravatarSaveResponse 11 | { 12 | internal GravatarSaveResponse() 13 | { 14 | } 15 | 16 | /// 17 | /// Whether the save operation was successful 18 | /// 19 | [DataMember] 20 | public bool Success { get; internal set; } 21 | 22 | /// 23 | /// The ID of the newly saved image 24 | /// 25 | [DataMember] 26 | public string SavedImageId { get; internal set; } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Gravatar.NET/Data/GravatarStruct.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Runtime.Serialization; 4 | 5 | namespace Gravatar.NET.Data 6 | { 7 | /// 8 | /// Represents a Gravatar struct parameter 9 | /// 10 | [DataContract] 11 | public class GravatarStruct 12 | { 13 | internal GravatarStruct() { } 14 | 15 | [DataMember] 16 | public IEnumerable Parameters { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Gravatar.NET/Data/GravatarUrlParameters.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Gravatar.NET.Exceptions; 3 | 4 | namespace Gravatar.NET.Data 5 | { 6 | /// 7 | /// Represents the possible URL parameters which can be used when making a request 8 | /// to the active account's image url 9 | /// 10 | public class GravatarUrlParameters 11 | { 12 | private int _size; 13 | private string _defaultUrl; 14 | 15 | /// 16 | /// The size to retrieve the image from Gravatar 17 | /// Possible value between 1 and 512 18 | /// If value is not in the acceptable range a GravatarUrlInvalidSizeExcetion 19 | /// is thrown 20 | /// 21 | public int Size 22 | { 23 | get { return _size; } 24 | 25 | set { 26 | 27 | if (value < 1 || value > 512) throw new GravatarUrlInvalidSizeExcetion(value); 28 | _size = value; 29 | } 30 | } 31 | 32 | /// 33 | /// The minimum rating of the image to retrieve from Gravatar 34 | /// 35 | public GravatarImageRating Rating { get; set; } 36 | 37 | /// 38 | /// The default option of an image to retrieve if the requested image doesnt exist for the account 39 | /// 40 | public GravatarDefaultUrlOptions DefaultOption{get;set;} 41 | 42 | /// 43 | /// If the Default option property is set to 'Custom', and the image doesnt exist for the account, 44 | /// this custom URL will be used to return a default image 45 | /// 46 | public string CustomDefaultUrl 47 | { 48 | get { return _defaultUrl; } 49 | 50 | set 51 | { 52 | _defaultUrl = value; 53 | if (!String.IsNullOrEmpty(value)) DefaultOption = GravatarDefaultUrlOptions.Custom; 54 | } 55 | } 56 | 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Gravatar.NET/Data/GravatarUserImage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.Serialization; 3 | 4 | namespace Gravatar.NET.Data 5 | { 6 | /// 7 | /// Represents a Gravatar user image details 8 | /// 9 | [DataContract] 10 | public class GravatarUserImage 11 | { 12 | internal GravatarUserImage() { } 13 | 14 | /// 15 | /// The identifier of the image 16 | /// 17 | [DataMember] 18 | public string Name { get; internal set; } 19 | 20 | /// 21 | /// The rating associated with the image 22 | /// 23 | [DataMember] 24 | public GravatarImageRating Rating { get; internal set; } 25 | 26 | /// 27 | /// The URL of the image 28 | /// 29 | [DataMember] 30 | public string Url {get; internal set;} 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Gravatar.NET/Exceptions/GravatarExceptions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Gravatar.NET.Exceptions { 4 | public class GravatarEmailHashFailedException : Exception { 5 | public GravatarEmailHashFailedException(string address, Exception ex) 6 | : base(String.Format("Address: '{0}' failed to be hashed", address), ex) { 7 | } 8 | } 9 | 10 | public class GravatarInvalidResponseXmlException : Exception { 11 | public GravatarInvalidResponseXmlException() : base("The XML received from the Gravatar server is invalid") { 12 | } 13 | } 14 | 15 | public class GravatarRequestException : Exception { 16 | public GravatarRequestException(Exception exception) 17 | : base("Failed to make request to Gravatar server", exception) { 18 | } 19 | } 20 | 21 | public class GravatarUrlInvalidSizeExcetion : ArgumentException { 22 | public GravatarUrlInvalidSizeExcetion(int size) 23 | : base(String.Format("Requested size {0} is not a valid value between 1 and 512", size), "Size") { 24 | } 25 | } 26 | 27 | public class UnknownGravatarMethodException : ArgumentException { 28 | public UnknownGravatarMethodException(string method) 29 | : base(String.Format("An unknown method '{0}' was called", method)) { 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Gravatar.NET/Extensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using Gravatar.NET.Data; 5 | 6 | namespace Gravatar.NET { 7 | public static class Extensions { 8 | internal static void Do(this IEnumerable collection, Action action) { 9 | foreach (var element in collection) 10 | action.Invoke(element); 11 | } 12 | 13 | public static GravatarParameter Get(this IEnumerable collection, string name) { 14 | return collection.FirstOrDefault(par => par.Name == name); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Gravatar.NET/Gravatar.NET.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | 9.0.30729 7 | 2.0 8 | {021C4788-F955-47C7-8360-853B7221F7BC} 9 | Library 10 | Properties 11 | Gravatar.NET 12 | Gravatar.NET 13 | v3.5 14 | 512 15 | 16 | 17 | 18 | 19 | 3.5 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | true 32 | full 33 | false 34 | bin\Debug\ 35 | DEBUG;TRACE 36 | prompt 37 | 4 38 | 39 | 40 | pdbonly 41 | true 42 | bin\Release\ 43 | TRACE 44 | prompt 45 | 4 46 | 47 | 48 | false 49 | 50 | 51 | signing-2017.snk 52 | 53 | 54 | 55 | 56 | 3.5 57 | 58 | 59 | 60 | 61 | 3.5 62 | 63 | 64 | 3.5 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 101 | -------------------------------------------------------------------------------- /Gravatar.NET/GravatarConstants.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Gravatar.NET 4 | { 5 | // ReSharper disable InconsistentNaming 6 | public class GravatarConstants 7 | { 8 | #region Error codes 9 | 10 | public const int USE_SECURE_URL = -7; 11 | public const int INTERNAL_ERROR = -8; 12 | public const int AUTHENTICATION_ERROR = -9; 13 | public const int PARAMETER_MISSING = -10; 14 | public const int PARAMETER_INCORRECT = -11; 15 | public const int MISC_ERROR = -100; 16 | public const int CLIENT_ERROR = -1000; 17 | #endregion 18 | 19 | #region Method names 20 | public const string METHOD_TEST = "grav.test"; 21 | public const string METHOD_USER_IMAGES = "grav.userimages"; 22 | public const string METHOD_EXISTS = "grav.exists"; 23 | public const string METHOD_ADDRESSES = "grav.addresses"; 24 | public const string METHOD_SAVE_DATA = "grav.saveData"; 25 | public const string METHOD_SAVE_URL = "grav.saveUrl"; 26 | public const string METHOD_USE_USER_IMAGE = "grav.useUserimage"; 27 | public const string METHOD_DELETE_USER_IMAGE = "grav.deleteUserimage"; 28 | #endregion 29 | 30 | #region XML literarls 31 | 32 | public const string XML_METHODCALL = "methodCall"; 33 | public const string XML_PARAMS = "params"; 34 | public const string XML_PARAM = "param"; 35 | public const string XML_VALUE = "value"; 36 | public const string XML_STRUCT = "struct"; 37 | public const string XML_ARRAY = "array"; 38 | public const string XML_DATA = "data"; 39 | public const string XML_NAME = "name"; 40 | public const string XML_FAULT = "fault"; 41 | public const string XML_MEMBER = "member"; 42 | public const string XML_BOOL = "bool"; 43 | public const string XML_BOOLEAN = "boolean"; 44 | public const string XML_INT = "int"; 45 | public const string XML_STRING = "string"; 46 | public const string XML_METHOD_RESPONSE = "methodResponse"; 47 | #endregion 48 | } 49 | // ReSharper restore InconsistentNaming 50 | } 51 | -------------------------------------------------------------------------------- /Gravatar.NET/GravatarResponseParser.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using Gravatar.NET.Data; 4 | using Gravatar.NET.Exceptions; 5 | 6 | namespace Gravatar.NET { 7 | /// 8 | /// Used to centerally populte the appropriate response properties of the 9 | /// instance that is returned after an API method call. 10 | /// 11 | internal class GravatarResponseParser { 12 | internal static void ParseResponseForMethod(string method, GravatarServiceResponse response) { 13 | if (response == null) return; 14 | if (response.IsError) return; 15 | 16 | switch (method) { 17 | case GravatarConstants.METHOD_TEST: 18 | SetTestMethodResponse(response); 19 | break; 20 | 21 | case GravatarConstants.METHOD_EXISTS: 22 | SetExistsMethodResponse(response); 23 | break; 24 | 25 | case GravatarConstants.METHOD_ADDRESSES: 26 | SetAddressesMethodResponse(response); 27 | break; 28 | case GravatarConstants.METHOD_USE_USER_IMAGE: 29 | SetUseUserImageMethodResponse(response); 30 | break; 31 | case GravatarConstants.METHOD_USER_IMAGES: 32 | SetUserImagesMethodResponse(response); 33 | break; 34 | case GravatarConstants.METHOD_SAVE_DATA: 35 | case GravatarConstants.METHOD_SAVE_URL: 36 | SetSaveMethodResponse(response); 37 | break; 38 | case GravatarConstants.METHOD_DELETE_USER_IMAGE: 39 | SetDeleteImageMethodResponse(response); 40 | break; 41 | default: 42 | throw new UnknownGravatarMethodException(method); 43 | } 44 | } 45 | 46 | private static void SetAddressesMethodResponse(GravatarServiceResponse response) { 47 | response.AddressesResponse = response.ResponseParameters 48 | .Select(parameter => new GravatarAddress { 49 | Name = parameter.Name, 50 | ImageId = parameter.StructValue.Parameters.Get("userimage").StringValue, 51 | Image = new GravatarUserImage { 52 | Rating = (GravatarImageRating)parameter.StructValue.Parameters.Get("rating").IntegerValue, 53 | Url = parameter.StructValue.Parameters.Get("userimage_url").StringValue 54 | } 55 | }); 56 | } 57 | 58 | private static void SetDeleteImageMethodResponse(GravatarServiceResponse response) { 59 | var responsePar = response.ResponseParameters.First(); 60 | if (responsePar.Type == GravatarParType.Bool) 61 | response.BooleanResponse = responsePar.BooleanValue; 62 | } 63 | 64 | private static void SetSaveMethodResponse(GravatarServiceResponse response) { 65 | var responsePar = response.ResponseParameters.First(); 66 | response.SaveResponse = responsePar.Type == GravatarParType.String ? new GravatarSaveResponse { Success = true, SavedImageId = responsePar.StringValue } : new GravatarSaveResponse(); 67 | } 68 | 69 | private static void SetUserImagesMethodResponse(GravatarServiceResponse response) { 70 | response.ImagesResponse = ( 71 | from par in response.ResponseParameters 72 | where par.Type == GravatarParType.Array 73 | let arrPars = par.ArrayValue 74 | let rating = int.Parse(arrPars.First().StringValue) 75 | select new GravatarUserImage { 76 | Name = par.Name, 77 | Rating = (GravatarImageRating) rating, 78 | Url = arrPars.Last().StringValue 79 | }); 80 | } 81 | 82 | private static void SetUseUserImageMethodResponse(GravatarServiceResponse response) { 83 | response.MultipleOperationResponse = ( 84 | from par in response.ResponseParameters 85 | select par.BooleanValue 86 | ).ToArray(); 87 | } 88 | 89 | private static void SetTestMethodResponse(GravatarServiceResponse response) { 90 | var responsePar = response.ResponseParameters.Last(); 91 | response.IntegerResponse = responsePar.Type == GravatarParType.Integer ? responsePar.IntegerValue : 0; 92 | } 93 | 94 | private static void SetExistsMethodResponse(GravatarServiceResponse response) { 95 | response.MultipleOperationResponse = ( 96 | from par in response.ResponseParameters 97 | select Convert.ToBoolean(par.IntegerValue) 98 | ).ToArray(); 99 | } 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /Gravatar.NET/GravatarService.Helper.cs: -------------------------------------------------------------------------------- 1 | // Gravatar.NET 2 | // Copyright (c) 2010 Yoav Niran 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining 5 | // a copy of this software and associated documentation files (the 6 | // "Software"), to deal in the Software without restriction, including 7 | // without limitation the rights to use, copy, modify, merge, publish, 8 | // distribute, sublicense, and/or sell copies of the Software, and to 9 | // permit persons to whom the Software is furnished to do so, subject to 10 | // the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be 13 | // included in all copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 19 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 20 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 21 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | using System; 24 | using System.Net; 25 | using System.Security.Cryptography; 26 | using System.Text; 27 | using System.IO; 28 | using Gravatar.NET.Exceptions; 29 | 30 | namespace Gravatar.NET 31 | { 32 | /// 33 | /// References a method to call when a Asynchronous Gravatar API method call completes 34 | /// 35 | public delegate void GravatarCallBack(GravatarServiceResponse response, object state); 36 | 37 | /// 38 | /// Represents the request state when async processing Gravatar requests 39 | /// 40 | class GravatarRequestState { 41 | public HttpWebRequest WebRequest { get; set; } 42 | public GravatarServiceRequest GravatarRequest { get; set; } 43 | public object UserState { get; set; } 44 | public GravatarCallBack CallBack { get; set; } 45 | } 46 | 47 | public sealed partial class GravatarService { 48 | private static string HashEmailAddress(string address) { 49 | try { 50 | MD5 md5 = new MD5CryptoServiceProvider(); 51 | 52 | var hasedBytes = md5.ComputeHash(Encoding.UTF8.GetBytes(address)); 53 | var sb = new StringBuilder(); 54 | 55 | for (var i = 0; i < hasedBytes.Length; i++) 56 | sb.Append(hasedBytes[i].ToString("X2")); 57 | 58 | return sb.ToString().ToLower(); 59 | } catch (Exception ex) { 60 | throw new GravatarEmailHashFailedException(address, ex); 61 | } 62 | } 63 | 64 | private GravatarServiceResponse ExecuteGravatarMethod(GravatarServiceRequest request) { 65 | var webRequest = (HttpWebRequest) WebRequest.Create(String.Format(GravatarApiUrl, HashEmailAddress(Email))); 66 | var requestData = Encoding.UTF8.GetBytes(request.ToString()); 67 | 68 | webRequest.Method = "POST"; 69 | webRequest.ContentType = "text/xml"; 70 | webRequest.ContentLength = requestData.Length; 71 | 72 | try { 73 | using (var requestStream = webRequest.GetRequestStream()) { 74 | requestStream.Write(requestData, 0, requestData.Length); 75 | requestStream.Close(); 76 | } 77 | 78 | var webResponse = (HttpWebResponse)webRequest.GetResponse(); 79 | return new GravatarServiceResponse(webResponse, request.MethodName); 80 | } catch (Exception ex) { 81 | return new GravatarServiceResponse(ex); 82 | } 83 | } 84 | 85 | private void ExecuteGravatarMethodAsync(GravatarServiceRequest request, GravatarCallBack callback, object state) { 86 | var webRequest = (HttpWebRequest) WebRequest.Create(String.Format(GravatarApiUrl, HashEmailAddress(Email))); 87 | 88 | webRequest.Method = "POST"; 89 | webRequest.ContentType = "text/xml"; 90 | 91 | webRequest.BeginGetRequestStream(OnGetRequestStream, new GravatarRequestState { 92 | WebRequest = webRequest, 93 | GravatarRequest = request, 94 | UserState = state, 95 | CallBack = callback 96 | }); 97 | } 98 | 99 | private static void OnGetRequestStream(IAsyncResult ar) { 100 | var requestState = (GravatarRequestState) ar.AsyncState; 101 | 102 | try { 103 | var data = Encoding.UTF8.GetBytes(requestState.GravatarRequest.ToString()); 104 | 105 | using (Stream requestStream = requestState.WebRequest.EndGetRequestStream(ar)) { 106 | requestStream.Write(data, 0, data.Length); 107 | requestStream.Close(); 108 | } 109 | 110 | requestState.WebRequest.BeginGetResponse(OnGetResponse, requestState); 111 | } catch (Exception ex) { 112 | requestState.CallBack(new GravatarServiceResponse(ex), requestState.UserState); 113 | } 114 | } 115 | 116 | private static void OnGetResponse(IAsyncResult ar) { 117 | var requestState = (GravatarRequestState)ar.AsyncState; 118 | 119 | try { 120 | var webResponse = (HttpWebResponse)requestState.WebRequest.EndGetResponse(ar); 121 | 122 | var gravatarResponse = new GravatarServiceResponse(webResponse, requestState.GravatarRequest.MethodName); 123 | requestState.CallBack(gravatarResponse, requestState.UserState); 124 | } 125 | catch (Exception ex) { 126 | requestState.CallBack(new GravatarServiceResponse(ex), requestState.UserState); 127 | } 128 | } 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /Gravatar.NET/GravatarService.cs: -------------------------------------------------------------------------------- 1 | // Gravatar.NET 2 | // Copyright (c) 2010 Yoav Niran 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining 5 | // a copy of this software and associated documentation files (the 6 | // "Software"), to deal in the Software without restriction, including 7 | // without limitation the rights to use, copy, modify, merge, publish, 8 | // distribute, sublicense, and/or sell copies of the Software, and to 9 | // permit persons to whom the Software is furnished to do so, subject to 10 | // the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be 13 | // included in all copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 19 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 20 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 21 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | using System; 24 | using System.Collections.Generic; 25 | using System.Linq; 26 | using System.Net; 27 | using System.Web; 28 | using System.Text; 29 | using Gravatar.NET.Data; 30 | using Gravatar.NET.Exceptions; 31 | 32 | namespace Gravatar.NET 33 | { 34 | /// 35 | /// The GravatarService class wraps around the raw xml-rpc API of Gravatar.com 36 | /// to give .NET clients easy and structured way of using the API to manage, upload and remove 37 | /// images for a Gravatar Account 38 | /// 39 | public sealed partial class GravatarService 40 | { 41 | #region Private Members 42 | private const string GravatarApiUrl = "https://secure.gravatar.com/xmlrpc?user={0}"; 43 | 44 | private const string ParPassword = "password"; 45 | private const string ParHashes = "hashes"; 46 | private const string ParData = "data"; 47 | private const string ParRating = "rating"; 48 | private const string ParUrl = "url"; 49 | private const string ParUserImage = "userimage"; 50 | private const string ParAddresses = "addresses"; 51 | 52 | private const string UrlParSize = "s={0}&"; 53 | private const string UrlParRating = "r={0}&"; 54 | private const string UrlParDefault = "d={0}"; 55 | private const string UrlPar404 = "404"; 56 | #endregion 57 | 58 | #region Properties 59 | public const string GravatarImageUrlBase = "http://www.gravatar.com/avatar/"; 60 | public const string GravatarProfileUrlBase = "http://www.gravatar.com"; 61 | 62 | public string Email { get; private set; } 63 | public string Password { get; private set; } 64 | public string ApiKey { get; private set; } 65 | #endregion 66 | 67 | public GravatarService(string email, string password) { 68 | Email = email; 69 | Password = password; 70 | } 71 | 72 | public GravatarService(string apiKey) { 73 | ApiKey = apiKey; 74 | } 75 | 76 | 77 | 78 | #region Gravatar API Methods 79 | 80 | /// 81 | /// A test function 82 | /// 83 | /// If the method call is successful, the result will be returned using the IntegerResponse property of the 84 | /// instance returned by this method. 85 | /// 86 | public GravatarServiceResponse Test() { 87 | var request = GetTestMethodRequest(); 88 | var response = ExecuteGravatarMethod(request); 89 | return response; 90 | } 91 | 92 | /// 93 | /// Check whether a hash has a gravatar 94 | /// 95 | /// If the method call is successful, the result will be returned using the MultipleOperationResponse property 96 | /// of the instance returned by this method 97 | /// an array of hashes to check 98 | /// Whether the supplied addresses are already hashed 99 | public GravatarServiceResponse Exists(string[] addresses, bool alreadyHashed=false) { 100 | var request = GetExistsMethodRequest(addresses, alreadyHashed); 101 | var response = ExecuteGravatarMethod(request); 102 | return response; 103 | } 104 | 105 | /// 106 | /// Get a list of addresses for this account 107 | /// 108 | /// If the method call is successful, the result will be returned using the AddressesResponse property of the 109 | /// instance returned by this method 110 | public GravatarServiceResponse Addresses() { 111 | var request = GetAddressesMethodRequest(); 112 | var response = ExecuteGravatarMethod(request); 113 | return response; 114 | } 115 | 116 | /// 117 | /// Return an array of userimages for this account 118 | /// 119 | /// If the method call is successful, the result will be returned using the ImagesResponse property of the 120 | /// instance returned by this method 121 | public GravatarServiceResponse UserImages() { 122 | var request = GetUserImagesMethodRequest(); 123 | var response = ExecuteGravatarMethod(request); 124 | return response; 125 | } 126 | 127 | /// 128 | /// Save binary image data as a userimage for this account 129 | /// 130 | /// The image data in bytes 131 | /// The rating of the image (g, pg, r, x) 132 | /// If the method call is successful, the result will be returned using the SaveResponse property of the 133 | /// instance returned by this method 134 | public GravatarServiceResponse SaveData(byte[] data, GravatarImageRating rating) { 135 | var request = GetSaveDataMethodRequest(data, rating); 136 | var response = ExecuteGravatarMethod(request); 137 | return response; 138 | } 139 | 140 | /// 141 | /// Read an image via its URL and save that as a userimage for this account 142 | /// 143 | /// a full url to an image 144 | /// The rating of the image (g, pg, r, x) 145 | /// If the method call is successful, the result will be returned using the SaveResponse property of the 146 | /// instance returned by this method 147 | public GravatarServiceResponse SaveUrl(string url, GravatarImageRating rating) { 148 | var request = GetSaveUrlMethodRequest(url, rating); 149 | var response = ExecuteGravatarMethod(request); 150 | return response; 151 | } 152 | 153 | /// 154 | /// Use a userimage as a gravatar for one of more addresses on this account 155 | /// 156 | /// The userimage you wish to use 157 | /// A list of the email addresses you wish to use this userimage for 158 | /// If the method call is successful, the result will be returned using the MultipleOperationResponse property 159 | /// of the instance returned by this method 160 | public GravatarServiceResponse UseUserImage(string userImage, string[] addresses) { 161 | var request = GetUseUserImagesMethodRequest(userImage, addresses); 162 | var response = ExecuteGravatarMethod(request); 163 | return response; 164 | } 165 | 166 | /// 167 | /// Remove a userimage from the account and any email addresses with which it is associated 168 | /// 169 | /// The user image you wish to remove from the account 170 | /// If the method call is successful, the result will be returned using the BooleanResponse property of the 171 | /// instance returned by this method 172 | public GravatarServiceResponse DeleteUserImage(string userImage) { 173 | var request = GetDeleteImageMethodRequest(userImage); 174 | var response = ExecuteGravatarMethod(request); 175 | return response; 176 | } 177 | #endregion 178 | 179 | #region Gravatar Async API Methods 180 | /// 181 | /// A test function - called asynchronously 182 | /// 183 | /// The callback activated when action finishes 184 | /// Custom parameter to callback 185 | /// If the method call is successful, the result will be returned using the IntegerResponse property of the 186 | /// instance returned by this method. 187 | /// The response is returned to the callback method 188 | /// 189 | public void TestAsync(GravatarCallBack callback, object state) { 190 | var request = GetTestMethodRequest(); 191 | ExecuteGravatarMethodAsync(request, callback, state); 192 | } 193 | 194 | /// 195 | /// Check whether a hash has a gravatar - called asynchronously 196 | /// 197 | /// an array of hashes to check 198 | /// The callback activated when action finishes 199 | /// Custom parameter to callback 200 | /// If the method call is successful, the result will be returned using the MultipleOperationResponse property 201 | /// of the instance returned by this method 202 | /// The response is returned to the callback method 203 | public void ExistsAsync(string[] addresses, GravatarCallBack callback, object state) { 204 | var request = GetExistsMethodRequest(addresses); 205 | ExecuteGravatarMethodAsync(request, callback, state); 206 | } 207 | 208 | /// 209 | /// Get a list of addresses for this account - called asynchronously 210 | /// 211 | /// The callback activated when action finishes 212 | /// Custom parameter to callback 213 | /// If the method call is successful, the result will be returned using the AddressesResponse property of the 214 | /// instance returned by this method 215 | /// The response is returned to the callback method 216 | public void AddressesAsync(GravatarCallBack callback, object state) { 217 | var request = GetAddressesMethodRequest(); 218 | ExecuteGravatarMethodAsync(request, callback, state); 219 | } 220 | 221 | /// 222 | /// Return an array of userimages for this account - called asynchronously 223 | /// 224 | /// The callback activated when action finishes 225 | /// Custom parameter to callback 226 | /// If the method call is successful, the result will be returned using the ImagesResponse property of the 227 | /// instance returned by this method 228 | /// The response is returned to the callback method 229 | public void UserImagesAsync(GravatarCallBack callback, object state) { 230 | var request = GetUserImagesMethodRequest(); 231 | ExecuteGravatarMethodAsync(request, callback, state); 232 | } 233 | 234 | /// 235 | /// Save binary image data as a userimage for this account - called asynchronously 236 | /// 237 | /// The image data in bytes 238 | /// The rating of the image (g, pg, r, x) 239 | /// The callback activated when action finishes 240 | /// Custom parameter to callback 241 | /// If the method call is successful, the result will be returned using the SaveResponse property of the 242 | /// instance returned by this method 243 | /// The response is returned to the callback method 244 | public void SaveDataAsync(byte[] data, GravatarImageRating rating, GravatarCallBack callback, object state) { 245 | var request = GetSaveDataMethodRequest(data, rating); 246 | ExecuteGravatarMethodAsync(request, callback, state); 247 | } 248 | 249 | /// 250 | /// Read an image via its URL and save that as a userimage for this account - called asynchronously 251 | /// 252 | /// a full url to an image 253 | /// The rating of the image (g, pg, r, x) 254 | /// The callback activated when action finishes 255 | /// Custom parameter to callback 256 | /// If the method call is successful, the result will be returned using the SaveResponse property of the 257 | /// instance returned by this method 258 | /// The response is returned to the callback method 259 | public void SaveUrlAsync(string url, GravatarImageRating rating, GravatarCallBack callback, object state) { 260 | var request = GetSaveUrlMethodRequest(url, rating); 261 | ExecuteGravatarMethodAsync(request, callback, state); 262 | } 263 | 264 | /// 265 | /// Use a userimage as a gravatar for one of more addresses on this account - called asynchronously 266 | /// 267 | /// The userimage you wish to use 268 | /// A list of the email addresses you wish to use this userimage for 269 | /// The callback activated when action finishes 270 | /// Custom parameter to callback 271 | /// If the method call is successful, the result will be returned using the MultipleOperationResponse property 272 | /// of the instance returned by this method 273 | /// The response is returned to the callback method 274 | public void UseUserImageAsync(string userImage, string[] addresses, GravatarCallBack callback, object state) { 275 | var request = GetUseUserImagesMethodRequest(userImage, addresses); 276 | ExecuteGravatarMethodAsync(request, callback, state); 277 | } 278 | 279 | /// 280 | /// Remove a userimage from the account and any email addresses with which it is associated - called asynchronously 281 | /// 282 | /// The user image you wish to remove from the account 283 | /// The callback activated when action finishes 284 | /// Custom parameter to callback 285 | /// If the method call is successful, the result will be returned using the BooleanResponse property of the 286 | /// instance returned by this method 287 | /// The response is returned to the callback method 288 | public void DeleteUserImageAsync(string userImage, GravatarCallBack callback, object state) { 289 | var request = GetDeleteImageMethodRequest(userImage); 290 | ExecuteGravatarMethodAsync(request, callback, state); 291 | } 292 | #endregion 293 | 294 | #region Get Gravatar Photo URL 295 | 296 | /// 297 | /// Gets the currently active Gravatar image URL for the email address used to instantiate the service with 298 | /// Throws a if the provided email address is invalid 299 | /// 300 | /// The Gravatar image URL 301 | public string GetGravatarUrl() { 302 | return GetGravatarUrlForAddress(Email); 303 | } 304 | 305 | /// 306 | /// Gets the currently active Gravatar image URL for the email address used to instantiate the service with 307 | /// Throws a if the provided email address is invalid 308 | /// 309 | /// The available parameters passed by the request to Gravatar when retrieving the image 310 | /// The Gravatar image URL 311 | public string GetGravatarUrl(GravatarUrlParameters pars) { 312 | return GetGravatarUrlForAddress(Email, pars); 313 | } 314 | 315 | /// 316 | /// Gets the currently active Gravatar image URL for the email address supplied to this method call 317 | /// Throws a if the provided email address is invalid 318 | /// 319 | /// The address to retireve the image for 320 | /// Whether the supplied address is already hashed 321 | /// The Gravatar image URL 322 | public static string GetGravatarUrlForAddress(string address, bool alreadyHashed = false) { 323 | return GetGravatarUrlForAddress(address, null, alreadyHashed); 324 | } 325 | 326 | /// 327 | /// Gets the currently active Gravatar image URL for the email address supplied to this method call 328 | /// Throws a if the provided email address is invalid 329 | /// 330 | /// The address to retireve the image for 331 | /// /// The available parameters passed by the request to Gravatar when retrieving the image 332 | /// Whether the supplied address is already hashed 333 | /// The Gravatar image URL 334 | public static string GetGravatarUrlForAddress(string address, GravatarUrlParameters pars, bool alreadyHashed = false) { 335 | var sbResult = new StringBuilder(GravatarImageUrlBase); 336 | sbResult.Append(alreadyHashed ? address : HashEmailAddress(address)); 337 | 338 | if (pars != null) { 339 | sbResult.Append("?"); 340 | 341 | if (pars.Size > 0) sbResult.AppendFormat(UrlParSize, pars.Size); 342 | if (pars.Rating != GravatarImageRating.G) sbResult.AppendFormat(UrlParRating, pars.Rating.ToString().ToLower()); 343 | 344 | if (pars.DefaultOption != GravatarDefaultUrlOptions.None) { 345 | if (pars.DefaultOption == GravatarDefaultUrlOptions.Custom) { 346 | sbResult.AppendFormat(UrlParDefault, HttpUtility.UrlEncode(pars.CustomDefaultUrl)); 347 | } else { 348 | sbResult.AppendFormat(UrlParDefault, (pars.DefaultOption == GravatarDefaultUrlOptions.Error ? UrlPar404 : pars.DefaultOption.ToString().ToLower() )); 349 | } 350 | } 351 | } 352 | 353 | return sbResult.ToString(); 354 | } 355 | 356 | #endregion 357 | 358 | #region Get Gravatar Profile 359 | /// 360 | /// Gets the Gravatar profile for the email address used to instantiate the service with 361 | /// Throws a if the provided email address is invalid 362 | /// 363 | /// The Gravatar profile 364 | public GravatarProfile GetGravatarProfile() { 365 | return GetGravatarProfile(Email); 366 | } 367 | 368 | /// 369 | /// Gets the Gravatar profile for the email address supplied to this method call 370 | /// Throws a if the provided email address is invalid 371 | /// 372 | /// The address to retireve the prpfile for 373 | /// Whether the supplied address is already hashed 374 | /// The Gravatar profile 375 | public static GravatarProfile GetGravatarProfile(string address, bool alreadyHashed=false) { 376 | try { 377 | var profileUrl = String.Format("{0}/{1}.xml", GravatarProfileUrlBase, alreadyHashed ? address : HashEmailAddress(address)); 378 | 379 | var webRequest = (HttpWebRequest)WebRequest.Create(profileUrl); 380 | webRequest.ContentType = "text/xml"; 381 | var webResponse = webRequest.GetResponse(); 382 | 383 | return new GravatarProfile(webResponse); 384 | } 385 | catch (WebException) { 386 | return null; 387 | } 388 | } 389 | 390 | #endregion 391 | 392 | #region Create Methods Requests 393 | private GravatarServiceRequest GetExistsMethodRequest(IEnumerable addresses, bool alreadyHashed = false) { 394 | return new GravatarServiceRequest { 395 | Email = Email, 396 | MethodName = GravatarConstants.METHOD_EXISTS, 397 | Parameters = new List { 398 | GravatarParameter.NewArrayParameter(ParHashes, addresses.Select(adr => GravatarParameter.NewStringParamter(String.Empty, alreadyHashed ? adr : HashEmailAddress(adr)))), 399 | GravatarParameter.NewStringParamter(ParPassword, Password) 400 | } 401 | }; 402 | } 403 | 404 | private GravatarServiceRequest GetTestMethodRequest() { 405 | return new GravatarServiceRequest { 406 | Email = Email, 407 | MethodName = GravatarConstants.METHOD_TEST, 408 | Parameters = new List { 409 | GravatarParameter.NewStringParamter(ParPassword, Password) 410 | } 411 | }; 412 | } 413 | 414 | private GravatarServiceRequest GetAddressesMethodRequest() { 415 | return new GravatarServiceRequest { 416 | Email = Email, 417 | MethodName = GravatarConstants.METHOD_ADDRESSES, 418 | Parameters = new List { 419 | GravatarParameter.NewStringParamter(ParPassword, Password) 420 | } 421 | }; 422 | } 423 | 424 | private GravatarServiceRequest GetUserImagesMethodRequest() { 425 | return new GravatarServiceRequest { 426 | Email = Email, 427 | MethodName = GravatarConstants.METHOD_USER_IMAGES, 428 | Parameters = new List { 429 | GravatarParameter.NewStringParamter(ParPassword, Password) 430 | } 431 | }; 432 | } 433 | 434 | private GravatarServiceRequest GetSaveDataMethodRequest(byte[] data, GravatarImageRating rating) { 435 | return new GravatarServiceRequest { 436 | Email = Email, 437 | MethodName = GravatarConstants.METHOD_SAVE_DATA, 438 | Parameters = new List { 439 | GravatarParameter.NewStringParamter(ParData, Convert.ToBase64String(data)), 440 | GravatarParameter.NewIntegerParameter(ParRating, (int)rating), 441 | GravatarParameter.NewStringParamter(ParPassword, Password) 442 | } 443 | }; 444 | } 445 | 446 | private GravatarServiceRequest GetSaveUrlMethodRequest(string url, GravatarImageRating rating) { 447 | return new GravatarServiceRequest { 448 | Email = Email, 449 | MethodName = GravatarConstants.METHOD_SAVE_URL, 450 | Parameters = new List { 451 | GravatarParameter.NewStringParamter(ParUrl, url), 452 | GravatarParameter.NewIntegerParameter(ParRating, (int)rating), 453 | GravatarParameter.NewStringParamter(ParPassword ,Password) 454 | } 455 | }; 456 | } 457 | 458 | private GravatarServiceRequest GetUseUserImagesMethodRequest(string userImage, IEnumerable addresses) { 459 | return new GravatarServiceRequest { 460 | Email = Email, 461 | MethodName = GravatarConstants.METHOD_USE_USER_IMAGE, 462 | Parameters = new List { 463 | GravatarParameter.NewStringParamter(ParUserImage, userImage), 464 | GravatarParameter.NewArrayParameter(ParAddresses, addresses.Select(adr => GravatarParameter.NewStringParamter(String.Empty, adr))), 465 | GravatarParameter.NewStringParamter(ParPassword, Password) 466 | } 467 | }; 468 | } 469 | 470 | private GravatarServiceRequest GetDeleteImageMethodRequest(string userImage) { 471 | return new GravatarServiceRequest { 472 | Email = Email, 473 | MethodName = GravatarConstants.METHOD_DELETE_USER_IMAGE, 474 | Parameters = new List { 475 | GravatarParameter.NewStringParamter(ParUserImage, userImage), 476 | GravatarParameter.NewStringParamter(ParPassword, Password) 477 | } 478 | }; 479 | } 480 | 481 | #endregion 482 | } 483 | } 484 | -------------------------------------------------------------------------------- /Gravatar.NET/GravatarServiceRequest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Text; 5 | using System.Xml; 6 | using Gravatar.NET.Data; 7 | 8 | namespace Gravatar.NET 9 | { 10 | /// 11 | /// Represents a single request to the Gravatar server, encapsulating a Gravatar method 12 | /// 13 | public class GravatarServiceRequest 14 | { 15 | #region Properties 16 | public string Email { get; internal set; } 17 | 18 | /// 19 | /// The Gravatar method called in the context of this request 20 | /// 21 | public string MethodName { get; internal set; } 22 | 23 | /// 24 | /// The list of parameters sent to Gravatar in this method call 25 | /// 26 | public List Parameters { get; internal set;} 27 | #endregion 28 | 29 | internal GravatarServiceRequest() { 30 | } 31 | 32 | private string CreateGravatarRequestXml() { 33 | var sb = new StringBuilder(); 34 | 35 | using (var sw = new StringWriter(sb)) { 36 | using (var xw = new XmlTextWriter(sw)) { 37 | xw.WriteProcessingInstruction("xml", "version='1.0'"); 38 | 39 | xw.WriteStartElement(GravatarConstants.XML_METHODCALL); 40 | xw.WriteElementString("methodName", MethodName); 41 | 42 | xw.WriteStartElement(GravatarConstants.XML_PARAMS); 43 | xw.WriteStartElement(GravatarConstants.XML_PARAM); 44 | xw.WriteStartElement(GravatarConstants.XML_VALUE); 45 | xw.WriteStartElement(GravatarConstants.XML_STRUCT); 46 | 47 | foreach (var p in Parameters) 48 | WriteGravatarRequestParam(xw, p); 49 | 50 | xw.WriteEndElement(); // struct 51 | xw.WriteEndElement(); // value 52 | xw.WriteEndElement(); // param 53 | xw.WriteEndElement(); // params 54 | xw.WriteEndElement(); // methodCall 55 | } 56 | } 57 | 58 | return sb.ToString(); 59 | } 60 | 61 | private static void WriteGravatarRequestParam(XmlTextWriter writer, GravatarParameter par) { 62 | writer.WriteStartElement(GravatarConstants.XML_MEMBER); 63 | writer.WriteElementString(GravatarConstants.XML_NAME, par.Name); 64 | 65 | if (par.Type == GravatarParType.Array) { 66 | writer.WriteStartElement(GravatarConstants.XML_VALUE); 67 | writer.WriteStartElement(GravatarConstants.XML_ARRAY); 68 | writer.WriteStartElement(GravatarConstants.XML_DATA); 69 | 70 | foreach (var arrPar in par.ArrayValue) { 71 | writer.WriteStartElement(GravatarConstants.XML_VALUE); 72 | 73 | switch (arrPar.Type) { 74 | case GravatarParType.Bool: 75 | writer.WriteElementString(GravatarConstants.XML_BOOL, arrPar.StringValue); 76 | break; 77 | case GravatarParType.Integer: 78 | writer.WriteElementString(GravatarConstants.XML_INT, arrPar.StringValue); 79 | break; 80 | default: 81 | writer.WriteElementString(GravatarConstants.XML_STRING, arrPar.StringValue); 82 | break; 83 | } 84 | 85 | writer.WriteEndElement(); //value 86 | } 87 | 88 | writer.WriteEndElement(); //data 89 | writer.WriteEndElement(); //array 90 | writer.WriteEndElement(); //value 91 | } 92 | else 93 | { 94 | writer.WriteElementString(GravatarConstants.XML_VALUE, par.StringValue); 95 | } 96 | 97 | writer.WriteEndElement(); //member 98 | } 99 | 100 | /// 101 | /// returns the XML structure for the method call 102 | /// 103 | public override string ToString() 104 | { 105 | return CreateGravatarRequestXml(); 106 | } 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /Gravatar.NET/GravatarServiceResponse.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Net; 6 | using System.Xml.Linq; 7 | using Gravatar.NET.Data; 8 | using Gravatar.NET.Exceptions; 9 | 10 | namespace Gravatar.NET 11 | { 12 | /// 13 | /// Represents the response returned from Gravatar after a request has been made. 14 | /// The object has different properties representing the different types of results which can 15 | /// be returned by a method call. 16 | /// 17 | public class GravatarServiceResponse 18 | { 19 | /// 20 | /// Create a new Gravatar response for the method that was called. 21 | /// Throws a GravatarInvalidResponseXmlException 22 | /// if the XML returned from Gravatar is in an unexpected format 23 | /// 24 | internal GravatarServiceResponse(WebResponse webResponse, string methodName) { 25 | using (var responseStream = webResponse.GetResponseStream()) 26 | if (responseStream != null) 27 | using (var reader = new StreamReader(responseStream)) 28 | InitializeGravatarResponse(reader.ReadToEnd(), methodName); 29 | } 30 | 31 | /// 32 | /// Create a new Gravatar response with the exception information that occurred 33 | /// while making a request 34 | /// 35 | /// 36 | internal GravatarServiceResponse(Exception ex) { 37 | IsError = true; 38 | ErrorCode = GravatarConstants.CLIENT_ERROR; 39 | ErrorInfo = ex.Message; 40 | } 41 | 42 | #region Error Info 43 | /// 44 | /// Indication whether the method call resulted in an Error or not 45 | /// 46 | public bool IsError { get; private set; } 47 | 48 | /// 49 | /// The Gravatar error code 50 | /// 51 | public int ErrorCode { get; private set; } 52 | 53 | /// 54 | /// Additional information about the Gravatar error 55 | /// 56 | public string ErrorInfo { get; private set; } 57 | #endregion 58 | 59 | #region Properties 60 | /// 61 | /// The raw XML returned from Gravatar as a result of a method call 62 | /// 63 | public string GravatarResponseXml { get; private set; } 64 | 65 | /// 66 | /// The list of all parameters returned from the method call 67 | /// 68 | public IEnumerable ResponseParameters { get; private set; } 69 | #endregion 70 | 71 | #region Method Responses 72 | /// 73 | /// Used when the result of a method call is of an integer type 74 | /// 75 | public int IntegerResponse { get; internal set; } 76 | 77 | /// 78 | /// Used when the result of a method call is of a Boolean type 79 | /// 80 | public bool BooleanResponse { get; internal set; } 81 | 82 | /// 83 | /// Used when the result of a method call is a list of user images 84 | /// 85 | public IEnumerable ImagesResponse { get; internal set; } 86 | 87 | /// 88 | /// Used when the result of a method is a Boolean indication for multiple operations such as updating a list 89 | /// of email addresses with an image 90 | /// 91 | public bool[] MultipleOperationResponse { get; internal set; } 92 | 93 | /// 94 | /// Used when the result of a method call is a list of email addresses 95 | /// 96 | public IEnumerable AddressesResponse { get; internal set; } 97 | 98 | /// 99 | /// Used when the operation is an image save operation 100 | /// 101 | public GravatarSaveResponse SaveResponse { get; internal set; } 102 | #endregion 103 | 104 | #region Helper Methods 105 | private void InitializeGravatarResponse(string response, string methodName) { 106 | GravatarResponseXml = response; 107 | 108 | try { 109 | var responseXmlDoc = XDocument.Parse(response); 110 | 111 | var rspElement = responseXmlDoc.Element(GravatarConstants.XML_METHOD_RESPONSE); 112 | if (rspElement == null) throw new GravatarInvalidResponseXmlException(); 113 | 114 | XElement firstStruct = (from s in responseXmlDoc.Descendants(GravatarConstants.XML_STRUCT) select s).FirstOrDefault(); 115 | var pars = firstStruct != null ? GetGravatarXmlMembers(firstStruct) : GetGravatarXmlParameters(responseXmlDoc); 116 | 117 | if (rspElement.Element(GravatarConstants.XML_FAULT) == null) { 118 | //request was accepted, no error sent back 119 | ResponseParameters = pars; 120 | } else { 121 | IsError = true; 122 | ErrorCode = pars.First().IntegerValue; 123 | ErrorInfo = pars.Last().StringValue; 124 | } 125 | 126 | // set the proper response based on the method that was called 127 | GravatarResponseParser.ParseResponseForMethod(methodName, this); 128 | } catch (Exception) { 129 | throw new GravatarInvalidResponseXmlException(); 130 | } 131 | } 132 | 133 | private IEnumerable GetGravatarXmlParameters(XContainer responseDoc) { 134 | return from par in responseDoc.Descendants(GravatarConstants.XML_PARAM) select GetParameterFromXml(par); 135 | } 136 | 137 | private IEnumerable GetGravatarXmlMembers(XContainer structElement) { 138 | return from member in structElement.Elements(GravatarConstants.XML_MEMBER) select GetParameterFromXml(member); 139 | } 140 | 141 | private GravatarParameter GetParameterFromXml(XContainer memberXml) { 142 | var par = new GravatarParameter(); 143 | 144 | // set name 145 | var nameElm = memberXml.Element(GravatarConstants.XML_NAME); 146 | if (nameElm != null) 147 | par.Name = nameElm.Value; 148 | 149 | // set value 150 | var valType = memberXml.Element(GravatarConstants.XML_VALUE).Elements().First(); 151 | if (valType.Name == GravatarConstants.XML_STRUCT) { 152 | par.Type = GravatarParType.Struct; 153 | par.StructValue = new GravatarStruct { Parameters = GetGravatarXmlMembers(valType) }; 154 | } else if (valType.Name == GravatarConstants.XML_ARRAY) { 155 | par.Type = GravatarParType.Array; 156 | par.ArrayValue = from value in valType.Descendants(GravatarConstants.XML_VALUE) select GetParameterFromXml(value); 157 | } else if (valType.Name == GravatarConstants.XML_INT) { 158 | par.Type = GravatarParType.Integer; 159 | par.IntegerValue = int.Parse(valType.Value); 160 | } else if (valType.Name == GravatarConstants.XML_STRING) { 161 | par.Type = GravatarParType.String; 162 | par.StringValue = valType.Value; 163 | } else if (valType.Name == GravatarConstants.XML_BOOL || valType.Name == GravatarConstants.XML_BOOLEAN) { 164 | par.Type = GravatarParType.Bool; 165 | 166 | if (valType.Value == "1") 167 | par.BooleanValue = true; 168 | else if (valType.Value == "0") 169 | par.BooleanValue = false; 170 | else 171 | par.BooleanValue = bool.Parse(valType.Value); 172 | } 173 | 174 | return par; 175 | } 176 | #endregion 177 | } 178 | } 179 | -------------------------------------------------------------------------------- /Gravatar.NET/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Gravatar.NET")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Gravatar.NET")] 13 | [assembly: AssemblyCopyright("Copyright © Yoav Niran")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("896ec635-51f7-4bc8-8ac0-aab606fae11e")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("0.4.0.1")] 36 | [assembly: AssemblyFileVersion("0.4.0.1")] 37 | -------------------------------------------------------------------------------- /GravatarOSC.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.26730.16 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GravatarOSC", "GravatarOSC\GravatarOSC.csproj", "{0C26688F-4A67-4DB5-843B-7D779D4B1DED}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gravatar.NET", "Gravatar.NET\Gravatar.NET.csproj", "{021C4788-F955-47C7-8360-853B7221F7BC}" 9 | EndProject 10 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{5D880F0E-8437-4CB4-A715-34A022ABEC15}" 11 | ProjectSection(SolutionItems) = preProject 12 | Readme.md = Readme.md 13 | EndProjectSection 14 | EndProject 15 | Global 16 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 17 | Debug|Any CPU = Debug|Any CPU 18 | Debug|Mixed Platforms = Debug|Mixed Platforms 19 | Debug|x64 = Debug|x64 20 | Release|Any CPU = Release|Any CPU 21 | Release|Mixed Platforms = Release|Mixed Platforms 22 | Release|x64 = Release|x64 23 | EndGlobalSection 24 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 25 | {0C26688F-4A67-4DB5-843B-7D779D4B1DED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 26 | {0C26688F-4A67-4DB5-843B-7D779D4B1DED}.Debug|Any CPU.Build.0 = Debug|Any CPU 27 | {0C26688F-4A67-4DB5-843B-7D779D4B1DED}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU 28 | {0C26688F-4A67-4DB5-843B-7D779D4B1DED}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU 29 | {0C26688F-4A67-4DB5-843B-7D779D4B1DED}.Debug|x64.ActiveCfg = Debug|Any CPU 30 | {0C26688F-4A67-4DB5-843B-7D779D4B1DED}.Release|Any CPU.ActiveCfg = Release|Any CPU 31 | {0C26688F-4A67-4DB5-843B-7D779D4B1DED}.Release|Any CPU.Build.0 = Release|Any CPU 32 | {0C26688F-4A67-4DB5-843B-7D779D4B1DED}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU 33 | {0C26688F-4A67-4DB5-843B-7D779D4B1DED}.Release|Mixed Platforms.Build.0 = Release|Any CPU 34 | {0C26688F-4A67-4DB5-843B-7D779D4B1DED}.Release|x64.ActiveCfg = Release|Any CPU 35 | {021C4788-F955-47C7-8360-853B7221F7BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 36 | {021C4788-F955-47C7-8360-853B7221F7BC}.Debug|Any CPU.Build.0 = Debug|Any CPU 37 | {021C4788-F955-47C7-8360-853B7221F7BC}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU 38 | {021C4788-F955-47C7-8360-853B7221F7BC}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU 39 | {021C4788-F955-47C7-8360-853B7221F7BC}.Debug|x64.ActiveCfg = Debug|Any CPU 40 | {021C4788-F955-47C7-8360-853B7221F7BC}.Release|Any CPU.ActiveCfg = Release|Any CPU 41 | {021C4788-F955-47C7-8360-853B7221F7BC}.Release|Any CPU.Build.0 = Release|Any CPU 42 | {021C4788-F955-47C7-8360-853B7221F7BC}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU 43 | {021C4788-F955-47C7-8360-853B7221F7BC}.Release|Mixed Platforms.Build.0 = Release|Any CPU 44 | {021C4788-F955-47C7-8360-853B7221F7BC}.Release|x64.ActiveCfg = Release|Any CPU 45 | EndGlobalSection 46 | GlobalSection(SolutionProperties) = preSolution 47 | HideSolutionNode = FALSE 48 | EndGlobalSection 49 | GlobalSection(ExtensibilityGlobals) = postSolution 50 | SolutionGuid = {A5E8DBCD-81C3-43D9-8EF6-92D9130144D3} 51 | EndGlobalSection 52 | EndGlobal 53 | -------------------------------------------------------------------------------- /GravatarOSC/.gitignore: -------------------------------------------------------------------------------- 1 | /*.csproj.user 2 | /obj/ 3 | /bin/ 4 | -------------------------------------------------------------------------------- /GravatarOSC/GravatarOSC.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | 9.0.30729 7 | 2.0 8 | {0C26688F-4A67-4DB5-843B-7D779D4B1DED} 9 | Library 10 | Properties 11 | GravatarOSC 12 | GravatarOSC 13 | v3.5 14 | 512 15 | 16 | 17 | 18 | 19 | 20 | 21 | 3.5 22 | 23 | 24 | true 25 | full 26 | false 27 | bin\Debug\ 28 | DEBUG;TRACE 29 | prompt 30 | 4 31 | true 32 | AllRules.ruleset 33 | 34 | 35 | pdbonly 36 | true 37 | bin\Release\ 38 | TRACE 39 | prompt 40 | 4 41 | true 42 | AllRules.ruleset 43 | 44 | 45 | 46 | Resources\OutlookSocialProvider.dll 47 | True 48 | 49 | 50 | 51 | 3.5 52 | 53 | 54 | 55 | 56 | 3.5 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | True 70 | True 71 | Resources.resx 72 | 73 | 74 | 75 | 76 | 77 | Designer 78 | 79 | 80 | Designer 81 | 82 | 83 | 84 | 85 | ResXFileCodeGenerator 86 | Resources.Designer.cs 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | {021C4788-F955-47C7-8360-853B7221F7BC} 96 | Gravatar.NET 97 | 98 | 99 | 100 | 107 | -------------------------------------------------------------------------------- /GravatarOSC/HelperMethods.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.Drawing; 4 | using System.Xml.Serialization; 5 | using System.IO; 6 | 7 | namespace GravatarOSC 8 | { 9 | class HelperMethods 10 | { 11 | //OSC Errors 12 | // ReSharper disable InconsistentNaming 13 | public const int OSC_E_FAIL = unchecked((int)0x80004005); // General failure error 14 | public const int OSC_E_INTERNAL_ERROR = unchecked((int)0x80041400); // An internal error has occurred due to an invalid operation 15 | public const int OSC_E_INVALIDARG = unchecked((int)0x80070057); // Invalid argument error 16 | public const int OSC_E_AUTH_ERROR = unchecked((int)0x80041404); // Authentication has failed on the network of the social network 17 | public const int OSC_E_NO_CHANGES = unchecked((int)0x80041406); // No changes have occurred since the last synchronization 18 | public const int OSC_E_COULDNOTCONNECT = unchecked((int)0x80041402); // No connection is available to connect to the social network 19 | public const int OSC_E_NOT_FOUND = unchecked((int)0x80041405); // A resource cannot be found 20 | public const int OSC_E_NOT_IMPLEMENTED = unchecked((int)0x80004001); // Not yet implemented 21 | public const int OSC_E_OUT_OF_MEMORY = unchecked((int)0x8007000E); // Out of memory error 22 | public const int OSC_E_PERMISSION_DENIED = unchecked((int)0x80041403); // Permission for the resource is denied by the OSC provider 23 | public const int OSC_E_VERSION = unchecked((int)0x80041401); // The provider does not support this version of OSC provider extensibility 24 | // ReSharper restore InconsistentNaming 25 | 26 | public static string SerializeObjectToString(object o) 27 | { 28 | var writer = new StringWriter(); 29 | var serializer = new XmlSerializer(o.GetType()); 30 | serializer.Serialize(writer, o); 31 | 32 | return writer.ToString(); 33 | } 34 | 35 | public static T DeserializeStringToObject(String s) { 36 | var serializer = new XmlSerializer(typeof(T)); 37 | return (T) serializer.Deserialize(new StringReader("\n" + s)); 38 | } 39 | 40 | public static int GetTrueIndex(bool[] array) { 41 | if (array == null) { 42 | Debug.WriteLine("HelperMethods:GetTrueIndex: got empty array"); 43 | return -1; 44 | } 45 | 46 | for (var i = 0; i < array.Length; i++) 47 | if (array[i]) 48 | return i; 49 | 50 | return -1; 51 | } 52 | 53 | public static byte[] GetProviderJpeg() { 54 | var ic = new ImageConverter(); 55 | var b = Properties.Resources.Logo; 56 | return (byte[])ic.ConvertTo(b, typeof(byte[])); 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /GravatarOSC/OSCPerson.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using OutlookSocialProvider; 4 | 5 | namespace GravatarOSC 6 | { 7 | class OSCPerson : ISocialPerson 8 | { 9 | public string GetActivities(DateTime startTime) { 10 | Debug.WriteLine("OSCPerson::GetActivities called"); 11 | 12 | return string.Empty; 13 | } 14 | 15 | public string GetDetails() { 16 | Debug.WriteLine("OSCPerson::GetDetails called"); 17 | 18 | return string.Empty; 19 | } 20 | 21 | public string GetFriendsAndColleagues() { 22 | Debug.WriteLine("OSCPerson::GetFriendsAndColleagues called"); 23 | 24 | return string.Empty; 25 | } 26 | 27 | public string[] GetFriendsAndColleaguesIDs() { 28 | Debug.WriteLine("OSCPerson::GetFriendsAndColleaguesIDs called"); 29 | 30 | string[] result = { "" }; 31 | return result; 32 | } 33 | 34 | public byte[] GetPicture() { 35 | Debug.WriteLine("OSCPerson::GetPicture called"); 36 | 37 | return null; 38 | } 39 | 40 | public string GetProfileUrl() { 41 | Debug.WriteLine("OSCPerson::GetProfileUrl called"); 42 | 43 | return string.Empty; 44 | } 45 | 46 | /// 47 | /// Not supported in OSC version 1.0 and version 1.1 48 | /// 49 | public string GetStatus() { 50 | Debug.WriteLine("OSCPerson::GetStatus called"); 51 | 52 | return string.Empty; 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /GravatarOSC/OSCProfile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using OutlookSocialProvider; 4 | 5 | namespace GravatarOSC 6 | { 7 | class OSCProfile : OSCPerson, ISocialProfile { 8 | public string GetActivitiesOfFriendsAndColleagues(DateTime startTime) { 9 | Debug.WriteLine("OSCProfile::GetActivitiesOfFriendsAndColleagues called"); 10 | 11 | return string.Empty; 12 | } 13 | 14 | public new string GetActivities(DateTime startTime) { 15 | Debug.WriteLine("OSCProfile::GetActivities called"); 16 | 17 | return string.Empty; 18 | } 19 | 20 | 21 | public new string GetDetails() { 22 | Debug.WriteLine("OSCProfile::GetDetails called"); 23 | 24 | return string.Empty; 25 | } 26 | 27 | public new string GetFriendsAndColleagues() { 28 | Debug.WriteLine("OSCProfile::GetFriendsAndColleagues called"); 29 | 30 | return string.Empty; 31 | } 32 | 33 | public new string[] GetFriendsAndColleaguesIDs() { 34 | Debug.WriteLine("OSCProfile::GetFriendsAndColleaguesIDs called"); 35 | 36 | return null; 37 | } 38 | 39 | public new byte[] GetPicture() { 40 | Debug.WriteLine("OSCProfile::GetPicture called"); 41 | 42 | return null; 43 | } 44 | 45 | public new string GetProfileUrl() { 46 | Debug.WriteLine("OSCProfile::GetProfileUrl called"); 47 | 48 | return string.Empty; 49 | } 50 | 51 | /// 52 | /// Not supported in OSC version 1.0 and version 1.1 53 | /// 54 | public bool[] AreFriendsOrColleagues(string[] userIDs) { 55 | Debug.WriteLine("OSCProfile::AreFriendsOrColleagues called"); 56 | 57 | return null; 58 | } 59 | 60 | /// 61 | /// Not supported in OSC version 1.0 and version 1.1 62 | /// 63 | public new string GetStatus() { 64 | Debug.WriteLine("OSCProfile::GetStatus called"); 65 | 66 | throw new NotImplementedException(); 67 | } 68 | 69 | /// 70 | /// Not supported in OSC version 1.0 and version 1.1 71 | /// 72 | public void SetStatus(string status) { 73 | Debug.WriteLine("OSCProfile::SetStatus called"); 74 | } 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /GravatarOSC/OSCProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using OutlookSocialProvider; 4 | 5 | namespace GravatarOSC 6 | { 7 | public class OSCProvider : ISocialProvider 8 | { 9 | public const string NetworkName = "Gravatar"; 10 | public const string NetworkUrl = "http://www.gravatar.com/"; 11 | 12 | private const string ProviderVersion = "1.1"; 13 | private const string ProviderGuidString = "{C8A61225-F18B-4AB9-ADCB-3ADDDA709AA7}"; 14 | 15 | public string GetCapabilities() { 16 | 17 | var capabilities = new OSCSchema.capabilities { 18 | // OSC 1.0 capabilities 19 | getFriends = true, 20 | cacheFriends = false, 21 | followPerson = false, 22 | doNotFollowPerson = false, 23 | getActivities = true, 24 | cacheActivities = false, 25 | 26 | // OSC 1.1 capabilities 27 | dynamicActivitiesLookupEx = false, 28 | dynamicActivitiesLookupExSpecified = true, 29 | hideHyperlinks = false, 30 | hideHyperlinksSpecified = true, 31 | supportsAutoConfigure = false, 32 | supportsAutoConfigureSpecified = true, 33 | dynamicContactsLookup = true, 34 | dynamicContactsLookupSpecified = true, 35 | useLogonCached = true, 36 | useLogonCachedSpecified = true, 37 | hideRememberMyPassword = false, 38 | hideRememberMyPasswordSpecified = true, 39 | hashFunction = "MD5" 40 | }; 41 | 42 | return HelperMethods.SerializeObjectToString(capabilities); 43 | } 44 | 45 | /// 46 | /// Executed because we signal "supportsAutoConfigure" 47 | /// 48 | public ISocialSession GetAutoConfiguredSession() { 49 | Debug.WriteLine("GetAutoConfiguredSession called"); 50 | 51 | return new OSCSession(this, true); 52 | } 53 | 54 | /// 55 | /// Should not be called by Outlook, but still returns something 56 | /// 57 | public ISocialSession GetSession() { 58 | Debug.WriteLine("GetSession called"); 59 | 60 | return new OSCSession(this); 61 | } 62 | 63 | /// 64 | /// Not supported in OSC version 1.0 and version 1.1 65 | /// 66 | public void GetStatusSettings(out string statusDefault, out int maxStatusLength) { 67 | Debug.WriteLine("GetStatusSetting called"); 68 | 69 | throw new NotImplementedException(); 70 | } 71 | 72 | /// 73 | /// Initialize Plugin 74 | /// 75 | public void Load(string socialProviderInterfaceVersion, string languageTag) { 76 | Debug.WriteLine("Load called with socialProviderInterfaceVersion=" + socialProviderInterfaceVersion + " and languageTag=" + languageTag); 77 | } 78 | 79 | public byte[] SocialNetworkIcon { 80 | get { return HelperMethods.GetProviderJpeg(); } 81 | } 82 | 83 | public string SocialNetworkName { 84 | get { return NetworkName; } 85 | } 86 | 87 | public Guid SocialNetworkGuid { 88 | get { return new Guid(ProviderGuidString); } 89 | } 90 | 91 | public string[] DefaultSiteUrls { 92 | get { return new [] { NetworkUrl }; } 93 | } 94 | 95 | public string Version { 96 | get { return ProviderVersion; } 97 | } 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /GravatarOSC/OSCSession.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Text; 5 | using Gravatar.NET; 6 | using OutlookSocialProvider; 7 | 8 | namespace GravatarOSC 9 | { 10 | class OSCSession : ISocialSession, ISocialSession2 { 11 | private GravatarService _gravatarService = null; 12 | private readonly OSCProvider _provider; 13 | private string _loggedOnUser; 14 | 15 | public OSCSession(OSCProvider provider, bool autoConfigured = false) { 16 | _provider = provider; 17 | 18 | if (autoConfigured) { 19 | _loggedOnUser = "Local User"; 20 | } 21 | } 22 | 23 | public string GetActivities(string[] emailAddresses, DateTime startTime) { 24 | Debug.WriteLine("ISocialSession::GetActivities called for:"); 25 | foreach (var emailAddress in emailAddresses) { 26 | Debug.WriteLine("\t" + emailAddress); 27 | } 28 | 29 | var feed = new OSCSchema.activityFeedType { network = GetNetworkIdentifier() }; 30 | return HelperMethods.SerializeObjectToString(feed); 31 | } 32 | 33 | /// 34 | /// Gravatar does not support activities, so we return an empty structure 35 | /// 36 | public string GetActivitiesEx(string[] hashedAddresses, DateTime startTime) { 37 | Debug.WriteLine("ISocialSession2::GetActivitiesEx called for:"); 38 | foreach (var address in hashedAddresses) 39 | Debug.WriteLine("\t" + address); 40 | 41 | var feed = new OSCSchema.activityFeedType {network = GetNetworkIdentifier()}; 42 | return HelperMethods.SerializeObjectToString(feed); 43 | } 44 | 45 | #region Person/People 46 | /// 47 | /// not yet clear, what this is used for 48 | /// 49 | /// 50 | /// 51 | public ISocialPerson GetPerson(string userId) { 52 | Debug.WriteLine("GetPerson called for " + userId); 53 | 54 | return new OSCPerson(); 55 | } 56 | 57 | /// 58 | /// Should return information about the addresses 59 | /// 60 | /// 61 | /// 62 | public string GetPeopleDetails(string hashedAddresses) { 63 | var addresses = HelperMethods.DeserializeStringToObject(hashedAddresses); 64 | 65 | Debug.WriteLine("ISocialSession2::GetPeopleDetails called for personsAddresses"); 66 | foreach (var line in addresses.personAddresses) 67 | Debug.WriteLine("\t" + line.index + ": " + String.Join(", ", line.hashedAddress)); 68 | 69 | var resultList = new List(); 70 | foreach (var personAddress in addresses.personAddresses) { 71 | if (personAddress.hashedAddress.Length == 0) continue; 72 | try { 73 | // find gravatar for hashed addresses 74 | var response = _gravatarService.Exists(personAddress.hashedAddress, true); 75 | if (response.IsError) { 76 | Debug.WriteLine("Encountered error when calling gravatar: " + response.ErrorCode); 77 | continue; 78 | } 79 | var index = HelperMethods.GetTrueIndex(response.MultipleOperationResponse); 80 | 81 | // no gravatar found 82 | if (index == -1) continue; 83 | 84 | // get gravatar profile 85 | var profile = GravatarService.GetGravatarProfile(personAddress.hashedAddress[index], true); 86 | if (profile == null) 87 | resultList.Add(new OSCSchema.personType { 88 | userID = personAddress.hashedAddress[index], 89 | pictureUrl = GravatarService.GetGravatarUrlForAddress(personAddress.hashedAddress[index], true), 90 | 91 | index = personAddress.index, 92 | indexSpecified = true 93 | }); 94 | else 95 | resultList.Add(new OSCSchema.personType { 96 | userID = personAddress.hashedAddress[index], 97 | pictureUrl = profile.ThumbnailUrl, 98 | city = profile.CurrentLocation, 99 | firstName = profile.GivenName, 100 | lastName = profile.FamilyName, 101 | nickname = profile.PreferredUsername, 102 | 103 | index = personAddress.index, 104 | indexSpecified = true 105 | }); 106 | } catch(Exception e) { 107 | Debug.WriteLine(e.ToString()); 108 | } 109 | } 110 | 111 | 112 | var friends = new OSCSchema.friends {person = resultList.ToArray()}; 113 | 114 | var result = HelperMethods.SerializeObjectToString(friends); 115 | Debug.WriteLine(result); 116 | return result; 117 | } 118 | 119 | /// 120 | /// ??? 121 | /// 122 | /// 123 | /// 124 | public string FindPerson(string userID) { 125 | Debug.WriteLine("FindPerson called for " + userID); 126 | 127 | return string.Empty; 128 | } 129 | 130 | /// 131 | /// We do not follow people 132 | /// 133 | public void FollowPerson(string emailAddress) { 134 | Debug.WriteLine("FollowPerson called for " + emailAddress); 135 | } 136 | 137 | /// 138 | /// We do not follow people 139 | /// 140 | public void FollowPersonEx(string[] emailAddresses, string displayName) { 141 | Debug.WriteLine("ISocialSession2::FollowPersonEx called for displayName = " + displayName); 142 | foreach (var emailAddress in emailAddresses) 143 | Debug.WriteLine("\t" + emailAddress); 144 | } 145 | 146 | /// 147 | /// We do not follow, so we also do not unfollow 148 | /// 149 | /// 150 | public void UnFollowPerson(string userId) { 151 | Debug.WriteLine("UnFollowPerson called for " + userId); 152 | } 153 | #endregion 154 | 155 | public string GetNetworkIdentifier() { 156 | return OSCProvider.NetworkName; 157 | } 158 | 159 | public string SiteUrl { 160 | set { /* To-Do: Implement SiteUrl */ } 161 | } 162 | 163 | 164 | #region Logon 165 | /// 166 | /// We do cached logon and therefore never call this 167 | /// 168 | public void Logon(string username, string password) { 169 | Debug.WriteLine("Logon called with username: " + username + ", password: " + password); 170 | } 171 | 172 | /// 173 | /// We do cached windows logon and therefore never call this 174 | /// 175 | public void LogonWeb(string connectIn, out string connectOut) { 176 | if (!string.IsNullOrEmpty(connectIn)) 177 | Debug.WriteLine("LogonWeb called with connectIn: " + connectIn); 178 | connectOut = string.Empty; 179 | } 180 | 181 | /// 182 | /// Logon to Gravatar service and safe Base64-encoded username/password combination in connectOut 183 | /// 184 | /// If recurring login, information from last connectOut (should contain encoded password) 185 | /// The username supplied 186 | /// If first login, the password supplied by the user 187 | /// Some value to cache, which allows us later to logon again (without the password) 188 | public void LogonCached(string connectIn, string userName, string password, out string connectOut) { 189 | string realUsername = userName; 190 | string realPassword = password; 191 | 192 | if (!string.IsNullOrEmpty(connectIn)) { 193 | Debug.WriteLine("LogonCached called with connectIn: " + connectIn); 194 | var parts = connectIn.Split(':'); 195 | realUsername = Encoding.UTF8.GetString(Convert.FromBase64String(parts[0])); 196 | realPassword = Encoding.UTF8.GetString(Convert.FromBase64String(parts[1])); 197 | connectOut = connectIn; 198 | } else { 199 | Debug.WriteLine("LogonCached called with username='" + userName + "' and password='" + password + "'"); 200 | connectOut = String.Format("{0}:{1}", Convert.ToBase64String(Encoding.UTF8.GetBytes(userName)), Convert.ToBase64String(Encoding.UTF8.GetBytes(password))); 201 | } 202 | 203 | _gravatarService = new GravatarService(realUsername, realPassword); 204 | var response = _gravatarService.Test(); 205 | if (response.IsError) { 206 | Debug.WriteLine("Failed to login to Gravatar"); 207 | throw new Exception(); 208 | } 209 | 210 | _loggedOnUser = realUsername; 211 | } 212 | 213 | public ISocialProfile GetLoggedOnUser() { 214 | return new OSCProfile(); 215 | } 216 | 217 | public string LoggedOnUserID { 218 | get { return _loggedOnUser; } 219 | } 220 | 221 | public string LoggedOnUserName { 222 | get { return _loggedOnUser; } 223 | } 224 | 225 | public string GetLogonUrl() { 226 | return OSCProvider.NetworkUrl; 227 | } 228 | 229 | #endregion 230 | } 231 | } 232 | -------------------------------------------------------------------------------- /GravatarOSC/Other Stuff/EnableDebugging.reg: -------------------------------------------------------------------------------- 1 | Windows Registry Editor Version 5.00 2 | 3 | [HKEY_CURRENT_USER\Software\Microsoft\Office\Outlook\SocialConnector] 4 | "DebugProviders"=dword:00000001 5 | "ShowDebugButtons"=dword:00000001 -------------------------------------------------------------------------------- /GravatarOSC/Other Stuff/OutlookSocialProvider.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/02strich/outlook-gravatar-connector/16183c98dd9b06b35c1a9060a7695128b696ad8d/GravatarOSC/Other Stuff/OutlookSocialProvider.dll -------------------------------------------------------------------------------- /GravatarOSC/Other Stuff/OutlookSocialProvider_1.0.xsd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/02strich/outlook-gravatar-connector/16183c98dd9b06b35c1a9060a7695128b696ad8d/GravatarOSC/Other Stuff/OutlookSocialProvider_1.0.xsd -------------------------------------------------------------------------------- /GravatarOSC/Other Stuff/OutlookSocialProvider_1.1.xsd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/02strich/outlook-gravatar-connector/16183c98dd9b06b35c1a9060a7695128b696ad8d/GravatarOSC/Other Stuff/OutlookSocialProvider_1.1.xsd -------------------------------------------------------------------------------- /GravatarOSC/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("GravatarOSC")] 8 | [assembly: AssemblyDescription("Outlook Social Connector for Gravatar")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("GravatarOSC")] 12 | [assembly: AssemblyCopyright("2017")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(true)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | // Supply a new GUID when you build your own provider from this project 23 | [assembly: Guid("FE1ABFF1-0D4B-433A-943D-1A9971CD438D")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /GravatarOSC/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.237 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace GravatarOSC.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("GravatarOSC.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | internal static System.Drawing.Bitmap Logo { 64 | get { 65 | object obj = ResourceManager.GetObject("Logo", resourceCulture); 66 | return ((System.Drawing.Bitmap)(obj)); 67 | } 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /GravatarOSC/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 122 | ..\Resources\Logo.jpg;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 123 | 124 | -------------------------------------------------------------------------------- /GravatarOSC/Resources/Logo - Copy.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/02strich/outlook-gravatar-connector/16183c98dd9b06b35c1a9060a7695128b696ad8d/GravatarOSC/Resources/Logo - Copy.jpg -------------------------------------------------------------------------------- /GravatarOSC/Resources/Logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/02strich/outlook-gravatar-connector/16183c98dd9b06b35c1a9060a7695128b696ad8d/GravatarOSC/Resources/Logo.jpg -------------------------------------------------------------------------------- /GravatarOSC/Schema/SocialProviderSchema.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:2.0.50727.4927 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | using System.Xml.Serialization; 12 | 13 | // 14 | // This source code was auto-generated by xsd, Version=2.0.50727.3038. 15 | // 16 | 17 | namespace OSCSchema 18 | { 19 | 20 | /// 21 | [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] 22 | [System.SerializableAttribute()] 23 | [System.Diagnostics.DebuggerStepThroughAttribute()] 24 | [System.ComponentModel.DesignerCategoryAttribute("code")] 25 | [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.microsoft.com/office/outlook/2010/06/socialprovider.xsd")] 26 | [System.Xml.Serialization.XmlRootAttribute("activityFeed", Namespace="http://schemas.microsoft.com/office/outlook/2010/06/socialprovider.xsd", IsNullable=false)] 27 | 28 | public partial class activityFeedType { 29 | 30 | private string networkField; 31 | 32 | private activityDetailsType[] activitiesField; 33 | 34 | private activityTemplateContainerType[] templatesField; 35 | 36 | /// 37 | public string network { 38 | get { 39 | return this.networkField; 40 | } 41 | set { 42 | this.networkField = value; 43 | } 44 | } 45 | 46 | /// 47 | [System.Xml.Serialization.XmlArrayItemAttribute("activityDetails", IsNullable=false)] 48 | public activityDetailsType[] activities { 49 | get { 50 | return this.activitiesField; 51 | } 52 | set { 53 | this.activitiesField = value; 54 | } 55 | } 56 | 57 | /// 58 | [System.Xml.Serialization.XmlArrayItemAttribute("activityTemplateContainer", IsNullable=false)] 59 | public activityTemplateContainerType[] templates { 60 | get { 61 | return this.templatesField; 62 | } 63 | set { 64 | this.templatesField = value; 65 | } 66 | } 67 | } 68 | 69 | /// 70 | [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] 71 | [System.SerializableAttribute()] 72 | [System.Diagnostics.DebuggerStepThroughAttribute()] 73 | [System.ComponentModel.DesignerCategoryAttribute("code")] 74 | [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.microsoft.com/office/outlook/2010/06/socialprovider.xsd")] 75 | public partial class activityDetailsType { 76 | 77 | private string ownerIDField; 78 | 79 | private string objectIDField; 80 | 81 | private ulong applicationIDField; 82 | 83 | private ulong templateIDField; 84 | 85 | private System.DateTime publishDateField; 86 | 87 | private activityTemplateTypeRestrictionType typeField; 88 | 89 | private bool typeFieldSpecified; 90 | 91 | private templateVariableType[] templateVariablesField; 92 | 93 | /// 94 | public string ownerID { 95 | get { 96 | return this.ownerIDField; 97 | } 98 | set { 99 | this.ownerIDField = value; 100 | } 101 | } 102 | 103 | /// 104 | public string objectID { 105 | get { 106 | return this.objectIDField; 107 | } 108 | set { 109 | this.objectIDField = value; 110 | } 111 | } 112 | 113 | /// 114 | public ulong applicationID { 115 | get { 116 | return this.applicationIDField; 117 | } 118 | set { 119 | this.applicationIDField = value; 120 | } 121 | } 122 | 123 | /// 124 | public ulong templateID { 125 | get { 126 | return this.templateIDField; 127 | } 128 | set { 129 | this.templateIDField = value; 130 | } 131 | } 132 | 133 | /// 134 | public System.DateTime publishDate { 135 | get { 136 | return this.publishDateField; 137 | } 138 | set { 139 | this.publishDateField = value; 140 | } 141 | } 142 | 143 | /// 144 | public activityTemplateTypeRestrictionType type { 145 | get { 146 | return this.typeField; 147 | } 148 | set { 149 | this.typeField = value; 150 | } 151 | } 152 | 153 | /// 154 | [System.Xml.Serialization.XmlIgnoreAttribute()] 155 | public bool typeSpecified { 156 | get { 157 | return this.typeFieldSpecified; 158 | } 159 | set { 160 | this.typeFieldSpecified = value; 161 | } 162 | } 163 | 164 | /// 165 | [System.Xml.Serialization.XmlArrayItemAttribute("templateVariable", IsNullable=false)] 166 | public templateVariableType[] templateVariables { 167 | get { 168 | return this.templateVariablesField; 169 | } 170 | set { 171 | this.templateVariablesField = value; 172 | } 173 | } 174 | } 175 | 176 | /// 177 | [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] 178 | [System.SerializableAttribute()] 179 | [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.microsoft.com/office/outlook/2010/06/socialprovider.xsd")] 180 | public enum activityTemplateTypeRestrictionType { 181 | 182 | /// 183 | [System.Xml.Serialization.XmlEnumAttribute("Status Update")] 184 | StatusUpdate, 185 | 186 | /// 187 | Photo, 188 | 189 | /// 190 | Document, 191 | 192 | /// 193 | Other, 194 | } 195 | 196 | /// 197 | [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] 198 | [System.SerializableAttribute()] 199 | [System.Diagnostics.DebuggerStepThroughAttribute()] 200 | [System.ComponentModel.DesignerCategoryAttribute("code")] 201 | [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.microsoft.com/office/outlook/2010/06/socialprovider.xsd")] 202 | public partial class templateVariableType { 203 | 204 | private string nameField; 205 | 206 | private string idField; 207 | 208 | private string nameHintField; 209 | 210 | private string emailAddressField; 211 | 212 | private string profileUrlField; 213 | 214 | private string textField; 215 | 216 | private string valueField; 217 | 218 | private string altTextField; 219 | 220 | private string hrefField; 221 | 222 | private simpleTemplateVariableType[] listItemsField; 223 | 224 | private templateTypeRestrictionType typeField; 225 | 226 | /// 227 | public string name { 228 | get { 229 | return this.nameField; 230 | } 231 | set { 232 | this.nameField = value; 233 | } 234 | } 235 | 236 | /// 237 | public string id { 238 | get { 239 | return this.idField; 240 | } 241 | set { 242 | this.idField = value; 243 | } 244 | } 245 | 246 | /// 247 | public string nameHint { 248 | get { 249 | return this.nameHintField; 250 | } 251 | set { 252 | this.nameHintField = value; 253 | } 254 | } 255 | 256 | /// 257 | public string emailAddress { 258 | get { 259 | return this.emailAddressField; 260 | } 261 | set { 262 | this.emailAddressField = value; 263 | } 264 | } 265 | 266 | /// 267 | public string profileUrl { 268 | get { 269 | return this.profileUrlField; 270 | } 271 | set { 272 | this.profileUrlField = value; 273 | } 274 | } 275 | 276 | /// 277 | public string text { 278 | get { 279 | return this.textField; 280 | } 281 | set { 282 | this.textField = value; 283 | } 284 | } 285 | 286 | /// 287 | public string value { 288 | get { 289 | return this.valueField; 290 | } 291 | set { 292 | this.valueField = value; 293 | } 294 | } 295 | 296 | /// 297 | public string altText { 298 | get { 299 | return this.altTextField; 300 | } 301 | set { 302 | this.altTextField = value; 303 | } 304 | } 305 | 306 | /// 307 | [System.Xml.Serialization.XmlElementAttribute(DataType="anyURI")] 308 | public string href { 309 | get { 310 | return this.hrefField; 311 | } 312 | set { 313 | this.hrefField = value; 314 | } 315 | } 316 | 317 | /// 318 | [System.Xml.Serialization.XmlArrayItemAttribute("simpleTemplateVariable", IsNullable=false)] 319 | public simpleTemplateVariableType[] listItems { 320 | get { 321 | return this.listItemsField; 322 | } 323 | set { 324 | this.listItemsField = value; 325 | } 326 | } 327 | 328 | /// 329 | [System.Xml.Serialization.XmlAttributeAttribute()] 330 | public templateTypeRestrictionType type { 331 | get { 332 | return this.typeField; 333 | } 334 | set { 335 | this.typeField = value; 336 | } 337 | } 338 | } 339 | 340 | /// 341 | [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] 342 | [System.SerializableAttribute()] 343 | [System.Diagnostics.DebuggerStepThroughAttribute()] 344 | [System.ComponentModel.DesignerCategoryAttribute("code")] 345 | [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.microsoft.com/office/outlook/2010/06/socialprovider.xsd")] 346 | public partial class simpleTemplateVariableType { 347 | 348 | private string nameField; 349 | 350 | private string textField; 351 | 352 | private string valueField; 353 | 354 | private string altTextField; 355 | 356 | private string hrefField; 357 | 358 | private templateSimpleTypeRestrictionType typeField; 359 | 360 | /// 361 | public string name { 362 | get { 363 | return this.nameField; 364 | } 365 | set { 366 | this.nameField = value; 367 | } 368 | } 369 | 370 | /// 371 | public string text { 372 | get { 373 | return this.textField; 374 | } 375 | set { 376 | this.textField = value; 377 | } 378 | } 379 | 380 | /// 381 | [System.Xml.Serialization.XmlElementAttribute(DataType="anyURI")] 382 | public string value { 383 | get { 384 | return this.valueField; 385 | } 386 | set { 387 | this.valueField = value; 388 | } 389 | } 390 | 391 | /// 392 | public string altText { 393 | get { 394 | return this.altTextField; 395 | } 396 | set { 397 | this.altTextField = value; 398 | } 399 | } 400 | 401 | /// 402 | [System.Xml.Serialization.XmlElementAttribute(DataType="anyURI")] 403 | public string href { 404 | get { 405 | return this.hrefField; 406 | } 407 | set { 408 | this.hrefField = value; 409 | } 410 | } 411 | 412 | /// 413 | [System.Xml.Serialization.XmlAttributeAttribute()] 414 | public templateSimpleTypeRestrictionType type { 415 | get { 416 | return this.typeField; 417 | } 418 | set { 419 | this.typeField = value; 420 | } 421 | } 422 | } 423 | 424 | /// 425 | [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] 426 | [System.SerializableAttribute()] 427 | [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.microsoft.com/office/outlook/2010/06/socialprovider.xsd")] 428 | public enum templateSimpleTypeRestrictionType { 429 | 430 | /// 431 | linkVariable, 432 | 433 | /// 434 | textVariable, 435 | 436 | /// 437 | pictureVariable, 438 | } 439 | 440 | /// 441 | [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] 442 | [System.SerializableAttribute()] 443 | [System.Diagnostics.DebuggerStepThroughAttribute()] 444 | [System.ComponentModel.DesignerCategoryAttribute("code")] 445 | [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.microsoft.com/office/outlook/2010/06/socialprovider.xsd")] 446 | public partial class personAddressType { 447 | 448 | private string[] hashedAddressField; 449 | 450 | private int indexField; 451 | 452 | /// 453 | [System.Xml.Serialization.XmlElementAttribute("hashedAddress")] 454 | public string[] hashedAddress { 455 | get { 456 | return this.hashedAddressField; 457 | } 458 | set { 459 | this.hashedAddressField = value; 460 | } 461 | } 462 | 463 | /// 464 | [System.Xml.Serialization.XmlAttributeAttribute()] 465 | public int index { 466 | get { 467 | return this.indexField; 468 | } 469 | set { 470 | this.indexField = value; 471 | } 472 | } 473 | } 474 | 475 | /// 476 | [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] 477 | [System.SerializableAttribute()] 478 | [System.Diagnostics.DebuggerStepThroughAttribute()] 479 | [System.ComponentModel.DesignerCategoryAttribute("code")] 480 | [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.microsoft.com/office/outlook/2010/06/socialprovider.xsd")] 481 | public partial class activityTemplateType { 482 | 483 | private activityTemplateTypeRestrictionType typeField; 484 | 485 | private bool typeFieldSpecified; 486 | 487 | private string titleField; 488 | 489 | private string dataField; 490 | 491 | private string iconField; 492 | 493 | /// 494 | public activityTemplateTypeRestrictionType type { 495 | get { 496 | return this.typeField; 497 | } 498 | set { 499 | this.typeField = value; 500 | } 501 | } 502 | 503 | /// 504 | [System.Xml.Serialization.XmlIgnoreAttribute()] 505 | public bool typeSpecified { 506 | get { 507 | return this.typeFieldSpecified; 508 | } 509 | set { 510 | this.typeFieldSpecified = value; 511 | } 512 | } 513 | 514 | /// 515 | public string title { 516 | get { 517 | return this.titleField; 518 | } 519 | set { 520 | this.titleField = value; 521 | } 522 | } 523 | 524 | /// 525 | public string data { 526 | get { 527 | return this.dataField; 528 | } 529 | set { 530 | this.dataField = value; 531 | } 532 | } 533 | 534 | /// 535 | [System.Xml.Serialization.XmlElementAttribute(DataType="anyURI")] 536 | public string icon { 537 | get { 538 | return this.iconField; 539 | } 540 | set { 541 | this.iconField = value; 542 | } 543 | } 544 | } 545 | 546 | /// 547 | [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] 548 | [System.SerializableAttribute()] 549 | [System.Diagnostics.DebuggerStepThroughAttribute()] 550 | [System.ComponentModel.DesignerCategoryAttribute("code")] 551 | [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.microsoft.com/office/outlook/2010/06/socialprovider.xsd")] 552 | public partial class activityTemplateContainerType { 553 | 554 | private ulong applicationIDField; 555 | 556 | private ulong templateIDField; 557 | 558 | private activityTemplateType activityTemplateField; 559 | 560 | /// 561 | public ulong applicationID { 562 | get { 563 | return this.applicationIDField; 564 | } 565 | set { 566 | this.applicationIDField = value; 567 | } 568 | } 569 | 570 | /// 571 | public ulong templateID { 572 | get { 573 | return this.templateIDField; 574 | } 575 | set { 576 | this.templateIDField = value; 577 | } 578 | } 579 | 580 | /// 581 | public activityTemplateType activityTemplate { 582 | get { 583 | return this.activityTemplateField; 584 | } 585 | set { 586 | this.activityTemplateField = value; 587 | } 588 | } 589 | } 590 | 591 | /// 592 | [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] 593 | [System.SerializableAttribute()] 594 | [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.microsoft.com/office/outlook/2010/06/socialprovider.xsd")] 595 | public enum templateTypeRestrictionType { 596 | 597 | /// 598 | publisherVariable, 599 | 600 | /// 601 | entityVariable, 602 | 603 | /// 604 | linkVariable, 605 | 606 | /// 607 | textVariable, 608 | 609 | /// 610 | pictureVariable, 611 | 612 | /// 613 | listVariable, 614 | } 615 | 616 | /// 617 | [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] 618 | [System.SerializableAttribute()] 619 | [System.Diagnostics.DebuggerStepThroughAttribute()] 620 | [System.ComponentModel.DesignerCategoryAttribute("code")] 621 | [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://schemas.microsoft.com/office/outlook/2010/06/socialprovider.xsd")] 622 | [System.Xml.Serialization.XmlRootAttribute(Namespace="http://schemas.microsoft.com/office/outlook/2010/06/socialprovider.xsd", IsNullable=false)] 623 | public partial class capabilities { 624 | 625 | private bool getFriendsField; 626 | 627 | private bool cacheFriendsField; 628 | 629 | private bool followPersonField; 630 | 631 | private bool doNotFollowPersonField; 632 | 633 | private bool getActivitiesField; 634 | 635 | private bool cacheActivitiesField; 636 | 637 | private bool dynamicActivitiesLookupField; 638 | 639 | private bool dynamicActivitiesLookupFieldSpecified; 640 | 641 | private bool displayUrlField; 642 | 643 | private bool useLogonWebAuthField; 644 | 645 | private bool hideHyperlinksField; 646 | 647 | private bool hideHyperlinksFieldSpecified; 648 | 649 | private bool supportsAutoConfigureField; 650 | 651 | private bool supportsAutoConfigureFieldSpecified; 652 | 653 | private uint contactSyncRestartIntervalField; 654 | 655 | private bool contactSyncRestartIntervalFieldSpecified; 656 | 657 | private bool dynamicActivitiesLookupExField; 658 | 659 | private bool dynamicActivitiesLookupExFieldSpecified; 660 | 661 | private bool dynamicContactsLookupField; 662 | 663 | private bool dynamicContactsLookupFieldSpecified; 664 | 665 | private bool useLogonCachedField; 666 | 667 | private bool useLogonCachedFieldSpecified; 668 | 669 | private bool hideRememberMyPasswordField; 670 | 671 | private bool hideRememberMyPasswordFieldSpecified; 672 | 673 | private string createAccountUrlField; 674 | 675 | private string forgotPasswordUrlField; 676 | 677 | private bool showOnDemandActivitiesWhenMinimizedField; 678 | 679 | private bool showOnDemandActivitiesWhenMinimizedFieldSpecified; 680 | 681 | private bool showOnDemandContactsWhenMinimizedField; 682 | 683 | private bool showOnDemandContactsWhenMinimizedFieldSpecified; 684 | 685 | private string hashFunctionField; 686 | 687 | /// 688 | public bool getFriends { 689 | get { 690 | return this.getFriendsField; 691 | } 692 | set { 693 | this.getFriendsField = value; 694 | } 695 | } 696 | 697 | /// 698 | public bool cacheFriends { 699 | get { 700 | return this.cacheFriendsField; 701 | } 702 | set { 703 | this.cacheFriendsField = value; 704 | } 705 | } 706 | 707 | /// 708 | public bool followPerson { 709 | get { 710 | return this.followPersonField; 711 | } 712 | set { 713 | this.followPersonField = value; 714 | } 715 | } 716 | 717 | /// 718 | public bool doNotFollowPerson { 719 | get { 720 | return this.doNotFollowPersonField; 721 | } 722 | set { 723 | this.doNotFollowPersonField = value; 724 | } 725 | } 726 | 727 | /// 728 | public bool getActivities { 729 | get { 730 | return this.getActivitiesField; 731 | } 732 | set { 733 | this.getActivitiesField = value; 734 | } 735 | } 736 | 737 | /// 738 | public bool cacheActivities { 739 | get { 740 | return this.cacheActivitiesField; 741 | } 742 | set { 743 | this.cacheActivitiesField = value; 744 | } 745 | } 746 | 747 | /// 748 | public bool dynamicActivitiesLookup { 749 | get { 750 | return this.dynamicActivitiesLookupField; 751 | } 752 | set { 753 | this.dynamicActivitiesLookupField = value; 754 | } 755 | } 756 | 757 | /// 758 | [System.Xml.Serialization.XmlIgnoreAttribute()] 759 | public bool dynamicActivitiesLookupSpecified { 760 | get { 761 | return this.dynamicActivitiesLookupFieldSpecified; 762 | } 763 | set { 764 | this.dynamicActivitiesLookupFieldSpecified = value; 765 | } 766 | } 767 | 768 | /// 769 | public bool displayUrl { 770 | get { 771 | return this.displayUrlField; 772 | } 773 | set { 774 | this.displayUrlField = value; 775 | } 776 | } 777 | 778 | /// 779 | public bool useLogonWebAuth { 780 | get { 781 | return this.useLogonWebAuthField; 782 | } 783 | set { 784 | this.useLogonWebAuthField = value; 785 | } 786 | } 787 | 788 | /// 789 | public bool hideHyperlinks { 790 | get { 791 | return this.hideHyperlinksField; 792 | } 793 | set { 794 | this.hideHyperlinksField = value; 795 | } 796 | } 797 | 798 | /// 799 | [System.Xml.Serialization.XmlIgnoreAttribute()] 800 | public bool hideHyperlinksSpecified { 801 | get { 802 | return this.hideHyperlinksFieldSpecified; 803 | } 804 | set { 805 | this.hideHyperlinksFieldSpecified = value; 806 | } 807 | } 808 | 809 | /// 810 | public bool supportsAutoConfigure { 811 | get { 812 | return this.supportsAutoConfigureField; 813 | } 814 | set { 815 | this.supportsAutoConfigureField = value; 816 | } 817 | } 818 | 819 | /// 820 | [System.Xml.Serialization.XmlIgnoreAttribute()] 821 | public bool supportsAutoConfigureSpecified { 822 | get { 823 | return this.supportsAutoConfigureFieldSpecified; 824 | } 825 | set { 826 | this.supportsAutoConfigureFieldSpecified = value; 827 | } 828 | } 829 | 830 | /// 831 | public uint contactSyncRestartInterval { 832 | get { 833 | return this.contactSyncRestartIntervalField; 834 | } 835 | set { 836 | this.contactSyncRestartIntervalField = value; 837 | } 838 | } 839 | 840 | /// 841 | [System.Xml.Serialization.XmlIgnoreAttribute()] 842 | public bool contactSyncRestartIntervalSpecified { 843 | get { 844 | return this.contactSyncRestartIntervalFieldSpecified; 845 | } 846 | set { 847 | this.contactSyncRestartIntervalFieldSpecified = value; 848 | } 849 | } 850 | 851 | /// 852 | public bool dynamicActivitiesLookupEx { 853 | get { 854 | return this.dynamicActivitiesLookupExField; 855 | } 856 | set { 857 | this.dynamicActivitiesLookupExField = value; 858 | } 859 | } 860 | 861 | /// 862 | [System.Xml.Serialization.XmlIgnoreAttribute()] 863 | public bool dynamicActivitiesLookupExSpecified { 864 | get { 865 | return this.dynamicActivitiesLookupExFieldSpecified; 866 | } 867 | set { 868 | this.dynamicActivitiesLookupExFieldSpecified = value; 869 | } 870 | } 871 | 872 | /// 873 | public bool dynamicContactsLookup { 874 | get { 875 | return this.dynamicContactsLookupField; 876 | } 877 | set { 878 | this.dynamicContactsLookupField = value; 879 | } 880 | } 881 | 882 | /// 883 | [System.Xml.Serialization.XmlIgnoreAttribute()] 884 | public bool dynamicContactsLookupSpecified { 885 | get { 886 | return this.dynamicContactsLookupFieldSpecified; 887 | } 888 | set { 889 | this.dynamicContactsLookupFieldSpecified = value; 890 | } 891 | } 892 | 893 | /// 894 | public bool useLogonCached { 895 | get { 896 | return this.useLogonCachedField; 897 | } 898 | set { 899 | this.useLogonCachedField = value; 900 | } 901 | } 902 | 903 | /// 904 | [System.Xml.Serialization.XmlIgnoreAttribute()] 905 | public bool useLogonCachedSpecified { 906 | get { 907 | return this.useLogonCachedFieldSpecified; 908 | } 909 | set { 910 | this.useLogonCachedFieldSpecified = value; 911 | } 912 | } 913 | 914 | /// 915 | public bool hideRememberMyPassword { 916 | get { 917 | return this.hideRememberMyPasswordField; 918 | } 919 | set { 920 | this.hideRememberMyPasswordField = value; 921 | } 922 | } 923 | 924 | /// 925 | [System.Xml.Serialization.XmlIgnoreAttribute()] 926 | public bool hideRememberMyPasswordSpecified { 927 | get { 928 | return this.hideRememberMyPasswordFieldSpecified; 929 | } 930 | set { 931 | this.hideRememberMyPasswordFieldSpecified = value; 932 | } 933 | } 934 | 935 | /// 936 | [System.Xml.Serialization.XmlElementAttribute(DataType="anyURI")] 937 | public string createAccountUrl { 938 | get { 939 | return this.createAccountUrlField; 940 | } 941 | set { 942 | this.createAccountUrlField = value; 943 | } 944 | } 945 | 946 | /// 947 | [System.Xml.Serialization.XmlElementAttribute(DataType="anyURI")] 948 | public string forgotPasswordUrl { 949 | get { 950 | return this.forgotPasswordUrlField; 951 | } 952 | set { 953 | this.forgotPasswordUrlField = value; 954 | } 955 | } 956 | 957 | /// 958 | public bool showOnDemandActivitiesWhenMinimized { 959 | get { 960 | return this.showOnDemandActivitiesWhenMinimizedField; 961 | } 962 | set { 963 | this.showOnDemandActivitiesWhenMinimizedField = value; 964 | } 965 | } 966 | 967 | /// 968 | [System.Xml.Serialization.XmlIgnoreAttribute()] 969 | public bool showOnDemandActivitiesWhenMinimizedSpecified { 970 | get { 971 | return this.showOnDemandActivitiesWhenMinimizedFieldSpecified; 972 | } 973 | set { 974 | this.showOnDemandActivitiesWhenMinimizedFieldSpecified = value; 975 | } 976 | } 977 | 978 | /// 979 | public bool showOnDemandContactsWhenMinimized { 980 | get { 981 | return this.showOnDemandContactsWhenMinimizedField; 982 | } 983 | set { 984 | this.showOnDemandContactsWhenMinimizedField = value; 985 | } 986 | } 987 | 988 | /// 989 | [System.Xml.Serialization.XmlIgnoreAttribute()] 990 | public bool showOnDemandContactsWhenMinimizedSpecified { 991 | get { 992 | return this.showOnDemandContactsWhenMinimizedFieldSpecified; 993 | } 994 | set { 995 | this.showOnDemandContactsWhenMinimizedFieldSpecified = value; 996 | } 997 | } 998 | 999 | /// 1000 | public string hashFunction { 1001 | get { 1002 | return this.hashFunctionField; 1003 | } 1004 | set { 1005 | this.hashFunctionField = value; 1006 | } 1007 | } 1008 | } 1009 | 1010 | /// 1011 | [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] 1012 | [System.SerializableAttribute()] 1013 | [System.Diagnostics.DebuggerStepThroughAttribute()] 1014 | [System.ComponentModel.DesignerCategoryAttribute("code")] 1015 | [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://schemas.microsoft.com/office/outlook/2010/06/socialprovider.xsd")] 1016 | [System.Xml.Serialization.XmlRootAttribute(Namespace="http://schemas.microsoft.com/office/outlook/2010/06/socialprovider.xsd", IsNullable=false)] 1017 | public partial class hashedAddresses { 1018 | 1019 | private personAddressType[] personAddressesField; 1020 | 1021 | /// 1022 | [System.Xml.Serialization.XmlElementAttribute("personAddresses")] 1023 | public personAddressType[] personAddresses { 1024 | get { 1025 | return this.personAddressesField; 1026 | } 1027 | set { 1028 | this.personAddressesField = value; 1029 | } 1030 | } 1031 | } 1032 | 1033 | /// 1034 | [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] 1035 | [System.SerializableAttribute()] 1036 | [System.Diagnostics.DebuggerStepThroughAttribute()] 1037 | [System.ComponentModel.DesignerCategoryAttribute("code")] 1038 | [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://schemas.microsoft.com/office/outlook/2010/06/socialprovider.xsd")] 1039 | [System.Xml.Serialization.XmlRootAttribute(Namespace="http://schemas.microsoft.com/office/outlook/2010/06/socialprovider.xsd", IsNullable=false)] 1040 | public partial class friends { 1041 | 1042 | private personType[] personField; 1043 | 1044 | /// 1045 | [System.Xml.Serialization.XmlElementAttribute("person")] 1046 | public personType[] person { 1047 | get { 1048 | return this.personField; 1049 | } 1050 | set { 1051 | this.personField = value; 1052 | } 1053 | } 1054 | } 1055 | 1056 | /// 1057 | [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] 1058 | [System.SerializableAttribute()] 1059 | [System.Diagnostics.DebuggerStepThroughAttribute()] 1060 | [System.ComponentModel.DesignerCategoryAttribute("code")] 1061 | [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.microsoft.com/office/outlook/2010/06/socialprovider.xsd")] 1062 | [System.Xml.Serialization.XmlRootAttribute("person", Namespace="http://schemas.microsoft.com/office/outlook/2010/06/socialprovider.xsd", IsNullable=false)] 1063 | public partial class personType { 1064 | 1065 | private string userIDField; 1066 | 1067 | private string firstNameField; 1068 | 1069 | private string lastNameField; 1070 | 1071 | private string fullNameField; 1072 | 1073 | private string nicknameField; 1074 | 1075 | private string fileAsField; 1076 | 1077 | private string companyField; 1078 | 1079 | private string titleField; 1080 | 1081 | private System.DateTime anniversaryField; 1082 | 1083 | private bool anniversaryFieldSpecified; 1084 | 1085 | private System.DateTime birthdayField; 1086 | 1087 | private bool birthdayFieldSpecified; 1088 | 1089 | private string emailAddressField; 1090 | 1091 | private string emailAddress2Field; 1092 | 1093 | private string emailAddress3Field; 1094 | 1095 | private string webProfilePageField; 1096 | 1097 | private string phoneField; 1098 | 1099 | private string cellField; 1100 | 1101 | private string homePhoneField; 1102 | 1103 | private string workPhoneField; 1104 | 1105 | private string addressField; 1106 | 1107 | private string cityField; 1108 | 1109 | private string stateField; 1110 | 1111 | private string countryOrRegionField; 1112 | 1113 | private string zipField; 1114 | 1115 | private string relationshipField; 1116 | 1117 | private System.DateTime creationTimeField; 1118 | 1119 | private bool creationTimeFieldSpecified; 1120 | 1121 | private System.DateTime lastModificationTimeField; 1122 | 1123 | private bool lastModificationTimeFieldSpecified; 1124 | 1125 | private System.DateTime expirationTimeField; 1126 | 1127 | private bool expirationTimeFieldSpecified; 1128 | 1129 | private string genderField; 1130 | 1131 | private int indexField; 1132 | 1133 | private bool indexFieldSpecified; 1134 | 1135 | private string pictureUrlField; 1136 | 1137 | private string friendStatusField; 1138 | 1139 | /// 1140 | public string userID { 1141 | get { 1142 | return this.userIDField; 1143 | } 1144 | set { 1145 | this.userIDField = value; 1146 | } 1147 | } 1148 | 1149 | /// 1150 | public string firstName { 1151 | get { 1152 | return this.firstNameField; 1153 | } 1154 | set { 1155 | this.firstNameField = value; 1156 | } 1157 | } 1158 | 1159 | /// 1160 | public string lastName { 1161 | get { 1162 | return this.lastNameField; 1163 | } 1164 | set { 1165 | this.lastNameField = value; 1166 | } 1167 | } 1168 | 1169 | /// 1170 | public string fullName { 1171 | get { 1172 | return this.fullNameField; 1173 | } 1174 | set { 1175 | this.fullNameField = value; 1176 | } 1177 | } 1178 | 1179 | /// 1180 | public string nickname { 1181 | get { 1182 | return this.nicknameField; 1183 | } 1184 | set { 1185 | this.nicknameField = value; 1186 | } 1187 | } 1188 | 1189 | /// 1190 | public string fileAs { 1191 | get { 1192 | return this.fileAsField; 1193 | } 1194 | set { 1195 | this.fileAsField = value; 1196 | } 1197 | } 1198 | 1199 | /// 1200 | public string company { 1201 | get { 1202 | return this.companyField; 1203 | } 1204 | set { 1205 | this.companyField = value; 1206 | } 1207 | } 1208 | 1209 | /// 1210 | public string title { 1211 | get { 1212 | return this.titleField; 1213 | } 1214 | set { 1215 | this.titleField = value; 1216 | } 1217 | } 1218 | 1219 | /// 1220 | [System.Xml.Serialization.XmlElementAttribute(DataType="date")] 1221 | public System.DateTime anniversary { 1222 | get { 1223 | return this.anniversaryField; 1224 | } 1225 | set { 1226 | this.anniversaryField = value; 1227 | } 1228 | } 1229 | 1230 | /// 1231 | [System.Xml.Serialization.XmlIgnoreAttribute()] 1232 | public bool anniversarySpecified { 1233 | get { 1234 | return this.anniversaryFieldSpecified; 1235 | } 1236 | set { 1237 | this.anniversaryFieldSpecified = value; 1238 | } 1239 | } 1240 | 1241 | /// 1242 | [System.Xml.Serialization.XmlElementAttribute(DataType="date")] 1243 | public System.DateTime birthday { 1244 | get { 1245 | return this.birthdayField; 1246 | } 1247 | set { 1248 | this.birthdayField = value; 1249 | } 1250 | } 1251 | 1252 | /// 1253 | [System.Xml.Serialization.XmlIgnoreAttribute()] 1254 | public bool birthdaySpecified { 1255 | get { 1256 | return this.birthdayFieldSpecified; 1257 | } 1258 | set { 1259 | this.birthdayFieldSpecified = value; 1260 | } 1261 | } 1262 | 1263 | /// 1264 | public string emailAddress { 1265 | get { 1266 | return this.emailAddressField; 1267 | } 1268 | set { 1269 | this.emailAddressField = value; 1270 | } 1271 | } 1272 | 1273 | /// 1274 | public string emailAddress2 { 1275 | get { 1276 | return this.emailAddress2Field; 1277 | } 1278 | set { 1279 | this.emailAddress2Field = value; 1280 | } 1281 | } 1282 | 1283 | /// 1284 | public string emailAddress3 { 1285 | get { 1286 | return this.emailAddress3Field; 1287 | } 1288 | set { 1289 | this.emailAddress3Field = value; 1290 | } 1291 | } 1292 | 1293 | /// 1294 | public string webProfilePage { 1295 | get { 1296 | return this.webProfilePageField; 1297 | } 1298 | set { 1299 | this.webProfilePageField = value; 1300 | } 1301 | } 1302 | 1303 | /// 1304 | public string phone { 1305 | get { 1306 | return this.phoneField; 1307 | } 1308 | set { 1309 | this.phoneField = value; 1310 | } 1311 | } 1312 | 1313 | /// 1314 | public string cell { 1315 | get { 1316 | return this.cellField; 1317 | } 1318 | set { 1319 | this.cellField = value; 1320 | } 1321 | } 1322 | 1323 | /// 1324 | public string homePhone { 1325 | get { 1326 | return this.homePhoneField; 1327 | } 1328 | set { 1329 | this.homePhoneField = value; 1330 | } 1331 | } 1332 | 1333 | /// 1334 | public string workPhone { 1335 | get { 1336 | return this.workPhoneField; 1337 | } 1338 | set { 1339 | this.workPhoneField = value; 1340 | } 1341 | } 1342 | 1343 | /// 1344 | public string address { 1345 | get { 1346 | return this.addressField; 1347 | } 1348 | set { 1349 | this.addressField = value; 1350 | } 1351 | } 1352 | 1353 | /// 1354 | public string city { 1355 | get { 1356 | return this.cityField; 1357 | } 1358 | set { 1359 | this.cityField = value; 1360 | } 1361 | } 1362 | 1363 | /// 1364 | public string state { 1365 | get { 1366 | return this.stateField; 1367 | } 1368 | set { 1369 | this.stateField = value; 1370 | } 1371 | } 1372 | 1373 | /// 1374 | public string countryOrRegion { 1375 | get { 1376 | return this.countryOrRegionField; 1377 | } 1378 | set { 1379 | this.countryOrRegionField = value; 1380 | } 1381 | } 1382 | 1383 | /// 1384 | public string zip { 1385 | get { 1386 | return this.zipField; 1387 | } 1388 | set { 1389 | this.zipField = value; 1390 | } 1391 | } 1392 | 1393 | /// 1394 | public string relationship { 1395 | get { 1396 | return this.relationshipField; 1397 | } 1398 | set { 1399 | this.relationshipField = value; 1400 | } 1401 | } 1402 | 1403 | /// 1404 | public System.DateTime creationTime { 1405 | get { 1406 | return this.creationTimeField; 1407 | } 1408 | set { 1409 | this.creationTimeField = value; 1410 | } 1411 | } 1412 | 1413 | /// 1414 | [System.Xml.Serialization.XmlIgnoreAttribute()] 1415 | public bool creationTimeSpecified { 1416 | get { 1417 | return this.creationTimeFieldSpecified; 1418 | } 1419 | set { 1420 | this.creationTimeFieldSpecified = value; 1421 | } 1422 | } 1423 | 1424 | /// 1425 | public System.DateTime lastModificationTime { 1426 | get { 1427 | return this.lastModificationTimeField; 1428 | } 1429 | set { 1430 | this.lastModificationTimeField = value; 1431 | } 1432 | } 1433 | 1434 | /// 1435 | [System.Xml.Serialization.XmlIgnoreAttribute()] 1436 | public bool lastModificationTimeSpecified { 1437 | get { 1438 | return this.lastModificationTimeFieldSpecified; 1439 | } 1440 | set { 1441 | this.lastModificationTimeFieldSpecified = value; 1442 | } 1443 | } 1444 | 1445 | /// 1446 | public System.DateTime expirationTime { 1447 | get { 1448 | return this.expirationTimeField; 1449 | } 1450 | set { 1451 | this.expirationTimeField = value; 1452 | } 1453 | } 1454 | 1455 | /// 1456 | [System.Xml.Serialization.XmlIgnoreAttribute()] 1457 | public bool expirationTimeSpecified { 1458 | get { 1459 | return this.expirationTimeFieldSpecified; 1460 | } 1461 | set { 1462 | this.expirationTimeFieldSpecified = value; 1463 | } 1464 | } 1465 | 1466 | /// 1467 | public string gender { 1468 | get { 1469 | return this.genderField; 1470 | } 1471 | set { 1472 | this.genderField = value; 1473 | } 1474 | } 1475 | 1476 | /// 1477 | public int index { 1478 | get { 1479 | return this.indexField; 1480 | } 1481 | set { 1482 | this.indexField = value; 1483 | } 1484 | } 1485 | 1486 | /// 1487 | [System.Xml.Serialization.XmlIgnoreAttribute()] 1488 | public bool indexSpecified { 1489 | get { 1490 | return this.indexFieldSpecified; 1491 | } 1492 | set { 1493 | this.indexFieldSpecified = value; 1494 | } 1495 | } 1496 | 1497 | /// 1498 | public string pictureUrl { 1499 | get { 1500 | return this.pictureUrlField; 1501 | } 1502 | set { 1503 | this.pictureUrlField = value; 1504 | } 1505 | } 1506 | 1507 | /// 1508 | public string friendStatus { 1509 | get { 1510 | return this.friendStatusField; 1511 | } 1512 | set { 1513 | this.friendStatusField = value; 1514 | } 1515 | } 1516 | } 1517 | } 1518 | -------------------------------------------------------------------------------- /GravatarOSC/SocialProviderSchema.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:2.0.50727.4927 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | using System.Xml.Serialization; 12 | 13 | // 14 | // This source code was auto-generated by xsd, Version=2.0.50727.3038. 15 | // 16 | 17 | namespace OSCSchema 18 | { 19 | 20 | /// 21 | [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] 22 | [System.SerializableAttribute()] 23 | [System.Diagnostics.DebuggerStepThroughAttribute()] 24 | [System.ComponentModel.DesignerCategoryAttribute("code")] 25 | [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.microsoft.com/office/outlook/2010/06/socialprovider.xsd")] 26 | [System.Xml.Serialization.XmlRootAttribute("activityFeed", Namespace="http://schemas.microsoft.com/office/outlook/2010/06/socialprovider.xsd", IsNullable=false)] 27 | 28 | public partial class activityFeedType { 29 | 30 | private string networkField; 31 | 32 | private activityDetailsType[] activitiesField; 33 | 34 | private activityTemplateContainerType[] templatesField; 35 | 36 | /// 37 | public string network { 38 | get { 39 | return this.networkField; 40 | } 41 | set { 42 | this.networkField = value; 43 | } 44 | } 45 | 46 | /// 47 | [System.Xml.Serialization.XmlArrayItemAttribute("activityDetails", IsNullable=false)] 48 | public activityDetailsType[] activities { 49 | get { 50 | return this.activitiesField; 51 | } 52 | set { 53 | this.activitiesField = value; 54 | } 55 | } 56 | 57 | /// 58 | [System.Xml.Serialization.XmlArrayItemAttribute("activityTemplateContainer", IsNullable=false)] 59 | public activityTemplateContainerType[] templates { 60 | get { 61 | return this.templatesField; 62 | } 63 | set { 64 | this.templatesField = value; 65 | } 66 | } 67 | } 68 | 69 | /// 70 | [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] 71 | [System.SerializableAttribute()] 72 | [System.Diagnostics.DebuggerStepThroughAttribute()] 73 | [System.ComponentModel.DesignerCategoryAttribute("code")] 74 | [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.microsoft.com/office/outlook/2010/06/socialprovider.xsd")] 75 | public partial class activityDetailsType { 76 | 77 | private string ownerIDField; 78 | 79 | private string objectIDField; 80 | 81 | private ulong applicationIDField; 82 | 83 | private ulong templateIDField; 84 | 85 | private System.DateTime publishDateField; 86 | 87 | private activityTemplateTypeRestrictionType typeField; 88 | 89 | private bool typeFieldSpecified; 90 | 91 | private templateVariableType[] templateVariablesField; 92 | 93 | /// 94 | public string ownerID { 95 | get { 96 | return this.ownerIDField; 97 | } 98 | set { 99 | this.ownerIDField = value; 100 | } 101 | } 102 | 103 | /// 104 | public string objectID { 105 | get { 106 | return this.objectIDField; 107 | } 108 | set { 109 | this.objectIDField = value; 110 | } 111 | } 112 | 113 | /// 114 | public ulong applicationID { 115 | get { 116 | return this.applicationIDField; 117 | } 118 | set { 119 | this.applicationIDField = value; 120 | } 121 | } 122 | 123 | /// 124 | public ulong templateID { 125 | get { 126 | return this.templateIDField; 127 | } 128 | set { 129 | this.templateIDField = value; 130 | } 131 | } 132 | 133 | /// 134 | public System.DateTime publishDate { 135 | get { 136 | return this.publishDateField; 137 | } 138 | set { 139 | this.publishDateField = value; 140 | } 141 | } 142 | 143 | /// 144 | public activityTemplateTypeRestrictionType type { 145 | get { 146 | return this.typeField; 147 | } 148 | set { 149 | this.typeField = value; 150 | } 151 | } 152 | 153 | /// 154 | [System.Xml.Serialization.XmlIgnoreAttribute()] 155 | public bool typeSpecified { 156 | get { 157 | return this.typeFieldSpecified; 158 | } 159 | set { 160 | this.typeFieldSpecified = value; 161 | } 162 | } 163 | 164 | /// 165 | [System.Xml.Serialization.XmlArrayItemAttribute("templateVariable", IsNullable=false)] 166 | public templateVariableType[] templateVariables { 167 | get { 168 | return this.templateVariablesField; 169 | } 170 | set { 171 | this.templateVariablesField = value; 172 | } 173 | } 174 | } 175 | 176 | /// 177 | [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] 178 | [System.SerializableAttribute()] 179 | [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.microsoft.com/office/outlook/2010/06/socialprovider.xsd")] 180 | public enum activityTemplateTypeRestrictionType { 181 | 182 | /// 183 | [System.Xml.Serialization.XmlEnumAttribute("Status Update")] 184 | StatusUpdate, 185 | 186 | /// 187 | Photo, 188 | 189 | /// 190 | Document, 191 | 192 | /// 193 | Other, 194 | } 195 | 196 | /// 197 | [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] 198 | [System.SerializableAttribute()] 199 | [System.Diagnostics.DebuggerStepThroughAttribute()] 200 | [System.ComponentModel.DesignerCategoryAttribute("code")] 201 | [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.microsoft.com/office/outlook/2010/06/socialprovider.xsd")] 202 | public partial class templateVariableType { 203 | 204 | private string nameField; 205 | 206 | private string idField; 207 | 208 | private string nameHintField; 209 | 210 | private string emailAddressField; 211 | 212 | private string profileUrlField; 213 | 214 | private string textField; 215 | 216 | private string valueField; 217 | 218 | private string altTextField; 219 | 220 | private string hrefField; 221 | 222 | private simpleTemplateVariableType[] listItemsField; 223 | 224 | private templateTypeRestrictionType typeField; 225 | 226 | /// 227 | public string name { 228 | get { 229 | return this.nameField; 230 | } 231 | set { 232 | this.nameField = value; 233 | } 234 | } 235 | 236 | /// 237 | public string id { 238 | get { 239 | return this.idField; 240 | } 241 | set { 242 | this.idField = value; 243 | } 244 | } 245 | 246 | /// 247 | public string nameHint { 248 | get { 249 | return this.nameHintField; 250 | } 251 | set { 252 | this.nameHintField = value; 253 | } 254 | } 255 | 256 | /// 257 | public string emailAddress { 258 | get { 259 | return this.emailAddressField; 260 | } 261 | set { 262 | this.emailAddressField = value; 263 | } 264 | } 265 | 266 | /// 267 | public string profileUrl { 268 | get { 269 | return this.profileUrlField; 270 | } 271 | set { 272 | this.profileUrlField = value; 273 | } 274 | } 275 | 276 | /// 277 | public string text { 278 | get { 279 | return this.textField; 280 | } 281 | set { 282 | this.textField = value; 283 | } 284 | } 285 | 286 | /// 287 | public string value { 288 | get { 289 | return this.valueField; 290 | } 291 | set { 292 | this.valueField = value; 293 | } 294 | } 295 | 296 | /// 297 | public string altText { 298 | get { 299 | return this.altTextField; 300 | } 301 | set { 302 | this.altTextField = value; 303 | } 304 | } 305 | 306 | /// 307 | [System.Xml.Serialization.XmlElementAttribute(DataType="anyURI")] 308 | public string href { 309 | get { 310 | return this.hrefField; 311 | } 312 | set { 313 | this.hrefField = value; 314 | } 315 | } 316 | 317 | /// 318 | [System.Xml.Serialization.XmlArrayItemAttribute("simpleTemplateVariable", IsNullable=false)] 319 | public simpleTemplateVariableType[] listItems { 320 | get { 321 | return this.listItemsField; 322 | } 323 | set { 324 | this.listItemsField = value; 325 | } 326 | } 327 | 328 | /// 329 | [System.Xml.Serialization.XmlAttributeAttribute()] 330 | public templateTypeRestrictionType type { 331 | get { 332 | return this.typeField; 333 | } 334 | set { 335 | this.typeField = value; 336 | } 337 | } 338 | } 339 | 340 | /// 341 | [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] 342 | [System.SerializableAttribute()] 343 | [System.Diagnostics.DebuggerStepThroughAttribute()] 344 | [System.ComponentModel.DesignerCategoryAttribute("code")] 345 | [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.microsoft.com/office/outlook/2010/06/socialprovider.xsd")] 346 | public partial class simpleTemplateVariableType { 347 | 348 | private string nameField; 349 | 350 | private string textField; 351 | 352 | private string valueField; 353 | 354 | private string altTextField; 355 | 356 | private string hrefField; 357 | 358 | private templateSimpleTypeRestrictionType typeField; 359 | 360 | /// 361 | public string name { 362 | get { 363 | return this.nameField; 364 | } 365 | set { 366 | this.nameField = value; 367 | } 368 | } 369 | 370 | /// 371 | public string text { 372 | get { 373 | return this.textField; 374 | } 375 | set { 376 | this.textField = value; 377 | } 378 | } 379 | 380 | /// 381 | [System.Xml.Serialization.XmlElementAttribute(DataType="anyURI")] 382 | public string value { 383 | get { 384 | return this.valueField; 385 | } 386 | set { 387 | this.valueField = value; 388 | } 389 | } 390 | 391 | /// 392 | public string altText { 393 | get { 394 | return this.altTextField; 395 | } 396 | set { 397 | this.altTextField = value; 398 | } 399 | } 400 | 401 | /// 402 | [System.Xml.Serialization.XmlElementAttribute(DataType="anyURI")] 403 | public string href { 404 | get { 405 | return this.hrefField; 406 | } 407 | set { 408 | this.hrefField = value; 409 | } 410 | } 411 | 412 | /// 413 | [System.Xml.Serialization.XmlAttributeAttribute()] 414 | public templateSimpleTypeRestrictionType type { 415 | get { 416 | return this.typeField; 417 | } 418 | set { 419 | this.typeField = value; 420 | } 421 | } 422 | } 423 | 424 | /// 425 | [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] 426 | [System.SerializableAttribute()] 427 | [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.microsoft.com/office/outlook/2010/06/socialprovider.xsd")] 428 | public enum templateSimpleTypeRestrictionType { 429 | 430 | /// 431 | linkVariable, 432 | 433 | /// 434 | textVariable, 435 | 436 | /// 437 | pictureVariable, 438 | } 439 | 440 | /// 441 | [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] 442 | [System.SerializableAttribute()] 443 | [System.Diagnostics.DebuggerStepThroughAttribute()] 444 | [System.ComponentModel.DesignerCategoryAttribute("code")] 445 | [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.microsoft.com/office/outlook/2010/06/socialprovider.xsd")] 446 | public partial class personAddressType { 447 | 448 | private string[] hashedAddressField; 449 | 450 | private int indexField; 451 | 452 | /// 453 | [System.Xml.Serialization.XmlElementAttribute("hashedAddress")] 454 | public string[] hashedAddress { 455 | get { 456 | return this.hashedAddressField; 457 | } 458 | set { 459 | this.hashedAddressField = value; 460 | } 461 | } 462 | 463 | /// 464 | [System.Xml.Serialization.XmlAttributeAttribute()] 465 | public int index { 466 | get { 467 | return this.indexField; 468 | } 469 | set { 470 | this.indexField = value; 471 | } 472 | } 473 | } 474 | 475 | /// 476 | [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] 477 | [System.SerializableAttribute()] 478 | [System.Diagnostics.DebuggerStepThroughAttribute()] 479 | [System.ComponentModel.DesignerCategoryAttribute("code")] 480 | [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.microsoft.com/office/outlook/2010/06/socialprovider.xsd")] 481 | public partial class activityTemplateType { 482 | 483 | private activityTemplateTypeRestrictionType typeField; 484 | 485 | private bool typeFieldSpecified; 486 | 487 | private string titleField; 488 | 489 | private string dataField; 490 | 491 | private string iconField; 492 | 493 | /// 494 | public activityTemplateTypeRestrictionType type { 495 | get { 496 | return this.typeField; 497 | } 498 | set { 499 | this.typeField = value; 500 | } 501 | } 502 | 503 | /// 504 | [System.Xml.Serialization.XmlIgnoreAttribute()] 505 | public bool typeSpecified { 506 | get { 507 | return this.typeFieldSpecified; 508 | } 509 | set { 510 | this.typeFieldSpecified = value; 511 | } 512 | } 513 | 514 | /// 515 | public string title { 516 | get { 517 | return this.titleField; 518 | } 519 | set { 520 | this.titleField = value; 521 | } 522 | } 523 | 524 | /// 525 | public string data { 526 | get { 527 | return this.dataField; 528 | } 529 | set { 530 | this.dataField = value; 531 | } 532 | } 533 | 534 | /// 535 | [System.Xml.Serialization.XmlElementAttribute(DataType="anyURI")] 536 | public string icon { 537 | get { 538 | return this.iconField; 539 | } 540 | set { 541 | this.iconField = value; 542 | } 543 | } 544 | } 545 | 546 | /// 547 | [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] 548 | [System.SerializableAttribute()] 549 | [System.Diagnostics.DebuggerStepThroughAttribute()] 550 | [System.ComponentModel.DesignerCategoryAttribute("code")] 551 | [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.microsoft.com/office/outlook/2010/06/socialprovider.xsd")] 552 | public partial class activityTemplateContainerType { 553 | 554 | private ulong applicationIDField; 555 | 556 | private ulong templateIDField; 557 | 558 | private activityTemplateType activityTemplateField; 559 | 560 | /// 561 | public ulong applicationID { 562 | get { 563 | return this.applicationIDField; 564 | } 565 | set { 566 | this.applicationIDField = value; 567 | } 568 | } 569 | 570 | /// 571 | public ulong templateID { 572 | get { 573 | return this.templateIDField; 574 | } 575 | set { 576 | this.templateIDField = value; 577 | } 578 | } 579 | 580 | /// 581 | public activityTemplateType activityTemplate { 582 | get { 583 | return this.activityTemplateField; 584 | } 585 | set { 586 | this.activityTemplateField = value; 587 | } 588 | } 589 | } 590 | 591 | /// 592 | [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] 593 | [System.SerializableAttribute()] 594 | [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.microsoft.com/office/outlook/2010/06/socialprovider.xsd")] 595 | public enum templateTypeRestrictionType { 596 | 597 | /// 598 | publisherVariable, 599 | 600 | /// 601 | entityVariable, 602 | 603 | /// 604 | linkVariable, 605 | 606 | /// 607 | textVariable, 608 | 609 | /// 610 | pictureVariable, 611 | 612 | /// 613 | listVariable, 614 | } 615 | 616 | /// 617 | [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] 618 | [System.SerializableAttribute()] 619 | [System.Diagnostics.DebuggerStepThroughAttribute()] 620 | [System.ComponentModel.DesignerCategoryAttribute("code")] 621 | [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://schemas.microsoft.com/office/outlook/2010/06/socialprovider.xsd")] 622 | [System.Xml.Serialization.XmlRootAttribute(Namespace="http://schemas.microsoft.com/office/outlook/2010/06/socialprovider.xsd", IsNullable=false)] 623 | public partial class capabilities { 624 | 625 | private bool getFriendsField; 626 | 627 | private bool cacheFriendsField; 628 | 629 | private bool followPersonField; 630 | 631 | private bool doNotFollowPersonField; 632 | 633 | private bool getActivitiesField; 634 | 635 | private bool cacheActivitiesField; 636 | 637 | private bool dynamicActivitiesLookupField; 638 | 639 | private bool dynamicActivitiesLookupFieldSpecified; 640 | 641 | private bool displayUrlField; 642 | 643 | private bool useLogonWebAuthField; 644 | 645 | private bool hideHyperlinksField; 646 | 647 | private bool hideHyperlinksFieldSpecified; 648 | 649 | private bool supportsAutoConfigureField; 650 | 651 | private bool supportsAutoConfigureFieldSpecified; 652 | 653 | private uint contactSyncRestartIntervalField; 654 | 655 | private bool contactSyncRestartIntervalFieldSpecified; 656 | 657 | private bool dynamicActivitiesLookupExField; 658 | 659 | private bool dynamicActivitiesLookupExFieldSpecified; 660 | 661 | private bool dynamicContactsLookupField; 662 | 663 | private bool dynamicContactsLookupFieldSpecified; 664 | 665 | private bool useLogonCachedField; 666 | 667 | private bool useLogonCachedFieldSpecified; 668 | 669 | private bool hideRememberMyPasswordField; 670 | 671 | private bool hideRememberMyPasswordFieldSpecified; 672 | 673 | private string createAccountUrlField; 674 | 675 | private string forgotPasswordUrlField; 676 | 677 | private bool showOnDemandActivitiesWhenMinimizedField; 678 | 679 | private bool showOnDemandActivitiesWhenMinimizedFieldSpecified; 680 | 681 | private bool showOnDemandContactsWhenMinimizedField; 682 | 683 | private bool showOnDemandContactsWhenMinimizedFieldSpecified; 684 | 685 | private string hashFunctionField; 686 | 687 | /// 688 | public bool getFriends { 689 | get { 690 | return this.getFriendsField; 691 | } 692 | set { 693 | this.getFriendsField = value; 694 | } 695 | } 696 | 697 | /// 698 | public bool cacheFriends { 699 | get { 700 | return this.cacheFriendsField; 701 | } 702 | set { 703 | this.cacheFriendsField = value; 704 | } 705 | } 706 | 707 | /// 708 | public bool followPerson { 709 | get { 710 | return this.followPersonField; 711 | } 712 | set { 713 | this.followPersonField = value; 714 | } 715 | } 716 | 717 | /// 718 | public bool doNotFollowPerson { 719 | get { 720 | return this.doNotFollowPersonField; 721 | } 722 | set { 723 | this.doNotFollowPersonField = value; 724 | } 725 | } 726 | 727 | /// 728 | public bool getActivities { 729 | get { 730 | return this.getActivitiesField; 731 | } 732 | set { 733 | this.getActivitiesField = value; 734 | } 735 | } 736 | 737 | /// 738 | public bool cacheActivities { 739 | get { 740 | return this.cacheActivitiesField; 741 | } 742 | set { 743 | this.cacheActivitiesField = value; 744 | } 745 | } 746 | 747 | /// 748 | public bool dynamicActivitiesLookup { 749 | get { 750 | return this.dynamicActivitiesLookupField; 751 | } 752 | set { 753 | this.dynamicActivitiesLookupField = value; 754 | } 755 | } 756 | 757 | /// 758 | [System.Xml.Serialization.XmlIgnoreAttribute()] 759 | public bool dynamicActivitiesLookupSpecified { 760 | get { 761 | return this.dynamicActivitiesLookupFieldSpecified; 762 | } 763 | set { 764 | this.dynamicActivitiesLookupFieldSpecified = value; 765 | } 766 | } 767 | 768 | /// 769 | public bool displayUrl { 770 | get { 771 | return this.displayUrlField; 772 | } 773 | set { 774 | this.displayUrlField = value; 775 | } 776 | } 777 | 778 | /// 779 | public bool useLogonWebAuth { 780 | get { 781 | return this.useLogonWebAuthField; 782 | } 783 | set { 784 | this.useLogonWebAuthField = value; 785 | } 786 | } 787 | 788 | /// 789 | public bool hideHyperlinks { 790 | get { 791 | return this.hideHyperlinksField; 792 | } 793 | set { 794 | this.hideHyperlinksField = value; 795 | } 796 | } 797 | 798 | /// 799 | [System.Xml.Serialization.XmlIgnoreAttribute()] 800 | public bool hideHyperlinksSpecified { 801 | get { 802 | return this.hideHyperlinksFieldSpecified; 803 | } 804 | set { 805 | this.hideHyperlinksFieldSpecified = value; 806 | } 807 | } 808 | 809 | /// 810 | public bool supportsAutoConfigure { 811 | get { 812 | return this.supportsAutoConfigureField; 813 | } 814 | set { 815 | this.supportsAutoConfigureField = value; 816 | } 817 | } 818 | 819 | /// 820 | [System.Xml.Serialization.XmlIgnoreAttribute()] 821 | public bool supportsAutoConfigureSpecified { 822 | get { 823 | return this.supportsAutoConfigureFieldSpecified; 824 | } 825 | set { 826 | this.supportsAutoConfigureFieldSpecified = value; 827 | } 828 | } 829 | 830 | /// 831 | public uint contactSyncRestartInterval { 832 | get { 833 | return this.contactSyncRestartIntervalField; 834 | } 835 | set { 836 | this.contactSyncRestartIntervalField = value; 837 | } 838 | } 839 | 840 | /// 841 | [System.Xml.Serialization.XmlIgnoreAttribute()] 842 | public bool contactSyncRestartIntervalSpecified { 843 | get { 844 | return this.contactSyncRestartIntervalFieldSpecified; 845 | } 846 | set { 847 | this.contactSyncRestartIntervalFieldSpecified = value; 848 | } 849 | } 850 | 851 | /// 852 | public bool dynamicActivitiesLookupEx { 853 | get { 854 | return this.dynamicActivitiesLookupExField; 855 | } 856 | set { 857 | this.dynamicActivitiesLookupExField = value; 858 | } 859 | } 860 | 861 | /// 862 | [System.Xml.Serialization.XmlIgnoreAttribute()] 863 | public bool dynamicActivitiesLookupExSpecified { 864 | get { 865 | return this.dynamicActivitiesLookupExFieldSpecified; 866 | } 867 | set { 868 | this.dynamicActivitiesLookupExFieldSpecified = value; 869 | } 870 | } 871 | 872 | /// 873 | public bool dynamicContactsLookup { 874 | get { 875 | return this.dynamicContactsLookupField; 876 | } 877 | set { 878 | this.dynamicContactsLookupField = value; 879 | } 880 | } 881 | 882 | /// 883 | [System.Xml.Serialization.XmlIgnoreAttribute()] 884 | public bool dynamicContactsLookupSpecified { 885 | get { 886 | return this.dynamicContactsLookupFieldSpecified; 887 | } 888 | set { 889 | this.dynamicContactsLookupFieldSpecified = value; 890 | } 891 | } 892 | 893 | /// 894 | public bool useLogonCached { 895 | get { 896 | return this.useLogonCachedField; 897 | } 898 | set { 899 | this.useLogonCachedField = value; 900 | } 901 | } 902 | 903 | /// 904 | [System.Xml.Serialization.XmlIgnoreAttribute()] 905 | public bool useLogonCachedSpecified { 906 | get { 907 | return this.useLogonCachedFieldSpecified; 908 | } 909 | set { 910 | this.useLogonCachedFieldSpecified = value; 911 | } 912 | } 913 | 914 | /// 915 | public bool hideRememberMyPassword { 916 | get { 917 | return this.hideRememberMyPasswordField; 918 | } 919 | set { 920 | this.hideRememberMyPasswordField = value; 921 | } 922 | } 923 | 924 | /// 925 | [System.Xml.Serialization.XmlIgnoreAttribute()] 926 | public bool hideRememberMyPasswordSpecified { 927 | get { 928 | return this.hideRememberMyPasswordFieldSpecified; 929 | } 930 | set { 931 | this.hideRememberMyPasswordFieldSpecified = value; 932 | } 933 | } 934 | 935 | /// 936 | [System.Xml.Serialization.XmlElementAttribute(DataType="anyURI")] 937 | public string createAccountUrl { 938 | get { 939 | return this.createAccountUrlField; 940 | } 941 | set { 942 | this.createAccountUrlField = value; 943 | } 944 | } 945 | 946 | /// 947 | [System.Xml.Serialization.XmlElementAttribute(DataType="anyURI")] 948 | public string forgotPasswordUrl { 949 | get { 950 | return this.forgotPasswordUrlField; 951 | } 952 | set { 953 | this.forgotPasswordUrlField = value; 954 | } 955 | } 956 | 957 | /// 958 | public bool showOnDemandActivitiesWhenMinimized { 959 | get { 960 | return this.showOnDemandActivitiesWhenMinimizedField; 961 | } 962 | set { 963 | this.showOnDemandActivitiesWhenMinimizedField = value; 964 | } 965 | } 966 | 967 | /// 968 | [System.Xml.Serialization.XmlIgnoreAttribute()] 969 | public bool showOnDemandActivitiesWhenMinimizedSpecified { 970 | get { 971 | return this.showOnDemandActivitiesWhenMinimizedFieldSpecified; 972 | } 973 | set { 974 | this.showOnDemandActivitiesWhenMinimizedFieldSpecified = value; 975 | } 976 | } 977 | 978 | /// 979 | public bool showOnDemandContactsWhenMinimized { 980 | get { 981 | return this.showOnDemandContactsWhenMinimizedField; 982 | } 983 | set { 984 | this.showOnDemandContactsWhenMinimizedField = value; 985 | } 986 | } 987 | 988 | /// 989 | [System.Xml.Serialization.XmlIgnoreAttribute()] 990 | public bool showOnDemandContactsWhenMinimizedSpecified { 991 | get { 992 | return this.showOnDemandContactsWhenMinimizedFieldSpecified; 993 | } 994 | set { 995 | this.showOnDemandContactsWhenMinimizedFieldSpecified = value; 996 | } 997 | } 998 | 999 | /// 1000 | public string hashFunction { 1001 | get { 1002 | return this.hashFunctionField; 1003 | } 1004 | set { 1005 | this.hashFunctionField = value; 1006 | } 1007 | } 1008 | } 1009 | 1010 | /// 1011 | [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] 1012 | [System.SerializableAttribute()] 1013 | [System.Diagnostics.DebuggerStepThroughAttribute()] 1014 | [System.ComponentModel.DesignerCategoryAttribute("code")] 1015 | [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://schemas.microsoft.com/office/outlook/2010/06/socialprovider.xsd")] 1016 | [System.Xml.Serialization.XmlRootAttribute(Namespace="http://schemas.microsoft.com/office/outlook/2010/06/socialprovider.xsd", IsNullable=false)] 1017 | public partial class hashedAddresses { 1018 | 1019 | private personAddressType[] personAddressesField; 1020 | 1021 | /// 1022 | [System.Xml.Serialization.XmlElementAttribute("personAddresses")] 1023 | public personAddressType[] personAddresses { 1024 | get { 1025 | return this.personAddressesField; 1026 | } 1027 | set { 1028 | this.personAddressesField = value; 1029 | } 1030 | } 1031 | } 1032 | 1033 | /// 1034 | [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] 1035 | [System.SerializableAttribute()] 1036 | [System.Diagnostics.DebuggerStepThroughAttribute()] 1037 | [System.ComponentModel.DesignerCategoryAttribute("code")] 1038 | [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://schemas.microsoft.com/office/outlook/2010/06/socialprovider.xsd")] 1039 | [System.Xml.Serialization.XmlRootAttribute(Namespace="http://schemas.microsoft.com/office/outlook/2010/06/socialprovider.xsd", IsNullable=false)] 1040 | public partial class friends { 1041 | 1042 | private personType[] personField; 1043 | 1044 | /// 1045 | [System.Xml.Serialization.XmlElementAttribute("person")] 1046 | public personType[] person { 1047 | get { 1048 | return this.personField; 1049 | } 1050 | set { 1051 | this.personField = value; 1052 | } 1053 | } 1054 | } 1055 | 1056 | /// 1057 | [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] 1058 | [System.SerializableAttribute()] 1059 | [System.Diagnostics.DebuggerStepThroughAttribute()] 1060 | [System.ComponentModel.DesignerCategoryAttribute("code")] 1061 | [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.microsoft.com/office/outlook/2010/06/socialprovider.xsd")] 1062 | [System.Xml.Serialization.XmlRootAttribute("person", Namespace="http://schemas.microsoft.com/office/outlook/2010/06/socialprovider.xsd", IsNullable=false)] 1063 | public partial class personType { 1064 | 1065 | private string userIDField; 1066 | 1067 | private string firstNameField; 1068 | 1069 | private string lastNameField; 1070 | 1071 | private string fullNameField; 1072 | 1073 | private string nicknameField; 1074 | 1075 | private string fileAsField; 1076 | 1077 | private string companyField; 1078 | 1079 | private string titleField; 1080 | 1081 | private System.DateTime anniversaryField; 1082 | 1083 | private bool anniversaryFieldSpecified; 1084 | 1085 | private System.DateTime birthdayField; 1086 | 1087 | private bool birthdayFieldSpecified; 1088 | 1089 | private string emailAddressField; 1090 | 1091 | private string emailAddress2Field; 1092 | 1093 | private string emailAddress3Field; 1094 | 1095 | private string webProfilePageField; 1096 | 1097 | private string phoneField; 1098 | 1099 | private string cellField; 1100 | 1101 | private string homePhoneField; 1102 | 1103 | private string workPhoneField; 1104 | 1105 | private string addressField; 1106 | 1107 | private string cityField; 1108 | 1109 | private string stateField; 1110 | 1111 | private string countryOrRegionField; 1112 | 1113 | private string zipField; 1114 | 1115 | private string relationshipField; 1116 | 1117 | private System.DateTime creationTimeField; 1118 | 1119 | private bool creationTimeFieldSpecified; 1120 | 1121 | private System.DateTime lastModificationTimeField; 1122 | 1123 | private bool lastModificationTimeFieldSpecified; 1124 | 1125 | private System.DateTime expirationTimeField; 1126 | 1127 | private bool expirationTimeFieldSpecified; 1128 | 1129 | private string genderField; 1130 | 1131 | private int indexField; 1132 | 1133 | private bool indexFieldSpecified; 1134 | 1135 | private string pictureUrlField; 1136 | 1137 | private string friendStatusField; 1138 | 1139 | /// 1140 | public string userID { 1141 | get { 1142 | return this.userIDField; 1143 | } 1144 | set { 1145 | this.userIDField = value; 1146 | } 1147 | } 1148 | 1149 | /// 1150 | public string firstName { 1151 | get { 1152 | return this.firstNameField; 1153 | } 1154 | set { 1155 | this.firstNameField = value; 1156 | } 1157 | } 1158 | 1159 | /// 1160 | public string lastName { 1161 | get { 1162 | return this.lastNameField; 1163 | } 1164 | set { 1165 | this.lastNameField = value; 1166 | } 1167 | } 1168 | 1169 | /// 1170 | public string fullName { 1171 | get { 1172 | return this.fullNameField; 1173 | } 1174 | set { 1175 | this.fullNameField = value; 1176 | } 1177 | } 1178 | 1179 | /// 1180 | public string nickname { 1181 | get { 1182 | return this.nicknameField; 1183 | } 1184 | set { 1185 | this.nicknameField = value; 1186 | } 1187 | } 1188 | 1189 | /// 1190 | public string fileAs { 1191 | get { 1192 | return this.fileAsField; 1193 | } 1194 | set { 1195 | this.fileAsField = value; 1196 | } 1197 | } 1198 | 1199 | /// 1200 | public string company { 1201 | get { 1202 | return this.companyField; 1203 | } 1204 | set { 1205 | this.companyField = value; 1206 | } 1207 | } 1208 | 1209 | /// 1210 | public string title { 1211 | get { 1212 | return this.titleField; 1213 | } 1214 | set { 1215 | this.titleField = value; 1216 | } 1217 | } 1218 | 1219 | /// 1220 | [System.Xml.Serialization.XmlElementAttribute(DataType="date")] 1221 | public System.DateTime anniversary { 1222 | get { 1223 | return this.anniversaryField; 1224 | } 1225 | set { 1226 | this.anniversaryField = value; 1227 | } 1228 | } 1229 | 1230 | /// 1231 | [System.Xml.Serialization.XmlIgnoreAttribute()] 1232 | public bool anniversarySpecified { 1233 | get { 1234 | return this.anniversaryFieldSpecified; 1235 | } 1236 | set { 1237 | this.anniversaryFieldSpecified = value; 1238 | } 1239 | } 1240 | 1241 | /// 1242 | [System.Xml.Serialization.XmlElementAttribute(DataType="date")] 1243 | public System.DateTime birthday { 1244 | get { 1245 | return this.birthdayField; 1246 | } 1247 | set { 1248 | this.birthdayField = value; 1249 | } 1250 | } 1251 | 1252 | /// 1253 | [System.Xml.Serialization.XmlIgnoreAttribute()] 1254 | public bool birthdaySpecified { 1255 | get { 1256 | return this.birthdayFieldSpecified; 1257 | } 1258 | set { 1259 | this.birthdayFieldSpecified = value; 1260 | } 1261 | } 1262 | 1263 | /// 1264 | public string emailAddress { 1265 | get { 1266 | return this.emailAddressField; 1267 | } 1268 | set { 1269 | this.emailAddressField = value; 1270 | } 1271 | } 1272 | 1273 | /// 1274 | public string emailAddress2 { 1275 | get { 1276 | return this.emailAddress2Field; 1277 | } 1278 | set { 1279 | this.emailAddress2Field = value; 1280 | } 1281 | } 1282 | 1283 | /// 1284 | public string emailAddress3 { 1285 | get { 1286 | return this.emailAddress3Field; 1287 | } 1288 | set { 1289 | this.emailAddress3Field = value; 1290 | } 1291 | } 1292 | 1293 | /// 1294 | public string webProfilePage { 1295 | get { 1296 | return this.webProfilePageField; 1297 | } 1298 | set { 1299 | this.webProfilePageField = value; 1300 | } 1301 | } 1302 | 1303 | /// 1304 | public string phone { 1305 | get { 1306 | return this.phoneField; 1307 | } 1308 | set { 1309 | this.phoneField = value; 1310 | } 1311 | } 1312 | 1313 | /// 1314 | public string cell { 1315 | get { 1316 | return this.cellField; 1317 | } 1318 | set { 1319 | this.cellField = value; 1320 | } 1321 | } 1322 | 1323 | /// 1324 | public string homePhone { 1325 | get { 1326 | return this.homePhoneField; 1327 | } 1328 | set { 1329 | this.homePhoneField = value; 1330 | } 1331 | } 1332 | 1333 | /// 1334 | public string workPhone { 1335 | get { 1336 | return this.workPhoneField; 1337 | } 1338 | set { 1339 | this.workPhoneField = value; 1340 | } 1341 | } 1342 | 1343 | /// 1344 | public string address { 1345 | get { 1346 | return this.addressField; 1347 | } 1348 | set { 1349 | this.addressField = value; 1350 | } 1351 | } 1352 | 1353 | /// 1354 | public string city { 1355 | get { 1356 | return this.cityField; 1357 | } 1358 | set { 1359 | this.cityField = value; 1360 | } 1361 | } 1362 | 1363 | /// 1364 | public string state { 1365 | get { 1366 | return this.stateField; 1367 | } 1368 | set { 1369 | this.stateField = value; 1370 | } 1371 | } 1372 | 1373 | /// 1374 | public string countryOrRegion { 1375 | get { 1376 | return this.countryOrRegionField; 1377 | } 1378 | set { 1379 | this.countryOrRegionField = value; 1380 | } 1381 | } 1382 | 1383 | /// 1384 | public string zip { 1385 | get { 1386 | return this.zipField; 1387 | } 1388 | set { 1389 | this.zipField = value; 1390 | } 1391 | } 1392 | 1393 | /// 1394 | public string relationship { 1395 | get { 1396 | return this.relationshipField; 1397 | } 1398 | set { 1399 | this.relationshipField = value; 1400 | } 1401 | } 1402 | 1403 | /// 1404 | public System.DateTime creationTime { 1405 | get { 1406 | return this.creationTimeField; 1407 | } 1408 | set { 1409 | this.creationTimeField = value; 1410 | } 1411 | } 1412 | 1413 | /// 1414 | [System.Xml.Serialization.XmlIgnoreAttribute()] 1415 | public bool creationTimeSpecified { 1416 | get { 1417 | return this.creationTimeFieldSpecified; 1418 | } 1419 | set { 1420 | this.creationTimeFieldSpecified = value; 1421 | } 1422 | } 1423 | 1424 | /// 1425 | public System.DateTime lastModificationTime { 1426 | get { 1427 | return this.lastModificationTimeField; 1428 | } 1429 | set { 1430 | this.lastModificationTimeField = value; 1431 | } 1432 | } 1433 | 1434 | /// 1435 | [System.Xml.Serialization.XmlIgnoreAttribute()] 1436 | public bool lastModificationTimeSpecified { 1437 | get { 1438 | return this.lastModificationTimeFieldSpecified; 1439 | } 1440 | set { 1441 | this.lastModificationTimeFieldSpecified = value; 1442 | } 1443 | } 1444 | 1445 | /// 1446 | public System.DateTime expirationTime { 1447 | get { 1448 | return this.expirationTimeField; 1449 | } 1450 | set { 1451 | this.expirationTimeField = value; 1452 | } 1453 | } 1454 | 1455 | /// 1456 | [System.Xml.Serialization.XmlIgnoreAttribute()] 1457 | public bool expirationTimeSpecified { 1458 | get { 1459 | return this.expirationTimeFieldSpecified; 1460 | } 1461 | set { 1462 | this.expirationTimeFieldSpecified = value; 1463 | } 1464 | } 1465 | 1466 | /// 1467 | public string gender { 1468 | get { 1469 | return this.genderField; 1470 | } 1471 | set { 1472 | this.genderField = value; 1473 | } 1474 | } 1475 | 1476 | /// 1477 | public int index { 1478 | get { 1479 | return this.indexField; 1480 | } 1481 | set { 1482 | this.indexField = value; 1483 | } 1484 | } 1485 | 1486 | /// 1487 | [System.Xml.Serialization.XmlIgnoreAttribute()] 1488 | public bool indexSpecified { 1489 | get { 1490 | return this.indexFieldSpecified; 1491 | } 1492 | set { 1493 | this.indexFieldSpecified = value; 1494 | } 1495 | } 1496 | 1497 | /// 1498 | public string pictureUrl { 1499 | get { 1500 | return this.pictureUrlField; 1501 | } 1502 | set { 1503 | this.pictureUrlField = value; 1504 | } 1505 | } 1506 | 1507 | /// 1508 | public string friendStatus { 1509 | get { 1510 | return this.friendStatusField; 1511 | } 1512 | set { 1513 | this.friendStatusField = value; 1514 | } 1515 | } 1516 | } 1517 | } 1518 | -------------------------------------------------------------------------------- /GravatarOSC/SocialProviderSchemaIncoming.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Xml.Serialization; 3 | 4 | // ReSharper disable InconsistentNaming 5 | namespace OSCSchema2 6 | { 7 | [Serializable] 8 | [XmlRootAttribute(Namespace = "", IsNullable = false)] 9 | public partial class hashedAddresses { 10 | 11 | private personAddressType[] personAddressesField; 12 | 13 | [XmlElementAttribute("personAddresses")] 14 | public personAddressType[] personAddresses { 15 | get { return this.personAddressesField; } 16 | set { this.personAddressesField = value; } 17 | } 18 | } 19 | 20 | [Serializable] 21 | [XmlTypeAttribute(Namespace = "")] 22 | public partial class personAddressType { 23 | private string[] hashedAddressField; 24 | private int indexField; 25 | 26 | [XmlElementAttribute("hashedAddress")] 27 | public string[] hashedAddress { 28 | get { return this.hashedAddressField; } 29 | set { this.hashedAddressField = value; } 30 | } 31 | 32 | [XmlAttributeAttribute()] 33 | public int index { 34 | get { return this.indexField; } 35 | set { this.indexField = value; } 36 | } 37 | } 38 | } 39 | // ReSharper restore InconsistentNaming -------------------------------------------------------------------------------- /Install32.cmd: -------------------------------------------------------------------------------- 1 | %windir%\Microsoft.NET\Framework\v4.0.30319\regasm /codebase GravatarOSC.dll 2 | %windir%\regedit.exe SocialProvider.reg -------------------------------------------------------------------------------- /Install64.cmd: -------------------------------------------------------------------------------- 1 | %windir%\Microsoft.NET\Framework64\v4.0.30319\regasm /codebase GravatarOSC.dll 2 | %windir%\regedit.exe SocialProvider.reg -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | Outlook Social connector for Gravatar 2 | ======== 3 | This connector allows you to see the Gravatar picture of your email participants directly in Outlook 2010/2013. Please be aware the Microsoft has stopped supporting the integration point this add-in uses as of Outlook 2016 and it therefore no longer works. 4 | 5 | #### Install Instructions 6 | 1. Extract a release ZIP into a folder of your liking 7 | 2. Depending on whether you use 32 or 64 bit Outlook, execute the appropriate Install batch script 8 | 3. When ever you move the files, you have to re-execute the install script 9 | 10 | #### Build/Develop Instructions 11 | 1. Find a machine with Outlook 2010 or 2013 and Visual Studio (e.g. 2017) 12 | 2. Clone the repo 13 | 3. Load the SocialProvider.reg and the GravatarOSC/Other Stuff/EnableDebugging.reg 14 | 4. Open Visual Studio as Administrator and open solution from repo 15 | 5. ***Note:*** if you are not using 32bit Outlook 2013, you will have to adjust the executable path. 16 | 6. Start using the Debug profile 17 | 18 | #### Release Instructions 19 | 1. Copy install cmd's, the reg file and the dll's from the Release folder into a clean new folder 20 | 2. ZIP it up and upload to GitHub 21 | 22 | ## .NET Library for Gravatar 23 | Fork of http://gravatarnet.codeplex.com to incorporate Gravatar profile support. 24 | -------------------------------------------------------------------------------- /SocialProvider.reg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/02strich/outlook-gravatar-connector/16183c98dd9b06b35c1a9060a7695128b696ad8d/SocialProvider.reg -------------------------------------------------------------------------------- /create_package.py: -------------------------------------------------------------------------------- 1 | import os 2 | import zipfile 3 | 4 | myZipFile = zipfile.ZipFile("gravatar-osc.zip", "w" ) 5 | myZipFile.write("Install32.cmd") 6 | myZipFile.write("Install64.cmd") 7 | myZipFile.write("GravatarOSC\\bin\\Release\\Gravatar.NET.dll", "Gravatar.NET.dll") 8 | myZipFile.write("GravatarOSC\\bin\\Release\\GravatarOSC.dll", "GravatarOSC.dll") 9 | myZipFile.write("GravatarOSC\\bin\\Release\\OutlookSocialProvider.dll", "OutlookSocialProvider.dll") 10 | --------------------------------------------------------------------------------