Repository.Control.AddXfmeaControl: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 2: Line 2:




<onlyinclude>Saves a new [[CXfmeaControl Class|cXfmeaControl]] object to the current project. Returns a '''Boolean''' value; when true, indicates a successful save.</onlyinclude>  
<onlyinclude>Adds a new Xfmea control to a Synthesis repository. Returns a '''Boolean''' value; when true, indicates a successful save.</onlyinclude>  


== Syntax ==
== Syntax ==
Line 9: Line 9:
=== Parameters ===
=== Parameters ===
''control''
''control''
:The [[CXfmeaControl Class|cXfmeaControl]] object to be added. (Required)
:Required. The [[CXfmeaControl Class|cXfmeaControl]] object to be added.




Line 25: Line 25:
   NewControl.Name = {{APIString|"MyNewControl"}}
   NewControl.Name = {{APIString|"MyNewControl"}}
   
   
  {{APIComment|'Add the new control to project #1. The control will be visible in the Synthesis repository upon refresh.}}
  {{APIComment|'Add the new control to project #1.}}
   MyRepository.Project.SetCurrentProject(1)   
   MyRepository.Project.SetCurrentProject(1)   
   {{APIPrefix|Call}} MyRepository.Control.AddXfmeaControl(NewControl)
   {{APIPrefix|Call}} MyRepository.Control.AddXfmeaControl(NewControl)
Line 39: Line 39:
   {{APIPrefix|Dim}} NewControl {{APIPrefix|As New}} cXfmeaControl ({{APIString|"MyNewControl"}})
   {{APIPrefix|Dim}} NewControl {{APIPrefix|As New}} cXfmeaControl ({{APIString|"MyNewControl"}})
   
   
  {{APIComment|'Add the new control to project #1. The control will be visible in the Synthesis repository upon refresh.}}
  {{APIComment|'Add the new control to project #1.}}
   MyRepository.Project.SetCurrentProject(1)   
   MyRepository.Project.SetCurrentProject(1)   
   MyRepository.Control.AddXfmeaControl(NewControl)
   MyRepository.Control.AddXfmeaControl(NewControl)

Revision as of 22:05, 24 August 2015

APIWiki.png


Member of: SynthesisAPI10.Repository


Adds a new Xfmea control to a Synthesis repository. Returns a Boolean value; when true, indicates a successful save.

Syntax

.Control.AddXfmeaControl(control)

Parameters

control

Required. The cXfmeaControl object to be added.


Example

This example creates a new Xfmea control resource, and then saves it in the first available project in a Synthesis repository.

VBA

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


 'Create a new control. The following example creates a control named "MyNewControl." 
 Dim NewControl As New cXfmeaControl
 NewControl.Name = "MyNewControl"

 'Add the new control to project #1. 
 MyRepository.Project.SetCurrentProject(1)   
 Call MyRepository.Control.AddXfmeaControl(NewControl)
VB.NET

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


 'Create a new control. The following example creates a control named "MyNewControl." 
 Dim NewControl As New cXfmeaControl ("MyNewControl")

 'Add the new control to project #1. 
 MyRepository.Project.SetCurrentProject(1)   
 MyRepository.Control.AddXfmeaControl(NewControl)