示例#1
0
        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();
        }
示例#2
0
        void DisposeItems()
        {
            if (items != null)
            {
                items.Disconnect();
                if (items.State == LazyState.Loaded)
                {
                    items.Value.Dispose();
                }

                items = null;
            }
        }
示例#3
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,
         }
     };
 }