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

C# IBrowsableCollection类代码示例

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

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



IBrowsableCollection类属于命名空间,在下文中一共展示了IBrowsableCollection类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Changed

		private void Changed (IBrowsableCollection query)
		{
			this.ClearMarks ();
			foreach (IBrowsableItem item in query.Items) {
				MarkDay ((uint)item.Time.Day);
			}
		}
开发者ID:guadalinex-archive,项目名称:guadalinex-v6,代码行数:7,代码来源:SimpleCalendar.cs


示例2: Run

		public void Run (IBrowsableCollection selection)
		{
			this.selection = selection;

			// Calculate the total size
			long total_size = 0;
			string path;
			System.IO.FileInfo file_info;

			foreach (IBrowsableItem item in selection.Items) {
				path = item.DefaultVersionUri.LocalPath;
				if (System.IO.File.Exists (path)) {
					file_info = new System.IO.FileInfo (path);
					total_size += file_info.Length;
				}
			}

			IconView view = new IconView (selection);
			view.DisplayDates = false;
			view.DisplayTags = false;

			Dialog.Modal = false;
			Dialog.TransientFor = null;
			
			size_label.Text = SizeUtil.ToHumanReadable (total_size);

			thumb_scrolledwindow.Add (view);
			Dialog.ShowAll ();

			//LoadHistory ();

			Dialog.Response += HandleResponse;
		}
开发者ID:AminBonyadUni,项目名称:facedetect-f-spot,代码行数:33,代码来源:CDExport.cs


示例3: Run

        public void Run(IBrowsableCollection selection)
        {
            dialog = new FacebookExportDialog (selection);

            if (selection.Items.Length > max_photos_per_album) {
                HigMessageDialog mbox = new HigMessageDialog (dialog,
                        Gtk.DialogFlags.DestroyWithParent | Gtk.DialogFlags.Modal, Gtk.MessageType.Error,
                        Gtk.ButtonsType.Ok, Catalog.GetString ("Too many images to export"),
                        String.Format (Catalog.GetString ("Facebook only permits {0} photographs per album.  Please refine your selection and try again."), max_photos_per_album));
                mbox.Run ();
                mbox.Destroy ();
                return;
            }

            if (dialog.Run () != (int)ResponseType.Ok) {
                dialog.Destroy ();
                return;
            }

            if (dialog.CreateAlbum) {
                string name = dialog.AlbumName;
                if (String.IsNullOrEmpty (name)) {
                    HigMessageDialog mbox = new HigMessageDialog (dialog, Gtk.DialogFlags.DestroyWithParent | Gtk.DialogFlags.Modal,
                            Gtk.MessageType.Error, Gtk.ButtonsType.Ok, Catalog.GetString ("Album must have a name"),
                            Catalog.GetString ("Please name your album or choose an existing album."));
                    mbox.Run ();
                    mbox.Destroy ();
                    return;
                }

                string description = dialog.AlbumDescription;
                string location = dialog.AlbumLocation;

                try {
                    album = dialog.Account.Facebook.CreateAlbum (name, description, location);
                }
                catch (FacebookException fe) {
                    HigMessageDialog mbox = new HigMessageDialog (dialog, Gtk.DialogFlags.DestroyWithParent | Gtk.DialogFlags.Modal,
                            Gtk.MessageType.Error, Gtk.ButtonsType.Ok, Catalog.GetString ("Creating a new album failed"),
                            String.Format (Catalog.GetString ("An error occurred creating a new album.\n\n{0}"), fe.Message));
                    mbox.Run ();
                    mbox.Destroy ();
                    return;
                }
            } else {
                album = dialog.ActiveAlbum;
            }

            if (dialog.Account != null) {
                dialog.Hide ();

                command_thread = new System.Threading.Thread (new System.Threading.ThreadStart (Upload));
                command_thread.Name = Mono.Unix.Catalog.GetString ("Uploading Pictures");

                progress_dialog = new ThreadProgressDialog (command_thread, selection.Items.Length);
                progress_dialog.Start ();
            }

            dialog.Destroy ();
        }
开发者ID:Yetangitu,项目名称:f-spot,代码行数:60,代码来源:FacebookExport.cs


