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


C# TagMode.ToString方法代码示例

本文整理汇总了C#中TagMode.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# TagMode.ToString方法的具体用法?C# TagMode.ToString怎么用?C# TagMode.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TagMode的用法示例。


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

示例1: PlacesPlacesForTags

 public PlaceCollection PlacesPlacesForTags(PlaceType placeTypeId, string woeId, string placeId, int? threshold, IEnumerable<string> tags, TagMode tagMode, IEnumerable<string> machineTags, MachineTagMode machineTagMode, DateTime? minUploadDate, DateTime? maxUploadDate, DateTime? minTakenDate, DateTime? maxTakenDate)
 {
     var dictionary = new Dictionary<string, string>();
     dictionary.Add("method", "flickr.places.placesForTags");
     if (placeTypeId != PlaceType.None) dictionary.Add("place_type_id", placeTypeId.ToString().ToLower());
     if (woeId != null) dictionary.Add("woe_id", woeId);
     if (placeId != null) dictionary.Add("place_id", placeId);
     if (threshold != null) dictionary.Add("threshold", threshold.ToString().ToLower());
     if (tags != null) dictionary.Add("tags", tags == null ? String.Empty : String.Join(",", tags.ToArray()));
     if (tagMode != TagMode.None) dictionary.Add("tag_mode", tagMode.ToString().ToLower());
     if (machineTags != null) dictionary.Add("machine_tags", machineTags == null ? String.Empty : String.Join(",", machineTags.ToArray()));
     if (machineTagMode != MachineTagMode.None) dictionary.Add("machine_tag_mode", machineTagMode.ToString().ToLower());
     if (minUploadDate != null) dictionary.Add("min_upload_date", minUploadDate.Value.ToUnixTimestamp());
     if (maxUploadDate != null) dictionary.Add("max_upload_date", maxUploadDate.Value.ToUnixTimestamp());
     if (minTakenDate != null) dictionary.Add("min_taken_date", minTakenDate.Value.ToUnixTimestamp());
     if (maxTakenDate != null) dictionary.Add("max_taken_date", maxTakenDate.Value.ToUnixTimestamp());
     return GetResponse<PlaceCollection>(dictionary);
 }
开发者ID:JamieKitson,项目名称:flickrnet-experimental,代码行数:18,代码来源:FlickrNetSync.cs

示例2: RenderBeginTagHelperScope

        private void RenderBeginTagHelperScope(string tagName, TagMode tagMode, IList<Chunk> children)
        {
            // Scopes/execution contexts are a runtime feature.
            if (_designTimeMode)
            {
                // Render all of the tag helper children inline for IntelliSense.
                _bodyVisitor.Accept(children);
                return;
            }

            // Call into the tag helper scope manager to start a new tag helper scope.
            // Also capture the value as the current execution context.
            _writer
                .WriteStartAssignment(ExecutionContextVariableName)
                .WriteStartInstanceMethodInvocation(
                    ScopeManagerVariableName,
                    _tagHelperContext.ScopeManagerBeginMethodName);

            // Assign a unique ID for this instance of the source HTML tag. This must be unique
            // per call site, e.g. if the tag is on the view twice, there should be two IDs.
            _writer.WriteStringLiteral(tagName)
                   .WriteParameterSeparator()
                   .Write("global::")
                   .Write(typeof(TagMode).FullName)
                   .Write(".")
                   .Write(tagMode.ToString())
                   .WriteParameterSeparator()
                   .WriteStringLiteral(GenerateUniqueId())
                   .WriteParameterSeparator();

            // We remove the target writer so TagHelper authors can retrieve content.
            var oldWriter = _context.TargetWriterName;
            _context.TargetWriterName = null;

            using (_writer.BuildAsyncLambda(endLine: false))
            {
                // Render all of the tag helper children.
                _bodyVisitor.Accept(children);
            }

            _context.TargetWriterName = oldWriter;

            _writer.WriteEndMethodInvocation();
        }
开发者ID:cjqian,项目名称:Razor,代码行数:44,代码来源:CSharpTagHelperCodeRenderer.cs


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