void OnFocusChanged(IPropertyTreeView sender, IShowProperty NewFocus, IShowProperty OldFocus) { if (subEntries != null) { steps.Clear(); // alle rauswerfen und neu aufbauen for (int i = 0; i < subEntries.Length; ++i) { PositionProperty pp = subEntries[i] as PositionProperty; if (pp != null) { if (pp.Drive == null) { continue; } SortedList <double, double> addTo; if (!steps.TryGetValue(pp.Drive, out addTo)) { addTo = new SortedList <double, double>(); steps[pp.Drive] = addTo; } addTo[pp.Time] = pp.Position; } } } }
bool ICommandHandler.OnCommand(string MenuId) { switch (MenuId) { case "MenuId.Schedule.NewPosition": propertyTreeView.OpenSubEntries(this, true); // damit gibts die subentries List <IShowProperty> tmp = new List <IShowProperty>(subEntries); PositionProperty pp = new PositionProperty(this, driveList); tmp.Add(pp); subEntries = tmp.ToArray(); propertyTreeView.Refresh(this); propertyTreeView.OpenSubEntries(pp, true); propertyTreeView.SelectEntry(pp); // besser wäre den ersten Eintrag davon return(true); case "MenuId.Schedule.Sort": propertyTreeView.SelectEntry(this); // damit der Focus hierhin geht und die Änderungen übernommen werden subEntries = null; propertyTreeView.Refresh(this); return(true); case "MenuId.Schedule.MakeCurrent": { ShowPropertySchedules sps = propertyTreeView.GetParent(this) as ShowPropertySchedules; if (sps != null) { sps.ActiveSchedule = this; } } return(true); case "MenuId.Schedule.Remove": { ShowPropertySchedules sps = propertyTreeView.GetParent(this) as ShowPropertySchedules; if (sps != null) { sps.Remove(this); } } return(true); } return(false); }