#pragma once #using <mscorlib.dll> #include "Error_m.h" #include "ClientUser_m.h" #include "KeepAlive_m.h" #include "ClientUserDelegate.h" using namespace System::Runtime::InteropServices; namespace p4dn { __gc public class ClientApi : public System::IDisposable { public: ClientApi(); ~ClientApi(); void SetTrans( int output, int content, int fnames, int dialog ); void SetProtocol( System::String *p, System::String *v ); void SetProtocolV( System::String *p ); String* GetProtocol( System::String *v ); void Init( p4dn::Error *e ); void Run(System::String *func, p4dn::ClientUser *ui ); void SaveForm(System::String *func, p4dn::ClientUser *ui ); void Dispose(); int Final(p4dn::Error *e ); int Dropped(); //void RunTag( String* func, p4dn::ClientUser *ui ); //void WaitTag( p4dn::ClientUser *ui ); void SetCharset( System::String* c ); void SetClient( System::String* c ); void SetCwd( System::String* c ); void SetHost( System::String* c ); void SetLanguage( System::String* c ); void SetPassword( System::String* c ); void SetPort( System::String* c ); void SetUser( System::String* c ); void SetArgv( System::String* args[] ); void SetBreak( p4dn::KeepAlive *keepAlive ); void DefineCharset( System::String* c, p4dn::Error* e ); void DefineClient( System::String* c, p4dn::Error* e ); void DefineHost( System::String* c, p4dn::Error* e ); void DefineLanguage( System::String* c, p4dn::Error* e ); void DefinePassword( System::String* c, p4dn::Error* e ); void DefinePort( System::String* c, p4dn::Error* e ); void DefineUser( System::String* c, p4dn::Error* e ); __property System::String* get_Charset() { return _clientApi->GetCharset().Text(); } __property System::String* get_Client() { return _clientApi->GetClient().Text(); } __property System::String* get_Cwd() { return _clientApi->GetCwd().Text(); } __property System::String* get_Host() { return _clientApi->GetHost().Text(); } __property System::String* get_Language() { return _clientApi->GetLanguage().Text(); } __property System::String* get_Os() { return _clientApi->GetOs().Text(); } __property System::String* get_Password() { return _clientApi->GetPassword().Text(); } __property System::String* get_Port() { return _clientApi->GetPort().Text(); } __property System::String* get_User() { return _clientApi->GetUser().Text(); } private: ::ClientApi* _clientApi; ::ClientApi* _getClientApi(); void CleanUp(); bool _Disposed; private: //================================================================ // // class for callbacks into the KeepAlive interfaces // __nogc class KeepAliveDelegate : ::KeepAlive { private: // handle to managed KeepAlive class //int _keepAliveHandle; gcroot<p4dn::KeepAlive*> _KeepAlive; public: KeepAliveDelegate(gcroot<p4dn::KeepAlive*> mKeepAlive) { _KeepAlive = mKeepAlive; } ~KeepAliveDelegate() { // Free the GC refererence delete _KeepAlive; } virtual int IsAlive() { bool b = _KeepAlive->IsAlive(); return ( b ? 1 : 0 ); } }; KeepAliveDelegate* _keepAliveDelegate; }; }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#4 | 5826 | Shawn Hladky | PerforceDotNet is now obsolete | ||
#3 | 5064 | Shawn Hladky |
WIP -- Added ability to parse forms. Added new tester application. ** not ready for human consumption, needs more review and testing. |
||
#2 | 4545 | Shawn Hladky |
Several Fixes: Updated solution to Visual Studio 2003 Implemented InputData Implemented OutPutBinary Changed ClientAPI and Error objects to implement the IDisposable interface to improve Garbage Collection Changed header files so you don't need to add #pragma once to the p4 api headers. Refactored the ClientUserDelagate class Fixed a few minor memory leaks |
||
#1 | 4328 | Shawn Hladky | Branching from //guest/jacob_gladish/PerforceDotNet/... | ||
//guest/jacob_gladish/PerforceDotNet/p4dn/ClientApi_m.h | |||||
#1 | 3787 | Jacob Gladish | initial code submission |