public static void OnClipMenu(ITimelineState state, TimelineClip[] clips, GenericMenu menu)
 {
     if (!(state.currentDirector == null))
     {
         TimelineClip[] array = (from c in clips
                                 where c.asset as AnimationPlayableAsset != null && c.parentTrack.clips.Any((TimelineClip x) => x.start < c.start)
                                 select c).ToArray <TimelineClip>();
         TimelineClip[] array2 = (from c in clips
                                  where c.asset as AnimationPlayableAsset != null && c.parentTrack.clips.Any((TimelineClip x) => x.start > c.start)
                                  select c).ToArray <TimelineClip>();
         if (array.Any <TimelineClip>() || array2.Any <TimelineClip>())
         {
             if (array.Any <TimelineClip>())
             {
                 menu.AddItem(AnimationOffsetMenu.MatchPreviousMenuItem, false, delegate(object x)
                 {
                     AnimationOffsetMenu.MatchClipsToPrevious(state, (TimelineClip[])x);
                 }, array);
             }
             if (array2.Any <TimelineClip>())
             {
                 menu.AddItem(AnimationOffsetMenu.MatchNextMenuItem, false, delegate(object x)
                 {
                     AnimationOffsetMenu.MatchClipsToNext(state, (TimelineClip[])x);
                 }, array2);
             }
             menu.AddItem(AnimationOffsetMenu.ResetOffsetMenuItem, false, delegate
             {
                 AnimationOffsetMenu.ResetClipOffsets(state, clips);
             });
         }
     }
 }
 public override bool Execute(IEnumerable <TimelineClip> clips)
 {
     if (clips == null || !clips.Any())
     {
         return(false);
     }
     AnimationOffsetMenu.MatchClipsToPrevious(clips.Where(x => IsValidClip(x, TimelineEditor.inspectedDirector)).ToArray());
     return(true);
 }
 public override bool Execute(WindowState state, TimelineClip[] items)
 {
     AnimationOffsetMenu.MatchClipsToPrevious(state, items.Where(x => IsValidClip(x, TimelineEditor.inspectedDirector)).ToArray());
     return(true);
 }