private void ListenerClick(SfbButtonAction action) { switch (action) { case SfbButtonAction.HistoryBack: ListenerHistoryBack(); break; case SfbButtonAction.HistoryForward: ListenerHistoryForward(); break; case SfbButtonAction.OpenParentDirectory: ListenerOpenParentDirectory(); break; case SfbButtonAction.ReloadBrowsers: ListenerReloadBrowsers(); break; case SfbButtonAction.ShowDrives: InternalChangeDirectory(fileSystem.root); break; case SfbButtonAction.AddToFavorites: ListenerAddToFavorites(); break; case SfbButtonAction.NewFolder: ListenerNewFolder(); break; case SfbButtonAction.DeleteSelection: ListenerDeleteSelection(); break; case SfbButtonAction.OpenExtensionsDropMenu: ListenerOpenExtensionsDropMenu(); break; case SfbButtonAction.CloseBrowser: CloseWindow(); break; case SfbButtonAction.SubmitOpenSelection: ListenerSubmitOpenSelection(); break; case SfbButtonAction.SubmitSaveSelection: ListenerSubmitSaveFile(); break; } }
public void SetButtonListeners(Button button, SfbButtonAction action) { button.onClick.AddListener(() => ListenerClick(action)); }