public static CorDebugValue CreateValue(RuntimeValue rtv, CorDebugAppDomain appDomain)
        {
            CorDebugValue val = null;
            bool fIsReference;
            
            if (rtv.IsBoxed)
            {
                val = new CorDebugValueBoxedObject (rtv, appDomain);
                fIsReference = true;
            }
            else if (rtv.IsPrimitive)
            {
                CorDebugClass c = ClassFromRuntimeValue (rtv, appDomain);
    
                if (c.IsEnum)
                {
                    val = new CorDebugValueObject (rtv, appDomain);
                    fIsReference = false;
                }
                else
                {
                    val = new CorDebugValuePrimitive (rtv, appDomain);
                    fIsReference = false;
                }
            }
            else if (rtv.IsArray)
            {
                val = new CorDebugValueArray (rtv, appDomain);
                fIsReference = true;
            }
            else if (rtv.CorElementType == CorElementType.ELEMENT_TYPE_STRING)
            {
                val = new CorDebugValueString (rtv, appDomain);
                fIsReference = true;
            }
            else
            {
                val = new CorDebugValueObject (rtv, appDomain);
                fIsReference = !rtv.IsValueType;
            }
            
            if (fIsReference)
            {
                val = new CorDebugValueReference(val, val.m_rtv, val.m_appDomain);
            }

            if (rtv.IsReference)    //CorElementType.ELEMENT_TYPE_BYREF
            {
                val = new CorDebugValueReferenceByRef(val, val.m_rtv, val.m_appDomain);
            }

            return val;        
        }
Exemple #2
0
        public static CorDebugValue CreateValue(RuntimeValue rtv, CorDebugAppDomain appDomain)
        {
            CorDebugValue val = null;
            bool          fIsReference;

            if (rtv.IsBoxed)
            {
                val          = new CorDebugValueBoxedObject(rtv, appDomain);
                fIsReference = true;
            }
            else if (rtv.IsPrimitive)
            {
                CorDebugClass c = ClassFromRuntimeValue(rtv, appDomain);

                if (c.IsEnum)
                {
                    val          = new CorDebugValueObject(rtv, appDomain);
                    fIsReference = false;
                }
                else
                {
                    val          = new CorDebugValuePrimitive(rtv, appDomain);
                    fIsReference = false;
                }
            }
            else if (rtv.IsArray)
            {
                val          = new CorDebugValueArray(rtv, appDomain);
                fIsReference = true;
            }
            else if (rtv.CorElementType == CorElementType.ELEMENT_TYPE_STRING)
            {
                val          = new CorDebugValueString(rtv, appDomain);
                fIsReference = true;
            }
            else
            {
                val          = new CorDebugValueObject(rtv, appDomain);
                fIsReference = !rtv.IsValueType;
            }

            if (fIsReference)
            {
                val = new CorDebugValueReference(val, val.m_rtv, val.m_appDomain);
            }

            if (rtv.IsReference)                  //CorElementType.ELEMENT_TYPE_BYREF
            {
                val = new CorDebugValueReferenceByRef(val, val.m_rtv, val.m_appDomain);
            }

            return(val);
        }
		public object GetElement (int[] indices)
		{
			return new CorValRef (delegate {
				// If we have a zombie state array, reload it.
				if (!obj.IsValid) {
					obj.Reload ();
					array = MicroFrameworkObjectValueAdaptor.GetRealObject (ctx, obj) as CorDebugValueArray;
				}

				return array != null ? array.GetElement (indices) : null;
			});
		}
 public CorDebugTypeArray( CorDebugValueArray valArray )
 {
     m_ValueArray = valArray; 
 }
		public ArrayAdaptor (EvaluationContext ctx, CorValRef obj, CorDebugValueArray array)
		{
			this.ctx = (CorEvaluationContext)ctx;
			this.array = array;
			this.obj = obj;
		}
 public CorDebugTypeArray(CorDebugValueArray valArray)
 {
     m_ValueArray = valArray;
 }