Class AchievementSyncCapabilities
What one connector can and cannot do, as the editor UI it drives needs to know before offering an action.
Inherited Members
Namespace: Serenity.Achievements.Application.Sync
Assembly: Serenity.Achievements.Application.dll
Syntax
public sealed class AchievementSyncCapabilities
Remarks
These flags and lists have to be honest, because the sync window builds its checkboxes, warnings and disabled buttons straight from them — a capability this type claims but a connector cannot actually deliver shows an author a control that fails when pressed, instead of one that was never offered.
Constructors
AchievementSyncCapabilities(Fields)
Creates a capabilities set.
Declaration
public AchievementSyncCapabilities(AchievementSyncCapabilities.Fields fields)
Parameters
| Type | Name | Description |
|---|---|---|
| AchievementSyncCapabilities.Fields | fields | The values to build it from. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | When no fields were given. |
Fields
NeutralStoredIconDescription
What a review says about the icon a storefront keeps when its connector says nothing more.
Declaration
public const string NeutralStoredIconDescription = "a copy of what was uploaded, which may not be the original"
Field Value
| Type | Description |
|---|---|
| string |
Properties
CanCreateOnPlatform
Declaration
public bool CanCreateOnPlatform { get; }
Property Value
| Type | Description |
|---|---|
| bool | Whether pushing a local-only achievement creates it on the platform. |
CanDeleteOnPlatform
Declaration
public bool CanDeleteOnPlatform { get; }
Property Value
| Type | Description |
|---|---|
| bool | Whether the connector can remove an achievement from the platform. |
CanPull
Declaration
public bool CanPull { get; }
Property Value
| Type | Description |
|---|---|
| bool | Whether the connector can read achievement definitions back from the platform. |
CanPush
Declaration
public bool CanPush { get; }
Property Value
| Type | Description |
|---|---|
| bool | Whether the connector can send achievement definitions to the platform. |
IconRequirement
Declaration
public AchievementIconRequirement IconRequirement { get; }
Property Value
| Type | Description |
|---|---|
| AchievementIconRequirement | Which icons the platform requires before it will accept a pushed achievement. |
PullableFields
Declaration
public IReadOnlyList<AchievementSyncFieldKind> PullableFields { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<AchievementSyncFieldKind> | The fields a pull can read. Empty means the connector cannot pull any field. |
PushableFields
Declaration
public IReadOnlyList<AchievementSyncFieldKind> PushableFields { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<AchievementSyncFieldKind> | The fields a push can send. Empty means the connector cannot push any field. |
RequiresManualPublish
Declaration
public bool RequiresManualPublish { get; }
Property Value
| Type | Description |
|---|---|
| bool | Whether a pushed change still needs a manual publish step on the platform's own portal. |
RequiresSignIn
Declaration
public bool RequiresSignIn { get; }
Property Value
| Type | Description |
|---|---|
| bool | Whether the connector needs an interactive sign-in before it can pull or push. |
StoredIconDescription
Declaration
public string StoredIconDescription { get; }
Property Value
| Type | Description |
|---|---|
| string | How the platform keeps an icon it was sent, in words that follow "the storefront keeps"; a neutral phrase when the connector says nothing, because the Application layer knows nothing of any storefront's format. |
SupportedLocaleCodes
Declaration
public IReadOnlyList<string> SupportedLocaleCodes { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<string> | The locale codes the platform accepts, or empty when the platform imposes no locale restriction of its own. |
Methods
AliasesOfLocale(string)
The other codes a project may spell the language of localeCode with.
Declaration
public IReadOnlyList<string> AliasesOfLocale(string localeCode)
Parameters
| Type | Name | Description |
|---|---|---|
| string | localeCode | A locale code the platform names. |
Returns
| Type | Description |
|---|---|
| IReadOnlyList<string> | The aliases, or none when the language has no other spelling. |
DisplayNameOfLocale(string)
The name the platform gives a language.
Declaration
public string DisplayNameOfLocale(string localeCode)
Parameters
| Type | Name | Description |
|---|---|---|
| string | localeCode | The locale code to name. |
Returns
| Type | Description |
|---|---|
| string | The platform's name for the language, or |
HasLanguageFor(string)
Whether the platform has a language for a given project locale code.
Declaration
public bool HasLanguageFor(string localeCode)
Parameters
| Type | Name | Description |
|---|---|---|
| string | localeCode | The locale code to check. |
Returns
| Type | Description |
|---|---|
| bool | True when the platform's languages are not known (PlatformLanguageLocaleCodes is empty) or name the locale; false when they are known and the locale is not among them. |
Supports(AchievementSyncFieldKind, AchievementSyncDirection)
Whether one field can travel in the given direction.
Declaration
public bool Supports(AchievementSyncFieldKind field, AchievementSyncDirection direction)
Parameters
| Type | Name | Description |
|---|---|---|
| AchievementSyncFieldKind | field | The field to check. |
| AchievementSyncDirection | direction | The direction to check it for. |
Returns
| Type | Description |
|---|---|
| bool | True when the field is listed for that direction. |
SupportsLocale(string)
Whether the platform accepts a given locale code.
Declaration
public bool SupportsLocale(string localeCode)
Parameters
| Type | Name | Description |
|---|---|---|
| string | localeCode | The locale code to check. |
Returns
| Type | Description |
|---|---|
| bool | True when SupportedLocaleCodes is empty (no restriction) or names the locale. |