Vous êtes sur la page 1sur 75

ueskLop Sldebar

age 1
SEMINAR REPORT
ON
DESKTOP SIDEBAR

BACHELOR OF TECHNOLOGY
(COMPUTER SCIENCE AND TECHNOLOGY)
SUBMITTED BY:
A1AY DAHIYA
Roll No. 3408053


Department of computer science and engineering
S. D. Institute of Technology & Management
Israna - 132107 (Panipat)
Kurukshetra University
ueskLop Sldebar


age 2
ACKNOWLEDGEMENT


I, MOHIT AHLAWAT student oI B.Tech 7th semester, studying at College SDITM ISRANA
hereby declare that the Training report on 'Desktop side bar submitted to Kurukshetra University
Kurukshetra in partial IulIillment oI Degree oI B.Tech is the original work conducted by me.
The inIormation and data given in the Training report is authentic to the best oI my knowledge. This
Project report is not being submitted to any other university Ior award oI any other Degree or
Diploma.




Mohit Ahlawat
3408052












ueskLop Sldebar


age 3
Introduction:
Desktop Sidebar is a side bar application to provide users with RSS feeds on their
desktop.
The application provides user the convenience of receiving new feeds and updates
on their desktop without visiting the website directly in the browser. The application
also provides notifications for updated and new feeds through e-mail like toast to the
user and previewing of feeds within the application.
The application consists of two major components:
1. A Desktop Sidebar
2. An RSS Gadget for SharePoint feeds.
The overall design of the application and inter relation of classes has been depicted
below:
ueskLop Sldebar


age 4
omponent Description:
O Desktop Sidebar: Desktop sidebar is a sidebar application that acts as a container for
the gadgets. t provides various features of an appbar application such as auto hide and
docking. t also provides a user interface for gadgets that it contains. t uses following
classes:
CIass Name: ShellAP
ShellAP class exposes functions that are used to interact with the shell to provide the
appbar functionality such as register the application to OS, unregister it, rendering of
appbar etc.
Name 1ype Scope keturn
1ype
arameters Descr|pt|on
8u@ SLrucLu
re
publlc @ls ls a sLrucLure LaL
sends appbar daLa suc as
slzedlsplay
recLanglewlndow andle
reference of appbar Lo Le
sysLem
@ SLrucLu
re
publlc @ls sLrucLure ls used Lo
speclfy Le recLangle
dlmenslons ln wlc Le
appbar ls rendered
SPpp8arMessage MeLo
d
publlc ulnL32 ulnL32
dwMessage
ref
8u
@ puaLa
Sends an appbar message
Lo Le sysLem
eglsLerWlndowMessage MeLo
d
publlc ulnL32 SLrlng
lpSLrlng
@e
eglsLerWlndowMessage
funcLlon deflnes a new
wlndow message LaL ls
guaranLeed Lo be unlque
LrougouL
Le sysLem @e message
ueskLop Sldebar


age 3
value can be used wen

ueskLop Sldebar


age 6
CIass Name: Sidebar
This class uses the functions exposed by ShellAP class and is inherited by the
DesktopSidebar class to implement sidebar functionalities. This class inherits from the
System.Windows.Forms class.

Name 1ype Scope keturn
1ype
arameters Descr|pt|on
pp8ardges num publlc @ls ls an enum for
edges Lo wlc appbar
can be docked
pp8arMessages num publlc @ls ls an enum for
messages wlc
appbar sends Lo Le
sell suc as new Lo
creaLe a new appbar
remove Lo unreglsLer
appbar eLc
pp8arnoLlflcaLlons num publlc @ls ls an enum for
noLlflcaLlons wlc
appbar sends Lo Le
sell suc as wlndow
poslLlon canged eLc
pp8arSLaLes num publlc @ls ls an enum for
sLaLes of appbar eg
auLo lde normal eLc
WM num publlc @ls ls an enum for
wlndow messages eg
cLlvaLe nPlLLesL
MouseoslLlonode
s
num publlc @ls ls an enum for
mouse poslLlons wlL
ueskLop Sldebar


age 7
respecL Lo appbar
ppbarnew meLo
d
prlvaLe bool @o creaLe a new
lnsLance of appbar
ppbaremove meLo
d
prlvaLe bool @o remove an lnsLance
of appbar
ppbarcLlvaLe meLo
d
prlvaLe vold Sends acLlvaLe
message Lo Le sysLem
ppbarWlndowos
anged
meLo
d
prlvaLe vold Sends wlndow poslLlon
canged message Lo
sysLem
ppbarCueryos meLo
d
prlvaLe vold ref
Sellpl@
appecL
@o query Le poslLlon
for appbar
ppbarSeLos meLo
d
prlvaLe vold ref
Sellpl@
appecL
@o seL Le poslLlon of
appbar
eglsLerallbackMes
sage
meLo
d
prlvaLe ulnL32 eglsLers wlndow
messages Lo CS
Slzepp8ar meLo
d
prlvaLe vold ueLermlnes and seLs
slze of Le appbar
CnppbarnoLlflcaLlo
n
meLo
d
prlvaLe vold ref Message
msg
Pandles Le
noLlflcaLlons senL by
appbar
CnncPlL@esL meLo
d
prlvaLe vold ref Message
msg
Pandles ncPlLLesL
message
Wndroc meLo
d
proLecL
ed
vold ref Message
msg
Pandles wlndows
messages
CnLoad meLo
d
proLecL
ed
vold venLrgs e SeLs appbar properLles
on load
ueskLop Sldebar


