protected override void OnInitialize() { if (AvailableTypes != null) { SelectedEventType = AvailableTypes.FirstOrDefault(); } var list = GetSelectedAgents(null).Cast <IAgent>().ToArray(); EmployeeSelectionWay = list.Length > 1 ? 1 : 0; CurrentAgent = list.Length > 0 ? list[0] : default(IAgent); SelectedCount = CurrentAgent.If <ISelectable>(o => o.IsSelected == true) ? list.Length : list.Length > 0 ? list.Length - 1 : 0; base.OnInitialize(); }
public override void Activate() { if (OnActivateDelegate != null) { OnActivateDelegate(this); } var list = GetSelectedAgents(null).Cast <IAgent>().ToArray(); EmployeeSelectionWay = list.Length > 1 ? 1 : 0; CurrentAgent = list.Length > 0 ? list[0] : default(IAgent); SelectedCount = CurrentAgent.If <Luna.Common.ISelectable>(o => o.IsSelected == true) ? list.Length : list.Length > 0 ? list.Length - 1 : 0; if (SelectedEventType != null) { SelectedEventType.TimespanWidth = MeasureEventWidth(EventLength); } }