How to create one item of a specific type so that under treeview in management client I have only one node without possibility to add more. I have created single item in ItemManager, something like:
public override void Init()
{
fqid.Kind = CaptisDefinition.CaptisKind;
fqid.ObjectId = Captis.CaptisDefinition.itemGuid;
//fqid.ServerId = Configuration.Instance.ServerFQID.ServerId;
fqid.ParentId = Guid.Empty;
if (GetItem(fqid) == null)
{
CurrentItem = new Item(fqid, "Default");
Configuration.Instance.SaveItemConfiguration(CaptisDefinition.CaptisPluginId, CurrentItem);
}
else
{
fqid.ServerId = Configuration.Instance.ServerFQID.ServerId;
CurrentItem = GetItem(fqid);
Configuration.Instance.SaveItemConfiguration(CaptisDefinition.CaptisPluginId, CurrentItem);
}
}
Also in PluginDefinition, I specified ItemsAllowed.One.
Above code gave me an errors, so firstly I used fqid.ServerId in commented line, but after event server being restarted I had to remove that line and now everything is ok, but that’s not way to go ![]()
Any suggestions on how to properly implement that part?