|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
- G2 u1 X3 f8 p1 S
# @2 W0 |" s1 J' O; x' iNX二次开发源码分享:自定义yes或者no的确认对话框
% [& i( N3 u9 A
! \% j2 ]6 Q2 Q4 D/ [; Estatic bool AskYesOrNo(string title, string message)
/ t7 @; F! c8 G {: ?4 n1 ^ R% M% f4 _$ C* f
string[] messages = { message };0 i. W( [2 j7 @* o a9 c
UFUi.MessageButtons buttons = default(UFUi.MessageButtons);
* b( H/ w+ P0 W: R! T buttons.button1 = true;, l$ b6 [6 K7 U: w- R, R
buttons.button2 = false;; Y; K# T6 X- J. D4 U. y4 M7 l
buttons.button3 = true;
: v. ^% i- j% O& \- }7 ^' q T buttons.label1 = "Yes";8 O8 U. ~9 {0 ^& F9 V
buttons.label2 = null;/ M# L+ p3 P; D2 H3 {' Z b, M
buttons.label3 = "No";
$ k! p& J t7 s8 m% f buttons.response1 = 1;8 b- X1 X" \/ ~/ l; H! M$ u$ B0 d
buttons.response2 = 0; c& i5 S! z# `8 }& G0 O1 I
buttons.response3 = 2;
4 p3 R( f6 ]8 q int resp = 0;
5 D! K2 U9 P0 r# p! |6 T/ m" d% q8 P6 d3 p; |& b" A7 Y( |- _( v% s
theUFSession.Ui.LockUGAccess(UFConstants.UF_UI_FROM_CUSTOM);
2 K6 |8 ]$ e' v% I/ {7 B. u5 r: n7 m theUFSession.Ui.MessageDialog(title, UiMessageDialogType.UiMessageQuestion,
. p) y, L! m# E+ ^7 F messages, 1, true, ref buttons, out resp);4 R! P. E3 X# r8 {
theUFSession.Ui.UnlockUgAccess(UFConstants.UF_UI_FROM_CUSTOM);8 L) y! O: |1 p# q
$ ]2 [+ n, w8 q, {3 d0 e; o) L( H if (resp == 1)
: w( k0 S, X1 u return true;) L7 g) U4 V1 v* O/ Y7 s7 S* x
else
0 k) f2 L3 p. s1 K- [# e! _ return false;# p$ d7 ]5 T9 \/ {
}( q, V: G t) i- C& T
, b" @7 D$ [7 D) b9 ]$ A
1 k4 U# T$ F5 N" ]4 ? T
|
|