/// <summary> ///Method Name:GetCarClass /// Description://Use the all functionality of Car class /// Author:bhumi /// Created On:25/5/2015 /// </summary> public void GetCarClass() { objcar = new Car(); objconst = new ConstantMessage(); objcar.Drive(); Console.WriteLine(objcar); }
/// <summary> ///Method Name:Drive7_11 /// Description://method of IFuelConsumption interface /// Author:bhumi /// Created On:27/5/2015 /// </summary> int IFuelConsumption.Drive7_11() { objconst = new ConstantMessage(); Console.WriteLine(objconst.strcountkm + " Car"); kilometer = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("km Car:" + kilometer); return(kilometer); }
//Method of interface int IFuelConsumption.Drive7_11() { objconst = new ConstantMessage(); int kilometer; Console.WriteLine(objconst.strcountkm + "for Armored Vehicle"); kilometer = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("km Armored Vehicle " + kilometer); return(kilometer); }
/// <summary> ///Method Name:Destruct /// Description://Method of specific namespace & class /// Author:bhumi /// Created On:27/5/2015 /// </summary> void vehicle.Destruct() { objconst = new ConstantMessage(); try { Console.WriteLine(objconst.strvehiclenotdestroy); throw new VehicleCannotBeDestroyedException(strvehicleexception); } catch (VehicleCannotBeDestroyedException ex) { Console.WriteLine(ex.Message); } }
ConstantMessage objconst;//object creation /// <summary> ///Method Name:Drive /// Description://method of Car class /// Author:bhumi /// Created On:25/5/2015 /// </summary> public void Drive7_10() { try { objconst = new ConstantMessage(); Console.WriteLine(objconst.strcarmotion); } catch (Exception ex) { Console.WriteLine(ex.Message); } finally { objconst = null; } }
/// <summary> ///Method Name:NoFuelExe /// Description://Method for throw the Exception /// Author:bhumi /// Created On:27/5/2015 /// </summary> public void NoFuelExe() { objconst = new ConstantMessage(); throw new NoFuelLeftException(); }
/// <summary> ///Method Name:Drive72 /// Description://method of Car class /// Author:bhumi /// Created On:25/5/2015 /// </summary> public void Drive72() { objconst = new ConstantMessage(); objvehicle = new Vehicle(); Console.WriteLine(objconst.strcarmotion); }
void IVehicle.Destruct() { objconst = new ConstantMessage(); Console.WriteLine(objconst.strcardestruct); }
/// <summary> ///Method Name:Drive /// Description://Method of specific namespace & class /// Author:bhumi /// Created On:25/5/2015 /// </summary> public void Drive() { objconst = new ConstantMessage(); Console.WriteLine(objconst.strcarmotion); }