Click here to Skip to main content
15,897,273 members
Articles / Programming Languages / C#

A Flexible Plugin System

Rate me:
Please Sign up or sign in to vote.
4.98/5 (25 votes)
3 Sep 2008LGPL34 min read 131.8K   1.8K   163  
A generic plugin system used to load and manage plugins
using System;

namespace Fadd.Commands.Net
{
    /// <summary>
    /// Packet sent through the channel. Keeps track of a command and its reply.
    /// </summary>
    [Serializable]
    internal class CommandPacket
    {
        private string _commandName;
        private bool _reply;
        private Command _command;
        private int _sequenceNumber;

        /// <summary>
        /// Initializes a new instance of the <see cref="CommandPacket"/> class.
        /// </summary>
        /// <param name="sequenceNumber">The sequence number.</param>
        /// <param name="command">Command .</param>
        public CommandPacket(int sequenceNumber, Command command)
        {
            Check.Min(0, sequenceNumber, "sequenceNumber");
            Check.Require(command, "command");

            _sequenceNumber = sequenceNumber;
            _command = command;
        }

        public bool Reply
        {
            get { return _reply; }
            set { _reply = value; }
        }

        public string CommandName
        {
            get { return _commandName; }
            set { _commandName = value; }
        }

        public Command Command
        {
            get { return _command; }
            set { _command = value; }
        }

        public int SequenceNumber
        {
            get { return _sequenceNumber; }
            set { _sequenceNumber = value; }
        }
    }
}

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 GNU Lesser General Public License (LGPLv3)


Written By
Founder 1TCompany AB
Sweden Sweden

Comments and Discussions