public void ListItemSelectedChangedNotify(object data) { WidgetSelectionInfo info = (WidgetSelectionInfo)data; WidgetListItem curitem = null; curitem = FindUIItemByGUID(info.WidgetID); if (curitem != null) { if (curitem.ItemType == ListItemType.GroupChildItem) { curitem.UpdateItemSelectInfo(false); } else { if (info.bSelected) { foreach (Guid ItemID in _oldSelectedList) { WidgetListItem tempitem = FindItemByGUID(ItemID); if ((tempitem != null && tempitem.IsSelected == true) && curitem.ParentID != tempitem.ParentID) { curitem.UpdateItemSelectInfo(false); return; } } if (curitem.PlaceFlag == true) { _oldSelectedList.Add(info.WidgetID); RefreshToolbarCommands(); return; } } else { if (curitem.PlaceFlag == true) { _oldSelectedList.Remove(info.WidgetID); return; } } WidgetSelectionInfoExtra Notifydata = new WidgetSelectionInfoExtra(); Notifydata.WidgetID = curitem.WidgetID; Notifydata.bSelected = info.bSelected; Notifydata.PageID = curitem.ParentPage.Guid; Notifydata.BelongWidget = WidgetListItem.BelongWidget; Notifydata.pageType = GetparentType(curitem.ParentPage); Notifydata.IsGroup = (curitem.ItemType == ListItemType.GroupItem); Notifydata.IsSwipePanel = (curitem.ItemType == ListItemType.DynamicPanelStateItem); _ListEventAggregator.GetEvent <WdgMgrChangeSelectionEvent>().Publish(Notifydata); } } }
public void WidgetSelectionChangeHandler(string EventArg) { try { List <Guid> SelectList = _selectionService.GetSelectedWidgetGUIDs(); foreach (Guid id in SelectList) { _oldSelectedList.Remove(id); WidgetListItem Item = FindUIItemByGUID(id); if (Item != null) { Item.UpdateItemSelectInfo(true); } } if (_oldSelectedList != null) { foreach (Guid id in _oldSelectedList) { WidgetListItem Item = FindUIItemByGUID(id); if (Item != null && !Item.PlaceFlag) { Item.UpdateItemSelectInfo(false); } } } _oldSelectedList.Clear(); //_oldSelectedList = SelectList; foreach (WidgetListItem item in _control.ObjectList.Items) { if (item.IsSelected) { _oldSelectedList.Add(item.WidgetID); } } if (SelectList.Count > 0) { WidgetListItem Item22 = FindUIItemByGUID(SelectList.First()); if (Item22 != null) { // ScrollToCenterOfView(_control.Tree, Item22); _control.ObjectList.ScrollIntoView(Item22); } } RefreshToolbarCommands(); } catch (System.Exception ex) { NLogger.Error("WidgetSelectionChange" + ex.Message); } }