本文整理汇总了C#中FSpot.Tag类的典型用法代码示例。如果您正苦于以下问题:C# Tag类的具体用法?C# Tag怎么用?C# Tag使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Tag类属于FSpot命名空间,在下文中一共展示了Tag类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RemoveTag
public void RemoveTag (Tag t)
{
if (tags_removed == null)
tags_removed = new List<Tag> ();
if (tags_added != null)
tags_added.Remove (t);
tags_removed.Add (t);
}
示例2: PopulatePeopleCategories
void PopulatePeopleCategories(TreeStore treeStore ,Tag parent,TreeIter parentIter,int level)
{
foreach (Tag tag in (parent as Category).Children) {
if (tag is Category) {
//Log.Debug("Append : "+tag.Name + " to "+parent.Name);
TreeIter iter =
(parentIter.Equals(TreeIter.Zero) ?
treeStore.AppendValues(tag.Name,/*parent,*/tag):
treeStore.AppendValues(parentIter,tag.Name,/*parent,*/tag)) ;
PopulatePeopleCategories (treeStore,tag,iter,level+1);
}
}
}
示例3: Create
public static void Create (Tag [] tags, Gtk.Menu menu)
{
Gtk.MenuItem item = new Gtk.MenuItem (String.Format (Catalog.GetPluralString ("Find _With", "Find _With", tags.Length), tags.Length));
Gtk.Menu submenu = GetSubmenu (tags);
if (submenu == null)
item.Sensitive = false;
else
item.Submenu = submenu;
menu.Append (item);
item.Show ();
}
示例4: GetTagsData
public static Tag[] GetTagsData(this SelectionData selection_data)
{
int size = sizeof (uint);
int length = selection_data.Length / size;
TagStore tag_store = MainWindow.Toplevel.Database.Tags;
Tag [] tags = new Tag [length];
for (int i = 0; i < length; i ++) {
uint id = System.BitConverter.ToUInt32 (selection_data.Data, i * size);
tags[i] = tag_store.Get (id);
}
return tags;
}
示例5: Face
public Face(uint id,uint leftX,uint topY,uint width,Photo photo,
Tag tag,bool tagConfirmed, bool autoDetected, bool autoRecognized, Pixbuf icon,long unix_time)
: base(id)
{
this.leftX = leftX;
this.topY = topY;
this.width = width;
this.photo = photo;
this.tag = tag;
this.tagConfirmed = tagConfirmed;
this.autoDetected = autoDetected;
this.autoRecognized = autoRecognized;
this.iconPixbuf = icon;
this.unix_time = unix_time;
//FIXME Possible Error HERE
photo_md5 = photo.MD5Sum;
}
示例6: GetSubmenu
public static Gtk.Menu GetSubmenu(Tag [] tags)
{
Tag single_tag = null;
if (tags != null && tags.Length == 1)
single_tag = tags[0];
//Console.WriteLine ("creating find with menu item");
if (LogicWidget.Root == null || LogicWidget.Root.SubTerms.Count == 0) {
//Console.WriteLine ("root is null or has no terms");
return null;
} else {
//Console.WriteLine ("root is not null and has terms");
Gtk.Menu m = new Gtk.Menu ();
Gtk.MenuItem all_item = GtkUtil.MakeMenuItem (m, Catalog.GetString ("All"), new EventHandler (MainWindow.Toplevel.HandleRequireTag));
GtkUtil.MakeMenuSeparator (m);
int sensitive_items = 0;
foreach (Term term in LogicWidget.Root.SubTerms) {
ArrayList term_parts = new ArrayList ();
bool contains_tag = AppendTerm (term_parts, term, single_tag);
string name = "_" + String.Join (", ", (string []) term_parts.ToArray (typeof(string)));
Gtk.MenuItem item = GtkUtil.MakeMenuItem (m, name, new EventHandler (MainWindow.Toplevel.HandleAddTagToTerm));
item.Sensitive = !contains_tag;
if (!contains_tag)
sensitive_items++;
}
if (sensitive_items == 0)
all_item.Sensitive = false;
return m;
}
}
示例7: HandleAttachTag
private void HandleAttachTag(Tag tag, Term parent, Literal after)
{
InsertTerm (new Tag [] {tag}, parent, after);
}
示例8: UnInclude
public void UnInclude(Tag [] tags)
{
ArrayList new_tags = new ArrayList(tags.Length);
foreach (Tag tag in tags) {
if (rootTerm.TagIncluded (tag))
new_tags.Add (tag);
}
if (new_tags.Count == 0)
return;
tags = (Tag []) new_tags.ToArray (typeof (Tag));
bool needsUpdate = false;
preventUpdate = true;
foreach (Term parent in rootTerm.LiteralParents ()) {
if (parent.Count == 1) {
foreach (Tag tag in tags) {
if ((parent.Last as Literal).Tag == tag) {
(parent.Last as Literal).RemoveSelf ();
needsUpdate = true;
break;
}
}
}
}
preventUpdate = false;
if (needsUpdate)
UpdateQuery ();
}
示例9: TagIncluded
public bool TagIncluded(Tag tag)
{
return rootTerm.TagIncluded (tag);
}
示例10: PhotoTagsChanged
/** Helper Functions **/
public void PhotoTagsChanged(Tag [] tags)
{
bool refresh_required = false;
foreach (Tag tag in tags) {
if ((rootTerm.FindByTag (tag)).Count > 0) {
refresh_required = true;
break;
}
}
if (refresh_required)
UpdateQuery ();
}
示例11: Include
// Add a tag or group of tags to the rootTerm, at the end of the Box
public void Include(Tag [] tags)
{
// Filter out any tags that are already included
ArrayList new_tags = new ArrayList(tags.Length);
foreach (Tag tag in tags) {
if (! rootTerm.TagIncluded (tag))
new_tags.Add (tag);
}
if (new_tags.Count == 0)
return;
tags = (Tag []) new_tags.ToArray (typeof (Tag));
InsertTerm (tags, rootTerm, null);
}
示例12: UnRequire
public void UnRequire(Tag [] tags)
{
logic_widget.UnRequire (tags);
}
示例13: UnInclude
public void UnInclude(Tag [] tags)
{
logic_widget.UnInclude (tags);
}
示例14: TagRequired
public bool TagRequired(Tag tag)
{
return logic_widget.TagRequired (tag);
}
示例15: TagIncluded
public bool TagIncluded(Tag tag)
{
return logic_widget.TagIncluded (tag);
}