Tuesday, March 8, 2011

How Do I Register A Trailer

Article in the series "2010 TFS Object Model" on DomusDotNet

was published today (link ) the fourth article of the series dedicated to Team Foundation Server 2010 Object Model related to the handling of work items.

Technorati tags: tfs 2010 , ,

Sunday, March 6, 2011

Can Men Wax Their Balls

La PEC nel processo amministrativo: un passo avanti

As noted, Article 136 of the Code provides that the administrative process "1. The defenders in the first state in the action or defense on its certified e-mail address and your address where you wish to receive fax communications related to the process. Once this information is expressly deemed to know the communications received by the above means in accordance with the rules, and regulations, in force. And 'burden of the defenders to communicate to the secretariat and the parties made any variation of such data. 2. Defenders provide copies made in electronic form of all the parties' submissions lodged and, where possible, of documents and any other act of the facts. The difensore attesta la conformità tra il contenuto del documento in formato elettronico e quello cartaceo. Il deposito del materiale informatico, ove non sia effettuato unitamente a quello cartaceo, è eseguito su richiesta della segreteria e nel termine da questa assegnato, esclusa ogni decadenza. In casi eccezionali il presidente puo' dispensare dall'osservanza di quanto previsto dal presente comma" .

Come scrivevo qualche tempo fa, alcune cancellerie, in sede di prima applicazione della norma, avevano optato per un'interpretazione piuttosto restrittiva, imponendo che il c.d. deposito informatico avvenisse fisicamente mediante la consegna di un cd rom contenente copia informatica degli atti già filed in paper form.

Fortunately, as pointed out by George Rognetta , the State Council "duty paid" means the deposit (although always in addition to the paper) by PEC, which can now also be Teleservices. A small step in the right direction.

statements here.


Saturday, March 5, 2011

Chefmate Breadmaker Hb-12w

Copyright: arriveremo alla modica quantità per uso personale

Via facebook learn the story happened to Bryan McCarthy (arrested) and its site channelsurfing.net (has seized ).

The site in question was limited to linking to a range of resources on the network and that allows viewing of entertainment and sports broadcasted by the U.S..

not a guest, or any material reproduced.

