by Bar Zohan
15. December 2011 19:04
Problem Definition:
If anyhow you'd like to access google web services (like Geocoding, Directions api etc.) inside a Silverlight browser application, when you use a webclient do the http request to the service you are going to get a security exception.
This is caused by the cross-domain-pol...
[More]
by Bar Zohan
16. June 2011 20:06
Using nolock select queries with entity framework
[More]
by Bar Zohan
15. February 2011 23:37
[code:c#]
AssemblyName assemblyName = new AssemblyName();
assemblyName.Name = "newAssemblyname";
AssemblyBuilder assemblyBui...
[More]
by Bar Zohan
29. October 2010 02:25
Some pointers and unsafe code should be used (sorry there is no other way for processing pixels). Function takes file path as parameter "path" and returns a Bitmap instance of the raw formatted image.
As raw image format does not provide height and width info of the image contained, you shoul...
[More]
by Bar Zohan
26. October 2010 22:41
Beside parsing all other object types, DateTime parsing from JSON had been a great headache. As I did not need it for the current project I've just ignored DateTime typed attributes of JSON [pi.PropertyType != typeof(DateTime) :)]
[code:c#]
using System;using System.Net;using System.Windows;using ...
[More]
by Bar Zohan
26. October 2010 02:37
The following code gives you the ability to use images and different colored text together inside a textblock-like control.
XAML:
[code:xml]
<StackPanel x:Class="SilverlightUI.ChatText" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"  ...
[More]
by Bar Zohan
26. October 2010 02:31
[code:c#]
public static double MeasureString(string s, FontFamily fontFamily, int fontSize) { TextBlock t = new TextBlock(); ...
[More]
by Bar Zohan
21. April 2010 23:07
Compressing strings using c#
[More]
by Bar Zohan
6. April 2010 00:48
Writing an asp.net web service function which handles file upload.
[More]
by Bar Zohan
5. April 2010 23:02
Using GDI To Draw Outlined Text
[More]
by Bar Zohan
5. April 2010 21:12
For sorting IQueryable's
[code:c#]
public enum SortDirection { Ascending, Descending }
public static IQueryable<T> DynamicSort<T>(this IQueryable<T> data , string columnName, SortDirection direction) { ...
[More]
by Bar Zohan
26. January 2010 19:53
Problem
In a page you need to list items and their photos but those photos are all in different sizes. So you have a standart photo area and you have to fit those images into it. And not only fit them, but also you have to preserve their width to height ratio. So here is how we deal with this probl...
[More]
by Bar Zohan
21. January 2010 02:06
A listview that creates it's column structure and populates it's rows directly from a generic list.
[More]
by Bar Zohan
21. January 2010 01:40
Briefing:
In this article I'm going to implement a simple plug in structured calculator. Calculator will take two numeric inputs from the user and user will select which calculator plug in to use. After that user will hit calculate button and our little program will ask the plug in to calculate tho...
[More]
by Bar Zohan
21. January 2010 00:25
Mvc framework has an html helper for giving ajax links (Ajax.ActionLink), but it does not provide one like Ajax.ImageActionLink. But ofcourse there is a simple, tricky workaround .
<%= Ajax.ActionLink("[imglnk]", "IndexContent", new { id = "main" }, new AjaxOptions { UpdateTargetId = "Righ...
[More]
by Bar Zohan
20. January 2010 21:03
Briefing
As mentioned in the title, our data provider is going to be very simple. Aim of this article is giving the main idea behind a Linq to Sql like data structure.
So what we are going to do now is as simple as this;
Create a new database and a new table inside it. (I'll use Sql Server 2008...
[More]