public JsonResult GetStackHolder(string stackHolder, string type)
        {
            List <StackInfo> stackHolders = new List <StackInfo>();
            var resp = new PropertyInfoData();

            stackHolders = resp.GetStackInfoData(stackHolder, type);
            return(Json(stackHolders, JsonRequestBehavior.AllowGet));
        }
        internal PropertyInfoDataWrapper(PropertyInfoData propertyInfoData)
        {
            type         = propertyInfoData.type;
            sourceType   = propertyInfoData.sourceType;
            name         = propertyInfoData.name;
            min          = propertyInfoData.min;
            max          = propertyInfoData.max;
            path         = propertyInfoData.path;
            modifierName = propertyInfoData.modifierName;
            propertyName = propertyInfoData.propertyName;

            arrayLength = msPropertyInfoGetArrayLength(propertyInfoData.self);

            switch (type)
            {
            case PropertyInfoDataType.Int: {
                int r = 0;
                msPropertyInfoCopyData(propertyInfoData.self, ref r);
                propertyValue = r;
                break;
            }

            case PropertyInfoDataType.Float: {
                float r = 0;
                msPropertyInfoCopyData(propertyInfoData.self, ref r);
                propertyValue = r;
                break;
            }

            case PropertyInfoDataType.IntArray: {
                int[] r = new int[arrayLength];
                msPropertyInfoCopyData(propertyInfoData.self, r);
                propertyValue = r;
                break;
            }

            case PropertyInfoDataType.FloatArray: {
                float[] r = new float[arrayLength];
                msPropertyInfoCopyData(propertyInfoData.self, r);
                propertyValue = r;
                break;
            }

            case PropertyInfoDataType.String: {
                var s = new StringBuilder(arrayLength + 1);         // +1 for string terminator
                msPropertyInfoCopyData(propertyInfoData.self, s);
                propertyValue = s.ToString();
                break;
            }

            default:
                Debug.LogError($"Type {propertyInfoData.type} not implemented");
                break;
            }
        }
Ejemplo n.º 3
0
 public CopyToOperation()
 {
     Properties = new List <PropertyInfoData>();
     PropertyInfo[] prop = typeof(T).GetProperties();
     foreach (var info in prop)
     {
         PropertyInfoData infoData = new PropertyInfoData()
         {
             Info        = info,
             IsValueType = info.GetType().IsValueType
         };
         Properties.Add(infoData);
     }
 }