Esempio n. 1
0
        public StreamDeckUserControl(GamingPanelEnum panelType, HIDSkeleton hidSkeleton, TabItem parentTabItem, IGlobalHandler globalHandler, DCSBIOS dcsbios)
        {
            InitializeComponent();
            ParentTabItem = parentTabItem;

            //no worky worky for this library hidSkeleton.HIDReadDevice.Removed += DeviceRemovedHandler;

            _streamDeckPanel = new StreamDeckPanel(panelType, hidSkeleton);
            _streamDeckPanel.Attach((IGamingPanelListener)this);
            globalHandler.Attach(_streamDeckPanel);
            GlobalHandler = globalHandler;
            _dcsbios      = dcsbios;

            UCStreamDeckButtonAction.SetStreamDeckPanel(_streamDeckPanel);
            UCStreamDeckButtonFace.SetStreamDeckPanel(_streamDeckPanel);

            StackPanelButtonUI.Children.Clear();
            switch (panelType)
            {
            case GamingPanelEnum.StreamDeckMini:
            {
                var child = new UserControlStreamDeckUIMini(_streamDeckPanel);
                _uiButtonGrid = child;
                StackPanelButtonUI.Children.Add(child);

                break;
            }

            case GamingPanelEnum.StreamDeck:
            {
                var child = new UserControlStreamDeckUINormal(_streamDeckPanel);
                _uiButtonGrid = child;
                StackPanelButtonUI.Children.Add(child);

                break;
            }

            case GamingPanelEnum.StreamDeckXL:
            {
                var child = new UserControlStreamDeckUIXL(_streamDeckPanel);
                _uiButtonGrid = child;
                StackPanelButtonUI.Children.Add(child);
                break;
            }
            }


            EventHandlers.AttachStreamDeckListener(UCStreamDeckButtonAction);
            EventHandlers.AttachStreamDeckListener(UCStreamDeckButtonFace);
            EventHandlers.AttachStreamDeckListener(_uiButtonGrid);
            EventHandlers.AttachStreamDeckConfigListener(_uiButtonGrid);
            EventHandlers.AttachStreamDeckListener(this);

            UCStreamDeckButtonAction.GlobalHandler = GlobalHandler;
            UCStreamDeckButtonFace.GlobalHandler   = GlobalHandler;

            UCStreamDeckButtonFace.SetStreamDeckPanel(_streamDeckPanel);
            UCStreamDeckButtonAction.SetStreamDeckPanel(_streamDeckPanel);
        }
Esempio n. 2
0
        public StreamDeckUserControl(GamingPanelEnum panelType, HIDSkeleton hidSkeleton, TabItem parentTabItem, IGlobalHandler globalHandler, DCSBIOS dcsbios)
        {
            InitializeComponent();
            _parentTabItem       = parentTabItem;
            _parentTabItemHeader = _parentTabItem.Header.ToString();
            _streamDeckPanel     = new StreamDeckPanel(panelType, hidSkeleton);
            _streamDeckPanel.Attach((IGamingPanelListener)this);
            globalHandler.Attach(_streamDeckPanel);
            _globalHandler = globalHandler;
            _dcsbios       = dcsbios;


            StackPanelButtonUI.Children.Clear();
            switch (panelType)
            {
            case GamingPanelEnum.StreamDeckMini:
            {
                var child = new UserControlStreamDeckUIMini();
                child.PanelHash = _streamDeckPanel.PanelHash;
                _uiButtonGrid   = child;
                StackPanelButtonUI.Children.Add(child);

                break;
            }

            case GamingPanelEnum.StreamDeck:
            {
                var child = new UserControlStreamDeckUINormal();
                child.PanelHash = _streamDeckPanel.PanelHash;
                _uiButtonGrid   = child;
                StackPanelButtonUI.Children.Add(child);

                break;
            }

            case GamingPanelEnum.StreamDeckXL:
            {
                var child = new UserControlStreamDeckUIXL();
                child.PanelHash = _streamDeckPanel.PanelHash;
                _uiButtonGrid   = child;
                StackPanelButtonUI.Children.Add(child);
                break;
            }
            }


            EventHandlers.AttachStreamDeckListener(UCStreamDeckButtonAction);
            EventHandlers.AttachStreamDeckListener(UCStreamDeckButtonFace);
            EventHandlers.AttachStreamDeckListener(_uiButtonGrid);
            EventHandlers.AttachStreamDeckConfigListener(_uiButtonGrid);
            EventHandlers.AttachStreamDeckListener(this);

            UCStreamDeckButtonAction.GlobalHandler = _globalHandler;
            UCStreamDeckButtonFace.GlobalHandler   = _globalHandler;

            UCStreamDeckButtonFace.PanelHash   = _streamDeckPanel.PanelHash;
            UCStreamDeckButtonAction.PanelHash = _streamDeckPanel.PanelHash;
        }
