예제 #1
0
 public override CimQualifier this[string methodName]
 {
     get
     {
         int num = 0;
         if (!string.IsNullOrWhiteSpace(methodName))
         {
             MiResult methodQualifierElementGetIndex = ClassMethods.GetMethodQualifierElement_GetIndex(this.classHandle, this.methodIndex, methodName, out num);
             MiResult miResult = methodQualifierElementGetIndex;
             if (miResult != MiResult.NOT_FOUND)
             {
                 CimException.ThrowIfMiResultFailure(methodQualifierElementGetIndex);
                 return(new CimMethodQualifierDeclarationOfMethod(this.classHandle, this.methodIndex, num));
             }
             else
             {
                 return(null);
             }
         }
         else
         {
             throw new ArgumentNullException("methodName");
         }
     }
 }
 public override CimQualifier this[string qualifierName]
 {
     get
     {
         int num = 0;
         if (!string.IsNullOrWhiteSpace(qualifierName))
         {
             MiResult propertyQualifierIndex = ClassMethods.GetPropertyQualifier_Index(this.classHandle, this.name, qualifierName, out num);
             MiResult miResult = propertyQualifierIndex;
             if (miResult != MiResult.NO_SUCH_PROPERTY)
             {
                 CimException.ThrowIfMiResultFailure(propertyQualifierIndex);
                 return(new CimQualifierOfProperty(this.classHandle, this.name, num));
             }
             else
             {
                 return(null);
             }
         }
         else
         {
             throw new ArgumentNullException("qualifierName");
         }
     }
 }
 public override CimQualifier this[string qualifierName]
 {
     get
     {
         int num = 0;
         if (!string.IsNullOrWhiteSpace(qualifierName))
         {
             MiResult classQualifierIndex = ClassMethods.GetClassQualifier_Index(this.classHandle, qualifierName, out num);
             MiResult miResult            = classQualifierIndex;
             if (miResult != MiResult.NOT_FOUND)
             {
                 CimException.ThrowIfMiResultFailure(classQualifierIndex);
                 return(new CimQualifierOfClass(this.classHandle, num));
             }
             else
             {
                 return(null);
             }
         }
         else
         {
             throw new ArgumentNullException("qualifierName");
         }
     }
 }
 public override CimQualifier this[string qualifierName]
 {
     get
     {
         int num = 0;
         if (!string.IsNullOrWhiteSpace(qualifierName))
         {
             MiResult methodGetQualifierElementGetIndex = ClassMethods.GetMethodGetQualifierElement_GetIndex(this.classHandle, this.methodIndex, this.parameterName, qualifierName, out num);
             MiResult miResult = methodGetQualifierElementGetIndex;
             if (miResult != MiResult.NO_SUCH_PROPERTY)
             {
                 CimException.ThrowIfMiResultFailure(methodGetQualifierElementGetIndex);
                 return(new CimQualifierOfMethodParameter(this.classHandle, this.methodIndex, this.parameterName, num));
             }
             else
             {
                 return(null);
             }
         }
         else
         {
             throw new ArgumentNullException("qualifierName");
         }
     }
 }
예제 #5
0
 public override CimPropertyDeclaration this[string propertyName]
 {
     get
     {
         int num = 0;
         if (!string.IsNullOrWhiteSpace(propertyName))
         {
             MiResult elementGetIndex = ClassMethods.GetElement_GetIndex(this.classHandle, propertyName, out num);
             MiResult miResult        = elementGetIndex;
             if (miResult != MiResult.NO_SUCH_PROPERTY)
             {
                 CimException.ThrowIfMiResultFailure(elementGetIndex);
                 return(new CimClassPropertyOfClass(this.classHandle, num));
             }
             else
             {
                 return(null);
             }
         }
         else
         {
             throw new ArgumentNullException("propertyName");
         }
     }
 }
예제 #6
0
        public IVmObject LookupClassMethod(string name)
        {
            (var method, var ok) = ClassMethods.Get(name);
            if (!ok)
            {
                if (SuperClass != null)
                {
                    return(SuperClass.LookupClassMethod(name));
                }
                if (Class != null)
                {
                    return(Class.LookupClassMethod(name));
                }

                return(null);
            }

            return(method);
        }
예제 #7
0
        public void Merge(KumaClass klass)
        {
            foreach (var key in klass.ClassMethods.Keys)
            {
                KumaMethodTable table;
                if (ClassMethods.ContainsKey(key))
                {
                    table = ClassMethods[key];
                }
                else
                {
                    table = new KumaMethodTable(key);
                }
                foreach (var func in klass.ClassMethods[key].Functions)
                {
                    table.AddFunction(func);
                }
            }

            foreach (var key in klass.InstanceMethods.Keys)
            {
                KumaMethodTable table;
                if (InstanceMethods.ContainsKey(key))
                {
                    table = InstanceMethods[key];
                }
                else
                {
                    table = new KumaMethodTable(key);
                }
                foreach (var func in klass.InstanceMethods[key].Functions)
                {
                    table.AddFunction(func);
                }
            }

            Context.MergeWithScope(klass.Context);
        }
예제 #8
0
 public override int GetHashCode()
 {
     return(ClassMethods.GetClassHashCode(this.ClassHandle));
 }