15 internal class ThingRegistryOrchestratorService :
LoadableService, IThingRegistryOrchestratorService
17 public ThingRegistryOrchestratorService()
21 public override Task Load(
bool isResuming, CancellationToken cancellationToken)
23 if (this.
BeginLoad(isResuming, cancellationToken))
26 return Task.CompletedTask;
29 public override Task Unload()
34 return Task.CompletedTask;
37 #region Event Handlers
41 public Task OpenClaimDevice(
string Uri)
43 MainThread.BeginInvokeOnMainThread(async () =>
48 return Task.CompletedTask;
51 public async Task OpenSearchDevices(
string Uri)
57 switch (Things.Length)
67 MainThread.BeginInvokeOnMainThread(async () =>
74 AllowSubscriptionFrom =
false,
77 LegalId =
string.Empty,
80 MetaData = Properties,
81 SourceId = Thing.
Node.SourceId,
82 Partition = Thing.
Node.Partition,
83 NodeId = Thing.
Node.NodeId,
85 RegistryJid = RegistryJid,
95 throw new NotImplementedException(
"Multiple devices were returned. Feature not implemented.");
105 public async Task OpenDeviceReference(
string Uri)
110 out
string? NodeId, out
string? PartitionId, out
MetaDataTag[]? Tags))
112 throw new InvalidOperationException(
"Not a direct reference URI.");
117 PartitionId ??
string.Empty, NodeId ??
string.Empty);
123 AllowSubscriptionFrom =
false,
126 LegalId =
string.Empty,
129 MetaData = Properties,
130 SourceId = SourceId ??
string.Empty,
131 Partition = PartitionId ??
string.Empty,
132 NodeId = NodeId ??
string.Empty,
140 if (Tag.
Name.Equals(
"R", StringComparison.OrdinalIgnoreCase))
144 else if (!(Info.
IsThing ??
false))
146 Info.MetaData = Merge(Info.
MetaData, Properties);
164 Dictionary<string, Property> Merged = [];
165 bool Changed =
false;
167 if (Stored is not
null)
173 if (FromUri is not
null)
189 Merged.Values.CopyTo(Result, 0);
bool BeginLoad(bool IsResuming, CancellationToken CancellationToken)
Sets the IsLoading flag if the service isn't already loading.
void EndLoad(bool isLoaded)
Sets the IsLoading and IsLoaded flags and fires an event representing the current load state of the s...
bool BeginUnload()
Sets the IsLoading flag if the service isn't already unloading.
void EndUnload()
Sets the IsLoading and IsLoaded flags and fires an event representing the current load state of the s...
Base class that references services in the app.
static IUiService UiService
Service serializing and managing UI-related tasks.
static IStringLocalizer Localizer
Localization service
static IXmppService XmppService
The XMPP service for XMPP communication.
The view model to bind to when displaying the list of things.
static ? NotificationEvent[] GetNotificationEvents(ContactInfo Thing)
Gets available notification events related to a thing.
Holds navigation parameters specific to claiming things.
A page that displays a specific claim thing.
The view model to bind to for when displaying thing claim information.
static ? string GetFriendlyName(IEnumerable< HumanReadableTag > Tags)
Get Friendly name of thing
static Property[] ToProperties(IEnumerable< HumanReadableTag > Tags)
Converts an enumerable set of HumanReadableTag to an enumerable set of Property.
Holds navigation parameters specific to viewing things.
A page that displays information about a thing and allows the user to interact with it.
string Name
Name of property
string Value
Property value
Contains information about a thing in a search result.
MetaDataTag[] Tags
Meta-data tags.
ThingReference Node
Node reference. Can be equal to ThingReference.Empty if not behind a concentrator.
Static interface for database persistence. In order to work, a database provider has to be assigned t...
static async Task Update(object Object)
Updates an object in the database.
Task DisplayException(Exception Exception, string? Title=null)
Displays an alert/message box to the user.
Task GoToAsync(string Route, BackMethod BackMethod=BackMethod.Inherited, string? UniqueId=null)
Navigates the AppShell to the specified route, with page arguments to match.
Task< bool > DisplayAlert(string Title, string Message, string? Accept=null, string? Cancel=null)
Displays an alert/message box to the user.
BackMethod
Navigation Back Method