Example #1
0
        public NUnitOptionsWidget(Properties customizationObject)
        {
            Build();
            test    = ((Properties)customizationObject).Get <UnitTest> ("UnitTest");
            config  = ((Properties)customizationObject).Get <string> ("Config");
            options = localOptions = (NUnitCategoryOptions)test.GetOptions(typeof(NUnitCategoryOptions), config);

            store = new TreeStore(typeof(string));
            categoryTree.Model          = store;
            categoryTree.HeadersVisible = false;

            CellRendererText tr = new CellRendererText();

            tr.Editable      = true;
            tr.Edited       += new EditedHandler(OnCategoryEdited);
            textColumn       = new TreeViewColumn();
            textColumn.Title = GettextCatalog.GetString("Category");
            textColumn.PackStart(tr, false);
            textColumn.AddAttribute(tr, "text", 0);
            textColumn.Expand = true;
            categoryTree.AppendColumn(textColumn);

            if (test.Parent != null)
            {
                useParentCheck.Active = !test.HasOptions(typeof(NUnitCategoryOptions), config);
            }
            else
            {
                useParentCheck.Active    = false;
                useParentCheck.Sensitive = false;
            }

            if (!options.EnableFilter)
            {
                noFilterRadio.Active = true;
            }
            else if (options.Exclude)
            {
                excludeRadio.Active = true;
            }
            else
            {
                includeRadio.Active = true;
            }

            Fill();

            noFilterRadio.Toggled  += new EventHandler(OnFilterToggled);
            includeRadio.Toggled   += new EventHandler(OnFilterToggled);
            excludeRadio.Toggled   += new EventHandler(OnFilterToggled);
            useParentCheck.Toggled += new EventHandler(OnToggledUseParent);
            addButton.Clicked      += new EventHandler(OnAddCategory);
            removeButton.Clicked   += new EventHandler(OnRemoveCategory);
        }
		public NUnitOptionsWidget (Properties customizationObject)
		{
			Build ();
			test =  ((Properties)customizationObject).Get<UnitTest> ("UnitTest");
			config =  ((Properties)customizationObject).Get<string> ("Config");
			options = localOptions = (NUnitCategoryOptions) test.GetOptions (typeof(NUnitCategoryOptions), config);
			
			store = new TreeStore (typeof(string));
			categoryTree.Model = store;
			categoryTree.HeadersVisible = false;
			
			CellRendererText tr = new CellRendererText ();
			tr.Editable = true;
			tr.Edited += new EditedHandler (OnCategoryEdited);
			textColumn = new TreeViewColumn ();
			textColumn.Title = GettextCatalog.GetString ("Category");
			textColumn.PackStart (tr, false);
			textColumn.AddAttribute (tr, "text", 0);
			textColumn.Expand = true;
			categoryTree.AppendColumn (textColumn);
			
			if (test.Parent != null)
				useParentCheck.Active = !test.HasOptions (typeof(NUnitCategoryOptions), config);
			else {
				useParentCheck.Active = false;
				useParentCheck.Sensitive = false;
			}
			
			if (!options.EnableFilter)
				noFilterRadio.Active = true;
			else if (options.Exclude)
				excludeRadio.Active = true;
			else
				includeRadio.Active = true;

			Fill ();
			
			noFilterRadio.Toggled += new EventHandler (OnFilterToggled);
			includeRadio.Toggled += new EventHandler (OnFilterToggled);
			excludeRadio.Toggled += new EventHandler (OnFilterToggled);
			useParentCheck.Toggled += new EventHandler (OnToggledUseParent);
			addButton.Clicked += new EventHandler (OnAddCategory);
			removeButton.Clicked += new EventHandler (OnRemoveCategory);
		}