This commit is contained in:
106
source/AyaNova.PlugIn/AyaNova.PlugIn.csproj
Normal file
106
source/AyaNova.PlugIn/AyaNova.PlugIn.csproj
Normal file
@@ -0,0 +1,106 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{674BC3C9-4F74-4304-91ED-2EAFFFEB09A7}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>AyaNova.PlugIn</RootNamespace>
|
||||
<AssemblyName>AyaNova.PlugIn</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<SignAssembly>true</SignAssembly>
|
||||
<AssemblyOriginatorKeyFile>..\..\keys\AyaNova.snk</AssemblyOriginatorKeyFile>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<OldToolsVersion>3.5</OldToolsVersion>
|
||||
<UpgradeBackupLocation />
|
||||
<TargetFrameworkProfile>
|
||||
</TargetFrameworkProfile>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Xml.Linq">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.DataSetExtensions">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="IAyaNovaCommand.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\bizobjects\AyaLib\GZTW.AyaNova.BLL.csproj">
|
||||
<Project>{50B807B6-FC35-4CC3-B54D-91C78426A943}</Project>
|
||||
<Name>GZTW.AyaNova.BLL</Name>
|
||||
<Private>False</Private>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\csla10\CSLA.Core.Bindablebase\CSLA.Core.Bindablebase.csproj">
|
||||
<Project>{C2392355-12A9-4197-A1D3-603C390B1E62}</Project>
|
||||
<Name>CSLA.Core.Bindablebase</Name>
|
||||
<Private>False</Private>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\csla10\CSLA.Server.DataPortal\CSLA.Server.DataPortal.vbproj">
|
||||
<Project>{80828E2C-E9FB-4E73-A27C-7F9CDB96FCDE}</Project>
|
||||
<Name>CSLA.Server.DataPortal</Name>
|
||||
<Private>False</Private>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\csla10\CSLA\CSLA.vbproj">
|
||||
<Project>{1B9A38BB-461A-47A4-AD72-099C694138A0}</Project>
|
||||
<Name>CSLA</Name>
|
||||
<Private>False</Private>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Data\Data\GZTW.Data.csproj">
|
||||
<Project>{701893AA-C042-4FB2-8643-E139372C1117}</Project>
|
||||
<Name>GZTW.Data</Name>
|
||||
<Private>False</Private>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Profile\GZTW.Profile\GZTW.Profile.csproj">
|
||||
<Project>{EDE897E2-E2E6-441D-9F83-0B973AE09670}</Project>
|
||||
<Name>GZTW.Profile</Name>
|
||||
<Private>False</Private>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\..\keys\AyaNova.snk">
|
||||
<Link>AyaNova.snk</Link>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
263
source/AyaNova.PlugIn/IAyaNovaCommand.cs
Normal file
263
source/AyaNova.PlugIn/IAyaNovaCommand.cs
Normal file
@@ -0,0 +1,263 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using GZTW.AyaNova.BLL;
|
||||
using System.Drawing;
|
||||
|
||||
namespace AyaNova.PlugIn
|
||||
{
|
||||
public interface IAyaNovaPlugin
|
||||
{
|
||||
/// <summary>
|
||||
/// Displayed in menus to group this plugin's menu item options beneath
|
||||
/// </summary>
|
||||
string PluginName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// May be displayed in UI
|
||||
/// or log files
|
||||
/// </summary>
|
||||
string PluginVersion { get; }
|
||||
|
||||
/// <summary>
|
||||
/// About info for plugin
|
||||
///
|
||||
/// </summary>
|
||||
string About { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Unique identifier for plugin, used in AyaNova to route commands
|
||||
/// and should also be used as the application ID if using the Integration
|
||||
/// object to persist plugin specific data.
|
||||
///
|
||||
/// This ID should never change.
|
||||
///
|
||||
/// Any plugin that fails to return a unique ID will not be loaded
|
||||
/// </summary>
|
||||
Guid PluginID { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Icon used to display beside plugin name in plugin menu option
|
||||
/// or null if no icon provided
|
||||
/// Should always be 16px square
|
||||
/// </summary>
|
||||
Image PluginSmallIcon { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Icon used to display beside plugin name in plugin menu option
|
||||
/// or null if no icon provided
|
||||
/// Should always be 32px square
|
||||
/// </summary>
|
||||
Image PluginLargeIcon { get; }
|
||||
|
||||
/// <summary>
|
||||
/// This is set by AyaNova after sucessful call to Initialize
|
||||
/// This gives the plugin access to the images and icons used in AyaNova
|
||||
/// </summary>
|
||||
System.Resources.ResourceManager AyaNovaResourceManager { set; }
|
||||
|
||||
/// <summary>
|
||||
/// Called when a user logs in to AyaNova sucessfully
|
||||
///
|
||||
/// Check the version number to ensure you are working with the same version of AyaNova as
|
||||
/// your plugin requires.
|
||||
///
|
||||
/// There is no particular requirement for the plugin to do anything with this method
|
||||
/// however this is a good point to cache any information required from the AyaNova biz object
|
||||
/// library if you need to cache it since access rights may have changed at this point.
|
||||
///
|
||||
/// Also any long held resources required should be loaded at this point (be sure to release them in Close)
|
||||
///
|
||||
/// Typically this is called after a user has launched AyaNova and sucessfully logged in but it may also
|
||||
/// be called when a user has used the logout menu option in AyaNova and just logged back in again.
|
||||
/// </summary>
|
||||
/// <param name="AyaNovaVersion">The version of AyaNova calling this plugin</param>
|
||||
/// <param name="localizedText">The current logged in AyaNova user's localized text object</param>
|
||||
/// <returns>False if initialization failed or plugin does not wish to participate or is unsupported in which case
|
||||
/// it will not be called upon again by AyaNova. true if plugin is supported / initialized ok</returns>
|
||||
bool Initialize(Version AyaNovaVersion, LocalizedTextTable localizedText);
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Called when a user is logging out but just before they have logged out.
|
||||
/// Release any resources at this point.
|
||||
///
|
||||
/// Typically this is called when AyaNova is about to close but may also be called when the user has selected
|
||||
/// logout from the interface
|
||||
/// </summary>
|
||||
void Close();
|
||||
|
||||
/// <summary>
|
||||
/// If your plugin supports the object type in question
|
||||
/// then this should return true.
|
||||
///
|
||||
/// This is called by AyaNova when it needs to know if the plugins menu should be displayed or not
|
||||
/// for a particular single object edit form.
|
||||
///
|
||||
/// Returning true will cause AyaNova to display in the plugin menu a popup item with the PluginName.
|
||||
///
|
||||
/// Later on, if the user selects that popup item then a call will be made to SingleObjectMenuOptions
|
||||
/// to get the specific options.
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="objectType"></param>
|
||||
/// <returns>true to display plugin name in plugin menu, false to not participate for the object type</returns>
|
||||
bool SingleObjectMenuShow(RootObjectTypes objectType);
|
||||
|
||||
/// <summary>
|
||||
/// If your plugin supports a list of the object type in question
|
||||
/// then this should return true.
|
||||
///
|
||||
/// This is called by AyaNova when it needs to know if the plugins menu should be displayed or not
|
||||
/// for a list display of an object type.
|
||||
///
|
||||
/// Returning true will cause AyaNova to display in the plugin menu a popup item with the PluginName.
|
||||
///
|
||||
/// Later on, if the user selects that popup item then a call will be made to MultipleObjectsMenuOptions
|
||||
/// to get the specific options.
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="objectType"></param>
|
||||
/// <returns>true to display plugin name in plugin menu, false to not participate for the object type</returns>
|
||||
bool MultipleObjectsMenuShow(RootObjectTypes objectType);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// If your Plugin supports editing the object type (or the specific object) provided
|
||||
/// then this should return a generic List of AyaNovaPluginMenuItem structs
|
||||
/// which will be displayed in the menu for a single AyaNova object being edited.
|
||||
///
|
||||
/// If your plugin does not support the object type in question then return null instead.
|
||||
///
|
||||
/// NOTE: if your plugin is general purpose and not tied to specific object types or you want to offer a general
|
||||
/// setup / configuration option for your plugin: AyaNova will invoke this method with objectType=RootObjectTypes.Nothing
|
||||
/// and display the menu items in the main AyaNova window.
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="objectType">The type of object currently open in the AyaNova UI</param>
|
||||
/// <param name="ayaNovaObject">The live object being edited or selected</param>
|
||||
/// <returns>A generic list of AyaNovaPluginMenuItem structs for all available options or null if not supported</returns>
|
||||
List<AyaNovaPluginMenuItem> SingleObjectMenuOptions(RootObjectTypes objectType, object ayaNovaObject);
|
||||
|
||||
/// <summary>
|
||||
/// If your Plugin supports editing multiples of the object type in question
|
||||
/// then this should return a generic List of AyaNovaPluginMenuItem structs
|
||||
/// which will be displayed in the menu for a list of the AyaNova object type being edited.
|
||||
///
|
||||
/// If your plugin does not support the object type in question or in multiples
|
||||
/// then return null instead.
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="objectType">The type of object list currently open in the AyaNova UI</param>
|
||||
/// <returns>A generic list of AyaNovaPluginMenuItem structs for all available options or null if not supported</returns>
|
||||
List<AyaNovaPluginMenuItem> MultipleObjectsMenuOptions(RootObjectTypes objectType);
|
||||
|
||||
/// <summary>
|
||||
/// Called by AyaNova UI when a plugin's menu option is selected on a list of AyaNova objects
|
||||
///
|
||||
/// Note that the list of id's will always be for objects that are saved in the AyaNova database and were displayed in the UI as a read only list
|
||||
/// from which the user selected one or more of these object record rows in a grid or other UI method.
|
||||
/// </summary>
|
||||
/// <param name="commandKey">The plugin's key value specified for the command in the AyaNovaPluginMenuItem </param>
|
||||
/// <param name="objectType">The type of AyaNova object selected</param>
|
||||
/// <param name="objectIDList">A list of ID's of the objects selected</param>
|
||||
/// <param name="listObject">Full list object of all items displayed in AyaNova UI (note, user could have filtered this list)</param>
|
||||
/// <returns>true if the AyaNova UI should refresh it's display of the list or false if not</returns>
|
||||
bool CommandSelectedForList(string commandKey, RootObjectTypes objectType, List<Guid> objectIDList, object listObject);
|
||||
|
||||
/// <summary>
|
||||
/// Called by the AyaNova UI when a plugin's menu option is selected in an edit form for a single object
|
||||
/// Note: the object may or may not have been saved to database, it could be completely new, retrieved and partially edited or
|
||||
/// identical to the copy in the database.
|
||||
///
|
||||
/// To check if it was ever saved to database use the IsNew property.
|
||||
/// To check if it's in a partially edited but unsaved state check the IsDirty property.
|
||||
///
|
||||
/// Do NOT under any circumstances attempt to save or delete the object in your plugin, AyaNova has a *lot* of code to ensure
|
||||
/// saving and deleting goes smoothly and there is no need to save or delete the object. If you save the object in your plugin it will result in
|
||||
/// an unstable state in the AyaNova user interface which could lead to data loss or crashes.
|
||||
///
|
||||
///
|
||||
/// Changes made to the object in the plugin will be immediately reflected in the AyaNova user interface since the UI is bound to the object.
|
||||
///
|
||||
/// For simplicity the object is passed as type object. Simply cast it back to it's type to work with it's methods and properties, i.e.:
|
||||
/// If your plugin operates on Client objects and the type passed is a Client then:
|
||||
/// if(objectType is Client)
|
||||
/// Client c=(Client)ayanovaObject;
|
||||
/// you can then access the properties and methods through c.
|
||||
///
|
||||
/// NOTE: if your plugin is general purpose and not tied to specific object types or you want to offer a setup option
|
||||
/// AyaNova will display a plugin option on the main windows for plugins that return single menu object options for
|
||||
/// object type RootObjectTypes.Nothing.
|
||||
///
|
||||
/// If a user selects a plugin command from the main AyaNova menu it will appear here as objectType=RootObjectTypes.Nothing
|
||||
/// and ayaNovaObject will be NULL.
|
||||
/// </summary>
|
||||
/// <param name="commandKey">The plugin's key value specified for the command in the AyaNovaPluginMenuItem</param>
|
||||
/// <param name="objectType">The type of AyaNova object selected</param>
|
||||
/// <param name="ayaNovaObject">The live object being edited or selected</param>
|
||||
/// <returns></returns>
|
||||
void CommandSelectedForSingleObject(string commandKey, RootObjectTypes objectType, object ayaNovaObject);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
#region Menu item structure
|
||||
|
||||
/// <summary>
|
||||
/// Menu item structure used to communicate available menu options
|
||||
/// to AyaNova
|
||||
///
|
||||
/// Note that the CommandKey value is the hidden internal key that will be passed back to the
|
||||
/// plugin if a user selects that menu item.
|
||||
///
|
||||
/// The Display string is the text displayed to the user in the menu, if it is left empty then an image *must* be provided
|
||||
/// and only the image will be displayed, no text.
|
||||
///
|
||||
/// Images should be 16px square for the small menu image and 32px square for the large menu image.
|
||||
/// Users can choose in AyaNova large or small menu item images, if only one is provided then the other will be scaled
|
||||
/// if required which will display less sharp.
|
||||
///
|
||||
/// If both images are null and Display is empty then the menu option will be ignored and not offered to the user.
|
||||
/// If the CommandKey value is empty then the menu option will be ignored and not offered to the user.
|
||||
///
|
||||
/// Note: localized text keys can be used within the Display string displayed to the end user
|
||||
/// by surrounding them in parenthesis and starting them with the tag LT:
|
||||
///
|
||||
/// For example an option that is presented in a single client editing form could be
|
||||
/// formatted like this "Transmogrify [LT:O.Client] now" and the [LT:O.Client] would
|
||||
/// be replaced with the localized version automatically based on the current users locale.
|
||||
///
|
||||
/// Or an option in a list of clients could be "Transmogrify [LT:Client.Label.List] now" which in default English
|
||||
/// locale would display "Transmogrify clients now";
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public struct AyaNovaPluginMenuItem
|
||||
{
|
||||
public AyaNovaPluginMenuItem(string ItemKey, string ItemDisplay, Image LargeMenuImage, Image SmallMenuImage)
|
||||
{
|
||||
mCommandKey=ItemKey;
|
||||
mDisplay=ItemDisplay;
|
||||
mMenuItemLargeImage=LargeMenuImage;
|
||||
mMenuItemSmallImage = SmallMenuImage;
|
||||
}
|
||||
|
||||
internal string mCommandKey;
|
||||
internal string mDisplay;
|
||||
internal Image mMenuItemLargeImage;
|
||||
internal Image mMenuItemSmallImage;
|
||||
|
||||
public string CommandKey { get { return mCommandKey; } }
|
||||
public string Display { get { return mDisplay; } }
|
||||
public Image MenuItemLargeImage { get { return mMenuItemLargeImage; } }
|
||||
public Image MenuItemSmallImage { get { return mMenuItemSmallImage; } }
|
||||
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
34
source/AyaNova.PlugIn/Properties/AssemblyInfo.cs
Normal file
34
source/AyaNova.PlugIn/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("AyaNova.PlugInLib")]
|
||||
[assembly: AssemblyDescription("AyaNova Plugin library interface")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("AyaNova.PlugInLib")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2009-2018 Ground Zero Tech-Works Inc.")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("bd78c74a-9d7e-47e6-aa8a-bfbe4a49af66")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("7.5.0.0")]
|
||||
[assembly: AssemblyFileVersion("7.5.0.0")]
|
||||
Reference in New Issue
Block a user