Beispiel #1
0
        static public Folder GetWtmlFile(string url, Action complete, bool?loadChildFolders)
        {
            if (loadChildFolders == null)
            {
                loadChildFolders = false;
            }
            Folder folder = new Folder();

            folder.Url = url;
            FolderDownloadAction folderDownloadAction = new FolderDownloadAction(complete, (bool)loadChildFolders);

            folderDownloadAction.StartingNewFolderLoad(folder);
            return(folder);
        }
Beispiel #2
0
        static public void LoadImagesets(Folder folder, FolderDownloadAction folderDownloadAction)
        {
            List <IThumbnail> children = folder.Children;

            foreach (object child in children)
            {
                if (child is Imageset)
                {
                    Imageset imageSet = (Imageset)child;
                    WWTControl.AddImageSetToRepository(imageSet);
                }
                if (child is Place)
                {
                    Place place = (Place)child;
                    if (place.StudyImageset != null)
                    {
                        WWTControl.AddImageSetToRepository(place.StudyImageset);
                    }

                    if (place.BackgroundImageset != null)
                    {
                        WWTControl.AddImageSetToRepository(place.BackgroundImageset);
                    }
                }
                if (child is Folder && folderDownloadAction.loadChildFolders)
                {
                    folderDownloadAction.StartingNewFolderLoad(((Folder)child));
                }
            }


            if (!string.IsNullOrEmpty(WWTControl.ImageSetName))
            {
                string name = WWTControl.ImageSetName.ToLowerCase();
                foreach (Imageset imageset in WWTControl.GetImageSets())
                {
                    if (imageset.Name.ToLowerCase() == name)
                    {
                        WWTControl.Singleton.RenderContext.BackgroundImageset = imageset;
                    }
                }
            }
        }