[longomatch] Format more files
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch] Format more files
- Date: Tue, 31 Mar 2015 17:36:00 +0000 (UTC)
commit 5a5b51c083f0f579c18c09d7d8d4a0e592806e41
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Thu Mar 26 18:28:30 2015 +0100
Format more files
LongoMatch.Core/Store/Coordinates.cs | 18 +++++++++---------
LongoMatch.Core/Store/DashboardButton.cs | 24 ++++++++++++++----------
LongoMatch.Core/Store/EventType.cs | 8 ++++----
LongoMatch.Core/Store/HotKey.cs | 14 ++++++++++++++
LongoMatch.Core/Store/MediaFile.cs | 27 ++++++++++++++-------------
LongoMatch.Core/Store/MediaFileSet.cs | 8 +++++---
LongoMatch.Core/Store/ProjectDescription.cs | 6 +++---
LongoMatch.Core/Store/TimelineNode.cs | 21 +++++++++++----------
8 files changed, 74 insertions(+), 52 deletions(-)
---
diff --git a/LongoMatch.Core/Store/Coordinates.cs b/LongoMatch.Core/Store/Coordinates.cs
index e263979..1c3eac0 100644
--- a/LongoMatch.Core/Store/Coordinates.cs
+++ b/LongoMatch.Core/Store/Coordinates.cs
@@ -28,28 +28,28 @@ namespace LongoMatch.Core.Common
{
Points = new List<Point> ();
}
-
+
public List<Point> Points {
get;
set;
}
-
+
public override bool Equals (object obj)
{
Coordinates c = obj as Coordinates;
- if (c == null)
+ if (c == null)
return false;
if (c.Points.Count != Points.Count)
return false;
- for (int i=0; i < Points.Count; i++) {
- if (!c.Points[i].Equals (Points[i]))
+ for (int i = 0; i < Points.Count; i++) {
+ if (!c.Points [i].Equals (Points [i]))
return false;
}
return true;
}
-
+
public override int GetHashCode ()
{
string s = "";
@@ -58,11 +58,11 @@ namespace LongoMatch.Core.Common
return base.GetHashCode ();
}
- for (int i=0; i < Points.Count; i++) {
- s += this.Points[i].X.ToString() + this.Points[i].Y.ToString();
+ for (int i = 0; i < Points.Count; i++) {
+ s += this.Points [i].X.ToString () + this.Points [i].Y.ToString ();
}
- return int.Parse(s);
+ return int.Parse (s);
}
}
diff --git a/LongoMatch.Core/Store/DashboardButton.cs b/LongoMatch.Core/Store/DashboardButton.cs
index 3b69f04..4ff72bd 100644
--- a/LongoMatch.Core/Store/DashboardButton.cs
+++ b/LongoMatch.Core/Store/DashboardButton.cs
@@ -100,12 +100,13 @@ namespace LongoMatch.Core.Store
[Serializable]
public class TimedDashboardButton: DashboardButton
{
- public TimedDashboardButton () {
+ public TimedDashboardButton ()
+ {
TagMode = TagMode.Predefined;
- Start = new Time {TotalSeconds = 10};
- Stop = new Time {TotalSeconds = 10};
+ Start = new Time { TotalSeconds = 10 };
+ Stop = new Time { TotalSeconds = 10 };
}
-
+
public TagMode TagMode {
get;
set;
@@ -125,10 +126,11 @@ namespace LongoMatch.Core.Store
[Serializable]
public class TagButton: DashboardButton
{
- public TagButton () {
+ public TagButton ()
+ {
BackgroundColor = StyleConf.ButtonTagColor;
}
-
+
public Tag Tag {
get;
set;
@@ -160,10 +162,11 @@ namespace LongoMatch.Core.Store
[Serializable]
public class TimerButton: DashboardButton
{
- public TimerButton () {
+ public TimerButton ()
+ {
BackgroundColor = StyleConf.ButtonTimerColor;
}
-
+
public Timer Timer {
get;
set;
@@ -215,11 +218,12 @@ namespace LongoMatch.Core.Store
[Serializable]
public class AnalysisEventButton: EventButton
{
- public AnalysisEventButton () {
+ public AnalysisEventButton ()
+ {
TagsPerRow = 2;
ShowSubcategories = true;
}
-
+
public bool ShowSubcategories {
get;
set;
diff --git a/LongoMatch.Core/Store/EventType.cs b/LongoMatch.Core/Store/EventType.cs
index 268a892..384c393 100644
--- a/LongoMatch.Core/Store/EventType.cs
+++ b/LongoMatch.Core/Store/EventType.cs
@@ -108,7 +108,7 @@ namespace LongoMatch.Core.Store
}
}
}
-
+
[Serializable]
public class AnalysisEventType: EventType
{
@@ -125,7 +125,7 @@ namespace LongoMatch.Core.Store
[JsonIgnore]
public Dictionary<string, List<Tag>> TagsByGroup {
get {
- return Tags.GroupBy (t => t.Group).ToDictionary (g => g.Key, g => g.ToList());
+ return Tags.GroupBy (t => t.Group).ToDictionary (g => g.Key, g => g.ToList
());
}
}
}
@@ -146,13 +146,13 @@ namespace LongoMatch.Core.Store
return false;
return pc.ID == ID;
}
-
+
public override int GetHashCode ()
{
return ID.GetHashCode ();
}
}
-
+
[Serializable]
public class ScoreEventType: EventType
{
diff --git a/LongoMatch.Core/Store/HotKey.cs b/LongoMatch.Core/Store/HotKey.cs
index 575dd7b..9cfb5a7 100644
--- a/LongoMatch.Core/Store/HotKey.cs
+++ b/LongoMatch.Core/Store/HotKey.cs
@@ -33,6 +33,7 @@ namespace LongoMatch.Core.Store
public class HotKey : IEquatable<HotKey>
{
#region Constructors
+
/// <summary>
/// Creates a new undefined HotKey
/// </summary>
@@ -41,8 +42,11 @@ namespace LongoMatch.Core.Store
Key = -1;
Modifier = -1;
}
+
#endregion
+
#region Properties
+
/// <summary>
/// Gdk Key
/// </summary>
@@ -68,16 +72,22 @@ namespace LongoMatch.Core.Store
return (Key != -1);
}
}
+
#endregion
+
#region Public Methods
+
public bool Equals (HotKey hotkeyComp)
{
if (hotkeyComp == null)
return false;
return (this.Key == hotkeyComp.Key && this.Modifier == hotkeyComp.Modifier);
}
+
#endregion
+
#region Operators
+
static public bool operator == (HotKey a, HotKey b)
{
// If both are null, or both are same instance, return true.
@@ -96,8 +106,11 @@ namespace LongoMatch.Core.Store
{
return !(a == b);
}
+
#endregion
+
#region Overrides
+
public override bool Equals (object obj)
{
if (obj is HotKey) {
@@ -118,6 +131,7 @@ namespace LongoMatch.Core.Store
return Catalog.GetString ("Not defined");
return Keyboard.HotKeyName (this);
}
+
#endregion
}
}
diff --git a/LongoMatch.Core/Store/MediaFile.cs b/LongoMatch.Core/Store/MediaFile.cs
index 4a3b8a2..1c75fc7 100644
--- a/LongoMatch.Core/Store/MediaFile.cs
+++ b/LongoMatch.Core/Store/MediaFile.cs
@@ -33,18 +33,18 @@ namespace LongoMatch.Core.Store
}
public MediaFile (string filePath,
- long length,
- ushort fps,
- bool hasAudio,
- bool hasVideo,
- string container,
- string videoCodec,
- string audioCodec,
- uint videoWidth,
- uint videoHeight,
- double par,
- Image preview,
- String name)
+ long length,
+ ushort fps,
+ bool hasAudio,
+ bool hasVideo,
+ string container,
+ string videoCodec,
+ string audioCodec,
+ uint videoWidth,
+ uint videoHeight,
+ double par,
+ Image preview,
+ String name)
{
FilePath = filePath;
Duration = new Time ((int)length);
@@ -139,7 +139,8 @@ namespace LongoMatch.Core.Store
}
}
- public bool Exists () {
+ public bool Exists ()
+ {
return System.IO.File.Exists (FilePath);
}
}
diff --git a/LongoMatch.Core/Store/MediaFileSet.cs b/LongoMatch.Core/Store/MediaFileSet.cs
index 5d1cf03..398f903 100644
--- a/LongoMatch.Core/Store/MediaFileSet.cs
+++ b/LongoMatch.Core/Store/MediaFileSet.cs
@@ -24,7 +24,7 @@ using Newtonsoft.Json;
namespace LongoMatch.Core.Store
{
- [JsonObject(MemberSerialization.OptIn)]
+ [JsonObject (MemberSerialization.OptIn)]
[Serializable]
public class MediaFileSet : List<MediaFile>
{
@@ -118,7 +118,8 @@ namespace LongoMatch.Core.Store
/// <param name="name">Name to use for the search.</param>
/// <param name="file">File.</param>
/// <returns><c>true</c> if the name was found and a substitution happened, <c>false</c>
otherwise.</returns>
- public bool Replace (String name, MediaFile file) {
+ public bool Replace (String name, MediaFile file)
+ {
MediaFile old_file = this.Where (mf => mf.Name == name).FirstOrDefault ();
return Replace (old_file, file);
}
@@ -131,7 +132,8 @@ namespace LongoMatch.Core.Store
/// <param name="old_file">Old file.</param>
/// <param name="new_file">New file.</param>
/// <returns>><c>true</c> if the old file was found and a substitution happened, <c>false</c>
otherwise.</returns>
- public bool Replace (MediaFile old_file, MediaFile new_file) {
+ public bool Replace (MediaFile old_file, MediaFile new_file)
+ {
bool found = false;
if (Contains (old_file)) {
diff --git a/LongoMatch.Core/Store/ProjectDescription.cs b/LongoMatch.Core/Store/ProjectDescription.cs
index 59394b3..75aa8c0 100644
--- a/LongoMatch.Core/Store/ProjectDescription.cs
+++ b/LongoMatch.Core/Store/ProjectDescription.cs
@@ -68,8 +68,8 @@ namespace LongoMatch.Core.Store
public String Title {
get {
return String.Format ("{0} - {1} ({2}-{3}) {4} {5}",
- LocalName, VisitorName, LocalGoals, VisitorGoals,
- Competition, Season);
+ LocalName, VisitorName, LocalGoals, VisitorGoals,
+ Competition, Season);
}
}
@@ -77,7 +77,7 @@ namespace LongoMatch.Core.Store
public String DateTitle {
get {
string ret = String.Format ("{0}-{1} {2}", LocalName, VisitorName,
- MatchDate.ToShortDateString ());
+ MatchDate.ToShortDateString ());
if (!String.IsNullOrEmpty (Season)) {
ret += " " + Season;
}
diff --git a/LongoMatch.Core/Store/TimelineNode.cs b/LongoMatch.Core/Store/TimelineNode.cs
index 11333f1..7773b2a 100644
--- a/LongoMatch.Core/Store/TimelineNode.cs
+++ b/LongoMatch.Core/Store/TimelineNode.cs
@@ -21,7 +21,7 @@ using LongoMatch.Core.Interfaces;
namespace LongoMatch.Core.Store
{
- /* FIXME: Code duplicated from Play, unfortunately we can't
+ /* FIXME: Code duplicated from Play, unfortunately we can't
* modify the class hierachy */
[Serializable]
public class TimelineNode: TimeNode
@@ -29,7 +29,7 @@ namespace LongoMatch.Core.Store
public TimelineNode ()
{
}
-
+
/// <summary>
/// Video framerate in frames per second. This value is taken from the
/// video file properties and used to translate from seconds
@@ -49,7 +49,7 @@ namespace LongoMatch.Core.Store
return (uint)(Start.MSeconds * Fps / 1000);
}
set {
- Start = new Time {MSeconds = (int)(1000 * value / Fps)};
+ Start = new Time { MSeconds = (int)(1000 * value / Fps) };
}
}
@@ -62,7 +62,7 @@ namespace LongoMatch.Core.Store
return (uint)(Stop.MSeconds * Fps / 1000);
}
set {
- Stop = new Time {MSeconds = (int)(1000 * value / Fps)};
+ Stop = new Time { MSeconds = (int)(1000 * value / Fps) };
}
}
@@ -80,7 +80,7 @@ namespace LongoMatch.Core.Store
[JsonIgnore]
public uint CentralFrame {
get {
- return StopFrame-((TotalFrames)/2);
+ return StopFrame - ((TotalFrames) / 2);
}
}
@@ -90,10 +90,10 @@ namespace LongoMatch.Core.Store
[JsonIgnore]
public uint TotalFrames {
get {
- return StopFrame-StartFrame;
+ return StopFrame - StartFrame;
}
}
-
+
/// <summary>
/// Get the key frame number if this play as key frame drawing or 0
/// </summary>
@@ -102,7 +102,7 @@ namespace LongoMatch.Core.Store
return 0;
}
}
-
+
public bool HasDrawings {
get;
set;
@@ -117,8 +117,9 @@ namespace LongoMatch.Core.Store
/// <returns>
/// A <see cref="System.Boolean"/>
/// </returns>
- public bool HasFrame(int frame) {
- return (frame>=StartFrame && frame<StopFrame);
+ public bool HasFrame (int frame)
+ {
+ return (frame >= StartFrame && frame < StopFrame);
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]