Friday, 16 March 2012
Virtual Box Guest additions 4.1.10 and Windows 8 Consumer Preview (Black Screen)
Tuesday, 2 August 2011
SpecFlow custom UnitTestProvider (Code generator) for Silverlight to access the Silverlight Test instance
public class SiverlightWithTestInstanceCustomGeneratorUnitTestProvider : MsTestSilverlightGeneratorProvider
{
public override void FinalizeTestClass(TechTalk.SpecFlow.Generator.TestClassGenerationContext generationContext)
{
base.FinalizeTestClass(generationContext);
var methods = from codeTypeMember in generationContext.Namespace.Types[0].Members.Cast()
where codeTypeMember.Name == "ScenarioSetup"
select (CodeMemberMethod)codeTypeMember;
var scenarioSetupMethod = methods.First();
var scenarioContext = new CodeTypeReferenceExpression("ScenarioContext");
var currentContext = new CodePropertyReferenceExpression(scenarioContext, "Current");
var scenarioContextExtensions = new CodeTypeReferenceExpression("ScenarioContextExtensions");
var setTestInstance = new CodeMethodInvokeExpression(scenarioContextExtensions, "SetTestInstance",
currentContext, new CodeThisReferenceExpression());
// Hmm. We have a little too much knowledge of where this should go, but it's after the call
// to testRunner.OnScenarioStart, and before FeatureBackground
scenarioSetupMethod.Statements.Insert(2, new CodeExpressionStatement(setTestInstance));
}
}
1: ScenarioContextExtensions.SetTestInstance(ScenarioContext.Current, this);
public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo)
{
TechTalk.SpecFlow.Async.AsyncTestRunner.RegisterAsyncTestExecutor(testRunner, new TechTalk.SpecFlow.Async.SilverlightAsyncTestExecutor(this));
testRunner.OnScenarioStart(scenarioInfo);
ScenarioContextExtensions.SetTestInstance(ScenarioContext.Current, this);
this.FeatureBackground();
}
var silverlightTest = ScenarioContext.Current.GetTestInstance<SilverlightTest>();
silverlightTest.TestPanel.Children.Add(myView);
I have not figured out if it is possible to configure specflow to read this from a different assembly, so for the time being you can
<generator path="..\..\packages\SpecFlow.1.7.0\tools" generateasynctests="true"></generator>
<unittestprovider name="customSL" generatorprovider="TechTalk.SpecFlow.Generator.UnitTestProvider.SiverlightWithTestInstanceCustomGeneratorUnitTestProvider" />
Thursday, 22 April 2010
Silverlight 4 Resources - Free training course
Silverlight 4 Training
Microsoft is offering a free Silverlight 4 training course, great place to get started.
The Silverlight 4 Training Course includes a whitepaper explaining all of the new Silverlight 4 features, several hands-on-labs that explain the features, and a 8 unit course for building business applications with Silverlight 4. The business applications course includes 8 modules with extensive hands on labs as well as 25 accompanying videos that walk you through key aspects of building a business application with Silverlight. Key aspects in this course are working with numerous sandboxed and elevated out of browser features, the new RichTextBox control, implicit styling, webcam, drag and drop, multi touch, validation, authentication, MEF, WCF RIA Services, right mouse click, and much more!
You can download the course here: http://www.microsoft.com/downloads/details.aspx?FamilyID=24CEA29E-042E-41C9-AA16-684A0CA5F5DB&displaylang=en
You can also view the course at Channel 9 http://channel9.msdn.com/learn/courses/Silverlight4/
Course content:
What's New in Silverlight 4
Make this your first stop with Silverlight 4 and read or download the 60+ page whitepaper! Walk through the new features in Silverlight 4, find learning materials and additional resources. This covers all of the new business centric features, features for rich media experiences, Expression Blend and Visual Studio tooling enhancements, and new Out of Browser features!
Silverlight 4 New Features
Check out these 5 hands on labs that demonstrate some of the newest features in Silverlight. Explore multi touch, drag and drop, numerous out of browser features, learn to interact with the webcam, create a rich text notepad using the RichTextBox control, printing your content, and more!
Silverlight 4 Business Apps: Module 1 - Introduction Silverlight 4 Business Apps
John Papa and Ian Griffiths discuss the key areas that the Building Business Applications with Silverlight 4 course focuses on. This module is the overview of the course which covers many key scenarios that are faced when building business applications and how Silverlight can help address them.
Silverlight 4 Business Apps: Module 2 - Event Manager using WCF RIA Services
This is module 2 of the Building Business Applications with Silverlight 4 course. This module sets the stage with the course's Event Manager application. It discusses using WCF services vs WCF RIA Services. Then it walks you through integrating WCF RIA Services into the solution to support reading, editing and inserting entities. This unit also covers the key aspects of data binding and page navigation.
Silverlight 4 Business Apps: Module 3 - User Registration with Authentication, Validation, Rich Text, Styling, and Commands
User Registration with Authentication, Validation, Rich Text, Styling, and Commands This is module 3 of the Building Business Applications with Silverlight 4 course. This module covers authentication, using the DataForm, setting up validation for the model, the RichTextBox control, implicit styling, commanding, and the fundamentals of MVVM.
Silverlight 4 Business Apps: Module 4 - User Profile with Drop Target, Webcam, Clipboard
This is module 4 of the Building Business Applications with Silverlight 4 course. This module covers dropping a file onto a Silverlight application, programmatic clipboard access, and accessing the webcam.
Silverlight 4 Business Apps: Module 5 - Schedule Planner with Grouping and Right Click
This is module 5 of the Building Business Applications with Silverlight 4 course. This module covers grouping in a DataGrid and an ItemsControl. It also covers the new Fluid UI visual states, right mouse click, and word based text trimming.
Silverlight 4 Business Apps: Module 6 - Printing the Schedule
This is module 6 of the Building Business Applications with Silverlight 4 course. This module covers the fundamentals of printing in Silverlight. It also offers some techniques for printing multiple pages.
Silverlight 4 Business Apps: Module 7 - Event Dashboard Running Out of Browser
This module covers several out of browser features including creating toasts, window placement, elevated trust, and native integration.
Silverlight 4 Business Apps: Module 8 - Advanced Out of Browser and MEF
This module covers more out of browser features including creating custom chrome, the window closing event, silent installs, and XAP signing. It also covers MEF and how it enables composability, supports a plug in model, and can dynamically load XAP files.
Wednesday, 21 April 2010
MEF Managed Extensibility Framework - Resources
Note: The aim of this document is to gather information and resources, it is a living document, so feel free to add comments to add or update.. Content is extracted from sources, so I am just collecting information for everybody's reference. I will probably end up putting this in a wiki / codeplex but for administration is easier to start here.
MEF
Extensibility is a key design point for many applications such as the Microsoft Office applications with their plug-in model for extensibility. Silverlight 4 ships with a new framework, the Managed Extensibility Framework (MEF), which provides a flexible way of building extensibility into your applications with capabilities for discovering and composing extensions at run-time in a dynamic and loosely-coupled way.
MEF can be found in .Net 4, Silverlight 4 and for Silverlight 3 in codeplex http://mef.codeplex.com/
Introduction
For an introduction of MEF you can start with this Presentation / Demo of Mike Taulty
In this demo-based session he takes a tour around MEF and look at its capabilities for building extensibility into your applications and also how it can be used in implementing the Model-View-ViewModel (MVVM) pattern in Silverlight applications.
So why use MEF
Ten Reasons to use the Managed Extensibility Framework
Learning MEF
You can find in Channel 9 a video series to learn MEF, created also by Mike Taulty
http://channel9.msdn.com/tags/learnMEFSL4/
The video series include:- MEF & Silverlight 4 Beta - Part 1, Introduction
- MEF & Silverlight 4 Beta - Part 2, Imports & Exports
- MEF & Silverlight 4 Beta - Part 3, Catalogs
- MEF & Silverlight 4 Beta - Part 4, Recomposition
- MEF & Silverlight 4 Beta - Part 5, the PackageCatalog
- MEF & Silverlight 4 Beta - Part 6, Locating Defaults & ExportProviders
You can take an step further and in this video Glenn Bloc shows how to use MEF to load and unload XAP files on demand.
Silverlight TV 11: Dynamically Loading XAPs with MEF
If you want to understand what is going on in the Framework you can also use the http://mefvisualizer.codeplex.com/ Mef Visualizer
Samples
In http://mef.codeplex.com/ you will find in the source code plenty samples to start with.
Supporting Frameworks
MEF Contrib
http://mefcontrib.codeplex.com/
In the MEF Contrib project you will find: A generic Catalog, Unity integration (this can become very handy if you are using PRISM), and Programming Models like Provider Model and Convention Model. You can read more in the Documentation and Features section.
PRISM and MEF
So what is the deal with PRISM and MEF? In PRISM 4 there will be full support / guidelines for MEF, you can read about here and here in the blogs of Glenn Bloc and Davil Hill.
In these blogs Jeremy Likness describes a good way to start on how to glue everything together
- PRISM, MEF and MVVM Part 1 of 3: Unity Glue
- PRISM, MEF, and MVVM Part 2 of 3: Making PRISM MEF Friendly
Or it also describes how you can use MEF instead of PRISM
- MEF instead of PRISM for Silverlight 3 Part 1 of 2: Dynamic Module Loading
- MEF instead of PRISM for Silverlight 3 Part 2 of 2: Region Management
Caliburn
There is another alternative to PRISM, you can use Caliburn as your framework of choice, which includes already MEF support.
Here is the current adapter source code.
Tuesday, 13 May 2008
Prism Silverlight - Prism Contrib
Patterns & Practices: Prism Contrib - Home
Unity Dependency Injection IoC Screencast
UnityContainer Resolve and BuildUp Methods
UnityContainer RegisterType and RegisterInstance Methods
UnityConfigurationSection for Web.config and App.config
ASP.NET MVC Framework. ASP.NET Model View Presenter Pattern.
If you are currently using Dependency Injection this is a pretty good alternative, I do like the ability to define the Registration type for Singleton, resolve properties without the need to decorate them, and from the screencast I like both examples for MVC and MVP.
Monday, 3 March 2008
AD When does my Password Expire?
Well with a bit of googling I have found this great post by Ryan Dunn
Using the PasswordExpires class from the post, and a bit of refactoring on the main class we can quickly get our personalize expiry page:
protected void Page_Load(object sender, EventArgs e)
{
PasswordExpires pe = new PasswordExpires();
string[] a = Context.User.Identity.Name.Split('\\');
string userName = a[1];
Response.Write(String.Format("Password Policy: {0} days", 0 - pe.PasswordAge.Days));
Response.Write("
");
TimeSpan t = pe.WhenExpires(userName);
if (t == TimeSpan.MaxValue)
Response.Write(String.Format("{0}: Password Never Expires", userName));
else if (t == TimeSpan.MinValue)
Response.Write(String.Format("{0}: Password Expired", userName));
else
Response.Write(
String.Format("Password for {0} expires in {1} days at {2}", userName, t.Days, DateTime.Now.Add(t)));
}
Thursday, 28 February 2008
SOA'izing MSMQ with WCF (and Why It's Worth It) - Home
Worth having a look!!!
Tuesday, 26 February 2008
JMS based Web Services in Oracle App Server Part 1: WCF Interoperability - Jesus Rodriguez's WebLog
Jesus Rodriguez explains in his WCF / Oracle interoperability series how WCF can consume a JMS queue exposed as a web service with Oracle app Server.
Monday, 25 February 2008
Upgrading Software Factories from 2005 to 2008 (Problems uninstalling)
1st Install the windows installer clean up.
2nd Remove with the windows installer clean up the factories and guidance packages.
3rd Install your guidance package in 2005 version.
4rd Uninstall it again.
5th Using the guidance troubleshoot get all the registry keys
6th Delete registry keys.
7th Install.
Tuesday, 19 February 2008
LINQ to DataSets
http://manning.com/marguerie which explains the usage of LINQ with DataSets. Worth having a look.
You will need to search for it, because direct links do not work. (Thanks for the info)
Monday, 18 February 2008
LoLCode
Here are some examples:
Hello world
http://lolcode.com/examples/hai-world
OpenFile
http://lolcode.com/examples/filezorz
I think is easier to debug than regular expressions!
Friday, 15 February 2008
SOA Guerrilla (Jim Webber) , ESB and SOA
the dangers on why you should not burry your integration, transformation etc in the ESB. (Well why you should not use a proprietary ESB). I myself I am not against it of having an ESB but you should follow standards to stop vendor lock in (BPEL) for system to system processes, and just use the ESB to simplify the management of your SLA (QoS), temporary contract resolution and management of policies, and even addressing. (its just a tool!)
Using standards on web services like WCF and WSIT you can achieve things like policy, reliable messaging, transaction support etc, but nevertheless the ESB will help you on said maintainability.
The majors risk is that the ESB sometimes won’t manage to comply as quick with new standards as development tools (You can overcome this by temporarily bypassing the bus until these are available)… and don’t forget that you will need good governance to don’t replicate or create new spaghetti.
And remember the 4 tenets of SOA: http://www.bpminstitute.org/articles/article/article/the-four-tenets-of-service-orientation.html
Wednesday, 13 February 2008
Continuous Production - Production-ready software…any time
And I defenetly agree with the article but in an enterprise enviroment also a good architecture based around Decoupling: SOA, BPM, Composite Applications (portlets, cap, wcsf), Modularitation, dependency injection, and Governance around depencies: services, object, modules will allow you to succeed!!
Enable the Create Translator recipe for all projects.
Our agile approach meant that we needed to have installed both factories side by side on the same machine and to overcome the issue that the GAX / GAT is only able to run in either 2005 or 2008 (Orcas) I decided to run WCSF in 2008 following the instructions of Ezequiel.
The Web Client Software Factory does not have the Create Translator recipe so whilst I could translate my model to my data contracts in the WSSF i could not translate my Datacontracts to my client model. After a bit of playing around I have managed to enable it, so here are the steps:
1. Have installed the Web Service Software Factory. :)
2. Modify the file:
%Program Files%\Microsoft Service Factory V3\Guidance Package\Recipes\Binding.xml
From:
To:
3. Close all instances of Visual Studio.
4. Open Visual Studio , go to Guidance Packages and add the Web Service Software Factory.
Note: If it is already there remove it and added it again to refresh the bindings
5. In the project you are creating add a folder “GeneratedCode".
Thursday, 31 May 2007
SOA, So What?
Abstract: Talk to a business person about SOA, and you’ll get a blank stare. Find out how Business and IT can speak the same language through business process management and get all their goals met! Technologists know that Service-oriented architecture (SOA) promises to give organizations a way to mix and match services for more agility – by relying less on packaged apps and more on reusable services. But you may be scratching your head on how to sell this premise to business people who just see another technology acronym with huge dollar signs attached. Start speaking their language and show them how business process management (BPM) allows everyone to solve real, quantifiable business problems via an SOA strategy. Attend this event and see how leading companies start with BPM in order to sell the SOA vision – so they can get business people to be more specific in what they need out of their systems in order to obtain measurable efficiencies and improvements. Come hear John Rymer of Forrester Research, describe a successful strategy for bridging the IT and Business gap.
SOA, So What?
