예제 #1
0
파일: ListModel.cs 프로젝트: jrivam/demo
        public ListModel(IListDomain <T, U, V> domains,
                         string name)
        {
            Domains = domains;

            Name = name;

            AddCommand = new RelayCommand(delegate(object parameter)
            {
                Messenger.Default.Send <W>(null, $"{Name}Add");
            }, delegate(object parameter) { return(this != null); });
        }
예제 #2
0
        public ListModelQuery(IListDomain <T, U, V> domains,
                              string name,
                              Q query, int maxdepth = 1, int top = 0)
            : base(domains, name)
        {
            _query    = query;
            _maxdepth = maxdepth;

            RefreshCommand = new RelayCommand(delegate(object parameter)
            {
                Messenger.Default.Send <int>(top, $"{Name}Refresh");
            }, delegate(object parameter) { return(true); });

            TotalRecords();
        }
예제 #3
0
파일: LogicQuery.cs 프로젝트: jrivam/demo
        public virtual (Result result, IEnumerable <V> domains) List(IQueryDomain <S, T, U, V> query, int maxdepth = 1, int top = 0, IListDomain <T, U, V> domains = null)
        {
            var enumeration = new List <V>();

            var selectmultiple = query.Data.Select(maxdepth, top, (domains?.Datas != null ? domains?.Datas : new ListData <T, U>()));

            if (selectmultiple.result.Success && selectmultiple.datas != null)
            {
                foreach (var instance in LoadDatas(selectmultiple.datas, maxdepth))
                {
                    instance.Changed = false;
                    instance.Deleted = false;

                    enumeration.Add(instance);
                }

                return(selectmultiple.result, enumeration);
            }

            return(selectmultiple.result, default(IList <V>));
        }
예제 #4
0
        public virtual (Result result, IEnumerable <V> domains) List(int maxdepth = 1, int top = 0, IListDomain <T, U, V> domains = null)
        {
            var list = _logic.List(this, maxdepth, top, domains);

            return(list);
        }