|
// OIMOBOXWatchDirDlg.h : header file
|
//
|
|
#pragma once
|
|
#include ".\\WatchingMobox\\DirChanges\\DirectoryChanges.h"
|
#include ".\\WatchingMobox\\DirChanges\\DelayedDirectoryChangeHandler.h"
|
#include ".\\WatchingMobox\\MoboxDirectoryChangeHandler.h"
|
#include "DirectoryChangeMgr.h"
|
|
#define APPFLAG_NETDISK ( _T("NETDISK") )
|
#define INI_MOBOX_WATCHINGFILE _T( "MoboxDirWatching.ini" )
|
|
#define MOBOX_BACKUPATTR_SECTION _T("MOBOX_BACKUPATTR")
|
#define MOBOX_BACKUPATTR_SECTION_BACKUPDIRWATCH _T("BackupDirWatch")
|
#define MOBOX_BACKUPATTR_SECTION_RELOADBACKUPDIR _T("ReloadBackupDirInfo")
|
#define MOBOX_BACKUPATTR_SECTION_WATCHLASTTIME _T("WatchLastTime")
|
#define MOBOX_BACKUPWATCHTIME_SECTION _T("MOBOX_BACKUPWATCHTIME")
|
|
#define MOBOX_LOGININFO_SECTION _T("MOBOX_LOGININFO")
|
#define MOBOX_LOGININFO_SECTION_USERSERVER _T("LoginUserServer")
|
|
typedef CMap<CString, LPCTSTR, CString, LPCTSTR> CMapStrToStr;
|
|
typedef struct _WATCHINGDIR_ITEM
|
{
|
CString strParam;
|
DWORD dwFileActionTickCount;
|
UINT nFileActionType;
|
|
_WATCHINGDIR_ITEM() : strParam(_T("")),dwFileActionTickCount(0),nFileActionType(0) {};
|
}
|
WATCHINGDIR_ITEM;
|
|
typedef CMap<CString, LPCTSTR, WATCHINGDIR_ITEM, WATCHINGDIR_ITEM&>CMapNetDiskWatchingDir;
|
|
typedef struct _LGOINUSER_INFO
|
{
|
CString strServerIp;
|
UINT nServerPort;
|
CString strServerID;
|
CString strLoginName;
|
CString strSessionID;
|
_LGOINUSER_INFO() : strServerIp(_T("")),nServerPort(0),strServerID(_T("")),strLoginName(_T("")),strSessionID(_T("")) {};
|
}
|
LGOINUSER_INFO;
|
typedef CMap<CString, LPCTSTR, LGOINUSER_INFO, LGOINUSER_INFO&>CMapLoginInfo;
|
// COIMOBOXWatchDirDlg dialog
|
class COIMOBOXWatchDirDlg : public CDialogEx
|
{
|
// Construction
|
public:
|
COIMOBOXWatchDirDlg(CWnd* pParent = NULL); // standard constructor
|
|
// Dialog Data
|
enum { IDD = IDD_OIMOBOXWATCHDIR_DIALOG };
|
|
protected:
|
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
//attributes
|
public:
|
CDirectoryChangeWatcher m_dirWatcher;
|
CMoboxDirectoryChangeHandler m_dirChangeHandler;
|
HANDLE m_hMoboxCheckChangeThread;
|
HANDLE m_hExitEvent;
|
private:
|
CDirectoryChangeMgr m_mgrDirectoryChange;
|
CMapNetDiskWatchingDir m_mapMoboxWatchingDir;
|
CString m_strLoginName;
|
CString m_strServerID;
|
CStringArray m_arBackupDir;
|
bool m_bFirstUnlockDMSDocs;
|
|
//Operations
|
public:
|
BOOL On_FileAdded(CString strFilePath);
|
BOOL On_FileRemoved(CString strFilePath);
|
BOOL On_FileNameChanged(CString strOldFileName, CString strNewFileName);
|
BOOL On_FileModified(CString strFilePath);
|
void WriteLog( CString strLog );
|
BOOL WatchBackupDirChange(CString strDir,CString strLastTime);
|
BOOL WatchBackupDirChange();
|
void UnlockUserDMSDocs( );
|
|
static unsigned int _stdcall ThreadFunctionCheckChangeInfo(void *pV);
|
static unsigned int _stdcall ThreadFunctionUnlockDMSDocs(void *pV);
|
private:
|
CString GetFileType( CString strFileName);
|
CString GetFileName( CString strFilePathName );
|
void GetBackupDirWatchInfo(CString &strUser, CString &strServerID);
|
BOOL GetElementItem(CString &strStuff, CString &strItem,CString strApart);
|
BOOL IsReloadBackupDirWatchInfo();
|
BOOL GetBackupDirWatchLastTime(CString &strTime);
|
void SetBackupDirWatchLastTime(CString strTime);
|
bool CStringToAnsi( LPCTSTR pszT, LPSTR *ppszA );
|
BOOL CheckProcessExist( CString strProcess);
|
void GetLoginUserInfo(CMapLoginInfo &mapLoginUser);
|
void EmptyLoginUserInfo();
|
BOOL GetBDLockDocs(CDBConnect *pDBConnect,CMapStrToStr &mapLockDoc );
|
BOOL RemoveLockDocsInfo(CDBConnect *pDBConnect);
|
// Implementation
|
protected:
|
HICON m_hIcon;
|
|
// Generated message map functions
|
virtual BOOL OnInitDialog();
|
afx_msg void OnPaint();
|
afx_msg HCURSOR OnQueryDragIcon();
|
DECLARE_MESSAGE_MAP()
|
public:
|
afx_msg void OnTimer(UINT_PTR nIDEvent);
|
afx_msg void OnDestroy();
|
};
|