コード例 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AdobeConnectXmlAPI" /> class.
        /// </summary>
        /// <param name="communicationProvider">The communicaton provider.</param>
        /// <param name="settings"><see cref="ISdkSettings"/></param>
        /// <exception cref="System.ArgumentNullException">
        /// Argument 'communicationProvider' can not be null.
        /// or
        /// Argument 'settings' can not be null.
        /// or
        /// Configuration parameter 'serviceURL' can not be null.
        /// </exception>
        public AdobeConnectXmlAPI(ICommunicationProvider communicationProvider, ISdkSettings settings)
        {
            if (settings == null)
            {
                throw new ArgumentNullException("Argument 'settings' can not be null.");
            }

            if (string.IsNullOrEmpty(settings.ServiceURL))
            {
                throw new ArgumentNullException("Configuration parameter 'serviceURL' can not be null.");
            }
            if (communicationProvider != null)
            {
                this.communicationProvider = communicationProvider;
            }
            else
            {
                throw new ArgumentNullException("Argument 'communicationProvider' can not be null.");
            }


            this.settings = settings;

            this.settings.ServiceURL = this.settings.ServiceURL.TrimEnd(new char[] { '/', '?' });
            if (!this.settings.ServiceURL.EndsWith("/api/xml"))
            {
                this.settings.ServiceURL = this.settings.ServiceURL + "/api/xml";
            }
        }
コード例 #2
0
        public static void Init(ICommunicationProvider instance)
        {
            if (instance == null)
                throw new ArgumentNullException("instance");
            if (ms_Instance != null)
                throw new InvalidOperationException("Communication provider is already installed");

            ms_Instance = instance;
        }
コード例 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AdobeConnectXmlAPI"/> class, using default <see cref="HttpCommunicationProvider"/> and <see cref="SdkSettings"/>.
 /// </summary>
 /// <remarks>
 /// <para>Default constructor expects the following configuration defined:</para>
 /// <para>&lt;add key="ServiceURL" value="https://acrobat.com/api/xml" /&gt;</para>
 /// <para>&lt;add key="NetUser" value="[your AC user]" /&gt;</para>
 /// <para>&lt;add key="NetPassword" value="[your AC password]" /&gt;</para>
 /// <para>Optional proxy settings:</para>
 /// <para>&lt;settings&gt;</para>
 /// <para>&lt;ipv6 enabled="true" /&gt;</para>
 /// <para>&lt;/settings&gt;</para>
 /// <para>&lt;defaultProxy enabled="true" useDefaultCredentials="true"&gt;</para>
 /// <para>    &lt;proxy bypassonlocal="True" proxyaddress="http://..." /&gt;</para>
 /// <para>&lt;/defaultProxy&gt;</para>
 /// </remarks>
 public AdobeConnectXmlAPI(ICommunicationProvider communicatonProvider)
     : this(communicatonProvider, new SdkSettings()
 {
     ServiceURL = ConfigurationManager.AppSettings["ServiceURL"],
     NetUser = ConfigurationManager.AppSettings["NetUser"],
     NetPassword = ConfigurationManager.AppSettings["NetPassword"],
     NetDomain = ConfigurationManager.AppSettings["NetDomain"],
     ProxyUrl = ConfigurationManager.AppSettings["ProxyUrl"],
     UseSessionParam = ConfigurationManager.AppSettings["UseSessionParam"] == null || bool.Parse(ConfigurationManager.AppSettings["UseSessionParam"])
 })
 {
 }
コード例 #4
0
        public MainWindow()
        {
            InitializeComponent();
            AppAction.InitData();

            #region SETUP TCPCOMMUNICATION FOR REMOTE CONTROLLING

            tcpProvider                  = new TcpCommunication(this);
            stringCommandSender          = new StringCommandSender();
            stringCommandSender.Provider = tcpProvider;

            tcpProvider.Start();

            #endregion
        }
コード例 #5
0
        public RemoteRuntimeHost(string assemblyQualifiedName)
        {
            var msg = $"You have to pass an instance implemented '{ nameof(ICommunicationProvider) }' to '{ nameof(RuntimeHost) }.{ nameof(RuntimeHost.SetNetworkProvider) }'.";

            if (string.IsNullOrEmpty(assemblyQualifiedName))
            {
                throw new InvalidOperationException(msg);
            }

            m_networkProvider2 = Activator.CreateInstance(Type.GetType(assemblyQualifiedName)) as ICommunicationProvider;
            if (m_networkProvider2 == null)
            {
                throw new InvalidOperationException(msg);
            }
        }
コード例 #6
0
        public StatsClient(IStatsConfig statsConfig)
        {
            _statsConfig = statsConfig;

            if (string.IsNullOrEmpty(_statsConfig.Host))
            {
                throw new ArgumentException("Host must be provided");
            }

            if (_statsConfig.Port <= 0)
            {
                throw new ArgumentException("Valid port must be provided");
            }

            if (string.IsNullOrEmpty(_statsConfig.Prefix))
            {
                throw new ArgumentException("Prefix must be provided");
            }

            _communicationProvider = new TcpCommunicationProvider(_statsConfig);
        }
コード例 #7
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AdobeConnectXmlAPI" /> class.
        /// </summary>
        /// <param name="communicationProvider">The communicaton provider.</param>
        /// <param name="settings"><see cref="ISdkSettings"/></param>
        /// <exception cref="System.ArgumentNullException">
        /// Argument 'communicationProvider' can not be null.
        /// or
        /// Argument 'settings' can not be null.
        /// or
        /// Configuration parameter 'serviceURL' can not be null.
        /// </exception>
        public AdobeConnectXmlAPI(ICommunicationProvider communicationProvider, ISdkSettings settings)
        {
            if (communicationProvider == null)
            {
                throw new ArgumentNullException("Argument 'communicationProvider' can not be null.");
            }

            if (settings == null)
            {
                throw new ArgumentNullException("Argument 'settings' can not be null.");
            }

            if (string.IsNullOrEmpty(settings.ServiceURL))
            {
                throw new ArgumentNullException("Configuration parameter 'serviceURL' can not be null.");
            }

            this.communicationProvider = communicationProvider;
            this.settings = settings;

            this.settings.ServiceURL = this.settings.ServiceURL.TrimEnd(new char[] { '/', '?' });

            AutoMapper.Mapper.Initialize(cfg => cfg.CreateMissingTypeMaps = true);
        }
コード例 #8
0
 public override void SetNetworkProvider(ICommunicationProvider networkProvider)
 {
     throw new NotSupportedException();
 }
コード例 #9
0
 public DeepSeaClient(ICommunicationProvider provider)
 {
     this.provider = provider;
 }
コード例 #10
0
 public DeepSeaServer(ICommunicationProvider provider)
 {
     this.provider = provider;
 }