private void cssHoriz_Validating(object sender, CancelEventArgs e)
 {
     if (this.bsHoriz.Current != null)
     {
         string reason            = String.Empty;
         Library.HorizontalZone h = (this.bsHoriz.Current) as Library.HorizontalZone;
         if (Library.CSSValidation.CSSValidate(this.cssHoriz.Text, false, out reason, h.CSS))
         {
             if (this.modified != null)
             {
                 this.modified(this, e);
             }
         }
     }
 }
 private void btnOptionsHoriz_Click(object sender, EventArgs e)
 {
     if (this.optHoriz != null && !this.optHoriz.IsDisposed)
     {
         Library.HorizontalZone hz = this.bsHoriz.Current as Library.HorizontalZone;
         this.optHoriz.CSS = hz.CSS;
         optHoriz.Attribs  = hz.Attributes;
         this.optHoriz.Show();
     }
     else
     {
         Library.HorizontalZone hz = this.bsHoriz.Current as Library.HorizontalZone;
         this.optHoriz      = new Attributes("HorizontalAreaStringified", hz.Name, hz.CountLines.ToString());
         this.optHoriz.CSS  = hz.CSS;
         optHoriz.Attribs   = hz.Attributes;
         optHoriz.modified += new EventHandler(this.CurrentItemChanged);
         optHoriz.Show();
     }
 }
 void bsZoneHoriz_DataSourceChanged(object sender, EventArgs e)
 {
     Library.HorizontalZone horiz = this.bsHoriz.Current as Library.HorizontalZone;
     if (horiz != null)
     {
         this.grpHHt.Enabled          = true;
         this.grpHLng.Enabled         = true;
         this.btnOptionsHoriz.Enabled = true;
         this.cssHoriz.Enabled        = true;
         this.cssHoriz.Text           = "";
         foreach (string key in horiz.CSS.Body.AllKeys)
         {
             this.cssHoriz.Text += key + ":" + horiz.CSS.Body[key] + ";" + Environment.NewLine;
         }
         this.bsVert.DataSource  = this.bsHoriz.Current;
         this.lstVert.DataSource = this.bsVert;
         if (this.optHoriz != null)
         {
             this.optHoriz.UpdateText("HorizontalAreaStringified", horiz.Name, horiz.CountLines.ToString());
             this.optHoriz.Attribs = horiz.Attributes;
             this.optHoriz.CSS     = horiz.CSS;
         }
     }
     else
     {
         this.btnOptionsHoriz.Enabled = false;
         this.grpHHt.Enabled          = false;
         this.grpHLng.Enabled         = false;
         this.cssHoriz.Enabled        = false;
         this.cssHoriz.Text           = "";
         if (this.optHoriz != null)
         {
             this.optHoriz.Hide();
         }
     }
 }