本文整理汇总了C#中TagInfo类的典型用法代码示例。如果您正苦于以下问题:C# TagInfo类的具体用法?C# TagInfo怎么用?C# TagInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TagInfo类属于命名空间,在下文中一共展示了TagInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Update
/// <summary>
/// 更新数据
/// </summary>
/// <param name="mod">TagInfo</param>
/// <returns>受影响行数</returns>
public int Update(TagInfo mod)
{
using (DbConnection conn = db.CreateConnection())
{
conn.Open();
using (DbTransaction tran = conn.BeginTransaction())
{
try
{
using (DbCommand cmd = db.GetStoredProcCommand("SP_Tag_Update"))
{
db.AddInParameter(cmd, "@TagID", DbType.Int32, mod.TagID);
db.AddInParameter(cmd, "@TagName", DbType.String, mod.TagName);
db.AddInParameter(cmd, "@State", DbType.Int32, mod.State);
db.AddInParameter(cmd, "@IsDeleted", DbType.Int32, mod.IsDeleted);
db.AddInParameter(cmd, "@Sort", DbType.Int32, mod.Sort);
tran.Commit();
return db.ExecuteNonQuery(cmd);
}
}
catch (Exception e)
{
tran.Rollback();
throw e;
}
finally
{
conn.Close();
}
}
}
}
示例2: AddRange
/// <summary>
/// Copies the elements of the specified <see cref="TagInfo">TagInfo</see> array to the end of the collection.
/// </summary>
/// <param name="value">An array of type <see cref="TagInfo">TagInfo</see> containing the Components to add to the collection.</param>
public void AddRange(TagInfo[] value)
{
for (int i = 0; (i < value.Length); i = (i + 1))
{
this.Add(value[i]);
}
}
示例3: MetadataImporter
TagInfo li_root_tag; // This is the Last Import root tag
public MetadataImporter ()
{
tag_store = App.Instance.Database.Tags;
tags_created = new Stack<Tag> ();
li_root_tag = new TagInfo (Catalog.GetString ("Imported Tags"), LastImportIcon);
}
示例4: UpdateTagsCollection
public void UpdateTagsCollection(string tagDisplayName, string tagValue, Dispatcher dispatcher)
{
bool tagFound = false;
dispatcher.Invoke(DispatcherPriority.Normal, new Action(delegate()
{
foreach (TagInfo summarySignal in _summaryStatusTags)
{
if (summarySignal.TagName.Equals(tagDisplayName))
{
int index = _summaryStatusTags.IndexOf(summarySignal);
_summaryStatusTags.RemoveAt(index);
summarySignal.TagName = tagDisplayName;
summarySignal.TagValue = tagValue;
_summaryStatusTags.Insert(index, summarySignal);
tagFound = true;
break;
}
}
if (!tagFound)
{
TagInfo summarySignal = new TagInfo();
summarySignal.TagValue = tagValue;
summarySignal.TagName = tagDisplayName;
_summaryStatusTags.Add(summarySignal);
}
}));
}
示例5: InsertTag
public int InsertTag(TagInfo tag)
{
CheckSlug(tag);
string cmdText =string.Format(@"insert into [{0}category]
(
[Type],[ParentId],[CateName],[Slug],[Description],[SortNum],[PostCount],[CreateTime]
)
values
(
@Type,@ParentId,@CateName,@Slug,@Description,@SortNum,@PostCount,@CreateTime
)", ConfigHelper.Tableprefix);
OleDbParameter[] prams = {
OleDbHelper.MakeInParam("@Type",OleDbType.Integer,1,(int)CategoryType.Tag),
OleDbHelper.MakeInParam("@ParentId",OleDbType.Integer,4,0),
OleDbHelper.MakeInParam("@CateName",OleDbType.VarWChar,255,tag.CateName),
OleDbHelper.MakeInParam("@Slug",OleDbType.VarWChar,255,tag.Slug),
OleDbHelper.MakeInParam("@Description",OleDbType.VarWChar,255,tag.Description),
OleDbHelper.MakeInParam("@SortNum",OleDbType.Integer,4,tag.SortNum),
OleDbHelper.MakeInParam("@PostCount",OleDbType.Integer,4,tag.PostCount),
OleDbHelper.MakeInParam("@CreateTime",OleDbType.Date,8,tag.CreateTime)
};
OleDbHelper.ExecuteScalar(CommandType.Text, cmdText, prams);
int newId = Convert.ToInt32(OleDbHelper.ExecuteScalar(string.Format("select top 1 [categoryid] from [{0}category] order by [categoryid] desc",ConfigHelper.Tableprefix)));
return newId;
}
示例6: GetTagInfo
public TagInfo GetTagInfo(string pathToAudioFile)
{
var tags = bassServiceProxy.GetTagsFromFile(pathToAudioFile);
if (tags == null)
{
return new TagInfo { IsEmpty = true };
}
int year;
int.TryParse(tags.year, out year);
TagInfo tagInfo = new TagInfo
{
Duration = tags.duration,
Album = tags.album,
Artist = tags.artist,
Title = tags.title,
AlbumArtist = tags.albumartist,
Genre = tags.genre,
Year = year,
Composer = tags.composer,
ISRC = tags.isrc
};
return tagInfo;
}
示例7: UpdateTagsCollection
public void UpdateTagsCollection(string tagDisplayName, string tagValue, Dispatcher dispatcher)
{
bool tagFound = false;
dispatcher.Invoke(DispatcherPriority.Normal, new Action(delegate()
{
foreach (TagInfo estop in _estopTags)
{
if (estop.TagName.Equals(tagDisplayName))
{
int index = _estopTags.IndexOf(estop);
_estopTags.RemoveAt(index);
estop.TagName = tagDisplayName;
estop.TagValue = tagValue;
_estopTags.Insert(index, estop);
tagFound = true;
break;
}
}
if (!tagFound)
{
TagInfo estop = new TagInfo();
estop.TagValue = tagValue;
estop.TagName = tagDisplayName;
_estopTags.Add(estop);
}
}));
}
示例8: InsertTag
public int InsertTag(TagInfo tag)
{
CheckSlug(tag);
string cmdText = @"insert into [loachs_terms]
(
[Type],[Name],[Slug],[Description],[Displayorder],[Count],[CreateDate]
)
values
(
@Type,@Name,@Slug,@Description,@Displayorder,@Count,@CreateDate
)";
SqliteParameter[] prams = {
SqliteDbHelper.MakeInParam("@Type",DbType.Int32,1,(int)TermType.Tag),
SqliteDbHelper.MakeInParam("@Name",DbType.String,255,tag.Name),
SqliteDbHelper.MakeInParam("@Slug",DbType.String,255,tag.Slug),
SqliteDbHelper.MakeInParam("@Description",DbType.String,255,tag.Description),
SqliteDbHelper.MakeInParam("@Displayorder",DbType.Int32,4,tag.Displayorder),
SqliteDbHelper.MakeInParam("@Count",DbType.Int32,4,tag.Count),
SqliteDbHelper.MakeInParam("@CreateDate",DbType.Date,8,tag.CreateDate)
};
SqliteDbHelper.ExecuteScalar(CommandType.Text, cmdText, prams);
int newId = Convert.ToInt32(SqliteDbHelper.ExecuteScalar("select [termid] from [loachs_terms] order by [termid] desc limit 1"));
return newId;
}
示例9: SerializeInternal
private void SerializeInternal(TagInfo model, IDictionary<string, object> result)
{
result.Add("tagid", model.TagID);
result.Add("tagname", model.TagName);
result.Add("state", model.State);
result.Add("isdeleted", model.IsDeleted);
result.Add("sort", model.Sort);
}
示例10: Delete
public int Delete(TagInfo tag)
{
string cmdText = string.Format("delete from [{0}category] where [categoryid] = @categoryid", ConfigHelper.Tableprefix);
using (var conn = new DapperHelper().OpenConnection())
{
return conn.Execute(cmdText, new { categoryid = tag.TagId });
}
}
示例11: XmpTagsImporter
public XmpTagsImporter(PhotoStore photo_store, TagStore tag_store)
{
this.tag_store = tag_store;
tags_created = new Stack<Tag> ();
li_root_tag = new TagInfo (Catalog.GetString ("Imported Tags"), LastImportIcon);
taginfo_table [(Entity)Location] = new TagInfo (Catalog.GetString ("Location"), PlacesIcon);
taginfo_table [(Entity)Country] = new TagInfo (Catalog.GetString ("Country"), PlacesIcon);
taginfo_table [(Entity)City] = new TagInfo (Catalog.GetString ("City"), PlacesIcon);
taginfo_table [(Entity)State] = new TagInfo (Catalog.GetString ("State"), PlacesIcon);
}
示例12: Init
public virtual void Init(Requirement r, Dictionary<string, object> meta)
{
Tag = new TagInfo { Req = r, Meta = meta };
Checked = meta.GetBoolFromMetadata(r.Name) ?? false;
Anchor = AnchorStyles.Left | AnchorStyles.Right;
AutoSize = false;
CheckedChanged += (a, b) =>
{
TagInfo m = (TagInfo)Tag;
m.Meta[m.Req.Name] = Checked;
};
}
示例13: Init
public virtual void Init(Requirement r, Dictionary<string, object> meta)
{
Tag = new TagInfo {Req = r, Meta = meta};
Text = meta.GetStringFromMetadata(r.Name) ?? string.Empty;
Anchor = AnchorStyles.Left | AnchorStyles.Right;
AutoSize = false;
TextChanged += (a, b) =>
{
TagInfo m = (TagInfo) Tag;
m.Meta[r.Name] = Text;
};
}
示例14: Init
public virtual void Init(Requirement r, Dictionary<string, object> meta)
{
Minimum = 0;
Maximum = int.MaxValue;
Tag = new TagInfo { Req = r, Meta = meta };
Value = (meta.GetIntFromMetadata(r.Name) ?? 0);
Anchor = AnchorStyles.Left | AnchorStyles.Right;
AutoSize = false;
ValueChanged += (a, b) =>
{
TagInfo m = (TagInfo)Tag;
m.Meta[r.Name] = (int)Value;
};
}
示例15: SaveData
/// <summary>
/// ajax保存
/// </summary>
protected void SaveData(string act)
{
TagInfo tag = new TagInfo();
if (act == "update")
{
tag = TagService.GetTag(PressRequest.GetFormInt("hidTagId", 0));
}
else
{
tag.CreateTime = DateTime.Now;
tag.PostCount = 0;
}
tag.CateName = HttpHelper.HtmlEncode(txtName.Text);
tag.Slug = StringHelper.FilterSlug(tag.CateName, "tag");
tag.Description = HttpHelper.HtmlEncode(txtDescription.Text);
tag.SortNum = TypeConverter.StrToInt(txtDisplayOrder.Text, 1000);
if (tag.CateName == "")
{
return;
}
Dictionary<string, string> jsondic = new Dictionary<string, string>();
jsondic.Add("CateName", tag.CateName);
jsondic.Add("Url", tag.Url);
jsondic.Add("SortNum", tag.SortNum.ToString());
jsondic.Add("Description", tag.Description);
if (act == "update")//更新操作
{
jsondic.Add("Slug", tag.Slug);
jsondic.Add("PostCount", tag.PostCount.ToString());
jsondic.Add("CreateTime", tag.CreateTime.ToShortDateString());
jsondic.Add("TagId", tag.TagId.ToString());
TagService.UpdateTag(tag);
Response.Write(JsonHelper.DictionaryToJson(jsondic));
}
else//添加操作
{
int tagid = TagService.InsertTag(tag);
jsondic.Add("TagId", tagid.ToString());
jsondic.Add("PostCount", "0");
jsondic.Add("CreateTime", DateTime.Now.ToShortDateString());
Response.Write(JsonHelper.DictionaryToJson(jsondic));
}
Response.End();
}