Class QuestionActivity
- Namespace
- ActivityPub.Types.AS.Extended.Activity
- Assembly
- ActivityPub.Types.dll
Represents a question being asked. Question objects are an extension of IntransitiveActivity. That is, the Question object is an Activity, but the direct object is the question itself and therefore it would not contain an object property. Either of the anyOf and oneOf properties MAY be used to express possible answers, but a Question object MUST NOT have both properties.
public class QuestionActivity : ASIntransitiveActivity, IASModel<ASType, ASTypeEntity>, IASModel<ASType>, IASModel<ASObject, ASObjectEntity, ASType>, IASModel<ASObject, ASObjectEntity>, IASModel<ASObject>, IASModel<ASActivity, ASActivityEntity, ASObject>, IASModel<ASActivity, ASActivityEntity>, IASModel<ASActivity>, IASModel<ASIntransitiveActivity, ASIntransitiveActivityEntity, ASActivity>, IASModel<ASIntransitiveActivity, ASIntransitiveActivityEntity>, IASModel<ASIntransitiveActivity>, IASModel<QuestionActivity, QuestionActivityEntity, ASIntransitiveActivity>, IASModel<QuestionActivity, QuestionActivityEntity>, IASModel<QuestionActivity>
- Inheritance
-
QuestionActivity
- Implements
- Inherited Members
Constructors
QuestionActivity()
Constructs a new instance and attaches it to a new, empty type graph.
public QuestionActivity()
QuestionActivity(ASType)
Constructs a new instance and extends an existing type graph from a provided model.
public QuestionActivity(ASType existingGraph)
Parameters
existingGraph
ASType
- See Also
-
Extend<TModel, TEntity>()
QuestionActivity(TypeMap, QuestionActivityEntity?)
public QuestionActivity(TypeMap typeMap, QuestionActivityEntity? entity)
Parameters
typeMap
TypeMapentity
QuestionActivityEntity
QuestionActivity(TypeMap, bool)
Constructs a new instance from an existing type graph. The existing graph is either extended or wrapped, depending on the value of
isExtending
public QuestionActivity(TypeMap typeMap, bool isExtending = true)
Parameters
Remarks
All overrides MUST call this using
base(typeMap, false)
Exceptions
- InvalidOperationException
If
is true and the entity type already exists in the graphextendGraph
- InvalidOperationException
If
is true and the entity requires another entity that is missing from the graphextendGraph
- InvalidCastException
If
is false and the object is not of typeextendGraph
TEntity
- See Also
Fields
QuestionType
ActivityStreams type name for "Question" types.
[PublicAPI]
public const string QuestionType = "Question"
Field Value
Properties
AllowMultiple
Indicates whether this question accepts multiple responses. If true, then multiple options can be selected. If false (default), then only one option may be selected.
public bool AllowMultiple { get; set; }
Property Value
Remarks
This is a synthetic field implemented to simplify parts of the Question schema. It does not exist in the ActivityStreams specification.
This field controls how the question is serialized. If true, then Options will map to "anyOf". Otherwise, it maps to "oneOf".
Closed
Indicates that a question has been closed, and answers are no longer accepted.
public FlagWithTimestamp? Closed { get; set; }
Property Value
Remarks
We don't support the Object or Link forms, because what would that even mean??
- See Also
Entity
private QuestionActivityEntity Entity { get; }
Property Value
Options
The list of options for this Question.
public LinkableList<ASObject>? Options { get; set; }
Property Value
Remarks
This is a semi-synthetic property. It does not exist in the ActivityStreams specification, but encapsulates the usage of both "oneOf" and "anyOf".
- See Also
Explicit Interface Implementations
IASModel<QuestionActivity>.ASTypeName
AS type name of this entity. For the full list of names in the object graph, use ASTypes.
static string IASModel<QuestionActivity>.ASTypeName { get; }
Returns
IASModel<QuestionActivity>.FromGraph(TypeMap)
Constructs an instance from this type from a pre-populated type graph. The provided TypeMap instance is guaranteed to include an instance of type EntityType.
static QuestionActivity IASModel<QuestionActivity>.FromGraph(TypeMap typeMap)
Parameters
typeMap
TypeMap