Esempio n. 1
0
 //internal API
 internal void Update(TypeDesign nodeDesign, List <string> path, Action <InstanceDesign, List <string> > createInstanceType)
 {
     nodeDesign.BaseType          = this.BaseType;
     nodeDesign.ClassName         = String.Empty;
     nodeDesign.IsAbstract        = this.IsAbstract;
     nodeDesign.NoClassGeneration = false;
     base.UpdateNode(nodeDesign, path, createInstanceType);
 }
Esempio n. 2
0
 //base types
 private static void CompareTypeDesign(TypeDesign expected, TypeDesign actual)
 {
     CompareNodeDesign(expected, actual);
     if (expected.BaseType == null && actual.BaseType == null)
     {
         return;
     }
     Assert.IsNotNull(expected.BaseType);
     Assert.IsNotNull(actual.BaseType);
     Assert.AreEqual <string>(expected.BaseType.ToString(), actual.BaseType.ToString());
 }
 /// <summary>
 /// Analizes the state machine from tree.
 /// </summary>
 /// <param name="imna">The analized node.</param>
 internal static void AnalizeStateMachine(IModelNodeAdvance imna)
 {
     if (CustomEditors.IsLicensed)
     {
         if ((((TypeDesign <Opc.Ua.ModelCompiler.ObjectTypeDesign>)imna.Wrapper4PropertyGrid).BaseType.ToString() == finiteStateMachineTypeString))
         {
             TypeDesign <Opc.Ua.ModelCompiler.ObjectTypeDesign> selectedNodeObjectTypeDesign = (TypeDesign <Opc.Ua.ModelCompiler.ObjectTypeDesign>)imna.Wrapper4PropertyGrid;
             try
             {
                 string            symbolicNameNameSpace = selectedNodeObjectTypeDesign.SymbolicName.NameSpace;
                 ObjectTypeDesign  machineObjectDesign   = (ObjectTypeDesign)selectedNodeObjectTypeDesign.Parent;
                 List <string>     allStates             = new List <string>();
                 List <Transition> allTransitions        = new List <Transition>();
                 Dictionary <FolderType, IEnumerable <IModelNodeAdvance> > folders = imna.GetFolders();
                 foreach (Folder folder in folders.Values)
                 {
                     if (folder is ChildrenFolder)
                     {
                         foreach (IModelNode machineIModelNode in folder)
                         {
                             if (machineIModelNode.NodeClass == NodeClassesEnum.Object)
                             {
                                 FindStatesAndTransitionsInStateMachine((InstanceDesign <Opc.Ua.ModelCompiler.ObjectDesign>)machineIModelNode.Wrapper4PropertyGrid, allStates, allTransitions);
                             }
                         }
                     }
                 }
                 bool transitionAnalized = false;
                 while (transitionAnalized == false)
                 {
                     transitionAnalized = StateMachineCrossTable.AddImagesOnTransitionButtons(allStates, allTransitions, symbolicNameNameSpace, machineObjectDesign, imna.IsReadOnly);
                 }
             }
             catch (Exception)
             {
                 MessageBox.Show(Resources.ProblemWithStateMachine_Header, Resources.ProblemwithDisplayingStateMachine_Info, System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                 return;
             }
         }
         else
         {
             MessageBox.Show(Resources.ProblemWithStateMachine_Header, Resources.ProblemWithStateMachine_Info, System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
             return;
         }
     }
     else
     {
         MessageBox.Show(Resources.ModelDesignerProLicenseWarning);
     }
 }