Beispiel #1
0
        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);
        }
Beispiel #2
0
 internal NetworkSession(Wrappers.MBaseSession sessionDelegate, Key key)
     : base(key)
 {
     // Check type
     m_delegate      = (Wrappers.MScriptSession)sessionDelegate;
     base.m_delegate = m_delegate;
     _Initialize(key);
 }
Beispiel #3
0
 internal MediaSession(Wrappers.MBaseSession sessionDelegate, Key key)
     : base(key)
 {
     // Check type
     m_delegate      = (Wrappers.MMediaSession)sessionDelegate;
     base.m_delegate = m_delegate;
     _Initialize(key);
 }
Beispiel #4
0
        /// <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);
        }
Beispiel #5
0
 public CSutProperties(Wrappers.MBaseSession theDelegate)
 {
     m_delegate = theDelegate;
 }
Beispiel #6
0
 public NewBaseSession(Wrappers.MBaseSession theDelegate)
 {
     this.m_delegate = theDelegate;
     CSutProperties _SutProperties = new CSutProperties(theDelegate);
 }
Beispiel #7
0
 public CSutProperties(Wrappers.MBaseSession theDelegate)
 {
     m_delegate = theDelegate;
 }
Beispiel #8
0
 public NewBaseSession(Wrappers.MBaseSession theDelegate)
 {
     this.m_delegate = theDelegate;
     CSutProperties _SutProperties = new CSutProperties(theDelegate);
 }