コード例 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Connector"/> class.
        /// </summary>
        /// <param name="configuration">The configuration.</param>
        protected Connector(ConnectorConfiguration configuration)
        {
            this.Snapshots    = new List <Snapshot>();
            this.MaxSnapshots = MaxSnapshotsDefault;
            if (configuration == null)
            {
                var plugin = PluginsManager.Instance.GetPlugin(this);
                configuration = new ConnectorConfiguration(plugin.GetType().FullName);
            }

            this.ConnectorConfiguration = configuration;
        }
コード例 #2
0
        /// <summary>
        /// Gets the notification configuration from the per connector settings or the global settings..
        /// </summary>
        /// <param name="applicationConfiguration">The application configuration.</param>
        /// <param name="connectorConfiguration">The connector configuration.</param>
        /// <returns>The notification configuration.</returns>
        public static NotificationConfiguration GetNotificationConfiguration(this ApplicationConfiguration applicationConfiguration, ConnectorConfiguration connectorConfiguration)
        {
            // firstly check if the config item exists to prevent creation it "on access".
            var notificationVisibilityConfigItem = connectorConfiguration.ConfigurationItems.FirstOrDefault(ci => ci.Key == Connector.NotificationsVisbility);

            if (notificationVisibilityConfigItem == null)
            {
                return(applicationConfiguration.NotificationConfiguration);
            }

            var connectorNotificationConfiguration = notificationVisibilityConfigItem.GetOrCreateConnectorNotificationConfiguration();

            return(connectorNotificationConfiguration.UseGlobalNotificationSettings ?
                   applicationConfiguration.NotificationConfiguration :
                   connectorNotificationConfiguration);
        }
コード例 #3
0
 public abstract Connector CreateNew(ConnectorConfiguration configuration);