Должен ли я просто сделать это?
Вилли Класс
public class WillyTC : Willy
{
public Dictionary<string, Dictionary<string, string>> WillyCustomProperties = new Dictionary<string, Dictionary<string, string>>();
public WillyTC() : base()
{
WillyCustomProperties.Add("PerimetreExterne", new Dictionary<string, string> { { "french", "Longueur à découper extérieure" } , { "english", "Cutting Length-Outer" } });
WillyCustomProperties.Add("PerimetreInterne", new Dictionary<string, string> { { "french", "Longueur à découper des boucles intérieures" } , { "english", "Cutting Length-Inner" } });
WillyCustomProperties.Add("NbDecoupeInterne", new Dictionary<string, string> { { "french", "Découpes" } , { "english", "Cut Outs" } });
WillyCustomProperties.Add("AireBrut", new Dictionary<string, string> { { "french", "Surface du flanc de tôle" } , { "english", "Bounding Box Area" } });
WillyCustomProperties.Add("AirePiece", new Dictionary<string, string> { { "french", "Surface du flanc de tôle brut" } , { "english", "Bounding Box Area-Blank" } });
WillyCustomProperties.Add("Pliages", new Dictionary<string, string> { { "french", "Plis" } , { "english", "Bends" } });
WillyCustomProperties.Add("Epaisseur", new Dictionary<string, string> { { "french", "Epaisseur de tôlerie" } , { "english", "Sheet Metal Thickness" } });
WillyCustomProperties.Add("LongueurRect", new Dictionary<string, string> { { "french", "Longueur du flanc de tôle" } , { "english", "Bounding Box Length" } });
WillyCustomProperties.Add("LargeurRect", new Dictionary<string, string> { { "french", "Largeur du flanc de tôle" } , { "english", "Bounding Box Width" } });
WillyCustomProperties.Add("NumeroMateriel", new Dictionary<string, string> { { "french", "NumeroMateriel" } , { "english", "NumeroMateriel" } });
WillyCustomProperties.Add("RPliage", new Dictionary<string, string> { { "french", "RPliagee" } , { "english", "RPliage" } });
WillyCustomProperties.Add("VPliage", new Dictionary<string, string> { { "french", "VPliage" } , { "english", "VPliage" } });
}
}
Используя это
string lang = parentType.solidworksController.swApp.GetCurrentLanguage();
PerimetreInterne = GetCustomPropDouble(customPropertyManager, ConfigController.config.TC.willy.WillyCustomProperties[nameof(PerimetreInterne)][lang]);
PerimetreExterne = GetCustomPropDouble(customPropertyManager, ConfigController.config.TC.willy.WillyCustomProperties[nameof(PerimetreExterne)][lang]);
NbDecoupeInterne = GetCustomPropInt(customPropertyManager, ConfigController.config.TC.willy.WillyCustomProperties[nameof(NbDecoupeInterne)][lang]);
AireBrut = GetCustomPropDouble(customPropertyManager, ConfigController.config.TC.willy.WillyCustomProperties[nameof(AireBrut)][lang]);
AirePiece = GetCustomPropDouble(customPropertyManager, ConfigController.config.TC.willy.WillyCustomProperties[nameof(AirePiece)][lang]);
Pliages = GetCustomPropInt(customPropertyManager, ConfigController.config.TC.willy.WillyCustomProperties[nameof(Pliages)][lang]);
Epaisseur = GetCustomPropDouble(customPropertyManager, ConfigController.config.TC.willy.WillyCustomProperties[nameof(Epaisseur)][lang]);
LongueurRect = GetCustomPropDouble(customPropertyManager, ConfigController.config.TC.willy.WillyCustomProperties[nameof(LongueurRect)][lang]);
LargeurRect = GetCustomPropDouble(customPropertyManager, ConfigController.config.TC.willy.WillyCustomProperties[nameof(LargeurRect)][lang]);