Exemple #1
0
        public override ApplyState Apply(ComputedStyle style, Value value)
        {
            if (value == null || value.IsType(typeof(Css.Keywords.None)))
            {
                style.RenderData.BGColour = null;
            }
            else
            {
                UnityEngine.Color col = value.GetColour(style.RenderData, this);

                if (col.a == 0f)
                {
                    style.RenderData.BGColour = null;
                }
                else
                {
                    BackgroundColour colour = style.RenderData.BGColour;

                    if (colour == null)
                    {
                        // Create one:
                        style.RenderData.BGColour = colour = new BackgroundColour(style.RenderData);
                    }

                    // Change the base colour:
                    colour.BaseColour = col;
                }
            }

            style.RequestLayout();

            // Ok!
            return(ApplyState.Ok);
        }
        public override void Apply(ComputedStyle style, Value value)
        {
            if (value == null)
            {
                style.BGColour = null;
            }
            else
            {
                BackgroundColour colour = style.BGColour;

                if (colour == null)
                {
                    // Create one:
                    style.BGColour = colour = new BackgroundColour(style.Element);
                }

                // Change the base colour:
                colour.BaseColour = value.ToColor();

                // Tell it a colour changed:
                colour.ColourChanged();

                // display:inline can't have a bg-colour:
                style.EnforceNoInline();
            }

            style.RequestLayout();
        }
 public ResizeRequest(Resolution resolution, BackgroundColour backgroundColour, string watermark, FileType fileType)
 {
     Resolution       = resolution;
     BackgroundColour = backgroundColour;
     Watermark        = watermark;
     FileType         = fileType;
 }
Exemple #4
0
        /// <summary>
        /// Loads the content.
        /// </summary>
        public virtual void LoadContent()
        {
            GraphicsManager.Instance.Graphics.GraphicsDevice.Clear(BackgroundColour.ToXnaColor());

            GuiManager.Instance.LoadContent();

            RegisterEvents();
        }
Exemple #5
0
        public ImageCacheKey(string imageName, string imageResolution = null, string backgroundColour = null,
                             string watermarkText = null, string imageType = null)
        {
            _imageResolution  = ImageResolution.Parse(imageResolution);
            _backgroundColour = BackgroundColour.Parse(backgroundColour);
            if (!string.IsNullOrWhiteSpace(watermarkText))
            {
                _watermarkHash = GetWatermarkStringHash(watermarkText);
            }
            _imageType = ImageType.Parse(imageType);

            ImageName = imageName;
        }
Exemple #6
0
        public string GetBackgroundColor()
        {
            Models.MailSettings mailSettings = Engine.Settings.Mail;

            if (!BackgroundColour.IsSet())
            {
                if (mailSettings.BackgroundColour.IsSet())
                {
                    Logo = mailSettings.BackgroundColour;
                }
            }

            return(BackgroundColour);
        }
Exemple #7
0
        public void SaveXml(System.Xml.XmlWriter Writer, ConformPathHandler pathRewrite)
        {
            Writer.WriteStartElement("style");
            Writer.WriteAttributeString("name", Name);
            Writer.WriteAttributeString("transparent", BackgroundTransparent.ToString());
            Writer.WriteAttributeString("backColour", BackgroundColour.ToArgb().ToString());
            Writer.WriteAttributeString("backImage", BackgroundImage);
            Writer.WriteAttributeString("transitionTime", TransitionTime.ToString());

            SaveTextItem(Writer, PassageTitle, "passageTitle");
            SaveTextItem(Writer, MainText, "mainText");
            SaveTextItem(Writer, CopyRight, "copyrightText");

            Writer.WriteEndElement();
        }
Exemple #8
0
        private UIElement GetImage(string path, int dim, CupSizeEnum flag, string text)
        {
            var stackPanel = new StackPanel()
            {
                VerticalAlignment = VerticalAlignment.Bottom,
                Margin            = new Thickness(0, 0, 12, 0),
            };

            var border = new Border
            {
                VerticalAlignment   = VerticalAlignment.Bottom,
                HorizontalAlignment = HorizontalAlignment.Center,
                Width       = dim,
                Height      = dim,
                OpacityMask = new ImageBrush()
                {
                    ImageSource = new BitmapImage(new Uri("/Images/CupSizes/" + path, UriKind.Relative))
                }
            };

            var cupsize = CupSizeEnum.Value;

            var thisColour = cupsize.HasFlag(flag)
                ? new SolidColorBrush(BackgroundColour.GetValueOrDefault())
                : new SolidColorBrush(Colors.LightGray);

            border.Background = thisColour;

            stackPanel.Children.Add(border);

            var textBlock = new TextBlock
            {
                Text = text,
                HorizontalAlignment = HorizontalAlignment.Center,
                Foreground          = thisColour,
                FontSize            = 14
            };

            stackPanel.Children.Add(textBlock);

            return(stackPanel);
        }
		public override void Apply(ComputedStyle style,Value value){
			
			if(value==null){
				style.BGColour=null;
			}else{
				BackgroundColour colour=style.BGColour;
				
				if(colour==null){
					// Create one:
					style.BGColour=colour=new BackgroundColour(style.Element);
				}
				
				// Change the base colour:
				colour.BaseColour=value.ToColor();
				
				// Tell it a colour changed:
				colour.ColourChanged();
				
				// display:inline can't have a bg-colour:
				style.EnforceNoInline();
			}
			
			style.RequestLayout();
		}
Exemple #10
0
 /// <summary>
 /// Draws the content on the specified spriteBatch.
 /// </summary>
 /// <param name="spriteBatch">Sprite batch.</param>
 public virtual void Draw(SpriteBatch spriteBatch)
 {
     GraphicsManager.Instance.Graphics.GraphicsDevice.Clear(BackgroundColour.ToXnaColor());
     GuiManager.Instance.Draw(spriteBatch);
 }