C# Class FlickrNet.UtilityMethods

Internal class providing certain utility functions to other classes.
Afficher le fichier Open project: liquidboy/X Class Usage Examples

Méthodes publiques

Méthode Description
AuthLevelToString ( AuthLevel level ) : string

Converts AuthLevel to a string.

BuddyIcon ( string server, string farm, string userId ) : string

Returns the buddy icon for a given set of server, farm and userid. If no server is present then returns the standard buddy icon.

DateToUnixTimestamp ( System.DateTime date ) : string

Converts a DateTime object into a unix timestamp number.

EscapeOAuthString ( string text ) : string

Escapes a string for use with OAuth.

The only valid characters are Alphanumerics and "-", "_", "." and "~". Everything else is hex encoded.

ExtrasToString ( PhotoSearchExtras extras ) : string

Utility method to convert the PhotoSearchExtras enum to a string.

MD5Hash ( string data ) : string

Generates an MD5 Hash of the passed in string.

MachineTagModeToString ( MachineTagMode machineTagMode ) : string

Convert a MachineTagMode to a string used when passing to Flickr.

MediaTypeToString ( MediaType mediaType ) : string

Converts a MediaType enumeration into a string used by Flickr.

ParseDateWithGranularity ( string date ) : System.DateTime

Parses a date which may contain only a vald year component.

PartialOptionsIntoArray ( PartialSearchOptions options, string>.Dictionary parameters ) : void

Adds the partial options to the passed in Hashtable.

Sha1Encrypt ( string baseString, string keyString ) : string
SortOrderToString ( PhotoSearchSortOrder order ) : string

Converts a PhotoSearchSortOrder into a string for use by the Flickr API.

SortOrderToString ( PopularitySort sortOrder ) : string

Converts a PopularitySort enum to a string.

StringToDictionary ( string response ) : string>.Dictionary

Converts a URL parameter encoded string into a dictionary.

e.g. ab=cd&ef=gh will return a dictionary of { "ab" => "cd", "ef" => "gh" }.

TagModeToString ( TagMode tagMode ) : string

Convert a TagMode to a string used when passing to Flickr.

UnixTimestampToDate ( long timestamp ) : System.DateTime

Converts a long, representing a unix timestamp number into a DateTime object.

UnixTimestampToDate ( string timestamp ) : System.DateTime

Converts a string, representing a unix timestamp number into a DateTime object.

UrlEncode ( string data ) : string

Encodes a URL quesrystring data component.

Private Methods

Méthode Description
CheckParsingException ( XmlReader reader ) : void
DateToMySql ( System.DateTime date ) : string
MemberTypeToString ( MemberTypes memberTypes ) : string
ParseIdToMemberType ( string memberTypeId ) : MemberTypes
ReadInt32 ( Stream s ) : int
ReadString ( Stream s ) : string
UrlFormat ( Photo p, string size, string extension ) : string
UrlFormat ( PhotoInfo p, string size, string extension ) : string
UrlFormat ( Photoset p, string size, string extension ) : string
UrlFormat ( string format ) : string
UrlFormat ( string farm, string server, string photoid, string secret, string size, string extension ) : string
UtilityMethods ( ) : System
WriteInt32 ( Stream s, int i ) : void
WriteString ( Stream s, string str ) : void

Method Details

AuthLevelToString() public static méthode

Converts AuthLevel to a string.
public static AuthLevelToString ( AuthLevel level ) : string
level AuthLevel The level to convert.
Résultat string

BuddyIcon() public static méthode

Returns the buddy icon for a given set of server, farm and userid. If no server is present then returns the standard buddy icon.
public static BuddyIcon ( string server, string farm, string userId ) : string
server string
farm string
userId string
Résultat string

DateToUnixTimestamp() public static méthode

Converts a DateTime object into a unix timestamp number.
public static DateToUnixTimestamp ( System.DateTime date ) : string
date System.DateTime The date to convert.
Résultat string

EscapeOAuthString() public static méthode

Escapes a string for use with OAuth.
The only valid characters are Alphanumerics and "-", "_", "." and "~". Everything else is hex encoded.
public static EscapeOAuthString ( string text ) : string
text string The text to escape.
Résultat string

ExtrasToString() public static méthode

Utility method to convert the PhotoSearchExtras enum to a string.
public static ExtrasToString ( PhotoSearchExtras extras ) : string
extras PhotoSearchExtras
Résultat string

MD5Hash() public static méthode

Generates an MD5 Hash of the passed in string.
public static MD5Hash ( string data ) : string
data string The unhashed string.
Résultat string

MachineTagModeToString() public static méthode

Convert a MachineTagMode to a string used when passing to Flickr.
public static MachineTagModeToString ( MachineTagMode machineTagMode ) : string
machineTagMode MachineTagMode The machine tag mode to convert.
Résultat string

MediaTypeToString() public static méthode

Converts a MediaType enumeration into a string used by Flickr.
public static MediaTypeToString ( MediaType mediaType ) : string
mediaType MediaType The value to convert.
Résultat string

ParseDateWithGranularity() public static méthode

Parses a date which may contain only a vald year component.
public static ParseDateWithGranularity ( string date ) : System.DateTime
date string The date, as a string, to be parsed.
Résultat System.DateTime

PartialOptionsIntoArray() public static méthode

Adds the partial options to the passed in Hashtable.
public static PartialOptionsIntoArray ( PartialSearchOptions options, string>.Dictionary parameters ) : void
options PartialSearchOptions The options to convert to an array.
parameters string>.Dictionary The to add the option key value pairs to.
Résultat void

Sha1Encrypt() public static méthode

public static Sha1Encrypt ( string baseString, string keyString ) : string
baseString string
keyString string
Résultat string

SortOrderToString() public static méthode

Converts a PhotoSearchSortOrder into a string for use by the Flickr API.
public static SortOrderToString ( PhotoSearchSortOrder order ) : string
order PhotoSearchSortOrder The sort order to convert.
Résultat string

SortOrderToString() public static méthode

Converts a PopularitySort enum to a string.
public static SortOrderToString ( PopularitySort sortOrder ) : string
sortOrder PopularitySort The value to convert.
Résultat string

StringToDictionary() public static méthode

Converts a URL parameter encoded string into a dictionary.
e.g. ab=cd&ef=gh will return a dictionary of { "ab" => "cd", "ef" => "gh" }.
public static StringToDictionary ( string response ) : string>.Dictionary
response string
Résultat string>.Dictionary

TagModeToString() public static méthode

Convert a TagMode to a string used when passing to Flickr.
public static TagModeToString ( TagMode tagMode ) : string
tagMode TagMode The tag mode to convert.
Résultat string

UnixTimestampToDate() public static méthode

Converts a long, representing a unix timestamp number into a DateTime object.
public static UnixTimestampToDate ( long timestamp ) : System.DateTime
timestamp long The unix timestamp.
Résultat System.DateTime

UnixTimestampToDate() public static méthode

Converts a string, representing a unix timestamp number into a DateTime object.
public static UnixTimestampToDate ( string timestamp ) : System.DateTime
timestamp string The timestamp, as a string.
Résultat System.DateTime

UrlEncode() public static méthode

Encodes a URL quesrystring data component.
public static UrlEncode ( string data ) : string
data string The data to encode.
Résultat string