This commit is contained in:
2018-06-29 19:47:36 +00:00
commit be7f501333
3769 changed files with 1425961 additions and 0 deletions

View File

@@ -0,0 +1,90 @@
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace AyaNova.PlugIn.AyaScript
{
/// <summary>
/// Summary description for CopyableMessageBox.
/// </summary>
public class ASCopyableMessageBox : System.Windows.Forms.Form
{
private System.Windows.Forms.TextBox edOut;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
private string mDisplay="";
public ASCopyableMessageBox(string Display)
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
mDisplay=Display;
//
//
//
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ASCopyableMessageBox));
this.edOut = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// edOut
//
this.edOut.Dock = System.Windows.Forms.DockStyle.Fill;
this.edOut.Location = new System.Drawing.Point(0, 0);
this.edOut.Multiline = true;
this.edOut.Name = "edOut";
this.edOut.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.edOut.Size = new System.Drawing.Size(488, 357);
this.edOut.TabIndex = 0;
//
// ASCopyableMessageBox
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(488, 357);
this.Controls.Add(this.edOut);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "ASCopyableMessageBox";
this.ShowInTaskbar = false;
this.Load += new System.EventHandler(this.CopyableMessageBox_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private void CopyableMessageBox_Load(object sender, System.EventArgs e)
{
edOut.Text=mDisplay;
}
}
}

View File

@@ -0,0 +1,197 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAICAAAAEAIACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAgBAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABn
vzAAZ79QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGe/MABn
v48ggM/gX6jf/1+n3/8Pb8CfAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAZ78/AGe/jx94
z+BQp9//oNjw/9D3///A7///oNjw/6DX8P8Qd8C/AGe/DwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAZ79PAHDA7x+Q
0P9PuOD/f9fw/5/g8P+/6P//wO///7/o//+f2PD/v+j//5DQ8P8feM/QAGe/HwAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABn
v38Al9D/L7jv/0/H7/9vz+//gNjw/5/g8P+P1/D/gMjv/3/I7/+A0PD/gNDw/1C47/8QeM/vAGe/LwAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAGe/gACQ0P8fsOD/MLjv/1C47/9gv+//j9jw/5/g//+f4P//gNj//1C47/9QuPD/MK/v/xCQ
3/8AZ79/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAZ7+PD4jQ/y+o4P9PwPD/b8/w/3DX8P+A2PD/gNjw/4DY8P9w1/D/b8/w/z+w
7/8PmOD/AIff/wBnv3AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAB9owG8AaMDwIJ/f/0DA8P9Qx/D/YM/w/2/P8P9vz/D/b8/w/2DP
8P9Qx/D/QMDw/y+v7/8Ah9D/AGe/bwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAIGjPHyBoz4AweNDvX7Dg/3/g8P8fgM//H5Df/0C/7/9PwPD/UMfw/1DH
8P9Qx/D/T8Dw/zCv4P8fkN//D3jP/wBowN8AZ79AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH8AIAB/
AHAAiADQD5cQ8AB/AEAAAAAAIGjPPyBoz69Al9//cNDw/4/w//9gv+//P4fQ7yBoz48AZ8C/EIfQ/zC3
7/8wt+//IJ/f/xCH0P8Ab8D/AGe/vwBnv3AAZ78vAAAAAAAAAAAAAAAAAAAAAAAAAAAAfwAgAH8AfwCI
ANAQqA//IMgQ/zDfH/9P12D/IKgw/x9or89PmN//j+///3/f8P9QoN//L3DPsCBoz08AAAAAAAAAAAAA
AAAAZ7+fAG/A/wBowOAAZ7+fAGe/UABnvw8AAAAAAAAAAAAAAAAAAAAAAAAAAAB/AB8AfwCAAIcA0A+f
AP8fvw//L9gQ/zDgH/8w5x//MOAf/0DYYP9A32D/IKg//yBwsOA/h9DgIGjPfyBozx8AAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAZ78vAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH8AbwCY
AP8Qvw//H8gP/yDQEP8v2BD/MN8f/zDgH/8w2CD/QNhf/z/YUP8wz0D/H68g/wCAAK8AAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAfwBwAJ8A/xC/D/8fxw//IM8Q/y/PL/9A11D/X+d//1/vgP9A32D/MMhA/y/IMP8fvyD/D6cP/wB/
AH8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAB/AH8AnwD/ELcf/y/HP/9A32D/X++A/1/vgP9f74D/T+dw/0DfYP8w10//H7gg/xC4
H/8AoAD/AH8AgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAH8ATwCID/8gxzD/P9hQ/0DfYP9P52//T+dv/0/nb/9A32D/P9hQ/y/P
P/8fxy//D68Q/wCgAP8AeB+PAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH8ATwCHAPAgwDD/MNdP/z/YUP8/2FD/P9hQ/zDX
T/8vzz//IMgw/xC/H/8Apw//AI8A/y+Xf/8vd8+/IGjPTwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAA0EcAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH8AMACAAO8fty//L88//y/P
P/8vzz//H7gv/w+gEP8AiAD/AH8A0AB/D5AfeH+gUKjf8H/Y8P9vwO//P4jQ4CBoz3AgaM8PAAAAAAAA
AADQRwA/0EcAj99gH+DfbyD/0EgAkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH8AIAB/
AN8PnxD/D5cP/wCAAPAAfwCwAH8AbwB/ACAAAAAAAAAAAAAAAAAAAAAAIGjPUECP389vwO//f9fw/3CP
r/+fV0DQ0F8f7+CPX//wx5///9ev/++gUP/voE//0FAPsNBHAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAH8AHwB/AI8AfwBPAH8ADwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0EcAEMBI
EKDPUBD/4Ggv/++YYP/wwJD//9iw///owP//2LD/8Kdf///IcP/wr1D/0FcP0NBHAB8AAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AADQRwA/308A/+9wMP/vj1D/8Kdw//DAkP//16///9+w//DHn//wqF///79g//C4X//woED/31gP79BH
AC8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAANBHAD/fSAD/728v/++HT//wmGD/8KBv//C3f///15///9+v///PkP/vn1D/8KhP/++Y
MP/vhx//0EcAvwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAA0EcAQN9IAP/gaCD/74dA//CoYP/wv4D//8+Q///PkP//z5D/8L+A//Cv
b//vj0D/74cf/+B4D//QRwCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQRwAf0EcA3+BoH//vj0D/8KBf//Cvb//wt3//8Ld///C3
f//wr2//8KBf/++PQP/vdy//4GgA/9BHAK8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQRwAQ0EcAz+BnH//vj0D/8J9Q//Cg
X//woF//8KBf//CfUP/vj0D/73gv/+BfEP/fTwD/0EcAnwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQRwAP0EcAsN9f
EP/vhz//749A/++IP//gdy//32Af/9BPAP/QRwDA0EcAcNBHAC8AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAA0EcAn99QD//fUA//0EcA79BHAJ/QRwBQ0EcAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAA0EcAX9BHADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAA//////////////+f///8D///4AP//4AB//+AAP//gAD//4AA//+AAP/8
AAD8EAAD4AA4HwAA/f8AA///AAH//wAB//8AAf//gAB/v8AADB/gHgAH8P8AA///AAH//wAB//8AAf//
AAH//4AB///AA///8B////n///////////8=
</value>
</data>
</root>

View File

@@ -0,0 +1,159 @@
<?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>{A9445D98-9E04-4A53-A6D7-441E97345975}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>AyaNova.PlugIn.AyaScript</RootNamespace>
<AssemblyName>AyaNova.PlugIn.AyaScript</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>..\..\WinFormApp\bin\debug\plugins\AyaScript\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\..\release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="CSScriptLibrary, Version=2.5.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\3rdprtylibs\CSScript\CSScriptLibrary.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<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="AyaScript.cs" />
<Compile Include="ASCopyableMessageBox.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Resource.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resource.resx</DependentUpon>
</Compile>
<Compile Include="ScriptDesigner.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="ScriptDesigner.Designer.cs">
<DependentUpon>ScriptDesigner.cs</DependentUpon>
</Compile>
<Compile Include="ScriptHeader.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="ScriptHeader.Designer.cs">
<DependentUpon>ScriptHeader.cs</DependentUpon>
</Compile>
<Compile Include="Timestamp.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\AyaNova.PlugIn\AyaNova.PlugIn.csproj">
<Project>{674BC3C9-4F74-4304-91ED-2EAFFFEB09A7}</Project>
<Name>AyaNova.PlugIn</Name>
<Private>False</Private>
</ProjectReference>
<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>
<EmbeddedResource Include="ASCopyableMessageBox.resx">
<DependentUpon>ASCopyableMessageBox.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Resource.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resource.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Include="ScriptDesigner.resx">
<DependentUpon>ScriptDesigner.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="ScriptHeader.resx">
<DependentUpon>ScriptHeader.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="Resources\Script24.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\Script16.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\Script16.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>"C:\data\AyaNova\utils\TimeStamp\bin\Release\TimeStamp.exe" "$(ProjectDir)Timestamp.cs" "/N:AyaNova.PlugIn.AyaScript"</PreBuildEvent>
</PropertyGroup>
<!-- 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>

