Compare commits

...

5 Commits

Author SHA1 Message Date
David Hall 3b3d11aed3 Added nullability to Printing and tests 2023-10-31 17:03:24 -06:00
David Hall cc7fac9a91 Added PSYSTEMTIME class 2023-10-31 17:03:09 -06:00
David Hall 236e881436 Added VirtualList class similar to VirtualDictionary 2023-10-31 17:02:46 -06:00
David Hall e7d92752e7 Added test class to impersonate a local acct. 2023-10-31 17:02:18 -06:00
David Hall d0fc6a0f70 Added nullability to PhotoAcquire 2023-10-23 14:39:57 -06:00
16 changed files with 1211 additions and 547 deletions

View File

@ -0,0 +1,234 @@
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
namespace Vanara.Collections;
/// <summary>Interface that defines the methods for a virtual list. This interface is used by the <see cref="VirtualList{T}"/> class.</summary>
/// <typeparam name="T">The type of the element.</typeparam>
/// <seealso cref="IVirtualReadOnlyListMethods&lt;T&gt;"/>
public interface IVirtualListMethods<T> : IVirtualReadOnlyListMethods<T>
{
/// <summary>Adds an item to the end of the list.</summary>
/// <param name="item">The object to add to the list.</param>
void AddItem(T item);
/// <summary>Inserts an item to the list at the specified index.</summary>
/// <param name="index">The zero-based index at which item should be inserted.</param>
/// <param name="item">The object to insert into the list.</param>
void InsertItemAt(int index, T item);
/// <summary>Removes the item at the specified index.</summary>
/// <param name="index">The zero-based index of the item to remove.</param>
void RemoveItemAt(int index);
/// <summary>Sets the element at the specified index.</summary>
/// <param name="index">The zero-based index of the element to set.</param>
/// <param name="value">The element at the specified index.</param>
void SetItemAt(int index, T value);
}
/// <summary>
/// Interface that defines the methods for a virtual read-only list. This interface is used by the <see cref="VirtualReadOnlyList{T}"/> class.
/// </summary>
/// <typeparam name="T">The type of the element.</typeparam>
public interface IVirtualReadOnlyListMethods<T>
{
/// <summary>Gets the number of elements in the collection.</summary>
/// <returns>The number of elements in the collection.</returns>
int GetItemCount();
/// <summary>Tries to get the element at the specified index.</summary>
/// <param name="index">The zero-based index of the element to get.</param>
/// <param name="value">The value, if <paramref name="index"/> is a valid index; or <see langword="default"/> if not.</param>
/// <returns><see langword="true"/> if the list contains an element at the specified index; otherwise, <see langword="false"/>.</returns>
bool TryGet(int index, [NotNullWhen(true)] out T? value);
}
/// <summary>A virtual list that implements a lot of the scaffolding.</summary>
/// <typeparam name="T">The element type.</typeparam>
public class VirtualList<T> : VirtualReadOnlyList<T>, IList<T>
{
/// <summary>The implementation.</summary>
protected readonly IVirtualListMethods<T> impl;
/// <summary>Initializes a new instance of the <see cref="VirtualList{T}"/> class.</summary>
public VirtualList(IVirtualListMethods<T> impl) : base(impl) => this.impl = impl;
/// <inheritdoc/>
bool ICollection<T>.IsReadOnly => false;
/// <inheritdoc/>
public new T this[int index]
{
get => base[index];
set => impl.SetItemAt(index, value);
}
/// <inheritdoc/>
public void Add(T item) => impl.AddItem(item);
/// <inheritdoc/>
public void Clear()
{
for (int i = Count - 1; i >= 0; i--)
RemoveAt(i);
}
/// <inheritdoc/>
public void Insert(int index, T item) => impl.InsertItemAt(index, item);
/// <inheritdoc/>
public bool Remove(T item)
{
int i = IndexOf(item);
if (i >= 0)
{
RemoveAt(i);
return true;
}
return false;
}
/// <inheritdoc/>
public void RemoveAt(int index) => impl.RemoveItemAt(index);
/// <inheritdoc/>
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
}
/// <summary>Wrapper for <see cref="IVirtualListMethods{T}"/> that allows for the use of delegates instead of implementing the interface.</summary>
/// <typeparam name="T">The element type.</typeparam>
/// <seealso cref="IVirtualListMethods&lt;T&gt;"/>
public class VirtualListMethodCarrier<T> : IVirtualListMethods<T>
{
/// <summary>Initializes a new instance of the <see cref="VirtualListMethodCarrier{T}"/> class.</summary>
/// <param name="tryGet">Delegate that tries to get the element at the specified index.</param>
/// <param name="getCount">Delegate that gets the number of elements in the collection.</param>
/// <param name="add">Delegate that adds an item to the end of the list.</param>
/// <param name="insert">Delegate that inserts an item to the list at the specified index.</param>
/// <param name="removeAt">Delegate that removes the item at the specified index.</param>
/// <param name="setAt">Delegate that sets the element at the specified index.</param>
public VirtualListMethodCarrier(VirtualReadOnlyList<T>.TryGetDelegate tryGet, Func<int> getCount, Action<T>? add = null, Action<int, T>? insert = null, Action<int>? removeAt = null, Action<int, T>? setAt = null)
{
TryGet = tryGet;
GetCount = getCount;
Add = add;
Insert = insert;
RemoveAt = removeAt;
SetAt = setAt;
}
/// <summary>Delegate that adds an item to the end of the list.</summary>
public Action<T>? Add { get; }
/// <summary>Delegate that gets the number of elements in the collection.</summary>
public Func<int> GetCount { get; }
/// <summary>Delegate that inserts an item to the list at the specified index.</summary>
public Action<int, T>? Insert { get; }
/// <summary>Delegate that removes the item at the specified index.</summary>
public Action<int>? RemoveAt { get; }
/// <summary>Delegate that sets the element at the specified index.</summary>
public Action<int, T>? SetAt { get; }
/// <summary>Delegate that tries to get the element at the specified index.</summary>
public VirtualReadOnlyList<T>.TryGetDelegate TryGet { get; }
/// <inheritdoc/>
void IVirtualListMethods<T>.AddItem(T item) => Add?.Invoke(item);
/// <inheritdoc/>
int IVirtualReadOnlyListMethods<T>.GetItemCount() => GetCount();
/// <inheritdoc/>
void IVirtualListMethods<T>.InsertItemAt(int index, T item) => Insert?.Invoke(index, item);
/// <inheritdoc/>
void IVirtualListMethods<T>.RemoveItemAt(int index) => RemoveAt?.Invoke(index);
/// <inheritdoc/>
void IVirtualListMethods<T>.SetItemAt(int index, T value) => SetAt?.Invoke(index, value);
/// <inheritdoc/>
bool IVirtualReadOnlyListMethods<T>.TryGet(int index, [NotNullWhen(true)] out T? value) => TryGet(index, out value);
}
/// <summary>A virtual read-only list that implements a lot of the scaffolding.</summary>
/// <typeparam name="T">The element type.</typeparam>
public class VirtualReadOnlyList<T> : IReadOnlyList<T>
{
/// <summary>The read only implementation.</summary>
protected readonly IVirtualReadOnlyListMethods<T> readOnlyImpl;
/// <summary>Initializes a new instance of the <see cref="VirtualList{T}"/> class.</summary>
public VirtualReadOnlyList(IVirtualReadOnlyListMethods<T> impl) => readOnlyImpl = impl;
/// <summary>Delegate for a method that tries to get the element at the specified index.</summary>
/// <param name="index">The zero-based index of the element to get.</param>
/// <param name="value">The value, if <paramref name="index"/> is a valid index; or <see langword="default"/> if not.</param>
/// <returns><see langword="true"/> if the list contains an element at the specified index; otherwise, <see langword="false"/>.</returns>
public delegate bool TryGetDelegate(int index, [NotNullWhen(true)] out T? value);
/// <inheritdoc/>
public virtual int Count => readOnlyImpl.GetItemCount();
/// <inheritdoc/>
public virtual T this[int index] => readOnlyImpl.TryGet(index, out T? v) ? v : throw new ArgumentOutOfRangeException(nameof(index));
/// <inheritdoc/>
public virtual bool Contains(T item) => IndexOf(item) >= 0;
/// <inheritdoc/>
public virtual void CopyTo(T[] array, int arrayIndex)
{
if (array is null)
throw new ArgumentNullException(nameof(array));
if (arrayIndex < 0 || arrayIndex > array.Length)
throw new ArgumentOutOfRangeException(nameof(arrayIndex));
if (array.Length - arrayIndex < Count)
throw new ArgumentException("The number of elements in the source ICollection<T> is greater than the available space from arrayIndex to the end of the destination array.");
for (int i = 0; i < Count; i++)
array[arrayIndex + i] = this[i];
}
/// <inheritdoc/>
public virtual IEnumerator<T> GetEnumerator()
{
for (int i = 0; i < Count; i++)
yield return this[i];
}
/// <inheritdoc/>
public virtual int IndexOf(T item)
{
for (int i = 0; i < Count; i++)
{
/* Unmerged change from project 'Vanara.PInvoke.Printing (net48)'
Before:
if (Equals(this[i], item))
After:
{
if (Equals(this[i], item))
*/
if (Equals(this[i], item))
return i;
}
/* Unmerged change from project 'Vanara.PInvoke.Printing (net48)'
Before:
return -1;
After:
}
return -1;
*/
return -1;
}
/// <inheritdoc/>
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
}

View File

@ -6833,9 +6833,8 @@ public static partial class Opc
public OpcEnumerator(TEnum opcEnumerator)
{
opcEnum = opcEnumerator ?? throw new ArgumentNullException(nameof(opcEnumerator));
moveNext = typeof(TEnum).GetMethod("MoveNext");
getCurrent = typeof(TEnum).GetMethod("GetCurrent");
if (moveNext is null || getCurrent is null) throw new ArgumentException("The type specified for TEnum is not a valid Opc Enumerator instance.");
moveNext = typeof(TEnum).GetMethod("MoveNext") ?? throw new ArgumentException("Unable to find MoveNext method in TEnum type.", nameof(TEnum));
getCurrent = typeof(TEnum).GetMethod("GetCurrent") ?? throw new ArgumentException("Unable to find GetCurrent method in TEnum type.", nameof(TEnum));
}
/// <summary>Gets the element in the collection at the current position of the enumerator.</summary>
@ -6844,7 +6843,7 @@ public static partial class Opc
get
{
var p = new object?[] { null };
((HRESULT)getCurrent.Invoke(opcEnum, p)).ThrowIfFailed();
((HRESULT)getCurrent.Invoke(opcEnum, p)!).ThrowIfFailed();
return (TElem)p[0]!;
}
}
@ -6863,7 +6862,7 @@ public static partial class Opc
public bool MoveNext()
{
var p = new object[] { false };
((HRESULT)moveNext.Invoke(opcEnum, p)).ThrowIfFailed();
((HRESULT)moveNext.Invoke(opcEnum, p)!).ThrowIfFailed();
return (bool)p[0];
}

View File

@ -1,4 +1,3 @@
#nullable enable
using System.Runtime.InteropServices.ComTypes;
using static Vanara.PInvoke.Gdi32;
using static Vanara.PInvoke.Ole32;
@ -11,6 +10,7 @@ namespace Vanara.PInvoke;
/// <summary>Enums and interfaces from the Windows Photo Acquisition API.</summary>
public static partial class PhotoAcquisition
{
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
public static readonly HRESULT PAQ_ERR = HRESULT.Make(true, HRESULT.FacilityCode.FACILITY_ITF, 0xA001);
public static readonly PROPERTYKEY PKEY_PhotoAcquire_CameraSequenceNumber = new(new(0x00f23377, 0x7ac6, 0x4b7a, 0x84, 0x43, 0x34, 0x5e, 0x73, 0x1f, 0xa5, 0x7a), 7); // VT_LPWSTR
public static readonly PROPERTYKEY PKEY_PhotoAcquire_DuplicateDetectionID = new(new(0x00f23377, 0x7ac6, 0x4b7a, 0x84, 0x43, 0x34, 0x5e, 0x73, 0x1f, 0xa5, 0x7a), 10); // VT_I4
@ -21,6 +21,7 @@ public static partial class PhotoAcquisition
public static readonly PROPERTYKEY PKEY_PhotoAcquire_RelativePathname = new(new(0x00f23377, 0x7ac6, 0x4b7a, 0x84, 0x43, 0x34, 0x5e, 0x73, 0x1f, 0xa5, 0x7a), 2); // VT_LPWSTR
public static readonly PROPERTYKEY PKEY_PhotoAcquire_SkipImport = new(new(0x00f23377, 0x7ac6, 0x4b7a, 0x84, 0x43, 0x34, 0x5e, 0x73, 0x1f, 0xa5, 0x7a), 9); // VT_BOOL
public static readonly PROPERTYKEY PKEY_PhotoAcquire_TransferResult = new(new(0x00f23377, 0x7ac6, 0x4b7a, 0x84, 0x43, 0x34, 0x5e, 0x73, 0x1f, 0xa5, 0x7a), 5); // VT_SCODE
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
/// <summary>The enumeration type indicates the type of a selected device.</summary>
/// <remarks>This enumeration type is pointed to by the <c>pnDeviceType</c> parameter of IPhotoAcquireDeviceSelectionDialog::DoModal.</remarks>
@ -453,8 +454,8 @@ public static partial class PhotoAcquisition
// https://learn.microsoft.com/en-us/windows/win32/api/photoacquire/nf-photoacquire-iphotoacquire-acquire HRESULT Acquire( [in]
// IPhotoAcquireSource *pPhotoAcquireSource, [in] BOOL fShowProgress, [in] HWND hWndParent, [in] LPCWSTR pszApplicationName, [in]
// IPhotoAcquireProgressCB *pPhotoAcquireProgressCB );
void Acquire([In, Optional, MarshalAs(UnmanagedType.Interface)] IPhotoAcquireSource pPhotoAcquireSource, [In, MarshalAs(UnmanagedType.Bool)] bool fShowProgress,
[In, Optional] HWND hWndParent, [In, Optional, MarshalAs(UnmanagedType.LPWStr)] string? pszApplicationName, [In, Optional, MarshalAs(UnmanagedType.Interface)] IPhotoAcquireProgressCB pPhotoAcquireProgressCB);
void Acquire([In, Optional, MarshalAs(UnmanagedType.Interface)] IPhotoAcquireSource? pPhotoAcquireSource, [In, MarshalAs(UnmanagedType.Bool)] bool fShowProgress,
[In, Optional] HWND hWndParent, [In, Optional, MarshalAs(UnmanagedType.LPWStr)] string? pszApplicationName, [In, Optional, MarshalAs(UnmanagedType.Interface)] IPhotoAcquireProgressCB? pPhotoAcquireProgressCB);
/// <summary>
/// The method retrieves an enumeration containing the paths of all files successfully transferred during the most recent call to Acquire.
@ -747,7 +748,7 @@ public static partial class PhotoAcquisition
// https://learn.microsoft.com/en-us/windows/win32/api/photoacquire/nf-photoacquire-iphotoacquireplugin-initialize HRESULT
// Initialize( [in] IPhotoAcquireSource *pPhotoAcquireSource, [in] IPhotoAcquireProgressCB *pPhotoAcquireProgressCB );
[PreserveSig]
HRESULT Initialize([In, Optional] IPhotoAcquireSource pPhotoAcquireSource, [In, Optional] IPhotoAcquireProgressCB pPhotoAcquireProgressCB);
HRESULT Initialize([In, Optional] IPhotoAcquireSource? pPhotoAcquireSource, [In, Optional] IPhotoAcquireProgressCB? pPhotoAcquireProgressCB);
/// <summary>
/// The method provides additional functionality each time an item is processed. The application provides the implementation of the method.
@ -806,8 +807,8 @@ public static partial class PhotoAcquisition
// ProcessItem( [in] DWORD dwAcquireStage, [in] IPhotoAcquireItem *pPhotoAcquireItem, [in] IStream *pOriginalItemStream, [in] LPCWSTR
// pszFinalFilename, [in] IPropertyStore *pPropertyStore );
[PreserveSig]
HRESULT ProcessItem(PAPS dwAcquireStage, [In, Optional] IPhotoAcquireItem pPhotoAcquireItem, [In, Optional] IStream pOriginalItemStream,
string pszFinalFilename, [In, Optional] IPropertyStore pPropertyStore);
HRESULT ProcessItem(PAPS dwAcquireStage, [In, Optional] IPhotoAcquireItem? pPhotoAcquireItem, [In, Optional] IStream? pOriginalItemStream,
string? pszFinalFilename, [In, Optional] IPropertyStore? pPropertyStore);
/// <summary>
/// Provides extended functionality when a transfer session is completed. The application provides the implementation of the
@ -928,7 +929,7 @@ public static partial class PhotoAcquisition
// https://learn.microsoft.com/en-us/windows/win32/api/photoacquire/nf-photoacquire-iphotoacquireprogresscb-startenumeration HRESULT
// StartEnumeration( [in] IPhotoAcquireSource *pPhotoAcquireSource );
[PreserveSig]
HRESULT StartEnumeration([In, Optional, MarshalAs(UnmanagedType.Interface)] IPhotoAcquireSource pPhotoAcquireSource);
HRESULT StartEnumeration([In, Optional, MarshalAs(UnmanagedType.Interface)] IPhotoAcquireSource? pPhotoAcquireSource);
/// <summary>
/// The method provides extended functionality each time an item is found during enumeration of items from the device. This method
@ -1023,7 +1024,7 @@ public static partial class PhotoAcquisition
// https://learn.microsoft.com/en-us/windows/win32/api/photoacquire/nf-photoacquire-iphotoacquireprogresscb-starttransfer HRESULT
// StartTransfer( [in] IPhotoAcquireSource *pPhotoAcquireSource );
[PreserveSig]
HRESULT StartTransfer([In, Optional, MarshalAs(UnmanagedType.Interface)] IPhotoAcquireSource pPhotoAcquireSource);
HRESULT StartTransfer([In, Optional, MarshalAs(UnmanagedType.Interface)] IPhotoAcquireSource? pPhotoAcquireSource);
/// <summary>
/// The method provides extended functionality each time the transfer of an item begins. The application provides the implementation
@ -1054,7 +1055,7 @@ public static partial class PhotoAcquisition
// https://learn.microsoft.com/en-us/windows/win32/api/photoacquire/nf-photoacquire-iphotoacquireprogresscb-startitemtransfer HRESULT
// StartItemTransfer( [in] UINT nItemIndex, [in] IPhotoAcquireItem *pPhotoAcquireItem );
[PreserveSig]
HRESULT StartItemTransfer([In] uint nItemIndex, [In, Optional, MarshalAs(UnmanagedType.Interface)] IPhotoAcquireItem pPhotoAcquireItem);
HRESULT StartItemTransfer([In] uint nItemIndex, [In, Optional, MarshalAs(UnmanagedType.Interface)] IPhotoAcquireItem? pPhotoAcquireItem);
/// <summary>
/// The method provides extended functionality when a destination directory is created during the acquisition process. The
@ -1150,7 +1151,7 @@ public static partial class PhotoAcquisition
// https://learn.microsoft.com/en-us/windows/win32/api/photoacquire/nf-photoacquire-iphotoacquireprogresscb-enditemtransfer HRESULT
// EndItemTransfer( [in] UINT nItemIndex, [in] IPhotoAcquireItem *pPhotoAcquireItem, [in] HRESULT hr );
[PreserveSig]
HRESULT EndItemTransfer([In] uint nItemIndex, [In, Optional, MarshalAs(UnmanagedType.Interface)] IPhotoAcquireItem pPhotoAcquireItem, HRESULT hr);
HRESULT EndItemTransfer([In] uint nItemIndex, [In, Optional, MarshalAs(UnmanagedType.Interface)] IPhotoAcquireItem? pPhotoAcquireItem, HRESULT hr);
/// <summary>
/// The method provides extended functionality when the transfer of all files is complete. The application provides the
@ -1210,7 +1211,7 @@ public static partial class PhotoAcquisition
// https://learn.microsoft.com/en-us/windows/win32/api/photoacquire/nf-photoacquire-iphotoacquireprogresscb-startdelete HRESULT
// StartDelete( [in] IPhotoAcquireSource *pPhotoAcquireSource );
[PreserveSig]
HRESULT StartDelete([In, Optional, MarshalAs(UnmanagedType.Interface)] IPhotoAcquireSource pPhotoAcquireSource);
HRESULT StartDelete([In, Optional, MarshalAs(UnmanagedType.Interface)] IPhotoAcquireSource? pPhotoAcquireSource);
/// <summary>
/// The method provides extended functionality each time the deletion of an individual item from the device begins. The application
@ -1241,7 +1242,7 @@ public static partial class PhotoAcquisition
// https://learn.microsoft.com/en-us/windows/win32/api/photoacquire/nf-photoacquire-iphotoacquireprogresscb-startitemdelete HRESULT
// StartItemDelete( [in] UINT nItemIndex, [in] IPhotoAcquireItem *pPhotoAcquireItem );
[PreserveSig]
HRESULT StartItemDelete([In] uint nItemIndex, [In, Optional, MarshalAs(UnmanagedType.Interface)] IPhotoAcquireItem pPhotoAcquireItem);
HRESULT StartItemDelete([In] uint nItemIndex, [In, Optional, MarshalAs(UnmanagedType.Interface)] IPhotoAcquireItem? pPhotoAcquireItem);
/// <summary>
/// The method provides extended functionality when the percentage of items deleted changes. The application provides the
@ -1303,7 +1304,7 @@ public static partial class PhotoAcquisition
// https://learn.microsoft.com/en-us/windows/win32/api/photoacquire/nf-photoacquire-iphotoacquireprogresscb-enditemdelete HRESULT
// EndItemDelete( [in] UINT nItemIndex, [in] IPhotoAcquireItem *pPhotoAcquireItem, [in] HRESULT hr );
[PreserveSig]
HRESULT EndItemDelete([In] uint nItemIndex, [In, Optional, MarshalAs(UnmanagedType.Interface)] IPhotoAcquireItem pPhotoAcquireItem, HRESULT hr);
HRESULT EndItemDelete([In] uint nItemIndex, [In, Optional, MarshalAs(UnmanagedType.Interface)] IPhotoAcquireItem? pPhotoAcquireItem, HRESULT hr);
/// <summary>
/// The method provides extended functionality when deletion of files from the image source is complete. The application provides the
@ -1561,8 +1562,8 @@ public static partial class PhotoAcquisition
// GetUserInput( [in] REFIID riidType, [in] IUnknown *pUnknown, [out] PROPVARIANT *pPropVarResult, [in] const PROPVARIANT
// *pPropVarDefault );
[PreserveSig]
HRESULT GetUserInput(in Guid riidType, [In, Optional, MarshalAs(UnmanagedType.IUnknown, IidParameterIndex = 0)] object pUnknown,
[Out] PROPVARIANT pPropVarResult, [In, Optional] PROPVARIANT pPropVarDefault);
HRESULT GetUserInput(in Guid riidType, [In, Optional, MarshalAs(UnmanagedType.IUnknown, IidParameterIndex = 0)] object? pUnknown,
[Out] PROPVARIANT pPropVarResult, [In, Optional] PROPVARIANT? pPropVarDefault);
}
/// <summary>The interface is used to work with image acquisition settings, such as file name format.</summary>
@ -1783,7 +1784,7 @@ public static partial class PhotoAcquisition
// https://learn.microsoft.com/en-us/windows/win32/api/photoacquire/nf-photoacquire-iphotoacquiresource-initializeitemlist HRESULT
// InitializeItemList( [in] BOOL fForceEnumeration, [in] IPhotoAcquireProgressCB *pPhotoAcquireProgressCB, [out] UINT *pnItemCount );
void InitializeItemList([In, MarshalAs(UnmanagedType.Bool)] bool fForceEnumeration,
[In, Optional, MarshalAs(UnmanagedType.Interface)] IPhotoAcquireProgressCB pPhotoAcquireProgressCB, out uint pnItemCount);
[In, Optional, MarshalAs(UnmanagedType.Interface)] IPhotoAcquireProgressCB? pPhotoAcquireProgressCB, out uint pnItemCount);
/// <summary>The method retrieves the number of items found by the InitializeItemList method.</summary>
/// <returns>Pointer to an integer value containing the item count.</returns>
@ -1976,7 +1977,7 @@ public static partial class PhotoAcquisition
/// <param name="pPhotoProgressActionCB">
/// A reference to a <see cref="IPhotoProgressActionCB"/> derived class that responds to the action link click.
/// </param>
void SetActionLinkCallback([In, Optional, MarshalAs(UnmanagedType.Interface)] IPhotoProgressActionCB pPhotoProgressActionCB);
void SetActionLinkCallback([In, Optional, MarshalAs(UnmanagedType.Interface)] IPhotoProgressActionCB? pPhotoProgressActionCB);
/// <summary>The method sets the text for the action link in the progress dialog box.</summary>
/// <param name="pszCaption">A string containing the action link text.</param>
@ -2007,8 +2008,8 @@ public static partial class PhotoAcquisition
// GetUserInput( [in] REFIID riidType, [in] IUnknown *pUnknown, [out] PROPVARIANT *pPropVarResult, [in] const PROPVARIANT
// *pPropVarDefault );
[PreserveSig]
HRESULT GetUserInput(in Guid riidType, [In, Optional, MarshalAs(UnmanagedType.IUnknown, IidParameterIndex = 0)] object pUnknown,
[Out] PROPVARIANT pPropVarResult, [In, Optional] PROPVARIANT pPropVarDefault);
HRESULT GetUserInput(in Guid riidType, [In, Optional, MarshalAs(UnmanagedType.IUnknown, IidParameterIndex = 0)] object? pUnknown,
[Out] PROPVARIANT pPropVarResult, [In, Optional] PROPVARIANT? pPropVarDefault);
}
/// <summary>Retrieves descriptive information entered by the user, such as the tag name of the images to store.</summary>
@ -2026,7 +2027,7 @@ public static partial class PhotoAcquisition
// GetUserInput( [in] REFIID riidType, [in] IUnknown *pUnknown, [out] PROPVARIANT *pPropVarResult, [in] const PROPVARIANT
// *pPropVarDefault );
[PreserveSig]
public static string? GetUserInput(this IPhotoProgressDialog dlg, [In, Optional] IUserInputString pUnknown, [In, Optional] string? pPropVarDefault)
public static string? GetUserInput(this IPhotoProgressDialog dlg, [In, Optional] IUserInputString? pUnknown, [In, Optional] string? pPropVarDefault)
{
if (dlg == null) throw new ArgumentNullException(nameof(dlg));
using PROPVARIANT res = new();

View File

@ -134,7 +134,7 @@ public static partial class PrntvPt
[PInvokeData("prntvpt.h", MSDNShortId = "3b0a6afd-fa9d-434e-a95f-b051296d4567")]
public static extern HRESULT ConvertPrintTicketToDevModeThunk2(HPTPROVIDER hProvider, [In] IntPtr pPrintTicket, uint cbSize,
EDefaultDevmodeType baseType, EPrintTicketScope scope, out SafeCoTaskMemHandle ppDevmode, out uint pcbDevModeLength,
[MarshalAs(UnmanagedType.BStr)] out string errMsg);
[MarshalAs(UnmanagedType.BStr)] out string? errMsg);
/// <summary>
/// <para>
@ -168,7 +168,7 @@ public static partial class PrntvPt
[DllImport(Lib.PrntvPt, SetLastError = false, ExactSpelling = true)]
[PInvokeData("winspool.h", MSDNShortId = "15219c19-b64c-4c51-9357-15a797557693")]
public static extern HRESULT GetPrintCapabilitiesThunk2(HPTPROVIDER hProvider, [In] IntPtr pPrintTicket, int cbPrintTicket, out IntPtr ppbPrintCapabilities,
out int pcbPrintCapabilitiesLength, [MarshalAs(UnmanagedType.BStr)] out string pbstrErrorMessage);
out int pcbPrintCapabilitiesLength, [MarshalAs(UnmanagedType.BStr)] out string? pbstrErrorMessage);
/// <summary>
/// <para>
@ -215,8 +215,8 @@ public static partial class PrntvPt
[DllImport(Lib.PrntvPt, SetLastError = false, ExactSpelling = true)]
[PInvokeData("prntvpt.h", MSDNShortId = "4aa7b9de-abf2-4781-942e-0b992a6bffed")]
public static extern HRESULT MergeAndValidatePrintTicketThunk2(HPTPROVIDER hProvider, [In] IntPtr pBasePrintTicket, int basePrintTicketLength,
[In] IntPtr pDeltaPrintTicket, int deltaPrintTicketLength, EPrintTicketScope scope, out SafeCoTaskMemHandle ppValidatedPrintTicket,
out int pValidatedPrintTicketLength, [MarshalAs(UnmanagedType.BStr)] out string pbstrErrorMessage);
[In, Optional] IntPtr pDeltaPrintTicket, int deltaPrintTicketLength, EPrintTicketScope scope, out SafeCoTaskMemHandle ppValidatedPrintTicket,
out int pValidatedPrintTicketLength, [MarshalAs(UnmanagedType.BStr)] out string? pbstrErrorMessage);
/// <summary>Closes a print ticket provider handle.</summary>
/// <param name="hProvider">A handle to the provider. This handle is returned by the PTOpenProvider or PTOpenProviderEx function.</param>
@ -344,7 +344,7 @@ public static partial class PrntvPt
[DllImport(Lib.PrntvPt, SetLastError = false, ExactSpelling = true)]
[PInvokeData("prntvpt.h", MSDNShortId = "5eec91b9-d554-4440-bc9e-6a26af34994b")]
public static extern HRESULT PTConvertPrintTicketToDevMode(HPTPROVIDER hProvider, IStream pPrintTicket, EDefaultDevmodeType baseDevmodeType,
EPrintTicketScope scope, out uint pcbDevmode, out SafePTMemory ppDevmode, [MarshalAs(UnmanagedType.BStr)] out string pbstrErrorMessage);
EPrintTicketScope scope, out uint pcbDevmode, out SafePTMemory ppDevmode, [MarshalAs(UnmanagedType.BStr)] out string? pbstrErrorMessage);
/// <summary>Retrieves the printer's capabilities formatted in compliance with the XML Print Schema.</summary>
/// <param name="hProvider">
@ -393,8 +393,8 @@ public static partial class PrntvPt
// HPTPROVIDER hProvider, IStream *pPrintTicket, IStream *pCapabilities, BSTR *pbstrErrorMessage );
[DllImport(Lib.PrntvPt, SetLastError = false, ExactSpelling = true)]
[PInvokeData("prntvpt.h", MSDNShortId = "925e314c-85ff-4c1b-b3c9-f36aa4b55e01")]
public static extern HRESULT PTGetPrintCapabilities(HPTPROVIDER hProvider, [Optional] IStream pPrintTicket, IStream pCapabilities,
[MarshalAs(UnmanagedType.BStr)] out string pbstrErrorMessage);
public static extern HRESULT PTGetPrintCapabilities(HPTPROVIDER hProvider, [Optional] IStream? pPrintTicket, IStream pCapabilities,
[MarshalAs(UnmanagedType.BStr)] out string? pbstrErrorMessage);
/// <summary>Retrieves the device printer's capabilities formatted in compliance with the XML Print Schema.</summary>
/// <param name="hProvider">
@ -416,8 +416,8 @@ public static partial class PrntvPt
// PTGetPrintDeviceCapabilities( HPTPROVIDER hProvider, IStream *pPrintTicket, IStream *pDeviceCapabilities, BSTR *pbstrErrorMessage );
[DllImport(Lib.PrntvPt, SetLastError = false, ExactSpelling = true)]
[PInvokeData("prntvpt.h", MSDNShortId = "DB9D63B1-2703-47F7-8F31-30FA0110E1E9")]
public static extern HRESULT PTGetPrintDeviceCapabilities(HPTPROVIDER hProvider, [Optional] IStream pPrintTicket, IStream pDeviceCapabilities,
[MarshalAs(UnmanagedType.BStr)] out string pbstrErrorMessage);
public static extern HRESULT PTGetPrintDeviceCapabilities(HPTPROVIDER hProvider, [Optional] IStream? pPrintTicket, IStream pDeviceCapabilities,
[MarshalAs(UnmanagedType.BStr)] out string? pbstrErrorMessage);
/// <summary>It retrieves the print devices resources for a printer formatted in compliance with the XML Print Schema.</summary>
/// <param name="hProvider">
@ -440,8 +440,8 @@ public static partial class PrntvPt
// *pbstrErrorMessage );
[DllImport(Lib.PrntvPt, SetLastError = false, ExactSpelling = true)]
[PInvokeData("prntvpt.h", MSDNShortId = "39F17562-B8EB-41AF-BA55-42FE35B4560F")]
public static extern HRESULT PTGetPrintDeviceResources(HPTPROVIDER hProvider, [MarshalAs(UnmanagedType.LPWStr)] string pszLocaleName,
[Optional] IStream pPrintTicket, IStream pDeviceResources, [MarshalAs(UnmanagedType.BStr)] out string pbstrErrorMessage);
public static extern HRESULT PTGetPrintDeviceResources(HPTPROVIDER hProvider, [MarshalAs(UnmanagedType.LPWStr)] string? pszLocaleName,
[Optional] IStream? pPrintTicket, IStream pDeviceResources, [MarshalAs(UnmanagedType.BStr)] out string? pbstrErrorMessage);
/// <summary>Merges two print tickets and returns a valid, viable print ticket.</summary>
/// <param name="hProvider">
@ -530,8 +530,8 @@ public static partial class PrntvPt
// IStream *pResultTicket, BSTR *pbstrErrorMessage );
[DllImport(Lib.PrntvPt, SetLastError = false, ExactSpelling = true)]
[PInvokeData("prntvpt.h", MSDNShortId = "97691930-d76a-48c9-80b9-8413d96322a9")]
public static extern HRESULT PTMergeAndValidatePrintTicket(HPTPROVIDER hProvider, IStream pBaseTicket, [Optional] IStream pDeltaTicket,
EPrintTicketScope scope, IStream pResultTicket, [MarshalAs(UnmanagedType.BStr)] out string pbstrErrorMessage);
public static extern HRESULT PTMergeAndValidatePrintTicket(HPTPROVIDER hProvider, IStream pBaseTicket, [Optional] IStream? pDeltaTicket,
EPrintTicketScope scope, IStream pResultTicket, [MarshalAs(UnmanagedType.BStr)] out string? pbstrErrorMessage);
/// <summary>Opens an instance of a print ticket provider.</summary>
/// <param name="pszPrinterName">A pointer to the full name of a print queue.</param>
@ -694,7 +694,7 @@ public static partial class PrntvPt
public static bool operator ==(HPTPROVIDER h1, HPTPROVIDER h2) => h1.Equals(h2);
/// <inheritdoc/>
public override bool Equals(object? obj) => obj is HPTPROVIDER h ? handle == h.handle : false;
public override bool Equals(object? obj) => obj is HPTPROVIDER h && handle == h.handle;
/// <inheritdoc/>
public override int GetHashCode() => handle.GetHashCode();
@ -741,7 +741,7 @@ public static partial class PrntvPt
/// <summary>Converts the memory held by this object to a structure.</summary>
/// <typeparam name="T">The type of the structure.</typeparam>
/// <returns>A structure marshaled from this memory.</returns>
public T ToStructure<T>() => IsInvalid ? default : handle.ToStructure<T>();
public T? ToStructure<T>() => IsInvalid ? default : handle.ToStructure<T>();
/// <inheritdoc/>
protected override bool InternalReleaseHandle() => PTReleaseMemory(handle).Succeeded;

