From: Clayton H. <dr...@us...> - 2005-01-02 22:21:48
|
Update of /cvsroot/sharpcvslib/sharpcvslib/src/ICSharpCode/SharpCvsLib/Protocols In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15897/src/ICSharpCode/SharpCvsLib/Protocols Modified Files: ProtocolFactory.cs SspiProtocol.cs Log Message: Implemented the Status commandline, fixed bug in the StatusCommand library component. Added documentation on the requests/ responses from the status command. Index: ProtocolFactory.cs =================================================================== RCS file: /cvsroot/sharpcvslib/sharpcvslib/src/ICSharpCode/SharpCvsLib/Protocols/ProtocolFactory.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ProtocolFactory.cs 1 Jan 2005 22:06:56 -0000 1.1 --- ProtocolFactory.cs 2 Jan 2005 22:21:38 -0000 1.2 *************** *** 23,30 **** private void PopulateProtocols() { foreach (Type type in this.GetType().Assembly.GetTypes()) { ! if (!type.IsAbstract && type.IsSubclassOf(typeof(IProtocol))) { ! ProtocolAttribute protocol = (ProtocolAttribute)type.GetCustomAttributes(typeof(ProtocolAttribute), false)[0]; ! this.Protocols.Add(protocol.Protocol, type); } } --- 23,34 ---- private void PopulateProtocols() { foreach (Type type in this.GetType().Assembly.GetTypes()) { ! if (type.IsAbstract) { ! continue; ! } ! if (type.IsSubclassOf(typeof(AbstractProtocol))) { ! ProtocolAttribute protocolAttribute = (ProtocolAttribute)type.GetCustomAttributes(typeof(ProtocolAttribute), false)[0]; ! IProtocol protocol = (IProtocol)Activator.CreateInstance(type, false); ! this.Protocols.Add(protocolAttribute.Protocol, protocol); } } *************** *** 47,60 **** /// thrown. /// </summary> ! /// <param name="protocol">String value of the protocol to get.</param> /// <returns>The requested implementation of <see cref="IProtocol"/>.</returns> /// <exception cref="UnsupportedProtocolException">If the specified protocol does /// not exist.</exception> ! public IProtocol GetProtocol(string protocol) { ! if (!this.Exists(protocol)) { throw new UnsupportedProtocolException ( ! string.Format("Unknown protocol=[{0}]", protocol)); } ! return (IProtocol)this.Protocols[protocol]; } } --- 51,65 ---- /// thrown. /// </summary> ! /// <param name="protocolName">String value of the protocol to get.</param> /// <returns>The requested implementation of <see cref="IProtocol"/>.</returns> /// <exception cref="UnsupportedProtocolException">If the specified protocol does /// not exist.</exception> ! public IProtocol GetProtocol(string protocolName) { ! if (!this.Exists(protocolName)) { throw new UnsupportedProtocolException ( ! string.Format("Unknown protocol=[{0}]", protocolName)); } ! object protocol = this.Protocols[protocolName]; ! return (IProtocol)protocol; } } Index: SspiProtocol.cs =================================================================== RCS file: /cvsroot/sharpcvslib/sharpcvslib/src/ICSharpCode/SharpCvsLib/Protocols/SspiProtocol.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SspiProtocol.cs 1 Jan 2005 22:06:56 -0000 1.1 --- SspiProtocol.cs 2 Jan 2005 22:21:38 -0000 1.2 *************** *** 54,58 **** /// </summary> [Protocol("sspi")] ! public class SspiProtocol : AbstractProtocol { private readonly ILog LOGGER = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); --- 54,58 ---- /// </summary> [Protocol("sspi")] ! public class SspiProtocol : AbstractProtocol, IProtocol { private readonly ILog LOGGER = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); |