View File

@@ -0,0 +1,513 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AyaNova.PlugIn;
using GZTW.AyaNova.BLL;
using System.ComponentModel;
using System.Windows.Forms;
using System.Reflection;
using System.Data;
using System.Text.RegularExpressions;
using System.IO;
using CSScriptLibrary;
using System.Drawing;
using System.Drawing.Imaging;
using System.Runtime.InteropServices;
namespace AyaNova.PlugIn.AyaScript
{
public class AyaScript : IAyaNovaPlugin
{
//Holds the image resources from AyaNova
//so we can display the correct icons in our plugin
System.Resources.ResourceManager resman = null;
//Holds the current logged in user's localized text
//lookup object
LocalizedTextTable LocaleText = null;
#region IAyaNovaPlugin Members
#region interface properties
public string PluginName
{
get { return "AyaScript"; }
}
public string PluginVersion
{
get { return "7.5"; }
}
public string About
{
get
{
return "AyaNova AyaScript plugin\r\n" +
"Built " + AyaNova.PlugIn.AyaScript.Timestamp.BuildAt.ToString() + "\r\n" +
"Copyright 2009-2018 Ground Zero Tech-Works Inc.";
}
}
public Guid PluginID
{
get { return new Guid("{C8FAE0E3-542E-4143-9708-1C3BDA2508B2}"); }
}
public System.Drawing.Image PluginSmallIcon
{
get { return Resource.Script16; }
}
public System.Drawing.Image PluginLargeIcon
{
get { return Resource.Script24; }
}
public System.Resources.ResourceManager AyaNovaResourceManager
{
set { resman = value; }
get { return resman; }
}
#endregion interface properties
#region Initialization and Close
public bool Initialize(Version AyaNovaVersion, LocalizedTextTable localizedText)
{
LocaleText = localizedText;
if (!Util.LoadScripts())
{
MessageBox.Show("AyaScript plugin disabled due to error loading scripts!");
return false;
}
Util.AYS = this;
return true;
}
public void Close()
{
Util.AYS=null;
}
#endregion Initialization and close
#region ShowMenu?
public bool SingleObjectMenuShow(RootObjectTypes objectType)
{
return true;
}
public bool MultipleObjectsMenuShow(RootObjectTypes objectType)
{
return true;
}
#endregion show menu?
#region Menu options
public List<AyaNovaPluginMenuItem> SingleObjectMenuOptions(RootObjectTypes objectType, object ayaNovaObject)
{
List<AyaNovaPluginMenuItem> list = new List<AyaNovaPluginMenuItem>();
list.Add(new AyaNovaPluginMenuItem("AyaScriptEditor", "AyaScript Editor", Resource.Script24, Resource.Script16));
foreach (Util.ScriptItem i in Util.ScriptList)
{
if(i.Show(true,objectType))
list.Add(new AyaNovaPluginMenuItem(i.ScriptID.ToString(), i.ScriptName, null, null));
}
return list;
}
public List<AyaNovaPluginMenuItem> MultipleObjectsMenuOptions(RootObjectTypes objectType)
{
List<AyaNovaPluginMenuItem> list = new List<AyaNovaPluginMenuItem>();
list.Add(new AyaNovaPluginMenuItem("AyaScriptEditor", "AyaScript Editor", Resource.Script24, Resource.Script16));
foreach (Util.ScriptItem i in Util.ScriptList)
{
if (i.Show(false, objectType))
list.Add(new AyaNovaPluginMenuItem(i.ScriptID.ToString(), i.ScriptName, null, null));
}
return list;
}
#endregion
#region Menu Commands
#region LIST OBJECT COMMAND
/// <summary>
/// LIST OBJECT
/// </summary>
/// <param name="commandKey"></param>
/// <param name="objectType"></param>
/// <param name="objectIDList"></param>
/// <param name="listObject"></param>
/// <returns></returns>
public bool CommandSelectedForList(string commandKey, RootObjectTypes objectType, List<Guid> objectIDList, object listObject)
{
if (commandKey == "AyaScriptEditor")
{
ScriptDesigner sd = new ScriptDesigner();
sd.ShowDialog();
sd.Dispose();
return true;
}
Util.ExecuteScript(new Guid(commandKey), true, objectType, listObject, objectIDList);
return true;
}
#endregion list object command
#region SINGLE OBJECT COMMAND
/// <summary>
/// SINGLE OBJECT
/// </summary>
/// <param name="commandKey"></param>
/// <param name="objectType"></param>
/// <param name="ayaNovaObject"></param>
public void CommandSelectedForSingleObject(string commandKey, RootObjectTypes objectType, object ayaNovaObject)
{
if (commandKey == "AyaScriptEditor")
{
ScriptDesigner sd = new ScriptDesigner();
sd.ShowDialog();
sd.Dispose();
return;
}
Util.ExecuteScript(new Guid(commandKey),false, objectType, ayaNovaObject, new List<Guid>());
}
#endregion single object command
#endregion menu commands
#endregion
}
public class Util
{
public static AyaScript AYS { get; set; }
#region Regular expressions
//Name: MyTestCode
public static Regex rxName = new Regex(
"//Name:\\s*([^\\r\\n]*)",
RegexOptions.IgnoreCase
| RegexOptions.Multiline
| RegexOptions.Compiled
);
//ShowInMenuFor: List / SingleObject / Everywhere / MainOnly
public static Regex rxShowInMenuFor = new Regex(
"//ShowInMenuFor:\\s*([^\\r\\n]*)",
RegexOptions.IgnoreCase
| RegexOptions.Multiline
| RegexOptions.Compiled
);
//HandlesAyaNovaTypes: Client, HeadOffice, Unit
public static Regex rxHandlesAyaNovaTypes = new Regex(
"//HandlesAyaNovaTypes:\\s*([^\\r\\n]*)",
RegexOptions.IgnoreCase
| RegexOptions.Multiline
| RegexOptions.Compiled
);
// //UniqueID: Guid
// public static Regex rxUniqueID = new Regex(
// "//UniqueID:\\s*([^\\r\\n]*)",
//RegexOptions.IgnoreCase
//| RegexOptions.Multiline
//| RegexOptions.Compiled
//);
#endregion regex
#region script store
private static List<ScriptItem> mScriptList;
public static List<ScriptItem> ScriptList
{
get
{
if (mScriptList == null) mScriptList = new List<ScriptItem>();
return mScriptList;
}
}
private static string dbFile = "";
public static bool LoadScripts()
{
//check for db file in same folder this plugin loaded from and if not found create one
dbFile = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + "\\AyaScripts.xml";
DataTable dt = new DataTable("Scripts");
#region Load or create scripts file
if (File.Exists(dbFile))
{
try
{
dt.ReadXml(dbFile);
}
catch (Exception ex)
{
MessageBox.Show("AyaScript plugin failed to load scripts from " + dbFile + ", error: \r\n" + ex.Message);
return false;
}
}
else
{
//create it
try
{
//setup the columns
dt.Columns.Add("script", typeof(string));
dt.WriteXml(dbFile, XmlWriteMode.WriteSchema);
}
catch (Exception ex)
{
MessageBox.Show("AyaScript plugin failed to initialize and write new dataset to " + dbFile + ", error: \r\n" + ex.Message);
return false;
}
}
#endregion load or create scripts file
#region parse scripts
ScriptList.Clear();
foreach (DataRow dr in dt.Rows)
ScriptList.Add(new ScriptItem(dr[0].ToString()));
#endregion parse
return true;
}
/// <summary>
/// Persist scripts back to file
/// </summary>
public static void WriteScripts()
{
DataTable dt = new DataTable("Scripts");
dt.Columns.Add("script", typeof(string));
foreach (ScriptItem i in ScriptList)
{
DataRow dr = dt.NewRow();
dr[0] = i.ScriptText;
dt.Rows.Add(dr);
}
dt.WriteXml(dbFile, XmlWriteMode.WriteSchema);
}
/// <summary>
/// Save a script into the script cache, if a script with the same id exists previously, it's replaced
/// </summary>
/// <param name="sScript"></param>
public static void SaveScript(string sScript, Guid ID)
{
ScriptItem si = new ScriptItem(sScript);
si.ScriptID = ID;
//remove if present already since it's been updated
DeleteScript(si.ScriptID);
ScriptList.Add(si);
}
/// <summary>
/// Remove script from cache if present
/// </summary>
/// <param name="scriptID">Guid of script</param>
public static void DeleteScript(Guid scriptID)
{
for(int x=0;x<ScriptList.Count();x++)
{
if(ScriptList[x].ScriptID==scriptID)
{
ScriptList.RemoveAt(x);
break;
}
}
}
public static string GetScript(string sName)
{
foreach (ScriptItem si in ScriptList)
{
if(si.ScriptName.Equals(sName, StringComparison.CurrentCultureIgnoreCase))
return si.ScriptText;
}
return "Script \"" + sName + "\" not found in cache.";
}
public static string GetScript(Guid ID)
{
foreach (ScriptItem si in ScriptList)
{
if (si.ScriptID==ID)
return si.ScriptText;
}
return "Script \"" + ID.ToString() + "\" not found in cache.";
}
#endregion script store
#region Script execution
/// <summary>
/// Execute script
/// </summary>
/// <param name="ID"></param>
public static void ExecuteScript(Guid ID, bool IsList, RootObjectTypes objectType, Object ayaNovaObject, List<Guid> objectIDList)
{
string s = "";
foreach (ScriptItem si in ScriptList)
{
if (si.ScriptID == ID)
{
s=si.ScriptText;
break;
}
}
if (!s.Contains("AyaScriptMain"))
{
MessageBox.Show("Main method AyaScriptMain not found, nothing to execute!");
return;
}
//for some reason cs-script throws a null reference exception when a null
//parameter is passed in
if (ayaNovaObject == null) ayaNovaObject = DBNull.Value;
try
{
var script = new AsmHelper(CSScript.LoadMethod(AddUsings(s)));
script.Invoke("*.AyaScriptMain", IsList, objectType, ayaNovaObject, objectIDList);
}
catch (Exception ex)
{
MessageBox.Show("Error running script:\r\n----- Exception message -----\r\n" + ex.Message);
}
}
/// <summary>
/// Add the most common using statements
/// if not already present
/// </summary>
/// <param name="sScript"></param>
/// <returns></returns>
private static string AddUsings(string sScript)
{
System.Text.StringBuilder sb = new StringBuilder();
//if (!sScript.Contains("using System;")) sb.Append("using System;\r\n");
if (!sScript.Contains("using System.Collections.Generic;")) sb.Append("using System.Collections.Generic;\r\n");
if (!sScript.Contains("using System.Data;")) sb.Append("using System.Data;\r\n");
if (!sScript.Contains("using System.Drawing;")) sb.Append("using System.Drawing;\r\n");
if (!sScript.Contains("using System.Text;")) sb.Append("using System.Text;\r\n");
if (!sScript.Contains("using System.Windows.Forms;")) sb.Append("using System.Windows.Forms;\r\n");
if (!sScript.Contains("using GZTW.AyaNova.BLL;")) sb.Append("using GZTW.AyaNova.BLL;\r\n");
if (!sScript.Contains("using AyaNova.PlugIn.AyaScript;")) sb.Append("using AyaNova.PlugIn.AyaScript;\r\n");
sb.Append(sScript);
return sb.ToString();
}
#endregion script execution
#region parse
[Serializable]
public class ScriptItem
{
public ScriptItem(string Script)
{
//parse and set properties
ScriptText = Script;
//Name
ScriptName = Util.rxName.Match(Script).Groups[1].Value;
if (string.IsNullOrEmpty(ScriptName))
ScriptName = "Script " + System.DateTime.Now.ToString();
//Show in menu for
ScriptShowInMenuFor = Util.rxShowInMenuFor.Match(Script).Groups[1].Value;
if (string.IsNullOrEmpty(ScriptShowInMenuFor))
ScriptShowInMenuFor = "Everywhere";
//ID
ScriptID = Guid.NewGuid();
//Object types
ScriptHandlesTypes = new List<RootObjectTypes>();
List<string> lsRootObjects = Util.rxHandlesAyaNovaTypes.Match(Script).Groups[1].Value.Replace(" ", "").Split(',').ToList<string>();
if (lsRootObjects.Count == 0)
lsRootObjects = new List<string>(new string[] { "Client" });
foreach (string s in lsRootObjects)
{
try
{
ScriptHandlesTypes.Add((RootObjectTypes)Enum.Parse(typeof(RootObjectTypes), s, true));
}
catch { }
}
}
public bool Show(bool bFromSingle, RootObjectTypes oType)
{
if(ScriptShowInMenuFor.Equals("Everywhere", StringComparison.CurrentCultureIgnoreCase)) return true;
if(ScriptShowInMenuFor.Equals("Main menu only", StringComparison.CurrentCultureIgnoreCase) && oType== RootObjectTypes.Nothing) return true;
if(bFromSingle)
{
if(!ScriptShowInMenuFor.Equals("Single AyaNova object", StringComparison.CurrentCultureIgnoreCase))
return false;
}
else
{
if (!ScriptShowInMenuFor.Equals("List of AyaNova objects", StringComparison.CurrentCultureIgnoreCase))
return false;
}
if (ScriptHandlesTypes.Contains(oType))
return true;
return false;
}
public string ScriptText { get; set; }
public string ScriptName { get; set; }
public Guid ScriptID { get; set; }
public string ScriptShowInMenuFor { get; set; }
public List<RootObjectTypes> ScriptHandlesTypes { get; set; }
}
#endregion parse
}//bottom of util class
}

