コード例 #1
0
        //public static IDictionary<IGExceptionId<TValue>, IGException<TValue>> ConvertToInterfaceExceptions(this IGClass gClass) {
        //  return new Dictionary<IGExceptionId<TValue>, IGException<TValue>>();
        //}

        //public static IDictionary<IGExceptionGroupId<TValue>, IGExceptionGroup<TValue>> ConvertToInterfaceExceptionGroups(this IGClass gClass) {
        //  return new Dictionary<IGExceptionGroupId<TValue>, IGExceptionGroup<TValue>>();
        //}

        //public static IDictionary<IGEventId<TValue>, IGEvent<TValue>> ConvertToInterfaceEvents(this IGClass gClass) {
        //  return new Dictionary<IGEventId<TValue>, IGEvent<TValue>>();
        //}

        //public static IDictionary<IGEventGroupId<TValue>, IGEventGroup<TValue>> ConvertToInterfaceEventGroups(this IGClass gClass) {
        //  return new Dictionary<IGEventGroupId<TValue>, IGEventGroup<TValue>>();
        //}
        static public void PopulateInterface(IGClass gClass, IGInterface gInterface)
        {
            //gClass.ConvertToInterfacePropertys().ForEach(x => gInterface.GPropertys.Add(x.Key, x.Value));
            //gClass.ConvertToInterfacePropertyGroups().ForEach(x => gInterface.GPropertyGroups.Add(x.Key, x.Value));
            //gClass.ConvertToInterfaceMethods().ForEach(x => gInterface.GMethods.Add(x.Key, x.Value));
            //gClass.ConvertToInterfaceMethodGroups().ForEach(x => gInterface.GMethodGroups.Add(x.Key, x.Value));
            //gClass.ConvertToInterfaceExceptions().ForEach(x => gInterface.GExceptions.Add(x.Key, x.Value));
            //gClass.ConvertToInterfaceExceptionGroups().ForEach(x => gInterface.GExceptionGroups.Add(x.Key, x.Value));
            //gClass.ConvertToInterfaceEvents().ForEach(x => gInterface.GEvents.Add(x.Key, x.Value));
            //gClass.ConvertToInterfaceEventGroups().ForEach(x => gInterface.GEventGroups.Add(x.Key, x.Value));
            foreach (var kvp in gClass.ConvertToInterfacePropertys())
            {
                gInterface.GPropertys.Add(kvp.Key, kvp.Value);
            }
            foreach (var kvp in gClass.ConvertToInterfacePropertyGroups())
            {
                gInterface.GPropertyGroups.Add(kvp.Key, kvp.Value);
            }
            //baseClass.ConvertToInterfacePropertyGroups().ForEach(x => gInterface.GPropertyGroups.Add(x.Key, x.Value));
            foreach (var kvp in gClass.ConvertToInterfaceMethods())
            {
                gInterface.GMethods.Add(kvp.Key, kvp.Value);
            }
            foreach (var kvp in gClass.ConvertToInterfaceMethodGroups())
            {
                gInterface.GMethodGroups.Add(kvp.Key, kvp.Value);
            }
        }
コード例 #2
0
 public static IGInterface AddMethod(this IGInterface gInterface, IEnumerable <GMethod> gMethods)
 {
     foreach (var o in gMethods)
     {
         gInterface.GMethods[o.Id] = o;
     }
     return(gInterface);
 }
コード例 #3
0
 public static IGInterface AddPropertyGroup(this IGInterface gInterface, IDictionary <IGPropertyGroupId <TValue>, IGPropertyGroup> gPropertyGroups)
 {
     foreach (var kvp in gPropertyGroups)
     {
         gInterface.GPropertyGroups.Add(kvp.Key, kvp.Value);
     }
     return(gInterface);
 }
コード例 #4
0
 public static IGInterface AddPropertyGroups(this IGInterface gInterface, IEnumerable <IGPropertyGroup> gPropertyGroups)
 {
     foreach (var o in gPropertyGroups)
     {
         gInterface.GPropertyGroups[o.Id] = o;
     }
     return(gInterface);
 }
コード例 #5
0
 public static IGInterface AddProperty(this IGInterface gInterface, IDictionary <IGPropertyId, IGProperty> gPropertys)
 {
     foreach (var kvp in gPropertys)
     {
         gInterface.GPropertys.Add(kvp.Key, kvp.Value);
     }
     return(gInterface);
 }
コード例 #6
0
 public static IGInterface AddMethodGroup(this IGInterface gInterface, IDictionary <IGMethodGroupId <TValue>, IGMethodGroup <TValue> > gMethodGroups)
 {
     foreach (var kvp in gMethodGroups)
     {
         gInterface.GMethodGroups.Add(kvp.Key, kvp.Value);
     }
     return(gInterface);
 }
コード例 #7
0
 public static IGInterface AddMethodGroup(this IGInterface gInterface, IEnumerable <IGMethodGroup> gMethodGroups)
 {
     foreach (var o in gMethodGroups)
     {
         gInterface.AddMethodGroup(o);
     }
     return(gInterface);
 }
