コード例 #1
0
        public AssemblyReferencePanel(SelectReferenceDialog selectDialog)
        {
            this.selectDialog = selectDialog;

            chooser = new FileChooserWidget(FileChooserAction.Open, "");
            chooser.SetCurrentFolder(Environment.GetFolderPath(Environment.SpecialFolder.Personal));
            chooser.SelectMultiple = true;

            // this should only allow dll's and exe's
            FileFilter filter = new FileFilter();

            filter.Name = GettextCatalog.GetString("Assemblies");
            filter.AddPattern("*.[Dd][Ll][Ll]");
            filter.AddPattern("*.[Ee][Xx][Ee]");
            chooser.AddFilter(filter);
            chooser.FileActivated += new EventHandler(SelectReferenceDialog);

            PackStart(chooser, true, true, 0);

            PackStart(new Gtk.VSeparator(), false, false, 0);

            VBox box = new VBox();

            Gtk.Button addButton = new Gtk.Button(Gtk.Stock.Add);
            addButton.Clicked += new EventHandler(SelectReferenceDialog);
            box.PackStart(addButton, false, false, 0);
            PackStart(box, false, false, 0);

            BorderWidth = 6;
            Spacing     = 6;
            ShowAll();
        }
コード例 #2
0
		public AssemblyReferencePanel (SelectReferenceDialog selectDialog)
		{
			this.selectDialog = selectDialog;
			
			chooser = new FileChooserWidget (FileChooserAction.Open, "");
			chooser.SetCurrentFolder (Environment.GetFolderPath (Environment.SpecialFolder.Personal));
			chooser.SelectMultiple = true;

			// this should only allow dll's and exe's
			FileFilter filter = new FileFilter ();
			filter.Name = GettextCatalog.GetString ("Assemblies");
			filter.AddPattern ("*.[Dd][Ll][Ll]");
			filter.AddPattern ("*.[Ee][Xx][Ee]");
			chooser.AddFilter (filter);
			chooser.FileActivated += new EventHandler (SelectReferenceDialog);

			PackStart (chooser, true, true, 0);
			
			PackStart (new Gtk.VSeparator(), false, false, 0);
			
			VBox box = new VBox ();
			Gtk.Button addButton = new Gtk.Button (Gtk.Stock.Add);
			addButton.Clicked += new EventHandler(SelectReferenceDialog);
			box.PackStart (addButton, false, false, 0);
			PackStart (box, false, false, 0);
			
			BorderWidth = 6;
			Spacing = 6;
			ShowAll();
		}
コード例 #3
0
        public AssemblyReferencePanel(SelectReferenceDialog selectDialog)
        {
            Spacing           = 6;
            this.selectDialog = selectDialog;

            store    = new ListStore(typeof(string), typeof(string), typeof(AssemblyInfo), typeof(bool), typeof(string), typeof(IconId), typeof(int));
            treeView = new TreeView(store);

            TreeViewColumn     firstColumn = new TreeViewColumn();
            CellRendererToggle tog_render  = new CellRendererToggle();

            tog_render.Toggled += AddReference;
            firstColumn.PackStart(tog_render, false);
            firstColumn.AddAttribute(tog_render, "active", ColSelected);

            treeView.AppendColumn(firstColumn);

            TreeViewColumn secondColumn = new TreeViewColumn();

            secondColumn.Title = GettextCatalog.GetString("Assembly");
            CellRendererImage crp = new CellRendererImage();

            secondColumn.PackStart(crp, false);
            secondColumn.AddAttribute(crp, "icon-id", ColIcon);

            CellRendererText text_render = new CellRendererText();

            secondColumn.PackStart(text_render, true);
            secondColumn.AddAttribute(text_render, "markup", ColName);

            treeView.AppendColumn(secondColumn);

            treeView.AppendColumn(GettextCatalog.GetString("Version"), new CellRendererText(), "markup", ColVersion);
            treeView.AppendColumn(GettextCatalog.GetString("Path"), new CellRendererText(), "text", ColPath);

            treeView.Columns[1].Resizable = true;

            store.SetSortColumnId(0, SortType.Ascending);
            store.SetSortFunc(0, new TreeIterCompareFunc(Sort));

            ScrolledWindow sc = new ScrolledWindow();

            sc.ShadowType = Gtk.ShadowType.In;
            sc.Add(treeView);
            PackStart(sc, true, true, 0);

            var but = new Gtk.Button(GettextCatalog.GetString("Browse..."));

            but.Clicked += HandleClicked;
            var hbox = new Gtk.HBox();

            hbox.PackEnd(but, false, false, 0);
            PackStart(hbox, false, false, 0);

            ShowAll();
            BorderWidth = 6;
        }
