Exemplo n.º 1
0
 /// <summary>
 /// Assigns the value for the given key in the styles of the given cells, or
 /// removes the key from the styles if the value is null.
 /// </summary>
 /// <param name="model">Model to execute the transaction in.</param>
 /// <param name="cells">Array of cells to be updated.</param>
 /// <param name="key">Key of the style to be changed.</param>
 /// <param name="value">New value for the given key.</param>
 public static void SetCellStyles(mxIGraphModel model, Object[] cells, String key, String value)
 {
     if (cells != null && cells.Length > 0)
     {
         model.BeginUpdate();
         try
         {
             for (int i = 0; i < cells.Length; i++)
             {
                 if (cells[i] != null)
                 {
                     String style = SetStyle(
                         model.GetStyle(cells[i]),
                         key, value);
                     model.SetStyle(cells[i], style);
                 }
             }
         }
         finally
         {
             model.EndUpdate();
         }
     }
 }