From 1251cb5a72f38024a917afec53f325b9bd4fc677 Mon Sep 17 00:00:00 2001 From: H4CK3R-01 Date: Thu, 7 Apr 2022 08:37:54 +0200 Subject: [PATCH] Cleaned up code --- SOURCE/Application/Form1.cs | 7 - SOURCE/Application/Program.cs | 3 - SOURCE/Application/Properties/AssemblyInfo.cs | 1 - SOURCE/Plugin/About.xaml.cs | 9 +- SOURCE/Plugin/AnimationClass.cs | 38 ++--- SOURCE/Plugin/AutomationMLDataTables.cs | 49 +++--- .../Plugin/ClassOfListsFromDataGridViews.cs | 10 +- .../Plugin/ClassOfListsFromReferencefile.cs | 22 +-- SOURCE/Plugin/DeviceDescription.cs | 1 - SOURCE/Plugin/MWController.cs | 26 ++-- SOURCE/Plugin/MWData.cs | 91 ++++++----- SOURCE/Plugin/MWDevice.cs | 57 ++++--- SOURCE/Plugin/ModellingWizard.xaml.cs | 12 +- SOURCE/Plugin/Properties/AssemblyInfo.cs | 1 - SOURCE/Plugin/SearchAMLComponentFile.cs | 43 +++--- SOURCE/Plugin/SearchAMLLibraryFile.cs | 142 ++++++++---------- 16 files changed, 230 insertions(+), 282 deletions(-) diff --git a/SOURCE/Application/Form1.cs b/SOURCE/Application/Form1.cs index 74a7a22..29bf4dd 100644 --- a/SOURCE/Application/Form1.cs +++ b/SOURCE/Application/Form1.cs @@ -1,11 +1,4 @@ using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows.Forms; namespace App diff --git a/SOURCE/Application/Program.cs b/SOURCE/Application/Program.cs index 7683481..dd58947 100644 --- a/SOURCE/Application/Program.cs +++ b/SOURCE/Application/Program.cs @@ -1,7 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; using System.Windows.Forms; namespace App diff --git a/SOURCE/Application/Properties/AssemblyInfo.cs b/SOURCE/Application/Properties/AssemblyInfo.cs index f5f0f90..1637e48 100644 --- a/SOURCE/Application/Properties/AssemblyInfo.cs +++ b/SOURCE/Application/Properties/AssemblyInfo.cs @@ -1,5 +1,4 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // Allgemeine Informationen über eine Assembly werden über die folgenden diff --git a/SOURCE/Plugin/About.xaml.cs b/SOURCE/Plugin/About.xaml.cs index 6e90780..ef771f9 100644 --- a/SOURCE/Plugin/About.xaml.cs +++ b/SOURCE/Plugin/About.xaml.cs @@ -1,7 +1,6 @@  using System.Reflection; using System.Windows; -using System.Windows.Controls; using System.Windows.Navigation; namespace Aml.Editor.Plugin @@ -18,10 +17,10 @@ namespace Aml.Editor.Plugin var assembly = Assembly.GetCallingAssembly(); - txtVersion.Text = "Version "+ assembly.GetName().Version.ToString(); - - - } + txtVersion.Text = "Version " + assembly.GetName().Version.ToString(); + + + } private void Close_Click(object sender, RoutedEventArgs e) { diff --git a/SOURCE/Plugin/AnimationClass.cs b/SOURCE/Plugin/AnimationClass.cs index 4bb07fa..6f04467 100644 --- a/SOURCE/Plugin/AnimationClass.cs +++ b/SOURCE/Plugin/AnimationClass.cs @@ -1,14 +1,8 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; -using Aml.Editor.Plugin.Properties; -using System.IO; +using Aml.Editor.Plugin.Properties; +using System; using System.Drawing; -using System.Web; -using System.Net; +using System.IO; +using System.Windows.Forms; namespace Aml.Editor.Plugin { @@ -22,7 +16,7 @@ namespace Aml.Editor.Plugin public Button DisplayBtn { get; set; } public DataGridView dataGridView { get; set; } public string words { get; set; } - // public TreeNode Node { get; set; } + // public TreeNode Node { get; set; } public AnimationClass() @@ -31,7 +25,7 @@ namespace Aml.Editor.Plugin } // Method for window size maximum and minimum - public void WindowSizeChanger(Panel panelNumber,Button buttonNumber) + public void WindowSizeChanger(Panel panelNumber, Button buttonNumber) { PanelNumber = panelNumber; ButtonNumber = buttonNumber; @@ -50,7 +44,7 @@ namespace Aml.Editor.Plugin public void WindowSizeChanger(Panel panelNumber) { PanelNumber = panelNumber; - // Node = node; + // Node = node; if (panelNumber.Size == panelNumber.MaximumSize) { panelNumber.Size = panelNumber.MinimumSize; @@ -66,13 +60,13 @@ namespace Aml.Editor.Plugin public string OpenFileDialog(TextBox textboxName) { TextboxName = textboxName; - + OpenFileDialog open = new OpenFileDialog(); open.Filter = "Document Files(*.pdf; *.doc;*.jpg; *.jpeg; *.gif; *.bmp; *.png;)|*.pdf; *.doc;*.jpg; *.jpeg; *.gif; *.bmp; *.png;"; if (open.ShowDialog() == DialogResult.OK) { textboxName.Text = open.FileName; - + } string nameOfFile = Path.GetFileName(open.FileName); return nameOfFile; @@ -90,23 +84,23 @@ namespace Aml.Editor.Plugin textboxName.Text = open.FileName; pdfDisplayBtn.Visible = true; pdfDisplayBtn.Text = Path.GetFileName(open.FileName); - + } } - // method for opening IEC-CDD urls - public void ManualOpener(string btnText) + // method for opening IEC-CDD urls + public void ManualOpener(string btnText) { string mainUrl = "https://cdd.iec.ch/CDD/IEC62683/iec62683.nsf/PropertiesAllVersions/0112-2---62683%23"; string lastUrl = "?OpenDocument"; string midUrl = btnText.Substring(15); - string finalUrl = mainUrl +midUrl+ lastUrl; - + string finalUrl = mainUrl + midUrl + lastUrl; + System.Diagnostics.Process.Start(finalUrl); } // Open Dialog Box related method that takes parmeters of textbox name and the picture box number. - public void OpenFileDialog(TextBox textboxName,PictureBox pictureBoxNumber) + public void OpenFileDialog(TextBox textboxName, PictureBox pictureBoxNumber) { TextboxName = textboxName; PictureboxNumber = pictureBoxNumber; @@ -136,7 +130,7 @@ namespace Aml.Editor.Plugin } // this method dispaly all hidden buttons with the Refsemantic Id in them. - public void DispalySemanticBtn(Button refSemanticBtn, DataGridView dataGrids,string word) + public void DispalySemanticBtn(Button refSemanticBtn, DataGridView dataGrids, string word) { words = word; DisplayBtn = refSemanticBtn; diff --git a/SOURCE/Plugin/AutomationMLDataTables.cs b/SOURCE/Plugin/AutomationMLDataTables.cs index ee96dd8..3434204 100644 --- a/SOURCE/Plugin/AutomationMLDataTables.cs +++ b/SOURCE/Plugin/AutomationMLDataTables.cs @@ -1,20 +1,17 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Data; -using System.Windows.Forms; using System.Drawing; +using System.Windows.Forms; namespace Aml.Editor.Plugin { - class AutomationMLDataTables + class AutomationMLDataTables { public DataTable AMLAttributeParameters() { DataTable AMLAttributeParameters = new DataTable(); - + AMLAttributeParameters.Columns.Add("AttributeName"); AMLAttributeParameters.Columns.Add("Value"); AMLAttributeParameters.Columns.Add("Default"); @@ -27,19 +24,19 @@ namespace Aml.Editor.Plugin return AMLAttributeParameters; } - public void CreateDataTableWithColumns( DataTable dataRowName, DataGridView dataGridViewName, + public void CreateDataTableWithColumns(DataTable dataRowName, DataGridView dataGridViewName, KeyValuePair>> pair) { KeyValuePair>> Pair = pair; - + DataTable DataRowName = dataRowName; DataGridView DataGridViewName = dataGridViewName; - + foreach (var valueList in Pair.Value) { - + foreach (var item in valueList) { @@ -63,7 +60,7 @@ namespace Aml.Editor.Plugin { DataGridViewName.Rows[num].Cells[0].Value = item.Name; } - + DataGridViewName.Rows[num].Cells[1].Value = item.Value; DataGridViewName.Rows[num].Cells[2].Value = item.Default; DataGridViewName.Rows[num].Cells[3].Value = item.Unit; @@ -88,19 +85,19 @@ namespace Aml.Editor.Plugin dgvcbc.Items.Add(items); } - - - + + + DataRowName.Rows.Add(row); - + break; } - - + + } - + } public void CheckForSameNameTextOfInternalAttributes(DataTable dataRowName, DataGridView dataGridViewName, KeyValuePair> pair) { @@ -111,10 +108,10 @@ namespace Aml.Editor.Plugin { try { - /* if (eachrow.Cells[0].Value.Equals(item.Name)) - { + /* if (eachrow.Cells[0].Value.Equals(item.Name)) + { - }*/ + }*/ } catch (Exception) { } } @@ -128,9 +125,9 @@ namespace Aml.Editor.Plugin foreach (var item in Pair.Value) { - + DataRow row = DataRowName.NewRow(); - + row["AttributeName"] = item.AttributeName; row["Value"] = item.Values; @@ -143,10 +140,10 @@ namespace Aml.Editor.Plugin DataRowName.Rows.Add(row); - - /* break;*/ - + + /* break;*/ + } diff --git a/SOURCE/Plugin/ClassOfListsFromDataGridViews.cs b/SOURCE/Plugin/ClassOfListsFromDataGridViews.cs index 3d3eaa3..ec5a3e7 100644 --- a/SOURCE/Plugin/ClassOfListsFromDataGridViews.cs +++ b/SOURCE/Plugin/ClassOfListsFromDataGridViews.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Aml.Editor.Plugin +namespace Aml.Editor.Plugin { class ClassOfListsFromDataGridViews { @@ -23,7 +17,7 @@ namespace Aml.Editor.Plugin //public CAEXSequence RefSemanticList { get; set; } - + public ClassOfListsFromDataGridViews() { diff --git a/SOURCE/Plugin/ClassOfListsFromReferencefile.cs b/SOURCE/Plugin/ClassOfListsFromReferencefile.cs index a9b1a7d..2c92822 100644 --- a/SOURCE/Plugin/ClassOfListsFromReferencefile.cs +++ b/SOURCE/Plugin/ClassOfListsFromReferencefile.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Aml.Engine.AmlObjects; -using Aml.Engine.CAEX; +using Aml.Engine.CAEX; namespace Aml.Editor.Plugin { @@ -20,7 +14,7 @@ namespace Aml.Editor.Plugin public string CopyRight { get; set; } public string AttributePath { get; set; } public string RefBaseClassPath { get; set; } - public string ID { get; set; } + public string ID { get; set; } public string ReferencedClassName { get; set; } public CAEXSequence RefSemanticList { get; set; } public string SupportesRoleClassType { get; set; } @@ -31,14 +25,14 @@ namespace Aml.Editor.Plugin public ClassOfListsFromReferencefile() { - // RefSemanticList = new List>(); + // RefSemanticList = new List>(); } public ClassOfListsFromReferencefile(string name, string value, string _default, string unit, - string reference, string description, - string copyRight, string semantic, string - attributePath, string refBaseClassPath, + string reference, string description, + string copyRight, string semantic, string + attributePath, string refBaseClassPath, string id, string referencedClassName, CAEXSequence refSemanticList, string supportesRoleClassType, string dataType) : this() { @@ -61,8 +55,8 @@ namespace Aml.Editor.Plugin public override string ToString() { - return "ClassOfListsFromReferencefile("+Name+"="+Value+"="+Default+"="+Unit+"="+Reference+"=" - +Description+"="+CopyRight+"="+Semantic+"="+AttributePath+ "=" + RefBaseClassPath + "=" + ID + return "ClassOfListsFromReferencefile(" + Name + "=" + Value + "=" + Default + "=" + Unit + "=" + Reference + "=" + + Description + "=" + CopyRight + "=" + Semantic + "=" + AttributePath + "=" + RefBaseClassPath + "=" + ID + "=" + ReferencedClassName + "=" + RefSemanticList + "=" + SupportesRoleClassType + "=" + DataType + ")"; } } diff --git a/SOURCE/Plugin/DeviceDescription.cs b/SOURCE/Plugin/DeviceDescription.cs index c479756..86275b3 100644 --- a/SOURCE/Plugin/DeviceDescription.cs +++ b/SOURCE/Plugin/DeviceDescription.cs @@ -8,7 +8,6 @@ using System.IO; using System.IO.Packaging; using System.Linq; using System.Windows.Forms; -using Aml.Engine.AmlObjects.Extensions; /// diff --git a/SOURCE/Plugin/MWController.cs b/SOURCE/Plugin/MWController.cs index 4fb1751..7f9de25 100644 --- a/SOURCE/Plugin/MWController.cs +++ b/SOURCE/Plugin/MWController.cs @@ -9,11 +9,11 @@ namespace Aml.Editor.Plugin public class MWController { // the (initialised) GUIs - - - + + + private DeviceDescription deviceDescriptionForm; - + // the interface class to the AML Editor private ModellingWizard modellingWizard; @@ -37,7 +37,7 @@ namespace Aml.Editor.Plugin /// Create the new CreateDevice GUI or return the previously created GUI /// /// the CreateDevice GUI for this session - + /// /// create the new DeviceDescription GUI or return the previously created GUI /// @@ -63,21 +63,21 @@ namespace Aml.Editor.Plugin if (newDevice.deviceName != null && newDevice.vendorName != null) { // create the device - result = mWData.CreateDevice(newDevice, isEdit); + result = mWData.CreateDevice(newDevice, isEdit); } // update the device list if (isEdit) { - + } else { devices.Add(newDevice); - + } - + return result; } @@ -86,11 +86,11 @@ namespace Aml.Editor.Plugin /// Show the correct GUI for the selected device /// /// The index of the selected item in the dropdown - + /// /// Reload all .amlx files in ./modellingwizard/ and update the dropdown. /// - + /// /// Switch the displayed @@ -101,7 +101,7 @@ namespace Aml.Editor.Plugin // TODO modellingWizard is null switch (targetGUI) { - + case MWGUIType.DeviceDescription: modellingWizard.changeGUI(GetDeviceDescriptionForm()); break; @@ -137,7 +137,7 @@ namespace Aml.Editor.Plugin result = "Invalid Filetype"; break; } - + return result; } } diff --git a/SOURCE/Plugin/MWData.cs b/SOURCE/Plugin/MWData.cs index c6c8e86..1a1cbc3 100644 --- a/SOURCE/Plugin/MWData.cs +++ b/SOURCE/Plugin/MWData.cs @@ -7,7 +7,6 @@ using System.IO.Packaging; using System.Linq; using System.Reflection; using System.Text.RegularExpressions; -using System.Windows.Forms; namespace Aml.Editor.Plugin { @@ -16,7 +15,7 @@ namespace Aml.Editor.Plugin // holds the controller to report created devices to private readonly MWController mWController; - + /// /// Create the MWData Object /// @@ -58,7 +57,7 @@ namespace Aml.Editor.Plugin /// public string CreateDevice(MWDevice device, bool isEdit) { - + CAEXDocument document = null; AutomationMLContainer amlx = null; @@ -76,18 +75,18 @@ namespace Aml.Editor.Plugin } else { - amlFilePath = System.IO.Path.Combine(device.filepath, fileName + ".amlx"); + amlFilePath = System.IO.Path.Combine(device.filepath, fileName + ".amlx"); } FileInfo file = new FileInfo(amlFilePath); - - + + // Create directory if it's not existing file.Directory.Create(); - + // Init CAEX Document if (isEdit) @@ -123,22 +122,22 @@ namespace Aml.Editor.Plugin { } - + } - + // Init the default Libs - AutomationMLBaseRoleClassLibType.RoleClassLib(document) ; - AutomationMLInterfaceClassLibType.InterfaceClassLib(document) ; + AutomationMLBaseRoleClassLibType.RoleClassLib(document); + AutomationMLInterfaceClassLibType.InterfaceClassLib(document); var structureRoleFamilyType = AutomationMLBaseRoleClassLibType.RoleClassLib(document).Structure; - + SystemUnitFamilyType systemUnitClass = null; // Create the SystemUnitClass for our device - if (!isEdit) + if (!isEdit) { systemUnitClass = document.CAEXFile.SystemUnitClassLib.Append("ComponentSystemUnitClassLib").SystemUnitClass.Append(device.deviceName); @@ -153,13 +152,13 @@ namespace Aml.Editor.Plugin } else { - + Boolean myBool; Boolean.TryParse(eachparameter.AddToFile, out myBool); - + if (myBool == true) { - + } Uri eachUri = null; @@ -171,7 +170,7 @@ namespace Aml.Editor.Plugin device.listWithURIConvertedToString.Add(par); } - + } foreach (var pair in device.DictionaryForRoleClassofComponent) @@ -336,7 +335,7 @@ namespace Aml.Editor.Plugin if (device.vendorName != null) { InternalElementType electricalInterface = null; - RoleRequirementsType roleRequirements = null ; + RoleRequirementsType roleRequirements = null; foreach (var internalElement in systemUnitClass.InternalElement) { if (internalElement.Name.Equals("Interfaces")) @@ -349,9 +348,9 @@ namespace Aml.Editor.Plugin } if (electricalInterface == null) electricalInterface = systemUnitClass.InternalElement.Append("Interfaces"); - roleRequirements = electricalInterface.RoleRequirements.Append(); + roleRequirements = electricalInterface.RoleRequirements.Append(); - roleRequirements.RefBaseRoleClassPath = structureRoleFamilyType.CAEXPath(); + roleRequirements.RefBaseRoleClassPath = structureRoleFamilyType.CAEXPath(); foreach (var pair in device.DictionaryForInterfaceClassesInElectricalInterfaces) { @@ -461,7 +460,7 @@ namespace Aml.Editor.Plugin } - + } } @@ -473,9 +472,9 @@ namespace Aml.Editor.Plugin string electricalConnectorPinName = Regex.Replace(pairofList.Key.ToString(), @"\(.*?\)", ""); electricalConnectorPinName = Regex.Replace(electricalConnectorPinName, @"\{.*?\}", ""); - electricalConnectorPinName = electricalConnectorPinName.Replace(electricalConnectorTypeName,""); + electricalConnectorPinName = electricalConnectorPinName.Replace(electricalConnectorTypeName, ""); + - if (initialnumberbetweenparanthesisofElectricalConnectorType == initialnumberbetweenparanthesisElectricalConnectorPins) @@ -590,7 +589,7 @@ namespace Aml.Editor.Plugin { // delete the old aml file amlx.Package.DeletePart(partUri); - + // delete all files in the amlx package. // Directory.Delete(Path.GetFullPath(amlx.ContainerFilename), true); @@ -598,9 +597,9 @@ namespace Aml.Editor.Plugin // write the new aml file into the package PackagePart root = amlx.AddRoot(path, partUri); - - - if (!isEdit) + + + if (!isEdit) { foreach (AttachablesDataGridViewParameters listWithUri in device.listWithURIConvertedToString) { @@ -612,16 +611,16 @@ namespace Aml.Editor.Plugin } } } - DirectoryInfo directory = new DirectoryInfo(Path.GetDirectoryName(amlFilePath)); - + DirectoryInfo directory = new DirectoryInfo(Path.GetDirectoryName(amlFilePath)); + foreach (FileInfo fileInfos in directory.GetFiles()) - { - if (fileInfos.Extension != ".amlx") - { - fileInfos.Delete(); - } - } - + { + if (fileInfos.Extension != ".amlx") + { + fileInfos.Delete(); + } + } + amlx.Save(); amlx.Close(); @@ -634,7 +633,7 @@ namespace Aml.Editor.Plugin { return "Device description file created!\nFilepath " + amlFilePath; } - + } public void SearchForAttributesInsideAttributesofAutomationComponent(string searchName, AttributeType attribute, ClassOfListsFromReferencefile item, SupportedRoleClassType SRC) @@ -667,14 +666,14 @@ namespace Aml.Editor.Plugin SearchForAttributesInsideAttributesofAutomationComponent(searchName, nestedAttribute, item, SRC); } } - + } public void SearchAttributesInsideAttributesOFElectricConnectorType(string searchName, AttributeType attribute, ClassOfListsFromReferencefile item, ExternalInterfaceType electricConnectorType) { foreach (var nestedAttribute in attribute.Attribute) { - + if (nestedAttribute.Name == searchName) { var eachattribute = nestedAttribute.Attribute.Append(item.Name.ToString()); @@ -697,14 +696,14 @@ namespace Aml.Editor.Plugin electricConnectorType.RefBaseClassPath = item.RefBaseClassPath; } - + if (nestedAttribute.Attribute.Exists) { SearchAttributesInsideAttributesOFElectricConnectorType(searchName, nestedAttribute, item, electricConnectorType); } } } - + /// /// Takes the url of the picture and setup in the value attribute of the corresponding internal element . /// @@ -753,7 +752,7 @@ namespace Aml.Editor.Plugin } urlAtt.AttributeDataType = "xs:anyURI"; urlAtt.Value = url.ToString(); - + } /// @@ -809,7 +808,7 @@ namespace Aml.Editor.Plugin } pictureAtt.AttributeDataType = "xs:anyURI"; pictureAtt.Value = picturePart.ToString(); - + return picturePart; } @@ -1007,11 +1006,11 @@ namespace Aml.Editor.Plugin if (name.Contains(".amlx")) { - amlx = new AutomationMLContainer(".\\modellingwizard\\" + name, FileMode.Create); + amlx = new AutomationMLContainer(".\\modellingwizard\\" + name, FileMode.Create); } else { - amlx = new AutomationMLContainer(".\\modellingwizard\\" + name + ".amlx", FileMode.Create); + amlx = new AutomationMLContainer(".\\modellingwizard\\" + name + ".amlx", FileMode.Create); } // create the aml package path @@ -1045,7 +1044,7 @@ namespace Aml.Editor.Plugin // Just as an interface } - public void copyFiles(string sourceFilePath, string destinationFilePath ) + public void copyFiles(string sourceFilePath, string destinationFilePath) { string sourFile = Path.GetFileName(sourceFilePath); string destFile = Path.Combine(destinationFilePath, sourFile); diff --git a/SOURCE/Plugin/MWDevice.cs b/SOURCE/Plugin/MWDevice.cs index 81fb325..0b5052f 100644 --- a/SOURCE/Plugin/MWDevice.cs +++ b/SOURCE/Plugin/MWDevice.cs @@ -1,26 +1,23 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Aml.Editor.Plugin { // this class initialize the parameters exclusively for the "Device Identofication", "DataGridViews in "Generic Data Tab" AND "Field Attachables Tab"" - public class MWDevice: MWData.MWObject + public class MWDevice : MWData.MWObject { public string environment { get; set; } public string fileName { get; set; } public string filepath { get; set; } - - + + public string vendorName { get; set; } - + public string deviceName { get; set; } - + // Can contain letters: public List dataGridParametersLists { get; set; } - + //Properties for Electrical Interface public List ElectricalInterfaces { get; set; } @@ -61,13 +58,13 @@ namespace Aml.Editor.Plugin public string RefSemantics { get; set; } public string Attributes { get; set; } public string Values { get; set; } - + public DataGridParameters() { } public DataGridParameters(string refSemantic, string attributes, string value) { - this.RefSemantics = refSemantic; + this.RefSemantics = refSemantic; this.Attributes = attributes; this.Values = value; } @@ -76,8 +73,8 @@ namespace Aml.Editor.Plugin return "DataGridParameters(" + RefSemantics + "=" + Attributes + "=" + Values + ")"; } } - - + + /// @@ -98,19 +95,19 @@ namespace Aml.Editor.Plugin //public string Units { get; set; } - public ElectricalParameters() + public ElectricalParameters() { - + } - - public ElectricalParameters(string connector, string connectorCode, string connectorType,string pins,string lis) - + + public ElectricalParameters(string connector, string connectorCode, string connectorType, string pins, string lis) + { this.Connector = connector; this.ConnectorCode = connectorCode; this.ConnectorType = connectorType; this.Pins = pins; - + } //public ElectricalParameters(string referenceID, string attribute, string values, string units, string pins) //{ @@ -120,19 +117,19 @@ namespace Aml.Editor.Plugin // this.Units = units; // this.Pins = pins; //} - + public override string ToString() { - - return "ElectricalParameters(" + Connector + "=" + ConnectorCode + "=" + ConnectorType + "="+Pins+")"; + + return "ElectricalParameters(" + Connector + "=" + ConnectorCode + "=" + ConnectorType + "=" + Pins + ")"; } - + } //This Class is responsible to hold the parameters in "ElectricalDataDataGrid View" public class ElectricalParametersInElectricalDataDataGridView { - + public string ReferenceID { get; set; } public string Attributes { get; set; } public string Values { get; set; } @@ -148,11 +145,11 @@ namespace Aml.Editor.Plugin this.Attributes = attribute; this.Values = values; this.Units = units; - + } public override string ToString() { - return "ElectricalParametersInElectricalDataDataGridView("+ ReferenceID + "=" + Attributes + "=" + Values + "=" + Units + ")"; + return "ElectricalParametersInElectricalDataDataGridView(" + ReferenceID + "=" + Attributes + "=" + Values + "=" + Units + ")"; } } @@ -168,7 +165,7 @@ namespace Aml.Editor.Plugin { } - public PinParametersInPinInfoDataGridView(string pinNumber,string referenceID, string attribute, string values, string units) + public PinParametersInPinInfoDataGridView(string pinNumber, string referenceID, string attribute, string values, string units) { this.PinNumber = pinNumber; this.ReferenceID = referenceID; @@ -179,7 +176,7 @@ namespace Aml.Editor.Plugin } public override string ToString() { - return "PinParametersInPinInfoDataGridView(" +PinNumber+"="+ ReferenceID + "=" + Attributes + "=" + Values + "=" + Units + ")"; + return "PinParametersInPinInfoDataGridView(" + PinNumber + "=" + ReferenceID + "=" + Attributes + "=" + Values + "=" + Units + ")"; } } @@ -188,7 +185,7 @@ namespace Aml.Editor.Plugin { public string ElementName { get; set; } public string FilePath { get; set; } - public string AddToFile { get; set; } + public string AddToFile { get; set; } public AttachablesDataGridViewParameters() { @@ -202,7 +199,7 @@ namespace Aml.Editor.Plugin } public override string ToString() { - return "AttachablesDataGridViewParameters(" + ElementName + "=" + FilePath +"="+ AddToFile + ")"; + return "AttachablesDataGridViewParameters(" + ElementName + "=" + FilePath + "=" + AddToFile + ")"; } } diff --git a/SOURCE/Plugin/ModellingWizard.xaml.cs b/SOURCE/Plugin/ModellingWizard.xaml.cs index fcac4c9..b3b309f 100644 --- a/SOURCE/Plugin/ModellingWizard.xaml.cs +++ b/SOURCE/Plugin/ModellingWizard.xaml.cs @@ -29,7 +29,7 @@ namespace Aml.Editor.Plugin public ModellingWizard() { mWController = new MWController(); - + // Defines the Command list, which will contain user commands, which a user can select // via the PlugIn Menu. Commands = new List(); @@ -38,7 +38,7 @@ namespace Aml.Editor.Plugin // Every PlugIn needs at least an Activation command, which will be called by a user to activate the PlugIn. ActivatePlugin = new PluginCommand() { - Command = new RelayCommand(this.StartCommandExecute, + Command = new RelayCommand(this.StartCommandExecute, this.StartCommandCanExecute), CommandName = "Start", CommandToolTip = "Start the PlugIn" @@ -92,7 +92,7 @@ namespace Aml.Editor.Plugin private void ReloadObjectsExecute(object obj) { - + } /// @@ -105,7 +105,7 @@ namespace Aml.Editor.Plugin /// ). /// public event EventHandler PluginTerminated; - + /// /// The AboutCommand - Command /// @@ -294,7 +294,7 @@ namespace Aml.Editor.Plugin /// The selected object, may be null. public void PublishAutomationMLFileAndObject(string amlFilePath, CAEXBasicObject selectedObject) { - + } /// @@ -337,7 +337,7 @@ namespace Aml.Editor.Plugin private void StartCommandExecute(object parameter) { this.IsActive = true; - + // create the new PlugInUI and add it to the forms host mWController.ChangeGui(MWController.MWGUIType.DeviceDescription); diff --git a/SOURCE/Plugin/Properties/AssemblyInfo.cs b/SOURCE/Plugin/Properties/AssemblyInfo.cs index 177057f..d14e120 100644 --- a/SOURCE/Plugin/Properties/AssemblyInfo.cs +++ b/SOURCE/Plugin/Properties/AssemblyInfo.cs @@ -1,5 +1,4 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // Allgemeine Informationen über eine Assembly werden über die folgenden diff --git a/SOURCE/Plugin/SearchAMLComponentFile.cs b/SOURCE/Plugin/SearchAMLComponentFile.cs index 70c5a0b..bde550e 100644 --- a/SOURCE/Plugin/SearchAMLComponentFile.cs +++ b/SOURCE/Plugin/SearchAMLComponentFile.cs @@ -1,9 +1,6 @@ -using System; +using Aml.Engine.CAEX; +using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Aml.Engine.CAEX; namespace Aml.Editor.Plugin { @@ -19,7 +16,7 @@ namespace Aml.Editor.Plugin public SearchAMLComponentFile() { - + } public void CheckForAttributesOfExternalIterface(int i, ExternalInterfaceType externalInterface) @@ -30,8 +27,8 @@ namespace Aml.Editor.Plugin foreach (var attribute in externalInterface.Attribute) { StoreEachAttributeValueInListOfExternalIterface(i, attributelist, attribute, externalInterface); - CkeckForNestedAttributesOfExternalIterface(i,attribute, externalInterface); - + CkeckForNestedAttributesOfExternalIterface(i, attribute, externalInterface); + } } @@ -43,7 +40,7 @@ namespace Aml.Editor.Plugin list.Add(sublist); try { - if (DictionaryofElectricalConnectorType.ContainsKey( "("+i+")"+ externalInterface.Name.ToString()+ "{" + "Class:" + " " + externalInterface.BaseClass + "}")) + if (DictionaryofElectricalConnectorType.ContainsKey("(" + i + ")" + externalInterface.Name.ToString() + "{" + "Class:" + " " + externalInterface.BaseClass + "}")) { DictionaryofElectricalConnectorType["(" + i + ")" + externalInterface.Name.ToString() + "{" + "Class:" + " " + externalInterface.BaseClass + "}"].AddRange(list); @@ -63,8 +60,8 @@ namespace Aml.Editor.Plugin } - - public void CkeckForNestedAttributesOfExternalIterface(int i, AttributeType attributeType, ExternalInterfaceType externalInterface) + + public void CkeckForNestedAttributesOfExternalIterface(int i, AttributeType attributeType, ExternalInterfaceType externalInterface) { List> attributelist = new List>(); if (attributeType.Attribute.Exists) @@ -73,8 +70,8 @@ namespace Aml.Editor.Plugin foreach (var attributeinattribute in attributeType.Attribute) { StoreEachAttributeValueInListOfExternalIterface(i, attributelist, attributeinattribute, attributeType, externalInterface); - CkeckForNestedAttributesOfExternalIterface(i,attributeinattribute, externalInterface); - + CkeckForNestedAttributesOfExternalIterface(i, attributeinattribute, externalInterface); + } } @@ -116,7 +113,7 @@ namespace Aml.Editor.Plugin attributeparameters.CopyRight = attributeType.Copyright; attributeparameters.AttributePath = attributeType.AttributePath; attributeparameters.RefSemanticList = attributeType.RefSemantic; - // attributeparameters.ReferencedClassName = externalInterface.BaseClass.ToString(); + // attributeparameters.ReferencedClassName = externalInterface.BaseClass.ToString(); attributeparameters.RefBaseClassPath = externalInterface.RefBaseClassPath; attributeparameters.ID = externalInterface.ID; @@ -163,7 +160,7 @@ namespace Aml.Editor.Plugin attributeparameters.CopyRight = AttributeInAttribute.Copyright; attributeparameters.AttributePath = AttributeInAttribute.AttributePath; attributeparameters.RefSemanticList = AttributeInAttribute.RefSemantic; - // attributeparameters.ReferencedClassName = externalInterface.BaseClass.ToString(); + // attributeparameters.ReferencedClassName = externalInterface.BaseClass.ToString(); attributeparameters.RefBaseClassPath = externalInterface.RefBaseClassPath; attributeparameters.ID = externalInterface.ID; @@ -193,7 +190,7 @@ namespace Aml.Editor.Plugin { StoreEachAttributeValueInListOfElectricalConnectorPins(i, attributelist, attribute, externalInterface, classType); CkeckForNestedAttributesOfElectricalConnectorPins(i, attribute, externalInterface, classType); - + } } @@ -226,7 +223,7 @@ namespace Aml.Editor.Plugin } - + public void CkeckForNestedAttributesOfElectricalConnectorPins(int i, AttributeType attributeType, ExternalInterfaceType externalInterface, ExternalInterfaceType classType) { List> attributelist = new List>(); @@ -237,7 +234,7 @@ namespace Aml.Editor.Plugin { StoreEachAttributeValueInListOfElectricalConnectorPins(i, attributelist, attributeinattribute, attributeType, externalInterface, classType); CkeckForNestedAttributesOfElectricalConnectorPins(i, attributeinattribute, externalInterface, classType); - + } } @@ -279,7 +276,7 @@ namespace Aml.Editor.Plugin attributeparameters.CopyRight = attributeType.Copyright; attributeparameters.AttributePath = attributeType.AttributePath; attributeparameters.RefSemanticList = attributeType.RefSemantic; - // attributeparameters.ReferencedClassName = externalInterface.BaseClass.ToString(); + // attributeparameters.ReferencedClassName = externalInterface.BaseClass.ToString(); attributeparameters.RefBaseClassPath = externalInterface.RefBaseClassPath; attributeparameters.ID = externalInterface.ID; @@ -357,7 +354,7 @@ namespace Aml.Editor.Plugin { StoreEachAttributeValueInListOfComponent(i, attributelist, attribute, supportedRoleClass, classType); CkeckForNestedAttributesOfComponent(i, attribute, supportedRoleClass, classType); - + } } @@ -369,7 +366,7 @@ namespace Aml.Editor.Plugin list.Add(sublist); try { - if (DictionaryofRolesforAutomationComponenet.ContainsKey("(" + i + ")" + supportedRoleClass.RoleReference.ToString() )) + if (DictionaryofRolesforAutomationComponenet.ContainsKey("(" + i + ")" + supportedRoleClass.RoleReference.ToString())) { DictionaryofRolesforAutomationComponenet["(" + i + ")" + supportedRoleClass.RoleReference.ToString()].AddRange(list); } @@ -387,7 +384,7 @@ namespace Aml.Editor.Plugin } - + public void CkeckForNestedAttributesOfComponent(int i, AttributeType attributeType, SupportedRoleClassType supportedRoleClass, SystemUnitFamilyType classType) { List> attributelist = new List>(); @@ -398,7 +395,7 @@ namespace Aml.Editor.Plugin { StoreEachAttributeValueInListOfComponent(i, attributelist, attributeinattribute, attributeType, supportedRoleClass, classType); CkeckForNestedAttributesOfComponent(i, attributeinattribute, supportedRoleClass, classType); - + } } diff --git a/SOURCE/Plugin/SearchAMLLibraryFile.cs b/SOURCE/Plugin/SearchAMLLibraryFile.cs index 072299c..6ac6eb9 100644 --- a/SOURCE/Plugin/SearchAMLLibraryFile.cs +++ b/SOURCE/Plugin/SearchAMLLibraryFile.cs @@ -1,18 +1,8 @@ -using System; +using Aml.Engine.CAEX; +using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Drawing; using System.Windows.Forms; -using Aml.Engine.AmlObjects; -using Aml.Engine.CAEX; -using System.IO; -using System.IO.Packaging; -using System.Xml; -using System.Collections; -using System.IO.Compression; -using Aml.Editor.Plugin.Contracts; namespace Aml.Editor.Plugin { @@ -85,7 +75,7 @@ namespace Aml.Editor.Plugin //This method search for "Referenced Class" of "External Interface" SearchForReferencedClassNameofExternalIterface(doc, referencedClassName, classType, externalInterface); } - + } } @@ -107,7 +97,7 @@ namespace Aml.Editor.Plugin } - + } } @@ -129,7 +119,7 @@ namespace Aml.Editor.Plugin foreach (var item in classTypeSearchForReferencedClassName.InterfaceClass) { //If "Refrenced Class Name" is existing... - if (item.Name == referencedClassName) + if (item.Name == referencedClassName) { //If external Interface is existing.... if (item.ExternalInterface.Exists) @@ -144,7 +134,7 @@ namespace Aml.Editor.Plugin //This method search for "Referenced Class" of "External Interface" SearchForReferencedClassNameofExternalIterface(doc, referencedClassName, classType, externalInterface); } - + } } @@ -159,7 +149,7 @@ namespace Aml.Editor.Plugin } } - //If "Interface Class" inside "Interface Class" is existng.... + //If "Interface Class" inside "Interface Class" is existng.... if (item.InterfaceClass.Exists) { //This class is responsible to search for interface classes ´nested inside Interface classes and recursion of @@ -179,7 +169,7 @@ namespace Aml.Editor.Plugin { StoreEachAttributeValueInListOfReferencedClassName(attributelist, classType, attribute); CkeckForNestedAttributesOfReferencedClassName(attribute, classType); - + } } @@ -191,7 +181,7 @@ namespace Aml.Editor.Plugin list.Add(sublist); try { - if (DictionaryForInterfaceClassInstancesAttributes.ContainsKey(classType.Name.ToString()+"{"+ "Class:" + " " +classType.ReferencedClassName+"}")) + if (DictionaryForInterfaceClassInstancesAttributes.ContainsKey(classType.Name.ToString() + "{" + "Class:" + " " + classType.ReferencedClassName + "}")) { DictionaryForInterfaceClassInstancesAttributes[classType.Name.ToString() + "{" + "Class:" + " " + classType.ReferencedClassName + "}"].AddRange(list); } @@ -206,7 +196,7 @@ namespace Aml.Editor.Plugin throw; } } - + } @@ -220,7 +210,7 @@ namespace Aml.Editor.Plugin { StoreEachAttributeValueInListOfReferencedClassName(attributelist, attributeinattribute, classType, attributeType); CkeckForNestedAttributesOfReferencedClassName(attributeinattribute, classType); - + } } @@ -239,7 +229,7 @@ namespace Aml.Editor.Plugin DictionaryForInterfaceClassInstancesAttributes.Add(classType.Name.ToString() + "{" + "Class:" + " " + classType.ReferencedClassName + "}", list); } } - + } /// @@ -261,7 +251,7 @@ namespace Aml.Editor.Plugin StoreEachAttributeValueInListOfReferencedClassName(attributelist, classType, attribute); //This method is responsible to check nested attributes of "Referenced Class Name" CkeckForNestedAttributesOfReferencedClassName(classTypeSearchForReferencedClassName, attribute, classType); - + } } @@ -296,7 +286,7 @@ namespace Aml.Editor.Plugin } } - + /// /// This method is responsible to check nested attributes of "Referenced Class Name" /// @@ -317,7 +307,7 @@ namespace Aml.Editor.Plugin StoreEachAttributeValueInListOfReferencedClassName(attributelist, attributeinattribute, classType, attributeType); //This method is recursion of it self. CkeckForNestedAttributesOfReferencedClassName(classTypeSearchForReferencedClassName, attributeinattribute, classType); - + } } @@ -328,7 +318,7 @@ namespace Aml.Editor.Plugin List> list = new List>(); List sublist = new List(); - //Add sublist to list + //Add sublist to list list.Add(sublist); //If dictioanry contains key , update the values under the key if (DictionaryForInterfaceClassInstancesAttributes.ContainsKey(classType.Name.ToString() + "{" + "Class:" + " " + classType.ReferencedClassName + "}")) @@ -396,7 +386,7 @@ namespace Aml.Editor.Plugin } - + /// /// This method store nested attributes of each attribute of "Referenced CLASS name" in the dictionary. /// @@ -547,7 +537,7 @@ namespace Aml.Editor.Plugin //This method check for the "Nested Attributes" inside the "Attribute" of "External Interface". CkeckForNestedAttributesOfReferencedClassNameofExternalIterface(attribute, classType, externalInterface); - + } } @@ -557,7 +547,7 @@ namespace Aml.Editor.Plugin //Initiate empty list of "Attributes values"..... List> list = new List>(); List sublist = new List(); - + list.Add(sublist); try { @@ -584,10 +574,10 @@ namespace Aml.Editor.Plugin throw; } } - + } - + /// /// This method is responsible to check "Nested ATtributes" of "External Interface's Attribute " /// @@ -608,7 +598,7 @@ namespace Aml.Editor.Plugin StoreEachAttributeValueInListOfReferencedClassNameofExternalIterface(attributelist, attributeinattribute, classType, attributeType, externalInterface); //This method is recursion of itself. CkeckForNestedAttributesOfReferencedClassNameofExternalIterface(attributeinattribute, classType, externalInterface); - + } } @@ -619,12 +609,12 @@ namespace Aml.Editor.Plugin List> list = new List>(); List sublist = new List(); - //Add sub list to list + //Add sub list to list list.Add(sublist); //IF dictionary is having the key, the update the values for the key. if (DictionaryForExternalInterfacesInstanceAttributesofInterfaceClassLib.ContainsKey(classType.Name.ToString() - + "{" + "Class:" + " " + classType.ReferencedClassName + "}" + externalInterface.Name.ToString() + + "{" + "Class:" + " " + classType.ReferencedClassName + "}" + externalInterface.Name.ToString() + "{" + "Class:" + " " + externalInterface.BaseClass + "}")) { DictionaryForExternalInterfacesInstanceAttributesofInterfaceClassLib[classType.Name.ToString() @@ -663,7 +653,7 @@ namespace Aml.Editor.Plugin StoreEachAttributeValueInListOfReferencedClassNameofExternalIterface(attributelist, classType, attribute, externalInterface); // This method is responsible to check the "Nested Attributes" of "Attributes" of"Interface Class's External interafce" CkeckForNestedAttributesOfReferencedClassNameofExternalIterface(classTypeSearchForReferencedClassName, attribute, classType, externalInterface); - + } } @@ -703,7 +693,7 @@ namespace Aml.Editor.Plugin } } - + /// /// This method is responsible to check the "Nested Attributes" of "Attributes" of"Interface Class's External interafce" /// @@ -725,7 +715,7 @@ namespace Aml.Editor.Plugin StoreEachAttributeValueInListOfReferencedClassNameofExternalIterface(attributelist, attributeinattribute, classType, attributeType, externalInterface); //This method is the recursion of itself.... CkeckForNestedAttributesOfReferencedClassNameofExternalIterface(classTypeSearchForReferencedClassName, attributeinattribute, classType, externalInterface); - + } } @@ -814,7 +804,7 @@ namespace Aml.Editor.Plugin } - + /// /// This method stores "Attributes" of "Referenced Class's External Interface" /// @@ -908,7 +898,7 @@ namespace Aml.Editor.Plugin SearchForReferencedClassNameofExternalIterface(doc, referencedClassName, classType, externalInterface); // This function is responsible to search for "Attributes" inside the "Referencd Class Name" of "eXTERNAL iNTERFACE" CheckForAttributesOfReferencedClassNameofExternalIterface(classType, externalInterface); - + } } } @@ -936,7 +926,7 @@ namespace Aml.Editor.Plugin } } - + /// /// This method is responsible for checking "Attributes" under "Referenced Class Name" /// @@ -956,7 +946,7 @@ namespace Aml.Editor.Plugin StoreEachAttributeValueInListOfReferencedClassName(attributelist, classType, attribute); //This function check for nested attributes in the attributes of "Refernced Class Name" CkeckForNestedAttributesOfReferencedClassName(classTypeSearchForReferencedClassName, attribute, classType); - + } } @@ -990,7 +980,7 @@ namespace Aml.Editor.Plugin } } - + /// /// This method check for nested attributes under attributes of "Referenced Class Name" /// @@ -1011,7 +1001,7 @@ namespace Aml.Editor.Plugin StoreEachAttributeValueInListOfReferencedClassName(attributelist, attributeinattribute, classType, attributeType); //This method is recursion of itself CkeckForNestedAttributesOfReferencedClassName(classTypeSearchForReferencedClassName, attributeinattribute, classType); - + } } @@ -1049,7 +1039,7 @@ namespace Aml.Editor.Plugin List sublist = new List(); ClassOfListsFromReferencefile attributeparameters = new ClassOfListsFromReferencefile(); - //Store every parameter value.... + //Store every parameter value.... attributeparameters.Name = attributeType.Name; attributeparameters.Value = attributeType.Value; @@ -1108,8 +1098,8 @@ namespace Aml.Editor.Plugin // In the following parameters on right hand side "attributeType" has been changed to "AttributeInAttribute" this has been repeated to all // methods of name "StoreEachAttributeValuesInList" with four parameters. - - + + attributeparameters.Name = AttributeInAttribute.Name; attributeparameters.Value = AttributeInAttribute.Value; @@ -1162,7 +1152,7 @@ namespace Aml.Editor.Plugin // This method look for nested attributes. CkeckForNestedAttributesOfReferencedClassNameofExternalIterface(attribute, classType, externalInterface); - + } } @@ -1202,7 +1192,7 @@ namespace Aml.Editor.Plugin } } - + /// /// This function is responsible for checking "nested attributes" under "attributes" of the "External Interface" /// @@ -1223,7 +1213,7 @@ namespace Aml.Editor.Plugin StoreEachAttributeValueInListOfReferencedClassNameofExternalIterface(attributelist, attributeinattribute, classType, attributeType, externalInterface); // This method allows tocheck for nested attribute inside attributes i.e. recursion of this own method. CkeckForNestedAttributesOfReferencedClassNameofExternalIterface(attributeinattribute, classType, externalInterface); - + } } @@ -1278,7 +1268,7 @@ namespace Aml.Editor.Plugin // This method looks for "nested attributes" under each "attribute" CkeckForNestedAttributesOfReferencedClassNameofExternalIterface(classTypeSearchForReferencedClassName, attribute, classType, externalInterface); - + } } @@ -1345,7 +1335,7 @@ namespace Aml.Editor.Plugin //Do recursion of this method untill the nested attributes were ended CkeckForNestedAttributesOfReferencedClassNameofExternalIterface(classTypeSearchForReferencedClassName, attributeinattribute, classType, externalInterface); - + } } @@ -1393,7 +1383,7 @@ namespace Aml.Editor.Plugin List sublist = new List(); ClassOfListsFromReferencefile attributeparameters = new ClassOfListsFromReferencefile(); - + attributeparameters.Name = attributeType.Name; attributeparameters.Value = attributeType.Value; @@ -1440,7 +1430,7 @@ namespace Aml.Editor.Plugin } - + /// /// This method stores the nested attributes in "DictionaryForExternalInterfacesInstancesAttributesOfRoleClassLib" /// @@ -1459,7 +1449,7 @@ namespace Aml.Editor.Plugin // In the following parameters on right hand side "attributeType" has been changed to "AttributeInAttribute" this has been repeated to all // methods of name "StoreEachAttributeValuesInList" with four parameters. - + attributeparameters.Name = AttributeInAttribute.Name; attributeparameters.Value = AttributeInAttribute.Value; @@ -1577,7 +1567,7 @@ namespace Aml.Editor.Plugin SearchForReferencedClassNameofExternalIterface(doc, referencedClassName, classType, externalInterface); //This Function is responsible to search attributes under the "Referenced Classs Name" i.e. in this part "RoleFamilyType" CheckForAttributesOfReferencedClassNameofExternalIterface(classType, externalInterface); - + } } } @@ -1644,7 +1634,7 @@ namespace Aml.Editor.Plugin } } - + /// /// This method is responsible for checking attributes under "Referenced Class Name" /// @@ -1663,7 +1653,7 @@ namespace Aml.Editor.Plugin StoreEachAttributeValueInListOfReferencedClassName(attributelist, classType, attribute); //This function check for nested attributes of referenced Class Name. CkeckForNestedAttributesOfReferencedClassName(attribute, classType); - + } } @@ -1697,7 +1687,7 @@ namespace Aml.Editor.Plugin } } - + /// /// This method check for "nested attributes" of "referenced class name" /// @@ -1717,7 +1707,7 @@ namespace Aml.Editor.Plugin StoreEachAttributeValueInListOfReferencedClassName(attributelist, attributeinattribute, classType, attributeType); //This method is recursion of itself... CkeckForNestedAttributesOfReferencedClassName(attributeinattribute, classType); - + } } @@ -1762,20 +1752,20 @@ namespace Aml.Editor.Plugin //This method is responsible for checking attributes under "Referenced Class Name" CheckForAttributesOfReferencedClassName(classType); - + } else { newnode = oParentNode.Nodes.Add(item.ToString(), item.ToString(), 1); } - + if (item.ExternalInterface.Exists) { foreach (var externalinterfaces in item.ExternalInterface) { TreeNode externalinterafcenode; - if (externalinterfaces.BaseClass != null && externalinterfaces.BaseClass.ToString() != externalinterfaces.Name.ToString() ) + if (externalinterfaces.BaseClass != null && externalinterfaces.BaseClass.ToString() != externalinterfaces.Name.ToString()) { referencedClassName = externalinterfaces.BaseClass.ToString(); externalinterafcenode = newnode.Nodes.Add(externalinterfaces.ToString(), externalinterfaces.ToString() + "{" + "Class:" + " " + referencedClassName + "}", 2); @@ -1786,7 +1776,7 @@ namespace Aml.Editor.Plugin //This Function is responsible to search attributes under the "Referenced Classs Name" i.e. in this part "RoleFamilyType" CheckForAttributesOfReferencedClassNameofExternalIterface(item, externalinterfaces); - + } else { @@ -1816,7 +1806,7 @@ namespace Aml.Editor.Plugin TreeNode newnode; if (item.ReferencedClassName != "") { - + referencedclassName = item.ReferencedClassName; newnode = oParentNode.Nodes.Add(item.ToString(), item.ToString() + "{" + "Class:" + " " + referencedclassName + "}", 1); CheckForAttributesOfReferencedClassName(item); @@ -1835,9 +1825,9 @@ namespace Aml.Editor.Plugin foreach (var externalinterfaces in item.ExternalInterface) { TreeNode externalinterafcenode; - if (externalinterfaces.BaseClass!= null) + if (externalinterfaces.BaseClass != null) { - + referencedclassName = externalinterfaces.BaseClass.ToString(); externalinterafcenode = newnode.Nodes.Add(externalinterfaces.ToString(), externalinterfaces.ToString() + "{" + "Class:" + " " + referencedclassName + "}", 2); externalinterafcenode.ForeColor = SystemColors.GrayText; @@ -1852,7 +1842,7 @@ namespace Aml.Editor.Plugin } - PrintExternalInterfaceNodes(document,externalinterafcenode, externalinterfaces, classType); + PrintExternalInterfaceNodes(document, externalinterafcenode, externalinterfaces, classType); } } @@ -1865,15 +1855,15 @@ namespace Aml.Editor.Plugin /// /// /// - public void PrintExternalInterfaceNodes(CAEXDocument document,TreeNode oParentNode, ExternalInterfaceType classType, InterfaceFamilyType InterafceclassType) + public void PrintExternalInterfaceNodes(CAEXDocument document, TreeNode oParentNode, ExternalInterfaceType classType, InterfaceFamilyType InterafceclassType) { if (classType.ExternalInterface.Exists) { - + foreach (var item in classType.ExternalInterface) { TreeNode newnode; - if (item.BaseClass!= null) + if (item.BaseClass != null) { referencedClassName = item.BaseClass.ToString(); newnode = oParentNode.Nodes.Add(item.ToString(), item.ToString() + "{" + "Class:" + " " + referencedClassName + "}", 2); @@ -1883,17 +1873,17 @@ namespace Aml.Editor.Plugin } else { - newnode = oParentNode.Nodes.Add(item.ToString(), item.ToString() , 2); + newnode = oParentNode.Nodes.Add(item.ToString(), item.ToString(), 2); newnode.ForeColor = SystemColors.GrayText; } - + PrintExternalInterfaceNodes(document, newnode, item, InterafceclassType); } } } - + /// /// This method is called to print "External Interfaces" in both "Role class Library and Interface Class Library" in the plugin. /// @@ -1907,7 +1897,7 @@ namespace Aml.Editor.Plugin foreach (var item in classType.ExternalInterface) { TreeNode newnode; - + if (item.BaseClass != null) { @@ -1925,9 +1915,9 @@ namespace Aml.Editor.Plugin { newnode = oParentNode.Nodes.Add(item.ToString(), item.ToString(), 2); newnode.ForeColor = SystemColors.GrayText; - + } - + //This is a recursion of this method itself... PrintExternalInterfaceNodes(document, newnode, item, RoleclassType); }