Repository.Action.AddAction: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
{{Template:APIClass|Repository Class|Repository}}
<noinclude>{{Template:API}}{{Template:APIBreadcrumb|10|Repository}}</noinclude>
{{Template:Repository.AddAction.Cmt}} {{Template:BooleanReturn.Cmt}}


==Syntax==
Saves a new [[CAction Class|cAction]] object to the Synthesis repository. Returns a '''Boolean''' value; when true, indicates that the action now exists in the repository.
*AddAction(ByVal action {{APIPrefix|As}} [[cAction Class|cAction]] ) {{APIPrefix|As Boolean}}
<noinclude>
== Syntax ==
''object''.'''Action.AddAction(''action'')'''


Parameters:
where ''object'' is a variable that represents a Repository object.
:''action'': An instance of [[cAction Class|cAction]] to add.


== Usage Example ==
=== Parameters ===
  {{APIComment|'Declare a new repository connection object.}}
{| {{APITable}}
   Dim MyRepository As New Repository
|-
    
|action{{APIParam|Required}}||The [[CAction Class|cAction]] object to be added.
  {{APIComment|'Connect to the Synthesis repository.}}
|}
   Dim Success As Boolean = False
 
   Success = MyRepository.ConnectToRepository("RepositoryFileNamePath")
 
    
== Example ==
  {{APIComment|'Set a first available project as current.}}
'''VBA'''
  MyRepository.Project.SetCurrentProject(0)
  {{APIPrefix|Dim}} MyRepository {{APIPrefix|As New}} Repository
{{APIComment|...'Add code to connect to a Synthesis repository.}}
  {{APIComment|'Create a new action. The following example creates an action named "MyNewAction."}}
   {{APIPrefix|Dim}} NewAction {{APIPrefix|As New}} cAction
   NewAction.Name = {{APIString|"MyNewAction"}}
  {{APIComment|'Add the new action to project #1. The action will be visible in the Synthesis repository upon refresh.}}
   MyRepository.Project.SetCurrentProject(1) 
   {{APIPrefix|Call}} MyRepository.Action.AddAction(NewAction)
 
'''VB.NET'''
   {{APIPrefix|Dim}} MyRepository {{APIPrefix|As New}} Repository
  {{APIComment|...'Add code to connect to a Synthesis repository.}}
{{APIComment|'Create a new action. The following example creates an action named "MyNewAction."}}
  {{APIPrefix|Dim}} NewAction {{APIPrefix|As New}} cAction ({{APIString|"MyNewAction"}})
   
   
{{APIComment|'Declare a new cAction.}}
  {{APIComment|'Add the new action to project #1. The action will be visible in the Synthesis repository upon refresh.}}
  Dim newAction As New cAction("NewAction1")
   MyRepository.Project.SetCurrentProject(1) 
 
   MyRepository.Action.AddAction(NewAction)
  {{APIComment|'Add the new action to the repository.}}
</noinclude>
   Dim SuccessAddAction As Boolean
   SuccessAddAction = MyRepository.Action.AddAction(newAction)

Revision as of 21:42, 16 July 2015

APIWiki.png


Member of: SynthesisAPI10Repository

Saves a new cAction object to the Synthesis repository. Returns a Boolean value; when true, indicates that the action now exists in the repository.

Syntax

object.Action.AddAction(action)

where object is a variable that represents a Repository object.

Parameters

Name Description
actionborder="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse; text-align: left; cellborder"
Name Status The cAction object to be added.


Example

VBA

 Dim MyRepository As New Repository
 ...'Add code to connect to a Synthesis repository. 

 'Create a new action. The following example creates an action named "MyNewAction." 
 Dim NewAction As New cAction
 NewAction.Name = "MyNewAction"

 'Add the new action to project #1. The action will be visible in the Synthesis repository upon refresh. 
 MyRepository.Project.SetCurrentProject(1)   
 Call MyRepository.Action.AddAction(NewAction)
VB.NET

 Dim MyRepository As New Repository
 ...'Add code to connect to a Synthesis repository. 

 'Create a new action. The following example creates an action named "MyNewAction." 
 Dim NewAction As New cAction ("MyNewAction")

 'Add the new action to project #1. The action will be visible in the Synthesis repository upon refresh. 
 MyRepository.Project.SetCurrentProject(1)   
 MyRepository.Action.AddAction(NewAction)