Exemplo n.º 1
0
        public bool ChangeName(string fileName)
        {
            BuildExceptions.NotNullNotEmpty(fileName, "fileName");
            if (this.IsValid)
            {
                if (IoPath.HasExtension(fileName))
                {
                    _path = IoPath.Combine(IoPath.GetDirectoryName(_path),
                                           fileName);
                }
                else
                {
                    string extension = IoPath.GetExtension(_path);

                    _path = IoPath.Combine(IoPath.GetDirectoryName(_path),
                                           fileName + extension);
                }

                return(true);
            }

            return(false);
        }
Exemplo n.º 2
0
        public BuildDirectoryPath(string path)
        {
            BuildExceptions.NotNullNotEmpty(path, "path");

            this.OnUpdatePath(path);
        }
Exemplo n.º 3
0
        protected BuildTocInfo(string name)
        {
            BuildExceptions.NotNullNotEmpty(name, "name");

            _name = name;
        }
Exemplo n.º 4
0
        public virtual bool UnregisterFunction(string functionName)
        {
            BuildExceptions.NotNullNotEmpty(functionName, "functionName");

            return(_userFunctions.Remove(functionName));
        }
Exemplo n.º 5
0
        public virtual void Initialize(string name, string workingDir,
                                       bool isEditable)
        {
            BuildExceptions.NotNullNotEmpty(name, "name");
            BuildExceptions.PathMustExist(workingDir, "workingDir");

            if (_isInitialized)
            {
                return;
            }

            _name       = name;
            _workingDir = workingDir;
            _isEditable = isEditable;

            if (String.IsNullOrEmpty(_mediaDir))
            {
                _mediaDir = Path.Combine(workingDir, "Media");
            }
            if (String.IsNullOrEmpty(_mediaFile))
            {
                _mediaFile = Path.Combine(workingDir,
                                          _name + BuildFileExts.MediaContentExt);
            }

            if (String.IsNullOrEmpty(_topicsDir))
            {
                _topicsDir = Path.Combine(workingDir, "Topics");
                if (String.IsNullOrEmpty(_topicsCompanionDir))
                {
                    _topicsCompanionDir = _topicsDir;
                }
            }
            if (String.IsNullOrEmpty(_topicsCompanionDir))
            {
                _topicsCompanionDir = Path.Combine(workingDir, "Topics");
            }
            if (String.IsNullOrEmpty(_topicsFile))
            {
                _topicsFile = Path.Combine(workingDir,
                                           _name + BuildFileExts.ConceptualContentExt);
            }

            if (String.IsNullOrEmpty(_commentsDir))
            {
                _commentsDir = Path.Combine(workingDir, "Comments");
            }
            if (String.IsNullOrEmpty(_assembliesDir))
            {
                _assembliesDir = Path.Combine(workingDir, "References");
            }
            if (String.IsNullOrEmpty(_dependenciesDir))
            {
                _dependenciesDir = Path.Combine(workingDir, "Dependencies");
            }
            if (String.IsNullOrEmpty(_imagesDir))
            {
                _imagesDir = Path.Combine(workingDir, "Images");
            }

            _isInitialized = true;
        }