예제 #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));
            }
        }
예제 #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));
            }
        }
예제 #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));
            }
        }