コード例 #1
0
ファイル: LookAheadView.xaml.cs プロジェクト: rbirkby/mscui
        /// <summary>
        /// Initialises the view.
        /// </summary>
        /// <param name="grid">The layoutRoot grid.</param>
        /// <param name="columnManager">Look ahead view column manager.</param>
        public void InitializeView(Grid grid, ColumnManager columnManager)
        {
            System.Collections.ObjectModel.Collection<ColumnManager> columns = new System.Collections.ObjectModel.Collection<ColumnManager>();
            columns.Add(columnManager);

            this.view = new ColumnView(grid, columns, true);
        }
コード例 #2
0
ファイル: ColumnManager.cs プロジェクト: roylisto/akik-crush
 void Awake()
 {
     instance = this;
 }
コード例 #3
0
ファイル: WrapDataGrid.xaml.cs プロジェクト: rbirkby/mscui
        /// <summary>
        /// Creates columns defined in the UI.
        /// </summary>
        private void CreateColumns()
        {
            if (this.columns.Count > 0)
            {
                this.mainView = new MainView();
                this.CreateGroupingColumn();

                for (int columnIndex = 0; columnIndex < this.columns.Count; columnIndex++)
                {
                    WrapDataGridColumn currentColumn = this.columns[columnIndex];

                    CheckCellTemplate(currentColumn.CellTemplate);
                    CheckHeaderTemplate(currentColumn.HeaderTemplate);

                    ColumnManager column = new ColumnManager();

                    // Load our cell template, then the ISV cell template and set grid column/row properties to isv cell template.                    
                    Grid headerTemplate = DataTemplateHelper.LoadContent((this.layoutRoot.Resources["HeaderTemplate"] as DataTemplate)) as Grid;
                    headerTemplate.SetValue(Grid.RowProperty, 1);
                    headerTemplate.SetValue(Grid.ColumnProperty, columnIndex + 1);

                    if (columnIndex + 1 == this.columns.Count)
                    {
                        // Setting colspan to 2 to cover scrollbar top
                        headerTemplate.SetValue(Grid.ColumnSpanProperty, 2);
                    }

                    // Header template
                    UIElement customHeaderTemplate = DataTemplateHelper.LoadContent(currentColumn.HeaderTemplate) as UIElement;
                    customHeaderTemplate.SetValue(Grid.ColumnProperty, 0);
                    customHeaderTemplate.SetValue(Grid.RowProperty, 0);
                    headerTemplate.Children.Add(customHeaderTemplate);

                    DataTemplate cellTemplate = this.layoutRoot.Resources["CellTemplate"] as DataTemplate;

                    // Column manager stack panel.
                    StackPanel columnStackPanel = new StackPanel();

                    columnStackPanel.SetValue(Grid.ColumnProperty, columnIndex + 1);
                    columnStackPanel.SetValue(Grid.RowProperty, 4);

                    // Set column manager properties.
                    column.MasterCellTemplate = cellTemplate;
                    column.CellTemplate = currentColumn.CellTemplate;
                    column.ColumnHeader = headerTemplate;
                    column.StackPanel = columnStackPanel;
                    column.BodyMargin = currentColumn.BodyMargin;
                    column.ToolTipTemplate = currentColumn.ToolTipTemplate;

                    // Add Column manager to column manager collection
                    this.mainViewColumns.Add(column);
                }
            }
        }
