コード例 #1
0
 /// <exception cref="ArangoDBException"/>
 public virtual void setValues(object doc, System.Collections.Generic.IDictionary <
                                   com.arangodb.entity.DocumentFieldAttribute.Type, string> values)
 {
     try
     {
         System.Collections.Generic.IDictionary <com.arangodb.entity.DocumentFieldAttribute.Type, java.lang.reflect.Field
                                                 > fields = this.getFields(Sharpen.Runtime.getClassForObject(doc));
         foreach (System.Collections.Generic.KeyValuePair <com.arangodb.entity.DocumentFieldAttribute.Type
                                                           , string> value in values)
         {
             java.lang.reflect.Field field = fields[value.Key];
             if (field != null)
             {
                 field.set(doc, value.Value);
             }
         }
     }
     catch (System.ArgumentException e)
     {
         throw new ArangoDBException(e);
     }
     catch (java.lang.IllegalAccessException e)
     {
         throw new ArangoDBException(e);
     }
 }
コード例 #2
0
        public static void DynamicPutstatic(object val, string name, string sig, RuntimeTypeHandle type, string clazz, [email protected] callerID)
        {
            Profiler.Count("DynamicPutstatic");
            FieldWrapper fw = GetFieldWrapper(null, type, clazz, name, sig, true);

            if (fw.IsFinal)
            {
                throw new java.lang.IllegalAccessError("Field " + fw.DeclaringType.Name + "." + fw.Name + " is final");
            }
            java.lang.reflect.Field field = (java.lang.reflect.Field)fw.ToField(false);
            if (fw.FieldTypeWrapper.IsPrimitive)
            {
                val = JVM.Box(val);
            }
            field.set(null, val, callerID);
        }