Author: pbartok
Date: 2005-03-29 17:10:44 -0500 (Tue, 29 Mar 2005)
New Revision: 42360

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Application.cs
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
Log:
2005-03-29  Peter Bartok  <[EMAIL PROTECTED]>
        * Application.cs:
          - Properly implemented CompanyName property
          - Fixed LocalUserAppDataPath and UserAppDataPath, now properly 
            returns a path that includes CompanyName, ProductName and 
            Version (fixes bug #70330)

2005-03-29  Stefan Buehler  <[EMAIL PROTECTED]>



Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Application.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Application.cs   
2005-03-29 21:57:35 UTC (rev 42359)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Application.cs   
2005-03-29 22:10:44 UTC (rev 42360)
@@ -146,21 +146,13 @@
 
                public static string CompanyName {
                        get {
-                               StackTrace      st;
-
-                               if (Environment.OSVersion.Platform != 
(PlatformID)128) {
-                                       RegistryKey     key;
-                                       String          ret;
-
-                                       
key=Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion",
 false);
-                                       
ret=(String)key.GetValue("RegisteredOrganization");
-
-                                       return ret;
-                                       
+                               AssemblyCompanyAttribute[] attrs = 
(AssemblyCompanyAttribute[]) 
Assembly.GetEntryAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute),
 true);
+                               
+                               if ((attrs != null) && attrs.Length>0) {
+                                       return attrs[0].Company;
                                }
 
-                               st=new StackTrace();
-                               return 
st.GetFrame(st.FrameCount-1).GetMethod().DeclaringType.Namespace;
+                               return 
Assembly.GetEntryAssembly().GetName().Name;
                        }
                }
 
@@ -193,7 +185,7 @@
 
                public static string LocalUserAppDataPath {
                        get {
-                               return 
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
+                               return 
Path.Combine(Path.Combine(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
 CompanyName), ProductName), ProductVersion);
                        }
                }
 
@@ -246,7 +238,7 @@
 
                public static string UserAppDataPath {
                        get {
-                               return 
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
+                               return 
Path.Combine(Path.Combine(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
 CompanyName), ProductName), ProductVersion);
                        }
                }
 

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2005-03-29 21:57:35 UTC (rev 42359)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2005-03-29 22:10:44 UTC (rev 42360)
@@ -1,5 +1,13 @@
-2005-03-18  Stefan Buehler  <[EMAIL PROTECTED]>
+2005-03-29  Peter Bartok  <[EMAIL PROTECTED]>
 
+       * Application.cs:
+         - Properly implemented CompanyName property
+         - Fixed LocalUserAppDataPath and UserAppDataPath, now properly 
+           returns a path that includes CompanyName, ProductName and 
+           Version (fixes bug #70330)
+
+2005-03-29  Stefan Buehler  <[EMAIL PROTECTED]>
+
        * TabPage.cs: Don't use Owner.DisplayRectangle unless owner is valid, 
          fixes bug #72588.
 

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to