Exemple #1
0
        public AlertWindow(string text, ContainerStyle windowStyle = null, ButtonStyle buttonStyle = null)
            : base(0, 0, 0, 0, null, windowStyle ?? new ContainerStyle() { Wall = 165, WallColor = 27 })
        {
            SetAlignmentInParent(Alignment.Center);
            SetupLayout(Alignment.Center, Direction.Down, childIndent: 0);
            int lines = (text?.Count(c => c == '\n') ?? 0) + 1;

            Label = AddToLayout(new Label(0, 0, 0, 1 + lines * 3, text, null,
                                          new LabelStyle()
            {
                TextIndent = new Indent()
                {
                    Horizontal = 1, Vertical = 1
                }
            }))
                    .SetFullSize(FullSize.Horizontal) as Label;
            buttonStyle = buttonStyle ?? new ButtonStyle()
            {
                WallColor  = PaintID.DeepGreen,
                BlinkStyle = ButtonBlinkStyle.Full,
                BlinkColor = PaintID.White
            };
            buttonStyle.TriggerStyle = ButtonTriggerStyle.TouchEnd;
            Button = AddToLayout(new Button(0, 0, 14, 4, "ok", null, buttonStyle,
                                            ((self, touch) => self.Root.HidePopUp()))) as Button;
            SetWH(0, Label.Height + Button.Height);
            SetFullSize(FullSize.Horizontal);
        }
Exemple #2
0
 protected static void ApplyContainerStyles(Grid container, ContainerStyle style)
 {
     if (style != null)
     {
         BindingOperations.SetBinding(container, Grid.MarginProperty, CreateBinding(style, "Margin"));
         BindingOperations.SetBinding(container, Grid.PaddingProperty, CreateBinding(style, "Padding"));
     }
 }
