Skip to content

Commit

Permalink
Add in code docu
Browse files Browse the repository at this point in the history
  • Loading branch information
Dirkster99 committed Jul 3, 2020
1 parent 8e62258 commit 218e242
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions source/Components/AvalonDock/Converters/ConverterCreater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

namespace AvalonDock.Converters
{
/// <summary>
/// Implements a static factory pattern for instances of WPF converters
/// and ensures that every single converter is instanciated only once.
/// </summary>
internal class ConverterCreater
{
#region Private fields
Expand All @@ -13,6 +17,14 @@ internal class ConverterCreater

#region Public methods

/// <summary>
/// Gets an available instance of the indicated type <see cref="{T}"/> or a brand new instance
/// if the indicated type was not created, yet (to be returned on next query of instance for type <see cref="{T}"/>).
///
/// This method ensures that every instance per class <see cref="{T}"/> is instanciated only once.
/// </summary>
/// <typeparam name="T">Type of class to be returned form this factory.</typeparam>
/// <returns></returns>
public static T Get<T>() where T : new()
{
if (!ConverterMap.ContainsKey(typeof(T)))
Expand Down

6 comments on commit 218e242

@LyonJack
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you use the auto annotation tool? Because my English is not good, some comments are not added

@Dirkster99
Copy link
Owner Author

Choose a reason for hiding this comment

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

No. I don't know an auto annotation tool. I use Visual Studion Community 2019 - not sure if there is an auto annotation tool for that - can you use Google Translate? Its usually pretty good for simple sentences - so this might be helpful if you keep the sentence structure simple instead of trying to phrase to complicated sentence structures in the original (Chinese) text.

Don't worry about a spelling or grammar mistake - we can always correct that later. I just spotted a mistake in the above docu where 'from' should have bee 'from' 😞 ...

@LyonJack
Copy link
Contributor

Choose a reason for hiding this comment

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

I know an Extend of VS named CodeMaid,that Extend can help us auto format code.
9

@Dirkster99
Copy link
Owner Author

Choose a reason for hiding this comment

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

Yes this tool seems to be interesting indeed - I use the XAML Styler to make XAML look more consistently across project.

@Dirkster99
Copy link
Owner Author

Choose a reason for hiding this comment

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

I am looking at CodeMaid and am seeing now that some of your code contributions do not use TAB Characters for indentation (maybe by mistake?).
Can we please use TAB character indentations in this project?

@Dirkster99
Copy link
Owner Author

Choose a reason for hiding this comment

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

I used the CodeMaid on these files and it seems to work fine with its default values :-)

Please sign in to comment.