Welcome to mirror list, hosted at ThFree Co, Russian Federation.

CompareWindow.cs « gui-compare - github.com/mono/mono-tools.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a7784aba5677e4479931ba175b7b620e89c3c11e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
//
//
// Authors:
//   Chris Toshok
//
using Gtk;
using System;
using System.IO;
using System.Reflection;

using IOPath = System.IO.Path;

public class CompareWindow : Window
{

		
		public CompareWindow ()
			: base ("Mono GuiCompare")
		{
			SetDefaultSize (500, 400);

			vbox = new Gtk.VBox ();
			tree = new Gtk.TreeView ();

			treeStore = new Gtk.TreeStore (typeof (string), typeof (Gdk.Pixbuf), typeof (Gdk.Pixbuf),
						       typeof (Gdk.Pixbuf), typeof (string),
						       typeof (Gdk.Pixbuf), typeof (string),
						       typeof (Gdk.Pixbuf), typeof (string));

			tree.Model = treeStore;

			// Create a column for the node name
			Gtk.TreeViewColumn nameColumn = new Gtk.TreeViewColumn ();
			nameColumn.Title = "Name";
			nameColumn.Resizable = true;

			Gtk.CellRendererText nameCell = new Gtk.CellRendererText ();
			Gtk.CellRendererPixbuf typeCell = new Gtk.CellRendererPixbuf ();
			Gtk.CellRendererPixbuf statusCell = new Gtk.CellRendererPixbuf ();

			nameColumn.PackStart (statusCell, false);
			nameColumn.PackStart (typeCell, false);
			nameColumn.PackStart (nameCell, true);

			tree.AppendColumn (nameColumn);

			nameColumn.AddAttribute (nameCell, "text", 0);
			nameColumn.AddAttribute (typeCell, "pixbuf", 1);
			nameColumn.AddAttribute (statusCell, "pixbuf", 2);

			// Create a column for the status counts
			Gtk.TreeViewColumn countsColumn = new Gtk.TreeViewColumn ();
			countsColumn.Title = "Counts";
			countsColumn.Resizable = true;

			Gtk.CellRendererPixbuf missingPixbufCell = new Gtk.CellRendererPixbuf ();
			Gtk.CellRendererText missingTextCell = new Gtk.CellRendererText ();
			Gtk.CellRendererPixbuf extraPixbufCell = new Gtk.CellRendererPixbuf ();
			Gtk.CellRendererText extraTextCell = new Gtk.CellRendererText ();
			Gtk.CellRendererPixbuf errorPixbufCell = new Gtk.CellRendererPixbuf ();
			Gtk.CellRendererText errorTextCell = new Gtk.CellRendererText ();

			countsColumn.PackStart (missingPixbufCell, false);
			countsColumn.PackStart (missingTextCell, false);
			countsColumn.PackStart (extraPixbufCell, false);
			countsColumn.PackStart (extraTextCell, false);
			countsColumn.PackStart (errorPixbufCell, false);
			countsColumn.PackStart (errorTextCell, false);

			tree.AppendColumn (countsColumn);

			countsColumn.AddAttribute (missingPixbufCell, "pixbuf", 3);
			countsColumn.AddAttribute (missingTextCell, "text", 4);
			countsColumn.AddAttribute (extraPixbufCell, "pixbuf", 5);
			countsColumn.AddAttribute (extraTextCell, "text", 6);
			countsColumn.AddAttribute (errorPixbufCell, "pixbuf", 7);
			countsColumn.AddAttribute (errorTextCell, "text", 8);

			
			scroll = new Gtk.ScrolledWindow ();

			scroll.HscrollbarPolicy = scroll.VscrollbarPolicy = PolicyType.Automatic;
			scroll.Add (tree);

			vbox.PackStart (scroll, true, true, 0);

			status = new Gtk.Statusbar ();

			vbox.PackEnd (status, false, false, 0);

			progressbar = new Gtk.ProgressBar ();

			status.PackEnd (progressbar, false, false, 0);

			Add (vbox);
		}

		string masterinfoDirectory = "./masterinfos";

		public void SetAssemblyPath (string path)
		{
			assemblyPath = path;
			PerformCompare ();
		}


		string assemblyPath;
		CompareContext context;
		Gtk.VBox vbox;
		Gtk.TreeView tree;
		Gtk.TreeStore treeStore;
		Gtk.Statusbar status;
		Gtk.ScrolledWindow scroll;
		Gtk.ProgressBar progressbar;
	}
}