View File

@@ -0,0 +1,36 @@
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.Plugin.AyaScript")]
[assembly: AssemblyDescription("AyaScript plugin for AyaNova")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Ground Zero Tech-Works Inc.")]
[assembly: AssemblyProduct("AyaNova.Plugin.AyaScript")]
[assembly: AssemblyCopyright("Copyright © 2009-2018 Ground Zero Tech-Works Inc.")]
[assembly: AssemblyTrademark("AyaNova is a registered trademark of Ground Zero Tech-Works Inc.")]
[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("51b7f95f-8da6-44e0-a6ea-97b6475cd189")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("7.5.0.0")]
[assembly: AssemblyFileVersion("7.5.0.0")]

View File

@@ -0,0 +1,84 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.1
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace AyaNova.PlugIn.AyaScript {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resource {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resource() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AyaNova.PlugIn.AyaScript.Resource", typeof(Resource).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
internal static System.Drawing.Bitmap Script16 {
get {
object obj = ResourceManager.GetObject("Script16", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap Script24 {
get {
object obj = ResourceManager.GetObject("Script24", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Icon ScriptIco {
get {
object obj = ResourceManager.GetObject("ScriptIco", resourceCulture);
return ((System.Drawing.Icon)(obj));
}
}
}
}

View File

@@ -0,0 +1,130 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="Script16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>Resources\Script16.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Script24" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>Resources\Script24.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="ScriptIco" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>Resources\Script16.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 806 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -0,0 +1,196 @@
namespace AyaNova.PlugIn.AyaScript
{
partial class ScriptDesigner
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.scriptToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.newScriptToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.saveScriptToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.deleteScriptToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.headerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.helpContentsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.edScript = new System.Windows.Forms.TextBox();
this.menuStrip1.SuspendLayout();
this.SuspendLayout();
//
// menuStrip1
//
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.scriptToolStripMenuItem,
this.editToolStripMenuItem,
this.helpToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Size = new System.Drawing.Size(666, 24);
this.menuStrip1.TabIndex = 0;
this.menuStrip1.Text = "menuStrip1";
//
// scriptToolStripMenuItem
//
this.scriptToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.newScriptToolStripMenuItem,
this.openToolStripMenuItem,
this.saveScriptToolStripMenuItem,
this.deleteScriptToolStripMenuItem,
this.exitToolStripMenuItem});
this.scriptToolStripMenuItem.Name = "scriptToolStripMenuItem";
this.scriptToolStripMenuItem.Size = new System.Drawing.Size(46, 20);
this.scriptToolStripMenuItem.Text = "&Script";
//
// newScriptToolStripMenuItem
//
this.newScriptToolStripMenuItem.Name = "newScriptToolStripMenuItem";
this.newScriptToolStripMenuItem.Size = new System.Drawing.Size(116, 22);
this.newScriptToolStripMenuItem.Text = "&New";
this.newScriptToolStripMenuItem.Click += new System.EventHandler(this.newScriptToolStripMenuItem_Click);
//
// openToolStripMenuItem
//
this.openToolStripMenuItem.Name = "openToolStripMenuItem";
this.openToolStripMenuItem.Size = new System.Drawing.Size(116, 22);
this.openToolStripMenuItem.Text = "&Open";
this.openToolStripMenuItem.DropDownItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.openToolStripMenuItem_DropDownItemClicked);
//
// saveScriptToolStripMenuItem
//
this.saveScriptToolStripMenuItem.Name = "saveScriptToolStripMenuItem";
this.saveScriptToolStripMenuItem.Size = new System.Drawing.Size(116, 22);
this.saveScriptToolStripMenuItem.Text = "&Save";
this.saveScriptToolStripMenuItem.Click += new System.EventHandler(this.saveScriptToolStripMenuItem_Click);
//
// deleteScriptToolStripMenuItem
//
this.deleteScriptToolStripMenuItem.Name = "deleteScriptToolStripMenuItem";
this.deleteScriptToolStripMenuItem.Size = new System.Drawing.Size(116, 22);
this.deleteScriptToolStripMenuItem.Text = "&Delete";
this.deleteScriptToolStripMenuItem.Click += new System.EventHandler(this.deleteScriptToolStripMenuItem_Click);
//
// exitToolStripMenuItem
//
this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
this.exitToolStripMenuItem.Size = new System.Drawing.Size(116, 22);
this.exitToolStripMenuItem.Text = "E&xit";
this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click);
//
// editToolStripMenuItem
//
this.editToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.headerToolStripMenuItem});
this.editToolStripMenuItem.Name = "editToolStripMenuItem";
this.editToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
this.editToolStripMenuItem.Text = "&Edit";
//
// headerToolStripMenuItem
//
this.headerToolStripMenuItem.Name = "headerToolStripMenuItem";
this.headerToolStripMenuItem.Size = new System.Drawing.Size(120, 22);
this.headerToolStripMenuItem.Text = "&Header";
this.headerToolStripMenuItem.Click += new System.EventHandler(this.headerToolStripMenuItem_Click);
//
// helpToolStripMenuItem
//
this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.helpContentsToolStripMenuItem,
this.aboutToolStripMenuItem});
this.helpToolStripMenuItem.Name = "helpToolStripMenuItem";
this.helpToolStripMenuItem.Size = new System.Drawing.Size(40, 20);
this.helpToolStripMenuItem.Text = "&Help";
//
// helpContentsToolStripMenuItem
//
this.helpContentsToolStripMenuItem.Name = "helpContentsToolStripMenuItem";
this.helpContentsToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.helpContentsToolStripMenuItem.Text = "&Contents";
this.helpContentsToolStripMenuItem.Click += new System.EventHandler(this.helpContentsToolStripMenuItem_Click);
//
// aboutToolStripMenuItem
//
this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem";
this.aboutToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.aboutToolStripMenuItem.Text = "&About";
this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click);
//
// edScript
//
this.edScript.AcceptsReturn = true;
this.edScript.AcceptsTab = true;
this.edScript.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.edScript.Font = new System.Drawing.Font("Lucida Console", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.edScript.Location = new System.Drawing.Point(12, 41);
this.edScript.Multiline = true;
this.edScript.Name = "edScript";
this.edScript.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.edScript.Size = new System.Drawing.Size(642, 452);
this.edScript.TabIndex = 1;
this.edScript.TextChanged += new System.EventHandler(this.edScript_TextChanged);
//
// ScriptDesigner
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(666, 505);
this.Controls.Add(this.edScript);
this.Controls.Add(this.menuStrip1);
this.MainMenuStrip = this.menuStrip1;
this.Name = "ScriptDesigner";
this.Text = "ScriptDesigner";
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
this.Load += new System.EventHandler(this.ScriptDesigner_Load);
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ScriptDesigner_FormClosing);
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.MenuStrip menuStrip1;
private System.Windows.Forms.ToolStripMenuItem scriptToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem saveScriptToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem deleteScriptToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem newScriptToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem headerToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem helpToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem helpContentsToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem;
private System.Windows.Forms.TextBox edScript;
private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;
}
}

