Пример #1
0
	public MainForm ()
	{
		// 
		// _tree
		// 
		_tree = new TreeView ();
		_tree.Dock = DockStyle.Top;
		_tree.Height = 100;
		Controls.Add (_tree);
		// 
		// _refreshButton
		// 
		_refreshButton = new Button ();
		_refreshButton.Location = new Point (8, 110);
		_refreshButton.Text = "Refresh";
		_refreshButton.Click += new EventHandler (RefreshButton_Click);
		Controls.Add (_refreshButton);
		// 
		// _visibleText
		// 
		_visibleText = new TextBox ();
		_visibleText.Dock = DockStyle.Bottom;
		_visibleText.Height = 200;
		_visibleText.Multiline = true;
		_visibleText.ScrollBars = ScrollBars.Vertical;
		Controls.Add (_visibleText);
		// 
		// MainForm
		// 
		ClientSize = new Size (400, 350);
		Location = new Point (250, 100);
		StartPosition = FormStartPosition.Manual;
		Text = "bug #81422";
		Load += new EventHandler (MainForm_Load);
	}
Пример #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        #region Initialize Values
        Page mainPage = this.Page;
        myTree = (TreeView)mainPage.FindControl("TreeView1");
        NodeSelected = myTree.SelectedNode;

        btnSubmit.Text = CareerCruisingWeb.CCLib.Common.Strings.TextCode(11202);

        if (NodeSelected == null)
            return;

        if (NodeSelected.ToolTip == "Degree Requirement")
        {
            this.Visible = true;
            lblTitle.Text = NodeSelected.Text;
            strDegreeReqID = NodeSelected.Value;
            strDegreeID = NodeSelected.Parent.Value;
            strSchoolID = ((CareerCruisingWeb.PageBase.SuperBase)Page).SchoolID;
            HiddenField strLastNode = (HiddenField)mainPage.FindControl("hdnLastNode");

            if (strLastNode.Value != "DRID" + strDegreeReqID)
            {
                blFirstLoad = true;
                strLastNode.Value = "DRID" + strDegreeReqID;
            }
        }

        #endregion Initialize Values
    }
Пример #3
0
        // Load hierarchical data from XML and display it in a TreeListControl
        void LoadHierarchicalXmlData()
        {
 
            var treeListControl = new TreeListControl();
      
            treeListControl.Dock = DockStyle.Fill;
            treeListControl.ShowRoot = false;
            treeListControl.LabelEditMode = TreeControl.LabelEditModes.EditOnF2 | TreeControl.LabelEditModes.EditOnClick;
            treeListControl.NodeDataEdited += treeListControl_NodeDataEdited;
            Controls.Add(treeListControl);

            Assembly assembly = Assembly.GetExecutingAssembly();
            string startupPath = Path.GetDirectoryName(new Uri(assembly.GetName().CodeBase).LocalPath);
            var xmlPath = Path.Combine(startupPath, "CoolSUVs.xml");

            var treeView = new TreeView(xmlPath, new DataEditorTheme(treeListControl.Font));
            var treeControlAdapter = new TreeControlAdapter(treeListControl);
            treeControlAdapter.TreeView = treeView;

            treeListControl.ItemRenderer = new TreeListItemRenderer(treeView);

            treeListControl.Columns.Add(new TreeListView.Column("MPG",  80));
            treeListControl.Columns.Add(new TreeListView.Column("Weight", 80));
            treeListControl.Columns.Add(new TreeListView.Column("AWD", 50));
            treeListControl.Columns.Add(new TreeListView.Column("Color", 80));
            treeListControl.Columns.Add(new TreeListView.Column("MSRP", 80));
            treeListControl.ExpandAll();
        }
Пример #4
0
 public void readSysTree(TreeView TV)
 {
     Model.SelectRecord selectRecord = new Model.SelectRecord("Menu", "", "*", "where 1=1");
     DataSet set = BLL.SelectRecord.SelectRecordData(selectRecord);
     if (set != null)
     {
         DataTable table = set.Tables[0];
         TV.Nodes.Clear();
         DataView view3 = new DataView(table)
         {
             RowFilter = "parentid=0"
         };
         DataView view = view3;
         foreach (DataRowView view2 in view)
         {
             TreeNode node2 = new TreeNode
             {
                 Text = view2["name"].ToString(),
                 Value = view2["id"].ToString()
             };
             TreeNode child = node2;
             if (this.list.Contains(view2["id"].ToString()))
             {
                 child.Checked = true;
             }
             TV.Nodes.Add(child);
             this.AddChildNode(table, child, view2["id"].ToString());
             child.ExpandAll();
         }
     }
 }
Пример #5
0
	public MainForm ()
	{
		// 
		// _treeView
		// 
		_treeView = new TreeView ();
		_treeView.Dock = DockStyle.Top;
		_treeView.Height = 200;
		_treeView.LabelEdit = true;
		_treeView.AfterLabelEdit += new NodeLabelEditEventHandler (TreeView_AfterLabelEdit);
		Controls.Add (_treeView);
		// 
		// _addNodeButton
		// 
		_addNodeButton = new Button ();
		_addNodeButton.Location = new Point (105, 210);
		_addNodeButton.Text = "Add Node";
		_addNodeButton.Click += new EventHandler (AddNodeButton_Click);
		Controls.Add (_addNodeButton);
		// 
		// MainForm
		// 
		ClientSize = new Size (300, 245);
		Location = new Point (250, 100);
		StartPosition = FormStartPosition.Manual;
		Text = "bug #82577";
		Load += new EventHandler (MainForm_Load);
	}
    public TreeView Populate(string userId)
    {
        TreeView treeView = new TreeView();

        IList<MenuFuncVO> menuFuncList = m_AuthService.GetTopMenuFuncNoLazy();

        //var result = from data in menuFuncList
        //             where data.ParentMenu == null
        //             select data;

        foreach (MenuFuncVO menu in menuFuncList)
        {
            TreeNode treeNode = new TreeNode(menu.MenuFuncName, "");

            if (menu.SubFuncs.Count > 0)
            {
                foreach (MenuFuncVO subMenu in menu.SubFuncs)
                {
                    //TreeNode subTreeNode = new TreeNode(subMenu.MenuFuncName, subMenu.Id.ToString());
                    TreeNode subTreeNode = new TreeNode(subMenu.MenuFuncName, subMenu.MainPath);
                    //subTreeNode.NavigateUrl = "~/" + subMenu.MainPath;
                    treeNode.ChildNodes.Add(subTreeNode);
                }
            }

            treeView.Nodes.Add(treeNode);
        }
        return treeView;
    }
      protected override bool Checked(WinForms::ToolStripMenuItem clickedItem, TreeView treeView, TreeNode clickedTn)
      {
         IEnumerable<IMaxNode> selNodes = TreeMode.GetMaxNodes(treeView.SelectedNodes);

         return selNodes.OfType<XRefSceneRecord>()
                        .Any(x => x.HasFlags(this.Flags));
      }
Пример #8
0
 public static void SelectTreeNodeByNodeValue(TreeView treeView, string nodeValue)
 {
     foreach (TreeNode rootNode in treeView.Nodes) {
         bool isSelected = SelectTreeNodeByNodeValue(treeView, rootNode, nodeValue);
         if (isSelected) break;
     }
 }
            private void SetupTree()
            {
                tree = new TreeView ();
                this.store = new ListStore (typeof (object));
                tree.Model = store;

                TreeViewColumn col = new TreeViewColumn ();
                col.Sizing = TreeViewColumnSizing.Fixed;
                col.Spacing = 4;

                CellRendererText text_renderer =
                    new CellRendererText ();
                text_renderer.WrapMode = Pango.WrapMode.Word;
                col.PackStart (text_renderer, true);
                col.SetCellDataFunc (text_renderer,
                             new
                             TreeCellDataFunc
                             (PluginInfoCellDataFunc));

                CellRendererToggle loaded_renderer =
                    new CellRendererToggle ();
                loaded_renderer.Activatable = false;
                col.PackStart (loaded_renderer, false);
                col.SetCellDataFunc (loaded_renderer,
                             new
                             TreeCellDataFunc
                             (LoadedStatusCellDataFunc));

                col.Title = Catalog.GetString("Plugins Details");
                tree.AppendColumn (col);
            }
Пример #10
0
        public void DataContexts_Should_Be_Correctly_Set()
        {
            var items = new object[]
            {
                "Foo",
                new Node { Value = "Bar" },
                new TextBlock { Text = "Baz" },
                new TreeViewItem { Header = "Qux" },
            };

            var target = new TreeView
            {
                Template = CreateTreeViewTemplate(),
                DataContext = "Base",
                DataTemplates = new DataTemplates
                {
                    new FuncDataTemplate<Node>(x => new Button { Content = x })
                },
                Items = items,
            };

            ApplyTemplates(target);

            var dataContexts = target.Presenter.Panel.Children
                .Cast<Control>()
                .Select(x => x.DataContext)
                .ToList();

            Assert.Equal(
                new object[] { items[0], items[1], "Base", "Base" },
                dataContexts);
        }
Пример #11
0
        public TreeStyle(TreeView tree)
        {
            _tree = tree;
            _frozenFont = new Font(_tree.Font, FontStyle.Italic);

            NodeForeColor = SystemColors.WindowText;
            NodeBackColor = SystemColors.Window;
            FrozenForeColor = SystemColors.GrayText;
            FrozenBackColor = SystemColors.Window;
            HiddenForeColor = SystemColors.GrayText;
            HiddenBackColor = SystemColors.Window;
            XrefForeColor = SystemColors.WindowText;
            XrefBackColor = SystemColors.Window;

            SelectionForeColor = SystemColors.HighlightText;
            SelectionBackColor = SystemColors.Highlight;

            LinkForeColor = SystemColors.WindowText;
            LinkBackColor = Color.FromArgb(255, 177, 177);

            ParentForeColor = SystemColors.WindowText;
            ParentBackColor = Color.FromArgb(177, 255, 177);

            LayerForeColor = SystemColors.WindowText;
            LayerBackColor = Color.FromArgb(177, 228, 255);
        }
Пример #12
0
    public TreeViewDemo()
    {
        Application.Init ();
        PopulateStore ();

        Window win = new Window ("TreeView demo");
        win.DeleteEvent += new DeleteEventHandler (DeleteCB);
        win.SetDefaultSize (640,480);

        ScrolledWindow sw = new ScrolledWindow ();
        win.Add (sw);

        TreeView tv = new TreeView (store);
        tv.EnableSearch = true;
        tv.HeadersVisible = true;
        tv.HeadersClickable = true;

        tv.AppendColumn ("Name", new CellRendererText (), "text", 0);
        tv.AppendColumn ("Type", new CellRendererText (), "text", 1);

        sw.Add (tv);

        dialog.Destroy ();
        dialog = null;

        win.ShowAll ();

        Application.Run ();
    }
        public TreeViewRenderingTests()
        {
            Mock<TextWriter> textWriter = new Mock<TextWriter>();
            Mock<HtmlTextWriter> writer = new Mock<HtmlTextWriter>(textWriter.Object);
            objectWriter = new Mock<IClientSideObjectWriter>();

            var list = new List<IHtmlNode>();
            list.Add(new HtmlElement("div"));

            var rootTag = new Mock<IHtmlNode>();
            rootTag.SetupGet(t => t.Children).Returns(() => list);

            var itemTag = new Mock<IHtmlNode>();
            itemTag.SetupGet(t => t.Children).Returns(() => list);
            itemTag.Setup(t => t.AppendTo(It.IsAny<IHtmlNode>())).Returns(() => itemTag.Object);

            builder = new Mock<ITreeViewHtmlBuilder>();
            builder.Setup(r => r.TreeViewTag()).Returns(() => rootTag.Object);
            builder.Setup(r => r.ItemTag(It.IsAny<TreeViewItem>(), It.IsAny<bool>())).Returns(() => itemTag.Object);
            builder.Setup(r => r.ItemInnerContent(It.IsAny<TreeViewItem>())).Returns(() => new Mock<IHtmlNode>().Object);
            builder.Setup(r => r.ItemHiddenInputValue(It.IsAny<TreeViewItem>())).Returns(() => new Mock<IHtmlNode>().Object);
            builder.Setup(r => r.ItemContentTag(It.IsAny<TreeViewItem>())).Returns(() => new Mock<IHtmlNode>().Object);
            builder.Setup(r => r.ChildrenTag(It.IsAny<TreeViewItem>())).Returns(() => new Mock<IHtmlNode>().Object);

            treeView = TreeViewTestHelper.CreateTreeView(writer.Object, builder.Object, objectWriter.Object);
            treeView.Name = "TreeView";
        }
