public override bool IsEqual(EqualtableFormat equaltable)
        {
            if (!(equaltable is TextEquatableFormat textEquatable))
            {
                return(false);
            }

            if (Source.Length != textEquatable.Text.Length)
            {
                return(false);
            }

            return(Source == textEquatable.Text);
        }
예제 #2
0
        public override bool IsEqual(EqualtableFormat equaltable)
        {
            if (!(equaltable is PathsEquatableFormat pathsEquatable))
            {
                return(false);
            }

            if (Paths.Count != pathsEquatable.Paths.Count)
            {
                return(false);
            }

            if (Paths.Except(pathsEquatable.Paths).Any())
            {
                return(false);
            }

            return(true);
        }
예제 #3
0
        public override bool IsEqual(EqualtableFormat equaltable)
        {
            if (!(equaltable is BitmapEquatableFormat bitmapEquatable))
            {
                return(false);
            }

            if (Size != bitmapEquatable.Size)
            {
                return(false);
            }

            if (!Enumerable.SequenceEqual(GetHash(), bitmapEquatable.GetHash()))
            {
                return(false);
            }

            return(true);
        }
예제 #4
0
 private async Task AddImplementationsAsync(ClipboardObject clipboardObject, EqualtableFormat equatableFormat)
 {
     clipboardObject.Implementations.AddRange((await Task.WhenAll(_implementationFactories.Select(f => f.CreateFromEquatable(clipboardObject, equatableFormat))).ConfigureAwait(false)).NotNull());
 }
 public abstract Task <ClipboardImplementation?> CreateFromEquatable(ClipboardObject clipboardObject, EqualtableFormat equaltableFormat);
예제 #6
0
 public ExistsEqualtableFormatContainer(EqualtableFormat equaltableFormat)
 {
     EqualtableFormat = equaltableFormat;
     Match            = null;
 }
예제 #7
0
 public override Task <ClipboardImplementation> CreateFromEquatable(ClipboardObject clipboardObject, EqualtableFormat equaltableFormat)
 {
     return(Task.FromResult <ClipboardImplementation>(
                equaltableFormat switch {
         TextEquatableFormat textEquatableFormat => new TextClipboardImplementation(clipboardObject, this, textEquatableFormat),
         PathsEquatableFormat pathsEquatableFormat => new PathsImplementation(clipboardObject, this, pathsEquatableFormat),
         BitmapEquatableFormat bitmapEquatableFormat => new BitmapImplementation(clipboardObject, this, bitmapEquatableFormat),
         _ => null,
     }));