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);
        }
示例#2
0
        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);
        }
示例#3
0
        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());
        }