public override bool Equals(object o)
        {
            if (this == o)
            {
                return(true);
            }

            if (o == null || GetType() != o.GetType())
            {
                return(false);
            }

            ExecutionSignature that = (ExecutionSignature)o;

            if (!CommandName.Equals(that.CommandName))
            {
                return(false);
            }

            if (!Eventcounts.Equals(that.Eventcounts))
            {
                return(false);
            }

            return(!(_cacheKey != null ? !_cacheKey.Equals(that._cacheKey) : that._cacheKey != null));
        }
Example #2
0
            public override bool Equals(object obj)
            {
                if (obj is LaunchType oth)
                {
                    return(CommandName?.Equals(oth.CommandName) ?? oth.CommandName == null);
                }

                return(false);
            }
        /// <summary>
        /// StringParser to limit the response to the expected command
        /// </summary>
        /// <param name="reader">string reader</param>
        /// <param name="length">string length</param>
        /// <returns>string</returns>
        protected virtual string CommandNameStringParser(StringReader reader, int length)
        {
            string value = StringParser.StringStringParser(reader, length);

            if (CommandName.Equals(value) == false)
            {
                throw new CommandNameMismatchException("\"" + value + "\" not supported for " + CommandName);
            }
            return(value);
        }
        // Methods
        /// <summary>
        /// StringFormatter to limit the response to the expected command
        /// </summary>
        /// <param name="obj">object to convert</param>
        /// <param name="length">length for the value as string, ignored</param>
        /// <returns>Value of the property as string</returns>
        protected virtual string CommandNameStringFormatter(string obj, int length)
        {
            string value = StringFormatter.StringStringFormatter(obj, length);

            if (CommandName.Equals(value) == false)
            {
                throw new CommandNameMismatchException("\"" + value + "\" not supported for " + CommandName);
            }
            return(value);
        }
Example #5
0
        static bool MatchCommad(UtilityCommand command)
        {
            bool rslt = CommandName.Equals(command.ToString(),
                                           StringComparison.OrdinalIgnoreCase);

            if (rslt)
            {
                Command = command;
            }
            return(rslt);
        }
            public override bool Equals(object obj)
            {
                LaunchType oth = obj as LaunchType;

                if (oth != null)
                {
                    return(CommandName.Equals(oth.CommandName));
                }

                return(false);
            }
Example #7
0
        public virtual bool CanRecognizeArgs(string[] originalCmdLineArgs)
        {
            if (originalCmdLineArgs == null ||
                originalCmdLineArgs.Length == 0)
            {
                return(false);
            }

            Debug.Assert(!string.IsNullOrEmpty(CommandName), "CommandName is NULL or Empty");
            if (CommandName.Equals(originalCmdLineArgs[0], StringComparison.OrdinalIgnoreCase))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #8
0
 public override bool CanHandle(IMessage message)
 {
     return(base.CanHandle(message) && CommandName.Equals(((ICommandMessage)message).CommandName));
 }