コード例 #4
0
ファイル: WrapDataGrid.xaml.cs プロジェクト: rbirkby/mscui
        /// <summary>
        /// Creates Look behind column.
        /// </summary>
        private void CreateLookBehindColumns()
        {
            if (this.lookBehindCellTemplate == null)
            {
                throw new ArgumentNullException("Look behind cell template must be defined", (Exception)null);
            }

            if (this.lookBehindSummaryCellTemplate == null)
            {
                throw new ArgumentNullException("Look behind summary cell template must be defined", (Exception)null);
            }

            this.lookBehindView = new LookBehindView();
            this.lookBehindColumn = new ColumnManager();
            Grid lookBehindLayout = DataTemplateHelper.LoadContent((this.layoutRoot.Resources["LookBehindCellTemplateGridLayout"] as DataTemplate)) as Grid;
            lookBehindLayout.SetValue(Grid.ColumnSpanProperty, this.WrapDataGridColumns.Count + 1);
            DataTemplate cellTemplate = this.layoutRoot.Resources["LookBehindCellTemplate"] as DataTemplate;
            StackPanel summaryPanel = new StackPanel();
            summaryPanel.SetValue(Grid.RowProperty, 0);
            summaryPanel.SetValue(Grid.ColumnProperty, 0);

            StackPanel columnPanel = new StackPanel();
            columnPanel.HorizontalAlignment = HorizontalAlignment.Right;
            columnPanel.Orientation = Orientation.Horizontal;
            columnPanel.SetValue(Grid.RowProperty, 0);
            columnPanel.SetValue(Grid.ColumnProperty, 1);

            SummaryManager summary = new SummaryManager();
            summary.CellTemplate = this.lookBehindSummaryCellTemplate;
            summary.MainPanel = summaryPanel;

            this.lookBehindColumn.SetValue(Grid.ColumnSpanProperty, 5);
            this.lookBehindColumn.MasterCellTemplate = cellTemplate;
            this.lookBehindColumn.CellTemplate = this.lookBehindCellTemplate;
            this.lookBehindColumn.StackPanel = columnPanel;
            this.lookBehindColumn.SummaryManager = summary;
            this.lookBehindColumn.GridLayout = lookBehindLayout;
        }
コード例 #5
0
 public DatabaseManager(ColumnManager columnManager)
 {
     _connection    = new SqlConnection(ConfigurationManager.ConnectionStrings["defaultDbConnectionStr"].ConnectionString);
     _columnManager = columnManager;
 }
コード例 #6
0
ファイル: WrapDataGrid.xaml.cs プロジェクト: rbirkby/mscui
        /// <summary>
        /// Creates a grouping column.        
        /// </summary>
        private void CreateGroupingColumn()
        {
            ColumnManager column = new ColumnManager();

            // Load our cell template, then the ISV cell template and set grid column/row properties to isv cell template.
            DataTemplate cellTemplate = this.layoutRoot.Resources["GroupingColumnTemplate"] as DataTemplate;
            Grid headerTemplate = DataTemplateHelper.LoadContent(this.layoutRoot.Resources["GroupingHeaderTemplate"] as DataTemplate) as Grid;
            headerTemplate.SetValue(Grid.RowProperty, 1);
            headerTemplate.SetValue(Grid.ColumnProperty, 0);

            // Column manager stack panel.
            StackPanel columnStackPanel = new StackPanel();
            columnStackPanel.SetValue(Canvas.ZIndexProperty, 9999);
            columnStackPanel.SetValue(Grid.ColumnProperty, 0);
            columnStackPanel.SetValue(Grid.RowProperty, 4);

            // Set column manager properties.
            column.MasterCellTemplate = null;
            column.CellTemplate = cellTemplate;
            column.ColumnHeader = headerTemplate;
            column.StackPanel = columnStackPanel;

            // Add Column manager to column manager collection
            this.mainViewColumns.Add(column);
        }
コード例 #7
0
 public ColumnController(ColumnManager dal)
 {
     Dal = dal;
 }
コード例 #8
0
        private void RefreshView(  )
        {
            this.treeView1.Nodes.Clear();

            bool hideAdva = IsHidden(_chkAdvanced);
            bool hideMeta = IsHidden(_chkMetaFields);
            bool hideProp = IsHidden(_chkProperties);
            bool hideStat = IsHidden(_chkStatistics);
            bool hideDefa = IsHidden(_chkDefault);
            bool hideNorm = IsHidden(_chkNormal);
            bool hideFold = IsHidden(_chkFolders);

            foreach (Column col in this._available)
            {
                bool isSelected = this._selected.Contains(col);

                if (!isSelected)
                {
                    if (col.Special.Has(EColumn.IsMeta))
                    {
                        if (hideMeta)
                        {
                            continue;
                        }
                    }
                    else if (col.Special.Has(EColumn.IsProperty))
                    {
                        if (hideProp)
                        {
                            continue;
                        }
                    }
                    else if (col.Special.Has(EColumn.IsStatistic))
                    {
                        if (hideStat)
                        {
                            continue;
                        }
                    }
                    else if (col.Special.Has(EColumn.Visible))
                    {
                        if (hideDefa)
                        {
                            continue;
                        }
                    }
                    else if (col.Special.Has(EColumn.Advanced))
                    {
                        if (hideAdva)
                        {
                            continue;
                        }
                    }
                    else if (hideNorm)
                    {
                        continue;
                    }
                }

                TreeNodeCollection parent = this.treeView1.Nodes;
                string             text;

                if (hideFold)
                {
                    string dir = UiControls.GetDirectory(col.Id);

                    if (!string.IsNullOrEmpty(dir))
                    {
                        dir += "\\";
                    }

                    text = dir + col.DisplayName;
                }
                else
                {
                    string[] elements = col.Id.Split('\\');

                    for (int n = 0; n < elements.Length - 1; n++)
                    {
                        bool found = false;

                        foreach (TreeNode child in parent)
                        {
                            if (child.Text == elements[n])
                            {
                                parent = child.Nodes;
                                found  = true;
                                break;
                            }
                        }

                        if (!found)
                        {
                            TreeNode newNode = new TreeNode(elements[n]);
                            newNode.NodeFont  = FontHelper.ItalicFont;
                            newNode.ForeColor = ColumnManager.COLCOL_FOLDER;
                            parent.Add(newNode);
                            parent = newNode.Nodes;
                        }
                    }

                    text = col.DisplayName;
                }

                TreeNode node = new TreeNode(text);
                node.Tag       = col;
                node.Checked   = isSelected;
                node.ForeColor = ColumnManager.GetColumnColour(col);

                parent.Add(node);
            }

            this.treeView1.ExpandAll();
        }
