public void Init(string platformType, string initializeAssembly, string mainAssembly, IEnumerable <string> references) { if (Platform.Instance == null) { var refs = new[] { Path.GetDirectoryName(typeof(AppDomainProxy).Assembly.Location), mainAssembly }; resolver = AssemblyResolver.Register(refs.Union(references)); var plat = Activator.CreateInstance(Type.GetType(platformType)) as Platform; Platform.Initialize(plat); if (!string.IsNullOrEmpty(initializeAssembly)) { plat.LoadAssembly(initializeAssembly); } var app = new Application(); app.Attach(); app.Terminating += App_Terminating; app.UnhandledException += App_UnhandledException; AppDomain.CurrentDomain.DomainUnload += CurrentDomain_DomainUnload; } designPanel = new DesignPanel(); designPanel.MainAssembly = mainAssembly; designPanel.References = references.ToList(); }
public void Init(string platformType, string initializeAssembly, string mainAssembly, IEnumerable<string> references) { if (Platform.Instance == null) { var refs = new[] { Path.GetDirectoryName(typeof(AppDomainProxy).Assembly.Location), mainAssembly }; resolver = AssemblyResolver.Register(refs.Union(references)); var plat = Activator.CreateInstance(Type.GetType(platformType)) as Platform; Platform.Initialize(plat); if (!string.IsNullOrEmpty(initializeAssembly)) { plat.LoadAssembly(initializeAssembly); } var app = new Application(); app.Attach(); app.Terminating += App_Terminating; app.UnhandledException += App_UnhandledException; AppDomain.CurrentDomain.DomainUnload += CurrentDomain_DomainUnload; } designPanel = new DesignPanel(); designPanel.MainAssembly = mainAssembly; designPanel.References = references.ToList(); }
public PreviewEditorView(Control editor, string mainAssembly, IEnumerable <string> references, Func <string> getCode) { //Size = new Size (200, 200); Editor = editor; MainAssemblyPath = mainAssembly; this.getCode = getCode; if (EnableAppDomains) { designPanel = new AppDomainDesignHost(); } else { designPanel = new InProcessDesignPanel(); } designPanel.MainAssembly = mainAssembly; designPanel.References = references; designPanel.ControlCreated = () => FinishProcessing(null); designPanel.Error = FinishProcessing; designPanelHolder = new Panel(); designPanelHolder.Content = designPanel.GetContainer(); designPanel.ContainerChanged = () => designPanelHolder.Content = designPanel.GetContainer(); Orientation = Orientation.Vertical; FixedPanel = SplitterFixedPanel.None; errorPanel = new Panel { Padding = new Padding(5), Visible = false, BackgroundColor = new Color(Colors.Red, .4f) }; Panel1 = new StackLayout { HorizontalContentAlignment = HorizontalAlignment.Stretch, Items = { new StackLayoutItem(designPanelHolder, expand: true), errorPanel } }; Panel2 = editor; RelativePosition = lastPosition; timer = new UITimer { Interval = RefreshTime }; timer.Elapsed += Timer_Elapsed; errorTimer = new UITimer { Interval = ErrorDisplayTime }; errorTimer.Elapsed += ErrorTimer_Elapsed; }
protected override void Dispose(bool disposing) { if (disposing) { designPanelHolder.Content = null; designPanel.Dispose(); designPanel = null; } base.Dispose(disposing); }
public void HookupEvents(AppDomainEventSink eventSink) { GetThemeColor = eventSink.GetThemeColor; designPanel = new DesignPanel(); designPanel.MainAssembly = mainAssembly; designPanel.References = references; designPanel.Error = eventSink.Error; designPanel.ControlCreated = eventSink.ControlCreated; }
public PreviewEditorView(Control editor, string mainAssembly, IEnumerable<string> references, Func<string> getCode) { //Size = new Size (200, 200); Editor = editor; MainAssemblyPath = mainAssembly; this.getCode = getCode; if (EnableAppDomains) designPanel = new AppDomainDesignHost(); else designPanel = new InProcessDesignPanel(); designPanel.MainAssembly = mainAssembly; designPanel.References = references; designPanel.ControlCreated = () => FinishProcessing(null); designPanel.Error = FinishProcessing; designPanelHolder = new Panel(); designPanelHolder.Content = designPanel.GetContainer(); designPanel.ContainerChanged = () => designPanelHolder.Content = designPanel.GetContainer(); Orientation = Orientation.Vertical; FixedPanel = SplitterFixedPanel.None; RelativePosition = lastPosition; errorPanel = new Panel { Padding = new Padding(5), Visible = false, BackgroundColor = new Color(Colors.Red, .4f) }; Panel1 = new StackLayout { HorizontalContentAlignment = HorizontalAlignment.Stretch, Items = { new StackLayoutItem(designPanelHolder, expand: true), errorPanel } }; Panel2 = editor; timer = new UITimer { Interval = RefreshTime }; timer.Elapsed += Timer_Elapsed; errorTimer = new UITimer { Interval = ErrorDisplayTime }; errorTimer.Elapsed += ErrorTimer_Elapsed; }
public void Init(string platformType, string initializeAssembly, string mainAssembly, IEnumerable <string> references) { if (Platform.Instance == null) { resolver = AssemblyResolver.Register(references.Union(new[] { mainAssembly, Path.GetDirectoryName(typeof(AppDomainProxy).Assembly.Location) })); var plat = Activator.CreateInstance(Type.GetType(platformType)) as Platform; Platform.Initialize(plat); if (!string.IsNullOrEmpty(initializeAssembly)) { plat.LoadAssembly(initializeAssembly); } new Application().Attach(); } designPanel = new DesignPanel(); designPanel.MainAssembly = mainAssembly; designPanel.References = references.ToList(); }