Example #1
0
        public bool ValidateConfiguration()
        {
            bool callsignValidity     = Callsign.VerifyCallsign();
            bool passwordValidity     = Helpers.VerifyPassword(Callsign, Password);
            bool checkSoftwareName    = SoftwareName.IndexOf(' ') > -1;
            bool checkSoftwareVersion = SoftwareVersion.IndexOf(' ') > -1;

            if (!callsignValidity)
            {
                Trace.TraceWarning($"{nameof(Callsign)} could not be validated, see http://www.aprs-is.net/Connecting.aspx for more information");
            }

            if (!passwordValidity)
            {
                Trace.TraceWarning($"{nameof(Password)} is not valid for given callsign. Please request a valid password with the software vendor in case you need write access to the APRS server.");
            }

            if (Password == "-1")
            {
                Trace.TraceWarning("APRS client is in readonly mode. Request a valid password in case you need write access to the APRS server");
            }

            if (!checkSoftwareName)
            {
                Trace.TraceWarning($"{nameof(SoftwareName)} contains a space.Spaces are illegal. Your mileage may vary now.");
            }

            if (!checkSoftwareVersion)
            {
                Trace.TraceWarning($"{nameof(SoftwareVersion)} contains a space. Spaces are illegal. Your mileage may vary now.");
            }

            return(callsignValidity && passwordValidity && checkSoftwareName && checkSoftwareVersion);
        }
Example #2
0
 public override int GetHashCode()
 {
     if (SoftwareName != null)
     {
         return(SoftwareName.ToLower().GetHashCode());
     }
     else
     {
         return(0);
     }
 }
Example #3
0
        /// <summary>
        ///     Object hash code
        /// </summary>
        /// <returns></returns>
        public override int GetHashCode()
        {
            unchecked
            {
                var hashCode = Name != null?Name.GetHashCode() : 0;

                hashCode = (hashCode * 397) ^ (Customizations != null ? Customizations.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (URI != null ? URI.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Version != null ? Version.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (ContactRole != null ? ContactRole.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (SoftwareName != null ? SoftwareName.GetHashCode() : 0);
                return(hashCode);
            }
        }
Example #4
0
 public override int GetHashCode()
 {
     unchecked
     {
         return(base.GetHashCode()
                + (Callsign.ToUpper().GetHashCode() * 3)
                + (VID.ToUpper().GetHashCode() * 3)
                + (Name.ToUpper().GetHashCode() * 3)
                + (ClientType.GetHashCode() * 3)
                + (GetItemHashCode(Location) * 3)
                + (Server.ToUpper().GetHashCode() * 3)
                + (Protocol.ToUpper().GetHashCode() * 3)
                + (ConnectionTime.GetHashCode() * 3)
                + (SoftwareName.ToUpper().GetHashCode() * 3)
                + (SoftwareVersion.ToUpper().GetHashCode() * 3)
                + (AdministrativeVersion.GetHashCode() * 3)
                + (ClientRating.GetHashCode() * 3) * 17);
     }
 }
Example #5
0
 public object Clone()
 {
     return(new Log((string)SoftwareName.Clone(), (string)LogTitle.Clone(), (string)LogDescription.Clone(), (DateLog)Date, (LogType)Type, backColor, foreColor));
 }