コード例 #8
0
        public static IR1Top RInterface(this IR1Top r1Top, IGInterface gInterface)
        {
            r1Top.Sb.RInterfacePreambleStringBuilder(gInterface, r1Top.Indent, r1Top.Eol, r1Top.Ct);
            r1Top.Indent.Append(r1Top.IndentDelta);
            if (gInterface.GPropertyGroups.Any())
            {
                r1Top.Sb.Append($"{r1Top.Indent}#region PropertyGroups{r1Top.Eol}");
                r1Top.Indent.Append(r1Top.IndentDelta);
                r1Top.RPropertyGroup(gInterface.GPropertyGroups);
                r1Top.Indent.ReplaceFirst(r1Top.IndentDelta, "");
                r1Top.Sb.Append($"{r1Top.Indent}#endregion{r1Top.Eol}");
            }
            if (gInterface.GPropertys.Any())
            {
                r1Top.Sb.Append($"{r1Top.Indent}#region Property{r1Top.Eol}");
                r1Top.Indent.Append(r1Top.IndentDelta);
                foreach (var kvp in gInterface.GPropertys)
                {
                    //r1Top.RInterfaceProperty(kvp.Value);
                    r1Top.RProperty(kvp.Value);
                }
                r1Top.Indent.ReplaceFirst(r1Top.IndentDelta, "");
                r1Top.Sb.Append($"{r1Top.Indent}#endregion{r1Top.Eol}");
            }
            //r1Top.RInterfaceProperty(gInterface.GPropertys);
            if (gInterface.GMethodGroups.Any())
            {
                r1Top.Sb.Append($"{r1Top.Indent}#region MethodGroups{r1Top.Eol}");
                r1Top.Indent.Append(r1Top.IndentDelta);
                foreach (var kvp in gInterface.GMethodGroups)
                {
                    r1Top.RMethodGroup(kvp.Value);
                }
                r1Top.Indent.ReplaceFirst(r1Top.IndentDelta, "");
                r1Top.Sb.Append($"{r1Top.Indent}#endregion{r1Top.Eol}");
            }
            if (gInterface.GMethods.Any())
            {
                r1Top.Sb.Append($"{r1Top.Indent}#region Methods{r1Top.Eol}");
                r1Top.Indent.Append(r1Top.IndentDelta);
                foreach (var kvp in gInterface.GMethods)
                {
                    r1Top.RMethod(kvp.Value);
                    //r1Top.RInterfaceMethod(kvp.Value);
                }
                r1Top.Indent.ReplaceFirst(r1Top.IndentDelta, "");
                r1Top.Sb.Append($"{r1Top.Indent}#endregion{r1Top.Eol}");
            }

            //r1Top.RInterfaceMethod(gInterface.GMethods);
            r1Top.Indent.ReplaceFirst(r1Top.IndentDelta, "");
            r1Top.Sb.Append($"{r1Top.Indent} }}{r1Top.Eol}");
            return(r1Top);
        }
コード例 #9
0
 public static IGInterface AddMethod(this IGInterface gInterface, IGMethod gMethod)
 {
     gInterface.GMethods[gMethod.Id] = gMethod;
     return(gInterface);
 }
コード例 #10
0
 public static IGInterface AddPropertyGroups(this IGInterface gInterface, IGPropertyGroup gPropertyGroup)
 {
     gInterface.GPropertyGroups[gPropertyGroup.Id] = gPropertyGroup;
     return(gInterface);
 }
コード例 #11
0
 public static IGInterface AddProperty(this IGInterface gInterface, IGProperty gProperty)
 {
     gInterface.GPropertys[gProperty.Id] = (gProperty);
     return(gInterface);
 }
コード例 #12
0
 public static IGInterface AddMethodGroup(this IGInterface gInterface, IGMethodGroup gMethodGroup)
 {
     gInterface.GMethodGroups[gMethodGroup.Id] = gMethodGroup;
     return(gInterface);
 }
コード例 #13
0
 public static StringBuilder RInterfacePreambleStringBuilder(this StringBuilder sb, IGInterface gInterface, StringBuilder indent, string eol, CancellationToken?ct = default)
 {
     ct?.ThrowIfCancellationRequested();
     sb.Append($"{indent}{gInterface.GVisibility} {gInterface.GAccessModifier} interface {gInterface.GName} ");
     if (gInterface.GInheritance != "" || gInterface.GImplements.Any())
     {
         sb.Append(" : ");
     }
     if (gInterface.GInheritance != "" && !gInterface.GImplements.Any())
     {
         sb.Append(gInterface.GInheritance);
     }
     else if (gInterface.GInheritance == "" && gInterface.GImplements.Any())
     {
         sb.Append(String.Join(",", gInterface.GImplements));
     }
     else if (gInterface.GInheritance != "" && gInterface.GImplements.Any())
     {
         sb.Append(gInterface.GInheritance);
         sb.Append(",");
         sb.Append(String.Join(",", gInterface.GImplements));
     }
     sb.Append($" {{{eol}");
     return(sb);
 }