View File

@@ -0,0 +1,254 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using GZTW.AyaNova.BLL;
namespace AyaNova.PlugIn.AyaScript
{
public partial class ScriptDesigner : Form
{
//string mScript = "";
//public string Script
//{
// get
// {
// return mScript;
// }
// set
// {
// if (mScript != value)
// {
// mScript = value;
// IsDirty = true;
// }
// }
//}
public Guid ScriptID { get; set; }
private bool IsDirty { get; set; }
private bool IsNew { get; set; }
//private bool IsEmpty
//{
// get
// {
// return string.IsNullOrEmpty(Script);
// }
//}
public ScriptDesigner()
{
InitializeComponent();
}
private void ScriptDesigner_Load(object sender, EventArgs e)
{
this.Icon = Resource.ScriptIco;
IsDirty = false;
IsNew = true;
ScriptID = Guid.NewGuid();
PopulateOpenMenu();
}
private void ScriptDesigner_FormClosing(object sender, FormClosingEventArgs e)
{
if (!SaveChanges()) e.Cancel = true;
Util.WriteScripts();
}
private void PopulateOpenMenu()
{
openToolStripMenuItem.DropDownItems.Clear();
foreach (Util.ScriptItem si in Util.ScriptList)
{
ToolStripMenuItem tsi = new ToolStripMenuItem();
tsi.Text = si.ScriptName;
tsi.Tag = si.ScriptID;
openToolStripMenuItem.DropDownItems.Add(tsi);
}
}
private void openToolStripMenuItem_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e)
{
if (!SaveChanges()) return;
//load selected script into editor
Guid g = (Guid)e.ClickedItem.Tag;
edScript.Text = Util.GetScript(g);
ScriptID = g;
IsDirty = false;
IsNew = false;
}
/// <summary>
/// returns false if should cancel operation
/// </summary>
/// <returns></returns>
private bool SaveChanges()
{
if (!IsDirty) return true;
DialogResult dr=MessageBox.Show("Save changes?", "", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning);
if (dr == DialogResult.Cancel) return false;
if (dr == DialogResult.No) return true;
Util.SaveScript(edScript.Text,ScriptID);
IsDirty = false;
IsNew = false;
PopulateOpenMenu();
return true;
}
///// <summary>
///// Main entry point for script
///// This method must be present and it's definition and parameters unmodified
///// to work with AyaScript
/////
///// Other methods can be defined separately but this one must be present
///// </summary>
///// <param name="objectType">AyaNova RootObjectType of passed ayaNovaObject or the type of object in the list if it's a list object</param>
///// <param name="ayaNovaObject">If a single object then this is the AyaNova business object, if a list then this is the list object</param>
///// <param name="objectIDList">If a list, this contains the id's of the AyaNova objects in the list. Null if not called from a list.</param>
//public static void AyaScriptMain(RootObjectTypes objectType, Object ayaNovaObject, List<Guid> objectIDList)
//{
//}
private void newScriptToolStripMenuItem_Click(object sender, EventArgs e)
{
if (!SaveChanges()) return;
System.Text.StringBuilder sb = new StringBuilder();
ScriptID = Guid.NewGuid();
//Header
sb.Append("//Script created: ");
sb.Append(System.DateTime.Now.ToString());
sb.Append("\r\n");
sb.Append("//Name: Script ");
sb.Append(System.DateTime.Now.ToString());
sb.Append("\r\n");
sb.Append("//ShowInMenuFor: Everywhere\r\n");
sb.Append("//HandlesAyaNovaTypes: Client\r\n");
sb.Append("\r\n");
sb.Append("\r\n");
sb.Append("\r\n");
sb.Append("\r\n");
sb.Append("\r\n");
//Main method
sb.Append("/// <summary> \r\n" +
"/// Main entry point for script \r\n" +
"/// This method must be present and it's definition and parameters unmodified \r\n" +
"/// to work with AyaScript \r\n" +
"/// \r\n" +
"/// Other methods can be defined separately but this one must be present \r\n" +
"/// </summary> \r\n" +
"/// <param name=IsList>true if called from a list object, false if called from a single object edit form</param> \r\n" +
"/// <param name=objectType>AyaNova RootObjectType of passed ayaNovaObject or the type of object in the list if it's a list object</param> \r\n" +
"/// <param name=ayaNovaObject>If a single object then this is the AyaNova business object, if a list then this is the list object, if called from the main menu where there is no object this is DBNull.Value</param> \r\n" +
"/// <param name=objectIDList>If a list, this contains the id's of the AyaNova objects in the list, otherwise it's an empty list.</param>\r\n" );
sb.Append("public static void AyaScriptMain(bool IsList, RootObjectTypes objectType, Object ayaNovaObject, List<Guid> objectIDList)\r\n");
sb.Append("{\r\n");
sb.Append("\tMessageBox.Show(\"Hello from AyaScript!\");\r\n");
sb.Append("}\r\n");
edScript.Text = sb.ToString();
IsNew = true;
ScriptHeader sh = new ScriptHeader();
sh.Script = edScript.Text;
if (sh.ShowDialog() == DialogResult.Cancel)
{
sh.Dispose();
return;
}
sh.Dispose();
edScript.Text = sh.Script;
}
/// <summary>
/// Set header values
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void headerToolStripMenuItem_Click(object sender, EventArgs e)
{
ScriptHeader sh = new ScriptHeader();
sh.Script = edScript.Text;
if (sh.ShowDialog() == DialogResult.OK)
edScript.Text = sh.Script;
sh.Dispose();
}
/// <summary>
/// Save script
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void saveScriptToolStripMenuItem_Click(object sender, EventArgs e)
{
if (!IsDirty) return;
Util.SaveScript(edScript.Text, ScriptID);
IsDirty = false;
IsNew = false;
}
private void deleteScriptToolStripMenuItem_Click(object sender, EventArgs e)
{
if (MessageBox.Show("Are you sure?", "Delete script permanently?", MessageBoxButtons.YesNo, MessageBoxIcon.Stop, MessageBoxDefaultButton.Button2) == DialogResult.No)
return;
if(!IsNew)
Util.DeleteScript(ScriptID);
edScript.Text = "";
ScriptID = Guid.NewGuid();
PopulateOpenMenu();
edScript.Text = "";
IsDirty = false;
IsNew = true;
}
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
{
if (!SaveChanges()) return;
Close();
}
private void edScript_TextChanged(object sender, EventArgs e)
{
IsDirty = true;
}
private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
{
MessageBox.Show(Util.AYS.About + "\r\nVersion " + Util.AYS.PluginVersion);
}
private void helpContentsToolStripMenuItem_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("http://api.ayanova.com/AyaScript/index.htm");
}
//-----------------------------------------------
}
}

