-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
1,483 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[*.cs] | ||
|
||
# CS8618: Un champ non-nullable doit contenir une valeur non-null lors de la fermeture du constructeur. Envisagez de déclarer le champ comme nullable. | ||
dotnet_diagnostic.CS8618.severity = none |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
; Script generated by the Inno Setup Script Wizard. | ||
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! | ||
|
||
#define MyAppName "SignaMath" | ||
#define MyAppVersion "1.0.0" | ||
#define MyAppPublisher "zonetecde" | ||
#define MyAppURL "github.com/zonetecde/SignaMath" | ||
#define MyAppExeName "SignaMath.exe" | ||
|
||
[Setup] | ||
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications. | ||
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) | ||
AppId={{5A9CF922-3F87-4C7F-99D3-1EB5A4F82D37} | ||
AppName={#MyAppName} | ||
AppVersion={#MyAppVersion} | ||
;AppVerName={#MyAppName} {#MyAppVersion} | ||
AppPublisher={#MyAppPublisher} | ||
AppPublisherURL={#MyAppURL} | ||
AppSupportURL={#MyAppURL} | ||
AppUpdatesURL={#MyAppURL} | ||
DefaultDirName={autopf}\{#MyAppName} | ||
DisableProgramGroupPage=yes | ||
; Remove the following line to run in administrative install mode (install for all users.) | ||
PrivilegesRequired=lowest | ||
OutputDir=E:\Cloud\OneDrive - Conseil régional Grand Est - Numérique Educatif\Programmation\c#\SignaMath\Setup | ||
OutputBaseFilename=SignaMath | ||
SetupIconFile=E:\Cloud\OneDrive - Conseil régional Grand Est - Numérique Educatif\Programmation\c#\SignaMath\SignaMath\assets\icon.ico | ||
Compression=lzma | ||
SolidCompression=yes | ||
WizardStyle=modern | ||
UninstallDisplayIcon={app}\{#MyAppExeName} | ||
|
||
[Languages] | ||
Name: "french"; MessagesFile: "compiler:Languages\French.isl" | ||
|
||
[Tasks] | ||
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; | ||
|
||
[Files] | ||
Source: "E:\Cloud\OneDrive - Conseil régional Grand Est - Numérique Educatif\Programmation\c#\SignaMath\SignaMath\bin\Debug\net6.0-windows\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion | ||
Source: "E:\Cloud\OneDrive - Conseil régional Grand Est - Numérique Educatif\Programmation\c#\SignaMath\SignaMath\bin\Debug\net6.0-windows\AngouriMath.dll"; DestDir: "{app}"; Flags: ignoreversion | ||
Source: "E:\Cloud\OneDrive - Conseil régional Grand Est - Numérique Educatif\Programmation\c#\SignaMath\SignaMath\bin\Debug\net6.0-windows\Antlr4.Runtime.Standard.dll"; DestDir: "{app}"; Flags: ignoreversion | ||
Source: "E:\Cloud\OneDrive - Conseil régional Grand Est - Numérique Educatif\Programmation\c#\SignaMath\SignaMath\bin\Debug\net6.0-windows\GenericTensor.dll"; DestDir: "{app}"; Flags: ignoreversion | ||
Source: "E:\Cloud\OneDrive - Conseil régional Grand Est - Numérique Educatif\Programmation\c#\SignaMath\SignaMath\bin\Debug\net6.0-windows\HonkSharp.dll"; DestDir: "{app}"; Flags: ignoreversion | ||
Source: "E:\Cloud\OneDrive - Conseil régional Grand Est - Numérique Educatif\Programmation\c#\SignaMath\SignaMath\bin\Debug\net6.0-windows\MathNet.Numerics.dll"; DestDir: "{app}"; Flags: ignoreversion | ||
Source: "E:\Cloud\OneDrive - Conseil régional Grand Est - Numérique Educatif\Programmation\c#\SignaMath\SignaMath\bin\Debug\net6.0-windows\Microsoft.WindowsAPICodePack.dll"; DestDir: "{app}"; Flags: ignoreversion | ||
Source: "E:\Cloud\OneDrive - Conseil régional Grand Est - Numérique Educatif\Programmation\c#\SignaMath\SignaMath\bin\Debug\net6.0-windows\Microsoft.WindowsAPICodePack.Shell.dll"; DestDir: "{app}"; Flags: ignoreversion | ||
Source: "E:\Cloud\OneDrive - Conseil régional Grand Est - Numérique Educatif\Programmation\c#\SignaMath\SignaMath\bin\Debug\net6.0-windows\Numbers.dll"; DestDir: "{app}"; Flags: ignoreversion | ||
Source: "E:\Cloud\OneDrive - Conseil régional Grand Est - Numérique Educatif\Programmation\c#\SignaMath\SignaMath\bin\Debug\net6.0-windows\SignaMath.deps.json"; DestDir: "{app}"; Flags: ignoreversion | ||
Source: "E:\Cloud\OneDrive - Conseil régional Grand Est - Numérique Educatif\Programmation\c#\SignaMath\SignaMath\bin\Debug\net6.0-windows\SignaMath.dll"; DestDir: "{app}"; Flags: ignoreversion | ||
Source: "E:\Cloud\OneDrive - Conseil régional Grand Est - Numérique Educatif\Programmation\c#\SignaMath\SignaMath\bin\Debug\net6.0-windows\SignaMath.exe"; DestDir: "{app}"; Flags: ignoreversion | ||
Source: "E:\Cloud\OneDrive - Conseil régional Grand Est - Numérique Educatif\Programmation\c#\SignaMath\SignaMath\bin\Debug\net6.0-windows\SignaMath.pdb"; DestDir: "{app}"; Flags: ignoreversion | ||
Source: "E:\Cloud\OneDrive - Conseil régional Grand Est - Numérique Educatif\Programmation\c#\SignaMath\SignaMath\bin\Debug\net6.0-windows\SignaMath.runtimeconfig.json"; DestDir: "{app}"; Flags: ignoreversion | ||
Source: "E:\Cloud\OneDrive - Conseil régional Grand Est - Numérique Educatif\Programmation\c#\SignaMath\SignaMath\bin\Debug\net6.0-windows\WpfMath.dll"; DestDir: "{app}"; Flags: ignoreversion | ||
Source: "E:\Cloud\OneDrive - Conseil régional Grand Est - Numérique Educatif\Programmation\c#\SignaMath\SignaMath\bin\Debug\net6.0-windows\XamlMath.Shared.dll"; DestDir: "{app}"; Flags: ignoreversion | ||
; NOTE: Don't use "Flags: ignoreversion" on any shared system files | ||
|
||
[Icons] | ||
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" | ||
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon | ||
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon; IconFilename: "{app}\{#MyAppExeName}" | ||
|
||
[Run] | ||
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace SignaMath.Classes | ||
{ | ||
internal class ColumnElement | ||
{ | ||
public ColumnElement(string expression, double value, byte position, List<int> fromRows) | ||
{ | ||
Expression = expression; | ||
Value = value; | ||
Position = position; | ||
FromRows = fromRows; | ||
ValeurInterdite = false; | ||
ColumnSign = '+'; | ||
} | ||
|
||
internal string Expression { get; set; } | ||
internal double Value { get; set; } | ||
internal char ColumnSign { get; set; } | ||
internal bool ValeurInterdite { get; set; } | ||
internal byte Position { get; set; } | ||
internal List<int> FromRows { get; set; } | ||
|
||
internal static char LastColumnSign = '+'; | ||
internal static double IntervalleMin = double.MinValue; | ||
internal static double IntervalleMax = double.MaxValue; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
using System; | ||
using System.Globalization; | ||
using System.IO; | ||
using System.Reflection; | ||
using System.Text.RegularExpressions; | ||
using System.Windows; | ||
using System.Windows.Media; | ||
using System.Windows.Media.Imaging; | ||
|
||
namespace SignaMath.Extension | ||
{ | ||
internal static class Extension | ||
{ | ||
internal static Brush PickBrush() | ||
{ | ||
Brush result = Brushes.Transparent; | ||
|
||
Random rnd = new Random(); | ||
|
||
Type brushesType = typeof(Brushes); | ||
|
||
PropertyInfo[] properties = brushesType.GetProperties(); | ||
|
||
int random = rnd.Next(properties.Length); | ||
result = (Brush)properties[random].GetValue(null, null)!; | ||
|
||
return result; | ||
} | ||
|
||
internal static void WriteToPng(UIElement element, string filename) | ||
{ | ||
var rect = new Rect(element.RenderSize); | ||
var visual = new DrawingVisual(); | ||
|
||
using (var dc = visual.RenderOpen()) | ||
{ | ||
dc.DrawRectangle(new VisualBrush(element), null, rect); | ||
} | ||
|
||
var dpiX = 300; // Résolution horizontale en DPI | ||
var dpiY = 300; // Résolution verticale en DPI | ||
|
||
var pixelWidth = (int)(rect.Width * dpiX / 96); | ||
var pixelHeight = (int)(rect.Height * dpiY / 96); | ||
|
||
var bitmap = new RenderTargetBitmap( | ||
pixelWidth, pixelHeight, dpiX, dpiY, PixelFormats.Default); | ||
bitmap.Render(visual); | ||
|
||
var encoder = new PngBitmapEncoder(); | ||
encoder.Frames.Add(BitmapFrame.Create(bitmap)); | ||
|
||
using (var file = File.OpenWrite(filename)) | ||
{ | ||
encoder.Save(file); | ||
} | ||
} | ||
|
||
internal static double StrToDouble(string expBrute) | ||
{ | ||
double approximation; | ||
if (expBrute.Contains('/')) | ||
{ | ||
// fraction toujours pas convertie | ||
approximation = ParseDoubleFromString(expBrute); | ||
} | ||
else | ||
{ | ||
approximation = double.Parse(expBrute.Replace(",", "."), CultureInfo.InvariantCulture); | ||
} | ||
|
||
return approximation; | ||
} | ||
|
||
private static double ParseDoubleFromString(string num) | ||
{ | ||
//removes multiple spces between characters, cammas, and leading/trailing whitespace | ||
num = Regex.Replace(num.Replace(",", ""), @"\s+", " ").Trim(); | ||
double d = 0; | ||
int whole = 0; | ||
double numerator; | ||
double denominator; | ||
|
||
//is there a fraction? | ||
if (num.Contains("/")) | ||
{ | ||
//is there a space? | ||
if (num.Contains(" ")) | ||
{ | ||
//seperate the integer and fraction | ||
int firstspace = num.IndexOf(" "); | ||
string fraction = num.Substring(firstspace, num.Length - firstspace); | ||
//set the integer | ||
whole = int.Parse(num.Substring(0, firstspace)); | ||
//set the numerator and denominator | ||
numerator = double.Parse(fraction.Split("/".ToCharArray())[0]); | ||
denominator = double.Parse(fraction.Split("/".ToCharArray())[1]); | ||
} | ||
else | ||
{ | ||
//set the numerator and denominator | ||
numerator = double.Parse(num.Split("/".ToCharArray())[0]); | ||
denominator = double.Parse(num.Split("/".ToCharArray())[1]); | ||
} | ||
|
||
//is it a valid fraction? | ||
if (denominator != 0) | ||
{ | ||
d = whole + numerator / denominator; | ||
} | ||
} | ||
else | ||
{ | ||
//parse the whole thing | ||
d = double.Parse(num.Replace(" ", "")); | ||
} | ||
|
||
return d; | ||
} | ||
} | ||
} |
Oops, something went wrong.