void Greeting(object sender, EventArgs args) { try { if (factory == null) { factory = new ChannelFactory <IContractXam>(binding, new EndpointAddress(address)); channel = factory.CreateChannel(); } if (factory != null && channel != null) { //Message.Text = channel.Greeting(); } } catch (Exception) { //Message.Text = "Error"; } }
public static Machine MoveMachineRight(this Machine machine, IContractXam channel) { Machine temp_machine = machine.ToClone(); if (channel != null) { temp_machine.X++; if (MainPage.MinX <= temp_machine.X && temp_machine.X < MainPage.MaxX && temp_machine.Y % 2 != 0 ) { channel.ChangeMachinePosition(temp_machine); return(temp_machine); } } return(machine); }
public static Machine MoveMachineUp(this Machine machine, IContractXam channel) { Machine temp_machine = machine.ToClone(); if (channel != null) { temp_machine.Y--; if (MainPage.MinY <= temp_machine.Y && temp_machine.Y < MainPage.MaxY && temp_machine.X % 2 != 0 ) { channel.ChangeMachinePosition(temp_machine); return(temp_machine); } } return(machine); }
void Connect() { try { if (factory == null) { factory = new ChannelFactory <IContractXam>(binding, new EndpointAddress(address)); channel = factory.CreateChannel(); } if (factory != null && channel != null) { //TODO picker MachineList = channel.GetAllMachines(); DisplayAlert("", $"Got machines list", "OK"); PositionsList = channel.GetAllPositions(); DisplayAlert("", $"Got positions list", "OK"); } } catch (Exception) { } }
public static Machine MoveMachineLeft(this Machine machine, IContractXam channel) { Machine temp_machine = machine.ToClone(); if (channel != null) { temp_machine.X--; if (MainPage.MinX <= temp_machine.X && temp_machine.X < MainPage.MaxX && temp_machine.Y % 2 != 0 ) { Console.WriteLine("Before sending " + machine.Str()); channel.ChangeMachinePosition(temp_machine); return(temp_machine); } } return(machine); }