From 13e64c99bc5e96f09c0c41a40100bd864dd98b8c Mon Sep 17 00:00:00 2001 From: Saveen Reddy Date: Sun, 14 Jun 2015 12:12:06 -0700 Subject: [PATCH] Added sample code --- .gitignore | 170 ++++++++++++++++++++++++++++++++++++++ Scripts/RTM_Countdown.ps1 | 57 +++++++++++++ 2 files changed, 227 insertions(+) create mode 100644 .gitignore create mode 100644 Scripts/RTM_Countdown.ps1 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e67cf63 --- /dev/null +++ b/.gitignore @@ -0,0 +1,170 @@ +################# +## Eclipse +################# + +*.pydevproject +.project +.metadata +bin/ +tmp/ +*.tmp +*.bak +*.swp +*~.nib +local.properties +.classpath +.settings/ +.loadpath + +# External tool builders +.externalToolBuilders/ + +# Locally stored "Eclipse launch configurations" +*.launch + +# CDT-specific +.cproject + +# PDT-specific +.buildpath + + +################# +## Visual Studio +################# + +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.sln.docstates +*.tss +*.nupkg + + +# Build results +[Dd]ebug/ +[Rr]elease/ +*_i.c +*_p.c +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.vspscc +.builds +*.dotCover + +## TODO: If you have NuGet Package Restore enabled, uncomment this +packages/ +src/packages/Microsoft + + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf + +# Visual Studio profiler +*.psess +*.vsp + +# ReSharper is a .NET coding add-in +_ReSharper* + +# 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 + +# Others +[Bb]in +[Oo]bj +sql +TestResults +*.Cache +ClientBin +stylecop.* +~$* +*.dbmdl +Generated_Code #added for RIA/Silverlight projects + +# 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 + + + +############ +## Windows +############ + +# Windows image file caches +Thumbs.db + +# Folder config file +Desktop.ini + + +############# +## Python +############# + +*.py[co] + +# Packages +*.egg +*.egg-info +dist +build +eggs +parts +bin +var +sdist +develop-eggs +.installed.cfg + +# Installer logs +pip-log.txt + +# Unit test / coverage reports +.coverage +.tox + +#Translations +*.mo + +#Mr Developer +.mr.developer.cfg + +# Mac crap +.DS_Store + +!*.targets diff --git a/Scripts/RTM_Countdown.ps1 b/Scripts/RTM_Countdown.ps1 new file mode 100644 index 0000000..72c5428 --- /dev/null +++ b/Scripts/RTM_Countdown.ps1 @@ -0,0 +1,57 @@ +Import-Module Visio +New-VisioApplication +$doc = New-VisioDocument + +$basic_u = Open-VisioDocument basic_u.vss +$master = Get-VisioMaster "Rectangle" $basic_u + +$font = $doc.Fonts["Segoe UI"] +$fontid = $font.ID + +# This is a demo, so get some dates relative to the current date +$date_today = Get-Date +$date_today = $date_today.Date +$lower_date = $date_today.AddDays(-3) +$upper_date = $date_today.AddDays(4) +$date_rtm = $date_today#.AddDays(2) + +$width = 1.0 +$height = 1.0 + +# Perform the rendering +$cur_date = $lower_date +$n=0 +$y=4 + +$color_normal = "rgb(255,255,255)" +$color_highlight = "rgb(255,0,0)" +$color_target = "rgb(200,200,200)" + +while ($cur_date -le $upper_date) +{ + $x = ($n*$width) + (1.0 + ($width/2.0)) + $shape = New-VisioShape $master $x,$y + $props = @{ "Width"=$width; "Height"= $height ; "Fillforegnd" = $color_normal ; "CharFont"=$fontid ; "CharSize" = "14pt"} + $text = Get-Date $cur_date -format "M/d" + + + if ($cur_date -eq $date_rtm) + { + $props["Fillforegnd"] = $color_target + $text = $text + "`nRTM" + } + + if ($cur_date -eq $date_today) + { + $props["Fillforegnd"] = $color_highlight + $text = $text + "`nTODAY" + } + + Set-VisioShapeCell $props + + Set-VisioShapeText $text + Write-Host $cur_date + $n = $n +1 + $cur_date = $cur_date.AddDays(1) + +} \ No newline at end of file