• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# ISchema类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: Format

 internal string Format(ISchema schema, Table table)
 {
     return this.Format(new ExpressionContext()
                            {
                                Schema = schema, 
                                Table = table
                            });
 }
开发者ID:khoale,项目名称:Simple.OData.Client,代码行数:8,代码来源:ODataExpression.Format.cs


示例17: SchemaPrinter

        public SchemaPrinter(ISchema schema, IEnumerable<string> customScalars = null)
        {
            _schemaReference = new WeakReference<ISchema>(schema);

            if (customScalars != null)
            {
                _scalars.Fill(customScalars);
            }
        }
开发者ID:kthompson,项目名称:graphql-dotnet,代码行数:9,代码来源:SchemaPrinter.cs


示例18: UserImpl

 public UserImpl(ISchema schema, UserModel model)
 {
     Schema = schema;
     Login = model.Login;
     Name = model.Name;
     Email = model.Email;
     Active = model.Active;
     PasswordHash = model.PasswordHash;
 }
开发者ID:christal1980,项目名称:wingsoa,代码行数:9,代码来源:UserImpl.cs


示例19: Execute

 public async Task<ExecutionResult> Execute(
   ISchema schema,
   object rootObject,
   string query,
   string operationName = null,
   Inputs inputs = null)
 {
     return await _executer.ExecuteAsync(schema, rootObject, query, operationName);
 }
开发者ID:modulexcite,项目名称:graphql-dotnet,代码行数:9,代码来源:GraphQLController.cs


示例20: Generate

        public string Generate(ISchema schema)
        {
            StringBuilder sb = new StringBuilder(string.Format(@"
            @using Kooboo.CMS.Content.Models;
            @using Kooboo.CMS.Content.Query;
            @if(Model==null)
            {{
            @(""The content was deleted."".Localize())
            }}
            else
            {{
            var schema = (Kooboo.CMS.Content.Models.Schema)ViewData[""Schema""];
            var allowedEdit = (bool)ViewData[""AllowedEdit""];
            var allowedView = (bool)ViewData[""AllowedView""];
            var workflowItem  = Model._WorkflowItem_;
            var hasWorkflowItem = workflowItem!=null;
            var availableEdit = hasWorkflowItem || (!hasWorkflowItem && allowedEdit);

            using(Html.BeginForm(ViewContext.RequestContext.AllRouteValues()[""action""].ToString()
            , ViewContext.RequestContext.AllRouteValues()[""controller""].ToString()
            , ViewContext.RequestContext.AllRouteValues()
            , FormMethod.Post, new RouteValueDictionary(new {{ enctype = ""{0}"" }})))
            {{
            <div class=""common-form"">
            <fieldset>
            <table>",
                    FormHelper.Enctype(schema)));

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

            sb.Append(@"
            @Html.Action(""Categories"", ViewContext.RequestContext.AllRouteValues())
            </table>
            </fieldset>
             <p class=""buttons"">
            @if(availableEdit){
               <button type=""submit"">@(""Save"".Localize())</button>
            if(Model.IsLocalized !=null && Model.IsLocalized == false){<button type=""submit"" name=""Localize"" value=""true"">Localize</button>}
            <a href=""javascript:;"" class=""dialog-close button"">@(""Close"".Localize())</a>
            }
            else
            {
            <a href=""javascript:;"" class=""dialog-close button"">@(""Close"".Localize())</a>
            <a href=""@Url.Action(""WorkflowHistory"",""PendingWorkflow"",ViewContext.RequestContext.AllRouteValues().Merge(""UserKey"", (object)(Model.UserKey)).Merge(""UUID"",(object)(Model.UUID)))"" title=""@(""View workflow history"".Localize())"" class=""button  dialog-link"">@(""View workflow history"".Localize())</a>
            <a href=""javascript:;"" class=""tooltip-link"" title=""@(""The content is approving or you have not permission to publish."".Localize())""></a>
            }

             </p>
               </div>
              }
            }");
            return sb.ToString();
        }
开发者ID:Epitomy,项目名称:CMS,代码行数:56,代码来源:UpdateForm.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ISchemaBase类代码示例发布时间:2022-05-24
下一篇:
C# ISchedulingContext类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap