void SortCommands_ChosenChanged(object sender, EventArgs e) { if (this.SortCommands.ChosenIndex == 1) { this.DiscManagerSort = DiscManagerSortType.Type; } else { this.DiscManagerSort = DiscManagerSortType.Name; } this.SortList(); }
void SortCommands_ChosenChanged(object sender, EventArgs e) { if(this.SortCommands.ChosenIndex==1) this.DiscManagerSort = DiscManagerSortType.Type; else this.DiscManagerSort = DiscManagerSortType.Name; this.SortList(); }
public MediaChangerManagerPage() { this.managerCommands = new ArrayListDataSet(this); //save command Command rescanCmd = new Command(); rescanCmd.Description = "Rescan Discs"; rescanCmd.Invoked += new EventHandler(rescanCmd_Invoked); this.managerCommands.Add(rescanCmd); this.sortCommands = new Choice(this); ArrayListDataSet sortSet = new ArrayListDataSet(); Command sortByName=new Command(this); sortByName.Description="Sort by Name"; sortSet.Add(sortByName); Command sortByType = new Command(this); sortByType.Description = "Sort by Type"; sortSet.Add(sortByType); this.sortCommands.Options = sortSet; this.SortCommands.ChosenChanged += new EventHandler(SortCommands_ChosenChanged); this.enableMediaChangers = new BooleanChoice(this, "Enable support for media changers"); this.enableMediaChangers.Value = Properties.Settings.Default.MediaChangersEnabled; this.detectMediaChangers = new BooleanChoice(this, "Detect new discs added to your changer"); this.detectMediaChangers.Value = Properties.Settings.Default.MediaChangersDetect; this.retrieveMetaData = new BooleanChoice(this, "Retrieve MetaData from Microsoft"); this.retrieveMetaData.Value = Properties.Settings.Default.MediaChangersRetrieveMetaData; this.manageChangers = new Command(this); this.manageChangers.Description = "Manage Discs"; this.manageChangers.Invoked += delegate(object changerSender, EventArgs changerArgs) { Dictionary<string, object> manageProperties = new Dictionary<string, object>(); manageProperties["Page"] = this; manageProperties["Application"] = Library.OMLApplication.Current; Library.OMLApplication.Current.Session.GoToPage("resx://Library/Library.Resources/V3_MediaChangerManagerPage", manageProperties); }; this.commands = new ArrayListDataSet(this); //save command Command saveCmd = new Command(); saveCmd.Description = "Save"; saveCmd.Invoked += new EventHandler(saveCmd_Invoked); this.commands.Add(saveCmd); //cancel command Command cancelCmd = new Command(); cancelCmd.Description = "Cancel"; cancelCmd.Invoked += new EventHandler(cancelCmd_Invoked); this.commands.Add(cancelCmd); this.discArray = new ArrayListDataSet(); if (OMLApplication.Current.MediaChangers.HasMediaChangers) { foreach (DiscDataEx disc in OMLApplication.Current.MediaChangers.KnownDiscs) { DiscCommand discItem = new DiscCommand(this); discItem.Description = disc.VolumeLabel; discItem.Disc = disc; if (!string.IsNullOrEmpty(disc.Title)) discItem.Description = disc.Title; discItem.Invoked += delegate(object discSender, EventArgs discArgs) { if(discSender is DiscCommand) { this.IsBusy = true; Microsoft.MediaCenter.UI.Application.DeferredInvokeOnWorkerThread(beginEject, endEject, (object)discSender); //((DiscCommand)discSender).Disc.Eject(); //this.updateDiscArray(); } }; this.discArray.Add(discItem); } } this.DiscManagerSort = DiscManagerSortType.Name; this.SortList(); //for (int i = 0; i < 20; ++i) //{ // Command c = new Command(this); // c.Description = string.Format("This is a very long description of a Test Disc {0}", i.ToString()); // this.discArray.Add(c); //} this.DetermineShowErrorMessage(); }
public MediaChangerManagerPage() { this.managerCommands = new ArrayListDataSet(this); //save command Command rescanCmd = new Command(); rescanCmd.Description = "Rescan Discs"; rescanCmd.Invoked += new EventHandler(rescanCmd_Invoked); this.managerCommands.Add(rescanCmd); this.sortCommands = new Choice(this); ArrayListDataSet sortSet = new ArrayListDataSet(); Command sortByName = new Command(this); sortByName.Description = "Sort by Name"; sortSet.Add(sortByName); Command sortByType = new Command(this); sortByType.Description = "Sort by Type"; sortSet.Add(sortByType); this.sortCommands.Options = sortSet; this.SortCommands.ChosenChanged += new EventHandler(SortCommands_ChosenChanged); this.enableMediaChangers = new BooleanChoice(this, "Enable support for media changers"); this.enableMediaChangers.Value = Properties.Settings.Default.MediaChangersEnabled; this.detectMediaChangers = new BooleanChoice(this, "Detect new discs added to your changer"); this.detectMediaChangers.Value = Properties.Settings.Default.MediaChangersDetect; this.retrieveMetaData = new BooleanChoice(this, "Retrieve MetaData from Microsoft"); this.retrieveMetaData.Value = Properties.Settings.Default.MediaChangersRetrieveMetaData; this.manageChangers = new Command(this); this.manageChangers.Description = "Manage Discs"; this.manageChangers.Invoked += delegate(object changerSender, EventArgs changerArgs) { Dictionary <string, object> manageProperties = new Dictionary <string, object>(); manageProperties["Page"] = this; manageProperties["Application"] = Library.OMLApplication.Current; Library.OMLApplication.Current.Session.GoToPage("resx://Library/Library.Resources/V3_MediaChangerManagerPage", manageProperties); }; this.commands = new ArrayListDataSet(this); //save command Command saveCmd = new Command(); saveCmd.Description = "Save"; saveCmd.Invoked += new EventHandler(saveCmd_Invoked); this.commands.Add(saveCmd); //cancel command Command cancelCmd = new Command(); cancelCmd.Description = "Cancel"; cancelCmd.Invoked += new EventHandler(cancelCmd_Invoked); this.commands.Add(cancelCmd); this.discArray = new ArrayListDataSet(); if (OMLApplication.Current.MediaChangers.HasMediaChangers) { foreach (DiscDataEx disc in OMLApplication.Current.MediaChangers.KnownDiscs) { DiscCommand discItem = new DiscCommand(this); discItem.Description = disc.VolumeLabel; discItem.Disc = disc; if (!string.IsNullOrEmpty(disc.Title)) { discItem.Description = disc.Title; } discItem.Invoked += delegate(object discSender, EventArgs discArgs) { if (discSender is DiscCommand) { this.IsBusy = true; Microsoft.MediaCenter.UI.Application.DeferredInvokeOnWorkerThread(beginEject, endEject, (object)discSender); //((DiscCommand)discSender).Disc.Eject(); //this.updateDiscArray(); } }; this.discArray.Add(discItem); } } this.DiscManagerSort = DiscManagerSortType.Name; this.SortList(); //for (int i = 0; i < 20; ++i) //{ // Command c = new Command(this); // c.Description = string.Format("This is a very long description of a Test Disc {0}", i.ToString()); // this.discArray.Add(c); //} this.DetermineShowErrorMessage(); }