From 9e23bde841e5340fd317eb29ae627aeafbf8534c Mon Sep 17 00:00:00 2001 From: Ami Bar Date: Mon, 20 Aug 2012 16:35:37 +0300 Subject: [PATCH] Moved to VS 2012 + Added support to Windows Phone --- STPCEDemo/STPCEDemo.csproj | 8 +- STPExamples/STPExamples.csproj | 6 +- STPSLDemo/STPSLDemo.csproj | 24 +- STPTests/STPTests.csproj | 6 +- STPWPDemo/App.xaml | 20 ++ STPWPDemo/App.xaml.cs | 142 ++++++++++ STPWPDemo/ApplicationIcon.png | Bin 0 -> 1881 bytes STPWPDemo/Background.png | Bin 0 -> 3521 bytes STPWPDemo/MainPage.xaml | 62 +++++ STPWPDemo/MainPage.xaml.cs | 244 ++++++++++++++++++ STPWPDemo/Properties/AppManifest.xml | 6 + STPWPDemo/Properties/AssemblyInfo.cs | 37 +++ STPWPDemo/Properties/WMAppManifest.xml | 35 +++ STPWPDemo/Resources/EmptyCell.jpg | Bin 0 -> 701 bytes STPWPDemo/Resources/GreenCell.jpg | Bin 0 -> 735 bytes STPWPDemo/Resources/RedCell.jpg | Bin 0 -> 710 bytes STPWPDemo/STPWPDemo.csproj | 132 ++++++++++ STPWPDemo/SpinTextBlock.xaml | 17 ++ STPWPDemo/SpinTextBlock.xaml.cs | 43 +++ STPWPDemo/SplashScreenImage.jpg | Bin 0 -> 9417 bytes STPWPDemo/UsageControl.xaml | 28 ++ STPWPDemo/UsageControl.xaml.cs | 109 ++++++++ STPWPDemo/UsageHistoryControl.xaml | 8 + STPWPDemo/UsageHistoryControl.xaml.cs | 209 +++++++++++++++ SmartThreadPool.sln | 68 ++--- SmartThreadPool/CallerThreadContext.cs | 14 +- SmartThreadPool/Exceptions.cs | 2 +- SmartThreadPool/STPEventWaitHandle.cs | 2 +- SmartThreadPool/STPPerformanceCounter.cs | 4 +- SmartThreadPool/STPStartInfo.cs | 14 +- SmartThreadPool/SmartThreadPool.cs | 45 +++- SmartThreadPool/SmartThreadPool.csproj | 6 +- SmartThreadPool/SmartThreadPoolCE.csproj | 8 +- SmartThreadPool/SmartThreadPoolMono.csproj | 6 +- SmartThreadPool/SmartThreadPoolSL.csproj | 12 +- SmartThreadPool/SmartThreadPoolWP.csproj | 89 +++++++ SmartThreadPool/WorkItem.cs | 13 +- SmartThreadPool/WorkItemsGroup.cs | 6 +- SmartThreadPool/WorkItemsQueue.cs | 27 +- .../TestSmartThreadPool.csproj | 6 +- .../TestSmartThreadPoolMono.csproj | 6 +- UsageControl/Properties/Resources.Designer.cs | 4 +- UsageControl/UsageControl.csproj | 6 +- .../Properties/Resources.Designer.cs | 4 +- .../Properties/Settings.Designer.cs | 4 +- WorkItemsGroupDemo/WorkItemsGroupDemo.csproj | 6 +- .../WorkItemsGroupDemoMono.csproj | 6 +- 47 files changed, 1387 insertions(+), 107 deletions(-) create mode 100644 STPWPDemo/App.xaml create mode 100644 STPWPDemo/App.xaml.cs create mode 100644 STPWPDemo/ApplicationIcon.png create mode 100644 STPWPDemo/Background.png create mode 100644 STPWPDemo/MainPage.xaml create mode 100644 STPWPDemo/MainPage.xaml.cs create mode 100644 STPWPDemo/Properties/AppManifest.xml create mode 100644 STPWPDemo/Properties/AssemblyInfo.cs create mode 100644 STPWPDemo/Properties/WMAppManifest.xml create mode 100644 STPWPDemo/Resources/EmptyCell.jpg create mode 100644 STPWPDemo/Resources/GreenCell.jpg create mode 100644 STPWPDemo/Resources/RedCell.jpg create mode 100644 STPWPDemo/STPWPDemo.csproj create mode 100644 STPWPDemo/SpinTextBlock.xaml create mode 100644 STPWPDemo/SpinTextBlock.xaml.cs create mode 100644 STPWPDemo/SplashScreenImage.jpg create mode 100644 STPWPDemo/UsageControl.xaml create mode 100644 STPWPDemo/UsageControl.xaml.cs create mode 100644 STPWPDemo/UsageHistoryControl.xaml create mode 100644 STPWPDemo/UsageHistoryControl.xaml.cs create mode 100644 SmartThreadPool/SmartThreadPoolWP.csproj diff --git a/STPCEDemo/STPCEDemo.csproj b/STPCEDemo/STPCEDemo.csproj index 44a8f93..9c65de7 100644 --- a/STPCEDemo/STPCEDemo.csproj +++ b/STPCEDemo/STPCEDemo.csproj @@ -1,4 +1,5 @@ - + + Debug AnyCPU @@ -17,9 +18,8 @@ v2.0 - - - 2.0 + 0 + 4.0 Windows CE diff --git a/STPExamples/STPExamples.csproj b/STPExamples/STPExamples.csproj index e272ba8..bd9a143 100644 --- a/STPExamples/STPExamples.csproj +++ b/STPExamples/STPExamples.csproj @@ -1,4 +1,5 @@ - + + Local 9.0.30729 @@ -24,7 +25,8 @@ - 2.0 + 3.5 + v2.0 bin\Debug\ diff --git a/STPSLDemo/STPSLDemo.csproj b/STPSLDemo/STPSLDemo.csproj index 2f67624..e45cc00 100644 --- a/STPSLDemo/STPSLDemo.csproj +++ b/STPSLDemo/STPSLDemo.csproj @@ -1,4 +1,8 @@ - + + + + v3.5 + Debug AnyCPU @@ -10,7 +14,7 @@ Properties STPSLDemo STPSLDemo - v3.5 + v3.0 true @@ -28,6 +32,8 @@ 3.5 + Silverlight + $(TargetFrameworkVersion) true @@ -82,26 +88,38 @@ MSBuild:Compile Designer + MSBuild:Compile + Designer MSBuild:Compile Designer + MSBuild:Compile + Designer MSBuild:Compile Designer + MSBuild:Compile + Designer Designer MSBuild:Compile + MSBuild:Compile + Designer Designer MSBuild:Compile + MSBuild:Compile + Designer Designer MSBuild:Compile + MSBuild:Compile + Designer @@ -128,7 +146,7 @@ PreserveNewest - + + + + + + + 25 + + + \ No newline at end of file diff --git a/STPWPDemo/App.xaml.cs b/STPWPDemo/App.xaml.cs new file mode 100644 index 0000000..112aec6 --- /dev/null +++ b/STPWPDemo/App.xaml.cs @@ -0,0 +1,142 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Navigation; +using System.Windows.Shapes; +using Microsoft.Phone.Controls; +using Microsoft.Phone.Shell; + +namespace STPWPDemo +{ + public partial class App : Application + { + /// + /// Provides easy access to the root frame of the Phone Application. + /// + /// The root frame of the Phone Application. + public PhoneApplicationFrame RootFrame { get; private set; } + + /// + /// Constructor for the Application object. + /// + public App() + { + // Global handler for uncaught exceptions. + UnhandledException += Application_UnhandledException; + + // Standard Silverlight initialization + InitializeComponent(); + + // Phone-specific initialization + InitializePhoneApplication(); + + // Show graphics profiling information while debugging. + if (System.Diagnostics.Debugger.IsAttached) + { + // Display the current frame rate counters. + Application.Current.Host.Settings.EnableFrameRateCounter = true; + + // Show the areas of the app that are being redrawn in each frame. + //Application.Current.Host.Settings.EnableRedrawRegions = true; + + // Enable non-production analysis visualization mode, + // which shows areas of a page that are handed off to GPU with a colored overlay. + //Application.Current.Host.Settings.EnableCacheVisualization = true; + + // Disable the application idle detection by setting the UserIdleDetectionMode property of the + // application's PhoneApplicationService object to Disabled. + // Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run + // and consume battery power when the user is not using the phone. + PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled; + } + + } + + // Code to execute when the application is launching (eg, from Start) + // This code will not execute when the application is reactivated + private void Application_Launching(object sender, LaunchingEventArgs e) + { + } + + // Code to execute when the application is activated (brought to foreground) + // This code will not execute when the application is first launched + private void Application_Activated(object sender, ActivatedEventArgs e) + { + } + + // Code to execute when the application is deactivated (sent to background) + // This code will not execute when the application is closing + private void Application_Deactivated(object sender, DeactivatedEventArgs e) + { + } + + // Code to execute when the application is closing (eg, user hit Back) + // This code will not execute when the application is deactivated + private void Application_Closing(object sender, ClosingEventArgs e) + { + } + + // Code to execute if a navigation fails + private void RootFrame_NavigationFailed(object sender, NavigationFailedEventArgs e) + { + if (System.Diagnostics.Debugger.IsAttached) + { + // A navigation has failed; break into the debugger + System.Diagnostics.Debugger.Break(); + } + } + + // Code to execute on Unhandled Exceptions + private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e) + { + if (System.Diagnostics.Debugger.IsAttached) + { + // An unhandled exception has occurred; break into the debugger + System.Diagnostics.Debugger.Break(); + } + } + + #region Phone application initialization + + // Avoid double-initialization + private bool phoneApplicationInitialized = false; + + // Do not add any additional code to this method + private void InitializePhoneApplication() + { + if (phoneApplicationInitialized) + return; + + // Create the frame but don't set it as RootVisual yet; this allows the splash + // screen to remain active until the application is ready to render. + RootFrame = new PhoneApplicationFrame(); + RootFrame.Navigated += CompleteInitializePhoneApplication; + + // Handle navigation failures + RootFrame.NavigationFailed += RootFrame_NavigationFailed; + + // Ensure we don't initialize again + phoneApplicationInitialized = true; + } + + // Do not add any additional code to this method + private void CompleteInitializePhoneApplication(object sender, NavigationEventArgs e) + { + // Set the root visual to allow the application to render + if (RootVisual != RootFrame) + RootVisual = RootFrame; + + // Remove this handler since it is no longer needed + RootFrame.Navigated -= CompleteInitializePhoneApplication; + } + + #endregion + } +} \ No newline at end of file diff --git a/STPWPDemo/ApplicationIcon.png b/STPWPDemo/ApplicationIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..5859393ca1056103ba35d225773352a9fa3ab754 GIT binary patch literal 1881 zcmV-f2d4OmP)GXLPE9uD;d|3K9jFs0^O3no;*#kUHY6H}PH_^L3*aj} zl+rSw?L`W0p^tkju#a}u3PxyqFY3}?ZpgV`?z#P)?|kQbU67g4(Jt>MC@$|ToYbAv zoz$Jwoz$JwUyrEBh@^xBYY9T32$%4g4Eozd9YH8m>Im7iz@UwrH+y+`StMa0!Jlv1 zOs9{eP8~IOLbaYWZ(elNbZg1v$&=#~5`=udMY3Y~^2n$tPDrTrV}g_vPDsd`qdqj` z?(SZ2=x{`MxJ4Ea7yy62*t!)g2L{u*+?5%tV8G+?EYFApOLBK?H(-W0sdbrL7RKcs zEi7D+mK#@=wJ2&3^B#Z6SE|tW^ z&fa_A0KDdD7g}CkuGQ%*uYy_6tlm5}8JiaBN~M03ks%g~tMA@5>&#%lv|6osRa0w$GfX-lmv6;tg7E35t(xdFTQCUeAbpwWpTg5+|K7IY# zwbIg(hK5FUUmu3O*mrLl?KRUayoa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-5>B z`F?^uj5UIS0&A+OHhi}J_wsTa!}NN6eQllj6z=lWJG4TH)* z?`+z*0Yy=!W5up*A7no6n!nw*wo>MkzI-d?@orCP?%cM_FCIaX9;>6gpovZ%<&lG0MhzAcYIoOgsb z0n|ss&CTu6!-opA%OZibfuXl|${hS;XMd^jw!!)D4NmG#>Q3rT>i;k5{|Ybw$j9Fp Tu#Z&K00000NkvXXu0mjfnP|DN literal 0 HcmV?d00001 diff --git a/STPWPDemo/Background.png b/STPWPDemo/Background.png new file mode 100644 index 0000000000000000000000000000000000000000..e46f21d9407f1ae4d6fedcf793778f32bae3f06d GIT binary patch literal 3521 zcmcInXHZjHyQUKa0*D|z9EwQqn$QW&LN5a0(9}p#z|av07z0wI3P?4PNKpZi&_Sw4 zLlF)jASHB>Dnt^hfxGX|`|JMszCE+|nprb@t(o_I+M8@^ZNYs`CMWRa_{X2b%~(Y4zZGoHG0TeeRQ-3xz&pF>q?5Cn9|4FxbFSa1h; zjwu3)x4dE>KCH#zaAiRhDpgE3ysD%`9LDRo_6rwxdbIRUYCu4MRTEfTM@v$&tGk!E%3QMmgErV+_P0kPK2#3KPgk)p2??OnY?$-L(8itp8(PcD%WG=V4eWeBKBB#C zYZDE~%gLz^-$tmtn#cNPvSc8RfwlV(hoa{9zk~VXLOJ)XhsB7pKkMPS13jV&n4D9_wYu%NS)+IVL>be8L z3lCzHhQWlZ1CPyKy?QlPZpCbaLm$6cOzHuOJ$0hK@cyq$ScTc?U#gQegC6dd{;vrR%RV6J^?a&mHfe4OM1g~1BwAX}4N5{V?qJ|QqI zp&z;YIW1|_&(AO7*Q`33kv{G#TgY8<64uGNou)Awsz128yVz^RF5sp7a~Q|Nnaq60 zqqbE-FEW1Y%X*a36;G18RtF2oVS$H%vu@y_}E#CqsT z*9Ls0Gv-J`(#VciRP|v&8 zwU<;qJ94No{r$#1K5`l#?2-?0K8j)ju(hCWp^iujym;A|0tZ)}N84q)ww`j*_h*92 z%F33w9!N^$YqNvFU^NxY{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>qUibf8Uv`-5LR1rx}U&lZEbD-bz*ch z7&x)2N~r;%AF^sm>=@qKet#&LO$P)SKslLArZKV z0X#fBJly*^yb1Bh8)EA~Q5X#PN*XFF*MK@Y*Zi$M%i{TF#P`piKh*ob<~uumh9&-u zzhqJWy%|O5_(JH*vZ6-!aG=lV2SBFtjG-hD2!sXI@yM}dMh&JL(E9mF&$s}VZv4yZ z7q}Ep0KV_cwh&ue5l6I7$^4g@Xeg$Zt~C{hPw^1+q4#8syBCvMpDy;nt;Xz*$*!t@ z_4*|-zdS$FPfs2YPj|ps-Mc7{`(+ zaPeYMY?js@h8NSa`7xldu<+l>p!ts2#U55-G!qz`@+AX8D2rD0l#TWLS+vA|cEtpXb}@)WHY-Vw4#Wd98N+omYttII7v_He)|{>c literal 0 HcmV?d00001 diff --git a/STPWPDemo/MainPage.xaml b/STPWPDemo/MainPage.xaml new file mode 100644 index 0000000..1f95997 --- /dev/null +++ b/STPWPDemo/MainPage.xaml @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + +