Ejemplo n.º 1
0
        /// <summary>
        /// Returns binding as a ManagementBaseObject.
        /// </summary>
        /// <returns>ManagementBaseObject representation.</returns>
        public ManagementBaseObject ToBaseObject(VirtualServerManager manager)
        {
            ManagementPath path = new ManagementPath();

            path.ClassName = "ServerBinding";

            ManagementClass bindingClass = new ManagementClass(
                manager.WmiScope, path, null);
            ManagementObject binding = bindingClass.CreateInstance();

            binding["Hostname"] = Hostname;
            binding["Port"]     = port.ToString();
            binding["IP"]       = IP;
            binding.Put();

            return(binding as ManagementBaseObject);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Gets the Bindings property as a list of ManagementBaseObject.
 /// </summary>
 public ManagementBaseObject[] GetBaseObjectBindings(VirtualServerManager manager)
 {
     return(Bindings.Select(b => b.ToBaseObject(manager)).ToArray());
 }