cadencii.windows.forms.RebarBand.UpdateColors C# (CSharp) Method

UpdateColors() protected method

protected UpdateColors ( ) : void
return void
        protected void UpdateColors() {
            if ( Created ) {
                REBARBANDINFO rbBand = new REBARBANDINFO();
                rbBand.cbSize = (uint)Marshal.SizeOf( rbBand );
                rbBand.fMask = (uint)win32.RBBIM_COLORS;
                if ( _useCoolbarColors ) {
                    rbBand.clrBack = new COLORREF();
                    rbBand.clrBack._ColorDWORD = (uint)win32.CLR_DEFAULT;
                    rbBand.clrFore = new COLORREF();
                    rbBand.clrFore._ColorDWORD = (uint)win32.CLR_DEFAULT;
                } else {
                    rbBand.clrBack = new COLORREF( _backColor );
                    rbBand.clrFore = new COLORREF( _foreColor );
                }

                if ( win32.SendMessage( _bands.Rebar.RebarHwnd, (int)win32.RB_SETBANDINFOA, BandIndex, ref rbBand ) == 0 ) {
                    int LastErr = Marshal.GetHRForLastWin32Error();
                    try {
                        Marshal.ThrowExceptionForHR( LastErr );
                    } catch ( Exception ex ) {
                        Console.WriteLine( LastErr + " " + ex.Message );
                        if ( _throwExceptions ) throw (new Exception( "Error Updating Foreground and Background Colors.", ex ));
                    }

                }
            }
        }