using System;
using System.Drawing;
using System.ComponentModel.Composition;
namespace RDPAddins.Common
{
///
/// Provides addin's metadata
///
public interface IAddinMetadata
{
///
/// Gets addin name
///
string AddinName { get; }
///
/// Get addin channel name
///
string ChannelName { get; }
///
/// Gets channel options
///
ChannelOptions ChannelOptions { get; }
}
///
/// Inherited from System.ComponentModel.Composition.ExportAttribute.
/// Every addins should have one as an addin description.
///
[MetadataAttribute]
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
public class AddinMetadataAttribute : ExportAttribute
{
///
/// Initializes a new instance of the AddinMetadataAttribute class, exporting the type or member marked with this attribute with the specified name, channel name and channel options.
///
/// Name of the addin.
/// !!! should be less than 7 chars !!! Channel name.
/// Specified channel's options
public AddinMetadataAttribute(string AddinName, string ChannelName, ChannelOptions ChannelOptions)
: base(typeof(IAddin))
{
this.AddinName = AddinName;
this.ChannelName = ChannelName;
this.ChannelOptions = ChannelOptions;
}
///
/// Gets addin name
///
public string AddinName { get; private set; }
///
/// Get addin channel name
///
public string ChannelName { get; private set; }
///
/// Gets channel options
///
public ChannelOptions ChannelOptions { get; private set; }
}
///
/// Specifies the options for this virtual channel.
///
[Flags]
public enum ChannelOptions : uint
{
///
/// The channel is initialized.
///
Initialized = 0x80000000,
///
/// Encrypt client-to-server data.
///
EncryptRDP = 0x40000000,
///
/// Encrypt server-to-client data.
///
EncryptSC = 0x20000000,
///
/// Encrypt client-to-server data.
///
EncryptCS = 0x10000000,
///
/// Channel data should be sent with high Multipoint Communications Services (MCS) priority.
///
PriorityHigh = 0x08000000,
///
/// Channel data should be sent with medium MCS priority.
///
PriorityMedium = 0x04000000,
///
/// Channel data should be sent with low MCS priority.
///
PriorityLow = 0x02000000,
///
/// Virtual channel data should be compressed if RDP data is being compressed.
///
CompressRDP = 0x00800000,
///
/// Virtual channel data should be compressed, regardless of Remote Desktop Protocol (RDP) compression.
///
Compress = 0x00400000,
///
/// Affects how data sent by the IChannel.Write function is received at the server end. If this value is set, each data block is preceded by a CHANNEL_PDU_HEADER structure. If this value is not set, the data block includes only the data specified to IChannel.Write.
///
ShowProtocol = 0x00200000
}
}