private void InitProperties() { mvarDropHighLightNode = null; mvarDropLinePosition = DropLinePositionEnum.None; mvarDropHighLightBackColor = SystemColors.Highlight; mvarDropHighLightForeColor = SystemColors.HighlightText; mvarDropLineColor = SystemColors.ControlText; mvarEdgeSensitivity = 0; mvarDropLineWidth = 2; }
private void SetDropHighlightNode(UltraTreeNode Node, DropLinePositionEnum DropLinePosition) { //Use to store whether there have been any changes in //DropNode or DropLinePosition bool IsPositionChanged = false; try { //Check to see if the nodes are equal and if //the dropline position are equal if (mvarDropHighLightNode != null && mvarDropHighLightNode.Equals(Node) && (mvarDropLinePosition == DropLinePosition)) { //They are both equal. Nothing has changed. IsPositionChanged = false; } else { //One or both have changed IsPositionChanged = true; } } catch { //If we reach this code, it means mvarDropHighLightNode //is null, so it could not be compared if (mvarDropHighLightNode == null) { //Check to see if Node is nothing, so we//ll know //if Node = mvarDropHighLightNode IsPositionChanged = !(Node == null); } } //Set both properties without calling PositionChanged mvarDropHighLightNode = Node; mvarDropLinePosition = DropLinePosition; //Check to see if the PositionChanged if (IsPositionChanged) { //Position did change. PositionChanged(); } }