Exemplo n.º 1
0
 internal ListsNode(WebNode parent)
 {
     this.parent = parent;
     lazyList    = new LazyLoadingList(LoadChildren);
     Children    = lazyList;
     parent.Lists.Advise(Notify);
 }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 3
0
 internal void Refresh()
 {
     folderItems = folderItems.EnsureDispose();
     ClearFolders();
     lazyChildren = new LazyLoadingList(LoadChildren);
     Children     = lazyChildren;
 }
Exemplo n.º 4
0
 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();
 }
Exemplo n.º 5
0
        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);
        }
Exemplo n.º 6
0
        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;
            }
        }
Exemplo n.º 7
0
        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;
        }
Exemplo n.º 8
0
        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));
        }
Exemplo n.º 9
0
 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,
         }
     };
 }