示例#1
0
        /// <summary>
        /// Set the given file to be the active file and clear its composer.
        /// If the file doesn't exist it's created.
        /// </summary>
        /// <param name="fileName"></param>
        /// <returns></returns>
        public FilesComposer InitalizeFile(string fileName)
        {
            SelectFile(fileName);

            if (HasActiveFile == false)
            {
                return(this);
            }

            ActiveFileComposer.Clear();

            return(this);
        }
示例#2
0
        /// <summary>
        /// Set the given file to be the active file and clear its composer.
        /// If the file doesn't exist it's created. After that it executes the given action.
        /// </summary>
        /// <param name="fileName"></param>
        /// <param name="initAction"></param>
        /// <returns></returns>
        public FilesComposer InitalizeFile(string fileName, Action <TextFileComposer> initAction)
        {
            SelectFile(fileName);

            if (HasActiveFile == false)
            {
                return(this);
            }

            ActiveFileComposer.Clear();

            initAction?.Invoke(ActiveFileComposer);

            return(this);
        }