Beispiel #1
0
        public object ImportData(string type, Dictionary <string, string> dictionary)
        {
            ArtPiece artPiece;

            if (type == painting)
            {
                artPiece = new Painting(dictionary);
            }
            else if (type == photography)
            {
                artPiece = new Photography(dictionary);
            }
            else if (type == sculpture)
            {
                artPiece = new Sculpture(dictionary);
            }
            else
            {
                return(null);
            }
            return(artPiece);
        }
Beispiel #2
0
        public object Create(string type)
        {
            ArtPiece artPiece;

            if (type == painting)
            {
                artPiece = new Painting();
            }
            else if (type == photography)
            {
                artPiece = new Photography();
            }
            else if (type == sculpture)
            {
                artPiece = new Sculpture();
            }
            else
            {
                return(null);
            }
            return(artPiece);
        }