protected override async void OnMessage(MessageEventArgs e) { var rawString = e.Data; var request = JsonConvert.DeserializeObject <Request <Object> >(rawString); switch (request.action) { case ACTION_SET_ID: id = JsonConvert.DeserializeObject <Request <string> >(rawString).payload; Story = await Task.Factory.StartNew(() => Story.Read(GetTargetFile(id))); break; case ACTION_UPDATE_LAYOUT: if (Story == null) { // fail // Send(); } else { var updateRequest = JsonConvert.DeserializeObject <Request <UpdateRequest> >(rawString) .payload; var storylineApp = new StorylineApp(); LayoutHandler.ApplyUpdateConfig(updateRequest, storylineApp); await Task.Factory.StartNew(() => storylineApp.SolveStory(Story)); var result = await LayoutHandler.postProcess(storylineApp._relaxedPos, Story, storylineApp); Send(JsonConvert.SerializeObject(result)); } break; } }
public static void MapInputTransparent(LayoutHandler handler, Layout layout) { if (handler.PlatformView is LayoutViewGroup layoutViewGroup) { // Handle input transparent for this view layoutViewGroup.InputTransparent = layout.InputTransparent; } layout.UpdateDescendantInputTransparent(); }
IReadOnlyList <UIElement> GetNativeChildren(LayoutHandler layoutHandler) { var views = new List <UIElement>(); for (int i = 0; i < layoutHandler.PlatformView.Children.Count; i++) { views.Add(layoutHandler.PlatformView.Children[i]); } return(views); }
IReadOnlyList<AView> GetNativeChildren(LayoutHandler layoutHandler) { var views = new List<AView>(); for (int i = 0; i < layoutHandler.PlatformView.ChildCount; i++) { views.Add(layoutHandler.PlatformView.GetChildAt(i)); } return views; }
public static bool ShouldArrangeLeftToRight(this IView view) { var viewFlowDirection = view.GetEffectiveFlowDirection(); // The various platforms handle layout and flow direction in different ways; some platforms // helpfully flip the coordinates of arrange calls when in RTL mode, others don't // So this gives us a place to ask the platform (via LayoutHandler) whether we need to do // the layout work to flip RTL stuff in our cross-platform layouts or not. var layoutFlowDirection = LayoutHandler.GetLayoutFlowDirection(viewFlowDirection); return(layoutFlowDirection == FlowDirection.LeftToRight); }
double GetNativeChildCount(LayoutHandler layoutHandler) { return(layoutHandler.PlatformView.Children.Count); }
IReadOnlyList <UIView> GetNativeChildren(LayoutHandler layoutHandler) { return(layoutHandler.NativeView.Subviews); }
double GetNativeChildCount(LayoutHandler layoutHandler) { return(layoutHandler.NativeView.Subviews.Length); }
LayoutView GetNativeLayout(LayoutHandler layoutHandler) { return(layoutHandler.NativeView); }
LayoutViewGroup GetNativeLayout(LayoutHandler layoutHandler) { return layoutHandler.PlatformView; }
public static void MapInputTransparent(LayoutHandler handler, Layout layout) { }
LayoutView GetNativeLayout(LayoutHandler layoutHandler) { return(layoutHandler.PlatformView); }
double GetNativeChildCount(LayoutHandler layoutHandler) { return(GetNativeChildCount((layoutHandler as IElementHandler).NativeView as UIView)); }
private void Construct(LayoutHandler layoutHandler) { this.layoutHandler = layoutHandler; }
private string GetTargetFile(string fileName) { return(LayoutHandler.GetTargetFile(fileName)); }
double GetNativeChildCount(LayoutHandler layoutHandler) { return((layoutHandler.NativeView as LayoutViewGroup).ChildCount); }
public static void MapInputTransparent(LayoutHandler handler, Layout layout) { handler.PlatformView?.UpdateInputTransparent(handler, layout); layout.UpdateDescendantInputTransparent(); }