示例4: CDExportDialog

        public CDExportDialog(IBrowsableCollection collection, System.Uri dest)
            : base(Assembly.GetExecutingAssembly (), "CDExport.ui", "cd_export_dialog")
        {
            this.dest = dest;

            // Calculate the total size
            long total_size = 0;
            string path;
            System.IO.FileInfo file_info;

            foreach (IPhoto item in collection.Items) {
                path = item.DefaultVersion.Uri.LocalPath;
                if (System.IO.File.Exists (path)) {
                    file_info = new System.IO.FileInfo (path);
                    total_size += file_info.Length;
                }
            }

            var view = new TrayView (collection);
            view.DisplayDates = false;
            view.DisplayTags = false;
            view.DisplayRatings = false;

            this.Modal = false;
            this.TransientFor = null;

            size_label.Text = Format.SizeForDisplay (total_size);

            thumb_scrolledwindow.Add (view);
            this.ShowAll ();

            previous_frame.Visible = !IsDestEmpty (dest);

            browse_button.Clicked += HandleBrowseExisting;
        }
开发者ID:Yetangitu,项目名称:f-spot,代码行数:35,代码来源:CDExportDialog.cs


示例5: Run

        public void Run(IBrowsableCollection selection)
        {
            dialog = new FacebookExportDialog (selection);

            if (selection.Items.Length > max_photos_per_album) {
                HigMessageDialog mbox = new HigMessageDialog (dialog,
                        Gtk.DialogFlags.DestroyWithParent | Gtk.DialogFlags.Modal, Gtk.MessageType.Error,
                        Gtk.ButtonsType.Ok, Catalog.GetString ("Too many images to export"),
                        String.Format (Catalog.GetString ("Facebook only permits {0} photographs per album.  Please refine your selection and try again."), max_photos_per_album));
                mbox.Run ();
                mbox.Destroy ();
                return;
            }

            if (dialog.Run () != (int)ResponseType.Ok) {
                dialog.Destroy ();
                return;
            }

            if (dialog.Account != null) {
                dialog.Hide ();

                command_thread = new System.Threading.Thread (new System.Threading.ThreadStart (Upload));
                command_thread.Name = Mono.Unix.Catalog.GetString ("Uploading Pictures");

                progress_dialog = new ThreadProgressDialog (command_thread, selection.Items.Length);
                progress_dialog.Start ();
            }

            dialog.Destroy ();
        }
开发者ID:iainlane,项目名称:f-spot,代码行数:31,代码来源:FacebookExport.cs


示例6: SelectionCollection

 public SelectionCollection(IBrowsableCollection collection)
 {
     this.selected_cells = new Dictionary<IPhoto, int> ();
     this.parent = collection;
     this.bit_array = new BitArray (this.parent.Count);
     this.parent.Changed += HandleParentChanged;
     this.parent.ItemsChanged += HandleParentItemsChanged;
 }
开发者ID:GNOME,项目名称:f-spot,代码行数:8,代码来源:SelectionCollection.cs


示例7: OriginalGallery

 public OriginalGallery(IBrowsableCollection selection, string path, string name)
     : base(selection, path, name)
 {
     requests = new ScaleRequest [] { new ScaleRequest ("hq", 0, 0, false),
                      new ScaleRequest ("mq", 800, 600, true),
                      new ScaleRequest ("lq", 640, 480, false, true),
                      new ScaleRequest ("thumbs", 120, 120, false) };
 }
开发者ID:Yetangitu,项目名称:f-spot,代码行数:8,代码来源:OriginalGallery.cs


示例8: BrowsablePointer

		public BrowsablePointer (IBrowsableCollection collection, int index)
		{
			this.collection = collection;
			this.Index = index;
			item = Current;

			collection.Changed += HandleCollectionChanged;
			collection.ItemsChanged += HandleCollectionItemsChanged;
		}
开发者ID:guadalinex-archive,项目名称:guadalinex-v6,代码行数:9,代码来源:BrowsablePointer.cs


示例9: MailImages

		public MailImages (IBrowsableCollection collection)
		{
			message = new MailMessage ();
			message.From = "[email protected]";
			message.To = "[email protected]";
			message.Subject = "test";

			EsmtpMail mail = new EsmtpMail ("smtp.gmail.com", "lewing", "ricedream");
			mail.Send (message)
		}
