public override void SetValue(object component, object value)
 {
     try
     {
         if (PropertyType.IsEnum)
         {
             property_.SetValue(component, Enum.Parse(PropertyType, value.ToString()));
             return;
         }
         if (PropertyType == typeof(UrhoBackend.ResourceRef))
         {
             //UrhoBackend.ResourceRef newRef = value as UrhoBackend.ResourceRef;
             UrhoBackend.ResourceRef baseRef = GetValue(component) as UrhoBackend.ResourceRef;
             baseRef.SetResourceName(value.ToString());
             property_.SetValue(component, baseRef);
             return;
         }
         if (value != null)
         {
             if (PropertyType == typeof(UrhoBackend.Color))
             {
                 property_.SetValue(component, EditorCore.Data.ColorConverter.ConvertFrom(value));
                 return;
             }
             property_.SetValue(component, value);
         }
     }
     catch (Exception ex) {
         ErrorHandler.GetInst().Error(ex);
     }
 }
        public override void SetValue(object component, object value)
        {
            UrhoBackend.Serializable wrapper = component as UrhoBackend.Serializable;
            PropertyGridTypeHandler  handler = component as PropertyGridTypeHandler;

            if (handler != null && wrapper == null)
            {
                wrapper = handler.wrapper;
            }

            if (wrapper != null)
            {
                if (type_ == typeof(UrhoBackend.ResourceRef))
                {
                    UrhoBackend.ResourceRef newRef  = value as UrhoBackend.ResourceRef;
                    UrhoBackend.ResourceRef baseRef = wrapper.GetAttributeDefault(attrName_).GetResourceRef();
                    baseRef.SetResourceName(newRef.GetName());
                    wrapper.SetAttribute(attrName_, VariantTranslate.VariantFromObject(baseRef));
                }
                //else if (type_ == typeof(UrhoBackend.ResourceRefList))
                //{
                //    List<string> list = value as List<string>;
                //    if (list != null)
                //    {
                //        UrhoBackend.ResourceRefList baseList = wrapper.GetAttributeDefault(attrName_).GetResourceRefList();
                //        baseList.FromList(list);
                //        wrapper.SetAttribute(attrName_, new UrhoBackend.Variant(baseList));
                //    }
                //}
                else if (attrInfo_.EnumNames != null && attrInfo_.EnumNames.Count > 0)
                {
                    int index = attrInfo_.EnumNames.IndexOf(value.ToString());
                    wrapper.SetAttribute(attrName_, new UrhoBackend.Variant(index));
                }
                else if (type_ == typeof(UrhoBackend.Quaternion))
                {
                    UrhoBackend.Vector3    vec3 = value as UrhoBackend.Vector3;
                    UrhoBackend.Quaternion quat = new UrhoBackend.Quaternion();
                    quat.FromEulerAngles(vec3.x, vec3.y, vec3.z);
                    wrapper.SetAttribute(attrName_, new UrhoBackend.Variant(quat));
                }
                else if (type_ == typeof(UrhoBackend.VariantMap))
                {
                    VariantMapList         records = lastReturn_ as VariantMapList; // value as VariantMapList;
                    UrhoBackend.VariantMap newMap  = new UrhoBackend.VariantMap();
                    VariantMapRecord.Fill(newMap, records);
                    wrapper.SetAttribute(attrName_, new UrhoBackend.Variant(newMap));
                    VariableUtils.SetVariableNames(wrapper, records);
                }
                else if (type_ == typeof(UrhoBackend.VariantVector))
                {
                    List <VariantVectorRecord> records = value as List <VariantVectorRecord>;
                    UrhoBackend.VariantVector  newVec  = new UrhoBackend.VariantVector();
                    VariantVectorRecord.To(newVec, records);
                    wrapper.SetAttribute(attrName_, new UrhoBackend.Variant(newVec));
                }
                else
                {
                    wrapper.SetAttribute(attrName_, VariantTranslate.VariantFromObject(value));
                }
            }
            //\todo
        }