views:

330

answers:

4

I know how to do this but I don't know is the StyleCop method true/working. Normally in StyleCop rules you must add this thing like this example to header (need to edit):

//-----------------------------------------------------------------------
// <copyright file="Widget.cs" company="Sprocket Enterprises">
//     Copyright (c) Sprocket Enterprises. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------

And with StyleCop for ReSharper:

// --------------------------------------------------------------------------------------------------------------------
// <copyright file="Form1.cs" company="">
//   
// </copyright>
// <summary>
//   Defines the Form1 type.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

My final header is:

// --------------------------------------------------------------------------------------------------------------------
// <copyright file="Form1.cs" company="{Company}">
//
// Copyright (C) 2009 {Company}
//
// This program is free software: you can redistribute it and/or modify
// it under the +terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program.  If not, see http://www.gnu.org/licenses/. 
// </copyright>
// <summary>
// {one line to give the program's name and a brief idea of what it does.}
// 
// Email: {Email}
// XFire and Steam: {Username}
// </summary>
// --------------------------------------------------------------------------------------------------------------------

If I add this header to all my sources and share, will my application be GPL licenced? If not, where's the problem? I hope the StyleCop method will work. Maybe I should move "{one line to give the program's name and a brief idea of what it does.}" to upper than Copyright tag. Thanks.

+1  A: 

Looks good to me. Have you read the GPL FAQ, there is a whole section on Using GNU licenses for your programs. Maybe you could double check there.

ParmesanCodice
A: 

Thanks, I just didn't use a licence before. I made it as this:

// --------------------------------------------------------------------------------------------------------------------
// <copyright file="Form1.cs" company="{Company}">
//
// {one line to give the program's name and a brief idea of what it does.}
// Copyright (C) 2009 {Company}
//
// This program is free software: you can redistribute it and/or modify
// it under the +terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program.  If not, see http://www.gnu.org/licenses/. 
// </copyright>
// <summary>
// Email: {Email}
// XFire and Steam: {Username}
// </summary>
// --------------------------------------------------------------------------------------------------------------------
Proton
+1  A: 

There's a how-to apply the license to source code.

This would be a good chance to make use of code regions:

#region Copyright
// your copyright goes here
#endregion

That way developers can collapse all the fluff :-)

Also, create a snippet so you don't have to remember.

Si
A: 

Yes, I knew how to add licence (and also the regions) already, but I wondered why StyleCop wants <copyright></copyright>. Can I add licence tag on it? And why I should do it (the StyleCop way)?

Proton