Exemple #1
0
        public void ShowEventArgsContructorCreatesCorrectValues()
        {
            ShowEventArgs args = new ShowEventArgs();

            Assert.AreEqual(null, args.Timezone);
            Assert.AreEqual(0, args.X);
            Assert.AreEqual(0, args.Y);
            Assert.AreEqual(null, args.Type);
        }
        protected void window_MovePresentationDownRequested(object sender, ShowEventArgs e)
        {
            int selectedIndex = _window.ShowOrderSelectedShowIndex;

            if (selectedIndex < _showToEdit.ShowOrderShowsCount - 1)
            {
                _showToEdit.MoveShowDownInShowOrder(_window.ShowOrderSelectedShowIndex);
                _window.ShowOrderSelectedShowIndex = selectedIndex + 1;
            }
        }
        protected void window_AddToShowRequested(object sender, ShowEventArgs e)
        {
            if (_window.ImportedSelectedShow != null)
            {
                int newSelectedIndex = _window.ShowOrderSelectedShowIndex + 1;

                _showToEdit.AddShowToShowOrder(_window.ImportedSelectedShow, newSelectedIndex);
                _window.ShowOrderSelectedShowIndex = newSelectedIndex;
            }
        }
Exemple #4
0
 protected override void OnShow(ShowEventArgs e)
 {
     if (e.Argument != null)
     {
         lbl.Location    = new Point(0, 0);
         lbl.MaximumSize = new Size(1000, 0);
         lbl.AutoSize    = true;
         lbl.Text        = e.Argument.ToString();
         lbl.Parent      = Control;
     }
 }
Exemple #5
0
        //Must contain the call the to base.InvokeAsync() method for the MVC call
        //To cross from the component thread to the MVC thread and call out to the
        //other registered components.
        protected virtual void OnShow(Object sender, ShowEventArgs e)
        {
            BuildToastSettings(e.ToastLevel, e.Message);

            //Need to call this way when using service.AddSingleton for global app state
            //-- see comments above.
            base.InvokeAsync(StateHasChanged);

            //Can uncomment and use if the ToastService is using AddScoped for a
            //Client scoped object.
            //StateHasChanged();
        }
Exemple #6
0
        public void ShowEventArgsAttributesAreSetable()
        {
            ShowEventArgs args = new ShowEventArgs();

            args.Type = "test";
            Assert.AreEqual("test", args.Type);
            args.X = 1;
            Assert.AreEqual(1, args.X);
            args.Y = 1;
            Assert.AreEqual(1, args.Y);
            args.Timezone = TimeZoneInfo.Local;
            Assert.AreEqual(TimeZoneInfo.Local, args.Timezone);
        }
        public override MicroLayout OnShowMenu(ShowEventArgs e)
        {
            switch (e.InstanceName)
            {
            case "Test":
                return(new MicroLayout(new Rows(new Row(1, HorizontalAlignment.Center, VerticalAlignment.Center,
                                                        new ButtonText("Test", this, e.InstanceName, false, true, "Test")))));

            case "Snapshot":
                return(new MicroLayout(new Rows(new Row(1, HorizontalAlignment.Center, VerticalAlignment.Center,
                                                        new ButtonText("Snapshot", this, e.InstanceName, false, true, "Snapshot")))));

            default:
                return(base.OnShowMenu(e));
            }
        }
        public override MicroLayout OnShowMenu(ShowEventArgs e)
        {
            switch (e.InstanceName)
            {
            case "Cam1":
                return(this.GetCameraImage(0));

            case "Cam2":
                return(this.GetCameraImage(1));

            case "Cam3":
                return(this.GetCameraImage(2));

            default:
                return(base.OnShowMenu(e));
            }
        }
        protected void window_MovePresentationUpRequested(object sender, ShowEventArgs e)
        {
            int selectedIndex = _window.ShowOrderSelectedShowIndex;

            if (selectedIndex > 0)
            {
                _showToEdit.MoveShowUpInShowOrder(_window.ShowOrderSelectedShowIndex);
                _window.ShowOrderSelectedShowIndex = selectedIndex - 1;
            }
        }
 protected void window_DeletePresentationRequested(object sender, ShowEventArgs e)
 {
     _showToEdit.DeleteShow(_window.ImportedSelectedShow);
 }
 protected void window_RemoveFromShowRequested(object sender, ShowEventArgs e)
 {
     if (_window.ShowOrderSelectedShowIndex >= 0)
         _showToEdit.RemoveShowFromShowOrder(_window.ShowOrderSelectedShowIndex);
 }