Пример #14
0
        public void GetAllLoadedNodes()
        {
            /* 
             * RootNode
               |-LoadedChild
               |-NotLoadedChild
               |-LoadedChild2
                    |-LoadedGrandChild
               |-NotLoadedChild2
                    |-LoadedGrandChild2
             */
            var treeView = new TreeView();

            ITreeNode rootNode = new MockTestNode(treeView, true) { Text = "RootNode" };
            var loadedChild = new MockTestNode(treeView, true) { Text = "LoadedChild" };
            rootNode.Nodes.Add(loadedChild);
            var notLoadedChild = new MockTestNode(treeView, false) { Text = "NotLoadedChild" };
            rootNode.Nodes.Add(notLoadedChild);

            var loadedChild2 = new MockTestNode(treeView, true) { Text = "LoadedChild2" };
            rootNode.Nodes.Add(loadedChild2);
            var loadedGrandChild = new MockTestNode(treeView, true) { Text = "LoadedGrandChild" };
            loadedChild2.Nodes.Add(loadedGrandChild);

            var notLoadedChild2 = new MockTestNode(treeView, false) { Text = "NotLoadedChild2" };
            rootNode.Nodes.Add(notLoadedChild2);
            notLoadedChild2.Nodes.Add(new MockTestNode(treeView, true) { Text = "LoadedGrandChild2" });
            //reset the loaded flag. It was set set to true by the previous call
            notLoadedChild2.SetLoaded(false);

            treeView.Nodes.Add(rootNode);

            Assert.AreEqual(new[] { rootNode, loadedChild, notLoadedChild, loadedChild2, loadedGrandChild, notLoadedChild2 }, treeView.AllLoadedNodes.ToArray());
        }
Пример #15
0
    public void Run(string[] args)
    {
        Application.Init ();
        PopulateStore ();
        store.SetSortColumnId(2, SortType.Ascending);

        Window win = new Window ("Gtk Widget Attributes");
        win.DeleteEvent += new DeleteEventHandler (DeleteCB);
        win.SetDefaultSize (640,480);

        ScrolledWindow sw = new ScrolledWindow ();
        win.Add (sw);

        TreeView tv = new TreeView (store);
        tv.HeadersVisible = true;

        tv.AppendColumn ("Name", new CellRendererText (), "markup", 0);
        tv.AppendColumn ("Type", new CellRendererText (), "text", 1);

        foreach(TreeViewColumn col in tv.Columns)
            col.Resizable = true;

        tv.SearchColumn = 2;

        sw.Add (tv);

        dialog.Destroy ();
        dialog = null;

        win.ShowAll ();

        Application.Run ();
    }
Пример #16
0
    public void SaveTreeView(TreeView treeView, string key)
    {

        List<bool?> list = new List<bool?>();
        SaveTreeViewExpandedState(treeView.Nodes, list);
        HttpContext.Current.Session[key + treeView.ID] = list;
    }
Пример #17
0
        public void Items_Should_Be_Created_Using_ItemTemplate_If_Present()
        {
            TreeView target;

            var root = new TestRoot
            {
                Child = target = new TreeView
                {
                    Template = CreateTreeViewTemplate(),
                    Items = CreateTestTreeData(),
                    ItemTemplate = new FuncTreeDataTemplate<Node>(
                        _ => new Canvas(),
                        x => x.Children),
                }
            };

            ApplyTemplates(target);

            var items = target.ItemContainerGenerator.Index.Items
                .OfType<TreeViewItem>()
                .ToList();

            Assert.Equal(4, items.Count);
            Assert.All(items, x => Assert.IsType<Canvas>(x.HeaderPresenter.Child));
        }
Пример #18
0
    public MForm9()
    {
        Text = "TreeView";
        Size = new Size(250, 250);

        TreeView tv = new TreeView();

        TreeNode root = new TreeNode();
        root.Text = "Languages";

        TreeNode child1 = new TreeNode();
        child1.Text = "Python";

        TreeNode child2 = new TreeNode();
        child2.Text = "Ruby";

        TreeNode child3 = new TreeNode();
        child3.Text = "Java";

        root.Nodes.AddRange(new TreeNode[] {child1, child2, child3});

        tv.Parent = this;
        tv.Nodes.Add(root);
        tv.Dock = DockStyle.Fill;
        tv.AfterSelect += new TreeViewEventHandler(AfterSelect);

        sb = new StatusBar();
        sb.Parent = this;

        CenterToScreen();
    }
Пример #19
0
    public Tree(string[] args)
    {
        Application.Init ();

        store = new TreeStore (typeof (string), typeof (string));

        Glade.XML gxml = new Glade.XML(null, "tree.glade", "window", null );
        gxml.Autoconnect( this );

        window.Resize(500, 400 );
        // eventos
        window.DeleteEvent += new DeleteEventHandler( Salir );
        b_agregar.Clicked += new EventHandler( Agregar );
        b_eliminar.Clicked += new EventHandler( Borrar );
        b_limpiar.Clicked += new EventHandler( Limpiar );
        b_salir.Clicked += new EventHandler( Cerrar );

        // crear arbol

        tv = new TreeView ();
        tv.Model = store;
        tv.HeadersVisible = true;

        tv.AppendColumn ("Nombre", new CellRendererText (), "text", 0);
        tv.AppendColumn ("Apellidos", new CellRendererText (), "text", 1);

        scrolledwindow1.Add (tv);
        window.ShowAll ();
        Application.Run ();
    }
Пример #20
0
	public MainForm ()
	{
		_treeView = new TreeView ();
		_treeView.Dock = DockStyle.Top;
		_treeView.Height = 150;
		_treeView.TabIndex = 0;
		_treeView.MouseClick += new MouseEventHandler (TreeView_MouseClick);
		Controls.Add (_treeView);
		// 
		// _eventsText
		// 
		_eventsText = new TextBox ();
		_eventsText.Dock = DockStyle.Bottom;
		_eventsText.Height = 150;
		_eventsText.Multiline = true;
		Controls.Add (_eventsText);
		// 
		// MainForm
		// 
		ClientSize = new Size (292, 310);
		Location = new Point (250, 100);
		StartPosition = FormStartPosition.Manual;
		Text = "bug #81739";
		Load += new EventHandler (MainForm_Load);
	}
Пример #21
0
 public void Init(Rect rect, BackendData backendData)
 {
   if (this.m_TreeView != null)
     return;
   this.m_BackendData = backendData;
   TreeViewState treeViewState = new TreeViewState();
   treeViewState.columnWidths = new float[6]
   {
     250f,
     90f,
     93f,
     98f,
     74f,
     78f
   };
   this.m_TreeView = new TreeView(this.m_EditorWindow, treeViewState);
   ITreeViewGUI gui = (ITreeViewGUI) new TestGUI(this.m_TreeView);
   ITreeViewDragging dragging = (ITreeViewDragging) new TestDragging(this.m_TreeView, this.m_BackendData);
   ITreeViewDataSource data = !this.m_Lazy ? (ITreeViewDataSource) new TestDataSource(this.m_TreeView, this.m_BackendData) : (ITreeViewDataSource) new LazyTestDataSource(this.m_TreeView, this.m_BackendData);
   this.m_TreeView.Init(rect, data, gui, dragging);
   this.m_ColumnHeader = new TreeViewColumnHeader();
   this.m_ColumnHeader.columnWidths = treeViewState.columnWidths;
   this.m_ColumnHeader.minColumnWidth = 30f;
   this.m_ColumnHeader.columnRenderer += new System.Action<int, Rect>(this.OnColumnRenderer);
 }
Пример #22
0
        public void Root_TreeContainerFromItem_Should_Return_Descendent_Item()
        {
            var tree = CreateTestTreeData();
            var target = new TreeView
            {
                Template = CreateTreeViewTemplate(),
                Items = tree,
                DataTemplates = CreateNodeDataTemplate(),
            };

            // For TreeViewItem to find its parent TreeView, OnAttachedToLogicalTree needs
            // to be called, which requires an IStyleRoot.
            var root = new TestRoot();
            root.Child = target;

            ApplyTemplates(target);

            var container = target.ItemContainerGenerator.Index.ContainerFromItem(
                tree[0].Children[1].Children[0]);

            Assert.NotNull(container);

            var header = ((TreeViewItem)container).Header;
            var headerContent = ((TextBlock)header).Text;

            Assert.Equal("Grandchild2a", headerContent);
        }
Пример #23
0
    public static void GetTreeView(TreeView tv)
    {
        tv.Nodes.Clear();

        //建立根節點
        TreeNode Root = new TreeNode();
        Root.Text = "Land Project";
        tv.Nodes.Add(Root);//建立根节点

        using (SqlConnection cn = new SqlConnection(ConnString))
        {
            if (cn.State != ConnectionState.Open) cn.Open();
            using (SqlCommand cm = new SqlCommand(" Select Distinct Pid,Convert(Nvarchar(10),CreateTime) CreateTime From LandProject Order By CreateTime DESC", cn))
            {
                using (SqlDataReader dr = cm.ExecuteReader())
                {
                    while (dr.Read())
                    {
                        TreeNode Node = new TreeNode();

                        Node.Text = dr["CreateTime"].ToString().Trim();
                        //Node.Target = "mainbottom";
                        //string Path = drNode["menu_addr"].ToString();
                        //int menusn = Convert.ToInt32(drNode["sn"].ToString());
                        Node.NavigateUrl = "LandProjectView.aspx" + "?Pid=" + dr["Pid"].ToString().Trim();
                        Root.ChildNodes.Add(Node);//建立子节点
                    }
                }
            }
        }
        tv.ExpandAll();
    }
Пример #24
0
	public ImageInfo () : base (null, null)
	{
		store = new TreeStore ((int)TypeFundamentals.TypeString,
				       (int)TypeFundamentals.TypeString);
		
		tv = new TreeView (store);
		tv.HeadersVisible = true;

		TreeViewColumn NameCol = new TreeViewColumn ();
		CellRenderer NameRenderer = new CellRendererText ();

		NameCol.Title = "Name";
		NameCol.PackStart (NameRenderer, true);
		NameCol.AddAttribute (NameRenderer, "markup", 0);
		tv.AppendColumn (NameCol);

		TreeViewColumn ValueCol = new TreeViewColumn ();
		CellRenderer ValueRenderer = new CellRendererText ();
		ValueCol.Title = "Value";
		ValueCol.PackStart (ValueRenderer, false);
		ValueCol.AddAttribute (ValueRenderer, "text", 1);
		tv.AppendColumn (ValueCol);

		//
		// Populate tree
		//

		TreeIter iter = new TreeIter ();
		PopulateGeneral (out iter);
		PopulateDetails (out iter);
		Add (tv);
	}
Пример #25
0
	public MainForm ()
	{
		_treeView = new TreeView ();
		_treeView.AllowDrop = true;
		_treeView.Dock = DockStyle.Top;
		_treeView.Height = 150;
		_treeView.DragDrop += new DragEventHandler (TreeView_DragDrop);
		_treeView.DragEnter += new DragEventHandler (TreeView_DragEnter);
		_treeView.DragOver += new DragEventHandler (TreeView_DragOver);
		_treeView.ItemDrag += new ItemDragEventHandler (TreeView_ItemDrag);
		Controls.Add (_treeView);
		// 
		// _eventsText
		// 
		_eventsText = new TextBox ();
		_eventsText.Dock = DockStyle.Bottom;
		_eventsText.Height = 150;
		_eventsText.Multiline = true;
		Controls.Add (_eventsText);
		// 
		// MainForm
		// 
		ClientSize = new Size (292, 300);
		Location = new Point (250, 100);
		StartPosition = FormStartPosition.Manual;
		Text = "bug #325076";
		Load += new EventHandler (MainForm_Load);
	}
Пример #26
0
        public void Clicking_Item_Should_Select_It()
        {
            var tree = CreateTestTreeData();
            var target = new TreeView
            {
                Template = CreateTreeViewTemplate(),
                Items = tree,
                DataTemplates = CreateNodeDataTemplate(),
            };

            var visualRoot = new TestRoot();
            visualRoot.Child = target;
            ApplyTemplates(target);

            var item = tree[0].Children[1].Children[0];
            var container = (TreeViewItem)target.ItemContainerGenerator.Index.ContainerFromItem(item);

            Assert.NotNull(container);

            container.RaiseEvent(new PointerPressEventArgs
            {
                RoutedEvent = InputElement.PointerPressedEvent,
                MouseButton = MouseButton.Left,
            });

            Assert.Equal(item, target.SelectedItem);
            Assert.True(container.IsSelected);
        }
 /// <summary>
 /// Initializes a new instance of the TreeViewBuilder class.
 /// </summary>
 /// <param name="view">The TreeView to build.</param>
 public TreeViewBuilder(TreeView view)
 {
     if (view == null)
     {
         throw new ArgumentNullException("view");
     }
     ParentContainer = view;
 }
Пример #28
0
 public static object GetId(TreeView treeView)
 {
     TreeIter treeIter;
     if (!treeView.Selection.GetSelected (out treeIter))
         return null;
     IList row = (IList)treeView.Model.GetValue(treeIter, 0);
     return row[0];
 }
