コード例 #1
0
        public void SwitchToFileBlock(string fileName, string blockName)
        {
            EndCurrentBlock();

            // Put current one file block on the stack...
            if (CurrentBlockPart != null)
            {
                PendingBlocks.Push(CurrentBlockPart.Parent);
            }

            // Create object for provided file name
            FileBlocks fileBlocks = new FileBlocks(fileName);

            // If it exists already just use it...
            if (m_FilesDictionary.ContainsKey(fileName))
            {
                fileBlocks = m_FilesDictionary[fileName];
            }
            else
            {
                m_FilesDictionary.Add(fileName, fileBlocks);
                m_OrderedFiles.Add(fileName);
            }

            // Create a holder for a new one piece of the text/code
            CurrentBlockPart = fileBlocks.GetBlock(blockName).GetNewBlockPart();
        }
コード例 #2
0
        public void RestorePreviousBlock()
        {
            EndCurrentBlock();

            // Store it as a current one piece of the text/code
            CurrentBlockPart = PendingBlocks.Pop().GetNewBlockPart();
        }
コード例 #3
0
ファイル: FileBlockInfo.cs プロジェクト: navirius/bitcare
        public FileBlockPart GetNewBlockPart()
        {
            // Create new block part
            FileBlockPart fileBlockPart = new FileBlockPart(this);

            // Store it on the list
            FileBlockParts.Add(fileBlockPart);

            // Return result
            return(fileBlockPart);
        }