コード例 #4
0
		public AssemblyReferencePanel (SelectReferenceDialog selectDialog)
		{
			Spacing = 6;
			this.selectDialog = selectDialog;

			store = new ListStore (typeof (string), typeof (string), typeof (AssemblyInfo), typeof (bool), typeof (string), typeof(IconId), typeof(int));
			treeView = new TreeView (store);

			TreeViewColumn firstColumn = new TreeViewColumn ();
			CellRendererToggle tog_render = new CellRendererToggle ();
			tog_render.Toggled += AddReference;
			firstColumn.PackStart (tog_render, false);
			firstColumn.AddAttribute (tog_render, "active", ColSelected);

			treeView.AppendColumn (firstColumn);

			TreeViewColumn secondColumn = new TreeViewColumn ();
			secondColumn.Title = GettextCatalog.GetString ("Assembly");
			CellRendererImage crp = new CellRendererImage ();
			secondColumn.PackStart (crp, false);
			secondColumn.AddAttribute (crp, "icon-id", ColIcon);

			CellRendererText text_render = new CellRendererText ();
			secondColumn.PackStart (text_render, true);
			secondColumn.AddAttribute (text_render, "markup", ColName);

			treeView.AppendColumn (secondColumn);

			treeView.AppendColumn (GettextCatalog.GetString ("Version"), new CellRendererText (), "markup", ColVersion);
			treeView.AppendColumn (GettextCatalog.GetString ("Path"), new CellRendererText (), "text", ColPath);

			treeView.Columns[1].Resizable = true;

			store.SetSortColumnId (0, SortType.Ascending);
			store.SetSortFunc (0, new TreeIterCompareFunc (Sort));

			ScrolledWindow sc = new ScrolledWindow ();
			sc.ShadowType = Gtk.ShadowType.In;
			sc.Add (treeView);
			PackStart (sc, true, true, 0);

			var but = new Gtk.Button (GettextCatalog.GetString ("Browse..."));
			but.Clicked += HandleClicked;
			var hbox = new Gtk.HBox ();
			hbox.PackEnd (but, false, false, 0);
			PackStart (hbox, false, false, 0);

			ShowAll ();
			BorderWidth = 6;
		}
コード例 #5
0
        public PackageReferencePanel(SelectReferenceDialog selectDialog, bool showAll)
        {
            this.selectDialog = selectDialog;
            this.showAll      = showAll;

            store    = new ListStore(typeof(string), typeof(string), typeof(SystemAssembly), typeof(bool), typeof(string), typeof(string), typeof(IconId), typeof(int), typeof(ReferenceType));
            treeView = new TreeView(store);

            TreeViewColumn     firstColumn = new TreeViewColumn();
            CellRendererToggle tog_render  = new CellRendererToggle();

            tog_render.Toggled += new Gtk.ToggledHandler(AddReference);
            firstColumn.PackStart(tog_render, false);
            firstColumn.AddAttribute(tog_render, "active", ColSelected);

            treeView.AppendColumn(firstColumn);

            TreeViewColumn secondColumn = new TreeViewColumn();

            secondColumn.Title = GettextCatalog.GetString("Assembly");
            CellRendererImage crp = new CellRendererImage();

            secondColumn.PackStart(crp, false);
            secondColumn.AddAttribute(crp, "icon-id", ColIcon);

            CellRendererText text_render = new CellRendererText();

            secondColumn.PackStart(text_render, true);
            secondColumn.AddAttribute(text_render, "markup", ColName);

            treeView.AppendColumn(secondColumn);

            treeView.AppendColumn(GettextCatalog.GetString("Version"), new CellRendererText(), "markup", ColVersion);
            treeView.AppendColumn(GettextCatalog.GetString("Package"), new CellRendererText(), "text", ColPackage);

            treeView.Columns[1].Resizable = true;

            store.SetSortColumnId(0, SortType.Ascending);
            store.SetSortFunc(0, new TreeIterCompareFunc(Sort));

            ScrolledWindow sc = new ScrolledWindow();

            sc.ShadowType = Gtk.ShadowType.In;
            sc.Add(treeView);
            this.PackStart(sc, true, true, 0);
            ShowAll();
            BorderWidth = 6;
        }
