<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;

namespace WpfUtility.Native {

    /// <summary>
    /// WINDOWPLACEMENT stores the position, size, and state of a window
    /// </summary>
    /// <remarks>
    /// <list type="bullet">
    /// <item>[WINDOWPLACEMENT Structure](https://msdn.microsoft.com/en-us/library/kb89946z.aspx)</item>
    /// <item>Header: winuser.h</item>
    /// </list>
    /// </remarks>
    [Serializable]
    [StructLayout(LayoutKind.Sequential)]
    struct WINDOWPLACEMENT {
        public uint length;
        public uint flags;
        public SW showCmd;
        public POINT minPosition;
        public POINT maxPosition;
        public RECT normalPosition;

        public override string ToString() {
            return String.Join(", ", new[] {
                "flags:" + flags,
                "showCmd:" + showCmd,
                "minPosition:{" + minPosition + "}",
                "maxPosition:{" + maxPosition + "}",
                "normalPosition:{" + normalPosition + "}",
            });
        }
    }

    /// <summary>
    /// ShowWindow() Commands
    /// </summary>
    enum SW : uint {
        HIDE = 0,
        SHOWNORMAL = 1,
        NORMAL = 1,
        SHOWMINIMIZED = 2,
        SHOWMAXIMIZED = 3,
        MAXIMIZE = 3,
        SHOWNOACTIVATE = 4,
        SHOW = 5,
        MINIMIZE = 6,
        SHOWMINNOACTIVE = 7,
        SHOWNA = 8,
        RESTORE = 9,
        SHOWDEFAULT = 10,
        FORCEMINIMIZE = 11,
        MAX = 11,
    }

    [Serializable]
    [StructLayout(LayoutKind.Sequential)]
    struct POINT {
        public int X;
        public int Y;

        public POINT(int x, int y) {
            X = x;
            Y = y;
        }

        public override string ToString() {
            return String.Join(", ", new[] {
                "X:" + X,
                "Y:" + Y,
            });
        }
    }

    [Serializable]
    [StructLayout(LayoutKind.Sequential)]
    struct RECT {
        public int Left;
        public int Top;
        public int Right;
        public int Bottom;

        public RECT(int left, int top, int right, int bottom) {
            Left = left;
            Top = top;
            Right = right;
            Bottom = bottom;
        }

        public override string ToString() {
            return String.Join(", ", new[] {
                "Left:" + Left,
                "Top:" + Top,
                "Right:" + Right,
                "Bottom:" + Bottom,
            });
        }
    }
}<commit_msg>NativeStructs: apply TakeAshUtility.ToStringHelper<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using TakeAshUtility;

namespace WpfUtility.Native {

    /// <summary>
    /// WINDOWPLACEMENT stores the position, size, and state of a window
    /// </summary>
    /// <remarks>
    /// <list type="bullet">
    /// <item>[WINDOWPLACEMENT Structure](https://msdn.microsoft.com/en-us/library/kb89946z.aspx)</item>
    /// <item>Header: winuser.h</item>
    /// </list>
    /// </remarks>
    [Serializable]
    [StructLayout(LayoutKind.Sequential)]
    struct WINDOWPLACEMENT {

        public uint length;

        [PrintMember("x4")]
        public uint flags;

        [PrintMember]
        public SW showCmd;

        [PrintMember]
        public POINT minPosition;

        [PrintMember]
        public POINT maxPosition;

        [PrintMember]
        public RECT normalPosition;

        public override string ToString() {
            return this.MembersToString();
        }
    }

    /// <summary>
    /// ShowWindow() Commands
    /// </summary>
    enum SW : uint {
        HIDE = 0,
        SHOWNORMAL = 1,
        NORMAL = 1,
        SHOWMINIMIZED = 2,
        SHOWMAXIMIZED = 3,
        MAXIMIZE = 3,
        SHOWNOACTIVATE = 4,
        SHOW = 5,
        MINIMIZE = 6,
        SHOWMINNOACTIVE = 7,
        SHOWNA = 8,
        RESTORE = 9,
        SHOWDEFAULT = 10,
        FORCEMINIMIZE = 11,
        MAX = 11,
    }

    [Serializable]
    [StructLayout(LayoutKind.Sequential)]
    struct POINT {

        [PrintMember]
        public int X;

        [PrintMember]
        public int Y;

        public POINT(int x, int y) {
            X = x;
            Y = y;
        }

        public override string ToString() {
            return this.MembersToString();
        }
    }

    [Serializable]
    [StructLayout(LayoutKind.Sequential)]
    struct RECT {

        [PrintMember]
        public int Left;

        [PrintMember]
        public int Top;

        [PrintMember]
        public int Right;

        [PrintMember]
        public int Bottom;

        public RECT(int left, int top, int right, int bottom) {
            Left = left;
            Top = top;
            Right = right;
            Bottom = bottom;
        }

        public override string ToString() {
            return this.MembersToString();
        }
    }
}
{'fraction_non_alphanumeric': 0.11443871479571599, 'fraction_numerical': 0.009321697738992463, 'mean_word_length': 1.5521255060728745, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2854958', 'n_tokens_mistral': 1555, 'n_tokens_neox': 1464, 'n_words': 364}