Пример #1
0
        static void CopyMovieAssetsCollection(string toWhere, RMMovieCollection collection, string _namespace, string rootDir = null)
        {
            string dir = toWhere + "\\" + DirectoryNames.ProjectFiles.MOVIES;

            Helper.MakeDirIfNotExistInstall(dir, _namespace);
            if (collection.Groups != null)
            {
                foreach (RMMovieGroup movieGroup in collection.Groups)
                {
                    CopyMovieAsset(dir, movieGroup, _namespace, rootDir);
                }
            }
        }
Пример #2
0
            public static RMMovieCollection RetrieveMovieCollection(string path, string rootPath, string _namespace, bool trimRootPath, out LogDataList log, RMPackage parent)
            {
                log = new LogDataList();


                RMMovieCollection newCollection = new RMMovieCollection(parent);

                log.WriteInformationLog(LoggerMessages.RMPackage.Info.RetrievedAutoData(parent.Name, path, RMCollectionType.Movies), _namespace);
                string[] files = null;
                try
                {
                    files = Directory.GetFiles(path);
                } catch (Exception ex)
                {
                    log.WriteErrorLog(LoggerMessages.RMPackage.Error.RetrieveAutoError(path, parent.Name, RMCollectionType.Movies), _namespace, ex);
                    return(null);
                }
                if (files == null || files.Length == 0)
                {
                    return(null);
                }

                for (int i = 0; i < files.Length; ++i)
                {
                    string originalFileName = Path.GetFileNameWithoutExtension(files[i]);
                    string nonLoweredPath   = files[i];
                    files[i] = files[i].ToLower();
                    string fileName      = originalFileName.ToLower();
                    string fileExtension = Path.GetExtension(files[i]);
                    if (fileExtension.Length < RMPConstants.MovieFileType.MP4.Length + 1)
                    {
                        continue;
                    }
                    fileExtension = fileExtension.Substring(1);

                    RMMovieFile.FileType typeOfFile = RMMovieFile.FileType.none;
                    typeOfFile = typeOfFile.ParseString(fileExtension);

                    if (typeOfFile == RMMovieFile.FileType.none || string.IsNullOrWhiteSpace(originalFileName))
                    {
                        continue;
                    }

                    RMMovieGroup rmv = newCollection.Groups.FindByInternalName(fileName);
                    if (rmv == null)
                    {
                        rmv              = new RMMovieGroup(newCollection);
                        rmv.Name         = originalFileName;
                        rmv.internalName = fileName;
                        newCollection.Groups.Add(rmv);
                    }
                    RMMovieFile rmf = new RMMovieFile(rmv);
                    if (trimRootPath)
                    {
                        rmf.Path = Helper.GetRelativePath(nonLoweredPath, rootPath);
                    }
                    else
                    {
                        rmf.Path = nonLoweredPath;
                    }
                    rmf.TypeOfFile = typeOfFile;
                    rmv.Files.Add(rmf);
                    log.WriteInformationLog(LoggerMessages.RMPackage.Info.RetrievedFile(parent.Name, nonLoweredPath, RMCollectionType.Movies), _namespace);
                }
                if (newCollection.Groups.Count == 0)
                {
                    return(null);
                }

                return(newCollection);
            }
