Example #1
0
 /// <summary>
 /// Comparison implementation
 /// </summary>
 /// <param name="obj"></param>
 /// <returns></returns>
 public int CompareTo(object obj)
 {
     if (obj is DisplayLayer)
     {
         DisplayLayer other = (DisplayLayer)obj;
         return(DisplayOrdering.CompareTo(other.DisplayOrdering));
     }
     return(0);
 }
 /// <summary>
 /// Draw all visible layers
 /// </summary>
 /// <param name="parameters"></param>
 public void Draw(RenderingParameters parameters)
 {
     for (int i = 0; i < Layers.Count; i++)
     {
         DisplayLayer layer = Layers[i];
         if (layer.Visible)
         {
             layer.Draw(parameters);
         }
     }
 }
 /// <summary>
 /// Load the specified layer type into the layer table.
 /// </summary>
 /// <param name="layerType">The type of layer to load.  Must derive from DisplayLayer.</param>
 /// <returns></returns>
 public bool LoadLayer(Type layerType)
 {
     if (typeof(DisplayLayer).IsAssignableFrom(layerType) && !layerType.IsAbstract)
     {
         if (!Layers.ContainsType(layerType))
         {
             DisplayLayer dLayer = (DisplayLayer)Activator.CreateInstance(layerType);
             Layers.Add(dLayer);
             return(true);
         }
     }
     return(false);
 }