void ProxyExecDown() { int ix = ProxyList.IndexOf(SelectedProxy); LE_Proxy nextProxy = ProxyList[ix + 1]; int ix1 = SelectedProxy.Ix; _dataService.SwapProxy(SelectedProxy, nextProxy); SelectedProxy.Ix = nextProxy.Ix; nextProxy.Ix = ix1; ProxyList[ix + 1] = SelectedProxy; ProxyList[ix] = nextProxy; SelectedProxy = ProxyList[ix + 1]; }
void ProxyExecUp() { int ix = ProxyList.IndexOf(SelectedProxy); LE_Proxy prevProxy = ProxyList[ix - 1]; int ix1 = SelectedProxy.Ix; _dataService.SwapProxy(SelectedProxy, prevProxy); SelectedProxy.Ix = prevProxy.Ix; prevProxy.Ix = ix1; ProxyList[ix - 1] = SelectedProxy; ProxyList[ix] = prevProxy; SelectedProxy = ProxyList[ix - 1]; }
private void LE_LinkToZoneChanged(string obj) { if (DetailSelectedItem.LE_Proxy == null) { //Link Operation int ix = ProxyList.Count; _dataService.LinkToZone(DetailSelectedItem, MasterSelectedItem, ix, (leProxy, error) => { if (error != null) { return; } // Report error here { DetailSelectedItem.LE_Proxy = leProxy; ProxyList.Add(leProxy); } }); if (MasterSelectedItem.PointType != DetailSelectedItem.PointType) { MasterSelectedItem.PointType = DetailSelectedItem.PointType; _dataService.UpdateLightZone(MasterSelectedItem, (i, er) => { }); } MasterSelectedItem.DirectParent = true; DetailSelectedItem.RaiseLinkedToZoneChanged(); MasterSelectedItem.RaiseHasChildrenChanged(); } else { // Unlink _dataService.UnlinkFromZone(DetailSelectedItem, MasterSelectedItem, (updateCount, error) => { }); LE_Proxy proxy = ProxyList.FirstOrDefault(p => p.LightElement.Id == DetailSelectedItem.Id); ProxyList.Remove(proxy); int i = 0; foreach (LE_Proxy leProxy in ProxyList) { leProxy.Ix = i; i++; } DetailSelectedItem.LE_Proxy = null; MasterSelectedItem.DirectParent = false; DetailSelectedItem.RaiseLinkedToZoneChanged(); MasterSelectedItem.RaiseHasChildrenChanged(); } }