Changeset 1789


Ignore:
Timestamp:
02/10/10 02:37:56 (5 years ago)
Author:
lowjoel
Message:

Instead of throwing an ArgumentNullException? when querying the system RTL status, use an available form or create one, in that order and check against those controls instead.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eraser6/CodeReview/Eraser.Util/Localisation.cs

    r1778 r1789  
    8080        public static bool IsRightToLeft(Control control) 
    8181        { 
    82             if (control == null) 
    83                 throw new ArgumentNullException("control"); 
    84  
    8582            while (control != null) 
    8683            { 
     
    9592                        break; 
    9693                } 
     94            } 
     95 
     96            if (Application.OpenForms.Count > 0) 
     97            { 
     98                return IsRightToLeft(Application.OpenForms[0]); 
     99            } 
     100            else 
     101            { 
     102                using (Form form = new Form()) 
     103                    return IsRightToLeft(form); 
    97104            } 
    98105        } 
Note: See TracChangeset for help on using the changeset viewer.