14 [CollectionName(
"ContractReferences")]
16 [Index(
"IsTemplate",
"ContractLoaded",
"Category",
"Name",
"Created")]
62 public string?
Name {
get;
set; }
96 if (this.contract is
null && !
string.IsNullOrEmpty(this.
ContractXml))
98 XmlDocument Doc =
new()
100 PreserveWhitespace =
true
109 return this.contract;
122 this.ContractXml =
null;
123 this.ContractLoaded =
false;
124 this.IsTemplate =
false;
125 this.IsTokenCreationTemplate =
false;
126 this.Name =
string.Empty;
127 this.Category =
string.Empty;
132 StringBuilder Xml =
new();
134 this.ContractXml = Xml.ToString();
135 this.ContractLoaded =
true;
137 this.IsTemplate = Contract.PartsMode ==
ContractParts.TemplateOnly;
141 this.Loaded = DateTime.UtcNow;
143 this.IsTokenCreationTemplate =
145 Contract.ForMachinesLocalName ==
"Create" &&
Contains a local reference to a contract that the user has created or signed.
DateTime Created
When object was created
string? Name
Name of contract
string? ContractXml
XML of contract.
string? Category
Category of contract
ContractState State
Contract state
async Task< Contract?> GetContract()
Gets a parsed contract.
bool ContractLoaded
If a local copy of the contract is available.
string? ObjectId
Object ID
async Task SetContract(Contract Contract)
Sets a parsed contract.
bool IsTemplate
If the contract can work as a template
bool IsTokenCreationTemplate
If the contract represents a token creation template
DateTime Loaded
When object was last loaded.
DateTime Updated
When object was last updated.
CaseInsensitiveString? ContractId
Contract reference
ContractReference()
Contains a local reference to a contract that the user has created or signed.
Base class that references services in the app.
static IXmppService XmppService
The XMPP service for XMPP communication.
The data model for a contract.
static async Task< string > GetName(Contract? Contract)
Gets a displayable name for a contract.
static async Task< string?> GetCategory(Contract Contract)
Gets the category of a contract
const string NamespaceNeuroFeatures
Namespace for Neuro-Features.
Contains the definition of a contract
static Task< ParsedContract > Parse(XmlDocument Xml)
Validates a contract XML Document, and returns the contract definition in it.
DateTime Created
When the contract was created
DateTime Updated
When the contract was last updated
void Serialize(StringBuilder Xml, bool IncludeNamespace, bool IncludeIdAttribute, bool IncludeClientSignatures, bool IncludeAttachments, bool IncludeStatus, bool IncludeServerSignature, bool IncludeAttachmentReferences)
Serializes the Contract, in normalized form.
ContractState State
Contract state
string ContractId
Contract identity
Contains information about a parsed contract.
Contract Contract
Contract object
Represents a case-insensitive string.
ContractParts
How the parts of the contract are defined.
ContractState
Recognized contract states