开发者ID:AminBonyadUni,项目名称:facedetect-f-spot,代码行数:10,代码来源:MailDialog.cs


示例10: RepairDialog

		public RepairDialog (IBrowsableCollection collection) : base ("RepairDialog.ui", "repair_dialog")
		{
			source = collection;
			missing = new PhotoList ();

			FindMissing ();
			TrayView view = new TrayView (missing);
			view_scrolled.Add (view);

			this.ShowAll ();
		}
开发者ID:Yetangitu,项目名称:f-spot,代码行数:11,代码来源:RepairDialog.cs


示例11: BrowsablePointer

        public BrowsablePointer(IBrowsableCollection collection, int index)
        {
            if (collection == null)
                throw new ArgumentNullException ("collection");

            this.collection = collection;
            Index = index;
            item = Current;

            collection.Changed += HandleCollectionChanged;
            collection.ItemsChanged += HandleCollectionItemsChanged;
        }
开发者ID:Yetangitu,项目名称:f-spot,代码行数:12,代码来源:BrowsablePointer.cs


示例12: Run

		public void Run (IBrowsableCollection p) {
			Console.WriteLine ("Executing ZipExport extension");
			if (p.Count == 0) {
				HigMessageDialog md = new HigMessageDialog (MainWindow.Toplevel.Window, DialogFlags.DestroyWithParent,
							  Gtk.MessageType.Error, ButtonsType.Ok,
							  Catalog.GetString ("No selection available"),
							  Catalog.GetString ("This tool requires an active selection. Please select one or more pictures and try again"));

				md.Run ();
				md.Destroy ();
				return;
			}
			photos = p.Items;
			ShowDialog ();
		}
开发者ID:guadalinex-archive,项目名称:guadalinex-v6,代码行数:15,代码来源:ZipExport.cs


示例13: FolderGallery

        internal FolderGallery(IBrowsableCollection selection, string path, string gallery_name)
        {
            if (null == selection)
                throw new ArgumentNullException ("selection");

            if (0 == selection.Count)
                throw new ArgumentException ("selection can't be empty");

            if (null == path)
                throw new ArgumentNullException ("path");

            if (null == gallery_name)
                throw new ArgumentNullException ("gallery_name");

            Collection = selection;
            GalleryName = gallery_name;
            GalleryPath = Path.Combine (path, GalleryName);
            this.requests = new ScaleRequest [] { ScaleRequest.Default };
        }
开发者ID:GNOME,项目名称:f-spot,代码行数:19,代码来源:FolderGallery.cs


示例14: AdjustTimeDialog

        public AdjustTimeDialog(Db db, IBrowsableCollection collection)
            : base("AdjustTimeDialog.ui", "time_dialog")
        {
            this.db = db;
            this.collection = collection;

            tray = new TrayView (collection);
            tray_scrolled.Add (tray);
            tray.Selection.Changed += HandleSelectionChanged;

            view = new PhotoImageView (collection);
            view_scrolled.Add (view);
            Item = view.Item;
            Item.Changed += HandleItemChanged;
            Item.MoveFirst ();

            //forward_button.Clicked += HandleForwardClicked;
            //back_button.Clicked += HandleBackClicked;
            ok_button.Clicked += HandleOkClicked;
            cancel_button.Clicked += HandleCancelClicked;

            photo_spin.ValueChanged += HandleSpinChanged;
            photo_spin.SetIncrements (1.0, 1.0);
            photo_spin.Adjustment.StepIncrement = 1.0;
            photo_spin.Wrap = true;

            date_edit.TimeChanged += HandleTimeChanged;
            date_edit.DateChanged += HandleTimeChanged;
            Gtk.Entry entry = (Gtk.Entry) date_edit.Children [0];
            entry.Changed += HandleTimeChanged;
            entry = (Gtk.Entry) date_edit.Children [2];
            entry.Changed += HandleTimeChanged;
            offset_entry.Changed += HandleOffsetChanged;
            ShowAll ();
            HandleCollectionChanged (collection);

            spacing_entry.Changed += HandleSpacingChanged;
            spacing_entry.Sensitive = ! difference_check.Active;

            difference_check.Toggled += HandleActionToggled;
        }
