Exemplo n.º 1
0
        public CollectorClient()
        {
            Auxiliary.Init();
            // Connect to IZService
            log.Info("Connecting to IZService");
            try
            {
                var binding = new NetNamedPipeBinding();
                binding.MaxBufferSize          = BioData.MaxSize;
                binding.MaxReceivedMessageSize = binding.MaxBufferSize;

                pipeFactory =
                    new DuplexChannelFactory <IDialogClientService>(new InstanceContext(this),
                                                                    binding,
                                                                    new EndpointAddress("net.pipe://localhost/IdentaZone/Collector/DialogClient"));

                collectorService = pipeFactory.CreateChannel();

                if (!collectorService.Login())
                {
                    log.Error("Service is busy");
                    return;
                }
                else
                {
                    log.Info("Successfully logged in");
                    IsConnected = true;
                }
            }
            catch (Exception ex)
            {
                log.Info(ex);
                return;
            }
        }
Exemplo n.º 2
0
        public CollectorDialog(Options options)
        {
            bool createdNew;

            m_Mutex = new Mutex(true, "IdentaZoneAdminMutex", out createdNew);
            if (!createdNew)
            {
                SetActiveWindow(IntPtr.Zero);
                MessageBox.Show("Some biometric is already running.", "Warning", MessageBoxButton.OK);
                this.Close();
                throw new Exception("Biometric is already in use");
            }

            try
            {
                this._options = options;
                // Auxiliary.Logger.Init();
                //log.Info("Const");
                InitializeComponent();
                arrowClicked = false;
                ShowState();
                PreInit();
                _stopFillingList  = false;
                _errorWindowShown = false;
                // Dispatcher.BeginInvoke(new Action(() => Init()), DispatcherPriority.ContextIdle);
                //log.Info(".ctr finished");
                _biometricProcessionFinished = new BiosecLibClient.BiometricProcessedDelegate(ImageProcessedCbc);
                _updateProgress        = new BiosecLibClient.UpdateDelegate(UpdateCallbackCbc);
                _fileOperationFinished = new BiosecLibClient.FinishDelegate(FileOperationFinished);
                _fileOperationError    = new BiosecLibClient.ErrorDelegate(FileOperationError);

                //log.Info("Connecting to service");
                var binding = new NetNamedPipeBinding();
                binding.ReceiveTimeout = System.TimeSpan.FromHours(24);

                pipeFactory =
                    new ChannelFactory <IDialogClientService>(
                        binding,
                        new EndpointAddress("net.pipe://localhost/IdentaZone/IMLogger/DialogClient"));

                loggingService = pipeFactory.CreateChannel();
                if (!loggingService.Login())
                {
                    Auxiliary.Logger._log.Error("Service is busy");
                    return;
                }
                else
                {
                    //log.Info("Successfully logged in");
                    IsConnected = true;
                }

                Dispatcher.BeginInvoke(new Action(() => Init()), DispatcherPriority.ContextIdle);

                SystemEvents.SessionSwitch += new SessionSwitchEventHandler(this.SystemEvents_SessionSwitch);
            }
            catch (Exception ex)
            {
                m_Mutex.ReleaseMutex();
                throw ex;
            }
        }