Ejemplo n.º 1
0
        /// <summary>Initializes a new instance of the T2GManager class. This constructor is used for unit tests.</summary>
        /// <param name="sessionData">Information describing the session.</param>
        /// <param name="localDataStorage">The local data storage.</param>
        /// <param name="fileDistributionManager">Manager for file distribution.</param>
        /// <param name="notifier">The notifier.</param>
        /// <param name="connectionManager">Manager for connection.</param>
        internal T2GManager(T2GSessionData sessionData, T2GLocalDataStorage localDataStorage, T2GFileDistributionManager fileDistributionManager, IT2GNotificationProcessor notifier, IT2GConnectionManager connectionManager)
        {
            _systemChangedEventHandlers               = new Dictionary <string, EventHandler <SystemChangedNotificationArgs> >();
            _systemDeletedEventHandlers               = new Dictionary <string, EventHandler <SystemDeletedNotificationArgs> >();
            _T2GOnlineOfflineEventHandlers            = new Dictionary <string, EventHandler <T2GOnlineStatusNotificationArgs> >();
            _elementEventHandlers                     = new Dictionary <string, EventHandler <ElementEventArgs> >();
            _filePublicationNotificationEventHandlers = new Dictionary <string, EventHandler <FilePublicationNotificationArgs> >();
            _filePublishedNotificationEventHandlers   = new Dictionary <string, EventHandler <FilePublishedNotificationArgs> >();
            _fileReceivedNotificationEventHandlers    = new Dictionary <string, EventHandler <FileReceivedArgs> >();
            _fileDistributionEventHandlers            = new Dictionary <string, EventHandler <FileDistributionStatusArgs> >();

            _sessionData             = sessionData;
            _localDataStorage        = localDataStorage;
            _fileDistributionManager = fileDistributionManager;
            _notifier          = notifier;
            _connectionManager = connectionManager;
        }
        /// <summary>Initializes a new instance of the T2GNotificationProcessor class.</summary>
        /// <exception cref="ArgumentNullException">Thrown when one or more required arguments are null.</exception>
        /// <param name="notifierTarget">The notifier target.</param>
        /// <param name="localDataStorage">The local data storage.</param>
        /// <param name="fileDistributionManager">Manager for file distribution(optional).</param>
        internal T2GNotificationProcessor(
            IT2GNotifierTarget notifierTarget,
            T2GLocalDataStorage localDataStorage,
            T2GFileDistributionManager fileDistributionManager)
        {
            if (notifierTarget == null)
            {
                throw new ArgumentNullException("notifierTarget");
            }

            if (localDataStorage == null)
            {
                throw new ArgumentNullException("localDataStorage");
            }

            _notifierTarget          = notifierTarget;
            _localDataStorage        = localDataStorage;
            _fileDistributionManager = fileDistributionManager;

            _lock = new object();
        }
Ejemplo n.º 3
0
        /// <summary>Initializes a new instance of the T2GManager class.</summary>
        internal T2GManager()
        {
            _systemChangedEventHandlers               = new Dictionary <string, EventHandler <SystemChangedNotificationArgs> >();
            _systemDeletedEventHandlers               = new Dictionary <string, EventHandler <SystemDeletedNotificationArgs> >();
            _T2GOnlineOfflineEventHandlers            = new Dictionary <string, EventHandler <T2GOnlineStatusNotificationArgs> >();
            _elementEventHandlers                     = new Dictionary <string, EventHandler <ElementEventArgs> >();
            _filePublicationNotificationEventHandlers = new Dictionary <string, EventHandler <FilePublicationNotificationArgs> >();
            _filePublishedNotificationEventHandlers   = new Dictionary <string, EventHandler <FilePublishedNotificationArgs> >();
            _fileReceivedNotificationEventHandlers    = new Dictionary <string, EventHandler <FileReceivedArgs> >();
            _fileDistributionEventHandlers            = new Dictionary <string, EventHandler <FileDistributionStatusArgs> >();

            _sessionData      = new T2GSessionData();
            _localDataStorage = new T2GLocalDataStorage(_sessionData, null);

            if (!string.IsNullOrEmpty(ServiceConfiguration.T2GServiceNotificationUrl))
            {
                _fileDistributionManager = new T2GFileDistributionManager(_sessionData, this);
            }

            _notifier          = new T2GNotificationProcessor(this, _localDataStorage, _fileDistributionManager);
            _connectionManager = new T2GConnectionManager(_sessionData, this);
        }