开发者ID:iainlane,项目名称:f-spot,代码行数:41,代码来源:AdjustTimeDialog.cs


示例15: PhotoImageView

		public PhotoImageView (IBrowsableCollection query)
		{
			loader = new FSpot.AsyncPixbufLoader ();
			loader.AreaUpdated += HandlePixbufAreaUpdated;
			loader.AreaPrepared += HandlePixbufPrepared;
			loader.Done += HandleDone;

			Accelerometer.OrientationChanged += HandleOrientationChanged;

			HandleRealized (null, null);

			this.SizeAllocated += HandleSizeAllocated;
			this.KeyPressEvent += HandleKeyPressEvent;
			//this.Realized += HandleRealized;
			this.Unrealized += HandleUnrealized;
			this.ScrollEvent += HandleScrollEvent;
			this.item = new BrowsablePointer (query, -1);
			item.Changed += PhotoItemChanged;
			this.Destroyed += HandleDestroyed;
			this.SetTransparentColor (this.Style.BaseColors [(int)Gtk.StateType.Normal]);
		}
开发者ID:AminBonyadUni,项目名称:facedetect-f-spot,代码行数:21,代码来源:PhotoImageView.cs


示例16: Run

        public void Run(IBrowsableCollection photos)
        {
            if (null == photos || null == photos.Items) {
                throw new ArgumentNullException ("photos");
            }

            main_dialog = new TabbloExportView (photos);

            InitBindings ();

            model.Deserialize ();
            model.PhotoCollection = photos;

            // Model deserialization triggers the various event
            // handlers, which can cause the default widget to lose
            // focus (it can be invalid, and hence disabled, for a
            // moment).
            main_dialog.ResetFocus ();

            main_dialog.Show ();
        }
开发者ID:nathansamson,项目名称:F-Spot-Album-Exporter,代码行数:21,代码来源:TabbloExport.cs


示例17: TabbloExportView

        internal TabbloExportView(IBrowsableCollection photos)
            : base(Assembly.GetExecutingAssembly (),
					"TabbloExport.ui", DialogName)
        {
            // Thumbnails
            var icon_view = new TrayView (photos);
            icon_view.DisplayDates = false;
            icon_view.DisplayTags = false;

            thumb_scrolled_window.Add (icon_view);
            icon_view.Show ();

            // Tags
            attached_tags_view = new FSpot.Widgets.TagView ();
            attached_tags_alignment.Add (attached_tags_view);
            attached_tags_view.Show ();

            removed_tags_view = new FSpot.Widgets.TagView ();
            removed_tags_alignment.Add (removed_tags_view);
            removed_tags_view.Show ();
        }
开发者ID:nathansamson,项目名称:F-Spot-Album-Exporter,代码行数:21,代码来源:TabbloExportView.cs


示例18: CollectionGridView

        public CollectionGridView (IBrowsableCollection collection) : base ()
        {
            Collection = collection;

            Collection.Changed += (obj) => {
                QueueResize ();
            };

            Collection.ItemsChanged += (obj, args) => {
                foreach (int item in args.Items) {
                    if (args.Changes.DataChanged)
                        UpdateThumbnail (item);
                    InvalidateCell (item);
                }
            };

            Name = "ImageContainer";

            Cache = new FSpot.PixbufCache ();
            Cache.OnPixbufLoaded += HandlePixbufLoaded;
        }
开发者ID:mono,项目名称:f-spot,代码行数:21,代码来源:CollectionCellGridView.cs


示例19: Run

        public void Run(IBrowsableCollection selection)
        {
            this.selection = selection;
            dialog = new CDExportDialog (selection, dest);
            //LoadHistory ();

                        if (dialog.Run () != (int)ResponseType.Ok) {
                                dialog.Destroy ();
                                return;
                        }

            clean = dialog.Clean;
            rotate = dialog.Rotate;

            command_thread = new System.Threading.Thread (new System.Threading.ThreadStart (Transfer));
            command_thread.Name = Catalog.GetString ("Transferring Pictures");

            progress_dialog = new ThreadProgressDialog (command_thread, selection.Count);
            progress_dialog.Start ();

            dialog.Destroy ();
        }
