コード例 #1
0
ファイル: appsservice.cs プロジェクト: zngduong/google-gdata
        /// <summary>
        /// the AppsService is an application object holding several
        /// real services object. To allow the setting of advanced http properties,
        /// proxies and other things, we allow setting the factory class that is used.
        ///
        /// a getter does not make a lot of sense here, as which of the several factories in use
        /// are we getting? It also would give the illusion that you could get one object and then
        /// modify its settings.
        /// </summary>
        /// <param name="factory">The factory to use for the AppsService</param>
        /// <returns></returns>
        public void SetRequestFactory(IGDataRequestFactory factory)
        {
            if (factory == null)
            {
                throw new ArgumentNullException("factory", "The factory object should not be NULL");
            }

            nicknameService.RequestFactory    = factory;
            userAccountService.RequestFactory = factory;
            groupsService.RequestFactory      = factory;
        }
コード例 #2
0
ファイル: unittests.cs プロジェクト: Zelxin/RPiKeg
        public virtual void InitTest() {
            Tracing.InitTracing();

            this.defaultHost = "http://localhost";
            this.strRemoteHost = null;
            this.externalHosts = null;
            this.iIterations = 10;

            if (this.factory == null) {
                GDataLoggingRequestFactory factory = new GDataLoggingRequestFactory(this.ServiceName, this.ApplicationName);
                this.factory = (IGDataRequestFactory)factory;
            }
            ReadConfigFile();
        }
コード例 #3
0
        public virtual void InitTest()
        {
            Tracing.InitTracing();

            this.defaultHost   = "http://localhost";
            this.strRemoteHost = null;
            this.externalHosts = null;
            this.iIterations   = 10;

            if (this.factory == null)
            {
                GDataLoggingRequestFactory factory = new GDataLoggingRequestFactory(this.ServiceName, this.ApplicationName);
                this.factory = (IGDataRequestFactory)factory;
            }
            ReadConfigFile();
        }
コード例 #4
0
        /////////////////////////////////////////////////////////////////////////////

        //////////////////////////////////////////////////////////////////////
        /// <summary>private void ReadConfigFile()</summary>
        /// <returns> </returns>
        //////////////////////////////////////////////////////////////////////
        protected virtual void ReadConfigFile()
        {
            this.unitTestConfiguration = (IDictionary)ConfigurationManager.GetSection("unitTestSection");

            // no need to go further if the configuration file is needed.
            if (unitTestConfiguration == null)
            {
                throw new FileNotFoundException("The DLL configuration file wasn't found, aborting.");
            }

            if (unitTestConfiguration.Contains("defHost") == true)
            {
                this.defaultHost = (string)unitTestConfiguration["defHost"];
                Tracing.TraceInfo("Read defaultHost value: " + this.defaultHost);
            }
            if (unitTestConfiguration.Contains("defRemoteHost") == true)
            {
                this.strRemoteHost = (string)unitTestConfiguration["defRemoteHost"];
                Tracing.TraceInfo("Read default remote host value: " + this.strRemoteHost);
            }
            if (unitTestConfiguration.Contains("iteration") == true)
            {
                this.iIterations = int.Parse((string)unitTestConfiguration["iteration"]);
            }
            if (unitTestConfiguration.Contains("resourcePath") == true)
            {
                this.resourcePath = (string)unitTestConfiguration["resourcePath"];
            }

            if (unitTestConfiguration.Contains("requestlogging") == true)
            {
                bool flag = bool.Parse((string)unitTestConfiguration["requestlogging"]);
                if (flag == false)
                {
                    // we are creating the logging factory by default. If
                    // tester set's it off, create the standard factory.
                    this.factory = new GDataGAuthRequestFactory(this.ServiceName, this.ApplicationName);
                }
            }

            this.externalHosts = (IDictionary)ConfigurationManager.GetSection("unitTestExternalHosts");
        }
