想学些Sidebar Gadget编程,发现网上相关的资料太少了,基本上都是入门教程,连个参考手册都没有。于是把MSDN上的资料整理一下,列出Sidebar Gadget可用的系统对象及相关的属性和函数:
System.Contact Object
System.ContactManager Object
System.Debug Object
System.Diagnostics.EventLog Object
System.Environment Object
System.Gadget Object
System.Gadget.Flyout Object
System.Gadget.Settings Object
System.Gadget.Sidebar Object
System.Gadget.SideShow Object
System.Machine Object
System.Machine.CPU Object
System.Machine.PowerStatus Object
System.MessageStore Object
System.MessageStoreFolder Object
System.MessageStoreMessage Object
System.Network.Wireless Object
System.Shell Object
System.Shell.Folder Object
System.Shell.Item Object
System.Shell.RecycleBin Object
System.ShellDrive Object
System.Sound Object
System.Time Object
System.Time.TimeZone Object
下面是具体信息和用法:
System.Contact Object
________________________________________Enables a Microsoft Windows Sidebar gadget to determine the attributes associated with the store of personal contacts. Once an object is created with System.ContactManager.Contacts, that object's information can be read with the associated System.Contact attributes.
Property
city
country
defaultEmail
displayName
filePath
homePhone
mobilePhone
pobox
postalCode
state
street
workPhone
System.ContactManager Object
________________________________________Enables a Microsoft Windows Sidebar gadget to retrieve information from the store of personal contacts, from a single index location within the store, and returned as an object which can be used with the System.Contact object and methods.
Collection
System.ContactManager.Contacts
System.Debug Object
________________________________________Exposes a method that allows for debugging functionality of a running Microsoft Windows Sidebar gadget by outputting strings containing debugging information.
Method
outputString
System.Diagnostics.EventLog Object
________________________________________Returns the contents of the specified Event Viewer event log.
Method
writeEntry(strEventLogEntry [, strEventType])
System.Environment Object
________________________________________Used to derive environment information regarding the user's current session in which Microsoft Windows Sidebar is running. Any value that can be viewed using the Microsoft? disk operating system (DOS) SET command from inside of a CMD.EXE shell can be obtained with this interface.
Property
machineName
Method
getEnvironmentVariable(strEnv)
System.Gadget Object
________________________________________Defines methods, events and properties that are used to identify and specify gadget configuration options within the Microsoft Windows Sidebar environment.
Property
background
docked
name
opacity
path
platformVersion
version
Event
onDock
onSettingsClosed
onSettingsClosing
onShowSettings
onUndock
Method
beginTransition
close
endTransition
System.Gadget.Flyout Object
________________________________________Used within a Microsoft Windows Sidebar gadget to determine flyout prompt properties.
Property
document
file
show
Event
onHide
onShow
System.Gadget.Settings Object
________________________________________This object and its methods are used to see if there are stored settings for the gadget, such as when settings are checked and loaded that were previously saved from an earlier session of a particular gadget instance.
Method
read
readString
write
writeString
Property
settingsUI
System.Gadget.Settings.ClosingEvent Object
________________________________________Defines properties and methods that are used to identify and specify cancellation handlers for the gadget settings process.
Property
action
cancel
cancellable
closeAction
System.Gadget.Sidebar Object
________________________________________This object contains properties and events that allow a gadget to customize its behavior to the Microsoft Windows Sidebar. For instance, the user can place the Sidebar on the left side of the screen, and a gadget developer can instead opt to implement left-aligned graphics.
Event
onDockSideChanged
Property
dockSide
System.Gadget.SideShow Object
________________________________________Allows gadget script code to provide and retrieve information applicable to the SideShow information appliance on portable devices, including text and images.
Event
applicationEvent
Method
addImage
addText
remove
removeAll
setFriendlyName
Property
enabled
System.Machine Object
________________________________________Exposes properties used to determine the characteristics associated with the processor hardware and memory configuration of the physical machine on which Microsoft Windows Sidebar is running the current gadget.
Collection
System.Machine.CPUs
Property
availableMemory
processorArchitecture
totalMemory
System.Machine.CPU Object
________________________________________Exposes properties used to determine the characteristics associated with the central processing units of the machine hosting the gadget.
Property
name
usagePercentage
System.Machine.PowerStatus Object
________________________________________Enables the ability within a Microsoft Windows Sidebar gadget to determine power characteristics of the current machine. Detects whether or not a battery is actually present (or detectable) in the system, but only if the system is not currently on AC power. The AC power state is mutually exclusive to the battery state.
Event
powerLineStatusChanged
Property
batteryCapacityRemaining
batteryCapacityTotal
batteryPercentRemaining
batteryStatus
enumBatteryStatus
isBatteryCharging
isPowerLineConnected
System.MessageStore Object
________________________________________Enables the ability within a Microsoft Windows Sidebar gadget to determine folder characteristics of a given folder within the system message store.
Collection
Folders
System.MessageStoreFolder Object
________________________________________Enables the ability within a Microsoft Windows Sidebar gadget to determine message characteristics, given a folder in the system's message store.
Collection
System.MessageStoreFolder.Messages
System.MessageStoreMessage Object
________________________________________Enables properties for a Microsoft Windows Sidebar gadget that determine the properties associated with the store of personal contacts. Once an object is created with System.MessageStoreFolder.Messages, that object can be used with the associated System.MessageStoreMessage properties.
Property
body
from
subject
to
System.Network.Wireless Object
________________________________________This object's properties and events allow a gadget to discover wireless network interface settings on the Microsoft Windows system currently running the gadget.
Event
connectionChanged
signalStrengthChanged
Property
address
ipv6Address
primaryDNSAddress
secureConnection
signalStrength
ssid
System.Shell Object
________________________________________Enables the ability within a Microsoft Windows Sidebar gadget to use properties and objects from the Windows shell.
Method
chooseFile
chooseFolder
drive
execute
itemFromFileDrop
itemFromPath
knownFolder
knownFolderPath
refreshDesktop
saveFileDialog
System.Shell.Folder Object
________________________________________Provides a means to programmatically allow a Microsoft Windows Sidebar gadget to mimic Windows Explorer file management operations, such as copying, moving, and obtaining item information within folders.
Collection
System.Shell.Folder.Items
Method
copyHere
moveHere
newFolder
parse
Property
Parent
Self
System.Shell.Item Object
________________________________________Enables properties to use with a System.Shell.Folder.System.Shell.Folder.Items object to determine a shell item's characteristics.
Method
invokeVerb
metadata
Property
isFile
isFileSystem
isFolder
isLink
link
modifyDate
name
path
SHFolder
size
type
System.Shell.RecycleBin Object
________________________________________Allows a Microsoft Windows Sidebar gadget to determine the Recycle Bin behaviors and settings (for example, file count and folder count).
Event
onRecycleBinChanged
Method
deleteItem
emptyAll
showRecycleSettings
Property
fileCount
folderCount
sizeUsed
System.ShellDrive Object
________________________________________Enables a Microsoft Windows Sidebar gadget to gain access to properties and methods associated with an instance of a drive object, previously created with the System.Shell.drive method, for use within a Sidebar gadget script. Drive characteristics of the retrieved object (for example, type of drive, or volume label) can be determined.
Property
driveFormat
driveLetter
driveType
freeSpace
isReady
rootDirectory
totalFreeSpace
totalSize
volumeLabel
System.Sound Object
________________________________________Allows a gadget to determine sound characteristics such as volume and the location from which a sound file should be played.
Method
beep
playSound
System.Time Object
________________________________________Allows a gadget to determine time standards based on characteristics of the system.
Collection
System.Time.TimeZones
Method
getLocalTime
Property
currentTimeZone
System.Time.TimeZone Object
________________________________________Represents a time zone object from a collection.
Property
bias
displayName
DSTBias
DSTDate
DSTName
name
standardBias
standardDate
STDName