Ejemplo n.º 1
0
 /// <summary>
 /// Add a converter for a type.
 /// </summary>
 /// <param name="type">Type.</param>
 /// <param name="converter">Converter.</param>
 public static void AddConverter(CustomDataType type, TypeConverter converter)
 {
     if (type == CustomDataType.Other)
         throw new InvalidOperationException("Not support Other type.");
     if (converter == null)
         throw new ArgumentNullException("converter");
     if (_DefaultItems.ContainsKey(type))
         _DefaultItems[type] = converter;
     else
         _DefaultItems.Add(type, converter);
 }
Ejemplo n.º 2
0
        public static async Task<ContentResult> AddOrUpdate(
            SocialGamificationAssetContext db,
            IList<CustomDataBase> sourceData,
            Guid objectId,
            CustomDataType objectType)
        {
            // Build the filter by CustomData
            if (sourceData != null && sourceData.Count > 0)
            {
                foreach (var data in sourceData)
                {
                    var customData =
                        await
                        db.CustomData.Where(c => c.Key.Equals(data.Key))
                          .Where(c => c.ObjectId.Equals(objectId))
                          .Where(c => c.ObjectType == objectType)
                          .FirstOrDefaultAsync();

                    if (customData != null)
                    {
                        db.Entry(customData).State = EntityState.Modified;
                        customData.Value = data.Value;
                    }
                    else
                    {
                        customData = new CustomData
                        {
                            Key = data.Key,
                            Value = data.Value,
                            ObjectId = objectId,
                            ObjectType = objectType
                        };

                        db.CustomData.Add(customData);
                    }
                }
            }

            return await SaveChanges(db, true);
        }
Ejemplo n.º 3
0
        public static async Task <ContentResult> AddOrUpdate(
            SocialGamificationAssetContext db,
            IList <CustomDataBase> sourceData,
            Guid objectId,
            CustomDataType objectType)
        {
            // Build the filter by CustomData
            if (sourceData != null && sourceData.Count > 0)
            {
                foreach (var data in sourceData)
                {
                    var customData =
                        await
                        db.CustomData.Where(c => c.Key.Equals(data.Key))
                        .Where(c => c.ObjectId.Equals(objectId))
                        .Where(c => c.ObjectType == objectType)
                        .FirstOrDefaultAsync();

                    if (customData != null)
                    {
                        db.Entry(customData).State = EntityState.Modified;
                        customData.Value           = data.Value;
                    }
                    else
                    {
                        customData = new CustomData
                        {
                            Key        = data.Key,
                            Value      = data.Value,
                            ObjectId   = objectId,
                            ObjectType = objectType
                        };

                        db.CustomData.Add(customData);
                    }
                }
            }

            return(await SaveChanges(db, true));
        }
Ejemplo n.º 4
0
        public static IQueryable <CustomData> ConditionBuilder(
            SocialGamificationAssetContext db,
            IList <CustomDataBase> sourceData,
            CustomDataType objectType)
        {
            var query = db.CustomData.Where(c => c.ObjectType == objectType);

            if (sourceData == null || sourceData.Count <= 0)
            {
                return(null);
            }

            foreach (var data in sourceData)
            {
                query = query.Where(c => c.Key.Equals(data.Key));

                if (!AllowedOperators.Contains(data.Operator))
                {
                    continue;
                }

                switch (data.Operator)
                {
                case "=":
                    query = query.Where(c => c.Value.Equals(data.Value));
                    break;

                case "!":
                    query = query.Where(c => c.Value != data.Value);
                    break;

                case "%":
                    query = query.Where(c => c.Value.Contains(data.Value));
                    break;
                }
            }

            return(query);
        }
Ejemplo n.º 5
0
 public virtual GvError Calculate(int calculation, CustomDataType src1, CustomDataType src2, CustomDataType dst, double parm1) {
   GvError ret = (GvError)C4dApiPINVOKE.CustomDataTypeClass_Calculate(swigCPtr, calculation, CustomDataType.getCPtr(src1), CustomDataType.getCPtr(src2), CustomDataType.getCPtr(dst), parm1);
   return ret;
 }
Ejemplo n.º 6
0
 /// <summary>
 /// A simple 1D kernel that references types which in turn reference internal
 /// custom types of the current assembly.
 /// </summary>
 /// <param name="index">The current thread index.</param>
 /// <param name="dataView">The view pointing to our memory buffer.</param>
 static void MyKernel(
     Index1D index,
     ArrayView <CustomDataType> dataView)
 {
     dataView[index] = new CustomDataType(index);
 }
Ejemplo n.º 7
0
 public GeData(int type, CustomDataType data) : this(C4dApiPINVOKE.new_GeData__SWIG_15(type, CustomDataType.getCPtr(data)), true) {
   if (C4dApiPINVOKE.SWIGPendingException.Pending) throw C4dApiPINVOKE.SWIGPendingException.Retrieve();
 }
        public List <CustomDataType> GetProviderDate(string attributeName, int year, int month)
        {
            int      i;
            int      machineID;
            int      startTimeStamp;
            int      endTimeStamp;
            string   databaseName;
            string   tableName;
            string   commandText;
            DateTime start;
            DateTime end;

            string[,] tableArray;
            List <CustomDataType> repaired   = null;
            List <CustomDataType> scheduled  = null;
            List <CustomDataType> maintained = null;
            List <CustomDataType> customData = new List <CustomDataType>();

            machineID = selectedMachine + 1;
            //  machineID = 8;
            commandText  = null;
            databaseName = gVariable.DBHeadString + machineID.ToString().PadLeft(3, '0');
            tableName    = gVariable.machineWorkingPlanTableName;

            //start of the month
            start          = new DateTime(year, month, 1);
            startTimeStamp = toolClass.ConvertDateTimeInt(start);

            //get the end of month 2018-04-30 23:59:59
            end          = start.AddMonths(1).AddSeconds(-1);
            endTimeStamp = toolClass.ConvertDateTimeInt(end);

            //get possible position for a plan(including repaired/scheduled/aintained)
            if (attributeName == "Repaired")
            {
                repaired    = new List <CustomDataType>();
                commandText = "select * from `" + tableName + "` where ((timeStamp1 < " + startTimeStamp + " and timeStamp2 > " + startTimeStamp + ") or (timeStamp1 >= " +
                              startTimeStamp + " and timeStamp1 < " + endTimeStamp + ")) and typeID = 0";
            }
            else if (attributeName == "Scheduled")
            {
                scheduled   = new List <CustomDataType>();
                commandText = "select * from `" + tableName + "` where ((timeStamp1 < " + startTimeStamp + " and timeStamp2 > " + startTimeStamp + ") or (timeStamp1 >= " +
                              startTimeStamp + " and timeStamp1 < " + endTimeStamp + ")) and typeID = 1";
            }
            else if (attributeName == "Maintained")
            {
                maintained  = new List <CustomDataType>();
                commandText = "select * from `" + tableName + "` where ((timeStamp1 < " + startTimeStamp + " and timeStamp2 > " + startTimeStamp + ") or (timeStamp1 >= " +
                              startTimeStamp + " and timeStamp1 < " + endTimeStamp + ")) and typeID > 1";
            }
            tableArray = mySQLClass.databaseCommonReading(databaseName, commandText);
            if (tableArray != null)
            {
                for (i = 0; i < tableArray.GetLength(0); i++)
                {
                    CustomDataType customDate = new CustomDataType();
                    customDate.id   = Convert.ToInt32(tableArray[i, 1]);
                    customDate.attr = attributeName;

                    if (Convert.ToInt32(tableArray[i, 5]) < startTimeStamp)  //start from prevous month
                    {
                        customDate.startTime = start.ToString();
                    }
                    else
                    {
                        customDate.startTime = tableArray[i, 4];
                    }

                    if (Convert.ToInt32(tableArray[i, 8]) > endTimeStamp)  //end in next month
                    {
                        customDate.endTime = end.ToString();
                    }
                    else
                    {
                        customDate.endTime = tableArray[i, 7];
                    }

                    if (attributeName == "Repaired")
                    {
                        repaired.Add(customDate);
                    }
                    else if (attributeName == "Scheduled")
                    {
                        scheduled.Add(customDate);
                    }
                    else if (attributeName == "Maintained")
                    {
                        maintained.Add(customDate);
                    }
                }
            }

            if (attributeName == "Repaired")
            {
                return(repaired);
            }
            else if (attributeName == "Scheduled")
            {
                return(scheduled);
            }
            else if (attributeName == "Maintained")
            {
                return(maintained);
            }
            else
            {
                return(null);
            }
        }
