Ejemplo n.º 1
0
        public HIDSetupPage()
        {
            this.InitializeComponent();

            this.manager                = HIDManager.Current;
            this.resources              = new ResourceLoader();
            this.boxToButtonMappings    = new Dictionary <UIElement, Utility.Button>();
            this.boxToButtonMappingsAlt = new Dictionary <UIElement, Utility.Button>();

            this.services = new UWPServiceProvider(this.Dispatcher);

            this.boxToButtonMappings.Add(this.leftBindingBox, Utility.Button.Left);
            this.boxToButtonMappingsAlt.Add(this.leftBindingBox2, Utility.Button.Left);
            this.boxToButtonMappings.Add(this.upBindingBox, Utility.Button.Up);
            this.boxToButtonMappingsAlt.Add(this.upBindingBox2, Utility.Button.Up);
            this.boxToButtonMappings.Add(this.rightBindingBox, Utility.Button.Right);
            this.boxToButtonMappingsAlt.Add(this.rightBindingBox2, Utility.Button.Right);
            this.boxToButtonMappings.Add(this.downBindingBox, Utility.Button.Down);
            this.boxToButtonMappingsAlt.Add(this.downBindingBox2, Utility.Button.Down);
            this.boxToButtonMappings.Add(this.startBindingBox, Utility.Button.Start);
            this.boxToButtonMappingsAlt.Add(this.startBindingBox2, Utility.Button.Start);
            this.boxToButtonMappings.Add(this.selectBindingBox, Utility.Button.Select);
            this.boxToButtonMappingsAlt.Add(this.selectBindingBox2, Utility.Button.Select);
            this.boxToButtonMappings.Add(this.lBindingBox, Utility.Button.L);
            this.boxToButtonMappingsAlt.Add(this.lBindingBox2, Utility.Button.L);
            this.boxToButtonMappings.Add(this.rBindingBox, Utility.Button.R);
            this.boxToButtonMappingsAlt.Add(this.rBindingBox2, Utility.Button.R);
            this.boxToButtonMappings.Add(this.aBindingBox, Utility.Button.A);
            this.boxToButtonMappingsAlt.Add(this.aBindingBox2, Utility.Button.A);
            this.boxToButtonMappings.Add(this.bBindingBox, Utility.Button.B);
            this.boxToButtonMappingsAlt.Add(this.bBindingBox2, Utility.Button.B);
            this.boxToButtonMappings.Add(this.turboBindingBox, Utility.Button.Turbo);
            this.boxToButtonMappingsAlt.Add(this.turboBindingBox2, Utility.Button.Turbo);
        }
Ejemplo n.º 2
0
 private StorageManager(IVBAXServiceProvider serviceProvider, ISaveInfo saveInfo)
 {
     this.services    = serviceProvider;
     this.info        = saveInfo;
     this.snapshotMap = new Dictionary <string, BitmapImage>();
     this.romList     = new ObservableCollection <ROMEntry>();
     this.resources   = new ResourceLoader();
 }
Ejemplo n.º 3
0
        public static IAsyncOperation <StorageManager> InitializeAsync(IVBAXServiceProvider serviceProvider, ISaveInfo saveInfo)
        {
            Func <Task <StorageManager> > helper = async() =>
            {
                if (singleton != null)
                {
                    throw new InvalidOperationException("StorageManager has been initialized already.");
                }
                singleton = new StorageManager(serviceProvider, saveInfo);
                await singleton.Initialize();

                return(singleton);
            };

            return(helper().AsAsyncOperation());
        }