Exemplo n.º 1
0
        private void ConfigureCapabilityPane(CapabilitySummary selectedCapability)
        {
            _componentFrame = new FrameView()
            {
                X           = 0,
                Y           = 0,
                Height      = Dim.Fill(),
                Width       = Dim.Fill(),
                Title       = $"Capability Details",
                ColorScheme = Colors.TopLevel
            };

            _capabilityPresentationJsonView = new TextView()
            {
                Y           = 0,
                X           = 0,
                Width       = Dim.Fill(),
                Height      = Dim.Fill(),
                ReadOnly    = true,
                ColorScheme = Colors.Dialog,
            };
            GetCapabilityPresentation(selectedCapability);
            _componentFrame.Add(_capabilityPresentationJsonView);
            HostPane.Add(_componentFrame);

            _capabilityPresentationJsonView.SetFocus();

            HostPane.ColorScheme = Colors.TopLevel;
        }
Exemplo n.º 2
0
 public virtual void DisplayErrorView()
 {
     if (ErrorView != null)
     {
         HostPane.Add(ErrorView);
     }
 }
Exemplo n.º 3
0
        public virtual View CreateJsonView(string json)
        {
            var view = new TextView()
            {
                X      = 0,
                Y      = 0,
                Width  = Dim.Fill(),
                Height = Dim.Fill()
            };

            string formattedJson = json.Replace("\r", "");

            view.Text     = ustring.Make(formattedJson);
            view.ReadOnly = true;

            // Set the colorscheme to make it stand out
            view.ColorScheme = Colors.Dialog;

            // Add
            HostPane.Add(view);
            HostPane.LayoutSubviews();
            HostPane.Clear();
            HostPane.SetNeedsDisplay();
            HostPane.Title = "Raw Data";
            return(view);
        }
Exemplo n.º 4
0
        public void ConfigureJsonPane()
        {
            JsonView = new TextView()
            {
                X      = 0,
                Y      = 0,
                Width  = Dim.Fill(),
                Height = Dim.Fill(),
            };

            JsonView.ReadOnly = true;

            // Set the colorscheme to make it stand out
            JsonView.ColorScheme = Colors.Dialog;

            HostPane.Add(JsonView);
        }
Exemplo n.º 5
0
        private void ConfigureComponentsStatusPane(Device selectedDevice)
        {
            _componentFrame = new FrameView()
            {
                X           = 0,
                Y           = 0,
                Height      = Dim.Fill(),
                Width       = Dim.Fill(),
                Title       = "main",
                ColorScheme = Colors.TopLevel
            };

            _componentList = new ListView(selectedDevice.Components.FirstOrDefault().Capabilities.Select(c => c.Id).ToList());

            _componentList.X             = 0;
            _componentList.Y             = 0;
            _componentList.Width         = Dim.Percent(30);
            _componentList.Height        = Dim.Fill();
            _componentList.AllowsMarking = false;
            _componentList.ColorScheme   = Colors.TopLevel;

            _componentList.SelectedItemChanged += (args) =>
            {
                _selectedCapabilityIndex = args.Item;
                GetComponentStatus(selectedDevice, args.Item);
            };

            _capabilitiesStatusJsonView = new TextView()
            {
                Y           = 0,
                X           = Pos.Right(_componentList),
                Width       = Dim.Fill(),
                Height      = Dim.Fill(),
                ReadOnly    = true,
                ColorScheme = Colors.Dialog,
            };

            _componentFrame.Add(_componentList, _capabilitiesStatusJsonView);

            HostPane.Add(_componentFrame);

            _componentList.SetFocus();
            GetComponentStatus(selectedDevice, 0);
            HostPane.ColorScheme = Colors.TopLevel;
        }