示例#1
0
        private static string ExtendNamespace(this string modelNamespace, GeneratorSettings settings)
        {
            if (string.IsNullOrEmpty(modelNamespace))
            {
                return(settings.PackageNamespace ?? string.Empty);
            }

            if (modelNamespace.StartsWith(".", StringComparison.Ordinal))
            {
                if (string.IsNullOrEmpty(settings.PackageNamespace))
                {
                    modelNamespace = modelNamespace.Substring(1);
                }
                else
                {
                    modelNamespace = settings.PackageNamespace + modelNamespace;
                }
            }

            return(modelNamespace);
        }
示例#2
0
 public CommunityModel(GeneratorSettings generatorSettings = null, AgentModel[] agents = null, MessageModel[] messages = null)
 {
     GeneratorSettings = generatorSettings ?? new GeneratorSettings();
     Agents            = agents ?? new AgentModel[0];
     Messages          = messages ?? new MessageModel[0];
 }