当前位置: 首页>>代码示例>>C#>>正文


C# ISchema类代码示例

本文整理汇总了C#中ISchema的典型用法代码示例。如果您正苦于以下问题:C# ISchema类的具体用法?C# ISchema怎么用?C# ISchema使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ISchema类属于命名空间,在下文中一共展示了ISchema类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ColumnSchema

		public ColumnSchema (ISchemaProvider schemaProvider, ISchema parent, string name)
			: base (schemaProvider)
		{
			this.constraints = new ConstraintSchemaCollection ();
			this.parent = parent;
			this.name = name;
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:7,代码来源:ColumnSchema.cs

示例2: Generate

        public string Generate(ISchema schema)
        {
            StringBuilder sb = new StringBuilder(string.Format(@"
@using Kooboo.CMS.Content.Models;
@using Kooboo.CMS.Content.Query;
@{{ var schema = (Kooboo.CMS.Content.Models.Schema)ViewData[""Schema""];
    var allowedEdit = (bool)ViewData[""AllowedEdit""];
    var allowedView = (bool)ViewData[""AllowedView""];
    var parentUUID = ViewContext.RequestContext.AllRouteValues()[""parentUUID""];
    var parentFolder=ViewContext.RequestContext.AllRouteValues()[""parentFolder""];
}}
@using(Html.BeginForm(ViewContext.RequestContext.AllRouteValues()[""action""].ToString()
    , ViewContext.RequestContext.AllRouteValues()[""controller""].ToString()
    , ViewContext.RequestContext.AllRouteValues()
    , FormMethod.Post
    , new RouteValueDictionary(new {{ enctype = ""{0}"" }})))
{{
    <table>", FormHelper.Enctype(schema)));

            foreach (var item in schema.Columns.OrderBy(it => it.Order))
            {
                sb.Append(item.Render(schema, false));
            }

            sb.Append(@"
    @Html.Action(""Categories"", ViewContext.RequestContext.AllRouteValues())
    
    </table>
}");

            return sb.ToString();
        }
开发者ID:Godoy,项目名称:CMS,代码行数:32,代码来源:CreateForm.cs

示例3: AssemblyFile

 public AssemblyFile(ISchema parent, AssemblyFile assemblyFile, ObjectStatus status)
     : base(parent, MsSql.ObjectType1.AssemblyFile)
 {
     Name = assemblyFile.Name;
     content = assemblyFile.content;
     Status = status;
 }
开发者ID:footcha,项目名称:DbTracer,代码行数:7,代码来源:AssemblyFile.cs

示例4: GraphTypeFromType

        public static IGraphType GraphTypeFromType(this IType type, ISchema schema)
        {
            if (type is NonNullType)
            {
                var nonnull = (NonNullType)type;
                var ofType = GraphTypeFromType(nonnull.Type, schema);
                var nonnullGraphType = typeof(NonNullGraphType<>).MakeGenericType(ofType.GetType());
                var instance = (NonNullGraphType)Activator.CreateInstance(nonnullGraphType);
                instance.ResolvedType = ofType;
                return instance;
            }

            if (type is ListType)
            {
                var list = (ListType)type;
                var ofType = GraphTypeFromType(list.Type, schema);
                var listGraphType = typeof(ListGraphType<>).MakeGenericType(ofType.GetType());
                var instance = (ListGraphType)Activator.CreateInstance(listGraphType);
                instance.ResolvedType = ofType;
                return instance;
            }

            if (type is NamedType)
            {
                var named = (NamedType)type;
                return schema.FindType(named.Name);
            }

            return null;
        }
开发者ID:graphql-dotnet,项目名称:graphql-dotnet,代码行数:30,代码来源:TypeExtensions.cs

示例5: Render

        public static string Render(this IColumn column, ISchema schema, bool isUpdate)
        {
            var controlType = column.ControlType;
            if (isUpdate && !column.Modifiable)
            {
                controlType = "Hidden";
            }
            if (string.IsNullOrEmpty(controlType))
            {
                return string.Empty;
            }
            if (!Contains(controlType))
            {
                throw new Exception(string.Format("Control type {0} does not exists.", controlType));
            }

            string controlHtml = string.Empty;

            controlHtml = controls[controlType].Render(schema, column);

            if (string.Equals(column.Name, "published", StringComparison.OrdinalIgnoreCase))
            {
                controlHtml = AllowedEditWraper(controlHtml);
            }

            return controlHtml;
        }
开发者ID:Epitomy,项目名称:CMS,代码行数:27,代码来源:ControlHelper.cs

示例6: DatabaseController

 public DatabaseController(ISchema schemaRepository, ISettings settingsRepository, IPathMapper pathMapper)
 {
     _schemaRepository = schemaRepository;
     _settingsRepository = settingsRepository;
     _pathMapper = pathMapper;
     _dbContext = new DbContext();
 }
开发者ID:rinckd,项目名称:sblog.net,代码行数:7,代码来源:DatabaseController.cs

示例7: ResolveFieldContext

 /// <summary>
 /// Initializes a new instance of the <see cref="ResolveFieldContext"/> class.
 /// </summary>
 /// <param name="fieldName">Name of the field.</param>
 /// <param name="fieldAst">The field ast.</param>
 /// <param name="fieldDefinition">The field definition.</param>
 /// <param name="returnType">Type of the return.</param>
 /// <param name="parentType">Type of the parent.</param>
 /// <param name="arguments">The arguments.</param>
 /// <param name="rootValue">The root value.</param>
 /// <param name="source">The source.</param>
 /// <param name="schema">The schema.</param>
 /// <param name="operation">The operation.</param>
 /// <param name="fragments">The fragments.</param>
 /// <param name="variables">The variables.</param>
 /// <param name="cancellationToken">The cancellation token.</param>
 /// <param name="userContext">The user context.</param>
 public ResolveFieldContext(
     string fieldName,
     Field fieldAst,
     FieldType fieldDefinition,
     GraphType returnType,
     ObjectGraphType parentType,
     IReadOnlyDictionary<string, object> arguments,
     object rootValue,
     object source,
     ISchema schema,
     Operation operation,
     IEnumerable<IFragment> fragments,
     IEnumerable<Variable> variables,
     CancellationToken cancellationToken,
     object userContext)
 {
     FieldName = fieldName;
     FieldAst = fieldAst;
     FieldDefinition = fieldDefinition;
     ReturnType = returnType;
     ParentType = parentType;
     Arguments = arguments;
     RootValue = rootValue;
     Source = source;
     Schema = schema;
     Operation = operation;
     Fragments = fragments;
     Variables = variables;
     CancellationToken = cancellationToken;
     UserContext = userContext;
 }
开发者ID:husterk,项目名称:graphql-dotnet,代码行数:48,代码来源:ResolveFieldContext.cs

示例8: BuildExecutionContext

        public ExecutionContext BuildExecutionContext(
            ISchema schema,
            object root,
            Document document,
            string operationName,
            Inputs inputs,
            CancellationToken cancellationToken)
        {
            var context = new ExecutionContext();
            context.Schema = schema;
            context.RootObject = root;

            var operation = !string.IsNullOrWhiteSpace(operationName)
                ? document.Operations.WithName(operationName)
                : document.Operations.FirstOrDefault();

            if (operation == null)
            {
                context.Errors.Add(new ExecutionError("Unknown operation name: {0}".ToFormat(operationName)));
                return context;
            }

            context.Operation = operation;
            context.Variables = GetVariableValues(schema, operation.Variables, inputs);
            context.Fragments = document.Fragments;
            context.CancellationToken = cancellationToken;

            return context;
        }
开发者ID:poobah,项目名称:graphql-dotnet,代码行数:29,代码来源:DocumentExecuter.cs

示例9: Validate

        public IValidationResult Validate(
            string originalQuery,
            ISchema schema,
            Document document,
            IEnumerable<IValidationRule> rules = null)
        {
            var context = new ValidationContext
            {
                OriginalQuery = originalQuery,
                Schema = schema,
                Document = document,
                TypeInfo = new TypeInfo(schema)
            };

            if (rules == null)
            {
                rules = CoreRules();
            }

            var visitors = rules.Select(x => x.Validate(context)).ToList();

            visitors.Insert(0, context.TypeInfo);
            #if DEBUG
            visitors.Insert(1, new DebugNodeVisitor());
            #endif

            var basic = new BasicVisitor(visitors.ToArray());

            basic.Visit(document);

            var result = new ValidationResult();
            result.Errors.AddRange(context.Errors);
            return result;
        }
开发者ID:mwatts,项目名称:graphql-dotnet,代码行数:34,代码来源:DocumentValidator.cs

示例10: DecorateClass

        public void DecorateClass(CodeTypeDeclaration typeDeclaration,
            ISchema schema,
            IDictionary<JsonSchema, SchemaImplementationDetails> implDetails,
            INestedClassProvider internalClassProvider)
        {
            typeDeclaration.ThrowIfNull("typeDeclaration");
            schema.ThrowIfNull("schema");
            implDetails.ThrowIfNull("implDetails");
            internalClassProvider.ThrowIfNull("internalClassProvider");

            JsonSchema details = schema.SchemaDetails;
            details.ThrowIfNull("schemaDetails");

            // Check if this decorator can be applied to the schema);
            if (details.Type != JsonSchemaType.Array)
            {
                return;
            }

            if (details.Items == null || details.Items.Count != 1)
            {
                logger.Warning("Found array scheme of unhandled type. {0}", details);
                return; // not supported
            }

            // Generate or find the nested type
            JsonSchema itemScheme = details.Items[0];
            SchemaImplementationDetails implDetail = implDetails[itemScheme];
            implDetail.ProposedName = "Entry"; // Change the name to a custom one.
            CodeTypeReference item = SchemaDecoratorUtil.GetCodeType(itemScheme, implDetail, internalClassProvider);

            // Insert the base type before any interface declaration
            var baseType = string.Format("List<{0}>", item.BaseType);
            typeDeclaration.BaseTypes.Insert(0, new CodeTypeReference(baseType));
        }
开发者ID:nick0816,项目名称:LoggenCSG,代码行数:35,代码来源:ArraySchemaDecorator.cs

示例11: Render

        public virtual string Render(ISchema schema, IColumn column)
        {
            string html = string.Format(EditorTemplate, column.Name,
                (string.IsNullOrEmpty(column.Label) ? column.Name : column.Label).RazorHtmlEncode(), RenderInput(column),
                string.IsNullOrEmpty(column.Tooltip) ? "" : string.Format(@"<a href=""javascript:;"" class=""tooltip-link"" title='{0}'></a>", (column.Tooltip).RazorHtmlEncode()));

            return html;
        }
开发者ID:Epitomy,项目名称:CMS,代码行数:8,代码来源:ControlBase.cs

示例12: ContainsTypeNames

 public void ContainsTypeNames(ISchema schema, params string[] typeNames)
 {
     typeNames.Apply(typeName =>
     {
         var type = schema.FindType(typeName);
         type.ShouldNotBeNull("Did not find {0} in type lookup.".ToFormat(typeName));
     });
 }
开发者ID:modulexcite,项目名称:graphql-dotnet,代码行数:8,代码来源:SchemaTests.cs

示例13: DecorateClass

 public void DecorateClass(CodeTypeDeclaration typeDeclaration,
                           ISchema schema,
                           IDictionary<JsonSchema, SchemaImplementationDetails> implDetails,
                           INestedClassProvider internalClassProvider)
 {
     schema.ThrowIfNull("schema");
     ImplementAdditionalProperties(typeDeclaration, schema.SchemaDetails, implDetails, internalClassProvider);
 }
开发者ID:jithuin,项目名称:infogeezer,代码行数:8,代码来源:AdditionalPropertiesSchemaDecorator.cs

示例14: Render

        public override string Render(ISchema schema, IColumn column)
        {
            string html = string.Format(CheckBoxTemplate, column.Name,
                 (string.IsNullOrEmpty(column.Label) ? column.Name : column.Label).RazorHtmlEncode(), RenderInput(column),
                 FormHelper.Tooltip(column.Tooltip));

            return html;
        }
开发者ID:kooboo-jifeng,项目名称:CMS,代码行数:8,代码来源:CheckBox.cs

示例15: CreateStream

 /// <summary>
 /// Attempts to interpret a TaggedGenericType instance as
 /// a specific type
 /// </summary>
 /// <param name="value">The value to interpet</param>
 /// <param name="schema">The type to interpret as</param>
 /// <param name="output">The output type</param>
 /// <returns>True if the interpretation succeeds, false otherwise</returns>
 public IValueStream CreateStream(GenericValue value, ISchema schema)
 {
     var tagged = (TaggedGenericValue)value;
     MemoryStream ms = new MemoryStream(tagged.tag, tagged.offset, tagged.end - tagged.offset);
     TagReader reader = new TagReader(ms);
     TagReaderStream stream = new TagReaderStream(reader, schema);
     return stream;
 }
开发者ID:LorenVS,项目名称:bacstack,代码行数:16,代码来源:TaggedValueProvider.cs


注:本文中的ISchema类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。