Exemplo n.º 1
0
        public void Filter_ReturnsCorrectResult(string filter, bool expected)
        {
            var project = new Project
            {
                ProjectTags = new List <ProjectTags>
                {
                    new()
                    {
                        Tag = new Tag
                        {
                            Name = "Tag1"
                        }
                    }
                }
            };

            var projectFilterArgs = new ProjectFilterArgs {
                Tag = filter
            };

            var sut = new FilterTag();

            var actual = sut.Filter(project, projectFilterArgs);

            actual.Should().Be(expected);
        }
Exemplo n.º 2
0
        public void Initialize(AppBar newParentToolBar, AppBar.ButtonTemplate newTemplate, ButtonIconProfile newCustomProfile)
        {
            // TODO move this into the tag manager
            VisibleFilterTag     = new FilterTag();
            VisibleFilterTag.Tag = "Default";
            HiddenFilterTag      = new FilterTag();
            HiddenFilterTag.Tag  = "Hidden";

            template          = newTemplate;
            customIconProfile = newCustomProfile;
            parentToolBar     = newParentToolBar;

            cButton = GetComponent <CompoundButton>();
            cButton.MainRenderer.enabled = false;
            text      = GetComponent <CompoundButtonText>();
            text.Text = template.Text;
            icon      = GetComponent <CompoundButtonIcon>();
            if (customIconProfile != null)
            {
                icon.IconProfile = customIconProfile;
                icon.IconName    = string.Empty;
            }
            icon.IconName = template.Icon;
            initialized   = true;
            Hide();
        }
Exemplo n.º 3
0
        public void Filter_ProjectNull_ThrowsArgumentNullException()
        {
            var projectFilterArgs = new ProjectFilterArgs();

            var sut = new FilterTag();

            Assert.Throws <ArgumentNullException>(() => sut.Filter(null, projectFilterArgs));
        }
Exemplo n.º 4
0
        public void Filter_ProjectFilterArgsNull_ReturnsTrue()
        {
            var project = new Project();

            var sut    = new FilterTag();
            var actual = sut.Filter(project, null);

            actual.Should().Be(true);
        }
Exemplo n.º 5
0
        public override int Initialize(int count = 1)
        {
            if (!Initialized)
            {
                m_ChromaTag = m_ChromaFilter.Tag;
            }

            return(base.Initialize(count));
        }
 protected void OnEnable()
 {
     // TODO move this into the tag manager
     VisibleFilterTag     = new FilterTag();
     VisibleFilterTag.Tag = "Default";
     HiddenFilterTag      = new FilterTag();
     HiddenFilterTag.Tag  = "Hidden";
     RefreshType();
     Hide();
 }
Exemplo n.º 7
0
        public void Filter_NoTagOnProject_ReturnsCorrectResult(string filter, bool expected)
        {
            var project = new Project();

            var projectFilterArgs = new ProjectFilterArgs {
                Tag = filter
            };

            var sut = new FilterTag();

            var actual = sut.Filter(project, projectFilterArgs);

            actual.Should().Be(expected);
        }
        private void OnFilterButtonSelected(FilterTag filterTag)
        {
            filterTag.IsSelected = !filterTag.IsSelected;
            bool isJitEnabled   = FilterButtons.Any(x => x.IsJit && x.IsSelected);
            var  selectedFilter = FilterButtons.Where(x => x.IsSelected).Select(x => x.Tag).ToList();

            System.Diagnostics.Debug.WriteLine($"Filtet Button Tapped : {filterTag.IsSelected}");
            if (filterTag.Tag.Equals(FilterButtonText))
            {
                // Navigate on Filter screen.
                _navigationService.NavigateToAsync(Enums.PageKey.Filter);
            }
            else
            {
                FiltereList(selectedFilter, isJitEnabled);
            }
        }
Exemplo n.º 9
0
        public IFilter <TOutput> CreateOutputFilter()
        {
            try
            {
                var input = MakeInitialFilter()
                            .MakeTagged();

                return(m_Chain
                       .Process(input)
                       .Apply(FinalizeOutput)
                       .GetTag(out m_Tag)
                       .Compile()
                       .InitializeFilter());
            }
            catch (Exception ex)
            {
                m_Tag = ErrorMessage(ex);
                return(HandleError(ex).Compile().InitializeFilter());
            }
        }
Exemplo n.º 10
0
        public void Initialize(AppBar newParentToolBar, AppBar.ButtonTemplate newTemplate, ButtonIconProfile newCustomProfile)
        {
            // TODO move this into the tag manager
            VisibleFilterTag     = new FilterTag();
            VisibleFilterTag.Tag = "Default";
            HiddenFilterTag      = new FilterTag();
            HiddenFilterTag.Tag  = "Hidden";

            template          = newTemplate;
            customIconProfile = newCustomProfile;
            parentToolBar     = newParentToolBar;

            cButton = GetComponent <CompoundButton>();
            cButton.MainRenderer.enabled = false;
            text      = GetComponent <CompoundButtonText>();
            text.Text = template.Text;
            icon      = GetComponent <CompoundButtonIcon>();
            if (customIconProfile != null)
            {
                icon.Profile  = customIconProfile;
                icon.IconName = string.Empty;
            }
            icon.IconName = template.Icon;
            initialized   = true;
            Hide();

            if (newTemplate.EventTarget != null)
            {
                // Register the button with its target interactable
                newTemplate.EventTarget.RegisterInteractible(gameObject);
            }
            else
            {
                // Register the button with the parent app bar
                newParentToolBar.RegisterInteractible(gameObject);
            }
        }
Exemplo n.º 11
0
 private void pushStatement(Element element, FilterTag tag, String value)
 {
     currentStatements.Add(element.ToString() +
                           "(" + Bounds + ")" +
                           "[" + tag.ToString() + " = " + value + "];");
 }
Exemplo n.º 12
0
 private String getWay(Bound Bounds, FilterTag filterTag, String filterValue)
 {
     return("way(" + Bounds.ToString() + ")[" + filterTag + " = " + filterValue + "];");
 }
Exemplo n.º 13
0
 private void OnFilterTagSelected(FilterTag filterTag)
 {
     filterTag.IsSelected = !filterTag.IsSelected;
     System.Diagnostics.Debug.WriteLine($"Filtet tag selected : {filterTag.IsSelected}");
 }