// called cyclically public void OnTimerUpdate(IElementView elementView) { if (invalid) { DrawItem(); } }
public CreateDataConnectionEventArgs(IElementView sourceElement, IElementView destinationElement, int srcPortIndex, int destPortIndex) { SourceElement = sourceElement; DestinationElement = destinationElement; DestinationPortIndex = destPortIndex; SourcePortIndex = srcPortIndex; }
public override void Enter(MouseEventContext mouseEventContext, IElementView elementView) { Log.Debug("Mouse Enter"); hasMouseFocus = true; invalid = true; base.Enter(mouseEventContext, elementView); }
public static IElementView GetView(IGameItem item, int size) { IElementView view = null; if (item is Fruit) { view = new FruitView(item, size); } else if (item is Poisson) { view = new PoissonView(item, size); } else if (item is SmartMouse) { view = new MouseView(item, size); } else if (item is Mouse) { view = new MouseView(item, size); } else if (item is Cat) { view = new CatView(item, size); } return(view); }
public void OnTimerUpdate(IElementView elementView) { if (this.updateTime != 0) { this.ExecuteCyclic(); } }
public override void Leave(MouseEventContext mouseEventContext, IElementView elementView) { Log.Debug("Mouse Leave"); hasMouseFocus = false; invalid = true; base.Leave(mouseEventContext, elementView); }
protected override void InitVisual(IElementView elementView, ulong noValueEffects) { this.view = elementView; visual = new GraphicItemVisual(this); ItemDrawingVisual.Children.Add(visual); DrawItem(); }
protected override void InitVisual(IElementView elementView, ulong noValueEffects) { this.elementView = elementView; this.visual = new GraphicItemVisual(this); this.ItemDrawingVisual.Children.Add(this.visual); this.DrawItem(this.response); }
protected override void UpdateVisual(IElementView elementView, ulong updateReason, ulong noValueEffects) { if (this.updateTime != 0) { this.ExecuteCyclic(); } this.DrawItem(this.response); }
// called for exit public override void PrepareForRemoval(IElementView elementV, int itemIndex) { terminate = true; if (rfb != null) { rfb.Close(); } base.PrepareForRemoval(elementV, itemIndex); }
public async Task <IActionResult> ReadAlbumElementViewAsync(long elementId, [FromQuery] long pageId) { PageContext context = new PageContext { PageId = pageId }; IElementView <AlbumElementSettings, AlbumElementContent> view = await _albumElementService.ReadElementViewAsync(TenantId, elementId, context); if (view == null) { return(NotFound()); } return(Ok(view)); }
public async Task <IActionResult> ReadBorrowCalculatorElementViewAsync(long elementId, [FromQuery] long pageId) { PageContext context = new PageContext { PageId = pageId }; IElementView <BorrowCalculatorElementSettings, object> view = await _borrowCalculatorElementService.ReadElementViewAsync(TenantId, elementId, context); if (view == null) { return(NotFound()); } return(Ok(view)); }
public async Task <IActionResult> ReadTagCloudElementViewAsync(long elementId, [FromQuery] long pageId, [FromQuery] string tagIds) { IEnumerable <long> tagIdCollection = !string.IsNullOrWhiteSpace(tagIds) ? tagIds.Split(',').Select(long.Parse) : null; PageContext context = new PageContext { PageId = pageId, TagIds = tagIdCollection }; IElementView <TagCloudElementSettings, TagCloudElementContent> view = await _tagCloudElementService.ReadElementViewAsync(TenantId, elementId, context); if (view == null) { return(NotFound()); } return(Ok(view)); }
private async Task <IElementViewModel> GetElementViewModelAsync <TSettings, TContent>(long tenantId, long elementId, IPageContext context, Func <long, long, IPageContext, Task <IElementView <TSettings, TContent> > > func) where TSettings : IElementSettings { IElementView view = await func(tenantId, elementId, context); if (view == null) { return(null); } return(new ElementViewModel <TSettings, TContent> { View = view, Context = context }); }
// called cyclically public void OnTimerUpdate(IElementView elementView) { pos = (dir ? pos + speed : pos - speed); if (pos < 0) { pos = 0; dir = true; } if (pos > 300) { pos = 300; dir = false; } DrawItem(); }
// called for init protected override void InitVisual(IElementView elementView, ulong noValueEffects) { Log.Debug("InitVisual"); view = elementView; visual = new GraphicItemVisual(this); ItemDrawingVisual.Children.Add(visual); view.Viewer.PreviewKeyDown += new KeyEventHandler(Viewer_PreviewKeyDown); view.Viewer.PreviewKeyUp += new KeyEventHandler(Viewer_PreviewKeyUp); view.Viewer.LostKeyboardFocus += new KeyboardFocusChangedEventHandler(Viewer_LostKeyboardFocus); view.Viewer.GotKeyboardFocus += new KeyboardFocusChangedEventHandler(Viewer_GotKeyboardFocus); font = new LogicalFont("Arial", 18.0, AfwDynamicGraphics.Media.FontStyle.Regular).GetFont(view); hasKeyFocus = view.Viewer.IsKeyboardFocusWithin; new Thread(RunNetThread).Start(); DrawItem(); }
public async Task <IActionResult> ReadPageListElementViewAsync(long elementId, [FromQuery] long pageId, [FromQuery] string tagIds, [FromQuery] string page) { IEnumerable <long> tagIdCollection = !string.IsNullOrWhiteSpace(tagIds) ? tagIds.Split(',').Select(long.Parse) : null; IDictionary <string, string> parameters = page != null ? new Dictionary <string, string> { { "page", page } } : null; PageContext context = new PageContext { PageId = pageId, Parameters = parameters, TagIds = tagIdCollection }; IElementView <PageListElementSettings, PageListElementContent> view = await _pageListElementService.ReadElementViewAsync(TenantId, elementId, context); if (view == null) { return(NotFound()); } return(Ok(view)); }
public IElementPresenter Create(IElement element, IElementView view) { if (element!=null && view!=null) { if (element is ISimpleElement && view is ISimpleElementView) { return Create(element as ISimpleElement, view as ISimpleElementView); } else if (element is ICompoundElement && view is ICompoundElementView) { return Create(element as ICompoundElement, view as ICompoundElementView); } else if (element is IProcedure && view is IProcedureView) { return Create(element as IProcedure, view as IProcedureView); } } return null; }
public override void MouseWheel(MouseEventContext mouseEventContext, IElementView elementView) { base.MouseWheel(mouseEventContext, elementView); }
public CreateDataConnectionEventArgs(IElementView sourceElement, IElementView destinationElement) : this(sourceElement, destinationElement, -1, -1) { }
internal void _View_SelectionChanged(IElementView sender, SelectionEventArgs ea) { if (sender != null) { // the change originated at the UI level and has already been applied at the UI level. if (_Element.IsSelected != ea.IsSelected) { // propagate the selection change to the model if the Source is a UI source: Mouse, Keyboard, UserInput if (ea.Source == SelectionSource.Mouse) { _Element.SetIsSelected(ea.IsSelected, ea.Source, ea.Origin); VerifySelectionStates(_View, _Element); } else if (ea.Source == SelectionSource.KeyBoard) { _Element.SetIsSelected(ea.IsSelected, ea.Source, ea.Origin); VerifySelectionStates(_View, _Element); } else if (ea.Source == SelectionSource.UserInput) { _Element.SetIsSelected(ea.IsSelected, ea.Source, ea.Origin); VerifySelectionStates(_View, _Element); } } } }
internal void LoadNetworkPipePresenterAndModel(INetworkPipe pipe, INetworkPipeView pipeView, IElementView srcElView, IElementView destElView, int srcPortIndex, int destPortIndex) { Guid srcElId = srcElView.Id; Guid destElId = destElView.Id; // connect the pipe to the elements, at the model (biz) level. IOutputNetworkPort srcPort = GetSourceNetworkPort(srcElId, srcPortIndex); IInputNetworkPort destPort = GetDestinationNetworkPort(destElId, destPortIndex); ConnectPipeModel(pipe, srcPort, destPort); // set the id of the pipeView to the id of the pipe model pipeView.Id = pipe.Id; // create the instance of the presenter with the model and the view INetworkPipePresenter presenter = CreateNetworkPipePresenter(pipe, pipeView); // Add the pipe presenter to the presenter mgr,and the view to the workspace view. // Pipe model has already been added to workspace during unpersisting. if (presenter != null) { View.Add(pipeView, srcElView, destElView, srcPortIndex, destPortIndex); PipePresenters.Add(pipe.Id, presenter); } }
public static IHtmlContent FormatHtmlElementHtml(this IHtmlHelper htmlHelper, IElementView <HtmlElementSettings, HtmlElementContent> view) { if (string.IsNullOrWhiteSpace(view.Content.FormattedHtml)) { return(new HtmlString(string.Empty)); } IUrlHelper urlHelper = new UrlHelper(htmlHelper.ViewContext); HtmlElementHelper helper = new HtmlElementHelper(view, urlHelper); IStringUtilities utilitites = new StringUtilities(); string html = utilitites.BlockReplace(view.Content.FormattedHtml, "[[{", "}]]", helper.Replace); return(new HtmlString(html)); }
internal void CreateNetworkConnectionFromView(IElementView srcElView, IElementView destElView, int srcPortIndex, int destPortIndex) { // create the instance of the view INetworkPipeView view = CreateNetworkPipeView(); CreateNetworkPipePresenterAndModel(view, srcElView, destElView, srcPortIndex, destPortIndex); }
/// <summary> /// Verifies both the <paramref name="view"/> and the <paramref name="model"/> have the /// same selected setting. /// </summary> /// <param name="view"></param> /// <param name="model"></param> private void VerifySelectionStates(IElementView view, IElement model) { if (view.IsSelected != model.IsSelected) { throw new InvalidOperationException("Both the view and model must have the same selected value!"); } }
// TODO REMOVE internal void _View_ExecuteButtonClicked(IElementView sender, ButtonClickEventArgs ea) { // TODO REMOVE throw new NotImplementedException(); if (sender!=null) { Element.Execute(); } }
public CompleteNetworkConnectionEventArgs(INetworkPipeView networkPipeView, IElementView sourceElement, IElementView destinationElement, int srcPortIndex, int destPortIndex) : base(sourceElement, destinationElement, srcPortIndex, destPortIndex) { NetworkPipeView = networkPipeView; }
// returns a new instance public override GraphicItem GetRunTimeInstance(IElementView elementView, GraphicItemVisual visual) { return(new PG2VNCViewer(this, visual)); }
public IElementPresenter AddElementInstance(IElementDefinition definition, IElementView view) { // create the instance of the element IElement el = CreateElementModel(definition); // create the instance of the element presenter with the element and the view IElementPresenter presenter = CreateElementPresenter(el, view); // add the element to the workspace.ElementMgr and the view to the workspace view if (presenter != null) { ElementPresenters.Add(el.Id, presenter); WorkSpace.ElementsMgr.Add(el); UpdateElementLocation(el, view.Location); } return presenter; }
// TODO REMOVE internal void _View_SettingsButtonClicked(IElementView sender, ButtonClickEventArgs ea) { // TODO REMOVE throw new NotImplementedException(); if (sender!=null) { // CustomizationsViewToggle(); //XXX } }
internal void _view_DeleteElementInstance(IElementView sender, DeleteElementInstanceEventArgs ea) { // pass the ref of the element to delete on to the workspace for actual deletion if (sender!=null) { WorkSpace.ElementsMgr.Remove(ea.Element); } }
// called if update required protected override void UpdateVisual(IElementView elementView, ulong updateReason, ulong noValueEffects) { DrawItem(); }
internal IElementPresenter CreateElementPresenter(IElement model, IElementView view) { IElementPresenter pesenter = null; if (model != null && view != null) { // create the instance of the element presenter with the element and the view using (ElementPresenterFactory presFac = new ElementPresenterFactory()) { pesenter = presFac.Create(model, view); } } return pesenter; }
public AddPipeInstanceEventArgs(IElementView srcEl, IElementView destEl) { SourceElement = srcEl; DestinationElement = destEl; }
internal void CreateNetworkPipePresenterAndModel(INetworkPipeView pipeView, IElementView srcElView, IElementView destElView, int srcPortIndex, int destPortIndex) { //TODO XXX REMOVE Guid newPipeId = GetNewId(); Guid srcElId = srcElView.Id; Guid destElId = destElView.Id; // create the pipe model INetworkPipe pipe = CreateNetworkPipeModel(newPipeId); // connect the pipe to the elements, at the model (biz) level. First we need to get the elemetns: IOutputNetworkPort srcPort = GetSourceNetworkPort(srcElId, srcPortIndex); IInputNetworkPort destPort = GetDestinationNetworkPort(destElId, destPortIndex); ConnectPipeModel(pipe, srcPort, destPort); // create the instance of the view pipeView.Id = pipe.Id; // create the instance of the presenter with the model and the view INetworkPipePresenter presenter = CreateNetworkPipePresenter(pipe, pipeView); // Add the pipe to the workspace.ElementMgr and the persenter to the presenter mgr. // The pipeView is already in the workspace view. if (presenter != null) { WorkSpace.PipesMgr.Add(pipe); PipePresenters.Add(pipe.Id, presenter); } }
public override void Enter(MouseEventContext mouseEventContext, IElementView elementView) { this.hasMouseFocus = true; base.Enter(mouseEventContext, elementView); }
public HtmlElementHelper(IElementView <HtmlElementSettings, HtmlElementContent> view, IUrlHelper urlHelper) { _view = view; _urlHelper = urlHelper; }
// TODO REMOVE internal void _View_ElementViewReset(IElementView sender, ElementViewResetEventArgs ea) { if (sender != null) { Element.Reset(); } }
public CompleteDataConnectionEventArgs(IDataPipeView dataPipeView, IElementView sourceElement, IElementView destinationElement, int srcPortIndex, int destPortIndex) : base(sourceElement, destinationElement, srcPortIndex, destPortIndex) { DataPipeView = dataPipeView; }
public override void Leave(MouseEventContext mouseEventContext, IElementView elementView) { this.hasMouseFocus = false; base.Leave(mouseEventContext, elementView); }
public override void MouseUp(MouseEventContext mouseEventContext, IElementView elementView) { MouseUpdate(mouseEventContext, true); base.MouseUp(mouseEventContext, elementView); }
internal void _View_PortViewSelectionChanged(IElementView sender, PortViewSelectionEventArgs ea) { // Not Currently Used. throw new Exception("The method or operation is not implemented."); }
// mouse handling - 800xA side public override bool IsMouseEventConsumer(IElementView elementView) { return(true); }
// TODO REMOVE internal void _View_ExecuteButtonClicked(IElementView sender, ButtonClickEventArgs ea) { // ExecutionToggle(); }