public EntryRenderer(GuiComponentDescriptor descriptor, EntryTitle titleRenderer, IComponentRenderer valueRenderer, GameObject valueGameObject) { _titleRenderer = titleRenderer; _valueRenderer = valueRenderer; _valueGameObject = valueGameObject; _descriptor = descriptor; }
private void SetCurrentAppState(ComponentType appStateType) { Action onReady = () => { _currentAppState = _appStates[appStateType]; _currentAppState.StateChangeRequested += StateChangeRequestedHandler; _currentAppState.AppSize = _graphicsBase.ScreenBounds; _currentAppStateRenderer = _appStateRenderers[appStateType]; _currentAppStateRenderer.Component = _currentAppState; _currentAppStateRenderer.GraphicsBase = _graphicsBase; _gestureRecognizer.CurrentAppState = _currentAppState; _currentAppState.OnTransitionTo(); }; if (_currentAppState != null) { _currentAppState.StateChangeRequested -= StateChangeRequestedHandler; _currentAppState.OnTransitionFrom(onReady); } else { onReady(); } }
/// <summary> /// Renders the specified <see cref="MvcComponentBase" /> to the current WebForms view. /// </summary> /// <param name="helper">The HTML helper instance that this method extends.</param> /// <param name="component">The <see cref="MvcComponentBase" /> to render.</param> public static void KrystalwareWebForms(this HtmlHelper helper, MvcComponentBase component) { IComponentRenderer renderer = RendererFactory.GetRenderer(component); renderer.Register(component); using (HtmlTextWriter w = new HtmlTextWriter(helper.ViewContext.Writer)) renderer.Render(component, w); }
public Renderer(IComponentRenderer componentRenderer, GraphicsDeviceManager graphicsDevice, ISpriteBatch spriteBatch) { _componentRenderer = componentRenderer; _spriteBatch = spriteBatch; _graphicsDevice = graphicsDevice; _currentScene = new NoScene(); _clearColor = Color.CornflowerBlue; _debug = false; }
/// <summary> /// Renders the specified <see cref="MvcComponentBase" /> and returns the output for a Razor view. /// </summary> /// <param name="helper">The HTML helper instance that this method extends.</param> /// <param name="component">The <see cref="MvcComponentBase" /> to render.</param> public static MvcHtmlString KrystalwareRazor(this HtmlHelper helper, MvcComponentBase component) { IComponentRenderer renderer = RendererFactory.GetRenderer(component); renderer.Register(component); using (StringWriter s = new StringWriter()) { using (HtmlTextWriter w = new HtmlTextWriter(s)) renderer.Render(component, w); return(MvcHtmlString.Create(s.ToString())); } }
private void SetCurrentAppState(ComponentType appStateType) { Action onReady = () => { _currentAppState = _appStates[appStateType]; _currentAppState.StateChangeRequested += StateChangeRequestedHandler; _currentAppState.AppSize = _graphicsBase.ScreenBounds; _currentAppStateRenderer = _appStateRenderers[appStateType]; _currentAppStateRenderer.Component = _currentAppState; _currentAppStateRenderer.GraphicsBase = _graphicsBase; _gestureRecognizer.CurrentAppState = _currentAppState; _currentAppState.OnTransitionTo(); }; if (_currentAppState != null) { _currentAppState.StateChangeRequested -= StateChangeRequestedHandler; _currentAppState.OnTransitionFrom(onReady); } else onReady(); }
public void RegisterRenderer <TComponent>(IComponentRenderer <TRendererContext, TComponent> renderer) where TComponent : IComponent { _renderers[typeof(TComponent)] = (ctx, c) => renderer.Render(ctx, (TComponent)c, Render); }