Exemplo n.º 1
0
        private void Scan()
        {
            this.changers = MediaChangeManagerHelper.GetChangers();
            //pop known/unknown discs
            foreach (MediaChangerEx changer in this.changers)
            {
                foreach (DiscDataEx disc in changer.Discs)
                {
                    if (disc.DiscType == DiscType.Unknown)
                    {
                        this.unknownDiscs.Add(disc);
                    }
                    else
                    {
                        this.knownDiscs.Add(disc);
                    }
                }
            }

            //let the gallery load first-this is somewhat hackish
            if (this.NeedsFullScan)
            {
                //Timer scanTimer = new Timer();
                //scanTimer.AutoRepeat = false;
                //scanTimer.Tick += new EventHandler(scanTimer_Tick);

                //scanTimer.Interval = 9000;
                //scanTimer.Enabled = true;
                //scanTimer.Start();
            }
        }
Exemplo n.º 2
0
        // Methods
        public int Compare(object x, object y)
        {
            if ((x == null) && (y == null))
            {
                return(0);
            }
            if (x == null)
            {
                return(-1);
            }
            if (y == null)
            {
                return(1);
            }
            DiscCommand disc  = (DiscCommand)x;
            DiscCommand disc2 = (DiscCommand)y;

            if (disc.IsDrive != disc2.IsDrive)
            {
                if (!disc.IsDrive)
                {
                    return(1);
                }
                return(-1);
            }
            int num = string.Compare(disc.Type, disc2.Type, true, CultureInfo.CurrentUICulture);

            if (num == 0)
            {
                return(MediaChangeManagerHelper.StrCmpLogicalW(disc.SortingName, disc2.SortingName));
            }
            return(num);
        }
Exemplo n.º 3
0
 // Methods
 public int Compare(object x, object y)
 {
     if ((x == null) && (y == null))
     {
         return(0);
     }
     if (x != null)
     {
         if (y == null)
         {
             return(1);
         }
         DiscCommand disc  = (DiscCommand)x;
         DiscCommand disc2 = (DiscCommand)y;
         if (disc.IsDrive == disc2.IsDrive)
         {
             return(MediaChangeManagerHelper.StrCmpLogicalW(disc.SortingName, disc2.SortingName));
         }
         if (!disc.IsDrive)
         {
             return(1);
         }
     }
     return(-1);
 }
Exemplo n.º 4
0
 public void PromptForScan()
 {
     if (this.NeedsFullScan)
     {
         DialogResult res = OMLApplication.Current.MediaCenterEnvironment.Dialog("New discs have been detected in the disc changer. Do you want to update your disc library now? It may take several minutes to load and scan each new disc.", "NEW DISCS FOUND", DialogButtons.Yes | DialogButtons.No, -1, true);
         if (res == DialogResult.Yes)
         {
             MediaChangeManagerHelper.RescanAllDiscs();
         }
     }
 }
Exemplo n.º 5
0
        private void beginRescan(object obj)
        {
            //slow this thread down
            //ThreadPriority priority = Thread.CurrentThread.Priority;
            //Thread.CurrentThread.Priority = ThreadPriority.Lowest;

            try
            {
                MediaChangeManagerHelper.RescanAllDiscs();
                //Microsoft.MediaCenter.UI.Application.DeferredInvoke(notifyRescanComplete, null);
            }
            finally
            {
                //
                // Reset our thread's priority back to its previous value
                //
                //Thread.CurrentThread.Priority = priority;
            }
        }
Exemplo n.º 6
0
 public void Load()
 {
     this.DrivePath = MediaChangeManagerHelper.LoadDisc(this);
 }
Exemplo n.º 7
0
 public void Eject()
 {
     MediaChangeManagerHelper.EjectDisc(this);
 }