View File

@@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View File

@@ -0,0 +1,151 @@
namespace AyaNova.PlugIn.AyaScript
{
partial class ScriptHeader
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.lblShowInMenuAs = new System.Windows.Forms.Label();
this.edName = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.cklBizObjects = new System.Windows.Forms.CheckedListBox();
this.label2 = new System.Windows.Forms.Label();
this.btnCancel = new System.Windows.Forms.Button();
this.btnOK = new System.Windows.Forms.Button();
this.cbShowFor = new System.Windows.Forms.ComboBox();
this.SuspendLayout();
//
// lblShowInMenuAs
//
this.lblShowInMenuAs.AutoSize = true;
this.lblShowInMenuAs.Location = new System.Drawing.Point(9, 15);
this.lblShowInMenuAs.Name = "lblShowInMenuAs";
this.lblShowInMenuAs.Size = new System.Drawing.Size(124, 13);
this.lblShowInMenuAs.TabIndex = 0;
this.lblShowInMenuAs.Text = "Name: (displays in menu)";
//
// edName
//
this.edName.Location = new System.Drawing.Point(9, 31);
this.edName.Name = "edName";
this.edName.Size = new System.Drawing.Size(472, 20);
this.edName.TabIndex = 1;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(9, 66);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(52, 13);
this.label1.TabIndex = 2;
this.label1.Text = "Show for:";
//
// cklBizObjects
//
this.cklBizObjects.CheckOnClick = true;
this.cklBizObjects.FormattingEnabled = true;
this.cklBizObjects.Location = new System.Drawing.Point(9, 141);
this.cklBizObjects.Name = "cklBizObjects";
this.cklBizObjects.Size = new System.Drawing.Size(472, 379);
this.cklBizObjects.Sorted = true;
this.cklBizObjects.TabIndex = 5;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(9, 125);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(124, 13);
this.label2.TabIndex = 4;
this.label2.Text = "Handles AyaNova types:";
//
// btnCancel
//
this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnCancel.Location = new System.Drawing.Point(9, 545);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(75, 35);
this.btnCancel.TabIndex = 6;
this.btnCancel.UseVisualStyleBackColor = true;
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// btnOK
//
this.btnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnOK.Location = new System.Drawing.Point(406, 545);
this.btnOK.Name = "btnOK";
this.btnOK.Size = new System.Drawing.Size(75, 35);
this.btnOK.TabIndex = 7;
this.btnOK.UseVisualStyleBackColor = true;
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
//
// cbShowFor
//
this.cbShowFor.FormattingEnabled = true;
this.cbShowFor.Items.AddRange(new object[] {
"Everywhere",
"Main menu only",
"Single AyaNova object",
"List of AyaNova objects"});
this.cbShowFor.Location = new System.Drawing.Point(9, 82);
this.cbShowFor.Name = "cbShowFor";
this.cbShowFor.Size = new System.Drawing.Size(472, 21);
this.cbShowFor.TabIndex = 10;
//
// ScriptHeader
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(497, 592);
this.Controls.Add(this.cbShowFor);
this.Controls.Add(this.btnOK);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.cklBizObjects);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.edName);
this.Controls.Add(this.lblShowInMenuAs);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Name = "ScriptHeader";
this.Text = "Script header - menu visibility options";
this.Load += new System.EventHandler(this.ScriptHeader_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label lblShowInMenuAs;
private System.Windows.Forms.TextBox edName;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.CheckedListBox cklBizObjects;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.Button btnOK;
private System.Windows.Forms.ComboBox cbShowFor;
}
}

View File

@@ -0,0 +1,147 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using GZTW.AyaNova.BLL;
namespace AyaNova.PlugIn.AyaScript
{
public partial class ScriptHeader : Form
{
public string Script { get; set; }
public ScriptHeader()
{
InitializeComponent();
cklBizObjects.DataSource = Enum.GetValues(typeof(RootObjectTypes));
}
private void ScriptHeader_Load(object sender, EventArgs e)
{
this.Icon = Resource.ScriptIco;
this.btnOK.Image = (System.Drawing.Image)Util.AYS.AyaNovaResourceManager.GetObject("OK24");
this.btnCancel.Image = (System.Drawing.Image)Util.AYS.AyaNovaResourceManager.GetObject("Cancel24");
ParseScript();
}
#region parse
/// <summary>
/// Read settings from script and update form controls
/// </summary>
private void ParseScript()
{
Util.ScriptItem si = new Util.ScriptItem(Script);
//set controls
edName.Text = si.ScriptName;
cbShowFor.SelectedItem = si.ScriptShowInMenuFor;
for (int x = 0; x < cklBizObjects.Items.Count; x++)
{
if (si.ScriptHandlesTypes.Contains((RootObjectTypes)Enum.Parse(typeof(RootObjectTypes), cklBizObjects.Items[x].ToString(), true)))
cklBizObjects.SetItemChecked(x, true);
else
cklBizObjects.SetItemChecked(x, false);
}
}
/// <summary>
/// Update settings from form controls to script
/// </summary>
private void UpdateScript()
{
//Name
string sNewName = "//Name: " + edName.Text;
string sOldName = Util.rxName.Match(Script).Value;
if (string.IsNullOrEmpty(sOldName))
Script = sNewName + Script;
else
Script = Script.Replace(sOldName, sNewName);
//Show in menu for
string sNewShowInMenuFor = "//ShowInMenuFor: " + cbShowFor.SelectedItem.ToString();
string sOldShowInMenuFor = Util.rxShowInMenuFor.Match(Script).Value;
if (string.IsNullOrEmpty(sOldShowInMenuFor))
Script = sNewShowInMenuFor + "\r\n" + Script;
else
Script = Script.Replace(sOldShowInMenuFor, sNewShowInMenuFor);
//Object types
string sOldObjectTypes=Util.rxHandlesAyaNovaTypes.Match(Script).Value;
System.Text.StringBuilder sbNew = new StringBuilder();
for (int x = 0; x < cklBizObjects.Items.Count; x++)
{
if (cklBizObjects.GetItemChecked(x))
{
sbNew.Append(cklBizObjects.Items[x].ToString());
sbNew.Append(", ");
}
}
if (sbNew.Length > 2)
sbNew.Length = sbNew.Length - 2;
else
sbNew.Append("Nothing");
if (string.IsNullOrEmpty(sOldObjectTypes))
Script = "//HandlesAyaNovaTypes: " + sbNew.ToString() + "\r\n" + Script;
else
Script = Script.Replace(sOldObjectTypes, "//HandlesAyaNovaTypes: " + sbNew.ToString());
}
#endregion parse
private void btnCancel_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
Close();
}
private void btnOK_Click(object sender, EventArgs e)
{
//Sanity check
if (string.IsNullOrEmpty(edName.Text))
{
MessageBox.Show("Name is a required field!");
return;
}
if (cbShowFor.SelectedIndex==-1)
{
MessageBox.Show("Show for selection is required!");
return;
}
if (cklBizObjects.CheckedItems.Count == 0)
{
if (cbShowFor.SelectedItem.ToString().Contains("Single AyaNova object") || cbShowFor.SelectedItem.ToString().Contains("List of AyaNova objects"))
{
MessageBox.Show("AyaNova type(s) must be selected when single or list show for is selected");
return;
}
}
//ok safe to proceed
UpdateScript();
DialogResult = DialogResult.OK;
Close();
}
//======================================
}
}

