Well, due to the amount of static I received from releasing the entirety of CarPal under GPL, I've decided to release the InterfaceClass part of CarPal under LGPL. This means that .net plugins can be written as long as they conform to the LGPL. Qt plugins are still required to be GPL, and this will not change, but I don't see anyone but me writing plugins in that method. This should make people happier.


Code:
/***************************************************************************
*   Copyright (C) 2009 by Michael Carpenter (malcom2073)                  *
*   [email protected]                                                   *
*                                                                         *
*   This program is free software; you can redistribute it and/or modify  *
*   it under the terms of the GNU Lesser General Public License as        *
*   published by the Free Software Foundation; either version 3 of the    *
*   License, or (at your option) any later version.                       *
*                                                                         *
*   This program is distributed in the hope that it will be useful,       *
*   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
*   GNU General Public License for more details.                          *
*                                                                         *
*   You should have received a copy of the GNU Lesser General Public      *
*   License along with this program; if not, write to the                 *
*   Free Software Foundation, Inc.,                                       *
*   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
***************************************************************************/

    
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace InterfaceClasses
{
    public interface Plugin
    {
        String Name();
        String Author();
        String Description();
        String Version();
        void Initialize(InterfaceClasses.IPluginHost host);
        void passPluginMessage(String sender, String message);
    }
    public interface IPluginHost
    {
        void passCoreMessage(String sender, String message);
    }
    public class IPCMessage
    {
        public IPCMessage()
        {
            
        }
        public IPCMessage(String message)
        {
            _args = new List<string>();
            try
            {
                if ((message.IndexOf(':') != -1) && (message.IndexOf(' ') != -1) && (message.Split(' ').Length >= 2))
                {
                    _valid = true;
                    _target = message.Split(':')[0];
                    int first = message.IndexOf(" ");
                    int second = message.IndexOf(" ", first + 1);
                    if (second == -1)
                    {
                        second = message.Length;
                    }
                    _class = message.Substring(message.IndexOf(":") + 1, first - (message.IndexOf(":") + 1));
                    _method = message.Substring(first + 1, second - (first + 1));
                    for (int i = 0; i < message.Length; i++)
                    {
                        if (message[i] == '!')
                        {
                            int index = message.IndexOf('!', i + 1);
                            if (index != -1)
                            {
                                _args.Add(message.Substring(i + 1, index - (i + 1)));
                                i = index;
                            }
                            else
                            {
                                //unknown error
                            }
                        }
                    }
                    _method = _method.Substring(0, _method.IndexOf(" "));
                }
            }
            catch (Exception ex)
            {
                    
            }
        }
        public String getTarget()
        {
            return _target;
        }
        public String getClass()
        {
            return _class;
        }
        public String getMethod()
        {
            return _method;
        }
        public List<String> getArgs()
        {
            return _args;
        }
        private bool _valid;
        private String _target;
        private String _class;
        private String _method;
        private List<String> _args;
    }
}