Ejemplo n.º 1
0
 public DesignSurfacePage(DesignServer server)
 {
     _server = server;
     Title   = "Design Surface";
 }
Ejemplo n.º 2
0
 protected DesignWorkflow(DesignServer server)
 {
     Server = server;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Instantiate a <see cref="DefaultDesignWorkflow"/>.
 /// </summary>
 /// <param name="messageFinder">Instantiates objects, using reflection.</param>
 /// <param name="server">When a message has been dispatched, the response is sent to the toolbox.</param>
 public DefaultDesignWorkflow(IXenMessageFinder messageFinder, DesignServer server) : base(server)
 {
     _messageFinder = messageFinder;
 }
Ejemplo n.º 4
0
        public ConnectionPage(DesignServer server, IXamlLoader xamlLoader, ITypeFinder typeFinder, IGetDesignerVersion version)
        {
            _server     = server;
            _xamlLoader = xamlLoader;
            _typeFinder = typeFinder;
            _version    = version;

            _mainLayout = new StackLayout
            {
                Padding     = new Thickness(10),
                Spacing     = 5,
                Orientation = StackOrientation.Vertical
            };

            _disconnectBtn = new Button
            {
                Text              = "Disconnect",
                VerticalOptions   = LayoutOptions.End,
                HorizontalOptions = LayoutOptions.Fill,
            };

            _continueBtn = new Button
            {
                Text              = "Design Surface",
                VerticalOptions   = LayoutOptions.End,
                HorizontalOptions = LayoutOptions.Fill,
            };

            _acceptingConnections = new Label
            {
                VerticalOptions         = LayoutOptions.CenterAndExpand,
                HorizontalOptions       = LayoutOptions.Center,
                HorizontalTextAlignment = TextAlignment.Center,
                TextColor = Color.White,
                Text      = $"Ready!\nNow accepting connections to:\n{_server.ListeningOn}",
                FontSize  = Device.GetNamedSize(NamedSize.Medium, typeof(Label))
            };

            _status = new Label
            {
                VerticalOptions   = LayoutOptions.EndAndExpand,
                HorizontalOptions = LayoutOptions.CenterAndExpand,
                Text = "Listening..."
            };

            _toolboxConnected = new Label
            {
                VerticalOptions         = LayoutOptions.CenterAndExpand,
                HorizontalOptions       = LayoutOptions.Center,
                HorizontalTextAlignment = TextAlignment.Center,
                Text     = "A toolbox is connected.\nYou can close the connection or continue to the design surface.",
                FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Label))
            };

            _continueBtn.Clicked += async(s, e) => await ShowDesignSurfaceAsync();

            _disconnectBtn.Clicked += (s, e) => OnDisconnect();

            RegisterServerEventHandlers();

            Content = _mainLayout;

            if (Device.OS == TargetPlatform.Android)
            {
                BackgroundImage = "background.png";
            }
            else
            {
                BackgroundColor = Color.White;
                _acceptingConnections.TextColor = Color.Black;
                _status.TextColor           = Color.Black;
                _toolboxConnected.TextColor = Color.Black;
            }

            StartAcceptingConnections();
        }
Ejemplo n.º 5
0
 private void GetDependencies()
 {
     _server   = Kernel.Get <DesignServer>();
     _workflow = Kernel.Get <DesignWorkflow>();
 }