View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -0,0 +1,538 @@
/*
Colours used:
body.background = #DAF3FD (Outside of page background very light windows 7 style blue)
H1, h2, h3=#F58220 (Dark orange)
Hyperlinks/menu items= #2176A8 (darker blue version of body background)
Active menu item= #144461 (Darker blue version of menu item)
compress before "release": http://www.cssdrive.com/compressor/compress.php
*/
body
{
background-position: #FF3399;
margin: 0;
padding: 0;
background: #DAF3FD;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 80%;
color: #000000;
}
h1, h2, h3
{
margin: 0;
font-weight: bold;
color: #F58220;
}
h1 {
letter-spacing: -1px;
font-size: 2em;
}
h2
{
font-size: 1.5em;
padding-top: 1.5em;
padding-bottom: 1.5em;
}
p, ul, ol {
margin: 0 0 2em 0;
/*text-align: justify;*/
line-height: 1.5em;
}
p.indentedsubitem
{
padding-left:20px;
}
/*testimonials*/
p.quote
{
font-size:1em;
color: #038D0E;
line-height: 1em;
}
a:link
{
color: #2176A8;
text-decoration: none;
}
a:visited
{
color: #064A5E;
}
a:hover
{
text-decoration: underline;
color: #2176A8;
}
a:active
{
text-decoration: underline;
color: #2176A8;
}
img {
border: none;
}
img.left {
float: left;
margin: 7px 15px 0 0;
}
img.right {
float: right;
margin: 7px 0 0 15px;
}
/* Form */
form {
margin: 0;
padding: 0;
}
fieldset {
margin: 0;
padding: 0;
border: none;
}
legend {
display: none;
}
input, textarea, select {
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
font-size: 1em;
color: #333333;
}
/* Header */
#header
{
/* uncomment to view layout
border-style: dotted;
border-color: #FF0000;*/
padding: 10px 20px 10px 20px;
width: 900px;
height: 75px;
margin: auto;
/*background images: http://lab.rails2u.com/bgmaker/*/
background: url(images/topfade.png) repeat-x left top;
}
#header h1
{
font-size: 2em;
color: #000000;
/*float: right;*/
vertical-align:middle;
text-align:center;
}
#header img
{
float: left;
}
.textmiddle {vertical-align:middle;}
#searchdiv
{
float:right;
width: 250px;
}
/* Div container for Menu, keeps it aligned and with enough blank space beneath */
#menudiv
{
float: left;
width: 590px;
padding: 0px 0px 0px 0px;
}
/* Page */
#page
{
width: 900px;
margin: 0 auto;
padding: 20px 20px;
background-color: #FFFFFF;
}
/* Content (left side large panel) */
#content
{
float: left;
width: 590px;
padding: 0px 30px 0px 30px;
border-right-style: solid;
border-right-width: 1px;
border-right-color: #DAF3FD;
}
#content h3 {
text-align:left;
font-size: 1.5em;
padding-bottom: 0.5em;
border-bottom: 1px solid #DAF3FD;
}
#content h4 {
text-align:left;
font-size: 1.0em;
padding-bottom: 1em;
border-top: 5px solid #DAF3FD;
}
div.contentblock
{
margin-top:1em;
margin-bottom:7em;
}
/* Sidebar */
#sidebar {
float: right;
width: 230px;
}
#sidebar ul {
margin: 0;
padding: 10px 0 0 0;
list-style: none;
}
#sidebar li
{
margin-bottom: 40px;
font-size: 1em;
}
#sidebar li ul {
}
#sidebar li li {
margin: 0;
padding: 3px 0;
border-bottom: 1px dashed #D1D1D1;
}
#sidebar li li a {
margin: 0;
}
#sidebar h2
{
margin-bottom: 10px;
padding-bottom: 5px;
border-bottom: 10px solid #EDEDED;
font-size: 1.5em;
font-weight: bold;
border-bottom-color: #DAF3FD;
border-bottom-width: 5px;
}
#sidebar a {
text-decoration: none;
color: #2176A8;
}
#sidebar a:hover, a:active {
text-decoration: underline;
color: #2176A8;
}
/* Footer */
#footer
{
background-position: left top;
width: 900px;
margin: 0 auto;
padding: 20px 20px;
/*background images: http://lab.rails2u.com/bgmaker/*/
background: url(images/bottomfade.png) repeat-x left top;
font-family: Tahoma, Arial, Helvetica, sans-serif;
}
html>body #footer {
height: auto;
}
#legal {
clear: both;
padding-top: 20px;
text-align: center;
font-size: 0.75em;
color: #000000;
}
/* Products / purchase table */
#pricing
{
font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
width:100%;
}
#pricing table
{
border:none;
}
#pricing td, #pricing th
{
font-size:1em;
padding:3px 7px 2px 7px;
}
#pricing th
{
font-size:1.1em;
text-align:left;
padding-top:5px;
padding-bottom:4px;
color:#F58220;
background: url(images/bg1x25fade.png) repeat-x left top;
}
#pricing td
{
background: url(images/bg1x25fade.png) repeat-x left top;
}
/* Css Menu http://purecssmenu.com/ */
ul.cssMenu ul{display:none}
ul.cssMenu li:hover>ul{display:block}
ul.cssMenu ul{position: absolute;left:-1px;top:98%;}
ul.cssMenu ul ul{position: absolute;left:98%;top:-2px;}
ul.cssMenu,ul.cssMenu ul {
margin:0px;
list-style:none;
padding:0px 2px 2px 0px;
background-color:#ffffff;
background-repeat:repeat;
border-color:#AAAAAA;
border-width:1px;
border-style:solid;
}
ul.cssMenu table {border-collapse:collapse}ul.cssMenu {
display:block;
zoom:1;
float: left;
}
ul.cssMenu ul{
width:199.5px;
}
ul.cssMenu li{
display:block;
margin:2px 0px 0px 2px;
font-size:0px;
}
ul.cssMenu a:active, ul.cssMenu a:focus {
outline-style:none;
}
ul.cssMenu a, ul.cssMenu li.dis a:hover, ul.cssMenu li.sep a:hover {
display:block;
vertical-align:middle;
background-color:#ffffff;
border-width:0px;
border-color:#6655ff;
border-style:solid;
text-align:left;
text-decoration:none;
padding:4px;
_padding-left:0;
font:15px Verdana;
color: #2176A8;
text-decoration:none;
cursor:default;
}
ul.cssMenu span{
overflow:hidden;
}
ul.cssMenu li {
float:left;
}
ul.cssMenu ul li {
float:none;
}
ul.cssMenu ul a {
text-align:left;
white-space:nowrap;
}
ul.cssMenu li.sep{
text-align:center;
padding:0px;
line-height:0;
height:100%;
}
ul.cssMenu li.sep span{
float:none; padding-right:0;
width:5;
height:16;
display:inline-block;
background-color:#AAAAAA; background-image:none;}
ul.cssMenu ul li.sep span{
width:80%;
height:3;
}
ul.cssMenu li:hover{
position:relative;
}
ul.cssMenu li:hover>a{
background-color:#2176A8;
border-color:#665500;
border-style:solid;
font:15px Verdana;
color: #ffffff;
text-decoration:none;
}
ul.cssMenu li a:hover{
position:relative;
background-color:#2176A8;
border-color:#665500;
border-style:solid;
font:15px Verdana;
color: #ffffff;
text-decoration:none;
}
ul.cssMenu li.dis a {
color: #AAAAAA !important;
}
ul.cssMenu img {border: none;float:left;_float:none;margin-right:4px;width:16px;
height:16px;
}
ul.cssMenu ul img {width:16px;
height:16px;
}
ul.cssMenu img.over{display:none}
ul.cssMenu li.dis a:hover img.over{display:none !important}
ul.cssMenu li.dis a:hover img.def {display:inline !important}
ul.cssMenu li:hover > a img.def {display:none}
ul.cssMenu li:hover > a img.over {display:inline}
ul.cssMenu a:hover img.over,ul.cssMenu a:hover ul img.def,ul.cssMenu a:hover a:hover ul img.def,ul.cssMenu a:hover a:hover a:hover ul img.def,ul.cssMenu a:hover a:hover img.over,ul.cssMenu a:hover a:hover a:hover img.over,ul.cssMenu a:hover a:hover a:hover a:hover img.over{display:inline}
ul.cssMenu a:hover img.def,ul.cssMenu a:hover ul img.over,ul.cssMenu a:hover a:hover ul img.over,ul.cssMenu a:hover a:hover a:hover ul img.over,ul.cssMenu a:hover a:hover img.def,ul.cssMenu a:hover a:hover a:hover img.def,ul.cssMenu a:hover a:hover a:hover a:hover img.def{display:none}
ul.cssMenu a:hover ul,ul.cssMenu a:hover a:hover ul,ul.cssMenu a:hover a:hover a:hover ul{display:block}
ul.cssMenu a:hover ul ul,ul.cssMenu a:hover a:hover ul ul{display:none}
ul.cssMenu span{
display:block;
background-image:url(./images/arrv_anim_1.gif);
background-position:right center;
background-repeat: no-repeat;
padding-right:11px;}
ul.cssMenu li:hover>a>span{ background-image:url(./images/arrv_anim_1o.gif);
}
ul.cssMenu a:hover span{ _background-image:url(./images/arrv_anim_1o.gif)}
ul.cssMenu ul span,ul.cssMenu a:hover table span{background-image:url(./images/arr_double_1.gif)}
ul.cssMenu ul li:hover > a span{ background-image:url(./images/arr_double_1o.gif);}
ul.cssMenu table a:hover span,ul.cssMenu table a:hover a:hover span,ul.cssMenu table a:hover a:hover a:hover span{background-image:url(./images/arr_double_1o.gif)}
ul.cssMenu table a:hover table span,ul.cssMenu table a:hover a:hover table span{background-image:url(./images/arr_double_1.gif)}
ul.cssMenu li.sep span{
float:none; padding-right:0;
width:5;
height:16;
display:inline-block;
background-color:#AAAAAA; background-image:none;}
ul.cssMenu ul li.sep span{
width:80%;
height:3;
}
ul.cssMenu li:hover{
position:relative;
}
ul.cssMenu li:hover>a{
background-color:#2176A8;
border-color:#665500;
border-style:solid;
font:normal 15px Verdana;
color: #ffffff;
text-decoration:underline;
}
ul.cssMenu li a:hover{
position:relative;
background-color:#2176A8;
border-color:#665500;
border-style:solid;
font:normal 15px Verdana;
color: #ffffff;
text-decoration:underline;
}
ul.cssMenu li.dis a {
color: #AAAAAA !important;
}
ul.cssMenu img {border: none;float:left;_float:none;margin-right:4px;width:16px;
height:16px;
}
ul.cssMenu ul img {width:16px;
height:16px;
}
ul.cssMenu img.over{display:none}
ul.cssMenu li.dis a:hover img.over{display:none !important}
ul.cssMenu li.dis a:hover img.def {display:inline !important}
ul.cssMenu li:hover > a img.def {display:none}
ul.cssMenu li:hover > a img.over {display:inline}
ul.cssMenu a:hover img.over,ul.cssMenu a:hover ul img.def,ul.cssMenu a:hover a:hover ul img.def,ul.cssMenu a:hover a:hover a:hover ul img.def,ul.cssMenu a:hover a:hover img.over,ul.cssMenu a:hover a:hover a:hover img.over,ul.cssMenu a:hover a:hover a:hover a:hover img.over{display:inline}
ul.cssMenu a:hover img.def,ul.cssMenu a:hover ul img.over,ul.cssMenu a:hover a:hover ul img.over,ul.cssMenu a:hover a:hover a:hover ul img.over,ul.cssMenu a:hover a:hover img.def,ul.cssMenu a:hover a:hover a:hover img.def,ul.cssMenu a:hover a:hover a:hover a:hover img.def{display:none}
ul.cssMenu a:hover ul,ul.cssMenu a:hover a:hover ul,ul.cssMenu a:hover a:hover a:hover ul{display:block}
ul.cssMenu a:hover ul ul,ul.cssMenu a:hover a:hover ul ul{display:none}
ul.cssMenu span{
display:block;
background-image:url(./images/arrv_anim_1.gif);
background-position:right center;
background-repeat: no-repeat;
padding-right:11px;}
ul.cssMenu li:hover>a>span{ background-image:url(./images/arrv_anim_1o.gif);
}
ul.cssMenu a:hover span{ _background-image:url(./images/arrv_anim_1o.gif)}
ul.cssMenu ul span,ul.cssMenu a:hover table span{background-image:url(./images/arr_double_1.gif)}
ul.cssMenu ul li:hover > a span{ background-image:url(./images/arr_double_1o.gif);}
ul.cssMenu table a:hover span,ul.cssMenu table a:hover a:hover span,ul.cssMenu table a:hover a:hover a:hover span{background-image:url(./images/arr_double_1o.gif)}
ul.cssMenu table a:hover table span,ul.cssMenu table a:hover a:hover table span{background-image:url(./images/arr_double_1.gif)}

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

View File

@@ -0,0 +1,226 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>AyaScript for AyaNova plugin</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="keywords" content=" service management software scripting, work order software scripting, ayanova scripts" />
<meta name="description" content="AyaNova work order &amp; service management software for repair shops scripting plugin." />
<link href="default.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div>
<!-- start header -->
<div id="header">
<h1>
<img alt="AyaScript AyaNova service management software scripting plugin logo" title="AyaScript AyaNova service management software scripting plugin logo"
src="images/AyaNova_Service_Management_Software_Logo.png" class="textmiddle" />
AyaScript for AyaNova</h1>
</div>
<!-- end header -->
</div>
<!-- start page -->
<div id="page">
<!-- start content -->
<div id="content">
<h2>
Harness the power of the AyaNova API from within AyaNova!</h2>
<p>
Create and execute c# code directly from the AyaNova plugin menu.
</p>
<div class="contentblock">
<h3>
About AyaScript
</h3>
<img class="left" src="images/Script128.png" alt="AyaScript for AyaNova service management software logo" title="AyaScript for AyaNova" border="0" />
<p>AyaScript provides an editor and runtime environment to develop and execute your own c# code using the AyaNova API and any other resources of the .net framework.</p>
<p>The cool thing about AyaScript is it's quick, easy and everything is provided to build and execute your code without requiring any other programs or utilities such as a development environment.</p>
<p>Scripts are available from within the AyaNova AyaScript plugin menu from anywhere in AyaNova that you specify.</p>
<p>This means you can quickly create useful utilities or Add-on's without having to build a full AyaNova plugin or stand alone application and your end users can execute the script from within the AyaNova program without any programming knowledge.</p>
<p>Example scripts are provided to get you started</p>
<p>AyaScript is also useful for AyaNova support to provide end users with snippets of code to resolve unique problems in a timely manner</p>
<p>Since AyaScript code is standard c# code any code developed in AyaScript can easily be turned into a separate AyaNova plugin or stand alone program that uses the AyaNova API</p>
</div>
<div class="contentblock">
<h3>
How it works
</h3>
<img class="right" src="images/tropical.png" alt="" title="Image by Titus Tscharntke" border="0" />
<p>Scripts are written in standard c# code and have access to the full AyaNova API and AyaNova business object or list of objects that a user selects in AyaNova.</p>
<p>When a script is selected to execute by the end user the relevant objects from the AyaNova application are passed to the script and it's compiled and an assembly is generated and executed on the fly.</p>
<p>Generated assemblies are cached so there is no performance penalty for scripts that are executed repeatedly.</p>
<p>Scripts are plain text and everything required to run them is stored in one text "file" so you can easily move them and share them with others.</p>
<p>All scripts are stored in an xml file (AyaScripts.xml) in the AyaScript plugin folder in the AyaNova program files folder. You do not need to work directly with this file as the AyaScript Editor handles all script persistence and all information required for a script to execute is stored in the text of the script itself.</p>
</div>
<div class="contentblock">
<h3>
Dangers and Limitations
</h3>
<img class="right" src="images/palm.png" alt="" title="Image by Titus Tscharntke" border="0" />
<p>AyaScript supports c# only, other development languages are not supported.</p>
<p>Users will need to be experienced in .net development to use AyaScript</p>
<p>We do not provide support for development questions, however we will answer questions regarding the AyaNova API itself. In other words we can not teach you how to program but we will be happy to answer questions about using the AyaNova API on the development support forum.</p>
<p><b>AyaScript is potentially dangerous</b> - it allows you to do anything you can do in the AyaNova program but a million times more quickly so it's very easy to damage your data. <b>There is no safety net.</b> For this reason we recommend in the strongest possible terms that you develop your scripts on a trial database or a copy of your live data and test thoroughly before you even consider making the script available to your live data users</p>
</div>
<div class="contentblock">
<h3>
Getting started
</h3>
<img class="right" src="images/redleaves.png" alt="" title="Image by Titus Tscharntke" border="0" />
<p>Setup a safe environment to test development: Use a copy of your database or download an install the trial version of AyaNova</p>
<p>We recommend doing development work in a virtual machine. In fact all AyaNova development we do here is within virtual machines, there are many benefits to doing so. We use VMWare Workstation for our own developers however we have also tried the free Virtual Box utility and it is sufficient for AyaNova development though not as fast in our experience. Developing in a virtual machine means you can safely isolate your testing and development from your live AyaNova and a virtual machine can be easily backed up and transported between hardware platforms if your computer should "crater" meaning little or no down time.</p>
<p>Once you have a safe development environment set up, download and install the free AyaScript plugin from the AyaNova plugin's page.</p>
<p>Run AyaNova and select the AyaScript plugin, you will see several sample scripts. To view the code for them select the first option which is always the AyaScript Editor. Select Script->Open and choose the script you want to see the source code for.</p>
</div>
<div class="contentblock">
<h3>
Script HEADER section format
</h3>
<img class="right" src="images/papyrus.png" alt="" title="Image by Titus Tscharntke" border="0" />
<p>AyaScripts consist of two sections, the header and main body.</p>
<p><b>Header</b> - The header contains c# single line style comments that are instructions to the AyaScript processor telling it when and where to show the script menu option to the end user and also the name of the script to display in the menu.</p>
<p>The header section is *required*, if any part of it is missing or malformed or doesn't pass a "sanity" check your script will not run or will not be available. Use the Header builder tool to ensure your script is compliant</p>
<p>AyaScript editor comes with a Header builder tool to automate the process of setting up the header section correctly, you can use the header builder at any time to create or edit the header or once you become more familiar with the header format you can simply type in the options. The header builder is available from the Edit->Header menu option in AyaScript.</p>
<p>Note that the header builder displays all possible object types in AyaNova defined in the RootObjectTypes enumerator in the AyaNova business object library; at present not all types listed are supported from the plugin menu as there is either no editor for them in the AyaNova program or they are not an editable type. However all the main Root object types in AyaNova that your users are generally concerned with are supported. We've provided all of them as we may add editors for other types in future through a future update to the AyaNova program itself.</p>
<p>Header line: <b>//Script created:</b> - This is not a required line, it's simply a convenience that is added by the header builder when a new script is created, you can delete it if you don't want it there.</p>
<p>Header line: <b>//Name:</b> - This is required. When a new script is created using the new script command it's set to the current date and time however you can edit it to whatever you want. This is the text displayed to the end user in the AyaScript->scripts list. Ideally it should be unique but AyaScript won't explode if you accidentally name two the same as internally it generates a unique Guid for each script when they are loaded and uses that instead of the name.</p>
<p>Header line: <b>//ShowInMenuFor:</b> - This is required. This controls in what situations AyaScript will offer the script to the end user in the menu. Your choices are Everywhere, Main menu only, Single AyaNova object, List of AyaNova objects</p>
<p><ul>
<lh><u>Show in menu for</u></lh>
<li>Everywhere</li>
<p>Show regardless of where the AyaNova user is in the AyaNova user interface. Generally this would be for utilities that are not tied to a specific business object, for example our Screenshot script, however the list or single object *is* passed to the script so this could also be for scripts that are designed to work with any object.</p>
<li>Main menu only</li>
<p>Only show from the main menu plugin menu item. This is generally used for utilities that are not designed to work with a specific business object and indeed when a script is called from the main menu no object is passed to the script since there isn't one and the object type is set to nothing.</p>
<li>Single AyaNova object</li>
<p>Only show from the single object editing form and only for the object types specified in the //HandlesAyaNovaTypes: (detailed below). For example you may want a script to only be available when in the client entry form or the work order entry form. This option specifically excludes offering the script in the menu when the user is viewing a list of AyaNova objects in the user interface.</p>
<li>List of AyaNova objects</li>
<p>Only offer the script in the AyaScript plugin menu when the user is viewing a list of AyaNova objects (i.e. the main form right window). For example if the user selects clients (or units or vendors or workorders etc etc) in the left side navigation window and a list of clients is displayed in the right pane. Note that when a script is selected from a list like this, the ID list contains only the objects <b>selected</b> by the end user so if a user want's to apply your script to objects in the list they need to select them first. That being said the underlying list object *is* passed to the script so you can iterate all the items in the list yourself if none are selected and in fact many of our plugins work that way on the assumption that if a user hasn't specficially selected one or more objects then their intention is to apply the plugin to *all* the objects in the list.</p>
</ul> </p>
<p>Header line: <b>//HandlesAyaNovaTypes: </b> - This is required. This controls which object types you want your script to be shown for. This is the text of the RootObjectTypes enumeration in the AyaNova API. Use the script header builder to easily choose the root object types you want to support and ensure they are spelled correctly. Your script can handle more than one type however if it does you will need to check the type of the object passed and cast it accordingly. Generics can be helpful here though scripts are so quick and easy you might find it easier to simply copy and paste your script and change accordingly for the different object types. For example if you have a script to process a Client and want to do the same with a HeadOffice it might be simpler and quicker to simply copy the script and change the object types in it rather than adding a switch statement and replicating the same code in one script. Note as stated earlier: *all* AyaNova RootObjectTypes are listed however not all are suppored by the AyaNova plugin system. Some are not real objects edited by the end user and some just don't have an interface for editing alone, however we've left all in because future updates of AyaNova may contain support for more objects. The easy way to tell if an object you want to work with is supported is simply run AyaNova go the the form where you can edit or view that object and see if the plugin menu option is displayed in the menu at the top. If it is, that object type is supported and you can work with it in your script. At present pretty much every object of any consequence is supported.</p>
</div>
<div class="contentblock">
<h3>
Script main body section format
</h3>
<img class="right" src="images/bamboo.png" alt="" title="Image by Titus Tscharntke" border="0" />
<p><b>Body</b> - The body of scripts consists of standard c# code. There is one required method (AyaScriptMain) and the rest is up to you. You can add other methods, other classes, includes etc as long as you include the required AyaScriptMain method. Think of the AyaScriptMain method as the equivalent of a Main method in a c# console application. It's the method that AyaScript expects to be there and calls with set parameters. </p>
<p><b>Comments / Includes / stuff at the top</b> - You can specify anything you want above the AyaScriptMain method. Remember this is standard c# so you can use multiline style comments /*comment*/ or single line comments //. You can also use include statements to save typing. Note that AyaScript automatically inserts include statements for you just before compiling the code, this is provided as a convenience, however if you specify the same include AyaScript is smart enough to know not to add it again and won't. The automatically inserted includes are: <ul>
<li>System.Collections.Generic</li>
<li>System.Data</li>
<li>System.Drawing</li>
(Note: System.Drawing.Region conflicts with the AyaNova business object Region so you must fully qualify like this: GZTW.AyaNova.BLL.Region)
<li>System.Text</li>
<li>System.Windows.Forms</li>
<li>GZTW.AyaNova.BLL</li>
<li>AyaNova.PlugIn.AyaScript</li>
(Used for predefined forms we may add from time to time. Initially there is one CopyableMessageBox form included see the sample for details)
</ul> </p>
<p><b>AyaScriptMain</b> - The main entry point for your script. Required to be present with the exact method signature and parameters like this: </p>
<p class="quote">public static void AyaScriptMain(bool IsList, RootObjectTypes objectType, Object ayaNovaObject, List<Guid> objectIDList)</br>
{</br>
MessageBox.Show("Hello from AyaScript!");</br>
}
</p>
<ul>
<li>IsList</li>
<p>Will be true if script was called from a list form.</p>
<li>objectType</li>
<p>AyaNova RootObjectType of passed ayaNovaObject or the type of object in the list if it's a list object</p>
<li>ayaNovaObject</li>
<p>If a single object then this is the AyaNova business object, if a list then this is the list object, if called from the main menu where there is no object this is DBNull.Value. Note: this is never simply "null".</p>
<li>objectIDList</li>
<p>If a list, this contains the id's of the AyaNova objects which the end user has *selected* in the list, otherwise it's an empty list. If IsList is true and this list is empty it means the user selected your script from a list but hasn't selected any items in the list. You can either warn them about this or treat it as an intention to apply your script to all objects in the list in which case you can get access to the entire list through the ayaNovaObject parameter which will be the underlying list object itself.</p>
</ul>
</div>
<div class="contentblock">
<h3>
Support / API documentation / Share scripts
</h3>
<img class="right" src="images/pine.png" alt="" title="Image by Titus Tscharntke" border="0" />
<p><b>Support</b> - As stated previously, while we cannot teach you how to program we are happy to provide help with specific problems using the AyaNova API itself. Post your questions to the <a href="http://forum.ayanova.com/Forum101-1.aspx" target="_blank">AyaNova Development / SDK / API section</a> of the AyaNova support forum.
</p>
<p><b>API documentation</b> - <a href="http://api.ayanova.com/" target="_blank">The full AyaNova API documentation is available on our website</a>.</p>
<p><b>Share your scripts</b> - If you've come up with a handy script you'd like to share with others copy and paste it into a post in the development area of our support forum. As we get more samples we'll likely open up a specific area for sample code.</p>
</div>
</div>
<!-- end content -->
<!-- start sidebar -->
<div id="sidebar">
<ul>
<li>
<h2>Handy links</h2>
<ul>
<li>AyaNova Development / API / SDK <a href="http://forum.ayanova.com/Forum101-1.aspx" target="_blank">support forum</a></li>
<li>AyaNova API <a href="http://api.ayanova.com/" target="_blank">documentation</a></li>
<li>Download <a href="http://www.ayanova.com/plugins.htm" target="_blank">AyaNova Plugins</a> including AyaScript</li>
<li>c# language <a href="http://msdn.microsoft.com/en-us/library/aa645596(VS.71).aspx" target="_blank">specifications</a></li>
<li><a href="http://stackoverflow.com/" target="_blank">Stack Overflow</a> questions and answers for programmers</li>
<li><a href="http://www.codeproject.com" target="_blank">CodeProject.com</a> - questions answers and articles for programmers</li>
</ul>
<h2>Free development environments</h2>
<p>While an integrated development environment is not required to work with AyaScript it can be useful to have an ide on hand to get the syntax and spelling correct for more complex scripts. We use Visual Studio Professional in-house however there are a couple of free alternatives available:</p>
<ul>
<li>Microsoft&reg; Visual C#&reg; 2008 <a href="http://www.microsoft.com/express/Windows/" target="_blank">Express Edition</a></li>
<li><a href="http://www.icsharpcode.net/OpenSource/SD/" target="_blank">#develop</a> (short for SharpDevelop) is a free, open source IDE for C#</li>
</ul>
<h2>Special thanks</h2>
<p>AyaScript uses the excellent <a href="http://csscript.net/" target="_blank">CS-Script</a>&copy; script execution engine by Oleg Shilo.</p>
</li>
</ul>
</div>
<!-- end sidebar -->
<div style="clear: both;">
&nbsp;</div>
</div>
<!-- end page -->
<!-- start footer -->
<div id="footer">
<p id="legal">
Copyright&copy; 1999, 2010 Ground Zero Tech-Works Inc. AyaNova&reg; is either a
registered trademark or trademark of Ground Zero Tech-Works Inc. in the United States
and/or other countries.
</p>
</div>
<!-- end footer -->
</body>
</html>