예제 #1
0
 public static void RequiresVersion(IVimClient _client, VimVersion _version)
 {
     if (_client.Version < _version)
     {
         throw new NotSupportedException(string.Format(Resources.MethodNotSupported, _client.ServiceContent.About.ApiVersion));
     }
 }
예제 #2
0
 public ViewBase(IVimClient client, ManagedObjectReference moRef)
 {
     if (moRef == null)
         throw new ArgumentNullException("moRef");
     if (client == null)
         throw new ArgumentNullException("client");
     this._client = client;
     this._moRef = moRef;
 }
예제 #3
0
 private static void ClearViewData(ViewBase currentObject, string currentPath, List<string> properties)
 {
     properties = ViewBase.GetCurrentProperties(currentPath, properties);
     if (properties.Count > 0)
     {
         foreach (string property in properties)
         {
             string[] strArray = property.Split('.');
             Type type = currentObject.GetType();
             object obj1 = (object)currentObject;
             bool flag = false;
             for (int index = 0; index < strArray.Length - 1; ++index)
             {
                 string name = "_" + strArray[index];
                 FieldInfo field = type.GetTypeInfo().GetField(name, BindingFlags.IgnoreCase | BindingFlags.Instance | BindingFlags.NonPublic);
                 if (field != (FieldInfo)null)
                 {
                     if (field.FieldType == typeof(ManagedObjectReference) && index <= strArray.Length - 2)
                         ViewBase.ClearExtView(obj1);
                     object obj2 = field.GetValue(obj1);
                     type = field.FieldType;
                     if (obj2 == null)
                     {
                         flag = true;
                         break;
                     }
                     obj1 = obj2;
                 }
             }
             if (!flag)
             {
                 FieldInfo field = type.GetField("_" + strArray[strArray.Length - 1], BindingFlags.IgnoreCase | BindingFlags.Instance | BindingFlags.NonPublic);
                 if (field != (FieldInfo)null)
                     ViewBase.ClearField(obj1, field);
             }
         }
     }
     else
     {
         ManagedObjectReference moRef = currentObject._moRef;
         IVimClient client = currentObject._client;
         foreach (FieldInfo field in currentObject.GetType().GetTypeInfo().GetFields(BindingFlags.Instance | BindingFlags.NonPublic))
             ViewBase.ClearField((object)currentObject, field);
         currentObject._moRef = moRef;
         currentObject._client = client;
     }
 }
예제 #4
0
 private static void SetExtView(object currentObject, string moPropertyName, IVimClient client, ManagedObjectReference[] moList, Dictionary<string, ObjectContent> objectContentList, Dictionary<string, ViewBase> generatedManagedObjectList, string currentPropertyPath, Dictionary<string, List<string>> allowedPropertyPath)
 {
     ArrayList arrayList = new ArrayList();
     bool flag = false;
     if (moList.Length == 0)
         flag = true;
     FieldInfo field1 = currentObject.GetType().GetTypeInfo().GetField("_linkedView", BindingFlags.Instance | BindingFlags.NonPublic);
     Dictionary<string, PropertyInfo> typeProperties = ViReflectionCache.GetTypeProperties(currentObject.GetType());
     PropertyInfo propertyInfo = (PropertyInfo)null;
     string lower = "LinkedView".ToLower();
     typeProperties.TryGetValue(lower, out propertyInfo);
     FieldInfo field2 = propertyInfo.PropertyType.GetField(moPropertyName, BindingFlags.Instance | BindingFlags.NonPublic);
     bool isArray = field2.FieldType.IsArray;
     Type type = isArray ? field2.FieldType.GetElementType() : field2.FieldType;
     foreach (ManagedObjectReference mo in moList)
     {
         if (objectContentList.ContainsKey(mo.Value) || generatedManagedObjectList.ContainsKey(mo.Value))
         {
             object obj;
             if (generatedManagedObjectList.ContainsKey(mo.Value))
                 obj = (object)generatedManagedObjectList[mo.Value];
             else
                 obj = ViewBase.GetViewType(mo.Type).GetConstructor(new Type[2]
                 {
       typeof (IVimClient),
       typeof (ManagedObjectReference)
                 }).Invoke(new object[2]
                 {
       (object) client,
       (object) mo
                 });
             ViewBase.SetViewData((ViewBase)obj, currentPropertyPath, allowedPropertyPath, objectContentList, generatedManagedObjectList);
             arrayList.Add(obj);
         }
     }
     if (!flag && arrayList.Count <= 0)
         return;
     object obj1 = propertyInfo.GetValue(currentObject, (object[])null) ?? ViReflectionCache.GetTypeDefaultConstructor(propertyInfo.PropertyType).Invoke((object[])null);
     field1.SetValue(currentObject, obj1);
     if (!isArray)
         field2.SetValue(obj1, arrayList[0]);
     else
         field2.SetValue(obj1, (object)arrayList.ToArray(type));
 }
