Class to store information about a script source.
Class to store information about a script source.
Пример #1
0
		/// <summary>Registers the given script as a top-level script in the debugger.</summary>
		/// <remarks>Registers the given script as a top-level script in the debugger.</remarks>
		private void RegisterTopScript(DebuggableScript topScript, string source)
		{
			if (!topScript.IsTopLevel())
			{
				throw new ArgumentException();
			}
			string url = GetNormalizedUrl(topScript);
			DebuggableScript[] functions = GetAllFunctions(topScript);
			if (sourceProvider != null)
			{
				string providedSource = sourceProvider.GetSource(topScript);
				if (providedSource != null)
				{
					source = providedSource;
				}
			}
			Dim.SourceInfo sourceInfo = new Dim.SourceInfo(source, functions, url);
			lock (urlToSourceInfo)
			{
				Dim.SourceInfo old = urlToSourceInfo.Get(url);
				if (old != null)
				{
					sourceInfo.CopyBreakpointsFrom(old);
				}
				urlToSourceInfo.Put(url, sourceInfo);
				for (int i = 0; i != sourceInfo.FunctionSourcesTop(); ++i)
				{
					Dim.FunctionSource fsource = sourceInfo.FunctionSource(i);
					string name = fsource.Name();
					if (name.Length != 0)
					{
						functionNames.Put(name, fsource);
					}
				}
			}
			lock (functionToSource)
			{
				for (int i = 0; i != functions.Length; ++i)
				{
					Dim.FunctionSource fsource = sourceInfo.FunctionSource(i);
					functionToSource.Put(functions[i], fsource);
				}
			}
			callback.UpdateSourceText(sourceInfo);
		}
Пример #2
0
			/// <summary>Creates a new FunctionSource.</summary>
			/// <remarks>Creates a new FunctionSource.</remarks>
			private FunctionSource(Dim.SourceInfo sourceInfo, int firstLine, string name)
			{
				if (name == null)
				{
					throw new ArgumentException();
				}
				this.sourceInfo = sourceInfo;
				this.firstLine = firstLine;
				this.name = name;
			}