Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ExtendedListView"/> class.
        /// </summary>
        public ExtendedListView()
        {
            // Creating the rows collection.
            this.Rows = new RowsCollection(this);

            // Creating the models.
            this.SelectionModel = new SelectionModel(this);
            this.CheckModel     = new CheckModel();
            this.ExpandModel    = new ExpandModel(this);

            // Creating the behaviors.
            this.mSelectionBehavior    = new SelectionBehavior(this);
            this.mExpandBehavior       = new ExpandBehavior(this);
            this.mColumnResizeBehavior = new ColumnResizeBehavior(this);
        }
Exemplo n.º 2
0
        private NameValueCollection ApplyExpansionBehavior(NameValueCollection queryParameters, ExpandBehavior expandBehavior)
        {
            switch (expandBehavior)
            {
            case ExpandBehavior.OneLevel:
            {
                var values = queryParameters.GetValues("$expand");
                if (values != null)
                {
                    queryParameters.Remove("$expand");
                    foreach (var value in values.Where(value => !value.Contains("/")))
                    {
                        queryParameters.Add("$expand", value);
                    }
                }
            }
            break;

            case ExpandBehavior.None:
            {
                queryParameters.Remove("$expand");
                return(queryParameters);
            }

            default:
                return(queryParameters);
            }
            throw new NotImplementedException();
        }
Exemplo n.º 3
0
 public ODataQuery(NameValueCollection queryParameters, ExpandBehavior expandBehavior = ExpandBehavior.None)
 {
     queryParameters = ApplyExpansionBehavior(queryParameters, expandBehavior);
     ModelFilter     = new ParameterParser <T>().Parse(queryParameters);
 }