Пример #1
0
        private void Upload()
        {
            //Do some validation shenanigans
            //TODO: Check for duplicate images (Easiest solution requires NET Core 2.1 or .NET Standard 2.1)
            // https://stackoverflow.com/questions/43289/comparing-two-byte-arrays-in-net
            // https://docs.microsoft.com/en-us/dotnet/api/system.memoryextensions.sequenceequal?view=netstandard-2.1

            RepositoryContainer.ImageSets.Create(ImageDataTransformHelper.CreateDataCollectionFromImages(ImageCollection));

            MessageBox.Show("Imagset uploaded");
        }
        private void SetSelectedImageSet(IEnumerable <ImageSource> imageset)
        {
            if (SelectedImageSetCollection.Count > 0)
            {
                SelectedImageSetCollection.Clear();
            }

            foreach (var item in imageset)
            {
                SelectedImageSetCollection.Add(item);
            }


            SettingsContainer.HangmanOptions.SelectedImageSetData = ImageDataTransformHelper.CreateDataCollectionFromImages(imageset);
            SetGraphicsOption(GraphicsOption.UseSelected);
        }