Beispiel #1
0
        protected override void OnResolveBegin(FrontendCompiler context)
        {
            if (String.IsNullOrEmpty(this.Name) && String.IsNullOrEmpty(this.Source))
            {
                context.OnMessage(new CompilerMessageEventArgs(CompilerMessage.FileMissingNameAndSource(), this));
            }
            else if (String.IsNullOrEmpty(this.Name) || this.Name.EndsWith("\\", StringComparison.Ordinal))
            {
                this.Name = IO.Path.Combine(this.Name ?? String.Empty, IO.Path.GetFileName(this.Source));
            }

            // TODO: error if name ends with "\".

            base.OnResolveBegin(context);

            // TODO: error if name is empty.

            if (String.IsNullOrEmpty(this.Source))
            {
                // TODO: walk the parent tree to see if a source is available.

                this.Source = IO.Path.Combine(this.ParentRelativePathFromName ?? String.Empty, this.Name);
            }
            else if (this.Source.EndsWith("\\", StringComparison.Ordinal))
            {
                this.Source = IO.Path.Combine(this.Source, this.ParentRelativePathFromName ?? String.Empty, this.Name);
            }
        }