Esempio n. 1
0
        public static ObjectVersionAndProperties CreateSingleFileObject(this Vault vault, int objType, int classId,
                                                                        PropertyValues pvs, SourceObjectFile file, bool checkIn)
        {
            var classPV = MFPropertyUtils.Class(classId);

            pvs.Add(0, classPV);

            return(vault.ObjectOperations.CreateNewSFDObject(objType, pvs, file, checkIn));
        }
Esempio n. 2
0
        /// <summary>
        /// 对象状态搜索
        /// </summary>
        /// <param name="cType"></param>
        /// <param name="sType"></param>
        /// <param name="dType"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public static SearchCondition Status(MFConditionType cType,
                                             MFStatusType sType, MFDataType dType, object value)
        {
            var sc = new SearchCondition();

            sc.ConditionType = cType;
            sc.Expression.DataStatusValueType = sType;
            MFPropertyUtils.SetValue(sc.TypedValue, dType, value);
            return(sc);
        }
Esempio n. 3
0
        /// <summary>
        /// 对象属性搜索
        /// </summary>
        /// <param name="cType"></param>
        /// <param name="propDef"></param>
        /// <param name="dType"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public static SearchCondition Property(MFConditionType cType,
                                               int propDef, MFDataType dType, object value)
        {
            var sc = new SearchCondition();

            sc.ConditionType = cType;
            sc.Expression.DataPropertyValuePropertyDef = propDef;
            MFPropertyUtils.SetValue(sc.TypedValue, dType, value);
            return(sc);
        }
Esempio n. 4
0
        /// <summary>
        /// 其中之一的搜索条件
        /// </summary>
        /// <param name="propDef"></param>
        /// <param name="item"></param>
        /// <returns></returns>
        public static SearchCondition OneOf(int propDef, int item)
        {
            if (item < 0)
            {
                throw new ArgumentException("对象ID必须非负");
            }
            var sc = new SearchCondition();

            sc.ConditionType = MFConditionType.MFConditionTypeEqual;
            sc.Expression.DataPropertyValuePropertyDef = propDef;
            MFPropertyUtils.SetValue(sc.TypedValue, MFDataType.MFDatatypeMultiSelectLookup, item);
            return(sc);
        }
Esempio n. 5
0
        public static ObjectVersionAndProperties CreateNewObject(this Vault vault, int objType, int classId,
                                                                 PropertyValues pvs, SourceObjectFiles files = null)
        {
            var classPV = MFPropertyUtils.Class(classId);

            pvs.Add(0, classPV);

            if (files == null || files.Count != 0)
            {
                var singleFilePV = MFPropertyUtils.SingleFile(false);
                pvs.Add(-1, singleFilePV);
            }

            return(vault.ObjectOperations.CreateNewObject(objType, pvs, files));
        }