3

Is there a standard for placing copyright statements in XAML files? In .cs files I use the following:

//-----------------------------------------------------------------------
// <copyright file="MyFile.cs" company="MyCompany" year="2011">
//
//                          COPYRIGHT INFORMATION
//  
//   ....Our Copyright...
//  
// </copyright>
//-----------------------------------------------------------------------

Is there something equivalent for XAML files?

user
  • 86,916
  • 18
  • 197
  • 190
KrisTrip
  • 4,943
  • 12
  • 55
  • 74
  • Ok fine, maybe "standard" isn't the right word. What I mean is something people typically use. Maybe I should have said a "common way to..." – KrisTrip Oct 25 '11 at 15:21
  • 2
    Source code file headers are so 1999 ;) – MattDavey Oct 25 '11 at 15:22
  • Yeah, my company is apparently stuck in the 90's because they require them :) – KrisTrip Oct 25 '11 at 15:23
  • @KrisTrip : I would suggest Version Control System to persist history of a source code changes. In addition you'll get many more important benefits by introducing VCS in your development process ;) – sll Oct 25 '11 at 15:27
  • @KrisTrip, how do you place copyright statements in your .csproj and .sln files? I would recommend you to use the same approach for XAML files :-) – svick Oct 25 '11 at 15:28
  • @sll We do use a Version Control System, I don't see what that has to do with copyright statements? – KrisTrip Oct 25 '11 at 15:38
  • @KrisTrip : VCS provides you info who was initially submitted this file and what was the purposes (description must be provided along with each submit), copytight itself is useless from my point of view (OR your company distributing open source project?) – sll Oct 25 '11 at 15:48
  • @sll our company sometimes distributes source code when we sell our products. – KrisTrip Oct 25 '11 at 16:16
  • Ok so only one sing is might be helpful is to include CompanyName.ProductName in namespaces – sll Oct 25 '11 at 16:25

1 Answers1

3

XAML is just XML at it's base, so you can use XML comments

<!-- Comment here -->

You could even use the XML documentation format within the comment (although there is no real point, as the XML doc generator does not process XAML files afaik.)

<!--
<copyright file="filename" company="CompanyCo" year="2011">
Copyright Info
</copyright>
-->

One small warning though, which if you work with XML at all is probably already known: You can't nest XML comments.

<!--
    In a comment
    <!--
        In a nested comment
    -->
    No longer in a comment!
-->

Just look at the code formatting above =)

Joseph Alcorn
  • 2,322
  • 17
  • 23