Rhino.Tools.Debugger.Dim.SourceInfo.CopyBreakpointsFrom C# (CSharp) Метод

CopyBreakpointsFrom() приватный Метод

Copies the breakpoints from the given SourceInfo object into this one.
Copies the breakpoints from the given SourceInfo object into this one.
private CopyBreakpointsFrom ( Dim old ) : void
old Dim
Результат void
			private void CopyBreakpointsFrom(Dim.SourceInfo old)
			{
				int end = old.breakpoints.Length;
				if (end > this.breakpoints.Length)
				{
					end = this.breakpoints.Length;
				}
				for (int line = 0; line != end; ++line)
				{
					if (old.breakpoints[line])
					{
						this.breakpoints[line] = true;
					}
				}
			}

Usage Example

Пример #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);
		}