View File

@ -950,11 +950,11 @@ public static partial class WinSpool
const string subKey64 = @"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\PackageInstallation\Windows x64\CorePrinterDrivers";
var is64bit = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("PROCESSOR_ARCHITEW6432"));
using var baseKey = string.IsNullOrEmpty(pszServer) ? null : RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine, pszServer);
using var baseKey = string.IsNullOrEmpty(pszServer) ? null : RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine, pszServer!);
using var reg = (baseKey ?? Registry.LocalMachine).OpenSubKey(is64bit ? subKey64 : subKey32, false);// RegistryKeyPermissionCheck.ReadSubTree, RegistryRights.EnumerateSubKeys);
var keys = reg?.GetSubKeyNames();
if (keys?.Length == 0) return new CORE_PRINTER_DRIVER[0];
var drvs = new CORE_PRINTER_DRIVER[keys.Length];
var drvs = new CORE_PRINTER_DRIVER[keys!.Length];
GetCorePrinterDrivers(pszServer, pszEnvironment, keys, (uint)keys.Length, drvs).ThrowIfFailed();
return drvs;
}
@ -1011,19 +1011,8 @@ public static partial class WinSpool
/// <returns>A sequence of <c>MONITOR_INFO_1</c> structures or <c>MONITOR_INFO_2</c> structures.</returns>
/// <exception cref="System.ArgumentException"></exception>
[PInvokeData("winspool.h", MSDNShortId = "4d4fbed2-193f-426c-8463-eeb6b1eaf316")]
public static IEnumerable<T> EnumMonitors<T>([Optional] string? pName) where T : struct
{
if (!TryGetLevel<T>("MONITOR_INFO_", out var lvl))
throw new ArgumentException($"{nameof(EnumMonitors)} cannot process a structure of type {typeof(T).Name}.");
if (!EnumMonitors(pName, lvl, default, 0, out var bytes, out var count))
Win32Error.ThrowLastErrorUnless(Win32Error.ERROR_INSUFFICIENT_BUFFER);
if (bytes == 0)
return new T[0];
using var mem = new SafeCoTaskMemHandle(bytes);
if (!EnumMonitors(pName, lvl, mem, mem.Size, out bytes, out count))
Win32Error.ThrowLastError();
return mem.ToArray<T>((int)count);
}
public static IEnumerable<T> EnumMonitors<T>([Optional] string? pName) where T : struct =>
WSEnum<T>("MONITOR_INFO_", (uint l, IntPtr p, uint cb, out uint pcb, out uint c) => EnumMonitors(pName, l, p, cb, out pcb, out c));
/// <summary>The <c>EnumPorts</c> function enumerates the ports that are available for printing on a specified server.</summary>
/// <param name="pName">
@ -1075,19 +1064,8 @@ public static partial class WinSpool
/// <returns>A sequence of <c>PORT_INFO_1</c> structures or <c>PORT_INFO_2</c> structures.</returns>
/// <remarks>The <c>EnumPorts</c> function can succeed even if the server specified by pName does not have a printer defined.</remarks>
[PInvokeData("winspool.h", MSDNShortId = "72ea0e35-bf26-4c12-9451-8f6941990d82")]
public static IEnumerable<T> EnumPorts<T>([Optional] string? pName) where T : struct
{
if (!TryGetLevel<T>("PORT_INFO_", out var lvl))
throw new ArgumentException($"{nameof(EnumPorts)} cannot process a structure of type {typeof(T).Name}.");
if (!EnumPorts(pName, lvl, default, 0, out var bytes, out var count))
Win32Error.ThrowLastErrorUnless(Win32Error.ERROR_INSUFFICIENT_BUFFER);
if (bytes == 0)
return new T[0];
using var mem = new SafeCoTaskMemHandle(bytes);
if (!EnumPorts(pName, lvl, mem, mem.Size, out bytes, out count))
Win32Error.ThrowLastError();
return mem.ToArray<T>((int)count);
}
public static IEnumerable<T> EnumPorts<T>([Optional] string? pName) where T : struct =>
WSEnum<T>("PORT_INFO_", (uint l, IntPtr p, uint cb, out uint pcb, out uint c) => EnumPorts(pName, l, p, cb, out pcb, out c));
/// <summary>The <c>EnumPrinterDrivers</c> function enumerates the printer drivers installed on a specified printer server.</summary>
/// <param name="pName">
@ -1199,19 +1177,8 @@ public static partial class WinSpool
/// <c>DRIVER_INFO_6</c>, or <c>DRIVER_INFO_8</c> structures.
/// </returns>
[PInvokeData("winspool.h", MSDNShortId = "fa3d8cf4-70bc-4362-833e-e4217ed5d43b")]
public static IEnumerable<T> EnumPrinterDrivers<T>([Optional] string? pName, [Optional] string? pEnvironment) where T : struct
{
if (!TryGetLevel<T>("DRIVER_INFO_", out var lvl))
throw new ArgumentException($"{nameof(EnumPrinterDrivers)} cannot process a structure of type {typeof(T).Name}.");
if (!EnumPrinterDrivers(pName, pEnvironment, lvl, default, 0, out var bytes, out var count))
Win32Error.ThrowLastErrorUnless(Win32Error.ERROR_INSUFFICIENT_BUFFER);
if (bytes == 0)
return new T[0];
using var mem = new SafeCoTaskMemHandle(bytes);
if (!EnumPrinterDrivers(pName, pEnvironment, lvl, mem, mem.Size, out bytes, out count))
Win32Error.ThrowLastError();
return mem.ToArray<T>((int)count);
}
public static IEnumerable<T> EnumPrinterDrivers<T>([Optional] string? pName, [Optional] string? pEnvironment) where T : struct =>
WSEnum<T>("DRIVER_INFO_", (uint l, IntPtr p, uint cb, out uint pcb, out uint c) => EnumPrinterDrivers(pName, pEnvironment, l, p, cb, out pcb, out c));
/// <summary>The <c>EnumPrintProcessorDatatypes</c> function enumerates the data types that a specified print processor supports.</summary>
/// <param name="pName">
@ -1271,19 +1238,8 @@ public static partial class WinSpool
/// <returns>A sequence of <c>DATATYPES_INFO_1</c> structures.</returns>
/// <remarks>Starting with Windows Vista, the data type information from remote print servers is retrieved from a local cache.</remarks>
[PInvokeData("winspool.h", MSDNShortId = "27b6e074-d303-446b-9e5f-6cfa55c30d26")]
public static IEnumerable<T> EnumPrintProcessorDatatypes<T>(string pPrintProcessorName, [Optional] string? pName) where T : struct
{
if (!TryGetLevel<T>("DATATYPES_INFO_", out var lvl))
throw new ArgumentException($"{nameof(EnumPrintProcessorDatatypes)} cannot process a structure of type {typeof(T).Name}.");
if (!EnumPrintProcessorDatatypes(pName, pPrintProcessorName, lvl, default, 0, out var bytes, out var count))
Win32Error.ThrowLastErrorUnless(Win32Error.ERROR_INSUFFICIENT_BUFFER);
if (bytes == 0)
return new T[0];
using var mem = new SafeCoTaskMemHandle(bytes);
if (!EnumPrintProcessorDatatypes(pName, pPrintProcessorName, lvl, mem, mem.Size, out bytes, out count))
Win32Error.ThrowLastError();
return mem.ToArray<T>((int)count);
}
public static IEnumerable<T> EnumPrintProcessorDatatypes<T>(string pPrintProcessorName, [Optional] string? pName) where T : struct =>
WSEnum<T>("DATATYPES_INFO_", (uint l, IntPtr p, uint cb, out uint pcb, out uint c) => EnumPrintProcessorDatatypes(pName, pPrintProcessorName, l, p, cb, out pcb, out c));
/// <summary>The <c>EnumPrintProcessors</c> function enumerates the print processors installed on the specified server.</summary>
/// <param name="pName">
@ -1597,7 +1553,7 @@ public static partial class WinSpool
[DllImport(Lib.Winspool, SetLastError = true, CharSet = CharSet.Auto)]
[PInvokeData("winspool.h", MSDNShortId = "0d482d28-7668-4734-ba71-5b355c18ddec")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool GetPrinterDriver2([Optional] HWND hWnd, HPRINTER hPrinter, [Optional] string? pEnvironment, uint Level, IntPtr pDriverInfo, uint cbBuf, out uint pcbNeeded);
public static extern bool GetPrinterDriver2([Optional] HWND hWnd, HPRINTER hPrinter, [Optional] string? pEnvironment, uint Level, [Optional] IntPtr pDriverInfo, [Optional] uint cbBuf, out uint pcbNeeded);
/// <summary>
/// The <c>GetPrinterDriver2</c> function retrieves driver data for the specified printer. If the driver is not installed on the
@ -1672,7 +1628,7 @@ public static partial class WinSpool
[DllImport(Lib.Winspool, SetLastError = false, CharSet = CharSet.Auto)]
[PInvokeData("winspool.h", MSDNShortId = "69c9cc87-d7e3-496a-b631-b3ae30cdb3fd")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool GetPrinterDriverDirectory([Optional] string? pName, [Optional] string? pEnvironment, uint Level, StringBuilder pDriverDirectory, int cbBuf, out int pcbNeeded);
public static extern bool GetPrinterDriverDirectory([Optional] string? pName, [Optional] string? pEnvironment, uint Level, StringBuilder? pDriverDirectory, int cbBuf, out int pcbNeeded);
/// <summary>Retrieves the path to the specified printer driver package on a print server.</summary>
/// <param name="pszServer">
@ -1709,7 +1665,8 @@ public static partial class WinSpool
// pszDriverPackageCab, _In_ DWORD cchDriverPackageCab, _Out_ LPDWORD pcchRequiredSize );
[DllImport(Lib.Winspool, SetLastError = false, CharSet = CharSet.Auto)]
[PInvokeData("winspool.h", MSDNShortId = "e88e984b-d2c0-43b4-8f70-b05ec202ab14")]
public static extern HRESULT GetPrinterDriverPackagePath([Optional] string? pszServer, [Optional] string? pszEnvironment, [Optional] string? pszLanguage, string pszPackageID, StringBuilder pszDriverPackageCab, int cchDriverPackageCab, out int pcchRequiredSize);
public static extern HRESULT GetPrinterDriverPackagePath([Optional] string? pszServer, [Optional] string? pszEnvironment, [Optional] string? pszLanguage,
string pszPackageID, StringBuilder? pszDriverPackageCab, int cchDriverPackageCab, out int pcchRequiredSize);
/// <summary>
/// The <c>GetPrintProcessorDirectory</c> function retrieves the path to the print processor directory on the specified server.
@ -1744,7 +1701,7 @@ public static partial class WinSpool
[DllImport(Lib.Winspool, SetLastError = false, CharSet = CharSet.Auto)]
[PInvokeData("winspool.h", MSDNShortId = "a2443cfd-e5ba-41c6-aaf4-45051a3d0e26")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool GetPrintProcessorDirectory([Optional] string? pName, [Optional] string? pEnvironment, uint Level, StringBuilder pPrintProcessorInfo, int cbBuf, out int pcbNeeded);
public static extern bool GetPrintProcessorDirectory([Optional] string? pName, [Optional] string? pEnvironment, uint Level, StringBuilder? pPrintProcessorInfo, int cbBuf, out int pcbNeeded);
/// <summary>Installs a printer driver from a driver package that is in the print server's driver store.</summary>
/// <param name="pszServer">

View File

@ -1,5 +1,8 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Security.Cryptography;
namespace Vanara.PInvoke;
@ -163,7 +166,7 @@ public static partial class WinSpool
/// print spooler that the print job can now be scheduled by the spooler for printing.
/// </remarks>
[PInvokeData("winspool.h", MSDNShortId = "cfafa874-6022-4bf4-bf3d-096213eb0c98")]
public static bool AddJob(HPRINTER hPrinter, out string path, out uint jobId)
public static bool AddJob(HPRINTER hPrinter, out string? path, out uint jobId)
{
path = null; jobId = 0;
AddJob(hPrinter, 1, default, 0, out var sz);
@ -451,7 +454,7 @@ public static partial class WinSpool
// https://docs.microsoft.com/en-us/windows/win32/printdocs/addprinterconnection2 BOOL AddPrinterConnection2( _In_ HWND hWnd, _In_
// LPCTSTR pszName, DWORD dwLevel, _In_ PVOID pConnectionInfo );
[PInvokeData("winspool.h", MSDNShortId = "5ae98157-5978-449e-beb1-4787110925fa")]
public static bool AddPrinterConnection2([Optional] HWND hWnd, string pszName, PRINTER_CONNECTION_FLAGS flags, string driverName = null) =>
public static bool AddPrinterConnection2([Optional] HWND hWnd, string pszName, PRINTER_CONNECTION_FLAGS flags, string? driverName = null) =>
AddPrinterConnection2(hWnd, pszName, 1, new PRINTER_CONNECTION_INFO_1 { dwFlags = flags, pszDriverName = driverName });
/// <summary>
@ -1909,7 +1912,7 @@ public static partial class WinSpool
// hPrinter, _In_ LPTSTR pDeviceName, _Out_ PDEVMODE pDevModeOutput, _In_ PDEVMODE pDevModeInput, _In_ DWORD fMode );
[DllImport(Lib.Winspool, SetLastError = false, CharSet = CharSet.Auto)]
[PInvokeData("winspool.h", MSDNShortId = "e89a2f6f-2bac-4369-b526-f8e15028698b")]
public static extern int DocumentProperties(HWND hWnd, HPRINTER hPrinter, string pDeviceName, IntPtr pDevModeOutput, in DEVMODE pDevModeInput, DM fMode);
public static extern int DocumentProperties(HWND hWnd, HPRINTER hPrinter, string pDeviceName, IntPtr pDevModeOutput, in DEVMODE pDevModeInput, [Optional] DM fMode);
/// <summary>
/// The <c>DocumentProperties</c> function retrieves or modifies printer initialization information or displays a
@ -2034,7 +2037,7 @@ public static partial class WinSpool
// hPrinter, _In_ LPTSTR pDeviceName, _Out_ PDEVMODE pDevModeOutput, _In_ PDEVMODE pDevModeInput, _In_ DWORD fMode );
[DllImport(Lib.Winspool, SetLastError = false, CharSet = CharSet.Auto)]
[PInvokeData("winspool.h", MSDNShortId = "e89a2f6f-2bac-4369-b526-f8e15028698b")]
public static extern int DocumentProperties(HWND hWnd, HPRINTER hPrinter, string pDeviceName, IntPtr pDevModeOutput, [Optional] IntPtr pDevModeInput, DM fMode);
public static extern int DocumentProperties(HWND hWnd, HPRINTER hPrinter, string pDeviceName, IntPtr pDevModeOutput, [Optional] IntPtr pDevModeInput, [Optional] DM fMode);
/// <summary>The <c>EndDocPrinter</c> function ends a print job for the specified printer.</summary>
/// <param name="hPrinter">
@ -2175,20 +2178,38 @@ public static partial class WinSpool
/// </param>
/// <returns>A sequence of <c>FORM_INFO_1</c> or <c>FORM_INFO_2</c> structures. All the structures will be of <typeparamref name="T"/>.</returns>
[PInvokeData("winspool.h", MSDNShortId = "b13b515a-c764-4a80-ab85-95fb4abb2a6b")]
public static IEnumerable<T> EnumForms<T>(HPRINTER hPrinter) where T : struct
public static IEnumerable<T> EnumForms<T>(HPRINTER hPrinter) where T : struct =>
WSEnum<T>("FORM_INFO_", (uint l, IntPtr p, uint cb, out uint pcb, out uint c) => EnumForms(hPrinter, l, p, cb, out pcb, out c));
private delegate bool F1(uint l, IntPtr p, uint cb, out uint pcb, out uint pcr);
private delegate bool T1(uint l, IntPtr p, uint cb, out uint pcb);
private static IEnumerable<T> WSEnum<T>(string prefix, F1 f, [CallerMemberName] string? caller = null) where T : struct
{
if (!TryGetLevel<T>("FORM_INFO_", out var lvl))
throw new ArgumentException($"{nameof(EnumForms)} cannot process a structure of type {typeof(T).Name}.");
if (!EnumForms(hPrinter, lvl, default, 0, out var bytes, out var count))
if (!TryGetLevel<T>(prefix, out var lvl))
throw new ArgumentException($"{caller} cannot process a structure of type {typeof(T).Name}.");
if (!f(lvl, default, 0, out var bytes, out var count))
Win32Error.ThrowLastErrorUnless(Win32Error.ERROR_INSUFFICIENT_BUFFER);
if (bytes == 0)
return new T[0];
using var mem = new SafeCoTaskMemHandle(bytes);
if (!EnumForms(hPrinter, lvl, mem, mem.Size, out bytes, out count))
using SafeCoTaskMemHandle mem = new(bytes);
if (!f(lvl, mem, mem.Size, out bytes, out count))
Win32Error.ThrowLastError();
return mem.ToArray<T>((int)count);
}
private static T WSGet<T>(string prefix, T1 f, [CallerMemberName] string? caller = null) where T : struct
{
if (!TryGetLevel<T>(prefix, out var lvl))
throw new ArgumentException($"{caller} cannot process a structure of type {typeof(T).Name}.");
if (!f(lvl, default, 0, out var bytes))
Win32Error.ThrowLastErrorUnless(Win32Error.ERROR_INSUFFICIENT_BUFFER);
using SafeCoTaskMemStruct<T> mem = new(bytes);
if (!f(lvl, mem, mem.Size, out bytes))
Win32Error.ThrowLastError();
return mem.Value;
}
/// <summary>The <c>EnumJobs</c> function retrieves information about a specified set of print jobs for a specified printer.</summary>
/// <param name="hPrinter">
/// A handle to the printer object whose print jobs the function enumerates. Use the <c>OpenPrinter</c> or <c>AddPrinter</c>
@ -2279,19 +2300,8 @@ public static partial class WinSpool
/// A sequence of <c>JOB_INFO_1</c>, <c>JOB_INFO_2</c>, or <c>JOB_INFO_3</c> structures. All the structures will be of <typeparamref name="T"/>.
/// </returns>
[PInvokeData("winspool.h", MSDNShortId = "1cf429ea-b40e-4063-b6de-c43b7b87f3d3")]
public static IEnumerable<T> EnumJobs<T>(HPRINTER hPrinter, uint FirstJob = 0, uint NoJobs = uint.MaxValue) where T : struct
{
if (!TryGetLevel<T>("JOB_INFO_", out var lvl))
throw new ArgumentException($"{nameof(EnumJobs)} cannot process a structure of type {typeof(T).Name}.");
if (!EnumJobs(hPrinter, FirstJob, NoJobs, lvl, default, 0, out var bytes, out var count))
Win32Error.ThrowLastErrorUnless(Win32Error.ERROR_INSUFFICIENT_BUFFER);
if (bytes == 0)
return new T[0];
using var mem = new SafeCoTaskMemHandle(bytes);
if (!EnumJobs(hPrinter, FirstJob, NoJobs, lvl, mem, mem.Size, out bytes, out count))
Win32Error.ThrowLastError();
return mem.ToArray<T>((int)count);
}
public static IEnumerable<T> EnumJobs<T>(HPRINTER hPrinter, uint FirstJob = 0, uint NoJobs = uint.MaxValue) where T : struct =>
WSEnum<T>("JOB_INFO_", (uint l, IntPtr p, uint cb, out uint pcb, out uint c) => EnumJobs(hPrinter, FirstJob, NoJobs, l, p, cb, out pcb, out c));
/// <summary>
/// <para>The <c>EnumPrinterData</c> function enumerates configuration data for a specified printer.</para>
@ -2385,8 +2395,8 @@ public static partial class WinSpool
// _In_ DWORD cbData, _Out_ LPDWORD pcbData );
[DllImport(Lib.Winspool, SetLastError = false, CharSet = CharSet.Auto)]
[PInvokeData("winspool.h", MSDNShortId = "0a4c8436-46fe-4e21-8d55-c5031a3d1b38")]
public static extern Win32Error EnumPrinterData(HPRINTER hPrinter, uint dwIndex, StringBuilder pValueName, uint cbValueName,
out uint pcbValueName, out REG_VALUE_TYPE pType, IntPtr pData, uint cbData, out uint pcbData);
public static extern Win32Error EnumPrinterData(HPRINTER hPrinter, uint dwIndex, StringBuilder? pValueName, uint cbValueName,
out uint pcbValueName, out REG_VALUE_TYPE pType, [Optional] IntPtr pData, uint cbData, out uint pcbData);
/// <summary>
/// <para>The <c>EnumPrinterData</c> function enumerates configuration data for a specified printer.</para>
@ -2414,7 +2424,7 @@ public static partial class WinSpool
/// </list>
/// </returns>
[PInvokeData("winspool.h", MSDNShortId = "0a4c8436-46fe-4e21-8d55-c5031a3d1b38")]
public static IEnumerable<(string valueName, REG_VALUE_TYPE valueType, object value)> EnumPrinterData(HPRINTER hPrinter)
public static IEnumerable<(string valueName, REG_VALUE_TYPE valueType, object? value)> EnumPrinterData(HPRINTER hPrinter)
{
var idx = 0U;
EnumPrinterData(hPrinter, idx, null, 0, out var valueNameSz, out _, default, 0, out var dataSz).ThrowIfFailed();
@ -2517,7 +2527,7 @@ public static partial class WinSpool
/// </list>
/// </returns>
[PInvokeData("winspool.h", MSDNShortId = "bc5ecc46-24a4-4b54-9431-0eaf6446e2d6")]
public static IEnumerable<(string valueName, REG_VALUE_TYPE valueType, object value)> EnumPrinterDataEx(HPRINTER hPrinter, string pKeyName = "PrinterDriverData")
public static IEnumerable<(string valueName, REG_VALUE_TYPE valueType, object? value)> EnumPrinterDataEx(HPRINTER hPrinter, string pKeyName = "PrinterDriverData")
{
EnumPrinterDataEx(hPrinter, pKeyName, default, 0, out var sz, out var cnt).ThrowUnless(Win32Error.ERROR_MORE_DATA);
using var mem = new SafeCoTaskMemHandle(sz);
@ -2828,7 +2838,7 @@ public static partial class WinSpool
[DllImport(Lib.Winspool, SetLastError = true, CharSet = CharSet.Auto)]
[PInvokeData("winspool.h", MSDNShortId = "0d0cc726-c515-4146-9273-cdf1db3c76b7")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool EnumPrinters(PRINTER_ENUM Flags, string Name, uint Level, IntPtr pPrinterEnum, uint cbBuf, out uint pcbNeeded, out uint pcReturned);
public static extern bool EnumPrinters(PRINTER_ENUM Flags, string? Name, uint Level, IntPtr pPrinterEnum, uint cbBuf, out uint pcbNeeded, out uint pcReturned);
/// <summary>The <c>EnumPrinters</c> function enumerates available printers, print servers, domains, or print providers.</summary>
/// <typeparam name="T">
@ -2921,19 +2931,8 @@ public static partial class WinSpool
/// </para>
/// </returns>
[PInvokeData("winspool.h", MSDNShortId = "0d0cc726-c515-4146-9273-cdf1db3c76b7")]
public static IEnumerable<T> EnumPrinters<T>(PRINTER_ENUM Flags = PRINTER_ENUM.PRINTER_ENUM_LOCAL, string Name = null) where T : struct
{
if (!TryGetLevel<T>("PRINTER_INFO_", out var lvl))
throw new ArgumentException($"{nameof(EnumPrinters)} cannot process a structure of type {typeof(T).Name}.");
if (!EnumPrinters(Flags, Name, lvl, default, 0, out var bytes, out var count))
Win32Error.ThrowLastErrorUnless(Win32Error.ERROR_INSUFFICIENT_BUFFER);
if (bytes == 0)
return new T[0];
using var mem = new SafeCoTaskMemHandle(bytes);
if (!EnumPrinters(Flags, Name, lvl, mem, mem.Size, out bytes, out count))
Win32Error.ThrowLastError();
return mem.ToArray<T>((int)count);
}
public static IEnumerable<T> EnumPrinters<T>(PRINTER_ENUM Flags = PRINTER_ENUM.PRINTER_ENUM_LOCAL, string? Name = null) where T : struct =>
WSEnum<T>("PRINTER_INFO_", (uint l, IntPtr p, uint cb, out uint pcb, out uint c) => EnumPrinters(Flags, Name, l, p, cb, out pcb, out c));
/// <summary>
/// The <c>FindClosePrinterChangeNotification</c> function closes a change notification object created by calling the
@ -3777,7 +3776,7 @@ public static partial class WinSpool
[DllImport(Lib.Winspool, SetLastError = true, CharSet = CharSet.Auto)]
[PInvokeData("winspool.h", MSDNShortId = "8ec06743-43ce-4fac-83c4-f09eac7ee333")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool GetDefaultPrinter(StringBuilder pszBuffer, ref int pcchBuffer);
public static extern bool GetDefaultPrinter(StringBuilder? pszBuffer, ref int pcchBuffer);
/// <summary>The <c>GetForm</c> function retrieves information about a specified form.</summary>
/// <param name="hPrinter">
@ -3823,17 +3822,8 @@ public static partial class WinSpool
/// If the caller is remote, and the Level is 2, the <c>StringType</c> value of the returned <c>FORM_INFO_2</c> will always be STRING_LANGPAIR.
/// </remarks>
[PInvokeData("winspool.h", MSDNShortId = "10b25748-6d7c-46ab-bd2c-9b6126a1d7d1")]
public static T GetForm<T>(HPRINTER hPrinter, string pFormName) where T : struct
{
if (!TryGetLevel<T>("FORM_INFO_", out var lvl))
throw new ArgumentException($"{nameof(GetForm)} cannot process a structure of type {typeof(T).Name}.");
if (!GetForm(hPrinter, pFormName, lvl, default, 0, out var sz))
Win32Error.ThrowLastErrorUnless(Win32Error.ERROR_INSUFFICIENT_BUFFER);
using var mem = new SafeCoTaskMemHandle(sz);
if (!GetForm(hPrinter, pFormName, lvl, mem, mem.Size, out sz))
Win32Error.ThrowLastError();
return mem.ToStructure<T>();
}
public static T GetForm<T>(HPRINTER hPrinter, string pFormName) where T : struct =>
WSGet<T>("FORM_INFO_", (uint l, IntPtr p, uint cb, out uint pcb) => GetForm(hPrinter, pFormName, l, p, cb, out pcb));
/// <summary>The <c>GetJob</c> function retrieves information about a specified print job.</summary>
/// <param name="hPrinter">
@ -3889,17 +3879,8 @@ public static partial class WinSpool
/// <returns>A <c>JOB_INFO_1</c> or a <c>JOB_INFO_2</c> structure containing information about the job as specified by <typeparamref name="T"/>.</returns>
/// <exception cref="ArgumentException"></exception>
[PInvokeData("winspool.h", MSDNShortId = "57e59f84-d2a0-4722-b0fc-6673f7bb5c57")]
public static T GetJob<T>(HPRINTER hPrinter, uint JobId) where T : struct
{
if (!TryGetLevel<T>("JOB_INFO_", out var lvl))
throw new ArgumentException($"{nameof(GetJob)} cannot process a structure of type {typeof(T).Name}.");
if (!GetJob(hPrinter, JobId, lvl, default, 0, out var sz))
Win32Error.ThrowLastErrorUnless(Win32Error.ERROR_INSUFFICIENT_BUFFER);
using var mem = new SafeCoTaskMemHandle(sz);
if (!GetJob(hPrinter, JobId, lvl, mem, mem.Size, out sz))
Win32Error.ThrowLastError();
return mem.ToStructure<T>();
}
public static T GetJob<T>(HPRINTER hPrinter, uint JobId) where T : struct =>
WSGet<T>("JOB_INFO_", (uint l, IntPtr p, uint cb, out uint pcb) => GetJob(hPrinter, JobId, l, p, cb, out pcb));
/// <summary>The <c>GetPrinter</c> function retrieves information about a specified printer.</summary>
/// <param name="hPrinter">
@ -4112,17 +4093,8 @@ public static partial class WinSpool
/// configurations, the printer data is queried from the print server.
/// </para>
/// </remarks>
public static T GetPrinter<T>(HPRINTER hPrinter) where T : struct
{
if (!TryGetLevel<T>("PRINTER_INFO_", out var lvl))
throw new ArgumentException($"{nameof(GetPrinter)} cannot process a structure of type {typeof(T).Name}.");
if (!GetPrinter(hPrinter, lvl, default, 0, out var sz))
Win32Error.ThrowLastErrorUnless(Win32Error.ERROR_INSUFFICIENT_BUFFER);
using var mem = new SafeCoTaskMemHandle(sz);
if (!GetPrinter(hPrinter, lvl, mem, mem.Size, out sz))
Win32Error.ThrowLastError();
return mem.ToStructure<T>();
}
public static T GetPrinter<T>(HPRINTER hPrinter) where T : struct =>
WSGet<T>("PRINTER_INFO_", (uint l, IntPtr p, uint cb, out uint pcb) => GetPrinter(hPrinter, l, p, cb, out pcb));
/// <summary>
/// <para>The <c>GetPrinterData</c> function retrieves configuration data for the specified printer or print server.</para>
@ -4578,7 +4550,7 @@ public static partial class WinSpool
/// </list>
/// </remarks>
[PInvokeData("winspool.h", MSDNShortId = "b5a44b27-a4aa-4e58-9a64-05be87d12ab5")]
public static object GetPrinterData(HPRINTER hPrinter, string pValueName)
public static object? GetPrinterData(HPRINTER hPrinter, string pValueName)
{
GetPrinterData(hPrinter, pValueName, out _, default, 0, out var sz).ThrowUnless(Win32Error.ERROR_MORE_DATA);
using var mem = new SafeCoTaskMemHandle(sz);
@ -5068,7 +5040,7 @@ public static partial class WinSpool
/// </list>
/// </remarks>
[PInvokeData("winspool.h", MSDNShortId = "5d9183a7-97cc-46de-848e-e37ce51396eb")]
public static object GetPrinterDataEx(HPRINTER hPrinter, string pKeyName, string pValueName)
public static object? GetPrinterDataEx(HPRINTER hPrinter, string pKeyName, string pValueName)
{
GetPrinterDataEx(hPrinter, pKeyName, pValueName, out _, default, 0, out var sz).ThrowUnless(Win32Error.ERROR_MORE_DATA);
using var mem = new SafeCoTaskMemHandle(sz);
@ -5252,8 +5224,8 @@ public static partial class WinSpool
[DllImport(Lib.Winspool, SetLastError = true, CharSet = CharSet.Auto)]
[PInvokeData("winspool.h", MSDNShortId = "96763220-d851-46f0-8be8-403f3356edb9")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool OpenPrinter(string pPrinterName, out SafeHPRINTER phPrinter,
[In, Optional, MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(PRINTER_DEFAULTS_Marshaler))] PRINTER_DEFAULTS pDefault);
public static extern bool OpenPrinter(string? pPrinterName, out SafeHPRINTER phPrinter,
[In, Optional, MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(PRINTER_DEFAULTS_Marshaler))] PRINTER_DEFAULTS? pDefault);
/// <summary>
/// Retrieves a handle to the specified printer, print server, or other types of handles in the print subsystem, while setting some
@ -5345,8 +5317,101 @@ public static partial class WinSpool
[DllImport(Lib.Winspool, SetLastError = true, CharSet = CharSet.Auto)]
[PInvokeData("winspool.h", MSDNShortId = "e2370ae4-4475-4ccc-a6f9-3d33d1370054")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool OpenPrinter2(string pPrinterName, out SafeHPRINTER phPrinter,
[In, Optional, MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(PRINTER_DEFAULTS_Marshaler))] PRINTER_DEFAULTS pDefault, in PRINTER_OPTIONS pOptions);
public static extern bool OpenPrinter2(string? pPrinterName, out SafeHPRINTER phPrinter,
[In, Optional, MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(PRINTER_DEFAULTS_Marshaler))] PRINTER_DEFAULTS? pDefault, in PRINTER_OPTIONS pOptions);
/// <summary>
/// Retrieves a handle to the specified printer, print server, or other types of handles in the print subsystem, while setting some
/// of the printer options.
/// </summary>
/// <param name="pPrinterName">
/// <para>
/// A pointer to a constant null-terminated string that specifies the name of the printer or print server, the printer object, the
/// XcvMonitor, or the XcvPort.
/// </para>
/// <para>
/// For a printer object, use: PrinterName,Job xxxx. For an XcvMonitor, use: ServerName,XcvMonitor MonitorName. For an XcvPort, use:
/// ServerName,XcvPort PortName.
/// </para>
/// <para><c>Windows Vista:</c> If <c>NULL</c>, it indicates the local print server.</para>
/// </param>
/// <param name="phPrinter">A pointer to a variable that receives a handle to the open printer or print server object.</param>
/// <param name="pDefault">A pointer to a <c>PRINTER_DEFAULTS</c> structure. This value can be <c>NULL</c>.</param>
/// <param name="pOptions">A pointer to a <c>PRINTER_OPTIONS</c> structure. This value can be <c>NULL</c>.</param>
/// <returns>
/// <para>If the function succeeds, the return value is a nonzero value.</para>
/// <para>If the function fails, the return value is zero. For extended error information, call <c>GetLastError</c>.</para>
/// </returns>
/// <remarks>
/// <para>Do not call this method in <c>DllMain</c>.</para>
/// <para>The ANSI version of this function is not implemented and returns ERROR_NOT_SUPPORTED.</para>
/// <para>
/// The pDefault parameter enables you to specify the data type and device mode values that are used for printing documents
/// submitted by the <c>StartDocPrinter</c> function. However, you can override these values by using the <c>SetJob</c> function
/// after a document has been started.
/// </para>
/// <para>
/// You can call the <c>OpenPrinter2</c> function to open a handle to a print server or to determine client access rights to a print
/// server. To do this, specify the name of the print server in the pPrinterName parameter, set the <c>pDatatype</c> and
/// <c>pDevMode</c> members of the <c>PRINTER_DEFAULTS</c> structure to <c>NULL</c>, and set the <c>DesiredAccess</c> member to
/// specify a server access mask value such as SERVER_ALL_ACCESS. When you are finished with the handle, pass it to the
/// <c>ClosePrinter</c> function to close it.
/// </para>
/// <para>
/// Use the <c>DesiredAccess</c> member of the <c>PRINTER_DEFAULTS</c> structure to specify the necessary access rights. The access
/// rights can be one of the following.
/// </para>
/// <list type="table">
/// <listheader>
/// <term>Desired Access value</term>
/// <term>Meaning</term>
/// </listheader>
/// <item>
/// <term>PRINTER_ACCESS_ADMINISTER</term>
/// <term>To perform administrative tasks, such as those provided by SetPrinter.</term>
/// </item>
/// <item>
/// <term>PRINTER_ACCESS_USE</term>
/// <term>To perform basic printing operations.</term>
/// </item>
/// <item>
/// <term>PRINTER_ALL_ACCESS</term>
/// <term>To perform all administrative tasks and basic printing operations except SYNCHRONIZE. See Standard Access Rights.</term>
/// </item>
/// <item>
/// <term>PRINTER_ACCESS_MANAGE_LIMITED</term>
/// <term>
/// To perform administrative tasks, such as those provided by SetPrinter and SetPrinterData. This value is available starting from
/// Windows 8.1.
/// </term>
/// </item>
/// <item>
/// <term>generic security values, such as WRITE_DAC</term>
/// <term>To allow specific control access rights. See Standard Access Rights.</term>
/// </item>
/// </list>
/// <para>
/// If a user does not have permission to open a specified printer or print server with the desired access, the <c>OpenPrinter2</c>
/// call will fail, and <c>GetLastError</c> will return the value ERROR_ACCESS_DENIED.
/// </para>
/// <para>
/// When pPrinterName is a local printer, then <c>OpenPrinter2</c> ignores all values of the <c>dwFlags</c> that the
/// <c>PRINTER_OPTIONS</c> structure pointed to using pOptions, except PRINTER_OPTION_CLIENT_CHANGE. If the latter is passed, then
/// <c>OpenPrinter2</c> will return ERROR_ACCESS_DENIED. Accordingly, when opening a local printer, <c>OpenPrinter2</c> provides no
/// advantage over <c>OpenPrinter</c>.
/// </para>
/// <para>
/// <c>Windows Vista:</c> The printer data returned by <c>OpenPrinter2</c> is retrieved from a local cache unless the
/// <c>PRINTER_OPTION_NO_CACHE</c> flag is set in the <c>dwFlags</c> field of the <c>PRINTER_OPTIONS</c> structure referenced by pOptions.
/// </para>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/printdocs/openprinter2 BOOL OpenPrinter2( _In_ LPCTSTR pPrinterName, _Out_
// LPHANDLE phPrinter, _In_ LPPRINTER_DEFAULTS pDefault, _In_ PPRINTER_OPTIONS pOptions );
[DllImport(Lib.Winspool, SetLastError = true, CharSet = CharSet.Auto)]
[PInvokeData("winspool.h", MSDNShortId = "e2370ae4-4475-4ccc-a6f9-3d33d1370054")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool OpenPrinter2(string? pPrinterName, out SafeHPRINTER phPrinter,
[In, Optional, MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(PRINTER_DEFAULTS_Marshaler))] PRINTER_DEFAULTS? pDefault, [In, Optional] IntPtr pOptions);
/// <summary>The <c>PrinterProperties</c> function displays a printer-properties property sheet for the specified printer.</summary>
/// <param name="hWnd">A handle to the parent window of the property sheet.</param>
@ -5499,7 +5564,7 @@ public static partial class WinSpool
[DllImport(Lib.Winspool, SetLastError = true, CharSet = CharSet.Auto)]
[PInvokeData("winspool.h", MSDNShortId = "55eec548-577f-422b-80e3-8b23aa4d2159")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool SetDefaultPrinter(string pszPrinter);
public static extern bool SetDefaultPrinter(string? pszPrinter);
/// <summary>The <c>SetForm</c> function sets the form information for the specified printer.</summary>
/// <param name="hPrinter">
@ -5976,7 +6041,7 @@ public static partial class WinSpool
[PInvokeData("winspool.h", MSDNShortId = "1b80ad93-aaa1-41ed-a668-a944fa62c3eb")]
public static bool SetPort([Optional] string? pName, string pPortName, PORT_STATUS status, PORT_STATUS_TYPE severity)
{
using var mem = SafeCoTaskMemHandle.CreateFromStructure(new PORT_INFO_3 { dwStatus = status, dwSeverity = severity });
using SafeCoTaskMemStruct<PORT_INFO_3> mem = new PORT_INFO_3 { dwStatus = status, dwSeverity = severity };
return SetPort(pName, pPortName, 3, mem);
}
@ -6008,7 +6073,7 @@ public static partial class WinSpool
[PInvokeData("winspool.h", MSDNShortId = "1b80ad93-aaa1-41ed-a668-a944fa62c3eb")]
public static bool SetPort([Optional] string? pName, string pPortName, string status, PORT_STATUS_TYPE severity)
{
using var mem = SafeCoTaskMemHandle.CreateFromStructure(new PORT_INFO_3 { pszStatus = status, dwSeverity = severity });
using SafeCoTaskMemStruct<PORT_INFO_3> mem = new PORT_INFO_3 { pszStatus = status, dwSeverity = severity };
return SetPort(pName, pPortName, 3, mem);
}
@ -6988,7 +7053,7 @@ public static partial class WinSpool
{
return InlineSetPrinterData(SetData, hPrinter, null, pValueName, pData, type);
static Win32Error SetData(HPRINTER p1, string p2, string p3, REG_VALUE_TYPE p4, IntPtr p5, uint p6) =>
static Win32Error SetData(HPRINTER p1, string? p2, string p3, REG_VALUE_TYPE p4, IntPtr p5, uint p6) =>
SetPrinterData(p1, p3, p4, p5, p6);
}
@ -7226,7 +7291,7 @@ public static partial class WinSpool
// LPCTSTR pKeyName, _In_ LPCTSTR pValueName, _In_ DWORD Type, _In_ LPBYTE pData, _In_ DWORD cbData );
[DllImport(Lib.Winspool, SetLastError = false, CharSet = CharSet.Auto)]
[PInvokeData("winspool.h", MSDNShortId = "b7faadfc-1c81-4ddf-8fe5-68f4cc0376f1")]
public static extern Win32Error SetPrinterDataEx(HPRINTER hPrinter, string pKeyName, string pValueName, REG_VALUE_TYPE Type, IntPtr pData, uint cbData);
public static extern Win32Error SetPrinterDataEx(HPRINTER hPrinter, string? pKeyName, string pValueName, REG_VALUE_TYPE Type, IntPtr pData, uint cbData);
/// <summary>
/// The <c>SetPrinterDataEx</c> function sets the configuration data for a printer or print server. The function stores the
@ -7462,7 +7527,7 @@ public static partial class WinSpool
// LPCTSTR pKeyName, _In_ LPCTSTR pValueName, _In_ DWORD Type, _In_ LPBYTE pData, _In_ DWORD cbData );
[DllImport(Lib.Winspool, SetLastError = false, CharSet = CharSet.Auto)]
[PInvokeData("winspool.h", MSDNShortId = "b7faadfc-1c81-4ddf-8fe5-68f4cc0376f1")]
public static extern Win32Error SetPrinterDataEx(HPRINTER hPrinter, string pKeyName, string pValueName, REG_VALUE_TYPE Type, byte[] pData, uint cbData);
public static extern Win32Error SetPrinterDataEx(HPRINTER hPrinter, string? pKeyName, string pValueName, REG_VALUE_TYPE Type, byte[] pData, uint cbData);
/// <summary>
/// The <c>SetPrinterDataEx</c> function sets the configuration data for a printer or print server. The function stores the
@ -7694,7 +7759,7 @@ public static partial class WinSpool
/// </list>
/// </remarks>
[PInvokeData("winspool.h", MSDNShortId = "b7faadfc-1c81-4ddf-8fe5-68f4cc0376f1")]
public static Win32Error SetPrinterDataEx(HPRINTER hPrinter, string pKeyName, string pValueName, object pData, REG_VALUE_TYPE type = 0) =>
public static Win32Error SetPrinterDataEx(HPRINTER hPrinter, string? pKeyName, string pValueName, object pData, REG_VALUE_TYPE type = 0) =>
InlineSetPrinterData(SetPrinterDataEx, hPrinter, pKeyName, pValueName, pData, type);
/// <summary>The <c>StartDocPrinter</c> function notifies the print spooler that a document is to be spooled for printing.</summary>
@ -7903,7 +7968,7 @@ public static partial class WinSpool
[return: MarshalAs(UnmanagedType.Bool)]
private static extern bool AddPrinterConnection2([Optional] HWND hWnd, string pszName, uint dwLevel, in PRINTER_CONNECTION_INFO_1 pConnectionInfo);
private static Win32Error InlineSetPrinterData(Func<HPRINTER, string, string, REG_VALUE_TYPE, IntPtr, uint, Win32Error> f, HPRINTER hPrinter, string pKeyName, string pValueName, object pData, REG_VALUE_TYPE type)
private static Win32Error InlineSetPrinterData(Func<HPRINTER, string?, string, REG_VALUE_TYPE, IntPtr, uint, Win32Error> f, HPRINTER hPrinter, string? pKeyName, string pValueName, object pData, REG_VALUE_TYPE type)
{
var pDataType = pData.GetType();
if (type == 0) type = RegistryTypeExt.GetFromType(pDataType);

View File

@ -71,7 +71,7 @@ public static partial class WinSpool
/// Pointer to a null-terminated string that specifies the name of an output file. To print to a printer, set this to <c>NULL</c>.
/// </summary>
[MarshalAs(UnmanagedType.LPTStr)]
public string pOutputFile;
public string? pOutputFile;
/// <summary>Pointer to a null-terminated string that identifies the type of data used to record the document.</summary>
[MarshalAs(UnmanagedType.LPTStr)]
@ -273,7 +273,7 @@ public static partial class WinSpool
/// <c>NULL</c> and should be specified only for printers capable of bidirectional communication.
/// </summary>
[MarshalAs(UnmanagedType.LPTStr)]
public string pMonitorName;
public string? pMonitorName;
/// <summary>A pointer to a null-terminated string that specifies the default data type of the print job (for example, "EMF").</summary>
[MarshalAs(UnmanagedType.LPTStr)]
@ -343,7 +343,7 @@ public static partial class WinSpool
/// <c>NULL</c> and should be specified only for printers capable of bidirectional communication.
/// </summary>
[MarshalAs(UnmanagedType.LPTStr)]
public string pMonitorName;
public string? pMonitorName;
/// <summary>A pointer to a null-terminated string that specifies the default data type of the print job (for example, EMF).</summary>
[MarshalAs(UnmanagedType.LPTStr)]
@ -486,7 +486,7 @@ public static partial class WinSpool
/// <c>NULL</c> and should be specified only for printers capable of bidirectional communication.
/// </summary>
[MarshalAs(UnmanagedType.LPTStr)]
public string pMonitorName;
public string? pMonitorName;
/// <summary>A pointer to a null-terminated string that specifies the default data type of the print job (for example, "EMF").</summary>
[MarshalAs(UnmanagedType.LPTStr)]
@ -507,21 +507,21 @@ public static partial class WinSpool
/// <summary>Pointer to a null-terminated string that specifies the manufacturer's name.</summary>
[MarshalAs(UnmanagedType.LPTStr)]
public string pszMfgName;
public string? pszMfgName;
/// <summary>Pointer to a null-terminated string that specifies the URL for the manufacturer.</summary>
[MarshalAs(UnmanagedType.LPTStr)]
public string pszOEMUrl;
public string? pszOEMUrl;
/// <summary>Pointer to a null-terminated string that specifies the hardware ID for the printer driver.</summary>
[MarshalAs(UnmanagedType.LPTStr)]
public string pszHardwareID;
public string? pszHardwareID;
/// <summary>
/// Pointer to a null-terminated string that specifies the provider of the printer driver (for example, "Microsoft Windows 2000")
/// </summary>
[MarshalAs(UnmanagedType.LPTStr)]
public string pszProvider;
public string? pszProvider;
}
/// <summary>Contains printer driver information.</summary>
@ -591,7 +591,7 @@ public static partial class WinSpool
/// <c>NULL</c> and should be specified only for printers capable of bidirectional communication.
/// </summary>
[MarshalAs(UnmanagedType.LPTStr)]
public string pMonitorName;
public string? pMonitorName;
/// <summary>A pointer to a null-terminated string that specifies the default data type of the print job (for example, "EMF").</summary>
[MarshalAs(UnmanagedType.LPTStr)]
@ -612,21 +612,21 @@ public static partial class WinSpool
/// <summary>A pointer to a null-terminated string that specifies the manufacturer's name.</summary>
[MarshalAs(UnmanagedType.LPTStr)]
public string pszMfgName;
public string? pszMfgName;
/// <summary>A pointer to a null-terminated string that specifies the URL for the manufacturer.</summary>
[MarshalAs(UnmanagedType.LPTStr)]
public string pszOEMUrl;
public string? pszOEMUrl;
/// <summary>A pointer to a null-terminated string that specifies the hardware ID for the printer driver.</summary>
[MarshalAs(UnmanagedType.LPTStr)]
public string pszHardwareID;
public string? pszHardwareID;
/// <summary>
/// A pointer to a null-terminated string that specifies the provider of the printer driver (for example, "Microsoft Windows 2000").
/// </summary>
[MarshalAs(UnmanagedType.LPTStr)]
public string pszProvider;
public string? pszProvider;
/// <summary>A pointer to a null-terminated string that specifies the print processor (for example, "WinPrint").</summary>
[MarshalAs(UnmanagedType.LPTStr)]
@ -645,7 +645,7 @@ public static partial class WinSpool
/// This must be <c>NULL</c> if the DRIVER_INFO_8 is being passed to <c>AddPrinterDriver</c> or <c>AddPrinterDriverEx</c>.
/// </summary>
[MarshalAs(UnmanagedType.LPTStr)]
public string pszInfPath;
public string? pszInfPath;
/// <summary>
/// <para>
@ -730,7 +730,7 @@ public static partial class WinSpool
/// must be <c>NULL</c> if the <c>DRIVER_INFO_8</c> is being passed to <c>AddPrinterDriver</c> or <c>AddPrinterDriverEx</c>.
/// </summary>
[MarshalAs(UnmanagedType.LPTStr)]
public string pszzCoreDriverDependencies;
public string? pszzCoreDriverDependencies;
/// <summary>The earliest allowed date of any drivers that shipped with Windows and on which this driver depends.</summary>
public FILETIME ftMinInboxDriverVerDate;
@ -909,14 +909,14 @@ public static partial class WinSpool
/// <summary>The Multilingual User Interface localized resource DLL that contains the localized display name.</summary>
[MarshalAs(UnmanagedType.LPTStr)]
public string pMuiDll;
public string? pMuiDll;
/// <summary>The resource ID of the form's display name in <c>pMuiDll</c>.</summary>
public uint dwResourceId;
/// <summary>The form's display name in the language specified by <c>wLangId</c>.</summary>
[MarshalAs(UnmanagedType.LPTStr)]
public string pDisplayName;
public string? pDisplayName;
/// <summary>The language of the <c>pDisplayName</c>.</summary>
public ushort wLangId;
@ -961,7 +961,7 @@ public static partial class WinSpool
public static bool operator ==(HPRINTER h1, HPRINTER h2) => h1.Equals(h2);
/// <inheritdoc/>
public override bool Equals(object? obj) => obj is HPRINTER h ? handle == h.handle : false;
public override bool Equals(object? obj) => obj is HPRINTER h && handle == h.handle;
/// <inheritdoc/>
public override int GetHashCode() => handle.GetHashCode();
@ -1009,7 +1009,7 @@ public static partial class WinSpool
public static bool operator ==(HPRINTERCHANGENOTIFICATION h1, HPRINTERCHANGENOTIFICATION h2) => h1.Equals(h2);
/// <inheritdoc/>
public override bool Equals(object? obj) => obj is HPRINTERCHANGENOTIFICATION h ? handle == h.handle : false;
public override bool Equals(object? obj) => obj is HPRINTERCHANGENOTIFICATION h && handle == h.handle;
/// <inheritdoc/>
public override int GetHashCode() => handle.GetHashCode();
@ -1057,7 +1057,7 @@ public static partial class WinSpool
public static bool operator ==(HSPOOLFILE h1, HSPOOLFILE h2) => h1.Equals(h2);
/// <inheritdoc/>
public override bool Equals(object? obj) => obj is HSPOOLFILE h ? handle == h.handle : false;
public override bool Equals(object? obj) => obj is HSPOOLFILE h && handle == h.handle;
/// <inheritdoc/>
public override int GetHashCode() => handle.GetHashCode();
@ -1109,7 +1109,7 @@ public static partial class WinSpool
/// Status and, if pStatus is <c>NULL</c>, the status is defined by the contents of the Status member.
/// </summary>
[MarshalAs(UnmanagedType.LPTStr)]
public string pStatus;
public string? pStatus;
/// <summary>
/// <para>
@ -1304,7 +1304,7 @@ public static partial class WinSpool
/// <c>Status</c> and, if <c>pStatus</c> is <c>NULL</c>, the status is defined by the contents of the Status member.
/// </summary>
[MarshalAs(UnmanagedType.LPTStr)]
public string pStatus;
public string? pStatus;
/// <summary>
/// The value of this member is <c>NULL</c>. Retrieval and setting of document security descriptors is not supported in this release.
@ -1537,7 +1537,7 @@ public static partial class WinSpool
/// <c>Status</c> and, if <c>pStatus</c> is <c>NULL</c>, the status is defined by the contents of the Status member.
/// </summary>
[MarshalAs(UnmanagedType.LPTStr)]
public string pStatus;
public string? pStatus;
/// <summary>
/// The value of this member is <c>NULL</c>. Retrieval and setting of document security descriptors is not supported in this release.
@ -1762,7 +1762,7 @@ public static partial class WinSpool
/// <c>pDescription</c> is "printer port"). This can be <c>NULL</c>.
/// </summary>
[MarshalAs(UnmanagedType.LPTStr)]
public string pDescription;
public string? pDescription;
/// <summary>Bitmask describing the type of port. This member can be a combination of the following values:</summary>
public PORT_TYPE fPortType;
@ -1932,7 +1932,7 @@ public static partial class WinSpool
/// <summary>A pointer to the name of the driver.</summary>
[MarshalAs(UnmanagedType.LPTStr)]
public string pszDriverName;
public string? pszDriverName;
}
/// <summary>
@ -2041,7 +2041,7 @@ public static partial class WinSpool
/// <summary>Pointer to a null-terminated string that contains additional data describing the structure.</summary>
[MarshalAs(UnmanagedType.LPTStr)]
public string pComment;
public string? pComment;
}
/// <summary>The <c>PRINTER_INFO_2</c> structure specifies detailed printer information.</summary>
@ -2059,7 +2059,7 @@ public static partial class WinSpool
/// printer is controlled locally.
/// </summary>
[MarshalAs(UnmanagedType.LPTStr)]
public string pServerName;
public string? pServerName;
/// <summary>A pointer to a null-terminated string that specifies the name of the printer.</summary>
[MarshalAs(UnmanagedType.LPTStr)]
@ -2070,7 +2070,7 @@ public static partial class WinSpool
/// PRINTER_ATTRIBUTE_SHARED constant was set for the <c>Attributes</c> member.)
/// </summary>
[MarshalAs(UnmanagedType.LPTStr)]
public string pShareName;
public string? pShareName;
/// <summary>
/// A pointer to a null-terminated string that identifies the port(s) used to transmit data to the printer. If a printer is
@ -2085,13 +2085,13 @@ public static partial class WinSpool
/// <summary>A pointer to a null-terminated string that provides a brief description of the printer.</summary>
[MarshalAs(UnmanagedType.LPTStr)]
public string pComment;
public string? pComment;
/// <summary>
/// A pointer to a null-terminated string that specifies the physical location of the printer (for example, "Bldg. 38, Room 1164").
/// </summary>
[MarshalAs(UnmanagedType.LPTStr)]
public string pLocation;
public string? pLocation;
/// <summary>
/// A pointer to a <c>DEVMODE</c> structure that defines default printer data such as the paper orientation and the resolution.
@ -2103,7 +2103,7 @@ public static partial class WinSpool
/// used to separate print jobs sent to the printer.
/// </summary>
[MarshalAs(UnmanagedType.LPTStr)]
public string pSepFile;
public string? pSepFile;
/// <summary>
/// A pointer to a null-terminated string that specifies the name of the print processor used by the printer. You can use the
@ -2117,11 +2117,11 @@ public static partial class WinSpool
/// <c>EnumPrintProcessorDatatypes</c> function to obtain a list of data types supported by a specific print processor.
/// </summary>
[MarshalAs(UnmanagedType.LPTStr)]
public string pDatatype;
public string? pDatatype;
/// <summary>A pointer to a null-terminated string that specifies the default print-processor parameters.</summary>
[MarshalAs(UnmanagedType.LPTStr)]
public string pParameters;
public string? pParameters;
/// <summary>A pointer to a <c>SECURITY_DESCRIPTOR</c> structure for the printer. This member may be <c>NULL</c>.</summary>
public PSECURITY_DESCRIPTOR pSecurityDescriptor;
@ -2431,7 +2431,7 @@ public static partial class WinSpool
/// <summary>Pointer to a null-terminated string that is the name of the server.</summary>
[MarshalAs(UnmanagedType.LPTStr)]
public string pServerName;
public string? pServerName;
/// <summary>
/// <para>Specifies information about the returned data.</para>
@ -2730,7 +2730,7 @@ public static partial class WinSpool
/// <para>Before calling <c>SetPrinter</c>, set <c>pszObjectGUID</c> to <c>NULL</c>.</para>
/// </summary>
[MarshalAs(UnmanagedType.LPTStr)]
public string pszObjectGUID;
public string? pszObjectGUID;
/// <summary>
/// <para>
@ -3612,7 +3612,7 @@ public static partial class WinSpool
public ACCESS_MASK DesiredAccess;
/// <summary>Pointer to a null-terminated string that specifies the default data type for a printer.</summary>
public string pDatatype;
public string? pDatatype;
/// <summary>A <c>DEVMODE</c> structure that identifies the default environment and initialization data for a printer.</summary>
public DEVMODE? pDevMode;
@ -3733,14 +3733,14 @@ public static partial class WinSpool
public IntPtr MarshalManagedToNative(object ManagedObj)
{
if (!(ManagedObj is PRINTER_DEFAULTS pd)) throw new ArgumentException("Type of managed object must be PRINTER_DEFAULTS.");
if (ManagedObj is not PRINTER_DEFAULTS pd) throw new ArgumentException("Type of managed object must be PRINTER_DEFAULTS.");
var sz = IntPtr.Size * 2 + 4 + StringHelper.GetByteCount(pd.pDatatype) + (pd.pDevMode?.dmSize ?? 0);
var mem = new SafeCoTaskMemHandle(sz);
using (var str = new NativeMemoryStream(mem))
{
str.WriteReference(pd.pDatatype);
str.WriteReferenceObject(pd.pDevMode.HasValue ? (object)pd.pDevMode.Value : null);
str.WriteReferenceObject(pd.pDevMode.HasValue ? pd.pDevMode.Value : null);
str.Write((uint)pd.DesiredAccess);
}

View File

@ -460,7 +460,7 @@ public static partial class XpsObjectModel
// HRESULT CreateSolidColorBrush( const XPS_COLOR *color, IXpsOMColorProfileResource *colorProfile, IXpsOMSolidColorBrush
// **solidColorBrush );
[MethodImpl(MethodImplOptions.InternalCall)]
IXpsOMSolidColorBrush CreateSolidColorBrush(in XPS_COLOR color, [In] IXpsOMColorProfileResource colorProfile);
IXpsOMSolidColorBrush CreateSolidColorBrush(in XPS_COLOR color, [In] IXpsOMColorProfileResource? colorProfile);
/// <summary>Creates an IXpsOMColorProfileResource interface, which is used to access a color profile resource stream.</summary>
/// <param name="acquiredStream">
@ -643,7 +643,7 @@ public static partial class XpsObjectModel
// HRESULT CreateGradientStop( const XPS_COLOR *color, IXpsOMColorProfileResource *colorProfile, FLOAT offset,
// IXpsOMGradientStop **gradientStop );
[MethodImpl(MethodImplOptions.InternalCall)]
IXpsOMGradientStop CreateGradientStop(in XPS_COLOR color, [In] IXpsOMColorProfileResource colorProfile, [In] float offset);
IXpsOMGradientStop CreateGradientStop(in XPS_COLOR color, [In] IXpsOMColorProfileResource? colorProfile, [In] float offset);
/// <summary>Creates an IXpsOMLinearGradientBrush interface.</summary>
/// <param name="gradStop1">
@ -765,24 +765,21 @@ public static partial class XpsObjectModel
/// <term><c>bInheritHandle</c>: a Boolean value that determines whether the returned handle can be inherited by child processes</term>
/// </item>
/// </list>
/// <para>If</para>
/// <para>lpSecurityDescriptor</para>
/// <para>is</para>
/// <para>NULL</para>
/// <para>, the file or device associated with the returned handle is assigned a default security descriptor.</para>
/// <para>
/// If lpSecurityDescriptor is NULL, the file or device associated with the returned handle is assigned a default security descriptor.
/// </para>
/// <para>For more information about securityAttributes, see CreateFile.</para>
/// </param>
/// <param name="flagsAndAttributes">
/// <para>
/// Specifies the settings and attributes of the file to be created. For most files, the <c>FILE_ATTRIBUTE_NORMAL</c> value can
/// be used.
/// Specifies the settings and attributes of the file to be created. For most files, the <c>FILE_ATTRIBUTE_NORMAL</c> value can be used.
/// </para>
/// <para>See CreateFile for more information about this parameter.</para>
/// </param>
/// <param name="optimizeMarkupSize">
/// <para>
/// A Boolean value that indicates whether the document markup will be optimized for size when the contents of the XPS OM are
/// written to the XPS package.
/// A Boolean value that indicates whether the document markup will be optimized for size when the contents of the XPS OM are written
/// to the XPS package.
/// </para>
/// <list type="table">
/// <listheader>
@ -804,12 +801,11 @@ public static partial class XpsObjectModel
/// The IOpcPartUri interface that contains the part name of the document sequence in the new file.
/// </param>
/// <param name="coreProperties">
/// The IXpsOMCoreProperties interface that contains the core document properties to be given to the new file. This parameter
/// can be set to <c>NULL</c>.
/// The IXpsOMCoreProperties interface that contains the core document properties to be given to the new file. This parameter can be
/// set to <c>NULL</c>.
/// </param>
/// <param name="packageThumbnail">
/// The IXpsOMImageResource interface that contains the thumbnail image to be assigned to the new file. This parameter can be
/// set to <c>NULL</c>.
/// The IXpsOMImageResource interface that contains the thumbnail image to be assigned to the new file. This parameter can be set to <c>NULL</c>.
/// </param>
/// <param name="documentSequencePrintTicket">
/// The IXpsOMPrintTicketResource interface that contains the package-level print ticket to be assigned to the new file. This
@ -821,17 +817,17 @@ public static partial class XpsObjectModel
/// <returns>A pointer to the new IXpsOMPackageWriter interface created by this method.</returns>
/// <remarks>
/// <para>
/// The file is opened and initialized and the IXpsOMPackageWriter interface that is returned is then used to write content
/// types, package relationships, core properties, document sequence resources, and document sequence relationships.
/// The file is opened and initialized and the IXpsOMPackageWriter interface that is returned is then used to write content types,
/// package relationships, core properties, document sequence resources, and document sequence relationships.
/// </para>
/// <para>
/// If documentSequencePrintTicket is set to <c>NULL</c> and the value of interleaving is <c>XPS_INTERLEAVING_ON</c>, this
/// method creates a blank job-level print ticket and adds a relationship to the blank print ticket. This is done to provide
/// more efficient streaming consumption of the package.
/// If documentSequencePrintTicket is set to <c>NULL</c> and the value of interleaving is <c>XPS_INTERLEAVING_ON</c>, this method
/// creates a blank job-level print ticket and adds a relationship to the blank print ticket. This is done to provide more efficient
/// streaming consumption of the package.
/// </para>
/// <para>
/// If documentSequencePrintTicket is set to <c>NULL</c> and the value of interleaving is <c>XPS_INTERLEAVING_OFF</c>, no blank
/// print ticket is created.
/// If documentSequencePrintTicket is set to <c>NULL</c> and the value of interleaving is <c>XPS_INTERLEAVING_OFF</c>, no blank print
/// ticket is created.
/// </para>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomobjectfactory-createpackagewriteronfile
@ -840,7 +836,10 @@ public static partial class XpsObjectModel
// *coreProperties, IXpsOMImageResource *packageThumbnail, IXpsOMPrintTicketResource *documentSequencePrintTicket, IOpcPartUri
// *discardControlPartName, IXpsOMPackageWriter **packageWriter );
[MethodImpl(MethodImplOptions.InternalCall)]
IXpsOMPackageWriter CreatePackageWriterOnFile([In, MarshalAs(UnmanagedType.LPWStr)] string fileName, [In] IntPtr securityAttributes, [In] uint flagsAndAttributes, [In] int optimizeMarkupSize, [In] XPS_INTERLEAVING interleaving, [In] IOpcPartUri documentSequencePartName, [In] IXpsOMCoreProperties coreProperties, [In] IXpsOMImageResource packageThumbnail, [In] IXpsOMPrintTicketResource documentSequencePrintTicket, [In] IOpcPartUri discardControlPartName);
IXpsOMPackageWriter CreatePackageWriterOnFile([In, MarshalAs(UnmanagedType.LPWStr)] string fileName, [In] SECURITY_ATTRIBUTES? securityAttributes,
[In] uint flagsAndAttributes, [In] int optimizeMarkupSize, [In] XPS_INTERLEAVING interleaving, [In] IOpcPartUri documentSequencePartName,
[In, Optional] IXpsOMCoreProperties? coreProperties, [In, Optional] IXpsOMImageResource? packageThumbnail,
[In, Optional] IXpsOMPrintTicketResource? documentSequencePrintTicket, [In, Optional] IOpcPartUri? discardControlPartName);
/// <summary>Opens a stream for writing the contents of an XPS OM to an XPS package.</summary>
/// <param name="outputStream">The stream to be used for writing.</param>
@ -904,7 +903,9 @@ public static partial class XpsObjectModel
// IXpsOMPrintTicketResource *documentSequencePrintTicket, IOpcPartUri *discardControlPartName, IXpsOMPackageWriter
// **packageWriter );
[MethodImpl(MethodImplOptions.InternalCall)]
IXpsOMPackageWriter CreatePackageWriterOnStream([In] ISequentialStream outputStream, [In] int optimizeMarkupSize, [In] XPS_INTERLEAVING interleaving, [In] IOpcPartUri documentSequencePartName, [In] IXpsOMCoreProperties coreProperties, [In] IXpsOMImageResource packageThumbnail, [In] IXpsOMPrintTicketResource documentSequencePrintTicket, [In] IOpcPartUri discardControlPartName);
IXpsOMPackageWriter CreatePackageWriterOnStream([In] ISequentialStream outputStream, [In] int optimizeMarkupSize, [In] XPS_INTERLEAVING interleaving,
[In] IOpcPartUri documentSequencePartName, [In, Optional] IXpsOMCoreProperties? coreProperties, [In, Optional] IXpsOMImageResource? packageThumbnail,
[In, Optional] IXpsOMPrintTicketResource? documentSequencePrintTicket, [In, Optional] IOpcPartUri? discardControlPartName);
/// <summary>Creates an IOpcPartUri interface that uses the specified URI.</summary>
/// <param name="uri">The URI string.</param>

View File

@ -28,7 +28,7 @@ public static partial class XpsObjectModel
// GetPartName( IOpcPartUri **partUri );
[MethodImpl(MethodImplOptions.InternalCall)]
[return: MarshalAs(UnmanagedType.Interface)]
new IOpcPartUri GetPartName();
new IOpcPartUri? GetPartName();
/// <summary>Sets the name that will be used when the part is serialized.</summary>
/// <param name="partUri">
@ -41,7 +41,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompart-setpartname HRESULT
// SetPartName( IOpcPartUri *partUri );
[MethodImpl(MethodImplOptions.InternalCall)]
new void SetPartName([In] IOpcPartUri partUri);
new void SetPartName([In] IOpcPartUri? partUri);
/// <summary>Gets a pointer to the IXpsOMPackage interface that contains the core properties.</summary>
/// <returns>
@ -50,7 +50,7 @@ public static partial class XpsObjectModel
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-getowner HRESULT
// GetOwner( IXpsOMPackage **package );
IXpsOMPackage GetOwner();
IXpsOMPackage? GetOwner();
/// <summary>Gets the <c>category</c> property.</summary>
/// <returns>The string that is read from the <c>category</c> property.</returns>
@ -60,7 +60,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-getcategory HRESULT
// GetCategory( LPWSTR *category );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetCategory();
string? GetCategory();
/// <summary>Sets the <c>category</c> property.</summary>
/// <param name="category">
@ -69,7 +69,7 @@ public static partial class XpsObjectModel
/// <remarks>The <c>category</c> property contains a categorization of the content.</remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-setcategory HRESULT
// SetCategory( LPCWSTR category );
void SetCategory([In, MarshalAs(UnmanagedType.LPWStr)] string category);
void SetCategory([In, MarshalAs(UnmanagedType.LPWStr)] string? category);
/// <summary>Gets the <c>contentStatus</c> property.</summary>
/// <returns>The string that is read from the <c>contentStatus</c> property.</returns>
@ -82,7 +82,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-getcontentstatus
// HRESULT GetContentStatus( LPWSTR *contentStatus );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetContentStatus();
string? GetContentStatus();
/// <summary>Sets the <c>contentStatus</c> property.</summary>
/// <param name="contentStatus">
@ -94,7 +94,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-setcontentstatus
// HRESULT SetContentStatus( LPCWSTR contentStatus );
void SetContentStatus([In, MarshalAs(UnmanagedType.LPWStr)] string contentStatus);
void SetContentStatus([In, MarshalAs(UnmanagedType.LPWStr)] string? contentStatus);
/// <summary>Gets the <c>contentType</c> property.</summary>
/// <returns>The string that is read from the <c>contentType</c> property.</returns>
@ -108,7 +108,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-getcontenttype
// HRESULT GetContentType( LPWSTR *contentType );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetContentType();
string? GetContentType();
/// <summary>Sets the <c>contentType</c> property.</summary>
/// <param name="contentType">
@ -121,7 +121,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-setcontenttype
// HRESULT SetContentType( LPCWSTR contentType );
void SetContentType([In, MarshalAs(UnmanagedType.LPWStr)] string contentType);
void SetContentType([In, MarshalAs(UnmanagedType.LPWStr)] string? contentType);
/// <summary>Gets the <c>created</c> property.</summary>
/// <returns>The date and time that are read from the <c>created</c> property.</returns>
@ -145,7 +145,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-getcreator HRESULT
// GetCreator( LPWSTR *creator );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetCreator();
string? GetCreator();
/// <summary>Sets the <c>creator</c> property.</summary>
/// <param name="creator">
@ -156,7 +156,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-setcreator HRESULT
// SetCreator( LPCWSTR creator );
void SetCreator([In, MarshalAs(UnmanagedType.LPWStr)] string creator);
void SetCreator([In, MarshalAs(UnmanagedType.LPWStr)] string? creator);
/// <summary>Gets the <c>description</c> property.</summary>
/// <returns>The string that is read from the <c>description</c> property.</returns>
@ -166,7 +166,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-getdescription
// HRESULT GetDescription( LPWSTR *description );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetDescription();
string? GetDescription();
/// <summary>Sets the <c>description</c> property.</summary>
/// <param name="description">
@ -175,7 +175,7 @@ public static partial class XpsObjectModel
/// <remarks>The <c>description</c> property explains the content.</remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-setdescription
// HRESULT SetDescription( LPCWSTR description );
void SetDescription([In, MarshalAs(UnmanagedType.LPWStr)] string description);
void SetDescription([In, MarshalAs(UnmanagedType.LPWStr)] string? description);
/// <summary>Gets the <c>identifier</c> property.</summary>
/// <returns>The string that is read from the <c>identifier</c> property.</returns>
@ -187,7 +187,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-getidentifier
// HRESULT GetIdentifier( LPWSTR *identifier );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetIdentifier();
string? GetIdentifier();
/// <summary>Sets the <c>identifier</c> property.</summary>
/// <param name="identifier">
@ -198,7 +198,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-setidentifier
// HRESULT SetIdentifier( LPCWSTR identifier );
void SetIdentifier([In, MarshalAs(UnmanagedType.LPWStr)] string identifier);
void SetIdentifier([In, MarshalAs(UnmanagedType.LPWStr)] string? identifier);
/// <summary>Gets the <c>keywords</c> property.</summary>
/// <returns>The string that is read from the <c>keywords</c> property.</returns>
@ -211,7 +211,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-getkeywords HRESULT
// GetKeywords( LPWSTR *keywords );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetKeywords();
string? GetKeywords();
/// <summary>Sets the <c>keywords</c> property.</summary>
/// <param name="keywords">
@ -224,7 +224,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-setkeywords HRESULT
// SetKeywords( LPCWSTR keywords );
void SetKeywords([In, MarshalAs(UnmanagedType.LPWStr)] string keywords);
void SetKeywords([In, MarshalAs(UnmanagedType.LPWStr)] string? keywords);
/// <summary>Gets the <c>language</c> property.</summary>
/// <returns>The value that is read from the <c>language</c> property.</returns>
@ -235,7 +235,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-getlanguage HRESULT
// GetLanguage( LPWSTR *language );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetLanguage();
string? GetLanguage();
/// <summary>Sets the <c>language</c> property.</summary>
/// <param name="language">
@ -248,7 +248,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-setlanguage HRESULT
// SetLanguage( LPCWSTR language );
void SetLanguage([In, MarshalAs(UnmanagedType.LPWStr)] string language);
void SetLanguage([In, MarshalAs(UnmanagedType.LPWStr)] string? language);
/// <summary>Gets the <c>lastModifiedBy</c> property.</summary>
/// <returns>The value that is read from the <c>lastModifiedBy</c> property.</returns>
@ -258,7 +258,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-getlastmodifiedby
// HRESULT GetLastModifiedBy( LPWSTR *lastModifiedBy );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetLastModifiedBy();
string? GetLastModifiedBy();
/// <summary>Sets the <c>lastModifiedBy</c> property.</summary>
/// <param name="lastModifiedBy">
@ -268,7 +268,7 @@ public static partial class XpsObjectModel
/// <remarks>The <c>lastModifiedBy</c> property describes the user who performs the last modification.</remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-setlastmodifiedby
// HRESULT SetLastModifiedBy( LPCWSTR lastModifiedBy );
void SetLastModifiedBy([In, MarshalAs(UnmanagedType.LPWStr)] string lastModifiedBy);
void SetLastModifiedBy([In, MarshalAs(UnmanagedType.LPWStr)] string? lastModifiedBy);
/// <summary>Gets the <c>lastPrinted</c> property.</summary>
/// <returns>The date and time that are read from the <c>lastPrinted</c> property.</returns>
@ -284,7 +284,7 @@ public static partial class XpsObjectModel
/// <remarks>The <c>lastPrinted</c> property contains the date and time the package was last printed.</remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-setlastprinted
// HRESULT SetLastPrinted( const SYSTEMTIME *lastPrinted );
void SetLastPrinted(in SYSTEMTIME lastPrinted);
void SetLastPrinted([In, Optional] PSYSTEMTIME? lastPrinted);
/// <summary>Gets the <c>modified</c> property.</summary>
/// <returns>The date and time that are read from the <c>modified</c> property.</returns>
@ -300,7 +300,7 @@ public static partial class XpsObjectModel
/// <remarks>The <c>modified</c> property contains the date and time the package was last changed.</remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-setmodified HRESULT
// SetModified( const SYSTEMTIME *modified );
void SetModified(in SYSTEMTIME modified);
void SetModified([In, Optional] PSYSTEMTIME? modified);
/// <summary>Gets the <c>revision</c> property.</summary>
/// <returns>The string that is read from the <c>revision</c> property.</returns>
@ -310,7 +310,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-getrevision HRESULT
// GetRevision( LPWSTR *revision );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetRevision();
string? GetRevision();
/// <summary>Sets the <c>revision</c> property.</summary>
/// <param name="revision">
@ -319,7 +319,7 @@ public static partial class XpsObjectModel
/// <remarks>The <c>revision</c> property contains the revision number of the resource.</remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-setrevision HRESULT
// SetRevision( LPCWSTR revision );
void SetRevision([In, MarshalAs(UnmanagedType.LPWStr)] string revision);
void SetRevision([In, MarshalAs(UnmanagedType.LPWStr)] string? revision);
/// <summary>Gets the <c>subject</c> property.</summary>
/// <returns>The string that is read from the <c>subject</c> property.</returns>
@ -327,7 +327,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-getsubject HRESULT
// GetSubject( LPWSTR *subject );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetSubject();
string? GetSubject();
/// <summary>Sets the <c>subject</c> property.</summary>
/// <param name="subject">
@ -336,7 +336,7 @@ public static partial class XpsObjectModel
/// <remarks>The <c>subject</c> property contains the topic of the resource content.</remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-setsubject HRESULT
// SetSubject( LPCWSTR subject );
void SetSubject([In, MarshalAs(UnmanagedType.LPWStr)] string subject);
void SetSubject([In, MarshalAs(UnmanagedType.LPWStr)] string? subject);
/// <summary>Gets the <c>title</c> property.</summary>
/// <returns>The string that is read from the <c>title</c> property.</returns>
@ -344,7 +344,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-gettitle HRESULT
// GetTitle( LPWSTR *title );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetTitle();
string? GetTitle();
/// <summary>Sets the <c>title</c> property.</summary>
/// <param name="title">
@ -353,7 +353,7 @@ public static partial class XpsObjectModel
/// <remarks>The <c>title</c> property contains the name given to the resource.</remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-settitle HRESULT
// SetTitle( LPCWSTR title );
void SetTitle([In, MarshalAs(UnmanagedType.LPWStr)] string title);
void SetTitle([In, MarshalAs(UnmanagedType.LPWStr)] string? title);
/// <summary>Gets the <c>version</c> property.</summary>
/// <returns>The string that is read from the <c>version</c> property.</returns>
@ -361,7 +361,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-getversion HRESULT
// GetVersion( LPWSTR *version );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetVersion();
string? GetVersion();
/// <summary>Sets the <c>version</c> property.</summary>
/// <param name="version">
@ -370,7 +370,7 @@ public static partial class XpsObjectModel
/// <remarks>The <c>version</c> property contains the version number of the resource.</remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-setversion HRESULT
// SetVersion( LPCWSTR version );
void SetVersion([In, MarshalAs(UnmanagedType.LPWStr)] string version);
void SetVersion([In, MarshalAs(UnmanagedType.LPWStr)] string? version);
/// <summary>Makes a deep copy of the interface.</summary>
/// <returns>A pointer to the copy of the interface.</returns>
@ -397,7 +397,7 @@ public static partial class XpsObjectModel
// GetPartName( IOpcPartUri **partUri );
[MethodImpl(MethodImplOptions.InternalCall)]
[return: MarshalAs(UnmanagedType.Interface)]
new IOpcPartUri GetPartName();
new IOpcPartUri? GetPartName();
/// <summary>Sets the name that will be used when the part is serialized.</summary>
/// <param name="partUri">
@ -410,7 +410,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompart-setpartname HRESULT
// SetPartName( IOpcPartUri *partUri );
[MethodImpl(MethodImplOptions.InternalCall)]
new void SetPartName([In] IOpcPartUri partUri);
new void SetPartName([In] IOpcPartUri? partUri);
/// <summary>Gets a pointer to the IXpsOMDocumentSequence interface that contains the document.</summary>
/// <returns>
@ -606,7 +606,7 @@ public static partial class XpsObjectModel
// GetPartName( IOpcPartUri **partUri );
[MethodImpl(MethodImplOptions.InternalCall)]
[return: MarshalAs(UnmanagedType.Interface)]
new IOpcPartUri GetPartName();
new IOpcPartUri? GetPartName();
/// <summary>Sets the name that will be used when the part is serialized.</summary>
/// <param name="partUri">
@ -619,7 +619,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompart-setpartname HRESULT
// SetPartName( IOpcPartUri *partUri );
[MethodImpl(MethodImplOptions.InternalCall)]
new void SetPartName([In] IOpcPartUri partUri);
new void SetPartName([In] IOpcPartUri? partUri);
/// <summary>Gets a pointer to the IXpsOMPackage interface that contains the document sequence.</summary>
/// <returns>
@ -628,7 +628,7 @@ public static partial class XpsObjectModel
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomdocumentsequence-getowner HRESULT
// GetOwner( IXpsOMPackage **package );
IXpsOMPackage GetOwner();
IXpsOMPackage? GetOwner();
/// <summary>
/// Gets a pointer to the IXpsOMDocumentCollection interface, which contains the documents specified in the document sequence.
@ -659,7 +659,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomdocumentsequence-getprintticketresource
// HRESULT GetPrintTicketResource( IXpsOMPrintTicketResource **printTicketResource );
IXpsOMPrintTicketResource GetPrintTicketResource();
IXpsOMPrintTicketResource? GetPrintTicketResource();
/// <summary>Sets the job-level print ticket resource for the document sequence.</summary>
/// <param name="printTicketResource">
@ -672,7 +672,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomdocumentsequence-setprintticketresource
// HRESULT SetPrintTicketResource( IXpsOMPrintTicketResource *printTicketResource );
void SetPrintTicketResource([In] IXpsOMPrintTicketResource printTicketResource);
void SetPrintTicketResource([In] IXpsOMPrintTicketResource? printTicketResource);
}
/// <summary>
@ -698,7 +698,7 @@ public static partial class XpsObjectModel
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompackage-getdocumentsequence HRESULT
// GetDocumentSequence( IXpsOMDocumentSequence **documentSequence );
IXpsOMDocumentSequence GetDocumentSequence();
IXpsOMDocumentSequence? GetDocumentSequence();
/// <summary>Sets the IXpsOMDocumentSequence interface of the XPS package.</summary>
/// <param name="documentSequence">
@ -706,7 +706,7 @@ public static partial class XpsObjectModel
/// </param>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompackage-setdocumentsequence HRESULT
// SetDocumentSequence( IXpsOMDocumentSequence *documentSequence );
void SetDocumentSequence([In] IXpsOMDocumentSequence documentSequence);
void SetDocumentSequence([In] IXpsOMDocumentSequence? documentSequence);
/// <summary>Gets a pointer to the IXpsOMCoreProperties interface of the XPS package.</summary>
/// <returns>
@ -715,7 +715,7 @@ public static partial class XpsObjectModel
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompackage-getcoreproperties HRESULT
// GetCoreProperties( IXpsOMCoreProperties **coreProperties );
IXpsOMCoreProperties GetCoreProperties();
IXpsOMCoreProperties? GetCoreProperties();
/// <summary>Sets the IXpsOMCoreProperties interface of the XPS package.</summary>
/// <param name="coreProperties">
@ -724,7 +724,7 @@ public static partial class XpsObjectModel
/// </param>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompackage-setcoreproperties HRESULT
// SetCoreProperties( IXpsOMCoreProperties *coreProperties );
void SetCoreProperties([In] IXpsOMCoreProperties coreProperties);
void SetCoreProperties([In] IXpsOMCoreProperties? coreProperties);
/// <summary>Gets the name of the discard control part in the XPS package.</summary>
/// <returns>
@ -733,7 +733,7 @@ public static partial class XpsObjectModel
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompackage-getdiscardcontrolpartname
// HRESULT GetDiscardControlPartName( IOpcPartUri **discardControlPartUri );
IOpcPartUri GetDiscardControlPartName();
IOpcPartUri? GetDiscardControlPartName();
/// <summary>Sets the name of the discard control part in the XPS package.</summary>
/// <param name="discardControlPartUri">
@ -742,7 +742,7 @@ public static partial class XpsObjectModel
/// </param>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompackage-setdiscardcontrolpartname
// HRESULT SetDiscardControlPartName( IOpcPartUri *discardControlPartUri );
void SetDiscardControlPartName([In] IOpcPartUri discardControlPartUri);
void SetDiscardControlPartName([In] IOpcPartUri? discardControlPartUri);
/// <summary>
/// Gets a pointer to the IXpsOMImageResource interface of the thumbnail resource that is associated with the XPS package.
@ -757,7 +757,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompackage-getthumbnailresource
// HRESULT GetThumbnailResource( IXpsOMImageResource **imageResource );
IXpsOMImageResource GetThumbnailResource();
IXpsOMImageResource? GetThumbnailResource();
/// <summary>Sets the thumbnail image of the XPS document.</summary>
/// <param name="imageResource">
@ -770,7 +770,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompackage-setthumbnailresource
// HRESULT SetThumbnailResource( IXpsOMImageResource *imageResource );
void SetThumbnailResource([In] IXpsOMImageResource imageResource);
void SetThumbnailResource([In] IXpsOMImageResource? imageResource);
/// <summary>Writes the XPS package to a specified file.</summary>
/// <param name="fileName">The name of the file to be created. This parameter must not be <c>NULL</c>.</param>
@ -827,7 +827,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompackage-writetofile HRESULT
// WriteToFile( LPCWSTR fileName, LPSECURITY_ATTRIBUTES securityAttributes, DWORD flagsAndAttributes, BOOL optimizeMarkupSize );
void WriteToFile([In, MarshalAs(UnmanagedType.LPWStr)] string fileName, [In] SECURITY_ATTRIBUTES securityAttributes, [In] FileFlagsAndAttributes flagsAndAttributes, [In, MarshalAs(UnmanagedType.Bool)] bool optimizeMarkupSize);
void WriteToFile([In, MarshalAs(UnmanagedType.LPWStr)] string fileName, [In] SECURITY_ATTRIBUTES? securityAttributes, [In] FileFlagsAndAttributes flagsAndAttributes, [In, MarshalAs(UnmanagedType.Bool)] bool optimizeMarkupSize);
/// <summary>Writes the XPS package to a specified stream.</summary>
/// <param name="stream">The stream that receives the serialized contents of the package. This parameter must not be <c>NULL</c>.</param>
@ -931,8 +931,9 @@ public static partial class XpsObjectModel
// IXpsOMDocumentStructureResource *documentStructure, IXpsOMSignatureBlockResourceCollection *signatureBlockResources,
// IXpsOMPartUriCollection *restrictedFonts );
[MethodImpl(MethodImplOptions.InternalCall)]
void StartNewDocument([In] IOpcPartUri documentPartName, [In] IXpsOMPrintTicketResource documentPrintTicket, [In] IXpsOMDocumentStructureResource documentStructure,
[In] IXpsOMSignatureBlockResourceCollection signatureBlockResources, [In] IXpsOMPartUriCollection restrictedFonts);
void StartNewDocument([In] IOpcPartUri documentPartName, [In, Optional] IXpsOMPrintTicketResource? documentPrintTicket,
[In, Optional] IXpsOMDocumentStructureResource? documentStructure,
[In, Optional] IXpsOMSignatureBlockResourceCollection? signatureBlockResources, [In, Optional] IXpsOMPartUriCollection? restrictedFonts);
/// <summary>Writes a new FixedPage part to the currently open FixedDocument part in the package.</summary>
/// <param name="page">
@ -974,8 +975,8 @@ public static partial class XpsObjectModel
// AddPage( IXpsOMPage *page, const XPS_SIZE *advisoryPageDimensions, IXpsOMPartUriCollection *discardableResourceParts,
// IXpsOMStoryFragmentsResource *storyFragments, IXpsOMPrintTicketResource *pagePrintTicket, IXpsOMImageResource *pageThumbnail );
[MethodImpl(MethodImplOptions.InternalCall)]
void AddPage([In] IXpsOMPage page, in XPS_SIZE advisoryPageDimensions, [In] IXpsOMPartUriCollection discardableResourceParts,
[In] IXpsOMStoryFragmentsResource storyFragments, [In] IXpsOMPrintTicketResource pagePrintTicket, [In] IXpsOMImageResource pageThumbnail);
void AddPage([In] IXpsOMPage page, in XPS_SIZE advisoryPageDimensions, [In, Optional] IXpsOMPartUriCollection? discardableResourceParts,
[In, Optional] IXpsOMStoryFragmentsResource? storyFragments, [In] IXpsOMPrintTicketResource? pagePrintTicket, [In, Optional] IXpsOMImageResource? pageThumbnail);
/// <summary>Creates a new part resource in the package.</summary>
/// <param name="resource">
@ -1104,7 +1105,7 @@ public static partial class XpsObjectModel
// GetPartName( IOpcPartUri **partUri );
[MethodImpl(MethodImplOptions.InternalCall)]
[return: MarshalAs(UnmanagedType.Interface)]
new IOpcPartUri GetPartName();
new IOpcPartUri? GetPartName();
/// <summary>Sets the name that will be used when the part is serialized.</summary>
/// <param name="partUri">
@ -1117,7 +1118,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompart-setpartname HRESULT
// SetPartName( IOpcPartUri *partUri );
[MethodImpl(MethodImplOptions.InternalCall)]
new void SetPartName([In] IOpcPartUri partUri);
new void SetPartName([In] IOpcPartUri? partUri);
/// <summary>Gets a pointer to the IXpsOMPageReference interface that contains the page.</summary>
/// <returns>A pointer to the IXpsOMPageReference interface that contains the page.</returns>
@ -1125,7 +1126,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompage-getowner HRESULT GetOwner(
// IXpsOMPageReference **pageReference );
[MethodImpl(MethodImplOptions.InternalCall)]
IXpsOMPageReference GetOwner();
IXpsOMPageReference? GetOwner();
/// <summary>Gets a pointer to an IXpsOMVisualCollection interface that contains a collection of the page's visual objects.</summary>
/// <returns>A pointer to the IXpsOMVisualCollection interface that contains a collection of the page's visual objects.</returns>
@ -1295,7 +1296,7 @@ public static partial class XpsObjectModel
// GetLanguage( LPWSTR *language );
[MethodImpl(MethodImplOptions.InternalCall)]
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetLanguage();
string? GetLanguage();
/// <summary>Sets the <c>Language</c> property of the page.</summary>
/// <param name="language">
@ -1308,7 +1309,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompage-setlanguage HRESULT
// SetLanguage( LPCWSTR language );
[MethodImpl(MethodImplOptions.InternalCall)]
void SetLanguage([In, MarshalAs(UnmanagedType.LPWStr)] string language);
void SetLanguage([In, MarshalAs(UnmanagedType.LPWStr)] string? language);
/// <summary>Gets the <c>Name</c> property of the page.</summary>
/// <returns>
@ -1318,7 +1319,7 @@ public static partial class XpsObjectModel
// LPWSTR *name );
[MethodImpl(MethodImplOptions.InternalCall)]
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetName();
string? GetName();
/// <summary>Sets the <c>Name</c> property of this page.</summary>
/// <param name="name">
@ -1332,7 +1333,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompage-setname HRESULT SetName(
// LPCWSTR name );
[MethodImpl(MethodImplOptions.InternalCall)]
void SetName([In, MarshalAs(UnmanagedType.LPWStr)] string name);
void SetName([In, MarshalAs(UnmanagedType.LPWStr)] string? name);
/// <summary>Gets a Boolean value that indicates whether the page is the target of a hyperlink.</summary>
/// <returns>
@ -1424,7 +1425,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompage-getdictionary HRESULT
// GetDictionary( IXpsOMDictionary **resourceDictionary );
[MethodImpl(MethodImplOptions.InternalCall)]
IXpsOMDictionary GetDictionary();
IXpsOMDictionary? GetDictionary();
/// <summary>
/// Gets a pointer to the IXpsOMDictionary interface of the local, unshared dictionary that is associated with this page.
@ -1457,7 +1458,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompage-getdictionarylocal HRESULT
// GetDictionaryLocal( IXpsOMDictionary **resourceDictionary );
[MethodImpl(MethodImplOptions.InternalCall)]
IXpsOMDictionary GetDictionaryLocal();
IXpsOMDictionary? GetDictionaryLocal();
/// <summary>Sets the IXpsOMDictionary interface pointer of the page's local dictionary resource.</summary>
/// <param name="resourceDictionary">
@ -1499,7 +1500,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompage-setdictionarylocal HRESULT
// SetDictionaryLocal( IXpsOMDictionary *resourceDictionary );
[MethodImpl(MethodImplOptions.InternalCall)]
void SetDictionaryLocal([In] IXpsOMDictionary resourceDictionary);
void SetDictionaryLocal([In] IXpsOMDictionary? resourceDictionary);
/// <summary>
/// Gets a pointer to the IXpsOMRemoteDictionaryResource interface of the shared dictionary resource that is used by this page.
@ -1535,7 +1536,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompage-getdictionaryresource HRESULT
// GetDictionaryResource( IXpsOMRemoteDictionaryResource **remoteDictionaryResource );
[MethodImpl(MethodImplOptions.InternalCall)]
IXpsOMRemoteDictionaryResource GetDictionaryResource();
IXpsOMRemoteDictionaryResource? GetDictionaryResource();
/// <summary>Sets the IXpsOMRemoteDictionaryResource interface pointer of the page's remote dictionary resource.</summary>
/// <param name="remoteDictionaryResource">
@ -1574,7 +1575,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompage-setdictionaryresource HRESULT
// SetDictionaryResource( IXpsOMRemoteDictionaryResource *remoteDictionaryResource );
[MethodImpl(MethodImplOptions.InternalCall)]
void SetDictionaryResource([In] IXpsOMRemoteDictionaryResource remoteDictionaryResource);
void SetDictionaryResource([In] IXpsOMRemoteDictionaryResource? remoteDictionaryResource);
/// <summary>Writes the page to the specified stream.</summary>
/// <param name="stream">The stream that receives the serialized contents of the page.</param>
@ -1712,7 +1713,7 @@ public static partial class XpsObjectModel
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompagereference-getowner HRESULT
// GetOwner( IXpsOMDocument **document );
IXpsOMDocument GetOwner();
IXpsOMDocument? GetOwner();
/// <summary>Gets a pointer to the IXpsOMPage interface that contains the page.</summary>
/// <returns>A pointer to the IXpsOMPage interface of the page. If a page has not been set, a <c>NULL</c> pointer is returned.</returns>
@ -1730,7 +1731,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompagereference-getpage HRESULT
// GetPage( IXpsOMPage **page );
IXpsOMPage GetPage();
IXpsOMPage? GetPage();
/// <summary>Sets the IXpsOMPage interface of the page reference.</summary>
/// <param name="page">The IXpsOMPage interface pointer of the page.</param>
@ -1849,7 +1850,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompagereference-getstoryfragmentsresource
// HRESULT GetStoryFragmentsResource( IXpsOMStoryFragmentsResource **storyFragmentsResource );
IXpsOMStoryFragmentsResource GetStoryFragmentsResource();
IXpsOMStoryFragmentsResource? GetStoryFragmentsResource();
/// <summary>
/// Sets the IXpsOMStoryFragmentsResource interface pointer of the StoryFragments resource to be assigned to the page.
@ -1868,7 +1869,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompagereference-setstoryfragmentsresource
// HRESULT SetStoryFragmentsResource( IXpsOMStoryFragmentsResource *storyFragmentsResource );
void SetStoryFragmentsResource([In] IXpsOMStoryFragmentsResource storyFragmentsResource);
void SetStoryFragmentsResource([In] IXpsOMStoryFragmentsResource? storyFragmentsResource);
/// <summary>
/// Gets a pointer to the IXpsOMPrintTicketResource interface of the page-level print ticket resource that is associated with
@ -1884,7 +1885,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompagereference-getprintticketresource
// HRESULT GetPrintTicketResource( IXpsOMPrintTicketResource **printTicketResource );
IXpsOMPrintTicketResource GetPrintTicketResource();
IXpsOMPrintTicketResource? GetPrintTicketResource();
/// <summary>
/// Sets the IXpsOMPrintTicketResource interface pointer of the page-level print ticket resource that is to be assigned to the page.
@ -1895,7 +1896,7 @@ public static partial class XpsObjectModel
/// </param>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompagereference-setprintticketresource
// HRESULT SetPrintTicketResource( IXpsOMPrintTicketResource *printTicketResource );
void SetPrintTicketResource([In] IXpsOMPrintTicketResource printTicketResource);
void SetPrintTicketResource([In] IXpsOMPrintTicketResource? printTicketResource);
/// <summary>
/// Gets a pointer to the IXpsOMImageResource interface of the thumbnail image resource that is associated with the page.
@ -1913,7 +1914,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompagereference-getthumbnailresource
// HRESULT GetThumbnailResource( IXpsOMImageResource **imageResource );
IXpsOMImageResource GetThumbnailResource();
IXpsOMImageResource? GetThumbnailResource();
/// <summary>
/// Sets the pointer to the IXpsOMImageResource interface of the thumbnail image resource to be assigned to the page.
@ -1928,7 +1929,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompagereference-setthumbnailresource
// HRESULT SetThumbnailResource( IXpsOMImageResource *imageResource );
void SetThumbnailResource([In] IXpsOMImageResource imageResource);
void SetThumbnailResource([In] IXpsOMImageResource? imageResource);
/// <summary>
/// Gets an IXpsOMNameCollection interface that contains the names of all the document subtree objects whose
@ -2124,7 +2125,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompart-getpartname HRESULT
// GetPartName( IOpcPartUri **partUri );
[MethodImpl(MethodImplOptions.InternalCall)]
IOpcPartUri GetPartName();
IOpcPartUri? GetPartName();
/// <summary>Sets the name that will be used when the part is serialized.</summary>
/// <param name="partUri">
@ -2137,7 +2138,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompart-setpartname HRESULT
// SetPartName( IOpcPartUri *partUri );
[MethodImpl(MethodImplOptions.InternalCall)]
void SetPartName([In] IOpcPartUri partUri);
void SetPartName([In] IOpcPartUri? partUri);
}
/// <summary>Provides access to all shared, part-based resources of the XPS document.</summary>

View File

@ -1,5 +1,8 @@
using System.Runtime.CompilerServices;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices.ComTypes;
using Vanara.Collections;
using Vanara.Extensions.Reflection;
using static Vanara.PInvoke.Opc;
using static Vanara.PInvoke.UrlMon;
@ -106,7 +109,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-gettransform HRESULT
// GetTransform( IXpsOMMatrixTransform **matrixTransform );
[MethodImpl(MethodImplOptions.InternalCall)]
new IXpsOMMatrixTransform GetTransform();
new IXpsOMMatrixTransform? GetTransform();
/// <summary>
/// Gets a pointer to the IXpsOMMatrixTransform interface that contains the local, unshared, resolved matrix transform for the visual.
@ -139,7 +142,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-gettransformlocal HRESULT
// GetTransformLocal( IXpsOMMatrixTransform **matrixTransform );
[MethodImpl(MethodImplOptions.InternalCall)]
new IXpsOMMatrixTransform GetTransformLocal();
new IXpsOMMatrixTransform? GetTransformLocal();
/// <summary>Sets the local, unshared matrix transform.</summary>
/// <param name="matrixTransform">
@ -184,7 +187,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-settransformlocal HRESULT
// SetTransformLocal( IXpsOMMatrixTransform *matrixTransform );
[MethodImpl(MethodImplOptions.InternalCall)]
new void SetTransformLocal([In] IXpsOMMatrixTransform matrixTransform);
new void SetTransformLocal([In] IXpsOMMatrixTransform? matrixTransform);
/// <summary>
/// Gets the lookup key name of the IXpsOMMatrixTransform interface in a resource dictionary that contains the resolved matrix
@ -219,7 +222,7 @@ public static partial class XpsObjectModel
// GetTransformLookup( LPWSTR *key );
[MethodImpl(MethodImplOptions.InternalCall)]
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetTransformLookup();
new string? GetTransformLookup();
/// <summary>Sets the lookup key name of a shared matrix transform in a resource dictionary.</summary>
/// <param name="key">The lookup key name of the matrix transform in the dictionary.</param>
@ -262,7 +265,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-settransformlookup HRESULT
// SetTransformLookup( LPCWSTR key );
[MethodImpl(MethodImplOptions.InternalCall)]
new void SetTransformLookup([In, MarshalAs(UnmanagedType.LPWStr)] string key);
new void SetTransformLookup([In, MarshalAs(UnmanagedType.LPWStr)] string? key);
/// <summary>
/// Gets a pointer to the IXpsOMGeometry interface that contains the resolved geometry of the visual's clipping region.
@ -298,7 +301,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-getclipgeometry HRESULT
// GetClipGeometry( IXpsOMGeometry **clipGeometry );
[MethodImpl(MethodImplOptions.InternalCall)]
new IXpsOMGeometry GetClipGeometry();
new IXpsOMGeometry? GetClipGeometry();
/// <summary>
/// Gets a pointer to the IXpsOMGeometry interface that contains the local, unshared geometry of the visual's clipping region.
@ -330,7 +333,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-getclipgeometrylocal HRESULT
// GetClipGeometryLocal( IXpsOMGeometry **clipGeometry );
[MethodImpl(MethodImplOptions.InternalCall)]
new IXpsOMGeometry GetClipGeometryLocal();
new IXpsOMGeometry? GetClipGeometryLocal();
/// <summary>Sets the local, unshared clipping region for the visual.</summary>
/// <param name="clipGeometry">
@ -376,7 +379,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-setclipgeometrylocal HRESULT
// SetClipGeometryLocal( IXpsOMGeometry *clipGeometry );
[MethodImpl(MethodImplOptions.InternalCall)]
new void SetClipGeometryLocal([In] IXpsOMGeometry clipGeometry);
new void SetClipGeometryLocal([In] IXpsOMGeometry? clipGeometry);
/// <summary>
/// Gets the lookup key for the IXpsOMGeometry interface in a resource dictionary that contains the visual's clipping region.
@ -409,7 +412,7 @@ public static partial class XpsObjectModel
// HRESULT GetClipGeometryLookup( LPWSTR *key );
[MethodImpl(MethodImplOptions.InternalCall)]
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetClipGeometryLookup();
new string? GetClipGeometryLookup();
/// <summary>Sets the lookup key name of a shared clip geometry in a resource dictionary.</summary>
/// <param name="key">
@ -454,7 +457,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-setclipgeometrylookup
// HRESULT SetClipGeometryLookup( LPCWSTR key );
[MethodImpl(MethodImplOptions.InternalCall)]
new void SetClipGeometryLookup([In, MarshalAs(UnmanagedType.LPWStr)] string key);
new void SetClipGeometryLookup([In, MarshalAs(UnmanagedType.LPWStr)] string? key);
/// <summary>Gets the opacity value of this visual.</summary>
/// <returns>The opacity value.</returns>
@ -508,7 +511,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-getopacitymaskbrush HRESULT
// GetOpacityMaskBrush( IXpsOMBrush **opacityMaskBrush );
[MethodImpl(MethodImplOptions.InternalCall)]
new IXpsOMBrush GetOpacityMaskBrush();
new IXpsOMBrush? GetOpacityMaskBrush();
/// <summary>Gets the local, unshared opacity mask brush for the visual.</summary>
/// <returns>
@ -538,7 +541,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-getopacitymaskbrushlocal
// HRESULT GetOpacityMaskBrushLocal( IXpsOMBrush **opacityMaskBrush );
[MethodImpl(MethodImplOptions.InternalCall)]
new IXpsOMBrush GetOpacityMaskBrushLocal();
new IXpsOMBrush? GetOpacityMaskBrushLocal();
/// <summary>Sets the IXpsOMBrush interface pointer as the local, unshared opacity mask brush.</summary>
/// <param name="opacityMaskBrush">
@ -584,7 +587,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-setopacitymaskbrushlocal
// HRESULT SetOpacityMaskBrushLocal( IXpsOMBrush *opacityMaskBrush );
[MethodImpl(MethodImplOptions.InternalCall)]
new void SetOpacityMaskBrushLocal([In] IXpsOMBrush opacityMaskBrush);
new void SetOpacityMaskBrushLocal([In] IXpsOMBrush? opacityMaskBrush);
/// <summary>Gets the name of the lookup key of the shared opacity mask brush in a resource dictionary.</summary>
/// <returns>
@ -615,7 +618,7 @@ public static partial class XpsObjectModel
// HRESULT GetOpacityMaskBrushLookup( LPWSTR *key );
[MethodImpl(MethodImplOptions.InternalCall)]
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetOpacityMaskBrushLookup();
new string? GetOpacityMaskBrushLookup();
/// <summary>Sets the lookup key name of a shared opacity mask brush in a resource dictionary.</summary>
/// <param name="key">
@ -660,7 +663,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-setopacitymaskbrushlookup
// HRESULT SetOpacityMaskBrushLookup( LPCWSTR key );
[MethodImpl(MethodImplOptions.InternalCall)]
new void SetOpacityMaskBrushLookup([In, MarshalAs(UnmanagedType.LPWStr)] string key);
new void SetOpacityMaskBrushLookup([In, MarshalAs(UnmanagedType.LPWStr)] string? key);
/// <summary>Gets the <c>Name</c> property of the visual.</summary>
/// <returns>The <c>Name</c> property string. If the <c>Name</c> property has not been set, a <c>NULL</c> pointer is returned.</returns>
@ -668,7 +671,7 @@ public static partial class XpsObjectModel
// LPWSTR *name );
[MethodImpl(MethodImplOptions.InternalCall)]
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetName();
new string? GetName();
/// <summary>Sets the <c>Name</c> property of the visual.</summary>
/// <param name="name">The name of the visual. A <c>NULL</c> pointer clears the <c>Name</c> property.</param>
@ -681,7 +684,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-setname HRESULT SetName(
// LPCWSTR name );
[MethodImpl(MethodImplOptions.InternalCall)]
new void SetName([In, MarshalAs(UnmanagedType.LPWStr)] string name);
new void SetName([In, MarshalAs(UnmanagedType.LPWStr)] string? name);
/// <summary>Gets a value that indicates whether the visual is the target of a hyperlink.</summary>
/// <returns>
@ -739,7 +742,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-gethyperlinknavigateuri
// HRESULT GetHyperlinkNavigateUri( IUri **hyperlinkUri );
[MethodImpl(MethodImplOptions.InternalCall)]
new IUri GetHyperlinkNavigateUri();
new IUri? GetHyperlinkNavigateUri();
/// <summary>Sets the destination URI of the visual's hyperlink.</summary>
/// <param name="hyperlinkUri">The IUri interface that contains the destination URI of the visual's hyperlink.</param>
@ -750,7 +753,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-sethyperlinknavigateuri
// HRESULT SetHyperlinkNavigateUri( IUri *hyperlinkUri );
[MethodImpl(MethodImplOptions.InternalCall)]
new void SetHyperlinkNavigateUri([In] IUri hyperlinkUri);
new void SetHyperlinkNavigateUri([In] IUri? hyperlinkUri);
/// <summary>Gets the <c>Language</c> property of the visual and of its contents.</summary>
/// <returns>
@ -764,7 +767,7 @@ public static partial class XpsObjectModel
// GetLanguage( LPWSTR *language );
[MethodImpl(MethodImplOptions.InternalCall)]
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetLanguage();
new string? GetLanguage();
/// <summary>Sets the <c>Language</c> property of the visual.</summary>
/// <param name="language">
@ -777,7 +780,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-setlanguage HRESULT
// SetLanguage( LPCWSTR language );
[MethodImpl(MethodImplOptions.InternalCall)]
new void SetLanguage([In, MarshalAs(UnmanagedType.LPWStr)] string language);
new void SetLanguage([In, MarshalAs(UnmanagedType.LPWStr)] string? language);
/// <summary>
/// Gets a pointer to an IXpsOMVisualCollection interface that contains a collection of the visual objects in the canvas.
@ -877,7 +880,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcanvas-getaccessibilityshortdescription
// HRESULT GetAccessibilityShortDescription( LPWSTR *shortDescription );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetAccessibilityShortDescription();
string? GetAccessibilityShortDescription();
/// <summary>
/// Sets the short textual description of the object's contents. This text is used by accessibility clients to describe the object.
@ -891,7 +894,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcanvas-setaccessibilityshortdescription
// HRESULT SetAccessibilityShortDescription( LPCWSTR shortDescription );
void SetAccessibilityShortDescription([In, MarshalAs(UnmanagedType.LPWStr)] string shortDescription);
void SetAccessibilityShortDescription([In, MarshalAs(UnmanagedType.LPWStr)] string? shortDescription);
/// <summary>
/// Gets the long (detailed) textual description of the object's contents. This text is used by accessibility clients to
@ -910,7 +913,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcanvas-getaccessibilitylongdescription
// HRESULT GetAccessibilityLongDescription( LPWSTR *longDescription );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetAccessibilityLongDescription();
string? GetAccessibilityLongDescription();
/// <summary>
/// Sets the long (detailed) textual description of the object's contents. This text is used by accessibility clients to
@ -925,7 +928,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcanvas-setaccessibilitylongdescription
// HRESULT SetAccessibilityLongDescription( LPCWSTR longDescription );
void SetAccessibilityLongDescription([In, MarshalAs(UnmanagedType.LPWStr)] string longDescription);
void SetAccessibilityLongDescription([In, MarshalAs(UnmanagedType.LPWStr)] string? longDescription);
/// <summary>Gets a pointer to the resolved IXpsOMDictionary interface of the dictionary associated with the canvas.</summary>
/// <returns>
@ -962,7 +965,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcanvas-getdictionary HRESULT
// GetDictionary( IXpsOMDictionary **resourceDictionary );
IXpsOMDictionary GetDictionary();
IXpsOMDictionary? GetDictionary();
/// <summary>Gets a pointer to the IXpsOMDictionary interface of the local, unshared dictionary.</summary>
/// <returns>
@ -998,7 +1001,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcanvas-getdictionarylocal HRESULT
// GetDictionaryLocal( IXpsOMDictionary **resourceDictionary );
IXpsOMDictionary GetDictionaryLocal();
IXpsOMDictionary? GetDictionaryLocal();
/// <summary>Sets the IXpsOMDictionary interface pointer of the local, unshared dictionary.</summary>
/// <param name="resourceDictionary">
@ -1040,7 +1043,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcanvas-setdictionarylocal HRESULT
// SetDictionaryLocal( IXpsOMDictionary *resourceDictionary );
void SetDictionaryLocal([In] IXpsOMDictionary resourceDictionary);
void SetDictionaryLocal([In] IXpsOMDictionary? resourceDictionary);
/// <summary>Gets a pointer to the IXpsOMRemoteDictionaryResource interface of the remote dictionary resource.</summary>
/// <returns>
@ -1073,7 +1076,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcanvas-getdictionaryresource
// HRESULT GetDictionaryResource( IXpsOMRemoteDictionaryResource **remoteDictionaryResource );
IXpsOMRemoteDictionaryResource GetDictionaryResource();
IXpsOMRemoteDictionaryResource? GetDictionaryResource();
/// <summary>Sets the IXpsOMRemoteDictionaryResource interface pointer of the remote dictionary resource.</summary>
/// <param name="remoteDictionaryResource">
@ -1111,7 +1114,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcanvas-setdictionaryresource
// HRESULT SetDictionaryResource( IXpsOMRemoteDictionaryResource *remoteDictionaryResource );
void SetDictionaryResource([In] IXpsOMRemoteDictionaryResource remoteDictionaryResource);
void SetDictionaryResource([In] IXpsOMRemoteDictionaryResource? remoteDictionaryResource);
/// <summary>Makes a deep copy of the interface.</summary>
/// <returns>A pointer to the copy of the interface.</returns>
@ -1136,7 +1139,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompart-getpartname HRESULT
// GetPartName( IOpcPartUri **partUri );
[MethodImpl(MethodImplOptions.InternalCall)]
new IOpcPartUri GetPartName();
new IOpcPartUri? GetPartName();
/// <summary>Sets the name that will be used when the part is serialized.</summary>
/// <param name="partUri">
@ -1149,7 +1152,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompart-setpartname HRESULT
// SetPartName( IOpcPartUri *partUri );
[MethodImpl(MethodImplOptions.InternalCall)]
new void SetPartName([In] IOpcPartUri partUri);
new void SetPartName([In] IOpcPartUri? partUri);
/// <summary>Gets a new, read-only copy of the stream that is associated with this resource.</summary>
/// <returns>A new, read-only copy of the stream that is associated with this resource.</returns>
@ -1209,7 +1212,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcolorprofileresourcecollection-getat
// HRESULT GetAt( UINT32 index, IXpsOMColorProfileResource **object );
[MethodImpl(MethodImplOptions.InternalCall)]
IXpsOMColorProfileResource GetAt([In] uint index);
IXpsOMColorProfileResource? GetAt([In] uint index);
/// <summary>Inserts an IXpsOMColorProfileResource interface pointer at a specified location in the collection.</summary>
/// <param name="index">
@ -1282,7 +1285,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcolorprofileresourcecollection-getbypartname
// HRESULT GetByPartName( IOpcPartUri *partName, IXpsOMColorProfileResource **part );
[MethodImpl(MethodImplOptions.InternalCall)]
IXpsOMColorProfileResource GetByPartName([In] IOpcPartUri partName);
IXpsOMColorProfileResource? GetByPartName([In] IOpcPartUri partName);
}
/// <summary>A collection of XPS_DASH structures.</summary>
@ -1414,7 +1417,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomdictionary-getbykey HRESULT
// GetByKey( LPCWSTR key, IXpsOMShareable *beforeEntry, IXpsOMShareable **entry );
IXpsOMShareable GetByKey([In, MarshalAs(UnmanagedType.LPWStr)] string key, [In] IXpsOMShareable beforeEntry);
IXpsOMShareable GetByKey([In, MarshalAs(UnmanagedType.LPWStr)] string key, [In] IXpsOMShareable? beforeEntry);
/// <summary>Gets the index of an IXpsOMShareable interface from the dictionary.</summary>
/// <param name="entry">The IXpsOMShareable interface pointer to be found in the dictionary.</param>
@ -1556,7 +1559,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompart-getpartname HRESULT
// GetPartName( IOpcPartUri **partUri );
[MethodImpl(MethodImplOptions.InternalCall)]
new IOpcPartUri GetPartName();
new IOpcPartUri? GetPartName();
/// <summary>Sets the name that will be used when the part is serialized.</summary>
/// <param name="partUri">
@ -1578,7 +1581,7 @@ public static partial class XpsObjectModel
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomdocumentstructureresource-getowner
[MethodImpl(MethodImplOptions.InternalCall)]
IXpsOMDocument GetOwner();
IXpsOMDocument? GetOwner();
/// <summary>Gets a new, read-only copy of the stream that is associated with this resource.</summary>
/// <returns>A new, read-only copy of the stream that is associated with this resource.</returns>
@ -1633,7 +1636,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompart-getpartname HRESULT
// GetPartName( IOpcPartUri **partUri );
[MethodImpl(MethodImplOptions.InternalCall)]
new IOpcPartUri GetPartName();
new IOpcPartUri? GetPartName();
/// <summary>Sets the name that will be used when the part is serialized.</summary>
/// <param name="partUri">
@ -1836,7 +1839,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomfontresourcecollection-getbypartname
// HRESULT GetByPartName( IOpcPartUri *partName, IXpsOMFontResource **part );
[MethodImpl(MethodImplOptions.InternalCall)]
IXpsOMFontResource GetByPartName([In] IOpcPartUri partName);
IXpsOMFontResource? GetByPartName([In] IOpcPartUri partName);
}
/// <summary>Describes the shape of a path or of a clipping region.</summary>
@ -1923,7 +1926,7 @@ public static partial class XpsObjectModel
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomgeometry-gettransform HRESULT
// GetTransform( IXpsOMMatrixTransform **transform );
IXpsOMMatrixTransform GetTransform();
IXpsOMMatrixTransform? GetTransform();
/// <summary>
/// Gets a pointer to the IXpsOMMatrixTransform interface that contains the local, unshared matrix transform for the geometry.
@ -1955,7 +1958,7 @@ public static partial class XpsObjectModel
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomgeometry-gettransformlocal HRESULT
// GetTransformLocal( IXpsOMMatrixTransform **transform );
IXpsOMMatrixTransform GetTransformLocal();
IXpsOMMatrixTransform? GetTransformLocal();
/// <summary>Sets the local, unshared matrix transform.</summary>
/// <param name="transform">
@ -1998,7 +2001,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomgeometry-settransformlocal HRESULT
// SetTransformLocal( IXpsOMMatrixTransform *transform );
void SetTransformLocal([In] IXpsOMMatrixTransform transform);
void SetTransformLocal([In] IXpsOMMatrixTransform? transform);
/// <summary>
/// Gets the lookup key for the IXpsOMMatrixTransform interface that contains the resolved matrix transform for the geometry.
@ -2032,7 +2035,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomgeometry-gettransformlookup HRESULT
// GetTransformLookup( LPWSTR *lookup );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetTransformLookup();
string? GetTransformLookup();
/// <summary>Sets the lookup key name of a shared matrix transform in a resource dictionary.</summary>
/// <param name="lookup">The key name of the shared matrix transform in the resource dictionary.</param>
@ -2073,7 +2076,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomgeometry-settransformlookup HRESULT
// SetTransformLookup( LPCWSTR lookup );
void SetTransformLookup([In, MarshalAs(UnmanagedType.LPWStr)] string lookup);
void SetTransformLookup([In, MarshalAs(UnmanagedType.LPWStr)] string? lookup);
/// <summary>Makes a deep copy of the interface.</summary>
/// <returns>A pointer to the copy of the interface.</returns>
@ -2099,7 +2102,7 @@ public static partial class XpsObjectModel
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomgeometryfigure-getowner HRESULT
// GetOwner( IXpsOMGeometry **owner );
IXpsOMGeometry GetOwner();
IXpsOMGeometry? GetOwner();
/// <summary>Gets the segment data points for the geometry figure.</summary>
/// <param name="dataCount">
@ -2232,7 +2235,7 @@ public static partial class XpsObjectModel
/// <remarks>For an example of how to use this method in a program, see the code example in GetSegmentData.</remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomgeometryfigure-getsegmenttypes
// HRESULT GetSegmentTypes( UINT32 *segmentCount, XPS_SEGMENT_TYPE *segmentTypes );
void GetSegmentTypes([In, Out] ref uint segmentCount, [In, Out] XPS_SEGMENT_TYPE[] segmentTypes);
void GetSegmentTypes([In, Out] ref uint segmentCount, [In, Out] XPS_SEGMENT_TYPE[]? segmentTypes);
/// <summary>Gets stroke definitions for the figure's segments.</summary>
/// <param name="segmentCount">
@ -2276,7 +2279,7 @@ public static partial class XpsObjectModel
/// </param>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomgeometryfigure-getsegmentstrokes
// HRESULT GetSegmentStrokes( UINT32 *segmentCount, BOOL *segmentStrokes );
void GetSegmentStrokes([In, Out] ref uint segmentCount, [In, Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.Bool)] bool[] segmentStrokes);
void GetSegmentStrokes([In, Out] ref uint segmentCount, [In, Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.Bool)] bool[]? segmentStrokes);
/// <summary>Sets the segment information and data points for segments in the figure.</summary>
/// <param name="segmentCount">
@ -2672,7 +2675,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-gettransform HRESULT
// GetTransform( IXpsOMMatrixTransform **matrixTransform );
[MethodImpl(MethodImplOptions.InternalCall)]
new IXpsOMMatrixTransform GetTransform();
new IXpsOMMatrixTransform? GetTransform();
/// <summary>
/// Gets a pointer to the IXpsOMMatrixTransform interface that contains the local, unshared, resolved matrix transform for the visual.
@ -2705,7 +2708,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-gettransformlocal HRESULT
// GetTransformLocal( IXpsOMMatrixTransform **matrixTransform );
[MethodImpl(MethodImplOptions.InternalCall)]
new IXpsOMMatrixTransform GetTransformLocal();
new IXpsOMMatrixTransform? GetTransformLocal();
/// <summary>Sets the local, unshared matrix transform.</summary>
/// <param name="matrixTransform">
@ -2750,7 +2753,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-settransformlocal HRESULT
// SetTransformLocal( IXpsOMMatrixTransform *matrixTransform );
[MethodImpl(MethodImplOptions.InternalCall)]
new void SetTransformLocal([In] IXpsOMMatrixTransform matrixTransform);
new void SetTransformLocal([In] IXpsOMMatrixTransform? matrixTransform);
/// <summary>
/// Gets the lookup key name of the IXpsOMMatrixTransform interface in a resource dictionary that contains the resolved matrix
@ -2785,7 +2788,7 @@ public static partial class XpsObjectModel
// GetTransformLookup( LPWSTR *key );
[MethodImpl(MethodImplOptions.InternalCall)]
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetTransformLookup();
new string? GetTransformLookup();
/// <summary>Sets the lookup key name of a shared matrix transform in a resource dictionary.</summary>
/// <param name="key">The lookup key name of the matrix transform in the dictionary.</param>
@ -2828,7 +2831,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-settransformlookup HRESULT
// SetTransformLookup( LPCWSTR key );
[MethodImpl(MethodImplOptions.InternalCall)]
new void SetTransformLookup([In, MarshalAs(UnmanagedType.LPWStr)] string key);
new void SetTransformLookup([In, MarshalAs(UnmanagedType.LPWStr)] string? key);
/// <summary>
/// Gets a pointer to the IXpsOMGeometry interface that contains the resolved geometry of the visual's clipping region.
@ -2864,7 +2867,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-getclipgeometry HRESULT
// GetClipGeometry( IXpsOMGeometry **clipGeometry );
[MethodImpl(MethodImplOptions.InternalCall)]
new IXpsOMGeometry GetClipGeometry();
new IXpsOMGeometry? GetClipGeometry();
/// <summary>
/// Gets a pointer to the IXpsOMGeometry interface that contains the local, unshared geometry of the visual's clipping region.
@ -2896,7 +2899,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-getclipgeometrylocal HRESULT
// GetClipGeometryLocal( IXpsOMGeometry **clipGeometry );
[MethodImpl(MethodImplOptions.InternalCall)]
new IXpsOMGeometry GetClipGeometryLocal();
new IXpsOMGeometry? GetClipGeometryLocal();
/// <summary>Sets the local, unshared clipping region for the visual.</summary>
/// <param name="clipGeometry">
@ -2942,7 +2945,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-setclipgeometrylocal HRESULT
// SetClipGeometryLocal( IXpsOMGeometry *clipGeometry );
[MethodImpl(MethodImplOptions.InternalCall)]
new void SetClipGeometryLocal([In] IXpsOMGeometry clipGeometry);
new void SetClipGeometryLocal([In] IXpsOMGeometry? clipGeometry);
/// <summary>
/// Gets the lookup key for the IXpsOMGeometry interface in a resource dictionary that contains the visual's clipping region.
@ -2975,7 +2978,7 @@ public static partial class XpsObjectModel
// HRESULT GetClipGeometryLookup( LPWSTR *key );
[MethodImpl(MethodImplOptions.InternalCall)]
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetClipGeometryLookup();
new string? GetClipGeometryLookup();
/// <summary>Sets the lookup key name of a shared clip geometry in a resource dictionary.</summary>
/// <param name="key">
@ -3020,7 +3023,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-setclipgeometrylookup
// HRESULT SetClipGeometryLookup( LPCWSTR key );
[MethodImpl(MethodImplOptions.InternalCall)]
new void SetClipGeometryLookup([In, MarshalAs(UnmanagedType.LPWStr)] string key);
new void SetClipGeometryLookup([In, MarshalAs(UnmanagedType.LPWStr)] string? key);
/// <summary>Gets the opacity value of this visual.</summary>
/// <returns>The opacity value.</returns>
@ -3074,7 +3077,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-getopacitymaskbrush HRESULT
// GetOpacityMaskBrush( IXpsOMBrush **opacityMaskBrush );
[MethodImpl(MethodImplOptions.InternalCall)]
new IXpsOMBrush GetOpacityMaskBrush();
new IXpsOMBrush? GetOpacityMaskBrush();
/// <summary>Gets the local, unshared opacity mask brush for the visual.</summary>
/// <returns>
@ -3104,7 +3107,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-getopacitymaskbrushlocal
// HRESULT GetOpacityMaskBrushLocal( IXpsOMBrush **opacityMaskBrush );
[MethodImpl(MethodImplOptions.InternalCall)]
new IXpsOMBrush GetOpacityMaskBrushLocal();
new IXpsOMBrush? GetOpacityMaskBrushLocal();
/// <summary>Sets the IXpsOMBrush interface pointer as the local, unshared opacity mask brush.</summary>
/// <param name="opacityMaskBrush">
@ -3150,7 +3153,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-setopacitymaskbrushlocal
// HRESULT SetOpacityMaskBrushLocal( IXpsOMBrush *opacityMaskBrush );
[MethodImpl(MethodImplOptions.InternalCall)]
new void SetOpacityMaskBrushLocal([In] IXpsOMBrush opacityMaskBrush);
new void SetOpacityMaskBrushLocal([In] IXpsOMBrush? opacityMaskBrush);
/// <summary>Gets the name of the lookup key of the shared opacity mask brush in a resource dictionary.</summary>
/// <returns>
@ -3181,7 +3184,7 @@ public static partial class XpsObjectModel
// HRESULT GetOpacityMaskBrushLookup( LPWSTR *key );
[MethodImpl(MethodImplOptions.InternalCall)]
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetOpacityMaskBrushLookup();
new string? GetOpacityMaskBrushLookup();
/// <summary>Sets the lookup key name of a shared opacity mask brush in a resource dictionary.</summary>
/// <param name="key">
@ -3226,7 +3229,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-setopacitymaskbrushlookup
// HRESULT SetOpacityMaskBrushLookup( LPCWSTR key );
[MethodImpl(MethodImplOptions.InternalCall)]
new void SetOpacityMaskBrushLookup([In, MarshalAs(UnmanagedType.LPWStr)] string key);
new void SetOpacityMaskBrushLookup([In, MarshalAs(UnmanagedType.LPWStr)] string? key);
/// <summary>Gets the <c>Name</c> property of the visual.</summary>
/// <returns>The <c>Name</c> property string. If the <c>Name</c> property has not been set, a <c>NULL</c> pointer is returned.</returns>
@ -3234,7 +3237,7 @@ public static partial class XpsObjectModel
// LPWSTR *name );
[MethodImpl(MethodImplOptions.InternalCall)]
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetName();
new string? GetName();
/// <summary>Sets the <c>Name</c> property of the visual.</summary>
/// <param name="name">The name of the visual. A <c>NULL</c> pointer clears the <c>Name</c> property.</param>
@ -3247,7 +3250,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-setname HRESULT SetName(
// LPCWSTR name );
[MethodImpl(MethodImplOptions.InternalCall)]
new void SetName([In, MarshalAs(UnmanagedType.LPWStr)] string name);
new void SetName([In, MarshalAs(UnmanagedType.LPWStr)] string? name);
/// <summary>Gets a value that indicates whether the visual is the target of a hyperlink.</summary>
/// <returns>
@ -3305,7 +3308,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-gethyperlinknavigateuri
// HRESULT GetHyperlinkNavigateUri( IUri **hyperlinkUri );
[MethodImpl(MethodImplOptions.InternalCall)]
new IUri GetHyperlinkNavigateUri();
new IUri? GetHyperlinkNavigateUri();
/// <summary>Sets the destination URI of the visual's hyperlink.</summary>
/// <param name="hyperlinkUri">The IUri interface that contains the destination URI of the visual's hyperlink.</param>
@ -3316,7 +3319,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-sethyperlinknavigateuri
// HRESULT SetHyperlinkNavigateUri( IUri *hyperlinkUri );
[MethodImpl(MethodImplOptions.InternalCall)]
new void SetHyperlinkNavigateUri([In] IUri hyperlinkUri);
new void SetHyperlinkNavigateUri([In] IUri? hyperlinkUri);
/// <summary>Gets the <c>Language</c> property of the visual and of its contents.</summary>
/// <returns>
@ -3330,7 +3333,7 @@ public static partial class XpsObjectModel
// GetLanguage( LPWSTR *language );
[MethodImpl(MethodImplOptions.InternalCall)]
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetLanguage();
new string? GetLanguage();
/// <summary>Sets the <c>Language</c> property of the visual.</summary>
/// <param name="language">
@ -3343,14 +3346,14 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-setlanguage HRESULT
// SetLanguage( LPCWSTR language );
[MethodImpl(MethodImplOptions.InternalCall)]
new void SetLanguage([In, MarshalAs(UnmanagedType.LPWStr)] string language);
new void SetLanguage([In, MarshalAs(UnmanagedType.LPWStr)] string? language);
/// <summary>Gets the text in unescaped UTF-16 scalar values.</summary>
/// <returns>The UTF-16 Unicode string of the text to be displayed. If the string is empty, a <c>NULL</c> pointer is returned.</returns>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomglyphs-getunicodestring HRESULT
// GetUnicodeString( LPWSTR *unicodeString );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetUnicodeString();
string? GetUnicodeString();
/// <summary>Gets the number of Glyph indices.</summary>
/// <returns>The number of glyph indices.</returns>
@ -3433,7 +3436,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomglyphs-getprohibitedcaretstops
// HRESULT GetProhibitedCaretStops( UINT32 *prohibitedCaretStopCount, UINT32 *prohibitedCaretStops );
void GetProhibitedCaretStops(ref uint prohibitedCaretStopCount, [In, Out] uint[] prohibitedCaretStops);
void GetProhibitedCaretStops(ref uint prohibitedCaretStopCount, [In, Out] uint[]? prohibitedCaretStops);
/// <summary>Gets the level of bidirectional text.</summary>
/// <returns>
@ -3490,7 +3493,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomglyphs-getdevicefontname HRESULT
// GetDeviceFontName( LPWSTR *deviceFontName );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetDeviceFontName();
string? GetDeviceFontName();
/// <summary>Gets the style simulations that will be applied when rendering the glyphs.</summary>
/// <returns>The XPS_STYLE_SIMULATION value that describes the style simulations to be applied.</returns>
@ -3652,7 +3655,7 @@ public static partial class XpsObjectModel
/// <remarks>The fill brush is used to fill the shape of the rendered glyphs.</remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomglyphs-getfillbrush HRESULT
// GetFillBrush( IXpsOMBrush **fillBrush );
IXpsOMBrush GetFillBrush();
IXpsOMBrush? GetFillBrush();
/// <summary>Gets a pointer to the local, unshared IXpsOMBrush interface of the fill brush to be used for the text.</summary>
/// <returns>
@ -3681,7 +3684,7 @@ public static partial class XpsObjectModel
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomglyphs-getfillbrushlocal HRESULT
// GetFillBrushLocal( IXpsOMBrush **fillBrush );
IXpsOMBrush GetFillBrushLocal();
IXpsOMBrush? GetFillBrushLocal();
/// <summary>Sets the IXpsOMBrush interface pointer to a local, unshared fill brush.</summary>
/// <param name="fillBrush">
@ -3725,7 +3728,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomglyphs-setfillbrushlocal HRESULT
// SetFillBrushLocal( IXpsOMBrush *fillBrush );
void SetFillBrushLocal([In] IXpsOMBrush fillBrush);
void SetFillBrushLocal([In] IXpsOMBrush? fillBrush);
/// <summary>
/// Gets the lookup key of the IXpsOMBrush interface that is stored in a resource dictionary and will be used as the fill brush.
@ -3757,7 +3760,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomglyphs-getfillbrushlookup HRESULT
// GetFillBrushLookup( LPWSTR *key );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetFillBrushLookup();
string? GetFillBrushLookup();
/// <summary>Sets the lookup key name of a shared fill brush.</summary>
/// <param name="key">
@ -3802,7 +3805,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomglyphs-setfillbrushlookup HRESULT
// SetFillBrushLookup( LPCWSTR key );
void SetFillBrushLookup([In, MarshalAs(UnmanagedType.LPWStr)] string key);
void SetFillBrushLookup([In, MarshalAs(UnmanagedType.LPWStr)] string? key);
/// <summary>Gets a pointer to the IXpsOMGlyphsEditor interface that will be used to edit the glyphs in the object.</summary>
/// <returns>A pointer to the IXpsOMGlyphsEditor interface.</returns>
@ -3837,13 +3840,13 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomglyphseditor-getunicodestring
// HRESULT GetUnicodeString( LPWSTR *unicodeString );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetUnicodeString();
string? GetUnicodeString();
/// <summary>Sets the text in unescaped UTF-16 scalar values.</summary>
/// <param name="unicodeString">The address of a UTF-16 Unicode string. A <c>NULL</c> pointer clears the property.</param>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomglyphseditor-setunicodestring
// HRESULT SetUnicodeString( LPCWSTR unicodeString );
void SetUnicodeString([In, MarshalAs(UnmanagedType.LPWStr)] string unicodeString);
void SetUnicodeString([In, MarshalAs(UnmanagedType.LPWStr)] string? unicodeString);
/// <summary>Gets the number of glyph indices.</summary>
/// <returns>The glyph index count.</returns>
@ -3882,7 +3885,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomglyphseditor-setglyphindices
// HRESULT SetGlyphIndices( UINT32 indexCount, const XPS_GLYPH_INDEX *glyphIndices );
void SetGlyphIndices([In] uint indexCount, [In] XPS_GLYPH_INDEX[] glyphIndices);
void SetGlyphIndices([In] uint indexCount, [In] XPS_GLYPH_INDEX[]? glyphIndices);
/// <summary>Gets the number of glyph mappings.</summary>
/// <returns>The number of glyph mappings.</returns>
@ -3918,7 +3921,7 @@ public static partial class XpsObjectModel
/// </param>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomglyphseditor-setglyphmappings
// HRESULT SetGlyphMappings( UINT32 glyphMappingCount, const XPS_GLYPH_MAPPING *glyphMappings );
void SetGlyphMappings([In] uint glyphMappingCount, [In] XPS_GLYPH_MAPPING[] glyphMappings);
void SetGlyphMappings([In] uint glyphMappingCount, [In] XPS_GLYPH_MAPPING[]? glyphMappings);
/// <summary>Gets the number of prohibited caret stops.</summary>
/// <returns>The number of prohibited caret stops.</returns>
@ -3955,7 +3958,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomglyphseditor-getprohibitedcaretstops
// HRESULT GetProhibitedCaretStops( UINT32 *count, UINT32 *prohibitedCaretStops );
void GetProhibitedCaretStops(ref uint count, [In, Out] uint[] prohibitedCaretStops);
void GetProhibitedCaretStops(ref uint count, [In, Out] uint[]? prohibitedCaretStops);
/// <summary>Sets an array of prohibited caret stop locations.</summary>
/// <param name="count">
@ -3973,7 +3976,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomglyphseditor-setprohibitedcaretstops
// HRESULT SetProhibitedCaretStops( UINT32 count, const UINT32 *prohibitedCaretStops );
void SetProhibitedCaretStops([In] uint count, [In] uint[] prohibitedCaretStops);
void SetProhibitedCaretStops([In] uint count, [In] uint[]? prohibitedCaretStops);
/// <summary>Gets the bidirectional text level of the parent IXpsOMGlyphs interface.</summary>
/// <returns>
@ -4066,7 +4069,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomglyphseditor-getdevicefontname
// HRESULT GetDeviceFontName( LPWSTR *deviceFontName );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetDeviceFontName();
string? GetDeviceFontName();
/// <summary>Sets the name of the device font.</summary>
/// <param name="deviceFontName">
@ -4078,7 +4081,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomglyphseditor-setdevicefontname
// HRESULT SetDeviceFontName( LPCWSTR deviceFontName );
void SetDeviceFontName([In, MarshalAs(UnmanagedType.LPWStr)] string deviceFontName);
void SetDeviceFontName([In, MarshalAs(UnmanagedType.LPWStr)] string? deviceFontName);
}
/// <summary>
@ -4215,7 +4218,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomgradientbrush-gettransform HRESULT
// GetTransform( IXpsOMMatrixTransform **transform );
IXpsOMMatrixTransform GetTransform();
IXpsOMMatrixTransform? GetTransform();
/// <summary>
/// Gets a pointer to the IXpsOMMatrixTransform interface that contains the local, unshared, resolved matrix transform for the brush.
@ -4251,7 +4254,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomgradientbrush-gettransformlocal
// HRESULT GetTransformLocal( IXpsOMMatrixTransform **transform );
IXpsOMMatrixTransform GetTransformLocal();
IXpsOMMatrixTransform? GetTransformLocal();
/// <summary>
/// Sets the IXpsOMMatrixTransform interface pointer to a local, unshared matrix transform that is to be used for the brush.
@ -4301,7 +4304,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomgradientbrush-settransformlocal
// HRESULT SetTransformLocal( IXpsOMMatrixTransform *transform );
void SetTransformLocal([In] IXpsOMMatrixTransform transform);
void SetTransformLocal([In] IXpsOMMatrixTransform? transform);
/// <summary>
/// <para>Gets the name of the lookup key of the shared matrix transform interface that is to be used for the brush.</para>
@ -4347,7 +4350,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomgradientbrush-gettransformlookup
// HRESULT GetTransformLookup( LPWSTR *key );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetTransformLookup();
string? GetTransformLookup();
/// <summary>
/// <para>Sets the name of the lookup key of a shared matrix transform that is to be used for the brush.</para>
@ -4395,7 +4398,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomgradientbrush-settransformlookup
// HRESULT SetTransformLookup( LPCWSTR key );
void SetTransformLookup([In, MarshalAs(UnmanagedType.LPWStr)] string key);
void SetTransformLookup([In, MarshalAs(UnmanagedType.LPWStr)] string? key);
/// <summary>Gets the XPS_SPREAD_METHOD value, which describes how the area outside of the gradient region will be rendered.</summary>
/// <returns>
@ -4481,7 +4484,7 @@ public static partial class XpsObjectModel
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomgradientstop-getowner HRESULT
// GetOwner( IXpsOMGradientBrush **owner );
IXpsOMGradientBrush GetOwner();
IXpsOMGradientBrush? GetOwner();
/// <summary>Gets the offset value of the gradient stop.</summary>
/// <returns>The offset value of the gradient stop, expressed as a fraction of the gradient path.</returns>
@ -4511,7 +4514,7 @@ public static partial class XpsObjectModel
/// <remarks>A color profile is only returned when the color type of color is XPS_COLOR_TYPE_CONTEXT.</remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomgradientstop-getcolor HRESULT
// GetColor( XPS_COLOR *color, IXpsOMColorProfileResource **colorProfile );
IXpsOMColorProfileResource GetColor(out XPS_COLOR color);
IXpsOMColorProfileResource? GetColor(out XPS_COLOR color);
/// <summary>Sets the color value and color profile of the gradient stop.</summary>
/// <param name="color">
@ -4532,7 +4535,7 @@ public static partial class XpsObjectModel
/// <remarks>A color profile is only required when the color type of color is XPS_COLOR_TYPE_CONTEXT.</remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomgradientstop-setcolor HRESULT
// SetColor( const XPS_COLOR *color, IXpsOMColorProfileResource *colorProfile );
void SetColor(in XPS_COLOR color, [In] IXpsOMColorProfileResource colorProfile);
void SetColor(in XPS_COLOR color, [In] IXpsOMColorProfileResource? colorProfile);
/// <summary>Makes a deep copy of the IXpsOMGradientStop interface.</summary>
/// <returns>A pointer to the copy of the interface.</returns>
@ -4706,7 +4709,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomtilebrush-gettransform HRESULT
// GetTransform( IXpsOMMatrixTransform **transform );
new IXpsOMMatrixTransform GetTransform();
new IXpsOMMatrixTransform? GetTransform();
/// <summary>
/// Gets a pointer to the IXpsOMMatrixTransform interface that contains the local, unshared resolved matrix transform for the brush.
@ -4741,7 +4744,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomtilebrush-gettransformlocal HRESULT
// GetTransformLocal( IXpsOMMatrixTransform **transform );
new IXpsOMMatrixTransform GetTransformLocal();
new IXpsOMMatrixTransform? GetTransformLocal();
/// <summary>Sets the IXpsOMMatrixTransform interface pointer to a local, unshared matrix transform.</summary>
/// <param name="transform">
@ -4789,7 +4792,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomtilebrush-settransformlocal HRESULT
// SetTransformLocal( IXpsOMMatrixTransform *transform );
new void SetTransformLocal([In] IXpsOMMatrixTransform transform);
new void SetTransformLocal([In] IXpsOMMatrixTransform? transform);
/// <summary>
/// Gets the lookup key that identifies the IXpsOMMatrixTransform interface in a resource dictionary that contains the resolved
@ -4829,7 +4832,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomtilebrush-gettransformlookup
// HRESULT GetTransformLookup( LPWSTR *key );
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetTransformLookup();
new string? GetTransformLookup();
/// <summary>
/// Sets the lookup key name of a shared matrix transform that will be used as the transform for this brush.The shared matrix
@ -4881,7 +4884,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomtilebrush-settransformlookup
// HRESULT SetTransformLookup( LPCWSTR key );
new void SetTransformLookup([In, MarshalAs(UnmanagedType.LPWStr)] string key);
new void SetTransformLookup([In, MarshalAs(UnmanagedType.LPWStr)] string? key);
/// <summary>Gets the portion of the source image to be used by the tile.</summary>
/// <returns>The XPS_RECT structure that describes the area of the source content to be used by the tile.</returns>
@ -4988,7 +4991,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomimagebrush-getimageresource HRESULT
// GetImageResource( IXpsOMImageResource **imageResource );
IXpsOMImageResource GetImageResource();
IXpsOMImageResource? GetImageResource();
/// <summary>
/// Sets a pointer to the IXpsOMImageResource interface that contains the image resource to be used as the source for the brush.
@ -4999,7 +5002,7 @@ public static partial class XpsObjectModel
/// <remarks>The image resource must be of type JPEG, PNG, TIFF 6.0, or HD Photo.</remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomimagebrush-setimageresource HRESULT
// SetImageResource( IXpsOMImageResource *imageResource );
void SetImageResource([In] IXpsOMImageResource imageResource);
void SetImageResource([In] IXpsOMImageResource? imageResource);
/// <summary>
/// Gets a pointer to the IXpsOMColorProfileResource interface, which contains the color profile resource that is associated
@ -5015,7 +5018,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomimagebrush-getcolorprofileresource
// HRESULT GetColorProfileResource( IXpsOMColorProfileResource **colorProfileResource );
IXpsOMColorProfileResource GetColorProfileResource();
IXpsOMColorProfileResource? GetColorProfileResource();
/// <summary>
/// Sets a pointer to the IXpsOMColorProfileResource interface, which contains the color profile resource that is associated
@ -5027,7 +5030,7 @@ public static partial class XpsObjectModel
/// </param>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomimagebrush-setcolorprofileresource
// HRESULT SetColorProfileResource( IXpsOMColorProfileResource *colorProfileResource );
void SetColorProfileResource([In] IXpsOMColorProfileResource colorProfileResource);
void SetColorProfileResource([In] IXpsOMColorProfileResource? colorProfileResource);
/// <summary>Makes a deep copy of the interface.</summary>
/// <returns>A pointer to the copy of the interface.</returns>
@ -5052,7 +5055,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompart-getpartname HRESULT
// GetPartName( IOpcPartUri **partUri );
[MethodImpl(MethodImplOptions.InternalCall)]
new IOpcPartUri GetPartName();
new IOpcPartUri? GetPartName();
/// <summary>Sets the name that will be used when the part is serialized.</summary>
/// <param name="partUri">
@ -5065,7 +5068,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompart-setpartname HRESULT
// SetPartName( IOpcPartUri *partUri );
[MethodImpl(MethodImplOptions.InternalCall)]
new void SetPartName([In] IOpcPartUri partUri);
new void SetPartName([In] IOpcPartUri? partUri);
/// <summary>Gets a new, read-only copy of the stream that is associated with this resource.</summary>
/// <returns>A new, read-only copy of the stream that is associated with this resource.</returns>
@ -5160,4 +5163,38 @@ public static partial class XpsObjectModel
/// <summary>A non-negative value that represents the object's size in the vertical (y) dimension.</summary>
public float height;
}
/// <summary>Wrapper for all IXpsXXXCollection interfaces. This class is used to wrap the collection interfaces.</summary>
/// <typeparam name="T">The element type.</typeparam>
public class XpsList<T> : VirtualList<T>
{
/// <summary>Initializes a new instance of the <see cref="XpsList{T}"/> class.</summary>
/// <param name="collection">The collection.</param>
public XpsList(object collection) : base(new Impl(collection))
{
}
private class Impl : IVirtualListMethods<T>
{
private readonly object collection;
public Impl(object collection) => this.collection = collection;
bool IVirtualReadOnlyListMethods<T>.TryGet(int index, [NotNullWhen(true)] out T? value)
{
value = collection.InvokeMethod<T>("GetAt", (uint)index);
return value is not null;
}
void IVirtualListMethods<T>.SetItemAt(int index, T value) => collection.InvokeMethod("SetAt", (uint)index, value);
int IVirtualReadOnlyListMethods<T>.GetItemCount() => (int)collection.InvokeMethod<uint>("GetCount");
void IVirtualListMethods<T>.AddItem(T item) => collection.InvokeMethod("Append", item);
void IVirtualListMethods<T>.InsertItemAt(int index, T item) => collection.InvokeMethod("InsertAt", (uint)index, item);
void IVirtualListMethods<T>.RemoveItemAt(int index) => collection.InvokeMethod("RemoveAt", (uint)index);
}
}
}

View File

@ -98,7 +98,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomimageresourcecollection-getbypartname
// HRESULT GetByPartName( IOpcPartUri *partName, IXpsOMImageResource **part );
[MethodImpl(MethodImplOptions.InternalCall)]
IXpsOMImageResource GetByPartName([In] IOpcPartUri partName);
IXpsOMImageResource? GetByPartName([In] IOpcPartUri partName);
}
/// <summary>Specifies a linear gradient, which is the color gradient along a vector.</summary>
@ -214,7 +214,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomgradientbrush-gettransform HRESULT
// GetTransform( IXpsOMMatrixTransform **transform );
new IXpsOMMatrixTransform GetTransform();
new IXpsOMMatrixTransform? GetTransform();
/// <summary>
/// Gets a pointer to the IXpsOMMatrixTransform interface that contains the local, unshared, resolved matrix transform for the brush.
@ -250,7 +250,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomgradientbrush-gettransformlocal
// HRESULT GetTransformLocal( IXpsOMMatrixTransform **transform );
new IXpsOMMatrixTransform GetTransformLocal();
new IXpsOMMatrixTransform? GetTransformLocal();
/// <summary>
/// Sets the IXpsOMMatrixTransform interface pointer to a local, unshared matrix transform that is to be used for the brush.
@ -300,7 +300,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomgradientbrush-settransformlocal
// HRESULT SetTransformLocal( IXpsOMMatrixTransform *transform );
new void SetTransformLocal([In] IXpsOMMatrixTransform transform);
new void SetTransformLocal([In] IXpsOMMatrixTransform? transform);
/// <summary>
/// <para>Gets the name of the lookup key of the shared matrix transform interface that is to be used for the brush.</para>
@ -346,7 +346,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomgradientbrush-gettransformlookup
// HRESULT GetTransformLookup( LPWSTR *key );
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetTransformLookup();
new string? GetTransformLookup();
/// <summary>
/// <para>Sets the name of the lookup key of a shared matrix transform that is to be used for the brush.</para>
@ -394,7 +394,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomgradientbrush-settransformlookup
// HRESULT SetTransformLookup( LPCWSTR key );
new void SetTransformLookup([In, MarshalAs(UnmanagedType.LPWStr)] string key);
new void SetTransformLookup([In, MarshalAs(UnmanagedType.LPWStr)] string? key);
/// <summary>Gets the XPS_SPREAD_METHOD value, which describes how the area outside of the gradient region will be rendered.</summary>
/// <returns>
@ -531,7 +531,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomnamecollection-getat HRESULT GetAt(
// UINT32 index, LPWSTR *name );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetAt([In] uint index);
string? GetAt([In] uint index);
}
/// <summary>Describes a non-text visual item.</summary>
@ -586,7 +586,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-gettransform HRESULT
// GetTransform( IXpsOMMatrixTransform **matrixTransform );
[MethodImpl(MethodImplOptions.InternalCall)]
new IXpsOMMatrixTransform GetTransform();
new IXpsOMMatrixTransform? GetTransform();
/// <summary>
/// Gets a pointer to the IXpsOMMatrixTransform interface that contains the local, unshared, resolved matrix transform for the visual.
@ -619,7 +619,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-gettransformlocal HRESULT
// GetTransformLocal( IXpsOMMatrixTransform **matrixTransform );
[MethodImpl(MethodImplOptions.InternalCall)]
new IXpsOMMatrixTransform GetTransformLocal();
new IXpsOMMatrixTransform? GetTransformLocal();
/// <summary>Sets the local, unshared matrix transform.</summary>
/// <param name="matrixTransform">
@ -664,7 +664,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-settransformlocal HRESULT
// SetTransformLocal( IXpsOMMatrixTransform *matrixTransform );
[MethodImpl(MethodImplOptions.InternalCall)]
new void SetTransformLocal([In] IXpsOMMatrixTransform matrixTransform);
new void SetTransformLocal([In] IXpsOMMatrixTransform? matrixTransform);
/// <summary>
/// Gets the lookup key name of the IXpsOMMatrixTransform interface in a resource dictionary that contains the resolved matrix
@ -699,7 +699,7 @@ public static partial class XpsObjectModel
// GetTransformLookup( LPWSTR *key );
[MethodImpl(MethodImplOptions.InternalCall)]
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetTransformLookup();
new string? GetTransformLookup();
/// <summary>Sets the lookup key name of a shared matrix transform in a resource dictionary.</summary>
/// <param name="key">The lookup key name of the matrix transform in the dictionary.</param>
@ -742,7 +742,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-settransformlookup HRESULT
// SetTransformLookup( LPCWSTR key );
[MethodImpl(MethodImplOptions.InternalCall)]
new void SetTransformLookup([In, MarshalAs(UnmanagedType.LPWStr)] string key);
new void SetTransformLookup([In, MarshalAs(UnmanagedType.LPWStr)] string? key);
/// <summary>
/// Gets a pointer to the IXpsOMGeometry interface that contains the resolved geometry of the visual's clipping region.
@ -778,7 +778,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-getclipgeometry HRESULT
// GetClipGeometry( IXpsOMGeometry **clipGeometry );
[MethodImpl(MethodImplOptions.InternalCall)]
new IXpsOMGeometry GetClipGeometry();
new IXpsOMGeometry? GetClipGeometry();
/// <summary>
/// Gets a pointer to the IXpsOMGeometry interface that contains the local, unshared geometry of the visual's clipping region.
@ -810,7 +810,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-getclipgeometrylocal HRESULT
// GetClipGeometryLocal( IXpsOMGeometry **clipGeometry );
[MethodImpl(MethodImplOptions.InternalCall)]
new IXpsOMGeometry GetClipGeometryLocal();
new IXpsOMGeometry? GetClipGeometryLocal();
/// <summary>Sets the local, unshared clipping region for the visual.</summary>
/// <param name="clipGeometry">
@ -856,7 +856,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-setclipgeometrylocal HRESULT
// SetClipGeometryLocal( IXpsOMGeometry *clipGeometry );
[MethodImpl(MethodImplOptions.InternalCall)]
new void SetClipGeometryLocal([In] IXpsOMGeometry clipGeometry);
new void SetClipGeometryLocal([In] IXpsOMGeometry? clipGeometry);
/// <summary>
/// Gets the lookup key for the IXpsOMGeometry interface in a resource dictionary that contains the visual's clipping region.
@ -889,7 +889,7 @@ public static partial class XpsObjectModel
// HRESULT GetClipGeometryLookup( LPWSTR *key );
[MethodImpl(MethodImplOptions.InternalCall)]
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetClipGeometryLookup();
new string? GetClipGeometryLookup();
/// <summary>Sets the lookup key name of a shared clip geometry in a resource dictionary.</summary>
/// <param name="key">
@ -934,7 +934,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-setclipgeometrylookup
// HRESULT SetClipGeometryLookup( LPCWSTR key );
[MethodImpl(MethodImplOptions.InternalCall)]
new void SetClipGeometryLookup([In, MarshalAs(UnmanagedType.LPWStr)] string key);
new void SetClipGeometryLookup([In, MarshalAs(UnmanagedType.LPWStr)] string? key);
/// <summary>Gets the opacity value of this visual.</summary>
/// <returns>The opacity value.</returns>
@ -988,7 +988,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-getopacitymaskbrush HRESULT
// GetOpacityMaskBrush( IXpsOMBrush **opacityMaskBrush );
[MethodImpl(MethodImplOptions.InternalCall)]
new IXpsOMBrush GetOpacityMaskBrush();
new IXpsOMBrush? GetOpacityMaskBrush();
/// <summary>Gets the local, unshared opacity mask brush for the visual.</summary>
/// <returns>
@ -1018,7 +1018,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-getopacitymaskbrushlocal
// HRESULT GetOpacityMaskBrushLocal( IXpsOMBrush **opacityMaskBrush );
[MethodImpl(MethodImplOptions.InternalCall)]
new IXpsOMBrush GetOpacityMaskBrushLocal();
new IXpsOMBrush? GetOpacityMaskBrushLocal();
/// <summary>Sets the IXpsOMBrush interface pointer as the local, unshared opacity mask brush.</summary>
/// <param name="opacityMaskBrush">
@ -1064,7 +1064,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-setopacitymaskbrushlocal
// HRESULT SetOpacityMaskBrushLocal( IXpsOMBrush *opacityMaskBrush );
[MethodImpl(MethodImplOptions.InternalCall)]
new void SetOpacityMaskBrushLocal([In] IXpsOMBrush opacityMaskBrush);
new void SetOpacityMaskBrushLocal([In] IXpsOMBrush? opacityMaskBrush);
/// <summary>Gets the name of the lookup key of the shared opacity mask brush in a resource dictionary.</summary>
/// <returns>
@ -1095,7 +1095,7 @@ public static partial class XpsObjectModel
// HRESULT GetOpacityMaskBrushLookup( LPWSTR *key );
[MethodImpl(MethodImplOptions.InternalCall)]
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetOpacityMaskBrushLookup();
new string? GetOpacityMaskBrushLookup();
/// <summary>Sets the lookup key name of a shared opacity mask brush in a resource dictionary.</summary>
/// <param name="key">
@ -1140,7 +1140,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-setopacitymaskbrushlookup
// HRESULT SetOpacityMaskBrushLookup( LPCWSTR key );
[MethodImpl(MethodImplOptions.InternalCall)]
new void SetOpacityMaskBrushLookup([In, MarshalAs(UnmanagedType.LPWStr)] string key);
new void SetOpacityMaskBrushLookup([In, MarshalAs(UnmanagedType.LPWStr)] string? key);
/// <summary>Gets the <c>Name</c> property of the visual.</summary>
/// <returns>The <c>Name</c> property string. If the <c>Name</c> property has not been set, a <c>NULL</c> pointer is returned.</returns>
@ -1148,7 +1148,7 @@ public static partial class XpsObjectModel
// LPWSTR *name );
[MethodImpl(MethodImplOptions.InternalCall)]
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetName();
new string? GetName();
/// <summary>Sets the <c>Name</c> property of the visual.</summary>
/// <param name="name">The name of the visual. A <c>NULL</c> pointer clears the <c>Name</c> property.</param>
@ -1161,7 +1161,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-setname HRESULT SetName(
// LPCWSTR name );
[MethodImpl(MethodImplOptions.InternalCall)]
new void SetName([In, MarshalAs(UnmanagedType.LPWStr)] string name);
new void SetName([In, MarshalAs(UnmanagedType.LPWStr)] string? name);
/// <summary>Gets a value that indicates whether the visual is the target of a hyperlink.</summary>
/// <returns>
@ -1219,7 +1219,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-gethyperlinknavigateuri
// HRESULT GetHyperlinkNavigateUri( IUri **hyperlinkUri );
[MethodImpl(MethodImplOptions.InternalCall)]
new IUri GetHyperlinkNavigateUri();
new IUri? GetHyperlinkNavigateUri();
/// <summary>Sets the destination URI of the visual's hyperlink.</summary>
/// <param name="hyperlinkUri">The IUri interface that contains the destination URI of the visual's hyperlink.</param>
@ -1244,7 +1244,7 @@ public static partial class XpsObjectModel
// GetLanguage( LPWSTR *language );
[MethodImpl(MethodImplOptions.InternalCall)]
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetLanguage();
new string? GetLanguage();
/// <summary>Sets the <c>Language</c> property of the visual.</summary>
/// <param name="language">
@ -1257,7 +1257,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-setlanguage HRESULT
// SetLanguage( LPCWSTR language );
[MethodImpl(MethodImplOptions.InternalCall)]
new void SetLanguage([In, MarshalAs(UnmanagedType.LPWStr)] string language);
new void SetLanguage([In, MarshalAs(UnmanagedType.LPWStr)] string? language);
/// <summary>Gets a pointer to the path's IXpsOMGeometry interface, which describes the resolved fill area for this path.</summary>
/// <returns>
@ -1289,7 +1289,7 @@ public static partial class XpsObjectModel
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompath-getgeometry HRESULT
// GetGeometry( IXpsOMGeometry **geometry );
IXpsOMGeometry GetGeometry();
IXpsOMGeometry? GetGeometry();
/// <summary>Gets the local, unshared geometry of the resolved fill area for this path.</summary>
/// <returns>
@ -1318,7 +1318,7 @@ public static partial class XpsObjectModel
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompath-getgeometrylocal HRESULT
// GetGeometryLocal( IXpsOMGeometry **geometry );
IXpsOMGeometry GetGeometryLocal();
IXpsOMGeometry? GetGeometryLocal();
/// <summary>
/// Sets the pointer to the local, unshared IXpsOMGeometry interface that contains the geometry of the resolved fill area to be
@ -1365,7 +1365,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompath-setgeometrylocal HRESULT
// SetGeometryLocal( IXpsOMGeometry *geometry );
void SetGeometryLocal([In] IXpsOMGeometry geometry);
void SetGeometryLocal([In] IXpsOMGeometry? geometry);
/// <summary>
/// Gets the lookup key of a shared geometry object that is stored in a resource dictionary and that describes the resolved fill
@ -1398,7 +1398,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompath-getgeometrylookup HRESULT
// GetGeometryLookup( LPWSTR *lookup );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetGeometryLookup();
string? GetGeometryLookup();
/// <summary>
/// <para>Sets the lookup key name of a shared geometry in a resource dictionary.</para>
@ -1441,7 +1441,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompath-setgeometrylookup HRESULT
// SetGeometryLookup( LPCWSTR lookup );
void SetGeometryLookup([In, MarshalAs(UnmanagedType.LPWStr)] string lookup);
void SetGeometryLookup([In, MarshalAs(UnmanagedType.LPWStr)] string? lookup);
/// <summary>
/// Gets the short textual description of the object's contents. This description is used by accessibility clients to describe
@ -1459,7 +1459,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompath-getaccessibilityshortdescription
// HRESULT GetAccessibilityShortDescription( LPWSTR *shortDescription );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetAccessibilityShortDescription();
string? GetAccessibilityShortDescription();
/// <summary>
/// Sets the short textual description of the object's contents. This description is used by accessibility clients to describe
@ -1490,7 +1490,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompath-getaccessibilitylongdescription
// HRESULT GetAccessibilityLongDescription( LPWSTR *longDescription );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetAccessibilityLongDescription();
string? GetAccessibilityLongDescription();
/// <summary>
/// Sets the long (detailed) textual description of the object's contents. This description is used by accessibility clients to
@ -1590,7 +1590,7 @@ public static partial class XpsObjectModel
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompath-getstrokebrush HRESULT
// GetStrokeBrush( IXpsOMBrush **brush );
IXpsOMBrush GetStrokeBrush();
IXpsOMBrush? GetStrokeBrush();
/// <summary>Gets a pointer to the local, unshared IXpsOMBrush interface that contains the stroke brush for the path.</summary>
/// <returns>
@ -1619,7 +1619,7 @@ public static partial class XpsObjectModel
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompath-getstrokebrushlocal HRESULT
// GetStrokeBrushLocal( IXpsOMBrush **brush );
IXpsOMBrush GetStrokeBrushLocal();
IXpsOMBrush? GetStrokeBrushLocal();
/// <summary>Sets a pointer to a local, unshared IXpsOMBrush interface to be used as a stroke brush.</summary>
/// <param name="brush">A pointer to a local, unshared IXpsOMBrush interface to be used as a stroke brush.</param>
@ -1660,7 +1660,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompath-setstrokebrushlocal HRESULT
// SetStrokeBrushLocal( IXpsOMBrush *brush );
void SetStrokeBrushLocal([In] IXpsOMBrush brush);
void SetStrokeBrushLocal([In] IXpsOMBrush? brush);
/// <summary>
/// Gets the lookup key of the brush that is stored in a resource dictionary and is to be used as the stroke brush for the path.
@ -1692,7 +1692,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompath-getstrokebrushlookup HRESULT
// GetStrokeBrushLookup( LPWSTR *lookup );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetStrokeBrushLookup();
string? GetStrokeBrushLookup();
/// <summary>
/// Sets the lookup key name of a shared brush to be used as the stroke brush.The shared brush is stored in a resource dictionary.
@ -1734,7 +1734,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompath-setstrokebrushlookup HRESULT
// SetStrokeBrushLookup( LPCWSTR lookup );
void SetStrokeBrushLookup([In, MarshalAs(UnmanagedType.LPWStr)] string lookup);
void SetStrokeBrushLookup([In, MarshalAs(UnmanagedType.LPWStr)] string? lookup);
/// <summary>
/// Gets a pointer to the IXpsOMDashCollection interface that contains the XPS_DASH structures that define the dash pattern of
@ -1905,7 +1905,7 @@ public static partial class XpsObjectModel
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompath-getfillbrush HRESULT
// GetFillBrush( IXpsOMBrush **brush );
IXpsOMBrush GetFillBrush();
IXpsOMBrush? GetFillBrush();
/// <summary>Gets a pointer to the local, unshared IXpsOMBrush interface that contains the fill brush for the path.</summary>
/// <returns>
@ -1935,7 +1935,7 @@ public static partial class XpsObjectModel
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompath-getfillbrushlocal HRESULT
// GetFillBrushLocal( IXpsOMBrush **brush );
IXpsOMBrush GetFillBrushLocal();
IXpsOMBrush? GetFillBrushLocal();
/// <summary>Sets the pointer to the local, unshared IXpsOMBrush interface to be used as the fill brush.</summary>
/// <param name="brush">A pointer to the local, unshared IXpsOMBrush interface to be used as the fill brush.</param>
@ -1976,7 +1976,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompath-setfillbrushlocal HRESULT
// SetFillBrushLocal( IXpsOMBrush *brush );
void SetFillBrushLocal([In] IXpsOMBrush brush);
void SetFillBrushLocal([In] IXpsOMBrush? brush);
/// <summary>
/// Gets the lookup key of the brush that is stored in a resource dictionary and used as the fill brush for the path.
@ -2008,7 +2008,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompath-getfillbrushlookup HRESULT
// GetFillBrushLookup( LPWSTR *lookup );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetFillBrushLookup();
string? GetFillBrushLookup();
/// <summary>Sets the lookup key name of a shared brush in a resource dictionary, to be used as the fill brush.</summary>
/// <param name="lookup">The key name of the brush in a resource dictionary, to be used as the fill brush.</param>
@ -2048,7 +2048,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompath-setfillbrushlookup HRESULT
// SetFillBrushLookup( LPCWSTR lookup );
void SetFillBrushLookup([In, MarshalAs(UnmanagedType.LPWStr)] string lookup);
void SetFillBrushLookup([In, MarshalAs(UnmanagedType.LPWStr)] string? lookup);
/// <summary>Makes a deep copy of the interface.</summary>
/// <returns>A pointer to the copy of the interface.</returns>
@ -2071,7 +2071,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompart-getpartname HRESULT
// GetPartName( IOpcPartUri **partUri );
[MethodImpl(MethodImplOptions.InternalCall)]
new IOpcPartUri GetPartName();
new IOpcPartUri? GetPartName();
/// <summary>Sets the name that will be used when the part is serialized.</summary>
/// <param name="partUri">
@ -2084,7 +2084,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompart-setpartname HRESULT
// SetPartName( IOpcPartUri *partUri );
[MethodImpl(MethodImplOptions.InternalCall)]
new void SetPartName([In] IOpcPartUri partUri);
new void SetPartName([In] IOpcPartUri? partUri);
/// <summary>Gets a new, read-only copy of the stream that is associated with this resource.</summary>
/// <returns>A new, read-only copy of the stream that is associated with this resource.</returns>
@ -2228,7 +2228,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomgradientbrush-gettransform HRESULT
// GetTransform( IXpsOMMatrixTransform **transform );
new IXpsOMMatrixTransform GetTransform();
new IXpsOMMatrixTransform? GetTransform();
/// <summary>
/// Gets a pointer to the IXpsOMMatrixTransform interface that contains the local, unshared, resolved matrix transform for the brush.
@ -2264,7 +2264,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomgradientbrush-gettransformlocal
// HRESULT GetTransformLocal( IXpsOMMatrixTransform **transform );
new IXpsOMMatrixTransform GetTransformLocal();
new IXpsOMMatrixTransform? GetTransformLocal();
/// <summary>
/// Sets the IXpsOMMatrixTransform interface pointer to a local, unshared matrix transform that is to be used for the brush.
@ -2314,7 +2314,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomgradientbrush-settransformlocal
// HRESULT SetTransformLocal( IXpsOMMatrixTransform *transform );
new void SetTransformLocal([In] IXpsOMMatrixTransform transform);
new void SetTransformLocal([In] IXpsOMMatrixTransform? transform);
/// <summary>
/// <para>Gets the name of the lookup key of the shared matrix transform interface that is to be used for the brush.</para>
@ -2360,7 +2360,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomgradientbrush-gettransformlookup
// HRESULT GetTransformLookup( LPWSTR *key );
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetTransformLookup();
new string? GetTransformLookup();
/// <summary>
/// <para>Sets the name of the lookup key of a shared matrix transform that is to be used for the brush.</para>
@ -2408,7 +2408,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomgradientbrush-settransformlookup
// HRESULT SetTransformLookup( LPCWSTR key );
new void SetTransformLookup([In, MarshalAs(UnmanagedType.LPWStr)] string key);
new void SetTransformLookup([In, MarshalAs(UnmanagedType.LPWStr)] string? key);
/// <summary>Gets the XPS_SPREAD_METHOD value, which describes how the area outside of the gradient region will be rendered.</summary>
/// <returns>
@ -2587,7 +2587,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompart-getpartname HRESULT
// GetPartName( IOpcPartUri **partUri );
[MethodImpl(MethodImplOptions.InternalCall)]
new IOpcPartUri GetPartName();
new IOpcPartUri? GetPartName();
/// <summary>Sets the name that will be used when the part is serialized.</summary>
/// <param name="partUri">
@ -2600,7 +2600,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompart-setpartname HRESULT
// SetPartName( IOpcPartUri *partUri );
[MethodImpl(MethodImplOptions.InternalCall)]
new void SetPartName([In] IOpcPartUri partUri);
new void SetPartName([In] IOpcPartUri? partUri);
/// <summary>Gets a pointer to the IXpsOMDictionary interface of the remote dictionary that is associated with this resource.</summary>
/// <returns>A pointer to the IXpsOMDictionary interface of the dictionary that is associated with this resource.</returns>
@ -2711,7 +2711,7 @@ public static partial class XpsObjectModel
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomremotedictionaryresourcecollection-getbypartname
// HRESULT GetByPartName( IOpcPartUri *partName, IXpsOMRemoteDictionaryResource **remoteDictionaryResource );
IXpsOMRemoteDictionaryResource GetByPartName([In] IOpcPartUri partName);
IXpsOMRemoteDictionaryResource? GetByPartName([In] IOpcPartUri partName);
}
/// <summary>Used as the base interface for the resource interfaces of the XPS object model.</summary>
@ -2728,7 +2728,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompart-getpartname HRESULT
// GetPartName( IOpcPartUri **partUri );
[MethodImpl(MethodImplOptions.InternalCall)]
new IOpcPartUri GetPartName();
new IOpcPartUri? GetPartName();
/// <summary>Sets the name that will be used when the part is serialized.</summary>
/// <param name="partUri">
@ -2741,7 +2741,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompart-setpartname HRESULT
// SetPartName( IOpcPartUri *partUri );
[MethodImpl(MethodImplOptions.InternalCall)]
new void SetPartName([In] IOpcPartUri partUri);
new void SetPartName([In] IOpcPartUri? partUri);
}
/// <summary>The base interface for sharable interfaces.</summary>
@ -2778,7 +2778,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompart-getpartname HRESULT
// GetPartName( IOpcPartUri **partUri );
[MethodImpl(MethodImplOptions.InternalCall)]
new IOpcPartUri GetPartName();
new IOpcPartUri? GetPartName();
/// <summary>Sets the name that will be used when the part is serialized.</summary>
/// <param name="partUri">
@ -2791,7 +2791,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompart-setpartname HRESULT
// SetPartName( IOpcPartUri *partUri );
[MethodImpl(MethodImplOptions.InternalCall)]
new void SetPartName([In] IOpcPartUri partUri);
new void SetPartName([In] IOpcPartUri? partUri);
/// <summary>Gets a pointer to the IXpsOMDocument interface that contains the resource.</summary>
/// <returns>
@ -2801,7 +2801,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomsignatureblockresource-getowner
// HRESULT GetOwner( IXpsOMDocument **owner );
[MethodImpl(MethodImplOptions.InternalCall)]
IXpsOMDocument GetOwner();
IXpsOMDocument? GetOwner();
/// <summary>Gets a new, read-only copy of the stream that is associated with this resource.</summary>
/// <returns>A new, read-only copy of the stream that is associated with this resource.</returns>
@ -2931,7 +2931,7 @@ public static partial class XpsObjectModel
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomsignatureblockresourcecollection-getbypartname
// HRESULT GetByPartName( IOpcPartUri *partName, IXpsOMSignatureBlockResource **signatureBlockResource );
IXpsOMSignatureBlockResource GetByPartName([In] IOpcPartUri partName);
IXpsOMSignatureBlockResource? GetByPartName([In] IOpcPartUri partName);
}
/// <summary>A single-color brush.</summary>
@ -2985,7 +2985,7 @@ public static partial class XpsObjectModel
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomsolidcolorbrush-getcolor HRESULT
// GetColor( XPS_COLOR *color, IXpsOMColorProfileResource **colorProfile );
IXpsOMColorProfileResource GetColor(out XPS_COLOR color);
IXpsOMColorProfileResource? GetColor(out XPS_COLOR color);
/// <summary>Sets the color value and color profile of the brush.</summary>
/// <param name="color">
@ -3005,7 +3005,7 @@ public static partial class XpsObjectModel
/// </param>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomsolidcolorbrush-setcolor HRESULT
// SetColor( const XPS_COLOR *color, IXpsOMColorProfileResource *colorProfile );
void SetColor(in XPS_COLOR color, [In] IXpsOMColorProfileResource colorProfile);
void SetColor(in XPS_COLOR color, [In] IXpsOMColorProfileResource? colorProfile);
/// <summary>Makes a deep copy of the interface.</summary>
/// <returns>A pointer to the copy of the interface.</returns>
@ -3037,7 +3037,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompart-getpartname HRESULT
// GetPartName( IOpcPartUri **partUri );
[MethodImpl(MethodImplOptions.InternalCall)]
new IOpcPartUri GetPartName();
new IOpcPartUri? GetPartName();
/// <summary>Sets the name that will be used when the part is serialized.</summary>
/// <param name="partUri">
@ -3050,7 +3050,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompart-setpartname HRESULT
// SetPartName( IOpcPartUri *partUri );
[MethodImpl(MethodImplOptions.InternalCall)]
new void SetPartName([In] IOpcPartUri partUri);
new void SetPartName([In] IOpcPartUri? partUri);
/// <summary>Gets a pointer to the IXpsOMPage interface that contains this resource.</summary>
/// <returns>
@ -3060,7 +3060,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomstoryfragmentsresource-getowner
// HRESULT GetOwner( IXpsOMPageReference **owner );
[MethodImpl(MethodImplOptions.InternalCall)]
IXpsOMPageReference GetOwner();
IXpsOMPageReference? GetOwner();
/// <summary>Gets a new, read-only copy of the stream that is associated with this resource.</summary>
/// <returns>A new, read-only copy of the stream that is associated with this resource.</returns>
@ -3231,7 +3231,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomtilebrush-gettransform HRESULT
// GetTransform( IXpsOMMatrixTransform **transform );
IXpsOMMatrixTransform GetTransform();
IXpsOMMatrixTransform? GetTransform();
/// <summary>
/// Gets a pointer to the IXpsOMMatrixTransform interface that contains the local, unshared resolved matrix transform for the brush.
@ -3266,7 +3266,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomtilebrush-gettransformlocal HRESULT
// GetTransformLocal( IXpsOMMatrixTransform **transform );
IXpsOMMatrixTransform GetTransformLocal();
IXpsOMMatrixTransform? GetTransformLocal();
/// <summary>Sets the IXpsOMMatrixTransform interface pointer to a local, unshared matrix transform.</summary>
/// <param name="transform">
@ -3314,7 +3314,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomtilebrush-settransformlocal HRESULT
// SetTransformLocal( IXpsOMMatrixTransform *transform );
void SetTransformLocal([In] IXpsOMMatrixTransform transform);
void SetTransformLocal([In] IXpsOMMatrixTransform? transform);
/// <summary>
/// Gets the lookup key that identifies the IXpsOMMatrixTransform interface in a resource dictionary that contains the resolved
@ -3354,7 +3354,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomtilebrush-gettransformlookup
// HRESULT GetTransformLookup( LPWSTR *key );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetTransformLookup();
string? GetTransformLookup();
/// <summary>
/// Sets the lookup key name of a shared matrix transform that will be used as the transform for this brush.The shared matrix
@ -3406,7 +3406,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomtilebrush-settransformlookup
// HRESULT SetTransformLookup( LPCWSTR key );
void SetTransformLookup([In, MarshalAs(UnmanagedType.LPWStr)] string key);
void SetTransformLookup([In, MarshalAs(UnmanagedType.LPWStr)] string? key);
/// <summary>Gets the portion of the source image to be used by the tile.</summary>
/// <returns>The XPS_RECT structure that describes the area of the source content to be used by the tile.</returns>
@ -3553,7 +3553,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-gettransform HRESULT
// GetTransform( IXpsOMMatrixTransform **matrixTransform );
[MethodImpl(MethodImplOptions.InternalCall)]
IXpsOMMatrixTransform GetTransform();
IXpsOMMatrixTransform? GetTransform();
/// <summary>
/// Gets a pointer to the IXpsOMMatrixTransform interface that contains the local, unshared, resolved matrix transform for the visual.
@ -3586,7 +3586,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-gettransformlocal HRESULT
// GetTransformLocal( IXpsOMMatrixTransform **matrixTransform );
[MethodImpl(MethodImplOptions.InternalCall)]
IXpsOMMatrixTransform GetTransformLocal();
IXpsOMMatrixTransform? GetTransformLocal();
/// <summary>Sets the local, unshared matrix transform.</summary>
/// <param name="matrixTransform">
@ -3631,7 +3631,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-settransformlocal HRESULT
// SetTransformLocal( IXpsOMMatrixTransform *matrixTransform );
[MethodImpl(MethodImplOptions.InternalCall)]
void SetTransformLocal([In] IXpsOMMatrixTransform matrixTransform);
void SetTransformLocal([In] IXpsOMMatrixTransform? matrixTransform);
/// <summary>
/// Gets the lookup key name of the IXpsOMMatrixTransform interface in a resource dictionary that contains the resolved matrix
@ -3666,7 +3666,7 @@ public static partial class XpsObjectModel
// GetTransformLookup( LPWSTR *key );
[MethodImpl(MethodImplOptions.InternalCall)]
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetTransformLookup();
string? GetTransformLookup();
/// <summary>Sets the lookup key name of a shared matrix transform in a resource dictionary.</summary>
/// <param name="key">The lookup key name of the matrix transform in the dictionary.</param>
@ -3709,7 +3709,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-settransformlookup HRESULT
// SetTransformLookup( LPCWSTR key );
[MethodImpl(MethodImplOptions.InternalCall)]
void SetTransformLookup([In, MarshalAs(UnmanagedType.LPWStr)] string key);
void SetTransformLookup([In, MarshalAs(UnmanagedType.LPWStr)] string? key);
/// <summary>
/// Gets a pointer to the IXpsOMGeometry interface that contains the resolved geometry of the visual's clipping region.
@ -3745,7 +3745,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-getclipgeometry HRESULT
// GetClipGeometry( IXpsOMGeometry **clipGeometry );
[MethodImpl(MethodImplOptions.InternalCall)]
IXpsOMGeometry GetClipGeometry();
IXpsOMGeometry? GetClipGeometry();
/// <summary>
/// Gets a pointer to the IXpsOMGeometry interface that contains the local, unshared geometry of the visual's clipping region.
@ -3777,7 +3777,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-getclipgeometrylocal HRESULT
// GetClipGeometryLocal( IXpsOMGeometry **clipGeometry );
[MethodImpl(MethodImplOptions.InternalCall)]
IXpsOMGeometry GetClipGeometryLocal();
IXpsOMGeometry? GetClipGeometryLocal();
/// <summary>Sets the local, unshared clipping region for the visual.</summary>
/// <param name="clipGeometry">
@ -3823,7 +3823,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-setclipgeometrylocal HRESULT
// SetClipGeometryLocal( IXpsOMGeometry *clipGeometry );
[MethodImpl(MethodImplOptions.InternalCall)]
void SetClipGeometryLocal([In] IXpsOMGeometry clipGeometry);
void SetClipGeometryLocal([In] IXpsOMGeometry? clipGeometry);
/// <summary>
/// Gets the lookup key for the IXpsOMGeometry interface in a resource dictionary that contains the visual's clipping region.
@ -3856,7 +3856,7 @@ public static partial class XpsObjectModel
// HRESULT GetClipGeometryLookup( LPWSTR *key );
[MethodImpl(MethodImplOptions.InternalCall)]
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetClipGeometryLookup();
string? GetClipGeometryLookup();
/// <summary>Sets the lookup key name of a shared clip geometry in a resource dictionary.</summary>
/// <param name="key">
@ -3901,7 +3901,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-setclipgeometrylookup
// HRESULT SetClipGeometryLookup( LPCWSTR key );
[MethodImpl(MethodImplOptions.InternalCall)]
void SetClipGeometryLookup([In, MarshalAs(UnmanagedType.LPWStr)] string key);
void SetClipGeometryLookup([In, MarshalAs(UnmanagedType.LPWStr)] string? key);
/// <summary>Gets the opacity value of this visual.</summary>
/// <returns>The opacity value.</returns>
@ -3955,7 +3955,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-getopacitymaskbrush HRESULT
// GetOpacityMaskBrush( IXpsOMBrush **opacityMaskBrush );
[MethodImpl(MethodImplOptions.InternalCall)]
IXpsOMBrush GetOpacityMaskBrush();
IXpsOMBrush? GetOpacityMaskBrush();
/// <summary>Gets the local, unshared opacity mask brush for the visual.</summary>
/// <returns>
@ -3985,7 +3985,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-getopacitymaskbrushlocal
// HRESULT GetOpacityMaskBrushLocal( IXpsOMBrush **opacityMaskBrush );
[MethodImpl(MethodImplOptions.InternalCall)]
IXpsOMBrush GetOpacityMaskBrushLocal();
IXpsOMBrush? GetOpacityMaskBrushLocal();
/// <summary>Sets the IXpsOMBrush interface pointer as the local, unshared opacity mask brush.</summary>
/// <param name="opacityMaskBrush">
@ -4031,7 +4031,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-setopacitymaskbrushlocal
// HRESULT SetOpacityMaskBrushLocal( IXpsOMBrush *opacityMaskBrush );
[MethodImpl(MethodImplOptions.InternalCall)]
void SetOpacityMaskBrushLocal([In] IXpsOMBrush opacityMaskBrush);
void SetOpacityMaskBrushLocal([In] IXpsOMBrush? opacityMaskBrush);
/// <summary>Gets the name of the lookup key of the shared opacity mask brush in a resource dictionary.</summary>
/// <returns>
@ -4062,7 +4062,7 @@ public static partial class XpsObjectModel
// HRESULT GetOpacityMaskBrushLookup( LPWSTR *key );
[MethodImpl(MethodImplOptions.InternalCall)]
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetOpacityMaskBrushLookup();
string? GetOpacityMaskBrushLookup();
/// <summary>Sets the lookup key name of a shared opacity mask brush in a resource dictionary.</summary>
/// <param name="key">
@ -4107,7 +4107,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-setopacitymaskbrushlookup
// HRESULT SetOpacityMaskBrushLookup( LPCWSTR key );
[MethodImpl(MethodImplOptions.InternalCall)]
void SetOpacityMaskBrushLookup([In, MarshalAs(UnmanagedType.LPWStr)] string key);
void SetOpacityMaskBrushLookup([In, MarshalAs(UnmanagedType.LPWStr)] string? key);
/// <summary>Gets the <c>Name</c> property of the visual.</summary>
/// <returns>The <c>Name</c> property string. If the <c>Name</c> property has not been set, a <c>NULL</c> pointer is returned.</returns>
@ -4115,7 +4115,7 @@ public static partial class XpsObjectModel
// LPWSTR *name );
[MethodImpl(MethodImplOptions.InternalCall)]
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetName();
string? GetName();
/// <summary>Sets the <c>Name</c> property of the visual.</summary>
/// <param name="name">The name of the visual. A <c>NULL</c> pointer clears the <c>Name</c> property.</param>
@ -4128,7 +4128,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-setname HRESULT SetName(
// LPCWSTR name );
[MethodImpl(MethodImplOptions.InternalCall)]
void SetName([In, MarshalAs(UnmanagedType.LPWStr)] string name);
void SetName([In, MarshalAs(UnmanagedType.LPWStr)] string? name);
/// <summary>Gets a value that indicates whether the visual is the target of a hyperlink.</summary>
/// <returns>
@ -4186,7 +4186,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-gethyperlinknavigateuri
// HRESULT GetHyperlinkNavigateUri( IUri **hyperlinkUri );
[MethodImpl(MethodImplOptions.InternalCall)]
IUri GetHyperlinkNavigateUri();
IUri? GetHyperlinkNavigateUri();
/// <summary>Sets the destination URI of the visual's hyperlink.</summary>
/// <param name="hyperlinkUri">The IUri interface that contains the destination URI of the visual's hyperlink.</param>
@ -4211,7 +4211,7 @@ public static partial class XpsObjectModel
// GetLanguage( LPWSTR *language );
[MethodImpl(MethodImplOptions.InternalCall)]
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetLanguage();
string? GetLanguage();
/// <summary>Sets the <c>Language</c> property of the visual.</summary>
/// <param name="language">
@ -4224,7 +4224,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-setlanguage HRESULT
// SetLanguage( LPCWSTR language );
[MethodImpl(MethodImplOptions.InternalCall)]
void SetLanguage([In, MarshalAs(UnmanagedType.LPWStr)] string language);
void SetLanguage([In, MarshalAs(UnmanagedType.LPWStr)] string? language);
}
/// <summary>A brush that uses a visual element as a source.</summary>
@ -4305,7 +4305,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomtilebrush-gettransform HRESULT
// GetTransform( IXpsOMMatrixTransform **transform );
new IXpsOMMatrixTransform GetTransform();
new IXpsOMMatrixTransform? GetTransform();
/// <summary>
/// Gets a pointer to the IXpsOMMatrixTransform interface that contains the local, unshared resolved matrix transform for the brush.
@ -4340,7 +4340,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomtilebrush-gettransformlocal HRESULT
// GetTransformLocal( IXpsOMMatrixTransform **transform );
new IXpsOMMatrixTransform GetTransformLocal();
new IXpsOMMatrixTransform? GetTransformLocal();
/// <summary>Sets the IXpsOMMatrixTransform interface pointer to a local, unshared matrix transform.</summary>
/// <param name="transform">
@ -4388,7 +4388,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomtilebrush-settransformlocal HRESULT
// SetTransformLocal( IXpsOMMatrixTransform *transform );
new void SetTransformLocal([In] IXpsOMMatrixTransform transform);
new void SetTransformLocal([In] IXpsOMMatrixTransform? transform);
/// <summary>
/// Gets the lookup key that identifies the IXpsOMMatrixTransform interface in a resource dictionary that contains the resolved
@ -4428,7 +4428,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomtilebrush-gettransformlookup
// HRESULT GetTransformLookup( LPWSTR *key );
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetTransformLookup();
new string? GetTransformLookup();
/// <summary>
/// Sets the lookup key name of a shared matrix transform that will be used as the transform for this brush.The shared matrix
@ -4480,7 +4480,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomtilebrush-settransformlookup
// HRESULT SetTransformLookup( LPCWSTR key );
new void SetTransformLookup([In, MarshalAs(UnmanagedType.LPWStr)] string key);
new void SetTransformLookup([In, MarshalAs(UnmanagedType.LPWStr)] string? key);
/// <summary>Gets the portion of the source image to be used by the tile.</summary>
/// <returns>The XPS_RECT structure that describes the area of the source content to be used by the tile.</returns>
@ -4611,7 +4611,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisualbrush-getvisual HRESULT
// GetVisual( IXpsOMVisual **visual );
IXpsOMVisual GetVisual();
IXpsOMVisual? GetVisual();
/// <summary>Gets a pointer to the interface of the local, unshared visual used as the source for the brush.</summary>
/// <returns>
@ -4644,7 +4644,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisualbrush-getvisuallocal HRESULT
// GetVisualLocal( IXpsOMVisual **visual );
IXpsOMVisual GetVisualLocal();
IXpsOMVisual? GetVisualLocal();
/// <summary>Sets the interface pointer of the local, unshared visual used as the source for the brush.</summary>
/// <param name="visual">
@ -4687,7 +4687,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisualbrush-setvisuallocal HRESULT
// SetVisualLocal( IXpsOMVisual *visual );
void SetVisualLocal([In] IXpsOMVisual visual);
void SetVisualLocal([In] IXpsOMVisual? visual);
/// <summary>
/// Gets the lookup key name of a visual in a resource dictionary; the visual is to be used as the source for the brush.
@ -4719,7 +4719,7 @@ public static partial class XpsObjectModel
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisualbrush-getvisuallookup HRESULT
// GetVisualLookup( LPWSTR *lookup );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetVisualLookup();
string? GetVisualLookup();
/// <summary>
/// Sets the lookup key name of the shared visual, which is stored in a resource dictionary, to be used as the source for the brush.
@ -4762,7 +4762,7 @@ public static partial class XpsObjectModel
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisualbrush-setvisuallookup HRESULT
// SetVisualLookup( LPCWSTR lookup );
void SetVisualLookup([In, MarshalAs(UnmanagedType.LPWStr)] string lookup);
void SetVisualLookup([In, MarshalAs(UnmanagedType.LPWStr)] string? lookup);
/// <summary>Makes a deep copy of the interface.</summary>
/// <returns>A pointer to the copy of the interface.</returns>

