/// <summary>Add an empty <see cref="Domain"/> object instance to the current <see cref="HostFileInstance"/>.</summary> /// <param name="parent">The parent of the to be created <see cref="Domain"/> object (optional, default = null).</param> /// <returns>True if a new <see cref="Domain"/> object instance has been successfully added to the current <see cref="HostFileInstance"/>; otherwise false.</returns> public bool AddDomain(Host parent) { if (parent != null && this.HostFileInstance != null) { return parent.AddChildToTop(Domain.CreateEmpty(parent, this.HostFileInstance.PropertyChangedCallBack)); } return false; }
/// <summary>Create an empty <see cref="Domain"/> with default settings.</summary> /// <param name="parent">The parent <see cref="Host"/> object.</param> /// <param name="propertyChangedCallBack">This event is fired whenever a property of this object changes.</param> /// <returns>An empty <see cref="Domain"/> with default settings.</returns> public static Domain CreateEmpty(Host parent, EventHandler propertyChangedCallBack) { return new Domain(parent, App.GetApplicationResource<string>("DomainName_Default"), propertyChangedCallBack); }
/// <summary>Create an empty <see cref="Host"/> with default settings.</summary> /// <param name="parent">The parent <see cref="HostGroup"/>.</param> /// <param name="propertyChangedCallBack">This event is fired whenever a property of this object changes.</param> /// <returns>An empty <see cref="Host"/> with default settings.</returns> public static Host CreateEmpty(HostGroup parent, EventHandler propertyChangedCallBack) { Host host = new Host(parent, App.GetApplicationResource<string>("HostIp_Default"), string.Empty, propertyChangedCallBack); host.Childs.Add(Domain.CreateEmpty(host, propertyChangedCallBack)); return host; }
/// <summary>Initializes a new instance of the <see cref="Domain"/> class.</summary> /// <param name="parent">The parent <see cref="Host"/> object.</param> /// <param name="domainName">The domain name.</param> /// <param name="propertyChangedCallBack">This event is fired whenever a property of this object changes.</param> public Domain(Host parent, string domainName, EventHandler propertyChangedCallBack) : base(HostfileEntryType.Domain, parent, domainName, propertyChangedCallBack) { }