Example #1
0
		static IEnumerable<BuilderInfo> GetBuilders()
		{
			var csBuilder = new BuilderInfo
			{
				Extension = ".eto.cs",
				DesignExtension = "^.+(?<![jx]eto)[.]cs$",
				CreateBuilder = () => new CSharpInterfaceBuilder(),
				GetCodeFile = fileName => Regex.Replace(fileName, @"(.+)[.]eto([.]cs)", "$1$2"),
				GetDesignFile = fileName => Regex.Replace(fileName, @"(.+)([.]cs)", "$1.eto$2")
			};
			var vbBuilder = new BuilderInfo
			{
				Extension = ".eto.vb",
				DesignExtension = "^.+(?<![jx]eto)[.]vb$",
				CreateBuilder = () => new VbInterfaceBuilder(),
				GetCodeFile = fileName => Regex.Replace(fileName, @"(.+)[.]eto([.]vb)", "$1$2"),
				GetDesignFile = fileName => Regex.Replace(fileName, @"(.+)([.]vb)", "$1.eto$2")
			};

			if (EtoEnvironment.Platform.IsWindows)
			{
				// use Roslyn on windows only, for now
				csBuilder.CreateBuilder = () => new RoslynCSharpInterfaceBuilder();
				vbBuilder.CreateBuilder = () => new RoslynVbInterfaceBuilder();
			}
			yield return csBuilder;
			yield return vbBuilder;

			yield return new BuilderInfo
			{
				Extension = ".eto.fs",
				DesignExtension = "^.+(?<![jx]eto)[.]fs$",
				CreateBuilder = () => new FSharpInterfaceBuilder(),
				GetCodeFile = fileName => Regex.Replace(fileName, @"(.+)[.]eto([.]fs)", "$1$2"),
				GetDesignFile = fileName => Regex.Replace(fileName, @"(.+)([.]fs)", "$1.eto$2")
			};
			yield return new BuilderInfo
			{
				Extension = ".xeto",
				DesignExtension = "^.+[.]xeto[.](cs|fs|vb)$",
				CreateBuilder = () => new XamlInterfaceBuilder(),
				GetCodeFile = fileName => fileName + ".cs",
				GetDesignFile = fileName => Regex.Replace(fileName, @"(.+[.]xeto)[.]cs", "$1")
			};
			yield return new BuilderInfo
			{
				Extension = ".jeto",
				DesignExtension = "^.+[.]jeto[.](cs|fs|vb)$",
				CreateBuilder = () => new JsonInterfaceBuilder(),
				GetCodeFile = fileName => fileName + ".cs",
				GetDesignFile = fileName => Regex.Replace(fileName, @"(.+[.]jeto)[.]cs", "$1")
			};
		}
Example #2
0
 public void SetBuilder(BuilderInfo builder)
 {
     Builder = builder;
     Stop();
     interfaceBuilder = Builder?.CreateBuilder();
 }
Example #3
0
 public bool SetBuilder(string fileName)
 {
     Builder          = BuilderInfo.Find(fileName);
     interfaceBuilder = Builder?.CreateBuilder();
     return(Builder != null);
 }
Example #4
0
		public void SetBuilder(BuilderInfo builder)
		{
			Builder = builder;
			Stop();
			interfaceBuilder = Builder?.CreateBuilder();
		}