Exemplo n.º 1
0
 public AppController()
 {
     _memberListFileName = "members.dat";
     _consoleView = new View.ConsoleView();
     _memberList = new Model.MemberList();
     _memberList.InitilizeFromFile(this._memberListFileName);
 }
        //Constructor
        public MemberRegistry(View.Console a_view)
        {
            m_isInStartup = true;
            m_view = a_view;

            //try to load member list from storage
            m_memberListDAL = new Model.MemberListDAL();
            m_memberList = m_memberListDAL.LoadMemberList();
            if (m_memberList == null)
            {
                m_memberList = new Model.MemberList();
            }

            //subscribe to the MemberList
            m_memberList.AddSubscriber(this);

            //try to load user list from storage
            m_userListDAL = new Model.UserListDAL();
            m_userList = m_userListDAL.LoadUserList();
            if (m_userList == null)
            {
                m_userList = new Model.UserList();
            }

            //subscribe to the UserList
            m_userList.AddSubscriber(this);

            m_addingEditingMember = null;
            m_loggedInUser = null;
            m_memberFiltering = null;

            m_isInStartup = false;
        }
        //Constructor
        public MemberRegistry(View.Console a_view)
        {
            m_isInStartup = true;

            m_view = a_view;
            m_storage = new Model.Storage();

            //try to load member list from storage
            m_memberList = m_storage.LoadMemberList();
            if (m_memberList == null)
            {
                m_memberList = new Model.MemberList();
            }

            //subscribe to the MemberList
            m_memberList.AddSubscriber(this);

            m_addingEditingMember = null;

            m_isInStartup = false;
        }