Beispiel #1
0
 /// <summary>
 /// Now we initialize our state, which means creating the ContextRouter if it doesn't exist.
 /// </summary>
 private static void InitializeContextRouter()
 {
     // If we don't have a context router for this session lifetime, create it now.
     if (contextRouter == null)
     {
         contextRouter              = new ContextRouter();
         contextRouter.OnException += (router, info) => OnException((ContextRouter)router, info);
         InitializeContextRouter(contextRouter);
         contextRouter.Run();
     }
 }
Beispiel #2
0
        public CPDesigner()
        {
            InitializeComponent();

            AppDomain.CurrentDomain.ReflectionOnlyAssemblyResolve += ReflectionOnlyAssemblyResolve;
            ContextRouter myContextRouter = InitializeMyContextRouter();

#if MyContext
            ContextRouter otherContextRouter = myContextRouter;
#else
            ContextRouter otherContextRouter = Listeners.Listeners.InitializeContext();
#endif
            myContextRouter.OnException += (_, cei) => MessageBox.Show(cei.Exception.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);

            WireUpEvents(myContextRouter);
            myContextRouter.Run();

            Shown           += (_, __) => myContextRouter.Publish <Startup>(otherContextRouter);
            canvasController = InitializeFlowSharp();
        }