Kaluzhny: CompanyName, CurrentCulture, ExecutablePath, ProductName, ProductVersion...
authorV Kaluzhny <vkaluzhny@mono-cvs.ximian.com>
Mon, 21 Apr 2003 06:48:50 +0000 (06:48 -0000)
committerV Kaluzhny <vkaluzhny@mono-cvs.ximian.com>
Mon, 21 Apr 2003 06:48:50 +0000 (06:48 -0000)
svn path=/trunk/mcs/; revision=13842

mcs/class/System.Windows.Forms/System.Windows.Forms/Application.cs

index 881668ab7452a0296eb0c61dd5d98bc97b157cd5..9f9fe903832dd2e517f70525abbd71d67902ba59 100644 (file)
@@ -60,18 +60,20 @@ namespace System.Windows.Forms {
                [MonoTODO]
                public static string CompanyName {
                        get {
-                               //FIXME:
-                               return "Company Name";
+                AssemblyCompanyAttribute[] attrs =(AssemblyCompanyAttribute[]) Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute),true);
+                if (attrs != null && attrs[0] != null)
+                    return attrs[0].Company;
+                return "";
                        }
                }
        
                [MonoTODO]
                public static CultureInfo CurrentCulture {
                        get {
-                               throw new NotImplementedException ();
+                               return CultureInfo.CurrentCulture;
                        }
                        set {
-                               //FIXME:
+                               Thread.CurrentThread.CurrentCulture = value;
                        }
                }
        
@@ -83,9 +85,8 @@ namespace System.Windows.Forms {
                [MonoTODO]
                public static string ExecutablePath {
                        get {
-                               //FIXME:
-                               return "";
-                       }
+                    return Assembly.GetExecutingAssembly().Location;                   
+            }
                }
        
                [MonoTODO]
@@ -105,16 +106,20 @@ namespace System.Windows.Forms {
                [MonoTODO]
                public static string ProductName {
                        get {
-                               //FIXME:
-                               return "Product Name";
+                    AssemblyProductAttribute[] attrs =(AssemblyProductAttribute[]) Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute),true);
+                    if (attrs != null && attrs[0] != null)
+                        return attrs[0].Product;
+                    return "";
                        }
                }
        
                [MonoTODO]
                public static string ProductVersion {
-                       get {
-                               //FIXME:
-                               return "0.0.0";
+            get {
+                    AssemblyVersionAttribute[] attrs =(AssemblyVersionAttribute[]) Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyVersionAttribute),true);
+                    if (attrs != null && attrs[0] != null)
+                        return attrs[0].Version;
+                    return "";
                        }
                }