Пример #29
0
 private void loadTree(List<int> estruturaHierarquiaIds)
 {
     if (estruturaHierarquiaIds.Count < 1) return;
     var trvPessoas = new TreeView();
     trvPessoas.ShowLines = true;
     tdTriviewHierarquia.Controls.Add(trvPessoas);
     addNode(trvPessoas.Nodes, estruturaHierarquiaIds, 0);
 }
	void AddColumn (string title, int counter, ref TreeView table)
	{
		TreeViewColumn column = new TreeViewColumn { Title = title };
		CellRenderer renderer = new CellRendererText ();
		column.PackStart (renderer, true);
		table.AppendColumn (column);
		column.AddAttribute (renderer, "text", counter);
	}
        // recursively handles control tree and switches to
        // menu / toolbar / tree view node trees when needed
        private static void ApplyLanguage(
            ComponentResourceManager componentResourceManager,
            Control control)
        {
            if (control is UserControl)
            {
                // use its own CRM
                ComponentResourceManager userControlCRM
                    = new ComponentResourceManager(control.GetType());

                userControlCRM.ApplyResources(control, control.Name);
                foreach (Control childControl in control.Controls)
                {
                    ApplyLanguage(userControlCRM, childControl);
                }

                if (control is Controls.MapTreeView)
                {
                    // bit of a hack due to context menus

                    foreach (ContextMenuStrip contextMenuStrip
                             in ((Controls.MapTreeView)control).ContextMenus)
                    {
                        ApplyLanguage(componentResourceManager, contextMenuStrip);
                    }
                }

                return;
            }

            componentResourceManager.ApplyResources(control, control.Name);
            foreach (Control childControl in control.Controls)
            {
                ApplyLanguage(componentResourceManager, childControl);
            }

            if (control is ToolStrip)
            {
                // handles derivative MenuStrip too
                ToolStrip toolStrip = (ToolStrip)control;
                foreach (ToolStripItem toolStripItem in toolStrip.Items)
                {
                    ApplyLanguage(componentResourceManager, toolStripItem);
                }
            }
            else if (control is TreeView)
            {
                // handle tree view nodes
                TreeView treeView = (TreeView)control;

                treeView.Nodes.Clear();
                treeView.Nodes.AddRange(new TreeNode[] {
                    ((TreeNode)(componentResourceManager.GetObject(treeView.Name + ".Nodes")))
                });

                foreach (TreeNode treeNode in treeView.Nodes)
                {
                    ApplyLanguage(componentResourceManager, treeNode);
                }
            }
        }
Пример #32
0
 public WarehouseAdapter(Warehouse warehouse, TreeView treeView)
 {
     this.warehouse = warehouse;
     this.treeView  = treeView;
 }
        /// <summary>
        /// Constructor
        /// </summary>
        public IndicatorDialog(int slotNumb, SlotTypes slotType, bool isDefined)
        {
            _slot     = slotNumb;
            _slotType = slotType;

            if (slotType == SlotTypes.Open)
            {
                _slotCation     = Language.T("Opening Point of the Position");
                PnlParameters   = new FancyPanel(_slotCation, LayoutColors.ColorSlotCaptionBackOpen);
                PnlTreeViewBase = new FancyPanel(Language.T("Indicators"), LayoutColors.ColorSlotCaptionBackOpen);
            }
            else if (slotType == SlotTypes.OpenFilter)
            {
                _slotCation     = Language.T("Opening Logic Condition");
                PnlParameters   = new FancyPanel(_slotCation, LayoutColors.ColorSlotCaptionBackOpenFilter);
                PnlTreeViewBase = new FancyPanel(Language.T("Indicators"), LayoutColors.ColorSlotCaptionBackOpenFilter);
            }
            else if (slotType == SlotTypes.Close)
            {
                _slotCation     = Language.T("Closing Point of the Position");
                PnlParameters   = new FancyPanel(_slotCation, LayoutColors.ColorSlotCaptionBackClose);
                PnlTreeViewBase = new FancyPanel(Language.T("Indicators"), LayoutColors.ColorSlotCaptionBackClose);
            }
            else
            {
                _slotCation     = Language.T("Closing Logic Condition");
                PnlParameters   = new FancyPanel(_slotCation, LayoutColors.ColorSlotCaptionBackCloseFilter);
                PnlTreeViewBase = new FancyPanel(Language.T("Indicators"), LayoutColors.ColorSlotCaptionBackCloseFilter);
            }

            TrvIndicators = new TreeView();
            BalanceChart  = new SmallBalanceChart();
            BtnAccept     = new Button();
            BtnHelp       = new Button();
            BtnDefault    = new Button();
            BtnCancel     = new Button();

            LblIndicatorInfo    = new Label();
            LblIndicatorWarning = new Label();
            LblIndicator        = new Label();
            LblGroup            = new Label();
            CbxGroup            = new ComboBox();
            ALblList            = new Label[5];
            ACbxList            = new ComboBox[5];
            ALblNumeric         = new Label[6];
            ANudNumeric         = new NUD[6];
            AChbCheck           = new CheckBox[2];

            BackColor       = LayoutColors.ColorFormBack;
            FormBorderStyle = FormBorderStyle.FixedDialog;
            Icon            = Data.Icon;
            MaximizeBox     = false;
            MinimizeBox     = false;
            ShowInTaskbar   = false;
            AcceptButton    = BtnAccept;
            CancelButton    = BtnCancel;
            Text            = Language.T("Logic and Parameters of the Indicators");

            // Panel TreeViewBase
            PnlTreeViewBase.Parent  = this;
            PnlTreeViewBase.Padding = new Padding(Border, (int)PnlTreeViewBase.CaptionHeight, Border, Border);

            // TreeView trvIndicators
            TrvIndicators.Parent                = PnlTreeViewBase;
            TrvIndicators.Dock                  = DockStyle.Fill;
            TrvIndicators.BackColor             = LayoutColors.ColorControlBack;
            TrvIndicators.ForeColor             = LayoutColors.ColorControlText;
            TrvIndicators.BorderStyle           = BorderStyle.None;
            TrvIndicators.NodeMouseDoubleClick += TrvIndicatorsNodeMouseDoubleClick;
            TrvIndicators.KeyPress             += TrvIndicatorsKeyPress;

            PnlParameters.Parent = this;

            // pnlSmallBalanceChart
            BalanceChart.Parent = this;

            // lblIndicatorInfo
            LblIndicatorInfo.Parent          = PnlParameters;
            LblIndicatorInfo.Size            = new Size(16, 16);
            LblIndicatorInfo.BackColor       = Color.Transparent;
            LblIndicatorInfo.BackgroundImage = Resources.information;
            LblIndicatorInfo.Click          += LblIndicatorInfoClick;
            LblIndicatorInfo.MouseEnter     += LabelMouseEnter;
            LblIndicatorInfo.MouseLeave     += LabelMouseLeave;

            // lblIndicatorWarning
            LblIndicatorWarning.Parent          = PnlParameters;
            LblIndicatorWarning.Size            = new Size(16, 16);
            LblIndicatorWarning.BackColor       = Color.Transparent;
            LblIndicatorWarning.BackgroundImage = Resources.warning;
            LblIndicatorWarning.Visible         = false;
            LblIndicatorWarning.Click          += LblIndicatorWarningClick;
            LblIndicatorWarning.MouseEnter     += LabelMouseEnter;
            LblIndicatorWarning.MouseLeave     += LabelMouseLeave;

            // Label Indicator
            LblIndicator.Parent    = PnlParameters;
            LblIndicator.TextAlign = ContentAlignment.MiddleCenter;
            LblIndicator.Font      = new Font(Font.FontFamily, 14, FontStyle.Bold);
            LblIndicator.ForeColor = LayoutColors.ColorSlotIndicatorText;
            LblIndicator.BackColor = Color.Transparent;

            // Label ALblList[0]
            ALblList[0] = new Label
            {
                Parent    = PnlParameters,
                TextAlign = ContentAlignment.BottomCenter,
                ForeColor = LayoutColors.ColorControlText,
                BackColor = Color.Transparent
            };

            // ComboBox ACbxList[0]
            ACbxList[0] = new ComboBox {
                Parent = PnlParameters, DropDownStyle = ComboBoxStyle.DropDownList
            };
            ACbxList[0].SelectedIndexChanged += ParamChanged;

            // Logical Group
            LblGroup = new Label
            {
                Parent    = PnlParameters,
                TextAlign = ContentAlignment.BottomCenter,
                ForeColor = LayoutColors.ColorControlText,
                BackColor = Color.Transparent,
                Text      = Language.T("Group")
            };

            CbxGroup = new ComboBox {
                Parent = PnlParameters
            };
            if (slotType == SlotTypes.OpenFilter)
            {
                CbxGroup.Items.AddRange(new object[] { "A", "B", "C", "D", "E", "F", "G", "H", "All" });
            }
            if (slotType == SlotTypes.CloseFilter)
            {
                CbxGroup.Items.AddRange(new object[] { "a", "b", "c", "d", "e", "f", "g", "h", "all" });
            }
            CbxGroup.SelectedIndexChanged += GroupChanged;
            CbxGroup.DropDownStyle         = ComboBoxStyle.DropDownList;
            _toolTip.SetToolTip(CbxGroup, Language.T("The logical group of the slot."));

            // ListParams
            for (int i = 1; i < 5; i++)
            {
                ALblList[i] = new Label
                {
                    Parent    = PnlParameters,
                    TextAlign = ContentAlignment.BottomCenter,
                    ForeColor = LayoutColors.ColorControlText,
                    BackColor = Color.Transparent
                };

                ACbxList[i] = new ComboBox
                {
                    Parent        = PnlParameters,
                    Enabled       = false,
                    DropDownStyle = ComboBoxStyle.DropDownList
                };
                ACbxList[i].SelectedIndexChanged += ParamChanged;
            }

            // NumParams
            for (int i = 0; i < 6; i++)
            {
                ALblNumeric[i] = new Label
                {
                    Parent    = PnlParameters,
                    TextAlign = ContentAlignment.MiddleRight,
                    ForeColor = LayoutColors.ColorControlText,
                    BackColor = Color.Transparent
                };

                ANudNumeric[i] = new NUD
                {
                    Parent = PnlParameters, TextAlign = HorizontalAlignment.Center, Enabled = false
                };
                ANudNumeric[i].ValueChanged += ParamChanged;
            }

            // CheckParams
            for (int i = 0; i < 2; i++)
            {
                AChbCheck[i] = new CheckBox
                {
                    Parent     = PnlParameters,
                    CheckAlign = ContentAlignment.MiddleLeft,
                    TextAlign  = ContentAlignment.MiddleLeft,
                    ForeColor  = LayoutColors.ColorControlText,
                    BackColor  = Color.Transparent,
                    Enabled    = false
                };
                AChbCheck[i].CheckedChanged += ParamChanged;
            }

            //Button Accept
            BtnAccept.Parent                  = this;
            BtnAccept.Text                    = Language.T("Accept");
            BtnAccept.DialogResult            = DialogResult.OK;
            BtnAccept.Click                  += BtnOkClick;
            BtnAccept.UseVisualStyleBackColor = true;

            //Button Default
            BtnDefault.Parent = this;
            BtnDefault.Text   = Language.T("Default");
            BtnDefault.Click += BtnDefaultClick;
            BtnDefault.UseVisualStyleBackColor = true;

            //Button Help
            BtnHelp.Parent = this;
            BtnHelp.Text   = Language.T("Help");
            BtnHelp.Click += BtnHelpClick;
            BtnHelp.UseVisualStyleBackColor = true;

            //Button Cancel
            BtnCancel.Parent                  = this;
            BtnCancel.Text                    = Language.T("Cancel");
            BtnCancel.DialogResult            = DialogResult.Cancel;
            BtnCancel.UseVisualStyleBackColor = true;

            SetTreeViewIndicators();

            // ComboBoxindicator index selection.
            if (isDefined)
            {
                TreeNode[] atrn = TrvIndicators.Nodes.Find(Data.Strategy.Slot[_slot].IndParam.IndicatorName, true);
                TrvIndicators.SelectedNode = atrn[0];
                UpdateFromIndicatorParam(Data.Strategy.Slot[_slot].IndParam);
                SetLogicalGroup();
                CalculateIndicator(false);
                BalanceChart.SetChartData();
                BalanceChart.InitChart();
                BalanceChart.Invalidate();
            }
            else
            {
                string defaultIndicator;
                if (slotType == SlotTypes.Open)
                {
                    defaultIndicator = "Bar Opening";
                }
                else if (slotType == SlotTypes.OpenFilter)
                {
                    defaultIndicator = "Accelerator Oscillator";
                }
                else if (slotType == SlotTypes.Close)
                {
                    defaultIndicator = "Bar Closing";
                }
                else
                {
                    defaultIndicator = "Accelerator Oscillator";
                }

                TreeNode[] atrn = TrvIndicators.Nodes.Find(defaultIndicator, true);
                TrvIndicators.SelectedNode = atrn[0];
                TrvIndicatorsLoadIndicator();
            }

            _oppSignalBehaviour = Data.Strategy.OppSignalAction;

            if (slotType == SlotTypes.Close && Data.Strategy.CloseFilters > 0)
            {
                for (int iSlot = Data.Strategy.CloseSlot + 1; iSlot < Data.Strategy.Slots; iSlot++)
                {
                    _closingConditions.Add(Data.Strategy.Slot[iSlot].Clone());
                }
            }
        }
