Exemple #1
0
        public RICustomDataCategory AddCategory(String caption)
        {
            RICustomDataCategory cat = new RICustomDataCategory(Root, caption, (Int16)(Level + 1));

            Children.Add(cat);

            return(cat);
        }
Exemple #2
0
        private static void GetExpandStates(List <RICustomDataElement> children, Hashtable expandedStates)
        {
            foreach (RICustomDataElement element in children)
            {
                if (element.CustomDataType == RICustomDataElementType.Category)
                {
                    RICustomDataCategory cat = (RICustomDataCategory)element;

                    Int32 hashId = (Int32)String.Format("{0}:{1}", cat.Caption, cat.Level).BKDRHash();
                    expandedStates[hashId] = cat.Expanded;

                    GetExpandStates(cat.Children, expandedStates);
                }
            }
        }
Exemple #3
0
        private static void UpdateCustomData(RICustomData cData, String groupName, List <ListNode> list)
        {
            if (list.Count == 0)
            {
                return;
            }

            RICustomDataCategory cat = cData.AddCategory(groupName);

            using (var pool = FastFormatterPool.Pool.Container())
            {
                foreach (ListNode node in list)
                {
                    RICustomDataRow row = cat.AddRow();
                    row.AddField(node.FName);
                    row.AddField(node.FValue);

                    row.SetExtraData(pool.Instance, new DetailContainerInt32(node.FStates.GetHashCode()));
                }
            }
        }
Exemple #4
0
        private static void AssignExpandedStates(List <RICustomDataElement> children, Hashtable expandedStates, ref Int32 id)
        {
            foreach (RICustomDataElement element in children)
            {
                element.Id = ++id;
                if (element.CustomDataType == RICustomDataElementType.Category)
                {
                    RICustomDataCategory cat = (RICustomDataCategory)element;

                    if (expandedStates != null)
                    {
                        Int32 hashId = (Int32)String.Format("{0}:{1}", cat.Caption, cat.Level).BKDRHash();
                        if (expandedStates.ContainsKey(hashId))
                        {
                            cat.Expanded = (Boolean)expandedStates[hashId];
                        }
                    }

                    AssignExpandedStates(cat.Children, expandedStates, ref id);
                }
            }
        }