コード例 #5
0
 /// <summary>
 /// the appsservice is an application object holding several
 /// real services object. To allow the setting of advanced http properties,
 /// proxies and other things, we allow setting the factory class that is used. 
 /// 
 /// a getter does not make a lot of sense here, as which of the several factories in use
 /// are we getting? It also would give the illusion that you could get one object and then
 /// modify it's settings. 
 /// </summary>
 /// <param name="factory">The factory to use for the AppsService</param>
 /// <returns></returns>
 public void  SetRequestFactory(IGDataRequestFactory factory)
 {
     if (factory == null)
     {
         throw new ArgumentNullException("factory", "The factory object should not be NULL");
     }
     emailListRecipientService.RequestFactory = factory;
     emailListService.RequestFactory = factory;
     nicknameService.RequestFactory = factory;
     userAccountService.RequestFactory = factory;
     groupsService.RequestFactory = factory;
 }
コード例 #6
0
ファイル: unittests.cs プロジェクト: Zelxin/RPiKeg
        /// <summary>private void ReadConfigFile()</summary> 
        /// <returns> </returns>        
        protected virtual void ReadConfigFile() {
            this.unitTestConfiguration = (IDictionary)ConfigurationManager.GetSection("unitTestSection");

            // no need to go further if the configuration file is needed.
            if (unitTestConfiguration == null)
                throw new FileNotFoundException("The DLL configuration file wasn't found, aborting.");

            if (unitTestConfiguration.Contains("defHost")) {
                this.defaultHost = (string)unitTestConfiguration["defHost"];
                Tracing.TraceInfo("Read defaultHost value: " + this.defaultHost);
            }
            if (unitTestConfiguration.Contains("defRemoteHost")) {
                this.strRemoteHost = (string)unitTestConfiguration["defRemoteHost"];
                Tracing.TraceInfo("Read default remote host value: " + this.strRemoteHost);
            }
            if (unitTestConfiguration.Contains("iteration")) {
                this.iIterations = int.Parse((string)unitTestConfiguration["iteration"]);
            }
            if (unitTestConfiguration.Contains("resourcePath")) {
                this.resourcePath = (string)unitTestConfiguration["resourcePath"];
            }

            if (unitTestConfiguration.Contains("requestlogging")) {
                bool flag = bool.Parse((string)unitTestConfiguration["requestlogging"]);
                if (!flag) {
                    // we are creating the logging factory by default. If 
                    // tester set's it off, create the standard factory. 
                    this.factory = new GDataGAuthRequestFactory(this.ServiceName, this.ApplicationName);
                }
            }

            this.externalHosts = (IDictionary)ConfigurationManager.GetSection("unitTestExternalHosts");
        }
コード例 #7
0
ファイル: service.cs プロジェクト: mintwans/cpsc483
        /////////////////////////////////////////////////////////////////////////////
 

        //////////////////////////////////////////////////////////////////////
        /// <summary>this will trigger the creation of an authenticating servicea</summary> 
        //////////////////////////////////////////////////////////////////////
        public Service(string service, string applicationName, string library)
        {
            this.GDataRequestFactory = new GDataGAuthRequestFactory(service, applicationName, library);
        }
コード例 #8
0
ファイル: service.cs プロジェクト: mintwans/cpsc483
        /////////////////////////////////////////////////////////////////////////////
 

        //////////////////////////////////////////////////////////////////////
        /// <summary>this will trigger the creation of an authenticating service</summary> 
        //////////////////////////////////////////////////////////////////////
        public Service(string service, string applicationName)
        {
            this.GDataRequestFactory = new GDataGAuthRequestFactory(service, applicationName, GServiceAgent);
        }
コード例 #9
0
ファイル: service.cs プロジェクト: mintwans/cpsc483
        /////////////////////////////////////////////////////////////////////////////
 

        //////////////////////////////////////////////////////////////////////
        /// <summary>default constructor, sets the default GDataRequest</summary> 
        //////////////////////////////////////////////////////////////////////
        public Service(string applicationName)
        {
            this.GDataRequestFactory = new GDataRequestFactory(applicationName + " " + GServiceAgent);
        }
コード例 #10
0
ファイル: service.cs プロジェクト: mintwans/cpsc483
 //////////////////////////////////////////////////////////////////////
 /// <summary>default constructor, sets the default GDataRequest</summary> 
 //////////////////////////////////////////////////////////////////////
 public Service()
 {
     this.GDataRequestFactory = new GDataRequestFactory(GServiceAgent);
 }