Exemplo n.º 1
0
        private void OK_button_Click(object sender, RoutedEventArgs e)
        {
            if (IMG_LSTVIEW_UI.SelectedItems == null)
            {
                return;
            }

            System.Collections.IList list = IMG_LSTVIEW_UI.SelectedItems as System.Collections.IList;
            if (list.Count != 1)
            {
                return;
            }

            ImageItem item      = (ImageItem)list[0];
            string    imageFile = item.p_Image_uri;

            string sets = "";

            foreach (StackPanel stack in SetItems_stackPanel.Children)
            {
                var txt = stack.Children[0] as TextBlock;
                sets += "_" + txt.Text;
            }

            sets += "_OK";
            string dir = Path.GetDirectoryName(imageFile) + "\\OK\\";

            Directory.CreateDirectory(dir);
            string newFileName = dir + Path.GetFileNameWithoutExtension(imageFile) + sets + Path.GetExtension(imageFile);

            File.Copy(imageFile, newFileName, true);

            int nextIndex = IMG_LSTVIEW_UI.SelectedIndex + 1;

            if (IMG_LSTVIEW_UI.ILV_GetImgItems().Count == nextIndex)
            {
                MessageBox.Show("마지막 이미지입니다!");
                return;
            }

            IMG_LSTVIEW_UI.SelectedIndex = nextIndex;

            if (KeepSets_checkBox.IsChecked == false)
            {
                DeleteAllItem();
            }
        }
Exemplo n.º 2
0
        private void ImageItemsUpdateUI(List <string> files)
        {
            if (IMG_LSTVIEW_UI.ILV_GetImgItems().Count != 0)
            {
                IMG_LSTVIEW_UI.ILV_Clearitem();
            }

            List <ImageItem> list = new List <ImageItem>();

            foreach (string file in files)
            {
                list.Add(new ImageItem()
                {
                    p_Image_uri = file, p_FileName = Path.GetFileName(file)
                });
            }

            foreach (ImageItem file in list)
            {
                IMG_LSTVIEW_UI.ILV_insertitem(file);
            }
        }
Exemplo n.º 3
0
        private void inner_ImageItemsUpdateUI(List <ImageItem> items)
        {
            try
            {
                if (IMG_LSTVIEW_UI.ILV_GetImgItems().Count != 0)
                {
                    IMG_LSTVIEW_UI.ILV_Clearitem();
                }

                foreach (ImageItem item in items)
                {
                    IMG_LSTVIEW_UI.ILV_insertitem(item);
                }

                return;
            }
            catch (Exception err)
            {
                return;
            }
            finally
            { }
        }