• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# FSpot.Tag类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中FSpot.Tag的典型用法代码示例。如果您正苦于以下问题:C# Tag类的具体用法?C# Tag怎么用?C# Tag使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Tag类属于FSpot命名空间,在下文中一共展示了Tag类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
		}
开发者ID:guadalinex-archive,项目名称:guadalinex-v6,代码行数:8,代码来源:PhotoChanges.cs


示例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);
         }
     }
 }
开发者ID:kanitw,项目名称:facespot,代码行数:13,代码来源:PeopleTreeStore.cs


示例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 ();
		}
开发者ID:guadalinex-archive,项目名称:guadalinex-v6,代码行数:13,代码来源:TagQueryWidget.cs


示例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;
        }
开发者ID:iainlane,项目名称:f-spot,代码行数:16,代码来源:SelectionDataExtensions.cs


示例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;
        }
开发者ID:kanitw,项目名称:facespot,代码行数:17,代码来源:Face.cs


示例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;
            }
        }
开发者ID:iainlane,项目名称:f-spot,代码行数:38,代码来源:TagQueryWidget.cs


示例7: HandleAttachTag

 private void HandleAttachTag(Tag tag, Term parent, Literal after)
 {
     InsertTerm (new Tag [] {tag}, parent, after);
 }
开发者ID:iainlane,项目名称:f-spot,代码行数:4,代码来源:TagQueryWidget.cs


示例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 ();
        }
开发者ID:iainlane,项目名称:f-spot,代码行数:31,代码来源:TagQueryWidget.cs


示例9: TagIncluded

 public bool TagIncluded(Tag tag)
 {
     return rootTerm.TagIncluded (tag);
 }
开发者ID:iainlane,项目名称:f-spot,代码行数:4,代码来源:TagQueryWidget.cs


示例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 ();
        }
开发者ID:iainlane,项目名称:f-spot,代码行数:15,代码来源:TagQueryWidget.cs


示例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);
        }
开发者ID:iainlane,项目名称:f-spot,代码行数:18,代码来源:TagQueryWidget.cs


示例12: UnRequire

 public void UnRequire(Tag [] tags)
 {
     logic_widget.UnRequire (tags);
 }
开发者ID:iainlane,项目名称:f-spot,代码行数:4,代码来源:QueryWidget.cs


示例13: UnInclude

 public void UnInclude(Tag [] tags)
 {
     logic_widget.UnInclude (tags);
 }
开发者ID:iainlane,项目名称:f-spot,代码行数:4,代码来源:QueryWidget.cs


示例14: TagRequired

 public bool TagRequired(Tag tag)
 {
     return logic_widget.TagRequired (tag);
 }
开发者ID:iainlane,项目名称:f-spot,代码行数:4,代码来源:QueryWidget.cs


示例15: TagIncluded

 public bool TagIncluded(Tag tag)
 {
     return logic_widget.TagIncluded (tag);
 }
开发者ID:iainlane,项目名称:f-spot,代码行数:4,代码来源:QueryWidget.cs


示例16: SetTagsData

        public static void SetTagsData(this SelectionData selection_data, Tag [] tags, Atom target)
        {
            byte [] data = new byte [tags.Length * sizeof (uint)];

            int i = 0;
            foreach (Tag tag in tags) {
                byte [] bytes = System.BitConverter.GetBytes (tag.Id);

                foreach (byte b in bytes) {
                    data[i] = b;
                    i++;
                }
            }

            selection_data.Set (target, 8, data, data.Length);
        }
开发者ID:nathansamson,项目名称:F-Spot-Album-Exporter,代码行数:16,代码来源:SelectionDataExtensions.cs


示例17: HandleTagSelected

 void HandleTagSelected(Tag t)
 {
     tag_button.Label = t.Name;
     Preferences.Set (SCREENSAVER_TAG, (int) t.Id);
 }
开发者ID:Yetangitu,项目名称:f-spot,代码行数:5,代码来源:ScreensaverConfig.cs


示例18: HandleTagMenuSelected

		private void HandleTagMenuSelected (Tag t) 
		{
			selected_tags = new Tag [] { t };
		}
开发者ID:guadalinex-archive,项目名称:guadalinex-v6,代码行数:4,代码来源:CameraFileSelectionDialog.cs


示例19: InsertTerm

        public ArrayList InsertTerm(Tag [] tags, Term parent, Literal after)
        {
            int position;
            if (after != null)
                position = WidgetPosition (after.Widget) + 1;
            else
                position = Children.Length - 1;

            ArrayList added = new ArrayList ();

            foreach (Tag tag in tags) {
                //Console.WriteLine ("Adding tag {0}", tag.Name);

                // Don't put a tag into a Term twice
                if (parent != Root && (parent.FindByTag (tag, true)).Count > 0)
                    continue;

                if (parent.Count > 0) {
                    Widget sep = parent.SeparatorWidget ();

                    InsertWidget (position, sep);
                    position++;
                }

                // Encapsulate new OR terms within a new AND term of which they are the
                // only member, so later other terms can be AND'd with them
                //
                // TODO should really see what type of term the parent is, and
                // encapsulate this term in a term of the opposite type. This will
                // allow the query system to be expanded to work for multiple levels much easier.
                if (parent == rootTerm) {
                    parent = new AndTerm (rootTerm, after);
                    after = null;
                }

                Literal term  = new Literal (parent, tag, after);
                term.TagsAdded  += HandleTagsAdded;
                term.LiteralsMoved += HandleLiteralsMoved;
                term.AttachTag  += HandleAttachTag;
                term.NegatedToggled += HandleNegated;
                term.Removing  += HandleRemoving;
                term.Removed  += HandleRemoved;
                term.RequireTag  += Require;
                term.UnRequireTag += UnRequire;

                added.Add (term);

                // Insert this widget into the appropriate place in the hbox
                InsertWidget (position, term.Widget);
            }

            UpdateQuery ();

            return added;
        }
开发者ID:iainlane,项目名称:f-spot,代码行数:55,代码来源:TagQueryWidget.cs


示例20: MergeTags

		void MergeTags (Tag tag_to_merge)
		{
			TagStore from_store = from_db.Tags;
			TagStore to_store = to_db.Tags;

			if (tag_to_merge != from_store.RootCategory) { //Do not merge RootCategory
				Tag dest_tag = to_store.GetTagByName (tag_to_merge.Name);
				if (dest_tag == null) {
					Category parent = (tag_to_merge.Category == from_store.RootCategory) ?
							to_store.RootCategory :
							to_store.GetTagByName (tag_to_merge.Category.Name) as Category;
					dest_tag = to_store.CreateTag (parent, tag_to_merge.Name);
					//FIXME: copy the tag icon and commit
				}
				tag_map [tag_to_merge.Id] = dest_tag;
			}

			if (!(tag_to_merge is Category))
				return;

			foreach (Tag t in (tag_to_merge as Category).Children)
				MergeTags (t);
		}
开发者ID:guadalinex-archive,项目名称:guadalinex-v6,代码行数:23,代码来源:MergeDb.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Facebook.FacebookClient类代码示例发布时间:2022-05-24
下一篇:
C# Framework.UIElement类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap