Example #1
0
        private void ShowConfig(ModuleBase configurable)
        {
            if (!configurable.HasConfig)
            {
                return;
            }

            MainWindow.DimMainWindow(true);
            Connection connection = Connection;

            DisabledEventArgs args = new DisabledEventArgs(true);

            bool wasEnabled = connection.IsEnabled;

            if (wasEnabled)
            {
                connection.Disable(args, null);
            }

            ConfigWindow config = new ConfigWindow((IWpfConfigurable)configurable);

            config.ShowDialog();

            if (wasEnabled)
            {
                Connection.Enable(new EnablingEventArgs(true), null);
            }

            MainWindow.DimMainWindow(false);
        }
Example #2
0
 protected override void OnDisabled(DisabledEventArgs e)
 {
     if (skype != null)
     {
         skype.CallStatus -= callStatusEventHandler;
     }
 }
Example #3
0
 protected override void OnDisabled(DisabledEventArgs e)
 {
     if (skype != null)
     {
         skype.SmsMessageStatusChanged -= smsMessageStatusChangedEventHandler;
     }
 }
Example #4
0
 protected override void OnDisabled(DisabledEventArgs e)
 {
     if (!e.IsConfiguring)
     {
         PhidgetManager.Release <InterfaceKit>(ref ifKit);
     }
 }
Example #5
0
 protected override void OnDisabled(DisabledEventArgs e)
 {
     if (skype != null)
     {
         skype.MessageStatus -= messageStatusEventHandler;
     }
 }
Example #6
0
 protected override void OnDisabled(DisabledEventArgs e)
 {
     if (excel != null)
     {
         excel.WorkbookAfterSave -= saveWorkbookEvent;
         excel = null;
     }
 }
Example #7
0
 protected override void OnDisabled(DisabledEventArgs e)
 {
     if (excel != null)
     {
         excel.WorkbookOpen -= openWorkbookEvent;
         excel = null;
     }
 }
Example #8
0
 protected override void OnDisabled(DisabledEventArgs e)
 {
     if (powerPoint != null)
     {
         powerPoint.PresentationPrint -= printPresentationEvent;
         powerPoint = null;
     }
 }
Example #9
0
 /// <summary>
 /// This method is unsubscribing from the EApplication_AfterPresentationOpenEventHandler.
 /// </summary>
 protected override void OnDisabled(DisabledEventArgs e)
 {
     if (powerPoint != null)
     {
         powerPoint.AfterPresentationOpen -= openPresentationEvent;
         powerPoint = null;
     }
 }
Example #10
0
 protected override void OnDisabled(DisabledEventArgs e)
 {
     if (word != null)
     {
         word.DocumentOpen -= openDocumentEvent;
         word = null;
     }
 }
Example #11
0
 protected override void OnDisabled(DisabledEventArgs e)
 {
     // only release if we aren't going into the configuration menu
     if (!e.IsConfiguring)
     {
         PhidgetManager.Release(ref advServo);
     }
 }
Example #12
0
 protected override void OnDisabled(DisabledEventArgs e)
 {
     if (powerPoint != null)
     {
         powerPoint.PresentationCloseFinal -= closePresentationEvent;
         powerPoint = null;
     }
 }
Example #13
0
 protected override void OnDisabled(DisabledEventArgs e)
 {
     if (word != null)
     {
         word.DocumentBeforePrint -= printDocumentEvent;
         word = null;
     }
 }
Example #14
0
 protected override void OnDisabled(DisabledEventArgs e)
 {
     if (excel != null)
     {
         excel.WorkbookBeforeClose -= closeWorkbookEvent;
         excel = null;
     }
 }
Example #15
0
 protected override void OnDisabled(DisabledEventArgs e)
 {
     if (word != null)
     {
         word.DocumentBeforeSave -= saveDocumentEvent;
         word = null;
     }
 }
Example #16
0
 protected override void OnDisabled(DisabledEventArgs e)
 {
     if (excel != null)
     {
         excel.WorkbookBeforePrint -= printWorkbookEvent;
         excel = null;
     }
 }
Example #17
0
 protected override void OnDisabled(DisabledEventArgs e)
 {
     if (powerPoint != null)
     {
         powerPoint.WindowActivate -= activePresentationChangedEvent;
         powerPoint = null;
     }
 }
Example #18
0
        protected override void OnDisabled(DisabledEventArgs e)
        {
            if (outlook != null)
            {
                outlook.Reminder -= reminderEvent;

                outlook = null;
            }
        }
Example #19
0
 protected override void OnDisabled(DisabledEventArgs e)
 {
     if (timer != null)
     {
         timer.Stop();
         timer.Elapsed -= timer_Elapsed;
         timer.Dispose();
     }
 }
