C# Class Facebook.Extensions

Provides extension methods to types within the OpenGraph.NET API.
Mostra file Open project: prabirshrestha/opengraph.net

Public Methods

Method Description
Clear ( this sourcePermissions, ExtendedPermissions toRemove ) : ExtendedPermissions

Ensures that the permissions within toRemove are not included in the set of permissions.

Format ( this val ) : string

Formats the value of an EventPrivacy value into a string.

IsSet ( this permissions, ExtendedPermissions toCheck ) : bool

Checks to see whether one or more permissions are set for a given permissions entry.

ParseIntoPermissions ( this extendedPermissions ) : ExtendedPermissions

Parses a Graph API-compatible string of extended permissions into its equivalent ExtendedPermissions enumeration instance.

Print ( this permissions ) : string

Renders a Graph API-compatible string representation of an ExtendedPermissions instance.

Set ( this sourcePermissions, ExtendedPermissions toAdd ) : ExtendedPermissions

Ensures that toAdd permissions are included within the sourcePermissions permissions set, and returns the result.

The contents of sourcePermissions are not changed. However, you could fluently add permissions by chaining these calls together:

ExtendedPermissions result = ExtendedPermissions.Friend.Set(ExtendedPermissions.OfflineAccess).Set(ExtendedPermissions.ReadMailbox);

Private Methods

Method Description
AsToken ( this src ) : JToken
CopyToStream ( this source, Stream destination ) : void
HexToBytes ( this src ) : byte[]
ReadToString ( this source ) : string
SplitIntoDictionary ( this dataString, char splitter = '&' ) : string>.Dictionary
ToHex ( this src ) : string
ToMd5String ( this src ) : string
ToMd5String ( this src, Encoding encoding ) : string
ToPostString ( string>.this postData ) : string
UrlEncode ( this stringToEncode ) : string

Method Details

Clear() public static method

Ensures that the permissions within toRemove are not included in the set of permissions.
public static Clear ( this sourcePermissions, ExtendedPermissions toRemove ) : ExtendedPermissions
sourcePermissions this The permissions from which to clear the desired permissions.
toRemove ExtendedPermissions The permissions to remove.
return ExtendedPermissions

Format() public static method

Formats the value of an EventPrivacy value into a string.
[Non-Silverlight] Thrown when is not a valid /// value of . [Silverlight] Thrown when is not a valid value /// of .
public static Format ( this val ) : string
val this The value to render.
return string

IsSet() public static method

Checks to see whether one or more permissions are set for a given permissions entry.
public static IsSet ( this permissions, ExtendedPermissions toCheck ) : bool
permissions this The permissions to check.
toCheck ExtendedPermissions The permissions to see if they are set.
return bool

ParseIntoPermissions() public static method

Parses a Graph API-compatible string of extended permissions into its equivalent ExtendedPermissions enumeration instance.
public static ParseIntoPermissions ( this extendedPermissions ) : ExtendedPermissions
extendedPermissions this The text to parse.
return ExtendedPermissions

Print() public static method

Renders a Graph API-compatible string representation of an ExtendedPermissions instance.
public static Print ( this permissions ) : string
permissions this The permissions to render.
return string

Set() public static method

Ensures that toAdd permissions are included within the sourcePermissions permissions set, and returns the result.

The contents of sourcePermissions are not changed. However, you could fluently add permissions by chaining these calls together:

ExtendedPermissions result = ExtendedPermissions.Friend.Set(ExtendedPermissions.OfflineAccess).Set(ExtendedPermissions.ReadMailbox);
public static Set ( this sourcePermissions, ExtendedPermissions toAdd ) : ExtendedPermissions
sourcePermissions this The permissions to which to set the additional permissions.
toAdd ExtendedPermissions The additional permissions to add.
return ExtendedPermissions