Esempio n. 1
0
        public TargetViewModel(ITargetLocation targetModel, ITransformation transformation, ICalibration calibration, IACPC acpc)
        {
            _targetModel             = targetModel;
            _transformationInterface = transformation;
            _calibrationInterface    = calibration;
            _acpcInterface           = acpc;

            // subscribe to the event with the proper function
            // the event is TargetLocationChangedRas
            // the function when the event is fired is TargetModel_TargetLocationChangedRas
            _targetModel.TargetLocationChangedRas    += TargetModel_TargetLocationChangedRas;
            _targetModel.TargetAcPcEnabledChanged    += TargetModel_TargetAcPcEnabledChanged;
            _calibrationInterface.CalibrationChanged += CalibrationInterface_CalibrationChanged;
            _acpcInterface.ACPCLengthChanged         += ACPCInterface_ACPCLengthChanged;
            _acpcInterface.ACPCOriginUpdated         += ACPCInterface_ACPCOriginUpdated;
        }
Esempio n. 2
0
        public MainViewModel(
            Dispatcher dispatcher,
            IEventAggregator eventAggregator,
            ISeriesSelectorController seriesSelectorController,
            IUiModeChanges uiModeModel,
            ITargetLocation targetModel,
            ITransformation transformationInterface,
            IStripsViewerLayoutController viewerLayoutController,
            ICalibration calibrationInterface,
            IMovementDetection movementDetectionModel,
            ILocateXD locateXDModel,
            IStripsManager stripsManager,
            IACPC acpcInterface,
            IRigidNPR rigidNPRInterface)
        {
            _dispatcher               = dispatcher;
            _eventAggregator          = eventAggregator;
            _seriesSelectorController = seriesSelectorController;

            _uiModeModel                        = uiModeModel;
            _uiModeModel.ModeChanged           += (s, a) => UiModeChanged?.Invoke(s, a);
            _uiModeModel.LayerVisiblityChanged += (s, a) => LayerVisibilityChanged?.Invoke(s, a);

            _viewerLayoutController = viewerLayoutController;
            _stripsManager          = stripsManager;
            _rigidNPR = rigidNPRInterface;

            ACPC = new TargetViewModel(targetModel, transformationInterface, calibrationInterface, acpcInterface);

            MD      = new MDViewModel(movementDetectionModel);
            XDCalib = new XDCalibViewModel(locateXDModel);

            SwitchLayoutCommand      = new DelegateCommand <StripsViewerLayout>(SwitchLayout);
            AppWorkingOcurredCommand = new DelegateCommand(() => _eventAggregator.GetEvent <AppWorkingEvent>().Publish());

            StripsViewerLayouts = new ObservableCollection <StripsViewerLayout>(_viewerLayoutController.Layouts);

            _seriesSelectorController.SeriesSelected += OnSeriesSelected;
            _stripsManager.Changed += OnStripsManagerChanged;
        }
Esempio n. 3
0
        internal static ITargetMailbox CreateTargetMailbox(IRecipientSession recipientSession, MailboxDiscoverySearch searchObject, string targetLegacyDn, ITargetLocation targetLocation)
        {
            Util.ThrowIfNull(recipientSession, "recipientSession");
            Util.ThrowIfNull(searchObject, "searchObject");
            Util.ThrowIfNullOrEmpty(targetLegacyDn, "targetLegacyDn");
            Util.ThrowIfNull(targetLocation, "targetLocation");
            ADSessionSettings sessionSettings = recipientSession.SessionSettings;

            Util.ThrowIfNull(sessionSettings, "adSessionSettings");
            ExchangePrincipal exchangePrincipal = ExchangePrincipal.FromLegacyDN(sessionSettings, targetLegacyDn, RemotingOptions.AllowCrossSite);

            if (exchangePrincipal == null || string.IsNullOrEmpty(exchangePrincipal.MailboxInfo.Location.ServerFqdn))
            {
                throw new ObjectNotFoundException(ServerStrings.ADUserNotFoundId(targetLegacyDn));
            }
            return(new TargetMailbox(exchangePrincipal.MailboxInfo.OrganizationId, exchangePrincipal.MailboxInfo.PrimarySmtpAddress.ToString(), targetLegacyDn, BackEndLocator.GetBackEndWebServicesUrl(exchangePrincipal.MailboxInfo), targetLocation)
            {
                StatusMailRecipients = Util.GetStatusMailRecipients(searchObject, recipientSession)
            });
        }
Esempio n. 4
0
 public TargetMailbox(OrganizationId orgId, string primarySmtpAddress, string legacyDN, IEwsClient ewsClient, ITargetLocation targetLocation)
 {
     Util.ThrowIfNullOrEmpty(primarySmtpAddress, "primarySmtpAddress");
     Util.ThrowIfNullOrEmpty(legacyDN, "legacyDN");
     Util.ThrowIfNull(ewsClient, "ewsClient");
     Util.ThrowIfNull(targetLocation, "targetLocation");
     this.organizationId = orgId;
     this.ewsClient      = ewsClient;
     this.targetLocation = targetLocation;
     this.Initialize(primarySmtpAddress, legacyDN, null);
 }
Esempio n. 5
0
 public TargetMailbox(OrganizationId orgId, string primarySmtpAddress, string legacyDN, Uri serviceEndpoint, ITargetLocation targetLocation) : this(orgId, primarySmtpAddress, legacyDN, new EwsClient(serviceEndpoint, new ServerToServerEwsCallingContext(null)), targetLocation)
 {
 }
 public MailboxExportContext(IExportMetadata exportMetadata, IList <ISource> sourceMailboxes, ITargetLocation targetLocation, bool isResume, Action <IEnumerable <ErrorRecord> > onWriteErrorRecord, Action <IEnumerable <ExportRecord> > onWriteResultManifest)
 {
     this.ExportMetadata        = exportMetadata;
     this.Sources               = sourceMailboxes;
     this.TargetLocation        = targetLocation;
     this.IsResume              = isResume;
     this.OnWriteErrorRecord    = onWriteErrorRecord;
     this.OnWriteResultManifest = onWriteResultManifest;
 }