Beispiel #1
0
        /// <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>Add an empty <see cref="Host"/> object instance to the current <see cref="HostFileInstance"/>.</summary>
        /// <param name="parent">The parent of the to be created <see cref="Host"/> object (optional, default = null).</param>
        /// <returns>True if a new <see cref="Host"/> object instance has been successfully added to the current <see cref="HostFileInstance"/>; otherwise false.</returns>
        public bool AddHost(HostGroup parent = null)
        {
            if (this.HostFileInstance != null)
            {
                if (parent != null)
                {
                    return parent.AddChildToTop(Host.CreateEmpty(parent, this.HostFileInstance.PropertyChangedCallBack));
                }

                return this.HostFileInstance.AddChildToTop(Host.CreateEmpty(parent, this.HostFileInstance.PropertyChangedCallBack));
            }

            return false;
        }
Beispiel #3
0
 /// <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;
 }
Beispiel #4
0
 /// <summary>Initializes a new instance of the <see cref="Host"/> class.</summary>
 /// <param name="parent">The parent <see cref="HostGroup"/> object.</param>
 /// <param name="hostname">The hostname.</param>
 /// <param name="description">A description text.</param>
 /// <param name="propertyChangedCallBack">This event is fired whenever a property of this object changes.</param>
 public Host(HostGroup parent, string hostname, string description, EventHandler propertyChangedCallBack)
     : base(HostfileEntryType.Host, parent, hostname, description, new HostfileEntryCollection(propertyChangedCallBack), propertyChangedCallBack)
 {
 }
Beispiel #5
0
 /// <summary>Initializes a new instance of the <see cref="Host"/> class.</summary>
 /// <param name="parent">The parent <see cref="HostGroup"/> object.</param>
 /// <param name="hostname">The hostname.</param>
 /// <param name="description">A description text.</param>
 /// <param name="propertyChangedCallBack">This event is fired whenever a property of this object changes.</param>
 public Host(HostGroup parent, string hostname, string description, EventHandler propertyChangedCallBack)
     : base(HostfileEntryType.Host, parent, hostname, description, new HostfileEntryCollection(propertyChangedCallBack), propertyChangedCallBack)
 {
 }