Exemple #1
0
 private void MediaDetectionForm_Loaded(object sender, RoutedEventArgs e)
 {
     foreach (DetectedMedia media in this.listNewMedia)
     {
         NewMediaDetectionItem item = new NewMediaDetectionItem();
         item.lblMediaUID.Content    = media.SupportData.UIdSupport;
         item.lblMediaUID.ToolTip    = media.SupportData.UIdSupport;
         item.lblMediaVolume.Content = media.Volume;
         item.lblMediaVolume.ToolTip = media.Volume;
         this.spNewFilesInVolumes.Children.Add(item);
     }
 }
Exemple #2
0
        private void btAddSelected_Click(object sender, RoutedEventArgs e)
        {
            int i = this.spNewFilesInVolumes.Children.Count - 1;

            while (i > -1)
            {
                NewMediaDetectionItem element = this.spNewFilesInVolumes.Children[i] as NewMediaDetectionItem;
                string        SupportUID      = (string)element.lblMediaUID.Content;
                DetectedMedia currentSupport  = listNewMedia.Where(lmm => lmm.SupportData.UIdSupport == SupportUID).FirstOrDefault();
                if (element.chkbxSelected.IsChecked.HasValue && element.chkbxSelected.IsChecked.Value)
                {
                    currentSupport.State = DetectionState.ToAdd;
                }
                else
                {
                    currentSupport.State = DetectionState.New;
                }
                i--;
            }
            this.DialogResult = true;
            this.Close();
        }