private void checkSystemForCardsTimer_Elapsed(object sender, ElapsedEventArgs e)
        {
            //Check the system to see if a card is present
            List <Card> potentiallyConnectedCards;
            var         connectedCard = Dependencies.SystemContext.GetCardConnectedToSystem(out potentiallyConnectedCards);

            //If there is no feedback, stay with this content panel
            if (connectedCard == null && potentiallyConnectedCards.Count == 0)
            {
                return;
            }

            //Build the event args to pass back up to the main application window
            var eventArgs = new MainApplicationWindow.ContentPanelStateChangeEventArgs
            {
                PotentiallyConnectedCards = potentiallyConnectedCards,
                ConnectedCard             = connectedCard,
                ContentPanelState         = (connectedCard != null)
                        ? MainApplicationWindow.ContentPanelStates.CardFound
                        : MainApplicationWindow.ContentPanelStates.CardNotFound
            };

            //Raise the ContentPanelStateChange event
            this.parent.RaiseContentPanelStateChange(this, eventArgs);

            //kill the timer
            this.checkSystemForCardsTimer.Enabled = false;
        }
        private void checkSystemForCardsTimer_Elapsed(object sender, ElapsedEventArgs e)
        {
            //Check the system to see if a card is present
            List<Card> potentiallyConnectedCards;
            var connectedCard = Dependencies.SystemContext.GetCardConnectedToSystem(out potentiallyConnectedCards);

            //If there is no feedback, stay with this content panel
            if (connectedCard == null && potentiallyConnectedCards.Count == 0)
                return;

            //Build the event args to pass back up to the main application window
            var eventArgs = new MainApplicationWindow.ContentPanelStateChangeEventArgs
                {
                    PotentiallyConnectedCards = potentiallyConnectedCards,
                    ConnectedCard = connectedCard,
                    ContentPanelState = (connectedCard != null)
                        ? MainApplicationWindow.ContentPanelStates.CardFound
                        : MainApplicationWindow.ContentPanelStates.CardNotFound
                };

            //Raise the ContentPanelStateChange event
            this.parent.RaiseContentPanelStateChange(this, eventArgs);

            //kill the timer
            this.checkSystemForCardsTimer.Enabled = false;
        }
        private void rescanButton_Click(object sender, EventArgs e)
        {
            //Build the event args to pass up to the parent
            var eventArgs = new MainApplicationWindow.ContentPanelStateChangeEventArgs
                {
                    ContentPanelState = MainApplicationWindow.ContentPanelStates.Waiting
                };

            //Raise the content panel change event on the parent
            this.parent.RaiseContentPanelStateChange(this, eventArgs);
        }
Example #4
0
        private void rescanButton_Click(object sender, EventArgs e)
        {
            //Build the event args to pass up to the parent
            var eventArgs = new MainApplicationWindow.ContentPanelStateChangeEventArgs
            {
                ContentPanelState = MainApplicationWindow.ContentPanelStates.Waiting
            };

            //Raise the content panel change event on the parent
            this.parent.RaiseContentPanelStateChange(this, eventArgs);
        }
Example #5
0
        private void disconnectButton_Click(object sender, EventArgs e)
        {
            //Build the event args to pass back up to the main application window
            var eventArgs = new MainApplicationWindow.ContentPanelStateChangeEventArgs
            {
                ContentPanelState = MainApplicationWindow.ContentPanelStates.EjectingCard,
                ConnectedCard     = this.card,
            };

            //raise the event on the parent
            this.parent.RaiseContentPanelStateChange(this, eventArgs);
        }
        private void SystemContext_CardSavedFinished(object sender, Framework.SystemContext.CardSavedEventArgs e)
        {
            //Build the event args to pass up to the main application window
            var eventArgs = new MainApplicationWindow.ContentPanelStateChangeEventArgs
            {
                ContentPanelState = MainApplicationWindow.ContentPanelStates.CardSaved,
                ConnectedCard = this.card
            };

            //Raise the event on the main application window
            this.parent.RaiseContentPanelStateChange(this, eventArgs);
        }
        private void disconnectButton_Click(object sender, EventArgs e)
        {
            //Build the event args to pass back up to the main application window
            var eventArgs = new MainApplicationWindow.ContentPanelStateChangeEventArgs
                {
                    ContentPanelState = MainApplicationWindow.ContentPanelStates.EjectingCard,
                    ConnectedCard = this.card,
                };

            //raise the event on the parent
            this.parent.RaiseContentPanelStateChange(this, eventArgs);
        }
