internal void Refresh() { LazyObservable <FolderListItemCollection> ret = null; ret = new LazyObservable <FolderListItemCollection>(delegate() { return(ParentFolder.GetListItems(null, Recursive.No, Fields, delegate(JArray <ListItem> listItems) { if (items == ret) { ret.Value = new FolderListItemCollection(ParentFolder, listItems); } else { Dispose(listItems); } }, delegate(Exception e) { ret.Exception = e; })); }); DisposeItems(); items = ret; Notify(); }
void DisposeItems() { if (items != null) { items.Disconnect(); if (items.State == LazyState.Loaded) { items.Value.Dispose(); } items = null; } }
internal RootNodes(App app) { this.app = app; configuration = new ReferenceObservable <Configuration <RootNode> >(); configuration.Advise(ConfigurationChange); roots = new ReferenceObservableList(); currenSite = new ReferenceObservableList(); lazyCurrenSite = new LazyObservable <RootNode>(LoadCurrentSite); loadingCurrenSite = new LazyLoadingList(LoadCurrentSiteList); List = new ObservableUnionList() { Lists = new ObservableList <IObservableList>() { new ObservableList <ITreeNode>() { new InformationNode() }, currenSite, roots, } }; }