Example #1
0
 public CoderrSerializationErrorHandler(CoderrConfiguration configuration, DuplicateDetector duplicateDetector)
 {
     if (configuration == null)
     {
         throw new ArgumentNullException(nameof(configuration));
     }
     _processor         = new ExceptionProcessor(configuration);
     _duplicateDetector = duplicateDetector;
 }
        public DuplicateMessageDetector(int maxListLength)
        {
            Fx.Assert(maxListLength > 0, "maxListLength must be > 0");

            this.disposed = false;
            this.hashAlgorithm = HashAlgorithm.Create();
            this.thisLock = new object();

            this.duplicateDetector = new DuplicateDetector<string>(maxListLength);
        }
        public DuplicateMessageDetector(int maxListLength)
        {
            Fx.Assert(maxListLength > 0, "maxListLength must be > 0");

            this.disposed      = false;
            this.hashAlgorithm = HashAlgorithm.Create();
            this.thisLock      = new object();

            this.duplicateDetector = new DuplicateDetector <string>(maxListLength);
        }
Example #4
0
        public void HasDupesTest()
        {
            // arrange
            int[] values = new int[] { 12, 55, 99, 42, 6, 7, 99 };

            // act
            bool actual = DuplicateDetector.HasDuplicates(values);

            // assert
            Assert.AreEqual(true, actual);
        }
        public AnnouncementService(int duplicateMessageHistoryLength)
        {
            if (duplicateMessageHistoryLength < 0)
            {
                throw FxTrace.Exception.ArgumentOutOfRange(
                          "duplicateMessageHistoryLength",
                          duplicateMessageHistoryLength,
                          SR.DiscoveryNegativeDuplicateMessageHistoryLength);
            }

            if (duplicateMessageHistoryLength > 0)
            {
                this.duplicateDetector = new DuplicateDetector <UniqueId>(duplicateMessageHistoryLength);
            }
        }
        public AnnouncementService(int duplicateMessageHistoryLength)
        {
            if (duplicateMessageHistoryLength < 0)
            {
                throw FxTrace.Exception.ArgumentOutOfRange(
                    "duplicateMessageHistoryLength", 
                    duplicateMessageHistoryLength, 
                    SR.DiscoveryNegativeDuplicateMessageHistoryLength);
            }

            if (duplicateMessageHistoryLength > 0)
            {
                this.duplicateDetector = new DuplicateDetector<UniqueId>(duplicateMessageHistoryLength);
            }
        }
 protected DiscoveryService(
     DiscoveryMessageSequenceGenerator discoveryMessageSequenceGenerator,
     int duplicateMessageHistoryLength)
 {
     if (discoveryMessageSequenceGenerator == null)
     {
         throw FxTrace.Exception.ArgumentNull("messageSequenceGenerator");
     }
     if (duplicateMessageHistoryLength < 0)
     {
         throw FxTrace.Exception.ArgumentOutOfRange(
             "duplicateMessageHistoryLength",
             duplicateMessageHistoryLength,
             SR.DiscoveryNegativeDuplicateMessageHistoryLength);
     }
     if (duplicateMessageHistoryLength > 0)
     {
         this.duplicateDetector = new DuplicateDetector<UniqueId>(duplicateMessageHistoryLength);
     }
     this.messageSequenceGenerator = discoveryMessageSequenceGenerator;
 }
Example #8
0
 protected DiscoveryProxy(
     DiscoveryMessageSequenceGenerator messageSequenceGenerator,
     int duplicateMessageHistoryLength)
 {
     if (messageSequenceGenerator == null)
     {
         throw FxTrace.Exception.ArgumentNull("messageSequenceGenerator");
     }
     if (duplicateMessageHistoryLength < 0)
     {
         throw FxTrace.Exception.ArgumentOutOfRange(
                   "duplicateMessageHistoryLength",
                   duplicateMessageHistoryLength,
                   SR.DiscoveryNegativeDuplicateMessageHistoryLength);
     }
     if (duplicateMessageHistoryLength > 0)
     {
         this.duplicateDetector = new DuplicateDetector <UniqueId>(duplicateMessageHistoryLength);
     }
     this.messageSequenceGenerator = messageSequenceGenerator;
 }
 /// <summary>
 /// Detects duplicates inside the media library
 /// </summary>
 public void DetectDuplicates()
 {
     DuplicateDetector.DetectDuplicates(_mediaLibraryItems.ToList());
 }
Example #10
0
 public CoderrErrorHandling(CoderrConfiguration configuration, DuplicateDetector detector)
 {
     _duplicateDetector = detector;
 }
Example #11
0
 public CoderrErrorHandling(CoderrConfiguration configuration)
 {
     _duplicateDetector = DuplicateDetector.Instance;
 }