Exemple #1
0
        ///// <summary>
        ///// 写入MF系统
        ///// </summary>
        ///// <param name="files">选择的文件集合</param>
        ///// <param name="mfClass">对象类别</param>
        ///// <param name="selProps">选择的对应属性</param>
        //public void ToSystem(SelectedFiles files, MfClass mfClass, List<MfClassPropDef> selProps)
        //{
        //    var log = TraceLog.GetLogger<MfVault>(MethodBase.GetCurrentMethod().Name);
        //    try
        //    {
        //        foreach (var f in files.Files)
        //        {
        //            FileToSystem(files, f, mfClass, selProps);
        //        }
        //    }
        //    finally
        //    {
        //        log.Close();
        //    }

        //}

        private SearchCondition GetCondition(MfClassPropDef propDef, string vv, TraceSource log)
        {
            var def = propDef.Def;
            var sc  = new SearchCondition {
                ConditionType = MFConditionType.MFConditionTypeEqual
            };

            sc.Expression.DataPropertyValuePropertyDef = def;
            if (!String.IsNullOrEmpty(vv))
            {
                var mfVal = GetValue(propDef.PropDef, vv, log);
                sc.TypedValue.SetValue((MFDataType)propDef.DataType, mfVal);
            }
            else
            {
                sc.TypedValue.SetValueToNULL((MFDataType)propDef.DataType);
            }
            return(sc);
        }
Exemple #2
0
        internal static List <MfClassPropDef> GetClassProps(Vault vault, int classId)
        {
            var oc = vault.ClassOperations.GetObjectClass(classId);
            var mc = new List <MfClassPropDef>();

            var namedPropDef = GetProp(vault, oc.NamePropertyDef);

            if (namedPropDef != null)
            {
                var np = new MfClassPropDef {
                    PropDef = namedPropDef, NamedProp = true, Required = true, ClassId = classId
                };
                mc.Add(np);
            }

            foreach (AssociatedPropertyDef p in oc.AssociatedPropertyDefs)
            {
                var def = p.PropertyDef;
                if (def == oc.NamePropertyDef)
                {
                    continue;
                }
                if (ExcludeProps.Contains(def))
                {
                    continue;
                }

                var mp = GetProp(vault, def);
                if (mp == null)
                {
                    continue;
                }
                var required = p.Required;
                var np0      = new MfClassPropDef {
                    PropDef = mp, Required = required, ClassId = classId
                };
                mc.Add(np0);
            }
            return(mc);
        }