コード例 #6
0
        public GacReferencePanel(SelectReferenceDialog selectDialog)
        {
            this.selectDialog = selectDialog;

            store    = new ListStore(typeof(string), typeof(string), typeof(SystemAssembly), typeof(bool), typeof(string), typeof(string));
            treeView = new TreeView(store);

            TreeViewColumn     firstColumn = new TreeViewColumn();
            CellRendererToggle tog_render  = new CellRendererToggle();

            tog_render.Toggled += new Gtk.ToggledHandler(AddReference);
            firstColumn.PackStart(tog_render, false);
            firstColumn.AddAttribute(tog_render, "active", 3);

            treeView.AppendColumn(firstColumn);

            TreeViewColumn secondColumn = new TreeViewColumn();

            secondColumn.Title = GettextCatalog.GetString("Assembly");
            CellRendererPixbuf crp = new CellRendererPixbuf();

            secondColumn.PackStart(crp, false);
            crp.StockId = "md-package";

            CellRendererText text_render = new CellRendererText();

            secondColumn.PackStart(text_render, true);
            secondColumn.AddAttribute(text_render, "text", 0);

            treeView.AppendColumn(secondColumn);

            treeView.AppendColumn(GettextCatalog.GetString("Version"), new CellRendererText(), "text", 1);
            treeView.AppendColumn(GettextCatalog.GetString("Package"), new CellRendererText(), "text", 5);

            treeView.Columns[1].Resizable = true;

            store.SetSortColumnId(0, SortType.Ascending);
            store.SetSortFunc(0, new TreeIterCompareFunc(Sort));

            ScrolledWindow sc = new ScrolledWindow();

            sc.ShadowType = Gtk.ShadowType.In;
            sc.Add(treeView);
            this.PackStart(sc, true, true, 0);
            ShowAll();
            BorderWidth = 6;
        }
コード例 #7
0
        public ProjectReferencePanel(SelectReferenceDialog selectDialog) : base(false, 6)
        {
            this.selectDialog = selectDialog;

            store = new ListStore(typeof(string), typeof(string), typeof(Project), typeof(bool), typeof(Xwt.Drawing.Image), typeof(bool), typeof(string));
            store.SetSortFunc(0, CompareNodes);
            treeView = new TreeView(store);

            TreeViewColumn firstColumn  = new TreeViewColumn();
            TreeViewColumn secondColumn = new TreeViewColumn();

            CellRendererToggle tog_render = new CellRendererToggle();

            tog_render.Xalign   = 0;
            tog_render.Toggled += new Gtk.ToggledHandler(AddReference);
            firstColumn.PackStart(tog_render, false);
            firstColumn.AddAttribute(tog_render, "active", ColSelected);
            firstColumn.AddAttribute(tog_render, "visible", ColVisible);

            secondColumn.Title = GettextCatalog.GetString("Project");
            CellRendererImage pix_render = new CellRendererImage();

            secondColumn.PackStart(pix_render, false);
            secondColumn.AddAttribute(pix_render, "image", ColPixbuf);

            CellRendererText text_render = new CellRendererText();

            secondColumn.PackStart(text_render, true);
            secondColumn.AddAttribute(text_render, "markup", ColName);
            secondColumn.AddAttribute(text_render, "foreground", ColColor);

            treeView.AppendColumn(firstColumn);
            treeView.AppendColumn(secondColumn);
            treeView.AppendColumn(GettextCatalog.GetString("Directory"), new CellRendererText(), "markup", ColPath);

            ScrolledWindow sc = new ScrolledWindow();

            sc.ShadowType = Gtk.ShadowType.In;
            sc.Add(treeView);
            PackStart(sc, true, true, 0);

            store.SetSortColumnId(0, SortType.Ascending);
            ShowAll();

            BorderWidth = 6;
        }
