Example #1
0
        internal string BuildCommandText()
        {
            string commandText = _command.ToString().ToUpper(CultureInfo.InvariantCulture);

            if (_arguments == null)
            {
                return(commandText);
            }
            else
            {
                StringBuilder builder = new StringBuilder();
                foreach (string arg in _arguments)
                {
                    builder.Append(arg);
                    builder.Append(" ");
                }
                string argText = builder.ToString().TrimEnd();

                if (_command == FtpsCmd.Unknown)
                {
                    return(argText);
                }
                else
                {
                    return(String.Format("{0} {1}", commandText, argText).TrimEnd());
                }
            }
        }
 /// <summary>
 /// Linearly searches for the specified object based on the feature 'name' parameter value
 /// and returns true if an object with the name is found; otherwise false.  Search is case insensitive.
 /// </summary>
 /// <param name="name">The name of the FtpFeature to locate in the collection.</param>
 /// <param name="arguments">The argument for the FtpFeature to locate in the collection.</param>
 /// <returns>True if the name if found; otherwise false.</returns>
 public bool Contains(FtpsCmd name, string arguments)
 {
     return(Contains(name.ToString(), arguments));
 }
 /// <summary>
 /// Linearly searches for the specified object based on the feature 'name' parameter value
 /// and returns true if an object with the name is found; otherwise false.  Search is case insensitive.
 /// </summary>
 /// <param name="name">The name of the FtpFeature to locate in the collection.</param>
 /// <returns>True if the name if found; otherwise false.</returns>
 public bool Contains(FtpsCmd name)
 {
     return(Contains(name.ToString()));
 }
 /// <summary>
 /// Linearly searches for the specified object based on the feature 'name' parameter value
 /// and returns the corresponding object with the name is found; otherwise null.  Search is case insensitive.
 /// </summary>
 /// <param name="name">The name of the FtpFeature to locate in the collection.</param>
 /// <returns>FtpFeature object if the name if found; otherwise null.</returns>
 public FtpsFeature Find(FtpsCmd name)
 {
     return(Find(name.ToString()));
 }
Example #5
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="message">Exception message text.</param>
 /// <param name="command">Enumerated FTP command.</param>
 public FtpsCommandNotSupportedException(string message, FtpsCmd command)
     : this(message, command.ToString())
 {
 }
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="message">Exception message text.</param>
 /// <param name="command">Enumerated FTP command.</param>
 public FtpsCommandNotSupportedException(string message, FtpsCmd command)
     : this(message, command.ToString())
 {  
 }