age 8
Cnloslng meLo
d
proLecL
ed
vold ancelvenL
rgs e
unreglsLers appbar on
close evenL
Moveln meLo
d
publlc vold lorm ob[ecL lf auLolde enabled
Lls funcLlon ldes
sldebar wen focus ls
noL on Le sldebar
MoveouL meLo
d
publlc vold lorm ob[ecL lf auLolde enabled
Lls funcLlon sows
sldebar wen focus ls
on Le sldebar
CnSlzeanged meLo
d
proLecL
ed
vold venLrgs e Pandles reslze evenL
of appbar
dge proper
Ly
publlc SeLs Le edge Lo wlc
appbar wlll be docked
uLolde proper
Ly
publlc SeLs Le appbar sLaLe
as auLo lde















ueskLop Sldebar


age 9
CIass Name: DesktopSidebar: Sidebar
This class inherits Sidebar class. t exposes all the properties of Sidebar as well as all
System.Windows.Forms properties.
Name 1ype Scope
keturn
1ype
aramete
r
Descr|pt|on
MalnMenu onLexL
Menu
proLecLe
d
Menu wlc as
opLlon llke
docklng auLo
lde close eLc
SysLem@rayMenu onLexL
Menu
publlc Pas opLlon uLo
Plde lose
lloaL bouL eLc
SerlallzeCadgeLonLalnerS
LaLe
MeLod prlvaLe Save Le sLaLe of
CadgeLs
onLalner anel
Lo a flle
deskLopgdL
ueserlallzeCadgeLonLaln
erSLaLe
MeLod rlvaLe CeL Le sLaLe of
CadgeL
onLalner panel
from flle
deskLopgdL
before loadlng
Le form







ueskLop Sldebar


age 10

CIass Name: GadgetContainer [Serializable]

This class inherits from the System.Windows.Forms.Panel class. t exposes all the
properties of a panel as well as user defined properties to be used for the gadget's U. This
provides a placeholder for the gadget in the sidebar.
Name 1ype Scope keturn
1ype
arameter
s
Descr|pt|on
CadgeLPeader8golor roperL
y
publlc SeLs Le eader background
color of Le gadgeL
CadgeLPeader8glmage roperL
y
publlc SeLs Le eader background
lmage of Le gadgeL
CadgeLPeadernabled roperL
y
publlc SeLs Le eader vlslblllLy of
Le gadgeL
CadgeLPeaderloreolor roperL
y
publlc SeLs Le eader forecolor of
Le gadgeL
CadgeLPeaderPover8go
lor
roperL
y
publlc SeLs Le eader background
color of Le gadgeL wen
mouse overs on lL
CadgeLPeaderPoverlmag
e
roperL
y
publlc SeLs Le eader background
lmage of Le gadgeL wen
mouse overs on lL
CadgeLPeaderPoverlore
olor
roperL
y
publlc SeLs Le eader lorecolor
of Le gadgeL wen mouse
overs on lL
CadgeLPeaderlonLSLyle roperL
y
publlc SeLs Le eader fonL sLyle
of Le gadgeL
CadgeLPeaderlconlmage roperL
y
publlc SeLs Le eader lcon lmage
of Le gadgeL
ueskLop Sldebar


age 11
CadgeLPeaderPelgL roperL
y
publlc SeLs Le eader elgL of
Le gadgeL
CadgeLCadgeL8golor roperL
y
publlc SeLs Le background color
of Le gadgeL
CadgeLCadgeL8glmage roperL
y
publlc SeLs Le background lmage
of Le gadgeL
CadgeLupScroll8uLLonlm
age
roperL
y
publlc SeLs Le lmage for up scroll
buLLon of gadgeL
CadgeLuownScroll8uLLon
lmage
roperL
y
publlc SeLs Le lmage for down
scroll buLLon of gadgeL
CadgeLloreolor roperL
y
publlc SeLs Le lorecolor of Le
gadgeL
CadgeLrlmarylonLSLyle roperL
y
publlc SeLs Le fonL sLyle of
conLrols on Le gadgeL
CadgeLSecondarylonLSLyl
e
roperL
y
publlc SeLs Le fonL sLyle of
conLrols on Le gadgeL
CadgeLSLaLusbar8golor roperL
y
publlc SeLs Le SLaLus bar
background color of Le
gadgeL
CadgeLSLaLusbar8glmage roperL
y
publlc SeLs Le SLaLus bar
background lmage of Le
gadgeL
CadgeLSLaLusbarnabled roperL
y
publlc SeLs Le SLaLus bar vlslblllLy
of Le gadgeL
CadgeLSLaLusbarloreolo
r
roperL
y
publlc SeLs Le SLaLus bar
forecolor of Le gadgeL
CadgeLSLaLusbarPover8g
olor
roperL
y
publlc SeLs Le SLaLus bar
background color of Le
gadgeL wen mouse overs
ueskLop Sldebar


age 12
on lL
CadgeLSLaLusbarPoverlm
age
roperL
y
publlc SeLs Le SLaLus bar
background lmage of Le
gadgeL wen mouse overs
on lL
CadgeLSLaLusbarPoverlo
reolor
roperL
y
publlc SeLs Le SLaLus bar
lorecolor of Le gadgeL
wen mouse overs on lL
CadgeLSLaLusbarlonLSLyl
e
roperL
y
publlc SeLs Le SLaLusbar fonL
sLyle of Le gadgeL
CadgeLSLaLusbarPelgL roperL
y
publlc SeLs Le SLaLusbar elgL of
Le gadgeL
ddCadgeL MeLod publlc SSCadgeL
gadgeL
MeLod Lo add a new
gadgeL Lo Le sldebar
emoveCadgeL MeLod publlc SSCadgeL
gadgeL
MeLod Lo remove gadgeL
from Le sldebar
SwapCadgeLs MeLod publlc SSCadgeL
gadgeL
MeLod Lo swap gadgeLs
wlLln sldebar Lo cange
Lelr locaLlon
SeLCadgeLLocaLlon MeLod publlc SSCadgeL
gadgeL
MeLod Lo seL locaLlon of
gadgeL









ueskLop Sldebar


age 13


CIass Name: Subscription
This class exposes methods to subscribe and unsubscribe to RSS feed urls.
Name 1ype Scope keturn
1ype
arameter
s
Descr|pt|on
dduL MeLod publlc vold SLrlng
feeduL
dds Le feed url Lo Le
urlxml flle Lo feLc feeds
fron Le same
emoveuL MeLod publlc vold SLrlng
feeduL
emoves Le feed url from
Le urlxml flle
LoaduL MeLod publlc vold SLrlng
fllepaL
Loads Le urls from urlxml

















ueskLop Sldebar


age 14

RSS Gadget:
RSS gadget is a user control that fetches, reads and displays RSS feeds to the user.
This control is placed on the sidebar as a sidebar gadget. t uses following classes:











ueskLop Sldebar


age 13

CIass Name: RSSPreview

This class is used to show the preview of the fetched feeds to the user in a reading pane
that can be docked or undocked depending upon the user preference.
Name 1ype Scope keturn
1ype
arameter
s
Descr|pt|on
revlew@lLle@exL roperL
y
publlc SeLs Le eader LexL of
prevlew wlL feed's LlLle
revlewuescrlpLlon@exL roperL
y
publlc SeLs Le LexL of prevlew
wlL feed's descrlpLlon
revlewuL roperL
y
publlc SeLs Le llnk of prevlew
wlL feed's llnk
















ueskLop Sldebar


age 16

CIass Name: NotificationWindow

This class is used to show the notification of the new or updated feeds to the user. This
class inherits the Sysem.Windows.Forms.Form Class.
Name 1ype Scope keturn
1ype
arameter
s
Descr|pt|on
noLlfy@lLle roperL
y
publlc SeLs Le eader LexL of
noLlflcaLlon popup wlL
feed's LlLle
noLlfyMessage roperL
y
publlc SeLs Le LexL of noLlflcaLlon
popup wlL feed's
descrlpLlon and auLor
noLlfyuL roperL
y
ubllc SeLs Le llnk of popup wlL
feed's llnk
noLlfylconlmage roperL
y
ubllc SeLs Le lmage of popup
noLlfylconSlze roperL
y
ubllc SeLs Le lmage slze of
popup
noLlfylcon8orderSLyle roperL
y
ubllc SeLs Le lmage border sLyle
of popup
noLlfy8ackcolor roperL
y
ubllc SeLs Le back color of
popup
noLlfylose8uLLonlmage roperL
y
ubllc SeL Le noLlflcaLlon
Wlndow's close buLLon
lmage
noLlfy8glmage roperL
y
ubllc SeL Le back ground lmage
of Le noLlflcaLlon Wlndow

ueskLop Sldebar


age 17

CIass Name: DisplayFeed
This class inherits the properties of a System.Windows.Forms.Panel class. This will display
the RSS feeds.
Name 1ype Scope keturn
1ype
aramete
rs
Descr|pt|on
SeLleedlmage MeLod publlc vold lmage
@ype
@ls meLod ls used Lo seL Le leed
lmage
SeLSeparaLorl
mage
MeLod publlc vold lmage
@ype
@ls meLod ls used Lo seL Le
separaLor lmage
evL@lLlellcked evenL prlvaL
e
vold Cb[ecL
venLrgs
@ls ls Le evenL wlc flres wen we
cllck on LlLle
lonLSLyle properLy publlc lonL @ls ls used Lo seL Le fonL slze of
Le @lLle @exL
@lLleloreolor properLy publlc lonL SeL Le color of Le @lLle LexL
uesclpLlonolo
r
properLy publlc lonL SeL Le color of Le uescrlpLlon LexL
uLorolor properLy publlc lonL SeL Le color of Le uLor LexL
@lmeolor properLy publlc lonL SeL Le color of Le @lme LexL
SeparaLorPelg
L
roperLy publlc lnL SeLs Le SeparaLor PelgL
anelPelgL roperLy publlc lnL SeL/CeL Le panel elgL




ueskLop Sldebar


age 18

CIass Name: RSSFeedViewer
This class shows the RSS feeds. This is a user control class. This can be placed within a
Sidebar gadget container.
Name 1ype Scope keturn
1ype
aramete
rs
Descr|pt|on
SeLonLrolSLyle MeLod publlc vold @ls meLod ls used Lo seL Le
background sLyle and LexL fonL color
and sLyle of Le conLrols
Sowleed MeLod prlvaL
e
vold lnL
onLrollnd
ex
reaLe conLrols Lo dlsplay feeds
sow feed on panel
SLarL@read MeLod publlc lnL @ls meLod ls used Lo call Le
leLcSSleed SLarL@read()
SLop@read MeLod publlc lnL @ls meLod ls used Lo call Le
leLcSSleedSLop@read()
CeLScrollableP
elgL
MeLod rlvaL
e
vold @ls meLod ls used Lo ceck weLer
lLems requlre a scrollbar or noL
Scrollanelup MeLod rlvaL
e
vold @ls meLod ls used Lo scroll Le
lLems upwards
Scrollaneluo
wn
MeLod rlvaL
e
vold @ls meLod ls used Lo scroll Le
lLems downwards





ueskLop Sldebar


age 19

CIass Name: FetchRSSFeed
This class will start a thread to fetch RSS Feeds from SharePoint or other RSS' server with
a time interval. t will also check for user credentials for RSS feeds. When it fetched RSS
feeds from server then it will check for updated and new feeds with the help of existing
feeds. f it completed the RSS feeds operation then it will raises an event to
RSSFeedViewer class to show the feeds. t also monitor network issues.
Name 1ype Scope keturn
1ype
arameters Descr|pt|on
leLclnLerval varlable prlvaL
e
@ls ls Le Llme lnLerval for
Lread wlc ls by defaulL 10
seconds and lLs value can be
canged by ppllcaLlon
conflguraLlon flle
SLarL@read MeLod publlc lnL @ls meLod sLarLs Le Lread
Lo feLc SS leeds
SLop@read MeLod publlc lnL @ls meLod ls used Lo sLop
Le Lread
leedleLcer MeLod prlvaL
e
@read worker meLod
CeLSSleed MeLod prlvaL
e
vold ouL
xcepLlon
@ls wlll geL Le SS feed
lLems
SSleedleLcedcomp
leLed
delegaLe publlc vold SSleed
ob[ecL
@ls wlll send a noLlflcaLlon Lo
SSleedvlewer LaL some
feeds ave been feLced
evLleedleLcedom
pleLed
evenL publlc SSleedleL
cedcomple
Led
llres wen all feeds ave been
feLced successfully
ueskLop Sldebar


age 20
ceckredenLlal meLod publlc bool CuL
xcepLlon
eck user credenLlals
CeLLSSleedxML meLod prlvaL
e
sLrlng CuL
xcepLlon
eLurn SS feed as a sLrlng
xML



CIass Name: RSSReader
This class is used to load the current RSS feed in XML Document which are fetched from a
SharePoint or other RSS server. Then it will compare the current RSS Feeds with existing
RSS feeds which are loaded from an existing file. The RSS feeds stored in a file are
serialized data. f it found any RSS feed has been updated or new then it will reset the
modified time and status of the feed (i.e. new, updated, read and removed).
Name 1ype Scope keturn
1ype
arameters Descr|pt|on
updaLeSSleed MeLo
d
publlc vold SLrlng
SSleedolle
cLlon
@ls ls used Lo geL updaLed feeds
comlng from Le SareolnL and
oLer servers
CeLSSleedlrom
node
MeLo
d
prlvaL
e
vold xmlnode
SSleed
@ls ls used Lo seL Le SS leed
from xml node Lo serlallzaLlon
collecLlon
CeLSSlLem meLo
d
publlc SSlLe
m
xmlnode
modlfled@lme
lf feed ls modlfled seL Llme and
geL Le sLaLus of feed le ead
new updaLed or removed
dfMode roper
Ly
publlc bool used Lo ceck weLer SS leed
ls ln dfMode or noL?



ueskLop Sldebar


age 21

CIass Name: RSSFeedCollector
This class will serialize the RSS feed and save to a file on hard disk. When RSS feeds
fetched from a server then it will desterilize the data from existing file and sent the current
feeds XML Data and old feeds to the RSSReader class to check for updates.
Name 1ype Scope keturn
1ype
arameters Descr|pt|on
Serlallzeleed MeLod publlc ef
SSleedollecL
lon
@ls meLod ls used Lo save Le
feed on ard dlsk wlL a flle
name leedrss
ueserlallzelee
d
MeLod publlc ef
SSleedollecL
lon
CeL Le SS feed from Le flle
saved on ard dlsk
updaLeSSlee
d
MeLod ubllc sLrlngxml ef
SSleedollecL
lon
CeL Le updaLed SS leed

Struct Name: RSSFeedCollection
This will contain a class variable for RSSFeeds. This is a serialize structure.
Name 1ype Scope keturn]Data
1ype
arameters Descr|pt|on
m_SSleed varlabl
e
publlc SSleeds onLalns an SSleeds class





ueskLop Sldebar


age 22

CIass Name: RSSFeeds
This class contains a collection of RSSFeed. An RSS feed can be added or removed from
this class. This will inherit properties of CollectionBase class.
Name 1ype Scope keturn
1ype
arameters Descr|pt|on
dd meLod publlc vold SSleed dd lLems Lo collecLlon
emove meLod publlc bool lnL lLemlndex emove lLems from collecLlon


Structure Name: RSSFeed
This will contains all the values of an RSS Feed like title of the feed, descriptive text,
modification time of a feed etc.
Name 1ype keturn]Data
1ype
Scope Descr|pt|on
loud varlable SLrlng ubllc loud of Le feed
@lLle varlable SLrlng ubllc @lLle of Le SS feed
uescrlpLlon varlable SLrlng ubllc uescrlpLlon of SS feed
Llnk varlable SLrlng ubllc uL of SS feed
ubuaLe varlable SLrlng ubllc ubllcaLlon uaLe of SS feed
LasL8ullduaLe varlable SLrlng ubllc Modlfled @lme of SS feed
aLegory varlable SLrlng ubllc aLegory of SS feed
CeneraLor varlable SLrlng ubllc Wo generaLor Le SS
feed?
@Ll varlable SLrlng ubllc @lme Lo llve of SS feed
ueskLop Sldebar


age 23
Sklpours varlable SLrlng ubllc @lme Lo sklp of SS feed
Sklpdays varlable SLrlng ubllc number of days Lo sklp SS
feed
ManaglngdlLor varlable SLrlng ubllc dlLor of Le SS feed
lLems varlable SSlLem ubllc lLem descrlpLlon of SS feed
rrorMessage varlable SLrlng ubllc rror durlng feLclng of SS
feed


CIass Name: RSStems
This class contains a collection of RSStem. An RSS feed items can be added or removed
from this class. This will inherit properties of CollectionBase class.
Name 1ype Scope keturn
1ype
arameters Descr|pt|on
dd meLod publlc vold SSlLem dd lLems Lo collecLlon
emove meLod publlc bool lnL lLemlndex emove lLems from collecLlon









ueskLop Sldebar


age 24

Structure Name: RSStem
This will contains all the values of an RSS Feed items like title of the feed, descriptive text,
modification time of a feed etc.
Name 1ype keturn]Dat
a 1ype
Scope Descr|pt|on
Llnk varlable SLrlng ubllc Llnk of leed
@lLle varlable SLrlng ubllc @lLle of leed
uescrlpLlon varlable SLrlng ubllc uescrlpLlon of leed
uLor varlable SLrlng ubllc uLor of leed
ommenLs varlable SLrlng ubllc ommenLs of feed
ubuaLe varlable SLrlng ubllc uaLe of publlcaLlons
Modlfled@lme varlable SLrlng ubllc Modlfled@lme
MessageSLaLe varlable SLrlng ubllc MessageSLaLe

Structure Name: RSSUrl
This will contains RSS feed URL and proxy server's address.
Name 1ype keturn]Dat
a 1ype
Scope Descr|pt|on
uL varlable SLrlng ubllc url from were feed comes
roxy varlable SLrlng ubllc roxy for server





ueskLop Sldebar


age 23

RSS Feed:
RSS (Rich Site Summary) is a format for deIivering reguIarIy changing web content.
Many news-related sites, weblogs and other online publishers syndicate their content as
an RSS Feed to whoever wants it.
RSS is a technology that is being used by millions of web users around the world to keep
track of their favorite websites.
n the 'old days' of the web to keep track of updates on a website you had to 'bookmark'
websites in your browser and manually return to them on a regular basis to see what had
been added.
RSS solves a problem for people who regularly use the web. t allows you to easiIy stay
informed by retrieving the latest content from the sites you are interested in. You save
time by not needing to visit each site individually. You ensure your privacy, by not
needing to join each site's email newsletter. The number of sites offering RSS feeds are
growing rapidly and includes big names like Yahoo News.

ProbIems ResoIved by RSS:
Most people are interested in many websites whose content changes on an unpredictable
schedule. Examples of such websites are news sites, community and religious organization
information pages, product information pages, medical websites, and weblogs. Repeatedly
checking each website to see if there is any new content can be very tedious.
Email notification of changes was an early solution to this problem. Unfortunately, when
you receive email notifications from multiple websites they are usually disorganized and
can get overwhelming, and are often mistaken for spam.
RSS is a better way to be notified of new and changed content. Notifications of changes to
multiple websites are handled easily, and the results are presented to you well organized
and distinct from email.

ueskLop Sldebar


age 26
ow RSS Work:
ere is a diagram showing how the websites, the RSS feed XML files, and your personal
computer are connected:

The diagram shows a web browser being used to read first Web Site 1 over the nternet
and then Web Site 2. t also shows the RSS feed XML files for both websites being
monitored simultaneously by an RSS Feed Aggregator.

&ses:
n addition to notifying you about news headlines and changes to websites, RSS can be
used for many other purposes. There does not even have to be a web page associated
with the items listed -- sometimes all the information you need may be in the titles and
descriptions themselves.
Some commonly mentioned uses are:
O Notification of the arrival of new products in a store
O Listing and notifying you of newsletter issues, including email newsletters
O Weather and other alerts of changing conditions
O Notification of additions of new items to a database, or new members to a group
One RSS aggregator is all that you need to read all of the RSS feeds, be they headlines,
alerts, changes, or other notifications. RSS is shaping up to be a very popular and useful
means for communicating.




ueskLop Sldebar


age 27

ueskLop Sldebar


age 28
ueskLop Sldebar


age 29




ueskLop Sldebar


age 30




This is when you clicked on the sidebar here comes a bar as shown above
t contain following options :

Dock sidebar :
n this you are given three options place your sidebar at right side or right side ir
you can use float in order to set its position to d way u like.

Autohide:
This allows you to hide your sidebar when you are not using it.if you want to see
the sidebar just click on the positon of the sidebar and sidebar appers else it
remain hidden.

eIp:
t contain the help options.

CIose:
On clocking the dock sidebar closes.






ueskLop Sldebar


age 31






ueskLop Sldebar


age 32






















ueskLop Sldebar


age 33



























ueskLop Sldebar


age 34
Coding:
About Sidebar:

usng System,
usng System.Co11ectons.6enerc,
usng System.ComponentMode1,
usng System.0rawng,

usng System.8e11ecton,
usng System.Wndows.Iorms,

namespace 0esktopSdebar
{
parta1 c1ass ^boutSdebar : Iorm
{
pub1c ^boutSdebar{)
{
1nta1zeComponent{),
,, ths.1ext = Strng.Iormat{"^bout {) {)", ^ssemb1y1t1e),
ths.1abe1roductuame.1ext = ^ssemb1yroduct,
,,ths.1abe1verson.1ext = Strng.Iormat{"verson {) {)", ^ssemb1yverson),
ths.1abe1Copyrght.1ext = ^ssemb1yCopyrght,
ths.1abe1Companyuame.1ext = "uCl 1echno1oges",


)

regon ^ssemb1y ^ttrbute ^ccessors

pub1c strng ^ssemb1y1t1e
{
get
{
obectj attrbutes =
^ssemb1y.6etLxecutng^ssemb1y{).6etCustom^ttrbutes{typeo1{^ssemb1y1t1e^ttrbute), 1a1se),
1 {attrbutes.length > )
{
^ssemb1y1t1e^ttrbute tt1e^ttrbute =
{^ssemb1y1t1e^ttrbute)attrbutesj,
1 {tt1e^ttrbute.1t1e != "")
{
return tt1e^ttrbute.1t1e,
)
)
return
System.10.ath.6etI1euameWthoutLxtenson{^ssemb1y.6etLxecutng^ssemb1y{).Code8ase),
)
)

pub1c strng ^ssemb1yverson
ueskLop Sldebar


age 33
{
get
{
return ^ssemb1y.6etLxecutng^ssemb1y{).6etuame{).verson.1oStrng{),
)
)

pub1c strng ^ssemb1y0escrpton
{
get
{
obectj attrbutes =
^ssemb1y.6etLxecutng^ssemb1y{).6etCustom^ttrbutes{typeo1{^ssemb1y0escrpton^ttrbute),
1a1se),
1 {attrbutes.length == )
{
return "",
)
return {{^ssemb1y0escrpton^ttrbute)attrbutesj).0escrpton,
)
)

pub1c strng ^ssemb1yroduct
{
get
{
obectj attrbutes =
^ssemb1y.6etLxecutng^ssemb1y{).6etCustom^ttrbutes{typeo1{^ssemb1yroduct^ttrbute), 1a1se),
1 {attrbutes.length == )
{
return "",
)
return {{^ssemb1yroduct^ttrbute)attrbutesj).roduct,
)
)

pub1c strng ^ssemb1yCopyrght
{
get
{
obectj attrbutes =
^ssemb1y.6etLxecutng^ssemb1y{).6etCustom^ttrbutes{typeo1{^ssemb1yCopyrght^ttrbute),
1a1se),
1 {attrbutes.length == )
{
return "",
)
return {{^ssemb1yCopyrght^ttrbute)attrbutesj).Copyrght,
)
)

pub1c strng ^ssemb1yCompany
{
get
{
obectj attrbutes =
^ssemb1y.6etLxecutng^ssemb1y{).6etCustom^ttrbutes{typeo1{^ssemb1yCompany^ttrbute), 1a1se),
ueskLop Sldebar


age 36
1 {attrbutes.length == )
{
return "",
)
return {{^ssemb1yCompany^ttrbute)attrbutesj).Company,
)
)
endregon

prvate vod ^boutSdebar_load{obect sender, Lvent^rgs e)
{

ths.1opMost = true,
8rng1oIront{),
ths.locaton = new ont{Screen.rmaryScreen.Workng^rea.Wdth , - ths.Wdth
, , Screen.rmaryScreen.Workng^rea.ueght , - ths.ueght , ),
)

prvate vod ok8utton_C1ck{obect sender, Lvent^rgs e)
{
ths.C1ose{),
)
)
)
















ueskLop Sldebar


age 37

Coding under windows form "Sidebar":
usng System,
usng System.Co11ectons.6enerc,

usng System.1ext,
usng System.0rawng,
usng System.8untme.1nteropServces,
usng System.ComponentMode1,
usng ue1per,
usng System.Wndows.Iorms,
usng System.Con1guraton,
usng System.10,



