コード例 #1
0
        private void Image_PreviewMouseUp(object sender, MouseButtonEventArgs e)
        {
            Image          img = (sender as Image);
            GoodsViewModel gu  = img.Tag as GoodsViewModel;

            if (e.LeftButton == MouseButtonState.Released && e.ChangedButton == MouseButton.Left)
            {
                EditGoodsCommentAndFlag(gu);
            }
            e.Handled = true;
        }
コード例 #2
0
        private void EditGoodsCommentAndFlag(GoodsViewModel goods)
        {
            var win = new GoodsCommentEditWindow {
                Flag = goods.Flag, Comment = goods.Comment
            };

            if (win.ShowDialog().Value == false)
            {
                return;
            }
            goods.Source.Flag    = win.Flag;
            goods.Source.Comment = win.Comment;
            ServiceContainer.GetService <GoodsService>().Update(goods.Source);
            goods.Flag    = win.Flag;
            goods.Comment = win.Comment;
        }
コード例 #3
0
        private void OpenImageDir(GoodsViewModel goodsViewModel)
        {
            if (string.IsNullOrWhiteSpace(goodsViewModel.Source.ImageDir))
            {
                return;
            }
            string dir = LocalConfigService.GetValue(SystemNames.CONFIG_WEB_IMAGE_DIR) + "\\" + goodsViewModel.Source.ImageDir.Trim();

            if (System.IO.Directory.Exists(dir) == false)
            {
                throw new Exception("文件夹不存在或者被删除:" + dir);
            }

            if (Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl) || Keyboard.IsKeyDown(Key.LeftAlt) || Keyboard.IsKeyDown(Key.RightAlt))
            {
                if (Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl))
                {
                    var d = System.IO.Path.Combine(dir, "PT");
                    if (System.IO.Directory.Exists(d) == false)
                    {
                        MessageBox.Show("文件夹不存在或者被删除:" + d);
                    }
                    else
                    {
                        Process.Start(d);
                    }
                }
                if (Keyboard.IsKeyDown(Key.LeftAlt) || Keyboard.IsKeyDown(Key.RightAlt))
                {
                    var d = System.IO.Path.Combine(dir, "YT");
                    if (System.IO.Directory.Exists(d) == false)
                    {
                        MessageBox.Show("文件夹不存在或者被删除:" + d);
                    }
                    else
                    {
                        Process.Start(d);
                    }
                }
            }
            else
            {
                Process.Start(dir);
            }
        }