Ejemplo n.º 1
0
        /// <inheritdoc/>
        public override void AwakeFromNib()
        {
            base.AwakeFromNib();
            View.Controller = this;

            var nsArray = NSArray.FromNSObjects(View.ViewModel.Programs.ToArray());

            var origValue = RomsArrayController.SelectsInsertedObjects;

            RomsArrayController.SelectsInsertedObjects = false;
            RomsArrayController.AddObjects(nsArray);
            RomsArrayController.RearrangeObjects();
            RomsArrayController.SelectsInsertedObjects = origValue;

            var table = View.FindChild <ROMsTableView>();

            table.Controller = this;
            DataSource       = new RomListDataSource(RomsArrayController);
            table.DataSource = DataSource;
            var tableDelegate = new RomListTableViewDelegate(RomsArrayController, View.ViewModel);

            table.Delegate = tableDelegate;
            TheDelegate    = tableDelegate;
            var programs = RomsArrayController.ArrangedObjects();

            for (int i = 0; i < (int)nsArray.Count; ++i)
            {
                var program     = programs[i] as ProgramDescriptionViewModel;
                var featuresTip = program.FeaturesTip;
            }

            View.ViewModel.Programs.CollectionChanged         += HandleProgramsChanged;
            View.ViewModel.CurrentSelection.CollectionChanged += HandleRomListSelectionChanged;
            HandleRomListSelectionChanged(null, null);

            INTV.Shared.Properties.Settings.Default.PropertyChanged += HandlePreferenceChanged;
            HandlePreferenceChanged(null, new System.ComponentModel.PropertyChangedEventArgs(RomListSettingsPageViewModel.ShowRomDetailsPropertyName));

            View.RegisterForDraggedTypes(new string[] { NSPasteboard.NSFilenamesType });
            INTV.Core.Model.Device.Peripheral.PeripheralAttached += HandlePeripheralArrivalOrDeparture;
            INTV.Core.Model.Device.Peripheral.PeripheralDetached += HandlePeripheralArrivalOrDeparture;
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Sorts the ROM list.
 /// </summary>
 internal void SortRoms()
 {
     RomsArrayController.RearrangeObjects();
 }