示例#1
0
        /// <summary>
        /// Creates a FilteredView on top of an existing static view.
        /// </summary>
        /// <param name="view">the static view to base the FilteredView upon</param>
        /// <param name="key">the key for the filtered view (must be unique)</param>
        /// <param name="description">a description of the filtered view</param>
        /// <param name="mode">whether to Include or Exclude elements/relationships based upon their tag</param>
        /// <param name="tags">the tags to include or exclude</param>
        /// <returns></returns>
        public FilteredView CreateFilteredView(StaticView view, string key, string description, FilterMode mode, params string[] tags)
        {
            AssertThatTheViewKeyIsUnique(key);

            FilteredView filteredView = new FilteredView(view, key, description, mode, tags);

            _filteredViews.Add(filteredView);

            return(filteredView);
        }
        internal FilteredView(StaticView view, string key, string description, FilterMode mode, params string[] tags) : this()
        {
            View        = view;
            Key         = key;
            Description = description;
            Mode        = mode;

            if (tags != null)
            {
                foreach (string tag in tags)
                {
                    Tags.Add(tag);
                }
            }
        }