Welcome to MSDN Blogs Sign in | Join | Help

The Silverlight 2 Beta 2 BluePrint for Sharepoint has just been release. It provides guidances and samples to learn and illustrate how to integrate Silverlight application with Sharepoint.

For more information: http://www.codeplex.com/SL4SP

1 Comments
Filed under:

[English]

Easy with the InkPresenter Control :-). This control sets the surface where we could draw.

It contains a Stroke Collection to set the style of our lines (color, size …). Each stroke contains a StylusPoint collection which represents points linked by our line

So, a line is defined by a set of points (Stylus Collection) linked to a style (Stroke)

To draw our line, we need to subscribe buttons and movements events of our mouse (or stylet for tablet pc).

image

MouseLeftButtonDown : Here we init the style of our line by instantiating a new Stroke object and by adding the first Styluspoint which represents the start point of our line.

image

MouseMove : We get the stylus point thanks to the current position of the mouse, and add it to our Inkpresenter control (throw the Stroke object)

image

MouseLeftButtonUp : We release the mouse capture. Our line is finished and we can delete the reference to the current stroke

image

image

[Français]

Tout simplement avec le contrôle InkPresenter :-). Ce contrôle va permettre de définir notre surface d’écriture.

Il est constitué d’une collection de Stroke définissant le style de nos traits (couleur, taille …). Chaque Stroke contient une collection de StylusPoint qui représente les points reliés par des traits.

Un trait est donc défini par un ensemble de points (Stylus collection) associé un style (Stroke)

Pour dessiner notre trait, nous allons nous abonner aux événements liés aux boutons et au mouvement de notre souris (ou de notre stylet pour les tablet pc).

image  

MouseLeftButtonDown : On initialise ici le style de notre trait en instanciant un nouvel objet Stroke et en lui ajoutant le premier StylusPoint qui constituera le point de départ de notre trait

image  

MouseMove : On y récupère la position courante de notre curseur et on ajoute le StylusPoint correspondant à notre contrôle InkPresenter (à travers notre instance d’objet Stroke)

image  

MouseLeftButtonUp : On arrête la capture de la souris. Note trait est terminé et nous pouvons supprimer le Stroke courant.

image  

image

2 Comments
Filed under:

[English]

It’s possible to display, in your browser, the rendering performance of your silverlight application (fps). For that, you just have to set, in the silverlight init params, the value of « EnableFrameRateCounter » property to true. This seetings is recomanded during your development.

HTML

image

ASPX

 image

[French]

Il est possible d’afficher, au sein de votre navigateur, le niveau de performance de votre application Silverlight (fps). Pour cela, il suffit de modifier, au sein des paramètres d’initialisation de Silverlight, la valeur de la propriété « EnableFrameRateCounter » à true. Ce paramètrage est recommandé au cours de vos développements.

image

 [English]

Patterns & practices team has just released the composite application guidance for WPF. This guidance brings architecture and design pattern recommendation which can help you split the development of your WPF client application across multiple development teams. The guidance includes a reference implementation, reusable library code, documentation, quick start tutorials and hands-on-labs.

More info: http://www.codeplex.com/CompositeWPF

image

[Français]

L’équipe patterns & practices de Microsoft vient de sortir un guide sur le développement d’applications composites en WPF. Ce guide offre des recommandations sur l’architecture et sur le design de patterns qui vont vous permettent de séparer les développements d’une application client WPF à travers de multiples équipes de développement. Ce guide inclut des exemples d’implémentations, des librairies ainsi que des tutoriaux et une documentation.

Pour plus d’information : http://www.codeplex.com/CompositeWPF

image

1 Comments
Filed under:

[English]

When you create a new SilverLight project, Visual Studio asks you which type of “hoster” you want to host your SilverLight Application.

clip_image002

The “copy to configuration specific folders” option allows you to set if you want to copy the .xap file to a configuration specific sub-folder (debug/release) of the target folder (ClientBin).

Example (if checked):

clip_image004

[Français]

Lors de la création de votre application, Visual Studio vous demandera au sein de quel type de « hoster » vous voulez héberger votre projet.

clip_image002[1]

L’option “copy to configuration specific folders” permet de spécifier si le copie du fichier .xap (application SilverLight compilée) se fait dans un sous répertoire spécifique à la configuration d’exécution (debug / release) du répertoire de destination (ClientBin).

Exemple (si coché):

clip_image004[1]

1 Comments
Filed under:

[English]

We will illustrate in this post how to create a simple Silverlight application.

To develop Web application with Silverlight 2, you need Visual Studio 2008 (express edition not yet supported L) and install the Silverlight Beta 2 chainer installer (http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=50a9ec01-267b-4521-b7d7-c0dba8866434). This installer will set up your environment (Visual Studio template, Sl runtime, SDK).

