FinalBuilder Custom Action using C#

Hi -

  I'm writing a custom action in C#, it extends the IFBCustomAction interface.


  In the OnExecute method I want the ability to stop execution.  How can I do this?   It appears the AbortAction method is called when the user stops execution via the GUI.  I want to stop execution from the OnExecute method.

  I'm sure this is easy, I just can find it anywhere.

   Thanks -

    Rob

Hi Rob,

You can just do “return true” or “return false” from the OnExecute method, depending on whether or not you want to fail the action (true implies success.)

- Angus

PS If you’re using FB 6, have you tried out the new .NET Custom Action API?
https://www.finalbuilder.com/articles.aspx?mid=370&ctl=ArticleView&articleId=28

Hi Angus -

  See, I knew it was simple enough. 

  Do you have a document outlining the methods and properties of all objects available when writing custom actions?   I see the document ActionStudioManual.pdf but it doesn't appear to document all objects available to us.

  Thanks for your help

   Rob

Hi Rob,

There is a reference section in the back of ActionStudioManual.pdf. However, if you’re writing C# based actions and you’re using the new API (as linked above), there is a full help file which documents all the available C# helper method. This doesn’t cover everything, but it covers 99% of your needs.

You can find this help file in the FinalBuilder program directory under ActionDefs\Assemblies\2.0\VSoft.CustomActionApi.chm

The API help is also integrated into XML help for Visual Studio, so if you’re using the new API you’ll get “smart” intellisense comments, method and parameter descriptions.

Regards,

Angus

I am Begnieer …I want to write Custom Action in c# and Want use that Action in FB…I dont know how to do …



Hi,

A good place to start is the ActionStudioManual.pdf that is installed with FinalBuilder, if you have read that and still don’t know where to start, please let us know more specifically what problem’s you’re having.

Regards,
Paul.

Want to write simple action …i dont know where to start…can u provide step by step process

Hi Velu,

The ActionStudioManual.pdf contains a step-by-step guide on how to write custom actions, both script based (page 8) and .NET based (page 17), the document is installed with FinalBuilder and can be found on your computer in C:\Program Files\FinalBuilder 6\ActionStudioManual.pdf (assuming a default install location). Also, we have a short video on the website that gives a quick introduction to ActionStudio, you can find this at http://static.finalbuilder.com/Demos/actionstudio.html

Regards,
Paul.

I have Created the Custom action and stored it in the \Actiondefs path and when i saw in FB action category it is not listed …

I have Created the Custom Action using c# …In FB I dont know wat to give in the Namespace.Classname and Assembly Information …

Hi Velu,

> I have Created the Custom action and stored it in the \Actiondefs path and when i saw in FB action category it is not listed

FinalBuilder should automatically load the new action package the next time FinalBuilder starts, if it's not loading automatically you can try adding it manually by going to Tools -> Package Manager -> Add.

> I have Created the Custom Action using c# ...In FB I dont know wat to give in the Namespace.Classname and Assembly Information ..


"Namespace.ClassName" is the fully qualified name of the action class (ie MyCompany.MyNamespace.HelloWorldAction)

"Assembly" is the name of the assembly file, which must be located inside the ActionDefs\Assemblies\< ver >directory.