Example #1
0
        public void New()
        {
            if (IsOpened)
            {
                throw new Exceptions.ProjectIsOpened();
            }

            m_project  = new ProjectDatabase();
            m_isOpened = true;

            OnProjectOpened(true);
        }
        public void Open( string aFilePath )
        {
            if ( IsOpened )
            throw new Exceptions.ProjectIsOpened();

              try {
            using ( FileStream file = File.Open( aFilePath, FileMode.Open ) )
              m_project = (ProjectDatabase) new BinaryFormatter().Deserialize( file );
              }
              catch ( IOException e ) {
            throw new Exceptions.ProjectLoadError( e.Message );
              }
              catch ( SerializationException e ) {
            throw new Exceptions.ProjectLoadError( e.Message );
              }

              m_filePath = aFilePath;
              m_isOpened = true;
              OnProjectOpened( false );
        }
        public void New()
        {
            if ( IsOpened )
            throw new Exceptions.ProjectIsOpened();

              m_project = new ProjectDatabase();
              m_isOpened = true;

              OnProjectOpened( true );
        }
        public void Close()
        {
            if ( !IsOpened )
            throw new Exceptions.ProjectNotOpened();

              m_isOpened = false;
              m_project = null;
              m_filePath = "";
              m_isModified = false;

              OnProjectClosed();
        }