Ejemplo n.º 9
0
 public virtual void WriteData(FastBinaryWriter writer, Object additionalInfo)
 {
     writer.Write(CustomDataType.GetHashCode());
     writer.Write(Level);
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Get converter for a type.
 /// </summary>
 /// <param name="type">Defined type.</param>
 /// <returns></returns>
 public static TypeConverter GetConverter(CustomDataType type)
 {
     TypeConverter converter;
     _DefaultItems.TryGetValue(type, out converter);
     return converter;
 }
Ejemplo n.º 11
0
        public virtual bool WriteData(CustomDataType d, HyperFile hf)
        {
            bool ret = C4dApiPINVOKE.CustomDataTypeClass_WriteData(swigCPtr, CustomDataType.getCPtr(d), HyperFile.getCPtr(hf));

            return(ret);
        }
Ejemplo n.º 12
0
        public virtual bool CopyData(CustomDataType src, CustomDataType dest, AliasTrans aliastrans)
        {
            bool ret = C4dApiPINVOKE.CustomDataTypeClass_CopyData(swigCPtr, CustomDataType.getCPtr(src), CustomDataType.getCPtr(dest), AliasTrans.getCPtr(aliastrans));

            return(ret);
        }
Ejemplo n.º 13
0
        public virtual GvError Calculate(int calculation, CustomDataType src1, CustomDataType src2, CustomDataType dst, double parm1)
        {
            GvError ret = (GvError)C4dApiPINVOKE.CustomDataTypeClass_Calculate(swigCPtr, calculation, CustomDataType.getCPtr(src1), CustomDataType.getCPtr(src2), CustomDataType.getCPtr(dst), parm1);

            return(ret);
        }
Ejemplo n.º 14
0
 public virtual GvError ConvertToGeData(int dst_type, CustomDataType src, GeData dst) {
   GvError ret = (GvError)C4dApiPINVOKE.CustomDataTypeClass_ConvertToGeData(swigCPtr, dst_type, CustomDataType.getCPtr(src), GeData.getCPtr(dst));
   if (C4dApiPINVOKE.SWIGPendingException.Pending) throw C4dApiPINVOKE.SWIGPendingException.Retrieve();
   return ret;
 }
Ejemplo n.º 15
0
 public virtual GvError ConvertToGv(int dst_type, CustomDataType src, SWIGTYPE_p_void dst, int cpu_id) {
   GvError ret = (GvError)C4dApiPINVOKE.CustomDataTypeClass_ConvertToGv(swigCPtr, dst_type, CustomDataType.getCPtr(src), SWIGTYPE_p_void.getCPtr(dst), cpu_id);
   return ret;
 }
Ejemplo n.º 16
0
 public virtual GvError ConvertFromGv(int src_type, SWIGTYPE_p_void src, int cpu_id, CustomDataType dst) {
   GvError ret = (GvError)C4dApiPINVOKE.CustomDataTypeClass_ConvertFromGv(swigCPtr, src_type, SWIGTYPE_p_void.getCPtr(src), cpu_id, CustomDataType.getCPtr(dst));
   return ret;
 }
Ejemplo n.º 17
0
 /// <summary>
 /// Initialize attribute.
 /// </summary>
 /// <param name="type">Type of property.</param>
 public CustomDataTypeAttribute(CustomDataType type)
 {
     Type = type;
     if (type == CustomDataType.File || type == CustomDataType.Image)
         IsFileUpload = true;
 }
Ejemplo n.º 18
0
        protected virtual EditorItem GetEditorItem(CustomDataType type, string custom, PropertyInfo property)
        {
            RequiredAttribute required = property.GetCustomAttributes(typeof(RequiredAttribute), true).FirstOrDefault() as RequiredAttribute;
            EditorItem        item;

            switch (type)
            {
            case CustomDataType.Boolean:
                item = new BoolEditor(Frame);
                break;

            case CustomDataType.Currency:
                item = new CurrencyEditor(Frame);
                break;

            case CustomDataType.Date:
                item = new DateEditor(Frame);
                break;

            case CustomDataType.DateTime:
                item = new DateTimeEditor(Frame);
                break;

            case CustomDataType.Default:
                item = new DefaultEditor(Frame);
                if (required != null)
                {
                    ((DefaultEditor)item).IsAllowdEmpty = required.AllowEmptyStrings;
                }
                break;

            case CustomDataType.EmailAddress:
                item = new EmailAddressEditor(Frame);
                break;

            case CustomDataType.Html:
                item = new HtmlEditor(Frame);
                break;

            case CustomDataType.ImageUrl:
                item = new ImageUrlEditor(Frame);
                break;

            case CustomDataType.Image:
                item = new ImageEditor(Frame);
                break;

            case CustomDataType.Integer:
                item = new IntegerEditor(Frame);
                break;

            case CustomDataType.MultilineText:
                item = new MultilineTextEditor(Frame);
                if (required != null)
                {
                    ((MultilineTextEditor)item).IsAllowdEmpty = required.AllowEmptyStrings;
                }
                break;

            case CustomDataType.Number:
                item = new NumberEditor(Frame);
                break;

            case CustomDataType.Password:
                item = new PasswordEditor(Frame);
                break;

            case CustomDataType.PhoneNumber:
                item = new PhoneNumberEditor(Frame);
                break;

            case CustomDataType.Sex:
                item = new SexEditor(Frame);
                break;

            case CustomDataType.Text:
                item = new DefaultEditor(Frame);
                break;

            case CustomDataType.Time:
                item = new TimeEditor(Frame);
                break;

            case CustomDataType.Url:
                item = new UrlEditor(Frame);
                break;

            default:
                switch (custom)
                {
                case "Enum":
                    item = GetEnumEditorItem(property.PropertyType);
                    break;

                case "Entity":
                    item = new EntityEditor(Frame, property.PropertyType);
                    break;

                case "Collection":
                    item = new CollectionEditor(Frame, property.PropertyType.GetGenericArguments()[0]);
                    break;

                default:
                    throw new NotSupportedException("不支持自定义类型编辑器。");
                }
                break;
            }
            if (required != null)
            {
                item.IsRequired = true;
            }
            return(item);
        }
Ejemplo n.º 19
0
 public GeData(int type, CustomDataType data) : this(C4dApiPINVOKE.new_GeData__SWIG_17(type, CustomDataType.getCPtr(data)), true)
 {
     if (C4dApiPINVOKE.SWIGPendingException.Pending)
     {
         throw C4dApiPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Ejemplo n.º 20
0
 /// <summary>
 /// Initialize attribute.
 /// </summary>
 /// <param name="type">Type of property.</param>
 public CustomDataTypeAttribute(CustomDataType type)
 {
     Type = type;
 }
Ejemplo n.º 21
0
 public virtual bool SetDParameter(CustomDataType data, DescID id, GeData t_data, SWIGTYPE_p_DESCFLAGS_SET flags) {
   bool ret = C4dApiPINVOKE.CustomDataTypeClass_SetDParameter(swigCPtr, CustomDataType.getCPtr(data), DescID.getCPtr(id), GeData.getCPtr(t_data), SWIGTYPE_p_DESCFLAGS_SET.getCPtr(flags));
   if (C4dApiPINVOKE.SWIGPendingException.Pending) throw C4dApiPINVOKE.SWIGPendingException.Retrieve();
   return ret;
 }
Ejemplo n.º 22
0
 public virtual void FreeData(CustomDataType data)
 {
     C4dApiPINVOKE.CustomDataTypeClass_FreeData(swigCPtr, CustomDataType.getCPtr(data));
 }
Ejemplo n.º 23
0
 public virtual bool GetEnabling(CustomDataType data, DescID id, GeData t_data, SWIGTYPE_p_DESCFLAGS_ENABLE flags, BaseContainer itemdesc) {
   bool ret = C4dApiPINVOKE.CustomDataTypeClass_GetEnabling(swigCPtr, CustomDataType.getCPtr(data), DescID.getCPtr(id), GeData.getCPtr(t_data), SWIGTYPE_p_DESCFLAGS_ENABLE.getCPtr(flags), BaseContainer.getCPtr(itemdesc));
   if (C4dApiPINVOKE.SWIGPendingException.Pending) throw C4dApiPINVOKE.SWIGPendingException.Retrieve();
   return ret;
 }
Ejemplo n.º 24
0
        public virtual int Compare(CustomDataType d1, CustomDataType d2)
        {
            int ret = C4dApiPINVOKE.CustomDataTypeClass_Compare(swigCPtr, CustomDataType.getCPtr(d1), CustomDataType.getCPtr(d2));

            return(ret);
        }
Ejemplo n.º 25
0
 public virtual void FreeData(CustomDataType data) {
   C4dApiPINVOKE.CustomDataTypeClass_FreeData(swigCPtr, CustomDataType.getCPtr(data));
 }
Ejemplo n.º 26
0
 protected virtual EditorItem GetEditorItem(CustomDataType type, string custom, PropertyInfo property)
 {
     RequiredAttribute required = property.GetCustomAttributes(typeof(RequiredAttribute), true).FirstOrDefault() as RequiredAttribute;
     EditorItem item;
     switch (type)
     {
         case CustomDataType.Boolean:
             item = new BoolEditor(Frame);
             break;
         case CustomDataType.Currency:
             item = new CurrencyEditor(Frame);
             break;
         case CustomDataType.Date:
             item = new DateEditor(Frame);
             break;
         case CustomDataType.DateTime:
             item = new DateTimeEditor(Frame);
             break;
         case CustomDataType.Default:
             item = new DefaultEditor(Frame);
             if (required != null)
                 ((DefaultEditor)item).IsAllowdEmpty = required.AllowEmptyStrings;
             break;
         case CustomDataType.EmailAddress:
             item = new EmailAddressEditor(Frame);
             break;
         case CustomDataType.Html:
             item = new HtmlEditor(Frame);
             break;
         case CustomDataType.ImageUrl:
             item = new ImageUrlEditor(Frame);
             break;
         case CustomDataType.Image:
             item = new ImageEditor(Frame);
             break;
         case CustomDataType.Integer:
             item = new IntegerEditor(Frame);
             break;
         case CustomDataType.MultilineText:
             item = new MultilineTextEditor(Frame);
             if (required != null)
                 ((MultilineTextEditor)item).IsAllowdEmpty = required.AllowEmptyStrings;
             break;
         case CustomDataType.Number:
             item = new NumberEditor(Frame);
             break;
         case CustomDataType.Password:
             item = new PasswordEditor(Frame);
             break;
         case CustomDataType.PhoneNumber:
             item = new PhoneNumberEditor(Frame);
             break;
         case CustomDataType.Sex:
             item = new SexEditor(Frame);
             break;
         case CustomDataType.Text:
             item = new DefaultEditor(Frame);
             break;
         case CustomDataType.Time:
             item = new TimeEditor(Frame);
             break;
         case CustomDataType.Url:
             item = new UrlEditor(Frame);
             break;
         default:
             switch (custom)
             {
                 case "Enum":
                     item = GetEnumEditorItem(property.PropertyType);
                     break;
                 case "Entity":
                     item = new EntityEditor(Frame, property.PropertyType);
                     break;
                 case "Collection":
                     item = new CollectionEditor(Frame, property.PropertyType.GetGenericArguments()[0]);
                     break;
                 default:
                     throw new NotSupportedException("不支持自定义类型编辑器。");
             }
             break;
     }
     if (required != null)
         item.IsRequired = true;
     return item;
 }
Ejemplo n.º 27
0
 public virtual bool CopyData(CustomDataType src, CustomDataType dest, AliasTrans aliastrans) {
   bool ret = C4dApiPINVOKE.CustomDataTypeClass_CopyData(swigCPtr, CustomDataType.getCPtr(src), CustomDataType.getCPtr(dest), AliasTrans.getCPtr(aliastrans));
   return ret;
 }
Ejemplo n.º 28
0
 /// <summary>
 /// Remove converter for a type.
 /// </summary>
 /// <param name="type">Defined type.</param>
 public static void RemoveConverter(CustomDataType type)
 {
     if (_DefaultItems.ContainsKey(type))
         _DefaultItems.Remove(type);
 }
Ejemplo n.º 29
0
 public virtual int Compare(CustomDataType d1, CustomDataType d2) {
   int ret = C4dApiPINVOKE.CustomDataTypeClass_Compare(swigCPtr, CustomDataType.getCPtr(d1), CustomDataType.getCPtr(d2));
   return ret;
 }
Ejemplo n.º 30
0
        /// <summary>
        /// Get the custom type from property info.
        /// </summary>
        /// <param name="propertyInfo">Property info.</param>
        /// <param name="customType">Custom type if exists.</param>
        /// <param name="isFileUpload">Is property used to upload.</param>
        /// <returns>Custom data type.</returns>
        public static CustomDataType GetCustomDataType(this PropertyInfo propertyInfo, out string customType, out bool isFileUpload)
        {
            CustomDataType type = CustomDataType.Default;

            customType   = null;
            isFileUpload = false;
            var customDataType = propertyInfo.GetCustomAttribute <CustomDataTypeAttribute>();

            if (customDataType != null)
            {
                type         = customDataType.Type;
                customType   = customDataType.Custom;
                isFileUpload = customDataType.IsFileUpload;
            }
            else
            {
                Type propertyType = propertyInfo.PropertyType;
                //ValueFilterAttribute filter = propertyInfo.GetCustomAttribute<ValueFilterAttribute>();
                //if (filter != null)
                //{
                //    type = CustomDataType.Other;
                //    customType = "ValueFilter";
                //}
                if (propertyType.GetTypeInfo().IsGenericType&& propertyType.GetGenericTypeDefinition() == typeof(Nullable <>))
                {
                    propertyType = propertyType.GetGenericArguments()[0];
                }
                else if (propertyType == typeof(DateTime))
                {
                    type = CustomDataType.Date;
                }
                else if (propertyType == typeof(TimeSpan))
                {
                    type = CustomDataType.Time;
                }
                else if (propertyType == typeof(bool))
                {
                    type = CustomDataType.Boolean;
                }
                else if (propertyType == typeof(short) || propertyType == typeof(int) || propertyType == typeof(long))
                {
                    type = CustomDataType.Integer;
                }
                else if (propertyType == typeof(float) || propertyType == typeof(double))
                {
                    type = CustomDataType.Number;
                }
                else if (propertyType == typeof(decimal))
                {
                    type = CustomDataType.Currency;
                }
                else if (propertyType == typeof(byte[]))
                {
                    type         = CustomDataType.File;
                    isFileUpload = true;
                }
                else if (propertyType.GetTypeInfo().IsEnum)
                {
                    type       = CustomDataType.Other;
                    customType = "Enum";
                }
                else if (propertyType.GetTypeInfo().IsGenericType)
                {
                    type       = CustomDataType.Other;
                    customType = "Collection";
                }
                else if (typeof(IEntity).IsAssignableFrom(propertyType))
                {
                    type       = CustomDataType.Other;
                    customType = "Entity";
                }
                else
                {
                    type = CustomDataType.Default;
                }
            }
            return(type);
        }
Ejemplo n.º 31
0
 public virtual bool WriteData(CustomDataType d, SWIGTYPE_p_HyperFile hf) {
   bool ret = C4dApiPINVOKE.CustomDataTypeClass_WriteData(swigCPtr, CustomDataType.getCPtr(d), SWIGTYPE_p_HyperFile.getCPtr(hf));
   return ret;
 }
Ejemplo n.º 32
0
 public void SetCustomDataType(int datatype, CustomDataType v) {
   C4dApiPINVOKE.GeData_SetCustomDataType(swigCPtr, datatype, CustomDataType.getCPtr(v));
   if (C4dApiPINVOKE.SWIGPendingException.Pending) throw C4dApiPINVOKE.SWIGPendingException.Retrieve();
 }
Ejemplo n.º 33
0
 public virtual bool ReadData(CustomDataType d, SWIGTYPE_p_HyperFile hf, int level) {
   bool ret = C4dApiPINVOKE.CustomDataTypeClass_ReadData(swigCPtr, CustomDataType.getCPtr(d), SWIGTYPE_p_HyperFile.getCPtr(hf), level);
   return ret;
 }
Ejemplo n.º 34
0
 public virtual bool GetDescription(CustomDataType data, Description res, SWIGTYPE_p_DESCFLAGS_DESC flags, BaseContainer parentdescription, DescID singledescid) {
   bool ret = C4dApiPINVOKE.ResourceDataTypeClass_GetDescription(swigCPtr, CustomDataType.getCPtr(data), Description.getCPtr(res), SWIGTYPE_p_DESCFLAGS_DESC.getCPtr(flags), BaseContainer.getCPtr(parentdescription), DescID.getCPtr(singledescid));
   if (C4dApiPINVOKE.SWIGPendingException.Pending) throw C4dApiPINVOKE.SWIGPendingException.Retrieve();
   return ret;
 }
Ejemplo n.º 35
0
        public virtual bool ReadData(CustomDataType d, HyperFile hf, int level)
        {
            bool ret = C4dApiPINVOKE.CustomDataTypeClass_ReadData(swigCPtr, CustomDataType.getCPtr(d), HyperFile.getCPtr(hf), level);

            return(ret);
        }
 /// <summary>
 /// Initialize attribute.
 /// </summary>
 /// <param name="type">Type of property.</param>
 public CustomDataTypeAttribute(CustomDataType type)
 {
     Type = type;
 }
Ejemplo n.º 37
0
        public virtual GvError ConvertFromGv(int src_type, SWIGTYPE_p_void src, int cpu_id, CustomDataType dst)
        {
            GvError ret = (GvError)C4dApiPINVOKE.CustomDataTypeClass_ConvertFromGv(swigCPtr, src_type, SWIGTYPE_p_void.getCPtr(src), cpu_id, CustomDataType.getCPtr(dst));

            return(ret);
        }
Ejemplo n.º 38
0
        public static IQueryable<CustomData> ConditionBuilder(
            SocialGamificationAssetContext db,
            IList<CustomDataBase> sourceData,
            CustomDataType objectType)
        {
            var query = db.CustomData.Where(c => c.ObjectType == objectType);

            if (sourceData == null || sourceData.Count <= 0)
            {
                return null;
            }

            foreach (var data in sourceData)
            {
                query = query.Where(c => c.Key.Equals(data.Key));

                if (!AllowedOperators.Contains(data.Operator))
                {
                    continue;
                }

                switch (data.Operator)
                {
                    case "=":
                        query = query.Where(c => c.Value.Equals(data.Value));
                        break;
                    case "!":
                        query = query.Where(c => c.Value != data.Value);
                        break;
                    case "%":
                        query = query.Where(c => c.Value.Contains(data.Value));
                        break;
                }
            }

            return query;
        }
Ejemplo n.º 39
0
        public virtual GvError ConvertToGv(int dst_type, CustomDataType src, SWIGTYPE_p_void dst, int cpu_id)
        {
            GvError ret = (GvError)C4dApiPINVOKE.CustomDataTypeClass_ConvertToGv(swigCPtr, dst_type, CustomDataType.getCPtr(src), SWIGTYPE_p_void.getCPtr(dst), cpu_id);

            return(ret);
        }
Ejemplo n.º 40
0
        public virtual GvError ConvertToGeData(int dst_type, CustomDataType src, GeData dst)
        {
            GvError ret = (GvError)C4dApiPINVOKE.CustomDataTypeClass_ConvertToGeData(swigCPtr, dst_type, CustomDataType.getCPtr(src), GeData.getCPtr(dst));

            if (C4dApiPINVOKE.SWIGPendingException.Pending)
            {
                throw C4dApiPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Ejemplo n.º 41
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(CustomDataType obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }