Developer, Former MVP, now at Microsoft - Best of 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013
bool registerForAllUsers = false;Guid gadgetId = new Guid("{65EA3E9A-8F83-4139-8139-94DE7E4149B0}");string startCmd = String.Empty;string iconPathNameAndResourceId;bool onlineOnly = false;Guid? propertyPage = null;GadgetRegistration.Register(registerForAllUsers, gadgetId, ScfSideShowGadget.ScfEndpointId, "The Moth", startCmd, iconPathNameAndResourceId, onlineOnly, GadgetCachePolicies.KeepOldest, propertyPage);
GadgetRegistration.Unregister(registerForAllUsers, gadgetId);
ScfSideShowGadget gadget = new ScfSideShowGadget(new Guid("{65EA3E9A-8F83-4139-8139-94DE7E4149B0}")); // send content to device
gadget.AddGlanceContent("some short summary \r\n" + DateTime.Now.ToLongTimeString() + "\r\n http://www.danielmoth.com/Blog \r\n Even more text all the way to the \r\n bottom");
string path = @"C:\Users\Public\Pictures\SideShow\";string b = path + "SSForest.jpg";string d = path + "SSgarden.jpg";string m = path + "SSmenu.jpg";string r = path + "SSdive.jpg";gadget.AddContent(MothImages.Background, ImageContentTransforms.None, new Bitmap(b));gadget.AddContent(MothImages.DialogIcon, ImageContentTransforms.KeepAspectRatio ImageContentTransforms.StretchToFit, new Bitmap(d));gadget.AddContent(MothImages.MenuIcon, ImageContentTransforms.ReduceColorDepth, new Bitmap(m));gadget.AddContent(MothImages.RandomImage, ImageContentTransforms.None, new Bitmap(r));
MothImages
AddContent
gadget.AddContent(MainMenuPage); //MainMenuPage is a property that returns a stringgadget.AddContent(ContextMenuPage); // ContextMenuPage is a property that returns a stringgadget.AddContent(ContentPageA); // ContentPageA is a property that returns a stringgadget.AddContent(ContentPageB); // ContentPageB is a property that returns a stringgadget.AddContent(ContentPageC); // ContentPageC is a property that returns a stringgadget.AddContent(DialogPage); // DialogPage is a property that returns a string
public static string MainMenuPage{ get { string content; content = File.ReadAllText("page1.xml"); return content; }}
content = Scf.Body( Scf.Menu(MothPages.MainMenu, "Main Menu Moth", ScfSelectAction.Target, Scf.Item(MothPages.SomeText, "Points to 1st content page"), // 1st overload Scf.Item(MothImages.MenuIcon, null, MothPages.WithImage, "Click for 2d one"), //2nd overload Scf.Item(null, MothPages.ContextMenu, MothPages.MixedText, "This adds to the context menu"), // 2nd overload with context menu Scf.Div(), Scf.Item(MothMenuIds.Open, MothImages.MenuIcon, null, MothPages.DialogExample, "Shows dialog"), //3rd overload Scf.Item(null, MothImages.MenuIcon, true, true, null, MothPages.MixedText, "IsDefault and points to 3rd content page"), // 4th overload Scf.Item(null, MothImages.MenuIcon, false, false, null, MothPages.DialogExample, "I am !enabled"), // 4th overload, default & enabled Scf.Btn(DeviceButton.Right, "Won't show up", MothPages.ContextMenu) ) );
Moth