コード例 #1
0
        protected override void OnDragDrop(DragEventArgs drgevent)
        {
            base.OnDragDrop(drgevent);
            ColumnNode  node        = (ColumnNode)drgevent.Data.GetData(typeof(ColumnNode));
            Point       pt          = this.PointToClient(new Point(drgevent.X, drgevent.Y));
            SectionNode sectionNode = this.GetNodeAt(pt) as SectionNode;

            if (sectionNode != null)
            {
                if (sectionNode == this.nodeGrouping)
                {
                    this.nodeSorting.Nodes.Clear();
                }

                if (!ExplorerTree.NodeExist(sectionNode, node.Text))
                {
                    SortColumnNode newNode = new SortColumnNode(node.Text,
                                                                ExplorerTree.ascendingIcon,
                                                                ExplorerTree.sortColumnMenu);

                    newNode.SortDirection = ListSortDirection.Ascending;
                    this.SelectedNode     = newNode;
                    this.CheckNode(newNode);
                    sectionNode.Nodes.Add(newNode);
                    this.reportModel.ReportSettings.SortColumnCollection.Add(new SortColumn(newNode.Text,
                                                                                            ListSortDirection.Ascending,
                                                                                            typeof(System.String), false));
                    this.OnPropertyChanged("Sort_Group");
                }
            }
        }
コード例 #2
0
        public void ToggleSortOrder()
        {
            SortColumnNode sortColumnNode = this.SelectedNode as SortColumnNode;

            if (sortColumnNode != null)
            {
                if (sortColumnNode.SortDirection == ListSortDirection.Ascending)
                {
                    sortColumnNode.SortDirection      = ListSortDirection.Descending;
                    sortColumnNode.ImageIndex         = descendingIcon;
                    sortColumnNode.SelectedImageIndex = descendingIcon;
                }
                else
                {
                    sortColumnNode.SortDirection      = ListSortDirection.Ascending;
                    sortColumnNode.ImageIndex         = ascendingIcon;
                    sortColumnNode.SelectedImageIndex = ascendingIcon;
                }
                SortColumn abstractColumn = null;
                if (this.SelectedNode is GroupColumnNode)
                {
                    abstractColumn = (SortColumn)this.reportModel.ReportSettings.GroupColumnsCollection.Find(this.SelectedNode.Text);
                }
                else
                {
                    abstractColumn = (SortColumn)this.reportModel.ReportSettings.SortColumnsCollection.Find(this.SelectedNode.Text);
                }
                abstractColumn.SortDirection = sortColumnNode.SortDirection;
                this.OnPropertyChanged("ToggleSortOrder");
            }
        }
コード例 #3
0
        private void AddSorting(SectionNode sectionNode, ColumnNode node)
        {
            SortColumnNode sortNode = new SortColumnNode(node.Text,
                                                         ExplorerTree.ascendingIcon,
                                                         ExplorerTree.sortColumnMenuPath);

            sortNode.SortDirection = ListSortDirection.Ascending;
            this.SelectedNode      = sortNode;
            sectionNode.Nodes.Add(sortNode);
            this.reportModel.ReportSettings.SortColumnsCollection.Add(new SortColumn(sortNode.Text,
                                                                                     ListSortDirection.Ascending,
                                                                                     typeof(System.String), false));
            this.OnPropertyChanged("Sorting");
        }
コード例 #4
0
        private void SetSortColumns()
        {
            this.nodeSorting.Nodes.Clear();
            SortColumnNode scn = null;

            foreach (SortColumn sc in this.reportModel.ReportSettings.SortColumnCollection)
            {
                if (sc.SortDirection == ListSortDirection.Ascending)
                {
                    scn = new SortColumnNode(sc.ColumnName, ascendingIcon, "/SharpDevelopReports/ContextMenu/FieldsExplorer/ColumnTreeNode");
                }
                else
                {
                    scn = new SortColumnNode(sc.ColumnName, ascendingIcon, "/SharpDevelopReports/ContextMenu/FieldsExplorer/ColumnTreeNode");
                }
                this.nodeSorting.Nodes.Add(scn);
            }
        }
コード例 #5
0
        private void SetSortColumns(AbstractColumn column)
        {
            SortColumn sortColumn = column as SortColumn;

            if (sortColumn != null)
            {
                var sortColumnNode = new SortColumnNode(sortColumn.ColumnName, sortColumnMenuPath);

                if (sortColumn.SortDirection == ListSortDirection.Ascending)
                {
                    sortColumnNode.ImageIndex = ascendingIcon;
                }
                else
                {
                    sortColumnNode.ImageIndex = descendingIcon;
                }
                this.nodeSorting.Nodes.Add(sortColumnNode);
            }
        }
