Skip to content

Commit

Permalink
Updated XML documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
David Hall committed Apr 5, 2018
1 parent d9337cb commit cd8afc3
Show file tree
Hide file tree
Showing 12 changed files with 162 additions and 4 deletions.
4 changes: 4 additions & 0 deletions Security/AccessControl/AccCtrlHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

namespace Vanara.Security.AccessControl
{
/// <summary>Enables access to managed <see cref="SecurityIdentifier"/> as unmanaged <see cref="PSID"/>.</summary>
/// <seealso cref="Vanara.InteropServices.PinnedObject"/>
public class PinnedSid : PinnedObject
{
private readonly byte[] bytes;
Expand All @@ -23,6 +25,7 @@ public PinnedSid(SecurityIdentifier sid)
public PSID PSID => PSID.CreateFromPtr(this);
}

/// <summary>Enables access to managed <see cref="RawAcl"/> as unmanaged <see cref="T:byte[]"/>.</summary>
public class PinnedAcl : PinnedObject
{
private readonly byte[] bytes;
Expand All @@ -35,6 +38,7 @@ public PinnedAcl(RawAcl acl)
}
}

/// <summary>Helper methods for working with Access Control structures.</summary>
public static class AccessControlHelper
{
public static ACCESS_ALLOWED_ACE GetAce(IntPtr pAcl, int aceIndex)
Expand Down
1 change: 1 addition & 0 deletions Security/AccessControl/Privilege.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ public enum SystemPrivilege
UnsolicitedInput
}

