[longomatch: 43/51] Use C# 3.0 autoimplemented properties and objects initializers
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch: 43/51] Use C# 3.0 autoimplemented properties and objects initializers
- Date: Fri, 21 May 2010 23:28:05 +0000 (UTC)
commit 63f370180facb7a112cfd788356735a5f0ca4e9b
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Tue May 11 01:25:13 2010 +0200
Use C# 3.0 autoimplemented properties and objects initializers
LongoMatch/DB/DataBase.cs | 15 +++--
LongoMatch/DB/ProjectDescription.cs | 107 +++++++----------------------------
2 files changed, 30 insertions(+), 92 deletions(-)
---
diff --git a/LongoMatch/DB/DataBase.cs b/LongoMatch/DB/DataBase.cs
index 0a89ce9..8bea903 100644
--- a/LongoMatch/DB/DataBase.cs
+++ b/LongoMatch/DB/DataBase.cs
@@ -138,11 +138,16 @@ namespace LongoMatch.DB
p.File = new PreviewMediaFile(Catalog.GetString("Change Me"),0,0,false,false,"","",0,0,null);
db.Set(p);
}
- ProjectDescription pd = new ProjectDescription(p.File.FilePath,
- p.LocalName, p.VisitorName,
- p.Season,p.Competition,
- p.LocalGoals,p.VisitorGoals,
- p.MatchDate,p.File.Preview);
+ ProjectDescription pd = new ProjectDescription {
+ File = p.File.FilePath,
+ LocalName= p.LocalName,
+ VisitorName = p.VisitorName,
+ Season = p.Season,
+ Competition = p.Competition,
+ LocalGoals = p.LocalGoals,
+ VisitorGoals = p.VisitorGoals,
+ MatchDate = p.MatchDate,
+ Preview = p.File.Preview};
list.Add(pd);
}catch{
Console.WriteLine("Error retreiving project. Skip");
diff --git a/LongoMatch/DB/ProjectDescription.cs b/LongoMatch/DB/ProjectDescription.cs
index f774a23..1dc9201 100644
--- a/LongoMatch/DB/ProjectDescription.cs
+++ b/LongoMatch/DB/ProjectDescription.cs
@@ -28,124 +28,57 @@ namespace LongoMatch.DB
/// </summary>
public class ProjectDescription : IComparable
{
- private string file;
-
- private string localName;
-
- private string visitorName;
-
- private int localGoals;
-
- private int visitorGoals;
-
- private DateTime matchDate;
-
- private string season;
-
- private string competition;
-
- private Pixbuf preview;
-
- public ProjectDescription(string file, String localName, String visitorName, String season, String competition, int localGoals,
- int visitorGoals, DateTime matchDate,Pixbuf preview)
- {
- this.file = file;
- this.localName = localName;
- this.visitorName = visitorName;
- this.localGoals = localGoals;
- this.visitorGoals = visitorGoals;
- this.matchDate = matchDate;
- this.season = season;
- this.competition = competition;
- this.preview = preview;
- }
-
+
public String Title {
get {
- return System.IO.Path.GetFileNameWithoutExtension(file);
+ return System.IO.Path.GetFileNameWithoutExtension(File);
}
}
public String File {
- get {
- return file;
- }
- set {
- file = value;
- }
+ get;
+ set;
}
public String Season {
- get {
- return season;
- }
- set {
- season = value;
- }
+ get;
+ set;
}
public String Competition {
- get {
- return competition;
- }
- set {
- competition= value;
- }
+ get;
+ set;
}
public String LocalName {
- get {
- return localName;
- }
- set {
- localName=value;
- }
+ get;
+ set;
}
public String VisitorName {
- get {
- return visitorName;
- }
- set {
- visitorName=value;
- }
+ get;
+ set;
}
public int LocalGoals {
- get {
- return localGoals;
- }
- set {
- localGoals=value;
- }
+ get;
+ set;
}
public int VisitorGoals {
- get {
- return visitorGoals;
- }
- set {
- visitorGoals=value;
- }
+ get;
+ set;
}
public DateTime MatchDate {
- get {
- return matchDate;
- }
- set {
- matchDate=value;
- }
+ get;
+ set;
}
public Pixbuf Preview {
- get {
- return this.preview;
- }
- set {
- preview = value;
- }
+ get;
+ set;
}
public int CompareTo(object obj) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]