mit hyphen

This commit is contained in:
2013-06-25 22:53:41 +00:00
parent 8896edc368
commit 318d93e6c1
424 changed files with 161843 additions and 2 deletions
@@ -0,0 +1,31 @@
/***********************************************************************\
* Virtuoso.Miranda.Plugins (Hyphen) *
* Provides a managed wrapper for API of IM client Miranda. *
* Copyright (C) 2006-2009 virtuoso *
* deml.tomas@seznam.cz *
* *
* This library 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 2.1 of the License, or (at your option) any later version. *
* *
* This library 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 *
* Lesser General Public License for more details. *
\***********************************************************************/
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization;
namespace Virtuoso.Miranda.Plugins.Collections
{
[Serializable]
public class ConfigurationValues : Dictionary<string, string>
{
public ConfigurationValues() : base(1) { }
protected ConfigurationValues(SerializationInfo info, StreamingContext context) : base(info, context) { }
}
}
@@ -0,0 +1,33 @@
/***********************************************************************\
* Virtuoso.Miranda.Plugins (Hyphen) *
* Provides a managed wrapper for API of IM client Miranda. *
* Copyright (C) 2006-2009 virtuoso *
* deml.tomas@seznam.cz *
* *
* This library 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 2.1 of the License, or (at your option) any later version. *
* *
* This library 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 *
* Lesser General Public License for more details. *
\***********************************************************************/
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
namespace Virtuoso.Miranda.Plugins.Collections
{
public sealed class ControlCollection : List<Control>
{
#region .ctors
internal ControlCollection() : base(1) { }
#endregion
}
}
@@ -0,0 +1,29 @@
/***********************************************************************\
* Virtuoso.Miranda.Plugins (Hyphen) *
* Provides a managed wrapper for API of IM client Miranda. *
* Copyright (C) 2006-2009 virtuoso *
* deml.tomas@seznam.cz *
* *
* This library 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 2.1 of the License, or (at your option) any later version. *
* *
* This library 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 *
* Lesser General Public License for more details. *
\***********************************************************************/
using System;
using System.Collections.Generic;
using System.Text;
using Virtuoso.Hyphen.Mini.Custom;
namespace Virtuoso.Miranda.Plugins.Collections
{
internal sealed class CustomApiExportDescriptorCollection : List<CustomApiExportDescriptor>
{
public CustomApiExportDescriptorCollection() : base() { }
}
}
@@ -0,0 +1,34 @@
/***********************************************************************\
* Virtuoso.Miranda.Plugins (Hyphen) *
* Provides a managed wrapper for API of IM client Miranda. *
* Copyright (C) 2006-2009 virtuoso *
* deml.tomas@seznam.cz *
* *
* This library 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 2.1 of the License, or (at your option) any later version. *
* *
* This library 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 *
* Lesser General Public License for more details. *
\***********************************************************************/
using System;
using System.Collections.Generic;
using System.Text;
using Virtuoso.Miranda.Plugins.Infrastructure;
namespace Virtuoso.Miranda.Plugins.Collections
{
[CLSCompliant(false)]
public sealed class EventHandleCollection : List<EventHandle>
{
#region .ctors
internal EventHandleCollection() : base(3) { }
#endregion
}
}
@@ -0,0 +1,55 @@
/***********************************************************************\
* Virtuoso.Miranda.Plugins (Hyphen) *
* Provides a managed wrapper for API of IM client Miranda. *
* Copyright (C) 2006-2009 virtuoso *
* deml.tomas@seznam.cz *
* *
* This library 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 2.1 of the License, or (at your option) any later version. *
* *
* This library 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 *
* Lesser General Public License for more details. *
\***********************************************************************/
using System;
using System.Collections.Generic;
using System.Text;
using Virtuoso.Miranda.Plugins.Infrastructure;
namespace Virtuoso.Miranda.Plugins.Collections
{
internal sealed class HookDescriptorCollection : List<HookDescriptor>, ITagSearchable<HookDescriptor>
{
#region .ctors
public HookDescriptorCollection() : base(3) { }
#endregion
#region Impl
public new void Add(HookDescriptor item)
{
if (Contains(item)) return;
base.Add(item);
}
public HookDescriptor Find(string name)
{
if (name == null)
throw new ArgumentNullException("name");
foreach (HookDescriptor descriptor in this)
if (descriptor.Name == name)
return descriptor;
return null;
}
#endregion
}
}
@@ -0,0 +1,26 @@
/***********************************************************************\
* Virtuoso.Miranda.Plugins (Hyphen) *
* Provides a managed wrapper for API of IM client Miranda. *
* Copyright (C) 2006-2009 virtuoso *
* deml.tomas@seznam.cz *
* *
* This library 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 2.1 of the License, or (at your option) any later version. *
* *
* This library 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 *
* Lesser General Public License for more details. *
\***********************************************************************/
using System;
namespace Virtuoso.Miranda.Plugins.Collections
{
internal interface ITagSearchable<T>
{
T Find(string tag);
}
}
@@ -0,0 +1,53 @@
/***********************************************************************\
* Virtuoso.Miranda.Plugins (Hyphen) *
* Provides a managed wrapper for API of IM client Miranda. *
* Copyright (C) 2006-2009 virtuoso *
* deml.tomas@seznam.cz *
* *
* This library 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 2.1 of the License, or (at your option) any later version. *
* *
* This library 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 *
* Lesser General Public License for more details. *
\***********************************************************************/
using System;
using System.Collections.Generic;
using System.Text;
using Virtuoso.Miranda.Plugins.Infrastructure;
namespace Virtuoso.Miranda.Plugins.Collections
{
public sealed class MenuItemDeclarationCollection : List<MenuItemDeclarationAttribute>, ITagSearchable<MenuItemDeclarationAttribute>
{
#region .ctors
internal MenuItemDeclarationCollection() : base(3) { }
#endregion
#region Impl
public MenuItemDeclarationAttribute this[string tag]
{
get
{
return Find(tag);
}
}
public MenuItemDeclarationAttribute Find(string tag)
{
foreach (MenuItemDeclarationAttribute item in this)
if (item.Tag.Equals(tag, StringComparison.Ordinal)) return item;
return null;
}
#endregion
}
}
@@ -0,0 +1,58 @@
/***********************************************************************\
* Virtuoso.Miranda.Plugins (Hyphen) *
* Provides a managed wrapper for API of IM client Miranda. *
* Copyright (C) 2006-2009 virtuoso *
* deml.tomas@seznam.cz *
* *
* This library 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 2.1 of the License, or (at your option) any later version. *
* *
* This library 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 *
* Lesser General Public License for more details. *
\***********************************************************************/
using System;
using System.Collections.Generic;
using System.Text;
using Virtuoso.Miranda.Plugins.Infrastructure;
using System.Collections.ObjectModel;
namespace Virtuoso.Miranda.Plugins.Collections
{
public sealed class MenuItemDeclarationReadOnlyCollection : ReadOnlyCollection<MenuItemDeclarationAttribute>, ITagSearchable<MenuItemDeclarationAttribute>
{
#region .ctors
internal MenuItemDeclarationReadOnlyCollection(MenuItemDeclarationCollection list) : base(list) { }
#endregion
#region Impl
public MenuItemDeclarationAttribute this[string tag]
{
get
{
return Find(tag);
}
}
public MenuItemDeclarationAttribute Find(string tag)
{
if (String.IsNullOrEmpty(tag))
throw new ArgumentNullException("tag");
foreach (MenuItemDeclarationAttribute item in this)
if (tag.Equals(item.Tag, StringComparison.Ordinal))
return item;
return null;
}
#endregion
}
}
@@ -0,0 +1,33 @@
/***********************************************************************\
* Virtuoso.Miranda.Plugins (Hyphen) *
* Provides a managed wrapper for API of IM client Miranda. *
* Copyright (C) 2006-2009 virtuoso *
* deml.tomas@seznam.cz *
* *
* This library 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 2.1 of the License, or (at your option) any later version. *
* *
* This library 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 *
* Lesser General Public License for more details. *
\***********************************************************************/
using System;
using System.Collections.Generic;
using System.Text;
using Virtuoso.Hyphen.Mini;
namespace Virtuoso.Miranda.Plugins.Collections
{
public sealed class ModuleCollection : List<Module>
{
#region .ctors
internal ModuleCollection() : base(1) { }
#endregion
}
}
@@ -0,0 +1,35 @@
/***********************************************************************\
* Virtuoso.Miranda.Plugins (Hyphen) *
* Provides a managed wrapper for API of IM client Miranda. *
* Copyright (C) 2006-2009 virtuoso *
* deml.tomas@seznam.cz *
* *
* This library 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 2.1 of the License, or (at your option) any later version. *
* *
* This library 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 *
* Lesser General Public License for more details. *
\***********************************************************************/
using System;
using System.Collections.Generic;
using System.Text;
using Virtuoso.Miranda.Plugins.Infrastructure;
using System.Collections.ObjectModel;
using Virtuoso.Hyphen.Mini;
namespace Virtuoso.Miranda.Plugins.Collections
{
public sealed class ModuleReadOnlyCollection : ReadOnlyCollection<Module>
{
#region .ctors
internal ModuleReadOnlyCollection(ModuleCollection list) : base(list) { }
#endregion
}
}
@@ -0,0 +1,77 @@
/***********************************************************************\
* Virtuoso.Miranda.Plugins (Hyphen) *
* Provides a managed wrapper for API of IM client Miranda. *
* Copyright (C) 2006-2009 virtuoso *
* deml.tomas@seznam.cz *
* *
* This library 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 2.1 of the License, or (at your option) any later version. *
* *
* This library 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 *
* Lesser General Public License for more details. *
\***********************************************************************/
using System;
using System.Collections.Generic;
using System.Text;
namespace Virtuoso.Miranda.Plugins.Collections
{
/* DO NOT USE FIND... OR CONTAINS... METHODS THAT ACCEPT A TYPE INSTANCE FROM ANOTHER APPDOMAIN,
* YOU MAY LEAK ITS ASSEMBLY TO THAT DOMAIN. */
public sealed class PluginDescriptorCollection : List<PluginDescriptor>
{
#region .ctors
internal PluginDescriptorCollection() : base(3) { }
#endregion
#region Find methods
public PluginDescriptor FindDescriptorOf(MirandaPlugin plugin)
{
if (plugin == null)
throw new ArgumentNullException("plugin");
foreach (PluginDescriptor descriptor in this)
if (descriptor.Plugin == plugin) return descriptor;
return null;
}
public PluginDescriptor FindDescriptorOf(Type pluginType)
{
if (pluginType == null)
throw new ArgumentNullException("plugin");
if (!pluginType.IsSubclassOf(DefaultPluginManager.PluginType))
return null;
foreach (PluginDescriptor descriptor in this)
if (descriptor.Plugin.GetType() == pluginType) return descriptor;
return null;
}
#endregion
#region Contains methods
public bool ContainsDescriptorOf(MirandaPlugin plugin)
{
return (FindDescriptorOf(plugin) != null);
}
public bool ContainsDescriptorOf(Type pluginType)
{
return (FindDescriptorOf(pluginType) != null);
}
#endregion
}
}
@@ -0,0 +1,64 @@
/***********************************************************************\
* Virtuoso.Miranda.Plugins (Hyphen) *
* Provides a managed wrapper for API of IM client Miranda. *
* Copyright (C) 2006-2009 virtuoso *
* deml.tomas@seznam.cz *
* *
* This library 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 2.1 of the License, or (at your option) any later version. *
* *
* This library 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 *
* Lesser General Public License for more details. *
\***********************************************************************/
using System;
using System.Collections.Generic;
using System.Text;
using Virtuoso.Miranda.Plugins.Infrastructure;
using System.Collections.ObjectModel;
namespace Virtuoso.Miranda.Plugins.Collections
{
/* DO NOT USE FIND... OR CONTAINS... METHODS THAT ACCEPT A TYPE INSTANCE FROM ANOTHER APPDOMAIN,
* YOU MAY LEAK AN ASSEMBLY TO THAT DOMAIN. */
public sealed class PluginDescriptorReadOnlyCollection : ReadOnlyCollection<PluginDescriptor>
{
#region .ctors
internal PluginDescriptorReadOnlyCollection(PluginDescriptorCollection list) : base(list) { }
#endregion
#region Find methods
public PluginDescriptor FindDescriptorOf(MirandaPlugin plugin)
{
return ((PluginDescriptorCollection)Items).FindDescriptorOf(plugin);
}
public PluginDescriptor FindDescriptorOf(Type pluginType)
{
return ((PluginDescriptorCollection)Items).FindDescriptorOf(pluginType);
}
#endregion
#region Contains methods
public bool ContainsDescriptorOf(MirandaPlugin plugin)
{
return ((PluginDescriptorCollection)Items).FindDescriptorOf(plugin) != null;
}
public bool ContainsDescriptorOf(Type pluginType)
{
return ((PluginDescriptorCollection)Items).FindDescriptorOf(pluginType) != null;
}
#endregion
}
}
@@ -0,0 +1,53 @@
/***********************************************************************\
* Virtuoso.Miranda.Plugins (Hyphen) *
* Provides a managed wrapper for API of IM client Miranda. *
* Copyright (C) 2006-2009 virtuoso *
* deml.tomas@seznam.cz *
* *
* This library 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 2.1 of the License, or (at your option) any later version. *
* *
* This library 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 *
* Lesser General Public License for more details. *
\***********************************************************************/
using System;
using System.Collections.Generic;
using System.Text;
using Virtuoso.Miranda.Plugins.Infrastructure;
using System.Runtime.Serialization;
using System.Diagnostics;
namespace Virtuoso.Miranda.Plugins.Collections
{
public sealed class ProtocolDictionary : Dictionary<string, Protocol>
{
#region .ctors
internal ProtocolDictionary(int count) : base(count) { }
#endregion
#region Indexers
public new Protocol this[string key]
{
get
{
bool notFound = (key == null || !ContainsKey(key));
Debug.Assert(!notFound);
if (notFound)
return Protocol.UnknownProtocol;
return base[key];
}
}
#endregion
}
}