As unreasonable it may seem, is an approach also followed by our teaching cases as giurispriudenza Calciolibero-Coolstreaming (a criminal) and free TV (in (civil).

The problem, in my opinion, is that (beyond the purely legal figure) the conduct complained of is required by virtually every user on the network: this blog, for example, has numerous links to resources that are on the web in an "abusive" and not because I'm a dangerous criminal but only because the law of copyright is so intrusive as to make illegal virtually every use enabled by new technologies even in the absence of any economic offensiveness.

is, then, one wonders whether between criminality and the criminality there is not an entirely alien to the law: the number of links.

If there are too many, you become a pirate hardened. If they make a moderate use, no problem.

will end that future will be modeled on copyright the law on drugs.

Rebuilding Snowmobile Crankshafts

MVP Summit 2011: the return

MVP Summit 2011 is over and I have just returned after a journey of nearly 18 hours ( between flights and expected).

The budget of the Summit is very positive: a week of full immersion in the Microsoft world to a place I always dreamed of visiting.

I met him in person MVP Italians who knew only through Facebook, Twitter and forums.

I saw almost 13 years after the legendary Enzino (only sin was not able to share more time with him but I hope to make my soon).

I personally knew the group RISE Contracts Code and in particular Francesco Logozzo (a great, and I thank you for your patience), Mike Barnett and Manuel Fähndrich . Enter the Building 99 (Research and Development) was an indescribable feeling.

IMG_0324

Turn to the Microsoft campus was for me as a child to turn to DisneyWorld. Simply fascinating! At

end it was a very successful summit, which leaves me in the mouth, want to return. An experience at least once in their lifetime.

thank all those who have allowed this, and at this point, I will work hard to reconfirm the MVP in order to regain the ability to go back!

Technorati tags: mvp, mvp summit

Thursday, February 17, 2011

Brunswick Zone Bowling

TFS2010 Object Model: TeamProjectPicker

the TFS 2010 object model provides a window to allow our users to select a TFS server, a collection project or a project.

The window is implemented by the class TeamProjectPicker Microsoft.TeamFoundation.Client which is in the namespace (assembly Microsoft.TeamFoundation.Client.dll).

TeamProjectPicker allows some flexibility because it can be used to select a collection project, a project or a series of projects.

Before looking at how we can achieve this, we see how the class is structured.

The class has three constructors that allow you to handle the possibility of choosing what to select and what credentials provider to use.

In particular, the most comprehensive manufacturer is as follows:

  1. Public Sub New ( ByVal mode As TeamProjectPickerMode ,
  2.                  ByVal disableCollectionChange As Boolean ,
  3.                  ByVal credentialsProvider As ICredentialsProvider )

L’argomento mode, di tipo TeamProjectPickerMode, permette di selezionare la modalità di selezione e può assumere i seguenti valori:

  • NoProject : You can select the server and project collection;
  • SingleProject : You can select only one project
  • multiproject: You can select multiple projects.

The following figure illustrates how the different options:

SNAGHTML11981afb

disableCollectionChange The argument allows you to decide whether it should be automatically selected collection of default (false) that can not be changed by the user or not (true).

Finally, the argument credentialsProvider used to set the credentials provider to use in case the connection a TFS non disponga di credenziali valide. Il provider da noi impostato verrà richiamato nel momento in cui , a causa della mancanza di credenziali, l’utente clicca sul link “Use different credentials”.

La GUI, una volta istanziata, può essere personalizzata (a dire il vero non molto) utilizzando le seguenti proprietà:

  • AcceptButtonText : permette di impostare il testo che appare sul bottone di selezione;
  • HelpTopic : permette di impostare l’argomento della guida relativo al dialog;
  • Text : permette di impostare la caption del controllo.

e può essere mostrata all’utente with ShowDialog (as usual dialog windows forms).

The class exposes, finally, the two properties to retrieve the collection selected by the user (type of property SelectedTeamProjectCollection TfsTeamProjectCollection) and projects (SelectedProjects type ProjectInfo).

The following piece of code displays the dialog selection in multi project and retrieves the user-selected values:

  1. Dim pp = New TeamProjectPicker ( TeamProjectPickerMode . Multiproject,
  2. False ,
  3. New UICredentialsProvider ())
  4. If pp.ShowDialog () = Windows.Forms. DialogResult . OK Then Dim
  5. collection = pp.SelectedTeamProjectCollection
  6. Dim projects = pp.SelectedProjects
  7. '
  8. ' Use collection of projects and
  9. '
  10. End If

Before concluding I would like to report the post SetDefaultSelectionProvider method whose purpose is to allow you to change the logic with which TeamProjectPicker the server recovers, the collection and projects by default.

object as an argument of the method is provided for any class that implements the interface ITeamProjectPickerDefaultSelectionProvider. The interface provides the following methods:

  • GetDefaultCollectionId : Returns the GUID of the collection default server which is Uri passt by subject;
  • GetDefaultProjects : Uri returns a list of projects relating to the collection where Guid is passed to argument;
  • GetDefaultServerUri : Returns the URI of the server default.

This allows us to customize the logic by which the picker selects and proposes projects to the user.

Finally, the picker is a Windows Forms object, so you must reference the System.Windows.Forms assembly.

Technorati tags: object model tfs, tfs 2010 ,

Wednesday, February 16, 2011

Aspiration Of Blood Meaning

101 Async samples

Vi segnalo un post di Alessandro Del Sole in cui viene riportata la notizia che sono disponibili, sul sito di Lucian Wischik un insieme di esempi sulle funzionalità di Async attualmente in CTP.

L’indirizzo del sito è il seguente: AsyncSamplesSilverlight

 

Tag di Technorati: ,

Wednesday, February 9, 2011

Crick In Neck A Virus

VB.NET: retrieve the assemblies referenced in our application

La classe Assembly prevede il metodo GetReferencedAssembly() per recuperare l’elenco degli AssemblyName ralativi agli assembly referenziati da un determinato assembly.

The problem is that if we have a structure with more dll referenced in the chain, the method returns only the first level of the same chain.

Suppose we have the following structure:

image

or the project AssemblyExtension reference the dll AssemblyExtensionLIB1 which, in turn, reference the AssemblyExtensionLIB2.

In this case, the method GetReferencedAssembly (), applied to an assembly AssemblyExtension, returns the following list:

SNAGHTML4498867

As you can see there is no trace of AssemblyExtensionLIB2. The following method

di estensione provvede ad eseguire un algoritmo ricorsivo per recuperare una lista di AssemblyName contenente tutte le reference dell’assembly:

  1. Imports System.Runtime.CompilerServices
  2. Imports System.Reflection
  3.  
  4. Module AssemblyExtension
  5.  
  6.     < Extension ()> _
  7.      Public Sub GetAllReferenceAssemblies( ByVal sourceAssembly As Assembly ,
  8.                                           ByVal allowGacAssembly As Boolean ,
  9.                                           ByVal list As ICollection ( Of AssemblyName ))
  10.          If sourceAssembly Is Nothing Then Throw New ArgumentNullException ( "Source Assembly" )
  11.          If list Is Nothing Then Throw New ArgumentNullException ( "Destination List" )
  12.         list.Add(sourceAssembly.GetName())
  13.          If allowGacAssembly OrElse Not sourceAssembly.GlobalAssemblyCache Then
  14.              Dim assemblies = sourceAssembly.GetReferencedAssemblies()
  15.              For Each assemblyName In assemblies
  16.                  Dim query = From a In list _
  17.                              Where a.FullName = assemblyName.FullName _
  18.                              Select a
  19.                  If query.Count = 0 Then
  20.                      Dim assembly As Assembly = assembly.Load(assemblyName.FullName)
  21.                     assembly.GetAllReferenceAssemblies(allowGacAssembly, list)
  22. End If Next
  23. End If End
  24. Sub End Module

The extension method is applicable on any assemble and the parameters are:

  • allowGacAssembly: indicates whether to search the references in DLLs contained in the GAC;
  • list: the list that will contain AssemblyName search result.

If your project before writing:

  1. Dim list = New List (Of AssemblyName )
  2. Assembly. GetEntryAssembly (). GetAllReferenceAssemblies ( True , list)

We get:

SNAGHTML46ed88a

allowGacAssembly While if we set = false:

SNAGHTML46fb735

Attenzione: il metodo GetReferencedAssembly restituisce gli assembly effettivamente referenziati (cioè quelli per i quali c’è almeno un tipo utilizzato) e non quelli inseriti nelle referenze di Visual Studio.

 

Monday, February 7, 2011

North Face Denali Fluffy

TFS2010 Object Model: we manage the project collections

In questo post vorrei porre l’attenzione su come utilizzare l’object model di TFS per gestire le Project Collection, cioè come utilizzare  da codice i servizi messi a disposizione dalla piattaforma TFS per creare, eseguire il detach o l’attach delle project collections del nostro server.

L’object model di TFS mette a disposizione l’interfaccia ITeamProjectCollectionService implementata da quelle classi che hanno la capacità di gestire le project collections.

Per prima cosa recuperiamo questa classe, utilizzando il metodo GetService (ereditato dalla classe TfsConnection) della TfsConfigurationServer:

  1. Public Sub GetTeamProjectService()
  2.     tpcService = CType ( tfs .GetService( Of ITeamProjectCollectionService )(), ITeamProjectCollectionService )
  3.      Console .WriteLine( "ITeamProjectCollectionService ricavato!" )
  4. End Sub

dove tfs è un’istanza di TfsConfigurationServer ricavata tramite il seguente pezzo di codice:

  1. Public Sub CreateTFSInstance( ByVal server As String )
  2. & Try
  3. # 160; tfs = TfsConfigurationServerFactory . GetConfigurationServer ( New type (server),
  4. : & # 160; : & # 160; ; New UICredentialsProvider ())
  5.          tfs .EnsureAuthenticated()
  6.          Console .WriteLine( "Instanza di TFS creata!" )
  7.      Catch ex As Exception
  8.          Console . WriteLine ( "Error connecting to TFS: {0}" , ex . Message) End
  9. Try End Sub

Once recovered the service instance that implements ITeamProjectCollectionService we have a number of methods that allow us to "play" with the project collections.

Create a collection of projects

methods of collection management projects are generally methods whose execution may not take long and that is why we introduce the concept of ServicingJobDetail and append operations.

In fact the method that we use for the creation of a project is the collection method QueueCreateCollection that "appends" the task of creating the collection and returns an object of type ServicingJobDetail we can ask to have knowledge of Avenza Dellea state ' transaction.

An example of code for creating a collection is as follows:

  1. Dim job = tpcService . QueueCreateCollection (collName,
  2. & # 160; , & # 160; ; String . Format ( "{0} - code created by" , collName)
  3. & # 160; & # 160; False ,
  4.                                             String . Format ( "~ / {0}" collName,),
  5. , & # 160; ; Microsoft.TeamFoundation.Framework . Common. TeamFoundationServiceHostStatus . Started,
  6. & # 160; & # 160; Nothing )
  7. Dim tpcoll = tpcService . WaitForCollectionServicingToComplete (job)

QueueCreateCollection version of the method we are using includes the following topics:

  • name is the name we intend to give to our collection;
  • description: the description of the collection;
  • IsDefault: indicates whether the collection we're creating is the default or not;
  • VirtualDirectory: is the virtual directory in which to place the collection. in our case we use the name of collection was preceded by "~/";
  • : indicates the state in which the collection should be created. In our case the status is Started;
  • servicingTokens: it is an IDictionary (Of String, String) parameters that may contain useful accessories for id creation of the collection.

When we leave the previous method, we can stand waiting for the completion of the creation of the collection, with the methodology WaitForCollectionServicingToComplete. This will end when the transaction is complete and return an object of class TeamProjectCollection with information on the collection itself.

It 's interesting to observe the operation of creating the collection using the administrative console of TFS:

image

Detach a project collection exposed by

Another feature that we are examining is that of detach a collection project.

To run the detach a collection of projects is necessary to have the ol'istanza TeamProjectCollection or GUID of the collection and call the appropriate overload of the method QueueDetachCollection ITeamProjectCollectionService interface.

The following code snippet shows how to retrieve TeamProjectCollection a name from the collection of projects and run the detach:

  1. Dim collection = (c From In tpcService . GetCollections (). ToList ()
  2. , & # 160; Where c . collName Name =
  3. , & # 160; Select c). FirstOrDefault ()
  4. If collection IsNot Nothing Then
  5. Console . WriteLine ( " ; Detach collection begun! ")
  6. Try
  7. & # 160; Dim connectionString As String = Nothing
  8. Dim job = tpcService .QueueDetachCollection(collection,
  9.                                                     Nothing ,
  10.                                                     "Sto fermando la collection!!" ,
  11.                                                    connectionString)
  12.  
  13.          Dim tpcoll = tpcService .WaitForCollectionServicingToComplete(job)
  14.          Console .Write( "Detach Collezione Ok: connectionstring={0}" , connectionString)
  15.      Catch ex As Exception
  16. Console . Write ( "Failed to detach the collection: {0 } ", ex . Message)
  17. End Try
  18. & # 160; Console . WriteLine () Else
  19. Console . WriteLine ( "The collection does not exist!" )
  20. End If

Anche in questo caso, il metodo QueueDetachCollection restituisce un oggetto di classe ServicingJobDetail grazie al quale siamo in grado di comprendere quando l’operazione ha termine.

I parametri utilizzati nella chiamata al metodo di detach sono:

  • teamProjectCollection : è l’istanza di TeamProjectCollection che identifica la collezione da sganciare;
  • servicingTokens : si tratta di un IDictionary(Of String,String) che può contenere parametri accessori utili al detach della collezione;
  • collectionStoppedMessage : è il messaggio warning that appears, for example, in the administration console TFS detach during operation;
  • detachedConnectionString: it is a return value to the caller, containing the connection string of database "dropped" from TFS that can be possibly hung up in another TFS.

Attach a project collection

The inverse of a function to detach the collection is a project that allows you to attach a hook databese (containing a collection of projects) to TFS server.

The method used for this operation is QueueAttachCollection which provides a couple of simple overload of the piuù which has three parameters:

  • databaseConnectionString: is the connection string of the database containing the collection of projects;
  • servicingToken: it is an IDictionary (Of String, String) parameters that may contain accessories that are needed to detach the collection;
  • cloneCollection: indicates whether to run a clone of the collection.

The following code snippet shows how to perform the attach of a collection given the connectionString:

  1. Dim job = tpcService . QueueAttachCollection (databaseConnectionString,
  2. & # 160; & # 160; Nothing ,
  3.                                             True )
  4.  
  5. Dim tpcoll = tpcService .WaitForCollectionServicingToComplete(job)

Come visto in precedenza possiamo sfruttare il job restituito dal metodo di attach  per capire quando il lavoro è concluso.

Tra i metodi messi a disposizione dall’interfaccia vista in questo post abbiamo anche il metodo che può essere utilizzato per eseguire l’attach di un database di TFS precedente alla versione 2010.

A compendio di questo post vorrei allegare un esempio di console sviluppata con Visual Studio 2010 che permette di integrare le funzioni viste.

The console provides the name of the TFS server in the form http://server:8080/tfs, is passed as an argument.

Sunday, January 30, 2011

Jesse Jane Best Movie?

TFS 2010 object model: recovery projects

In the previous post (link , link ) we saw how to use the TFS 2010 object model to connect to a TFS server and recover the project collection therein.

Niche In this post we will see ways to retrieve the properties of these projects within the project collections.

Query on server nodes

The first way is to use a mechanism similar to that seen in the previous post for the recovery of the collections based on the use of the method QueryChildren property CatalogNode:

  1. Dim tfs = TfsConfigurationServerFactory . GetConfigurationServer ( New Uri ( "http://server:8080/tfs" )
  2.                                                                 New UICredentialsProvider ())
  3. Dim allProjects = tfs.CatalogNode.QueryChildren({ CatalogResourceTypes .TeamProject},
  4.                                            True ,
  5.                                            CatalogQueryOptions .IncludeParents)

In questo caso otteniamo una collezione in sola lettura di CatalogNode nella cui proprietà Resource sono presenti le proprietà del progetto (nome, descrizione, etc., etc.).
Poichè abbiamo utilizzato l’opzione IncludeParents, otteniamo che, per ogni catalogNode, la proprietà Parent contiene il nodo relativo alla collection di appartenenza.
Il parametro recurse=true nella precedente query è fondamentale in quanto i progetti non sono direttamente contenuti nel server.
Se mettiamo recurse=false otteniamo una collezione vuota.

Se volessimo ottenere i progetti contenuti in una specific collection, we could use a LINQ query like this:

  1. Dim tfs = TfsConfigurationServerFactory . GetConfigurationServer ( New Uri ( "http://server:8080/tfs" ) ,
  2. , & # 160; , & # 160; ; New UICredentialsProvider ())
  3. Dim allProjects = tfs.CatalogNode.QueryChildren({ CatalogResourceTypes .TeamProject},
  4.                                            True ,
  5.                                            catalog query options . Include parents)
  6. Dim collProjects = From n In allProjects . OfType ( Of CatalogNode ) ()
  7. & # 160; ; Where = n.ParentNode.Resource.DisplayName "DomusDotNet"
  8.                      Select n

Query sui nodi della Project Collection

Un altro modo per ottenere i progetti presenti all’interno di una collection è quello di eseguire una query sui nodi contenenti le risorse direttamente su un’istanza di TfsTeamProjectCollectionNel precedente post della serie, abbiamo visto i tre modi possibili per TfsTeamProjectCollection get an instance of the class. Suppose, then to have one and want to retrieve the properties of the projects in it:

  1. Dim collProjects tfsColl1.CatalogNode.QueryChildren = ({ CatalogResourceTypes . TeamProject},
  2. & # 160; , & # 160; , & # 160; False ,
  3.                                                          CatalogQueryOptions .None)

In questo caso non serve la recursione e il recupero dei nodi padre perchè i progetti sono gerarchicamente disposti sotto la collection.

 

Tuesday, January 25, 2011

Strep Throat Symptoms And Teethache

Event Online Application Development with VB.NET by WP7 WPF Tips & Tricks

I must point out that the online event will be held on January 27 at 21:00. Speakers of the event will

Alessandro Del Sole and Renato Marzaro both MVP for Visual Basic, and a guarantee of quality.

For more info and registration at the event, refer to:

http://www.wpfitalia.it/Eventionline.aspx

Sunday, January 23, 2011

Bunsoy Kasi Translation

TFS 2010 object model: retrieve information from the project collections

In this post I will show how to recover and the information contained in the collection of Project Team Foundation Server using the Object Model messoci SDK available.

In the previous post

series we have seen how to connect to the TFS server, and then we take for granted being able to access the server.

To retrieve the collections of the project we can use the property CatalogNode TfsConfigurationServer class and perform a query to obtain the nodes of type Collection:

  1. Dim tfsInstance = TfsConfigurationServerFactory . GetConfigurationServer ( New Uri ( "http://server:8080/tfs" )) Dim
  2. tfsInstance.CatalogNode.QueryChildren collections = ({ CatalogResourceTypes . ProjectCollection} &
  3. # 160; ; & # 160; ; False , CatalogQueryOptions . None)

The variable collections contain a collection of read-only CatalogNode which are contained in the data we wanted. In particular

CatalogNode has a property of type Resource CatalogResource.

The most important properties of the class are CatalogeResource:

  • Description: description of the collection (generally the resource). It is the description that we have entered during creation of the collection;
  • DisplayName : name of the collective. It 's the name we included in the collection creation wizard;
  • Identifier: This is a GUID that uniquely identifies the resource-level catalog;
  • Properties: it is an object that implements IDictionary (Of String, String) in which contained property of the node. In particular, in this dictionary are the property instanceId useful when we want to retrieve the reference to the services exposed by the collection;
  • ResourceType : contains the type of the resource. In this case it is TeamprojectCollection.

property CatalogNode a TfsConnection allows to obtain all the information relative ai nodi apparteneti alla connessione. Nel caso della TfsConfigurationServer si tratta di tuti gli oggetti contenuti nel server tra cui collection, progetti e via discorrendo.

Possiamo recuperare le informazioni contenute nella CatalogeNode anche avendo a disposizione l’istanza della Project Collection (cioè un’istannza della classe TfsTeamProjectCollection).

Prima di vedere come recuperare le informazioni di cui sopra vediamo come è possibile ottenere l’istanza della TFSTeamProjectCollection.

Se abbiamo a disposizione un’istanza della TfsConfigurationServer (vedi il post precedente), possiamo utilizzare il metodo GetTeamProjectCollection.

The method provides, as an argument, the instance identifier of the collection you want to retrieve. This is a GUID that is recoverable in the Properties property of the collection CatalogeResource instance with key "instanceId"

  1. Dim tfs = TfsConfigurationServerFactory . GetConfigurationServer ( New Uri ( "http://server:8080/tfs" )
  2. , & # 160; , & # 160; ; New UICredentialsProvider ())
  3. Dim collections = tfs.CatalogNode.QueryChildren({ CatalogResourceTypes .ProjectCollection},
  4.                                                               False ,
  5.                                                               CatalogQueryOptions . None)
  6. Dim collInstanceId = (n From In collections
  7. & # 160; Where n.Resource.DisplayName = "name collection"
  8. & # 160; Select n.Resource.Properties( "InstanceId" )).FirstOrDefault()

E’ evidente che se non abbiamo l’instance identifier e dobbiamo recuperarlo con il precedente pezzo di codice, abbiamo anche tutte le informazioni culla collection senza dover utilizzare l’istanza di TfsTeamProjectCollection ottenuta con il metodo GetTeamProjectCollection.

Supponiamo, per un attimo, di avere l’instace id senza dover accedere ai nodi della CatalogeNode dell’istanza di TfsConfigurationServer. In questo caso, per ottenere l’istanza di TfsTeamProjectCollection è sufficiente:

  1. Dim tfs = TfsConfigurationServerFactory . GetConfigurationServer ( New Type ( "http://server:8080/tfs" ),
  2. : & # 160; : & # 160; ; New UICredentialsProvider ()) Dim
  3. tfsColl = tfs . GetTeamProjectCollection ( New Guid (collInstanceId))

where instanceId is the string that identifies the instance of the Id collection.

GetTeamProjectCollection method behaves similarly to what we saw in the previous TfsConfigurationServerFactory post :

  • if the instance of TfsConfigurationServer on which usage was generated by TfsConfigurationServerFactory, then the instance returned from the method will always same;
  • if the instance of TfsConfigurationServer on which usage has been instantiated using the constructor, then the instance returned from the method will be different for each call.

Two other ways to retrieve the instance of TfsTeamProjectCollection are

  • use the constructor of the class TfsTeamProjectCollection:
  1. Dim tfsColl = New TfsTeamProjectCollection ( New Uri ( "http://server:8080/tfs/nomecollection" )
  2. & # 160; , & # 160; New UICredentialsProvider ())
  • use the factory class TfsTeamProjectCollectionFatctory:
  1. Dim tfsColl = TfsTeamProjectCollectionFactory . GetTeamProjectCollection ( New Uri ( " http://server:8080/tfs/nomecollection ")
  2. & # 160; , & # 160; , & # 160; ; New UICredentialsProvider ())

We observe that the URL of the collection is obtained by concatenating the name of the server URL colection.

If we use the factory, we will get the same instance of TfsTeamProjectCollection, while the manufacturer allows us to have a different instance each time.

When we have the instance to access the server component of the project collection, the same information can be recovered by going directly to the property and in particular to the property CatalogNode Resource:

  1. Dim collName = tfsColl.CatalogNode.Resource.DisplayName
  2. Dim collDescription = tfsColl.CatalogNode.Resource.Description
  3. Dim collInstanceId tfsColl.CatalogNode.Resource.Properties = ( "InstancreId" )

Another way to retrieve information relating to the collection in our server is to require TfsConfigurationServer instance, the service ITeamProjectCollectionService through education:

  1. Dim tfs = TfsConfigurationServerFactory . GetConfigurationServer ( New Type ( "http://rma-mbnb01-dev:8080/tfs" )
  2. & # 160; & # 160; & # 160; New UICredentialsProvider ()) Dim
  3. temProSrv = CType ( tfs . GetService ( Of ITeamProjectCollectionService ) (), ITeamProjectCollectionService )

and then invoke the method GetCollections:

  1. Dim collections = temProSrv . GetCollections ()

The result of this is a IList (Of TeamProjectCollection). The TeamProjectCollection is a class in this namespace Microsoft.TeamFoundation.Framework.Client and contains information relating to the collection project and a bit more.

Friday, January 21, 2011

What Are The Four Stages Lupus

But when a simple, boring !! Contracts on ioProgrammo

E 'a while that I post to "vent" and it's time to make a!

Today I happened to read some comments related to WP7, which said that the operating system has not found favor with the public because they are too simple to be boring!

Since the ease of use means that a product does not meet public favor ?!?!?!?!

We complained about why Windows Mobile complex, slow, cumbersome, etc.. Etc.. and now this is too easy to use ?!?!?!

I have given up the phone to my wife who does not love the technology and using a telephone in which the maximum dell'avveniristico is the MMS and was able to use it without an engineering degree Nuclear! It has not even filed for divorce because they are bought me!!

If WP7 did not find the expected success is not due to the fact that it is simple to use! The fact that the interface is minimal can be worn as a downside: can like it or not, but it is a negative side!

That said, personally I enjoy like a hedgehog to read the mail with a few taps of your finger, you think of it as you like!

What Is Cervical Mucous Like After Conception

Code of February 2010

E 'output in the February issue of ioProgrammo , an introduction to my article on the Contracts Code.

4-159g

Technorati tags: code contracts, ,

Saturday, January 15, 2011

Decorative Beads To Buy In Bulk

TFS Object Model: a server to connect to TFS

Because of the work I am busy lately to interact, via code, using the object model, with TFS . I would like to start a mini series dedicated to tips and short articles on the use of certain classes in the same object model. The series is not meant to be exhaustive but is intended as my habit of sharing know-how.

This post covers the initial part of every interaction with TFS: The connection to the server.

If we want to create client applications that interact with Team Foundation Server 2010, we can use the object model made available by libraries Microsoft.TeamFoundation .*. dll.

image

In particular to connect to the server you need to reference libraries and Microsoft.TeamFoundation.Client.dll Microsoft.TeamFoundation.Common.dll.

The connection to the TFS server (in order to obtain services for the management of the entity's own server) can be done using the class contained within the namespace TFSConfigurationServer Microsoft.TeamFoundation.Client (Microsoft.TeamFoundation.Client assembly. dll).

E 'can create an instance of TFSConfigurationServer in two ways: Using the manufacturer

  • :
  1. Dim tfsInstance1 = New TfsConfigurationServer ( New Uri ( "http://server:8080/tfs" ) New UICredentialsProvider ())
  • Using the factory class TFSConfigurationServerFactory:
  1. Dim tfsInstance1 = TfsConfigurationServerFactory . GetConfigurationServer ( New Uri ( "http://server:8080/tfs" ) New UICredentialsProvider ())

In both cases the address http://server:8080 / tfs must be a valid address to connect to TFS. We can get the address using the Team Explorer. And 'Just open the properties of a collection of Team Explorer to get the address to be included in our classrooms:

image

Both manufacturer who make available factory overload to specify the login credentials, but at this time, non ce ne preoccupiamo e come provider di credenziali utilizziamo la classe UICredentialProvider che permette, se TfsConfigurationServer non trova delle credenziali in cache, di richiederle all’utente con un prompt.

Quello che ci interessa in questo post è mettere in evidenza la sostanziale differenza tra costruttore e factory e cioè il fatto che il costruttore permette di ottenere differenti istanze di conessione  (una per ogni New) mentre la factory crea una nuova istanza la prima volta che viene richiamato il metodo GetConfigurationServer e restituisce la stessa istanza le volte successive.

Per verificare questo non possimao utilizzare il metodo Equals delal classe Object perchè tale metodo e ridefinito in the class from which the TfsConnection TfsConfigurationServer comes to compare two instances of the class defined as equal when they have the same URL. Then write the following code:

  1. Dim tfsInstance1 = New TfsConfigurationServer ( New Uri ( "http://server:8080/tfs" )
  2. & # 160; , & # 160; ; New UICredentialsProvider ()) Dim
  3. tfsInstance2 = New TfsConfigurationServer ( New Type ( "http://server:8080/tfs" )
  4. & # 160; & # 160; New UICredentialsProvider ())
  5. tfsInstance1 . Dispose ()

Following the call to the Dispose method, if the instances are distinct, tfsInstance1 will be "provisions" while tfsInstance2 not.

To test this we insert the QuickWatch in our project to highlight the Disposed property values \u200b\u200b(which are not directly visible because Friend) and we observe that, after Dispose has:

image

Let the same thing for the instances generated by the Factory:

    Dim
  1. tfsInstance1 = TfsConfigurationServerFactory . GetConfigurationServer ( New Type ( "http://server:8080/tfs" )
  2. &
  3. # 160; : & # 160; : & # 160; ; New UICredentialsProvider ())
  4. Dim tfsInstance2 = TfsConfigurationServerFactory .GetConfigurationServer( New Uri ( "http://server:8080/tfs" ),
  5.                                                                      New UICredentialsProvider ())
  6. tfsInstance1 . Dispose ()

In this case, tell us QuickWatch:

image

If this were not enough, we can analyze GetConfigeurationServer is implemented as the method of using TfsConfigurationServerFactory Reflector :

image

The class implements a sort of cache (this is a Dictionary (Of Uri, TfsConfigurationServer)) in which it is sought any instance already created ( Step 1) and, in this case it is returned. If there is an instance for the URI passed as an argument, the factory uses the constructor to instantiate a new TfsConfigurationServer and stores in its cache (step 2).

Tuesday, January 11, 2011

Split Entry Remodel Blog

Sample Code

The Visual Basic team, adhering to the requests made by the developer community VB.NET (Which, in spite of the C-sharpisti is large and vital Sorriso), published a series of examples ranging from 7 to Phone Windows Azure.

You can find the complete list at this link .

also found on the pages indicated wishlist VB code, or the ability to tell the VB team to an article or a snippet of code that you want to appear in the examples.

Technorati Tags: vb.net , , example, snippet, code

Sunday, January 9, 2011

Wedding Reception Program Outline

VB.NET VB for Dummies: The Serialization - Part 2

This post is a continuation of previous post serialization.

In particular we will see that the SOAP and JSON serialization.

Serialization SOAP SOAP serialization is committed to the SoapFormatter System.Runtime.Serialization.Formatters.Soap contained in the namespace in the library of the same name. The SOAP formatter

goes back to the earliest versions of the framework and, unfortunately, from a certain point, even though it was declared obsolete, it was not brought forward in the development and does not support certain types of data very much used in the world. NET such as generics and nullable.

For this reason, we can not serialize in SOAP format (using the SoapFormatter) our bill (see previous post) as this has a property of type List (Of DettagliFattura) (generic).

JSON serialization format JSON serialization (more info here ) is a textual format very popular in AJAX applications. Entry is a way to serialize complex objects even with a very compact size and easy to interoperate with JavaScript, therefore, well suited for scenarios partoicolarmente AJAX-style web.

JSON serialization can be done using the class DataContractJsonSerializer that framework 4.0 is contained in the namespace System.Runtime.Serialization.Json all’interno dell’omonimo assembly.

Fate attenzione perchè, se state sviluppando per il framework 3.5 (prima di questo la classe DataContractJsonSerialization non era presente), trovate la classe nello stesso namespace ma l’assembly è System.ServiceModel.Web.

La classe DataContractJsonSerializer prevede, tra i vari metodi, WriteObject e ReadObject che permettono , rispettivamente, di serializzare e deserializzare un’oggetto in formato JSON.

Entrambi i metodi sfruttano uno stream per serializzare l’oggetto. In base alle nostre esigenze tale stream potrebbe essere in memoria (come nell’esempio riportato in seguito), su file o su un canale web (ad esempio come response to a request from a remote client).

methods for serialization and deserialization of the object are Invoice:

  1. Public Shared Function SerializzaJSON (ByVal bill As Invoice ) As String
  2. If bill Is Nothing Then Throw New ArgumentNullException ( "Bill" )
  3.      Dim strJSON As String = Nothing
  4.      Dim serializer = New DataContractJsonSerializer ( GetType ( Fattura ))
  5.      Using memStream = New MemoryStream ()
  6.          serializer .WriteObject(memStream, fattura)
  7.         strJSON = Encoding.Default.GetString( memStream .ToArray())
  8.      End Using
  9.      Return strJSON
  10. End Function
  11.  
  12. Public Shared Function DeserializzaJSON( ByVal As strFattura String) As Invoice
  13. Dim retObj As Invoice = Nothing
  14. & # 160; Dim serializer = New DataContractJsonSerializer ( GetType ( Invoice )) &
  15. # 160; Using memStream = New MemoryStream (Encoding.Default.GetBytes (strFattura))
  16. retObj = CType (serializer . ReadObject (memStream) Invoice )
  17. End Using Return
  18. retObj
  19. End Function

The result is as follows:

image

We observe that, in the examples, we used the default encoding for strings. Evidently, if necessary, the encoding may be the one we want.

If our class (as in Bill) is composed of objects. NET serializable, we can immediately use the JSON serialization.

Alternatively, we can decorate our class (and all those that may be used as a property) with the Serializable attribute or the attribute DataContract.

In the first case it is enough to decorate the sun and JSON serialization classes will have the properties expressed by the name of the attribute that is encapsulated by private property. In the case of property definite in modo compatto (come accade nella Fattura) il compilatore crea, dietro le quinte un attributo per ogni proprietà con lo stesso nome della proprietà a cui viene anteposto il carattere “_”. In questo caso il JSON risultante vedrà le proprietà espresse con il nome della proprietà preceduta da “_”.

Nel caso dell’attributo DataContract, invece, è necessario decorare anche ogni proprietà con l’attributo DataMember (se una proprietà non viene decorata con DataMember, questa non finisce nella serializzazione).

L’attributo DataMember permette di rinominare la proprietà all’interno del JSON risultante:

  1. \u0026lt; DataMember (Name: = "numeroDocumento" )>
  2. Public Property NumeroDocumento As String

In this case, the properties, the ' inside of the JSON, will be called "numeroDocumento" and not "NumeroDocumento.

using DataContract and DataMember we can intervene in the resulting JSON in order to customize the results to our liking (especially useful when we are given the path and we must re-create the class).

Serializzazion custom

Just a hint at the possibility of creating a custom serialization of objects.

To do this, the framework provides us with the interface that has two IFormatter Serialize and Deserialize methods that we have to redefine our logic by implementing the serialization / deserialization:

An example might be:

  1. Imports System.Runtime.Serialization
  2. Public Class MioSerializzatore
  3. Implements IFormatter
  4.  
  5.      Public Property Binder As System.Runtime.Serialization. SerializationBinder Implements System.Runtime.Serialization. IFormatter .Binder
  6.          Get
  7.  
  8.          End Get
  9.          Set ( ByVal value As System.Runtime.Serialization. SerializationBinder )
  10.  
  11.          End Set
  12.      End Property
  13.  
  14.      Public Property Context As System.Runtime.Serialization. StreamingContext Implements System.Runtime.Serialization. IFormatter .Context
  15.          Get
  16.  
  17.          End Get
  18.          Set ( ByVal value As System.Runtime.Serialization. StreamingContext )
  19.  
  20.          End Set
  21.      End Property
  22.  
  23.      Public Function Deserialize( ByVal serializationStream As System.IO. Stream ) As Object Implements System.Runtime.Serialization. IFormatter . Deserialize
  24. 'Here comes the logic of deserialization
  25. End Function
  26. Public Sub Serialize (ByVal serializationStream As System.IO. Stream , ByVal graph As Object ) Implements System.Runtime.Serialization. IFormatter .Serialize
  27.          ' qui ci va la logica di serializzazione
  28.      End Sub
  29.  
  30.      Public Property SurrogateSelector As System.Runtime.Serialization. ISurrogateSelector Implements System.Runtime.Serialization. IFormatter .SurrogateSelector
  31.          Get
  32.  
  33.          End Get
  34.          Set ( ByVal value As System.Runtime.Serialization. ISurrogateSelector )
  35. End September
  36. End Property End
  37. Class
Technorati tags: serialization, serialization , , xml, soap , ,