RemoveByName(Name: String): Boolean;
Name - a name of the domain that needs removing.
The RemoveByName method removes the specified domain from the collection. Returns True if the remove operation was successful.
Executing the example requires a form, a button named Button1 on this form.
Sub Button1OnClick(Sender: Object; Args: IEventArgs);
Var
MB: IMetabase;
Sec: IMetabaseSecurity;
m_User: IMetabaseUser;
St: IStations;
Dm: IDomains;
Begin
MB := MetabaseClass.Active;
Sec := MB.Security;
m_User := Sec.ResolveName("ADMIN") As IMetabaseUser;
St := m_User.Stations;
Dm := St.Domains;
Dm.RemoveByName("PROGNOZ);
Sec.Apply;
End Sub Button1OnClick;
Pressing the button will remove a domain named PROGNOZ from the collection.
See also: