Example #1
0
            public override void Replace()
            {
                var regex    = new Regex(string.Format(API_CLASSE, FinalName)).Match(StringApi);
                var baseType = regex.Groups["b"].Value;

                string oldValue = regex.Value;
                string newValue = oldValue.Replace(baseType, $@"{baseType}, Name = ""{CompiledName}""");

                SbApi.Replace(oldValue, newValue);
            }
Example #2
0
            public override void Replace()
            {
                var regex = new Regex(string.Format(API_PROTOCOL, FinalName)).Match(StringApi);

                string oldValue = regex.Value;
                string newValue = string.Empty;

                if (regex.Groups["b"].Success)
                {
                    var baseType = regex.Groups["b"].Value;
                    newValue = oldValue.Replace(baseType, $@"{baseType}, Name = ""{CompiledName}""");
                }
                else
                {
                    newValue = oldValue.Replace("Protocol", $@"Protocol(Name = ""{CompiledName}"")");
                }

                SbApi.Replace(oldValue, newValue);
            }