Show / Hide Table of Contents

Interface ISocialNetwork

Describes an entity that can perform social functions (i.e. login, post)

Inherited Members
INamed.Name
Namespace: NFX.Web.Social
Assembly: NFX.Web.dll
Syntax
public interface ISocialNetwork : INamed

Properties

CanPost

Defines if a meeesage can be post to this social network

Declaration
bool CanPost { get; }
Property Value
Type Description
System.Boolean

CredentialsEntry

Specifies how service takes user credentials

Declaration
CredentialsEntryMethod CredentialsEntry { get; }
Property Value
Type Description
CredentialsEntryMethod

Description

Provides social network description, this default implementation returns the name of the class

Declaration
string Description { get; }
Property Value
Type Description
System.String

ID

Globally uniquelly identifies social network architype

Declaration
SocialNetID ID { get; }
Property Value
Type Description
SocialNetID

RequiresSpecifiedExternalLoginReference

Specifies if this provider requires to obtain temporary token before redirecting to social network login page. Currently only Twitter requires this routine

Declaration
bool RequiresSpecifiedExternalLoginReference { get; }
Property Value
Type Description
System.Boolean

ServiceURL

Returns the root public URL for the service

Declaration
string ServiceURL { get; }
Property Value
Type Description
System.String

Methods

CreateSocialUserInfo(Nullable<SocialUserInfoToken>)

Create an instance of social user info class. If parameters are null then creates new non-logged-in instance, otherwise, if parameters are set, then connects to network and tries to re-initializes SocialUser info with fresh data from the network (i.e. name, gender etc.) using the supplied net tokens, or throws if tokens are invalid (i.e. expired). This returned instance is usually stored in session for later use

Declaration
SocialUserInfo CreateSocialUserInfo(SocialUserInfoToken? existingToken = default (SocialUserInfoToken? ))
Parameters
Type Name Description
System.Nullable<SocialUserInfoToken> existingToken
Returns
Type Description
SocialUserInfo

SocialUserInfo instance

GetExternalLoginReference(String)

Returns href to login via social system/site

Declaration
string GetExternalLoginReference(string returnURL)
Parameters
Type Name Description
System.String returnURL
Returns
Type Description
System.String

GetPicture(SocialUserInfo, out String, String)

Returns user profile image or null if no image available. Picture kind specifies classification of pictures within profile i.e. "main", "small-icon" etc.

Declaration
Image GetPicture(SocialUserInfo userInfo, out string contentType, string pictureKind = null)
Parameters
Type Name Description
SocialUserInfo userInfo
System.String contentType
System.String pictureKind
Returns
Type Description
Image

GetPictureData(SocialUserInfo, out String, String)

Returns user profile image data along with content type or null if no image available. Picture kind specifies classification of pictures within profile i.e. "main", "small-icon" etc.

Declaration
byte[] GetPictureData(SocialUserInfo userInfo, out string contentType, string pictureKind = null)
Parameters
Type Name Description
SocialUserInfo userInfo
System.String contentType
System.String pictureKind
Returns
Type Description
System.Byte[]

GetSpecifiedExternalLoginReference(SocialUserInfo, String)

Returns social service login URL for "two-stage" login networks. Currently twitter only requires this

Declaration
string GetSpecifiedExternalLoginReference(SocialUserInfo userInfo, string returnURL)
Parameters
Type Name Description
SocialUserInfo userInfo

Context

System.String returnURL

Social site redirects browser here after login

Returns
Type Description
System.String

Social site login URL

ObtainTokensAndFillInfo(SocialUserInfo, JSONDataMap, String)

Fills user info with values from social network

Declaration
void ObtainTokensAndFillInfo(SocialUserInfo userInfo, JSONDataMap request, string returnURL)
Parameters
Type Name Description
SocialUserInfo userInfo

Context user info

JSONDataMap request

Context http request

System.String returnURL

Social network login URL (sometimes needed by social site just to ensure correct call)

PostMessage(SocialUserInfo, String)

Post message to social network

Declaration
void PostMessage(SocialUserInfo userInfo, string text)
Parameters
Type Name Description
SocialUserInfo userInfo

Context social user info

System.String text

Message to send

PrepareReturnURLParameter(String, Boolean)

Declaration
string PrepareReturnURLParameter(string returnURL, bool escape = true)
Parameters
Type Name Description
System.String returnURL
System.Boolean escape
Returns
Type Description
System.String

RenewLongTermTokens(SocialUserInfo)

Refreshes long term tokens (if provider needs them). Should be used in scenario like background server-side token renew routine

Declaration
void RenewLongTermTokens(SocialUserInfo userInfo)
Parameters
Type Name Description
SocialUserInfo userInfo

RetrieveUserInfo(SocialUserInfo)

Retrieves all user fields (e.g. screen name, email) but tokens.

Declaration
void RetrieveUserInfo(SocialUserInfo userInfo)
Parameters
Type Name Description
SocialUserInfo userInfo

Extension Methods

