public static PropertyDefineCollection CreatePropertiesFromConfiguration(PropertyGroupConfigurationElement group)
        {
            PropertyDefineCollection pds = new PropertyDefineCollection();

            pds.LoadPropertiesFromConfiguration(group);

            return(pds);
        }
        public static PropertyDefineCollection CreatePropertiesFromConfiguration(string groupName)
        {
            PropertyDefineCollection pds = new PropertyDefineCollection();

            pds.LoadPropertiesFromConfiguration(groupName);

            return(pds);
        }
Ejemplo n.º 3
0
        public void AppendFromPropertyDefineCollection(PropertyDefineCollection propDefinitions)
        {
            foreach (PropertyDefine propDef in propDefinitions)
            {
                PropertyValue pv = new PropertyValue(propDef);

                this.Add(pv);
            }
        }
Ejemplo n.º 4
0
        private void LoadPropertiesFromDataType(PropertyDataType dataType)
        {
            string propConfigKey = dataType.ToString() + "FieldProperties";

            PropertyDefineCollection propDefinitions = new PropertyDefineCollection();

            propDefinitions.LoadPropertiesFromConfiguration(propConfigKey);

            this.Properties.InitFromPropertyDefineCollection(propDefinitions);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 从配置信息初始化
        /// </summary>
        /// <param name="categoryName"></param>
        internal void InitFromConfiguration(UserRecentDataCategoryConfigurationElement elem)
        {
            this.Name        = elem.Name;
            this.Description = elem.Description;

            this._list = new UserRecentDataCategoryItemCollection(this);

            this._definedProperties = new PropertyDefineCollection();
            this._definedProperties.LoadPropertiesFromConfiguration(elem);
            this._defaultSize = elem.DefaultRecentCount;
        }
Ejemplo n.º 6
0
        public void FillCreateActivityParams(WfCreateActivityParamCollection capc, PropertyDefineCollection definedProperties)
        {
            SOARoleContext context = SOARoleContext.Current;

            if (context != null && context.QueryParams.Count > 0)
            {
                SOARolePropertyRowCollection matchedRows = this.Rows.Query(context.QueryParams);

                matchedRows = matchedRows.ExtractMatrixRows();

                matchedRows.FillCreateActivityParams(capc, this.PropertyDefinitions, definedProperties);
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        /// 从配置信息初始化
        /// </summary>
        /// <param name="categoryName"></param>
        internal void InitFromConfiguration(PropertyGroupConfigurationElement elem)
        {
            this.Name        = elem.Name;
            this.Description = elem.Description;

            this._Properties = new PropertyValueCollection();

            PropertyDefineCollection definedProperties = new PropertyDefineCollection();

            definedProperties.LoadPropertiesFromConfiguration(elem);

            this._Properties.InitFromPropertyDefineCollection(definedProperties);
        }
Ejemplo n.º 8
0
        ///// <summary>
        ///// 将列表中由index指定的元素提升到列表的开头,其余元素顺次下移
        ///// </summary>
        ///// <param name="index"></param>
        //public void Advance(int index)
        //{
        //    if (index < 0 || index >= this.Count)
        //    {
        //        throw new ArgumentOutOfRangeException("index");
        //    }
        //    if (index == this.Count - 1 && index >= 0)
        //    {
        //        var obj = InnerList[index];

        //        InnerList.RemoveAt(index);
        //        InnerList.Insert(0, obj);
        //    }
        //    else if (index < this.Count - 1)
        //    {
        //        var obj = InnerList[index];
        //        for (int i = index - 1; i >= 0; i--)
        //        {
        //            InnerList[i + 1] = InnerList[i];
        //        }
        //        InnerList[0] = obj;
        //    }
        //}

        /// <summary>
        /// 基于现有配置创建一个新的<see cref="PropertyValueCollection"/>
        /// </summary>
        /// <returns>返回此Item</returns>
        public PropertyValueCollection CreateItem()
        {
            PropertyDefineCollection defines = null;

            if (this.owner == null || (defines = this.owner.MetaData) == null)
            {
                throw new InvalidOperationException("未找到分类的属性定义");
            }

            PropertyValueCollection collection = new PropertyValueCollection();

            foreach (var item in defines)
            {
                collection.Add(new PropertyValue(item));
            }

            return(collection);
        }
Ejemplo n.º 9
0
        /// <summary>
        /// 重新设置当前properties
        /// </summary>
        /// <param name="definedProperties"></param>
        /// <param name="forceOverride">是否强制覆盖</param>
        /// <param name="resetValue">是否重新设置StringValue</param>
        private void ResetDefinedProperties(PropertyDefineCollection definedProperties, bool forceOverride, bool resetValue)
        {
            foreach (PropertyDefine pd in definedProperties)
            {
                PropertyValue pv = this[pd.Name];

                if (pv == null)
                {
                    this.Add(new PropertyValue(pd));
                }
                else
                {
                    pv.Definition = pd;

                    if (resetValue)
                    {
                        pv.StringValue = pd.DefaultValue;
                    }
                }
            }
        }
Ejemplo n.º 10
0
 /// <summary>
 /// 当前的属性值集合与新的属性定义进行合并
 /// </summary>
 /// <param name="definedProperties"></param>
 /// <param name="forceOverride">是否强制覆盖</param>
 public void MergeDefinedProperties(PropertyDefineCollection definedProperties, bool forceOverride)
 {
     this.ResetDefinedProperties(definedProperties, forceOverride, false);
 }
Ejemplo n.º 11
0
 /// <summary>
 /// 当前的属性值集合与新的属性定义进行合并
 /// </summary>
 /// <param name="propDefinitions"></param>
 public void MergeDefinedProperties(PropertyDefineCollection definedProperties)
 {
     MergeDefinedProperties(definedProperties, false);
 }
Ejemplo n.º 12
0
 /// <summary>
 /// 将原来的属性替换
 /// </summary>
 /// <param name="definedProperties"></param>
 public void ReplaceDefinedProperties(PropertyDefineCollection definedProperties)
 {
     this.ResetDefinedProperties(definedProperties, true, true);
 }
Ejemplo n.º 13
0
        public void InitFromPropertyDefineCollection(PropertyDefineCollection propDefinitions)
        {
            this.Clear();

            AppendFromPropertyDefineCollection(propDefinitions);
        }
Ejemplo n.º 14
0
        private int _defaultSize;                                  //默认显示的最近项的个数

        internal UserRecentDataCategory()
        {
            this._definedProperties = new PropertyDefineCollection();
        }
Ejemplo n.º 15
0
        //沈峥注释掉,2015/6/21.必须提供列定义
        //public void FillCreateActivityParams(WfCreateActivityParamCollection capc, PropertyDefineCollection definedProperties)
        //{
        //    SOARolePropertyDefinitionCollection definitions = null;

        //    SOARole role = this._Role as SOARole;

        //    if (role != null)
        //        definitions = role.PropertyDefinitions;
        //    else
        //        definitions = new SOARolePropertyDefinitionCollection();

        //    this.FillCreateActivityParams(capc, definitions, definedProperties);
        //}

        public void FillCreateActivityParams(WfCreateActivityParamCollection capc, SOARolePropertyDefinitionCollection definitions, PropertyDefineCollection definedProperties)
        {
            capc.NullCheck("capc");
            definitions.NullCheck("definitions");

            SOARolePropertyRowUsersCollection rowsUsers = GenerateRowsUsers();

            rowsUsers.ForEach(rowUsers => capc.Add(WfCreateActivityParam.FromRowUsers(rowUsers, definitions, definedProperties)));

            if (definitions.MatrixType == WfMatrixType.ActivityMatrix)
            {
                capc.MergeSameActivityParamBySN();
            }

            capc.ForEach(cap => InitTransitionTemplatesProperties(cap, definitions, cap.Source));
        }