示例#1
0
 public Document Process(Dom.Document document)
 {
     Document result = null;
     if (document.NotNull() && document.Root.NotNull())
     {
         Generic.IEnumerator<Node> root = this.Process(document.Root);
         if (root.MoveNext() && root.Current is Element)
             result = new Document(root.Current as Element) { Encoding = document.Encoding, Standalone = document.Standalone, Version = document.Version };
     }
     return result;
 }
示例#2
0
 protected override Generic.IEnumerator<Dom.Node> Process(Dom.ProcessingInstruction instruction)
 {
     Generic.IEnumerator<Dom.Node> result;
     switch (instruction.Target)
     {
         case "include":
             result = this.Process(this.LoadAll(((Uri.Locator)instruction.Value).Resolve((Uri.Locator)instruction.Region.Resource)));
             break;
         default:
             result = base.Process(instruction);
             break;
     }
     return result;
 }
示例#3
0
 public override void VisitChildren(Dom.Expressions.ContainerExpression x)
 {
 }
示例#4
0
		public static bool NavigateTo(Dom.IEntity entity)
		{
			if (entity == null)
				throw new ArgumentNullException("entity");
			var cu = entity.CompilationUnit;
			Dom.DomRegion region;
			if (entity is Dom.IClass)
				region = ((Dom.IClass)entity).Region;
			else if (entity is Dom.IMember)
				region = ((Dom.IMember)entity).Region;
			else
				region = Dom.DomRegion.Empty;
			
			if (cu == null || string.IsNullOrEmpty(cu.FileName) || region.IsEmpty) {
				foreach (var item in AddInTree.BuildItems<INavigateToEntityService>("/SharpDevelop/Services/NavigateToEntityService", null, false)) {
					if (item.NavigateToEntity(entity))
						return true;
				}
				return false;
			} else {
				return FileService.JumpToFilePosition(cu.FileName, region.BeginLine, region.BeginColumn) != null;
			}
		}
			public override void VisitPostfixExpression(Dom.Expressions.PostfixExpression x){}
			public override void VisitOpBasedExpression(Dom.Expressions.OperatorBasedExpression ox){}
示例#7
0
 protected override void OnScopeChanged(Dom.Statements.IStatement scopedStatement)
 {
     ctxt.CurrentContext.ScopedStatement = scopedStatement;
 }