コード例 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="func"></param>
        /// <param name="p"></param>
        /// <param name="s"></param>
        protected override void CommandWrapper(ICommandFunc func, CommunicateProtocol p, SocketState s)
        {
            try
            {
                func.profile = this.GetProfile(Settings.Default);
                SocketState state = func.Execute(p, s, listener);

                if (this.window != null)
                {
                    this.window.MessageCallBackMethod(state.OutPutMsg, null);
                }
            }
            catch (Exception Ex)
            {
                Logger.Write(LogType.Error, Ex.Message, Ex);

                if (this.window != null)
                {
                    this.window.MessageCallBackMethod(Ex.ToString(), null);
                }
            }
            finally
            {
                listener.ContinueAsyncReceive(s);
                GC.WaitForFullGCComplete();
                GC.Collect();
            }
        }
コード例 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="func"></param>
        /// <param name="p"></param>
        /// <param name="s"></param>
        protected override void CommandWrapper(ICommandFunc func, CommunicateProtocol p, SocketState s)
        {
            try
            {
                func.profile = this.GetProfile(Settings.Default);
                SocketState state = func.Execute(p, s, client);

                OnSocketEventRaised(this, new EventArgCollection.SocketEventArgs()
                {
                    Msg = state.OutPutMsg
                });
            }
            catch (Exception Ex)
            {
                OnErrorRaised(this, new EventArgCollection.SocketErrorEventArgs()
                {
                    Exp = Ex
                });
            }
            finally
            {
                client.ContinueAsyncReceive(s);
                GC.WaitForFullGCComplete();
                GC.Collect();
            }
        }
コード例 #3
0
 public TResult Execute <TResult>(ICommandFunc <TResult> command, CommandAction commandAction)
 {
     try
     {
         Logger.WriteLine($"Executing Command: {command?.GetType().FullName}");
         return(command.Execute(commandAction));
     }
     catch (TestExecutionException ex)
     {
         if (!HandleException(ex))
         {
             throw;
         }
         else
         {
             return(default);
コード例 #4
0
 public TResult Execute <TResult>(ICommandFunc <TResult> command)
 {
     return(Execute(command, DefaultCommandAction));
 }
コード例 #5
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="func"></param>
 /// <param name="p"></param>
 /// <param name="s"></param>
 protected abstract void CommandWrapper(ICommandFunc func, CommunicateProtocol p, SocketState s);