I’m not good in Graphics so I mostly use the default HTML Table with border=1 which does look pretty awkward…
So I decided to create a little CSS to make the default Table look a bit nicer.
Here’s the CSS:
Continue reading CSS formatted Table
I’m not good in Graphics so I mostly use the default HTML Table with border=1 which does look pretty awkward…
So I decided to create a little CSS to make the default Table look a bit nicer.
Here’s the CSS:
Continue reading CSS formatted Table
I worked with PHP and MySQLi for the last few days and still don’t like it that much but got used to it.
Something that was annoying me pretty much was the Binding of Parameters in an SQL-Statement.
So I decided to write a little Helper Function for this. Continue reading PHP, MySQLi and Dynamic Parameter Binding
I tried to make a simple Application which connects to my Digital Camera (which is detected as Portable Device) and Copy or Move the Files to my Harddisk (and put them in Directories, named by the DateTaken of the Photo). At first I tried to use the .NET FolderBrowserDialog
but it was soon clear, that it can’t handle Portable Devices and doesn’t even show them.
My approach was to use the shell32.dll
. It contains a BrowseForFolder
which is able to handle Portable Devices. Continue reading Copy/Move Files from Portable Device
An Image can contain additional Information about the Camera or the Date it was taken. It’s quite easy to access those Information with C-Sharp. All you need to do is to add a Reference to PresentationCore
and WindowsBase
, include the System.Windows.Media.Imaging
Namespace and use the following Code-Snippet as a StartingPoint:
public DateTime GetDateTaken(string filePath) { using (FileStream fileStream = new FileStream(filePath, FileMode.Open, FileAccess.Read)) { BitmapFrame bitmapFrame = BitmapFrame.Create(fileStream, BitmapCreateOptions.DelayCreation, BitmapCacheOption.None); BitmapMetadata bitmapMetadata = bitmapFrame.Metadata as BitmapMetadata; return DateTime.Parse(bitmapMetadata.DateTaken); } }
The Feature to automatically reformat the Code in Visual Studio is quite nice. But I always forget the combination for it so here they are:
Reformat only the selected Code (keeps Breakpoints):
Reformat the Code in the active File (keeps Breakpoints):
Reformat the Code in the active File (looses Breakpoints):
The default Diff/Merge Tool from Team Foundation is everything else than sophisticated… But who cares, it’s pretty easy to use your favorite Tools for Diffing and Merging. Continue reading Custom Diff/Merge Tools in Team Foundation
There are multiple possibilities to call an Operation Asynchronous from a WCF Service:
In this model, you register to a Completed
-Event and call your Operation with an Async
appended. The Callback Method is run on the same Thread that was used to call the Async Request, so you don’t need to invoke
it in case you’re modifying the UI.
Example:
public void AsyncCall() { MyServiceClient client = new MyServiceClient(); client.SomeMethodCompleted += SomeMethodCompletedCallback; client.SomeMethodAsync(<Your Parameters>); } public void SomeMethodCompletedCallback(object sender, SomeMethodCompletedEventArgs e) { MyServiceClient client = sender as MyServiceClient; if (client != null) { client.Close(); } <Your Return Value> = e.Result; }
In this model, you call your Operation with a prepending Begin
. Note that the Callback is running on a Worker-Thread so if you’re modifying the UI, don’t forget to invoke
in the Callback.
Example:
public void AsyncCall() { MyServiceClient client = new MyServiceClient(); client.BeginSomeMethod(<Your Parameters>, new AsyncCallback(OnEndSomeMethod), client); } public void OnEndSomeMethod(IAsyncResult asyncResult) { MyServiceClient client = asyncResult.AsyncState as MyServiceClient; if (client != null) { <Your Return Value> = client.EndSomeMethod(asyncResult) client.Close(); } }
This is the only “true” Asynchronous Model. It will run in a Server-Thread so you are able to get the status of a pending Operation or even cancel it. The implementation is more time-consuming than the other two but, in some cases, worth the effort.
I suggest you Google for some examples.
There is a very good series of posts at Dan Rigsby’s Blog
starting at this Post. Have a look at it to get more information and examples.
When you try to access a WCF-Service with your Browser you might see the following Error:
HTTP Error 404.3 – Not Found
The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.
If that happens, you probably don’t have the Service Model registered with your IIS.
Here’s how to register it:
You now should be able to access your Webservice.