View File

@ -313,7 +313,7 @@ public static partial class XpsPrint
[DllImport(Lib.XpsPrint, SetLastError = false, ExactSpelling = true)]
[PInvokeData("xpsprint.h", MSDNShortId = "d982ae2e-c68f-4197-b419-22a63e61db8a")]
public static extern HRESULT StartXpsPrintJob([MarshalAs(UnmanagedType.LPWStr)] string printerName, [Optional, MarshalAs(UnmanagedType.LPWStr)] string? jobName,
[Optional, MarshalAs(UnmanagedType.LPWStr)] string? outputFileName, [Optional] IntPtr progressEvent, [Optional] IntPtr completionEvent, [Optional] byte[]? printablePagesOn,
[Optional, MarshalAs(UnmanagedType.LPWStr)] string? outputFileName, [Optional] HEVENT progressEvent, [Optional] HEVENT completionEvent, [Optional] byte[]? printablePagesOn,
uint printablePagesOnCount, out IXpsPrintJob xpsPrintJob, out IXpsPrintJobStream documentStream, out IXpsPrintJobStream printTicketStream);
/// <summary>
@ -439,7 +439,7 @@ public static partial class XpsPrint
[DllImport(Lib.XpsPrint, SetLastError = false, ExactSpelling = true)]
[PInvokeData("xpsprint.h", MSDNShortId = "91D0BA4D-60A6-43F8-8BD3-9183DC6CD50D")]
public static extern HRESULT StartXpsPrintJob1([MarshalAs(UnmanagedType.LPWStr)] string printerName, [Optional, MarshalAs(UnmanagedType.LPWStr)] string? jobName,
[Optional, MarshalAs(UnmanagedType.LPWStr)] string? outputFileName, [Optional] IntPtr progressEvent, [Optional] IntPtr completionEvent,
[Optional, MarshalAs(UnmanagedType.LPWStr)] string? outputFileName, [Optional] HEVENT progressEvent, [Optional] HEVENT completionEvent,
out IXpsPrintJob xpsPrintJob, out IntPtr printContentReceiver);
/// <summary>

View File

@ -317,8 +317,7 @@ public struct SYSTEMTIME : IEquatable<SYSTEMTIME>, IComparable<SYSTEMTIME>
{
var ticks1 = t1.ToUInt64;
var ticks2 = t2.ToUInt64;
if (ticks1 > ticks2) return 1;
return ticks1 < ticks2 ? -1 : 0;
return ticks1 > ticks2 ? 1 : ticks1 < ticks2 ? -1 : 0;
}
/// <summary>Compares the current object with another object of the same type.</summary>
@ -378,4 +377,338 @@ public struct SYSTEMTIME : IEquatable<SYSTEMTIME>, IComparable<SYSTEMTIME>
((ulong)wMilliseconds & 0x3ff);
private static bool IsLeapYear(ushort year) => year % 4 == 0 && (year % 100 != 0 || year % 400 == 0);
}
/// <summary>
/// Specifies a date and time, using individual members for the month, day, year, weekday, hour, minute, second, and millisecond. The
/// time is either in coordinated universal time (UTC) or local time, depending on the function that is being called.
/// </summary>
[PInvokeData("winbase.h")]
[StructLayout(LayoutKind.Sequential, Pack = 2)]
public class PSYSTEMTIME : IEquatable<SYSTEMTIME>, IComparable<SYSTEMTIME>, IEquatable<PSYSTEMTIME>, IComparable<PSYSTEMTIME>
{
private SYSTEMTIME st;
/// <summary>The year. The valid values for this member are 1601 through 30827.</summary>
public ushort wYear { get => st.wYear; set => st.wYear = value; }
/// <summary>
/// The month. This member can be one of the following values.
/// <list type="table">
/// <listheader>
/// <term>Value</term>
/// <term>Meaning</term>
/// </listheader>
/// <item>
/// <term>1</term>
/// <term>January</term>
/// </item>
/// <item>
/// <term>2</term>
/// <term>February</term>
/// </item>
/// <item>
/// <term>3</term>
/// <term>March</term>
/// </item>
/// <item>
/// <term>4</term>
/// <term>April</term>
/// </item>
/// <item>
/// <term>5</term>
/// <term>May</term>
/// </item>
/// <item>
/// <term>6</term>
/// <term>June</term>
/// </item>
/// <item>
/// <term>7</term>
/// <term>July</term>
/// </item>
/// <item>
/// <term>8</term>
/// <term>August</term>
/// </item>
/// <item>
/// <term>9</term>
/// <term>September</term>
/// </item>
/// <item>
/// <term>10</term>
/// <term>October</term>
/// </item>
/// <item>
/// <term>11</term>
/// <term>November</term>
/// </item>
/// <item>
/// <term>12</term>
/// <term>December</term>
/// </item>
/// </list>
/// </summary>
public ushort wMonth { get => st.wMonth; set => st.wMonth = value; }
/// <summary>
/// The day of the week. This member can be one of the following values.
/// <list type="table">
/// <listheader>
/// <term>Value</term>
/// <term>Meaning</term>
/// </listheader>
/// <item>
/// <term>0</term>
/// <term>Sunday</term>
/// </item>
/// <item>
/// <term>1</term>
/// <term>Monday</term>
/// </item>
/// <item>
/// <term>2</term>
/// <term>Tuesday</term>
/// </item>
/// <item>
/// <term>3</term>
/// <term>Wednesday</term>
/// </item>
/// <item>
/// <term>4</term>
/// <term>Thursday</term>
/// </item>
/// <item>
/// <term>5</term>
/// <term>Friday</term>
/// </item>
/// <item>
/// <term>6</term>
/// <term>Saturday</term>
/// </item>
/// </list>
/// </summary>
public ushort wDayOfWeek { get => st.wDayOfWeek; set => st.wDayOfWeek = value; }
/// <summary>The day of the month. The valid values for this member are 1 through 31.</summary>
public ushort wDay { get => st.wDay; set => st.wDay = value; }
/// <summary>The hour. The valid values for this member are 0 through 23.</summary>
public ushort wHour { get => st.wHour; set => st.wHour = value; }
/// <summary>The minute. The valid values for this member are 0 through 59.</summary>
public ushort wMinute { get => st.wMinute; set => st.wMinute = value; }
/// <summary>The second. The valid values for this member are 0 through 59.</summary>
public ushort wSecond { get => st.wSecond; set => st.wSecond = value; }
/// <summary>The millisecond. The valid values for this member are 0 through 999.</summary>
public ushort wMilliseconds { get => st.wMilliseconds; set => st.wMilliseconds = value; }
/// <summary>Initializes a new instance of the <see cref="SYSTEMTIME"/> struct with a <see cref="DateTime"/>.</summary>
/// <param name="dt">The <see cref="DateTime"/> value.</param>
/// <param name="toKind">Indicates whether the <see cref="SYSTEMTIME"/> should represent the local, universal or unknown time.</param>
/// <exception cref="ArgumentOutOfRangeException">dt - Year value must be 1601 through 30827</exception>
public PSYSTEMTIME(DateTime dt, DateTimeKind toKind = DateTimeKind.Unspecified) => st = new SYSTEMTIME(dt, toKind);
/// <summary>Initializes a new instance of the <see cref="SYSTEMTIME"/> struct.</summary>
/// <param name="year">The year. The valid values for this member are 1601 through 30827.</param>
/// <param name="month">
/// The month. This member can be one of the following values.
/// <list type="table">
/// <listheader>
/// <term>Value</term>
/// <term>Meaning</term>
/// </listheader>
/// <item>
/// <term>1</term>
/// <term>January</term>
/// </item>
/// <item>
/// <term>2</term>
/// <term>February</term>
/// </item>
/// <item>
/// <term>3</term>
/// <term>March</term>
/// </item>
/// <item>
/// <term>4</term>
/// <term>April</term>
/// </item>
/// <item>
/// <term>5</term>
/// <term>May</term>
/// </item>
/// <item>
/// <term>6</term>
/// <term>June</term>
/// </item>
/// <item>
/// <term>7</term>
/// <term>July</term>
/// </item>
/// <item>
/// <term>8</term>
/// <term>August</term>
/// </item>
/// <item>
/// <term>9</term>
/// <term>September</term>
/// </item>
/// <item>
/// <term>10</term>
/// <term>October</term>
/// </item>
/// <item>
/// <term>11</term>
/// <term>November</term>
/// </item>
/// <item>
/// <term>12</term>
/// <term>December</term>
/// </item>
/// </list>
/// </param>
/// <param name="day">The day of the month. The valid values for this member are 1 through 31.</param>
/// <param name="hour">The hour. The valid values for this member are 0 through 23.</param>
/// <param name="minute">The minute. The valid values for this member are 0 through 59.</param>
/// <param name="second">The second. The valid values for this member are 0 through 59.</param>
/// <param name="millisecond">The millisecond. The valid values for this member are 0 through 999.</param>
public PSYSTEMTIME(ushort year, ushort month, ushort day, ushort hour = 0, ushort minute = 0, ushort second = 0,
ushort millisecond = 0) => st = new SYSTEMTIME(year, month, day, hour, minute, second, millisecond);
/// <summary>Initializes a new instance of the <see cref="PSYSTEMTIME"/> class.</summary>
/// <param name="st">The <see cref="SYSTEMTIME"/> instance.</param>
public PSYSTEMTIME(SYSTEMTIME st) => this.st = st;
/// <summary>Gets or sets the day of the week.</summary>
/// <value>The day of the week.</value>
[ExcludeFromCodeCoverage]
public DayOfWeek DayOfWeek
{
get => st.DayOfWeek;
set => st.DayOfWeek = value;
}
/// <summary>Gets the number of ticks that represent the date and time of this instance.</summary>
public long Ticks => st.Ticks;
/// <summary>Indicates if two <see cref="PSYSTEMTIME"/> values are equal.</summary>
/// <param name="s1">The first <see cref="PSYSTEMTIME"/> value.</param>
/// <param name="s2">The second <see cref="PSYSTEMTIME"/> value.</param>
/// <returns><c>true</c> if both values are equal; otherwise <c>false</c>.</returns>
public static bool operator ==(PSYSTEMTIME? s1, PSYSTEMTIME? s2) => s1 is null ? s2 is null : s1.Equals(s2);
/// <summary>Indicates if two <see cref="PSYSTEMTIME"/> values are not equal.</summary>
/// <param name="s1">The first <see cref="PSYSTEMTIME"/> value.</param>
/// <param name="s2">The second <see cref="PSYSTEMTIME"/> value.</param>
/// <returns><c>true</c> if both values are not equal; otherwise <c>false</c>.</returns>
public static bool operator !=(PSYSTEMTIME? s1, PSYSTEMTIME? s2) => !(s1 == s2);
/// <summary>Determines whether one specified <see cref="PSYSTEMTIME"/> is greater than another specified <see cref="PSYSTEMTIME"/>.</summary>
/// <param name="s1">The first <see cref="PSYSTEMTIME"/> value.</param>
/// <param name="s2">The second <see cref="PSYSTEMTIME"/> value.</param>
/// <returns><c>true</c> if <paramref name="s1"/> is greater than <paramref name="s2"/>; otherwise, <c>false</c>.</returns>
public static bool operator >(PSYSTEMTIME? s1, PSYSTEMTIME? s2) => Compare(s1, s2) > 0;
/// <summary>Determines whether one specified <see cref="PSYSTEMTIME"/> is greater than or equal to another specified <see cref="PSYSTEMTIME"/>.</summary>
/// <param name="s1">The first <see cref="PSYSTEMTIME"/> value.</param>
/// <param name="s2">The second <see cref="PSYSTEMTIME"/> value.</param>
/// <returns><c>true</c> if <paramref name="s1"/> is greater than or equal to <paramref name="s2"/>; otherwise, <c>false</c>.</returns>
public static bool operator >=(PSYSTEMTIME? s1, PSYSTEMTIME? s2) => Compare(s1, s2) >= 0;
/// <summary>Determines whether one specified <see cref="PSYSTEMTIME"/> is less than another specified <see cref="PSYSTEMTIME"/>.</summary>
/// <param name="s1">The first <see cref="PSYSTEMTIME"/> value.</param>
/// <param name="s2">The second <see cref="PSYSTEMTIME"/> value.</param>
/// <returns><c>true</c> if <paramref name="s1"/> is less than <paramref name="s2"/>; otherwise, <c>false</c>.</returns>
public static bool operator <(PSYSTEMTIME? s1, PSYSTEMTIME? s2) => Compare(s1, s2) < 0;
/// <summary>Determines whether one specified <see cref="PSYSTEMTIME"/> is less than or equal to another specified <see cref="PSYSTEMTIME"/>.</summary>
/// <param name="s1">The first <see cref="PSYSTEMTIME"/> value.</param>
/// <param name="s2">The second <see cref="PSYSTEMTIME"/> value.</param>
/// <returns><c>true</c> if <paramref name="s1"/> is less than or equal to <paramref name="s2"/>; otherwise, <c>false</c>.</returns>
public static bool operator <=(PSYSTEMTIME? s1, PSYSTEMTIME? s2) => Compare(s1, s2) <= 0;
/// <summary>The minimum value supported by <see cref="PSYSTEMTIME"/>.</summary>
public static readonly PSYSTEMTIME MinValue = new(SYSTEMTIME.MinValue);
/// <summary>The maximum value supported by <see cref="PSYSTEMTIME"/>.</summary>
public static readonly PSYSTEMTIME MaxValue = new(SYSTEMTIME.MaxValue);
/// <summary>Performs an implicit conversion from <see cref="PSYSTEMTIME"/> to <see cref="SYSTEMTIME"/>.</summary>
/// <param name="st">The <see cref="PSYSTEMTIME"/> instance.</param>
/// <returns>The result of the conversion.</returns>
public static implicit operator SYSTEMTIME(PSYSTEMTIME? st) => st?.st ?? default;
/// <summary>Performs an implicit conversion from <see cref="SYSTEMTIME"/> to <see cref="PSYSTEMTIME"/>.</summary>
/// <param name="st">The <see cref="SYSTEMTIME"/> instance.</param>
/// <returns>The result of the conversion.</returns>
public static implicit operator PSYSTEMTIME(SYSTEMTIME st) => new(st);
/// <summary>Compares two instances of <see cref="PSYSTEMTIME"/> and returns an integer that indicates whether the first instance is earlier than, the same as, or later than the second instance.</summary>
/// <param name="s1">The first object to compare. </param>
/// <param name="s2">The second object to compare. </param>
/// <returns>A signed number indicating the relative values of t1 and t2.
/// <list type="table">
/// <listheader><term>Value Type</term><term>Condition</term></listheader>
/// <item><term>Less than zero</term><term>t1 is earlier than t2.</term></item>
/// <item><term>Zero</term><term>t1 is the same as t2.</term></item>
/// <item><term>Greater than zero</term><term>t1 is later than t2.</term></item>
/// </list>
///</returns>
public static int Compare(PSYSTEMTIME? s1, PSYSTEMTIME? s2) => s1 is null ? s2 is null ? 0 : -1 : s1.CompareTo(s2);
/// <summary>Compares the current object with another object of the same type.</summary>
/// <param name="other">An object to compare with this object.</param>
/// <returns>
/// A value that indicates the relative order of the objects being compared. The return value has the following meanings: Value
/// Meaning Less than zero This object is less than the <paramref name="other"/> parameter.Zero This object is equal to <paramref
/// name="other"/>. Greater than zero This object is greater than <paramref name="other"/>.
/// </returns>
public int CompareTo(PSYSTEMTIME? other) => other is null ? 1 : st.CompareTo(other.st);
/// <summary>Compares the current object with another object of the same type.</summary>
/// <param name="other">An object to compare with this object.</param>
/// <returns>
/// A value that indicates the relative order of the objects being compared. The return value has the following meanings: Value
/// Meaning Less than zero This object is less than the <paramref name="other"/> parameter.Zero This object is equal to <paramref
/// name="other"/>. Greater than zero This object is greater than <paramref name="other"/>.
/// </returns>
public int CompareTo(SYSTEMTIME other) => st.CompareTo(other);
/// <summary>Indicates whether the current object is equal to another object of the same type.</summary>
/// <param name="other">An object to compare with this object.</param>
/// <returns>true if the current object is equal to the <paramref name="other"/> parameter; otherwise, false.</returns>
public bool Equals(PSYSTEMTIME? other) => other is not null && (ReferenceEquals(this, other) || st.Equals(other.st));
/// <summary>Indicates whether the current object is equal to another object of the same type.</summary>
/// <param name="other">An object to compare with this object.</param>
/// <returns>true if the current object is equal to the <paramref name="other"/> parameter; otherwise, false.</returns>
public bool Equals(SYSTEMTIME other) => st.Equals(other);
/// <summary>Determines whether the specified <see cref="object"/>, is equal to this instance.</summary>
/// <param name="obj">The <see cref="object"/> to compare with this instance.</param>
/// <returns><c>true</c> if the specified <see cref="object"/> is equal to this instance; otherwise, <c>false</c>.</returns>
public override bool Equals(object? obj) => Equals(obj as PSYSTEMTIME);
/// <summary>Returns a hash code for this instance.</summary>
/// <returns>A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.</returns>
public override int GetHashCode() => st.GetHashCode();
/// <summary>Converts this <see cref="SYSTEMTIME"/> instance to a <see cref="DateTime"/> instance.</summary>
/// <param name="kind">Indicates whether this <see cref="SYSTEMTIME"/> instance is local, universal or neither.</param>
/// <returns>An equivalent <see cref="DateTime"/> value.</returns>
public DateTime ToDateTime(DateTimeKind kind) => st.ToDateTime(kind);
/// <summary>Returns a <see cref="string"/> that represents this instance.</summary>
/// <returns>A <see cref="string"/> that represents this instance.</returns>
public override string ToString() => st.ToString();
/// <summary>Returns a <see cref="string" /> that represents this instance.</summary>
/// <param name="kind">One of the enumeration values that indicates whether the new object represents local time, UTC, or neither.</param>
/// <param name="format">A standard or custom date and time format string.</param>
/// <param name="provider">An object that supplies culture-specific formatting information.</param>
/// <returns>A <see cref="string" /> that represents this instance.</returns>
public string ToString(DateTimeKind kind, string? format, IFormatProvider? provider) => st.ToString(kind, format, provider);
}

