#pragma once #using <mscorlib.dll> #include "Error_m.h" #include "ClientUser_m.h" #include "KeepAlive_m.h" using namespace System; using namespace System::Runtime::InteropServices; System::String* ToDotNetString( const StrPtr& p ); namespace p4dn { __gc public class ClientApi { public: ClientApi(); ~ClientApi(); void SetTrans( int output, int content, int fnames, int dialog ); void SetProtocol( String *p, String *v ); void SetProtocolV( String *p ); String* GetProtocol( String *v ); void Init( p4dn::Error *e ); void Run( String* func, p4dn::ClientUser *ui ); int Final( p4dn::Error *e ); int Dropped(); void RunTag( String* func, p4dn::ClientUser *ui ); void WaitTag( p4dn::ClientUser *ui ); void SetCharset( String* c ); void SetClient( String* c ); void SetCwd( String* c ); void SetHost( String* c ); void SetLanguage( String* c ); void SetPassword( String* c ); void SetPort( String* c ); void SetUser( String* c ); void SetArgv( String* args[] ); void SetBreak( p4dn::KeepAlive *keepAlive ); void DefineCharset( String* c, p4dn::Error* e ); void DefineClient( String* c, p4dn::Error* e ); void DefineHost( String* c, p4dn::Error* e ); void DefineLanguage( String* c, p4dn::Error* e ); void DefinePassword( String* c, p4dn::Error* e ); void DefinePort( String* c, p4dn::Error* e ); void DefineUser( String* c, p4dn::Error* e ); __property String* get_Charset() { return ToDotNetString(_clientApi->GetCharset()); } __property String* get_Client() { return ToDotNetString(_clientApi->GetClient()); } __property String* get_Cwd() { return ToDotNetString(_clientApi->GetCwd()); } __property String* get_Host() { return ToDotNetString(_clientApi->GetHost()); } __property String* get_Language() { return ToDotNetString(_clientApi->GetLanguage()); } __property String* get_Os() { return ToDotNetString(_clientApi->GetOs()); } __property String* get_Password() { return ToDotNetString(_clientApi->GetPassword()); } __property String* get_Port() { return ToDotNetString(_clientApi->GetPort()); } __property String* get_User() { return ToDotNetString(_clientApi->GetUser()); } private: ::ClientApi* _clientApi; private: //================================================================ // // class for callbacks into the KeepAlive interfaces // __nogc class KeepAliveDelegate : ::KeepAlive { private: // handle to managed KeepAlive class int _keepAliveHandle; public: KeepAliveDelegate( int handle ) : _keepAliveHandle(handle) { } ~KeepAliveDelegate() { GCHandle h = GCHandle::op_Explicit( IntPtr(_keepAliveHandle) ); h.Free(); } virtual int IsAlive() { GCHandle h = GCHandle::op_Explicit( IntPtr(_keepAliveHandle) ); p4dn::KeepAlive* keepAlive = static_cast< p4dn::KeepAlive* >( h.Target ); 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 |