Exemple #3
0
 protected static void ApplyContainerStyles(Grid container, ContainerStyle style)
 {
     if (style != null)
     {
         BindingOperations.SetBinding(container, Grid.MarginProperty, CreateBinding(style, "Margin"));
         BindingOperations.SetBinding(container, Grid.PaddingProperty, CreateBinding(style, "Padding"));
     }
 }
 /// <summary>
 /// Attribute providing easier creation of custom internal editor windows
 /// </summary>
 /// <param name="Description"></param>
 /// <param name="ToolTip"></param>
 /// <param name="ContainerId"></param>
 /// <param name="Order"></param>
 /// <param name="ContainerType"></param>
 /// <param name="ContainerName"></param>
 public EditorFieldAttribute(string Description = default, ContainerStyle ContainerType = default, string ContainerName = default,
                             int ContainerId    = -1,
                             int Order          = -1,
                             string ToolTip     = default)
 {
     if (Description == default)
     {
         description = "Field Description Missing!";
         toolTip     = "Please fill out the field description in the EditorField attribute!";
     }
     else
     {
         description = Description;
         toolTip     = default ? Description : ToolTip;
Exemple #5
0
        /// <summary>
        /// Root widget that saves its position and size and has a button for changing position
        /// and a button for changing size (top left corner 1x1 and bottom right corner 1x1 by default).
        /// </summary>
        /// <param name="name">Unique interface identifier</param>
        /// <param name="provider">Tile provider object, default value - null (interface would
        /// be drawn on the Main.tile, tiles would be irrevocably modified).
        /// <para></para>
        /// FakeTileRectangle from [FakeManager](https://github.com/AnzhelikaO/FakeManager)
        /// can be passed as a value so that interface would be drawn above the Main.tile.</param>
        public Panel(string name, int x, int y, int width, int height, PanelDrag drag, PanelResize resize,
                     UIConfiguration configuration = null, ContainerStyle style = null, object provider = null)
            : base(name, x, y, width, height, configuration ?? new UIConfiguration() { UseBegin  = true,
                                                                                       UseMoving = true, UseEnd = true }, style, provider)
        {
            if (drag != null)
            {
                DragObject = Add(drag) as PanelDrag;
            }
            if (resize != null)
            {
                ResizeObject = Add(resize) as PanelResize;
            }

            DBRead();
        }
        public DefaultStyles(Structurizr.Styles styles, Action <ElementType, string> onCreatedFromExistingElement)
        {
            _elementStyle = styles.Elements.FirstOrDefault(x => x.Tag == "Element");
            if (_elementStyle == null)
            {
                _elementStyle = new ElementStyle("Element");
                styles.Elements.Add(_elementStyle);
            }

            Person          = new PersonStyle(styles, onCreatedFromExistingElement);
            SoftwareSystem  = new SoftwareSystemStyle(styles, onCreatedFromExistingElement);
            Container       = new ContainerStyle(styles, onCreatedFromExistingElement);
            Component       = new ComponentStyle(styles, onCreatedFromExistingElement);
            AsyncLineStyle  = new AsynchronousLineStyle(styles, onCreatedFromExistingElement);
            SyncLineStyle   = new SynchronousLineStyle(styles, onCreatedFromExistingElement);
            DependencyStyle = new DependencyStyle(styles, onCreatedFromExistingElement);
        }
        protected override void RenderContents(HtmlTextWriter writer)
        {
            //render table
            if (ContainerStyle != null)
            {
                ContainerStyle.AddAttributesToRender(writer);
            }
            writer.RenderBeginTag(HtmlTextWriterTag.Table);

            //Render Header Row
            RenderHeader(writer);

            //Render ListBox row
            RenderListBoxes(writer);

            //Render end of table
            writer.RenderEndTag();
        }
 public static IDenpendencyContainer CreateNewContainer(ContainerStyle style)
 {
     switch (style)
     {
         case  ContainerStyle.Autofac:
             ContainerBuilder builder = new ContainerBuilder();
             var container = new AutofacContainer(builder.Build());
             return container;
         //case "Microsoft Unity":
         //    IUnityContainer unityBuilder = new UnityContainer();
         //    MicrosoftUnityContainer unityContainer = new MicrosoftUnityContainer(unityBuilder);
         //    return unityContainer;
         default:
             ContainerBuilder builder2 = new ContainerBuilder();
             var container2 = new AutofacContainer(builder2.Build());
             return container2;
     }
 }
Exemple #9
0
        public ConfirmWindow(string text, Action <bool> callback, ContainerStyle style = null,
                             ButtonStyle yesButtonStyle = null, ButtonStyle noButtonStyle = null)
            : base(0, 0, 0, 0)
        {
            ConfirmCallback = callback ?? throw new ArgumentNullException(nameof(callback));

            SetAlignmentInParent(Alignment.Center);
            SetFullSize(FullSize.Both);

            Container = Add(new VisualContainer(style ?? new ContainerStyle()
            {
                Wall = 165, WallColor = 27
            })) as VisualContainer;
            Container.SetAlignmentInParent(Alignment.Center)
            .SetFullSize(FullSize.Horizontal)
            .SetupLayout(Alignment.Center, Direction.Down, childIndent: 0);

            int lines = (text?.Count(c => c == '\n') ?? 0) + 1;

            Label = Container.AddToLayout(new Label(0, 0, 0, 1 + lines * 3, text, null,
                                                    new LabelStyle()
            {
                TextIndent = new Indent()
                {
                    Horizontal = 1, Vertical = 1
                }
            }))
                    .SetFullSize(FullSize.Horizontal) as Label;

            VisualContainer yesno = Container.AddToLayout(new VisualContainer(0, 0, 24, 4)) as VisualContainer;

            yesButtonStyle = yesButtonStyle ?? new ButtonStyle()
            {
                WallColor  = PaintID.DeepGreen,
                BlinkStyle = ButtonBlinkStyle.Full,
                BlinkColor = PaintID.White
            };
            yesButtonStyle.TriggerStyle = ButtonTriggerStyle.TouchEnd;
            YesButton = yesno.Add(new Button(0, 0, 12, 4, "yes", null, yesButtonStyle,
                                             ((self, touch) =>
            {
                self.Root.HidePopUp();
                callback.Invoke(true);
            }))) as Button;

            noButtonStyle = noButtonStyle ?? new ButtonStyle()
            {
                WallColor  = PaintID.DeepRed,
                BlinkStyle = ButtonBlinkStyle.Full,
                BlinkColor = PaintID.White
            };
            noButtonStyle.TriggerStyle = ButtonTriggerStyle.TouchEnd;
            NoButton = yesno.Add(new Button(12, 0, 12, 4, "no", null, noButtonStyle,
                                            ((self, touch) =>
            {
                self.Root.HidePopUp();
                callback.Invoke(false);
            }))) as Button;

            Callback = CancelCallback;
            Container.SetWH(0, Label.Height + yesno.Height);
        }
Exemple #10
0
 /// <summary>
 /// Root widget that saves its position and size and has a button for changing position
 /// and a button for changing size (top left corner 1x1 and bottom right corner 1x1 by default).
 /// </summary>
 /// <param name="name">Unique interface identifier</param>
 /// <param name="provider">Tile provider object, default value - null (interface would
 /// be drawn on the Main.tile, tiles would be irrevocably modified).
 /// <para></para>
 /// FakeTileRectangle from [FakeManager](https://github.com/AnzhelikaO/FakeManager)
 /// can be passed as a value so that interface would be drawn above the Main.tile.</param>
 public Panel(string name, int x, int y, int width, int height, UIConfiguration configuration = null,
              ContainerStyle style = null, object provider = null)
     : this(name, x, y, width, height, new DefaultPanelDrag(), new DefaultPanelResize(), configuration, style, provider)
 {
 }