本文整理汇总了C#中ITag类的典型用法代码示例。如果您正苦于以下问题:C# ITag类的具体用法?C# ITag怎么用?C# ITag使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ITag类属于命名空间,在下文中一共展示了ITag类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TagValue
public TagValue(ITag tag, object value)
{
if (tag == null) throw new ArgumentNullException("tag");
Tag = tag;
Value = value;
}
示例2: IsEditTag
public override bool IsEditTag(ITag tag)
{
// Cache the FieldInfo/PropertyInfo since we will be using it a lot
if (AttributeIdFieldInfo == null)
{
Type type = tag.GetType();
AttributeIdFieldInfo = type.GetField("myAttributeId", BindingFlags.Instance | BindingFlags.NonPublic);
}
if (AttributeIdFieldInfo == null)
{
return false;
}
var value = AttributeIdFieldInfo.GetValue(tag) as string;
if (value == null)
{
return false;
}
switch (value)
{
case ExternalEditAttribute1:
case ExternalEditAttribute2:
case ExternalEditAttribute3:
return true;
default:
return false;
}
}
示例3: GuardPresenceOfCategoriesOnTag
private void GuardPresenceOfCategoriesOnTag(ITag tag)
{
Type tagType = tag.GetType();
object[] categories = tagType.GetCustomAttributes(typeof(CategoryAttribute), true);
Assert.That(categories.Length, Is.EqualTo(1));
Console.WriteLine(((CategoryAttribute) categories[0]).Category);
}
示例4: Validate
public void Validate(ITag tag)
{
foreach (var validator in _validators)
{
validator?.Validate(tag);
}
}
示例5: Photo
public Photo(FileInfo file, ITag parent)
{
this.file = file;
this.parent = parent;
this.id = CryptoUtil.Md5Encode(file.FullName);
metaReader = JpegMetadataReader.RetreiveFromFile(file.FullName);
}
示例6: VisitTag
/// <summary>
///
/// </summary>
/// <param name="tag"></param>
public override void VisitTag(ITag tag)
{
if (IsPreTag(tag))
{
preTagBeingProcessed = true;
}
}
示例7: TagViewModel
public TagViewModel(ITag tag)
{
if (tag == null)
throw new ArgumentNullException("tag");
this.tag = tag;
}
示例8: Write
public override void Write(ITag value, NbtOptions options)
{
if (options.HasFlag(NbtOptions.Header) && value.Type != TagType.End)
this.WriteHeader(value);
switch (value.Type)
{
case TagType.End:
this.WriteEnd();
break;
case TagType.Byte:
this.Write((byte)value.Value);
break;
case TagType.Short:
this.Write((short)value.Value);
break;
case TagType.Int:
this.Write((int)value.Value);
break;
case TagType.Long:
this.Write((long)value.Value);
break;
case TagType.Float:
this.Write((float)value.Value);
break;
case TagType.Double:
this.Write((double)value.Value);
break;
case TagType.ByteArray:
this.Write((byte[])value.Value);
break;
case TagType.String:
this.Write((string)value.Value);
break;
case TagType.List:
this.Write((TagCollection)value.Value);
break;
case TagType.Compound:
this.Write((TagDictionary)value.Value);
break;
case TagType.IntArray:
this.Write((int[])value.Value);
break;
default:
throw new ArgumentException("Unrecognized or unsupported tag type.", "value");
}
}
示例9: SaveCommit
public void SaveCommit( ITag tag, out bool success )
{
using ( IUnitOfWork u = UnitOfWork.Begin() ) {
Save( tag, out success );
if ( success )
u.Commit();
}
}
示例10: ToPostEntity
public static PostEntity ToPostEntity(this PostViewModel postViewModel, ITag tagRepository)
{
var postEntity = postViewModel.Post;
postEntity.Categories = GetSelectedCategories(postViewModel.Categories);
if (!string.IsNullOrEmpty(postViewModel.Tags))
postEntity.Tags = GetSelectedTags(postViewModel.Tags, tagRepository);
return postEntity;
}
示例11: BasicFilter
public BasicFilter(string name, ITag tag, IOperator filterOperator, string criteria)
: base(name)
{
_tag = tag;
_operator = filterOperator;
_tag.attachObserver(this);
this._criteria = criteria;
}
示例12: FourthGenResourceLayoutTable
public FourthGenResourceLayoutTable(ITag playTag, FileSegmentGroup metaArea, MetaAllocator allocator,
EngineDescription buildInfo)
{
_tag = playTag;
_metaArea = metaArea;
_allocator = allocator;
_buildInfo = buildInfo;
}
示例13: Post
public Post(IUser userRepository, ICategory categoryRepository, ITag tagRepository, IComment commentRepository)
{
_postsTable = context.GetTable<PostEntity>();
_commentRepository = commentRepository;
_tagRepository = tagRepository;
_categoryRepository = categoryRepository;
_userRepository = userRepository;
}
示例14: EditBasicFilter
internal EditBasicFilter(BasicFilter target, string newName, ITag newTag, IOperator newOperator, string newCriteria)
{
_newName = newName;
_newTag = newTag;
_newCriteria = newCriteria;
_target = target;
_newOperator = newOperator;
}
示例15: CreativeController
public CreativeController(ITag tag, ICreative creative, IChapter chapter, IUser user, ILike like)
{
this.tagRepository = tag;
this.creativeRepository = creative;
this.chapterRepository = chapter;
this.userRepository = user;
this.likeRepository = like;
}