/// <summary>Extension methods for <see cref="SafeTokenHandle"/> for working with privileges.</summary>
public static class PrivilegeExtension
{
public static SafeCoTaskMemHandle AdjustPrivilege(this SafeTokenHandle hObj, SystemPrivilege priv, PrivilegeAttributes attr)
Expand Down
11 changes: 9 additions & 2 deletions Security/AccessControl/PrivilegeAndAttributes.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
using Vanara.Security.AccessControl;
using static Vanara.PInvoke.AdvApi32;
using static Vanara.PInvoke.AdvApi32;

namespace Vanara.Security.AccessControl
{
/// <summary>Class to hold associated <see cref="SystemPrivilege"/> and <see cref="PrivilegeAttributes"/> pairs.</summary>
public class PrivilegeAndAttributes
{
/// <summary>Initializes a new instance of the <see cref="PrivilegeAndAttributes"/> class.</summary>
/// <param name="p">The privilege.</param>
/// <param name="a">The attribute.</param>
public PrivilegeAndAttributes(SystemPrivilege p, PrivilegeAttributes a)
{
Privilege = p;
Attributes = a;
}

/// <summary>Gets the privilege.</summary>
/// <value>The privilege.</value>
public SystemPrivilege Privilege { get; }
/// <summary>Gets the attributes.</summary>
/// <value>The attributes.</value>
public PrivilegeAttributes Attributes { get; }
}
}
1 change: 1 addition & 0 deletions Security/AccountUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Vanara.Security
{
/// <summary>Helper methods for working with <see cref="WindowsIdentity"/> and user names.</summary>
public static partial class AccountUtils
{
public static bool IsAdmin(this WindowsIdentity id) => new WindowsPrincipal(id).IsInRole(WindowsBuiltInRole.Administrator);
Expand Down
1 change: 1 addition & 0 deletions System/Extensions/FileInfoExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace Vanara.Extensions
{
/// <summary>Extension methods for <see cref="FileSystemInfo"/> and derived classes to facilitate retrieval of extended properties.</summary>
public static class FileInfoExtension
{
private static readonly SafeFileHandle nullSafeHandle = new SafeFileHandle(IntPtr.Zero, false);
Expand Down
2 changes: 2 additions & 0 deletions System/Extensions/ProcessExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

namespace Vanara.Extensions
{
/// <summary>Values which define a processes integrity level.</summary>
public enum ProcessIntegrityLevel
{
Untrusted,
Expand All @@ -22,6 +23,7 @@ public enum ProcessIntegrityLevel
System
}

/// <summary>Extension methods for <see cref="Process"/> for privilegs, status, elevation and relationships.</summary>
public static partial class ProcessExtension
{
public static void DisablePrivilege(this Process process, SystemPrivilege privilege)
Expand Down
1 change: 1 addition & 0 deletions System/Extensions/ServiceControllerExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

namespace Vanara.Extensions
{
/// <summary>Extension methods for <see cref="ServiceController"/>.</summary>
public static partial class ServiceControllerExtension
{
public static void SetStartType(this ServiceController svc, ServiceStartMode mode)
Expand Down
28 changes: 26 additions & 2 deletions System/Network/NetworkConnection.cs
Original file line number Diff line number Diff line change
@@ -1,28 +1,52 @@
using System;
using System.Runtime.InteropServices;
using static Vanara.PInvoke.NetListMgr;

namespace Vanara.Network
{
public class NetworkConnection
/// <summary>Represents a single network connection. Wraps <see cref="INetworkConnection"/>.</summary>
public class NetworkConnection : IDisposable
{
private readonly INetworkConnection conn;
private INetworkConnection conn;

internal NetworkConnection(INetworkConnection networkConnection)
{
if (conn == null) throw new ArgumentNullException(nameof(networkConnection));
conn = networkConnection;
}

/// <summary>Returns the ID of the network adapter used by this connection. There may multiple connections using the same adapter ID.</summary>
/// <returns>A GUID that specifies the adapter ID of the TCP/IP interface used by this network connection.</returns>
public Guid AdapterId => conn.GetAdapterId();

/// <summary>Returns the Connection ID associated with this network connection.</summary>
/// <returns>A GUID that specifies the Connection ID associated with this network connection.</returns>
public Guid ConnectionId => conn.GetConnectionId();

/// <summary>Returns the connectivity state of the network.</summary>
/// <returns>A NLM_CONNECTIVITY enumeration value that contains a bitmask that specifies the connectivity of this network connection.</returns>
public NLM_CONNECTIVITY Connectivity => conn.GetConnectivity();

/// <summary>Returns the type of network connection.</summary>
/// <returns>An NLM_DOMAIN_TYPE enumeration value that specifies the domain type of the network.</returns>
public NLM_DOMAIN_TYPE DomainType => conn.GetDomainType();

/// <summary>Specifies if the associated network connection has any network connectivity.</summary>
/// <value>If TRUE, this network connection has connectivity; if FALSE, it does not.</value>
public bool IsConnected => conn.IsConnected;

/// <summary>Specifies if the associated network connection has internet connectivity.</summary>
/// <value>If TRUE, this network connection has connectivity to the internet; if FALSE, it does not.</value>
public bool IsConnectedToInternet => conn.IsConnectedToInternet;

internal INetwork Network => conn.GetNetwork();

/// <summary>Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.</summary>
void IDisposable.Dispose()
{
if (conn == null) return;
Marshal.FinalReleaseComObject(conn);
conn = null;
}
}
}
1 change: 1 addition & 0 deletions System/Network/NetworkListManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

namespace Vanara.Network
{
/// <summary>Provides a set of methods to perform network list management functions.</summary>
public static class NetworkListManager
{
private static NetworkConnectionIterator connIter;
Expand Down
4 changes: 4 additions & 0 deletions System/VirtualDisk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

namespace Vanara.IO
{
/// <summary>Class that represents a virtual disk and allows for performing actions on it. This wraps most of the methods found in virtdisk.h.</summary>
/// <seealso cref="System.IDisposable"/>
public class VirtualDisk : IDisposable
{
private static readonly bool IsPreWin8 = Environment.OSVersion.Version < new Version(6, 2);
Expand All @@ -31,6 +33,7 @@ public class VirtualDisk : IDisposable

private VirtualDisk(SafeFileHandle handle, OPEN_VIRTUAL_DISK_VERSION version) { hVhd = handle; ver = version; }

/// <summary>Represents the format of the virtual disk.</summary>
public enum DeviceType : uint
{
/// <summary>Device type is unknown or not valid.</summary>
Expand All @@ -55,6 +58,7 @@ public enum DeviceType : uint
VhdSet = VIRTUAL_STORAGE_TYPE_DEVICE_TYPE.VIRTUAL_STORAGE_TYPE_DEVICE_VHDSET
}

/// <summary>Represents the subtype of a virtual disk.</summary>
public enum Subtype : uint
{
Fixed = 2,
Expand Down
2 changes: 2 additions & 0 deletions Windows.Shell/PropertyDescription.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

namespace Vanara.Windows.Shell
{
/// <summary>Enumerate and retrieve individual property description details. Wraps the <see cref="IPropertyDescription"/> shell interface</summary>
/// <seealso cref="System.IDisposable"/>
public class PropertyDescription : IDisposable
{
/// <summary>The IPropertyDescription object.</summary>
Expand Down
Loading

0 comments on commit cd8afc3

Please sign in to comment.