コード例 #8
0
        public PackageReferencePanel (SelectReferenceDialog selectDialog, bool showAll)
        {
            this.selectDialog = selectDialog;
			this.showAll = showAll;
			
            store = new ListStore (typeof (string), typeof (string), typeof (SystemAssembly), typeof (bool), typeof (string), typeof (string), typeof(IconId), typeof(int), typeof(ReferenceType));
            treeView = new TreeView (store);

            TreeViewColumn firstColumn = new TreeViewColumn ();
            CellRendererToggle tog_render = new CellRendererToggle ();
            tog_render.Toggled += new Gtk.ToggledHandler (AddReference);
            firstColumn.PackStart (tog_render, false);
            firstColumn.AddAttribute (tog_render, "active", ColSelected);

            treeView.AppendColumn (firstColumn);

            TreeViewColumn secondColumn = new TreeViewColumn ();
            secondColumn.Title = GettextCatalog.GetString ("Assembly");
            CellRendererIcon crp = new CellRendererIcon ();
            secondColumn.PackStart (crp, false);
            secondColumn.AddAttribute (crp, "icon-id", ColIcon);

            CellRendererText text_render = new CellRendererText ();
            secondColumn.PackStart (text_render, true);
            secondColumn.AddAttribute (text_render, "markup", ColName);

            treeView.AppendColumn (secondColumn);

            treeView.AppendColumn (GettextCatalog.GetString ("Version"), new CellRendererText (), "markup", ColVersion);
            treeView.AppendColumn (GettextCatalog.GetString ("Package"), new CellRendererText (), "text", ColPackage);

            treeView.Columns[1].Resizable = true;

            store.SetSortColumnId (0, SortType.Ascending);
            store.SetSortFunc (0, new TreeIterCompareFunc (Sort));

            ScrolledWindow sc = new ScrolledWindow ();
            sc.ShadowType = Gtk.ShadowType.In;
            sc.Add (treeView);
            this.PackStart (sc, true, true, 0);
            ShowAll ();
            BorderWidth = 6;
        }
コード例 #9
0
        public AssemblyReferencePanel(SelectReferenceDialog selectDialog)
        {
            this.selectDialog = selectDialog;

            chooser = new FileChooserWidget(FileChooserAction.Open, "");
            chooser.SetCurrentFolder(Environment.GetFolderPath(Environment.SpecialFolder.Personal));
            chooser.SelectMultiple = true;

            // this should only allow dll's and exe's
            FileFilter filter = new FileFilter();

            filter.Name = GettextCatalog.GetString("Assemblies");
            filter.AddPattern("*.[Dd][Ll][Ll]");
            filter.AddPattern("*.[Ee][Xx][Ee]");
            chooser.AddFilter(filter);
            chooser.FileActivated    += new EventHandler(SelectReferenceDialog);
            chooser.SelectionChanged += HandleChooserSelectionChanged;
            chooser.BorderWidth       = 6;

            PackStart(chooser, true, true, 0);

            HeaderBox hbox = new HeaderBox(1, 0, 0, 0);

            hbox.GradientBackground = true;
            hbox.SetPadding(6, 6, 6, 6);

            HBox box = new HBox();

            detailsLabel           = new Label();
            detailsLabel.Xalign    = 0;
            detailsLabel.Ellipsize = Pango.EllipsizeMode.End;
            box.PackStart(detailsLabel, true, true, 0);
            addButton = new Gtk.Button(Gtk.Stock.Add);
            box.PackEnd(addButton, false, false, 0);
            hbox.Add(box);
            PackStart(hbox, false, false, 0);

            addButton.Clicked += SelectReferenceDialog;

            Spacing = 6;
            ShowAll();
        }
