📄 securedformunit.cpp
字号:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "SecuredFormUnit.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
//---------------------------------------------------------------------------
__fastcall TSecuredForm::TSecuredForm(TComponent* Owner)
: TForm(Owner), FOnRightsRead(0) , Rights()
{
ReadRights();
}
__fastcall TSecuredForm::TSecuredForm(TComponent* Owner, char *name)
: TForm(Owner), FOnRightsRead(0), Rights(name)
{
ReadRights();
}
void __fastcall TSecuredForm::ReadRights() {
if (Rights.Binded() && (Rights.Logged() || Rights.AutoLogin()) )
Rights.GetRight(Name.c_str());
// if (!Rights.Logged())
// throw Exception("Login Failed");
// if you want your application to quit when no login occured, close it in constructor
RightsRead();
}
void __fastcall TSecuredForm::RightsRead() {
if (FOnRightsRead) FOnRightsRead(this);
}
//---------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -