public string GetFinalProduct(ComputerSystemProduct obj)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append(string.Format("RAM: {0}", obj.RAM));
            sb.Append(string.Format("HDDSize: {0}", obj.HDDSize));
            sb.Append(string.Format("Mouse: {0}", obj.Mouse));
            sb.Append(string.Format("KeyBoard: {0}", obj.KeyBoard));
            sb.Append(string.Format("TouchScreen: {0}", obj.TouchScreen));
            sb.Append(string.Format("Processor: {0}", obj.Processor));

            return(sb.ToString());
        }
Ejemplo n.º 2
0
        public static string GetSystemConfigurationObject(Dictionary <string, string> collection)
        {
            //Step:1 Concrete Builder building it for Laptop. Similary we can build it for DesktopBuilder.
            ISystemBuilder systemBuilder = new LaptopBuilder(); //DesktopBuilder

            //step:2 Director
            ConfigurationBuilder builder = new ConfigurationBuilder();

            builder.BuildSystem(systemBuilder, collection);

            //Step:3 Return the system
            ComputerSystemProduct product = systemBuilder.GetSystem();

            //Step:4 Get Final Product info.
            string SystemConfigDetails = product.GetFinalProduct(product);

            return(SystemConfigDetails);
        }