public void Run(int maxOperations = 10000) { input = new Input(); context = new Context(OnOutput, input); input.WaitInput += OnWaitInput; if (Code != null) { try { var tokens = LexicalAnalizer.Analize(Code); var assembly = SyntaxisAnalizer.CreateProgramTree(tokens); List <Assembly> assemblies = new List <Assembly>(); assemblies.Add(AssemblyPool.GetInstance(typeof(CiliAssembly))); assemblies.Add(AssemblyPool.GetInstance(typeof(MscorlibAssembly))); ExecuteEngine.Execute(assembly, assemblies, context, maxOperations); } catch (LexicalAnalizeException ex) { OnOutput("Lexical analize error: " + ex.Message + "\r\n"); } catch (SyntaxisAnalizeException ex) { OnOutput("Syntaxis analize error: " + ex.Message + "\r\n"); } catch (CiliPreparingException ex) { OnOutput("Code preparing error: " + ex.Message + "\r\n"); } catch (CiliRuntimeException ex) { OnOutput("Runtime error: " + ex.Message + "\r\n"); } catch (ProgramException ex) { OnOutput("Programm error: " + ex.Message + "\r\n"); } catch (Exception ex) { OnOutput("INTERNAL ERROR: " + ex.Message + "\r\n"); } } }
public AppConfiguration() { AssemblyPool.AddThisAssembly(); Messaging .HandleTheseMessagesAsynchronously(mi => mi.Name.EndsWith("TaskMsg")) .HandleTheseMessagesOnDispatcher(mi => mi.Name.EndsWith("UiMsg")) .TypesSubscribedToMessaging(t => typeof(AbstractViewModel).IsAssignableFrom(t)) .SpecifyFlexibleSubscriptionRules(a => a.ByMethodName("Handle").PublishMethods("Route")) .TypesBeingAMessageHub(t => t.CanBeCastTo <IHub>()) .TypesBeingAMessageHub(t => t.CanBeCastTo <IController>()); Converters.ApplyDefaults(); ViewLocation .ModelsMatching <DateTime>(m => m.Use((b, ctx) => b.Start <DatePicker>(ctx.Model).StaticStyle("EditableDate").BindSelectedDate())) .ModelsMatching <CustomerNumber>(m => m.FromMatchingDataTemplate()) .AddLocator <EnumAsGroupBoxViews>(); StartViewModel <MainViewModel>(); }