コード例 #10
0
		public ProjectReferencePanel (SelectReferenceDialog selectDialog) : base (false, 6)
		{
			this.selectDialog = selectDialog;
			
			store = new ListStore (typeof (string), typeof (string), typeof(Project), typeof(bool), typeof(Gdk.Pixbuf), typeof(bool), typeof(string));
			store.SetSortFunc (0, CompareNodes);
			treeView = new TreeView (store);
			
			TreeViewColumn firstColumn = new TreeViewColumn ();
			TreeViewColumn secondColumn = new TreeViewColumn ();
			
			CellRendererToggle tog_render = new CellRendererToggle ();
			tog_render.Xalign = 0;
			tog_render.Toggled += new Gtk.ToggledHandler (AddReference);
			firstColumn.PackStart (tog_render, false);
			firstColumn.AddAttribute (tog_render, "active", 3);
			firstColumn.AddAttribute (tog_render, "visible", 5);

			secondColumn.Title = GettextCatalog.GetString ("Project");
			Gtk.CellRendererPixbuf pix_render = new Gtk.CellRendererPixbuf ();
			secondColumn.PackStart (pix_render, false);
			secondColumn.AddAttribute (pix_render, "pixbuf", 4);
			
			CellRendererText text_render = new CellRendererText ();
			secondColumn.PackStart (text_render, true);
			secondColumn.AddAttribute (text_render, "text", 0);
			secondColumn.AddAttribute (text_render, "foreground", 6);
			
			treeView.AppendColumn (firstColumn);
			treeView.AppendColumn (secondColumn);
			treeView.AppendColumn (GettextCatalog.GetString ("Directory"), new CellRendererText (), "markup", 1);
			
			ScrolledWindow sc = new ScrolledWindow ();
			sc.ShadowType = Gtk.ShadowType.In;
			sc.Add (treeView);
			PackStart (sc, true, true, 0);
			
			store.SetSortColumnId (0, SortType.Ascending);
			ShowAll ();
			
			BorderWidth = 6;
		}
コード例 #11
0
        public GacReferencePanel (SelectReferenceDialog selectDialog)
        {
            this.selectDialog = selectDialog;

            store = new ListStore (typeof (string), typeof (string), typeof (SystemAssembly), typeof (bool), typeof (string), typeof (string));
            treeView = new TreeView (store);

            TreeViewColumn firstColumn = new TreeViewColumn ();
            CellRendererToggle tog_render = new CellRendererToggle ();
            tog_render.Toggled += new Gtk.ToggledHandler (AddReference);
            firstColumn.PackStart (tog_render, false);
            firstColumn.AddAttribute (tog_render, "active", 3);

            treeView.AppendColumn (firstColumn);

            TreeViewColumn secondColumn = new TreeViewColumn ();
            secondColumn.Title = GettextCatalog.GetString ("Assembly");
            CellRendererPixbuf crp = new CellRendererPixbuf ();
            secondColumn.PackStart (crp, false);
            crp.StockId = "md-package";

            CellRendererText text_render = new CellRendererText ();
            secondColumn.PackStart (text_render, true);
            secondColumn.AddAttribute (text_render, "text", 0);

            treeView.AppendColumn (secondColumn);

            treeView.AppendColumn (GettextCatalog.GetString ("Version"), new CellRendererText (), "text", 1);
            treeView.AppendColumn (GettextCatalog.GetString ("Package"), new CellRendererText (), "text", 5);

            treeView.Columns[1].Resizable = true;

            store.SetSortColumnId (0, SortType.Ascending);
            store.SetSortFunc (0, new TreeIterCompareFunc (Sort));

            ScrolledWindow sc = new ScrolledWindow ();
            sc.ShadowType = Gtk.ShadowType.In;
            sc.Add (treeView);
            this.PackStart (sc, true, true, 0);
            ShowAll ();
            BorderWidth = 6;
        }
