Esempio n. 1
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = MinorVersion.GetHashCode();
         hashCode = (hashCode * 397) ^ MajorVersion.GetHashCode();
         hashCode = (hashCode * 397) ^ (PropMask?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (BackColor?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (ForeColor?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (FontTextProps?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (int)NextAvailableId;
         hashCode = (hashCode * 397) ^ (BooleanProperties?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (int)BorderStyle;
         hashCode = (hashCode * 397) ^ (int)MousePointer;
         hashCode = (hashCode * 397) ^ (ScrollBars?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ GroupCount;
         hashCode = (hashCode * 397) ^ (int)Cycle;
         hashCode = (hashCode * 397) ^ (int)SpecialEffect;
         hashCode = (hashCode * 397) ^ (BorderColor?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (int)Zoom;
         hashCode = (hashCode * 397) ^ (int)PictureAlignment;
         hashCode = (hashCode * 397) ^ (int)PictureSizeMode;
         hashCode = (hashCode * 397) ^ (int)ShapeCookie;
         hashCode = (hashCode * 397) ^ (int)DrawBuffer;
         hashCode = (hashCode * 397) ^ (DisplayedSize?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (LogicalSize?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (ScrollPosition?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (Caption?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ FontIsStdFont.GetHashCode();
         hashCode = (hashCode * 397) ^ (FontStdFont?.GetHashCode() ?? 0);
         return(hashCode);
     }
 }
        public override void Handle(ushort opcode, params object[] arguments)
        {
            switch ((EventOpcode)opcode)
            {
            case EventOpcode.LogicalPosition:
            {
                var x = (int)arguments[0];
                var y = (int)arguments[1];
                LogicalPosition?.Invoke(this, x, y);
                break;
            }

            case EventOpcode.LogicalSize:
            {
                var width  = (int)arguments[0];
                var height = (int)arguments[1];
                LogicalSize?.Invoke(this, width, height);
                break;
            }

            case EventOpcode.Done:
            {
                Done?.Invoke(this);
                break;
            }

            case EventOpcode.Name:
            {
                var name = (string)arguments[0];
                Name?.Invoke(this, name);
                break;
            }

            case EventOpcode.Description:
            {
                var description = (string)arguments[0];
                Description?.Invoke(this, description);
                break;
            }

            default:
                throw new ArgumentOutOfRangeException("unknown event");
            }
        }