コード例 #1
0
        private void UpsertStack(string stackName, string templatePath, List <Parameter> parameters, List <Tag> tags, bool notification = false)
        {
            var settings = new StackSettings
            {
                NotificationArns = new List <string>()
            };

            CloudFormation.UpsertStack(stackName, templatePath, parameters, tags, Credentials, settings).Wait();
        }
コード例 #2
0
        public LayoutField()
        {
            InitializeComponent();

            var renderStackSettings = new StackSettings(Orientation.Vertical, Orientation.Horizontal, 16, @"Controls", Resources[@"stlRenderStack"] as Style, Resources[@"stlRenderStackItemBorder"] as Style, Resources[@"stlRenderStackHeaderBorder"] as Style, Resources[@"ctlRenderHeader"] as ControlTemplate);
            var layoutStackSettings = new StackSettings(Orientation.Horizontal, Orientation.Horizontal, 16, null, Resources[@"stlLayoutStack"] as Style, Resources[@"stlLayoutStackItemBorder"] as Style, Resources[@"stlLayoutStackHeaderBorder"] as Style, Resources[@"ctlLayoutHeader"] as ControlTemplate, LayoutStruct.Node.Rendering, renderStackSettings);

            deviceStackSettings = new StackSettings(Orientation.Vertical, Orientation.Vertical, 32, null, Resources[@"stlDeviceStack"] as Style, Resources[@"stlDeviceStackItemBorder"] as Style, Resources[@"stlDeviceStackHeaderBorder"] as Style, Resources[@"ctlDeviceHeader"] as ControlTemplate, LayoutStruct.Node.Layout, layoutStackSettings);
        }
コード例 #3
0
 public StackSettings(Orientation stackOrientation, Orientation headerStackOrientation, int headerIconScale, [CanBeNull] string header = null, [CanBeNull] Style stackStyle = null, [CanBeNull] Style stackItemBorderStyle = null, [CanBeNull] Style stackHeaderBorderStyle = null, [CanBeNull] ControlTemplate labelTemplate = null, [CanBeNull] string childXNodeName = null, [CanBeNull] StackSettings childSettings = null)
 {
     // Not adding a default orientation because that would make the init less intuitive.
     StackOrientation       = stackOrientation;
     HeaderStackOrientation = headerStackOrientation;
     HeaderIconScale        = headerIconScale;
     Header                 = header;
     StackStyle             = stackStyle;
     StackItemBorderStyle   = stackItemBorderStyle;
     StackHeaderBorderStyle = stackHeaderBorderStyle;
     LabelTemplate          = labelTemplate;
     ChildXNodeName         = childXNodeName;
     ChildSettings          = childSettings;
 }
コード例 #4
0
        private StackPanel DrawPanel([NotNull] IEnumerable <XElement> elements, [NotNull] StackSettings settings)
        {
            Debug.ArgumentNotNull(elements, nameof(elements));
            Debug.ArgumentNotNull(settings, nameof(settings));

            var stkElements = new StackPanel
            {
                Orientation = settings.StackOrientation
            };

            if (settings.StackStyle != null)
            {
                stkElements.Style = settings.StackStyle;
            }

            if (elements.Any())
            {
                foreach (var e in elements)
                {
                    var stkElement = new StackPanel
                    {
                        Orientation = settings.StackOrientation == Orientation.Horizontal ? Orientation.Vertical : Orientation.Horizontal
                    };

                    // <ICON-LABEL>
                    var stkHead = new StackPanel
                    {
                        Orientation = settings.HeaderStackOrientation
                    };

                    // ICON
                    var icon = new Icon(layoutSourceField.FieldUris.First().Site, GetAttributeValue(e, LayoutStruct.Attribute.Icon));

                    var image = new Image
                    {
                        Source = icon.GetSource(),
                        Height = settings.HeaderIconScale,
                        Width  = settings.HeaderIconScale
                    };
                    RenderOptions.SetBitmapScalingMode(image, BitmapScalingMode.NearestNeighbor);
                    stkHead.Children.Add(image);

                    // LABEL
                    var label = new Label
                    {
                        Content = GetAttributeValue(e, LayoutStruct.Attribute.DisplayName)
                    };
                    if (settings.LabelTemplate != null)
                    {
                        label.Template = settings.LabelTemplate;
                    }

                    // LINK
                    if (e.Attribute(LayoutStruct.Attribute.ItemId) != null)
                    {
                        var element = e;

                        label.MouseUp += delegate(object sender, MouseButtonEventArgs args)
                        {
                            if (args.ChangedButton == MouseButton.Left)
                            {
                                GoToItemId(GetAttributeValue(element, LayoutStruct.Attribute.ItemId));
                            }
                        };
                    }

                    stkHead.Children.Add(label);

                    // BORDER
                    var brdHead = new Border();
                    if (settings.StackHeaderBorderStyle != null)
                    {
                        brdHead.Style = settings.StackHeaderBorderStyle;
                    }

                    brdHead.Child = stkHead;
                    stkElement.Children.Add(brdHead);

                    // </ICON-Label>

                    // CHILDREN
                    if (!string.IsNullOrEmpty(settings.ChildXNodeName) && settings.ChildSettings != null)
                    {
                        stkElement.Children.Add(DrawPanel(e.Descendants(settings.ChildXNodeName), settings.ChildSettings));
                    }

                    // BORDER
                    var brdItem = new Border();
                    if (settings.StackItemBorderStyle != null)
                    {
                        brdItem.Style = settings.StackItemBorderStyle;
                    }

                    brdItem.Child = stkElement;

                    // ADD TO PARENT
                    stkElements.Children.Add(brdItem);
                }
            }

            return(stkElements);
        }