View File

@ -0,0 +1,23 @@
using static Vanara.PInvoke.AdvApi32;
namespace Vanara.PInvoke.Tests;
public class ImpersonatedUser : IDisposable
{
private readonly SafeHTOKEN hToken;
public ImpersonatedUser(string un, string pwd, string? svr = null)
{
if (!(svr?.StartsWith('\\') ?? false))
svr = $@"\\{svr}";
Win32Error.ThrowLastErrorIfFalse(LogonUser(un, svr, pwd, LogonUserType.LOGON32_LOGON_NETWORK, LogonUserProvider.LOGON32_PROVIDER_DEFAULT, out hToken));
Win32Error.ThrowLastErrorIfFalse(ImpersonateLoggedOnUser(hToken));
}
public void Dispose()
{
RevertToSelf();
((IDisposable)hToken).Dispose();
GC.SuppressFinalize(this);
}
}

View File

@ -2,6 +2,9 @@
<PropertyGroup>
<AssemblyName>UnitTest.PInvoke.Printing</AssemblyName>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Drawing.Common" Version="7.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\PInvoke\Kernel32\Vanara.PInvoke.Kernel32.csproj" />
<ProjectReference Include="..\..\..\PInvoke\Printing\Vanara.PInvoke.Printing.csproj" />

