示例#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;
        }
示例#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;
        }
示例#6
0
 public Decorator(IVisualComponent component)
 {
     this.Component = component;
 }
        //=====================================================================
        //		Constructors and Destructors
        //=====================================================================


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


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

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

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