Пример #34
0
        }// Init

        internal override int InsertPropSheetPageControls()
        {
            System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(CEvalAssemWiz3));
            this.m_txtAssemEval               = new System.Windows.Forms.TextBox();
            this.m_tvCodegroups               = new System.Windows.Forms.TreeView();
            this.m_txtLevelEval               = new System.Windows.Forms.TextBox();
            this.m_lblAssemEval               = new System.Windows.Forms.Label();
            this.m_lblViewCodegroups          = new System.Windows.Forms.Label();
            this.m_lblLevelEval               = new System.Windows.Forms.Label();
            this.m_txtAssemEval.BorderStyle   = System.Windows.Forms.BorderStyle.None;
            this.m_txtAssemEval.Location      = ((System.Drawing.Point)(resources.GetObject("m_txtAssemEval.Location")));
            this.m_txtAssemEval.ReadOnly      = true;
            this.m_txtAssemEval.Size          = ((System.Drawing.Size)(resources.GetObject("m_txtAssemEval.Size")));
            this.m_txtAssemEval.TabStop       = false;
            m_txtAssemEval.Name               = "Assembly";
            this.m_tvCodegroups.Location      = ((System.Drawing.Point)(resources.GetObject("m_tvCodegroups.Location")));
            this.m_tvCodegroups.Size          = ((System.Drawing.Size)(resources.GetObject("m_tvCodegroups.Size")));
            this.m_tvCodegroups.TabIndex      = ((int)(resources.GetObject("m_tvCodegroups.TabIndex")));
            m_tvCodegroups.Name               = "Codegroups";
            this.m_txtLevelEval.BorderStyle   = System.Windows.Forms.BorderStyle.None;
            this.m_txtLevelEval.Location      = ((System.Drawing.Point)(resources.GetObject("m_txtLevelEval.Location")));
            this.m_txtLevelEval.ReadOnly      = true;
            this.m_txtLevelEval.Size          = ((System.Drawing.Size)(resources.GetObject("m_txtLevelEval.Size")));
            this.m_txtLevelEval.TabStop       = false;
            m_txtLevelEval.Name               = "PolicyLevel";
            this.m_lblAssemEval.Location      = ((System.Drawing.Point)(resources.GetObject("m_lblAssemEval.Location")));
            this.m_lblAssemEval.Size          = ((System.Drawing.Size)(resources.GetObject("m_lblAssemEval.Size")));
            this.m_lblAssemEval.TabIndex      = ((int)(resources.GetObject("m_lblAssemEval.TabIndex")));
            this.m_lblAssemEval.Text          = resources.GetString("m_lblAssemEval.Text");
            m_lblAssemEval.Name               = "AssemblyLabel";
            this.m_lblViewCodegroups.Location = ((System.Drawing.Point)(resources.GetObject("m_lblViewCodegroups.Location")));
            this.m_lblViewCodegroups.Size     = ((System.Drawing.Size)(resources.GetObject("m_lblViewCodegroups.Size")));
            this.m_lblViewCodegroups.TabIndex = ((int)(resources.GetObject("m_lblViewCodegroups.TabIndex")));
            this.m_lblViewCodegroups.Text     = resources.GetString("m_lblViewCodegroups.Text");
            m_lblViewCodegroups.Name          = "ViewCodegroupLabel";
            this.m_lblLevelEval.Location      = ((System.Drawing.Point)(resources.GetObject("m_lblLevelEval.Location")));
            this.m_lblLevelEval.Size          = ((System.Drawing.Size)(resources.GetObject("m_lblLevelEval.Size")));
            this.m_lblLevelEval.TabIndex      = ((int)(resources.GetObject("m_lblLevelEval.TabIndex")));
            this.m_lblLevelEval.Text          = resources.GetString("m_lblLevelEval.Text");
            m_lblLevelEval.Name               = "PolicyLevelLabel";
            PageControls.AddRange(new System.Windows.Forms.Control[] { this.m_txtLevelEval,
                                                                       this.m_lblViewCodegroups,
                                                                       this.m_tvCodegroups,
                                                                       this.m_txtAssemEval,
                                                                       this.m_lblLevelEval,
                                                                       this.m_lblAssemEval });

            // Create an image list of icons we'll be displaying
            m_ilIcons = new ImageList();
            // Keep the order of these consistant with the const's declared at the top
            // of this class
            m_ilIcons.Images.Add(System.Drawing.Icon.FromHandle(CResourceStore.GetHIcon("enterprisepolicy_ico")));
            m_ilIcons.Images.Add(System.Drawing.Icon.FromHandle(CResourceStore.GetHIcon("machinepolicy_ico")));
            m_ilIcons.Images.Add(System.Drawing.Icon.FromHandle(CResourceStore.GetHIcon("userpolicy_ico")));
            m_ilIcons.Images.Add(System.Drawing.Icon.FromHandle(CResourceStore.GetHIcon("singlecodegroup_ico")));
            m_ilIcons.Images.Add(System.Drawing.Icon.FromHandle(CResourceStore.GetHIcon("customcodegroup_ico")));
            m_ilIcons.Images.Add(System.Drawing.Icon.FromHandle(CResourceStore.GetHIcon("info_ico")));

            m_tvCodegroups.ImageList = m_ilIcons;


            return(1);
        }// InsertPropSheetPageControls
Пример #35
0
 /// <summary>
 ///   Required method for Designer support - do not modify
 ///   the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(TestForm));
     this.panelTop                 = new System.Windows.Forms.Panel();
     this.useSslCheckBox           = new System.Windows.Forms.CheckBox();
     this.uidlButton               = new System.Windows.Forms.Button();
     this.totalMessagesTextBox     = new System.Windows.Forms.TextBox();
     this.labelTotalMessages       = new System.Windows.Forms.Label();
     this.labelPassword            = new System.Windows.Forms.Label();
     this.passwordTextBox          = new System.Windows.Forms.TextBox();
     this.labelUsername            = new System.Windows.Forms.Label();
     this.loginTextBox             = new System.Windows.Forms.TextBox();
     this.connectAndRetrieveButton = new System.Windows.Forms.Button();
     this.labelServerPort          = new System.Windows.Forms.Label();
     this.portTextBox              = new System.Windows.Forms.TextBox();
     this.labelServerAddress       = new System.Windows.Forms.Label();
     this.popServerTextBox         = new System.Windows.Forms.TextBox();
     this.panelProperties          = new System.Windows.Forms.Panel();
     this.gridHeaders              = new System.Windows.Forms.DataGrid();
     this.panelMiddle              = new System.Windows.Forms.Panel();
     this.panelMessageBody         = new System.Windows.Forms.Panel();
     this.progressBar              = new System.Windows.Forms.ProgressBar();
     this.messageTextBox           = new System.Windows.Forms.TextBox();
     this.labelMessageBody         = new System.Windows.Forms.Label();
     this.panelMessagesView        = new System.Windows.Forms.Panel();
     this.listMessages             = new System.Windows.Forms.TreeView();
     this.contextMenuMessages      = new System.Windows.Forms.ContextMenu();
     this.menuDeleteMessage        = new System.Windows.Forms.MenuItem();
     this.menuViewSource           = new System.Windows.Forms.MenuItem();
     this.labelMessageNumber       = new System.Windows.Forms.Label();
     this.attachmentPanel          = new System.Windows.Forms.Panel();
     this.listAttachments          = new System.Windows.Forms.TreeView();
     this.labelAttachments         = new System.Windows.Forms.Label();
     this.saveFile                 = new System.Windows.Forms.SaveFileDialog();
     this.panelTop.SuspendLayout();
     this.panelProperties.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.gridHeaders)).BeginInit();
     this.panelMiddle.SuspendLayout();
     this.panelMessageBody.SuspendLayout();
     this.panelMessagesView.SuspendLayout();
     this.attachmentPanel.SuspendLayout();
     this.SuspendLayout();
     //
     // panelTop
     //
     this.panelTop.Controls.Add(this.useSslCheckBox);
     this.panelTop.Controls.Add(this.uidlButton);
     this.panelTop.Controls.Add(this.totalMessagesTextBox);
     this.panelTop.Controls.Add(this.labelTotalMessages);
     this.panelTop.Controls.Add(this.labelPassword);
     this.panelTop.Controls.Add(this.passwordTextBox);
     this.panelTop.Controls.Add(this.labelUsername);
     this.panelTop.Controls.Add(this.loginTextBox);
     this.panelTop.Controls.Add(this.connectAndRetrieveButton);
     this.panelTop.Controls.Add(this.labelServerPort);
     this.panelTop.Controls.Add(this.portTextBox);
     this.panelTop.Controls.Add(this.labelServerAddress);
     this.panelTop.Controls.Add(this.popServerTextBox);
     this.panelTop.Dock     = System.Windows.Forms.DockStyle.Top;
     this.panelTop.Location = new System.Drawing.Point(0, 0);
     this.panelTop.Name     = "panelTop";
     this.panelTop.Size     = new System.Drawing.Size(865, 64);
     this.panelTop.TabIndex = 0;
     //
     // useSslCheckBox
     //
     this.useSslCheckBox.AutoSize   = true;
     this.useSslCheckBox.Checked    = true;
     this.useSslCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
     this.useSslCheckBox.Location   = new System.Drawing.Point(19, 38);
     this.useSslCheckBox.Name       = "useSslCheckBox";
     this.useSslCheckBox.Size       = new System.Drawing.Size(68, 17);
     this.useSslCheckBox.TabIndex   = 4;
     this.useSslCheckBox.Text       = "Use SSL";
     this.useSslCheckBox.UseVisualStyleBackColor = true;
     //
     // uidlButton
     //
     this.uidlButton.Enabled  = false;
     this.uidlButton.Location = new System.Drawing.Point(460, 42);
     this.uidlButton.Name     = "uidlButton";
     this.uidlButton.Size     = new System.Drawing.Size(82, 21);
     this.uidlButton.TabIndex = 6;
     this.uidlButton.Text     = "UIDL";
     this.uidlButton.Click   += new System.EventHandler(this.UidlButtonClick);
     //
     // totalMessagesTextBox
     //
     this.totalMessagesTextBox.Location = new System.Drawing.Point(553, 30);
     this.totalMessagesTextBox.Name     = "totalMessagesTextBox";
     this.totalMessagesTextBox.Size     = new System.Drawing.Size(100, 20);
     this.totalMessagesTextBox.TabIndex = 7;
     //
     // labelTotalMessages
     //
     this.labelTotalMessages.Location = new System.Drawing.Point(553, 7);
     this.labelTotalMessages.Name     = "labelTotalMessages";
     this.labelTotalMessages.Size     = new System.Drawing.Size(100, 23);
     this.labelTotalMessages.TabIndex = 9;
     this.labelTotalMessages.Text     = "Total Messages";
     //
     // labelPassword
     //
     this.labelPassword.Location = new System.Drawing.Point(264, 36);
     this.labelPassword.Name     = "labelPassword";
     this.labelPassword.Size     = new System.Drawing.Size(64, 23);
     this.labelPassword.TabIndex = 8;
     this.labelPassword.Text     = "Password";
     //
     // passwordTextBox
     //
     this.passwordTextBox.Location     = new System.Drawing.Point(328, 36);
     this.passwordTextBox.Name         = "passwordTextBox";
     this.passwordTextBox.PasswordChar = '*';
     this.passwordTextBox.Size         = new System.Drawing.Size(128, 20);
     this.passwordTextBox.TabIndex     = 2;
     //
     // labelUsername
     //
     this.labelUsername.Location = new System.Drawing.Point(264, 5);
     this.labelUsername.Name     = "labelUsername";
     this.labelUsername.Size     = new System.Drawing.Size(64, 23);
     this.labelUsername.TabIndex = 6;
     this.labelUsername.Text     = "Username";
     //
     // loginTextBox
     //
     this.loginTextBox.Location = new System.Drawing.Point(328, 5);
     this.loginTextBox.Name     = "loginTextBox";
     this.loginTextBox.Size     = new System.Drawing.Size(128, 20);
     this.loginTextBox.TabIndex = 1;
     //
     // connectAndRetrieveButton
     //
     this.connectAndRetrieveButton.Location = new System.Drawing.Point(460, 0);
     this.connectAndRetrieveButton.Name     = "connectAndRetrieveButton";
     this.connectAndRetrieveButton.Size     = new System.Drawing.Size(82, 39);
     this.connectAndRetrieveButton.TabIndex = 5;
     this.connectAndRetrieveButton.Text     = "Connect and Retreive";
     this.connectAndRetrieveButton.Click   += new System.EventHandler(this.ConnectAndRetrieveButtonClick);
     //
     // labelServerPort
     //
     this.labelServerPort.Location = new System.Drawing.Point(97, 39);
     this.labelServerPort.Name     = "labelServerPort";
     this.labelServerPort.Size     = new System.Drawing.Size(31, 23);
     this.labelServerPort.TabIndex = 3;
     this.labelServerPort.Text     = "Port";
     //
     // portTextBox
     //
     this.portTextBox.Location = new System.Drawing.Point(128, 39);
     this.portTextBox.Name     = "portTextBox";
     this.portTextBox.Size     = new System.Drawing.Size(128, 20);
     this.portTextBox.TabIndex = 3;
     this.portTextBox.Text     = "110";
     //
     // labelServerAddress
     //
     this.labelServerAddress.Location = new System.Drawing.Point(16, 8);
     this.labelServerAddress.Name     = "labelServerAddress";
     this.labelServerAddress.Size     = new System.Drawing.Size(112, 23);
     this.labelServerAddress.TabIndex = 1;
     this.labelServerAddress.Text     = "POP Server Address";
     //
     // popServerTextBox
     //
     this.popServerTextBox.Location   = new System.Drawing.Point(128, 8);
     this.popServerTextBox.Name       = "popServerTextBox";
     this.popServerTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Horizontal;
     this.popServerTextBox.Size       = new System.Drawing.Size(128, 20);
     this.popServerTextBox.TabIndex   = 0;
     //
     // panelProperties
     //
     this.panelProperties.Controls.Add(this.gridHeaders);
     this.panelProperties.Dock     = System.Windows.Forms.DockStyle.Bottom;
     this.panelProperties.Location = new System.Drawing.Point(0, 260);
     this.panelProperties.Name     = "panelProperties";
     this.panelProperties.Size     = new System.Drawing.Size(865, 184);
     this.panelProperties.TabIndex = 1;
     //
     // gridHeaders
     //
     this.gridHeaders.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                      | System.Windows.Forms.AnchorStyles.Left)
                                                                     | System.Windows.Forms.AnchorStyles.Right)));
     this.gridHeaders.DataMember           = "";
     this.gridHeaders.HeaderForeColor      = System.Drawing.SystemColors.ControlText;
     this.gridHeaders.Location             = new System.Drawing.Point(0, 0);
     this.gridHeaders.Name                 = "gridHeaders";
     this.gridHeaders.PreferredColumnWidth = 400;
     this.gridHeaders.ReadOnly             = true;
     this.gridHeaders.Size                 = new System.Drawing.Size(865, 188);
     this.gridHeaders.TabIndex             = 3;
     //
     // panelMiddle
     //
     this.panelMiddle.Controls.Add(this.panelMessageBody);
     this.panelMiddle.Controls.Add(this.panelMessagesView);
     this.panelMiddle.Controls.Add(this.attachmentPanel);
     this.panelMiddle.Dock     = System.Windows.Forms.DockStyle.Fill;
     this.panelMiddle.Location = new System.Drawing.Point(0, 64);
     this.panelMiddle.Name     = "panelMiddle";
     this.panelMiddle.Size     = new System.Drawing.Size(865, 196);
     this.panelMiddle.TabIndex = 2;
     //
     // panelMessageBody
     //
     this.panelMessageBody.Controls.Add(this.progressBar);
     this.panelMessageBody.Controls.Add(this.messageTextBox);
     this.panelMessageBody.Controls.Add(this.labelMessageBody);
     this.panelMessageBody.Dock     = System.Windows.Forms.DockStyle.Fill;
     this.panelMessageBody.Location = new System.Drawing.Point(175, 0);
     this.panelMessageBody.Name     = "panelMessageBody";
     this.panelMessageBody.Size     = new System.Drawing.Size(376, 196);
     this.panelMessageBody.TabIndex = 6;
     //
     // progressBar
     //
     this.progressBar.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
                                                                     | System.Windows.Forms.AnchorStyles.Right)));
     this.progressBar.Location = new System.Drawing.Point(7, 172);
     this.progressBar.Name     = "progressBar";
     this.progressBar.Size     = new System.Drawing.Size(360, 12);
     this.progressBar.TabIndex = 10;
     //
     // messageTextBox
     //
     this.messageTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                         | System.Windows.Forms.AnchorStyles.Left)
                                                                        | System.Windows.Forms.AnchorStyles.Right)));
     this.messageTextBox.Location   = new System.Drawing.Point(7, 22);
     this.messageTextBox.MaxLength  = 999999999;
     this.messageTextBox.Multiline  = true;
     this.messageTextBox.Name       = "messageTextBox";
     this.messageTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Both;
     this.messageTextBox.Size       = new System.Drawing.Size(360, 143);
     this.messageTextBox.TabIndex   = 9;
     //
     // labelMessageBody
     //
     this.labelMessageBody.Location = new System.Drawing.Point(8, 8);
     this.labelMessageBody.Name     = "labelMessageBody";
     this.labelMessageBody.Size     = new System.Drawing.Size(136, 16);
     this.labelMessageBody.TabIndex = 5;
     this.labelMessageBody.Text     = "Message Body";
     //
     // panelMessagesView
     //
     this.panelMessagesView.Controls.Add(this.listMessages);
     this.panelMessagesView.Controls.Add(this.labelMessageNumber);
     this.panelMessagesView.Dock     = System.Windows.Forms.DockStyle.Left;
     this.panelMessagesView.Location = new System.Drawing.Point(0, 0);
     this.panelMessagesView.Name     = "panelMessagesView";
     this.panelMessagesView.Size     = new System.Drawing.Size(281, 196);
     this.panelMessagesView.TabIndex = 5;
     //
     // listMessages
     //
     this.listMessages.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                       | System.Windows.Forms.AnchorStyles.Left)
                                                                      | System.Windows.Forms.AnchorStyles.Right)));
     this.listMessages.ContextMenu  = this.contextMenuMessages;
     this.listMessages.Location     = new System.Drawing.Point(8, 24);
     this.listMessages.Name         = "listMessages";
     this.listMessages.Size         = new System.Drawing.Size(266, 160);
     this.listMessages.TabIndex     = 8;
     this.listMessages.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.ListMessagesMessageSelected);
     //
     // contextMenuMessages
     //
     this.contextMenuMessages.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
         this.menuDeleteMessage,
         this.menuViewSource
     });
     //
     // menuDeleteMessage
     //
     this.menuDeleteMessage.Index  = 0;
     this.menuDeleteMessage.Text   = "Delete Mail";
     this.menuDeleteMessage.Click += new System.EventHandler(this.MenuDeleteMessageClick);
     //
     // menuViewSource
     //
     this.menuViewSource.Index  = 1;
     this.menuViewSource.Text   = "View source";
     this.menuViewSource.Click += new System.EventHandler(this.MenuViewSourceClick);
     //
     // labelMessageNumber
     //
     this.labelMessageNumber.Location = new System.Drawing.Point(8, 8);
     this.labelMessageNumber.Name     = "labelMessageNumber";
     this.labelMessageNumber.Size     = new System.Drawing.Size(136, 16);
     this.labelMessageNumber.TabIndex = 1;
     this.labelMessageNumber.Text     = "Messages";
     //
     // attachmentPanel
     //
     this.attachmentPanel.Controls.Add(this.listAttachments);
     this.attachmentPanel.Controls.Add(this.labelAttachments);
     this.attachmentPanel.Dock     = System.Windows.Forms.DockStyle.Right;
     this.attachmentPanel.Location = new System.Drawing.Point(667, 0);
     this.attachmentPanel.Name     = "attachmentPanel";
     this.attachmentPanel.Size     = new System.Drawing.Size(208, 196);
     this.attachmentPanel.TabIndex = 4;
     this.attachmentPanel.Visible  = false;
     //
     // listAttachments
     //
     this.listAttachments.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                          | System.Windows.Forms.AnchorStyles.Left)
                                                                         | System.Windows.Forms.AnchorStyles.Right)));
     this.listAttachments.Location      = new System.Drawing.Point(8, 24);
     this.listAttachments.Name          = "listAttachments";
     this.listAttachments.ShowLines     = false;
     this.listAttachments.ShowRootLines = false;
     this.listAttachments.Size          = new System.Drawing.Size(192, 160);
     this.listAttachments.TabIndex      = 10;
     this.listAttachments.AfterSelect  += new System.Windows.Forms.TreeViewEventHandler(this.ListAttachmentsAttachmentSelected);
     //
     // labelAttachments
     //
     this.labelAttachments.Location = new System.Drawing.Point(12, 8);
     this.labelAttachments.Name     = "labelAttachments";
     this.labelAttachments.Size     = new System.Drawing.Size(136, 16);
     this.labelAttachments.TabIndex = 3;
     this.labelAttachments.Text     = "Attachments";
     //
     // saveFile
     //
     this.saveFile.Title = "Save Attachment";
     //
     // TestForm
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.ClientSize        = new System.Drawing.Size(865, 444);
     this.Controls.Add(this.panelMiddle);
     this.Controls.Add(this.panelProperties);
     this.Controls.Add(this.panelTop);
     this.Icon          = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
     this.Name          = "TestForm";
     this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
     this.Text          = "OpenPOP.NET Test Application";
     this.WindowState   = System.Windows.Forms.FormWindowState.Maximized;
     this.panelTop.ResumeLayout(false);
     this.panelTop.PerformLayout();
     this.panelProperties.ResumeLayout(false);
     ((System.ComponentModel.ISupportInitialize)(this.gridHeaders)).EndInit();
     this.panelMiddle.ResumeLayout(false);
     this.panelMessageBody.ResumeLayout(false);
     this.panelMessageBody.PerformLayout();
     this.panelMessagesView.ResumeLayout(false);
     this.attachmentPanel.ResumeLayout(false);
     this.ResumeLayout(false);
 }
