Click here to Skip to main content
15,884,040 members
Articles / Desktop Programming / Windows Forms

Task Manager

Rate me:
Please Sign up or sign in to vote.
4.90/5 (105 votes)
1 Jan 2010CPOL4 min read 203.8K   21K   229  
Manage your daily tasks and To-Do list using some exciting features of Windows 7.
//Copyright (c) Microsoft Corporation.  All rights reserved.

using System;
using System.Collections;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

namespace Microsoft.WindowsAPICodePack.Net
{
    /// <summary>
    /// Represents a connection to a network.
    /// </summary>
    /// <remarks> A collection containing instances of this class is obtained by calling
    /// the <see cref="P:Microsoft.WindowsAPICodePack.Net.Network.Connections"/> property.</remarks>
    public class NetworkConnection
    {
        #region Private Fields

        INetworkConnection networkConnection;

        #endregion // Private Fields

        internal NetworkConnection(INetworkConnection networkConnection)
        {
            this.networkConnection = networkConnection;
        }

        /// <summary>
        /// Retrieves an object that represents the network 
        /// associated with this connection.
        /// </summary>
        /// <returns>A <see cref="Network"/> object.</returns>
        public Network Network
        {
            get
            {
                return new Network(networkConnection.GetNetwork());
            }
        }

        /// <summary>
        /// Gets the adapter identifier for this connection.
        /// </summary>
        /// <value>A <see cref="System.Guid"/> object.</value>
        public Guid AdapterId
        {
            get
            {
                return networkConnection.GetAdapterId();
            }
        }
        /// <summary>
        /// Gets the unique identifier for this connection.
        /// </summary>
        /// <value>A <see cref="System.Guid"/> object.</value>
        public Guid ConnectionId
        {
            get
            {
                return networkConnection.GetConnectionId();
            }
        }
        /// <summary>
        /// Gets a value that indicates the connectivity of this connection.
        /// </summary>
        /// <value>A <see cref="Connectivity"/> value.</value>
        public Connectivity Connectivity
        {
            get
            {
                return networkConnection.GetConnectivity();
            }
        }

        /// <summary>
        /// Gets a value that indicates whether the network associated
        /// with this connection is 
        /// an Active Directory network and whether the machine
        /// has been authenticated by Active Directory.
        /// </summary>
        /// <value>A <see cref="DomainType"/> value.</value>
        public DomainType DomainType
        {
            get
            {
                return networkConnection.GetDomainType();
            }
        }
        /// <summary>
        /// Gets a value that indicates whether this 
        /// connection has Internet access.
        /// </summary>
        /// <value>A <see cref="System.Boolean"/> value.</value>
        public bool IsConnectedToInternet
        {
            get
            {
                return networkConnection.IsConnectedToInternet;
            }
        }

        /// <summary>
        /// Gets a value that indicates whether this connection has
        /// network connectivity.
        /// </summary>
        /// <value>A <see cref="System.Boolean"/> value.</value>
        public bool IsConnected
        {
            get
            {
                return networkConnection.IsConnected;
            }
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Chief Technology Officer
Pakistan Pakistan
Passion and positive dedication is essential part of success. I believe on hardworking and sharing knowledge with others. I always try to be a better than I am and think positive for positive result.

My Blogs

My Linked-In Profile

Comments and Discussions