Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented missing Journal constructor so Initialize method is called. #310

Merged
merged 5 commits into from
Sep 19, 2017
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions net-core/Ical.Net/Ical.Net/Components/Journal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,17 @@ public JournalStatus Status
set => Properties.Set("STATUS", value);
}

private void Initialize()
/// <summary>
/// Constructs an Journal object, with an iCalObject
/// (usually an iCalendar object) as its parent.
/// </summary>
public Journal()
{
Name = Components.Journal;
}

protected override bool EvaluationIncludesReferenceDate => true;

protected override void OnDeserializing(StreamingContext context)
{
base.OnDeserializing(context);
Initialize();
}

protected bool Equals(Journal other) => Start.Equals(other.Start) && Equals(other as RecurringComponent);

public override bool Equals(object obj)
Expand Down
12 changes: 5 additions & 7 deletions v2/ical.NET/Components/Journal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,17 @@ public JournalStatus Status
set { Properties.Set("STATUS", value); }
}

private void Initialize()
/// <summary>
/// Constructs an Journal object, with an iCalObject
/// (usually an iCalendar object) as its parent.
/// </summary>
public Journal()
{
Name = Components.Journal;
}

protected override bool EvaluationIncludesReferenceDate => true;

protected override void OnDeserializing(StreamingContext context)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I seem to recall that deleting these overrides can cause subtle problems, so I think these should be put back.

I'm sorry my other comment was unclear: I meant delete the call to Initialize() from this method, moving that logic to the constructor, which you've done. Can you put back this override? Then it will be ready to merge.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted removal of OnDeserializing()
(see 7a3f471)

{
base.OnDeserializing(context);
Initialize();
}

protected bool Equals(Journal other) => Start.Equals(other.Start) && Equals(other as RecurringComponent);

public override bool Equals(object obj)
Expand Down