Пример #36
0
 /*
  * Réinitialise le treeView
  */
 public static void refreshTreeview(TreeView treeView1, DataSet dataSetTreeView, Bitmap tagBitmap)
 {
     treeView1.Nodes.Clear();
     dataSetTreeView.Clear();
     Tree.InitialiseTreeView(treeView1, dataSetTreeView, tagBitmap);
 }
Пример #37
0
 public void Test(string strField, string strValue, bool bFindByNodeText, TreeView tree, SqlConnection conn)
 {
     nodeFinder.Init(strField, strValue, bFindByNodeText, tree, conn);
     nodeFinder.FindNext();
 }
Пример #38
0
 //TODO: no es muy feliz que un DAO conozca elementos de la GUI
 public void fillTree(TreeView treeView)
 {
     this.parsearNivel(null, "Padre is null", this.table(), treeView);
 }
Пример #39
0
        /*
         * Si le noeud de la checklist n'est pas affiché dans le treeView, affiche ce noeud à l'écran
         */
        public static void expandNodes(string titleCategory, string titleTopic, string titleChecklist, TreeView treeView1, TreeNode nodeCategory, TreeNode nodeTopic, TreeNode nodeChecklist)
        {
            treeView1.CollapseAll();
            foreach (TreeNode node in treeView1.Nodes)
            {
                if (node.Level == 0 && node.Text == titleCategory)
                {
                    if (node.IsExpanded == false)
                    {
                        node.Expand();
                    }
                    nodeCategory = node;

                    foreach (TreeNode children in node.Nodes)
                    {
                        if (children.Level == 1 && children.Text == titleTopic)
                        {
                            if (children.IsExpanded == false)
                            {
                                children.Expand();
                            }
                            nodeTopic = children;

                            foreach (TreeNode check in children.Nodes)
                            {
                                if (check.Level == 2 && check.Text == titleChecklist)
                                {
                                    if (check.IsSelected == false)
                                    {
                                        treeView1.SelectedNode = check;
                                    }
                                    nodeChecklist = check;
                                }
                            }
                        }
                    }
                }
            }
        }
Пример #40
0
        IGenerateAction ICodeGenerator.InitalizeSelection(CodeGenerationOptions options, TreeView treeView)
        {
            var exportMethods = new ExportMethods(this, options);

            exportMethods.Initialize(treeView);
            return(exportMethods);
        }
Пример #41
0
 public static IEnumerable <TreeNode> AllNodes(this TreeView tree)
 {
     return(tree.Nodes.AllNodes());
 }
Пример #42
0
        public FileDialog()
        {
            Padding   = new Margin(8);
            Resizable = true;

            Split      = new SplitContainer();
            Split.Dock = DockStyle.Fill;
            Controls.Add(Split);

            Tree      = new TreeView();
            Tree.Dock = DockStyle.Fill;
            Tree.SelectedNodeChanged += Tree_SelectedNodeChanged;
            Tree.Indent                        = 8;
            Tree.Scrollbar.Size                = new Point(14, 10);
            Tree.Scrollbar.Slider.Style        = "vscrollTrack";
            Tree.Scrollbar.Slider.Button.Style = "vscrollButton";
            Tree.Scrollbar.ButtonUp.Style      = "vscrollUp";
            Tree.Scrollbar.ButtonUp.Size       = new Point(10, 20);
            Tree.Scrollbar.ButtonDown.Style    = "vscrollUp";
            Tree.Scrollbar.ButtonDown.Size     = new Point(10, 20);
            Tree.Scrollbar.Slider.Margin       = new Margin(0, 2, 0, 2);
            Split.SplitFrame1.Controls.Add(Tree);

            View      = new ListView();
            View.Dock = DockStyle.Fill;
            View.Columns.Add(new ListView.Column {
                Text = "Name", Aspect = "Name", Width = 120, MinWidth = 64
            });
            View.Columns.Add(new ListView.Column {
                Text = "Size", Aspect = "Size", Width = 120, MinWidth = 64
            });
            View.Columns.Add(new ListView.Column {
                Text = "Type", Aspect = "Type", Width = 120, MinWidth = 64
            });
            View.StretchLastColumn = false;
            View.FullRowSelect     = true;

            View.CreateHeader = delegate(object sender, ListView.FormatHeaderEventArgs args)
            {
                var header = new Button
                {
                    Dock      = DockStyle.Fill,
                    Text      = args.Column.Text,
                    AllowDrop = true
                };

                header.MouseClick += delegate
                {
                    if (args.Column.Aspect == "Name")
                    {
                        View.Sort <PathInfo>((a, b) => a.Name.CompareTo(b.Name));
                    }
                    else if (args.Column.Aspect == "Size")
                    {
                        View.Sort <PathInfo>((a, b) => a.Size.CompareTo(b.Size));
                    }
                    else if (args.Column.Aspect == "Type")
                    {
                        View.Sort <PathInfo>((a, b) => a.Type.CompareTo(b.Type));
                    }
                };

                header.MouseDrag += delegate(Control snd, MouseEventArgs e)
                {
                    var drag = new Label();
                    drag.Size     = snd.Size;
                    drag.Position = snd.Location;
                    drag.Style    = snd.Style;
                    drag.Text     = ((Button)snd).Text;

                    DoDragDrop(drag);
                };

                header.DragDrop += delegate { };

                return(header);
            };

            View.CreateCell = delegate(object sender, ListView.FormatCellEventArgs args)
            {
                var aspect = View.GetAspectValue(args.Model, args.Column);

                return(new Button
                {
                    Scissor = false,
                    Size = new Point(28, 28),
                    Dock = DockStyle.Top,
                    Text = aspect,
                    Tooltip = aspect,
                    TextAlign = Alignment.MiddleLeft,
                    Style = "label",
                    AutoEllipsis = true
                });
            };

            Split.SplitFrame2.Controls.Add(View);
        }
