コード例 #1
0
ファイル: CriticalPeakPricing.cs プロジェクト: lenloe1/Stuff
 internal override void Invoke()
 {
     this.m_client   = ExternalClientFactory.ConstructControlServiceClient(ExternalLib.Endpoint.ControlEndpointName, ExternalLib.Endpoint.ExternalUserName, ExternalLib.Endpoint.ExternalUserPassword);
     this._rqstToken = this.m_client.ServiceClient.ActivateCriticalPeakPricingByMeters(_epRequest);
     Thread.Sleep(300000);
     this.m_client.ServiceClient.Close();
 }
コード例 #2
0
        internal override void Invoke()
        {
            if (string.IsNullOrEmpty(UniqueID))
            {
                this._client    = ExternalClientFactory.ConstructControlServiceClient(ExternalLib.Endpoint.ControlEndpointName, ExternalLib.Endpoint.ExternalUserName, ExternalLib.Endpoint.ExternalUserPassword);
                this._rqstToken = this._client.ServiceClient.DownloadConfigurationByGroup(_requestDownloadConfig);
                this._client.ServiceClient.Close();

                _uniqueID = _rqstToken.Id.ToString();
            }
        }
コード例 #3
0
        internal override void Invoke()
        {
            this._client = ExternalClientFactory.ConstructControlServiceClient(ExternalLib.Endpoint.ControlEndpointName, ExternalLib.Endpoint.ExternalUserName, ExternalLib.Endpoint.ExternalUserPassword);

            RequestToken Token = new RequestToken();

            Token.Id = new Guid(_uniqueID);

            this._result = this._client.ServiceClient.GetDownloadConfigurationByGroupResult(Token);

            this._client.ServiceClient.Close();
        }
コード例 #4
0
ファイル: Ping.cs プロジェクト: lenloe1/Stuff
 internal override void Invoke()
 {
     if (string.IsNullOrEmpty(UniqueID))
     {
         this._client    = ExternalClientFactory.ConstructControlServiceClient(ExternalLib.Endpoint.ControlEndpointName, ExternalLib.Endpoint.ExternalUserName, ExternalLib.Endpoint.ExternalUserPassword);
         this._rqstToken = this._client.ServiceClient.PingByEndpoints(_requestPing);
         bool blTryAgain = true;
         int  retryCount = 4;
         _uniqueID = _rqstToken.Id.ToString();
         while (blTryAgain)
         {
             if (retryCount == 0)
             {
                 blTryAgain = false;
             }
             try
             {
                 Thread.Sleep(60000);
                 this._rqstResult = this._client.ServiceClient.GetPingByEndpointsResult(this._rqstToken);
                 if (this._rqstResult != null)
                 {
                     blTryAgain = false;
                 }
             }
             catch (Exception e)
             {
                 Console.WriteLine("Exception from DisconnectMeter: " + e);
                 retryCount--;
             }
             if (this._rqstResult == null)
             {
                 retReslt = "Unknown";
             }
             else
             {
                 retReslt = this._rqstResult.Result.ToString();
             }
         }
         this._client.ServiceClient.Close();
     }
 }