Esempio n. 1
0
        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;
            }
        }
Esempio n. 2
0
        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);
        }
Esempio n. 4
0
		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;
		}
Esempio n. 5
0
        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);
 }
Esempio n. 7
0
 IReadOnlyList <UIView> GetNativeChildren(LayoutHandler layoutHandler)
 {
     return(layoutHandler.NativeView.Subviews);
 }
Esempio n. 8
0
 double GetNativeChildCount(LayoutHandler layoutHandler)
 {
     return(layoutHandler.NativeView.Subviews.Length);
 }
Esempio n. 9
0
 LayoutView GetNativeLayout(LayoutHandler layoutHandler)
 {
     return(layoutHandler.NativeView);
 }
Esempio n. 10
0
		LayoutViewGroup GetNativeLayout(LayoutHandler layoutHandler)
		{
			return layoutHandler.PlatformView;
		}
Esempio n. 11
0
 public static void MapInputTransparent(LayoutHandler handler, Layout layout)
 {
 }
Esempio n. 12
0
 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;
 }
Esempio n. 15
0
 private string GetTargetFile(string fileName)
 {
     return(LayoutHandler.GetTargetFile(fileName));
 }
 double GetNativeChildCount(LayoutHandler layoutHandler)
 {
     return((layoutHandler.NativeView as LayoutViewGroup).ChildCount);
 }
Esempio n. 17
0
 public static void MapInputTransparent(LayoutHandler handler, Layout layout)
 {
     handler.PlatformView?.UpdateInputTransparent(handler, layout);
     layout.UpdateDescendantInputTransparent();
 }