namespace 0esktopSdebar
{

pub1c c1ass Sdebar:Iorm
{
regon Lnums

pub1c enum 1hemes
{
81ack = ,
6ray =
)


pub1c enum ^pp8arMessages
{
,,, <summary>
,,, 8egsters a new appbar and spec1es the message dent1er
,,, that the system shou1d use to send not1caton messages to
,,, the appbar.
,,, <,summary>
uew = x,
,,, <summary>
,,, unregsters an appbar, removng the bar 1rom the system's
,,, nterna1 1st.
,,, <,summary>
8emove = x,
,,, <summary>
,,, 8equests a sze and screen poston 1or an appbar.
,,, <,summary>
queryos = x,
,,, <summary>
,,, Sets the sze and screen poston o1 an appbar.
,,, <,summary>
Setos = x2,
,,, <summary>
,,, 8etreves the autohde and a1ways-on-top states o1 the
,,, Mcroso1t Wndows taskbar.
ueskLop Sldebar


age 38
,,, <,summary>
6etState = x4,
,,, <summary>
,,, 8etreves the boundng rectang1e o1 the Wndows taskbar.
,,, <,summary>
6et1ask8aros = xS,
,,, <summary>
,,, uot1es the system that an appbar has been actvated.
,,, <,summary>
^ctvate = x6,
,,, <summary>
,,, 8etreves the hand1e to the autohde appbar assocated wth
,,, a partcu1ar edge o1 the screen.
,,, <,summary>
6et^utoude8ar = x7,
,,, <summary>
,,, 8egsters or unregsters an autohde appbar 1or an edge o1
,,, the screen.
,,, <,summary>
Set^utoude8ar = x8,
,,, <summary>
,,, uot1es the system when an appbar's poston has changed.
,,, <,summary>
WndowosChanged = x,
,,, <summary>
,,, Sets the state o1 the appbar's autohde and a1ways-on-top
,,, attrbutes.
,,, <,summary>
SetState = xa
)

pub1c enum skns
{
81ue = ,
81ack =
)

pub1c enum ^pp8aruot1catons
{
,,, <summary>
,,, uot1es an appbar that the taskbar's autohde or
,,, a1ways-on-top state has changed-that s, the user has se1ected
,,, or c1eared the "^1ways on top" or "^uto hde" check box on the
,,, taskbar's property sheet.
,,, <,summary>
StateChange = x,
,,, <summary>
,,, uot1es an appbar when an event has occurred that may a11ect
,,, the appbar's sze and poston. Lvents nc1ude changes n the
,,, taskbar's sze, poston, and vsb1ty state, as we11 as the
,,, addton, remova1, or reszng o1 another appbar on the same
,,, sde o1 the screen.
,,, <,summary>
osChanged = x,
,,, <summary>
,,, uot1es an appbar when a 1u11-screen app1caton s openng or
,,, c1osng. 1hs not1caton s sent n the 1orm o1 an
ueskLop Sldebar


age 39
,,, app1caton-de1ned message that s set by the ^8M_uLW message.
,,, <,summary>
Iu11Screen^pp = x,
,,, <summary>
,,, uot1es an appbar that the user has se1ected the Cascade,
,,, 11e uorzonta11y, or 11e vertca11y command 1rom the
,,, taskbar's shortcut menu.
,,, <,summary>
Wndow^rrange = x2
)

jI1ags
pub1c enum ^pp8arStates
{
^utoude = x,
^1ways0n1op = x,
uorma1 = x2
)


pub1c enum ^pp8arLdges
{
le1t = ,
1op = ,
8ght = ,
8ottom = 2,
I1oat = 4
)

,, Wndow Messages
pub1c enum WM
{
^C11v^1L = x6,
W1u00W0SCu^u6L0 = x47,
uCu111LS1 = x84
)

pub1c enum MouseostonCodes
{
u1L8808 = {-),
u118^uS^8Lu1 = {-),
u1u0WuL8L = ,
u1Cl1Lu1 = ,
u1C^110u = ,
u1SYSMLuu = 2,
u1680W80x = 4,
u1S12L = u1680W80x,
u1MLuu = S,
u1uSC80ll = 6,
u1vSC80ll = 7,
u1M1u8u110u = 8,
u1M^x8u110u = ,
u1lLI1 = ,
u1816u1 = ,
u110 = ,
u110lLI1 = 2,
u110816u1 = 4,
ueskLop Sldebar


age 40
u180110M = S,
u180110MlLI1 = 6,
u180110M816u1 = 7,
u18080L8 = 8,
u18L0uCL = u1M1u8u110u,
u1200M = u1M^x8u110u,
u1S12LI18S1 = u1lLI1,
u1S12Ll^S1 = u180110M816u1,
u108JLC1 = ,
u1Cl0SL = ,
u1uLl =
)

endregon Lnums

regon rvate varab1es

,, saves the current edge
prvate ^pp8arLdges m_Ldge = ^pp8arLdges.I1oat,
prvate ^pp8arStates m_state = ^pp8arStates.^1ways0n1op,

prvate nt Startos,
prvate nt Lndos,
pub1c boo1 sudden = 1a1se,

,, saves the ca11back message d
prvate u1nt2 Ca11backMessage10 = ,

,, checks the dock mode
prvate 8oo1ean 1s^ppbarMode = 1a1se,

,, save the 11oatng sze and 1ocaton
prvate Sze m_revSze,
prvate ont m_revlocaton,
pub1c boo1 autohdeLnab1ed = 1a1se,
pub1c 1mer ude1mer,
prvate 1hemes m_theme,
endregon rvate varab1es

regon ropertes
pub1c 1hemes 1heme
{
get
{
return m_theme,
)
set
{
m_theme = va1ue,


)

)
pub1c ^pp8arLdges Ldge
{
get
ueskLop Sldebar


age 41
{
return m_Ldge,
)
set
{
m_Ldge = va1ue,
1 {va1ue == ^pp8arLdges.I1oat)
^ppbar8emove{),
e1se
^ppbaruew{),

1 {1s^ppbarMode)
Sze^pp8ar{),

)
)
pub1c ^pp8arStates ^utohde
{
get
{
return m_state,
)
set
{
m_state = va1ue,
1 {va1ue == ^pp8arStates.^utoude)

^ppbar8emove{),

)
)

pub1c ^pp8arStates uorma1
{
get
{
return m_state,
)
set
{
m_state = va1ue,
1 {va1ue == ^pp8arStates.uorma1)
{
ths.1opMost = 1a1se,
Send1o8ack{),

)

)
)

endregon

regon ^pp8ar Iunctons

,, to hand1e mouse move event when sdebar s not docked
pub1c de1egate vod 0nSdebarMouseMove{obect sender, MouseLvent^rgs e),
ueskLop Sldebar


age 42
pub1c event 0nSdebarMouseMove evtMouseMove,

prvate 8oo1ean ^ppbaruew{)
{
1 {Ca11backMessage10 == )
throw new Lxcepton{"^pp1caton cou1dn't be nta1zed"),

1 {1s^ppbarMode)
return true,

m_revSze = Sze,
m_revlocaton = locaton,

,, prepare data structure o1 message
She11^p.^8^80^1^ msg0ata = new She11^p.^8^80^1^{),
msg0ata.cbSze = {u1nt2)Marsha1.Sze01{msg0ata),
msg0ata.hWnd = uand1e,
msg0ata.uCa11backMessage = Ca11backMessage10,

,, nsta11 new appbar
u1nt2 retva1 = She11^p.Su^pp8arMessage{{u1nt2)^pp8arMessages.uew,re1
msg0ata),
1s^ppbarMode = {retva1!=),

Sze^pp8ar{),

return 1s^ppbarMode,
)

prvate 8oo1ean ^ppbar8emove{)
{
,, prepare data structure o1 message
She11^p.^8^80^1^ msg0ata = new She11^p.^8^80^1^{),
msg0ata.cbSze = {u1nt2)Marsha1.Sze01{msg0ata),
msg0ata.hWnd = uand1e,

,, remove appbar
u1nt2 retva1 =
She11^p.Su^pp8arMessage{{u1nt2)^pp8arMessages.8emove,re1 msg0ata),

1s^ppbarMode = 1a1se,

Sze = m_revSze,
locaton = m_revlocaton,

return {retva1!=) ? true : 1a1se,
)

prvate vod ^ppbarqueryos{re1 She11^p.8LC1 app8ect)
{
,, prepare data structure o1 message
She11^p.^8^80^1^ msg0ata = new She11^p.^8^80^1^{),
msg0ata.cbSze = {u1nt2)Marsha1.Sze01{msg0ata),
msg0ata.hWnd = uand1e,
msg0ata.uLdge = {u1nt2)m_Ldge,
msg0ata.rc = app8ect,

ueskLop Sldebar


age 43
,, query poston 1or the appbar
She11^p.Su^pp8arMessage{{u1nt2)^pp8arMessages.queryos, re1 msg0ata),
app8ect = msg0ata.rc,
)

prvate vod ^ppbarSetos{re1 She11^p.8LC1 app8ect)
{
,, prepare data structure o1 message
She11^p.^8^80^1^ msg0ata = new She11^p.^8^80^1^{),
msg0ata.cbSze = {u1nt2)Marsha1.Sze01{msg0ata),
msg0ata.hWnd = uand1e,
msg0ata.uLdge = {u1nt2)m_Ldge,
msg0ata.rc = app8ect,

,, set poston 1or the appbar
She11^p.Su^pp8arMessage{{u1nt2)^pp8arMessages.Setos, re1 msg0ata),
app8ect = msg0ata.rc,
)

prvate vod ^ppbar^ctvate{)
{
,, prepare data structure o1 message
She11^p.^8^80^1^ msg0ata = new She11^p.^8^80^1^{),
msg0ata.cbSze = {u1nt2)Marsha1.Sze01{msg0ata),
msg0ata.hWnd = uand1e,

,, send actvate to the system
She11^p.Su^pp8arMessage{{u1nt2)^pp8arMessages.^ctvate, re1 msg0ata),
)

prvate vod ^ppbarWndowosChanged{)
{
,, prepare data structure o1 message
She11^p.^8^80^1^ msg0ata = new She11^p.^8^80^1^{),
msg0ata.cbSze = {u1nt2)Marsha1.Sze01{msg0ata),
msg0ata.hWnd = uand1e,

,, send wndowposchanged to the system
She11^p.Su^pp8arMessage{{u1nt2)^pp8arMessages.WndowosChanged, re1
msg0ata),
)

prvate 8oo1ean ^ppbarSet^utoude8ar{8oo1ean hdeva1ue)
{
,, prepare data structure o1 message
She11^p.^8^80^1^ msg0ata = new She11^p.^8^80^1^{),
msg0ata.cbSze = {u1nt2)Marsha1.Sze01{msg0ata),
msg0ata.hWnd = uand1e,
msg0ata.uLdge = {u1nt2)m_Ldge,
msg0ata.1aram = {hdeva1ue) ? : ,

,, set auto hde
u1nt2 retva1 =
She11^p.Su^pp8arMessage{{u1nt2)^pp8arMessages.Set^utoude8ar,re1 msg0ata),
return {retva1!=) ? true : 1a1se,
)

ueskLop Sldebar


age 44
prvate 1nttr ^ppbar6et^utoude8ar{^pp8arLdges edge)
{
,, prepare data structure o1 message
She11^p.^8^80^1^ msg0ata = new She11^p.^8^80^1^{),
msg0ata.cbSze = {u1nt2)Marsha1.Sze01{msg0ata),
msg0ata.uLdge = {u1nt2)edge,

,, get auto hde
1nttr retva1 =
{1nttr)She11^p.Su^pp8arMessage{{u1nt2)^pp8arMessages.6et^utoude8ar,re1 msg0ata),
return retva1,
)

prvate ^pp8arStates ^ppbar6et1askbarState{)
{
,, prepare data structure o1 message
She11^p.^8^80^1^ msg0ata = new She11^p.^8^80^1^{),
msg0ata.cbSze = {u1nt2)Marsha1.Sze01{msg0ata),

,, get taskbar state
u1nt2 retva1 =
She11^p.Su^pp8arMessage{{u1nt2)^pp8arMessages.6etState, re1 msg0ata),
return {^pp8arStates)retva1,
)

prvate vod ^ppbarSet1askbarState{^pp8arStates state)
{
,, prepare data structure o1 message
She11^p.^8^80^1^ msg0ata = new She11^p.^8^80^1^{),
msg0ata.cbSze = {u1nt2)Marsha1.Sze01{msg0ata),
msg0ata.1aram = {1nt2)state,

,, set taskbar state
She11^p.Su^pp8arMessage{{u1nt2)^pp8arMessages.SetState, re1 msg0ata),
)

prvate vod ^ppbar6et1askbaros{out She11^p.8LC1 task8ect)
{
,, prepare data structure o1 message
She11^p.^8^80^1^ msg0ata = new She11^p.^8^80^1^{),
msg0ata.cbSze = {u1nt2)Marsha1.Sze01{msg0ata),

,, get taskbar poston
She11^p.Su^pp8arMessage{{u1nt2)^pp8arMessages.6et1ask8aros, re1
msg0ata),
task8ect = msg0ata.rc,
)


endregon ^pp8ar Iunctons




pub1c Sdebar{)
{
Iorm8orderSty1e = Iorm8orderSty1e.Szab1e1oo1Wndow,
ueskLop Sldebar


age 43

ude1mer = new 1mer{),
ude1mer.1nterva1 = ,
ude1mer.Lnab1ed = 1a1se,
ude1mer.1ck += new Lventuand1er{ude1mer_1ck),
ths.MouseMove += new MouseLventuand1er{Sdebar_MouseMove),
,, 8egster a unque message as our ca11back message
Ca11backMessage10 = 8egsterCa11backMessage{),
1 {Ca11backMessage10 == )
throw new Lxcepton{"^pp1caton cou1dn't be nta1zed"),
)


,,, <summary>
,,, to hde wndow borders
,,, <,summary>
protected overrde Createarams Createarams
{
get
{
Createarams params = base.Createarams,
params.Sty1e = params.Sty1e & x8,
return params,
)
)


,,, <summary>
,,, uand1es the mouse move event o1 sdebar
,,, <,summary>
,,, <param name="sender"><,param>
,,, <param name="e"><,param>
vod Sdebar_MouseMove{obect sender, MouseLvent^rgs e)
{
1 {ths.Ldge == ^pp8arLdges.I1oat)
{
evtMouseMove{sender, e),
)
)

,,, <summary>
,,, uand1es the tck event o1 tmer when autohde s enab1ed
,,, <,summary>
,,, <param name="sender"><,param>
,,, <param name="e"><,param>
vod ude1mer_1ck{obect sender, Lvent^rgs e)
{
1 {sudden && autohdeLnab1ed)
{
swtch {ths.Ldge)
{
case ^pp8arLdges.8ght:
1 {Startos <= Lndos)
{
ths.locaton = new System.0rawng.ont{Startos, ),
Startos += ,

ueskLop Sldebar


age 46
)
e1se
{
ths.locaton = new System.0rawng.ont{Lndos, ),
ude1mer.Lnab1ed = 1a1se,
)
break,
case ^pp8arLdges.le1t:

1 {Lndos > )
{
ths.le1t -= ,
ths.locaton = new System.0rawng.ont{ths.le1t, ),
Lndos -= ,

)
e1se
{
ude1mer.Lnab1ed = 1a1se,
ths.locaton = new System.0rawng.ont{ - ths.Wdth, ),

)
break,

)

)
,, 1ncrease sze o1 Sde 8ar
e1se 1 {autohdeLnab1ed && !sudden)
{
swtch {ths.Ldge)
{
case ^pp8arLdges.8ght:

1 {Startos >= Lndos)
{
ths.locaton = new System.0rawng.ont{Startos, ),
Startos -= ,

)
e1se
{
ths.locaton = new
System.0rawng.ont{Screen.rmaryScreen.Workng^rea.Wdth - ths.Wdth + S, ),
ude1mer.Lnab1ed = 1a1se,
)

break,

case ^pp8arLdges.le1t:
1 {Startos < -)
{
ths.le1t += ,
1 {Startos >= )
{
ths.locaton = new System.0rawng.ont{-, ),
)
ueskLop Sldebar


age 47
e1se
{
ths.locaton = new System.0rawng.ont{ths.le1t-, ),
Startos += ,
)

)
e1se
{
ude1mer.Lnab1ed = 1a1se,
ths.locaton = new System.0rawng.ont{-, ),
)

break,
)

)
)


,,, <summary>
,,, 8egsters the ca11 back message
,,, <,summary>
,,, <returns><,returns>

prvate u1nt2 8egsterCa11backMessage{)
{
Strng unqueMessageStrng = 6ud.uew6ud{).1oStrng{),
return She11^p.8egsterWndowMessage{unqueMessageStrng),
)

,,, <summary>
,,, Creates a new nstance o1 sdebar dependng upon the edge
,,, <,summary>
prvate vod Sze^pp8ar{)
{
She11^p.8LC1 rt = new She11^p.8LC1{),

1 {{m_Ldge == ^pp8arLdges.le1t) ||
{m_Ldge == ^pp8arLdges.8ght))
{
rt.top = ,
rt.bottom = System1n1ormaton.rmaryMontorSze.ueght,
1 {m_Ldge == ^pp8arLdges.le1t)
{
rt.rght = m_revSze.Wdth,
)
e1se
{
rt.rght = System1n1ormaton.rmaryMontorSze.Wdth,
rt.1e1t = rt.rght - m_revSze.Wdth,
)
)
e1se
{
rt.1e1t = ,
rt.rght = System1n1ormaton.rmaryMontorSze.Wdth,
ueskLop Sldebar


age 48
1 {m_Ldge == ^pp8arLdges.1op)
{
rt.bottom = m_revSze.ueght,
)
e1se
{
rt.bottom = System1n1ormaton.rmaryMontorSze.ueght,
rt.top = rt.bottom - m_revSze.ueght,
)
)

^ppbarqueryos{re1 rt),

swtch {m_Ldge)
{
case ^pp8arLdges.le1t:
rt.rght = rt.1e1t + m_revSze.Wdth,
break,
case ^pp8arLdges.8ght:
rt.1e1t= rt.rght - m_revSze.Wdth,
break,
case ^pp8arLdges.1op:
rt.bottom = rt.top + m_revSze.ueght,
break,
case ^pp8arLdges.8ottom:
rt.top = rt.bottom - m_revSze.ueght,
break,
)

^ppbarSetos{re1 rt),

locaton = new ont{rt.1e1t,rt.top),
Sze = new Sze{rt.rght - rt.1e1t,rt.bottom - rt.top),
)

regon Message uand1ers

,,, <summary>
,,, uand1es a not1caton receved 1rom appbar
,,, <,summary>
,,, <param name="msg"><,param>
vod 0n^ppbaruot1caton{re1 Message msg)
{
^pp8arStates state,
^pp8aruot1catons msg1ype = {^pp8aruot1catons){1nt2)msg.Waram,


,,code commented n be1ow snppet to reso1ve the menu and ch1 wndows ssues.
swtch {msg1ype)
{
case ^pp8aruot1catons.osChanged:
Sze^pp8ar{),
break,

case ^pp8aruot1catons.StateChange:
state = ^ppbar6et1askbarState{),
1 {{state & ^pp8arStates.^1ways0n1op) !=)
ueskLop Sldebar


age 49
{
,,1opMost = true,

,,8rng1oIront{),
)
e1se
{
1opMost = 1a1se,
Send1o8ack{),
)
break,

case ^pp8aruot1catons.Iu11Screen^pp:
1 {{nt)msg.laram !=)
{
,,1opMost = true,
,,Send1o8ack{),
)
e1se
{
state = ^ppbar6et1askbarState{),
1 {{state & ^pp8arStates.^1ways0n1op) !=)
{
,,1opMost = true,
,, Send1o8ack{),

,,Commented to enab1e context menus o1 system tray....
,,8rng1oIront{),
)
e1se
{
,,1opMost = 1a1se,
,,Send1o8ack{),
)
)

break,

case ^pp8aruot1catons.Wndow^rrange:
1 {{nt)msg.laram != ) ,, be1ore
vsb1e = 1a1se,
e1se ,, a1ter
vsb1e = true,

break,
)
)

,,, <summary>
,,, 1nvokes when ucut1est event s 1red
,,, <,summary>
,,, <param name="msg"><,param>
vod 0nucut1est{re1 Message msg)
{
0e1Wndroc{re1 msg),
1 {{m_Ldge == ^pp8arLdges.1op) && {{nt)msg.8esu1t ==
{nt)MouseostonCodes.u180110M))
ueskLop Sldebar


age 30
.1oStrng{),
e1se 1 {{m_Ldge == ^pp8arLdges.8ottom) && {{nt)msg.8esu1t ==
{nt)MouseostonCodes.u110))
.1oStrng{),
e1se 1 {{m_Ldge == ^pp8arLdges.le1t) && {{nt)msg.8esu1t ==
{nt)MouseostonCodes.u1816u1))
.1oStrng{),
e1se 1 {{m_Ldge == ^pp8arLdges.8ght) && {{nt)msg.8esu1t ==
{nt)MouseostonCodes.u1lLI1))
.1oStrng{),
e1se 1 {{nt)msg.8esu1t == {nt)MouseostonCodes.u1Cl0SL)
.1oStrng{),
e1se
{
msg.8esu1t = {1nttr)MouseostonCodes.u1Cl1Lu1,
return,
)
base.Wndroc{re1 msg),
)


endregon Message uand1ers

regon Wndow rocedure

,,, <summary>
,,, uand1es the Wndows messages
,,, <,summary>
,,, <param name="msg"><,param>
protected overrde vod Wndroc{re1 Message msg)
{
1 {1s^ppbarMode)
{
1 {msg.Msg == Ca11backMessage10)
{
0n^ppbaruot1caton{re1 msg),

)
e1se 1 {msg.Msg == {nt)WM.^C11v^1L)
{
^ppbar^ctvate{),
)
e1se 1 {msg.Msg == {nt)WM.W1u00W0SCu^u6L0)
{
^ppbarWndowosChanged{),
)
e1se 1 {msg.Msg == {nt)WM.uCu111LS1)
{
0nucut1est{re1 msg),
return,
)
)

base.Wndroc{re1 msg),
)

endregon Wndow rocedure
ueskLop Sldebar


age 31

,,, <summary>
,,, 0ccurs when sdebar 1oads
,,, <,summary>
,,, <param name="e"><,param>
protected overrde vod 0nload{Lvent^rgs e)
{
try
{
m_revSze = Sze,
m_revlocaton = locaton,


base.0nload{e),
)
catch {Lxcepton ex)
{

)
)

,,, <summary>
,,, unregsters the sdebar on c1osng
,,, <,summary>
,,, <param name="e"><,param>
protected overrde vod 0nC1osng{Cance1Lvent^rgs e)
{

^ppbar8emove{),
base.0nC1osng{e),

)

,,, <summary>
,,, uand1es the sze change event
,,, <,summary>
,,, <param name="e"><,param>
protected overrde vod 0nSzeChanged{Lvent^rgs e)
{
1 {1s^ppbarMode)
{
1 {m_Ldge == ^pp8arLdges.1op || m_Ldge == ^pp8arLdges.8ottom)
m_revSze.ueght = Sze.ueght,
e1se
m_revSze.Wdth = Sze.Wdth,

Sze^pp8ar{),
)

base.0nSzeChanged{e),
)

,,, <summary>
,,, unregsters the sdebar 1rom 0S
,,, <,summary>
,,, <param name="status"><,param>
pub1c vod un8egster^pp8ar{boo1 status)
ueskLop Sldebar


age 32
{

1 {status == true)
{
^ppbar8emove{),
)
e1se
{
^ppbar^ctvate{),
)

)


,,, <summary>
,,, 0ocks sdebar n when autohde s enab1ed
,,, <,summary>
pub1c vod 0ock1n{)
{
try
{

sudden = true,

,,6ettng the Start locaton 1or the 1oop
Startos = ths.locaton.x,


,,Ca1cu1aton the 1na1 x coordnate 1or the 1oop to 1nsh
swtch {ths.Ldge)
{
case ^pp8arLdges.le1t:
Lndos = ths.Wdth,
break,
case ^pp8arLdges.8ght:
Lndos = {nt)Screen.rmaryScreen.8ounds.Wdth - ,
break,
)
She11^p.8LC1 rect = new She11^p.8LC1{),
rect.1e1t = Lndos,
^ppbarSetos{re1 rect),
ude1mer.Lnab1ed = true,



)
catch {Lxcepton ex)
{
Message8ox.Show{ex.Message),

)
)


,,, <summary>
,,, docks sdebar out when autohde s dsab1ed
,,, <,summary>
ueskLop Sldebar


age 33
pub1c vod 0ock0ut{)
{
try
{
sudden = 1a1se,
ude1mer.Lnab1ed = 1a1se,
,,Startng locaton o1 the 0ockng Wndow
,,nt Startx = ths.locaton.x,
Startos = ths.locaton.x,
,,Ca1cu1atng the 1na1 x Coordnate at whch the dockng wndow shou1d
,,sett1e n order to be comp1ete1y vsb1e



swtch {ths.Ldge)
{
case ^pp8arLdges.le1t:
Lndos = {nt)Screen.rmaryScreen.8ounds.Wdth - getScreenWdth{),


break,
case ^pp8arLdges.8ght:
Lndos = getScreenWdth{)-{ths.Wdth)+,
break,
)
ude1mer.Lnab1ed = true,
ths.^utohde = ^pp8arStates.^1ways0n1op,

)
catch {Lxcepton ex)
{



)
)

,,, <summary>
,,, uand1es the reso1uton change o1 the system
,,, <,summary>
pub1c vod uand1e8eso1utonChange{)
{
^ppbar8emove{),
^ppbaruew{),
)

,,, <summary>
,,, 6ets the totta1 screen wdth
,,, <,summary>
,,, <returns><,returns>
protected nt getScreenWdth{)
{
8ectang1e recWorkng^rea = new 8ectang1e{),
recWorkng^rea = Screen.rmaryScreen.Workng^rea,
return recWorkng^rea.Wdth,
)

ueskLop Sldebar


age 34

prvate vod 1nta1zeComponent{)
{
ths.Suspendlayout{),
,,
,, Sdebar
,,
ths.C1entSze = new System.0rawng.Sze{77, 72),
ths.0oub1e8u11ered = true,
ths.Iorm8orderSty1e = System.Wndows.Iorms.Iorm8orderSty1e.Szab1e1oo1Wndow,
ths.uame = "Sdebar",
ths.addng = new System.Wndows.Iorms.addng{, , , ),
ths.8esumelayout{1a1se),

)




)
)


















