public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { IWindowsFormsEditorService svc = (IWindowsFormsEditorService) provider.GetService(typeof(IWindowsFormsEditorService)); if (svc != null) { MarkerHelper NewSpawner = new MarkerHelper((MarkerTimeline)value); if (NewSpawner.ShowDialog() == System.Windows.Forms.DialogResult.OK) { value = NewSpawner.MarkerViewer.ActiveMarker; } } return(value); }
public override List <VisibleTimeline> CreateNewEditorItem(AnimationClass ActiveAnimation, AnimationClass.AnimationLayer ActiveLayer, int KeyFrame, System.Drawing.Point MousePosition) { List <VisibleTimeline> ReturnValue = new List <VisibleTimeline>(); MarkerHelper NewSpawner = new MarkerHelper(); if (NewSpawner.ShowDialog() == System.Windows.Forms.DialogResult.OK) { MarkerTimeline NewSetMarkerEvent = NewSpawner.MarkerViewer.ActiveMarker; NewSetMarkerEvent.Position = new Vector2(535, 170); NewSetMarkerEvent.SpawnFrame = KeyFrame; NewSetMarkerEvent.DeathFrame = KeyFrame + 10; NewSetMarkerEvent.IsUsed = true;//Disable the spawner as we spawn the Marker manually. NewSetMarkerEvent.Add(KeyFrame, new VisibleAnimationObjectKeyFrame(new Vector2(NewSpawner.MarkerViewer.ActiveMarker.Position.X, NewSpawner.MarkerViewer.ActiveMarker.Position.Y), true, -1)); ReturnValue.Add(NewSetMarkerEvent); } return(ReturnValue); }