Ejemplo n.º 1
0
 private IView BuildView(Color?bottomBorderColor, ContentAlignment alignment)
 {
     return(new Cell
     {
         ElementText = new TextRenderer(),
         TextAlignment = alignment,
         Border = BuildBorder(bottomBorderColor)
     });
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Initializes the overrideable defaults to their initial default values.
        /// </summary>
        /// <remarks>The first thread to load this class will initialize its own copies of these thread-wide defaults
        /// automatically.  Other threads will initialize their own copies of these defaults upon first access, or
        /// they may call this method to force initialization.  It is safe to call this more than once, but
        /// only the first call has an effect.  Thereafter the same initialized defaults in this class are
        /// shared across the entire UI thread (but not between threads), including any changes to these defaults.
        /// This is necessary to avoid sharing the System.Windows.Forms.Cursor objects between threads in a
        /// multi-UI-thread scenario and other un-threadsafe issues.</remarks>
        public static void Initialize()
        {
            if (t_Initialized) // Only do this once per thread.
            {
                return;
            }

            t_DefaultBorder = new RectangleBorder(new BorderLine(Color.LightGray, 1),
                                                  new BorderLine(Color.LightGray, 1));
            t_DefaultPadding   = new DevAge.Drawing.Padding(2);
            t_DefaultBackColor = Color.FromKnownColor(KnownColor.Window);
            t_DefaultForeColor = Color.FromKnownColor(KnownColor.WindowText);
            t_DefaultAlignment = DevAge.Drawing.ContentAlignment.MiddleLeft;
            t_Initialized      = true; // Mark this thread as initialized, so we don't override these again.
        }