Пример #1
0
        /// <summary>
        ///     Initializes a new instance of the WimMessageFileInfo class.
        /// </summary>
        /// <param name="wParam">The wParam object from the native callback function.</param>
        /// <param name="lParam">The lParam object from the native callback function.</param>
        internal WimMessageFileInfo(IntPtr wParam, IntPtr lParam)
            : base(wParam, lParam)
        {
            // Marshal the path
            //
            Param1 = Marshal.PtrToStringUni(wParam);

            // See if the last character is the path separator
            //
            if (Param1 != null && Param1[Param1.Length - 1] == System.IO.Path.DirectorySeparatorChar)
            {
                // Remove the last character
                //
                Param1 = Param1.Remove(Param1.Length - 1);
            }

            // Marshal the struct and cast it as a WimFileInfo object
            //
            Param2 = new WimFileInfo(Param1, lParam);
        }