This class converts C# constructs to their VB.NET equivalents.
Inheritance: CSharpConstructsConvertVisitor
		protected override void ConvertAst(CompilationUnit compilationUnit, List<ISpecial> specials, FileProjectItem sourceItem)
		{
			PreprocessingDirective.CSharpToVB(specials);
			IProjectContent pc = ParserService.GetProjectContent(sourceItem.Project) ?? ParserService.CurrentProjectContent;
			CSharpToVBNetConvertVisitor visitor = new CSharpToVBNetConvertVisitor(pc, ParserService.GetParseInformation(sourceItem.FileName));
			visitor.RootNamespaceToRemove = sourceItem.Project.RootNamespace;
			visitor.DefaultImportsToRemove = defaultImports;
			visitor.StartupObjectToMakePublic = startupObject;
			compilationUnit.AcceptVisitor(visitor, null);
		}
Ejemplo n.º 2
0
 public string CSharpToVB(string input, out string errors)
 {
     INode node = Parse(SupportedLanguage.CSharp, input, out errors);
     if (node == null)
         return null;
     // apply conversion logic:
     var visitor = new CSharpToVBNetConvertVisitor(project, parseInfo);
     visitor.DefaultImportsToRemove = DefaultImportsToRemove;
     compilationUnit.AcceptVisitor(visitor,null);
     PreprocessingDirective.CSharpToVB(specials);
     return CreateCode(UnpackExpression(node), new VBNetOutputVisitor());
 }
Ejemplo n.º 3
0
        public string CSharpToVB(string input, out string errors)
        {
            INode node = Parse(SupportedLanguage.CSharp, input, out errors);

            if (node == null)
            {
                return(null);
            }
            // apply conversion logic:
            var visitor = new CSharpToVBNetConvertVisitor(project, parseInfo);

            visitor.DefaultImportsToRemove = DefaultImportsToRemove;
            compilationUnit.AcceptVisitor(visitor, null);
            PreprocessingDirective.CSharpToVB(specials);
            return(CreateCode(UnpackExpression(node), new VBNetOutputVisitor()));
        }