예제 #5
0
 public HostSystem(IVimClient client, ManagedObjectReference moRef) : base(client, moRef)
 {
 }
예제 #6
0
 public Datastore(IVimClient client, ManagedObjectReference moRef) : base(client, moRef)
 {
 }
예제 #7
0
 public HttpNfcLease(IVimClient client, ManagedObjectReference moRef) : base(client, moRef)
 {
 }
 public PropertyCollector(IVimClient client, ManagedObjectReference moRef) : base(client, moRef)
 {
 }
예제 #9
0
 public ClusterComputeResource(IVimClient client, ManagedObjectReference moRef) : base(client, moRef)
 {
 }
 public VStorageObjectManagerBase(IVimClient client, ManagedObjectReference moRef) : base(client, moRef)
 {
 }
예제 #11
0
 public HostVirtualNicManager(IVimClient client, ManagedObjectReference moRef) : base(client, moRef)
 {
 }
예제 #12
0
 public OverheadMemoryManager(IVimClient client, ManagedObjectReference moRef) : base(client, moRef)
 {
 }
예제 #13
0
 public ResourcePlanningManager(IVimClient client, ManagedObjectReference moRef) : base(client, moRef)
 {
 }
 public StorageResourceManager(IVimClient client, ManagedObjectReference moRef) : base(client, moRef)
 {
 }
예제 #15
0
 public Network(IVimClient client, ManagedObjectReference moRef) : base(client, moRef)
 {
 }
예제 #16
0
 public ExtensionManager(IVimClient client, ManagedObjectReference moRef) : base(client, moRef)
 {
 }
 public SimpleCommand(IVimClient client, ManagedObjectReference moRef) : base(client, moRef)
 {
 }
 public ClusterProfile(IVimClient client, ManagedObjectReference moRef) : base(client, moRef)
 {
 }
예제 #19
0
 public DistributedVirtualSwitch(IVimClient client, ManagedObjectReference moRef) : base(client, moRef)
 {
 }
 public ServiceManager(IVimClient client, ManagedObjectReference moRef) : base(client, moRef)
 {
 }
예제 #21
0
 public ScheduledTaskManager(IVimClient client, ManagedObjectReference moRef) : base(client, moRef)
 {
 }
예제 #22
0
 public CryptoManager(IVimClient client, ManagedObjectReference moRef) : base(client, moRef)
 {
 }
 public PerformanceManager(IVimClient client, ManagedObjectReference moRef) : base(client, moRef)
 {
 }
예제 #24
0
 public ProfileComplianceManager(IVimClient client, ManagedObjectReference moRef) : base(client, moRef)
 {
 }
 public DistributedVirtualPortgroup(IVimClient client, ManagedObjectReference moRef) : base(client, moRef)
 {
 }
예제 #26
0
 public SearchIndex(IVimClient client, ManagedObjectReference moRef) : base(client, moRef)
 {
 }
예제 #27
0
 public ResourcePool(IVimClient client, ManagedObjectReference moRef) : base(client, moRef)
 {
 }
예제 #28
0
 public HostVFlashManager(IVimClient client, ManagedObjectReference moRef) : base(client, moRef)
 {
 }
 public AuthorizationManager(IVimClient client, ManagedObjectReference moRef) : base(client, moRef)
 {
 }
예제 #30
0
 public EventHistoryCollector(IVimClient client, ManagedObjectReference moRef) : base(client, moRef)
 {
 }