コード例 #9
0
        public int AddColumn(ColumnEntity columnEntity)
        {
            ColumnManager mgr = new ColumnManager();

            return(mgr.Add(columnEntity));
        }
コード例 #10
0
        public bool UpdateColumn(ColumnEntity columnEntity)
        {
            ColumnManager mgr = new ColumnManager();

            return(mgr.Update(columnEntity));
        }
コード例 #11
0
        public bool BatchUpdateColumn(System.Data.DataTable dt, string tableID)
        {
            ColumnManager mgr = new ColumnManager();

            return(mgr.UpdateList(dt, tableID));
        }
コード例 #12
0
        public List <ColumnEntity> GetColumnList(string tableId)
        {
            ColumnManager mgr = new ColumnManager();

            return(mgr.GetList(tableId));
        }
コード例 #13
0
        public System.Data.DataTable GetColumnDataTable(string tableId)
        {
            ColumnManager mgr = new ColumnManager();

            return(mgr.GetDataTable(tableId));
        }
コード例 #14
0
        public void PerformColumnLoad(string fileName, IOResults ares, int numColumns, bool firstLineIsHeader, BackgroundWorker bw)
        {
            columnManager = new ColumnManager(numColumns);
            int          maxLoadCount = 5000;
            int          ct           = 0;
            StreamReader sr           = null;
            FileStream   fs           = null;

            try
            {
                fs = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
                sr = new StreamReader(fs);
            }
            catch (FileNotFoundException fex)
            {
                ares.errorCondition       = 1;
                ares.extendedErrorMessage = fex.ToString();
            }
            catch (Exception ex)
            {
                ares.errorCondition       = 1;
                ares.extendedErrorMessage = ex.ToString();
            }

            if (sr != null)
            {
                string line = null;
                //Continue to read until you reach end of file
                int recordNumber = 0;
                if (firstLineIsHeader)
                {
                    string headers = sr.ReadLine();
                    this.SetColumnHeaders(headers, columnManager);
                }
                int progressIndicator = 0;
                int reportProgressOn  = 10000;

                while ((line = sr.ReadLine()) != null)
                {
                    ct++;
                    if (ct == maxLoadCount)
                    {
                        break;
                    }
                    ParseLineIntoColumns(recordNumber, line, numColumns);
                    recordNumber++;
                    progressIndicator++;
                    if (progressIndicator == reportProgressOn)
                    {
                        progressIndicator = 0;
                        bw.ReportProgress(recordNumber, fileName);
                    }
                }

                sr.Dispose();
                sr.Close();
                if (fs != null)
                {
                    fs.Close();
                }
            }
        }
コード例 #15
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ColumnHeaderClickEventArgs"/> class.
 /// </summary>
 /// <param name="columnIndex">Index of the column whose header was clicked.</param>
 /// <param name="columnManager">The ColumnManager that was clicked.</param>
 public ColumnHeaderClickEventArgs(int columnIndex, ColumnManager columnManager)
 {
     this.columnIndex = columnIndex;
     this.columnManager = columnManager;
 }