ueskLop Sldebar


age 33

Coding under Rss feed viewer:
usng System,
usng System.Co11ectons.6enerc,
usng System.ComponentMode1,
usng System.0rawng,
usng System.0ata,

usng System.1ext,
usng System.Co11ectons,
usng System.Wndows.Iorms,
usng System.1hreadng,
usng System.10,
usng System.xm1.Sera1zaton,
usng System.8e11ecton,
usng System.8untme.Sera1zaton,
usng System.8untme.Sera1zaton.Iormatters.8nary,

namespace 8SSIeed6adget
{

pub1c parta1 c1ass 8SSIeedvewer : userContro1
{
regon Member varab1e

nt Scro11011t = ,
nt Scro11ont = ,
boo1 bStartScro11ng = 1a1se,
boo1 bShow1osat = 1a1se,
boo1 Scro110own = 1a1se,
boo1 Scro11up = 1a1se,
nterna1 boo1 sScro11anvsb1e = 1a1se,
nterna1 boo1 de^ctvatevew = 1a1se,

1mage update1mg,
1mage newer,
ont ane10rgna1ont,
boo1 m_Sgna1k11 = 1a1se,
1hread thrdScro11ane1,
pub1c Manua18esetLvent evtManua18est = new Manua18esetLvent{1a1se),

protected nterna1 6adgetSty1e m_6adgetSty1e,
8SSrevew m_8SSrevew,
Ietch8SSIeed m_Ietch8ssIeed,
8SSIeedvewer m_8ssIeedvewer = nu11,
8SSI1e8eader^ndWrter m_8ssI1e8Lader^ndWrter,
Show8SSIeed m_Show8SSIeed,
Subscrpton m_Subscrpton,
nterna1 8SSIeedvew 1eedvew,
,,strng strI1eath = ^ssemb1y.6etLxecutng^ssemb1y{).locaton,
strng strI1eath = Lnvronment.Current0rectory,
Iont tt1eIont,
Iont descIont,
Iont authorIont,
ueskLop Sldebar


age 36
Iont tmeIont,

de1egate vod Scro11{),
pub1c de1egate vod 0nMouseuover{obect sender, Lvent^rgs e),
pub1c event 0nMouseuover evtMouseuover,
pub1c de1egate vod 0nMouseleave{obect sender, Lvent^rgs e),
pub1c event 0nMouseleave evtMouseleave,

pub1c de1egate vod 0nMouseMove{obect sender, MouseLvent^rgs e),
pub1c event 0nMouseMove evt0nMouseMove,

pub1c de1egate vod Set^utoudeState{boo1 b1ogg1e1mage),
pub1c event Set^utoudeState evtSet^utoudeState,

pub1c de1egate vod revew0pened{),
pub1c event revew0pened evtrevew0pened,

pub1c de1egate vod ShowMessage0nlabe1{),


boo1 1e1t = 1a1se,
boo1 bI1oat = 1a1se,
endregon

regon ropertes

pub1c boo1 le1t
{
get { return 1e1t, )
set { 1e1t = va1ue, )

)

pub1c boo1 1sI1oated
{
get { return 1e1t, )
set { 1e1t = va1ue, )
)

pub1c Co1or 1t1eCo1or
{
get { return m_6adgetSty1e.1t1eCo1or, )
set
{
m_6adgetSty1e.1t1eCo1or = va1ue,
setIontCo1or{),
)
)

pub1c Co1or 0escrptonCo1or
{
get { return m_6adgetSty1e.0escrptonCo1or, )
set
{
m_6adgetSty1e.0escrptonCo1or = va1ue,
setIontCo1or{),
)
ueskLop Sldebar


age 37
)

pub1c Co1or ^uthorCo1or
{
get { return m_6adgetSty1e.^uthorCo1or, )
set
{
m_6adgetSty1e.^uthorCo1or = va1ue,
setIontCo1or{),
)
)

pub1c Co1or 1meCo1or
{
get { return m_6adgetSty1e.1meCo1or, )
set
{
m_6adgetSty1e.1meCo1or = va1ue,
setIontCo1or{),
)
)

pub1c Iont Iont011t1e
{
get { return tt1eIont, )
set { tt1eIont = va1ue, )
)

pub1c Iont Iont010escrpton
{
get { return descIont, )
set { descIont = va1ue, )
)

pub1c Iont Iont01^uthor
{
get { return authorIont, )
set { authorIont = va1ue, )
)

pub1c Iont Iont011me
{
get { return tmeIont, )
set { tmeIont = va1ue, )
)

pub1c boo1 Show1oast
{
get { return bShow1osat, )
set { bShow1osat = va1ue, )
)
pub1c 11oat IontSze
{
get { return m_6adgetSty1e.1ontSze, )
set
{
m_6adgetSty1e.1ontSze = va1ue,
ueskLop Sldebar


age 38
SetIontSze{),
)
)

pub1c nt Separatorueght
{
get { return m_6adgetSty1e.Separartorueght, )
set { m_6adgetSty1e.Separartorueght = va1ue, SetSeparatorueght^nd1mage{nu11), )
)

pub1c strng 8SSuot1catonWndow8g1mage
{
get { return m_6adgetSty1e.uot1yWndow8g1mage, )
set { m_6adgetSty1e.uot1yWndow8g1mage = va1ue, )
)

pub1c 1mage uewIeed1mage
{
get { return newer, )
set { 8SS1magelst.1magesj = va1ue, newer = va1ue, )
)

pub1c 1mage updateIeed1mage
{
get { return update1mg, )
set { 8SS1magelst.1magesj = va1ue, update1mg = va1ue, )

)
pub1c strng Scro110own8uttonuorma11mageath
{
set { m_6adgetSty1e.Scro110own8uttonuorma11mageath = va1ue, )
)
pub1c strng Scro110own8uttonuover1mageath
{
set { m_6adgetSty1e.Scro110own8uttonuover1mageath = va1ue, )
)
pub1c strng Scro110own8uttonress1mageath
{
set { m_6adgetSty1e.Scro110own8uttonress1mageath = va1ue, )
)

pub1c strng Scro11up8uttonuorma11mageath
{
set { m_6adgetSty1e.Scro11up8uttonuorma11mageath = va1ue, )
)

pub1c strng Scro11up8uttonuover1mageath
{
set { m_6adgetSty1e.Scro11up8uttonuover1mageath = va1ue, )
)

pub1c strng Scro11up8uttonress1mageath
{
set { m_6adgetSty1e.Scro11up8uttonress1mageath = va1ue, )
)

pub1c 1mage Separator8g1mage
ueskLop Sldebar


age 39
{
set
{
8SS1magelst.1magesj = va1ue,
SetSeparatorueght^nd1mage{va1ue),
)
)

endregon

regon Constructor 8egon

pub1c 8SSIeedvewer{)
{
,,strI1eath = strI1eath.Substrng{, strI1eath.1ndex01{".") + ) + "sty1e",
strI1eath = strI1eath + "\\8SSIeed6adget.sty1e",
m_8ssI1e8Lader^ndWrter = new 8SSI1e8eader^ndWrter{),
m_8ssIeedvewer = ths,
0esera1ze6adgetSty1e{),
m_Show8SSIeed = new Show8SSIeed{re1 m_8ssI1e8Lader^ndWrter, re1
m_8ssIeedvewer),
m_Ietch8ssIeed = new Ietch8SSIeed{re1 m_8ssIeedvewer, re1
m_8ssI1e8Lader^ndWrter),
m_8SSrevew = new 8SSrevew{re1 m_8ssIeedvewer),
m_8SSrevew.evtCheck^utoude += new 8SSrevew.Check^utoude{Check^utoude),
m_8SSrevew.evt0penrevew += new
8SSrevew.0penrevew{m_8SSrevew_evt0penrevew),


m_Subscrpton = new Subscrpton{re1 m_Ietch8ssIeed),
1nta1zeComponent{),
m_Ietch8ssIeed.roxy^ddress = m_6adgetSty1e.roxy^ddress,
tt1eIont = new Iont{"verdana", m_6adgetSty1e.1ontSze, IontSty1e.8o1d,
6raphcsunt.ont, {{byte){))),
descIont = new Iont{"verdana", m_6adgetSty1e.1ontSze, IontSty1e.8egu1ar,
6raphcsunt.ont, {{byte){))),
authorIont = new Iont{"verdana", m_6adgetSty1e.1ontSze, IontSty1e.8egu1ar,
6raphcsunt.ont, {{byte){))),
tmeIont = new Iont{"verdana", m_6adgetSty1e.1ontSze, IontSty1e.8egu1ar,
6raphcsunt.ont, {{byte){))),

ane10rgna1ont = 8aseane1.locaton,
1b1loadng.8rng1oIront{),
1b1loadng.vsb1e = true,
Set8utton1mages{),

,,Ieedloaded{),
)



endregon


regon Iunctons

,,, <summary>
ueskLop Sldebar


age 60
,,, 1o dsp1ay the "Con1gure ur1 message" on sdebar to user
,,, <,summary>
nterna1 vod ShowCon1gureMessage{)
{
1 {ths.1nvoke8equred)
{
ths.1nvoke{new ShowMessage0nlabe1{showMessage)),
)
e1se
{
showMessage{),
)
)

prvate vod showMessage{)
{
1 {m_Ietch8ssIeed.8SSur1lst.Count == )
{
1b1loadng.1ext = "1ease subscrbe 1or 8SS 1eeds...",
8aseane1.Contro1s.C1ear{),
1b1loadng.vsb1e = true,
1b1loadng.8rng1oIront{),

)
e1se
{
1b1loadng.1ext = "loadng...",
1b1loadng.vsb1e = true,
1b1loadng.8rng1oIront{),
)
)


,,, <summary>
,,, Lvent hand1er 1or open prevew
,,, <,summary>
vod m_8SSrevew_evt0penrevew{)
{
try
{
evtrevew0pened{),
)
catch { )
)


,,, <summary>
,,, checks 1or autohde status nad ca11s the eventhand1er
,,, <,summary>
,,, <param name="s1ogg1e1mage"><,param>
vod Check^utoude{boo1 s1ogg1e1mage)
{
try
{
evtSet^utoudeState{s1ogg1e1mage),
)
catch
ueskLop Sldebar


age 61
{
)
)

,,8equred n case o1 scro11 buttons provded on basepane1 o1 1eedvewer
prvate vod Set8utton1mages{)
{
,,1 {!strng.1suu110rLmpty{m_6adgetSty1e.Scro110own8uttonuorma11mageath))
,,{
,, btnScro110own.1mage =
1mage.IromI1e{m_6adgetSty1e.Scro110own8uttonuorma11mageath),
,,)
,,e1se
,,{
,, btnScro110own.1mage = 8SS1magelst.1magesjS,

,,)
,,1 {!strng.1suu110rLmpty{m_6adgetSty1e.Scro11up8uttonuorma11mageath))
,,{
,, btnScro11up.1mage =
1mage.IromI1e{m_6adgetSty1e.Scro11up8uttonuorma11mageath),
,,)
,,e1se
,,{
,, btnScro11up.1mage = 8SS1magelst.1magesj8,

,,)

)

pub1c vod C1ose{)
{
try
{
1 {nu11 != m_8SSrevew)
m_8SSrevew.C1ose{),
Sera1ze6adgetSty1e{),
m_Ietch8ssIeed.Stop1hread{),
m_Show8SSIeed.Stop1hread{),

,,code requred n case o1 scro11ng on the basepane1 o1 1eedvewer s
requred...
,,1 {nu11 != thrdScro11ane1)
,,{
,, m_Sgna1k11 = true,
,, evtManua18est.Set{),
,, 1 {thrdScro11ane1.Jon{))
,, {
,, thrdScro11ane1.^bort{),
,, )
,,)

m_Ietch8ssIeed = nu11,
m_8SSrevew.C1ose{),
m_8SSrevew = nu11,
1eedvew.C1ose{),
1eedvew = nu11,
ueskLop Sldebar


age 62
m_8ssI1e8Lader^ndWrter = nu11,
m_Ietch8ssIeed = nu11,
m_Show8SSIeed = nu11,
m_Subscrpton.C1ose{),
m_Subscrpton = nu11,

)
catch {Lxcepton ex)
{
)

)
endregon

regon Sera1zaton 8egon

,,, <summary>
,,, Sera1zes the current state o1 the gadget nc1udng 1ont sty1e,1ont co1or etc.
,,, <,summary>
prvate vod Sera1ze6adgetSty1e{)
{
I1eStream 1s = nu11,
1 {I1e.Lxsts{strI1eath))
{
I1e.0e1ete{strI1eath),
)
try
{
1s = new I1eStream{strI1eath, I1eMode.Create, I1e^ccess.Wrte),
8naryIormatter bnaryIormatter = new 8naryIormatter{),

bnaryIormatter.Sera1ze{1s, m_6adgetSty1e),
)
catch { )
1na11y
{
1s.C1ose{),
)

)

,,, <summary>
,,, 0esera1zes the gadget sty1e
,,, <,summary>
prvate vod 0esera1ze6adgetSty1e{)
{
I1eStream 1s = nu11,
1 {I1e.Lxsts{strI1eath))
{
try
{
1s = new I1eStream{strI1eath, I1eMode.0pen, I1e^ccess.8ead),
8naryIormatter bnaryIormatter = new 8naryIormatter{),
m_6adgetSty1e = {6adgetSty1e)bnaryIormatter.0esera1ze{1s),
)
catch { )
1na11y
ueskLop Sldebar


age 63
{
1s.C1ose{),
)
)
e1se
{
m_6adgetSty1e = new 6adgetSty1e{),
)
)

endregon

regon ub1c Method 8egon

,,, <summary>
,,, starts thread to 1etch 8SS Ieeds
,,, <,summary>
pub1c vod Startng1hread1oIetch8SSIeed{)
{
m_Show8SSIeed.Start1hread{),
m_Ietch8ssIeed.Start1hread{),

,, Scro11pane1 thread s used to autoscro11 the pane1 1or 1eeds.

,,1 {nu11 == thrdScro11ane1)
,,{
,, thrdScro11ane1 = new 1hread{new 1hreadStart{StartScro11)),
,, thrdScro11ane1.1s8ackground = true,
,, thrdScro11ane1.rorty = 1hreadrorty.uorma1,
,, thrdScro11ane1.uame = "Scro11er",
,, thrdScro11ane1.Start{),
,,)
,,e1se
,,{
,, thrdScro11ane1.Start{),
,,)

)


,,, <summary>
,,, 0sp1ays the 1eed vew wndow
,,, <,summary>
pub1c vod ShowIeedvew{)
{

1 {nu11 == 1eedvew)
{
1eedvew = new 8SSIeedvew{re1 m_8ssI1e8Lader^ndWrter, re1
m_8ssIeedvewer),
1eedvew.evtCheck^utoude += new 8SSIeedvew.Check^utoude{Check^utoude),
)
e1se 1 {!1eedvew.sude)
{
1eedvew.C1osevew{),
return ,
)
ueskLop Sldebar


age 64
1eedvew.Sze = new Sze{S, 4),
1eedvew.ShowIeed{),
1 {ths.1sI1oated)
{
1 {ths.arent.arent.locaton.x >= Screen.rmaryScreen.Workng^rea.Wdth ,
)
{
1eedvew.rght8order.Lnab1ed = 1a1se,
1eedvew.1e1t8order.Lnab1ed = true,
1eedvew.locaton = new ont{ths.arent.arent.locaton.x -
1eedvew.Wdth, ),
)
e1se
{
1eedvew.locaton = new ont{ths.arent.arent.locaton.x +
ths.arent.arent.Wdth, ),
1eedvew.rght8order.Lnab1ed = true,
1eedvew.1e1t8order.Lnab1ed = 1a1se,
)


)
e1se 1 {ths.arent.arent.locaton.x > S)
{
1eedvew.locaton = new ont{ths.arent.arent.locaton.x - 1eedvew.Wdth,
S),
1eedvew.1e1t8order.Lnab1ed = true,
1eedvew.rght8order.Lnab1ed = 1a1se,
)
e1se
{
1eedvew.locaton = new ont{ths.arent.arent.locaton.x +
ths.arent.arent.Wdth, S),
1eedvew.rght8order.Lnab1ed = true,
1eedvew.1e1t8order.Lnab1ed = 1a1se,
)
sScro11anvsb1e = true,
1oreach {0sp1ayIeed pn1Ieed n 8aseane1.Contro1s)
{
pn1Ieed.1b11t1e.C1ck -= new Lventuand1er{pn1Ieed.1b11t1e_C1ck),
)
1eedvew.Show{),
sScro11anvsb1e = true,
1eedvew.sude = 1a1se,

)

,,, <summary>
,,, Shows up the 1orm 1or subscrpton
,,, <,summary>
pub1c vod Subscbeur1{)
{
nt 11ag = ,
1 {m_Subscrpton != nu11)
m_Subscrpton = new Subscrpton{re1 m_Ietch8ssIeed),
m_Subscrpton.evtCheck^utoude += new Subscrpton.Check^utoude{Check^utoude),
1 {8aseane1.arent.arent.arent.locaton.x < m_Subscrpton.Wdth)
ueskLop Sldebar


age 63
m_Subscrpton.locaton = new ont{8aseane1.arent.arent.arent.locaton.x
+ 8aseane1.arent.arent.arent.Wdth, ),
e1se
{
m_Subscrpton.locaton = new ont{8aseane1.arent.arent.arent.locaton.x
- m_Subscrpton.Wdth, ),
)
,, m_Subscrpton.1opMost = true,
11ag = 1sIorm^1ready0pen{m_Subscrpton.uame.1oStrng{)),
1 {11ag == )
{
,,do nothng

)
e1se 1 {11ag == )
{
m_Subscrpton.Show{),
)
,, m_Subscrpton.Show{),
)

,,, <summary>
,,, undocks the 8SS revew pane
,,, <,summary>
,,, <param name="sender"><,param>
,,, <param name="e"><,param>
pub1c vod undock_8SSrevew{obect sender, Lvent^rgs e)
{
m_8SSrevew.btnundock_C1ck{sender, e),
)


,,, <summary>
,,, Checks 1 a 1orm s a1ready open or not
,,, <,summary>
,,, <param name="uame"><,param>
,,, <returns><,returns>
pub1c statc nt 1sIorm^1ready0pen{strng uame)
{
1oreach {Iorm 0penIorm n ^pp1caton.0penIorms)
{
1 {0penIorm.uame.1oStrng{) == uame)
return ,
)

return ,
)

endregon

regon 1nterna1 Method 8egon

,,, <summary>
,,, Ca11s the update 1eed method o1 show8SSIeed c1ass
,,, <,summary>
,,, <param name="strlnk"><,param>
nterna1 vod update{strng strlnk)
ueskLop Sldebar


age 66
{
m_Show8SSIeed.updateIeed{strlnk),
)

,,, <summary>
,,, Checks whether 1eeds have been 1oaded or not n the sdebar
,,, and dsp1ays message accordng1y
,,, <,summary>
nterna1 vod Ieedloaded{)
{
,,1 {m_Ietch8ssIeed.8SSur1lst.Count == )
,,{
,, 1b1loadng.1ext = "1ease con1gure the gadget...",
,,)
,,e1se
,,{
1b1loadng.Send1o8ack{),
,, 1b1loadng.1ext = "loadng...",
1b1loadng.vsb1e = 1a1se,
,, )
)


,,, <summary>
,,, 0sp1ays a network message to user
,,, <,summary>
,,, <param name="strMessage"><,param>
nterna1 vod ShowuetworkMessage{strng strMessage)
{
Message8ox.Show{strMessage),
)

,,, <summary>
,,, Lvent hand1er 1or the mouse over event
,,, <,summary>
,,, <param name="sender"><,param>
,,, <param name="e"><,param>
nterna1 vod onMouse0ver{obect sender, Lvent^rgs e)
{
try
{
evtMouseuover{sender, e),
evtManua18est.8eset{),
)
catch { )
)

,,, <summary>
,,, Lvent hand1er 1or the mouse move event
,,, <,summary>
,,, <param name="sender"><,param>
,,, <param name="e"><,param>
nterna1 vod onMouseMove{obect sender, MouseLvent^rgs e)
{
try
{
evt0nMouseMove{sender, e),
ueskLop Sldebar


age 67
)
catch { )
)

,,, <summary>
,,, Lvent hand1er 1or the mouse 1eave event
,,, <,summary>
,,, <param name="sender"><,param>
,,, <param name="e"><,param>
nterna1 vod onMouseleave{obect sender, Lvent^rgs e)
{
try
{
evtMouseleave{sender, e),
)
catch { )
)

,,, <summary>
,,, shows the prevew wndow o1 a certan 1eed n c1ck o1 tt1e
,,, <,summary>
,,, <param name="dsp1ayIeed"><,param>
nterna1 vod Showrevew{re1 0sp1ayIeed dsp1ayIeed)
{
1 {nu11 == m_8SSrevew)
m_8SSrevew = new 8SSrevew{re1 m_8ssIeedvewer),

1 {sScro11anvsb1e)
{
8SSrevew.^ctvated = true,
1 {1eedvew.locaton.x > ths.Wdth + )
{
m_8SSrevew.revewlocaton = new ont{1eedvew.locaton.x -
m_8SSrevew.Wdth, 1eedvew.8aseane1.locaton.Y + dsp1ayIeed.locaton.Y +
1eedvew.locaton.Y + ),
)
e1se
{
1 {1eedvew.locaton.x + 1eedvew.Wdth + m_8SSrevew.Wdth <
Screen.rmaryScreen.Workng^rea.Wdth + ths.arent.arent.Wdth)
{
m_8SSrevew.revewlocaton = new ont{1eedvew.locaton.x +
1eedvew.Wdth, 1eedvew.8aseane1.locaton.Y + dsp1ayIeed.locaton.Y + 1eedvew.locaton.Y
+ ),
)
e1se
{
1 {le1t)
m_8SSrevew.revewlocaton = new ont{1eedvew.locaton.x +
1eedvew.Wdth , , 1eedvew.8aseane1.locaton.Y + dsp1ayIeed.locaton.Y +
1eedvew.locaton.Y + ),
e1se
m_8SSrevew.revewlocaton = new
ont{Screen.rmaryScreen.Workng^rea.x, 1eedvew.8aseane1.locaton.Y +
dsp1ayIeed.locaton.Y + 1eedvew.locaton.Y + ),
)
)
ueskLop Sldebar


age 68
1 {{1eedvew.8aseane1.locaton.Y + dsp1ayIeed.locaton.Y +
1eedvew.locaton.Y + ) > Screen.rmaryScreen.Workng^rea.8ottom - m_8SSrevew.ueght)
{
m_8SSrevew.revewlocaton = new ont{m_8SSrevew.revewlocaton.x,
Screen.rmaryScreen.Workng^rea.8ottom - m_8SSrevew.ueght),
)
)
e1se
{
1 {ths.arent.arent.locaton.x < m_8SSrevew.Wdth)
m_8SSrevew.revewlocaton = new ont{ths.arent.arent.locaton.x +
ths.arent.arent.Wdth, ths.arent.arent.locaton.Y + dsp1ayIeed.locaton.Y + S8 +
8aseane1.locaton.Y),
e1se
{
m_8SSrevew.revewlocaton = new ont{ths.arent.arent.locaton.x -
m_8SSrevew.Wdth, ths.arent.arent.locaton.Y + dsp1ayIeed.locaton.Y + S8 +
8aseane1.locaton.Y),
)
1 {ths.arent.arent.8ottom - dsp1ayIeed.locaton.Y + 8aseane1.locaton.Y
< m_8SSrevew.ueght)
{
m_8SSrevew.revewlocaton = new ont{m_8SSrevew.revewlocaton.x,
ths.arent.arent.8ottom - m_8SSrevew.ueght),
)
)
m_8SSrevew.revew0escrpton1ext = dsp1ayIeed.0escrpton,
m_8SSrevew.revew1t1e1ext = dsp1ayIeed.1b11t1e.1ext,
m_8SSrevew.revewu8l = dsp1ayIeed.1b11t1e.1ag.1oStrng{),

m_8SSrevew.1opMost = true,
evtManua18est.8eset{),
m_8SSrevew.sloaded = true,
m_8SSrevew.Show0a1og{),
)


,,, <summary>
,,, 6ets the scro11ab1e heght o1 the the 1eed vewer n case scro11ng s provded
,,, <,summary>
nterna1 vod 6etScro11ab1eueght{)
{
8aseane1.^utoScro11 = 1a1se,
1 {8aseane1.ueght > ths.ueght)
{
Scro11011t = 8aseane1.ueght - ths.ueght,
1 {Scro11011t > )
evtManua18est.Set{),
Scro11up = true,
Scro110own = 1a1se,
)
)


,,, <summary>
,,, Sets the seperator mage and t's attrbutes
,,, <,summary>
ueskLop Sldebar


age 69
,,, <param name="mg"><,param>
nterna1 vod SetSeparatorueght^nd1mage{1mage mg)
{
1 {8aseane1.Contro1s.Count > )
{
1oreach {0sp1ayIeed ob0sp1ayIeed n 8aseane1.Contro1s)
{
1 {mg != nu11)
ob0sp1ayIeed.SetSeparator1mages = mg,
e1se
{
ob0sp1ayIeed.Separatorueght = m_6adgetSty1e.Separartorueght,
)
)
)
)

endregon

regon rvate Method 8egon

,,, <summary>
,,, starts the autoscro11ng
,,, <,summary>
prvate vod StartScro11{)
{
wh1e {true)
{
evtManua18est.Wat0ne{),
1 {m_Sgna1k11)
break,
try
{
ths.8egn1nvoke{new Scro11{Scro118aseane1)),
1hread.S1eep{S),

1 {m_Sgna1k11)
break,
)
catch { )
)
)

,,, <summary>
,,, Scro11s the basepane1 1or vewng 1eeds
,,, <,summary>
prvate vod Scro118aseane1{)
{
1 {ths.1nvoke8equred)
{
ths.8egn1nvoke{new Scro11{Scro118aseane1)),
)
e1se
{

1 {Scro11ont < Scro11011t && Scro11ont > && {Scro11011t -
Scro11ont > ))
ueskLop Sldebar


age 70
{
8aseane1.locaton = new ont{8aseane1.locaton.x, 8aseane1.locaton.Y
- ),
8aseane1.1nva1date{),
Scro11ont += ,
)
e1se
{
,,8aseane1.locaton = new ont{8aseane1.locaton.x,
8aseane1.locaton.Y + {Scro11ont - Scro11011t)),
,,1 {Scro11ont + 8aseane1.locaton.Y > )
,,{
,, 8aseane1.locaton = new ont{8aseane1.locaton.x,
8aseane1.locaton.Y - {Scro11ont + 8aseane1.locaton.Y)),
,,)
,,Scro11ont = Scro11011t,
8aseane1.locaton = ane10rgna1ont,
Scro11ont = ,
)

)
)


prvate 8tmap 8esze8tmap{8tmap orgna1, nt nWdth, nt nueght)
{
return new 8tmap{orgna1, nWdth, nueght),
)

prvate vod SetIontSze{)
{
1 {8aseane1.Contro1s.Count > )
{
1oreach {0sp1ayIeed ob0sp1ayIeed n 8aseane1.Contro1s)
{
Iont 1abe1Iont = ob0sp1ayIeed.1b11t1e.Iont,
1abe1Iont = new System.0rawng.Iont{"verdana", m_6adgetSty1e.1ontSze,
IontSty1e.8o1d, 6raphcsunt.ont, {{byte){))),
ob0sp1ayIeed.1b11t1e.Iont = 1abe1Iont,
1abe1Iont = new System.0rawng.Iont{"verdana", m_6adgetSty1e.1ontSze,
IontSty1e.8egu1ar, 6raphcsunt.ont, {{byte){))),
ob0sp1ayIeed.1b10escrpton.Iont = 1abe1Iont,
ob0sp1ayIeed.1b1^uthor.Iont = 1abe1Iont,
ob0sp1ayIeed.1b11me.Iont = 1abe1Iont,
)
)
)
prvate vod setIontCo1or{)
{
1 {8aseane1.Contro1s.Count > )
{
1oreach {0sp1ayIeed ob0sp1ayIeed n 8aseane1.Contro1s)
{
ob0sp1ayIeed.1t1eCo1or = m_6adgetSty1e.1t1eCo1or,
ob0sp1ayIeed.0escrptonCo1or = m_6adgetSty1e.0escrptonCo1or,
ob0sp1ayIeed.^uthorCo1or = m_6adgetSty1e.^uthorCo1or,
ob0sp1ayIeed.1meCo1or = m_6adgetSty1e.1meCo1or,
ueskLop Sldebar


age 71
)
)
)


endregon

regon Iorm's Lvent 8egon

prvate vod 8ssIeedvewer_8esze{obect sender, Lvent^rgs e)
{
evtManua18est.8eset{),
6etScro11ab1eueght{),
)

prvate vod optons1oo1StrpMenu1tem_C1ck{obect sender, Lvent^rgs e)
{
,, 100o: runtme user optons
)

prvate vod 8SSIeedvewer_load{obect sender, Lvent^rgs e)
{
ths.Sze = ths.arent.Sze,
1 {m_Ietch8ssIeed.8SSur1lst.Count == )
{
1b1loadng.1ext = "1ease subscrbe 1or 8SS 1eeds...",
1b1loadng.vsb1e = true,
)
e1se
{
1b1loadng.1ext = "loadng...",
1b1loadng.vsb1e = true,
)
)

prvate vod 8aseane1_Mouseleave{obect sender, Lvent^rgs e)
{
evtManua18est.Set{),
onMouseleave{sender, e),
)

endregon


)
)











