Example #1
0
        // Constructor
        public RichCompound(Chemical chemical)
        {
            Chemical = chemical;

            // The Adaptee
            bank = new ChemicalDatabank();
        }
Example #2
0
        public override void Display()
        {
            // The Adaptee
            _bank = new ChemicalDatabank();

            // Adaptee request methods
            BoilingPoint     = _bank.GetCriticalPoint(Chemical, State.Boiling);
            MeltingPoint     = _bank.GetCriticalPoint(Chemical, State.Melting);
            MolecularWeight  = _bank.GetMolecularWeight(Chemical);
            MolecularFormula = _bank.GetMolecularStructure(Chemical);

            base.Display();
            Console.WriteLine(" Formula: {0}", MolecularFormula);
            Console.WriteLine(" Weight : {0}", MolecularWeight);
            Console.WriteLine(" Melting Pt: {0}", MeltingPoint);
            Console.WriteLine(" Boiling Pt: {0}", BoilingPoint);
        }
Example #3
0
        public override void Display()
        {
            // The Adaptee
            _bank = new ChemicalDatabank();

            // Adaptee request methods
            BoilingPoint = _bank.GetCriticalPoint(Chemical, State.Boiling);
            MeltingPoint = _bank.GetCriticalPoint(Chemical, State.Melting);
            MolecularWeight = _bank.GetMolecularWeight(Chemical);
            MolecularFormula = _bank.GetMolecularStructure(Chemical);

            base.Display();
            Console.WriteLine(" Formula: {0}", MolecularFormula);
            Console.WriteLine(" Weight : {0}", MolecularWeight);
            Console.WriteLine(" Melting Pt: {0}", MeltingPoint);
            Console.WriteLine(" Boiling Pt: {0}", BoilingPoint);
        }