Beispiel #1
0
 public UsingSpec(ClrNamespaceName NamespaceName)
 {
     this.IsStatic      = false;
     this.SubjectName   = NamespaceName;
     this.Documentation = null;
     this.AliasName     = String.Empty;
 }
Beispiel #2
0
 public UsingSpec(string AliasName, ClrNamespaceName NamespaceName)
 {
     this.AliasName     = AliasName;
     this.IsStatic      = false;
     this.SubjectName   = NamespaceName;
     this.Documentation = null;
 }
Beispiel #3
0
 public NamespaceSpec(ClrNamespaceName Name, IEnumerable <IClrElementSpec> DeclaredElements,
                      IEnumerable <UsingSpec> Usings)
     :  base(Name, null, ClrAccessKind.Default, array <AttributionSpec>())
 {
     this.DeclaredElements = rovalues(DeclaredElements);
     this.Usings           = rovalues(Usings);
 }
Beispiel #4
0
 public static Option <int> RepresentStructure(this FolderPath SrcDir, ClrNamespaceName DstNs, FilePath DstFile)
 {
     using (var writer = new StreamWriter(DstFile))
     {
         writer.WriteLine($"namespace {DstNs}");
         writer.WriteLine("{");
         var result = Render(SrcDir, writer);
         writer.WriteLine("}");
         return(result);
     }
 }
Beispiel #5
0
 /// <summary>
 /// Specifies a using statement
 /// </summary>
 /// <param name="ns">The namespace to be brought into scope</param>
 /// <returns></returns>
 public static UsingSpec SpecifyUsing(this ClrNamespaceName ns)
 => new UsingSpec(ns);
Beispiel #6
0
 public NamespaceSpec(ClrNamespaceName Name, params IClrElementSpec[] DeclaredElements)
     : base(Name, null, ClrAccessKind.Default, array <AttributionSpec>())
 {
     this.DeclaredElements = DeclaredElements;
     this.Usings           = array <UsingSpec>();
 }
Beispiel #7
0
 public bool IsDeclaredIn(ClrNamespaceName ns)
 => Namespace.MapValueOrDefault(x => x.ToString(), string.Empty) == ns.ToString();