ueskLop Sldebar


age 72

Coding on RSS notification windows :

usng System,
usng System.Co11ectons.6enerc,
usng System.ComponentMode1,
usng System.0ata,
usng System.0rawng,
usng System.1ext,
usng System.Wndows.Iorms,
usng System.0agnostcs,

namespace 8SSIeed6adget
{
pub1c parta1 c1ass 8SSuot1catonWndow : Iorm
{
ont p,
nt counter = ,
nt Stay1me = 4,
strng strur = strng.Lmpty,
prvate 1mage pane11mage,
prvate 1mage rss1mage,

pub1c 1mage uot1y8g1mage
{
set
{
ths.8ackground1mage = va1ue,
)
)

pub1c 1mage uot1y1con1mage
{
set
{
pct8SS1con.1mage = va1ue,
)
)

pub1c strng uot1yu8l
{
set { strur = va1ue, )
)

pub1c strng uot1y1t1e
{
set { 1b11t1e.1ext = va1ue, )
)
pub1c strng uot1yMessage
{
set{
1b1Message.1ext = va1ue,
1 {1b1Message.1ext.length > 4)
{
1b1Message.1ext = 1b1Message.1ext.Substrng{, 27) + "...",
)
ueskLop Sldebar


age 73
)
)

pub1c Sze uot1y1conSze
{
set { pct8SS1con.Sze = va1ue, )
)

pub1c 8orderSty1e uot1y1con8orderSty1e
{
set { pct8SS1con.8orderSty1e = va1ue, )
)

pub1c Co1or uot1y8ackCo1or
{
set { ths.8ackCo1or = va1ue, )
)

pub1c 1mage uot1yC1ose8utton1mage
{
set { 1b1IormC1ose.1mage = va1ue, )
)

pub1c nt Stay1me
{
set { Stay1me = va1ue * , )
)


pub1c 8SSuot1catonWndow{)
{
1nta1zeComponent{),
p = new ont{),
)

prvate vod tmerup_1ck{obect sender, Lvent^rgs e)
{
try
{
p = ths.locaton,
1 {p.Y == Screen.rmaryScreen.8ounds.ueght - )
{

tmerup.Lnab1ed = 1a1se,
tmer0own.1nterva1 = ,
tmer0own.Lnab1ed = true,
)
e1se
{
p.Y -= S,
ths.locaton = p,
)
)
catch { )
)

prvate vod tmer0own_1ck{obect sender, Lvent^rgs e)
ueskLop Sldebar


age 74
{

try
{
1 {counter == Stay1me)
{
1 {ths.p.Y == Screen.rmaryScreen.8ounds.ueght)
{
tmer0own.Lnab1ed = 1a1se,
ths.C1ose{),
)
e1se
{
p.Y += S,
ths.locaton = p,
)
)
e1se
counter++,
)
catch { )
)

prvate vod uot1catonWndow_load{obect sender, Lvent^rgs e)
{
try
{
ths.locaton = new ont{Screen.rmaryScreen.8ounds.Wdth - ths.Wdth,
Screen.rmaryScreen.8ounds.ueght),
tmerup.1nterva1 = ,
tmerup.Lnab1ed = true,
ths.1opMost = true,
)
catch { )
)

prvate vod 1b1IormC1ose_C1ck{obect sender, Lvent^rgs e)
{
ths.C1ose{),
)

prvate vod mouse0ver{obect sender, Lvent^rgs e)
{
tmer0own.Stop{),
)
prvate vod mouseleave{obect sender, Lvent^rgs e)
{
tmer0own.Start{),
)

prvate vod 0pen8rowser_C1ck{obect sender, Lvent^rgs e)
{
try
{
rocess.Start{strur),
)
catch { )
ueskLop Sldebar


age 73
ths.C1ose{),
)

prvate vod uot1catonWndow_IormC1osng{obect sender, IormC1osngLvent^rgs e)
{

)


)
)

Vous aimerez peut-être aussi