Example #1
0
 /// <summary>Causes a service channel to transition from the created state into the opened state.</summary>
 public void Open()
 {
     if (this.CommunicationObject == null)
     {
         return;
     }
     if (this.CommunicationObject.State != CommunicationState.Created)
     {
         return;
     }
     try
     {
         this.CommunicationObject.Open();
     }
     catch (Exception ex)
     {
         ChannelFaultedEventArgs args = new ChannelFaultedEventArgs("Exception when opening an SDK channel", ex);
         this.OnChannelFaulted(args);
         if (args.Cancel)
         {
             return;
         }
         throw;
     }
 }
Example #2
0
 /// <summary>Event handler virtual method for a channel factory that is in a faulted state.</summary>
 /// <param name="args">Type: <see cref="T:Microsoft.Xrm.Sdk.Client.ChannelFaultedEventArgs"></see>. Faulted channel event arguments.</param>
 protected virtual void OnFactoryFaulted(ChannelFaultedEventArgs args)
 {
     if (this.FactoryFaulted == null)
     {
         return;
     }
     this.FactoryFaulted((object)this, args);
 }