diff --git a/VisualBundle/ItemModel.cs b/VisualBundle/ItemModel.cs
index 30f6fde..a456636 100644
--- a/VisualBundle/ItemModel.cs
+++ b/VisualBundle/ItemModel.cs
@@ -48,12 +48,11 @@ public ItemModel GetChildItem(string Name)
}
public class FolderModel : ItemModel
{
- private static ImageSource _icon = Properties.Resources.dir;
override public ImageSource Icon
{
get
{
- return _icon;
+ return Properties.Resources.dir;
}
}
public FolderModel() : base()
@@ -67,12 +66,11 @@ public FolderModel(string name) : this()
}
public class FileModel : ItemModel
{
- private static ImageSource _icon = Properties.Resources.file;
override public ImageSource Icon
{
get
{
- return _icon;
+ return Properties.Resources.file;
}
}
public FileModel()
diff --git a/VisualBundle/MainWindow.xaml b/VisualBundle/MainWindow.xaml
index 9219b54..33e24b1 100644
--- a/VisualBundle/MainWindow.xaml
+++ b/VisualBundle/MainWindow.xaml
@@ -11,27 +11,27 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/VisualBundle/MainWindow.xaml.cs b/VisualBundle/MainWindow.xaml.cs
index 2889145..9863b62 100644
--- a/VisualBundle/MainWindow.xaml.cs
+++ b/VisualBundle/MainWindow.xaml.cs
@@ -7,9 +7,7 @@
using System.IO;
using System.Linq;
using System.Windows;
-using System.Windows.Controls;
using System.Windows.Media;
-using System.Windows.Media.Imaging;
namespace VisualBundle
{
@@ -18,7 +16,7 @@ public partial class MainWindow : Window
public IndexContainer ic;
private FileRecord moveF;
private ItemModel moveD;
- private HashSet changed = new HashSet();
+ private readonly HashSet changed = new HashSet();
public MainWindow()
{
@@ -92,20 +90,6 @@ private void OnLoaded(object sender, RoutedEventArgs e)
ButtonReplaceAll.IsEnabled = true;
}
- private void OnTreeViewItemExpanded(object sender, RoutedEventArgs e)
- {
- // handle auto now
- // no need anymore
- /*
- var tvi = e.OriginalSource as ItemModel;
- if (tvi.Items != null)
- {
- tvi.Items.Clear();
- foreach(var c in ((Dictionary)tvi.Tag).Values)
- tvi.Items.Add(c);
- }
- */
- }
private ItemModel GetSelectedBundle()
{
return (ItemModel)View1.SelectedItem;
@@ -177,17 +161,9 @@ private void OnTreeView2SelectedChanged(object sender, RoutedPropertyChangedEven
}
- public StackPanel TreeItem(string path, ImageSource icon)
- {
- var sp = new StackPanel { Orientation = Orientation.Horizontal };
- sp.Children.Add(new Image { Source = icon, Width = 20, Height = 20 });
- sp.Children.Add(new TextBlock { Text = path, FontSize = 16 });
- return sp;
- }
-
public void BuildTree(ItemModel root, string path, object file)
{
- if (path == null) { return; }
+ if (path == null) return;
var paths = path.Split('/');
ItemModel parent = root;
@@ -446,9 +422,10 @@ private void ButtonReplaceAllClick(object sender, RoutedEventArgs e)
if (fbd.ShowDialog() == true)
{
if (MessageBox.Show(
- "This function will replace all files to every loaded bundles" + Environment.NewLine
+ "This will replace all files to every loaded bundles." + Environment.NewLine
+ + "And bundles which weren't loaded won't be changed." + Environment.NewLine
+ "Are you sure you want to do this?",
- "Replace all files to every loaded bundles",
+ "Replace All Confirm",
MessageBoxButton.OKCancel, MessageBoxImage.Warning, MessageBoxResult.Cancel) == MessageBoxResult.OK)
{
var Bundle2_path = Path.GetDirectoryName(fbd.FileName);
@@ -507,7 +484,7 @@ private HashSet GetLoadedBundleRecordAll()
return bundles;
}
- private Microsoft.Win32.OpenFileDialog OpenBundle2Dialog()
+ private OpenFileDialog OpenBundle2Dialog()
{
var ofd = new OpenFileDialog()
{