Skip to content

Commit f35f7e7

Browse files
committed
#261 Powershell - now takes ownership of its own object type like the new standard for plugins. CLOSE #261
1 parent cf2ba08 commit f35f7e7

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

Plugins/OSAE.PowerShellProcessor/PowerShellPlugin.cs

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,24 @@ public override void RunInterface(string pluginName)
7171
{
7272
this.Log.Debug("Powershell Plugin needs registering");
7373
Register(false);
74-
}
75-
74+
}
75+
OwnTypes();
76+
}
77+
78+
public void OwnTypes()
79+
{
80+
//Added the follow to automatically own Speech Base types that have no owner.
81+
OSAEObjectType oType = OSAEObjectTypeManager.ObjectTypeLoad("POWERSHELL");
82+
83+
if (oType.OwnedBy == "")
84+
{
85+
OSAEObjectTypeManager.ObjectTypeUpdate(oType.Name, oType.Name, oType.Description, pName, oType.BaseType, oType.Owner, oType.SysType, oType.Container, oType.HideRedundant);
86+
Log.Info("Powershell Plugin took ownership of the POWERSHELL Object Type.");
87+
}
88+
else
89+
{
90+
Log.Info("Powershell Plugin correctly owns the POWERSHELL Object Type.");
91+
}
7692
}
7793

7894
private bool PluginRegistered()

0 commit comments

Comments
 (0)