Exemplo n.º 1
0
        /// <summary>
        /// Populates the TaskPaneInfoSurrogate with data that is to be
        /// serialized from the specified TaskPaneInfo
        /// </summary>
        /// <param name="taskPaneInfo">The TaskPaneInfo that contains the data
        /// to be serialized</param>
        public void Load(TaskPaneInfo taskPaneInfo)
        {
            this.GradientStartColor = Tools.Drawing.ConvertColorToString(taskPaneInfo.GradientStartColor);
            this.GradientEndColor   = Tools.Drawing.ConvertColorToString(taskPaneInfo.GradientEndColor);
            this.GradientDirection  = taskPaneInfo.GradientDirection;

            this.Padding = taskPaneInfo.Padding;

            this.BackImage   = taskPaneInfo.BackImage.ToByteArray();
            this.StretchMode = taskPaneInfo.StretchMode;

            this.Watermark          = taskPaneInfo.Watermark.ToByteArray();
            this.WatermarkAlignment = taskPaneInfo.WatermarkAlignment;
        }
Exemplo n.º 2
0
        public void Update(ref InfComponentsImage17 comp)
        {
            ComponentFieldFlags flags = ComponentFieldFlags.None;

            ImageId = SetValue(ImageId, comp.registryId, nameof(ImageId), ref flags);
            Stretch = SetValue(Stretch, (ImageStretchMode)comp.stretchType, nameof(Stretch), ref flags);

            base.Update(
                comp.left, comp.top,
                comp.width, comp.height,
                (AtFlags)comp.displayAt,
                flags
                );
        }
Exemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the TaskPaneInfoSurrogate class with default settings
        /// </summary>
        public TaskPaneInfoSurrogate()
        {
            this.GradientStartColor = Tools.Drawing.ConvertColorToString(Color.Empty);
            this.GradientEndColor   = Tools.Drawing.ConvertColorToString(Color.Empty);
            this.GradientDirection  = LinearGradientMode.Vertical;

            this.Padding = PaddingEx.Empty;

            this.BackImage   = new byte[0];
            this.StretchMode = ImageStretchMode.Normal;

            this.Watermark          = new byte[0];
            this.WatermarkAlignment = ContentAlignment.BottomCenter;
        }
Exemplo n.º 4
0
 public ImageContent(int                 registryId,
                     ImageStretchMode    stretchType = ImageStretchMode.Proportional,
                     AtFlags             displayAt   = AtFlags.All,
                     VerticalAlignment   vAlignment  = VerticalAlignment.Stretch,
                     HorizontalAlignment hAlignment  = HorizontalAlignment.Stretch,
                     Size                size        = default)
   : base(displayAt,
          vAlignment,
          hAlignment,
          size)
 {
   RegistryId  = registryId;
   StretchType = stretchType;
 }
Exemplo n.º 5
0
        protected TaskPaneInfoSurrogate(SerializationInfo info, StreamingContext context)
            : base()
        {
            int version = info.GetInt32("Version");

            this.GradientStartColor = info.GetString("GradientStartColor");
            this.GradientEndColor   = info.GetString("GradientEndColor");
            this.GradientDirection  = (LinearGradientMode)info.GetValue("GradientDirection", typeof(LinearGradientMode));

            this.Padding = (PaddingEx)info.GetValue("Padding", typeof(PaddingEx));

            this.BackImage   = (byte[])info.GetValue("BackImage", typeof(byte[]));
            this.StretchMode = (ImageStretchMode)info.GetValue("StretchMode", typeof(ImageStretchMode));

            this.Watermark          = (byte[])info.GetValue("Watermark", typeof(byte[]));
            this.WatermarkAlignment = (ContentAlignment)info.GetValue("WatermarkAlignment", typeof(ContentAlignment));
        }
Exemplo n.º 6
0
        /// <summary>
        /// Initializes a new instance of the TaskPaneInfo class with default settings
        /// </summary>
        public TaskPaneInfo()
        {
            // set background values
            this.gradientStartColor = Color.Transparent;
            this.gradientEndColor   = Color.Transparent;
            this.direction          = LinearGradientMode.Vertical;

            // set padding values
            this.padding = new PaddingEx(12, 12, 12, 12);

            // images
            this.backImage   = null;
            this.stretchMode = ImageStretchMode.Tile;

            this.watermark          = null;
            this.watermarkAlignment = ContentAlignment.BottomCenter;

            this.owner = null;
        }
