internal ListsNode(WebNode parent) { this.parent = parent; lazyList = new LazyLoadingList(LoadChildren); Children = lazyList; parent.Lists.Advise(Notify); }
IDisposable LoadChildren() { return(parent.Lists.Get( delegate(ObservableList <List> source) { if (source == null) { Children = null; } else { JArray <List> ar = new JArray <List>((int)source.Count); for (int i = 0; i < ar.Length; i++) { ar[i] = source[i]; } ar.Sort(CompareByTitle); Children = new ObservableHierarchyList <List>(ar); } lazyList = lazyList.EnsureDispose(); }, lazyList.SetException)); }
internal void Refresh() { folderItems = folderItems.EnsureDispose(); ClearFolders(); lazyChildren = new LazyLoadingList(LoadChildren); Children = lazyChildren; }
protected override void Notify() { if (lazyList == null && (parent.Lists.State == LazyState.Empty || parent.Lists.State == LazyState.Loading)) { lazyList = new LazyLoadingList(LoadChildren); Children = lazyList; } base.Notify(); }
internal WebsNode(WebNode parent) { this.parent = parent; sorter = new ListView <Web, string, string>(JMapFactories.String, delegate(Web web) { return(UriUtility.GetFileName(web.Url).ToLowerInvariant()); }, null, delegate(Web web) { return(web.Title); }, String.Compare); lazyList = new LazyLoadingList(LoadChildren); Children = lazyList; parent.Webs.Advise(Notify); }
void ConfigurationChange() { if (Configuration != null) { roots.List = Configuration.Roots; if (Configuration.Roots != null) { foreach (RootNode rootNode in Configuration.Roots) { rootNode.RootNodes = this; } } switch (Configuration.EffectiveDisplayCurrent) { case DisplayCurrentMode.None: currenSite.List = null; break; case DisplayCurrentMode.Web: if (currentSiteLoadingAsSite) { lazyCurrenSite.Clear(); loadingCurrenSite = new LazyLoadingList(LoadCurrentSiteList); currenSite.List = loadingCurrenSite; } currenSite.List = loadingCurrenSite; break; case DisplayCurrentMode.Site: if (!currentSiteLoadingAsSite) { lazyCurrenSite.Clear(); } loadingCurrenSite = new LazyLoadingList(LoadCurrentSiteList); currenSite.List = loadingCurrenSite; break; } } else { roots.List = null; currenSite.List = null; } }
public FolderNode() { Folders.Advise(folders_Changed); sorter = new ListView <Folder, int, string>(JMapFactories.Int, delegate(Folder folder) { return(folder.Item.ID); }, null, delegate(Folder folder) { return(folder.Name.ToLowerInvariant()); }, String.Compare); lazyChildren = new LazyLoadingList(LoadChildren); Children = lazyChildren; }
IDisposable LoadChildren() { return(parent.Webs.Get( delegate(ObservableList <Web> source) { if (source == null) { Children = null; } else { sorter.Source = source; Children = sorter.Target; } lazyList = lazyList.EnsureDispose(); }, lazyList.SetException)); }
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, } }; }