本文整理汇总了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);
}
示例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();
}