Example #20
0
        protected override void OnDisabled(DisabledEventArgs e)
        {
            if (outlook != null)
            {
                outlook.NewMail -= mailEvent;

                outlook = null;
            }
        }
Example #21
0
        protected override void OnDisabled(DisabledEventArgs e)
        {
            rfid.Tag     -= RfidTag;
            rfid.TagLost -= LostRfidTag;

            if (!e.IsConfiguring)
            {
                PhidgetManager.Release <RFID>(ref rfid);
            }
        }
Example #22
0
        protected override void OnDisabled(DisabledEventArgs e)
        {
            sensor.TemperatureChange -= TemperatureChange;

            // only release if we aren't going into the configuration menu
            if (!e.IsConfiguring)
            {
                PhidgetManager.Release <TemperatureSensor>(ref sensor);
            }
        }
Example #23
0
        protected override void OnDisabled(DisabledEventArgs e)
        {
            ir.Code -= ir_Code;

            // only release if we aren't going into the configuration menu
            if (!e.IsConfiguring)
            {
                PhidgetManager.Release <IR>(ref ir);
            }
        }
Example #24
0
        protected override void OnDisabled(DisabledEventArgs e)
        {
            lyncClient = null;

            if (selectedContact != null)
            {
                selectedContact.ContactInformationChanged -= contactInformationChanged;
                selectedContact = null;
            }
        }
Example #25
0
 protected override void OnDisabled(DisabledEventArgs e)
 {
     if (!e.IsConfiguring && IsEnabled)
     {
         phoneLayout.DisableButton(button.Id);
         phoneConnector.Disable();
         phoneConnector.EventCalled -= phoneConnector_EventCalled;
         ThreadPool.QueueUserWorkItem(o => phoneConnector.SetNewData());
     }
 }
Example #26
0
        protected override void OnDisabled(DisabledEventArgs e)
        {
            if (conversationManager != null)
            {
                conversationManager.ConversationAdded -= conversationAdded;
                conversationManager = null;
            }

            if (lyncClient != null)
            {
                lyncClient = null;
            }
        }
 /// <summary>
 /// This method is unsubscribing from the ContactInformationChangedEvent.
 /// </summary>
 protected override void OnDisabled(DisabledEventArgs e)
 {
     if (lyncClient != null)
     {
         foreach (Group group in lyncClient.ContactManager.Groups)
         {
             foreach (Contact contact in group)
             {
                 contact.ContactInformationChanged -= contactInformationChanged;
             }
         }
     }
 }
Example #28
0
        protected override void OnDisabled(DisabledEventArgs e)
        {
            if (timer != null)
            {
                timer.Stop();
                timer.Dispose();
            }

            if (devices != null)
            {
                devices.Clear();
                devices = null;
            }
        }
Example #29
0
 protected override void OnDisabled(DisabledEventArgs e)
 {
     try
     {
         this.manager.ReleasePort(this.port);
     }
     catch
     {
         /* Swallow the exception because the only times this will happen is if we
          * try to close a port that hasn't been opened or if it hasn't been connected with the specified action.
          * Aka, it was closed here before it was opened. Nothing we can do, might as well hide it
          */
     }
 }
Example #30
0
 //[MethodImpl(MethodImplOptions.Synchronized)]
 protected override void OnDisabled(DisabledEventArgs e)
 {
     if (!e.IsConfiguring)
     {
         if (webcambuffer != null && selectedCameraIndex != -1)
         {
             webcambuffer.UnregisterForImages(WebcamManager.GetCamera(selectedCameraIndex));
             ReleasePreviousBuffers();
             WebcamManager.ReleaseInactiveCameras();
             if (callbacksRegistered)
             {
                 WebcamManager.UnregisterWebcamConnectionEvent(OnCameraConnected);
                 WebcamManager.UnregisterWebcamRemovalEvent(OnCameraDisconnected);
                 callbacksRegistered = false;
             }
         }
     }
 }
Example #31
0
 protected override void OnDisabled(DisabledEventArgs e)
 {
     base.OnDisabled(e);
     lock (Lock) {
         Done = true;
     }
     if (PollingThread != null) {
         PollingThread.Join();
         PollingThread = null;
     }
 }
Example #32
0
 protected override void OnDisabled(DisabledEventArgs e)
 {            
     if (device != null)
         device.DeviceStatusChanged -= device_DeviceStatusChanged;
 }
Example #33
0
 protected override void OnDisabled(DisabledEventArgs e)
 {
     base.OnDisabled(e);
 }