Пример #1
0
        public static void Convert(string legacyFile, string upgradeFile)
        {
            legacySplxApi.SuplexApiClient legacyApi   = new legacySplxApi.SuplexApiClient();
            legacySplxApi.SuplexStore     legacyStore = legacyApi.LoadFile(legacyFile);

            FileSystemDal fsd = new FileSystemDal
            {
                CurrentPath = upgradeFile
            };

            foreach (legacySplxApi.User legacyUser in legacyStore.Users)
            {
                fsd.Store.Users.Add(legacyUser.ToNewUser());
            }
            foreach (legacySplxApi.Group legacyGroup in legacyStore.Groups)
            {
                fsd.Store.Groups.Add(legacyGroup.ToNewGroup());
            }
            foreach (legacySplxApi.GroupMembershipItem legacyGmi in legacyStore.GroupMembership.InnerList.Values)
            {
                fsd.Store.GroupMembership.Add(legacyGmi.ToNewGroupMembership());
            }

            RecurseSecureObjectsForImport(legacyStore.UIElements, fsd.Store.SecureObjects);

            fsd.ToYamlFile();
        }