Пример #1
0
 private static StringBuffer AppendGroupId(StringBuffer sb, string groupId, DfmTabItemBlockToken item)
 {
     sb += groupId;
     sb += "_";
     sb += item.Id;
     if (!string.IsNullOrEmpty(item.Condition))
     {
         sb += "_";
         sb += item.Condition;
     }
     return(sb);
 }
Пример #2
0
        private static int ApplyTabVisible(List <string[]> tabSelectionInfo, List <DfmTabItemBlockToken> items)
        {
            int firstVisibleTab = -1;

            for (int i = 0; i < items.Count; i++)
            {
                var tab     = items[i];
                var visible = string.IsNullOrEmpty(tab.Condition) || tabSelectionInfo.Any(t => t[0] == tab.Condition);
                if (visible && firstVisibleTab == -1)
                {
                    firstVisibleTab = i;
                }
                if (tab.Visible != visible)
                {
                    items[i] = new DfmTabItemBlockToken(tab.Rule, tab.Context, tab.Id, tab.Condition, tab.Title, tab.Content, visible, tab.SourceInfo);
                }
            }

            return(firstVisibleTab);
        }