Exemple #12
0
        public override MicroLayout OnShowMenu(ShowEventArgs e)
        {
            switch (e.InstanceName)
            {
            case "Temperature":
                MicroLayoutElement    Value;
                System.Drawing.Bitmap Bmp;

                if (temperatureC.HasValue)
                {
                    Bmp   = Clayster.HomeApp.MomentaryValues.Graphics.GetGauge(15, 25, temperatureC.Value, "°C", GaugeType.GreenToRed);
                    Value = new ImageVariable(Bmp);
                }

                /*{
                 *      Bitmap Bmp = Clayster.HomeApp.MomentaryValues.Graphics.GetGauge (15, 25, temperatureC.Value, "°C", GaugeType.GreenToRed);
                 *      string Id = typeof(Controller).FullName + ".Temp." + XmlUtilities.DoubleToString (temperatureC.Value, 1);
                 *      Value = new ImageConstant (Id, Bmp);
                 * }*/
                else
                {
                    Value = new Label("N/A");
                }

                return(new MicroLayout(new Rows(
                                           new Row(1, HorizontalAlignment.Center, VerticalAlignment.Center, Paragraph.Header1("Temperature")),
                                           new Row(3, HorizontalAlignment.Center, VerticalAlignment.Center, Value))));

            case "Light":
                if (lightPercent.HasValue)
                {
                    Bmp   = Clayster.HomeApp.MomentaryValues.Graphics.GetGauge(0, 100, lightPercent.Value, "%", GaugeType.WhiteDots);
                    Value = new ImageVariable(Bmp);
                }

                /*{
                 *      Bitmap Bmp = Clayster.HomeApp.MomentaryValues.Graphics.GetGauge (0, 100, lightPercent.Value, "%", GaugeType.WhiteDots);
                 *      string Id = typeof(Controller).FullName + ".Light." + XmlUtilities.DoubleToString (lightPercent.Value, 1);
                 *      Value = new ImageConstant (Id, Bmp);
                 * }*/
                else
                {
                    Value = new Label("N/A");
                }

                return(new MicroLayout(new Rows(
                                           new Row(1, HorizontalAlignment.Center, VerticalAlignment.Center, Paragraph.Header1("Light")),
                                           new Row(3, HorizontalAlignment.Center, VerticalAlignment.Center, Value))));

            case "Motion":
                Value = this.GetAlarmSymbol(motion);

                return(new MicroLayout(new Rows(
                                           new Row(1, HorizontalAlignment.Center, VerticalAlignment.Center, Paragraph.Header1("Motion")),
                                           new Row(2, HorizontalAlignment.Center, VerticalAlignment.Center, Value))));

            case "Alarm":
                Value = this.GetAlarmSymbol(lastAlarm);

                return(new MicroLayout(new Rows(
                                           new Row(1, HorizontalAlignment.Center, VerticalAlignment.Center, Paragraph.Header1("Alarm")),
                                           new Row(2, HorizontalAlignment.Center, VerticalAlignment.Center, Value))));

            default:
                return(base.OnShowMenu(e));
            }
        }
Exemple #13
0
        protected override void OnShow(ShowEventArgs e)
        {
            base.OnShow(e);

            previousPlugin = e.PreviousPlugin;
        }