This commit is contained in:
138
source/Plugins/AyaNova.PlugIn.PerfAdvisor/perf.cs
Normal file
138
source/Plugins/AyaNova.PlugIn.PerfAdvisor/perf.cs
Normal file
@@ -0,0 +1,138 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using AyaNova.PlugIn;
|
||||
using GZTW.AyaNova.BLL;
|
||||
|
||||
namespace AyaNova.PlugIn.PerfAdvisor
|
||||
{
|
||||
class perf : IAyaNovaPlugin
|
||||
{
|
||||
private static bool bActive = false;
|
||||
|
||||
#region IAyaNovaPlugin Members
|
||||
|
||||
#region header stuff
|
||||
public string PluginName
|
||||
{
|
||||
get { return "Performance Advisor"; }
|
||||
}
|
||||
|
||||
public string PluginVersion
|
||||
{
|
||||
get { return "6.0.0.0"; }
|
||||
}
|
||||
|
||||
public string About
|
||||
{
|
||||
get { return "AyaNova Performance Advisor Copyright 2009-2010 Ground Zero Tech-Works Inc."; }
|
||||
}
|
||||
|
||||
public Guid PluginID
|
||||
{
|
||||
get { return new Guid("{0883B817-7BD5-4ee0-A233-C924256C33C9}"); }
|
||||
}
|
||||
|
||||
public System.Drawing.Image PluginSmallIcon
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
public System.Drawing.Image PluginLargeIcon
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
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 = true;// (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("ADVISE", "Test", 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 == "ADVISE")
|
||||
new Advisor().ShowDialog();
|
||||
}
|
||||
#endregion commands
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
|
||||
#region Menu item structure
|
||||
|
||||
/// <summary>
|
||||
///Performance test data
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public struct PerfItem
|
||||
{
|
||||
public PerfItem(string Test, long Milliseconds, long Count)
|
||||
{
|
||||
mTest = Test;
|
||||
mMilliseconds = Milliseconds;
|
||||
mCount = Count;
|
||||
}
|
||||
|
||||
internal string mTest;
|
||||
internal long mMilliseconds;
|
||||
internal long mCount;
|
||||
|
||||
public string Test { get { return mTest; } }
|
||||
public long Milliseconds { get { return mMilliseconds; } }
|
||||
public long Count { get { return mCount; } }
|
||||
public long MillisecondsAverage { get { return mMilliseconds / mCount; } }
|
||||
public long Seconds { get { return mMilliseconds / 1000; } }
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
Reference in New Issue
Block a user