Fixed loading amlx files without crashing

This commit is contained in:
Administrator 2022-04-01 10:43:18 +02:00
parent d9419df191
commit 69a74d9f74
2 changed files with 241 additions and 239 deletions

View File

@ -2422,6 +2422,8 @@ namespace Aml.Editor.Plugin
{
foreach (var attribute in externalInterface.Attribute)
{
if (attribute.Value != null)
{
if (attribute.Value.Contains("https://") ||
attribute.Value.Contains("http://") ||
@ -2455,6 +2457,7 @@ namespace Aml.Editor.Plugin
}
}
}
}
//Fehlermeldung
else
@ -2760,6 +2763,8 @@ namespace Aml.Editor.Plugin
foreach (var externalInterface in internalElements.ExternalInterface)
{
foreach (var attribute in externalInterface.Attribute)
{
if (attribute.Value != null)
{
if (attribute.Value.Contains("https://") ||
attribute.Value.Contains("http://") ||
@ -2799,6 +2804,7 @@ namespace Aml.Editor.Plugin
}
}
}
}
//Fehlermeldung
else
@ -2813,6 +2819,9 @@ namespace Aml.Editor.Plugin
foreach (var internalElementsTwo in internalElements.InternalElement)
{
foreach (var intface in internalElementsTwo.ExternalInterface)
{
if (intface.BaseClass != null)
{
//Code for Interfaces
if (AllInterfaces.Contains(intface.BaseClass.Name) && intface.BaseClass.Name != "ExternalDataConnector" && intface.BaseClass.Name != "ExternalDataReference")
@ -2959,16 +2968,15 @@ namespace Aml.Editor.Plugin
{
foreach (var attribute in externalInterface.Attribute)
{
if (attribute.Value.Contains("https://") ||
attribute.Value.Contains("http://") ||
attribute.Value.Contains("www") ||
attribute.Value.Contains("WWW"))
Console.WriteLine(attribute);
Console.WriteLine(attribute.Value);
if (attribute.Value != null)
{
attachablesInfoDataGridView.Rows[num].Cells[1]
.Value =
attribute.Value;
attachablesInfoDataGridView.Rows[num].Cells[2]
.Value = true;
if (attribute.Value.Contains("https://") || attribute.Value.Contains("http://") || attribute.Value.Contains("www") || attribute.Value.Contains("WWW"))
{
attachablesInfoDataGridView.Rows[num].Cells[1].Value = attribute.Value;
attachablesInfoDataGridView.Rows[num].Cells[2].Value = true;
}
foreach (FileInfo fileInfo1 in directory.GetFiles())
@ -2997,6 +3005,7 @@ namespace Aml.Editor.Plugin
}
}
}
}
//Fehlermeldung
else
@ -3012,9 +3021,10 @@ namespace Aml.Editor.Plugin
}
}
}
}
amlx.Close();
}
catch (Exception ex)
catch (Exception)
{
open.Dispose();
newToolStripMenuItem_Click(sender, e);
@ -3762,7 +3772,7 @@ namespace Aml.Editor.Plugin
foreach (TreeNode childNode in node.Nodes)
{
if(childNode.Name == "AutomationMLBaseRole")
if (childNode.Name == "AutomationMLBaseRole")
{
autoloadGenericInformationtreeView(childNode);
}
@ -4634,7 +4644,8 @@ namespace Aml.Editor.Plugin
}
}
}
} else if (row.Cells[0].Value.ToString() == "1" && row.Cells[1].Value.ToString() == "(1)AutomationMLComponentStandardRCL/AutomationComponent")
}
else if (row.Cells[0].Value.ToString() == "1" && row.Cells[1].Value.ToString() == "(1)AutomationMLComponentStandardRCL/AutomationComponent")
{
string SRCSerialNumber = row.Cells[0].Value.ToString();
string SRC = row.Cells[1].Value.ToString();

View File

@ -230,15 +230,6 @@
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<COMReference Include="Microsoft.Vbe.Interop.Forms">
<Guid>{0D452EE1-E08F-101A-852E-02608C4D0BB4}</Guid>
<VersionMajor>2</VersionMajor>
<VersionMinor>0</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>primary</WrapperTool>
<Isolated>False</Isolated>
<EmbedInteropTypes>True</EmbedInteropTypes>
</COMReference>
<COMReference Include="stdole">
<Guid>{00020430-0000-0000-C000-000000000046}</Guid>
<VersionMajor>2</VersionMajor>