コード例 #1
0
 public TabDocumentGroupControl(Group group)
 {
     InitializeComponent();
     Group = group;
     DeselectedBlocks = new List<Block>();
 }
コード例 #2
0
ファイル: Block.cs プロジェクト: arusland/dax
 public bool HasGroup(Group group)
 {
     return Groups.Any(p => p.Equals(group));
 }
コード例 #3
0
 private void AddTabItem(Group group)
 {
     var item = new TabItem() { Header = group.Name, Content = new TabDocumentGroupControl(group) };
     tabControlMain.Items.Add(item);
 }
コード例 #4
0
 private bool AllowBlockFilter(Block target, Group currentGroup, List<Block> deselectedBlocks)
 {
     return (deselectedBlocks.Count == 0 || deselectedBlocks.All(p => p.Order != target.Order))
         && (currentGroup.IsAll || target.HasGroup(currentGroup));
 }
コード例 #5
0
        public void InvokeSearch()
        {
            if (_daxManager.CanSearch)
            {
                InputControls.ToList().ForEach(p => p.IsHighlighted = false);

                var inputs = InputControls.Where(p => p.IsSelected)
                                .Where(p => p.Context.AllowBlank || !p.IsBlank)
                                .ToList();

                inputs.ForEach(p => p.IsHighlighted = true);

                var deselectedGroups = BlockControls
                    .Where(p => !p.IsSelected)
                    .Select(p => p.Block)
                    .ToList();

                CurrentTab.DeselectedBlocks.Clear();
                CurrentTab.DeselectedBlocks.AddRange(deselectedGroups);

                if (BlockControls.All(p => !p.IsSelected))
                {
                    CurrentTab.DeselectedBlocks.Clear();
                }

                _currentGroup = CurrentTab.Group;
                List<Block> deselectedBlocks = CurrentTab.DeselectedBlocks;

                var inputValues = inputs.ToDictionary(p => p.InputName, p => p.InputValue);
                _daxManager.SearchAsync(inputValues, b => AllowBlockFilter(b, _currentGroup, deselectedBlocks));
            }
        }