ln.provider.netwatch/entities/NetworkDevice.cs

43 lines
1.1 KiB
C#

// /**
// * File: NetworkDevice.cs
// * Author: haraldwolff
// *
// * This file and it's content is copyrighted by the Author and / or copyright holder.
// * Any use wihtout proper permission is illegal and may lead to legal actions.
// *
// *
// **/
using System;
using ln.types.threads;
using ln.logging;
using ln.manage;
using ln.types.net;
namespace ln.provider.netwatch.entities
{
public class NetworkDevice : IDisposable
{
[PropertyDescriptor(Identity = true)]
public String Name { get; set; } = Guid.NewGuid().ToString();
public DeviceFlags Flags { get; set; }
public IPv6[] IPAddresses { get; set; } = new IPv6[0];
public NetworkDevicePort[] DevicePorts { get; set; } = new NetworkDevicePort[0];
public NetworkDevice()
{
SchedulingPool.Default.Schedule(Check, 4000);
}
public virtual void Check()
{
Logging.Log(LogLevel.DEBUG, "NetworkDevice {0}: Check()", Name);
}
public void Dispose()
{
SchedulingPool.Default.Unschedule(Check);
}
}
}