コード例 #1
0
        List <_File> loadFiles()
        {
            _files.Clear();
            DirectoryInfo d = new DirectoryInfo(home + "branches\\" + source + "\\" + branch);

            FileInfo[] Files = d.GetFiles("*.*", SearchOption.AllDirectories);
            foreach (FileInfo file in Files)
            {
                _File add = new _File
                {
                    Name         = file.Name,
                    Path         = file.FullName.Replace(home + "branches\\" + source + "\\", "").Replace("\\" + file.Name, ""),
                    Size         = (int)(file.Length / 1024),
                    LastModified = ts(file.LastWriteTime, true),
                    Icon         = 0,
                    Symlink      = file.Attributes.HasFlag(FileAttributes.ReparsePoint)
                };
                //Console.WriteLine("\n\n" + add.Name + ", \n" + add.Path + ", \n" + add.AbsolutePath+"\n\n");
                if (add.Name.EndsWith(".xml") || add.Name.EndsWith(".json") || add.Name.EndsWith(".txt") || add.Name.EndsWith(".log"))
                {
                    add.Icon = 1;
                }
                else if (add.Name.EndsWith(".map") || add.Name.EndsWith(".mapinfo") || add.Name.EndsWith(".blf") || add.Name.EndsWith(".campaign") || add.Name.EndsWith(".asmp"))
                {
                    add.Icon = 2;
                }
                _files.Add(add);
            }

            return(_files);
        }
コード例 #2
0
        public MusicUninstaller(Uninstall _uninstall, _File _file)
        {
            file      = _file;
            uninstall = _uninstall;
            bgmAcb    = (ACB_File)uninstall.GetParsedFile <ACB_File>(MusicInstaller.BGM_PATH, false);

            if (_file.filePath == MusicInstaller.OPTION_INSTALL_TYPE)
            {
                oblFile = (OBL_File)uninstall.GetParsedFile <OBL_File>(MusicInstaller.OBL_PATH, false);

                for (int i = 0; i < GeneralInfo.LanguageSuffix.Length; i++)
                {
                    msgFiles.Add((MSG_File)uninstall.GetParsedFile <MSG_File>($"{MusicInstaller.OPTION_MSG_PATH}{GeneralInfo.LanguageSuffix[i]}", false));
                }
            }
            else if (_file.filePath == MusicInstaller.DIRECT_INSTALL_TYPE)
            {
                if (cpkAcbFile == null)
                {
                    cpkAcbFile = (ACB_File)uninstall.GetParsedFile <ACB_File>(MusicInstaller.BGM_PATH, true);
                }
            }

            Uninstall();
        }
コード例 #3
0
    public void File(_File file)
    {
        ListViewItem item = new ListViewItem();

        item.Text        = file.Name;
        item.ToolTipText = file.Path;
        item.Tag         = item.ImageIndex;
        item.Name        = item.Text;
        RaiseEvents(item);
        //Add item to listView1
    }
コード例 #4
0
        public void Initialisation()
        {
            currentDirectory = new DirectoryInfo(mainFolder.Way);

            directories = currentDirectory.GetDirectories();
            files       = currentDirectory.GetFiles();

            string[]      directoryNames = Directory.GetDirectories(mainFolder.Way);
            string[]      fileNames      = Directory.GetFiles(mainFolder.Way);
            List <string> filePaths      = new List <string>();
            List <string> directoryPaths = new List <string>();

            filePaths.AddRange(fileNames);
            directoryPaths.AddRange(directoryNames);

            filePaths.Sort();
            directoryPaths.Sort();

            fileSystemEntriesPaths.AddRange(directoryPaths);
            fileSystemEntriesPaths.AddRange(filePaths);

            foreach (string path in fileSystemEntriesPaths)
            {
                if (Directory.Exists(path))
                {
                    Folder folder = new Folder(path);
                    folder.IndentationsLength = indentationLength + 2;
                    folders.Add(folder);
                    mainFolder.AddChildren(folder);
                }
                else
                {
                    _File file = new _File(path);
                    file.IndentationsLength = indentationLength;
                    folders.Add(file);
                    mainFolder.AddChildren(file);
                }
            }

            folders[current.Index].Current = true;

            // myComputer.SetCoordinatesCurrentDirectory();
        }
コード例 #5
0
        public AcbUninstaller(Uninstall _uninstall, _File _file)
        {
            file      = _file;
            uninstall = _uninstall;

            if (file.filePath == AcbInstaller.OPTION_INSTALL_TYPE || file.filePath == AcbInstaller.DIRECT_INSTALL_TYPE)
            {
                //BGM
                LoadBgm();
                UninstallBgm();
            }
            else if (Utils.SanitizePath(file.filePath) == AcbInstaller.CSS_VOICE_EN_PATH || Utils.SanitizePath(file.filePath) == AcbInstaller.CSS_VOICE_JPN_PATH)
            {
                //CSS
                CssUninstall();
            }
            else
            {
                throw new Exception($"Cannot uninstall file \"{file.filePath}\". It is not recognized.\n\nOnly BGM and CSS ACB files are supported.");
            }
        }
コード例 #6
0
            internal static _File GetObject(MfsOperations parent)
            {
                if (_theObject == null) {
                    _theObject = new _File (parent);
                }

                return _theObject;
            }
コード例 #7
0
 public void Dispose()
 {
     _theObject = null;
 }
コード例 #8
0
 public void Post([FromBody] _File value)
 {
     GetFile(value.tokenId, value.ID, value.GUID);
 }
コード例 #9
0
 private void LoadSubobjects()
 {
     FileObj = _File.GetObject (this);
     DocumentObj = _Document.GetObject (this);
     AspectObj = _Aspect.GetObject (this);
     AspectGroupObj = _AspectGroup.GetObject (this);
     BriefcaseObj = _Briefcase.GetObject (this);
     CollectionObj = _Collection.GetObject (this);
     NoteObj = _Note.GetObject (this);
     UrlObj = _Url.GetObject (this);
     VCardObj = _VCard.GetObject (this);
     SfdObj = _Sfd.GetObject (this);
     RelationObj = _Relation.GetObject (this);
     ArchiveObj = _Archive.GetObject (this);
     BookmarkObj = _Bookmark.GetObject (this);
     IndexObj = _Index.GetObject (this);
     MasterPasswordObj = _MasterPassword.GetObject (this);
     CredentialsObj = _Credentials.GetObject (this);
 }