In our plugin we are creating some events via ConfigurationItems.UserDefinedEventFolder.AddUserDefinedEvent(String) at runtime and want to use them instantly with EnvironmentManager.Instance.PostMessage(msg,FQIDnewEvent);
Wherefore we need the FQID from this new Event.
We thought of using Configuration.Instance.GetItemsByKind(Kind.TriggerEvent)after a SDK.Environment.ReloadServerConfiguration(Configuration.Instance.ServerFQID.FQID) but ReloadConfiguration throws the Exception “Der Typ \“VideoOS.Platform.Data.RestrictedMediaService\” in der Assembly \“VideoOS.Platform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=bc60fba4a7969f89\” konnte nicht geladen werden.”:“VideoOS.Platform.Data.RestrictedMediaService”}
What is the right proceedure to create and instant use an Event ?
You shouldn’t ever try to use SDK in a plugin. The SDK dll and the environment will generally cause conflicts. There is no way to renew the configuration from a plugin in the Management Client environment.
Basically if the user want to see and use the new event the user has to use refresh.
I have an idea that you can cheat. Even if the Management Client configuration does not know the new event you might be able to cheat by not using the local configuration but instead read it with the Configuration API, something like this
var ev = mgt.UserDefinedEventFolder.UserDefinedEvents.FirstOrDefault(x => x.Name == evName);
FQID fqid = new FQID(ev.ServerId, Guid.Empty, Guid.Parse(ev.Id), FolderType.No, Kind.TriggerEvent);
EnvironmentManager.Instance.SendMessage(new VideoOS.Platform.Messaging.Message(MessageId.Control.TriggerCommand), fqid, null);