public Session Load(FileName fileName) { if (fileName == null) { throw new ArgumentNullException(); } Session session = null; Wrappers.MBaseSession session_delegate = Wrappers.MSessionFactory.Load(fileName); switch (session_delegate.SessionType) { case Wrappers.SessionType.SessionTypeEmulator: /* TODO: Add emulator from file. * session = new EmulatorSession(session_delegate, null); */ break; case Wrappers.SessionType.SessionTypeMedia: session = new MediaSession(session_delegate, null); break; case Wrappers.SessionType.SessionTypeScript: session = new NetworkSession(session_delegate, null); break; case Wrappers.SessionType.SessionTypeUnknown: throw new ApplicationException(); } return(session); }
internal NetworkSession(Wrappers.MBaseSession sessionDelegate, Key key) : base(key) { // Check type m_delegate = (Wrappers.MScriptSession)sessionDelegate; base.m_delegate = m_delegate; _Initialize(key); }
internal MediaSession(Wrappers.MBaseSession sessionDelegate, Key key) : base(key) { // Check type m_delegate = (Wrappers.MMediaSession)sessionDelegate; base.m_delegate = m_delegate; _Initialize(key); }
/// <summary> /// Load a session from file. /// </summary> /// <param name="fileName">file with extension <c>.SES</c></param> /// <returns> /// Returns a session of type; /// <list type="bullet"> /// <item>Dvtk.Sessions.ScriptSession</item> /// <item>Dvtk.Sessions.EmulatorSession</item> /// <item>Dvtk.Sessions.MediaSession</item> /// </list> /// </returns> /// <remarks> /// The type of session is dynamically determined. /// </remarks> public Session Load(FileName fileName) { if (fileName == null) { throw new ArgumentNullException(); } System.IO.FileInfo fileInfo = new System.IO.FileInfo(fileName); if (!fileInfo.Exists) { throw new ArgumentException(); } // // Transform fileName to fully qualified file name. // fileName = fileInfo.FullName; Session session = null; Wrappers.MBaseSession adaptee = Wrappers.MSessionFactory.Load(fileName); switch (adaptee.SessionType) { case Wrappers.SessionType.SessionTypeEmulator: session = new EmulatorSession(adaptee); break; case Wrappers.SessionType.SessionTypeMedia: session = new MediaSession(adaptee); break; case Wrappers.SessionType.SessionTypeScript: session = new ScriptSession(adaptee); break; case Wrappers.SessionType.SessionTypeSniffer: session = new SnifferSession(adaptee); break; case Wrappers.SessionType.SessionTypeUnknown: // Unknown Wrappers.SessionType throw new System.NotImplementedException(); } return(session); }
public CSutProperties(Wrappers.MBaseSession theDelegate) { m_delegate = theDelegate; }
public NewBaseSession(Wrappers.MBaseSession theDelegate) { this.m_delegate = theDelegate; CSutProperties _SutProperties = new CSutProperties(theDelegate); }