开发者ID:iainlane,项目名称:f-spot,代码行数:22,代码来源:CDExport.cs


示例20: SendEmail

		public SendEmail (IBrowsableCollection selection) : base ("mail_dialog")
		{
			this.selection = selection;

			for (int i = 0; i < selection.Count; i++) {
				Photo p = selection[i] as Photo;
				if (Gnome.Vfs.MimeType.GetMimeTypeForUri (p.DefaultVersionUri.ToString ()) != "image/jpeg")
					force_original = true;
			}

			if (force_original) {
				original_size.Active = true;
				tiny_size.Sensitive = false;
				small_size.Sensitive = false;
				medium_size.Sensitive = false;
				large_size.Sensitive = false;
				x_large_size.Sensitive = false;
			} else  
				switch (Preferences.Get<int> (Preferences.EXPORT_EMAIL_SIZE)) {
					case 0 :  original_size.Active = true; break;
					case 1 :  tiny_size.Active = true; break;
					case 2 :  small_size.Active = true; break;
					case 3 :  medium_size.Active = true; break;
					case 4 :  large_size.Active = true; break;
					case 5 :  x_large_size.Active = true; break;
					default: break;
				}

			rotate_check.Active = Preferences.Get<bool> (Preferences.EXPORT_EMAIL_ROTATE);
			rotate_check.Sensitive = original_size.Active && tiny_size.Sensitive;
			
			tray_scrolled.Add (new TrayView (selection));

			Dialog.Modal = false;

			// Calculate total original filesize 
			for (int i = 0; i < selection.Count; i++) {
				Photo photo = selection[i] as Photo;
				try {
					Orig_Photo_Size += (new Gnome.Vfs.FileInfo (photo.DefaultVersionUri.ToString ())).Size;
				} catch {
				}
			}

			for (int k = 0; k < avg_scale_ref.Length; k++)
				avg_scale[k] = avg_scale_ref[k];


			// Calculate approximate size shrinking, use first photo, and shrink to medium size as base.
			Photo scalephoto = selection [0] as Photo;
			if (scalephoto != null && !force_original) {
				
				// Get first photos file size
				long orig_size = (new Gnome.Vfs.FileInfo (scalephoto.DefaultVersionUri.ToString ())).Size;
				
				FilterSet filters = new FilterSet ();
				filters.Add (new ResizeFilter ((uint)(sizes [3])));
				long new_size;
				using (FilterRequest request = new FilterRequest (scalephoto.DefaultVersionUri)) {
					filters.Convert (request);
					new_size = (new Gnome.Vfs.FileInfo (request.Current.ToString ())).Size;
				}
				
				if (orig_size > 0) {
				
					// Get the factor (scale) between original and resized medium size.
					scale_percentage = 1 - ( (float) (orig_size - new_size) / orig_size);
					
					// What is the relation between the estimated medium scale factor, and reality?
					double scale_scale = scale_percentage / avg_scale_ref[3];
					
					//System.Console.WriteLine ("scale_percentage {0}, ref {1}, relative {2}", 
					//	scale_percentage, avg_scale_ref[3], scale_scale  );

					// Re-Calculate the proper relation per size
					for (int k = 0; k < avg_scale_ref.Length; k++) {
						avg_scale[k] = avg_scale_ref[k] * scale_scale;
					//	System.Console.WriteLine ("avg_scale[{0}]={1} (was {2})", 
					//		k, avg_scale[k], avg_scale_ref[k]  );
					}
				}

			}

			NumberOfPictures.Text 	= selection.Count.ToString();
			TotalOriginalSize.Text 	= SizeUtil.ToHumanReadable (Orig_Photo_Size);
			
			UpdateEstimatedSize();

			Dialog.ShowAll ();

			//LoadHistory ();

			Dialog.Response += HandleResponse;
		}
开发者ID:guadalinex-archive,项目名称:guadalinex-v6,代码行数:95,代码来源:SendEmail.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# IBrowser类代码示例发布时间:2022-05-24
下一篇:
C# IBrokerage类代码示例发布时间: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