當前位置: 首頁>>代碼示例>>C#>>正文


C# CellRef.GetHashCode方法代碼示例

本文整理匯總了C#中PropertyTools.Wpf.CellRef.GetHashCode方法的典型用法代碼示例。如果您正苦於以下問題:C# CellRef.GetHashCode方法的具體用法?C# CellRef.GetHashCode怎麽用?C# CellRef.GetHashCode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PropertyTools.Wpf.CellRef的用法示例。


在下文中一共展示了CellRef.GetHashCode方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: InsertDisplayControl

 /// <summary>
 /// Inserts the display control for the specified cell.
 /// </summary>
 /// <param name="cellRef">The cell reference.</param>
 private void InsertDisplayControl(CellRef cellRef)
 {
     var e = this.CreateDisplayControl(cellRef, null, null);
     SetElementPosition(e, cellRef);
     this.sheetGrid.Children.Insert(this.cellInsertionIndex, e);
     this.cellInsertionIndex++;
     this.cellMap.Add(cellRef.GetHashCode(), e);
 }
開發者ID:punker76,項目名稱:PropertyTools,代碼行數:12,代碼來源:DataGrid.cs

示例2: GetCellElement

 /// <summary>
 /// Gets the element at the specified cell.
 /// </summary>
 /// <param name="cellRef">The cell reference.</param>
 /// <returns>
 /// The element, or <c>null</c> if the cell was not found.
 /// </returns>
 public UIElement GetCellElement(CellRef cellRef)
 {
     UIElement e;
     return this.cellMap.TryGetValue(cellRef.GetHashCode(), out e) ? e : null;
 }
開發者ID:punker76,項目名稱:PropertyTools,代碼行數:12,代碼來源:DataGrid.cs

示例3: AddDisplayControl

        /// <summary>
        /// Adds the display control for the specified cell.
        /// </summary>
        /// <param name="cellRef">The cell reference.</param>
        private void AddDisplayControl(CellRef cellRef)
        {
            var e = this.CreateDisplayControl(cellRef, null, null);
            if (e == null)
            {
                return;
            }

            SetElementPosition(e, cellRef);
            this.sheetGrid.Children.Add(e);
            this.cellMap.Add(cellRef.GetHashCode(), e);
        }
開發者ID:punker76,項目名稱:PropertyTools,代碼行數:16,代碼來源:DataGrid.cs

示例4: UpdateCellContent

        /// <summary>
        /// Updates the content of the specified cell.
        /// </summary>
        /// <param name="cellRef">The cell reference.</param>
        protected void UpdateCellContent(CellRef cellRef)
        {
            var c = this.GetCellElement(cellRef);
            if (c != null)
            {
                this.sheetGrid.Children.Remove(c);
                this.cellInsertionIndex--;
                this.cellMap.Remove(cellRef.GetHashCode());
            }

            this.InsertDisplayControl(cellRef);
        }
開發者ID:punker76,項目名稱:PropertyTools,代碼行數:16,代碼來源:DataGrid.cs

示例5: InsertCellElement

        /// <summary>
        /// The insert cell element.
        /// </summary>
        /// <param name="cellRef">
        /// The cell ref.
        /// </param>
        /// <param name="value">
        /// The value.
        /// </param>
        /// <param name="insert">
        /// The insert.
        /// </param>
        private void InsertCellElement(CellRef cellRef, object value, bool insert)
        {
            // if (value == null)
            // return;
            var e = this.CreateElement(cellRef, null);
            SetElementPosition(e, cellRef);
            if (insert)
            {
                this.sheetGrid.Children.Insert(this.cellInsertionIndex, e);
                this.cellInsertionIndex++;
            }
            else
            {
                this.sheetGrid.Children.Add(e);
            }

            this.cellMap.Add(cellRef.GetHashCode(), e);
        }
開發者ID:betology,項目名稱:SambaPOS-3,代碼行數:30,代碼來源:SimpleGrid.cs

示例6: VirtualizeCells

        /// <summary>
        /// Virtualizes the UIElements for the visible cells.
        ///   Adds elements for the visible cells not currently in the logical tree.
        ///   Removes elements for the nonvisible cells.
        /// </summary>
        protected void VirtualizeCells()
        {
            CellRef cell1, cell2;
            this.GetVisibleCells(out cell1, out cell2);
            if (cell1.Column < 0)
            {
                return;
            }

            var delete = this.cellMap.Keys.ToList();

            for (int i = cell1.Row; i <= cell2.Row; i++)
            {
                for (int j = cell1.Column; j <= cell2.Column; j++)
                {
                    var cellRef = new CellRef(i, j);
                    var c = this.GetCellElement(cellRef);
                    if (c == null)
                    {
                        // The cell is not currently in the collection - add it
                        this.UpdateCellContent(cellRef);
                    }
                    else
                    {
                        // the cell is currently in the collection - keep it (remove it from the delete keys)
                        delete.Remove(cellRef.GetHashCode());
                    }
                }
            }

            foreach (var hash in delete)
            {
                var cell = this.cellMap[hash];
                this.sheetGrid.Children.Remove(cell);
                this.cellInsertionIndex--;
                this.cellMap.Remove(hash);
            }
        }
開發者ID:betology,項目名稱:SambaPOS-3,代碼行數:43,代碼來源:SimpleGrid.cs

示例7: UpdateCellContent

        protected void UpdateCellContent(CellRef cellRef)
        {
            var c = GetCellElement(cellRef);
            var value = GetCellValue(cellRef);

            if (c != null)
            {
                sheetGrid.Children.Remove(c);
                cellInsertionIndex--;
                cellMap.Remove(cellRef.GetHashCode());
            }
            InsertCellElement(cellRef, value, true);
        }
開發者ID:basio,項目名稱:veropos,代碼行數:13,代碼來源:SimpleGrid.cs


注:本文中的PropertyTools.Wpf.CellRef.GetHashCode方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。