Пример #43
0
        private void OperationTreeView_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs <object> e)
        {
            TreeView treeview = sender as TreeView;

            if (treeview == null)
            {
                return;
            }
            OperationNode selectedItem = treeview.SelectedItem as OperationNode;

            if (selectedItem == null)
            {
                return;
            }
            if (selectedItem.Operation == null)
            {
                return;
            }

            UserControl paramSettingUserControl = null;

            if (paramSettingPanelDict.ContainsKey(selectedItem.Operation.OperationType))
            {
                paramSettingUserControl = paramSettingPanelDict[selectedItem.Operation.OperationType];
            }
            else
            {
                switch (selectedItem.Operation.OperationType)
                {
                case OperationType.Experiment:
                    paramSettingUserControl = new ExperimentSettingPanel();
                    break;

                case OperationType.GeneralParam:
                    paramSettingUserControl = new GeneralParamSettingPanel();
                    break;

                case OperationType.Data:
                    paramSettingUserControl = new DataSettingPanel();
                    break;

                case OperationType.BackgroundData:
                    paramSettingUserControl = new BackgroundDataSettingPanel();
                    break;

                case OperationType.Sample:
                    paramSettingUserControl = new SampleSettingPanel();
                    break;

                case OperationType.Scan:
                    paramSettingUserControl = new ScanSettingPanel();
                    break;

                case OperationType.Trigger:
                    paramSettingUserControl = new TriggerSettingPanel();
                    break;

                case OperationType.Time:
                    paramSettingUserControl = new TimeSettingPanel();
                    break;

                case OperationType.Temperature:
                    paramSettingUserControl = new TemperatureSettingPanel();
                    break;

                case OperationType.MicroplateReader_Position:
                    paramSettingUserControl = new MPRSettingPanel();
                    break;

                case OperationType.WaveLength:
                    paramSettingUserControl = new WavelengthSettingPanel();
                    break;
                }
                paramSettingPanelDict.Add(selectedItem.Operation.OperationType, paramSettingUserControl);
            }

            if (paramSettingUserControl != null)
            {
                tabItemParamSetting.Content         = paramSettingUserControl;
                paramSettingUserControl.DataContext = selectedItem;
            }
        }
Пример #44
0
        public ManuallyPopulateTreeView()
        {
            Title = "Manually Populate TreeView";

            TreeView tree = new TreeView();

            Content = tree;

            TreeViewItem itemAnimal = new TreeViewItem();

            itemAnimal.Header = "Animal";
            tree.Items.Add(itemAnimal);

            TreeViewItem itemDog = new TreeViewItem();

            itemDog.Header = "Dog";
            itemDog.Items.Add("Poodle");
            itemDog.Items.Add("Irish Setter");
            itemDog.Items.Add("German Shepherd");
            itemAnimal.Items.Add(itemDog);

            TreeViewItem itemCat = new TreeViewItem();

            itemCat.Header = "Cat";
            itemCat.Items.Add("Calico");

            TreeViewItem item = new TreeViewItem();

            item.Header = "Alley Cat";
            itemCat.Items.Add(item);

            Button btn = new Button();

            btn.Content = "Noodles";
            itemCat.Items.Add(btn);

            itemCat.Items.Add("Siamese");
            itemAnimal.Items.Add(itemCat);

            TreeViewItem itemPrimate = new TreeViewItem();

            itemPrimate.Header = "Primate";
            itemPrimate.Items.Add("Chimpanzee");
            itemPrimate.Items.Add("Bonobo");
            itemPrimate.Items.Add("Human");
            itemAnimal.Items.Add(itemPrimate);

            TreeViewItem itemMineral = new TreeViewItem();

            itemMineral.Header = "Mineral";
            itemMineral.Items.Add("Calcium");
            itemMineral.Items.Add("Zinc");
            itemMineral.Items.Add("Iron");
            tree.Items.Add(itemMineral);

            TreeViewItem itemVegetable = new TreeViewItem();

            itemVegetable.Header = "Vegetable";
            itemVegetable.Items.Add("Carrot");
            itemVegetable.Items.Add("Asparagus");
            itemVegetable.Items.Add("Broccoli");
            tree.Items.Add(itemVegetable);
        }
Пример #45
0
        private void treeView_AfterCheck(object sender, TreeViewEventArgs e)
        {
            TreeView from = sender as TreeView;
            TreeView to   = from.Name == "treeViewAzioni" ? treeViewCategorie : treeViewAzioni;

            from.AfterCheck -= treeView_AfterCheck;
            to.AfterCheck   -= treeView_AfterCheck;

            List <TreeNode> justChecked = new List <TreeNode>();

            if (e.Node.Nodes.Count > 0)
            {
                foreach (TreeNode node in e.Node.Nodes)
                {
                    node.Checked = e.Node.Checked;
                    justChecked.Add(node);
                }
            }
            else
            {
                justChecked.Add(e.Node);
            }

            string filter = from.Name == "treeViewAzioni" ? "SiglaAzione" : "SiglaCategoria";
            string field  = from.Name == "treeViewAzioni" ? "SiglaCategoria" : "SiglaAzione";


            if (e.Node.Checked)
            {
                foreach (TreeNode node in justChecked)
                {
                    _azioniCategorie.RowFilter = filter + " = '" + node.Name + "' AND IdApplicazione = " + Workbook.IdApplicazione;
                    foreach (DataRowView azioneCategoria in _azioniCategorie)
                    {
                        to.Nodes.Find(azioneCategoria[field].ToString(), true)[0].Checked = true;
                    }
                }
            }
            else
            {
                Dictionary <string, bool> checkedNodes = new Dictionary <string, bool>();
                ThroughAllNodes(from.Nodes, n =>
                {
                    if (n.Nodes.Count == 0)
                    {
                        _azioniCategorie.RowFilter = filter + " = '" + n.Name + "' AND IdApplicazione = " + Workbook.IdApplicazione;
                        foreach (DataRowView azioneCategoria in _azioniCategorie)
                        {
                            if (checkedNodes.ContainsKey(azioneCategoria[field].ToString()))
                            {
                                checkedNodes[azioneCategoria[field].ToString()] = checkedNodes[azioneCategoria[field].ToString()] || n.Checked;
                            }
                            else
                            {
                                checkedNodes.Add(azioneCategoria[field].ToString(), n.Checked);
                            }
                        }
                    }
                });

                ThroughAllNodes(to.Nodes, n =>
                {
                    if (n.Nodes.Count == 0)
                    {
                        n.Checked = n.Checked && checkedNodes[n.Name];
                    }
                });
            }

            CheckParents();
            CaricaEntita();
            ColoraNodi();

            to.AfterCheck   += treeView_AfterCheck;
            from.AfterCheck += treeView_AfterCheck;
        }
Пример #46
0
 void OnRunAllClicked(object sender, EventArgs args)
 {
     RunTest(TreeView.GetRootNode(), null);
 }
Пример #47
0
 //------
 public TreeAdapter(TreeView tr)
 {
     tree = tr;
 }
Пример #48
0
        void AddEventsToTreeView(ControlEvent ce, TreeView treeView, bool includeControlName)
        {
            string eventName;

            if (includeControlName)
            {
                eventName = String.Format("{0}::{1}", ce.ControlName, ce.EventName);
            }
            else
            {
                eventName = ce.EventName;
            }

            TreeNode node = new TreeNode(String.Format("{0} {1}",
                                                       DateTime.Now.Ticks - startTicks, eventName));

            node.Tag = ce;
            treeView.Nodes.Add(node);

            TreeNode eventArgsNode = new TreeNode(ce.EventArgs.GetType().FullName);

            eventArgsNode.Tag = ce;
            node.Nodes.Add(eventArgsNode);

            // Special case: save reflection overhead if this is an EventArgs
            // as this contains no values

            if (ce.EventArgs.GetType() != typeof(EventArgs))
            {
                Type eventArgsType = ce.EventArgs.GetType();

                // Iterate through properties and add details of each to the tree view.
                foreach (PropertyInfo member in eventArgsType.GetProperties())
                {
                    try
                    {
                        TreeNode newNode = new TreeNode(
                            String.Format("[prop] {0} = {1}", member.Name,
                                          eventArgsType.GetProperty(member.Name).GetValue(ce.EventArgs, null).ToString()));
                        newNode.Tag = ce;
                        eventArgsNode.Nodes.Add(newNode);
                    }
                    catch (Exception) { }
                }
                // Iterate through public types
                foreach (MemberInfo type in eventArgsType.GetMembers())
                {
                    try
                    {
                        if (type.MemberType == MemberTypes.Field)
                        {
                            TreeNode newNode = new TreeNode(
                                String.Format("[field] {0} = {1}", type.Name,
                                              eventArgsType.GetField(type.Name).GetValue(ce.EventArgs).ToString()));
                            newNode.Tag = ce;
                            eventArgsNode.Nodes.Add(newNode);
                        }
                    }
                    catch (Exception) { }
                }
            }

            if (this.ScrollingEnabled)
            {
                treeView.SelectedNode = node;
            }
        }
Пример #49
0
        protected void Page_Load(object sender, EventArgs e)
        {
            #region "controles de la Master"
            ImageButton        ButtonCompra = (ImageButton)this.Master.FindControl("ButtonCompra");
            Label              LabelUser    = (Label)this.Master.FindControl("LabelUser");
            TreeView           myTreeView   = (TreeView)this.Master.FindControl("myTreeView");
            ContentPlaceHolder holder       = (ContentPlaceHolder)this.Master.FindControl("placeHolderControl");
            #endregion
            MiniCesta __controlCesta = (MiniCesta)Page.LoadControl(__rutaControlCesta);
            holder.Controls.Add(__controlCesta);

            __controlFichero = new Controlador_Acceso_Ficheros();
            __controlTabla   = new ControladorTablas(this.Page);

            librosFichero = __controlFichero.infoLibros("./Ficheros/libros.txt");

            #region "sesionUser"
            if (this.Session["Usuario"] != null)
            {
                LabelUser.Text = (string)Session["Usuario"];
            }
            else
            {
                LabelUser.Text = "Parece que el nombre no se almacena bien";
            }

            ///---llamada a procedimiento interno para ver variables post

            #endregion

            mostrar();

            #region "isPostback"
            if (this.IsPostBack)
            {
                foreach (string clave in this.Request.Params.AllKeys)
                {
                    string claveRequest = this.Request.Params[clave];
                    switch (clave)
                    {
                    case "__EVENTTARGET":

                        if (claveRequest.Contains(myTreeView.ID))
                        {
                            char[] separador = new char[] { '\\' };
                            __categoriaPulsada = this.Request.Params["__EVENTARGUMENT"].ToString().Split(separador)[0].Substring(1);
                            LabelUser.Text     = "has seleccionado el nodo treeview: " + __categoriaPulsada;
                            //metodo que devuelve libros con categorías....

                            if (__categoriaPulsada == "Todos")
                            {
                                __controlTabla.rellenaTablaLibros(this.tablaLibros, librosFichero, false);
                            }

                            List <Libro> categoryList = __controlFichero.findByCategory(librosFichero, __categoriaPulsada);

                            __controlTabla.rellenaTablaLibros(this.tablaLibros, categoryList, true);
                        }

                        else if (claveRequest.Contains("linkButtonTitulo"))
                        {
                            string isbnLibro = ((string)claveRequest).Substring(((string)claveRequest).Length - 10, 10);
                            Response.Redirect("VistaDetallesLibro.aspx?isbn=" + isbnLibro);
                        }


                        break;

                    default:
                        break;
                    }
                    if (clave.Contains("botonCompra"))
                    {
                        string isbnLibro = ((string)clave).Substring(((string)clave).Length - 10, 10);

                        if (Request.Cookies["cesta"] != null)
                        {
                            HttpCookie miCookie = Request.Cookies["cesta"];
                            miCookie.Values["libros"] += isbnLibro + ":";
                            Response.Cookies.Add(miCookie);
                        }

                        __controlCesta.addItem();
                        __controlTabla.rellenaTablaLibros(this.tablaLibros, librosFichero, false);
                    }
                    else if (clave.Contains("botonVerCesta"))
                    {
                        Response.Redirect("VistaCesta.aspx");
                    }
                }
            }
            #endregion
            else
            {
                Response.Cookies["cesta"]["owner"]  = (string)this.Session["Usuario"];
                Response.Cookies["cesta"]["libros"] = "";
                Response.Cookies["cesta"].Expires   = DateTime.Now.AddDays(1);
                __controlTabla.rellenaTablaLibros(this.tablaLibros, librosFichero, false);
            }
        }
 public FolderBrowserContextMenu(FolderBrowerSidebar sidebar)
 {
     Sidebar           = sidebar;
     TreeFolderBrowser = sidebar.TreeFolderBrowser;
     Model             = mmApp.Model;
 }
