Compare commits
285 Commits
pagesdraft
...
r#141
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4a309ad980 | ||
|
|
c301f908ad | ||
|
|
6ce158dc41 | ||
|
|
e8fe0bb041 | ||
|
|
b337eefc8c | ||
|
|
70d92c7a3b | ||
|
|
363baad60c | ||
|
|
2606e089df | ||
|
|
a99ff5526c | ||
|
|
64fc09f622 | ||
|
|
a9a96b6ffc | ||
|
|
f79cd5836e | ||
|
|
d414e4df47 | ||
|
|
4652b82885 | ||
|
|
7637b62271 | ||
|
|
55e426f6c2 | ||
|
|
2eea814558 | ||
|
|
121c728df7 | ||
|
|
9a84f847d1 | ||
|
|
fa7a84661e | ||
|
|
75b6b4501f | ||
|
|
a3014d04c8 | ||
|
|
bcceaaaa53 | ||
|
|
6f5496a006 | ||
|
|
a366d0e949 | ||
|
|
88320657e9 | ||
|
|
1136e29034 | ||
|
|
759f0a8859 | ||
|
|
bf9a612de5 | ||
|
|
00fb9ca637 | ||
|
|
49151c0714 | ||
|
|
5eedf70604 | ||
|
|
c2871bb3d1 | ||
|
|
9abb7de1ec | ||
|
|
854dc8b46e | ||
|
|
96cd4bccb4 | ||
|
|
6338caea9c | ||
|
|
3874f2ef06 | ||
|
|
c12c76c5ae | ||
|
|
a3c8f3b9fc | ||
|
|
dadcc2e965 | ||
|
|
175b871005 | ||
|
|
af57bad869 | ||
|
|
932842aebb | ||
|
|
125587f99c | ||
|
|
1b52f87950 | ||
|
|
6b8ec1e8b0 | ||
|
|
5788889ae7 | ||
|
|
6b5341d1ac | ||
|
|
900cb9111a | ||
|
|
0df8f72c53 | ||
|
|
970c6ce8e8 | ||
|
|
9662be5632 | ||
|
|
6a69aec6eb | ||
|
|
dd7ef6e82e | ||
|
|
3e3b082463 | ||
|
|
4a5253c25c | ||
|
|
a375fe9008 | ||
|
|
1d434a394f | ||
|
|
5aee5e266a | ||
|
|
666b6c9730 | ||
|
|
59503f2d23 | ||
|
|
43cfeea2d7 | ||
|
|
d17b4b7e33 | ||
|
|
b78250401c | ||
|
|
d167dbfb9e | ||
|
|
0072df1186 | ||
|
|
218353393e | ||
|
|
de91ac2d76 | ||
|
|
74224a4fc5 | ||
|
|
0ceb0584d1 | ||
|
|
88b664284f | ||
|
|
92614e7128 | ||
|
|
9eff5be228 | ||
|
|
9ebeaa8147 | ||
|
|
b9f268d594 | ||
|
|
7978e27049 | ||
|
|
be65f4056b | ||
|
|
73a186cf28 | ||
|
|
7a7c478277 | ||
|
|
c886b3e573 | ||
|
|
98a51bce24 | ||
|
|
a7769184d5 | ||
|
|
40145c727e | ||
|
|
6ead6414e6 | ||
|
|
03789a9a38 | ||
|
|
92db7d16f3 | ||
|
|
9454a764d6 | ||
|
|
a433d47583 | ||
|
|
486058687d | ||
|
|
ce3c953b64 | ||
|
|
e2ee1aad9f | ||
|
|
281cd06bab | ||
|
|
d71f6db920 | ||
|
|
eb68b666f7 | ||
|
|
8a69101cbf | ||
|
|
d9a54b2b13 | ||
|
|
92d580f270 | ||
|
|
8b4ee44520 | ||
|
|
9c0415ddbb | ||
|
|
52a3154caf | ||
|
|
18f72e6096 | ||
|
|
82625f7aa4 | ||
|
|
0b82c3b18a | ||
|
|
3616bd233f | ||
|
|
573a562e03 | ||
|
|
25d6217a9b | ||
|
|
5fbd297af5 | ||
|
|
f1e41b1fce | ||
|
|
c0692dfca9 | ||
|
|
cf4c5dc486 | ||
|
|
707e7c0761 | ||
|
|
347e45f561 | ||
|
|
4395f4f6cd | ||
|
|
182b50eca2 | ||
|
|
544ae68f2c | ||
|
|
db15808e24 | ||
|
|
7e99840b6c | ||
|
|
0f82e4512d | ||
|
|
19e18a4daa | ||
|
|
2a24c01854 | ||
|
|
2ef3d053b1 | ||
|
|
c0a880e771 | ||
|
|
46cedaeeb4 | ||
|
|
bda60de4f5 | ||
|
|
e70a6d36f1 | ||
|
|
80d008a431 | ||
|
|
175765a3c0 | ||
|
|
5a709e7445 | ||
|
|
a2eeb54c55 | ||
|
|
511e6640ba | ||
|
|
505b19e57d | ||
|
|
5d2614d59b | ||
|
|
5c8756ac21 | ||
|
|
10018077fc | ||
|
|
ca13f3f581 | ||
|
|
6f1eae3ca8 | ||
|
|
8774683a80 | ||
|
|
8335c47b0f | ||
|
|
ceeaabac1c | ||
|
|
e1abe121bf | ||
|
|
ed891074e0 | ||
|
|
6dc522b6a8 | ||
|
|
b54be92e3c | ||
|
|
12acceff32 | ||
|
|
9e31f121ba | ||
|
|
a06133b173 | ||
|
|
4fa7c9d9dd | ||
|
|
e46a7a22e1 | ||
|
|
7396edc095 | ||
|
|
b6b003315f | ||
|
|
e1ea814861 | ||
|
|
579217ec1c | ||
|
|
2f247e29b4 | ||
|
|
3003508139 | ||
|
|
cb242fc2fd | ||
|
|
4f10725531 | ||
|
|
c3a572c6f6 | ||
|
|
e60bfae1a8 | ||
|
|
731e3305b9 | ||
|
|
bc77d076c9 | ||
|
|
b3ef2ab81f | ||
|
|
ea54e23d56 | ||
|
|
0f64e15c3f | ||
|
|
476a626de4 | ||
|
|
2b4b980883 | ||
|
|
086317fef5 | ||
|
|
3755348854 | ||
|
|
cc4cfd9afd | ||
|
|
7053571f6c | ||
|
|
170067df02 | ||
|
|
38becf5ae6 | ||
|
|
0e90a7a03c | ||
|
|
7e65f09ca8 | ||
|
|
7056650095 | ||
|
|
5e5074a534 | ||
|
|
f5ef147baa | ||
|
|
c9b3553d2a | ||
|
|
f8280d1ce1 | ||
|
|
448cfd5118 | ||
|
|
655b4c0638 | ||
|
|
ff39d78658 | ||
|
|
d8071e76eb | ||
|
|
2e883b1e98 | ||
|
|
5a55355f98 | ||
|
|
cfb7b74610 | ||
|
|
22a0315fdd | ||
|
|
fe46e28a26 | ||
|
|
31b4e4459e | ||
|
|
0991901c90 | ||
|
|
94a12f2a77 | ||
|
|
2b96528c7d | ||
|
|
7ee3fa5535 | ||
|
|
a8d93ee943 | ||
|
|
2a8d321a64 | ||
|
|
4b5587770c | ||
|
|
a750b5e1a2 | ||
|
|
709f7fc289 | ||
|
|
811ad35fa9 | ||
|
|
ab0ba5ac6b | ||
|
|
bb3de8beec | ||
|
|
c5ea535489 | ||
|
|
bbc6269ed1 | ||
|
|
d8b3848086 | ||
|
|
775533ec32 | ||
|
|
eb91cbae44 | ||
|
|
b52c0c8625 | ||
|
|
52872b108b | ||
|
|
d06b86bc41 | ||
|
|
c293c331fb | ||
|
|
e044450f1d | ||
|
|
ce6358b9f7 | ||
|
|
e27a8bb989 | ||
|
|
c666a526f0 | ||
|
|
6fed7482ca | ||
|
|
4d79854ee7 | ||
|
|
57da34fc6b | ||
|
|
518bbc00ce | ||
|
|
38b379c6d6 | ||
|
|
24f7607f84 | ||
|
|
55d55c64e0 | ||
|
|
8f472d7662 | ||
|
|
919c1f8d08 | ||
|
|
ff81278aba | ||
|
|
0b71ef13fe | ||
|
|
e180ca3a45 | ||
|
|
978fb9b83b | ||
|
|
fcd674aa4e | ||
|
|
7e2552a8e3 | ||
|
|
ffc902c78f | ||
|
|
5dbcc01dd2 | ||
|
|
a2463795f9 | ||
|
|
53d5fa413e | ||
|
|
5c3a8a3432 | ||
|
|
e451f7ff89 | ||
|
|
25b05855a2 | ||
|
|
52625e6bee | ||
|
|
6da4552e79 | ||
|
|
1c890fd43d | ||
|
|
f8f90ab247 | ||
|
|
0f6196a521 | ||
|
|
eac32fadd3 | ||
|
|
3d3a0fa9e2 | ||
|
|
a93ea28794 | ||
|
|
f49d1bba36 | ||
|
|
db46c1a451 | ||
|
|
7068d54406 | ||
|
|
2f4034a4f2 | ||
|
|
ec3fd17234 | ||
|
|
bff8eb07c8 | ||
|
|
512d367a7e | ||
|
|
eb533e8008 | ||
|
|
6071f96b3b | ||
|
|
72495a5bc5 | ||
|
|
84266dfb59 | ||
|
|
9c973b2b8f | ||
|
|
590cf43751 | ||
|
|
5b66041f81 | ||
|
|
9a81b166cd | ||
|
|
70a8f7a266 | ||
|
|
4bde4a8ba2 | ||
|
|
66e5bd95b8 | ||
|
|
8c8d5bc2ce | ||
|
|
a71a67cd06 | ||
|
|
d935b7c2d9 | ||
|
|
61c0a9c736 | ||
|
|
4b41d8b764 | ||
|
|
1bf0531e34 | ||
|
|
6f92d8f268 | ||
|
|
13c2e96867 | ||
|
|
faa5dc7440 | ||
|
|
29bc862035 | ||
|
|
c2bfc2b1d3 | ||
|
|
78ff7bf24f | ||
|
|
c3a9109a7e | ||
|
|
1265e916c7 | ||
|
|
586718d983 | ||
|
|
ffa0d8a009 | ||
|
|
04695ee32f | ||
|
|
159dab18f3 | ||
|
|
4ef5e7995b | ||
|
|
fa9f3c0fe2 | ||
|
|
a5c37eef1e | ||
|
|
c60fb42122 | ||
|
|
56d7145878 |
64
.gitattributes
vendored
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
###############################################################################
|
||||||
|
# Set default behavior to automatically normalize line endings.
|
||||||
|
###############################################################################
|
||||||
|
* text=auto
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Set default behavior for command prompt diff.
|
||||||
|
#
|
||||||
|
# This is need for earlier builds of msysgit that does not have it on by
|
||||||
|
# default for csharp files.
|
||||||
|
# Note: This is only used by command line
|
||||||
|
###############################################################################
|
||||||
|
#*.cs diff=csharp
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Set the merge driver for project and solution files
|
||||||
|
#
|
||||||
|
# Merging from the command prompt will add diff markers to the files if there
|
||||||
|
# are conflicts (Merging from VS is not affected by the settings below, in VS
|
||||||
|
# the diff markers are never inserted). Diff markers may cause the following
|
||||||
|
# file extensions to fail to load in VS. An alternative would be to treat
|
||||||
|
# these files as binary and thus will always conflict and require user
|
||||||
|
# intervention with every merge. To do so, just uncomment the entries below
|
||||||
|
###############################################################################
|
||||||
|
*.csproj -text merge=union
|
||||||
|
*.sln -text merge=union
|
||||||
|
*.resx -text merge=union
|
||||||
|
#*.vbproj merge=binary
|
||||||
|
#*.vcxproj merge=binary
|
||||||
|
#*.vcproj merge=binary
|
||||||
|
#*.dbproj merge=binary
|
||||||
|
#*.fsproj merge=binary
|
||||||
|
#*.lsproj merge=binary
|
||||||
|
#*.wixproj merge=binary
|
||||||
|
#*.modelproj merge=binary
|
||||||
|
#*.sqlproj merge=binary
|
||||||
|
#*.wwaproj merge=binary
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# behavior for image files
|
||||||
|
#
|
||||||
|
# image files are treated as binary by default.
|
||||||
|
###############################################################################
|
||||||
|
#*.jpg binary
|
||||||
|
#*.png binary
|
||||||
|
#*.gif binary
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# diff behavior for common document formats
|
||||||
|
#
|
||||||
|
# Convert binary document formats to text before diffing them. This feature
|
||||||
|
# is only available from the command line. Turn it on by uncommenting the
|
||||||
|
# entries below.
|
||||||
|
###############################################################################
|
||||||
|
#*.doc diff=astextplain
|
||||||
|
#*.DOC diff=astextplain
|
||||||
|
#*.docx diff=astextplain
|
||||||
|
#*.DOCX diff=astextplain
|
||||||
|
#*.dot diff=astextplain
|
||||||
|
#*.DOT diff=astextplain
|
||||||
|
#*.pdf diff=astextplain
|
||||||
|
#*.PDF diff=astextplain
|
||||||
|
#*.rtf diff=astextplain
|
||||||
|
#*.RTF diff=astextplain
|
||||||
194
.gitignore
vendored
Normal file
@@ -0,0 +1,194 @@
|
|||||||
|
## Ignore Visual Studio temporary files, build results, and
|
||||||
|
## files generated by popular Visual Studio add-ons.
|
||||||
|
|
||||||
|
# User-specific files
|
||||||
|
*.suo
|
||||||
|
*.user
|
||||||
|
*.sln.docstates
|
||||||
|
|
||||||
|
# Build results
|
||||||
|
|
||||||
|
[Dd]ebug/
|
||||||
|
[Rr]elease/
|
||||||
|
x64/
|
||||||
|
build/
|
||||||
|
[Bb]in/
|
||||||
|
[Oo]bj/
|
||||||
|
|
||||||
|
# MSTest test Results
|
||||||
|
[Tt]est[Rr]esult*/
|
||||||
|
[Bb]uild[Ll]og.*
|
||||||
|
|
||||||
|
*_i.c
|
||||||
|
*_p.c
|
||||||
|
*.ilk
|
||||||
|
*.meta
|
||||||
|
*.obj
|
||||||
|
*.pch
|
||||||
|
*.pdb
|
||||||
|
*.pgc
|
||||||
|
*.pgd
|
||||||
|
*.rsp
|
||||||
|
*.sbr
|
||||||
|
*.tlb
|
||||||
|
*.tli
|
||||||
|
*.tlh
|
||||||
|
*.tmp
|
||||||
|
*.tmp_proj
|
||||||
|
*.log
|
||||||
|
*.vspscc
|
||||||
|
*.vssscc
|
||||||
|
.builds
|
||||||
|
*.pidb
|
||||||
|
*.log
|
||||||
|
*.scc
|
||||||
|
|
||||||
|
# Visual C++ cache files
|
||||||
|
ipch/
|
||||||
|
*.aps
|
||||||
|
*.ncb
|
||||||
|
*.opensdf
|
||||||
|
*.sdf
|
||||||
|
*.cachefile
|
||||||
|
|
||||||
|
# Visual Studio profiler
|
||||||
|
*.psess
|
||||||
|
*.vsp
|
||||||
|
*.vspx
|
||||||
|
|
||||||
|
# Guidance Automation Toolkit
|
||||||
|
*.gpState
|
||||||
|
|
||||||
|
# ReSharper is a .NET coding add-in
|
||||||
|
_ReSharper*/
|
||||||
|
*.[Rr]e[Ss]harper
|
||||||
|
|
||||||
|
# TeamCity is a build add-in
|
||||||
|
_TeamCity*
|
||||||
|
|
||||||
|
# DotCover is a Code Coverage Tool
|
||||||
|
*.dotCover
|
||||||
|
|
||||||
|
# NCrunch
|
||||||
|
*.ncrunch*
|
||||||
|
.*crunch*.local.xml
|
||||||
|
|
||||||
|
# Installshield output folder
|
||||||
|
[Ee]xpress/
|
||||||
|
|
||||||
|
# DocProject is a documentation generator add-in
|
||||||
|
DocProject/buildhelp/
|
||||||
|
DocProject/Help/*.HxT
|
||||||
|
DocProject/Help/*.HxC
|
||||||
|
DocProject/Help/*.hhc
|
||||||
|
DocProject/Help/*.hhk
|
||||||
|
DocProject/Help/*.hhp
|
||||||
|
DocProject/Help/Html2
|
||||||
|
DocProject/Help/html
|
||||||
|
|
||||||
|
# Click-Once directory
|
||||||
|
publish/
|
||||||
|
|
||||||
|
# Publish Web Output
|
||||||
|
*.Publish.xml
|
||||||
|
*.pubxml
|
||||||
|
|
||||||
|
# NuGet Packages Directory
|
||||||
|
## TODO: If you have NuGet Package Restore enabled, uncomment the next line
|
||||||
|
#packages/
|
||||||
|
|
||||||
|
# Windows Azure Build Output
|
||||||
|
csx
|
||||||
|
*.build.csdef
|
||||||
|
|
||||||
|
# Windows Store app package directory
|
||||||
|
AppPackages/
|
||||||
|
|
||||||
|
# Others
|
||||||
|
sql/
|
||||||
|
*.Cache
|
||||||
|
ClientBin/
|
||||||
|
[Ss]tyle[Cc]op.*
|
||||||
|
~$*
|
||||||
|
*~
|
||||||
|
*.dbmdl
|
||||||
|
*.[Pp]ublish.xml
|
||||||
|
*.pfx
|
||||||
|
*.publishsettings
|
||||||
|
|
||||||
|
# RIA/Silverlight projects
|
||||||
|
Generated_Code/
|
||||||
|
|
||||||
|
# Backup & report files from converting an old project file to a newer
|
||||||
|
# Visual Studio version. Backup files are not needed, because we have git ;-)
|
||||||
|
_UpgradeReport_Files/
|
||||||
|
Backup*/
|
||||||
|
UpgradeLog*.XML
|
||||||
|
UpgradeLog*.htm
|
||||||
|
|
||||||
|
# SQL Server files
|
||||||
|
App_Data/*.mdf
|
||||||
|
App_Data/*.ldf
|
||||||
|
|
||||||
|
|
||||||
|
#LightSwitch generated files
|
||||||
|
GeneratedArtifacts/
|
||||||
|
_Pvt_Extensions/
|
||||||
|
ModelManifest.xml
|
||||||
|
|
||||||
|
# =========================
|
||||||
|
# Windows detritus
|
||||||
|
# =========================
|
||||||
|
|
||||||
|
# Windows image file caches
|
||||||
|
Thumbs.db
|
||||||
|
ehthumbs.db
|
||||||
|
|
||||||
|
# Folder config file
|
||||||
|
Desktop.ini
|
||||||
|
|
||||||
|
# Recycle Bin used on file shares
|
||||||
|
$RECYCLE.BIN/
|
||||||
|
|
||||||
|
# Mac desktop service store files
|
||||||
|
.DS_Store
|
||||||
|
gitattributes
|
||||||
|
gitignore
|
||||||
|
winphone/
|
||||||
|
.spl
|
||||||
|
.srum
|
||||||
|
*.spl
|
||||||
|
*.srum
|
||||||
|
Doxyfile
|
||||||
|
screenshots/
|
||||||
|
CampusAppWP8/packages/WPtoolkit.4.2012.10.30/lib/sl3-wp/Microsoft.Phone.Controls.Toolkit.dll
|
||||||
|
CampusAppWP8/packages/WPtoolkit.4.2012.10.30/lib/sl4-windowsphone71/Microsoft.Phone.Controls.Toolkit.dll
|
||||||
|
CampusAppWP8/packages/WPtoolkit.4.2012.10.30/lib/wp8/Microsoft.Phone.Controls.Toolkit.dll
|
||||||
|
CampusAppWP8/packages/BuiltToRoam.Core.Agent.1.0.1.5/BuiltToRoam.Core.Agent.1.0.1.5.nupkg
|
||||||
|
CampusAppWP8/packages/BuiltToRoam.Core.Agent.1.0.1.5/BuiltToRoam.Core.Agent.1.0.1.5.nuspec
|
||||||
|
CampusAppWP8/packages/BuiltToRoam.Core.Agent.1.0.1.5/lib/sl4-wp71/AsyncCtpLibrary_Phone.dll
|
||||||
|
CampusAppWP8/packages/BuiltToRoam.Core.Agent.1.0.1.5/lib/sl4-wp71/BuiltToRoam.Core.Agent.dll
|
||||||
|
CampusAppWP8/packages/BuiltToRoam.GeoWatcher.1.0.1.5/BuiltToRoam.GeoWatcher.1.0.1.5.nupkg
|
||||||
|
CampusAppWP8/packages/BuiltToRoam.GeoWatcher.1.0.1.5/BuiltToRoam.GeoWatcher.1.0.1.5.nuspec
|
||||||
|
CampusAppWP8/packages/BuiltToRoam.GeoWatcher.1.0.1.5/lib/sl4-wp71/BuiltToRoam.GeoWatcher.dll
|
||||||
|
CampusAppWP8/packages/Newtonsoft.Json.4.5.11/Newtonsoft.Json.4.5.11.nupkg
|
||||||
|
CampusAppWP8/packages/Newtonsoft.Json.4.5.11/Newtonsoft.Json.4.5.11.nuspec
|
||||||
|
CampusAppWP8/packages/Newtonsoft.Json.4.5.11/lib/net20/Newtonsoft.Json.dll
|
||||||
|
CampusAppWP8/packages/Newtonsoft.Json.4.5.11/lib/net20/Newtonsoft.Json.xml
|
||||||
|
CampusAppWP8/packages/Newtonsoft.Json.4.5.11/lib/net35/Newtonsoft.Json.dll
|
||||||
|
CampusAppWP8/packages/Newtonsoft.Json.4.5.11/lib/net35/Newtonsoft.Json.xml
|
||||||
|
CampusAppWP8/packages/Newtonsoft.Json.4.5.11/lib/net40/Newtonsoft.Json.dll
|
||||||
|
CampusAppWP8/packages/Newtonsoft.Json.4.5.11/lib/net40/Newtonsoft.Json.xml
|
||||||
|
CampusAppWP8/packages/Newtonsoft.Json.4.5.11/lib/portable-net40+sl4+wp7+win8/Newtonsoft.Json.dll
|
||||||
|
CampusAppWP8/packages/Newtonsoft.Json.4.5.11/lib/portable-net40+sl4+wp7+win8/Newtonsoft.Json.xml
|
||||||
|
CampusAppWP8/packages/Newtonsoft.Json.4.5.11/lib/sl3-wp/Newtonsoft.Json.dll
|
||||||
|
CampusAppWP8/packages/Newtonsoft.Json.4.5.11/lib/sl3-wp/Newtonsoft.Json.xml
|
||||||
|
CampusAppWP8/packages/Newtonsoft.Json.4.5.11/lib/sl4-windowsphone71/Newtonsoft.Json.dll
|
||||||
|
CampusAppWP8/packages/Newtonsoft.Json.4.5.11/lib/sl4-windowsphone71/Newtonsoft.Json.xml
|
||||||
|
CampusAppWP8/packages/Newtonsoft.Json.4.5.11/lib/sl4/Newtonsoft.Json.dll
|
||||||
|
CampusAppWP8/packages/Newtonsoft.Json.4.5.11/lib/sl4/Newtonsoft.Json.xml
|
||||||
|
CampusAppWP8/packages/Newtonsoft.Json.4.5.11/lib/winrt45/Newtonsoft.Json.dll
|
||||||
|
CampusAppWP8/packages/Newtonsoft.Json.4.5.11/lib/winrt45/Newtonsoft.Json.xml
|
||||||
|
CampusAppWP8/packages/SharpZipLib-WP7.0.86.0.518/SharpZipLib-WP7.0.86.0.518.nupkg
|
||||||
|
CampusAppWP8/packages/SharpZipLib-WP7.0.86.0.518/SharpZipLib-WP7.0.86.0.518.nuspec
|
||||||
|
CampusAppWP8/packages/SharpZipLib-WP7.0.86.0.518/lib/sl4-windowsphone71/SharpZipLib.WindowsPhone7.dll
|
||||||
27
CampusAppWP8/CampusAppWP8/Api/GeoApi/SpsApi.cs
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
//-----------------------------------------------------------------------
|
||||||
|
// <copyright file="SpsApi.cs" company="BTU/IIT">
|
||||||
|
// Company copyright tag.
|
||||||
|
// </copyright>
|
||||||
|
// <author>stubbfel</author>
|
||||||
|
// <sience>06.08.2013</sience>
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
namespace CampusAppWP8.Feed.GeoApi
|
||||||
|
{
|
||||||
|
using CampusAppWP8.Model;
|
||||||
|
using CampusAppWP8.Model.GeoDb;
|
||||||
|
using CampusAppWP8.Resources;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Class for SPSAPI
|
||||||
|
/// </summary>
|
||||||
|
public class SpsApi : XmlModel<SpsModel>
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="SpsApi" /> class.
|
||||||
|
/// </summary>
|
||||||
|
public SpsApi()
|
||||||
|
: base(ModelType.Feed, Constants.UrlSpsService)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
31
CampusAppWP8/CampusAppWP8/Api/Lecture/LectureApi.cs
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
//-----------------------------------------------------------------------
|
||||||
|
// <copyright file="LectureApi.cs" company="BTU/IIT">
|
||||||
|
// Company copyright tag.
|
||||||
|
// </copyright>
|
||||||
|
// <author>stubbfel</author>
|
||||||
|
// <sience>13.06.2013</sience>
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
namespace CampusAppWP8.Feed.Lecture
|
||||||
|
{
|
||||||
|
using CampusAppWP8.Model;
|
||||||
|
using CampusAppWP8.Model.Lecture;
|
||||||
|
using CampusAppWP8.Resources;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Class for the feed of the Lecture
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// need the XmlAPI
|
||||||
|
/// </remarks>
|
||||||
|
public class LectureApi : XmlModel<LectureList>
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="LectureApi" /> class.
|
||||||
|
/// </summary>
|
||||||
|
public LectureApi()
|
||||||
|
: base(ModelType.Feed, Constants.UrlLecture_ApiBaseAddr)
|
||||||
|
{
|
||||||
|
this.ValidRootName = Constants.LectureXmlValidRootName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -8,12 +8,22 @@
|
|||||||
|
|
||||||
<!--Anwendungsressourcen-->
|
<!--Anwendungsressourcen-->
|
||||||
<Application.Resources>
|
<Application.Resources>
|
||||||
<local:LocalizedStrings xmlns:local="clr-namespace:CampusAppWP8" x:Key="LocalizedStrings"/>
|
<ResourceDictionary>
|
||||||
|
<ResourceDictionary.MergedDictionaries>
|
||||||
|
<ResourceDictionary Source="Styles/ListButton.xaml"/>
|
||||||
|
<ResourceDictionary Source="Styles/StartPageStyles.xaml"/>
|
||||||
|
<ResourceDictionary>
|
||||||
|
<local:LocalizedStrings xmlns:local="clr-namespace:CampusAppWP8" x:Key="LocalizedStrings"/>
|
||||||
|
<local:ThemelizedIcons xmlns:local="clr-namespace:CampusAppWP8" x:Key="ThemelizedIcons"/>
|
||||||
|
<local:Const xmlns:local="clr-namespace:CampusAppWP8" x:Key="Const"/>
|
||||||
|
</ResourceDictionary>
|
||||||
|
</ResourceDictionary.MergedDictionaries>
|
||||||
|
</ResourceDictionary>
|
||||||
</Application.Resources>
|
</Application.Resources>
|
||||||
|
|
||||||
<Application.ApplicationLifetimeObjects>
|
<Application.ApplicationLifetimeObjects>
|
||||||
<!--Erforderliches Objekt, das Lebensdauerereignisse der Anwendung behandelt-->
|
<!--Erforderliches Objekt, das Lebensdauerereignisse der Anwendung behandelt-->
|
||||||
<shell:PhoneApplicationService
|
<shell:PhoneApplicationService
|
||||||
Launching="Application_Launching" Closing="Application_Closing"
|
Launching="Application_Launching" Closing="Application_Closing"
|
||||||
Activated="Application_Activated" Deactivated="Application_Deactivated"/>
|
Activated="Application_Activated" Deactivated="Application_Deactivated"/>
|
||||||
</Application.ApplicationLifetimeObjects>
|
</Application.ApplicationLifetimeObjects>
|
||||||
|
|||||||
@@ -1,12 +1,18 @@
|
|||||||
using System;
|
using CampusAppWP8.File.Setting;
|
||||||
|
using CampusAppWP8.Model.Setting;
|
||||||
|
using CampusAppWP8.Resources;
|
||||||
|
using CampusAppWP8.Utility;
|
||||||
|
using Microsoft.Phone.Controls;
|
||||||
|
using Microsoft.Phone.Shell;
|
||||||
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Resources;
|
using System.Globalization;
|
||||||
|
using System.IO.IsolatedStorage;
|
||||||
|
using System.Threading;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Markup;
|
using System.Windows.Markup;
|
||||||
using System.Windows.Navigation;
|
using System.Windows.Navigation;
|
||||||
using Microsoft.Phone.Controls;
|
using Windows.Devices.Geolocation;
|
||||||
using Microsoft.Phone.Shell;
|
|
||||||
using CampusAppWP8.Resources;
|
|
||||||
|
|
||||||
|
|
||||||
namespace CampusAppWP8
|
namespace CampusAppWP8
|
||||||
@@ -59,17 +65,117 @@ namespace CampusAppWP8
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method save any object to the IsolatedStorage
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="key"> key of the object</param>
|
||||||
|
/// <param name="value">value of the object, if value == null => remove key</param>
|
||||||
|
public static void SaveToIsolatedStorage<T>(string key, T value)
|
||||||
|
{
|
||||||
|
IsolatedStorageSettings isolatedStore = IsolatedStorageSettings.ApplicationSettings;
|
||||||
|
isolatedStore.Remove(key);
|
||||||
|
if (value != null)
|
||||||
|
{
|
||||||
|
isolatedStore.Add(key, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
isolatedStore.Save();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method load any object to the IsolatedStorage
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="key"> key of the object</param>
|
||||||
|
public static T LoadFromIsolatedStorage<T>(string key)
|
||||||
|
{
|
||||||
|
IsolatedStorageSettings isolatedStore = IsolatedStorageSettings.ApplicationSettings;
|
||||||
|
|
||||||
|
if (isolatedStore.Contains(key))
|
||||||
|
{
|
||||||
|
object value = isolatedStore[key];
|
||||||
|
return (T)value;
|
||||||
|
}
|
||||||
|
return default(T);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method save any object to the IsolatedStorage
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="key"> key of the object</param>
|
||||||
|
/// <param name="value">value of the object, if value == null => remove key</param>
|
||||||
|
public static void SaveToAppState<T>(string key, T value)
|
||||||
|
{
|
||||||
|
IsolatedStorageSettings isolatedStore = IsolatedStorageSettings.ApplicationSettings;
|
||||||
|
isolatedStore.Remove(key);
|
||||||
|
if (value != null)
|
||||||
|
{
|
||||||
|
isolatedStore.Add(key, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
isolatedStore.Save();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method load any object to the IsolatedStorage
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="key"> key of the object</param>
|
||||||
|
public static T LoadFromAppState<T>(string key)
|
||||||
|
{
|
||||||
|
IsolatedStorageSettings isolatedStore = IsolatedStorageSettings.ApplicationSettings;
|
||||||
|
|
||||||
|
if (isolatedStore.Contains(key))
|
||||||
|
{
|
||||||
|
object value = isolatedStore[key];
|
||||||
|
return (T)value;
|
||||||
|
}
|
||||||
|
return default(T);
|
||||||
|
}
|
||||||
|
|
||||||
// Code, der beim Starten der Anwendung ausgeführt werden soll (z. B. über "Start")
|
// Code, der beim Starten der Anwendung ausgeführt werden soll (z. B. über "Start")
|
||||||
// Dieser Code wird beim Reaktivieren der Anwendung nicht ausgeführt
|
// Dieser Code wird beim Reaktivieren der Anwendung nicht ausgeführt
|
||||||
private void Application_Launching(object sender, LaunchingEventArgs e)
|
private void Application_Launching(object sender, LaunchingEventArgs e)
|
||||||
{
|
{
|
||||||
|
this.LoadSettings();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Load the appsettings from the store
|
||||||
|
/// </summary>
|
||||||
|
private void LoadSettings()
|
||||||
|
{
|
||||||
|
UserProfilFile userFile;
|
||||||
|
userFile = Settings.UserProfil;
|
||||||
|
if (userFile.Model == null)
|
||||||
|
{
|
||||||
|
userFile.onLoaded += new UserProfilFile.OnLoaded(this.UserSettingsLoaded);
|
||||||
|
userFile.LoadData();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.UserSettingsLoaded();
|
||||||
|
}
|
||||||
|
|
||||||
|
Thread thread = new Thread(new ThreadStart(Utilities.DetermineAndStoreCurrentPosition));
|
||||||
|
thread.Start();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Load the usersettings from the store
|
||||||
|
/// </summary>
|
||||||
|
private void UserSettingsLoaded()
|
||||||
|
{
|
||||||
|
if (Settings.UserProfil.Model == null)
|
||||||
|
{
|
||||||
|
Settings.UserProfil.Model = new UserProfilModel();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Code, der ausgeführt werden soll, wenn die Anwendung aktiviert wird (in den Vordergrund gebracht wird)
|
// Code, der ausgeführt werden soll, wenn die Anwendung aktiviert wird (in den Vordergrund gebracht wird)
|
||||||
// Dieser Code wird beim ersten Starten der Anwendung nicht ausgeführt
|
// Dieser Code wird beim ersten Starten der Anwendung nicht ausgeführt
|
||||||
private void Application_Activated(object sender, ActivatedEventArgs e)
|
private void Application_Activated(object sender, ActivatedEventArgs e)
|
||||||
{
|
{
|
||||||
|
this.LoadSettings();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Code, der ausgeführt werden soll, wenn die Anwendung deaktiviert wird (in den Hintergrund gebracht wird)
|
// Code, der ausgeführt werden soll, wenn die Anwendung deaktiviert wird (in den Hintergrund gebracht wird)
|
||||||
|
|||||||
BIN
CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/add_159.png
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/btulogo_159.png
Normal file
|
After Width: | Height: | Size: 6.2 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/campus_159.png
Normal file
|
After Width: | Height: | Size: 5.2 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/delete_159.png
Normal file
|
After Width: | Height: | Size: 6.1 KiB |
|
After Width: | Height: | Size: 5.4 KiB |
|
After Width: | Height: | Size: 7.5 KiB |
|
After Width: | Height: | Size: 8.9 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/info_159.png
Normal file
|
After Width: | Height: | Size: 5.0 KiB |
|
After Width: | Height: | Size: 7.7 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/link_159.png
Normal file
|
After Width: | Height: | Size: 8.2 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/mensa_159.png
Normal file
|
After Width: | Height: | Size: 9.0 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/news_159.png
Normal file
|
After Width: | Height: | Size: 6.9 KiB |
|
After Width: | Height: | Size: 9.2 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/phone_159.png
Normal file
|
After Width: | Height: | Size: 6.4 KiB |
|
After Width: | Height: | Size: 6.7 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/search_159.png
Normal file
|
After Width: | Height: | Size: 7.3 KiB |
|
After Width: | Height: | Size: 7.3 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/webmail_159.png
Normal file
|
After Width: | Height: | Size: 6.4 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/add_159.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 5.6 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/campus_159.png
Normal file
|
After Width: | Height: | Size: 5.7 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/delete_159.png
Normal file
|
After Width: | Height: | Size: 6.6 KiB |
|
After Width: | Height: | Size: 5.6 KiB |
|
After Width: | Height: | Size: 8.4 KiB |
|
After Width: | Height: | Size: 10 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/info_159.png
Normal file
|
After Width: | Height: | Size: 5.2 KiB |
|
After Width: | Height: | Size: 8.5 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/link_159.png
Normal file
|
After Width: | Height: | Size: 9.3 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/mensa_159.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/news_159.png
Normal file
|
After Width: | Height: | Size: 7.5 KiB |
|
After Width: | Height: | Size: 11 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/phone_159.png
Normal file
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 6.6 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/search_159.png
Normal file
|
After Width: | Height: | Size: 8.1 KiB |
|
After Width: | Height: | Size: 8.1 KiB |
|
After Width: | Height: | Size: 6.9 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/Tiles/kachel_large.png
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/Tiles/kachel_medium.png
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/Tiles/kachel_small.png
Normal file
|
After Width: | Height: | Size: 9.5 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/icons/DarkTheme/update_159.png
Normal file
|
After Width: | Height: | Size: 6.8 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/icons/LightTheme/update_159.png
Normal file
|
After Width: | Height: | Size: 7.4 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/testmap.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
@@ -1,253 +1,459 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
<ProductVersion>10.0.20506</ProductVersion>
|
<ProductVersion>10.0.20506</ProductVersion>
|
||||||
<SchemaVersion>2.0</SchemaVersion>
|
<SchemaVersion>2.0</SchemaVersion>
|
||||||
<ProjectGuid>{120B88CC-F3F0-4C5A-A3FD-C26E835338CC}</ProjectGuid>
|
<ProjectGuid>{120B88CC-F3F0-4C5A-A3FD-C26E835338CC}</ProjectGuid>
|
||||||
<ProjectTypeGuids>{C089C8C0-30E0-4E22-80C0-CE093F111A43};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
|
<ProjectTypeGuids>{C089C8C0-30E0-4E22-80C0-CE093F111A43};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
|
||||||
<OutputType>Library</OutputType>
|
<OutputType>Library</OutputType>
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
<RootNamespace>CampusAppWP8</RootNamespace>
|
<RootNamespace>CampusAppWP8</RootNamespace>
|
||||||
<AssemblyName>CampusAppWP8</AssemblyName>
|
<AssemblyName>CampusAppWP8</AssemblyName>
|
||||||
<TargetFrameworkIdentifier>WindowsPhone</TargetFrameworkIdentifier>
|
<TargetFrameworkIdentifier>WindowsPhone</TargetFrameworkIdentifier>
|
||||||
<TargetFrameworkVersion>v8.0</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v8.0</TargetFrameworkVersion>
|
||||||
<SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
|
<SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
|
||||||
<SilverlightApplication>true</SilverlightApplication>
|
<SilverlightApplication>true</SilverlightApplication>
|
||||||
<SupportedCultures>
|
<SupportedCultures>
|
||||||
</SupportedCultures>
|
</SupportedCultures>
|
||||||
<XapOutputs>true</XapOutputs>
|
<XapOutputs>true</XapOutputs>
|
||||||
<GenerateSilverlightManifest>true</GenerateSilverlightManifest>
|
<GenerateSilverlightManifest>true</GenerateSilverlightManifest>
|
||||||
<XapFilename>CampusAppWP8_$(Configuration)_$(Platform).xap</XapFilename>
|
<XapFilename>CampusAppWP8_$(Configuration)_$(Platform).xap</XapFilename>
|
||||||
<SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate>
|
<SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate>
|
||||||
<SilverlightAppEntry>CampusAppWP8.App</SilverlightAppEntry>
|
<SilverlightAppEntry>CampusAppWP8.App</SilverlightAppEntry>
|
||||||
<ValidateXaml>true</ValidateXaml>
|
<ValidateXaml>true</ValidateXaml>
|
||||||
<MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
|
<MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
|
||||||
<ThrowErrorsInValidation>true</ThrowErrorsInValidation>
|
<ThrowErrorsInValidation>true</ThrowErrorsInValidation>
|
||||||
<ExpressionBlendVersion>5.0.40218.0</ExpressionBlendVersion>
|
<ExpressionBlendVersion>5.0.40218.0</ExpressionBlendVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
<DebugType>full</DebugType>
|
<DebugType>full</DebugType>
|
||||||
<Optimize>false</Optimize>
|
<Optimize>false</Optimize>
|
||||||
<OutputPath>Bin\Debug</OutputPath>
|
<OutputPath>Bin\Debug</OutputPath>
|
||||||
<DefineConstants>DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
|
<DefineConstants>DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
|
||||||
<NoStdLib>true</NoStdLib>
|
<NoStdLib>true</NoStdLib>
|
||||||
<NoConfig>true</NoConfig>
|
<NoConfig>true</NoConfig>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<DocumentationFile>
|
<DocumentationFile>
|
||||||
</DocumentationFile>
|
</DocumentationFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
<DebugType>pdbonly</DebugType>
|
<DebugType>pdbonly</DebugType>
|
||||||
<Optimize>true</Optimize>
|
<Optimize>true</Optimize>
|
||||||
<OutputPath>Bin\Release</OutputPath>
|
<OutputPath>Bin\Release</OutputPath>
|
||||||
<DefineConstants>TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
|
<DefineConstants>TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
|
||||||
<NoStdLib>true</NoStdLib>
|
<NoStdLib>true</NoStdLib>
|
||||||
<NoConfig>true</NoConfig>
|
<NoConfig>true</NoConfig>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
<DebugType>full</DebugType>
|
<DebugType>full</DebugType>
|
||||||
<Optimize>false</Optimize>
|
<Optimize>false</Optimize>
|
||||||
<OutputPath>Bin\x86\Debug</OutputPath>
|
<OutputPath>Bin\x86\Debug</OutputPath>
|
||||||
<DefineConstants>DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
|
<DefineConstants>DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
|
||||||
<NoStdLib>true</NoStdLib>
|
<NoStdLib>true</NoStdLib>
|
||||||
<NoConfig>true</NoConfig>
|
<NoConfig>true</NoConfig>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||||
<DebugType>pdbonly</DebugType>
|
<DebugType>pdbonly</DebugType>
|
||||||
<Optimize>true</Optimize>
|
<Optimize>true</Optimize>
|
||||||
<OutputPath>Bin\x86\Release</OutputPath>
|
<OutputPath>Bin\x86\Release</OutputPath>
|
||||||
<DefineConstants>TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
|
<DefineConstants>TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
|
||||||
<NoStdLib>true</NoStdLib>
|
<NoStdLib>true</NoStdLib>
|
||||||
<NoConfig>true</NoConfig>
|
<NoConfig>true</NoConfig>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|ARM' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|ARM' ">
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
<DebugType>full</DebugType>
|
<DebugType>full</DebugType>
|
||||||
<Optimize>false</Optimize>
|
<Optimize>false</Optimize>
|
||||||
<OutputPath>Bin\ARM\Debug</OutputPath>
|
<OutputPath>Bin\ARM\Debug</OutputPath>
|
||||||
<DefineConstants>DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
|
<DefineConstants>DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
|
||||||
<NoStdLib>true</NoStdLib>
|
<NoStdLib>true</NoStdLib>
|
||||||
<NoConfig>true</NoConfig>
|
<NoConfig>true</NoConfig>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|ARM' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|ARM' ">
|
||||||
<DebugType>pdbonly</DebugType>
|
<DebugType>pdbonly</DebugType>
|
||||||
<Optimize>true</Optimize>
|
<Optimize>true</Optimize>
|
||||||
<OutputPath>Bin\ARM\Release</OutputPath>
|
<OutputPath>Bin\ARM\Release</OutputPath>
|
||||||
<DefineConstants>TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
|
<DefineConstants>TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
|
||||||
<NoStdLib>true</NoStdLib>
|
<NoStdLib>true</NoStdLib>
|
||||||
<NoConfig>true</NoConfig>
|
<NoConfig>true</NoConfig>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="App.xaml.cs">
|
<Compile Include="Api\GeoApi\SpsApi.cs" />
|
||||||
<DependentUpon>App.xaml</DependentUpon>
|
<Compile Include="App.xaml.cs">
|
||||||
</Compile>
|
<DependentUpon>App.xaml</DependentUpon>
|
||||||
<Compile Include="LocalizedStrings.cs" />
|
</Compile>
|
||||||
<Compile Include="Model\departments\ChairModel.cs" />
|
<Compile Include="Feed\Departments\DepartmentFavoriteFeed.cs" />
|
||||||
<Compile Include="Model\departments\DepartmentModel.cs" />
|
<Compile Include="Const.cs" />
|
||||||
<Compile Include="Model\departments\DepartmentViewModel.cs" />
|
<Compile Include="File\Setting\UserProfilFile.cs" />
|
||||||
<Compile Include="Model\departments\FacultyModel.cs" />
|
<Compile Include="Model\GeoDb\PlaceModel.cs" />
|
||||||
<Compile Include="Model\Mensa\MenuModel.cs" />
|
<Compile Include="Model\GeoDb\SpsModel.cs" />
|
||||||
<Compile Include="Model\Mensa\MenuWeekModel.cs" />
|
<Compile Include="Model\Mensa\MealModel.cs" />
|
||||||
<Compile Include="Pages\campusmap\CampusMapPage.xaml.cs">
|
<Compile Include="Model\Setting\AppSettings.cs" />
|
||||||
<DependentUpon>CampusMapPage.xaml</DependentUpon>
|
<Compile Include="Model\Setting\UserProfilModel.cs" />
|
||||||
</Compile>
|
<Compile Include="Model\Utility\CourseListPickerItemListModel.cs" />
|
||||||
<Compile Include="Pages\departments\DepartmentPage.xaml.cs">
|
<Compile Include="Model\Utility\DegreeListPickerItemListModel.cs" />
|
||||||
<DependentUpon>DepartmentPage.xaml</DependentUpon>
|
<Compile Include="Model\Utility\CleanUrlParamModel.cs" />
|
||||||
</Compile>
|
<Compile Include="Model\Utility\RoleListPickerItemListModel.cs" />
|
||||||
<Compile Include="Pages\lecture\LecturePage.xaml.cs">
|
<Compile Include="Model\Utility\SemesterListPickerItemListModel.cs" />
|
||||||
<DependentUpon>LecturePage.xaml</DependentUpon>
|
<Compile Include="Model\Utility\ListPickerItemListModel.cs" />
|
||||||
</Compile>
|
<Compile Include="Pages\Setting\UserProfil.xaml.cs">
|
||||||
<Compile Include="Model\BaseModel.cs" />
|
<DependentUpon>UserProfil.xaml</DependentUpon>
|
||||||
<Compile Include="Model\BaseViewModel.cs" />
|
</Compile>
|
||||||
<Compile Include="Feed\Mensa\MensaFeed.cs" />
|
<Compile Include="Resources\Icons.Designer.cs" />
|
||||||
<Compile Include="Pages\Mensa\MensaPage.xaml.cs">
|
<Compile Include="Settings.cs" />
|
||||||
<DependentUpon>MensaPage.xaml</DependentUpon>
|
<Compile Include="Utility\Lui\Button\EmailButton.cs" />
|
||||||
</Compile>
|
<Compile Include="Feed\Link\CommonLinkFeed.cs" />
|
||||||
<Compile Include="Pages\news\NewsPage.xaml.cs">
|
<Compile Include="Feed\Link\ClubLinkFeed.cs" />
|
||||||
<DependentUpon>NewsPage.xaml</DependentUpon>
|
<Compile Include="Feed\Openinghours\OpeninghoursFeed.cs" />
|
||||||
</Compile>
|
<Compile Include="Feed\StudentCouncil\StudentCouncilFeed.cs" />
|
||||||
<Compile Include="Pages\news\RSSItem.cs" />
|
<Compile Include="LocalizedStrings.cs" />
|
||||||
<Compile Include="Pages\news\RSSNewsTemplate.xaml.cs">
|
<Compile Include="Model\Campusmap\MapModel.cs" />
|
||||||
<DependentUpon>RSSNewsTemplate.xaml</DependentUpon>
|
<Compile Include="Model\Campusmap\MapPinModel.cs" />
|
||||||
</Compile>
|
<Compile Include="Model\Departments\ChairModel.cs" />
|
||||||
<Compile Include="Pages\StartPage.xaml.cs">
|
<Compile Include="Model\Departments\DepartmentModel.cs" />
|
||||||
<DependentUpon>StartPage.xaml</DependentUpon>
|
<Compile Include="Model\Departments\FacultyModel.cs" />
|
||||||
</Compile>
|
<Compile Include="Model\RSS\RSSChannelModel.cs" />
|
||||||
<Compile Include="Pages\webmail\WebmailPage.xaml.cs">
|
<Compile Include="Model\RSS\RSSViewModel.cs" />
|
||||||
<DependentUpon>WebmailPage.xaml</DependentUpon>
|
<Compile Include="Model\Lecture\LectureActivity.cs" />
|
||||||
</Compile>
|
<Compile Include="Model\Lecture\LectureCourse.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Model\Lecture\LectureDate.cs" />
|
||||||
<Compile Include="Resources\AppResources.Designer.cs">
|
<Compile Include="Model\Lecture\LectureLecturer.cs" />
|
||||||
<AutoGen>True</AutoGen>
|
<Compile Include="Model\Lecture\LectureList.cs" />
|
||||||
<DesignTime>True</DesignTime>
|
<Compile Include="Model\Lecture\LectureModule.cs" />
|
||||||
<DependentUpon>AppResources.resx</DependentUpon>
|
<Compile Include="Model\Lecture\LecturePageModel.cs" />
|
||||||
</Compile>
|
<Compile Include="Model\MainModel.cs" />
|
||||||
<Compile Include="Resources\Constants.Designer.cs">
|
<Compile Include="Model\Link\LinkModel.cs" />
|
||||||
<AutoGen>True</AutoGen>
|
<Compile Include="Model\Link\LinkListModel.cs" />
|
||||||
<DesignTime>True</DesignTime>
|
<Compile Include="Model\Mensa\MenuModel.cs" />
|
||||||
<DependentUpon>Constants.resx</DependentUpon>
|
<Compile Include="Model\Mensa\MenuWeekModel.cs" />
|
||||||
</Compile>
|
<Compile Include="Model\Openinghours\OpeninghoursInstitutionModel.cs" />
|
||||||
<Compile Include="Utility\Feed.cs" />
|
<Compile Include="Model\Openinghours\OpeninghoursModel.cs" />
|
||||||
<Compile Include="Utility\FeedEventHandler.cs" />
|
<Compile Include="Model\StudentCouncil\StudentCouncilListModel.cs" />
|
||||||
<Compile Include="Utility\FileList.cs" />
|
<Compile Include="Model\StudentCouncil\StudentCouncilModel.cs" />
|
||||||
<Compile Include="Utility\FileManager.cs" />
|
<Compile Include="Model\Utility\UrlParamModel.cs" />
|
||||||
<Compile Include="Utility\Logger.cs" />
|
<Compile Include="Model\XmlModel.cs" />
|
||||||
<Compile Include="Utility\URLList.cs" />
|
<Compile Include="Pages\Campusmap\CampusMapPage.xaml.cs">
|
||||||
<Compile Include="Utility\XmlFeed.cs" />
|
<DependentUpon>CampusMapPage.xaml</DependentUpon>
|
||||||
</ItemGroup>
|
</Compile>
|
||||||
<ItemGroup>
|
<Compile Include="Api\Lecture\LectureApi.cs" />
|
||||||
<ApplicationDefinition Include="App.xaml">
|
<Compile Include="Feed\Departments\DepartmentFeed.cs" />
|
||||||
<SubType>Designer</SubType>
|
<Compile Include="Pages\Departments\DepartmentFavoritePage.xaml.cs">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<DependentUpon>DepartmentFavoritePage.xaml</DependentUpon>
|
||||||
</ApplicationDefinition>
|
</Compile>
|
||||||
<Page Include="Pages\campusmap\CampusMapPage.xaml">
|
<Compile Include="Pages\Departments\DepartmentIndexPage.xaml.cs">
|
||||||
<SubType>Designer</SubType>
|
<DependentUpon>DepartmentIndexPage.xaml</DependentUpon>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
</Compile>
|
||||||
</Page>
|
<Compile Include="Pages\Departments\DepartmentInfoPage.xaml.cs">
|
||||||
<Page Include="Pages\departments\DepartmentPage.xaml">
|
<DependentUpon>DepartmentInfoPage.xaml</DependentUpon>
|
||||||
<SubType>Designer</SubType>
|
</Compile>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Compile Include="Pages\Departments\DepartmentPage.xaml.cs">
|
||||||
</Page>
|
<DependentUpon>DepartmentPage.xaml</DependentUpon>
|
||||||
<Page Include="Pages\lecture\LecturePage.xaml">
|
</Compile>
|
||||||
<SubType>Designer</SubType>
|
<Compile Include="Feed\Events\EventFeed.cs" />
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Compile Include="Pages\Events\EventIndexPage.xaml.cs">
|
||||||
</Page>
|
<DependentUpon>EventIndexPage.xaml</DependentUpon>
|
||||||
<Page Include="Pages\Mensa\MensaPage.xaml">
|
</Compile>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Compile Include="Pages\Events\EventPage.xaml.cs">
|
||||||
<SubType>Designer</SubType>
|
<DependentUpon>EventPage.xaml</DependentUpon>
|
||||||
</Page>
|
</Compile>
|
||||||
<Page Include="Pages\news\NewsPage.xaml">
|
<Compile Include="Pages\Lecture\LecturePage.xaml.cs">
|
||||||
<SubType>Designer</SubType>
|
<DependentUpon>LecturePage.xaml</DependentUpon>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
</Compile>
|
||||||
</Page>
|
<Compile Include="Feed\Mensa\MensaFeed.cs" />
|
||||||
<Page Include="Pages\news\RSSNewsTemplate.xaml">
|
<Compile Include="Pages\Lecture\ModulWebPage.xaml.cs">
|
||||||
<SubType>Designer</SubType>
|
<DependentUpon>ModulWebPage.xaml</DependentUpon>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
</Compile>
|
||||||
</Page>
|
<Compile Include="Model\Utility\ListPickerItemModel.cs" />
|
||||||
<Page Include="Pages\StartPage.xaml">
|
<Compile Include="Pages\Lecture\ResultDetailPage.xaml.cs">
|
||||||
<SubType>Designer</SubType>
|
<DependentUpon>ResultDetailPage.xaml</DependentUpon>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
</Compile>
|
||||||
</Page>
|
<Compile Include="Pages\Lecture\ResultPage.xaml.cs">
|
||||||
<Page Include="Pages\webmail\WebmailPage.xaml">
|
<DependentUpon>ResultPage.xaml</DependentUpon>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
</Compile>
|
||||||
<SubType>Designer</SubType>
|
<Compile Include="Pages\Links\LinkPage.xaml.cs">
|
||||||
</Page>
|
<DependentUpon>LinkPage.xaml</DependentUpon>
|
||||||
</ItemGroup>
|
</Compile>
|
||||||
<ItemGroup>
|
<Compile Include="Pages\Mensa\MensaPage.xaml.cs">
|
||||||
<None Include="Assets\psd\holo_optionsbuttons.psd" />
|
<DependentUpon>MensaPage.xaml</DependentUpon>
|
||||||
<None Include="Assets\psd\iconbutton_effects2.psd" />
|
</Compile>
|
||||||
<None Include="packages.config" />
|
<Compile Include="Feed\News\NewsFeed.cs" />
|
||||||
<None Include="Properties\AppManifest.xml" />
|
<Compile Include="Pages\News\NewsIndexPage.xaml.cs">
|
||||||
<None Include="Properties\WMAppManifest.xml">
|
<DependentUpon>NewsIndexPage.xaml</DependentUpon>
|
||||||
<SubType>Designer</SubType>
|
</Compile>
|
||||||
</None>
|
<Compile Include="Pages\News\NewsPage.xaml.cs">
|
||||||
</ItemGroup>
|
<DependentUpon>NewsPage.xaml</DependentUpon>
|
||||||
<ItemGroup>
|
</Compile>
|
||||||
<Content Include="Assets\AlignmentGrid.png" />
|
<Compile Include="Model\RSS\RSSModel.cs" />
|
||||||
<Content Include="Assets\ApplicationIcon.png">
|
<Compile Include="Pages\Openinghours\OpeninghoursPage.xaml.cs">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<DependentUpon>OpeninghoursPage.xaml</DependentUpon>
|
||||||
</Content>
|
</Compile>
|
||||||
<Content Include="Assets\Tiles\FlipCycleTileLarge.png">
|
<Compile Include="Pages\StartPage.xaml.cs">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<DependentUpon>StartPage.xaml</DependentUpon>
|
||||||
</Content>
|
</Compile>
|
||||||
<Content Include="Assets\Tiles\FlipCycleTileMedium.png">
|
<Compile Include="Pages\StudentCouncil\StudentCouncilPage.xaml.cs">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<DependentUpon>StudentCouncilPage.xaml</DependentUpon>
|
||||||
</Content>
|
</Compile>
|
||||||
<Content Include="Assets\Tiles\FlipCycleTileSmall.png">
|
<Compile Include="Pages\Webmail\WebmailPage.xaml.cs">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<DependentUpon>WebmailPage.xaml</DependentUpon>
|
||||||
</Content>
|
</Compile>
|
||||||
<Content Include="Assets\Tiles\IconicTileMediumLarge.png">
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<Compile Include="Resources\AppResources.Designer.cs">
|
||||||
</Content>
|
<AutoGen>True</AutoGen>
|
||||||
<Content Include="Assets\Tiles\IconicTileSmall.png">
|
<DesignTime>True</DesignTime>
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<DependentUpon>AppResources.resx</DependentUpon>
|
||||||
</Content>
|
</Compile>
|
||||||
<Content Include="README_FIRST.txt" />
|
<Compile Include="Resources\Constants.Designer.cs">
|
||||||
<Content Include="Toolkit.Content\ApplicationBar.Cancel.png" />
|
<AutoGen>True</AutoGen>
|
||||||
<Content Include="Toolkit.Content\ApplicationBar.Check.png" />
|
<DesignTime>True</DesignTime>
|
||||||
<Content Include="Toolkit.Content\ApplicationBar.Delete.png" />
|
<DependentUpon>Constants.resx</DependentUpon>
|
||||||
<Content Include="Toolkit.Content\ApplicationBar.Select.png" />
|
</Compile>
|
||||||
</ItemGroup>
|
<Compile Include="ThemelizedIcons.cs" />
|
||||||
<ItemGroup>
|
<Compile Include="Utility\File.cs" />
|
||||||
<EmbeddedResource Include="Resources\AppResources.resx">
|
<Compile Include="Utility\Logger.cs" />
|
||||||
<Generator>PublicResXFileCodeGenerator</Generator>
|
<Compile Include="Utility\HttpRequest.cs" />
|
||||||
<LastGenOutput>AppResources.Designer.cs</LastGenOutput>
|
<Compile Include="Utility\Lui\Button\GoToMapButton.cs" />
|
||||||
</EmbeddedResource>
|
<Compile Include="Utility\Lui\Button\UpdateButtonAppBar.cs" />
|
||||||
<EmbeddedResource Include="Resources\Constants.resx">
|
<Compile Include="Utility\Lui\Button\ToggleButton.cs" />
|
||||||
<Generator>ResXFileCodeGenerator</Generator>
|
<Compile Include="Utility\Lui\Button\NavigateButton.cs" />
|
||||||
<LastGenOutput>Constants.Designer.cs</LastGenOutput>
|
<Compile Include="Utility\Lui\Button\PhoneButton.cs" />
|
||||||
</EmbeddedResource>
|
<Compile Include="Utility\Lui\Button\LinkButton.cs" />
|
||||||
</ItemGroup>
|
<Compile Include="Utility\StringManager.cs" />
|
||||||
<ItemGroup>
|
<Compile Include="Utility\Utilities.cs">
|
||||||
<Reference Include="Microsoft.Phone.Controls, Version=8.0.0.0, Culture=neutral, PublicKeyToken=24eec0d8c86cda1e, processorArchitecture=MSIL" />
|
<SubType>Code</SubType>
|
||||||
<Reference Include="Microsoft.Phone.Controls.Toolkit">
|
</Compile>
|
||||||
<HintPath>..\packages\WPtoolkit.4.2012.10.30\lib\wp8\Microsoft.Phone.Controls.Toolkit.dll</HintPath>
|
<Compile Include="Utility\XmlManager.cs" />
|
||||||
</Reference>
|
</ItemGroup>
|
||||||
</ItemGroup>
|
<ItemGroup>
|
||||||
<ItemGroup />
|
<ApplicationDefinition Include="App.xaml">
|
||||||
<Import Project="$(MSBuildExtensionsPath)\Microsoft\$(TargetFrameworkIdentifier)\$(TargetFrameworkVersion)\Microsoft.$(TargetFrameworkIdentifier).$(TargetFrameworkVersion).Overrides.targets" />
|
<SubType>Designer</SubType>
|
||||||
<Import Project="$(MSBuildExtensionsPath)\Microsoft\$(TargetFrameworkIdentifier)\$(TargetFrameworkVersion)\Microsoft.$(TargetFrameworkIdentifier).CSharp.targets" />
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
</ApplicationDefinition>
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
<Page Include="Pages\Campusmap\CampusMapPage.xaml">
|
||||||
<Target Name="BeforeBuild">
|
<SubType>Designer</SubType>
|
||||||
</Target>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<Target Name="AfterBuild">
|
</Page>
|
||||||
</Target>
|
<Page Include="Pages\Departments\DepartmentFavoritePage.xaml">
|
||||||
-->
|
<SubType>Designer</SubType>
|
||||||
<ProjectExtensions />
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
<Page Include="Pages\Departments\DepartmentIndexPage.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
<Page Include="Pages\Departments\DepartmentInfoPage.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
<Page Include="Pages\Departments\DepartmentPage.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
<Page Include="Pages\Lecture\LecturePage.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
<Page Include="Pages\Lecture\ModulWebPage.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
<Page Include="Pages\Lecture\ResultDetailPage.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
<Page Include="Pages\Lecture\ResultPage.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
<Page Include="Pages\Events\EventIndexPage.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
<Page Include="Pages\Events\EventPage.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</Page>
|
||||||
|
<Page Include="Pages\Links\LinkPage.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
<Page Include="Pages\Mensa\MensaPage.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</Page>
|
||||||
|
<Page Include="Pages\News\NewsIndexPage.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
<Page Include="Pages\News\NewsPage.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
<Page Include="Pages\Openinghours\OpeninghoursPage.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
<Page Include="Pages\Setting\UserProfil.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
<Page Include="pages\StartPage.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
<Page Include="Pages\StudentCouncil\StudentCouncilPage.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
<Page Include="Pages\Webmail\WebmailPage.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</Page>
|
||||||
|
<Page Include="Styles\StartPageStyles.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</Page>
|
||||||
|
<Page Include="Styles\ListButton.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="Assets\psd\holo_optionsbuttons.psd" />
|
||||||
|
<None Include="Assets\psd\iconbutton_effects2.psd" />
|
||||||
|
<None Include="packages.config" />
|
||||||
|
<None Include="Properties\AppManifest.xml" />
|
||||||
|
<None Include="Properties\WMAppManifest.xml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</None>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Content Include="Assets\AlignmentGrid.png" />
|
||||||
|
<Content Include="Assets\ApplicationIcon.png">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Include="Assets\Icons\DarkTheme\add_159.png" />
|
||||||
|
<Content Include="Assets\Icons\DarkTheme\btulogo_159.png" />
|
||||||
|
<Content Include="Assets\Icons\DarkTheme\campus_159.png" />
|
||||||
|
<Content Include="Assets\Icons\DarkTheme\delete_159.png" />
|
||||||
|
<Content Include="Assets\Icons\DarkTheme\favorite_159.png" />
|
||||||
|
<Content Include="Assets\Icons\DarkTheme\info_159.png" />
|
||||||
|
<Content Include="Assets\Icons\DarkTheme\phone_159.png" />
|
||||||
|
<Content Include="Assets\Icons\DarkTheme\update_159.png" />
|
||||||
|
<Content Include="Assets\Icons\LightTheme\add_159.png" />
|
||||||
|
<Content Include="Assets\Icons\LightTheme\btulogo_159.png" />
|
||||||
|
<Content Include="Assets\Icons\LightTheme\campus_159.png" />
|
||||||
|
<Content Include="Assets\Icons\DarkTheme\departments_159.png" />
|
||||||
|
<Content Include="Assets\Icons\LightTheme\delete_159.png" />
|
||||||
|
<Content Include="Assets\Icons\LightTheme\departments_159.png" />
|
||||||
|
<Content Include="Assets\Icons\DarkTheme\homework_159.png" />
|
||||||
|
<Content Include="Assets\Icons\LightTheme\favorite_159.png" />
|
||||||
|
<Content Include="Assets\Icons\LightTheme\homework_159.png" />
|
||||||
|
<Content Include="Assets\Icons\DarkTheme\link_159.png" />
|
||||||
|
<Content Include="Assets\Icons\LightTheme\info_159.png" />
|
||||||
|
<Content Include="Assets\Icons\LightTheme\link_159.png" />
|
||||||
|
<Content Include="Assets\Icons\DarkTheme\lectures_159.png" />
|
||||||
|
<Content Include="Assets\Icons\LightTheme\lectures_159.png" />
|
||||||
|
<Content Include="Assets\Icons\DarkTheme\mensa_159.png" />
|
||||||
|
<Content Include="Assets\Icons\LightTheme\mensa_159.png" />
|
||||||
|
<Content Include="Assets\Icons\DarkTheme\news_159.png" />
|
||||||
|
<Content Include="Assets\Icons\LightTheme\news_159.png" />
|
||||||
|
<Content Include="Assets\Icons\DarkTheme\openhours_159.png" />
|
||||||
|
<Content Include="Assets\Icons\LightTheme\openhours_159.png" />
|
||||||
|
<Content Include="Assets\Icons\DarkTheme\schedule_159.png" />
|
||||||
|
<Content Include="Assets\Icons\LightTheme\phone_159.png" />
|
||||||
|
<Content Include="Assets\Icons\LightTheme\schedule_159.png" />
|
||||||
|
<Content Include="Assets\Icons\DarkTheme\search_159.png" />
|
||||||
|
<Content Include="Assets\Icons\LightTheme\search_159.png" />
|
||||||
|
<Content Include="Assets\Icons\DarkTheme\student_council_159.png" />
|
||||||
|
<Content Include="Assets\Icons\LightTheme\student_council_159.png" />
|
||||||
|
<Content Include="Assets\Icons\DarkTheme\webmail_159.png" />
|
||||||
|
<Content Include="Assets\Icons\LightTheme\update_159.png" />
|
||||||
|
<Content Include="Assets\Icons\LightTheme\webmail_159.png" />
|
||||||
|
<Content Include="Assets\testmap.png" />
|
||||||
|
<Content Include="Assets\Tiles\FlipCycleTileLarge.png">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Include="Assets\Tiles\FlipCycleTileMedium.png">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Include="Assets\Tiles\FlipCycleTileSmall.png">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Include="Assets\Tiles\IconicTileMediumLarge.png">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Include="Assets\Tiles\IconicTileSmall.png">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Include="Assets\Tiles\kachel_large.png" />
|
||||||
|
<Content Include="Assets\Tiles\kachel_medium.png" />
|
||||||
|
<Content Include="Assets\Tiles\kachel_small.png" />
|
||||||
|
<Content Include="README_FIRST.txt" />
|
||||||
|
<Content Include="Toolkit.Content\ApplicationBar.Cancel.png" />
|
||||||
|
<Content Include="Toolkit.Content\ApplicationBar.Check.png" />
|
||||||
|
<Content Include="Toolkit.Content\ApplicationBar.Delete.png" />
|
||||||
|
<Content Include="Toolkit.Content\ApplicationBar.Select.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<EmbeddedResource Include="Resources\AppResources.resx">
|
||||||
|
<Generator>PublicResXFileCodeGenerator</Generator>
|
||||||
|
<LastGenOutput>AppResources.Designer.cs</LastGenOutput>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Resources\Constants.resx">
|
||||||
|
<Generator>PublicResXFileCodeGenerator</Generator>
|
||||||
|
<LastGenOutput>Constants.Designer.cs</LastGenOutput>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Resources\Icons.resx">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</EmbeddedResource>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="AsyncCtpLibrary_Phone">
|
||||||
|
<HintPath>..\packages\BuiltToRoam.Core.Agent.1.0.1.5\lib\sl4-wp71\AsyncCtpLibrary_Phone.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="BuiltToRoam.Core.Agent">
|
||||||
|
<HintPath>..\packages\BuiltToRoam.Core.Agent.1.0.1.5\lib\sl4-wp71\BuiltToRoam.Core.Agent.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="BuiltToRoam.GeoWatcher">
|
||||||
|
<HintPath>..\packages\BuiltToRoam.GeoWatcher.1.0.1.5\lib\sl4-wp71\BuiltToRoam.GeoWatcher.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Phone.Controls, Version=8.0.0.0, Culture=neutral, PublicKeyToken=24eec0d8c86cda1e, processorArchitecture=MSIL" />
|
||||||
|
<Reference Include="Microsoft.Phone.Controls.Toolkit">
|
||||||
|
<HintPath>..\packages\WPtoolkit.4.2012.10.30\lib\wp8\Microsoft.Phone.Controls.Toolkit.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Newtonsoft.Json">
|
||||||
|
<HintPath>..\packages\Newtonsoft.Json.4.5.11\lib\sl4-windowsphone71\Newtonsoft.Json.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="SharpZipLib.WindowsPhone7">
|
||||||
|
<HintPath>..\packages\SharpZipLib-WP7.0.86.0.518\lib\sl4-windowsphone71\SharpZipLib.WindowsPhone7.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Microsoft\$(TargetFrameworkIdentifier)\$(TargetFrameworkVersion)\Microsoft.$(TargetFrameworkIdentifier).$(TargetFrameworkVersion).Overrides.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Microsoft\$(TargetFrameworkIdentifier)\$(TargetFrameworkVersion)\Microsoft.$(TargetFrameworkIdentifier).CSharp.targets" />
|
||||||
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
|
Other similar extension points exist, see Microsoft.Common.targets.
|
||||||
|
<Target Name="BeforeBuild">
|
||||||
|
</Target>
|
||||||
|
<Target Name="AfterBuild">
|
||||||
|
</Target>
|
||||||
|
-->
|
||||||
|
<ProjectExtensions />
|
||||||
</Project>
|
</Project>
|
||||||
33
CampusAppWP8/CampusAppWP8/Const.cs
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
//-----------------------------------------------------------------------
|
||||||
|
// <copyright file="Const.cs" company="BTU/IIT">
|
||||||
|
// Company copyright tag.
|
||||||
|
// </copyright>
|
||||||
|
// <author>stubbfel</author>
|
||||||
|
// <sience>08.07.2013</sience>
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
namespace CampusAppWP8
|
||||||
|
{
|
||||||
|
using CampusAppWP8.Resources;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Access to Constants.rex
|
||||||
|
/// </summary>
|
||||||
|
public class Const
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Resource object.
|
||||||
|
/// </summary>
|
||||||
|
private static Constants constantResources = new Constants();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the resource object.
|
||||||
|
/// </summary>
|
||||||
|
public Constants Constants
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return constantResources;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,103 @@
|
|||||||
|
//-----------------------------------------------------------------------
|
||||||
|
// <copyright file="DepartmentFavoriteFeed.cs" company="BTU/IIT">
|
||||||
|
// Company copyright tag.
|
||||||
|
// </copyright>
|
||||||
|
// <author>fiedlchr</author>
|
||||||
|
// <sience>01.07.2013</sience>
|
||||||
|
//----------------------------------------------------------------------using System;
|
||||||
|
namespace CampusAppWP8.Feed.Departments
|
||||||
|
{
|
||||||
|
using System.IO;
|
||||||
|
using CampusAppWP8.Model;
|
||||||
|
using CampusAppWP8.Model.Departments;
|
||||||
|
using CampusAppWP8.Resources;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Feed object to handle favorite department feeds.
|
||||||
|
/// </summary>
|
||||||
|
public class DepartmentFavoriteFeed : XmlModel<DepartmentModel>
|
||||||
|
{
|
||||||
|
#region Constructor
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="DepartmentFavoriteFeed" /> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="autoLoad">automatic loading of the data</param>
|
||||||
|
public DepartmentFavoriteFeed(bool autoLoad = true)
|
||||||
|
: base(ModelType.File, Constants.FileDepartment_Favorite_Name, string.Empty)
|
||||||
|
{
|
||||||
|
this.isFileUpToDateOnLoad += new IsFileUpToDate(this.CheckIsFileUpToDateOnLoad);
|
||||||
|
this.isFileUpToDateOnSave += new IsFileUpToDate(this.CheckIsFileUpToDateOnSave);
|
||||||
|
|
||||||
|
if (autoLoad == true)
|
||||||
|
{
|
||||||
|
this.LoadData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Constructor
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Method
|
||||||
|
|
||||||
|
#region Protected
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method implement CheckIsModelUpToDate()-Method <see cref="Pages"/>.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="model">model object</param>
|
||||||
|
/// <returns>true, if model is up-to-date, otherwise false</returns>
|
||||||
|
private bool CheckIsModelUpToDate(DepartmentModel model)
|
||||||
|
{
|
||||||
|
bool retValue = true;
|
||||||
|
|
||||||
|
if ((model == null)
|
||||||
|
|| (model.Faculties == null)
|
||||||
|
|| (model.Faculties.Count != 1))
|
||||||
|
{
|
||||||
|
retValue = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return retValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method implement CheckIsFileUpToDate()-Method <see cref="Pages"/>.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="model">model object</param>
|
||||||
|
/// <param name="info">file info object</param>
|
||||||
|
/// <returns>true, if file is up-to-date, otherwise false</returns>
|
||||||
|
private bool CheckIsFileUpToDateOnLoad(DepartmentModel model, FileInfo info)
|
||||||
|
{
|
||||||
|
bool retValue = false;
|
||||||
|
|
||||||
|
if (this.Model == null)
|
||||||
|
{
|
||||||
|
retValue = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return retValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method implement CheckIsFileUpToDate()-Method <see cref="Pages"/>.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="model">model object</param>
|
||||||
|
/// <param name="info">file info object</param>
|
||||||
|
/// <returns>true, if file is up-to-date, otherwise false</returns>
|
||||||
|
private bool CheckIsFileUpToDateOnSave(DepartmentModel model, FileInfo info)
|
||||||
|
{
|
||||||
|
bool retValue = false;
|
||||||
|
|
||||||
|
retValue = (model.HasChanged() == false) ? true : false;
|
||||||
|
|
||||||
|
return retValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Protected
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
// Method
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
116
CampusAppWP8/CampusAppWP8/Feed/Departments/DepartmentFeed.cs
Normal file
@@ -0,0 +1,116 @@
|
|||||||
|
//-----------------------------------------------------------------------
|
||||||
|
// <copyright file="DepartmentFeed.cs" company="BTU/IIT">
|
||||||
|
// Company copyright tag.
|
||||||
|
// </copyright>
|
||||||
|
// <author>fiedlchr</author>
|
||||||
|
// <sience>24.06.2013</sience>
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
namespace CampusAppWP8.Feed.Departments
|
||||||
|
{
|
||||||
|
using System.IO;
|
||||||
|
using CampusAppWP8.Model;
|
||||||
|
using CampusAppWP8.Model.Departments;
|
||||||
|
using CampusAppWP8.Resources;
|
||||||
|
using CampusAppWP8.Utility;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Feed class for the department information.
|
||||||
|
/// </summary>
|
||||||
|
public class DepartmentFeed : XmlModel<DepartmentModel>
|
||||||
|
{
|
||||||
|
#region Constructor
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="DepartmentFeed" /> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="autoLoad">automatic loading of the data</param>
|
||||||
|
public DepartmentFeed(bool autoLoad = true)
|
||||||
|
: base(ModelType.FileAndFeed, Constants.FileDepartment_Name, Constants.UrlDepartment_Addr)
|
||||||
|
{
|
||||||
|
this.isFileUpToDateOnLoad += new IsFileUpToDate(this.CheckIsFileUpToDateOnLoad);
|
||||||
|
this.isFileUpToDateOnSave += new IsFileUpToDate(this.CheckIsFileUpToDateOnSave);
|
||||||
|
this.isModelUpToDateOnLoad += new IsModelUpToDate(this.CheckIsModelUpToDate);
|
||||||
|
|
||||||
|
if (autoLoad == true)
|
||||||
|
{
|
||||||
|
this.LoadData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Constructor
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Method
|
||||||
|
|
||||||
|
#region Protected
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method implement CheckIsModelUpToDate()-Method <see cref="Pages"/>.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="model">model object</param>
|
||||||
|
/// <returns>true, if model is up-to-date, otherwise false</returns>
|
||||||
|
private bool CheckIsModelUpToDate(DepartmentModel model)
|
||||||
|
{
|
||||||
|
bool retValue = true;
|
||||||
|
|
||||||
|
if (model == null)
|
||||||
|
{
|
||||||
|
retValue = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
retValue = Utilities.DayDifference(Utilities.DifferenceType.Less, model.CreateTime, 7.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
return retValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method implement CheckIsFileUpToDate()-Method <see cref="Pages"/>.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="model">model object</param>
|
||||||
|
/// <param name="info">file info object</param>
|
||||||
|
/// <returns>true, if file is up-to-date, otherwise false</returns>
|
||||||
|
private bool CheckIsFileUpToDateOnLoad(DepartmentModel model, FileInfo info)
|
||||||
|
{
|
||||||
|
bool retValue = true;
|
||||||
|
|
||||||
|
if (model == null)
|
||||||
|
{
|
||||||
|
// at loading
|
||||||
|
if (info.Exists == true)
|
||||||
|
{
|
||||||
|
retValue = Utilities.DayDifference(Utilities.DifferenceType.Less, info.LastWriteTime, 7.0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return retValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method implement CheckIsFileUpToDate()-Method <see cref="Pages"/>.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="model">model object</param>
|
||||||
|
/// <param name="info">file info object</param>
|
||||||
|
/// <returns>true, if file is up-to-date, otherwise false</returns>
|
||||||
|
private bool CheckIsFileUpToDateOnSave(DepartmentModel model, FileInfo info)
|
||||||
|
{
|
||||||
|
bool retValue = true;
|
||||||
|
|
||||||
|
// at saving
|
||||||
|
if ((info.Exists == false)
|
||||||
|
|| (info.Length == 0))
|
||||||
|
{
|
||||||
|
retValue = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return retValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Protedted
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
// Method
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
100
CampusAppWP8/CampusAppWP8/Feed/Events/EventFeed.cs
Normal file
@@ -0,0 +1,100 @@
|
|||||||
|
//-----------------------------------------------------------------------
|
||||||
|
// <copyright file="EventFeed.cs" company="BTU/IIT">
|
||||||
|
// Company copyright tag.
|
||||||
|
// </copyright>
|
||||||
|
// <author>fiedlchr</author>
|
||||||
|
// <sience>24.06.2013</sience>
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
namespace CampusAppWP8.Feed.Events
|
||||||
|
{
|
||||||
|
using System.IO;
|
||||||
|
using CampusAppWP8.Model;
|
||||||
|
using CampusAppWP8.Model.RSS;
|
||||||
|
using CampusAppWP8.Resources;
|
||||||
|
using CampusAppWP8.Utility;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Event Feed.
|
||||||
|
/// </summary>
|
||||||
|
public class EventFeed : XmlModel<RSSViewModel>
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="EventFeed" /> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="autoLoad">automatic loading of the data</param>
|
||||||
|
public EventFeed(bool autoLoad = true)
|
||||||
|
: base(ModelType.FileAndFeed, Constants.FileEvents_Name, Constants.UrlEvents_Addr)
|
||||||
|
{
|
||||||
|
this.isFileUpToDateOnLoad += new IsFileUpToDate(this.CheckIsFileUpToDateOnLoad);
|
||||||
|
this.isFileUpToDateOnSave += new IsFileUpToDate(this.CheckIsFileUpToDateOnSave);
|
||||||
|
this.isModelUpToDateOnLoad += new IsModelUpToDate(this.CheckIsModelUpToDate);
|
||||||
|
|
||||||
|
if (autoLoad == true)
|
||||||
|
{
|
||||||
|
this.LoadData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method implement CheckIsModelUpToDate()-Method <see cref="Pages"/>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="model">model object</param>
|
||||||
|
/// <returns>true, if model is up-to-date, otherwise false</returns>
|
||||||
|
private bool CheckIsModelUpToDate(RSSViewModel model)
|
||||||
|
{
|
||||||
|
bool retValue = true;
|
||||||
|
|
||||||
|
if (model == null)
|
||||||
|
{
|
||||||
|
retValue = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
retValue = Utilities.DayDifference(Utilities.DifferenceType.Less, model.CreateTime, 1.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
return retValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method implement CheckIsFileUpToDate()-Method <see cref="Pages"/>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="model">model object</param>
|
||||||
|
/// <param name="info">file info object</param>
|
||||||
|
/// <returns>true, if file is up-to-date, otherwise false</returns>
|
||||||
|
private bool CheckIsFileUpToDateOnLoad(RSSViewModel model, FileInfo info)
|
||||||
|
{
|
||||||
|
bool retValue = true;
|
||||||
|
|
||||||
|
if (model == null)
|
||||||
|
{
|
||||||
|
// at loading
|
||||||
|
if (info.Exists == true)
|
||||||
|
{
|
||||||
|
retValue = Utilities.DayDifference(Utilities.DifferenceType.Less, info.LastWriteTime, 1.0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return retValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method implement CheckIsFileUpToDate()-Method <see cref="Pages"/>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="model">model object</param>
|
||||||
|
/// <param name="info">file info object</param>
|
||||||
|
/// <returns>true, if file is up-to-date, otherwise false</returns>
|
||||||
|
private bool CheckIsFileUpToDateOnSave(RSSViewModel model, FileInfo info)
|
||||||
|
{
|
||||||
|
bool retValue = true;
|
||||||
|
|
||||||
|
if ((info.Exists == false)
|
||||||
|
|| (info.Length == 0))
|
||||||
|
{
|
||||||
|
retValue = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return retValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
88
CampusAppWP8/CampusAppWP8/Feed/Link/ClubLinkFeed.cs
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
//-----------------------------------------------------------------------
|
||||||
|
// <copyright file="ClubLinkFeed.cs" company="BTU/IIT">
|
||||||
|
// Company copyright tag.
|
||||||
|
// </copyright>
|
||||||
|
// <author>stubbfel</author>
|
||||||
|
// <sience>02.07.2013</sience>
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
namespace CampusAppWP8.Feed.Link
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
using CampusAppWP8.Model;
|
||||||
|
using CampusAppWP8.Model.Link;
|
||||||
|
using CampusAppWP8.Resources;
|
||||||
|
using CampusAppWP8.Utility;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// This Class is for ClubLinkFeeds
|
||||||
|
/// </summary>
|
||||||
|
public class ClubLinkFeed : XmlModel<LinkListModel>
|
||||||
|
{
|
||||||
|
#region Constructor
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="ClubLinkFeed" /> class.
|
||||||
|
/// </summary>
|
||||||
|
public ClubLinkFeed()
|
||||||
|
: base(ModelType.FileAndFeed, Constants.FileLink_ClubLinks, Constants.UrlLink_ClubLinks)
|
||||||
|
{
|
||||||
|
this.isFileUpToDateOnLoad += new IsFileUpToDate(this.CheckIsFileUpToDate);
|
||||||
|
this.isModelUpToDateOnLoad += new IsModelUpToDate(this.CheckIsModelUpToDate);
|
||||||
|
this.isFileUpToDateOnSave += new IsFileUpToDate(this.CheckIsFileUpToDate);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Method
|
||||||
|
|
||||||
|
#region Private
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method check if the FeedModel is up-to-date
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="model">reference of the FeedModel</param>
|
||||||
|
/// <returns>true, if model is up-to-date, otherwise false</returns>
|
||||||
|
private bool CheckIsModelUpToDate(LinkListModel model)
|
||||||
|
{
|
||||||
|
if (model == null)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
DateTime lastModified = model.CreateTime;
|
||||||
|
return this.CheckIsUpToDate(lastModified);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method check if the FeedFile is up-to-date
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="model">reference of the FeedModel</param>
|
||||||
|
/// <param name="fileInfo">info about the file</param>
|
||||||
|
/// <returns>true, if file is up-to-date, otherwise false</returns>
|
||||||
|
private bool CheckIsFileUpToDate(LinkListModel model, FileInfo fileInfo)
|
||||||
|
{
|
||||||
|
if (fileInfo == null || !fileInfo.Exists)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
DateTime lastModified = fileInfo.LastWriteTime;
|
||||||
|
return this.CheckIsUpToDate(lastModified);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Check if the model or file is up-to-date.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="lastModified">Date of the last modification</param>
|
||||||
|
/// <returns>true, if is up-to-date, otherwise false</returns>
|
||||||
|
private bool CheckIsUpToDate(DateTime lastModified)
|
||||||
|
{
|
||||||
|
return Utilities.DayDifference(Utilities.DifferenceType.Less, lastModified, 7.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
88
CampusAppWP8/CampusAppWP8/Feed/Link/CommonLinkFeed.cs
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
//-----------------------------------------------------------------------
|
||||||
|
// <copyright file="CommonLinkFeed.cs" company="BTU/IIT">
|
||||||
|
// Company copyright tag.
|
||||||
|
// </copyright>
|
||||||
|
// <author>stubbfel</author>
|
||||||
|
// <sience>02.07.2013</sience>
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
namespace CampusAppWP8.Feed.Link
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
using CampusAppWP8.Model;
|
||||||
|
using CampusAppWP8.Model.Link;
|
||||||
|
using CampusAppWP8.Resources;
|
||||||
|
using CampusAppWP8.Utility;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// This Class is for CommonLinkFeeds
|
||||||
|
/// </summary>
|
||||||
|
public class CommonLinkFeed : XmlModel<LinkListModel>
|
||||||
|
{
|
||||||
|
#region Constructor
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="CommonLinkFeed" /> class.
|
||||||
|
/// </summary>
|
||||||
|
public CommonLinkFeed()
|
||||||
|
: base(ModelType.FileAndFeed, Constants.FileLink_CommonLinks, Constants.UrlLink_CommonLinks)
|
||||||
|
{
|
||||||
|
this.isFileUpToDateOnLoad += new IsFileUpToDate(this.CheckIsFileUpToDate);
|
||||||
|
this.isFileUpToDateOnSave += new IsFileUpToDate(this.CheckIsFileUpToDate);
|
||||||
|
this.isModelUpToDateOnLoad += new IsModelUpToDate(this.CheckIsModelUpToDate);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Method
|
||||||
|
|
||||||
|
#region Private
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method check if the FeedModel is up-to-date
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="model">reference of the FeedModel</param>
|
||||||
|
/// <returns>true, if model is up-to-date, otherwise false</returns>
|
||||||
|
private bool CheckIsModelUpToDate(LinkListModel model)
|
||||||
|
{
|
||||||
|
if (model == null)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
DateTime lastModified = model.CreateTime;
|
||||||
|
return this.CheckIsUpToDate(lastModified);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method check if the FeedFile is up-to-date
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="model">reference of the FeedModel</param>
|
||||||
|
/// <param name="fileInfo">info about the file</param>
|
||||||
|
/// <returns>true, if file is up-to-date, otherwise false</returns>
|
||||||
|
private bool CheckIsFileUpToDate(LinkListModel model, FileInfo fileInfo)
|
||||||
|
{
|
||||||
|
if (fileInfo == null || !fileInfo.Exists)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
DateTime lastModified = fileInfo.LastWriteTime;
|
||||||
|
return this.CheckIsUpToDate(lastModified);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Check if the model or file is up-to-date.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="lastModified">Date of the last modification</param>
|
||||||
|
/// <returns>true, if is up-to-date, otherwise false</returns>
|
||||||
|
private bool CheckIsUpToDate(DateTime lastModified)
|
||||||
|
{
|
||||||
|
return Utilities.DayDifference(Utilities.DifferenceType.Less, lastModified, 7.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,17 +5,18 @@
|
|||||||
// <author>stubbfel</author>
|
// <author>stubbfel</author>
|
||||||
// <sience>03.05.2013</sience>
|
// <sience>03.05.2013</sience>
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
namespace CampusAppWP8.Pages.Mensa
|
namespace CampusAppWP8.Feed.Mensa
|
||||||
{
|
{
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.ObjectModel;
|
using System.IO;
|
||||||
|
using CampusAppWP8.Model;
|
||||||
using CampusAppWP8.Model.Mensa;
|
using CampusAppWP8.Model.Mensa;
|
||||||
using CampusAppWP8.Utility;
|
using CampusAppWP8.Resources;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This Class is for MesaFeeds
|
/// This Class is for MensaFeeds
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class MensaFeed : XmlFeed<MenuWeekModel>
|
public class MensaFeed : XmlModel<MenuWeekModel>
|
||||||
{
|
{
|
||||||
#region Constructor
|
#region Constructor
|
||||||
|
|
||||||
@@ -23,63 +24,50 @@ namespace CampusAppWP8.Pages.Mensa
|
|||||||
/// Initializes a new instance of the <see cref="MensaFeed" /> class.
|
/// Initializes a new instance of the <see cref="MensaFeed" /> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public MensaFeed()
|
public MensaFeed()
|
||||||
: base(URLList.MensaFeedURL, FileList.MensaXmlFile)
|
: base(ModelType.FileAndFeed, Constants.FileMensa_Shedule, Constants.UrlMensa_Week)
|
||||||
{
|
{
|
||||||
|
this.isFileUpToDateOnLoad += new IsFileUpToDate(this.CheckIsFileUpToDate);
|
||||||
|
this.isModelUpToDateOnLoad += new IsModelUpToDate(this.CheckIsModelUpToDate);
|
||||||
|
this.isFileUpToDateOnSave += new IsFileUpToDate(this.CheckIsFileUpToDate);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Proberty
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets i List of MenuModel
|
|
||||||
/// </summary>
|
|
||||||
public ObservableCollection<MenuModel> Menus { get; set; }
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Method
|
#region Method
|
||||||
|
|
||||||
#region Protected
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Method implement CheckIsModelUpToDate()-Method <see cref="Feed"/>
|
|
||||||
/// </summary>
|
|
||||||
/// <returns>true, if model is up-to-date, otherwise false</returns>
|
|
||||||
protected override bool CheckIsModelUpToDate()
|
|
||||||
{
|
|
||||||
DateTime lastModified = this.Model.CreateTime;
|
|
||||||
return this.CheckIsUpToDate(lastModified);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Method implement CheckIsFileUpToDate()-Method <see cref="Feed"/>
|
|
||||||
/// </summary>
|
|
||||||
/// <returns>true, if file is up-to-date, otherwise false</returns>
|
|
||||||
protected override bool CheckIsFileUpToDate()
|
|
||||||
{
|
|
||||||
DateTime lastModified = FileManager.GetFileInfo(FileName).LastWriteTime;
|
|
||||||
return this.CheckIsUpToDate(lastModified);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Private
|
#region Private
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Method calculate this day of the week, which its gets new menus
|
/// Method check if the FeedModel is up-to-date
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>Date of NewMenuWeekDay</returns>
|
/// <param name="model">reference of the FeedModel</param>
|
||||||
private DateTime CalcNewMenuWeekDay()
|
/// <returns>true, if model is up-to-date, otherwise false</returns>
|
||||||
|
private bool CheckIsModelUpToDate(MenuWeekModel model)
|
||||||
{
|
{
|
||||||
DateTime now = DateTime.Now;
|
if (model == null)
|
||||||
while (now.DayOfWeek != DayOfWeek.Monday)
|
|
||||||
{
|
{
|
||||||
now = now.Subtract(new TimeSpan(1, 0, 0, 0));
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
DateTime monday = new DateTime(now.Year, now.Month, now.Day);
|
DateTime lastModified = model.CreateTime;
|
||||||
return monday;
|
return this.CheckIsUpToDate(lastModified);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method check if the FeedFile is up-to-date
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="model">reference of the FeedModel</param>
|
||||||
|
/// <param name="fileInfo">info about the file</param>
|
||||||
|
/// <returns>true, if file is up-to-date, otherwise false</returns>
|
||||||
|
private bool CheckIsFileUpToDate(MenuWeekModel model, FileInfo fileInfo)
|
||||||
|
{
|
||||||
|
if (fileInfo == null || !fileInfo.Exists)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
DateTime lastModified = fileInfo.LastWriteTime;
|
||||||
|
return this.CheckIsUpToDate(lastModified);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -89,7 +77,7 @@ namespace CampusAppWP8.Pages.Mensa
|
|||||||
/// <returns>true, if is up-to-date, otherwise false</returns>
|
/// <returns>true, if is up-to-date, otherwise false</returns>
|
||||||
private bool CheckIsUpToDate(DateTime lastModified)
|
private bool CheckIsUpToDate(DateTime lastModified)
|
||||||
{
|
{
|
||||||
int diff = lastModified.CompareTo(this.CalcNewMenuWeekDay());
|
int diff = lastModified.CompareTo(MenuWeekModel.CalcFirstWeekDay());
|
||||||
|
|
||||||
if (diff < 0)
|
if (diff < 0)
|
||||||
{
|
{
|
||||||
|
|||||||
99
CampusAppWP8/CampusAppWP8/Feed/News/NewsFeed.cs
Normal file
@@ -0,0 +1,99 @@
|
|||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// <copyright file="NewsFeed.cs" company="BTU/IIT">
|
||||||
|
// Company copyright tag.
|
||||||
|
// </copyright>
|
||||||
|
// <author>fiedlchr</author>
|
||||||
|
// <sience>24.06.2013</sience>
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
namespace CampusAppWP8.Feed.News
|
||||||
|
{
|
||||||
|
using System.IO;
|
||||||
|
using CampusAppWP8.Model;
|
||||||
|
using CampusAppWP8.Model.RSS;
|
||||||
|
using CampusAppWP8.Resources;
|
||||||
|
using CampusAppWP8.Utility;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// News Feed.
|
||||||
|
/// </summary>
|
||||||
|
public class NewsFeed : XmlModel<RSSViewModel>
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="NewsFeed" /> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="autoLoad">automatic loading of the data</param>
|
||||||
|
public NewsFeed(bool autoLoad = true)
|
||||||
|
: base(ModelType.FileAndFeed, Constants.FileNews_Name, Constants.UrlNews_Addr)
|
||||||
|
{
|
||||||
|
this.isFileUpToDateOnLoad += new IsFileUpToDate(this.CheckIsFileUpToDateOnLoad);
|
||||||
|
this.isFileUpToDateOnSave += new IsFileUpToDate(this.CheckIsFileUpToDateOnSave);
|
||||||
|
this.isModelUpToDateOnLoad += new IsModelUpToDate(this.CheckIsModelUpToDate);
|
||||||
|
|
||||||
|
if (autoLoad == true)
|
||||||
|
{
|
||||||
|
this.LoadData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method implement CheckIsModelUpToDate()-Method <see cref="Pages"/>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="model">model object</param>
|
||||||
|
/// <returns>true, if model is up-to-date, otherwise false</returns>
|
||||||
|
private bool CheckIsModelUpToDate(RSSViewModel model)
|
||||||
|
{
|
||||||
|
bool retValue = true;
|
||||||
|
|
||||||
|
if (model == null)
|
||||||
|
{
|
||||||
|
retValue = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
retValue = Utilities.DayDifference(Utilities.DifferenceType.Less, model.CreateTime, 1.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
return retValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method implement CheckIsFileUpToDate()-Method <see cref="Pages"/>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="model">model object</param>
|
||||||
|
/// <param name="info">info object of the file</param>
|
||||||
|
/// <returns>true, if file is up-to-date, otherwise false</returns>
|
||||||
|
private bool CheckIsFileUpToDateOnLoad(RSSViewModel model, FileInfo info)
|
||||||
|
{
|
||||||
|
bool retValue = true;
|
||||||
|
|
||||||
|
if (model == null)
|
||||||
|
{
|
||||||
|
if (info.Exists == true)
|
||||||
|
{
|
||||||
|
retValue = Utilities.DayDifference(Utilities.DifferenceType.Less, info.LastWriteTime, 1.0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return retValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method implement CheckIsFileUpToDate()-Method <see cref="Pages"/>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="model">model object</param>
|
||||||
|
/// <param name="info">info object of the file</param>
|
||||||
|
/// <returns>true, if file is up-to-date, otherwise false</returns>
|
||||||
|
private bool CheckIsFileUpToDateOnSave(RSSViewModel model, FileInfo info)
|
||||||
|
{
|
||||||
|
bool retValue = true;
|
||||||
|
|
||||||
|
if ((info.Exists == false)
|
||||||
|
|| (info.Length == 0))
|
||||||
|
{
|
||||||
|
retValue = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return retValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
105
CampusAppWP8/CampusAppWP8/Feed/Openinghours/OpeninghoursFeed.cs
Normal file
@@ -0,0 +1,105 @@
|
|||||||
|
//-----------------------------------------------------------------------
|
||||||
|
// <copyright file="OpeninghoursFeed.cs" company="BTU/IIT">
|
||||||
|
// Company copyright tag.
|
||||||
|
// </copyright>
|
||||||
|
// <author>fiedlchr</author>
|
||||||
|
// <sience>24.06.2013</sience>
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
namespace CampusAppWP8.Feed.Openinghours
|
||||||
|
{
|
||||||
|
using System.IO;
|
||||||
|
using CampusAppWP8.Model;
|
||||||
|
using CampusAppWP8.Model.Openinghours;
|
||||||
|
using CampusAppWP8.Resources;
|
||||||
|
using CampusAppWP8.Utility;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// This Class is for MesaFeeds
|
||||||
|
/// </summary>
|
||||||
|
public class OpeninghoursFeed : XmlModel<OpeninghoursModel>
|
||||||
|
{
|
||||||
|
#region Constructor
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="OpeninghoursFeed" /> class.
|
||||||
|
/// </summary>
|
||||||
|
public OpeninghoursFeed()
|
||||||
|
: base(ModelType.FileAndFeed, Constants.FileOpeningHours_OpeningHours, Constants.UrlOpeningHours_OpeningHours)
|
||||||
|
{
|
||||||
|
this.isFileUpToDateOnLoad += new IsFileUpToDate(this.CheckIsFileUpToDateOnLoad);
|
||||||
|
this.isFileUpToDateOnSave += new IsFileUpToDate(this.CheckIsFileUpToDateOnSave);
|
||||||
|
this.isModelUpToDateOnLoad += new IsModelUpToDate(this.CheckIsModelUpToDate);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Method
|
||||||
|
|
||||||
|
#region Private
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method check if the FeedModel is up-to-date
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="model">reference of the FeedModel</param>
|
||||||
|
/// <returns>true, if model is up-to-date, otherwise false</returns>
|
||||||
|
private bool CheckIsModelUpToDate(OpeninghoursModel model)
|
||||||
|
{
|
||||||
|
bool retValue = true;
|
||||||
|
|
||||||
|
if (model == null)
|
||||||
|
{
|
||||||
|
retValue = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
retValue = Utilities.DayDifference(Utilities.DifferenceType.Less, model.CreateTime, 7.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
return retValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method check if the FeedFile is up-to-date
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="model">reference of the FeedModel</param>
|
||||||
|
/// <param name="info">info about the file</param>
|
||||||
|
/// <returns>true, if file is up-to-date, otherwise false</returns>
|
||||||
|
private bool CheckIsFileUpToDateOnLoad(OpeninghoursModel model, FileInfo info)
|
||||||
|
{
|
||||||
|
bool retValue = true;
|
||||||
|
|
||||||
|
if (model == null)
|
||||||
|
{
|
||||||
|
if (info.Exists == true)
|
||||||
|
{
|
||||||
|
retValue = Utilities.DayDifference(Utilities.DifferenceType.Less, info.LastWriteTime, 7.0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return retValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method check if the FeedFile is up-to-date
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="model">reference of the FeedModel</param>
|
||||||
|
/// <param name="info">info about the file</param>
|
||||||
|
/// <returns>true, if file is up-to-date, otherwise false</returns>
|
||||||
|
private bool CheckIsFileUpToDateOnSave(OpeninghoursModel model, FileInfo info)
|
||||||
|
{
|
||||||
|
bool retValue = true;
|
||||||
|
|
||||||
|
if ((info.Exists == false)
|
||||||
|
|| (info.Length == 0))
|
||||||
|
{
|
||||||
|
retValue = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return retValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,88 @@
|
|||||||
|
//-----------------------------------------------------------------------
|
||||||
|
// <copyright file="StudentCouncilFeed.cs" company="BTU/IIT">
|
||||||
|
// Company copyright tag.
|
||||||
|
// </copyright>
|
||||||
|
// <author>stubbfel</author>
|
||||||
|
// <sience>02.07.2013</sience>
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
namespace CampusAppWP8.Feed.StudentCouncil
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
using CampusAppWP8.Model;
|
||||||
|
using CampusAppWP8.Model.StudentCouncil;
|
||||||
|
using CampusAppWP8.Resources;
|
||||||
|
using CampusAppWP8.Utility;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// This Class is for StudentCouncilFeed
|
||||||
|
/// </summary>
|
||||||
|
public class StudentCouncilFeed : XmlModel<StudentCouncilListModel>
|
||||||
|
{
|
||||||
|
#region Constructor
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="StudentCouncilFeed" /> class.
|
||||||
|
/// </summary>
|
||||||
|
public StudentCouncilFeed()
|
||||||
|
: base(ModelType.FileAndFeed, Constants.FileStudentCouncil_StudentCouncils, Constants.UrlStudentCouncil_StudentCouncils)
|
||||||
|
{
|
||||||
|
this.isFileUpToDateOnLoad += new IsFileUpToDate(this.CheckIsFileUpToDate);
|
||||||
|
this.isModelUpToDateOnLoad += new IsModelUpToDate(this.CheckIsModelUpToDate);
|
||||||
|
this.isFileUpToDateOnSave += new IsFileUpToDate(this.CheckIsFileUpToDate);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Method
|
||||||
|
|
||||||
|
#region Private
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method check if the FeedModel is up-to-date
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="model">reference of the FeedModel</param>
|
||||||
|
/// <returns>true, if model is up-to-date, otherwise false</returns>
|
||||||
|
private bool CheckIsModelUpToDate(StudentCouncilListModel model)
|
||||||
|
{
|
||||||
|
if (model == null)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
DateTime lastModified = model.CreateTime;
|
||||||
|
return this.CheckIsUpToDate(lastModified);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method check if the FeedFile is up-to-date
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="model">reference of the FeedModel</param>
|
||||||
|
/// <param name="fileInfo">info about the file</param>
|
||||||
|
/// <returns>true, if file is up-to-date, otherwise false</returns>
|
||||||
|
private bool CheckIsFileUpToDate(StudentCouncilListModel model, FileInfo fileInfo)
|
||||||
|
{
|
||||||
|
if (fileInfo == null || !fileInfo.Exists)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
DateTime lastModified = fileInfo.LastWriteTime;
|
||||||
|
return this.CheckIsUpToDate(lastModified);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Check if the model or file is up-to-date.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="lastModified">Date of the last modification</param>
|
||||||
|
/// <returns>true, if is up-to-date, otherwise false</returns>
|
||||||
|
private bool CheckIsUpToDate(DateTime lastModified)
|
||||||
|
{
|
||||||
|
return Utilities.DayDifference(Utilities.DifferenceType.Less, lastModified, 7.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
67
CampusAppWP8/CampusAppWP8/File/Setting/UserProfilFile.cs
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
//-----------------------------------------------------------------------
|
||||||
|
// <copyright file="UserProfilFile.cs" company="BTU/IIT">
|
||||||
|
// Company copyright tag.
|
||||||
|
// </copyright>
|
||||||
|
// <author>stubbfel</author>
|
||||||
|
// <sience>23.07.2013</sience>
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
namespace CampusAppWP8.File.Setting
|
||||||
|
{
|
||||||
|
using System.IO;
|
||||||
|
using CampusAppWP8.Model;
|
||||||
|
using CampusAppWP8.Model.Setting;
|
||||||
|
using CampusAppWP8.Resources;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Class for handle the user-profile-file
|
||||||
|
/// </summary>
|
||||||
|
public class UserProfilFile : XmlModel<UserProfilModel>
|
||||||
|
{
|
||||||
|
#region Constructor
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="UserProfilFile" /> class.
|
||||||
|
/// </summary>
|
||||||
|
public UserProfilFile()
|
||||||
|
: base(ModelType.File, Constants.FileProfil_User)
|
||||||
|
{
|
||||||
|
this.isFileUpToDateOnLoad += new IsFileUpToDate(this.CheckIsFileUpToDateOnLoad);
|
||||||
|
this.isFileUpToDateOnSave += new IsFileUpToDate(this.CheckIsFileUpToDateOnSave);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Constructor
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method implement CheckIsFileUpToDate()-Method <see cref="Pages"/>.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="model">model object</param>
|
||||||
|
/// <param name="info">file info object</param>
|
||||||
|
/// <returns>true, if file is up-to-date, otherwise false</returns>
|
||||||
|
private bool CheckIsFileUpToDateOnLoad(UserProfilModel model, FileInfo info)
|
||||||
|
{
|
||||||
|
if (model == null)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method implement CheckIsFileUpToDate()-Method <see cref="Pages"/>.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="model">model object</param>
|
||||||
|
/// <param name="info">file info object</param>
|
||||||
|
/// <returns>true, if file is up-to-date, otherwise false</returns>
|
||||||
|
private bool CheckIsFileUpToDateOnSave(UserProfilModel model, FileInfo info)
|
||||||
|
{
|
||||||
|
if (model != null && !model.HasChanged())
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
177
CampusAppWP8/CampusAppWP8/Model/Campusmap/MapModel.cs
Normal file
@@ -0,0 +1,177 @@
|
|||||||
|
//-----------------------------------------------------------------------
|
||||||
|
// <copyright file="MapModel.cs" company="BTU/IIT">
|
||||||
|
// Company copyright tag.
|
||||||
|
// </copyright>
|
||||||
|
// <author>stubbfel</author>
|
||||||
|
// <sience>24.06.2013</sience>
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
namespace CampusAppWP8.Model.Campusmap
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Media.Imaging;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// This Class manage the properties of a Map
|
||||||
|
/// </summary>
|
||||||
|
public class MapModel
|
||||||
|
{
|
||||||
|
#region Constructors
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="MapModel" /> class.
|
||||||
|
/// </summary>
|
||||||
|
public MapModel()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Property
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the ImageSource of the map
|
||||||
|
/// </summary>
|
||||||
|
public string ImageSource { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the ImageWidth of the map
|
||||||
|
/// </summary>
|
||||||
|
public double ImageWidth { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the ImageHeight of the map
|
||||||
|
/// </summary>
|
||||||
|
public double ImageHeight { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the ImageOffsetX of the map
|
||||||
|
/// </summary>
|
||||||
|
public double MapImageOffsetX { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the ImageOffsetY of the map
|
||||||
|
/// </summary>
|
||||||
|
public double MapImageOffsetY { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the GeoOffsetX of the map
|
||||||
|
/// </summary>
|
||||||
|
public double GeoOffsetX { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the GeoOffsetY of the map
|
||||||
|
/// </summary>
|
||||||
|
public double GeoOffsetY { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the Scale (to pixel) of the map
|
||||||
|
/// </summary>
|
||||||
|
public double Scale { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the reference point
|
||||||
|
/// </summary>
|
||||||
|
public Point RefPoint { get; set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method calculate the coordinates of ScrollToOffsets point
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="point">input point</param>
|
||||||
|
/// <returns>point (in pixel)</returns>
|
||||||
|
public Point GetScrollPoint(Point point)
|
||||||
|
{
|
||||||
|
return this.GetScrollPoint(point.X, point.Y);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method calculate the coordinates of ScrollToOffsets point
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>the input-point will be shown in the center</remarks>
|
||||||
|
/// <param name="x">x - coordinate</param>
|
||||||
|
/// <param name="y">y - coordinate</param>
|
||||||
|
/// <returns>point (in pixel)</returns>
|
||||||
|
public Point GetScrollPoint(double x, double y)
|
||||||
|
{
|
||||||
|
x = this.RefPoint.X + this.MapImageOffsetX + x;
|
||||||
|
y = this.RefPoint.Y + this.MapImageOffsetY - y;
|
||||||
|
return new Point(x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method create in image, which can show at a certain position
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="x">the x- coordinate</param>
|
||||||
|
/// <param name="y">the y-coordinate</param>
|
||||||
|
/// <returns>image of the pin</returns>
|
||||||
|
public Image AddPin(double x, double y)
|
||||||
|
{
|
||||||
|
Point position = new Point(x, y);
|
||||||
|
return this.AddPin(position);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method create in image, which can show at a certain position depend of the <see cref="RefPoint" />
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="x">the x-coordinate</param>
|
||||||
|
/// <param name="y">the y-coordinate</param>
|
||||||
|
/// <returns>image of the pin</returns>
|
||||||
|
public Image AddPinFromRefPoint(double x, double y)
|
||||||
|
{
|
||||||
|
Point position = new Point(this.RefPoint.X + x, this.RefPoint.Y - y);
|
||||||
|
return this.AddPin(position);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method create in image, which can show at a certain position depend of the <see cref="RefPoint" />
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="position">input point</param>
|
||||||
|
/// <returns>image of the pin</returns>
|
||||||
|
public Image AddPinFromRefPoint(Point position)
|
||||||
|
{
|
||||||
|
return this.AddPinFromRefPoint(position.X, position.Y);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method create in image, which can show at a certain position
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="position">input point</param>
|
||||||
|
/// <returns>image of the pin</returns>
|
||||||
|
public Image AddPin(Point position)
|
||||||
|
{
|
||||||
|
MapPinModel pin = new MapPinModel() { Position = position };
|
||||||
|
Image pinImg = new Image() { Source = new BitmapImage(new Uri(pin.ImageSource, UriKind.Relative)), Width = pin.ImageWidth };
|
||||||
|
Canvas.SetTop(pinImg, pin.Position.Y);
|
||||||
|
Canvas.SetLeft(pinImg, pin.Position.X);
|
||||||
|
return pinImg;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Convert a coordinates to coordinates which address pixels
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="x">the x-coordinate</param>
|
||||||
|
/// <param name="y">the y-coordinate</param>
|
||||||
|
/// <returns>Point in pixel-size</returns>
|
||||||
|
public Point ConverToPixelPoint(double x, double y)
|
||||||
|
{
|
||||||
|
return new Point { X = this.Scale * x, Y = this.Scale * y };
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Convert a coordinates to coordinates which address pixels
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="point">not scaled point</param>
|
||||||
|
/// <returns>Point in pixel-size</returns>
|
||||||
|
public Point ConverToPixelPoint(Point point)
|
||||||
|
{
|
||||||
|
return this.ConverToPixelPoint(point.X, point.Y);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
106
CampusAppWP8/CampusAppWP8/Model/Campusmap/MapPinModel.cs
Normal file
@@ -0,0 +1,106 @@
|
|||||||
|
//-----------------------------------------------------------------------
|
||||||
|
// <copyright file="MapPinModel.cs" company="BTU/IIT">
|
||||||
|
// Company copyright tag.
|
||||||
|
// </copyright>
|
||||||
|
// <author>stubbfel</author>
|
||||||
|
// <sience>24.06.2013</sience>
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
namespace CampusAppWP8.Model.Campusmap
|
||||||
|
{
|
||||||
|
using System.Windows;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// This Class manage the properties of a MapPin
|
||||||
|
/// </summary>
|
||||||
|
public class MapPinModel
|
||||||
|
{
|
||||||
|
#region Member
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Variable of the actual position of the pin
|
||||||
|
/// </summary>
|
||||||
|
private Point position;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
#region Constructor
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="MapPinModel" /> class.
|
||||||
|
/// </summary>
|
||||||
|
public MapPinModel()
|
||||||
|
{
|
||||||
|
this.ImageSource = "/Assets/icons/search_159_light.png";
|
||||||
|
this.ImageWidth = 60;
|
||||||
|
this.ImageHeight = 60;
|
||||||
|
this.PinImageOffsetX = -24;
|
||||||
|
this.PinImageOffsetY = -24;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Property
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the ImageSource of the pin
|
||||||
|
/// </summary>
|
||||||
|
public string ImageSource { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the ImageWidth of the pin
|
||||||
|
/// </summary>
|
||||||
|
public double ImageWidth { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the ImageHeight of the pin
|
||||||
|
/// </summary>
|
||||||
|
public double ImageHeight { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the ImageOffsetX of the pin
|
||||||
|
/// </summary>
|
||||||
|
public double PinImageOffsetX { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the ImageOffsetY of the pin
|
||||||
|
/// </summary>
|
||||||
|
public double PinImageOffsetY { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets position of the pin
|
||||||
|
/// </summary>
|
||||||
|
public Point Position
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.position;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
// null assert
|
||||||
|
if (value == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.position == null)
|
||||||
|
{
|
||||||
|
this.position = value;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// check the x-value
|
||||||
|
if (value.X + this.PinImageOffsetX != this.position.X)
|
||||||
|
{
|
||||||
|
this.position.X = value.X + this.PinImageOffsetX;
|
||||||
|
}
|
||||||
|
|
||||||
|
// check the y-value
|
||||||
|
if (value.Y + this.PinImageOffsetY != this.position.Y)
|
||||||
|
{
|
||||||
|
this.position.Y = value.Y + this.PinImageOffsetY;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
128
CampusAppWP8/CampusAppWP8/Model/Departments/ChairModel.cs
Normal file
@@ -0,0 +1,128 @@
|
|||||||
|
//-----------------------------------------------------------------------
|
||||||
|
// <copyright file="ChairModel.cs" company="BTU/IIT">
|
||||||
|
// Company copyright tag.
|
||||||
|
// </copyright>
|
||||||
|
// <author>fiedlchr</author>
|
||||||
|
// <sience>24.06.2013</sience>
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
namespace CampusAppWP8.Model.Departments
|
||||||
|
{
|
||||||
|
using System.Globalization;
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Class to hold information about a professorship chair.
|
||||||
|
/// </summary>
|
||||||
|
public class ChairModel
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// German name of the chair.
|
||||||
|
/// </summary>
|
||||||
|
private string nameDE = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Link to the chair page.
|
||||||
|
/// </summary>
|
||||||
|
private string url = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// English name of the chair.
|
||||||
|
/// </summary>
|
||||||
|
private string nameEN = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="ChairModel" /> class.
|
||||||
|
/// </summary>
|
||||||
|
public ChairModel()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="ChairModel" /> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="name">name of the chair</param>
|
||||||
|
public ChairModel(string name)
|
||||||
|
{
|
||||||
|
this.nameDE = name;
|
||||||
|
this.nameEN = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the german name of the chair.
|
||||||
|
/// </summary>
|
||||||
|
[XmlAttribute("name_de")]
|
||||||
|
public string NameDE
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.nameDE;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value != this.nameDE)
|
||||||
|
{
|
||||||
|
this.nameDE = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the english name of the chair.
|
||||||
|
/// </summary>
|
||||||
|
[XmlAttribute("name_en")]
|
||||||
|
public string NameEN
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.nameEN;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value != this.nameEN)
|
||||||
|
{
|
||||||
|
this.nameEN = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the url of the chair homepage.
|
||||||
|
/// </summary>
|
||||||
|
[XmlAttribute("url")]
|
||||||
|
public string Url
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.url;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value != this.url)
|
||||||
|
{
|
||||||
|
this.url = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the localized name of the chair.
|
||||||
|
/// </summary>
|
||||||
|
public string Name
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (CultureInfo.CurrentUICulture.Name.StartsWith("de"))
|
||||||
|
{
|
||||||
|
return this.NameDE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return this.NameEN;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,91 @@
|
|||||||
|
//-----------------------------------------------------------------------
|
||||||
|
// <copyright file="DepartmentModel.cs" company="BTU/IIT">
|
||||||
|
// Company copyright tag.
|
||||||
|
// </copyright>
|
||||||
|
// <author>fiedlchr</author>
|
||||||
|
// <sience>24.06.2013</sience>
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
namespace CampusAppWP8.Model.Departments
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// View model for department page.
|
||||||
|
/// </summary>
|
||||||
|
[XmlRoot("root")]
|
||||||
|
public class DepartmentModel
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Object to store the time when the instance was created.
|
||||||
|
/// </summary>
|
||||||
|
private DateTime createTime;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// List of faculties.
|
||||||
|
/// </summary>
|
||||||
|
private ObservableCollection<FacultyModel> faculties;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="DepartmentModel" /> class.
|
||||||
|
/// </summary>
|
||||||
|
public DepartmentModel()
|
||||||
|
{
|
||||||
|
this.Faculties = new ObservableCollection<FacultyModel>();
|
||||||
|
this.createTime = DateTime.Now;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the faculty list.
|
||||||
|
/// </summary>
|
||||||
|
[XmlArray("professorships")]
|
||||||
|
[XmlArrayItem("faculty")]
|
||||||
|
public ObservableCollection<FacultyModel> Faculties
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.faculties;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value != this.faculties)
|
||||||
|
{
|
||||||
|
this.faculties = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the creation time.
|
||||||
|
/// </summary>
|
||||||
|
public DateTime CreateTime
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.createTime;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Check if the content of the faculty lists hast changed since the
|
||||||
|
/// last call of this function.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>true, if changes happen since last request, otherwise false</returns>
|
||||||
|
public bool HasChanged()
|
||||||
|
{
|
||||||
|
bool retValue = false;
|
||||||
|
|
||||||
|
foreach (FacultyModel temp in this.Faculties)
|
||||||
|
{
|
||||||
|
if ((temp.HasChanged() == true) && (retValue == false))
|
||||||
|
{
|
||||||
|
retValue = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return retValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
238
CampusAppWP8/CampusAppWP8/Model/Departments/FacultyModel.cs
Normal file
@@ -0,0 +1,238 @@
|
|||||||
|
//-----------------------------------------------------------------------
|
||||||
|
// <copyright file="FacultyModel.cs" company="BTU/IIT">
|
||||||
|
// Company copyright tag.
|
||||||
|
// </copyright>
|
||||||
|
// <author>fiedlchr</author>
|
||||||
|
// <sience>24.06.2013</sience>
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
namespace CampusAppWP8.Model.Departments
|
||||||
|
{
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
using CampusAppWP8.Resources;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Model for holding the faculty information.
|
||||||
|
/// </summary>
|
||||||
|
public class FacultyModel
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Object to hold the information of the chair containing to this
|
||||||
|
/// faculty.
|
||||||
|
/// </summary>
|
||||||
|
private ObservableCollection<ChairModel> chairs;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Name of the faculty.
|
||||||
|
/// </summary>
|
||||||
|
private string name = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// For checking of change.
|
||||||
|
/// </summary>
|
||||||
|
private bool hasChanged = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="FacultyModel" /> class.
|
||||||
|
/// </summary>
|
||||||
|
public FacultyModel()
|
||||||
|
{
|
||||||
|
this.chairs = new ObservableCollection<ChairModel>();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="FacultyModel" /> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="name">name of the faculty</param>
|
||||||
|
public FacultyModel(string name)
|
||||||
|
{
|
||||||
|
this.name = name;
|
||||||
|
this.chairs = new ObservableCollection<ChairModel>();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the list of the chairs containing to this faculty.
|
||||||
|
/// </summary>
|
||||||
|
[XmlElement("chair")]
|
||||||
|
public ObservableCollection<ChairModel> Chairs
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.chairs;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value != this.chairs)
|
||||||
|
{
|
||||||
|
this.chairs = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the name of the faculty.
|
||||||
|
/// </summary>
|
||||||
|
public string Name
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return AppResources.Faculty + " " + this.name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the id of the faculty.
|
||||||
|
/// </summary>
|
||||||
|
[XmlAttribute("id")]
|
||||||
|
public string Id
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.name;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
this.name = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Remove a chair model from the lost.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="chairName">name of the chair</param>
|
||||||
|
/// <returns>true, if succeeded</returns>
|
||||||
|
public bool RemoveChair(string chairName)
|
||||||
|
{
|
||||||
|
bool retValue = false;
|
||||||
|
|
||||||
|
ChairModel tempChair = null;
|
||||||
|
|
||||||
|
foreach (ChairModel temp in this.Chairs)
|
||||||
|
{
|
||||||
|
if (temp.Name.Equals(chairName) == true)
|
||||||
|
{
|
||||||
|
tempChair = temp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tempChair != null)
|
||||||
|
{
|
||||||
|
retValue = this.Chairs.Remove(tempChair);
|
||||||
|
this.hasChanged = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return retValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Add a chair to the list, if it does not already exist.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="chairModel">chair model to add</param>
|
||||||
|
/// <returns>true, is succeeded</returns>
|
||||||
|
public bool AddChair(ChairModel chairModel)
|
||||||
|
{
|
||||||
|
bool retValue = false;
|
||||||
|
|
||||||
|
if ((chairModel != null)
|
||||||
|
&& (this.Chairs.Contains(chairModel) == false))
|
||||||
|
{
|
||||||
|
bool isIn = false;
|
||||||
|
|
||||||
|
foreach (ChairModel temp in this.Chairs)
|
||||||
|
{
|
||||||
|
if ((temp.NameDE.Equals(chairModel.NameDE) == true)
|
||||||
|
|| (temp.NameEN.Equals(chairModel.NameEN) == true))
|
||||||
|
{
|
||||||
|
isIn = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isIn == false)
|
||||||
|
{
|
||||||
|
this.Chairs.Add(chairModel);
|
||||||
|
this.hasChanged = true;
|
||||||
|
retValue = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return retValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Create a chair model and add it to the list, if it does not already
|
||||||
|
/// exist.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="nameDE">german name of the chair</param>
|
||||||
|
/// <param name="nameEN">english name of the chair</param>
|
||||||
|
/// <param name="url">url of the chair home page</param>
|
||||||
|
/// <returns>true, if succeeded</returns>
|
||||||
|
public bool AddChair(string nameDE, string nameEN, string url)
|
||||||
|
{
|
||||||
|
bool retValue = false;
|
||||||
|
|
||||||
|
bool isIn = false;
|
||||||
|
|
||||||
|
foreach (ChairModel temp in this.Chairs)
|
||||||
|
{
|
||||||
|
if ((temp.NameDE.Equals(nameDE) == true)
|
||||||
|
|| (temp.NameEN.Equals(nameEN) == true))
|
||||||
|
{
|
||||||
|
isIn = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isIn == false)
|
||||||
|
{
|
||||||
|
ChairModel newModel = new ChairModel();
|
||||||
|
newModel.NameDE = nameDE;
|
||||||
|
newModel.NameEN = nameEN;
|
||||||
|
newModel.Url = url;
|
||||||
|
|
||||||
|
this.Chairs.Add(newModel);
|
||||||
|
this.hasChanged = true;
|
||||||
|
retValue = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return retValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Return the chair model of the chair with the specified name.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="name">name of the chair</param>
|
||||||
|
/// <returns>chair model, if succeeded, otherwise null</returns>
|
||||||
|
public ChairModel GetChairModel(string name)
|
||||||
|
{
|
||||||
|
ChairModel retValue = null;
|
||||||
|
|
||||||
|
foreach (ChairModel temp in this.Chairs)
|
||||||
|
{
|
||||||
|
if (temp.Name.Equals(name) == true)
|
||||||
|
{
|
||||||
|
retValue = temp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return retValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Return true if there were changes in the chair list, otherwise false.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="reset">when true, the hasChanged flag will be reset</param>
|
||||||
|
/// <returns>true, when changed, otherwise false</returns>
|
||||||
|
public bool HasChanged(bool reset = true)
|
||||||
|
{
|
||||||
|
bool retValue = this.hasChanged;
|
||||||
|
|
||||||
|
if (reset == true)
|
||||||
|
{
|
||||||
|
this.hasChanged = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return retValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
50
CampusAppWP8/CampusAppWP8/Model/Events/RSSChannelModel.cs
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
using CampusAppWP8.Model;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
|
namespace CampusAppWP8.Model.events_news
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Channel Model, which contains the rss feed item list.
|
||||||
|
/// </summary>
|
||||||
|
public class RSSChannelModel : BaseModel
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// RssFeed information item list.
|
||||||
|
/// </summary>
|
||||||
|
[XmlElement("item")]
|
||||||
|
public ObservableCollection<RSSModel> item { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Default constructor.
|
||||||
|
/// </summary>
|
||||||
|
public RSSChannelModel()
|
||||||
|
{
|
||||||
|
this.item = new ObservableCollection<RSSModel>();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Set/Get the rss feed item list.
|
||||||
|
/// </summary>
|
||||||
|
public ObservableCollection<RSSModel> Item
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.item;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value != this.item)
|
||||||
|
{
|
||||||
|
this.item = value;
|
||||||
|
int i = 0;
|
||||||
|
foreach (RSSModel rssItem in this.item)
|
||||||
|
{
|
||||||
|
rssItem.Index = i++;
|
||||||
|
}
|
||||||
|
NotifyPropertyChanged("item");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
209
CampusAppWP8/CampusAppWP8/Model/Events/RSSModel.cs
Normal file
@@ -0,0 +1,209 @@
|
|||||||
|
using CampusAppWP8.Model;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
|
namespace CampusAppWP8.Model.events_news
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Contains the rss feed informations.
|
||||||
|
/// </summary>
|
||||||
|
public class RSSModel : BaseModel
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Title of the fees
|
||||||
|
/// </summary>
|
||||||
|
private string title;
|
||||||
|
/// <summary>
|
||||||
|
/// Description text of the feed.
|
||||||
|
/// </summary>
|
||||||
|
private string text;
|
||||||
|
/// <summary>
|
||||||
|
/// Timestamp (publication date) of the event or news.
|
||||||
|
/// </summary>
|
||||||
|
private DateTime timestamp;
|
||||||
|
/// <summary>
|
||||||
|
/// Url of the feed.
|
||||||
|
/// </summary>
|
||||||
|
private string link;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Set/Get the title of the feed.
|
||||||
|
/// </summary>
|
||||||
|
[XmlElement("title")]
|
||||||
|
public string Title
|
||||||
|
{
|
||||||
|
get { return this.title; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (this.title != value)
|
||||||
|
{
|
||||||
|
this.title = value;
|
||||||
|
NotifyPropertyChanged("rss");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Set/Get the text of the feed.
|
||||||
|
/// </summary>
|
||||||
|
[XmlElement("description")]
|
||||||
|
public string Text
|
||||||
|
{
|
||||||
|
get { return this.text; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (this.text != HTMLUnicodeToString(value))
|
||||||
|
{
|
||||||
|
this.text = HTMLUnicodeToString(value);
|
||||||
|
NotifyPropertyChanged("rss");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Set/Get the timestamp of the feed as string.
|
||||||
|
/// </summary>
|
||||||
|
[XmlElement("pubDate")]
|
||||||
|
public string Timestamp
|
||||||
|
{
|
||||||
|
get { return this.timestamp.ToString("R"); }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (this.timestamp != DateTime.Parse(value))
|
||||||
|
{
|
||||||
|
this.timestamp = DateTime.Parse(value);
|
||||||
|
NotifyPropertyChanged("rss");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Set/Get the timestamp of the feed as DateTime object.
|
||||||
|
/// </summary>
|
||||||
|
public DateTime DTTimestamp
|
||||||
|
{
|
||||||
|
get { return this.timestamp; }
|
||||||
|
set { this.timestamp = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Return the date of the timestamp as string.
|
||||||
|
/// example: Mon, 25.06.2013.
|
||||||
|
/// </summary>
|
||||||
|
public string Date
|
||||||
|
{
|
||||||
|
get { return String.Format("{0:ddd, dd.MM.yyyy}", this.timestamp); }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Return the time of the timestamp as string.
|
||||||
|
/// example: 12:56 Uhr.
|
||||||
|
/// </summary>
|
||||||
|
public string Time
|
||||||
|
{
|
||||||
|
get { return String.Format("{0:h:mm} Uhr", this.timestamp); }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the ListIndex
|
||||||
|
/// </summary>
|
||||||
|
public int Index { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Set/Get the link/url of the feed.
|
||||||
|
/// </summary>
|
||||||
|
[XmlElement("link")]
|
||||||
|
public string Link
|
||||||
|
{
|
||||||
|
get { return this.link; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (this.link != value)
|
||||||
|
{
|
||||||
|
this.link = value;
|
||||||
|
NotifyPropertyChanged("rss");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Remove or transform html-unicode specific tags into ascii.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="htmluni">html string</param>
|
||||||
|
/// <returns>ascii string</returns>
|
||||||
|
private string HTMLUnicodeToString(string htmluni)
|
||||||
|
{
|
||||||
|
StringBuilder retValue = new StringBuilder();
|
||||||
|
|
||||||
|
for(int i = 0; i < htmluni.Length; i++)
|
||||||
|
{
|
||||||
|
switch (htmluni[i])
|
||||||
|
{
|
||||||
|
// beginning tag of the unicode
|
||||||
|
case '&':
|
||||||
|
{
|
||||||
|
int startOff = i + 2;
|
||||||
|
// sear closing tag of the unicode
|
||||||
|
int endOff = htmluni.IndexOf(';', startOff);
|
||||||
|
// get and parse value inbetween
|
||||||
|
string sub = htmluni.Substring(startOff, endOff - startOff);
|
||||||
|
int cVal = int.Parse(sub);
|
||||||
|
|
||||||
|
switch (cVal)
|
||||||
|
{
|
||||||
|
// if the unicode value is 128 (€)
|
||||||
|
case 128:
|
||||||
|
retValue.Append('€');
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
retValue.Append((char)cVal);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// set the current index to the end of the unicode tag
|
||||||
|
i = endOff;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case '<':
|
||||||
|
{
|
||||||
|
// ignoring <..> html tags
|
||||||
|
i = htmluni.IndexOf('>', i);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case '\t':
|
||||||
|
// removing tabs
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
// adding other characters to the return string
|
||||||
|
retValue.Append(htmluni[i]);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return retValue.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Comparing function for Datetime-Timestamps.
|
||||||
|
/// (currently unused)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="item1">first item</param>
|
||||||
|
/// <param name="item2">secound item</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static int CompareTimeStamp(RSSModel item1, RSSModel item2)
|
||||||
|
{
|
||||||
|
if (item1.DTTimestamp > item2.DTTimestamp)
|
||||||
|
return -1;
|
||||||
|
else
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
36
CampusAppWP8/CampusAppWP8/Model/GeoDb/PlaceModel.cs
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
//-----------------------------------------------------------------------
|
||||||
|
// <copyright file="PlaceModel.cs" company="BTU/IIT">
|
||||||
|
// Company copyright tag.
|
||||||
|
// </copyright>
|
||||||
|
// <author>stubbfel</author>
|
||||||
|
// <sience>08.08.2013</sience>
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace CampusAppWP8.Model.GeoDb
|
||||||
|
{
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Model for a place of the SPSService
|
||||||
|
/// </summary>
|
||||||
|
public class PlaceModel
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the placeId
|
||||||
|
/// </summary>
|
||||||
|
[XmlAttribute("id")]
|
||||||
|
public string PlaceId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the id of the "parent" of a place
|
||||||
|
/// </summary>
|
||||||
|
[XmlAttribute("parentId")]
|
||||||
|
public string ParentId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the ReferencePoint of a place
|
||||||
|
/// </summary>
|
||||||
|
[XmlAttribute("refpoint")]
|
||||||
|
public string RefPoint { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
26
CampusAppWP8/CampusAppWP8/Model/GeoDb/SpsModel.cs
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
//-----------------------------------------------------------------------
|
||||||
|
// <copyright file="SpsModel.cs" company="BTU/IIT">
|
||||||
|
// Company copyright tag.
|
||||||
|
// </copyright>
|
||||||
|
// <author>stubbfel</author>
|
||||||
|
// <sience>08.08.2013</sience>
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace CampusAppWP8.Model.GeoDb
|
||||||
|
{
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Model for a xml-response of the SPSService
|
||||||
|
/// </summary>
|
||||||
|
[XmlRoot("root")]
|
||||||
|
public class SpsModel
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets a list of places
|
||||||
|
/// </summary>
|
||||||
|
[XmlElement("place")]
|
||||||
|
public ObservableCollection<PlaceModel> Places { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
221
CampusAppWP8/CampusAppWP8/Model/Lecture/LectureActivity.cs
Normal file
@@ -0,0 +1,221 @@
|
|||||||
|
//-----------------------------------------------------------------------
|
||||||
|
// <copyright file="LectureActivity.cs" company="BTU/IIT">
|
||||||
|
// Company copyright tag.
|
||||||
|
// </copyright>
|
||||||
|
// <author>stubbfel</author>
|
||||||
|
// <sience>13.06.2013</sience>
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
namespace CampusAppWP8.Model.Lecture
|
||||||
|
{
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
using CampusAppWP8.Utility;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Model for a Activity
|
||||||
|
/// </summary>
|
||||||
|
public class LectureActivity
|
||||||
|
{
|
||||||
|
#region Members
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// List of lecturer
|
||||||
|
/// </summary>
|
||||||
|
private ObservableCollection<LectureLecturer> lecturer;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// a formatted string for the names of the lecturers
|
||||||
|
/// </summary>
|
||||||
|
private string lecturerString;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// a formatted string for the names of the courses
|
||||||
|
/// </summary>
|
||||||
|
private string courseString;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// a formatted string for the topic of the lecture
|
||||||
|
/// </summary>
|
||||||
|
private string topic;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
#region Constructor
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="LectureActivity" /> class.
|
||||||
|
/// </summary>
|
||||||
|
public LectureActivity()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Proberty
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the type of the activity
|
||||||
|
/// </summary>
|
||||||
|
[XmlElement("art")]
|
||||||
|
public string Type { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the id of the activity
|
||||||
|
/// </summary>
|
||||||
|
[XmlAttribute("id")]
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets semester of the activity
|
||||||
|
/// </summary>
|
||||||
|
[XmlElement("semester")]
|
||||||
|
public int Semester { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the contact hour
|
||||||
|
/// </summary>
|
||||||
|
[XmlElement("sws")]
|
||||||
|
public string SWS { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets LectureModule
|
||||||
|
/// </summary>
|
||||||
|
[XmlElement("modul")]
|
||||||
|
public LectureModule Modul { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets LectureTitle
|
||||||
|
/// </summary>
|
||||||
|
[XmlElement("titel")]
|
||||||
|
public string Title { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the lecturers
|
||||||
|
/// </summary>
|
||||||
|
[XmlElement("lehrperson")]
|
||||||
|
public ObservableCollection<LectureLecturer> Lecturer
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.lecturer;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value != this.lecturer)
|
||||||
|
{
|
||||||
|
this.lecturer = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the formatted string of the lecturers
|
||||||
|
/// </summary>
|
||||||
|
public string LecturerString
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.lecturerString;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value != this.lecturerString)
|
||||||
|
{
|
||||||
|
this.lecturerString = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets formatted string of the courses
|
||||||
|
/// </summary>
|
||||||
|
public string CourseString
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.courseString;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value != this.courseString)
|
||||||
|
{
|
||||||
|
this.courseString = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the courses
|
||||||
|
/// </summary>
|
||||||
|
[XmlElement("studiengang")]
|
||||||
|
public ObservableCollection<LectureCourse> Course { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the dates of the activity
|
||||||
|
/// </summary>
|
||||||
|
[XmlElement("termin")]
|
||||||
|
public ObservableCollection<LectureDate> Dates { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the Department
|
||||||
|
/// </summary>
|
||||||
|
[XmlElement("zugeordnete_einrichtung")]
|
||||||
|
public string Department { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the topic of the Lecture
|
||||||
|
/// </summary>
|
||||||
|
[XmlElement("lehrinhalt")]
|
||||||
|
public string Topic
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.topic;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value != this.topic)
|
||||||
|
{
|
||||||
|
this.topic = StringManager.StripHTML(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method create a formatted string of the LecturerList
|
||||||
|
/// </summary>
|
||||||
|
public void CreateLectureString()
|
||||||
|
{
|
||||||
|
string result = string.Empty;
|
||||||
|
foreach (LectureLecturer tmpLecturer in this.Lecturer)
|
||||||
|
{
|
||||||
|
result += StringManager.AddNewLine(tmpLecturer.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
this.LecturerString = StringManager.RemvoveNewLine(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method create a formatted string of the CourseList
|
||||||
|
/// </summary>
|
||||||
|
public void CreateCourseString()
|
||||||
|
{
|
||||||
|
string result = string.Empty;
|
||||||
|
foreach (LectureCourse course in this.Course)
|
||||||
|
{
|
||||||
|
result += StringManager.AddNewLine(course.Title);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.CourseString = StringManager.RemvoveNewLine(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
29
CampusAppWP8/CampusAppWP8/Model/Lecture/LectureCourse.cs
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
// <copyright file="LectureCourse.cs" company="BTU/IIT">
|
||||||
|
// Company copyright tag.
|
||||||
|
// </copyright>
|
||||||
|
// <author>stubbfel</author>
|
||||||
|
// <sience>10.06.2013</sience>
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
namespace CampusAppWP8.Model.Lecture
|
||||||
|
{
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Model for a course
|
||||||
|
/// </summary>
|
||||||
|
public class LectureCourse
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="LectureCourse" /> class.
|
||||||
|
/// </summary>
|
||||||
|
public LectureCourse()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the title of the course
|
||||||
|
/// </summary>
|
||||||
|
[XmlElement("bezeichnung")]
|
||||||
|
public string Title { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
66
CampusAppWP8/CampusAppWP8/Model/Lecture/LectureDate.cs
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
//-----------------------------------------------------------------------
|
||||||
|
// <copyright file="LectureDate.cs" company="BTU/IIT">
|
||||||
|
// Company copyright tag.
|
||||||
|
// </copyright>
|
||||||
|
// <author>stubbfel</author>
|
||||||
|
// <sience>10.06.2013</sience>
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
namespace CampusAppWP8.Model.Lecture
|
||||||
|
{
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Model for the date of an activity
|
||||||
|
/// </summary>
|
||||||
|
public class LectureDate
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="LectureDate" /> class.
|
||||||
|
/// </summary>
|
||||||
|
public LectureDate()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets WeekDay
|
||||||
|
/// </summary>
|
||||||
|
[XmlElement("wochentag")]
|
||||||
|
public string WeekDay { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets From
|
||||||
|
/// </summary>
|
||||||
|
[XmlElement("von")]
|
||||||
|
public string From { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets To
|
||||||
|
/// </summary>
|
||||||
|
[XmlElement("bis")]
|
||||||
|
public string To { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets Interval
|
||||||
|
/// </summary>
|
||||||
|
[XmlElement("rhythmus")]
|
||||||
|
public string Interval { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets Room
|
||||||
|
/// </summary>
|
||||||
|
[XmlElement("raum")]
|
||||||
|
public string Room { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets StartDate
|
||||||
|
/// </summary>
|
||||||
|
[XmlElement("anfangsdatum")]
|
||||||
|
public string StartDate { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets EndDate
|
||||||
|
/// </summary>
|
||||||
|
[XmlElement("enddatum")]
|
||||||
|
public string EndDate { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
72
CampusAppWP8/CampusAppWP8/Model/Lecture/LectureLecturer.cs
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
//-----------------------------------------------------------------------
|
||||||
|
// <copyright file="LectureLecturer.cs" company="BTU/IIT">
|
||||||
|
// Company copyright tag.
|
||||||
|
// </copyright>
|
||||||
|
// <author>stubbfel</author>
|
||||||
|
// <sience>10.06.2013</sience>
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
namespace CampusAppWP8.Model.Lecture
|
||||||
|
{
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Model for a lecturer
|
||||||
|
/// </summary>
|
||||||
|
public class LectureLecturer
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="LectureLecturer" /> class.
|
||||||
|
/// </summary>
|
||||||
|
public LectureLecturer()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the FirstName of a lecturer
|
||||||
|
/// </summary>
|
||||||
|
[XmlElement("vorname")]
|
||||||
|
public string FirstName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the LastName of a lecturer
|
||||||
|
/// </summary>
|
||||||
|
[XmlElement("name")]
|
||||||
|
public string LastName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the title of a lecturer
|
||||||
|
/// </summary>
|
||||||
|
[XmlElement("titel")]
|
||||||
|
public string Title { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the Responsibility of a lecturer
|
||||||
|
/// </summary>
|
||||||
|
[XmlAttribute("zustaendigkeit")]
|
||||||
|
public string Responsibility { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method overrides the base ToString() and create an formatted string of the lecturer
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>returns a string like: [Title] FirstName LastName [(Responsibility)]</returns>
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
string result = string.Empty;
|
||||||
|
|
||||||
|
if (!this.Title.Equals(string.Empty))
|
||||||
|
{
|
||||||
|
result += this.Title + " ";
|
||||||
|
}
|
||||||
|
|
||||||
|
result += this.FirstName + " ";
|
||||||
|
result += this.LastName + " ";
|
||||||
|
|
||||||
|
if (!this.Responsibility.Equals(string.Empty))
|
||||||
|
{
|
||||||
|
result += "(" + this.Responsibility + ") ";
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
57
CampusAppWP8/CampusAppWP8/Model/Lecture/LectureList.cs
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
//-----------------------------------------------------------------------
|
||||||
|
// <copyright file="LectureList.cs" company="BTU/IIT">
|
||||||
|
// Company copyright tag.
|
||||||
|
// </copyright>
|
||||||
|
// <author>stubbfel</author>
|
||||||
|
// <sience>10.06.2013</sience>
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
namespace CampusAppWP8.Model.Lecture
|
||||||
|
{
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Model for a List of LectureActivity
|
||||||
|
/// </summary>
|
||||||
|
[XmlRoot("lsf_auszug")]
|
||||||
|
public class LectureList
|
||||||
|
{
|
||||||
|
#region Constructor
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="LectureList" /> class.
|
||||||
|
/// </summary>
|
||||||
|
public LectureList()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Proberty
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets List of the activities
|
||||||
|
/// </summary>
|
||||||
|
[XmlArray("veranstaltungsliste")]
|
||||||
|
[XmlArrayItem("veranstaltung")]
|
||||||
|
public ObservableCollection<LectureActivity> Activities { get; set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method return a certain activity
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"> id of the activity</param>
|
||||||
|
/// <returns> the activity (FirstOrDefault)</returns>
|
||||||
|
public LectureActivity GetActivity(int id)
|
||||||
|
{
|
||||||
|
LectureActivity activity = this.Activities.Where(p => p.Id == id).FirstOrDefault();
|
||||||
|
return activity;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
98
CampusAppWP8/CampusAppWP8/Model/Lecture/LectureModule.cs
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
//-----------------------------------------------------------------------
|
||||||
|
// <copyright file="LectureModule.cs" company="BTU/IIT">
|
||||||
|
// Company copyright tag.
|
||||||
|
// </copyright>
|
||||||
|
// <author>stubbfel</author>
|
||||||
|
// <sience>10.06.2013</sience>
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
namespace CampusAppWP8.Model.Lecture
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
using CampusAppWP8.Resources;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Model for the module of an lecture
|
||||||
|
/// </summary>
|
||||||
|
public class LectureModule
|
||||||
|
{
|
||||||
|
#region Members
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Number of the module (like an id)
|
||||||
|
/// </summary>
|
||||||
|
private int number;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Url to the website of the module
|
||||||
|
/// </summary>
|
||||||
|
private Uri url;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Constructor
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="LectureModule" /> class.
|
||||||
|
/// </summary>
|
||||||
|
public LectureModule()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Property
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the title of the module
|
||||||
|
/// </summary>
|
||||||
|
[XmlElement("titel")]
|
||||||
|
public string Title { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the number of the module and create the URL
|
||||||
|
/// </summary>
|
||||||
|
[XmlElement("nummer")]
|
||||||
|
public int Number
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.number;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value != this.number)
|
||||||
|
{
|
||||||
|
this.number = value;
|
||||||
|
this.CreateUrl();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the URL of the module
|
||||||
|
/// </summary>
|
||||||
|
public Uri Url
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.url;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method create the url of the module
|
||||||
|
/// </summary>
|
||||||
|
private void CreateUrl()
|
||||||
|
{
|
||||||
|
this.url = new Uri(Constants.UrlLecture_ModulBaseAddr + this.number.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
326
CampusAppWP8/CampusAppWP8/Model/Lecture/LecturePageModel.cs
Normal file
@@ -0,0 +1,326 @@
|
|||||||
|
//-----------------------------------------------------------------------
|
||||||
|
// <copyright file="LecturePageModel.cs" company="BTU/IIT">
|
||||||
|
// Company copyright tag.
|
||||||
|
// </copyright>
|
||||||
|
// <author>stubbfel</author>
|
||||||
|
// <sience>18.06.2013</sience>
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
namespace CampusAppWP8.Model.Lecture
|
||||||
|
{
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
using CampusAppWP8.Model.Setting;
|
||||||
|
using CampusAppWP8.Model.Utility;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Model for the LecturePage
|
||||||
|
/// </summary>
|
||||||
|
[DataContract]
|
||||||
|
public class LecturePageModel
|
||||||
|
{
|
||||||
|
#region Members
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Variable for the courseIndex
|
||||||
|
/// </summary>
|
||||||
|
[DataMember]
|
||||||
|
public int selectCourseIndex;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Variable for the degreeIndex
|
||||||
|
/// </summary>
|
||||||
|
[DataMember]
|
||||||
|
public int selectDegreeIndex;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Variable for the semesterIndex
|
||||||
|
/// </summary>
|
||||||
|
[DataMember]
|
||||||
|
public int selectSemesterIndex;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Variable for the fromIndex
|
||||||
|
/// </summary>
|
||||||
|
[DataMember]
|
||||||
|
public int selectFromIndex;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Variable for the toIndex
|
||||||
|
/// </summary>
|
||||||
|
[DataMember]
|
||||||
|
public int selectToIndex;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// List for the courses of the BTU
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// need to be extend to full list
|
||||||
|
/// </remarks>
|
||||||
|
private ListPickerItemListModel courseList;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// List of the degrees
|
||||||
|
/// </summary>
|
||||||
|
private ListPickerItemListModel degreeList;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// List of the semester
|
||||||
|
/// </summary>
|
||||||
|
private ListPickerItemListModel semesterList;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// List for the number of semester (from)
|
||||||
|
/// </summary>
|
||||||
|
private ListPickerItemListModel fromNumberList;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// List for the number of semester (to)
|
||||||
|
/// </summary>
|
||||||
|
private ListPickerItemListModel toNumberList;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Constructor
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="LecturePageModel" /> class.
|
||||||
|
/// </summary>
|
||||||
|
public LecturePageModel()
|
||||||
|
{
|
||||||
|
this.courseList = new CourseListPickerItemListModel();
|
||||||
|
this.degreeList = new DegreeListPickerItemListModel();
|
||||||
|
this.semesterList = new SemesterListPickerItemListModel();
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Proberty
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the selected course index
|
||||||
|
/// </summary>
|
||||||
|
public int SelectCourseIndex
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.selectCourseIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value != this.selectCourseIndex && this.courseList != null && value < this.courseList.List.Count)
|
||||||
|
{
|
||||||
|
this.selectCourseIndex = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the selected degree index
|
||||||
|
/// </summary>
|
||||||
|
public int SelectDegreeIndex
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.selectDegreeIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value != this.selectDegreeIndex && this.degreeList != null && value < this.degreeList.List.Count)
|
||||||
|
{
|
||||||
|
this.selectDegreeIndex = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the selected semester-index
|
||||||
|
/// </summary>
|
||||||
|
public int SelectSemesterIndex
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.selectSemesterIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value != this.selectSemesterIndex && this.semesterList != null && value < this.semesterList.List.Count)
|
||||||
|
{
|
||||||
|
this.selectSemesterIndex = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the selected from-index
|
||||||
|
/// </summary>
|
||||||
|
public int SelectFromIndex
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.selectFromIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value != this.selectFromIndex && this.fromNumberList != null && value < this.fromNumberList.List.Count)
|
||||||
|
{
|
||||||
|
this.selectFromIndex = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the selected to-index
|
||||||
|
/// </summary>
|
||||||
|
public int SelectToIndex
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.selectToIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value != this.selectToIndex && this.toNumberList != null && value < this.toNumberList.List.Count)
|
||||||
|
{
|
||||||
|
this.selectToIndex = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets List for the courses of the BTU
|
||||||
|
/// </summary>
|
||||||
|
public ListPickerItemListModel CourseList
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.courseList;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets List of the degrees
|
||||||
|
/// </summary>
|
||||||
|
public ListPickerItemListModel DegreeList
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.degreeList;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets List of the semester
|
||||||
|
/// </summary>
|
||||||
|
public ListPickerItemListModel SemesterList
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.semesterList;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets List for the number of semester
|
||||||
|
/// </summary>
|
||||||
|
public ListPickerItemListModel FromNumberList
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.fromNumberList;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the NumberList
|
||||||
|
/// </summary>
|
||||||
|
public ListPickerItemListModel ToNumberList
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.toNumberList;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Methods
|
||||||
|
|
||||||
|
#region public
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Load all ListPickerLists
|
||||||
|
/// </summary>
|
||||||
|
public void LoadLists()
|
||||||
|
{
|
||||||
|
this.LoadFromNumberList();
|
||||||
|
this.LoadToNumberList();
|
||||||
|
UserProfilModel userModel = Settings.UserProfil.Model;
|
||||||
|
this.selectCourseIndex = this.courseList.GetIndexOrDefault(((int)userModel.Course).ToString().PadLeft(3, '0'));
|
||||||
|
this.selectDegreeIndex = this.degreeList.GetIndexOrDefault(((int)userModel.Degree).ToString());
|
||||||
|
this.selectSemesterIndex = this.semesterList.GetIndexOrDefault(((int)userModel.Semester).ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region private
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Load the NumberList
|
||||||
|
/// </summary>
|
||||||
|
public void LoadFromNumberList()
|
||||||
|
{
|
||||||
|
string selectValue = null;
|
||||||
|
if (this.fromNumberList != null && this.fromNumberList.List.Count > 0)
|
||||||
|
{
|
||||||
|
selectValue = this.fromNumberList.List[this.SelectFromIndex].Value;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.fromNumberList = this.CreateNumberList(1, 10);
|
||||||
|
this.SelectFromIndex = this.fromNumberList.GetIndexOrDefault(selectValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Load the NumberList
|
||||||
|
/// </summary>
|
||||||
|
public void LoadToNumberList()
|
||||||
|
{
|
||||||
|
string selectValue = null;
|
||||||
|
if (this.toNumberList != null && this.toNumberList.List.Count > 0)
|
||||||
|
{
|
||||||
|
selectValue = this.toNumberList.List[this.SelectToIndex].Value;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.toNumberList = this.CreateNumberList(this.SelectFromIndex + 1, 10);
|
||||||
|
this.SelectToIndex = this.toNumberList.GetIndexOrDefault(selectValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method create a NumberList
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="startvalue">startValue of the list</param>
|
||||||
|
/// <param name="endvalue">endValue of the list</param>
|
||||||
|
/// <returns>return list</returns>
|
||||||
|
private ListPickerItemListModel CreateNumberList(int startvalue, int endvalue)
|
||||||
|
{
|
||||||
|
ListPickerItemListModel list = new ListPickerItemListModel();
|
||||||
|
string degree = this.DegreeList.List[this.SelectDegreeIndex].Value;
|
||||||
|
|
||||||
|
for (int i = startvalue; i <= endvalue; i++)
|
||||||
|
{
|
||||||
|
if ((i > 4 && "88".Equals(degree)) || (i > 6 && "82".Equals(degree)))
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
list.AddItem(i.ToString(), i.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
64
CampusAppWP8/CampusAppWP8/Model/Link/LinkListModel.cs
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// <copyright file="LinkListModel.cs" company="BTU/IIT">
|
||||||
|
// Company copyright tag.
|
||||||
|
// </copyright>
|
||||||
|
// <author>stubbfel</author>
|
||||||
|
// <sience>02.07.2013</sience>
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace CampusAppWP8.Model.Link
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Model for a list of links.
|
||||||
|
/// </summary>
|
||||||
|
[XmlRoot("root")]
|
||||||
|
public class LinkListModel
|
||||||
|
{
|
||||||
|
#region Member
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Time when the model was created.
|
||||||
|
/// </summary>
|
||||||
|
private readonly DateTime createTime;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Constructor
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="LinkListModel" /> class.
|
||||||
|
/// </summary>
|
||||||
|
public LinkListModel()
|
||||||
|
{
|
||||||
|
this.createTime = DateTime.Now;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Property
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets feed information item list.
|
||||||
|
/// </summary>
|
||||||
|
[XmlArray("data")]
|
||||||
|
[XmlArrayItem("link")]
|
||||||
|
public ObservableCollection<LinkModel> Links { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the creation time of the model.
|
||||||
|
/// </summary>
|
||||||
|
public DateTime CreateTime
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.createTime;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
173
CampusAppWP8/CampusAppWP8/Model/Link/LinkModel.cs
Normal file
@@ -0,0 +1,173 @@
|
|||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// <copyright file="LinkModel.cs" company="BTU/IIT">
|
||||||
|
// Company copyright tag.
|
||||||
|
// </copyright>
|
||||||
|
// <author>stubbfel</author>
|
||||||
|
// <sience>02.07.2013</sience>
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace CampusAppWP8.Model.Link
|
||||||
|
{
|
||||||
|
using System.Globalization;
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Model for menu
|
||||||
|
/// </summary>
|
||||||
|
public class LinkModel
|
||||||
|
{
|
||||||
|
#region Member
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// German version of the link title.
|
||||||
|
/// </summary>
|
||||||
|
private string titleDE;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// English version of the link title.
|
||||||
|
/// </summary>
|
||||||
|
private string titleEN;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// German version of the link.
|
||||||
|
/// </summary>
|
||||||
|
private string linkDE;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// English version of the link.
|
||||||
|
/// </summary>
|
||||||
|
private string linkEN;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Constructor
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="LinkModel" /> class.
|
||||||
|
/// </summary>
|
||||||
|
public LinkModel()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Property
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the german title of the link.
|
||||||
|
/// </summary>
|
||||||
|
[XmlAttribute("title_de")]
|
||||||
|
public string Title_DE
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.titleDE;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value != this.titleDE)
|
||||||
|
{
|
||||||
|
this.titleDE = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the english title of the link.
|
||||||
|
/// </summary>
|
||||||
|
[XmlAttribute("title_en")]
|
||||||
|
public string Title_EN
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.titleEN;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
this.titleEN = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the german link.
|
||||||
|
/// </summary>
|
||||||
|
[XmlAttribute("link_de")]
|
||||||
|
public string Link_DE
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.linkDE;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value != this.linkDE)
|
||||||
|
{
|
||||||
|
this.linkDE = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the english link.
|
||||||
|
/// </summary>
|
||||||
|
[XmlAttribute("link_en")]
|
||||||
|
public string Link_EN
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.linkEN;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value != this.linkEN)
|
||||||
|
{
|
||||||
|
this.linkEN = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the localized title. If the phone is set to german language,
|
||||||
|
/// the german title will be returned otherwise the english title.
|
||||||
|
/// </summary>
|
||||||
|
public string Title
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (CultureInfo.CurrentUICulture.Name.StartsWith("de"))
|
||||||
|
{
|
||||||
|
return this.titleDE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return this.titleEN;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the localized link. if the phone is set to german language,
|
||||||
|
/// the german comment will be returned otherwise the english link.
|
||||||
|
/// </summary>
|
||||||
|
public string Link
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (CultureInfo.CurrentUICulture.Name.StartsWith("de"))
|
||||||
|
{
|
||||||
|
return this.Link_DE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return this.Link_EN;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
504
CampusAppWP8/CampusAppWP8/Model/MainModel.cs
Normal file
@@ -0,0 +1,504 @@
|
|||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// <copyright file="MainModel.cs" company="BTU/IIT">
|
||||||
|
// Company copyright tag.
|
||||||
|
// </copyright>
|
||||||
|
// <author>fiedlchr</author>
|
||||||
|
// <sience>05.07.2013</sience>
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
namespace CampusAppWP8
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Net;
|
||||||
|
using System.Text;
|
||||||
|
using CampusAppWP8.Model.Utility;
|
||||||
|
using CampusAppWP8.Utility;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Base model io handling class.
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="T">model type</typeparam>
|
||||||
|
public abstract class MainModel<T> : IDisposable
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Model io type.
|
||||||
|
/// </summary>
|
||||||
|
private ModelType modelType;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Model object.
|
||||||
|
/// </summary>
|
||||||
|
private T model = default(T);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// File object.
|
||||||
|
/// </summary>
|
||||||
|
private CampusAppWP8.Utility.File file = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Web object.
|
||||||
|
/// </summary>
|
||||||
|
private HttpRequest api = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Filename of saved data.
|
||||||
|
/// </summary>
|
||||||
|
private string fileName = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Url of the feed data.
|
||||||
|
/// </summary>
|
||||||
|
private Uri httpApiUri = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Parameterized uri of the feed.
|
||||||
|
/// </summary>
|
||||||
|
private Uri paramizedUri = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="MainModel{T}" /> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="modelType">Model IO type</param>
|
||||||
|
/// <param name="fileName">name of the file</param>
|
||||||
|
/// <param name="url">url of the feed</param>
|
||||||
|
public MainModel(ModelType modelType, string fileName, string url)
|
||||||
|
{
|
||||||
|
this.Init(modelType, fileName, url);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="MainModel{T}" /> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="modelType">Model IO type</param>
|
||||||
|
/// <param name="sourceName">name of the file or the url of the feed</param>
|
||||||
|
public MainModel(ModelType modelType, string sourceName)
|
||||||
|
{
|
||||||
|
if (modelType == ModelType.File)
|
||||||
|
{
|
||||||
|
this.Init(modelType, sourceName, string.Empty);
|
||||||
|
}
|
||||||
|
else if (modelType == ModelType.Feed)
|
||||||
|
{
|
||||||
|
this.Init(modelType, string.Empty, sourceName);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new NotSupportedException("Wrong constructor was called for Feed and File support.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Finalizes an instance of the <see cref="MainModel{T}" /> class.
|
||||||
|
/// </summary>
|
||||||
|
~MainModel()
|
||||||
|
{
|
||||||
|
this.SaveData();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Delegate of the OnLoading callback function.
|
||||||
|
/// </summary>
|
||||||
|
public delegate void OnLoading();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Delegate of the OnLoaded callback function.
|
||||||
|
/// </summary>
|
||||||
|
public delegate void OnLoaded();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Delegate of the OnSaving callback function.
|
||||||
|
/// </summary>
|
||||||
|
public delegate void OnSaving();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Delegate of the OnSaved callback function.
|
||||||
|
/// </summary>
|
||||||
|
public delegate void OnSaved();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Delegate of the IsModelUpToDate callback function.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="model">data model</param>
|
||||||
|
/// <returns>true, model is up to date</returns>
|
||||||
|
public delegate bool IsModelUpToDate(T model);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Delegate of the IsFileUpToDate callback function.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="model">data model</param>
|
||||||
|
/// <param name="fileInfo">info of the file</param>
|
||||||
|
/// <returns>true, is file is up to date</returns>
|
||||||
|
public delegate bool IsFileUpToDate(T model, FileInfo fileInfo);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Callback pointer, called before loading.
|
||||||
|
/// </summary>
|
||||||
|
public event OnLoading onLoading = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Callback pointer, called after loading.
|
||||||
|
/// </summary>
|
||||||
|
public event OnLoaded onLoaded = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Callback pointer, called before saving.
|
||||||
|
/// </summary>
|
||||||
|
public event OnSaving onSaving = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Callback pointer, called after saving.
|
||||||
|
/// </summary>
|
||||||
|
public event OnSaved onSaved = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Callback pointer, for checking if file is up to date at loading.
|
||||||
|
/// </summary>
|
||||||
|
public event IsFileUpToDate isFileUpToDateOnLoad = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Callback pointer, for checking if file is up to date at saving.
|
||||||
|
/// </summary>
|
||||||
|
public event IsFileUpToDate isFileUpToDateOnSave = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Callback pointer, for checking if model is up to date at loading.
|
||||||
|
/// </summary>
|
||||||
|
public event IsModelUpToDate isModelUpToDateOnLoad = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Callback pointer, for checking if model is up to date at saving.
|
||||||
|
/// (currently unused)
|
||||||
|
/// </summary>
|
||||||
|
public event IsModelUpToDate isModelUpToDateOnSave = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Specifies the I/O type of the model.
|
||||||
|
/// </summary>
|
||||||
|
public enum ModelType
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Invalid/unset state.
|
||||||
|
/// </summary>
|
||||||
|
INVALID = 0,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// File only (01).
|
||||||
|
/// </summary>
|
||||||
|
File = 1,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Feed only (10).
|
||||||
|
/// </summary>
|
||||||
|
Feed = 2,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// File and feed (11).
|
||||||
|
/// </summary>
|
||||||
|
FileAndFeed = 3
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the Model.
|
||||||
|
/// </summary>
|
||||||
|
public T Model
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.model;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
this.model = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Called before finalizing. Can maybe be removed.
|
||||||
|
/// </summary>
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
this.SaveData();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Forces a update from web.
|
||||||
|
/// </summary>
|
||||||
|
public void ForceWebUpdate()
|
||||||
|
{
|
||||||
|
if (this.api != null)
|
||||||
|
{
|
||||||
|
if (this.onLoading != null)
|
||||||
|
{
|
||||||
|
this.onLoading();
|
||||||
|
}
|
||||||
|
|
||||||
|
this.api.HttpGet(this.httpApiUri, this.OnLoadDataComplete);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Load the data if necessary, from web or from file, regarding if
|
||||||
|
/// the file data is up to date.
|
||||||
|
/// </summary>
|
||||||
|
public void LoadData()
|
||||||
|
{
|
||||||
|
bool loadFromFile = true;
|
||||||
|
|
||||||
|
if (this.onLoading != null)
|
||||||
|
{
|
||||||
|
this.onLoading();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (((this.isModelUpToDateOnLoad == null)
|
||||||
|
|| (this.isModelUpToDateOnLoad(this.model) == false))
|
||||||
|
&& ((this.file != null) || this.api != null))
|
||||||
|
{
|
||||||
|
if (this.file != null)
|
||||||
|
{
|
||||||
|
if ((this.file.Exist() == false)
|
||||||
|
|| (this.file.GetFileInfo().Length == 0))
|
||||||
|
{
|
||||||
|
loadFromFile = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (((this.isFileUpToDateOnLoad != null) && (this.isFileUpToDateOnLoad(this.model, this.file.GetFileInfo()) == false))
|
||||||
|
|| (this.isFileUpToDateOnLoad == null))
|
||||||
|
{
|
||||||
|
loadFromFile = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
loadFromFile = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.api == null)
|
||||||
|
{
|
||||||
|
loadFromFile = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (loadFromFile == false)
|
||||||
|
{
|
||||||
|
if (this.paramizedUri != null)
|
||||||
|
{
|
||||||
|
this.api.HttpGet(this.paramizedUri, this.OnLoadDataComplete);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.api.HttpGet(this.httpApiUri, this.OnLoadDataComplete);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string data = this.file.ReadFile();
|
||||||
|
|
||||||
|
if (data != null && !data.Equals(string.Empty))
|
||||||
|
{
|
||||||
|
this.DeserializeModel(Encoding.UTF8.GetBytes(data));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (loadFromFile == true)
|
||||||
|
{
|
||||||
|
if (this.onLoaded != null)
|
||||||
|
{
|
||||||
|
this.onLoaded();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Save the model data if necessary.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="force">force saving. DEFAULT: false</param>
|
||||||
|
public void SaveData(bool force = false)
|
||||||
|
{
|
||||||
|
if ((this.file != null)
|
||||||
|
&& ((this.isFileUpToDateOnSave == null)
|
||||||
|
|| (this.isFileUpToDateOnSave(this.model, this.file.GetFileInfo()) == false)
|
||||||
|
|| (force == true)))
|
||||||
|
{
|
||||||
|
if (this.onSaving != null)
|
||||||
|
{
|
||||||
|
this.onSaving();
|
||||||
|
}
|
||||||
|
|
||||||
|
byte[] data = this.SerializeModel();
|
||||||
|
string test = Encoding.UTF8.GetString(data, 0, data.Length);
|
||||||
|
this.file.WriteFile(data);
|
||||||
|
|
||||||
|
if (this.onSaved != null)
|
||||||
|
{
|
||||||
|
this.onSaved();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Return the model io type.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>model io type</returns>
|
||||||
|
public ModelType GetModelType()
|
||||||
|
{
|
||||||
|
return this.modelType;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Return the model.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>model object</returns>
|
||||||
|
public T GetModel()
|
||||||
|
{
|
||||||
|
return this.model;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Create the parameterized uri.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="parameters">uri parameter list</param>
|
||||||
|
public void SetUriParams(List<UrlParamModel> parameters)
|
||||||
|
{
|
||||||
|
if (this.api != null)
|
||||||
|
{
|
||||||
|
this.paramizedUri = this.api.CreateGetUrl(parameters);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clear the parameterized uri.
|
||||||
|
/// </summary>
|
||||||
|
public void ClearUriParams()
|
||||||
|
{
|
||||||
|
this.paramizedUri = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Abstract declaration of the model deserialize function.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="modelData">model data as byte array</param>
|
||||||
|
/// <returns>true, is succeeded</returns>
|
||||||
|
protected abstract bool DeserializeModel(byte[] modelData);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Abstract declaration of the model serialize function.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>model data as byte array</returns>
|
||||||
|
protected abstract byte[] SerializeModel();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Check if the model io type is file.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>true, if the model io type has file.</returns>
|
||||||
|
protected bool IsFile()
|
||||||
|
{
|
||||||
|
bool retValue = false;
|
||||||
|
|
||||||
|
if ((this.modelType & ModelType.File) != 0)
|
||||||
|
{
|
||||||
|
retValue = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return retValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Check if the model io type is feed.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>true if the model io type has feed.</returns>
|
||||||
|
protected bool IsHttpApi()
|
||||||
|
{
|
||||||
|
bool retValue = false;
|
||||||
|
|
||||||
|
if ((this.modelType & ModelType.Feed) != 0)
|
||||||
|
{
|
||||||
|
retValue = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return retValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initialize the class. Is called by the constructors.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="modelType">model IO type</param>
|
||||||
|
/// <param name="fileName">name of the data file</param>
|
||||||
|
/// <param name="url">url of the feed data</param>
|
||||||
|
private void Init(ModelType modelType, string fileName, string url)
|
||||||
|
{
|
||||||
|
this.modelType = modelType;
|
||||||
|
|
||||||
|
if ((url != null) && (url.Equals(string.Empty) == false))
|
||||||
|
{
|
||||||
|
this.httpApiUri = new Uri(url, UriKind.Absolute);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.fileName = fileName;
|
||||||
|
|
||||||
|
if ((this.IsFile() == true)
|
||||||
|
&& (fileName.Equals(string.Empty) == false))
|
||||||
|
{
|
||||||
|
this.InitFile(CampusAppWP8.Utility.File.IOTypeRead.ReadSync, CampusAppWP8.Utility.File.IOTypeWrite.WriteAsync);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((this.IsHttpApi() == true)
|
||||||
|
&& (url.Equals(string.Empty) == false))
|
||||||
|
{
|
||||||
|
this.InitHttpApi();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes the file object.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="readType">read io type (Default: sync)</param>
|
||||||
|
/// <param name="writeType">write io type (Default: async)</param>
|
||||||
|
private void InitFile(CampusAppWP8.Utility.File.IOTypeRead readType = CampusAppWP8.Utility.File.IOTypeRead.ReadSync, CampusAppWP8.Utility.File.IOTypeWrite writeType = CampusAppWP8.Utility.File.IOTypeWrite.WriteAsync)
|
||||||
|
{
|
||||||
|
if ((this.IsFile() == true)
|
||||||
|
&& (this.file == null))
|
||||||
|
{
|
||||||
|
this.file = new CampusAppWP8.Utility.File(this.fileName, readType, writeType);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes the web object.
|
||||||
|
/// </summary>
|
||||||
|
private void InitHttpApi()
|
||||||
|
{
|
||||||
|
if ((this.IsHttpApi() == true)
|
||||||
|
&& (this.api == null))
|
||||||
|
{
|
||||||
|
this.api = new HttpRequest(this.httpApiUri);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Is called after the loading from web is complete.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender">sending object</param>
|
||||||
|
/// <param name="e">event args</param>
|
||||||
|
private void OnLoadDataComplete(object sender, DownloadStringCompletedEventArgs e)
|
||||||
|
{
|
||||||
|
Exception downloadError = e.Error;
|
||||||
|
if (downloadError != null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
string downloadResult = e.Result;
|
||||||
|
if (downloadResult != null && !downloadResult.Equals(string.Empty))
|
||||||
|
{
|
||||||
|
this.DeserializeModel(Encoding.UTF8.GetBytes(downloadResult));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.onLoaded != null)
|
||||||
|
{
|
||||||
|
this.onLoaded();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
268
CampusAppWP8/CampusAppWP8/Model/Mensa/MealModel.cs
Normal file
@@ -0,0 +1,268 @@
|
|||||||
|
//-----------------------------------------------------------------------
|
||||||
|
// <copyright file="MealModel.cs" company="BTU/IIT">
|
||||||
|
// Company copyright tag.
|
||||||
|
// </copyright>
|
||||||
|
// <author>stubbfel</author>
|
||||||
|
// <sience>06.08.2013</sience>
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
namespace CampusAppWP8.Model.Mensa
|
||||||
|
{
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
using CampusAppWP8.Resources;
|
||||||
|
using CampusAppWP8.Utility;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Model for a meal
|
||||||
|
/// </summary>
|
||||||
|
public class MealModel
|
||||||
|
{
|
||||||
|
#region Members
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Constant for the vegetarian icon
|
||||||
|
/// </summary>
|
||||||
|
private const string MealIconNameVegetarian = "CARROTTE";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Constant for the free icon
|
||||||
|
/// </summary>
|
||||||
|
private const string MealIconNameFree = "FREI";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Constant for the pig icon
|
||||||
|
/// </summary>
|
||||||
|
private const string MealIconNamePig = "SCHWEIN";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Constant for the cow icon
|
||||||
|
/// </summary>
|
||||||
|
private const string MealIconNameCow = "RIND";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Constant for the fowl icon
|
||||||
|
/// </summary>
|
||||||
|
private const string MealIconNameFowl = "GEFL";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Constant for the cow-pig icon
|
||||||
|
/// </summary>
|
||||||
|
private const string MealIconNameCowPig = "RINDSCHWEIN";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Constant for the fish icon
|
||||||
|
/// </summary>
|
||||||
|
private const string MealIconNameFish = "FISCH";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Constant for the wild icon
|
||||||
|
/// </summary>
|
||||||
|
private const string MealIconNameWild = "WILD";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Constant for the lamb icon
|
||||||
|
/// </summary>
|
||||||
|
private const string MealIconNameLamb = "LAMM";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Variable for the id of the meal
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// ValueRange : 0 - 7
|
||||||
|
/// </remarks>
|
||||||
|
private int mealId;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Name of the meal
|
||||||
|
/// </summary>
|
||||||
|
private string mealName;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Name of the icon
|
||||||
|
/// </summary>
|
||||||
|
private string iconName;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Url of the icon
|
||||||
|
/// </summary>
|
||||||
|
private string iconUrl;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Description of the meal
|
||||||
|
/// </summary>
|
||||||
|
private string mealDesc;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Proberty
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the mealId
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// ValueRange : 0 - 7
|
||||||
|
/// </remarks>
|
||||||
|
[XmlAttribute("id")]
|
||||||
|
public int MealId
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.mealId;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value > -1 && value < 8)
|
||||||
|
{
|
||||||
|
this.mealId = value;
|
||||||
|
this.CreateMealName();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the mealName
|
||||||
|
/// </summary>
|
||||||
|
public string MealName
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.mealName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the iconName
|
||||||
|
/// </summary>
|
||||||
|
[XmlAttribute("icon")]
|
||||||
|
public string IconName
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.iconName;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value != this.iconName)
|
||||||
|
{
|
||||||
|
this.iconName = value;
|
||||||
|
this.CreateIconUrl();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the iconUrl
|
||||||
|
/// </summary>
|
||||||
|
public string IconUrl
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.iconUrl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the mealDescription
|
||||||
|
/// </summary>
|
||||||
|
[XmlAttribute("desc")]
|
||||||
|
public string MealDesc
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.mealDesc;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value != this.mealDesc)
|
||||||
|
{
|
||||||
|
this.mealDesc = StringManager.StripHTML(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method create depends of the mealId the mealName
|
||||||
|
/// </summary>
|
||||||
|
private void CreateMealName()
|
||||||
|
{
|
||||||
|
switch (this.mealId)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
this.mealName = AppResources.MensaApp_Soup;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
this.mealName = AppResources.MensaApp_Dinner1;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
this.mealName = AppResources.MensaApp_Dinner2;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
this.mealName = AppResources.MensaApp_Dinner3;
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
this.mealName = AppResources.MensaApp_Dinner4;
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
this.mealName = AppResources.MensaApp_Dinner5;
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
this.mealName = AppResources.MensaApp_Bio;
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
this.mealName = AppResources.MensaApp_Action;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
this.mealName = string.Empty;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method create depends of the iconUrl the iconName
|
||||||
|
/// </summary>
|
||||||
|
private void CreateIconUrl()
|
||||||
|
{
|
||||||
|
switch (this.iconName)
|
||||||
|
{
|
||||||
|
case MealModel.MealIconNameVegetarian:
|
||||||
|
this.iconUrl = Icons.Info;
|
||||||
|
break;
|
||||||
|
case MealModel.MealIconNameFree:
|
||||||
|
this.iconUrl = Icons.Info;
|
||||||
|
break;
|
||||||
|
case MealModel.MealIconNameCowPig:
|
||||||
|
this.iconUrl = Icons.Info;
|
||||||
|
break;
|
||||||
|
case MealModel.MealIconNameFish:
|
||||||
|
this.iconUrl = Icons.Info;
|
||||||
|
break;
|
||||||
|
case MealModel.MealIconNameFowl:
|
||||||
|
this.iconUrl = Icons.Info;
|
||||||
|
break;
|
||||||
|
case MealModel.MealIconNameLamb:
|
||||||
|
this.iconUrl = Icons.Info;
|
||||||
|
break;
|
||||||
|
case MealModel.MealIconNamePig:
|
||||||
|
this.iconUrl = Icons.Info;
|
||||||
|
break;
|
||||||
|
case MealModel.MealIconNameWild:
|
||||||
|
this.iconUrl = Icons.Info;
|
||||||
|
break;
|
||||||
|
case MealModel.MealIconNameCow:
|
||||||
|
this.iconUrl = Icons.Info;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
this.iconUrl = string.Empty;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
103
CampusAppWP8/CampusAppWP8/Model/Mensa/MenuModel.cs
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
//-----------------------------------------------------------------------
|
||||||
|
// <copyright file="MenuModel.cs" company="BTU/IIT">
|
||||||
|
// Company copyright tag.
|
||||||
|
// </copyright>
|
||||||
|
// <author>stubbfel</author>
|
||||||
|
// <sience>04.05.2013</sience>
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
namespace CampusAppWP8.Model.Mensa
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
using CampusAppWP8.Resources;
|
||||||
|
using CampusAppWP8.Utility;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Globalization;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Model for menu
|
||||||
|
/// </summary>
|
||||||
|
public class MenuModel
|
||||||
|
{
|
||||||
|
#region Member
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Name of the day
|
||||||
|
/// </summary>
|
||||||
|
private string dayName;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// DateTime of the day
|
||||||
|
/// </summary>
|
||||||
|
private string date;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// DateTime of the monday
|
||||||
|
/// </summary>
|
||||||
|
private DateTime monday;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Constructor
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="MenuModel" /> class.
|
||||||
|
/// </summary>
|
||||||
|
public MenuModel()
|
||||||
|
{
|
||||||
|
this.monday = MenuWeekModel.CalcFirstWeekDay();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Property
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the menus for the week
|
||||||
|
/// </summary>
|
||||||
|
[XmlElement("Meal")]
|
||||||
|
public ObservableCollection<MealModel> Meals { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the WeekDay
|
||||||
|
/// </summary>
|
||||||
|
[XmlAttribute("day")]
|
||||||
|
public string Day
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.dayName;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value != this.dayName)
|
||||||
|
{
|
||||||
|
this.dayName = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets of Date
|
||||||
|
/// </summary>
|
||||||
|
[XmlAttribute("date")]
|
||||||
|
public string Date
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.date.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value != this.date)
|
||||||
|
{
|
||||||
|
this.date = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -17,11 +17,16 @@ namespace CampusAppWP8.Model.Mensa
|
|||||||
[XmlRoot("root")]
|
[XmlRoot("root")]
|
||||||
public class MenuWeekModel
|
public class MenuWeekModel
|
||||||
{
|
{
|
||||||
|
#region Members
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Time when the model was created
|
/// Time when the model was created
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private readonly DateTime createTime;
|
private readonly DateTime createTime;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Constructor
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="MenuWeekModel" /> class.
|
/// Initializes a new instance of the <see cref="MenuWeekModel" /> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -30,22 +35,48 @@ namespace CampusAppWP8.Model.Mensa
|
|||||||
this.createTime = DateTime.Now;
|
this.createTime = DateTime.Now;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Proberty
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the menus for the week
|
/// Gets or sets the menus for the week
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[XmlArray("BTU")]
|
[XmlArray("Mealplan")]
|
||||||
[XmlArrayItem("Tagesmenu")]
|
[XmlArrayItem("Menu")]
|
||||||
public ObservableCollection<MenuModel> Menus { get; set; }
|
public ObservableCollection<MenuModel> Menus { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the creation time of the model
|
/// Gets the creation time of the model
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DateTime CreateTime
|
public DateTime CreateTime
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return this.createTime;
|
return this.createTime;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method calculate this day of the week, which its gets new menus
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>Date of NewMenuWeekDay</returns>
|
||||||
|
public static DateTime CalcFirstWeekDay()
|
||||||
|
{
|
||||||
|
DateTime now = DateTime.Now;
|
||||||
|
while (now.DayOfWeek != DayOfWeek.Monday)
|
||||||
|
{
|
||||||
|
now = now.Subtract(new TimeSpan(1, 0, 0, 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
DateTime monday = new DateTime(now.Year, now.Month, now.Day);
|
||||||
|
return monday;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,581 @@
|
|||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// <copyright file="OpeninghoursInstitutionModel.cs" company="BTU/IIT">
|
||||||
|
// Company copyright tag.
|
||||||
|
// </copyright>
|
||||||
|
// <author>fiedlchr</author>
|
||||||
|
// <sience>24.06.2013</sience>
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace CampusAppWP8.Model.Openinghours
|
||||||
|
{
|
||||||
|
using System.Globalization;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Model for menu
|
||||||
|
/// </summary>
|
||||||
|
public class OpeninghoursInstitutionModel
|
||||||
|
{
|
||||||
|
#region Member
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// German version of the institution title.
|
||||||
|
/// </summary>
|
||||||
|
private string titleDE = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// English version of the institution title.
|
||||||
|
/// </summary>
|
||||||
|
private string titleEN = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Opening hours on monday.
|
||||||
|
/// </summary>
|
||||||
|
private string dayMonday = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Opening hours on tuesday.
|
||||||
|
/// </summary>
|
||||||
|
private string dayTuesday = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Opening hours on wednesday.
|
||||||
|
/// </summary>
|
||||||
|
private string dayWednesday = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Opening hours on thursday.
|
||||||
|
/// </summary>
|
||||||
|
private string dayThursday = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Opening hours on friday.
|
||||||
|
/// </summary>
|
||||||
|
private string dayFriday = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Opening hours on saturday.
|
||||||
|
/// </summary>
|
||||||
|
private string daySaturday = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Opening hours on sunday.
|
||||||
|
/// </summary>
|
||||||
|
private string daySunday = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Email address of the institution.
|
||||||
|
/// </summary>
|
||||||
|
private string infoEmail = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Phone number of the institution.
|
||||||
|
/// </summary>
|
||||||
|
private string infoPhone = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Building name where the institution is located.
|
||||||
|
/// </summary>
|
||||||
|
private string infoBuilding = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Room where the institution is located.
|
||||||
|
/// </summary>
|
||||||
|
private string infoRoom = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// German version of the comment.
|
||||||
|
/// </summary>
|
||||||
|
private string commentDE = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// English version of the comment.
|
||||||
|
/// </summary>
|
||||||
|
private string commentEN = string.Empty;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Constructor
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="OpeninghoursInstitutionModel" /> class.
|
||||||
|
/// </summary>
|
||||||
|
public OpeninghoursInstitutionModel()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Property
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the german title of the institution.
|
||||||
|
/// </summary>
|
||||||
|
[XmlAttribute("title_de")]
|
||||||
|
public string Title_DE
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.titleDE;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
this.titleDE = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the english title of the institution.
|
||||||
|
/// </summary>
|
||||||
|
[XmlAttribute("title_en")]
|
||||||
|
public string Title_EN
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.titleEN;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
this.titleEN = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the open hours on monday.
|
||||||
|
/// </summary>
|
||||||
|
[XmlAttribute("monday")]
|
||||||
|
public string Monday
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.dayMonday;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
this.dayMonday = this.FixOpeninghoursString(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the open hours on tuesday.
|
||||||
|
/// </summary>
|
||||||
|
[XmlAttribute("tuesday")]
|
||||||
|
public string Tuesday
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.dayTuesday;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
this.dayTuesday = this.FixOpeninghoursString(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the open hours on wednesday.
|
||||||
|
/// </summary>
|
||||||
|
[XmlAttribute("wednesday")]
|
||||||
|
public string Wednesday
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.dayWednesday;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
this.dayWednesday = this.FixOpeninghoursString(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the open hours on thursday.
|
||||||
|
/// </summary>
|
||||||
|
[XmlAttribute("thursday")]
|
||||||
|
public string Thursday
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.dayThursday;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
this.dayThursday = this.FixOpeninghoursString(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the open hours on friday.
|
||||||
|
/// </summary>
|
||||||
|
[XmlAttribute("friday")]
|
||||||
|
public string Friday
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.dayFriday;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
this.dayFriday = this.FixOpeninghoursString(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the open hours on saturday.
|
||||||
|
/// </summary>
|
||||||
|
[XmlAttribute("saturday")]
|
||||||
|
public string Saturday
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.daySaturday;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
this.daySaturday = this.FixOpeninghoursString(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the open hours on sunday.
|
||||||
|
/// </summary>
|
||||||
|
[XmlAttribute("sunday")]
|
||||||
|
public string Sunday
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.daySunday;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
this.daySunday = this.FixOpeninghoursString(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the email address of the institution.
|
||||||
|
/// </summary>
|
||||||
|
[XmlAttribute("email")]
|
||||||
|
public string EMail
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.infoEmail;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
this.infoEmail = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the phone number of the institution.
|
||||||
|
/// </summary>
|
||||||
|
[XmlAttribute("phone")]
|
||||||
|
public string Phone
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.infoPhone;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
this.infoPhone = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the building where the institution is located.
|
||||||
|
/// </summary>
|
||||||
|
[XmlAttribute("location_building")]
|
||||||
|
public string Building
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.infoBuilding;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
this.infoBuilding = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the room where the institution is located.
|
||||||
|
/// </summary>
|
||||||
|
[XmlAttribute("location_room")]
|
||||||
|
public string Room
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.infoRoom;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
this.infoRoom = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the german comment.
|
||||||
|
/// </summary>
|
||||||
|
[XmlAttribute("comment_de")]
|
||||||
|
public string Comment_DE
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.commentDE;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
this.commentDE = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the english comment.
|
||||||
|
/// </summary>
|
||||||
|
[XmlAttribute("comment_en")]
|
||||||
|
public string Comment_EN
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.commentEN;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
this.commentEN = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the localized title. If the phone is set to german language,
|
||||||
|
/// the german title will be returned otherwise the english title.
|
||||||
|
/// </summary>
|
||||||
|
public string Title
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (CultureInfo.CurrentUICulture.Name.StartsWith("de"))
|
||||||
|
{
|
||||||
|
return this.titleDE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return this.titleEN;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the localized comment. if the phone is set to german language,
|
||||||
|
/// the german comment will be returned otherwise the english comment.
|
||||||
|
/// </summary>
|
||||||
|
public string Comment
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (CultureInfo.CurrentUICulture.Name.StartsWith("de"))
|
||||||
|
{
|
||||||
|
return this.commentDE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return this.commentEN;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a string containing the email address and the institution
|
||||||
|
/// title separated by ':'.
|
||||||
|
/// </summary>
|
||||||
|
public string EMailTitle
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.EMail + ":" + this.Title;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a string containing the phone number and the institution
|
||||||
|
/// title separated by ':'.
|
||||||
|
/// </summary>
|
||||||
|
public string PhoneTitle
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.Phone + ":" + this.Title;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the visibility state of the monday TextBlock.
|
||||||
|
/// </summary>
|
||||||
|
public Visibility VisibleMonday
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return ((this.dayMonday == string.Empty) || (this.dayMonday.Length == 0)) ? Visibility.Collapsed : Visibility.Visible;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the visibility state of the tuesday TextBlock.
|
||||||
|
/// </summary>
|
||||||
|
public Visibility VisibleTuesday
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return ((this.dayTuesday == string.Empty) || (this.dayTuesday.Length == 0)) ? Visibility.Collapsed : Visibility.Visible;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the visibility state of the wednesday TextBlock.
|
||||||
|
/// </summary>
|
||||||
|
public Visibility VisibleWednesday
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return ((this.dayWednesday == string.Empty) || (this.dayWednesday.Length == 0)) ? Visibility.Collapsed : Visibility.Visible;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the visibility state of the thursday TextBlock.
|
||||||
|
/// </summary>
|
||||||
|
public Visibility VisibleThursday
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return ((this.dayThursday == string.Empty) || (this.dayThursday.Length == 0)) ? Visibility.Collapsed : Visibility.Visible;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the visibility state of the friday TextBlock.
|
||||||
|
/// </summary>
|
||||||
|
public Visibility VisibleFriday
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return ((this.dayFriday == string.Empty) || (this.dayFriday.Length == 0)) ? Visibility.Collapsed : Visibility.Visible;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the visibility state of the saturday TextBlock.
|
||||||
|
/// </summary>
|
||||||
|
public Visibility VisibleSaturday
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return ((this.daySaturday == string.Empty) || (this.daySaturday.Length == 0)) ? Visibility.Collapsed : Visibility.Visible;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the visibility state of the sunday TextBlock.
|
||||||
|
/// </summary>
|
||||||
|
public Visibility VisibleSunday
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return ((this.daySunday == string.Empty) || (this.daySunday.Length == 0)) ? Visibility.Collapsed : Visibility.Visible;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the visibility state of the comment.
|
||||||
|
/// </summary>
|
||||||
|
public Visibility VisibleComment
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return ((this.Comment == string.Empty) || (this.Comment.Length == 0)) ? Visibility.Collapsed : Visibility.Visible;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the visibility state of the email address.
|
||||||
|
/// </summary>
|
||||||
|
public Visibility VisibleEMail
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return ((this.infoEmail == string.Empty) || (this.infoEmail.Length == 0)) ? Visibility.Collapsed : Visibility.Visible;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the visibility state of the phone number.
|
||||||
|
/// </summary>
|
||||||
|
public Visibility VisiblePhone
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return ((this.infoPhone == string.Empty) || (this.infoPhone.Length == 0)) ? Visibility.Collapsed : Visibility.Visible;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the visibility state of the room.
|
||||||
|
/// </summary>
|
||||||
|
public Visibility VisibleRoom
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return ((this.infoRoom == string.Empty) || (this.infoRoom.Length == 0)) ? Visibility.Collapsed : Visibility.Visible;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the visibility state of the building.
|
||||||
|
/// </summary>
|
||||||
|
public Visibility VisibleBuilding
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return ((this.infoBuilding == string.Empty) || (this.infoBuilding.Length == 0)) ? Visibility.Collapsed : Visibility.Visible;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Method
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Removes unwanted chars in a string.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="str">input string</param>
|
||||||
|
/// <returns>fixed string</returns>
|
||||||
|
private string FixOpeninghoursString(string str)
|
||||||
|
{
|
||||||
|
string retValue = string.Empty;
|
||||||
|
|
||||||
|
retValue = str.Replace(" | ", "\n");
|
||||||
|
|
||||||
|
return retValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,81 @@
|
|||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// <copyright file="OpeninghoursModel.cs" company="BTU/IIT">
|
||||||
|
// Company copyright tag.
|
||||||
|
// </copyright>
|
||||||
|
// <author>fiedlchr</author>
|
||||||
|
// <sience>24.06.2013</sience>
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace CampusAppWP8.Model.Openinghours
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Model for opening hours.
|
||||||
|
/// </summary>
|
||||||
|
[XmlRoot("root")]
|
||||||
|
public class OpeninghoursModel
|
||||||
|
{
|
||||||
|
#region Member
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Time when the model was created.
|
||||||
|
/// </summary>
|
||||||
|
private readonly DateTime createTime;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets feed information item list.
|
||||||
|
/// </summary>
|
||||||
|
private ObservableCollection<OpeninghoursInstitutionModel> institutions;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Constructor
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="OpeninghoursModel" /> class.
|
||||||
|
/// </summary>
|
||||||
|
public OpeninghoursModel()
|
||||||
|
{
|
||||||
|
this.institutions = new ObservableCollection<OpeninghoursInstitutionModel>();
|
||||||
|
this.createTime = DateTime.Now;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Property
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the creation time of the model.
|
||||||
|
/// </summary>
|
||||||
|
public DateTime CreateTime
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.createTime;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the Institutions.
|
||||||
|
/// </summary>
|
||||||
|
[XmlArray("data")]
|
||||||
|
[XmlArrayItem("institution")]
|
||||||
|
public ObservableCollection<OpeninghoursInstitutionModel> Institutions
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.institutions;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
this.institutions = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
70
CampusAppWP8/CampusAppWP8/Model/RSS/RSSChannelModel.cs
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// <copyright file="RSSChannelModel.cs" company="BTU/IIT">
|
||||||
|
// Company copyright tag.
|
||||||
|
// </copyright>
|
||||||
|
// <author>fiedlchr</author>
|
||||||
|
// <sience>24.06.2013</sience>
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
namespace CampusAppWP8.Model.RSS
|
||||||
|
{
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Collections.Specialized;
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Channel Model, which contains the RSS feed item list.
|
||||||
|
/// </summary>
|
||||||
|
public class RSSChannelModel
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// RSS feed information item list.
|
||||||
|
/// </summary>
|
||||||
|
private ObservableCollection<RSSModel> item;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="RSSChannelModel" /> class.
|
||||||
|
/// </summary>
|
||||||
|
public RSSChannelModel()
|
||||||
|
{
|
||||||
|
this.item = new ObservableCollection<RSSModel>();
|
||||||
|
this.item.CollectionChanged += new NotifyCollectionChangedEventHandler(this.OnListChanged);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the RSS feed item list.
|
||||||
|
/// </summary>
|
||||||
|
[XmlElement("item")]
|
||||||
|
public ObservableCollection<RSSModel> Item
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.item;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value != this.item)
|
||||||
|
{
|
||||||
|
this.item = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Is called when the item list has changed.
|
||||||
|
/// Here used for the add event.
|
||||||
|
/// Set the index of the last list element.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender">item list</param>
|
||||||
|
/// <param name="e">event args</param>
|
||||||
|
private void OnListChanged(object sender, NotifyCollectionChangedEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.Action == NotifyCollectionChangedAction.Add)
|
||||||
|
{
|
||||||
|
ObservableCollection<RSSModel> list = sender as ObservableCollection<RSSModel>;
|
||||||
|
|
||||||
|
list[list.Count - 1].Index = list.Count - 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
256
CampusAppWP8/CampusAppWP8/Model/RSS/RSSModel.cs
Normal file
@@ -0,0 +1,256 @@
|
|||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// <copyright file="RSSModel.cs" company="BTU/IIT">
|
||||||
|
// Company copyright tag.
|
||||||
|
// </copyright>
|
||||||
|
// <author>fiedlchr</author>
|
||||||
|
// <sience>24.06.2013</sience>
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
namespace CampusAppWP8.Model.RSS
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Text;
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Contains the RSS feed information.
|
||||||
|
/// </summary>
|
||||||
|
public class RSSModel
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Index of this object.
|
||||||
|
/// </summary>
|
||||||
|
private int index = -1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Title of the fees
|
||||||
|
/// </summary>
|
||||||
|
private string title;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Description text of the feed.
|
||||||
|
/// </summary>
|
||||||
|
private string text;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Timestamp (publication date) of the event or news.
|
||||||
|
/// </summary>
|
||||||
|
private DateTime timestamp;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Url of the feed.
|
||||||
|
/// </summary>
|
||||||
|
private string link;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the title of the feed.
|
||||||
|
/// </summary>
|
||||||
|
[XmlElement("title")]
|
||||||
|
public string Title
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.title;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (this.title != value)
|
||||||
|
{
|
||||||
|
this.title = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the text of the feed.
|
||||||
|
/// </summary>
|
||||||
|
[XmlElement("description")]
|
||||||
|
public string Text
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.text;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (this.text != this.HTMLUnicodeToString(value))
|
||||||
|
{
|
||||||
|
this.text = this.HTMLUnicodeToString(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the timestamp of the feed as string.
|
||||||
|
/// </summary>
|
||||||
|
[XmlElement("pubDate")]
|
||||||
|
public string Timestamp
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.timestamp.ToString("R");
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (this.timestamp != DateTime.Parse(value))
|
||||||
|
{
|
||||||
|
this.timestamp = DateTime.Parse(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the timestamp of the feed as DateTime object.
|
||||||
|
/// </summary>
|
||||||
|
public DateTime DTTimestamp
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.timestamp;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
this.timestamp = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the date of the timestamp as string.
|
||||||
|
/// example: Mon, 25.06.2013.
|
||||||
|
/// </summary>
|
||||||
|
public string Date
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return string.Format("{0:ddd, dd.MM.yyyy}", this.timestamp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the time of the timestamp as string.
|
||||||
|
/// example: 12:56 Uhr.
|
||||||
|
/// </summary>
|
||||||
|
public string Time
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return string.Format("{0:h:mm} Uhr", this.timestamp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the link/url of the feed.
|
||||||
|
/// </summary>
|
||||||
|
[XmlElement("link")]
|
||||||
|
public string Link
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.link;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (this.link != value)
|
||||||
|
{
|
||||||
|
this.link = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the ListIndex.
|
||||||
|
/// </summary>
|
||||||
|
public int Index
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.index;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
this.index = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Comparing function for DateTime timestamps.
|
||||||
|
/// (currently unused)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="item1">first item</param>
|
||||||
|
/// <param name="item2">second item</param>
|
||||||
|
/// <returns>-1 if item2 is older then item1, otherwise 0</returns>
|
||||||
|
public static int CompareTimeStamp(RSSModel item1, RSSModel item2)
|
||||||
|
{
|
||||||
|
if (item1.DTTimestamp > item2.DTTimestamp)
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Remove or transform html-unicode specific tags into ASCII.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="htmluni">html string</param>
|
||||||
|
/// <returns>ASCII string</returns>
|
||||||
|
private string HTMLUnicodeToString(string htmluni)
|
||||||
|
{
|
||||||
|
StringBuilder retValue = new StringBuilder();
|
||||||
|
|
||||||
|
for (int i = 0; i < htmluni.Length; i++)
|
||||||
|
{
|
||||||
|
switch (htmluni[i])
|
||||||
|
{
|
||||||
|
// beginning tag of the unicode
|
||||||
|
case '&':
|
||||||
|
int startOff = i + 2;
|
||||||
|
//// sear closing tag of the unicode
|
||||||
|
int endOff = htmluni.IndexOf(';', startOff);
|
||||||
|
//// get and parse value inbetween
|
||||||
|
string sub = htmluni.Substring(startOff, endOff - startOff);
|
||||||
|
int charVal = int.Parse(sub);
|
||||||
|
|
||||||
|
switch (charVal)
|
||||||
|
{
|
||||||
|
// if the unicode value is 128 (€)
|
||||||
|
case 128:
|
||||||
|
retValue.Append('€');
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
retValue.Append((char)charVal);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// set the current index to the end of the unicode tag
|
||||||
|
i = endOff;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case '<':
|
||||||
|
// ignoring <..> html tags
|
||||||
|
i = htmluni.IndexOf('>', i);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case '\t':
|
||||||
|
// removing tabs
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
// adding other characters to the return string
|
||||||
|
retValue.Append(htmluni[i]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return retValue.ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
71
CampusAppWP8/CampusAppWP8/Model/RSS/RSSViewModel.cs
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// <copyright file="RSSViewModel.cs" company="BTU/IIT">
|
||||||
|
// Company copyright tag.
|
||||||
|
// </copyright>
|
||||||
|
// <author>fiedlchr</author>
|
||||||
|
// <sience>24.06.2013</sience>
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
namespace CampusAppWP8.Model.RSS
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ViewModel of the RSS feed, containing the feed/channel object.
|
||||||
|
/// </summary>
|
||||||
|
[XmlRoot("root")]
|
||||||
|
public class RSSViewModel
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Object to store the time when the instance was created.
|
||||||
|
/// </summary>
|
||||||
|
private DateTime createTime;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Channel list for the RSS feeds.
|
||||||
|
/// </summary>
|
||||||
|
private ObservableCollection<RSSChannelModel> channel;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="RSSViewModel" /> class.
|
||||||
|
/// </summary>
|
||||||
|
public RSSViewModel()
|
||||||
|
{
|
||||||
|
this.channel = new ObservableCollection<RSSChannelModel>();
|
||||||
|
this.createTime = DateTime.Now;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the channel list.
|
||||||
|
/// </summary>
|
||||||
|
[XmlArray("rss")]
|
||||||
|
[XmlArrayItem("channel")]
|
||||||
|
public ObservableCollection<RSSChannelModel> Channel
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.channel;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value != this.channel)
|
||||||
|
{
|
||||||
|
this.channel = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the creation time.
|
||||||
|
/// </summary>
|
||||||
|
public DateTime CreateTime
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.createTime;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
50
CampusAppWP8/CampusAppWP8/Model/Setting/AppSettings.cs
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
//-----------------------------------------------------------------------
|
||||||
|
// <copyright file="AppSettings.cs" company="BTU/IIT">
|
||||||
|
// Company copyright tag.
|
||||||
|
// </copyright>
|
||||||
|
// <author>stubbfel</author>
|
||||||
|
// <sience>08.08.2013</sience>
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace CampusAppWP8.Model.Setting
|
||||||
|
{
|
||||||
|
using CampusAppWP8.Resources;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Model for settings of the app
|
||||||
|
/// </summary>
|
||||||
|
public class AppSettings
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets a value indicating whether the GeoWatch-Flag
|
||||||
|
/// </summary>
|
||||||
|
public bool GeoWatchEnable
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return App.LoadFromAppState<bool>(Constants.AppSetting_GeoWatchEnable);
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
App.SaveToAppState<bool>(Constants.AppSetting_GeoWatchEnable, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets a value indicating whether the InitializationApp-Flag
|
||||||
|
/// </summary>
|
||||||
|
public bool InitApp
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return App.LoadFromAppState<bool>(Constants.AppSetting_GeoWatchEnable);
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
App.SaveToAppState<bool>(Constants.AppSetting_GeoWatchEnable, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
258
CampusAppWP8/CampusAppWP8/Model/Setting/UserProfilModel.cs
Normal file
@@ -0,0 +1,258 @@
|
|||||||
|
//-----------------------------------------------------------------------
|
||||||
|
// <copyright file="UserProfilModel.cs" company="BTU/IIT">
|
||||||
|
// Company copyright tag.
|
||||||
|
// </copyright>
|
||||||
|
// <author>stubbfel</author>
|
||||||
|
// <sience>23.07.2013</sience>
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
namespace CampusAppWP8.Model.Setting
|
||||||
|
{
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
using CampusAppWP8.Resources;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Model for the profile of an user
|
||||||
|
/// </summary>
|
||||||
|
[XmlRoot("root")]
|
||||||
|
public class UserProfilModel
|
||||||
|
{
|
||||||
|
#region Members
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// constant for the first validate semester
|
||||||
|
/// </summary>
|
||||||
|
private static readonly int FirstSemester = int.Parse(Constants.Valid_FirstSemseter);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// constant for the last validate semester
|
||||||
|
/// </summary>
|
||||||
|
private static readonly int LastSemester = int.Parse(Constants.Valid_LastSemseter);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// constant for the max. number of a validate course
|
||||||
|
/// </summary>
|
||||||
|
private static readonly int MaxCourseNumber = int.Parse(Constants.Valid_MaxCourseNumber);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// constant for the default value of a semester
|
||||||
|
/// </summary>
|
||||||
|
private static readonly int DefaultSemester = int.Parse(Constants.Setting_DefaultSemester);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// constant for the default value of a courseNumber
|
||||||
|
/// </summary>
|
||||||
|
private static readonly int DefaultCourseNumber = int.Parse(Constants.Setting_DefaultCourseNumber);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Flag which indicates that any properties has been changed
|
||||||
|
/// </summary>
|
||||||
|
private bool changed = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets the course of the user
|
||||||
|
/// </summary>
|
||||||
|
private int course = UserProfilModel.DefaultCourseNumber;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets the role of the user
|
||||||
|
/// </summary>
|
||||||
|
private RoleType role = RoleType.STUDENT;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets the degree of the user
|
||||||
|
/// </summary>
|
||||||
|
private DegreeType degree = DegreeType.BACHELOR;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets the semester of the user
|
||||||
|
/// </summary>
|
||||||
|
private int semester = UserProfilModel.DefaultSemester;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Enums
|
||||||
|
/// <summary>
|
||||||
|
/// Specifies the degrees.
|
||||||
|
/// </summary>
|
||||||
|
public enum DegreeType
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// bachelor degree
|
||||||
|
/// </summary>
|
||||||
|
BACHELOR = 82,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// master degree
|
||||||
|
/// </summary>
|
||||||
|
MASTER = 88,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// diploma degree
|
||||||
|
/// </summary>
|
||||||
|
DIPLOM = 11
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Specifies the role of the user.
|
||||||
|
/// </summary>
|
||||||
|
public enum RoleType
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// for students (01).
|
||||||
|
/// </summary>
|
||||||
|
STUDENT = 1,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// for staffs (10).
|
||||||
|
/// </summary>
|
||||||
|
STAFF = 2,
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Proberties
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the course of the user
|
||||||
|
/// </summary>
|
||||||
|
[XmlElement("Course")]
|
||||||
|
public int Course
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.course;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value != this.course && this.ValditateCourse(value))
|
||||||
|
{
|
||||||
|
this.course = value;
|
||||||
|
this.changed = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the role of the user
|
||||||
|
/// </summary>
|
||||||
|
[XmlElement("Role")]
|
||||||
|
public RoleType Role
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.role;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value != this.role)
|
||||||
|
{
|
||||||
|
this.role = value;
|
||||||
|
this.changed = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the degree of the user
|
||||||
|
/// </summary>
|
||||||
|
[XmlElement("Degere")]
|
||||||
|
public DegreeType Degree
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.degree;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value != this.degree)
|
||||||
|
{
|
||||||
|
this.degree = value;
|
||||||
|
this.changed = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the semester of the user
|
||||||
|
/// </summary>
|
||||||
|
[XmlElement("Semseter")]
|
||||||
|
public int Semester
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.semester;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value != this.semester && this.ValditateSemester(value))
|
||||||
|
{
|
||||||
|
this.semester = value;
|
||||||
|
this.changed = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Methods
|
||||||
|
|
||||||
|
#region public
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method return the changed flag
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="reset"> if is true, set changed flag to false, otherwise do nothing (bypass)</param>
|
||||||
|
/// <returns>return true, if any properties has changed, otherwise false</returns>
|
||||||
|
public bool HasChanged(bool reset = true)
|
||||||
|
{
|
||||||
|
bool result = this.changed;
|
||||||
|
|
||||||
|
if (reset)
|
||||||
|
{
|
||||||
|
this.changed = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region private
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Methods check if a value could be a valid semester
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="possibleSemester">value which has to be checked</param>
|
||||||
|
/// <returns>true if it is an valid semester, otherwise false</returns>
|
||||||
|
private bool ValditateSemester(int possibleSemester)
|
||||||
|
{
|
||||||
|
if (possibleSemester < UserProfilModel.FirstSemester || possibleSemester > UserProfilModel.LastSemester)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Methods check if a value could be a valid course
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="possibleCourse">value which has to be checked</param>
|
||||||
|
/// <returns>true if it is an valid course, otherwise false</returns>
|
||||||
|
private bool ValditateCourse(int possibleCourse)
|
||||||
|
{
|
||||||
|
if (possibleCourse > UserProfilModel.MaxCourseNumber)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,80 @@
|
|||||||
|
//-----------------------------------------------------------------------
|
||||||
|
// <copyright file="StudentCouncilListModel.cs" company="BTU/IIT">
|
||||||
|
// Company copyright tag.
|
||||||
|
// </copyright>
|
||||||
|
// <author>stubbfel</author>
|
||||||
|
// <sience>02.07.2013</sience>
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
namespace CampusAppWP8.Model.StudentCouncil
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Model for menus in one week
|
||||||
|
/// </summary>
|
||||||
|
[XmlRoot("root")]
|
||||||
|
public class StudentCouncilListModel
|
||||||
|
{
|
||||||
|
#region Members
|
||||||
|
/// <summary>
|
||||||
|
/// Time when the model was created
|
||||||
|
/// </summary>
|
||||||
|
private readonly DateTime createTime;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
#region Constructor
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="StudentCouncilListModel" /> class.
|
||||||
|
/// </summary>
|
||||||
|
public StudentCouncilListModel()
|
||||||
|
{
|
||||||
|
this.createTime = DateTime.Now;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Proberty
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the StudentCouncils
|
||||||
|
/// </summary>
|
||||||
|
[XmlArray("data")]
|
||||||
|
[XmlArrayItem("studentcouncil")]
|
||||||
|
public ObservableCollection<StudentCouncilModel> StudentCouncils { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the creation time of the model
|
||||||
|
/// </summary>
|
||||||
|
public DateTime CreateTime
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.createTime;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Method
|
||||||
|
/// <summary>
|
||||||
|
/// Method group the StudentCouncilList by Faculty
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>a Dictionary, where the Key is name of the Faculty und the value is a List of StudentCouncil</returns>
|
||||||
|
public Dictionary<string, List<StudentCouncilModel>> GetStudentCouncilsGroupByFaculty()
|
||||||
|
{
|
||||||
|
List<IGrouping<string, StudentCouncilModel>> tmpList = this.StudentCouncils.GroupBy(p => p.Faculty).ToList();
|
||||||
|
Dictionary<string, List<StudentCouncilModel>> itemMap = new Dictionary<string, List<StudentCouncilModel>>();
|
||||||
|
foreach (IGrouping<string, StudentCouncilModel> group in tmpList)
|
||||||
|
{
|
||||||
|
Dictionary<string, List<StudentCouncilModel>> tempDic = new Dictionary<string, List<StudentCouncilModel>>();
|
||||||
|
itemMap.Add(group.Key, group.ToList());
|
||||||
|
}
|
||||||
|
|
||||||
|
return itemMap;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,86 @@
|
|||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// <copyright file="StudentCouncilModel.cs" company="BTU/IIT">
|
||||||
|
// Company copyright tag.
|
||||||
|
// </copyright>
|
||||||
|
// <author>stubbfel</author>
|
||||||
|
// <sience>02.07.2013</sience>
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace CampusAppWP8.Model.StudentCouncil
|
||||||
|
{
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
using CampusAppWP8.Resources;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Model for menu
|
||||||
|
/// </summary>
|
||||||
|
public class StudentCouncilModel
|
||||||
|
{
|
||||||
|
#region Member
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// name of the faculty.
|
||||||
|
/// </summary>
|
||||||
|
private string faculty;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Constructor
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="StudentCouncilModel" /> class.
|
||||||
|
/// </summary>
|
||||||
|
public StudentCouncilModel()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Property
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the faculty of the StudentCouncil.
|
||||||
|
/// </summary>
|
||||||
|
[XmlAttribute("faculty")]
|
||||||
|
public string Faculty
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.faculty;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value != this.faculty)
|
||||||
|
{
|
||||||
|
this.faculty = value;
|
||||||
|
int num;
|
||||||
|
if (int.TryParse(this.faculty, out num))
|
||||||
|
{
|
||||||
|
this.faculty = AppResources.Faculty + " " + num;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the name of the StudentCouncil.
|
||||||
|
/// </summary>
|
||||||
|
[XmlAttribute("name")]
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the webpage-url of the StudentCouncil.
|
||||||
|
/// </summary>
|
||||||
|
[XmlAttribute("url")]
|
||||||
|
public string Url { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the email-address of the StudentCouncil.
|
||||||
|
/// </summary>
|
||||||
|
[XmlAttribute("email")]
|
||||||
|
public string Email { get; set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
//-----------------------------------------------------------------------
|
||||||
|
// <copyright file="CleanUrlParamModel.cs" company="BTU/IIT">
|
||||||
|
// Company copyright tag.
|
||||||
|
// </copyright>
|
||||||
|
// <author>stubbfel</author>
|
||||||
|
// <sience>06.08.2013</sience>
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
namespace CampusAppWP8.Model.Utility
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// This class is a Model for the URLParameter like GET-Parameter
|
||||||
|
/// </summary>
|
||||||
|
public class CleanUrlParamModel:UrlParamModel
|
||||||
|
{
|
||||||
|
#region Constructor
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="UrlParamModel" /> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="key">the key for the parameter</param>
|
||||||
|
public CleanUrlParamModel(string key) :base(key)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="UrlParamModel" /> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="key">the key for the parameter</param>>
|
||||||
|
/// <param name="value">value of the parameter</param>
|
||||||
|
public CleanUrlParamModel(string key, string value) : base(key,value)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Proberty
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the token, which indicate that the parameterList started
|
||||||
|
/// </summary>
|
||||||
|
public override string ParamToken
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return string.Empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method return a formatted string like Key=Value
|
||||||
|
/// </summary>
|
||||||
|
/// <returns> return formatted string</returns>
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
if (!this.IsParamValid())
|
||||||
|
{
|
||||||
|
return string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
return "/" + this.key + "/" + this.Value;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,86 @@
|
|||||||
|
// <copyright file="CourseListPickerItemListModel.cs" company="BTU/IIT">
|
||||||
|
// Company copyright tag.List
|
||||||
|
// </copyright>
|
||||||
|
// <author>stubbfel</author>
|
||||||
|
// <sience>25.07.2013</sience>
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
namespace CampusAppWP8.Model.Utility
|
||||||
|
{
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// This is a class for the courseList
|
||||||
|
/// </summary>
|
||||||
|
public class CourseListPickerItemListModel : ListPickerItemListModel
|
||||||
|
{
|
||||||
|
#region Constructor
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="CourseListPickerItemListModel" /> class.
|
||||||
|
/// </summary>
|
||||||
|
public CourseListPickerItemListModel()
|
||||||
|
: base()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Method
|
||||||
|
|
||||||
|
#region private
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Overrides the LoadList-Method <see cref="ListPickerItemListModel"/>
|
||||||
|
/// </summary>
|
||||||
|
protected override void LoadList()
|
||||||
|
{
|
||||||
|
this.AddItem(new ListPickerItemModel("013", "Architektur"));
|
||||||
|
this.AddItem(new ListPickerItemModel("017", "Bauingenieurwesen"));
|
||||||
|
this.AddItem(new ListPickerItemModel("021", "Betriebswirtschaftslehre"));
|
||||||
|
this.AddItem(new ListPickerItemModel("042", "Wirtschaftsrecht für Technologieunternehmen"));
|
||||||
|
this.AddItem(new ListPickerItemModel("048", "Elektrotechnik"));
|
||||||
|
this.AddItem(new ListPickerItemModel("079", "Informatik "));
|
||||||
|
this.AddItem(new ListPickerItemModel("104", "Maschinenbau"));
|
||||||
|
this.AddItem(new ListPickerItemModel("105", "Mathematik"));
|
||||||
|
this.AddItem(new ListPickerItemModel("128", "Physik "));
|
||||||
|
this.AddItem(new ListPickerItemModel("179", "Wirtschaftsingenieurwesen"));
|
||||||
|
this.AddItem(new ListPickerItemModel("184", "Wirtschaftswissenschaften "));
|
||||||
|
this.AddItem(new ListPickerItemModel("215", "Biomedizinische Gerätetechnik "));
|
||||||
|
this.AddItem(new ListPickerItemModel("226", "Verfahrenstechnik"));
|
||||||
|
this.AddItem(new ListPickerItemModel("276", "Wirtschaftsmathematik "));
|
||||||
|
this.AddItem(new ListPickerItemModel("711", "Kultur und Technik "));
|
||||||
|
this.AddItem(new ListPickerItemModel("744", "Physik der Halbleiter-Technologie"));
|
||||||
|
this.AddItem(new ListPickerItemModel("749", "Angewandte Mathematik "));
|
||||||
|
this.AddItem(new ListPickerItemModel("764", "Technologie- und Innovationsmanagement"));
|
||||||
|
this.AddItem(new ListPickerItemModel("766", "Stadt- und Regionalplanung"));
|
||||||
|
this.AddItem(new ListPickerItemModel("767", "Informations- und Medientechnik "));
|
||||||
|
this.AddItem(new ListPickerItemModel("768", "World Heritage Studies"));
|
||||||
|
this.AddItem(new ListPickerItemModel("770", "Umweltingenieurwesen und Verfahrenstechnik"));
|
||||||
|
this.AddItem(new ListPickerItemModel("771", "Environmental and Resource Management"));
|
||||||
|
this.AddItem(new ListPickerItemModel("772", "Landnutzung und Wasserbewirtschaftung"));
|
||||||
|
this.AddItem(new ListPickerItemModel("773", "Bauen und Erhalten"));
|
||||||
|
this.AddItem(new ListPickerItemModel("774", "Umweltingenieurwesen"));
|
||||||
|
this.AddItem(new ListPickerItemModel("794", "eBusiness"));
|
||||||
|
this.AddItem(new ListPickerItemModel("798", "Civil Engineering"));
|
||||||
|
this.AddItem(new ListPickerItemModel("799", "Structural Engineering"));
|
||||||
|
this.AddItem(new ListPickerItemModel("800", "Electrical Power Engineering "));
|
||||||
|
this.AddItem(new ListPickerItemModel("841", "Euro Hydroinformatics and Water Management"));
|
||||||
|
this.AddItem(new ListPickerItemModel("842", "Technologien Biogener Rohstoffe"));
|
||||||
|
this.AddItem(new ListPickerItemModel("843", "Environmental Technologies"));
|
||||||
|
this.AddItem(new ListPickerItemModel("844", "Process Engineering and Plant Design"));
|
||||||
|
this.AddItem(new ListPickerItemModel("845", "Architekturvermittlung"));
|
||||||
|
this.AddItem(new ListPickerItemModel("851", "Nachwachsende Rohstoffe und Erneuerbare Energien"));
|
||||||
|
this.AddItem(new ListPickerItemModel("852", "Energieträger aus Biomasse und Abfällen"));
|
||||||
|
this.AddItem(new ListPickerItemModel("853", "Power Engineering"));
|
||||||
|
this.AddItem(new ListPickerItemModel("857", "Verfahrenstechnik - Prozess- und Anlagentechnik"));
|
||||||
|
this.AddItem(new ListPickerItemModel("858", "Architektur.Studium.Generale"));
|
||||||
|
this.AddItem(new ListPickerItemModel("860", "Verarbeitungstechnologien der Werkstoffe"));
|
||||||
|
this.AddItem(new ListPickerItemModel("871", "Forensic Sciences and Engineering"));
|
||||||
|
this.List = this.List.OrderBy(o => o.Text).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
// <copyright file="DegreeListPickerItemListModel.cs" company="BTU/IIT">
|
||||||
|
// Company copyright tag.List
|
||||||
|
// </copyright>
|
||||||
|
// <author>stubbfel</author>
|
||||||
|
// <sience>25.07.2013</sience>
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
namespace CampusAppWP8.Model.Utility
|
||||||
|
{
|
||||||
|
using CampusAppWP8.Resources;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// This Class creates a list of degrees
|
||||||
|
/// </summary>
|
||||||
|
public class DegreeListPickerItemListModel : ListPickerItemListModel
|
||||||
|
{
|
||||||
|
#region Constructor
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="DegreeListPickerItemListModel" /> class.
|
||||||
|
/// </summary>
|
||||||
|
public DegreeListPickerItemListModel()
|
||||||
|
: base()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Method
|
||||||
|
|
||||||
|
#region private
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Overrides the LoadList-Method <see cref="ListPickerItemListModel"/>
|
||||||
|
/// </summary>
|
||||||
|
protected override void LoadList()
|
||||||
|
{
|
||||||
|
this.AddItem(new ListPickerItemModel(((int)CampusAppWP8.Model.Setting.UserProfilModel.DegreeType.BACHELOR).ToString(), AppResources.Degree_Bachelor));
|
||||||
|
this.AddItem(new ListPickerItemModel(((int)CampusAppWP8.Model.Setting.UserProfilModel.DegreeType.MASTER).ToString(), AppResources.Degree_Master));
|
||||||
|
this.AddItem(new ListPickerItemModel(((int)CampusAppWP8.Model.Setting.UserProfilModel.DegreeType.DIPLOM).ToString(), AppResources.Degree_Diploma));
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,148 @@
|
|||||||
|
//-----------------------------------------------------------------------
|
||||||
|
// <copyright file="ListPickerItemListModel.cs" company="BTU/IIT">
|
||||||
|
// Company copyright tag.List
|
||||||
|
// </copyright>
|
||||||
|
// <author>stubbfel</author>
|
||||||
|
// <sience>25.07.2013</sience>
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
namespace CampusAppWP8.Model.Utility
|
||||||
|
{
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Class for a List of ListPickerItems
|
||||||
|
/// </summary>
|
||||||
|
public class ListPickerItemListModel
|
||||||
|
{
|
||||||
|
#region Members
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// reference of the itemList
|
||||||
|
/// </summary>
|
||||||
|
private List<ListPickerItemModel> list;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Constructor
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="ListPickerItemListModel" /> class.
|
||||||
|
/// </summary>
|
||||||
|
public ListPickerItemListModel()
|
||||||
|
{
|
||||||
|
this.list = new List<ListPickerItemModel>();
|
||||||
|
this.LoadList();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Property
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the ItemList
|
||||||
|
/// </summary>
|
||||||
|
public List<ListPickerItemModel> List
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.list;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value != this.list)
|
||||||
|
{
|
||||||
|
this.list = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Method
|
||||||
|
|
||||||
|
#region public
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method return a the Index of an item which has a certain value
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="value">a certain value</param>
|
||||||
|
/// <returns>return index of value or default(0)</returns>
|
||||||
|
public virtual int GetIndexOrDefault(string value)
|
||||||
|
{
|
||||||
|
int index = 0;
|
||||||
|
int i = 0;
|
||||||
|
foreach (ListPickerItemModel item in this.list)
|
||||||
|
{
|
||||||
|
if (item.Value.Equals(value))
|
||||||
|
{
|
||||||
|
index = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return index;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// add an new item to the list
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="value">value of the item</param>
|
||||||
|
/// <param name="text">text of the item</param>
|
||||||
|
public void AddItem(string value, string text)
|
||||||
|
{
|
||||||
|
this.AddItem(new ListPickerItemModel(value, text));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// add an new item to the list
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="item">new item of the list</param>
|
||||||
|
public void AddItem(ListPickerItemModel item)
|
||||||
|
{
|
||||||
|
this.list.Add(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// remove an item
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="value">value of the item</param>
|
||||||
|
/// <param name="text">text of the item</param>
|
||||||
|
/// <returns>true if removing was successful, otherwise false</returns>
|
||||||
|
public bool RemoveItem(string value, string text)
|
||||||
|
{
|
||||||
|
return this.RemoveItem(new ListPickerItemModel(value, text));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// remove an item
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="item">item which has to be remove</param>
|
||||||
|
/// <returns>true if removing was successful, otherwise false</returns>
|
||||||
|
public bool RemoveItem(ListPickerItemModel item)
|
||||||
|
{
|
||||||
|
return this.list.Remove(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region private
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method load an default list
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// load an empty list
|
||||||
|
/// </remarks>
|
||||||
|
protected virtual void LoadList()
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
//-----------------------------------------------------------------------
|
||||||
|
// <copyright file="ListPickerItemModel.cs" company="BTU/IIT">
|
||||||
|
// Company copyright tag.
|
||||||
|
// </copyright>
|
||||||
|
// <author>stubbfel</author>
|
||||||
|
// <sience>13.06.2013</sience>
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
namespace CampusAppWP8.Model.Utility
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Model for the ListPickerItems
|
||||||
|
/// </summary>
|
||||||
|
public class ListPickerItemModel
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="ListPickerItemModel" /> class.
|
||||||
|
/// </summary>
|
||||||
|
public ListPickerItemModel()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="ListPickerItemModel" /> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="value">string for the value property of an item</param>
|
||||||
|
/// <param name="text">string for the text property of an item</param>
|
||||||
|
public ListPickerItemModel(string value, string text)
|
||||||
|
{
|
||||||
|
this.Value = value;
|
||||||
|
this.Text = text;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the Value of an Item
|
||||||
|
/// </summary>
|
||||||
|
public string Value { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the Text (caption) of an Item
|
||||||
|
/// </summary>
|
||||||
|
public string Text { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
// <copyright file="RoleListPickerItemListModel.cs" company="BTU/IIT">
|
||||||
|
// Company copyright tag.List
|
||||||
|
// </copyright>
|
||||||
|
// <author>stubbfel</author>
|
||||||
|
// <sience>25.07.2013</sience>
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
namespace CampusAppWP8.Model.Utility
|
||||||
|
{
|
||||||
|
using CampusAppWP8.Resources;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Class for the RoleList
|
||||||
|
/// </summary>
|
||||||
|
public class RoleListPickerItemListModel : ListPickerItemListModel
|
||||||
|
{
|
||||||
|
#region Constructor
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="RoleListPickerItemListModel" /> class.
|
||||||
|
/// </summary>
|
||||||
|
public RoleListPickerItemListModel()
|
||||||
|
: base()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Method
|
||||||
|
|
||||||
|
#region private
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Overrides the LoadList-Method <see cref="ListPickerItemListModel"/>
|
||||||
|
/// </summary>
|
||||||
|
protected override void LoadList()
|
||||||
|
{
|
||||||
|
this.AddItem(new ListPickerItemModel(CampusAppWP8.Model.Setting.UserProfilModel.RoleType.STUDENT.ToString(), AppResources.Setting_RoleStudent));
|
||||||
|
this.AddItem(new ListPickerItemModel(CampusAppWP8.Model.Setting.UserProfilModel.RoleType.STAFF.ToString(), AppResources.Setting_RoleStaff));
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
// <copyright file="SemesterListPickerItemListModel.cs" company="BTU/IIT">
|
||||||
|
// Company copyright tag.List
|
||||||
|
// </copyright>
|
||||||
|
// <author>stubbfel</author>
|
||||||
|
// <sience>25.07.2013</sience>
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
namespace CampusAppWP8.Model.Utility
|
||||||
|
{
|
||||||
|
using CampusAppWP8.Resources;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Class for the SemesterList
|
||||||
|
/// </summary>
|
||||||
|
public class SemesterListPickerItemListModel : ListPickerItemListModel
|
||||||
|
{
|
||||||
|
#region Constructor
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="SemesterListPickerItemListModel" /> class.
|
||||||
|
/// </summary>
|
||||||
|
public SemesterListPickerItemListModel()
|
||||||
|
: base()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Method
|
||||||
|
|
||||||
|
#region private
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Overrides the LoadList-Method <see cref="ListPickerItemListModel"/>
|
||||||
|
/// </summary>
|
||||||
|
protected override void LoadList()
|
||||||
|
{
|
||||||
|
this.AddItem(new ListPickerItemModel("20131", "SoSe 13"));
|
||||||
|
this.AddItem(new ListPickerItemModel("20132", "WiSe 13/14"));
|
||||||
|
this.AddItem(new ListPickerItemModel("20141", "SoSe 14"));
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
108
CampusAppWP8/CampusAppWP8/Model/Utility/URLParamModel.cs
Normal file
@@ -0,0 +1,108 @@
|
|||||||
|
//-----------------------------------------------------------------------
|
||||||
|
// <copyright file="URLParamModel.cs" company="BTU/IIT">
|
||||||
|
// Company copyright tag.
|
||||||
|
// </copyright>
|
||||||
|
// <author>stubbfel</author>
|
||||||
|
// <sience>17.06.2013</sience>
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
namespace CampusAppWP8.Model.Utility
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// This class is a Model for the URLParameter like GET-Parameter
|
||||||
|
/// </summary>
|
||||||
|
public class UrlParamModel
|
||||||
|
{
|
||||||
|
#region Members
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Variable of the key
|
||||||
|
/// </summary>
|
||||||
|
protected readonly string key;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Constructor
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="UrlParamModel" /> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="key">the key for the parameter</param>
|
||||||
|
public UrlParamModel(string key)
|
||||||
|
{
|
||||||
|
this.key = key;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="UrlParamModel" /> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="key">the key for the parameter</param>>
|
||||||
|
/// <param name="value">value of the parameter</param>
|
||||||
|
public UrlParamModel(string key, string value)
|
||||||
|
{
|
||||||
|
this.key = key;
|
||||||
|
this.Value = value;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Proberty
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the value of the Parameter
|
||||||
|
/// </summary>
|
||||||
|
public string Value { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the key of the parameter
|
||||||
|
/// </summary>
|
||||||
|
public string Key
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.key;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the token, which indicate that the parameterList started
|
||||||
|
/// </summary>
|
||||||
|
public virtual string ParamToken
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return "?";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method check if the parameter is valid
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>true if is it valid, otherwise false</returns>
|
||||||
|
public virtual bool IsParamValid()
|
||||||
|
{
|
||||||
|
if (this.key == null || string.Empty.Equals(this.key) || string.Empty.Equals(this.Value))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Method return a formatted string like Key=Value
|
||||||
|
/// </summary>
|
||||||
|
/// <returns> return formatted string</returns>
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
if (!this.IsParamValid())
|
||||||
|
{
|
||||||
|
return string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
return "&" + this.key + "=" + this.Value;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
89
CampusAppWP8/CampusAppWP8/Model/XmlModel.cs
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// <copyright file="XmlModel.cs" company="BTU/IIT">
|
||||||
|
// Company copyright tag.
|
||||||
|
// </copyright>
|
||||||
|
// <author>fiedlchr</author>
|
||||||
|
// <sience>05.07.2013</sience>
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
namespace CampusAppWP8.Model
|
||||||
|
{
|
||||||
|
using System.Text;
|
||||||
|
using CampusAppWP8.Resources;
|
||||||
|
using CampusAppWP8.Utility;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Xml model io handler class.
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="T">model type</typeparam>
|
||||||
|
public class XmlModel<T> : MainModel<T>
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="XmlModel{T}" /> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="modelType">model io type</param>
|
||||||
|
/// <param name="fileName">filename of the data file</param>
|
||||||
|
/// <param name="url">url of the feed data</param>
|
||||||
|
public XmlModel(ModelType modelType, string fileName, string url)
|
||||||
|
: base(modelType, fileName, url)
|
||||||
|
{
|
||||||
|
this.ValidRootName = Constants.XMLRootElementName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="XmlModel{T}" /> class.
|
||||||
|
/// Use only if the model io type is file or feed, not both.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="modelType">model io type</param>
|
||||||
|
/// <param name="sourceName">name of the file or the url of the feed</param>
|
||||||
|
public XmlModel(ModelType modelType, string sourceName)
|
||||||
|
: base(modelType, sourceName)
|
||||||
|
{
|
||||||
|
this.ValidRootName = Constants.XMLRootElementName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets for the name of the root-tag
|
||||||
|
/// </summary>
|
||||||
|
protected string ValidRootName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Create the model from a xml byte array.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="modelData">model data</param>
|
||||||
|
/// <returns>true, if succeeded</returns>
|
||||||
|
protected override bool DeserializeModel(byte[] modelData)
|
||||||
|
{
|
||||||
|
bool retValue = true;
|
||||||
|
|
||||||
|
string data = Encoding.UTF8.GetString(modelData, 0, modelData.Length);
|
||||||
|
|
||||||
|
T tempModel = XmlManager.DeserializationToModel<T>(data, this.ValidRootName);
|
||||||
|
if (tempModel != null)
|
||||||
|
{
|
||||||
|
this.Model = tempModel;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
retValue = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return retValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Serializes the model to a byte array.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>model data</returns>
|
||||||
|
protected override byte[] SerializeModel()
|
||||||
|
{
|
||||||
|
byte[] retValue = null;
|
||||||
|
|
||||||
|
if (this.Model != null)
|
||||||
|
{
|
||||||
|
retValue = Encoding.UTF8.GetBytes(XmlManager.SerializationToString<T>(this.Model));
|
||||||
|
}
|
||||||
|
|
||||||
|
return retValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||