Skip to content

Commit

Permalink
Merge pull request #25 from caidevOficial/npd_CSharp_SB
Browse files Browse the repository at this point in the history
Ready to merge from NPD  to PRD - version [2.5.1.76]
  • Loading branch information
[FacuFalcone] committed May 27, 2021
2 parents ed76842 + 90a1c09 commit 2c4ca3c
Show file tree
Hide file tree
Showing 16 changed files with 2,515 additions and 2,479 deletions.
Binary file modified StructureBuilder/.vs/StructureBuilder/v16/.suo
Binary file not shown.
22 changes: 11 additions & 11 deletions StructureBuilder/Entities/Classes/ClassDiagram1.cd
Original file line number Diff line number Diff line change
@@ -1,70 +1,70 @@
<?xml version="1.0" encoding="utf-8"?>
<ClassDiagram MajorVersion="1" MinorVersion="1">
<ClassDiagram MajorVersion="1" MinorVersion="1" MembersFormat="FullSignature">
<Class Name="AuxiliarClass.ConsolePrinter">
<Position X="1.5" Y="4.5" Width="1.5" />
<Position X="0.5" Y="4.75" Width="7.25" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAEACAAAAAAAAQAAAAAAAIAAAAAAgAAAAAA=</HashCode>
<FileName>Classes\AuxiliarClass\ConsolePrinter.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="AuxiliarClass.DataCollector">
<Position X="13.5" Y="0.5" Width="2.25" />
<Position X="5.25" Y="7" Width="4" />
<TypeIdentifier>
<HashCode>IAQAEAAABAAgCAAAEAAAABAAAGAAAAAAAAAAAAAIAAA=</HashCode>
<FileName>Classes\AuxiliarClass\DataCollector.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="AuxiliarClass.DataValidator">
<Position X="12" Y="4.75" Width="1.5" />
<Position X="5.5" Y="10.25" Width="2.75" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAI=</HashCode>
<FileName>Classes\AuxiliarClass\DataValidator.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="Entities.Parameter">
<Position X="11" Y="0.5" Width="2.25" />
<Position X="15.25" Y="7" Width="7.75" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAQAIEAAAABAAAAAAAAAAAAAAAEAhAAhiI=</HashCode>
<FileName>Classes\Entities\Parameter.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="Entities.Structure">
<Position X="8.5" Y="0.5" Width="2.25" />
<Position X="9.5" Y="7" Width="5.5" />
<TypeIdentifier>
<HashCode>BAAAAAAQAAAAAAAAQAAAAAACAEAAABBgAAAAAAAAwiA=</HashCode>
<FileName>Classes\Entities\Structure.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="SBExceptions.EmptyFieldException">
<Position X="5.75" Y="5" Width="2.75" />
<Position X="0.5" Y="7" Width="4.25" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>Classes\Exceptions\EmptyFieldException.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="FileBuilders.Creator">
<Position X="0.5" Y="0.5" Width="2.5" />
<Position X="0.5" Y="0.5" Width="7.25" />
<TypeIdentifier>
<HashCode>QIIAAAAAEABAACgAAoAAQAAAAIAIAAgAAAAAAAAAACA=</HashCode>
<FileName>Classes\FileBuilders\Creator.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="FileBuilders.CreatorDotC">
<Position X="3.25" Y="0.5" Width="2.25" />
<Position X="8.25" Y="0.5" Width="8.25" />
<TypeIdentifier>
<HashCode>YIIIAAAAUABAAAgAAoAAQAAEAIAIAAgAAEBAAACQACA=</HashCode>
<FileName>Classes\FileBuilders\CreatorDotC.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="FileBuilders.CreatorDotH">
<Position X="5.75" Y="0.5" Width="2.5" />
<Position X="17" Y="0.5" Width="8.25" />
<TypeIdentifier>
<HashCode>QIIAAAAAEABAACgAAoAAwAAAAIAIAAgAAAAEAAAAACA=</HashCode>
<FileName>Classes\FileBuilders\CreatorDotH.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="SBExceptions.NoSoundFoundException">
<Position X="8.75" Y="4.75" Width="3" />
<Position X="0.5" Y="9" Width="4.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>Classes\Exceptions\NoSoundFoundException.cs</FileName>
Expand Down
2 changes: 1 addition & 1 deletion StructureBuilder/Entities/Classes/FileBuilders/Creator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public abstract class Creator {
/// <param name="packsDone">Amount of steps done.</param>
/// <param name="fullPackSize">Amount of total steps to do.</param>
/// <returns>The amount of steps done.</returns>
public abstract short FileMaker(Structure myStructure, short packsDone, short fullPackSize);
public abstract short FileMaker(string path, Structure myStructure, short packsDone, short fullPackSize);

#endregion

Expand Down
24 changes: 10 additions & 14 deletions StructureBuilder/Entities/Classes/FileBuilders/CreatorDotC.cs
Original file line number Diff line number Diff line change
Expand Up @@ -572,33 +572,29 @@ public sealed class CreatorDotC : Creator {
/// <param name="packsDone">Amount of steps done.</param>
/// <param name="fullPackSize">Amount of total steps to do.</param>
/// <returns>The amount of steps done.</returns>
public override short FileMaker(Structure myStructure, short packsDone, short fullPackSize) {
public override short FileMaker(string path, Structure myStructure, short packsDone, short fullPackSize) {
if (!(myStructure is null)) {
TextWriter pFileDotC = new StreamWriter($"{myStructure.FinalStructureName}.c");

try {
StringBuilder dataMaker = new StringBuilder();
string curFile = $"{myStructure.FinalStructureName}.c";

packsDone = CreateBasicStructFunctions(myStructure, dataMaker, packsDone, fullPackSize);
packsDone = CreateGettersAndSetters(myStructure, dataMaker, packsDone, fullPackSize);
CreateDeleteFunction(myStructure, dataMaker);

if (File.Exists(curFile)) {
// if exist, writes the file.
pFileDotC.Write(dataMaker);

try {
using(StreamWriter pFileDotC = new StreamWriter($"{path}\\{curFile}")) {
pFileDotC.Write(dataMaker);
}
} catch (Exception e2) {
Console.WriteLine(e2.StackTrace);
throw new Exception("Maybe the file is null in CreatorDotC.cs", e2);
}

} catch (Exception e) {
Console.WriteLine(e.StackTrace);
}
// Here we close the file if there is an error or not.
try {
if (!(pFileDotC is null)) {
pFileDotC.Close();
}
} catch (Exception e2) {
Console.WriteLine(e2.StackTrace);
}
}

return packsDone;
Expand Down
27 changes: 9 additions & 18 deletions StructureBuilder/Entities/Classes/FileBuilders/CreatorDotH.cs
Original file line number Diff line number Diff line change
Expand Up @@ -338,9 +338,9 @@ public sealed class CreatorDotH : Creator {
/// <param name="packsDone">Amount of steps done.</param>
/// <param name="fullPackSize">Amount of total steps to do.</param>
/// <returns>The amount of steps done.</returns>
public override short FileMaker(Structure myStructure, short packsDone, short fullPackSize) {
public override short FileMaker(string path, Structure myStructure, short packsDone, short fullPackSize) {
if (!(myStructure is null)) {
TextWriter pFileDotH = new StreamWriter($"{myStructure.FinalStructureName}.h");

try {
StringBuilder dataMaker = new StringBuilder();
string curFile = $"{myStructure.FinalStructureName}.h";
Expand All @@ -359,28 +359,19 @@ public sealed class CreatorDotH : Creator {
CreateDeleteFunction(myStructure, dataMaker);
dataMaker.AppendLine($"\n#endif /* {myStructure.FinalStructureName.ToUpper()}_H_INCLUDED */");

if (File.Exists(curFile)) {
// if exist the file, writes.
pFileDotH.Write(dataMaker);
}

packsDone++;
ConsolePrinter.ShowProgress(fullPackSize, packsDone);

} catch (Exception e) {
Console.WriteLine(e.StackTrace);
throw new Exception("Something has gone wrong in CreatorDotH.cs", e);
} finally {
// Here we close the file if there is an error or not.
try {
if (!(pFileDotH is null)) {
pFileDotH.Close();
using (StreamWriter pFileDotH = new StreamWriter($"{path}\\{curFile}")) {
pFileDotH.Write(dataMaker);
}
} catch (Exception e2) {
Console.WriteLine(e2.StackTrace);
throw new Exception("Maybe the file is null in CreatorDotH.cs", e2);
}
}

} catch (Exception e) {
Console.WriteLine(e.StackTrace);
throw new Exception("Something has gone wrong in CreatorDotH.cs", e);
}
}

return packsDone;
Expand Down
20 changes: 10 additions & 10 deletions StructureBuilder/StructureBuilder_Form/Forms/DiagramForm.cd
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<ClassDiagram MajorVersion="1" MinorVersion="1">
<ClassDiagram MajorVersion="1" MinorVersion="1" MembersFormat="NameAndType">
<Class Name="StructureBuilder_Form.Program">
<Position X="3" Y="0.5" Width="1.25" />
<Position X="5" Y="0.5" Width="1.25" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAA=</HashCode>
<FileName>Program.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="StructureBuilder_Form.StructureBuilder">
<Position X="0.5" Y="0.5" Width="2.25" />
<Position X="0.5" Y="0.5" Width="4.25" />
<TypeIdentifier>
<HashCode>AIAxAEFQAChAMBwBJHmBCACGGEAKACCAGAKmASgIAI4=</HashCode>
<HashCode>AIAxAEFQAChAMBwBJHmBCAGGGEgKACCAGAKmACgIBI4=</HashCode>
<FileName>Forms\StructureBuilder_Form.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="StructureBuilder_Form.Properties.Resources">
<Position X="3" Y="1.75" Width="1.75" />
<Position X="5" Y="1.75" Width="2.75" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAABEAAAAQAAAAAAAAAAAAAAAIA=</HashCode>
</TypeIdentifier>
</Class>
<Class Name="StructureBuilder_Form.Properties.Settings">
<Position X="3" Y="4.25" Width="1.75" />
<Position X="5" Y="4.5" Width="2.25" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAIAAAAAABAAAAAAAAAAAAAAA=</HashCode>
</TypeIdentifier>
</Class>
<Class Name="StructureBuilder_Form.frmException">
<Position X="5" Y="0.5" Width="2" />
<Position X="13.5" Y="0.5" Width="3" />
<TypeIdentifier>
<HashCode>AAAAAAAAACQAQAAAACCAAAACEBEAAAAACCAAAAAAAAA=</HashCode>
<FileName>Forms\FrmException.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="StructureBuilder_Form.FrmSuccess">
<Position X="9.25" Y="0.5" Width="1.75" />
<Position X="10.75" Y="0.5" Width="2.5" />
<TypeIdentifier>
<HashCode>AAAAABAAACAAAhAAAACAAgBSAAAAAAAAACAAAAAAAgA=</HashCode>
<HashCode>AAAAABAAACAIAhAAAACCAgBSAAAAAAAAACAAAAAAAgA=</HashCode>
<FileName>Forms\FrmSuccess.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="StructureBuilder_Form.FrmWelcome">
<Position X="7.25" Y="0.5" Width="1.75" />
<Position X="8" Y="0.5" Width="2.5" />
<TypeIdentifier>
<HashCode>EQAAAAgQACAAABAAAACAAAACAAAAAAAAAAAAAAgAAIA=</HashCode>
<FileName>Forms\FrmWelcome.cs</FileName>
Expand Down
33 changes: 18 additions & 15 deletions StructureBuilder/StructureBuilder_Form/Forms/FrmSuccess.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 7 additions & 8 deletions StructureBuilder/StructureBuilder_Form/Forms/FrmSuccess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,23 @@
*/

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 StructureBuilder_Form {
public partial class FrmSuccess : Form {

private string path;

#region Builder

public FrmSuccess() {
InitializeComponent();
}

public FrmSuccess(string path) : this() {
this.path = path;
}

#endregion

#region TimerEvent
Expand All @@ -57,7 +56,6 @@ public partial class FrmSuccess : Form {
tmrFadeOut.Start();

}

}

private void tmrFadeOut_Tick(object sender, EventArgs e) {
Expand All @@ -78,6 +76,7 @@ public partial class FrmSuccess : Form {
#region LoadEvent

private void FrmSuccess_Load(object sender, EventArgs e) {
lblSuccess.Text = $"Files Created, check in {this.path}";
this.Opacity = 0.0;
this.pbProgress.Value = 0;
this.pbProgress.Minimum = 0;
Expand Down
5 changes: 2 additions & 3 deletions StructureBuilder/StructureBuilder_Form/Forms/FrmWelcome.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ public partial class FrmWelcome : Form {
if (this.cpbProgress.Value < 100) {
this.cpbProgress.Value += 1;
this.cpbProgress.Text = this.cpbProgress.Value.ToString();
}
else {
} else {
tmFadeIn.Stop();
tmFadeOut.Start();
}
Expand All @@ -71,7 +70,7 @@ public partial class FrmWelcome : Form {
this.cpbProgress.Value += 1;
this.cpbProgress.Text = this.cpbProgress.Value.ToString();
}

if (this.Opacity == 0) {
this.Close();
}
Expand Down
Loading

0 comments on commit 2c4ca3c

Please sign in to comment.