MiscUtils.NonNull<T>(T, Func<Exception>, String)
ObjectValueConversion.AsString(Object, String, ConvertErrorHandling)
ObjectValueConversion.AsNonNullOrEmptyString(Object)
ObjectValueConversion.AsLaconicConfig(Object, ConfigSectionNode, String, ConvertErrorHandling)
ObjectValueConversion.AsJSONConfig(Object, ConfigSectionNode, String, ConvertErrorHandling)
ObjectValueConversion.AsXMLConfig(Object, ConfigSectionNode, ConvertErrorHandling)
ObjectValueConversion.AsChar(Object, Char, ConvertErrorHandling)
ObjectValueConversion.AsNullableChar(Object, Nullable<Char>, ConvertErrorHandling)
ObjectValueConversion.AsByte(Object, Byte, ConvertErrorHandling)
ObjectValueConversion.AsNullableByte(Object, Nullable<Byte>, ConvertErrorHandling)
ObjectValueConversion.AsSByte(Object, SByte, ConvertErrorHandling)
ObjectValueConversion.AsNullableSByte(Object, Nullable<SByte>, ConvertErrorHandling)
ObjectValueConversion.AsShort(Object, Int16, ConvertErrorHandling)
ObjectValueConversion.AsNullableShort(Object, Nullable<Int16>, ConvertErrorHandling)
ObjectValueConversion.AsUShort(Object, UInt16, ConvertErrorHandling)
ObjectValueConversion.AsNullableUShort(Object, Nullable<UInt16>, ConvertErrorHandling)
ObjectValueConversion.AsInt(Object, Int32, ConvertErrorHandling)
ObjectValueConversion.AsNullableInt(Object, Nullable<Int32>, ConvertErrorHandling)
ObjectValueConversion.AsUInt(Object, UInt32, ConvertErrorHandling)
ObjectValueConversion.AsNullableUInt(Object, Nullable<UInt32>, ConvertErrorHandling)
ObjectValueConversion.AsLong(Object, Int64, ConvertErrorHandling)
ObjectValueConversion.AsNullableLong(Object, Nullable<Int64>, ConvertErrorHandling)
ObjectValueConversion.AsULong(Object, UInt64, ConvertErrorHandling)
ObjectValueConversion.AsNullableULong(Object, Nullable<UInt64>, ConvertErrorHandling)
ObjectValueConversion.AsDouble(Object, Double, ConvertErrorHandling)
ObjectValueConversion.AsNullableDouble(Object, Nullable<Double>, ConvertErrorHandling)
ObjectValueConversion.AsFloat(Object, Single, ConvertErrorHandling)
ObjectValueConversion.AsNullableFloat(Object, Nullable<Single>, ConvertErrorHandling)
ObjectValueConversion.AsDecimal(Object, Decimal, ConvertErrorHandling)
ObjectValueConversion.AsNullableDecimal(Object, Nullable<Decimal>, ConvertErrorHandling)
ObjectValueConversion.AsBool(Object, Boolean, ConvertErrorHandling)
ObjectValueConversion.AsNullableBool(Object, Nullable<Boolean>, ConvertErrorHandling)
ObjectValueConversion.AsGUID(Object, Guid, ConvertErrorHandling)
ObjectValueConversion.AsNullableGUID(Object, Nullable<Guid>, ConvertErrorHandling)
ObjectValueConversion.AsDateTime(Object)
ObjectValueConversion.AsDateTime(Object, DateTime, ConvertErrorHandling)
ObjectValueConversion.AsNullableDateTime(Object, Nullable<DateTime>, ConvertErrorHandling)
ObjectValueConversion.AsGDID(Object)
ObjectValueConversion.AsGDID(Object, GDID, ConvertErrorHandling)
ObjectValueConversion.AsNullableGDID(Object, Nullable<GDID>, ConvertErrorHandling)
ObjectValueConversion.AsGDIDSymbol(Object)
ObjectValueConversion.AsGDIDSymbol(Object, GDIDSymbol, ConvertErrorHandling)
ObjectValueConversion.AsNullableGDIDSymbol(Object, Nullable<GDIDSymbol>, ConvertErrorHandling)
ObjectValueConversion.AsTimeSpan(Object)
ObjectValueConversion.AsTimeSpan(Object, TimeSpan, ConvertErrorHandling)
ObjectValueConversion.AsNullableTimeSpan(Object, Nullable<TimeSpan>, ConvertErrorHandling)
ObjectValueConversion.AsEnum<TEnum>(Object, TEnum, ConvertErrorHandling)
ObjectValueConversion.AsNullableEnum<TEnum>(Object, Nullable<TEnum>, ConvertErrorHandling)
ObjectValueConversion.AsUri(Object, Uri, ConvertErrorHandling)
JSONExtensions.ToJSON(Object, JSONWritingOptions)
JSONExtensions.ToJSON(Object, TextWriter, JSONWritingOptions)
JSONExtensions.ToJSON(Object, Stream, JSONWritingOptions, Encoding)
ErlObject.ToErlObject(Object)
ErlObject.ToErlObject(Object, ErlTypeOrder, Boolean)
Back to top Copyright © 2006-2018 Agnicore Inc
Generated by DocFX