Ejemplo n.º 1
0
        public WeatherForecastController()
        {
            var host = ConfigurationManager.AppSettings["host"];

            if (!int.TryParse(ConfigurationManager.AppSettings["port"], out int port) || string.IsNullOrEmpty(host))
            {
                return;
            }



            _apiClient = Ioc.Resolve <IApiClient>();
            _apiClient.Open(host, port);
            MainVM = new MainVM(_apiClient);

            DataContext = MainVM;

            var wc = Ioc.Resolve <IVisual>().GetVisualComponent();

            _wcInterface = wc;
            if (wc.IsWpfCompatible)
            {
                _weatherControl = (UIElement)wc.Control;
            }
            else
            {
                _weatherControl = new WindowsFormsHost()
                {
                    Child = (System.Windows.Forms.Control)wc.Control
                };
            }
            Body.Content = _weatherControl;
        }
Ejemplo n.º 2
0
        public MainWindow()
        {
            var host = ConfigurationManager.AppSettings["host"];

            if (!int.TryParse(ConfigurationManager.AppSettings["port"], out int port) || string.IsNullOrEmpty(host))
            {
                MessageBox.Show("Invalid Config");
                Application.Current.Shutdown();
                return;
            }

            InitializeComponent();

            _apiClient = Ioc.Resolve <IApiClient>();
            _apiClient.Open(host, port);
            MainVM = new MainVM(_apiClient);

            DataContext = MainVM;

            var wc = Ioc.Resolve <IVisual>().GetVisualComponent();

            _wcInterface = wc;
            if (wc.IsWpfCompatible)
            {
                _weatherControl = (UIElement)wc.Control;
            }
            else
            {
                _weatherControl = new WindowsFormsHost()
                {
                    Child = (System.Windows.Forms.Control)wc.Control
                };
            }
            Body.Content = _weatherControl;
        }
 //---------------------------------------------------------------------
 public OutlineDecorator(IVisualComponent ThisComponent, int ThisLineWidth, Color ThisLineColor)
     : base(ThisComponent)
 {
     this.LineWidth = ThisLineWidth;
     this.LineColor = ThisLineColor;
     return;
 }
 //---------------------------------------------------------------------
 public DropShadowDecorator(IVisualComponent ThisComponent, int ThisShadowDepth, Color ThisShadowColor, int ThisShadowOpacity)
     : base(ThisComponent)
 {
     this.ShadowDepth   = ThisShadowDepth;
     this.ShadowColor   = ThisShadowColor;
     this.ShadowOpacity = ThisShadowOpacity;
     return;
 }
        //=====================================================================
        //		Constructors and Destructors
        //=====================================================================


        //---------------------------------------------------------------------
        public DropShadowDecorator(IVisualComponent ThisComponent)
            : base(ThisComponent)
        {
            return;
        }
Ejemplo n.º 6
0
 public Decorator(IVisualComponent component)
 {
     this.Component = component;
 }
        //=====================================================================
        //		Constructors and Destructors
        //=====================================================================


        //---------------------------------------------------------------------
        public OutlineDecorator(IVisualComponent ThisComponent)
            : base(ThisComponent)
        {
            return;
        }
Ejemplo n.º 8
0
 static void RenderView(IVisualComponent component)
 {
     component.Draw();
 }
        //=====================================================================
        //		Constructors and Destructors
        //=====================================================================


        //---------------------------------------------------------------------
        public ComponentDecorator(IVisualComponent ThisComponent)
        {
            this._VisualComponent = ThisComponent;
            return;
        }
Ejemplo n.º 10
0
 public ScrollDecorator(IVisualComponent compt)
     : base(compt)
 {
 }
Ejemplo n.º 11
0
 public ScrollDecorator(IVisualComponent Component, int scrollPosition) : base(Component)
 {
     this.scrollPosition = scrollPosition;
 }
Ejemplo n.º 12
0
        public static ISetupAppBuilder AddComponent(this ISetupAppBuilder builder, IVisualComponent component)
        {
            builder.Context.Components.RegisterComponent(component);

            return(builder);
        }
Ejemplo n.º 13
0
 public BorderDecorator(IVisualComponent wrapped, int width)
 {
     _wrapped = wrapped;
     _width = width;
 }
Ejemplo n.º 14
0
 public BorderDecorator(IVisualComponent compt)
     : base(compt)
 {
 }
Ejemplo n.º 15
0
 public void Remove(IVisualComponent visualComponent)
 {
     Console.WriteLine("Cannot remove from a Icon Visual Component");
 }
Ejemplo n.º 16
0
        public static void RegisterComponent(IVisualComponent component)
        {
            var items = (AvaloniaList <object>)_carousel.Items;

            items.Add(component.GetVisualControl(Runtime.Context));
        }
Ejemplo n.º 17
0
 public BorderDecorator(IVisualComponent Component, int borderWidth) : base(Component)
 {
     this.borderWidth = borderWidth;
 }
Ejemplo n.º 18
0
 static void RenderView(IVisualComponent component)
 {
     component.Draw();
 }
Ejemplo n.º 19
0
 public void Add(IVisualComponent visualComponent)
 {
     _visualComponents.Add(visualComponent);
 }
Ejemplo n.º 20
0
 public void Remove(IVisualComponent visualComponent)
 {
     _visualComponents.Remove(visualComponent);
 }
Ejemplo n.º 21
0
 public void Add(IVisualComponent visualComponent)
 {
     Console.WriteLine("Cannot add to a Icon Visual Component");
 }
Ejemplo n.º 22
0
 public ScrollDecorator(IVisualComponent wrapped, int topLine)
 {
     _wrapped = wrapped;
     _topLine = topLine;
 }
Ejemplo n.º 23
0
 public BorderDecorator(IVisualComponent wrapped, int width)
 {
     _wrapped = wrapped;
     _width   = width;
 }
Ejemplo n.º 24
0
 public ScrollDecorator(IVisualComponent wrapped, int topLine)
 {
     _wrapped = wrapped;
     _topLine = topLine;
 }