From c073068ad4ccf50a733e95c66dc031da9275a396 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 7 Apr 2009 10:31:03 +0200 Subject: [PATCH] Make Gst.Version a static class --- gstreamer-sharp/Application.cs | 12 ------------ gstreamer-sharp/Version.cs | 33 ++++++++++++++------------------- 2 files changed, 14 insertions(+), 31 deletions(-) diff --git a/gstreamer-sharp/Application.cs b/gstreamer-sharp/Application.cs index 71052b4..8172480 100644 --- a/gstreamer-sharp/Application.cs +++ b/gstreamer-sharp/Application.cs @@ -77,18 +77,6 @@ namespace Gst } } - private static Version version = null; - - public static Version Version { - get { - if(version == null) { - version = new Version(); - } - - return version; - } - } - [DllImport("gstreamer-0.10")] private static extern void gst_init(ref int argc, ref IntPtr argv); diff --git a/gstreamer-sharp/Version.cs b/gstreamer-sharp/Version.cs index e62c605..1169c47 100644 --- a/gstreamer-sharp/Version.cs +++ b/gstreamer-sharp/Version.cs @@ -12,27 +12,22 @@ using System.Runtime.InteropServices; namespace Gst { - public class Version + public static class Version { - private uint major; - private uint minor; - private uint micro; - private uint nano; - private string version_string; + private static uint major; + private static uint minor; + private static uint micro; + private static uint nano; + private static string version_string; - internal Version() + static Version() { gst_version(out major, out minor, out micro, out nano); } - public override string ToString() - { - return String.Format("{0}.{1}.{2}.{3}", major, minor, micro, nano); - } - - public string Description { + public static string Description { get { - if(version_string == null) { + if (version_string == null) { IntPtr version_string_ptr = gst_version_string(); version_string = GLib.Marshaller.Utf8PtrToString(version_string_ptr); } @@ -41,19 +36,19 @@ namespace Gst } } - public uint Major { + public static uint Major { get { return major; } } - public uint Minor { + public static uint Minor { get { return minor; } } - public uint Micro { + public static uint Micro { get { return micro; } } - public uint Nano { + public static uint Nano { get { return nano; } } @@ -63,4 +58,4 @@ namespace Gst [DllImport("gstreamer-0.10")] private static extern IntPtr gst_version_string(); } -} \ No newline at end of file +} -- 2.7.4