Esempio n. 3
0
        public StreamDeckUserControl(GamingPanelEnum panelType, HIDSkeleton hidSkeleton, TabItem parentTabItem)
        {
            InitializeComponent();
            ParentTabItem = parentTabItem;

            _streamDeckPanel = new StreamDeckPanel(panelType, hidSkeleton);

            UCStreamDeckButtonAction.SetStreamDeckPanel(_streamDeckPanel);
            UCStreamDeckButtonFace.SetStreamDeckPanel(_streamDeckPanel);

            StackPanelButtonUI.Children.Clear();
            switch (panelType)
            {
            case GamingPanelEnum.StreamDeckMini:
            {
                var child = new UserControlStreamDeckUIMini(_streamDeckPanel);
                _uiButtonGrid = child;
                StackPanelButtonUI.Children.Add(child);

                break;
            }

            case GamingPanelEnum.StreamDeck:
            case GamingPanelEnum.StreamDeckV2:
            case GamingPanelEnum.StreamDeckMK2:
            {
                var child = new UserControlStreamDeckUINormal(_streamDeckPanel);
                _uiButtonGrid = child;
                StackPanelButtonUI.Children.Add(child);

                break;
            }

            case GamingPanelEnum.StreamDeckXL:
            {
                var child = new UserControlStreamDeckUIXL(_streamDeckPanel);
                _uiButtonGrid = child;
                StackPanelButtonUI.Children.Add(child);
                break;
            }
            }


            SDEventHandler.AttachStreamDeckListener(UCStreamDeckButtonAction);
            SDEventHandler.AttachStreamDeckListener(UCStreamDeckButtonFace);
            SDEventHandler.AttachStreamDeckListener(_uiButtonGrid);
            SDEventHandler.AttachStreamDeckConfigListener(_uiButtonGrid);
            SDEventHandler.AttachStreamDeckListener(this);
            SDEventHandler.AttachActionTypeChangedListener(UCStreamDeckButtonFace);
            AppEventHandler.AttachGamingPanelListener(this);
            UCStreamDeckButtonFace.SetStreamDeckPanel(_streamDeckPanel);
            UCStreamDeckButtonAction.SetStreamDeckPanel(_streamDeckPanel);
        }
Esempio n. 4
0
        public StreamDeckUserControl(GamingPanelEnum panelType, HIDSkeleton hidSkeleton, TabItem parentTabItem, IGlobalHandler globalHandler, DCSBIOS dcsbios)
        {
            InitializeComponent();
            _parentTabItem       = parentTabItem;
            _parentTabItemHeader = _parentTabItem.Header.ToString();
            _streamDeck          = new StreamDeckPanel(this, panelType, hidSkeleton);
            _streamDeck.Attach((IGamingPanelListener)this);
            globalHandler.Attach(_streamDeck);
            _globalHandler = globalHandler;

            _dcsbios = dcsbios;

            StackPanelButtonUI.Children.Clear();
            switch (panelType)
            {
            case GamingPanelEnum.StreamDeckMini:
            case GamingPanelEnum.StreamDeck:
            {
                var child = new UserControlStreamDeckUINormal();
                _streamDeckUI = child;
                child.SetSDUIParent(this);
                StackPanelButtonUI.Children.Add(child);

                break;
            }

            case GamingPanelEnum.StreamDeckXL:
            {
                var child = new UserControlStreamDeckUIXL();
                _streamDeckUI = child;
                child.SetSDUIParent(this);
                StackPanelButtonUI.Children.Add(child);
                break;
            }
            }

            UCStreamDeckButtonAction.SDUIParent    = this;
            UCStreamDeckButtonAction.GlobalHandler = _globalHandler;
            UCStreamDeckButtonFace.SDUIParent      = this;
            UCStreamDeckButtonFace.GlobalHandler   = _globalHandler;
            UCStreamDeckButtonFace.UserControlStreamDeckButtonAction = UCStreamDeckButtonAction;
            UCStreamDeckButtonAction.UserControlStreamDeckButtonFace = UCStreamDeckButtonFace;
            _streamDeckUI.HideAllDotImages();
        }