Ejemplo n.º 1
0
        // Export all data for selected user.
        public void ExportUserData()
        {
            ExportData(DataType.User);

            int      i        = 0;
            Activity activity = SelectedUser.GetActivity(i);

            while (activity != null)
            {
                ImportExport.WriteData(activity);
                i++;
                activity = SelectedUser.GetActivity(i);
            }

            i = 0;
            Instance instance = SelectedUser.GetInstance(i);

            while (instance != null)
            {
                ImportExport.WriteData(instance);
                int     j       = 0;
                Session session = instance.GetSession(j);
                while (session != null)
                {
                    ImportExport.WriteData(session);
                    j++;
                    session = instance.GetSession(j);
                }
                i++;
                instance = SelectedUser.GetInstance(i);
            }
        }
Ejemplo n.º 2
0
        public void ExportData(DataType type)
        {
            object data;

            switch (type)
            {
            case DataType.User:
                data = SelectedUser;
                break;

            case DataType.Activity:
                data = SelectedActivity;
                break;

            case DataType.Instance:
                data = SelectedInstance;
                break;

            case DataType.Session:
                data = SelectedSession;
                break;

            default:
                data = null;
                break;
            }

            ImportExport.WriteData(data);
        }