Repository.Control.AddXfmeaControl: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Template:API}}{{Template:APIBreadcrumb|10|.[[Repository Class|Repository]]}}
{{Template:API}}{{Template:APIBreadcrumb|.[[Repository Class|Repository]]}}




<onlyinclude>Adds a new Xfmea control to a Synthesis repository. Returns a '''Boolean''' value; when true, indicates a successful save.</onlyinclude>  
<onlyinclude>Adds a new Xfmea control to the current project. Returns a '''Boolean''' value; when true, indicates a successful save.</onlyinclude>  


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




Line 16: Line 16:
  '''VBA'''
  '''VBA'''
   
   
  {{APIComment|'Add code to connect to a Synthesis repository.}}
  {{APIComment|'Declare a new Repository object and connect to a Synthesis repository.}}
   {{APIPrefix|Dim}} MyRepository {{APIPrefix|As New}} Repository
   {{APIPrefix|Dim}} MyRepository {{APIPrefix|As New}} Repository
  {{APIComment|...}}
  MyRepository.ConnectToAccessRepository({{APIString|"C:\RSRepository1.rsr10"}})
 
  {{APIComment|'Create a new control. The following example creates a control with the description "MyNewControl."}}
  {{APIComment|'Create a new control. The following example creates a control with the description "MyNewControl."}}
  {{APIPrefix|Dim}} NewControl {{APIPrefix|As New}} cXfmeaControl
  {{APIPrefix|Dim}} NewControl {{APIPrefix|As New}} cXfmeaControl
  NewControl.ControlDescription = {{APIString|"MyNewControl"}}
  NewControl.ControlDescription = {{APIString|"MyNewControl"}}
   
   
  {{APIComment|'Add the new control to project #1.}}
  {{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)


  '''VB.NET'''
  '''VB.NET'''
   
   
  {{APIComment|'Add code to connect to a Synthesis repository.}}
  {{APIComment|'Declare a new Repository object and connect to a Synthesis repository.}}
   {{APIPrefix|Dim}} MyRepository {{APIPrefix|As New}} Repository
   {{APIPrefix|Dim}} MyRepository {{APIPrefix|As New}} Repository
  {{APIComment|...}}
  MyRepository.ConnectToAccessRepository({{APIString|"C:\RSRepository1.rsr10"}})
 
  {{APIComment|'Create a new control. The following example creates a control with the description "MyNewControl."}}
  {{APIComment|'Create a new control. The following example creates a control with the description "MyNewControl."}}
  {{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.}}
  {{APIComment|'Add the new control to project #1.}}
  MyRepository.Project.SetCurrentProject(1)   
  MyRepository.Project.SetCurrentProject(1)   
  MyRepository.Control.AddXfmeaControl(NewControl)
  MyRepository.Control.AddXfmeaControl(NewControl)

Latest revision as of 16:41, 9 June 2016

APIWiki.png


Member of: SynthesisAPI.Repository


Adds a new Xfmea control to the current project. Returns a Boolean value; when true, indicates a successful save.

Syntax

.Control.AddXfmeaControl(control)

Parameters

control

Required. The cXfmeaControl object that represents the control 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

 'Declare a new Repository object and connect to a Synthesis repository. 
  Dim MyRepository As New Repository
  MyRepository.ConnectToAccessRepository("C:\RSRepository1.rsr10")
 
 'Create a new control. The following example creates a control with the description "MyNewControl." 
  Dim NewControl As New cXfmeaControl
  NewControl.ControlDescription = "MyNewControl"

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

 'Declare a new Repository object and connect to a Synthesis repository. 
  Dim MyRepository As New Repository
  MyRepository.ConnectToAccessRepository("C:\RSRepository1.rsr10")
 
 'Create a new control. The following example creates a control with the description "MyNewControl." 
  Dim NewControl As New cXfmeaControl ("MyNewControl")

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