@@ -48,13 +48,13 @@ public static List<ProtocolAction> GetActions(this ProtocolBase server)
4848 ) ) ;
4949 }
5050
51- if ( server is ProtocolBaseWithAddressPortUserPwd { Credentials . Count : > 0 } protocol )
51+ if ( server is ProtocolBaseWithAddressPortUserPwd { AlternateCredentials . Count : > 0 } protocol )
5252 {
53- foreach ( var credential in protocol . Credentials )
53+ foreach ( var credential in protocol . AlternateCredentials )
5454 {
5555 actions . Add ( new ProtocolAction (
5656 actionName : IoC . Get < ILanguageService > ( ) . Translate ( "Connect" ) + $ " (TXT:with credential { credential . Name } )",
57- action : ( ) => { GlobalEventHelper . OnRequestServerConnect ? . Invoke ( server , fromView : $ "{ nameof ( LauncherWindowView ) } - Action - Credentials ", assignCredentialName : credential . Name ) ; }
57+ action : ( ) => { GlobalEventHelper . OnRequestServerConnect ? . Invoke ( server , fromView : $ "{ nameof ( LauncherWindowView ) } - Action - AlternateCredentials ", assignCredentialName : credential . Name ) ; }
5858 ) ) ;
5959 }
6060 }
@@ -76,11 +76,6 @@ public static List<ProtocolAction> GetActions(this ProtocolBase server)
7676 }
7777 }
7878
79- //else
80- //{
81- // actions.Add(new ProtocolAction(IoC.Get<ILanguageService>().Translate("Connect"), () => { GlobalEventHelper.OnRequestServerConnect?.Invoke(server.Id, fromView: nameof(LauncherWindowView)); }));
82- //}
83-
8479 if ( writable )
8580 {
8681 actions . Add ( new ProtocolAction ( IoC . Get < ILanguageService > ( ) . Translate ( "Edit" ) , ( ) =>
@@ -89,12 +84,12 @@ public static List<ProtocolAction> GetActions(this ProtocolBase server)
8984 IoC . Get < MainWindowViewModel > ( ) ? . ShowMe ( ) ;
9085 GlobalEventHelper . OnRequestGoToServerEditPage ? . Invoke ( server : server , showAnimation : false ) ;
9186 } ) ) ;
92- // actions.Add(new ProtocolAction(IoC.Get<ILanguageService>().Translate("server_card_operate_duplicate"), () =>
93- // {
94- // if (GlobalEventHelper.OnRequestGoToServerEditPage == null)
95- // IoC.Get<MainWindowViewModel>()?.ShowMe();
96- // GlobalEventHelper.OnRequestGoToServerDuplicatePage?.Invoke(server: server, showAnimation: false);
97- // }));
87+ actions . Add ( new ProtocolAction ( IoC . Get < ILanguageService > ( ) . Translate ( "server_card_operate_duplicate" ) , ( ) =>
88+ {
89+ if ( GlobalEventHelper . OnRequestGoToServerEditPage == null )
90+ IoC . Get < MainWindowViewModel > ( ) ? . ShowMe ( ) ;
91+ GlobalEventHelper . OnRequestGoToServerDuplicatePage ? . Invoke ( server : server , showAnimation : false ) ;
92+ } ) ) ;
9893 }
9994 } ;
10095
@@ -151,11 +146,6 @@ public static List<ProtocolAction> GetActions(this ProtocolBase server)
151146 }
152147 }
153148
154- //if (writable)
155- //{
156- // actions.Add(new ProtocolAction(IoC.Get<ILanguageService>().Translate("Delete"), () => { GlobalEventHelper.OnRequestDeleteServer?.Invoke(server); }));
157- //}
158-
159149 #endregion Build Actions
160150
161151 return actions ;
0 commit comments