Once installed, you can create a new Silverlight project from Visual Studio from /New/Project/SilverLight/Silverlight Application.

Silverlight is not a standalone plug-in. It needs to be hosted in a HTML Web page. During the creation of your application, Visual Studio will ask you in which type of “hoster” you want to host your project (Web Site or simple HTML page). In our example, we choose Web Site.

clip_image002

Visual Studio generates two projects: The Silverlight project and the Web project which hosts the Silverlight Application.

The Silverlight project contains App.Xaml file which represents the base class of your SL application. By default, this class instanciates the Page.xaml User Control which represents the first control of your application.

The Web Project contains:

  • Default.aspx Web page which is not used (can be deleted)
  • A ClientBin repository which contains the Silverlight project compiled (as a .xap file)
  • A test page XXTestPage.aspx which hosts your Silverlight project thanks to ScriptManager ajax control and the Silverlight server control which references the .xap file.

image

  • A test page XXTestPage.html which hosts your Silverlight project thanks to the “object” javascript object which references the .XAP file

image

Finally, Visual studio creates for us different projects, references between the project, test pages (depends on what we want/need) and basic controls to start quickly our project.

We are going to customize our application by adding a TextBlock control to display a simple text in the Page.XAML.

image

Press F5 and you should see the following screen:

clip_image004

When you pressed F5, the Silverlight project was compiled and generated a .XAB file which is copied to ClientBinFolder of your Web Project.

You have just created your first SL application …

[Français]

Nous allons voir à travers ce post comment créer notre première application Silverlight.