コード例 #6
0
        public void ToggleSortOrder()
        {
            SortColumnNode scn = this.SelectedNode as SortColumnNode;

            if (scn != null)
            {
                if (scn.SortDirection == ListSortDirection.Ascending)
                {
                    scn.SortDirection      = ListSortDirection.Descending;
                    scn.ImageIndex         = descendingIcon;
                    scn.SelectedImageIndex = descendingIcon;
                }
                else
                {
                    scn.SortDirection      = ListSortDirection.Ascending;
                    scn.ImageIndex         = ascendingIcon;
                    scn.SelectedImageIndex = ascendingIcon;
                }
                SortColumn abstr = (SortColumn)this.reportModel.ReportSettings.SortColumnCollection.Find(this.SelectedNode.Text);
                abstr.SortDirection = scn.SortDirection;
                this.OnPropertyChanged("ToggleSortOrder");
            }
        }
コード例 #7
0
        private void CheckNode(TreeNode node)
        {
            SortColumnNode cn = node as SortColumnNode;

            if (cn != null)
            {
                if (node.Parent == nodeSorting)
                {
                    if (cn.SortDirection == ListSortDirection.Ascending)
                    {
                        cn.ImageIndex = ascendingIcon;
                    }
                    else
                    {
                        cn.ImageIndex = descendingIcon;
                    }
                }
                else if (node.Parent == this.nodeGrouping)
                {
                    cn.ImageIndex         = clearIcon;
                    cn.SelectedImageIndex = clearIcon;
                }
            }
        }
コード例 #8
0
ファイル: ExplorerTree.cs プロジェクト: Rpinski/SharpDevelop
		private void SetSortColumns (AbstractColumn column)
		{
			SortColumn sortColumn = column as SortColumn;
			
			if (sortColumn != null) {
				var  sortColumnNode = new SortColumnNode (sortColumn.ColumnName,sortColumnMenuPath);

				if (sortColumn.SortDirection == ListSortDirection.Ascending) {
					sortColumnNode.ImageIndex = ascendingIcon;
				} else {
					sortColumnNode.ImageIndex = descendingIcon;
				}
				this.nodeSorting.Nodes.Add(sortColumnNode);
			}
			
		}
コード例 #9
0
ファイル: ExplorerTree.cs プロジェクト: Rpinski/SharpDevelop
		private void AddSorting(SectionNode sectionNode, ColumnNode node)
		{
			SortColumnNode sortNode = new SortColumnNode (node.Text,
			                                              ExplorerTree.ascendingIcon,
			                                              ExplorerTree.sortColumnMenuPath);

			sortNode.SortDirection = ListSortDirection.Ascending;
			this.SelectedNode = sortNode;
			sectionNode.Nodes.Add(sortNode);
			this.reportModel.ReportSettings.SortColumnsCollection.Add(new SortColumn(sortNode.Text,
			                                                                         ListSortDirection.Ascending,
			                                                                         typeof(System.String),false));
			this.OnPropertyChanged ("Sorting");
			
		}
コード例 #10
0
		private void SetSortColumns()
		{
			this.nodeSorting.Nodes.Clear();
			SortColumnNode scn = null;
			foreach (SortColumn sc in this.reportModel.ReportSettings.SortColumnsCollection){
				if (sc.SortDirection == ListSortDirection.Ascending) {
					scn  = new SortColumnNode (sc.ColumnName,ascendingIcon,"/SharpDevelopReports/ContextMenu/FieldsExplorer/ColumnSortTreeNode");
				} else {
					scn = new SortColumnNode (sc.ColumnName,descendingIcon,"/SharpDevelopReports/ContextMenu/FieldsExplorer/ColumnSortTreeNode");
				}
				this.nodeSorting.Nodes.Add(scn);
			}
		}
コード例 #11
0
		protected override void OnDragDrop(DragEventArgs drgevent)
		{
			base.OnDragDrop(drgevent);
			ColumnNode node = (ColumnNode)drgevent.Data.GetData(typeof(ColumnNode));
			Point pt = this.PointToClient (new Point( drgevent.X,drgevent.Y));
			SectionNode sectionNode = this.GetNodeAt (pt) as SectionNode;
			if (sectionNode != null) {
				if (sectionNode == this.nodeGrouping) {
					this.nodeSorting.Nodes.Clear();
				}
				
				if (!ExplorerTree.NodeExist (sectionNode,node.Text)) {
					SortColumnNode newNode = new SortColumnNode (node.Text,
					                                             ExplorerTree.ascendingIcon,
					                                             ExplorerTree.sortColumnMenu);

					newNode.SortDirection = ListSortDirection.Ascending;
					this.SelectedNode = newNode;
					this.CheckNode (newNode);
					sectionNode.Nodes.Add(newNode);
					this.reportModel.ReportSettings.SortColumnCollection.Add(new SortColumn(newNode.Text,
					                                                                        ListSortDirection.Ascending,
					                                                                        typeof(System.String),false));
					this.OnPropertyChanged ("Sort_Group");
				}
			}
		}