European Silverlight 4 & Silverlight 5 Hosting BLOG

BLOG about Silverlight 5 Hosting and Its Techologies - Dedicated to European Windows Hosting Customer

Comparison of Windows ASP.NET Hosting between HostForLIFE.eu Hosting Platform and Windows Azure Platform

clock August 25, 2014 11:13 by author Peter

Given the length of this review and the number of plans, it is unrealistic to compare everything of them one by one. As usual, the review focuses on price, features, uptime & speed as well as customer support. Before starting our detailed comparison, we’d like to share with you the overall ratings of the plans based on our first-hand hosting experience and large-sampled customer reviews.

Please refer to this table for more differences and similarities.

 


HostForLIFe.EU

Windows Azure

 

 

 

Price

€3.00/month

$76 / month

Website

Unlimited

100

Disk Space

Unlimited

1 GB

Bandwidth

Unlimited

Unlimited

1 SQL Server Size

Include 50MB

0 to 100 MB = $ 5.041/mo

Server Features

Include 4 GB RAM or higher

768 MB = $16/month

SLA

99.90%

99.90%

ASP.NET 4.5.2 / ASP.NET 4.5.1

Yes

Yes

ASP.NET 4.5 / ASP.NET 4.0

Yes

Yes

ASP.NET 3.5 / ASP.NET 2.0 / ASP.NET 1.1

Yes

Yes

Classic ASP

Yes

Yes

ASP.NET MVC 6.0 / 5.2 / MVC 5.1.2 / MVC 5.1.1 / MVC 5.0

Yes

Yes

ASP.NET MVC 4.0 / MVC 3.0 / MVC 2.0

Yes

Yes

WordPress

Yes

Yes

Umbraco

Yes

Yes

Joomla

Yes

Yes

Drupal

Yes

Yes

Node.js

Yes

Yes

PHP 5

Yes

Yes

Conclusion
Both companies are able to provide brilliant Windows hosting service. If a choice has to be made, we recommend HostForLIFE.eu as your web host because the price is more reasonable, features more complete and the performance and our technical support are awesome.To learn more about HostForLIFE.eu web hosting, please visit http://www.hostforlife.eu



European Silverlight 5 Hosting – HostForLIFE.eu :: Tips - The Easiest way to Reading URL-Parameters in Silverlight

clock August 15, 2014 08:38 by author Onit

In this guide we will showed you how to read the URL-Parameters in Silverlight this article will showed you the easiest way to read it. In CRM there is a setting that you can “pass-param”. If you are on a CRM Form you get keys like “typename” and “id”.

Below is the Complete list of CRM:

Parameter

Name

Description

typename

Entity Name

Name of the entity

type

Entity Type Code

Integer that uniquely identifies the entity in a specific organization

id

Object GUID

GUID that represents a record.

orgname

Organization Name

Unique name of the organization.

userlcid

User Language Code

Language code identifier that is being used by the current user.

orglcid

Organization Language Code

Language code identifier that represents the base language for the organization.


For Example is like

[something].aspx?id=%7bB2232821-A775-DF11-8DD1-00155DBA3809%7d&orglcid=1033&orgname=adventureworkscycle&type=1&typename=account&userlcid=1033

If you have the Silverlight in the Sitemap you don’t get (of course), typename, type and id. You can read them in your Silverlight:

IDictionary<string, string> QueryString = HtmlPage.Document.QueryString;
 string orgname, entityname;

 if (QueryString.ContainsKey("orgname"))
     orgname = QueryString["orgname"];

 if (QueryString.ContainsKey("typename"))
     entityname = QueryString["typename"];

 



European Silverlight 5 Hosting – HostForLIFE.eu :: How to Create Multi-Click Event in Silverlight 5

clock August 6, 2014 07:22 by author Onit

Silverlight 5 has given us a new property in the MouseButtonEventArgs called Click Count. Before the release of this Silverlight 5, there are no implementation of “double click” event, you need to write your code to implement that. But instead of giving double click event, the Silverlight gave us the ability to tracking how much clicking we done. But there’s a limitation of the clickcount, and in this article will look at creating a solution to resolve it.

Implement ClickCount

For this post we will be using a simple test harness that look like this:

The blue box on the left is going to be our click area.  The right side is a simple ListBox with the ItemsSource set to an ObservableCollection<string>.  And here is what the XAML looks like:

<Grid x:Name="LayoutRoot" Background="White">
    <Grid.ColumnDefinitions>
        <ColumnDefinition/>
        <ColumnDefinition/>
    </Grid.ColumnDefinitions>
       
    <Rectangle Fill="Blue"
               Width="100"
               Height="100"
               VerticalAlignment="Center"
               HorizontalAlignment="Center"/>
       
    <ListBox x:Name="lbClicks"
             Margin="5,5,5,5"
             HorizontalAlignment="Stretch"
             VerticalAlignment="Stretch"
             Grid.Column="1"/>
</Grid>

You can use the code below for the code behind that xaml

private ObservableCollection<string> _events =
             new ObservableCollection<string>();
