Пример #1
0
        private void buttonInsertImage_Click(object sender, RoutedEventArgs e)
        {
            //1:获取选中图片列表
            List <string> selectedImgList = image.GetSelectedImageNameList();

            //2:获取选中图片列表不为空判断
            if (selectedImgList == null)
            {
                MessageBox.Show("请选中一张图片");
                return;
            }
            //3:插入图片
            //3-1:只能选中一张图片作为插入位置
            if (selectedImgList.Count != 1)
            {
                MessageBox.Show("请仅选中一张图片");
            }
            //3-2:插入图片
            else
            {
                List <string> selImgNames = InnerUtility.OpenFileSelectDialog("插入");
                if (selImgNames != null)
                {
                    bool flag = image.InsertImageList(selImgNames);
                    if (!flag)
                    {
                        MessageBox.Show("追加图像失败");
                    }
                }
                else
                {
                    MessageBox.Show("未选择图像");
                }
            }
        }
Пример #2
0
        private void buttonAddImage_Click(object sender, RoutedEventArgs e)
        {
            List <string> selImgNames = InnerUtility.OpenFileSelectDialog("插入");

            if (selImgNames != null)
            {
                bool flag = image.AddImageList(selImgNames);
                if (!flag)
                {
                    MessageBox.Show("追加图像失败");
                }
                else
                {
                    ClearImage.IsEnabled = true;
                }
            }
            else
            {
                MessageBox.Show("未选择图像");
            }
        }