Working comments with CommentPool.
This commit is contained in:
@ -24,6 +24,7 @@ using Microsoft.Office.Interop.Word;
|
||||
using zaaReloaded2.LabModel;
|
||||
using zaaReloaded2.Formatter;
|
||||
using System.Runtime.Serialization;
|
||||
using zaaReloaded2.Controller.Comments;
|
||||
|
||||
namespace zaaReloaded2.Controller.Elements
|
||||
{
|
||||
@ -94,15 +95,6 @@ namespace zaaReloaded2.Controller.Elements
|
||||
|
||||
#endregion
|
||||
|
||||
#region Events
|
||||
|
||||
/// <summary>
|
||||
/// Propagates the FillInComment events of collected items.
|
||||
/// </summary>
|
||||
public event EventHandler<ItemCommentEventArgs> FillInComment;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
public Items() : base() { }
|
||||
@ -202,12 +194,10 @@ namespace zaaReloaded2.Controller.Elements
|
||||
{
|
||||
// First, check if the item name contains an optional comment
|
||||
// definition
|
||||
ItemComment comment = ItemComment.FromDefinition(name);
|
||||
ItemComment comment = CommentPool.Default.GetCommentFor(name);
|
||||
if (comment != null)
|
||||
{
|
||||
name = comment.Item;
|
||||
// Enable propagation of FillInComment events
|
||||
comment.FillInComment += comment_FillInComment;
|
||||
}
|
||||
|
||||
// Then, see if we have such an item
|
||||
@ -228,23 +218,6 @@ namespace zaaReloaded2.Controller.Elements
|
||||
return items;
|
||||
}
|
||||
|
||||
void comment_FillInComment(object sender, ItemCommentEventArgs e)
|
||||
{
|
||||
OnFillInComment(e);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Protected methods
|
||||
|
||||
protected virtual void OnFillInComment(ItemCommentEventArgs args)
|
||||
{
|
||||
EventHandler<ItemCommentEventArgs> h = FillInComment;
|
||||
if (h != null)
|
||||
{
|
||||
h(this, args);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Fields
|
||||
|
Reference in New Issue
Block a user