Esempio n. 1
0
 /// <summary>
 /// Returns the hash code for this instance.
 /// </summary>
 /// <returns>
 /// A 32-bit signed integer that is the hash code for this instance.
 /// </returns>
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = BackgroundTileMapAddress.GetHashCode();
         hashCode = (hashCode * 397) ^ TileSetAddress.GetHashCode();
         hashCode = (hashCode * 397) ^ ScrollX.GetHashCode();
         hashCode = (hashCode * 397) ^ ScrollY.GetHashCode();
         hashCode = (hashCode * 397) ^ SpriteHeight.GetHashCode();
         hashCode = (hashCode * 397) ^ SpritesEnabled.GetHashCode();
         hashCode = (hashCode * 397) ^ WindowEnabled.GetHashCode();
         hashCode = (hashCode * 397) ^ WindowTileMapAddress.GetHashCode();
         return(hashCode);
     }
 }
        protected override void ProcessRecord()
        {
            var control = new PsStack();

            SetControlProps(control);

            control.MinWidth     = MinWidth;
            control.MaxWidth     = MaxWidth;
            control.MinHeight    = MinHeight;
            control.MaxHeight    = MaxHeight;
            control.BgColor      = BgColor;
            control.Border       = Border;
            control.BorderRadius = BorderRadius;
            control.BorderLeft   = BorderLeft;
            control.BorderRight  = BorderRight;
            control.BorderTop    = BorderTop;
            control.BorderBottom = BorderBottom;
            control.OnSubmit     = OnSubmit;

            if (HorizontalAlign.HasValue)
            {
                control.HorizontalAlign = HorizontalAlign.Value;
            }

            if (VerticalAlign.HasValue)
            {
                control.VerticalAlign = VerticalAlign.Value;
            }

            if (Gap.HasValue)
            {
                control.Gap = Gap.Value;
            }

            if (Horizontal.IsPresent)
            {
                control.Horizontal = Horizontal.ToBool();
            }

            if (VerticalFill.IsPresent)
            {
                control.VerticalFill = VerticalFill.ToBool();
            }

            if (Wrap.IsPresent)
            {
                control.Wrap = Wrap.ToBool();
            }

            if (ScrollX.IsPresent)
            {
                control.ScrollX = ScrollX.ToBool();
            }

            if (ScrollY.IsPresent)
            {
                control.ScrollY = ScrollY.ToBool();
            }

            if (Controls != null)
            {
                foreach (var childControl in Controls)
                {
                    control.Controls.Add(childControl);
                }
            }

            WriteObject(control);
        }