External/Aga.Controls/Tree/TreeModelEventArgs.cs
author moel.mich
Tue, 30 Dec 2014 22:47:39 +0000
changeset 431 0e46e3ca812a
permissions -rw-r--r--
Fixed the following issue (present only on 32-bit systems):

Version: 0.7.0.0

System.NullReferenceException: Object reference not set to an instance of an object.
at OpenHardwareMonitor.GUI.MainForm.timer_Tick(Object sender, EventArgs e)
at System.Windows.Forms.Timer.OnTick(EventArgs e)
at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Common Language Runtime: 4.0.30319.18444
Operating System: Microsoft Windows NT 6.1.7601 Service Pack 1
Process Type: 32-Bit
     1 using System;
     2 using System.Collections.Generic;
     3 using System.Text;
     4 
     5 namespace Aga.Controls.Tree
     6 {
     7 	public class TreeModelEventArgs: TreePathEventArgs
     8 	{
     9 		private object[] _children;
    10 		public object[] Children
    11 		{
    12 			get { return _children; }
    13 		}
    14 
    15 		private int[] _indices;
    16 		public int[] Indices
    17 		{
    18 			get { return _indices; }
    19 		}
    20 
    21 		/// <summary>
    22 		/// 
    23 		/// </summary>
    24 		/// <param name="parent">Path to a parent node</param>
    25 		/// <param name="children">Child nodes</param>
    26 		public TreeModelEventArgs(TreePath parent, object[] children)
    27 			: this(parent, null, children)
    28 		{
    29 		}
    30 
    31 		/// <summary>
    32 		/// 
    33 		/// </summary>
    34 		/// <param name="parent">Path to a parent node</param>
    35 		/// <param name="indices">Indices of children in parent nodes collection</param>
    36 		/// <param name="children">Child nodes</param>
    37 		public TreeModelEventArgs(TreePath parent, int[] indices, object[] children)
    38 			: base(parent)
    39 		{
    40 			if (children == null)
    41 				throw new ArgumentNullException();
    42 
    43 			if (indices != null && indices.Length != children.Length)
    44 				throw new ArgumentException("indices and children arrays must have the same length");
    45 
    46 			_indices = indices;
    47 			_children = children;
    48 		}
    49 	}
    50 }