public AFP_ITake GetOutLens() { AFP_ITake re = Lens; Lens = null; return(re); }
public override bool PutInLens(AFP_ITake iTake) { if (!(iTake is AFP_HoLens holens)) { return(false); } Lens = iTake; return(true); }
private void TestUsingFactory() { AFP_Camere camera = null; AFP_ITake lens = null; foreach (AFP_IMakeCamera factory in factories) { camera = factory.MakeCamera(); lens = factory.MakeLens(); TestCase(camera, lens); // 호환성 테스트 } }
private void TestCase(AFP_Camere camera, AFP_ITake lens) { Console.WriteLine("Test"); if (camera.PutInLens(lens) == false) { Console.WriteLine("Lens not setted in camera"); } if (camera.TakeAPicture() == false) { Console.WriteLine("Picture has not taken"); } }
public AFP_Camere() { Lens = null; }
public abstract bool PutInLens(AFP_ITake iTake);