Esempio n. 1
0
        /// <summary>
        /// Returns true if Body4 instances are equal
        /// </summary>
        /// <param name="other">Instance of Body4 to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Body4 other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Filename == other.Filename ||
                     Filename != null &&
                     Filename.Equals(other.Filename)
                     ) &&
                 (
                     Documentbody == other.Documentbody ||
                     Documentbody != null &&
                     Documentbody.Equals(other.Documentbody)
                 ) &&
                 (
                     Subject == other.Subject ||
                     Subject != null &&
                     Subject.Equals(other.Subject)
                 ) &&
                 (
                     ObjectidCatGtmattachmentsodataBind == other.ObjectidCatGtmattachmentsodataBind ||
                     ObjectidCatGtmattachmentsodataBind != null &&
                     ObjectidCatGtmattachmentsodataBind.Equals(other.ObjectidCatGtmattachmentsodataBind)
                 ));
        }
Esempio n. 2
0
        public override bool Equals(object obj)
        {
            if (!(obj is MusicFile))
            {
                return(false);
            }

            return(Filename.Equals(((MusicFile)obj).Filename));
        }
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            if (obj == this)
            {
                return(true);
            }

            return(obj is DisputeEvidenceFile other &&
                   ((Filename == null && other.Filename == null) || (Filename?.Equals(other.Filename) == true)) &&
                   ((Filetype == null && other.Filetype == null) || (Filetype?.Equals(other.Filetype) == true)));
        }
Esempio n. 4
0
        public override bool Equals(object obj)
        {
            if (obj == null || GetType() != obj.GetType())
            {
                return(false);
            }

            File objresult = (File)obj;

            if (!Filename.Equals(objresult.Filename) ||
                !FullPath.Equals(objresult.FullPath) ||
                !SizeInKiloBytes.Equals(objresult.SizeInKiloBytes) ||
                !Hash.Equals(objresult.Hash))
            {
                return(false);
            }

            return(true);
        }
        /// <summary>
        /// Returns true if DesignerBean instances are equal
        /// </summary>
        /// <param name="input">Instance of DesignerBean to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(DesignerBean input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     Name == input.Name ||
                     (Name != null &&
                      Name.Equals(input.Name))
                     ) &&
                 (
                     Filename == input.Filename ||
                     (Filename != null &&
                      Filename.Equals(input.Filename))
                 ) &&
                 (
                     Id == input.Id ||
                     (Id != null &&
                      Id.Equals(input.Id))
                 ) &&
                 (
                     Block == input.Block ||
                     (Block != null &&
                      Block.Equals(input.Block))
                 ) &&
                 (
                     Source == input.Source ||
                     (Source != null &&
                      Source.Equals(input.Source))
                 ) &&
                 (
                     SourceEdited == input.SourceEdited ||
                     (SourceEdited != null &&
                      SourceEdited.Equals(input.SourceEdited))
                 ));
        }
        /// <summary>
        /// Returns true if MailAttachment instances are equal
        /// </summary>
        /// <param name="other">Instance of MailAttachment to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(MailAttachment other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Filename == other.Filename ||
                     Filename != null &&
                     Filename.Equals(other.Filename)
                     ) &&
                 (
                     Data == other.Data ||
                     Data != null &&
                     Data.Equals(other.Data)
                 ));
        }
 public bool Equals(OCRResults other)
 {
     return(Filename.Equals(other.Filename) && OCROutput.Equals(other.OCROutput) && Result.Equals(other.Result));
 }
Esempio n. 8
0
        /// <summary>
        /// Parses the HTTP request
        /// </summary>
        /// <param name="line">HTTP request string</param>
        private void ParseRequestLine(string line)
        {
            XmlConfigurator.Configure();
            if (String.IsNullOrWhiteSpace(line))
            {
                throw new ArgumentException();
            }
            string[] requestWords = line.Split(' ');
            if (requestWords.Length != 3)
            {
                throw new ArgumentException();
            }

            Methods method;

            if (!Methods.TryParse(requestWords[0], out method))
            {
                errorLog.Error("Only GET requests are supported");
                throw new MethodException("Only GET requests are supported", "Method");
            }
            Method = method;

            Filename = requestWords[1];
            Filename = Uri.UnescapeDataString(Filename);
            Filename = Filename.Replace('+', ' ');

            int position = Filename.IndexOf('?');

            if (position >= 0)
            {
                string query = Filename.Substring(position + 1);
                IDictionary <string, string> dict = ReadingRequest.ParseQuery(query);
                if (dict != null)
                {
                    GetArguments = dict;
                }
                Filename = Filename.Substring(0, position);
            }

            if (Filename.Equals("/"))
            {
                Filename = INDEX_FILENAME;
            }

            Protocol = requestWords[2];

            string[] protocolWords = Protocol.Split('/');
            if (protocolWords.Length != 2)
            {
                errorLog.Error("Invalid protocol format");
                throw new ProtocolException("Invalid protocol format", "protocolWords");
            }
            if (!protocolWords[0].Equals("HTTP"))
            {
                errorLog.Error("Only HTTP is supported");
                throw new ProtocolException("Only HTTP is supported", "protocolWords[0]");
            }

            try
            {
                decimal protocolVersion = decimal.Parse(protocolWords[1]);
                if (protocolVersion < 1)
                {
                    errorLog.Error("Invalid HTTP version");
                    throw new ProtocolException("Invalid HTTP version", "protocolVersion");
                }
            }
            catch (FormatException)
            {
                errorLog.Error("Invalid HTTP version format");
                throw new ProtocolException("Invalid HTTP version format", "protocolVersion");
            }
        }