Scf.Em Method
Creates a Simple Content Format Em element.
Namespace: Microsoft.SideShow.SimpleContentFormat
Assembly: Microsoft.SideShow (in microsoft.sideshow.dll)
Usage
Syntax
'Declaration
Public Shared Function Em ( _
ParamArray content As Object() _
) As ScfElement
public static ScfElement Em (
params Object[] content
)
public:
static ScfElement^ Em (
... array<Object^>^ content
)
public static ScfElement Em (
Object[] content
)
public static function Em (
... content : Object[]
) : ScfElement
Parameters
- content
An array of ScfElement objects that make up this element's content.
Return Value
An ScfElement object that represents a text emphasis element.
Example
This example code shows how to emphasize text content using the Em method.
private static void SampleEm()
{
// Set the gadget's GUID.
Guid gadgetId = new Guid("{0530B726-F6D5-4a66-900E-3C7673316F3B}");
// Add the gadget's registry subkey and values.
GadgetRegistration.Register(
false, // Register gadget for current user only
gadgetId, // Guid for the registry subkey
ScfSideShowGadget.ScfEndpointId, // Endpoints registry value
"Example SideShow gadget", // FriendlyName registry value
null, // StartCommand registry value
null, // Icon registry value, this gadget will use the generic gadget icon.
false, // OnlineOnly registry value
GadgetCachePolicies.KeepNewest, // CachePolicy registry value
null);
// Construct a Simple Content Format SideShow gadget for the gadget's Guid.
using (ScfSideShowGadget gadget = new ScfSideShowGadget(gadgetId))
{
// Add Glance content.
gadget.AddGlanceContent(
String.Format("Some glance content"));
// Set element ids;
int mainMenuPageId = 1;
int page1Id = 2;
int menuItem1Id = 3;
// The menu page.
string content =
Scf.Body(
Scf.Menu(mainMenuPageId, "Main Menu", ScfSelectAction.Target,
// The word "excited" will be emphasized, the rest of the Txt content will not be emphasized.
Scf.Txt(ScfAlign.Left, true, Color.Blue, "You should be so ", Scf.Em("excited"), " that you don't have to write your own xml."),
Scf.Item(menuItem1Id, "Navigate to content page.")));
gadget.AddContent(content);
// The content page.
string page1 = Scf.Body(
Scf.Content(page1Id, "Page 1 Title",
// The word "Wow!" is emphasized.
Scf.Txt(ScfAlign.Left, true, Color.Blue, Scf.Em("Wow!"), "I expect the wow to be bold but its all up to the device.")));
gadget.AddContent(page1);
}
}
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Platforms
Development Platforms
Windows Vista Home Premium, Windows Vista Business, Windows Vista Enterprise, Windows Vista Ultimate
Target Platforms
Windows Vista Home Premium, Windows Vista Business, Windows Vista Enterprise, Windows Vista Ultimate
See Also
Reference
Scf Class
Scf Members
Microsoft.SideShow.SimpleContentFormat Namespace