Recommended Practices

Suggestions around how to most effectively use these APIs.

Wrap the generic APIs in an application specific layer, abstracting out repeated items. Take the following example where use have two different types of typical text types on a label – a header and a normal font with the only difference being the font size used.

public static IZebraCommand HeaderText(string text, int x, int y)
{
  return ZebraCommands.TextCommand(x, y, ElementRotation.NO_ROTATION, 
            *StandardZebraFont.LARGEST*, 1, 1, false, text);
    }


    public static IZebraCommand NormalText(string text, int x, int y)
    {
      return ZebraCommands.TextCommand(x, y, ElementRotation.NO_ROTATION,                
                *StandardZebraFont.NORMAL*, 1, 1, false, text);
    }
}

Last edited Aug 16, 2007 at 8:54 PM by thekua, version 2

Comments

No comments yet.