Exemplo n.º 1
0
        public DirectoryInfoReader(string directorypath)
        {
            this.directorypath = directorypath;
            this.modelFolders  = Directory.GetDirectories(this.directorypath);

            /*
             * Each folder represents one model
             *
             */
            foreach (string folder in this.modelFolders)
            {
                string   folderName  = folder.Split('\\').Last();
                string[] numberTitle = folderName.Split('-');
                int      number      = int.Parse(numberTitle[0]);
                string   title       = numberTitle[1];
                string[] images      = Directory.GetFiles(folder + "\\images");
                string[] notes       = new string[] {};
                if (Directory.Exists(folder + "\\notes"))
                {
                    notes = Directory.GetFiles(folder + "\\notes");
                }
                ExternalModel next = new ExternalModel(number, title, images, notes);
                this.externalModels.Add(next);
            }
        }
Exemplo n.º 2
0
 //Logic for adding items to the scatterview
 private void checkAndAddModel(object sender, ContactEventArgs e)
 {
     //make sure that the item is not already being displayed
     if (e.Contact.IsTagRecognized && e.Contact.Tag.Type == TagType.Byte && (int)e.Contact.Tag.Byte.Value != currentTag)
     {
         ExternalModel myModel = modelData.GetOrganFromTag(e.Contact.Tag.Byte.Value);
         currentTag = (int)e.Contact.Tag.Byte.Value;
         ClearInfo();
         if (myModel != null)
         {
             //AddMediaElementsToScatterView(myModel.GetImagesNodes());
             AddSVIsToScatterView(myModel.GetSVIs());
             //organNameLabel.Content = myModel.title;
             //organDescriptionBox.Text = myModel.description;
         }
     }
 }
 public DirectoryInfoReader(string directorypath)
 {
     this.directorypath = directorypath;
     this.modelFolders = Directory.GetDirectories(this.directorypath);
     /*
      * Each folder represents one model
      *
      */
     foreach (string folder in this.modelFolders)
     {
         string folderName = folder.Split('\\').Last();
         string[] numberTitle = folderName.Split('-');
         int number = int.Parse(numberTitle[0]);
         string title = numberTitle[1];
         string[] images = Directory.GetFiles(folder+"\\images");
         string[] notes = new string[]{};
         if (Directory.Exists(folder+"\\notes"))
         {
             notes = Directory.GetFiles(folder + "\\notes");
         }
         ExternalModel next = new ExternalModel(number, title, images, notes);
         this.externalModels.Add(next);
       }
 }