public IMaterial WithParameters(IList <string> parameters) { Guard.WhenArgument(parameters, "parameters").IsNull().Throw(); IMaterialFromLibrary externalMaterial = this.materialLibrary.WithParameters(parameters); IMaterial internalMaterial = new MaterialAdapter(externalMaterial); return(internalMaterial); }
public IMaterialFromLibrary WithParameters(IList <string> parameters) { var kernel = new StandardKernel(new MaterialModule()); string commandParameters = string.Join(" ", parameters); IMaterialFromLibrary executionResult = kernel.Get <ICommandProcessor>().ProcessCommand(commandParameters); return(executionResult); }
public MaterialAdapter(IMaterialFromLibrary materialFromLibrary) { Guard.WhenArgument(materialFromLibrary, "materialFromLibrary").IsNull().Throw(); this.eModule = materialFromLibrary.EModule; this.gModule = materialFromLibrary.GModule; this.name = materialFromLibrary.Name; this.type = materialFromLibrary.Type; this.number = materialFromLibrary.Number; }
public static string AsString(this IMaterialFromLibrary material) { var result = new StringBuilder(); result.AppendLine($"ID: {material.Number}"); result.AppendLine($"Name: {material.Name}"); result.AppendLine($"E-module: {material.EModule}"); result.AppendLine($"G-module: {material.GModule}"); result.AppendLine("----"); return(result.ToString()); }