1 //------------------------------------------------------------------------------
2 // <copyright file="QilReference.cs" company="Microsoft">
3 // Copyright (c) Microsoft Corporation. All rights reserved.
5 // <owner current="true" primary="true">[....]</owner>
6 //------------------------------------------------------------------------------
8 using System.Diagnostics;
10 namespace System.Xml.Xsl.Qil {
13 /// View over a Qil node which is the target of a reference (functions, variables, parameters).
15 internal class QilReference : QilNode {
16 // Names longer than 1023 characters cause AV in cscompee.dll, see VSWhidbey 485526
17 // So we set the internal limit to 1000. Needs to be lower since we might later append
18 // few characters (for example "(2)") if we end up with two same named methods after
20 private const int MaxDebugNameLength = 1000;
22 private string debugName;
24 //-----------------------------------------------
26 //-----------------------------------------------
29 /// Construct a reference
31 public QilReference(QilNodeType nodeType) : base(nodeType) {
35 //-----------------------------------------------
36 // QilReference methods
37 //-----------------------------------------------
40 /// Name of this reference, preserved for debugging (may be null).
42 public string DebugName {
43 get { return this.debugName; }
45 if (value.Length > MaxDebugNameLength)
46 value = value.Substring(0, MaxDebugNameLength);
48 this.debugName = value;