コード例 #12
0
        public AssemblyReferencePanel(SelectReferenceDialog selectDialog)
        {
            this.selectDialog = selectDialog;

            chooser = new FileChooserWidget (FileChooserAction.Open, "");
            chooser.SetCurrentFolder (Environment.GetFolderPath (Environment.SpecialFolder.Personal));
            chooser.SelectMultiple = true;

            // this should only allow dll's and exe's
            FileFilter filter = new FileFilter ();
            filter.Name = GettextCatalog.GetString ("Assemblies");
            filter.AddPattern ("*.[Dd][Ll][Ll]");
            filter.AddPattern ("*.[Ee][Xx][Ee]");
            chooser.AddFilter (filter);
            chooser.FileActivated += new EventHandler (SelectReferenceDialog);
            chooser.SelectionChanged += HandleChooserSelectionChanged;
            chooser.BorderWidth = 6;

            PackStart (chooser, true, true, 0);

            HeaderBox hbox = new HeaderBox (1, 0, 0, 0);
            hbox.GradientBackground = true;
            hbox.SetPadding (6,6,6,6);

            HBox box = new HBox ();
            detailsLabel = new Label ();
            detailsLabel.Xalign = 0;
            detailsLabel.Ellipsize = Pango.EllipsizeMode.End;
            box.PackStart (detailsLabel, true, true, 0);
            addButton = new Gtk.Button (Gtk.Stock.Add);
            box.PackEnd (addButton, false, false, 0);
            hbox.Add (box);
            PackStart (hbox, false, false, 0);

            addButton.Clicked += SelectReferenceDialog;

            Spacing = 6;
            ShowAll();
        }
コード例 #13
0
		public bool AddReferenceToProject (DotNetProject project)
		{
			try {
				if (selDialog == null)
					selDialog = new SelectReferenceDialog ();
				
				selDialog.SetProject (project);

				if (MessageService.RunCustomDialog (selDialog) == (int)Gtk.ResponseType.Ok) {
					var newRefs = selDialog.ReferenceInformations;
					
					ArrayList toDelete = new ArrayList ();
					foreach (ProjectReference refInfo in project.References)
						if (!newRefs.Contains (refInfo))
							toDelete.Add (refInfo);
					
					foreach (ProjectReference refInfo in toDelete)
							project.References.Remove (refInfo);

					foreach (ProjectReference refInfo in selDialog.ReferenceInformations)
						if (!project.References.Contains (refInfo))
							project.References.Add(refInfo);
					
					return true;
				}
				else
					return false;
			} finally {
				selDialog.Hide ();
			}
		}
コード例 #14
0
		public bool AddReferenceToProject (DotNetProject project)
		{
			try {
				if (selDialog == null) {
					selDialog = new SelectReferenceDialog ();
					selDialog.TransientFor = MessageService.RootWindow;
				}
				
				selDialog.SetProject (project);

				if (MessageService.RunCustomDialog (selDialog) == (int)Gtk.ResponseType.Ok) {
					var newRefs = selDialog.ReferenceInformations;
					
					var editEventArgs = new EditReferencesEventArgs (project);
					foreach (var refInfo in project.References)
						if (!newRefs.Contains (refInfo))
							editEventArgs.ReferencesToRemove.Add (refInfo);

					foreach (var refInfo in selDialog.ReferenceInformations)
						if (!project.References.Contains (refInfo))
							editEventArgs.ReferencesToAdd.Add(refInfo);

					if (BeforeEditReferences != null)
						BeforeEditReferences (this, editEventArgs);

					foreach (var reference in editEventArgs.ReferencesToRemove)
						project.References.Remove (reference);

					foreach (var reference in editEventArgs.ReferencesToAdd)
						project.References.Add (reference);

					return editEventArgs.ReferencesToAdd.Count > 0 || editEventArgs.ReferencesToRemove.Count > 0;
				}
				else
					return false;
			} finally {
				selDialog.Hide ();
			}
		}
コード例 #15
0
		public bool SelectProjectReferences (ProjectReferenceCollection references, AssemblyContext ctx, TargetFramework targetVersion)
		{
			try {
				if (selDialog == null)
					selDialog = new SelectReferenceDialog ();
				
				selDialog.SetReferenceCollection (references, ctx, targetVersion);

				if (MessageService.RunCustomDialog (selDialog) == (int)Gtk.ResponseType.Ok) {
					references.Clear ();
					references.AddRange (selDialog.ReferenceInformations);
					return true;
				}
				else
					return false;
			} finally {
				if (selDialog != null)
					selDialog.Hide ();
			}
		}