This commit is contained in:
111
source/Plugins/AyaNova.PlugIn.Merger/Merger.cs
Normal file
111
source/Plugins/AyaNova.PlugIn.Merger/Merger.cs
Normal file
@@ -0,0 +1,111 @@
|
||||
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.5"; }
|
||||
}
|
||||
|
||||
public string About
|
||||
{
|
||||
get { return "AyaNova Merger\r\n"+
|
||||
"Built " + AyaNova.PlugIn.Merger.Timestamp.BuildAt.ToString() + "\r\n" +
|
||||
"Copyright 2009-2018 Ground Zero Tech-Works Inc."; }
|
||||
}
|
||||
|
||||
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<AyaNovaPluginMenuItem> SingleObjectMenuOptions(RootObjectTypes objectType, object ayaNovaObject)
|
||||
{
|
||||
List<AyaNovaPluginMenuItem> l = new List<AyaNovaPluginMenuItem>(1);
|
||||
l.Add(new AyaNovaPluginMenuItem("MERGECLIENTS", "Merge two clients", null, null));
|
||||
return l;
|
||||
}
|
||||
|
||||
public List<AyaNovaPluginMenuItem> MultipleObjectsMenuOptions(RootObjectTypes objectType)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
#endregion show/options
|
||||
|
||||
#region Commands
|
||||
public bool CommandSelectedForList(string commandKey, RootObjectTypes objectType, List<Guid> objectIDList, object listObject)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public void CommandSelectedForSingleObject(string commandKey, RootObjectTypes objectType, object ayaNovaObject)
|
||||
{
|
||||
if (commandKey == "MERGECLIENTS")
|
||||
new MergeClients().ShowDialog();
|
||||
}
|
||||
#endregion commands
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user