Ejemplo n.º 1
0
        protected virtual void OnDetailsButtonClicked(object sender, System.EventArgs e)
        {
            Gtk.TreeIter iter;
            Gtk.Widget   active_tab = notebook1.Children [notebook1.Page];
            string       tab_label  = notebook1.GetTabLabelText(active_tab);
            string       name       = string.Empty;
            // string version = string.Empty;
            ProjectPackage package = null;

            if (tab_label == "System Packages")
            {
                normalPackageTreeView.Selection.GetSelected(out iter);
                name = (string)normalPackageListStore.GetValue(iter, NormalPackageNameID);
                // version = (string)normalPackageListStore.GetValue (iter, NormalPackageVersionID);
            }
            else if (tab_label == "Project Packages")
            {
                projectPackageTreeView.Selection.GetSelected(out iter);
                name = (string)projectPackageListStore.GetValue(iter, ProjectPackageNameID);
                // version = (string)projectPackageListStore.GetValue (iter, ProjectPackageVersionID);
            }
            else
            {
                return;
            }

            foreach (ProjectPackage p in packages)
            {
                if (p.Name == name /* && p.Version == version */)
                {
                    package = p;
                    break;
                }
            }

            if (package == null)
            {
                return;
            }

            PackageDetails details = new PackageDetails(package);

            details.Modal = true;
            details.Show();
        }
Ejemplo n.º 2
0
		protected virtual void OnDetailsButtonClicked (object sender, System.EventArgs e)
		{
			Gtk.TreeIter iter;
			Gtk.Widget active_tab = notebook1.Children [notebook1.Page];
			string tab_label = notebook1.GetTabLabelText (active_tab);
			string name = string.Empty;
			// string version = string.Empty;
			ProjectPackage package = null;
			
			if (tab_label == "System Packages") {
				normalPackageTreeView.Selection.GetSelected (out iter);
				name = (string)normalPackageListStore.GetValue (iter, NormalPackageNameID);
				// version = (string)normalPackageListStore.GetValue (iter, NormalPackageVersionID);
			} else if (tab_label == "Project Packages") {
				projectPackageTreeView.Selection.GetSelected (out iter);
				name = (string)projectPackageListStore.GetValue (iter, ProjectPackageNameID);
				// version = (string)projectPackageListStore.GetValue (iter, ProjectPackageVersionID);
			} else {
				return;
			}
			
			foreach (ProjectPackage p in packages) {
				if (p.Name == name /* && p.Version == version */) {
					package = p;
					break;
				}
			}
			
			if (package == null)
				return;
			
			PackageDetails details = new PackageDetails (package);
			details.Modal = true;
			details.Show ();
		}