Example #8
0
        private void SystemContext_CardSavedFinished(object sender, Framework.SystemContext.CardSavedEventArgs e)
        {
            //Build the event args to pass up to the main application window
            var eventArgs = new MainApplicationWindow.ContentPanelStateChangeEventArgs
            {
                ContentPanelState = MainApplicationWindow.ContentPanelStates.CardSaved,
                ConnectedCard     = this.card
            };

            //Raise the event on the main application window
            this.parent.RaiseContentPanelStateChange(this, eventArgs);
        }
Example #9
0
        private void saveCardButton_Click(object sender, EventArgs e)
        {
            //Save the card to the card
            Dependencies.SystemContext.BeginSaveCard(this.card);

            //Build the event args to pass back up to the main application window
            var eventArgs = new MainApplicationWindow.ContentPanelStateChangeEventArgs
            {
                ContentPanelState = MainApplicationWindow.ContentPanelStates.SavingCard,
                ConnectedCard     = this.card
            };

            //raise the event on the parent
            this.parent.RaiseContentPanelStateChange(this, eventArgs);
        }
        private void saveCardButton_Click(object sender, EventArgs e)
        {
            //Save the card to the card
            Dependencies.SystemContext.BeginSaveCard(this.card);

            //Build the event args to pass back up to the main application window
            var eventArgs = new MainApplicationWindow.ContentPanelStateChangeEventArgs
                {
                    ContentPanelState = MainApplicationWindow.ContentPanelStates.SavingCard,
                    ConnectedCard = this.card
                };

            //raise the event on the parent
            this.parent.RaiseContentPanelStateChange(this, eventArgs);
        }
Example #11
0
        private void continueButton_Click(object sender, EventArgs e)
        {
            //Collect the users choices from the UI elements
            var recordUse      = this.customCheckbox1.Selected;
            var recordUserData = this.customCheckbox2.Selected;

            //Register the users connectivity choices with the framework
            var connectivityContext = Dependencies.ConnectivityContext;

            connectivityContext.SetUserConnectivityChoices(recordUse, recordUserData);

            //Build the event args to pass back up to the parent
            var eventArgs = new MainApplicationWindow.ContentPanelStateChangeEventArgs
            {
                ContentPanelState = MainApplicationWindow.ContentPanelStates.Waiting
            };

            //Call the content pane even on the parent
            this.parent.RaiseContentPanelStateChange(this, eventArgs);
        }
        private void continueButton_Click(object sender, EventArgs e)
        {
            //Collect the users choices from the UI elements
            var recordUse = this.customCheckbox1.Selected;
            var recordUserData = this.customCheckbox2.Selected;

            //Register the users connectivity choices with the framework
            var connectivityContext = Dependencies.ConnectivityContext;

            connectivityContext.SetUserConnectivityChoices(recordUse, recordUserData);

            //Build the event args to pass back up to the parent
            var eventArgs = new MainApplicationWindow.ContentPanelStateChangeEventArgs
                {
                    ContentPanelState = MainApplicationWindow.ContentPanelStates.Waiting
                };

            //Call the content pane even on the parent
            this.parent.RaiseContentPanelStateChange(this, eventArgs);
        }
        internal EjectingCardContentPanel(MainApplicationWindow parent, Card card)
        {
            //Init the UI
            InitializeComponent();

            //Let the system know the card is being removed
            Dependencies.SystemContext.CardIsBeingRemoved(card);

            //Set a timer to wait then reset the content panel
            var t = new Timer { Interval = 2000 };
            t.Tick += delegate(object sender, EventArgs e)
                {
                    t.Enabled = false;
                    var eventArgs = new MainApplicationWindow.ContentPanelStateChangeEventArgs
                        {
                            ContentPanelState = MainApplicationWindow.ContentPanelStates.Waiting,
                        };
                    parent.RaiseContentPanelStateChange(this, eventArgs);
                };
            t.Enabled = true;
        }
        internal EjectingCardContentPanel(MainApplicationWindow parent, Card card)
        {
            //Init the UI
            InitializeComponent();

            //Let the system know the card is being removed
            Dependencies.SystemContext.CardIsBeingRemoved(card);

            //Set a timer to wait then reset the content panel
            var t = new Timer {
                Interval = 2000
            };

            t.Tick += delegate(object sender, EventArgs e)
            {
                t.Enabled = false;
                var eventArgs = new MainApplicationWindow.ContentPanelStateChangeEventArgs
                {
                    ContentPanelState = MainApplicationWindow.ContentPanelStates.Waiting,
                };
                parent.RaiseContentPanelStateChange(this, eventArgs);
            };
            t.Enabled = true;
        }