Пример #1
0
            public void LoadTaskLists(IBackend backend)
            {
                if (backend == null)
                {
                    throw new ArgumentNullException("backend");
                }
                this.backend = backend;

                if (IsLoaded)
                {
                    UnloadTaskLists();
                }
                IsLoaded = true;

                var i = 0;

                foreach (var item in backend.GetAll())
                {
                    AddList(i++, (ITaskList)item, true);
                }

                // enable backend propagation on all objects
                foreach (var list in this)
                {
                    if (list.ListType == TaskListType.Regular)
                    {
                        ((IBackendDetachable)list).AttachBackend(null);
                    }
                }
            }