00001 using System; 00002 using System.Collections.Generic; 00003 using System.ComponentModel; 00004 using System.Drawing; 00005 using System.Data; 00006 using System.Text; 00007 using System.Windows.Forms; 00008 using Shared; 00009 00010 namespace CommentControls 00011 { 00018 public partial class CommentsContainer : UserControl 00019 { 00021 private Dictionary<int, CommentInfo> comments = new Dictionary<int, CommentInfo>(); 00022 00026 public event CommentsContainerEventHandler CommentsChanged; 00027 00028 public CommentsContainer() 00029 { 00030 InitializeComponent(); 00031 } 00032 00033 [ 00034 TypeConverter(typeof(Dictionary<int, CommentInfo>)), 00035 Category("Appearance"), 00036 Description("The handled set of comments") 00037 ] 00038 public Dictionary<int, CommentInfo> Comments 00039 { 00040 get { return comments; } 00041 set { 00042 comments = value; 00043 CommentsContainerEventArgs args = new CommentsContainerEventArgs(CommentsContainerEventArgs.CommentsContainerEventType.CommentsChanged); 00044 if (CommentsChanged != null) 00045 CommentsChanged(this, args); 00046 } 00047 } 00048 } 00049 00053 public class CommentsContainerEventArgs : EventArgs 00054 { 00058 public enum CommentsContainerEventType 00059 { 00060 CommentsChanged 00061 } 00062 00063 private CommentsContainerEventType eventType; 00064 00065 public CommentsContainerEventType EventType 00066 { 00067 get { return eventType; } 00068 set { eventType = value; } 00069 } 00070 00075 public CommentsContainerEventArgs(CommentsContainerEventType et) 00076 { 00077 eventType = et; 00078 } 00079 } 00080 00086 public delegate void CommentsContainerEventHandler( 00087 object sender, CommentsContainerEventArgs e); 00088 }
1.5.1-p1