示例#1
0
        public Dictionary <string, string> GetDistributedVirtualSwitchUuids()
        {
            Dictionary <string, string> dictionary = new Dictionary <string, string>((IEqualityComparer <string>)StringComparer.CurrentCultureIgnoreCase);

            try
            {
                DVSManagerDvsConfigTarget managerDvsConfigTarget = this._vimService.Service.QueryDvsConfigTarget(((VCService)this._vimService).DVSManager, this.ManagedObject, (ManagedObjectReference)null);
                if (managerDvsConfigTarget.distributedVirtualPortgroup != null)
                {
                    foreach (DistributedVirtualPortgroupInfo virtualPortgroupInfo in managerDvsConfigTarget.distributedVirtualPortgroup)
                    {
                        if (!virtualPortgroupInfo.uplinkPortgroup)
                        {
                            CUtils.AddOrReplace <string, string>((IDictionary <string, string>)dictionary, virtualPortgroupInfo.portgroupKey, virtualPortgroupInfo.switchUuid);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
            }
            return(dictionary);
        }
示例#2
0
 public virtual void Load()
 {
     try
     {
         this.Lock.AcquireWriterLock(-1);
         if (this._deleted)
         {
             return;
         }
         PropertyItem[] propertyItemArray = this._serializerFile.Load();
         if (propertyItemArray == null)
         {
             return;
         }
         foreach (PropertyItem propertyItem in propertyItemArray)
         {
             CUtils.AddOrReplace <string, PropertyItem>((IDictionary <string, PropertyItem>) this.Data, propertyItem.Name, propertyItem);
         }
     }
     finally
     {
         this.Lock.ReleaseWriterLock();
     }
 }