static void Main(string[] args) { var businessRules = new TransformDataIntoNewData(); var ui = new MyDialog(businessRules); businessRules.Dialog = ui; ui.OnOKUseButtonPressed(); // simulate user pressing button System.Console.ReadKey(); // prevent console from closing }
static void Main(string[] args) { var transformDataBR = new TransformDataIntoNewData(); //criando objeto que implementa a interface var transformNameBR = new TransformNameIntoNewName(); var qtdata = new UI_QT.TransformDataWindow(transformDataBR);//recebe o objeto var qtname = new UI_QT.TransformNameWindow(transformNameBR); var unitydata = new UI_UNITY.TransformDataWindow(transformDataBR); var unityname = new UI_UNITY.TransformNameWindow(transformNameBR); transformDataBR.Window = qtdata; //unitydata/ injeta transformNameBR.Window = qtname; //unityname qtdata.OnOKUseButtonPressed(); //unitydata simulate user pressing button qtname.OnOKUseButtonPressed(); //unityname System.Console.ReadKey(); // prevent console from closing }
static void Main(string[] args) { //##### using QT ##### // var transformData = new TransformDataIntoNewData(); var transformName = new TransformNameIntoNewName(); var transformNumber = new TransformNumberIntoNewNumber(); var qtData = new UI_QT.TransformDataWindow(transformData); var qtName = new UI_QT.TransformNameWindow(transformName); var qtNumber = new UI_QT.TransformNumberWindow(transformNumber); transformData.Output = qtData; transformName.Output = qtName; transformNumber.Output = qtNumber; // simulate user pressing button qtData.OnOKUseButtonPressed(); qtName.OnOKUseButtonPressed(); qtNumber.OnOKUseButtonPressed(); //##### using UNITY ##### // var unityData = new UI_UNITY.TransformDataWindow(transformData); var unityName = new UI_UNITY.TransformNameWindow(transformName); var unityNumber = new UI_UNITY.TransformNumberWindow(transformNumber); transformData.Output = unityData; transformName.Output = unityName; transformNumber.Output = unityNumber; unityData.OnOKUseButtonPressed(); unityName.OnOKUseButtonPressed(); unityNumber.OnOKUseButtonPressed(); System.Console.ReadKey(); // prevent console from closing }
public MyDialog(TransformDataIntoNewData businessRule) { this.businessRule = businessRule; }