View File

@ -11,13 +11,24 @@ namespace Vanara.PInvoke.Tests;
[TestFixture]
public class PrintingTests
{
private const string connPtrName = "Foobar";
private string connPtrName = "";
private (string un, string pw, string sv) creds = ("", "", "");
private const string defKey = "PrinterDriverData";
private static readonly string defaultPrinterName = new System.Drawing.Printing.PrinterSettings().PrinterName;
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
private SafeHPRINTER hprnt;
#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
[OneTimeSetUp]
public void _Setup() => Assert.That(OpenPrinter(defaultPrinterName, out hprnt), ResultIs.Successful);
public void _Setup()
{
Assert.That(OpenPrinter(defaultPrinterName, out hprnt, new() { DesiredAccess = (uint)AccessRights.PRINTER_ACCESS_USE, pDatatype = "RAW", pDevMode = new DEVMODE() { dmDeviceName = defaultPrinterName } }), ResultIs.Successful);
var auth = (object[])TestCaseSources.GetAuthCasesFromFile(true, true)[0];
connPtrName = string.Concat(auth[5], '\\', auth[9]);
if (!connPtrName.StartsWith('\\'))
connPtrName = @"\\" + connPtrName;
creds = ((string)auth[6], (string)auth[7], (string)auth[5]);
}
[OneTimeTearDown]
public void _TearDown() => hprnt?.Dispose();
@ -79,10 +90,10 @@ public class PrintingTests
pPrintProcessor = pi.pPrintProcessor,
Attributes = PRINTER_ATTRIBUTE.PRINTER_ATTRIBUTE_LOCAL
};
var p2 = new SafeHPRINTER(default, false);
SafeHPRINTER p2 = new(default, false);
Assert.That(p2 = AddPrinter(null, 2, pi2), ResultIs.ValidHandle);
try
{
Assert.That(p2 = AddPrinter(null, 2, pi2), ResultIs.ValidHandle);
GetSet("Test", 123, 123U);
GetSet("Test", 123L, 123UL);
GetSet("Test", "123");
@ -102,9 +113,9 @@ public class PrintingTests
Assert.That(DeletePrinter(p2), ResultIs.Successful);
}
void GetSet(string vn, object v, object r = null, REG_VALUE_TYPE t = REG_VALUE_TYPE.REG_NONE)
void GetSet(string vn, object v, object? r = null, REG_VALUE_TYPE t = REG_VALUE_TYPE.REG_NONE)
{
if (r is null) r = v;
r ??= v;
Assert.That(SetPrinterData(p2, vn, v, t), ResultIs.Successful);
Assert.That(GetPrinterData(p2, vn), v.GetType().IsArray ? (IResolveConstraint)Is.EquivalentTo((IEnumerable)r) : Is.EqualTo(r));
Assert.That(DeletePrinterData(p2, vn), ResultIs.Successful);
@ -248,20 +259,17 @@ public class PrintingTests
[Test]
public void EnumPrintersTest()
{
PRINTER_INFO_1[] res1;
Assert.That(res1 = EnumPrinters<PRINTER_INFO_1>().ToArray(), Is.Not.Empty);
TestContext.WriteLine(string.Join(",", res1.Select(v => v.pName)));
PRINTER_INFO_2[] res2;
Assert.That(res2 = EnumPrinters<PRINTER_INFO_2>().ToArray(), Is.Not.Empty);
TestContext.WriteLine(string.Join(",", res2.Select(v => v.Status)));
res2.WriteValues();
PRINTER_INFO_1[] res1;
Assert.That(res1 = EnumPrinters<PRINTER_INFO_1>().ToArray(), Is.Not.Empty);
//PRINTER_INFO_3[] res3;
//Assert.That(res3 = EnumPrinters<PRINTER_INFO_3>().ToArray(), Is.Not.Empty);
PRINTER_INFO_4[] res4;
Assert.That(res4 = EnumPrinters<PRINTER_INFO_4>().ToArray(), Is.Not.Empty);
TestContext.WriteLine(string.Join(",", res4.Select(v => v.Attributes)));
PRINTER_INFO_5[] res5;
Assert.That(res5 = EnumPrinters<PRINTER_INFO_5>().ToArray(), Is.Not.Empty);
TestContext.WriteLine(string.Join(",", res5.Select(v => v.pPortName)));
//PRINTER_INFO_6[] res6;
//Assert.That(res6 = EnumPrinters<PRINTER_INFO_6>().ToArray(), Is.Not.Empty);
//PRINTER_INFO_7[] res7;
@ -381,14 +389,15 @@ public class PrintingTests
Assert.That(AddJob(hprnt, out var path, out var id), ResultIs.Successful);
try
{
System.IO.File.WriteAllText(path, "Test page.");
System.IO.File.WriteAllText(path!, "Test page.");
JOB_INFO_2 ji2 = default;
Assert.That(() => ji2 = GetJob<JOB_INFO_2>(hprnt, id), Throws.Nothing);
Assert.That(ji2.JobId, Is.EqualTo(id));
Assert.NotNull(ji2.pDatatype);
TestHelper.WriteValues(ji2);
var jobInfo = new JOB_INFO_1 { JobId = id, Priority = JOB_PRIORITY.MAX_PRIORITY, Status = ji2.Status, pDatatype = ji2.pDatatype };
var jobInfo = new JOB_INFO_1 { JobId = id, Priority = JOB_PRIORITY.MAX_PRIORITY, Status = ji2.Status, pDatatype = ji2.pDatatype! };
Assert.That(SetJob(hprnt, id, jobInfo), ResultIs.Successful);
Assert.That(ScheduleJob(hprnt, id), ResultIs.Successful);
@ -432,7 +441,7 @@ public class PrintingTests
var bytes = new byte[] { 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1 };
Kernel32.WriteFile(hspf, bytes, (uint)bytes.Length, out _);
Assert.That(CommitSpoolData(hprnt, hspf, (uint)bytes.Length), ResultIs.Successful);
Assert.That(() => hspf.Dispose(), Throws.Nothing);
Assert.That(hspf.Dispose, Throws.Nothing);
}
[Test]
@ -474,7 +483,8 @@ public class PrintingTests
if (FindNextPrinterChangeNotification(hChange, out var chg, default, out var ppi) && !ppi.IsInvalid)
{
PRINTER_NOTIFY_INFO pi = ppi;
log.Add($"{chg}: {string.Join(",", pi.aData?.Select(d => d.Field))}");
if (pi.aData is not null)
log.Add($"{chg}: {string.Join(",", pi.aData.Select(d => d.Field))}");
}
}
}