public override string[] GetModuleCommand(IIntermediateModule module, string[] sourceFiles, string[] resourceFiles, IIntermediateCompilerOptions options) { string target = options.Target; if (module != module.Project.RootModule) { target = string.Format("{0}.{1}.part", target.Substring(0, target.LastIndexOf('.')), module.Name); } return(Tweaks.MergeArrays <string>(new string[] { GetTypeCommand(module != module.Project.RootModule ? ProjectOutputType.Module : module.Project.OutputType, options), GetOutputCommand(target, options) }, GetSourcesCommand(sourceFiles, options))); //return string.Format("{0} {1} {2}", , string.Join(" ", )); }
public override void Dispose() { try { if (this._metadata != null) { this._metadata.Dispose(); this._metadata = null; } this.parent = null; this.name = null; this.declaringModule = null; } finally { this.isDisposed = 1; base.Dispose(); } }
/// <summary> /// If the <see cref="Declaration{TDom, TParent}.ParentTarget"/> is an <see cref="INameSpaceDeclaration"/> then /// the <see cref="Module"/> is set to the /// <see cref="IIntermediateProject.CurrentDefaultModule"/>. /// </summary> protected virtual void CheckModule() { if (this.ParentTarget is INameSpaceDeclaration || this.ParentTarget is IIntermediateProject) { IIntermediateProject iip = null; if (this.ParentTarget is INameSpaceDeclaration) { iip = ((INameSpaceDeclaration)(this.ParentTarget)).Project; } else { iip = ((IIntermediateProject)this.ParentTarget); } if (iip != null) { this.module = iip.CurrentDefaultModule; } } else if (this.parentTarget is IDeclaredType) { this.module = ((IDeclaredType)(this.parentTarget)).Module; } }
/// <summary> /// Creates and inserts a new <typeparamref name="TIntermediateType"/> instance /// into the current <see cref="IIntermediateTypeDictionary{TTypeIdentifier, TType, TIntermediateType}"/>. /// </summary> /// <param name="name">The <see cref="String"/> that defines the name of the /// new <typeparamref name="TIntermediateType"/> to create.</param> /// <param name="module">The <see cref="IIntermediateModule"/> to add the /// new <typeparamref name="TIntermediateType"/> to.</param> /// <returns>A new <typeparamref name="TIntermediateType"/> instance.</returns> /// <remarks>Using this method creates a new partial instance /// of the assembly to ensure the class can be translated into /// a file of its own.</remarks> /// <exception cref="System.ArgumentNullException">thrown when <paramref name="name"/>, or <paramref name="module"/>, is null.</exception> /// <exception cref="System.ArgumentException">thrown when a type by the <paramref name="name"/> /// provided already exists in the containing type parent, or <paramref name="name"/> /// is <see cref="String.Empty"/>.</exception> public TIntermediateType Add(string name, IIntermediateModule module) { if (name == null) { throw new ArgumentNullException("name"); } if (module == null) { throw new ArgumentNullException("module"); } if (name == string.Empty) { throw new ArgumentException("The name provided cannot be empty.", "name"); } if (module.Parent.GetRoot() != this.Parent.Assembly.GetRoot()) { throw new ArgumentException("module"); } var result = this.Add(name); result.DeclaringModule = module; return(result); }
public abstract string[] GetModuleCommand(IIntermediateModule module, string[] sourceFiles, string[] resourceFiles, IIntermediateCompilerOptions options);