Example #1
0
        /// <summary>
        /// Set the filebrowser with options on image import.
        /// </summary>
        private void SetFileBrowser()
        {
            //Filebrowser
            Microsoft.Win32.OpenFileDialog openImagesDialog = new Microsoft.Win32.OpenFileDialog();

            // Set options for filebrowser
            openImagesDialog.Filter           = "Image Files|*.jpg;*.jpeg";
            openImagesDialog.InitialDirectory = "";
            openImagesDialog.FilterIndex      = 1;
            openImagesDialog.Title            = "Select image(s) to import";
            openImagesDialog.Multiselect      = true;

            bool result = (bool)openImagesDialog.ShowDialog();

            if (result == true)
            {
                if (framesContainer.Count == 1 &&
                    framesContainer.FramesList[0].Curves.TotalPointCount == 0 &&
                    framesContainer.FramesList[0].ImageUrl == null)
                {
                    framesContainer.Clear();
                }
            }

            framesContainer.AddRange(DiffusionCurves.Import.ImportImages.Import(result,
                                                                                openImagesDialog.FileNames, this.framesContainer.Count));
        }
        public void AddRangeTest()
        {
            Frame testframe  = MockRepository.GenerateMock <Frame>("");
            Frame testframe2 = MockRepository.GenerateMock <Frame>("");
            Frame testframe3 = MockRepository.GenerateMock <Frame>("");
            List <DiffusionCurves.Model.Frame> frameCollection = new List <DiffusionCurves.Model.Frame>();

            frameCollection.Add(testframe);
            frameCollection.Add(testframe2);
            frameCollection.Add(testframe3);

            int count = testFramesContainer.Count;

            testFramesContainer.AddRange(frameCollection);
            Assert.AreEqual(count + 3, testFramesContainer.Count);
        }