Example #1
0
        void IControllerService.SendSettings(AppSettingsProperty value)
        {
            try
            {
                clientCallback?.SettingsReceiveAndApply(value);
            }
            catch (Exception e)
            {
                FaultContract fault = new FaultContract();

                fault.Result      = false;
                fault.Message     = e.Message;
                fault.Description = "WCF description";

                Trace.TraceError("[WCF] {0}", e);

                throw new FaultException <FaultContract>(fault, new FaultReason(e.Message));
            }
        }
Example #2
0
        string IControllerService.DisconnectPrepare()
        {
            try
            {
                m_ConnectionChanged -= controllerCallback.ConnectionChanged;
                m_ConnectionChanged();
                //   OperationContext.Current.Channel.Close();
                controllerCallback = null;
                return("disconnected");
            }
            catch (Exception e)
            {
                FaultContract fault = new FaultContract();

                fault.Result      = false;
                fault.Message     = e.Message;
                fault.Description = "WCF error";

                Trace.TraceError("[WCF] {0}", e);

                throw new FaultException <FaultContract>(fault, new FaultReason(e.Message));
            }
        }
Example #3
0
        void IControllerService.Connect()
        {
            try
            {
                controllerCallback   = OperationContext.Current.GetCallbackChannel <IControllerServiceCallback>();
                m_ConnectionChanged += controllerCallback.ConnectionChanged;
                if (clientCallback != null)
                {
                    m_ConnectionChanged();
                }
            }
            catch (Exception e)
            {
                FaultContract fault = new FaultContract();

                fault.Result      = false;
                fault.Message     = e.Message;
                fault.Description = "WCF error";

                Trace.TraceError("[WCF] {0}", e);

                throw new FaultException <FaultContract>(fault, new FaultReason(e.Message));
            }
        }