Exemplo n.º 7
0
        /// <summary>
        /// Forces the use of default empty values
        /// </summary>
        public void SetDefaultEmptyValues()
        {
            // set background values
            this.gradientStartColor = Color.Empty;
            this.gradientEndColor   = Color.Empty;
            this.direction          = LinearGradientMode.Vertical;

            // set padding values
            this.padding.Left   = 0;
            this.padding.Top    = 0;
            this.padding.Right  = 0;
            this.padding.Bottom = 0;

            // images
            this.backImage          = null;
            this.stretchMode        = ImageStretchMode.Tile;
            this.watermark          = null;
            this.watermarkAlignment = ContentAlignment.BottomCenter;
        }
Exemplo n.º 8
0
            /// <summary>
            /// Populates the TaskPaneInfoSurrogate with data that is to be 
            /// serialized from the specified TaskPaneInfo
            /// </summary>
            /// <param name="taskPaneInfo">The TaskPaneInfo that contains the data 
            /// to be serialized</param>
            public void Load(TaskPaneInfo taskPaneInfo)
            {
                this.GradientStartColor = ThemeManager.ConvertColorToString(taskPaneInfo.GradientStartColor);
                this.GradientEndColor = ThemeManager.ConvertColorToString(taskPaneInfo.GradientEndColor);
                this.GradientDirection = taskPaneInfo.GradientDirection;

                this.Padding = taskPaneInfo.Padding;

                this.BackImage = ThemeManager.ConvertImageToByteArray(taskPaneInfo.BackImage);
                this.StretchMode = taskPaneInfo.StretchMode;

                this.Watermark = ThemeManager.ConvertImageToByteArray(taskPaneInfo.Watermark);
                this.WatermarkAlignment = taskPaneInfo.WatermarkAlignment;
            }
Exemplo n.º 9
0
            protected TaskPaneInfoSurrogate(SerializationInfo info, StreamingContext context)
                : base()
            {
                int version = info.GetInt32("Version");

                this.GradientStartColor = info.GetString("GradientStartColor");
                this.GradientEndColor = info.GetString("GradientEndColor");
                this.GradientDirection = (LinearGradientMode)info.GetValue("GradientDirection", typeof(LinearGradientMode));

                this.Padding = (Padding)info.GetValue("Padding", typeof(Padding));

                this.BackImage = (byte[])info.GetValue("BackImage", typeof(byte[]));
                this.StretchMode = (ImageStretchMode)info.GetValue("StretchMode", typeof(ImageStretchMode));

                this.Watermark = (byte[])info.GetValue("Watermark", typeof(byte[]));
                this.WatermarkAlignment = (ContentAlignment)info.GetValue("WatermarkAlignment", typeof(ContentAlignment));
            }
Exemplo n.º 10
0
            /// <summary>
            /// Initializes a new instance of the TaskPaneInfoSurrogate class with default settings
            /// </summary>
            public TaskPaneInfoSurrogate()
            {
                this.GradientStartColor = ThemeManager.ConvertColorToString(Color.Empty);
                this.GradientEndColor = ThemeManager.ConvertColorToString(Color.Empty);
                this.GradientDirection = LinearGradientMode.Vertical;

                this.Padding = Padding.Empty;

                this.BackImage = new byte[0];
                this.StretchMode = ImageStretchMode.Normal;

                this.Watermark = new byte[0];
                this.WatermarkAlignment = ContentAlignment.BottomCenter;
            }
Exemplo n.º 11
0
        /// <summary>
        /// Forces the use of default values
        /// </summary>
        public void SetDefaultValues()
        {
            // set background values
            this.gradientStartColor = SystemColors.Window;
            this.gradientEndColor = SystemColors.Window;
            this.direction = LinearGradientMode.Vertical;

            // set padding values
            this.padding.Left = 12;
            this.padding.Top = 12;
            this.padding.Right = 12;
            this.padding.Bottom = 12;

            // images
            this.backImage = null;
            this.stretchMode = ImageStretchMode.Tile;
            this.watermark = null;
            this.watermarkAlignment = ContentAlignment.BottomCenter;
        }
Exemplo n.º 12
0
        /// <summary>
        /// Initializes a new instance of the TaskPaneInfo class with default settings
        /// </summary>
        public TaskPaneInfo()
        {
            // set background values
            this.gradientStartColor = Color.Transparent;
            this.gradientEndColor = Color.Transparent;
            this.direction = LinearGradientMode.Vertical;

            // set padding values
            this.padding = new Padding(12, 12, 12, 12);

            // images
            this.backImage = null;
            this.stretchMode = ImageStretchMode.Tile;

            this.watermark = null;
            this.watermarkAlignment = ContentAlignment.BottomCenter;

            this.owner = null;
        }