Пример #3
0
        TreeNode AddAssetGroup(frmAddAssetGroup formShown)
        {
            string _namespace = MethodBase.GetCurrentMethod().ToLogFormatFullName();

            if (formShown.DialogResult == DialogResult.Cancel)
            {
                return(null);
            }

            if (string.IsNullOrWhiteSpace(formShown.TypeName))
            {
                Helper.ShowMessageBox(MessageBoxStrings.GUI.frmPackageAssets.ADD_NO_NAME_GROUP_ASSET, MessageBoxStrings.MESSAGEBOX_NAME, MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(null);
            }

            frmPackAssetTNodeTag collectionTag = tViewAssets.Nodes.FindNodeOfCollectionType(formShown.TypeToAdd);

            if (collectionTag == null)
            {
                RMCollection rmc = null;
                try
                {
                    rmc = formShown.TypeToAdd.ToNewCollection(PackageOfCollections);
                }
                catch (Exception ex)
                {
                    Helper.ShowMessageBox(MessageBoxStrings.GUI.frmPackageAssets.ADD_ASSET_GROUP_ERR_GENERAL, MessageBoxStrings.MESSAGEBOX_NAME, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    Logger.WriteErrorLog(frmPackageAssetsMessages.Error.UNABLE_CREATE_COLLECTION, _namespace, ex, BasicDebugLogger.DebugErrorType.Error);
                    return(null);
                }
                if (PackageOfCollections.Collections == null)
                {
                    PackageOfCollections.Collections = new List <RMCollection>();
                }
                PackageOfCollections.Collections.Add(rmc);
                collectionTag = AddCollectionToTView(tViewAssets, rmc, RootDirectory);
            }

            if (formShown.TypeToAdd == RMCollectionType.BGM || formShown.TypeToAdd == RMCollectionType.BGS || formShown.TypeToAdd == RMCollectionType.ME || formShown.TypeToAdd == RMCollectionType.SE)
            {
                RMAudioCollection collectionObj = collectionTag.Object as RMAudioCollection;
                if (collectionObj == null)
                {
                    Helper.ShowMessageBox(MessageBoxStrings.GUI.frmPackageAssets.ADD_ASSET_GROUP_ERR_GENERAL, MessageBoxStrings.MESSAGEBOX_NAME, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    Logger.WriteErrorLog(frmPackageAssetsMessages.Error.UNABLE_ADD_GROUP_INVALID_COLLECTION, _namespace, null, BasicDebugLogger.DebugErrorType.Error);
                    return(null);
                }
                RMAudioGroup audioGroup = new RMAudioGroup(collectionObj);
                audioGroup.Name = formShown.TypeName;
                TreeNode             tNode       = new TreeNode();
                frmPackAssetTNodeTag newGroupTag = new frmPackAssetTNodeTag(tNode, audioGroup, RootDirectory);
                tNode.Text = newGroupTag.ToString();
                tNode.Tag  = newGroupTag;
                collectionTag.AssociatedNode.Nodes.Add(tNode);

                if (collectionObj.Groups == null)
                {
                    collectionObj.Groups = new List <RMAudioGroup>();
                }
                collectionObj.Groups.Add(audioGroup);

                if (!PackageOfCollections.Collections.Contains(collectionObj))
                {
                    PackageOfCollections.Collections.Add(collectionObj);
                }

                return(tNode);
            }
            else if (formShown.TypeToAdd == RMCollectionType.Characters)
            {
                RMCharImageCollection collectionObj = collectionTag.Object as RMCharImageCollection;
                if (collectionObj == null)
                {
                    Helper.ShowMessageBox(MessageBoxStrings.GUI.frmPackageAssets.ADD_ASSET_GROUP_ERR_GENERAL, MessageBoxStrings.MESSAGEBOX_NAME, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    Logger.WriteErrorLog(frmPackageAssetsMessages.Error.UNABLE_ADD_GROUP_INVALID_COLLECTION, _namespace, null, BasicDebugLogger.DebugErrorType.Error);
                    return(null);
                }
                RMCharImageGroup charImageGroup = new RMCharImageGroup(collectionObj);
                charImageGroup.Name = formShown.TypeName;
                TreeNode             tNode       = new TreeNode();
                frmPackAssetTNodeTag newGroupTag = new frmPackAssetTNodeTag(tNode, charImageGroup, RootDirectory);
                tNode.Text = newGroupTag.ToString();
                tNode.Tag  = newGroupTag;
                collectionTag.AssociatedNode.Nodes.Add(tNode);

                if (collectionObj.Groups == null)
                {
                    collectionObj.Groups = new List <RMCharImageGroup>();
                }
                collectionObj.Groups.Add(charImageGroup);

                if (!PackageOfCollections.Collections.Contains(collectionObj))
                {
                    PackageOfCollections.Collections.Add(collectionObj);
                }

                return(tNode);
            }
            else if (formShown.TypeToAdd == RMCollectionType.Tilesets)
            {
                RMTilesetCollection collectionObj = collectionTag.Object as RMTilesetCollection;
                if (collectionObj == null)
                {
                    Helper.ShowMessageBox(MessageBoxStrings.GUI.frmPackageAssets.ADD_ASSET_GROUP_ERR_GENERAL, MessageBoxStrings.MESSAGEBOX_NAME, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    Logger.WriteErrorLog(frmPackageAssetsMessages.Error.UNABLE_ADD_GROUP_INVALID_COLLECTION, _namespace, null, BasicDebugLogger.DebugErrorType.Error);
                    return(null);
                }
                RMTilesetGroup tilesetGroup = new RMTilesetGroup(collectionObj);
                tilesetGroup.Name = formShown.TypeName;
                TreeNode             tNode       = new TreeNode();
                frmPackAssetTNodeTag newGroupTag = new frmPackAssetTNodeTag(tNode, tilesetGroup, RootDirectory);
                tNode.Text = newGroupTag.ToString();
                tNode.Tag  = newGroupTag;
                collectionTag.AssociatedNode.Nodes.Add(tNode);

                if (collectionObj.Groups == null)
                {
                    collectionObj.Groups = new List <RMTilesetGroup>();
                }
                collectionObj.Groups.Add(tilesetGroup);

                if (!PackageOfCollections.Collections.Contains(collectionObj))
                {
                    PackageOfCollections.Collections.Add(collectionObj);
                }

                return(tNode);
            }
            else if (formShown.TypeToAdd == RMCollectionType.Movies)
            {
                RMMovieCollection collectionObj = collectionTag.Object as RMMovieCollection;
                if (collectionObj == null)
                {
                    Helper.ShowMessageBox(MessageBoxStrings.GUI.frmPackageAssets.ADD_ASSET_GROUP_ERR_GENERAL, MessageBoxStrings.MESSAGEBOX_NAME, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    Logger.WriteErrorLog(frmPackageAssetsMessages.Error.UNABLE_ADD_GROUP_INVALID_COLLECTION, _namespace, null, BasicDebugLogger.DebugErrorType.Error);
                    return(null);
                }
                RMMovieGroup movieGroup = new RMMovieGroup(collectionObj);
                movieGroup.Name = formShown.TypeName;
                TreeNode             tNode       = new TreeNode();
                frmPackAssetTNodeTag newGroupTag = new frmPackAssetTNodeTag(tNode, movieGroup, RootDirectory);
                tNode.Text = newGroupTag.ToString();
                tNode.Tag  = newGroupTag;
                collectionTag.AssociatedNode.Nodes.Add(tNode);

                if (collectionObj.Groups == null)
                {
                    collectionObj.Groups = new List <RMMovieGroup>();
                }
                collectionObj.Groups.Add(movieGroup);

                if (!PackageOfCollections.Collections.Contains(collectionObj))
                {
                    PackageOfCollections.Collections.Add(collectionObj);
                }

                return(tNode);
            }
            else if (formShown.TypeToAdd == RMCollectionType.Generator)
            {
                RMGeneratorCollection collectionObj = collectionTag.Object as RMGeneratorCollection;
                if (collectionObj == null)
                {
                    Helper.ShowMessageBox(MessageBoxStrings.GUI.frmPackageAssets.ADD_ASSET_GROUP_ERR_GENERAL, MessageBoxStrings.MESSAGEBOX_NAME, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    Logger.WriteErrorLog(frmPackageAssetsMessages.Error.UNABLE_ADD_GROUP_INVALID_COLLECTION, _namespace, null, BasicDebugLogger.DebugErrorType.Error);
                    return(null);
                }
                RMGenPart genGroup = new RMGenPart(collectionObj);
                genGroup.Name     = formShown.TypeName;
                genGroup.PartType = formShown.GeneratorType;
                genGroup.Gender   = formShown.GeneratorGender;
                TreeNode             tNode       = new TreeNode();
                frmPackAssetTNodeTag newGroupTag = new frmPackAssetTNodeTag(tNode, genGroup, RootDirectory);
                tNode.Text = newGroupTag.ToString();
                tNode.Tag  = newGroupTag;
                collectionTag.AssociatedNode.Nodes.Add(tNode);

                if (collectionObj.Parts == null)
                {
                    collectionObj.Parts = new List <RMGenPart>();
                }
                collectionObj.Parts.Add(genGroup);

                if (!PackageOfCollections.Collections.Contains(collectionObj))
                {
                    PackageOfCollections.Collections.Add(collectionObj);
                }

                return(tNode);
            }
            return(null);
        }
Пример #4
0
        bool RemoveAssetGroup(TreeNode tNode)
        {
            string _namespace             = MethodBase.GetCurrentMethod().ToLogFormatFullName();
            frmPackAssetTNodeTag groupTag = tNode.Tag as frmPackAssetTNodeTag;

            if (groupTag == null)
            {
                Helper.ShowMessageBox(MessageBoxStrings.GUI.frmPackageAssets.DELETE_GROUP_ERR, MessageBoxStrings.MESSAGEBOX_NAME, MessageBoxButtons.OK, MessageBoxIcon.Error);
                Logger.WriteErrorLog(frmPackageAssetsMessages.Error.UNABLE_REMOVE_GROUP_TAG_NULL, _namespace, null, BasicDebugLogger.DebugErrorType.Error);
                return(false);
            }

            if (tNode.Parent == null)
            {
                Helper.ShowMessageBox(MessageBoxStrings.GUI.frmPackageAssets.DELETE_GROUP_ERR, MessageBoxStrings.MESSAGEBOX_NAME, MessageBoxButtons.OK, MessageBoxIcon.Error);
                Logger.WriteErrorLog(frmPackageAssetsMessages.Error.UNABLE_REMOVE_GROUP_PARENT_NULL, _namespace, null, BasicDebugLogger.DebugErrorType.Error);
                return(false);
            }

            frmPackAssetTNodeTag collTag = tNode.Parent.Tag as frmPackAssetTNodeTag;

            if (collTag == null)
            {
                Helper.ShowMessageBox(MessageBoxStrings.GUI.frmPackageAssets.DELETE_GROUP_ERR, MessageBoxStrings.MESSAGEBOX_NAME, MessageBoxButtons.OK, MessageBoxIcon.Error);
                Logger.WriteErrorLog(frmPackageAssetsMessages.Error.UNABLE_REMOVE_GROUP_PARENT_NULL, _namespace, null, BasicDebugLogger.DebugErrorType.Error);
                return(false);
            }

            if (collTag.TagObjectType != frmPackAssetTNodeTag.TagType.Collection)
            {
                Helper.ShowMessageBox(MessageBoxStrings.GUI.frmPackageAssets.DELETE_GROUP_ERR, MessageBoxStrings.MESSAGEBOX_NAME, MessageBoxButtons.OK, MessageBoxIcon.Error);
                Logger.WriteErrorLog(frmPackageAssetsMessages.Error.UNABLE_REMOVE_GROUP_PARENT_NULL, _namespace, null, BasicDebugLogger.DebugErrorType.Error);
                return(false);
            }


            if (groupTag.TagObjectType == frmPackAssetTNodeTag.TagType.AudioGroup)
            {
                if (collTag.CollectionType != RMCollectionType.BGM && collTag.CollectionType != RMCollectionType.BGS && collTag.CollectionType != RMCollectionType.SE && collTag.CollectionType != RMCollectionType.ME)
                {
                    Helper.ShowMessageBox(MessageBoxStrings.GUI.frmPackageAssets.DELETE_GROUP_ERR, MessageBoxStrings.MESSAGEBOX_NAME, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    Logger.WriteErrorLog(frmPackageAssetsMessages.Error.UNABLE_REMOVE_GROUP_INVALID_PARENT, _namespace, null, BasicDebugLogger.DebugErrorType.Error);
                    return(false);
                }
                RMAudioCollection audioCollection = collTag.Object as RMAudioCollection;
                if (audioCollection == null)
                {
                    Helper.ShowMessageBox(MessageBoxStrings.GUI.frmPackageAssets.DELETE_GROUP_ERR, MessageBoxStrings.MESSAGEBOX_NAME, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    Logger.WriteErrorLog(frmPackageAssetsMessages.Error.UNABLE_REMOVE_GROUP_INVALID_PARENT, _namespace, null, BasicDebugLogger.DebugErrorType.Error);
                    return(false);
                }
                RMAudioGroup audio = groupTag.Object as RMAudioGroup;
                if (audio == null)
                {
                    Helper.ShowMessageBox(MessageBoxStrings.GUI.frmPackageAssets.DELETE_GROUP_ERR, MessageBoxStrings.MESSAGEBOX_NAME, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    Logger.WriteErrorLog(frmPackageAssetsMessages.Error.UNABLE_REMOVE_GROUP_INVALID, _namespace, null, BasicDebugLogger.DebugErrorType.Error);
                    return(false);
                }
                tNode.Remove();
                audioCollection.Groups.Remove(audio);
                if (audioCollection.Groups.Count == 0)
                {
                    audioCollection.Parent.Collections.Remove(audioCollection);
                }
                return(true);
            }
            else if (groupTag.TagObjectType == frmPackAssetTNodeTag.TagType.CharacterGroup)
            {
                if (collTag.CollectionType != RMCollectionType.Characters)
                {
                    Helper.ShowMessageBox(MessageBoxStrings.GUI.frmPackageAssets.DELETE_GROUP_ERR, MessageBoxStrings.MESSAGEBOX_NAME, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    Logger.WriteErrorLog(frmPackageAssetsMessages.Error.UNABLE_REMOVE_GROUP_INVALID_PARENT, _namespace, null, BasicDebugLogger.DebugErrorType.Error);
                    return(false);
                }
                RMCharImageCollection charCollection = collTag.Object as RMCharImageCollection;
                if (charCollection == null)
                {
                    Helper.ShowMessageBox(MessageBoxStrings.GUI.frmPackageAssets.DELETE_GROUP_ERR, MessageBoxStrings.MESSAGEBOX_NAME, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    Logger.WriteErrorLog(frmPackageAssetsMessages.Error.UNABLE_REMOVE_GROUP_INVALID_PARENT, _namespace, null, BasicDebugLogger.DebugErrorType.Error);
                    return(false);
                }
                RMCharImageGroup charGroup = groupTag.Object as RMCharImageGroup;
                if (charGroup == null)
                {
                    Helper.ShowMessageBox(MessageBoxStrings.GUI.frmPackageAssets.DELETE_GROUP_ERR, MessageBoxStrings.MESSAGEBOX_NAME, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    Logger.WriteErrorLog(frmPackageAssetsMessages.Error.UNABLE_REMOVE_GROUP_INVALID, _namespace, null, BasicDebugLogger.DebugErrorType.Error);
                    return(false);
                }
                tNode.Remove();
                charCollection.Groups.Remove(charGroup);
                if (charCollection.Groups.Count == 0)
                {
                    charCollection.Parent.Collections.Remove(charCollection);
                }
                return(true);
            }
            else if (groupTag.TagObjectType == frmPackAssetTNodeTag.TagType.GeneratorPartGroup)
            {
                if (collTag.CollectionType != RMCollectionType.Generator)
                {
                    Helper.ShowMessageBox(MessageBoxStrings.GUI.frmPackageAssets.DELETE_GROUP_ERR, MessageBoxStrings.MESSAGEBOX_NAME, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    Logger.WriteErrorLog(frmPackageAssetsMessages.Error.UNABLE_REMOVE_GROUP_INVALID_PARENT, _namespace, null, BasicDebugLogger.DebugErrorType.Error);
                    return(false);
                }
                RMGeneratorCollection genCollection = collTag.Object as RMGeneratorCollection;
                if (genCollection == null)
                {
                    Helper.ShowMessageBox(MessageBoxStrings.GUI.frmPackageAssets.DELETE_GROUP_ERR, MessageBoxStrings.MESSAGEBOX_NAME, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    Logger.WriteErrorLog(frmPackageAssetsMessages.Error.UNABLE_REMOVE_GROUP_INVALID_PARENT, _namespace, null, BasicDebugLogger.DebugErrorType.Error);
                    return(false);
                }
                RMGenPart genGroup = groupTag.Object as RMGenPart;
                if (genGroup == null)
                {
                    Helper.ShowMessageBox(MessageBoxStrings.GUI.frmPackageAssets.DELETE_GROUP_ERR, MessageBoxStrings.MESSAGEBOX_NAME, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    Logger.WriteErrorLog(frmPackageAssetsMessages.Error.UNABLE_REMOVE_GROUP_INVALID, _namespace, null, BasicDebugLogger.DebugErrorType.Error);
                    return(false);
                }
                tNode.Remove();
                genCollection.Parts.Remove(genGroup);
                if (genCollection.Parts.Count == 0)
                {
                    genCollection.Parent.Collections.Remove(genCollection);
                }
                return(true);
            }
            else if (groupTag.TagObjectType == frmPackAssetTNodeTag.TagType.MovieGroup)
            {
                if (collTag.CollectionType != RMCollectionType.Movies)
                {
                    Helper.ShowMessageBox(MessageBoxStrings.GUI.frmPackageAssets.DELETE_GROUP_ERR, MessageBoxStrings.MESSAGEBOX_NAME, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    Logger.WriteErrorLog(frmPackageAssetsMessages.Error.UNABLE_REMOVE_GROUP_INVALID_PARENT, _namespace, null, BasicDebugLogger.DebugErrorType.Error);
                    return(false);
                }
                RMMovieCollection movieCollection = collTag.Object as RMMovieCollection;
                if (movieCollection == null)
                {
                    Helper.ShowMessageBox(MessageBoxStrings.GUI.frmPackageAssets.DELETE_GROUP_ERR, MessageBoxStrings.MESSAGEBOX_NAME, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    Logger.WriteErrorLog(frmPackageAssetsMessages.Error.UNABLE_REMOVE_GROUP_INVALID_PARENT, _namespace, null, BasicDebugLogger.DebugErrorType.Error);
                    return(false);
                }
                RMMovieGroup movieGroup = groupTag.Object as RMMovieGroup;
                if (movieGroup == null)
                {
                    Helper.ShowMessageBox(MessageBoxStrings.GUI.frmPackageAssets.DELETE_GROUP_ERR, MessageBoxStrings.MESSAGEBOX_NAME, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    Logger.WriteErrorLog(frmPackageAssetsMessages.Error.UNABLE_REMOVE_GROUP_INVALID, _namespace, null, BasicDebugLogger.DebugErrorType.Error);
                    return(false);
                }
                tNode.Remove();
                movieCollection.Groups.Remove(movieGroup);
                if (movieCollection.Groups.Count == 0)
                {
                    movieCollection.Parent.Collections.Remove(movieCollection);
                }
                return(true);
            }
            else if (groupTag.TagObjectType == frmPackAssetTNodeTag.TagType.TilesetGroup)
            {
                if (collTag.CollectionType != RMCollectionType.Tilesets)
                {
                    Helper.ShowMessageBox(MessageBoxStrings.GUI.frmPackageAssets.DELETE_GROUP_ERR, MessageBoxStrings.MESSAGEBOX_NAME, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    Logger.WriteErrorLog(frmPackageAssetsMessages.Error.UNABLE_REMOVE_GROUP_INVALID_PARENT, _namespace, null, BasicDebugLogger.DebugErrorType.Error);
                    return(false);
                }
                RMTilesetCollection tilesetCollection = collTag.Object as RMTilesetCollection;
                if (tilesetCollection == null)
                {
                    Helper.ShowMessageBox(MessageBoxStrings.GUI.frmPackageAssets.DELETE_GROUP_ERR, MessageBoxStrings.MESSAGEBOX_NAME, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    Logger.WriteErrorLog(frmPackageAssetsMessages.Error.UNABLE_REMOVE_GROUP_INVALID_PARENT, _namespace, null, BasicDebugLogger.DebugErrorType.Error);
                    return(false);
                }
                RMTilesetGroup tilesetGroup = groupTag.Object as RMTilesetGroup;
                if (tilesetGroup == null)
                {
                    Helper.ShowMessageBox(MessageBoxStrings.GUI.frmPackageAssets.DELETE_GROUP_ERR, MessageBoxStrings.MESSAGEBOX_NAME, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    Logger.WriteErrorLog(frmPackageAssetsMessages.Error.UNABLE_REMOVE_GROUP_INVALID, _namespace, null, BasicDebugLogger.DebugErrorType.Error);
                    return(false);
                }
                tNode.Remove();
                tilesetCollection.Groups.Remove(tilesetGroup);
                if (tilesetCollection.Groups.Count == 0)
                {
                    tilesetCollection.Parent.Collections.Remove(tilesetCollection);
                }
                return(true);
            }

            return(false);
        }
                public static void InstallMovie(string toWhere, string fromDirectory, RMMovieCollection collection, string _namespace)
                {
                    string dir = toWhere + "\\" + DirectoryNames.ProjectFiles.MOVIES;

                    Helper.MakeDirIfNotExistInstall(dir, _namespace);
                    if (collection.Groups != null)
                    {
                        foreach (RMMovieGroup movie in collection.Groups)
                        {
                            InstallMovieFile(dir, toWhere, fromDirectory, movie, _namespace);
                        }
                    }
                }
Пример #6
0
 public InvalidMovieException(string message, WhichInvalid whichInvalid, RMMovieCollection collection) : base(message)
 {
     TypeOfIssue = whichInvalid;
     Collection  = collection;
 }