Пример #51
0
        static void tv_SelectedNodeChanged(object sender, EventArgs e)
        {
            TreeView tv = (TreeView)sender;

            WebTest.CurrentTest.UserData = tv.SelectedNode.Text;
        }
Пример #52
0
 private void InitializeComponent()
 {
     this.components     = new System.ComponentModel.Container();
     this.kryptonPanel1  = new ComponentFactory.Krypton.Toolkit.KryptonPanel();
     this.txtFilePath    = new System.Windows.Forms.TextBox();
     this.ktxtFilePath   = new ComponentFactory.Krypton.Toolkit.KryptonTextBox();
     this.tvFileList     = new System.Windows.Forms.TreeView();
     this.ktvFileList    = new ComponentFactory.Krypton.Toolkit.KryptonTreeView();
     this.panel1         = new System.Windows.Forms.Panel();
     this.kryptonPanel2  = new ComponentFactory.Krypton.Toolkit.KryptonPanel();
     this.kbtnNewFolder  = new ComponentFactory.Krypton.Toolkit.KryptonButton();
     this.kbtnOk         = new ComponentFactory.Krypton.Toolkit.KryptonButton();
     this.kbtnCancel     = new ComponentFactory.Krypton.Toolkit.KryptonButton();
     this.ilSystemImages = new System.Windows.Forms.ImageList(this.components);
     this.kptxtFilePath  = new ExtendedControls.ExtendedToolkit.Controls.KryptonPromptTextBox();
     ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit();
     this.kryptonPanel1.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).BeginInit();
     this.kryptonPanel2.SuspendLayout();
     this.SuspendLayout();
     //
     // kryptonPanel1
     //
     this.kryptonPanel1.Controls.Add(this.txtFilePath);
     this.kryptonPanel1.Controls.Add(this.kptxtFilePath);
     this.kryptonPanel1.Controls.Add(this.ktxtFilePath);
     this.kryptonPanel1.Controls.Add(this.tvFileList);
     this.kryptonPanel1.Controls.Add(this.ktvFileList);
     this.kryptonPanel1.Dock     = System.Windows.Forms.DockStyle.Top;
     this.kryptonPanel1.Location = new System.Drawing.Point(0, 0);
     this.kryptonPanel1.Name     = "kryptonPanel1";
     this.kryptonPanel1.Size     = new System.Drawing.Size(491, 517);
     this.kryptonPanel1.TabIndex = 0;
     //
     // txtFilePath
     //
     this.txtFilePath.Font     = new System.Drawing.Font("Segoe UI", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.txtFilePath.Location = new System.Drawing.Point(12, 13);
     this.txtFilePath.Name     = "txtFilePath";
     this.txtFilePath.Size     = new System.Drawing.Size(466, 27);
     this.txtFilePath.TabIndex = 3;
     //
     // ktxtFilePath
     //
     this.ktxtFilePath.Location = new System.Drawing.Point(12, 13);
     this.ktxtFilePath.Name     = "ktxtFilePath";
     this.ktxtFilePath.Size     = new System.Drawing.Size(466, 27);
     this.ktxtFilePath.StateCommon.Content.Font = new System.Drawing.Font("Segoe UI", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.ktxtFilePath.TabIndex = 4;
     //
     // tvFileList
     //
     this.tvFileList.Font         = new System.Drawing.Font("Segoe UI", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.tvFileList.Location     = new System.Drawing.Point(11, 50);
     this.tvFileList.Name         = "tvFileList";
     this.tvFileList.Size         = new System.Drawing.Size(467, 451);
     this.tvFileList.TabIndex     = 3;
     this.tvFileList.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.tvFileList_AfterSelect);
     //
     // ktvFileList
     //
     this.ktvFileList.Location = new System.Drawing.Point(12, 50);
     this.ktvFileList.Name     = "ktvFileList";
     this.ktvFileList.Size     = new System.Drawing.Size(467, 451);
     this.ktvFileList.StateNormal.Node.Content.LongText.Font  = new System.Drawing.Font("Segoe UI", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.ktvFileList.StateNormal.Node.Content.ShortText.Font = new System.Drawing.Font("Segoe UI", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.ktvFileList.TabIndex     = 0;
     this.ktvFileList.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.ktvFileList_AfterSelect);
     //
     // panel1
     //
     this.panel1.BackColor = System.Drawing.SystemColors.ControlDarkDark;
     this.panel1.Dock      = System.Windows.Forms.DockStyle.Top;
     this.panel1.Location  = new System.Drawing.Point(0, 517);
     this.panel1.Name      = "panel1";
     this.panel1.Size      = new System.Drawing.Size(491, 3);
     this.panel1.TabIndex  = 1;
     //
     // kryptonPanel2
     //
     this.kryptonPanel2.Controls.Add(this.kbtnNewFolder);
     this.kryptonPanel2.Controls.Add(this.kbtnOk);
     this.kryptonPanel2.Controls.Add(this.kbtnCancel);
     this.kryptonPanel2.Dock     = System.Windows.Forms.DockStyle.Fill;
     this.kryptonPanel2.Location = new System.Drawing.Point(0, 520);
     this.kryptonPanel2.Name     = "kryptonPanel2";
     this.kryptonPanel2.Size     = new System.Drawing.Size(491, 47);
     this.kryptonPanel2.TabIndex = 2;
     //
     // kbtnNewFolder
     //
     this.kbtnNewFolder.DialogResult = System.Windows.Forms.DialogResult.OK;
     this.kbtnNewFolder.Location     = new System.Drawing.Point(12, 7);
     this.kbtnNewFolder.Name         = "kbtnNewFolder";
     this.kbtnNewFolder.Size         = new System.Drawing.Size(118, 28);
     this.kbtnNewFolder.StateCommon.Content.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.kbtnNewFolder.TabIndex    = 2;
     this.kbtnNewFolder.Values.Text = "New &Folder";
     this.kbtnNewFolder.Click      += new System.EventHandler(this.kbtnNewFolder_Click);
     //
     // kbtnOk
     //
     this.kbtnOk.DialogResult = System.Windows.Forms.DialogResult.OK;
     this.kbtnOk.Location     = new System.Drawing.Point(292, 7);
     this.kbtnOk.Name         = "kbtnOk";
     this.kbtnOk.Size         = new System.Drawing.Size(90, 28);
     this.kbtnOk.StateCommon.Content.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.kbtnOk.TabIndex    = 1;
     this.kbtnOk.Values.Text = "&Ok";
     this.kbtnOk.Click      += new System.EventHandler(this.kbtnOk_Click);
     //
     // kbtnCancel
     //
     this.kbtnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
     this.kbtnCancel.Location     = new System.Drawing.Point(388, 7);
     this.kbtnCancel.Name         = "kbtnCancel";
     this.kbtnCancel.Size         = new System.Drawing.Size(90, 28);
     this.kbtnCancel.StateCommon.Content.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.kbtnCancel.TabIndex    = 0;
     this.kbtnCancel.Values.Text = "&Cancel";
     this.kbtnCancel.Click      += new System.EventHandler(this.kbtnCancel_Click);
     //
     // ilSystemImages
     //
     this.ilSystemImages.ColorDepth       = System.Windows.Forms.ColorDepth.Depth8Bit;
     this.ilSystemImages.ImageSize        = new System.Drawing.Size(16, 16);
     this.ilSystemImages.TransparentColor = System.Drawing.Color.Transparent;
     //
     // kptxtFilePath
     //
     this.kptxtFilePath.DrawPrompt       = true;
     this.kptxtFilePath.FocusSelect      = true;
     this.kptxtFilePath.Font             = new System.Drawing.Font("Segoe UI", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.kptxtFilePath.Location         = new System.Drawing.Point(12, 13);
     this.kptxtFilePath.Name             = "kptxtFilePath";
     this.kptxtFilePath.PromptForeColour = System.Drawing.SystemColors.GrayText;
     this.kptxtFilePath.PromptText       = "Enter directory path...";
     this.kptxtFilePath.PromptTypeface   = new System.Drawing.Font("Segoe UI", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.kptxtFilePath.Size             = new System.Drawing.Size(466, 27);
     this.kptxtFilePath.TabIndex         = 2;
     //
     // KryptonFileBrowser
     //
     this.ClientSize = new System.Drawing.Size(491, 567);
     this.Controls.Add(this.kryptonPanel2);
     this.Controls.Add(this.panel1);
     this.Controls.Add(this.kryptonPanel1);
     this.Font            = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
     this.MaximizeBox     = false;
     this.MinimizeBox     = false;
     this.Name            = "KryptonFileBrowser";
     this.ShowIcon        = false;
     this.ShowInTaskbar   = false;
     this.StartPosition   = System.Windows.Forms.FormStartPosition.CenterScreen;
     this.Text            = "File Browser";
     this.TextExtra       = "(Beta)";
     this.Load           += new System.EventHandler(this.KryptonFileBrowser_Load);
     ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit();
     this.kryptonPanel1.ResumeLayout(false);
     this.kryptonPanel1.PerformLayout();
     ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).EndInit();
     this.kryptonPanel2.ResumeLayout(false);
     this.ResumeLayout(false);
 }
Пример #53
0
 private static void SetStartItem(TreeView element, TreeViewItem value)
 {
     element.SetValue(StartItemProperty, value);
 }
Пример #54
0
 public static void SetSelectedItems(TreeView element, IList value)
 {
     element.SetValue(SelectedItemsProperty, value);
 }
Пример #55
0
 private static TreeViewItem GetStartItem(TreeView element)
 {
     return((TreeViewItem)element.GetValue(StartItemProperty));
 }
Пример #56
0
        public static void TreeViewUpdate(AppManager apm, BACnetManager bnm, TreeView treeViewMessageLog, bool logmessages)
        {
            if (bnm.BACnetMessageLog.Count > 0)
            {
                while (bnm.BACnetMessageLog.Count > 0)
                {
                    // remove the first treenode

                    _count++;

                    PacketLog pktlog = bnm.BACnetMessageLog.Dequeue();

                    if (!logmessages)
                    {
                        // discard the message, unless it has been logged as an error
                        if (pktlog.BACnetPacket != null && !pktlog.BACnetPacket.errorFlag)
                        {
                            continue;
                        }
                    }


                    TreeNode           ntn           = new TreeNode();
                    TreeNodeCollection addBACnetHere = treeViewMessageLog.Nodes;

                    if (pktlog.BACnetPacket != null)
                    {
                        // bump the rest up a level
                        TreeNode nntn = new TreeNode();
                        nntn.Text = "BACnet";

                        if (pktlog.sending == true)
                        {
                            nntn.Text      = _count.ToString() + " BACnet Sent";
                            nntn.BackColor = Color.LightPink;
                        }
                        else
                        {
                            nntn.Text      = _count.ToString() + " BACnet Recd";
                            nntn.BackColor = Color.LightGreen;
                        }

                        // display some NPDU parameters

                        if (pktlog.BACnetPacket.npdu.isBroadcast)
                        {
                            nntn.Nodes.Add("To:   Broadcast");
                        }
                        else
                        {
                            if (pktlog.BACnetPacket.dadr != null)
                            {
                                nntn.Nodes.Add("To:   " + pktlog.BACnetPacket.dadr.ToString());
                            }
                        }

                        // From address

                        if (pktlog.BACnetPacket.directlyConnectedIPEndPointOfDevice != null)
                        {
                            nntn.Nodes.Add("From: " + pktlog.BACnetPacket.directlyConnectedIPEndPointOfDevice.ToString());
                        }


                        if (pktlog.BACnetPacket.npdu.expectingReply)
                        {
                            nntn.Nodes.Add("Expecting Reply");
                        }

                        if (!pktlog.BACnetPacket.npdu.isNPDUmessage)
                        {
                            switch (pktlog.BACnetPacket.pduType)
                            {
                            case BACnetEnums.BACNET_PDU_TYPE.PDU_TYPE_UNCONFIRMED_SERVICE_REQUEST:
                                nntn.Text += " Unconfirmed Service Request -";
                                switch (pktlog.BACnetPacket.unconfirmedServiceChoice)
                                {
                                case BACnetEnums.BACNET_UNCONFIRMED_SERVICE.SERVICE_UNCONFIRMED_I_AM:
                                    nntn.Text += " I-Am";
                                    break;

                                case BACnetEnums.BACNET_UNCONFIRMED_SERVICE.SERVICE_UNCONFIRMED_WHO_IS:
                                    nntn.Text += " Who-Is";
                                    break;

                                default:
                                    nntn.Text += " m0019 Unknown BACnet unconfirmed service type - fix line 196 PacketLog.cs";
                                    break;
                                }
                                break;


                            case BACnetEnums.BACNET_PDU_TYPE.PDU_TYPE_CONFIRMED_SERVICE_REQUEST:
                                nntn.Text += " Confirmed Service Request";
                                switch (pktlog.BACnetPacket.confirmedServiceChoice)
                                {
                                case BACnetEnums.BACNET_CONFIRMED_SERVICE.SERVICE_CONFIRMED_READ_PROPERTY:
                                    nntn.Nodes.Add("Read Property " + pktlog.BACnetPacket.propertyID.ToString());
                                    break;

                                case BACnetEnums.BACNET_CONFIRMED_SERVICE.SERVICE_CONFIRMED_READ_PROP_MULTIPLE:
                                    nntn.Nodes.Add("Read Property Multiple");
                                    break;

                                default:
                                    nntn.Nodes.Add("m0014 Unknown BACnet confirmed service type " + pktlog.BACnetPacket.confirmedServiceChoice.ToString());
                                    break;
                                }
                                break;

                            case BACnetEnums.BACNET_PDU_TYPE.PDU_TYPE_COMPLEX_ACK:
                                nntn.Text += " Complex ACK -";
                                switch (pktlog.BACnetPacket.confirmedServiceChoice)
                                {
                                case BACnetEnums.BACNET_CONFIRMED_SERVICE.SERVICE_CONFIRMED_READ_PROPERTY:
                                    nntn.Text += " Read Property " + pktlog.BACnetPacket.propertyID.ToString();
                                    break;

                                case BACnetEnums.BACNET_CONFIRMED_SERVICE.SERVICE_CONFIRMED_READ_PROP_MULTIPLE:
                                    nntn.Text += " Read Property Multiple";
                                    break;

                                default:
                                    nntn.Text += " m0036 Unknown BACnet confirmed service type";
                                    break;
                                }
                                break;

                            case BACnetEnums.BACNET_PDU_TYPE.PDU_TYPE_REJECT:
                                nntn.Text += " Reject PDU - " + pktlog.BACnetPacket.pduRejectReason.ToString() + " [" + pktlog.BACnetPacket.invokeID.ToString() + "]";
                                break;

                            case BACnetEnums.BACNET_PDU_TYPE.PDU_TYPE_ABORT:
                                apm.MessageTodo("m0092 Resolve pktlog.bacnetpacket.pdutyp " + pktlog.BACnetPacket.pduType.ToString());
                                break;

                            default:
                                apm.MessageTodo("m0015 Resolve pktlog.bacnetpacket.pdutyp " + pktlog.BACnetPacket.pduType.ToString());
                                break;
                            }
                        }
                        else if (pktlog.BACnetPacket.apdu_present)
                        {
                            apm.MessageTodo("m0018 I dont expect to see this");
                        }
                        else
                        {
                            // todo, clean up this flag one day
                            nntn.Nodes.Add("NPDU Function: " + pktlog.BACnetPacket.npdu.function.ToString());
                        }
                        addBACnetHere.Add(nntn);
                    }

                    treeViewMessageLog.ExpandAll();

                    // remove all the earlier nodes...
                    while (treeViewMessageLog.Nodes.Count > 150)
                    {
                        treeViewMessageLog.Nodes.RemoveAt(0);
                    }
                }
            }
        }
Пример #57
0
        public override void Initialize(NodeBuilder[] builders, TreePadOption[] options, string menuPath)
        {
            base.Initialize(builders, options, menuPath);

            testChangedHandler            = (EventHandler)DispatchService.GuiDispatch(new EventHandler(OnDetailsTestChanged));
            testService.TestSuiteChanged += (EventHandler)DispatchService.GuiDispatch(new EventHandler(OnTestSuiteChanged));
            paned = new VPaned();

            VBox            vbox       = new VBox();
            DockItemToolbar topToolbar = Window.GetToolbar(PositionType.Top);

            buttonRunAll             = new Button(new Gtk.Image(Gtk.Stock.GoUp, IconSize.Menu));
            buttonRunAll.Clicked    += new EventHandler(OnRunAllClicked);
            buttonRunAll.Sensitive   = true;
            buttonRunAll.TooltipText = GettextCatalog.GetString("Run all tests");
            topToolbar.Add(buttonRunAll);

            buttonRun             = new Button(new Gtk.Image(Gtk.Stock.Execute, IconSize.Menu));
            buttonRun.Clicked    += new EventHandler(OnRunClicked);
            buttonRun.Sensitive   = true;
            buttonRun.TooltipText = GettextCatalog.GetString("Run test");
            topToolbar.Add(buttonRun);

            buttonStop             = new Button(new Gtk.Image(Gtk.Stock.Stop, IconSize.Menu));
            buttonStop.Clicked    += new EventHandler(OnStopClicked);
            buttonStop.Sensitive   = false;
            buttonStop.TooltipText = GettextCatalog.GetString("Cancel running test");
            topToolbar.Add(buttonStop);
            topToolbar.ShowAll();

            vbox.PackEnd(base.Control, true, true, 0);
            vbox.FocusChain = new Gtk.Widget [] { base.Control };

            paned.Pack1(vbox, true, true);

            detailsPad = new VBox();

            EventBox eb     = new EventBox();
            HBox     header = new HBox();

            eb.Add(header);

            detailLabel         = new HeaderLabel();
            detailLabel.Padding = 6;

            Button hb = new Button(new Gtk.Image("gtk-close", IconSize.SmallToolbar));

            hb.Relief   = ReliefStyle.None;
            hb.Clicked += new EventHandler(OnCloseDetails);
            header.PackEnd(hb, false, false, 0);

            hb          = new Button(new Gtk.Image("gtk-go-back", IconSize.SmallToolbar));
            hb.Relief   = ReliefStyle.None;
            hb.Clicked += new EventHandler(OnGoBackTest);
            header.PackEnd(hb, false, false, 0);

            header.Add(detailLabel);
            Gdk.Color hcol = eb.Style.Background(StateType.Normal);
            hcol.Red   = (ushort)(((double)hcol.Red) * 0.9);
            hcol.Green = (ushort)(((double)hcol.Green) * 0.9);
            hcol.Blue  = (ushort)(((double)hcol.Blue) * 0.9);
            //	eb.ModifyBg (StateType.Normal, hcol);

            detailsPad.PackStart(eb, false, false, 0);

            VPaned panedDetails = new VPaned();

            panedDetails.BorderWidth = 3;
            VBox boxPaned1 = new VBox();

            chart = new TestChart();
            chart.ButtonPressEvent += OnChartButtonPress;
            chart.SelectionChanged += new EventHandler(OnChartDateChanged);
            chart.HeightRequest     = 50;

            Toolbar toolbar = new Toolbar();

            toolbar.IconSize     = IconSize.SmallToolbar;
            toolbar.ToolbarStyle = ToolbarStyle.Icons;
            toolbar.ShowArrow    = false;
            ToolButton but = new ToolButton("gtk-zoom-in");

            but.Clicked += new EventHandler(OnZoomIn);
            toolbar.Insert(but, -1);

            but          = new ToolButton("gtk-zoom-out");
            but.Clicked += new EventHandler(OnZoomOut);
            toolbar.Insert(but, -1);

            but          = new ToolButton("gtk-go-back");
            but.Clicked += new EventHandler(OnChartBack);
            toolbar.Insert(but, -1);

            but          = new ToolButton("gtk-go-forward");
            but.Clicked += new EventHandler(OnChartForward);
            toolbar.Insert(but, -1);

            but          = new ToolButton("gtk-goto-last");
            but.Clicked += new EventHandler(OnChartLast);
            toolbar.Insert(but, -1);

            boxPaned1.PackStart(toolbar, false, false, 0);
            boxPaned1.PackStart(chart, true, true, 0);

            panedDetails.Pack1(boxPaned1, false, false);

            // Detailed test information --------

            infoBook = new ButtonNotebook();
            infoBook.PageLoadRequired += new EventHandler(OnPageLoadRequired);

            // Info - Group summary

            Frame          tf = new Frame();
            ScrolledWindow sw = new ScrolledWindow();

            detailsTree = new TreeView();

            detailsTree.HeadersVisible = true;
            detailsTree.RulesHint      = true;
            detailsStore = new ListStore(typeof(object), typeof(string), typeof(string), typeof(string), typeof(string));

            CellRendererText trtest = new CellRendererText();
            CellRendererText tr;

            TreeViewColumn col3 = new TreeViewColumn();

            col3.Expand = false;
//			col3.Alignment = 0.5f;
            col3.Widget = new Gtk.Image(CircleImage.Success);
            col3.Widget.Show();
            tr = new CellRendererText();
//			tr.Xalign = 0.5f;
            col3.PackStart(tr, false);
            col3.AddAttribute(tr, "markup", 2);
            detailsTree.AppendColumn(col3);

            TreeViewColumn col4 = new TreeViewColumn();

            col4.Expand = false;
//			col4.Alignment = 0.5f;
            col4.Widget = new Gtk.Image(CircleImage.Failure);
            col4.Widget.Show();
            tr = new CellRendererText();
//			tr.Xalign = 0.5f;
            col4.PackStart(tr, false);
            col4.AddAttribute(tr, "markup", 3);
            detailsTree.AppendColumn(col4);

            TreeViewColumn col5 = new TreeViewColumn();

            col5.Expand = false;
//			col5.Alignment = 0.5f;
            col5.Widget = new Gtk.Image(CircleImage.NotRun);
            col5.Widget.Show();
            tr = new CellRendererText();
//			tr.Xalign = 0.5f;
            col5.PackStart(tr, false);
            col5.AddAttribute(tr, "markup", 4);
            detailsTree.AppendColumn(col5);

            TreeViewColumn col1 = new TreeViewColumn();

//			col1.Resizable = true;
//			col1.Expand = true;
            col1.Title = "Test";
            col1.PackStart(trtest, true);
            col1.AddAttribute(trtest, "markup", 1);
            detailsTree.AppendColumn(col1);

            detailsTree.Model = detailsStore;

            sw.Add(detailsTree);
            tf.Add(sw);
            tf.ShowAll();

            TestSummaryPage = infoBook.AddPage(GettextCatalog.GetString("Summary"), tf);

            // Info - Regressions list

            tf = new Frame();
            sw = new ScrolledWindow();
            tf.Add(sw);
            regressionTree = new TreeView();
            regressionTree.HeadersVisible = false;
            regressionTree.RulesHint      = true;
            regressionStore = new ListStore(typeof(object), typeof(string), typeof(Pixbuf));

            CellRendererText trtest2 = new CellRendererText();
            var pr = new CellRendererPixbuf();

            TreeViewColumn col = new TreeViewColumn();

            col.PackStart(pr, false);
            col.AddAttribute(pr, "pixbuf", 2);
            col.PackStart(trtest2, false);
            col.AddAttribute(trtest2, "markup", 1);
            regressionTree.AppendColumn(col);
            regressionTree.Model = regressionStore;
            sw.Add(regressionTree);
            tf.ShowAll();

            TestRegressionsPage = infoBook.AddPage(GettextCatalog.GetString("Regressions"), tf);

            // Info - Failed tests list

            tf = new Frame();
            sw = new ScrolledWindow();
            tf.Add(sw);
            failedTree = new TreeView();
            failedTree.HeadersVisible = false;
            failedTree.RulesHint      = true;
            failedStore = new ListStore(typeof(object), typeof(string), typeof(Pixbuf));

            trtest2 = new CellRendererText();
            pr      = new CellRendererPixbuf();

            col = new TreeViewColumn();
            col.PackStart(pr, false);
            col.AddAttribute(pr, "pixbuf", 2);
            col.PackStart(trtest2, false);
            col.AddAttribute(trtest2, "markup", 1);
            failedTree.AppendColumn(col);
            failedTree.Model = failedStore;
            sw.Add(failedTree);
            tf.ShowAll();

            TestFailuresPage = infoBook.AddPage(GettextCatalog.GetString("Failed tests"), tf);

            // Info - results

            tf = new Frame();
            sw = new ScrolledWindow();
            tf.Add(sw);
            resultView          = new TextView();
            resultView.Editable = false;
            sw.Add(resultView);
            tf.ShowAll();
            TestResultPage = infoBook.AddPage(GettextCatalog.GetString("Result"), tf);

            // Info - Output

            tf = new Frame();
            sw = new ScrolledWindow();
            tf.Add(sw);
            outputView          = new TextView();
            outputView.Editable = false;
            sw.Add(outputView);
            tf.ShowAll();
            TestOutputPage = infoBook.AddPage(GettextCatalog.GetString("Output"), tf);

            panedDetails.Pack2(infoBook, true, true);
            detailsPad.PackStart(panedDetails, true, true, 0);
            paned.Pack2(detailsPad, true, true);

            paned.ShowAll();

            infoBook.HidePage(TestResultPage);
            infoBook.HidePage(TestOutputPage);
            infoBook.HidePage(TestSummaryPage);
            infoBook.HidePage(TestRegressionsPage);
            infoBook.HidePage(TestFailuresPage);

            detailsPad.Sensitive = false;
            detailsPad.Hide();

            detailsTree.RowActivated    += new Gtk.RowActivatedHandler(OnTestActivated);
            regressionTree.RowActivated += new Gtk.RowActivatedHandler(OnRegressionTestActivated);
            failedTree.RowActivated     += new Gtk.RowActivatedHandler(OnFailedTestActivated);

            foreach (UnitTest t in testService.RootTests)
            {
                TreeView.AddChild(t);
            }
        }
Пример #58
0
 public CreateViewForm(TreeView treeView)
 {
     TreeView = treeView;
     InitializeComponent();
 }
Пример #59
0
 void RunSelectedTest(IExecutionHandler mode)
 {
     RunTest(TreeView.GetSelectedNode(), mode);
 }
Пример #60
0
 public static IList GetSelectedItems(TreeView element)
 {
     return((IList)element.GetValue(SelectedItemsProperty));
 }