Pour développer une application en Silverlight 2, vous aurez besoin de VisualStudio 2008 (la version Express n’est pas encore supportée) et d’y installer le composant additionnel correspondant (http://www.microsoft.com/downloads/details.aspx?FamilyID=50A9EC01-267B-4521-B7D7-C0DBA8866434&displaylang=fr) Ce composant installera les contrôles nécessaires au développement et à l’exécution d’une application en Silverlight 2 (Template Visual Studio, SDK, runtime …).

Une fois installé, vous pouvez créer une nouvelle application SL à partir de l’entrée de menu de Visual Studio /New/Project/SilverLight/Silverlight Application.

Silverlight est un plug-in qui ne peut pas s’exécuter seul. Il nécessite d’être hébergé au sein d’une page Web. Lors de la création de votre application, Visual Studio vous demandera au sein de quel type de « hoster » vous voulez héberger votre projet (Web site ou page HTML). Dans notre exemple, nous choisirons d’utiliser un projet de type « Web Site ».

clip_image002[1]

Visual Studio générera alors 2 projets: Votre projet Silverlight ainsi que le projet Web qui hébergera votre application SL.

Le projet Silverlight contient un fichier App.XAML qui représente la classe de base de votre application SL. Par défaut, cette classe instancie le contrôle utilisateur Page.Xaml qui constituera le premier contrôle de votre application.

Le projet Web est constitué:

  • D’une page Web Default.aspx qui n’est pas utile (peut être supprimée)
  • D’un répertoire « ClientBin » contenant le projet Silverlight sous forme compilée (.xap)
  • Une page de test XXTestPage.aspx qui héberge le projet Silverlight à l’aide du contrôle Ajax ScriptManager et du contrôle serveur Silverlight qui référence le fichier .xap

image

  • Une page de test XXTestPage.html qui héberge le projet Silverlight à l’aide du l’objet javascript “object” qui référence le fichier .Xap

image

Visual Studio nous a donc créé les différents projets, les références entre ces projets, des pages de tests (en fonction de ce que l’on veut) et des contrôles de bases pour pouvoir démarrer rapidement notre projet.

Nous allons personnaliser notre application en ajoutant le contrôle TextBlock pour afficher un texte simple au sein du contrôle Page.XAML

image

Appuyez sur F5 et vous devriez voir apparaître l’écran suivant:

clip_image005

En appuyant sur F5, votre projet Silverlight est compilé sous forme de fichier .XAB et est copié dans le répertoire ClientBin de votre projet WEB.

Et voilà, vous venez de créer votre première application Silverlight 2 …

1 Comments
Filed under:

[English]

Environment is a problem of everyone. Microsoft is among companies which are concerned by the conservation of our earth. His implication comes with the organization of worldwide competition about environment (Imagine Cup), by communication about best practices in IT and in their products.

You can find more information about environment problems in the following web site: http://www.microsoft.com/environment/

[Français]

L’environnement est un problème qui nous concerne tous. Microsoft fait parti des entreprises soucieuses de la conservation de notre planète. Son implication passe par de nombreuses actions telles que l’organisation d’un concours mondial sur l’environnement (Imagine Cup), la communication de bonnes pratiques au sein des structures IT ainsi que dans l’utilisation de ses produits.

Un site dédié aux problèmes de l’environnement et des bonnes pratiques à avoir est disponible ici.

http://www.microsoft.com/environment/

image

1 Comments
Filed under:

[English]

The new version of the .net framework (3.5) brings new features: C# 3, VB9, LINQ, extension methods etc. In WF, the main evolution comes with the integration of WCF (Windows Communication Foundation). It means:

  • Specific controls to call or export workflow activities in WCF
  • New hosting library
  • New WF templates in VS 2008

In this article (in French), I am explaining new WF functionalities in .net 3.5. I am illustrating that in implementing a service of recipes to generate chocolate cake’s one.

[Français]

La version 3.5 du .NET Framework apporte un grand nombre de nouveautés : C# 3, VB9, LINQ, méthodes d’extensions etc. Concernant WF, sa principale évolution tourne autour de l’intégration de WCF (Windows Communications Foundation). Cela se traduit par :

  • la présence de contrôles spécifiques pour exporter ou appeler un workflow en WCF,
  • Une librairie de hosting (hébergement de workflow) spécifique,
  • Des templates Visual Studio 2008.

A travers cet article, nous allons étudier les nouvelles fonctionnalités de WF présentes dans la version 3.5 du Framework. Afin de les illustrer, nous mettrons en place un service de recette de cuisine générant celle du gâteau au chocolat.

 

1 Comments
Filed under: ,

Silverlight 2 beta 2 will be publicly available later this week. This release includes the following features:

  • UI Framework: Beta 2 includes improvements in animation support, error handling and reporting, automation and accessibility support, keyboard input support, and general performance.  This release also provides more compatibility between Silverlight and WPF.
  • Rich Controls: Beta 2 includes a new templating model called Visual State Manager that allows for easier templating for controls. Other features include the introduction of TabControl, text wrapping and scrollbars for TextBox, and for DataGrid additions include Autosize, Reorder, Sort, performance increases and more.  Most controls are now in the runtime instead of packaged with the application.
  • Networking Support: Beta 2 includes improved Cross Domain support and security enhancements, upload support for WebClient, and duplex communications (“push” from server to Silverlight client).
  • Rich Base Class Library: Beta 2 includes improved threading abilities, LINQ-to-JSON, ADO.NET Data Services support, better support for SOAP, and various other improvements to make networking and data handling easier.
  • Deep Zoom: Beta 2 introduces a new XML-based file format for Deep Zoom image tiles, as well as a new MultiScaleTileSource that enables existing tile databases to utilize Deep Zoom. Better, event driven notification for zoom/pan state is another improvement in Silverlight 2 Beta 2. 
0 Comments
Filed under:

The goal of this post is to illustrate the inheritance concept in LINQ to SQL.

We use inheritance when we want to map a set of classes derived from the same base class with the same relational table.

Contact will be our Base Class:

[Table(Name = "Contact")]
[InheritanceMapping(Code = "Employee", Type = typeof (EmployeeContact), IsDefault = true)]
[InheritanceMapping(Code = "Company", Type = typeof(CompanyContact))]

public class Contact
{
     [Column(IsDbGenerated=true,IsPrimaryKey=true)]
     public Guid Id;

     [Column]
     public string Name;

     [Column(IsDiscriminator = true)]
     public string EntityType;
}

The InheritanceMapping attribute specify the corresponding derived class which will be identified by a special discriminator column. The Code parameter défines the value and the Type parameter défines the corresponding derived type. We have to had a field to store the discriminator value (EntityType in our sample). This field is mapped with a column which will have the value of the corresponing type.

CompanyContact and EmployeeContact derive from Contact

public class CompanyContact: Contact
{
     [Column]
     public string SubName;
}

public class EmployeeContact:Contact
{
     [Column]
     public string WebSite;
}

Those derived classes don’t need to have the table attribute. Because they derived from Contact class, they are mapped with same table than Contact.

The following class represents our DataContext:

public class MyDataContext : DataContext
{
     public Table<Contact> Contacts;
     public MyDataContext(string connection) : base(connection)
}

 

This script creates the correponding DataBase with two records:

image

We can check the result in the SQL Server :

clip_image002[4]

0 Comments
Filed under:

In France, FaceBook is coming since a few months … and it makes a lot of noise. What is cool with this social network, it’s that we can develop customs applications.

I decided to explain steps to create a windows form which get facebook information.

First of all you have to create a FaceBook application in facebook:

Subscribe to Facebook

  1. Add the Facebook developer application (http://www.facebook.com/developers/)
  2. Create new application
    • Facebook provide you an API Key and a secret
  3. Edit your application to fill the Canvas Page URL and the CallBack Url
  4. Save your settings

Now that you have the API Key and a secret, you can develop your application:

  1. Install the Facebook developer toolkit (http://www.codeplex.com/FacebookToolkit)
  2. In Visual studio, check in the toolbar that you have facebook items (FaceBookService with facebook.dll, FriendMap,FriendList with Facebook.Controls.dll)
  3. Create a Windows Application
  4. Drag and drop FriendMap, FriendList and buttonControl on your windows form
  5. Add the following Code:

 

public partial class Form1 : Form
{

public Facebook.Components.FacebookService _fbService;

public Form1()
{
       InitializeComponent();
       _fbService = new Facebook.Components.FacebookService();
       _fbService.ApplicationKey = "ApplicationKey";
       _fbService.Secret = "Secret";
       _fbService.IsDesktopApplication = true;
}

private void button1_Click(object sender, EventArgs e)
{
      Collection<User> users = _fbService.GetFriends();
      friendMap1.Friends = users;
     friendList1.Friends = users;
}

}

 

F5 and enjoy :-)

Scott has just announced the possibility to download and browse the source code of the .NET Framework library. It will be available with VS 2008 and the .NET Framework 3.5.

You can have more information and read the entire article on his blog:

http://weblogs.asp.net/scottgu/archive/2007/10/03/releasing-the-source-code-for-the-net-framework-libraries.aspx

The goal of this article is to explain how we can share and use messages definitions in Web Services architecture.

When you design your application, you need to specify messages to allow communication between layers. Messages definitions will be shared and distributed in a separate assembly. But, when you generate your proxy with wsdl.exe (or add web reference), the definition of your messages is the same but with a different namespace defined in you shared assembly.

With the framework 2.0, there are two possibilities to resolve this problem:

I : Expand the Generated Code

The goal is to use the partial class notion. Here, you don’t modify but you expand the generated code with partial class.

On the shared assembly (messages definitions):

1. Messages objects in your shared assembly should implement interface

On the server side:

1. Create a Web Method which returns an object defined in your shared assembly

On the client side:

1. Create a partial class with the same name that Messages define in the generated proxy

2. Call the Web Service and get the result :-)

II: Modify the generated code

The second solution is to use the Schema importer service which allows you to customize the code generated by wsdl.exe. The following article explain what is Schema importer service and how to use it:

http://www.microsoft.com/belux/msdn/nl/community/columns/jdruyts/wsproxy.mspx

I just received an email from Stan Vonog, a founder of Musigy – a company that was formed after its founders participated in Innovation Accelerator 2006. Stan and his team from Russia won the Imagine Cup 2005 in Japan with a p2p technology (http://spectrum.ieee.org/jul07/5297) for transmitting live audio and video streams in real time, with high quality and very low delays – so that musicians in different countries can play together over the Internet!

Musigy enabled the world's first distributed jazz festival – Jazz at the Speed of Light (http://jsl.musigy.com ) where world's jazz stars in Russia (the Red Square), Ukraine (the Black Sea) and the UK (Oxford) played live across 3,000 miles.

The guys also made a major 2007 New Year Internet concert on Russian National TV (http://blog.musigy.com/archive/2007/02/18/musigy-unites-georgia-and-russia-on-channel-russia.aspx ) – the event was viewed by 50 million people!

Tomorrow Musigy is releasing a beta version of its first consumer Internet product, Musigy Maker. Give it a try. You can be among the first people in the world to make music without geographic boundaries!  Sign up and download Musigy Maker beta at www.musigy.com/signup

The Imagine Cup 2007 finals have just finished last week in Seoul, Korea. The new winners are from Thailand, Korea and Jamaica. These three teams, plus Ireland, Mexico and Poland were awarded participation in the Innovation Accelerator – a two-week business incubation program designed by Microsoft and BT to transform Imagine Cup ideas into viable business realities.

Apparently Imagine Cup can bring not only the prize money, but also unlimited opportunities, fame and world domination:) Musigy guys were featured numerous times on TV (http://blog.musigy.com/archive/2007/06/22/musigy-on-nhk-in-japan.aspx) and even a glossy magazine for women (http://blog.musigy.com/archive/2007/05/04/musigy-in-gala-a-glossy-magazine-about-people-fashion-and-style-for-women.aspx)!!

So, go ahead and step up to competing in the Imagine Cup 2008, which will take place in the fabulous city of Paris!

1 Comments
Filed under:

Le recrutement pour le programme MACH a commencé depuis peu. Alors, si vous êtes passioné par les technologies Microsoft et que vous êtes motivé, la suite peut vous intérésser:

Lien direct: http://www.microsoft.com/france/travailler/etudiants/programmes/default.mspx

 

 

Un lien direct vers le journal métro publiant un article à ce sujet (avec un excellent témoignage p18 ;-) ) : http://metropoint.metro.lu/20070514_Paris.pdf

More Posts Next page »
 
Page view tracker