Jump to content

I want to generate the Custom Hooks

  • Please log in to reply
5 replies to this topic

#1 Guest_Xiao_*

  • Guests

Posted 11 January 2005 - 09:36 AM

I want to generate the Custom Hooks, can i input my code in function PreInsert? if i can input my code, how do i generate .net Components without replaced by TierDeveloper generate the code of GYSHooks automatically ? for example,

public class GYSHooks : ServicedComponent
public const int SUCCESS_CONTINUE = 0;
public const int SUCCESS_NONCONTINUE = 1;
public const int FAIL_NONCONTINUE = 2;

public int PreInsert(System.Data.OleDb.OleDbConnection Conn, GYS objInfo)
// here, input my code



#2 Guest_Paul_*

  • Guests

Posted 11 January 2005 - 09:39 AM


Yes, you can put your own code in the pre/post functions. TierDeveloper facilitates the user to customize the generated code behavior through "Custom Hooks" feature.

Once you are done generating your data components you can insert code in your Custom Hook Classes and can build them as components from the .NET. If at later stage you need to regenerate the components, TierDeveloper will prompts you for whether you want to overwrite the existing Custom Hook classes here you need to skip them so it won't get overwritten.

As TierDeveloper generates Custom Hook Classes in a separate folder "Hooks" you can make backup of these classes, before regenerating the components, so that you won't lost your code.

#3 Guest_cylosoft_*

  • Guests

Posted 17 May 2005 - 02:43 PM

What if I need to add references to the project, and TierDev needs to change the project? I always lose my references.

#4 Guest_Paul_*

  • Guests

Posted 23 May 2005 - 07:57 AM

The best solution to this issue is to modify the templates so that TierDeveloper can incorporate your code every time you rebuild or regenerate.

If you want to add references to components project, please do the following.

1. Open the script template Project.cs_csproj.ts from the
2. Find the tag <References> in this template.
Add a new Reference tag and provide your assembly information ...

Name = "System.Data.OracleClient"
AssemblyName = "System.Data.OracleClient"
HintPath = "specify location here"
3. Done!. Go to TierDeveloper, generate and build the components it will automatically add your dll to the project's References.

I hope it solves your situation.

#5 Guest_DamonCarr_*

  • Guests

Posted 15 November 2005 - 01:03 PM

Where are the XML Attributes Documents?

For example, it appears you are trying to only generate hooks if the current time is in some way related to the existance of the hooksgenerated.dat file you create hidden in the HOOKS directory. In the Template IDE it says:

<target name="Hooks" depends="initHooks">
<CompareFileStamp src="${TierDevFile}" target="${HooksDir}/hooksgenerated.dat"/>

OK what is this doing? As I have mentioned in other posts no matter what I do, for either your default C# Component Template or for my custom template, my hooks are all blow away every time.

How can I make this work? I add a bunch of custom code to a hook and BOOM it is blown away.. Very Frustrating...

Kind Regards,

Damon Carr

#6 Guest_Paul_*

  • Guests

Posted 18 November 2005 - 06:23 AM

Please read the following thread I've addressed this issue there and let me know if you still have any issues.


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users