using System; using System.Collections.Generic; using System.Linq; using System.Text; using AyaNova.PlugIn; using GZTW.AyaNova.BLL; namespace AyaNova.PlugIn.Merger { class Merger : IAyaNovaPlugin { private static bool bActive = false; #region IAyaNovaPlugin Members #region header stuff public string PluginName { get { return "Merger"; } } public string PluginVersion { get { return "7.6"; } } public string About { get { return "AyaNova Merger"; } } public Guid PluginID { get { return new Guid("{3238DBD2-7EE7-4e68-A812-EBABDFF6F56C}"); } } public System.Drawing.Image PluginSmallIcon { get { return Resource1.Merger16; } } public System.Drawing.Image PluginLargeIcon { get { return Resource1.Merger32; } } public System.Resources.ResourceManager AyaNovaResourceManager { set { ; } } #endregion header stuff #region start / stop public bool Initialize(Version AyaNovaVersion, LocalizedTextTable localizedText) { User u = User.GetItem(User.CurrentThreadUserID); bActive = (u.UserType == UserTypes.Administrator && AyaBizUtils.Right(RootObjectTypes.Client) > (int)SecurityLevelTypes.ReadOnly); return bActive; } public void Close() { ; } #endregion start stop #region Show / menu options public bool SingleObjectMenuShow(RootObjectTypes objectType) { //Only show in main menu return objectType == RootObjectTypes.Nothing; } public bool MultipleObjectsMenuShow(RootObjectTypes objectType) { return false; } public List SingleObjectMenuOptions(RootObjectTypes objectType, object ayaNovaObject) { List l = new List(1); l.Add(new AyaNovaPluginMenuItem("MERGECLIENTS", "Merge two clients", null, null)); return l; } public List MultipleObjectsMenuOptions(RootObjectTypes objectType) { return null; } #endregion show/options #region Commands public bool CommandSelectedForList(string commandKey, RootObjectTypes objectType, List objectIDList, object listObject) { return false; } public void CommandSelectedForSingleObject(string commandKey, RootObjectTypes objectType, object ayaNovaObject) { if (commandKey == "MERGECLIENTS") new MergeClients().ShowDialog(); } #endregion commands #endregion } }