public MainPage()
{
    InitializeComponent();
    lbClicks.ItemsSource = _events;
}

look at the first example. To track the ClickCount we need to add the MouseLeftButtonDown event. Add the code below to our rectangle in XAML:

<Rectangle Fill="Blue"
            Width="100"
            Height="100"
            VerticalAlignment="Center"
            HorizontalAlignment="Center"         
MouseLeftButtonDown="Rectangle_MouseLeftButtonDown"/>

In our event handler, we can easily track the click count by adding a new string to our _events collection.  You will notice that the ClickCount will increase each time you click the mouse button if you are quick enough.  Pause in the clicking for a moment and the ClickCount will reset!.

private void Rectangle_MouseLeftButtonDown(object sender,
                                  MouseButtonEventArgs e)
{
       _events.Add("Click Count : " + e.ClickCount);
}

You can see that we can track a double click or triple click or a click-15 if we want.
All we would need to add is a conditional statement based off of the ClickCount property.

if(e.ClickCount == 2)

{
  MessageBox.Show("Double click");
}

Issue

however, While this is an interesting solution for the missing functionality, it does have a missing component that will cause you some grief.  Instead of our conditional statement that we had above, what if our code looked something like this:

if(e.ClickCount == 1)
{
  MessageBox.Show("Single click");
}
else if(e.ClickCount == 2)
{
  MessageBox.Show("Double click");}
}

If you run this code, you will notice that you will never fire the “Double click” MessageBox.  This is because the moment the first MessageBox is displayed, the focus is taken away from our rectangle and thus the ClickCount is started over when we come back to it.  This means that attempting to implement two events is a bit tricky.

How to make it worked!

So How to track multiple click?  You need to write some code.  In order to create a reusable solutionwe decide to implement solution as a behavior.  This will allow us to add a multiple click handler to any UIElement in XAML without having to do a bunch of wiring.  However, the code is straight forward enough you can easily remove it and create your own reusable solution.

Every time a user clicks on your object a DispatcherTimer is stopped and then started.  In addition we track the latest sender object and the ClickCount.  Once the user stops clicking on your object, the DispatcherTimer is allowed to hit the Click event and we fire an event giving the latest ClickCount and the sending object.

Our code for the behavior will looks like this:
public class MultiClick : Behavior<UIElement>

{
    private DispatcherTimer _timer;
    private int _clickCount;
    private object _sender;

    public MultiClick()
    {
        _timer = new DispatcherTimer()
             {Interval = new TimeSpan(0, 0, 0, 0, 250)};
        _timer.Tick += _timer_Tick;
    }

    #region events and delegates

    public delegate void MouseMultiClickHandler(object sender,
                                              int clickCount);
    public event MouseMultiClickHandler MouseMultiClick;

    #endregion

    #region Behavior Overrides
    protected override void OnAttached()
    {
        base.OnAttached();
        AssociatedObject.MouseLeftButtonDown
        += AssociatedObject_MouseLeftButtonDown;
    }

    protected override void OnDetaching()
    {
        base.OnDetaching();
        AssociatedObject.MouseLeftButtonDown
        -= AssociatedObject_MouseLeftButtonDown;
    }
    #endregion

    #region EventHandlers

    void _timer_Tick(object sender, EventArgs e)
    {
        _timer.Stop();

        if (MouseMultiClick != null)
            MouseMultiClick(_sender, _clickCount);
    }

    void AssociatedObject_MouseLeftButtonDown(object sender,
                                   MouseButtonEventArgs e)
    {
        _timer.Stop();
        _clickCount = e.ClickCount;
        _sender = sender;
        _timer.Start();

    }

    #endregion

}

The OnAttached/OnDetaching methods are how the Behavior is attached to the object, an UIElement is our case.  The AssociatedObject is simply to object that the Behavior is attached to.  As we discussed before, the DispatcherTimer is stopped and started when the user clicks on the object.  Once the DispatcherTimer hits the Click event, it(dispatcher time) will stop stopped, a MouseMultiClick event is fired and the Behavior waits for the next MouseLeftButtonDown event.

**Note: Its important to set the time at 200 milliseconds. And no longer than that you may get unexpected results.

This is how we use our behavior, Here is what are Rectangle looks like with our Behavior.  I have also removed the MouseLeftButtonDown event.

<Rectangle Fill="Blue"
            Width="100"
            Height="100"
            VerticalAlignment="Center"
            HorizontalAlignment="Center">
    <i:Interaction.Behaviors>
        <local:MultiClick MouseMultiClick="MultiClick_MouseMultiClick"/>
    </i:Interaction.Behaviors>
</Rectangle>

You can see we attached to the MouseMultiClick event we created in our Behavior.  The code behind is pretty much identical to our original code behind, where we are simply tracking the event:

private void MultiClick_MouseMultiClick(object sender,
                                       int clickCount)
{
    _events.Add("Multi Click : " + clickCount);
}
  If you run the project again, you will now see that instead of getting an event for every click, you only get one event for each round of clicking.  So you can track single, double, triple, etc.  From there you can implement your code based on your project needs.



Tag cloud

Sign in