Repository.Control.GetAllXfmeaControlsDictionary: Difference between revisions

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




<onlyinclude>Gets a dictionary of Xfmea controls associated with a project. Returns a '''Dictionary (Of Integer, [[cXfmeaControl Class|cXfmeaControl]])''' object, where the keys are the ID numbers of the controls. (VB.NET only)</onlyinclude>
<onlyinclude>Returns a dictionary object that contains all available Xfmea controls in the current project. The dictionary syntax is '''Dictionary (Of Integer, cXfmeaControl)''', where the keys are the ID numbers and the associated values are the [[cXfmeaControl Class|cXfmeaControl]] objects that represent the controls. (VB.NET only)</onlyinclude>


== Syntax ==
== Syntax ==
Line 15: Line 15:
   {{APIPrefix|Dim}} MyRepository {{APIPrefix|As New}} Repository
   {{APIPrefix|Dim}} MyRepository {{APIPrefix|As New}} Repository
   MyRepository.ConnectToAccessRepository({{APIString|"C:\RSRepository1.rsr10"}})
   MyRepository.ConnectToAccessRepository({{APIString|"C:\RSRepository1.rsr10"}})
{{APIComment|'Set the first project in the repository as the current project.}}
  MyRepository.Project.SetCurrentProject(1) 
    
    
  {{APIComment|'Get a dictionary of all Xfmea controls in project #1.}}
  {{APIComment|'Declare a new dictionary object.}}
   {{APIPrefix|Dim}} ControlsDict {{APIPrefix|As}} Dictionary (of Integer, cXfmeaControl)   
   {{APIPrefix|Dim}} ControlsDict {{APIPrefix|As}} Dictionary (of Integer, cXfmeaControl)   
  MyRepository.Project.SetCurrentProject(1) 
{{APIComment|'Add values to the dictionary.}}
   ControlsDict = MyRepository.Control.GetAllXfmeaControlsDictionary()
   ControlsDict = MyRepository.Control.GetAllXfmeaControlsDictionary()
   
   
  {{APIComment|'Output sample: Display the number of entries in the dictionary.}}
  {{APIComment|'Output sample: Display the number of entries in the dictionary.}}
   MsgBox(ControlsDict.Count)
   MsgBox(ControlsDict.Count)

Revision as of 16:50, 9 June 2016

APIWiki.png


Member of: SynthesisAPI.Repository


Returns a dictionary object that contains all available Xfmea controls in the current project. The dictionary syntax is Dictionary (Of Integer, cXfmeaControl), where the keys are the ID numbers and the associated values are the cXfmeaControl objects that represent the controls. (VB.NET only)

Syntax

.Control.GetAllXfmeaControlsDictionary()


Example

This example assumes that Xfmea controls exist in the first available project of the repository.

VB.NET 

 'Declare a new Repository object and connect to a Synthesis repository. 
  Dim MyRepository As New Repository
  MyRepository.ConnectToAccessRepository("C:\RSRepository1.rsr10")

 'Set the first project in the repository as the current project. 
  MyRepository.Project.SetCurrentProject(1)  
 
 'Declare a new dictionary object. 
  Dim ControlsDict As Dictionary (of Integer, cXfmeaControl)  

 'Add values to the dictionary. 
  ControlsDict = MyRepository.Control.GetAllXfmeaControlsDictionary()

 'Output sample: Display the number of entries in the dictionary. 
  MsgBox(ControlsDict.Count)