I wanted to create an interface; however one of the methods I wanted to implement in it had a class as a parameter. I thought about it and realized that be doing so I would be tightly binding my interface to a specific class. I didn’t think that was good practice because interfaces need to […]
Read More →Error – Class name is inaccessible due to its protection level

There is a pretty basic reason why this error happens. However, until you find the solution, it is a big deal. I was creating a simple base class like the below which I planned on extending in another class. public class TreeViewModel : INotifyPropertyChanged { TreeViewSelector() { } } However, when I tried to […]
Read More →Hey, the 90’s called and they want their website back

I got trolled once because of the way my website looked. I must admit, it did age a bit, but at the time I built it, using ADO.NET, ASP.NET Webforms (ASPX) and Master Pages, it was a pretty cool and sophisticated website for it’s time. Here is a tribute to my old C# blog look […]
Read More →Adding a context menu to a treeview Part 2

In my previous post I showed you how I added a context menu to a treeview. I had a new requirement that wanted a treeview property to contain a flag that could be turned on or off and that the value be displayed in the context menu. First I added the menuItem to the XAML. […]
Read More →Adding images to a Tree View in WPF using C#
Like I’ve said before, once you find what your looking for, it is easy to find examples about how to use and implement it. I had this again while trying to add images to a treeview. The term I was looking for, while trying to find a solution was ValueConverter. In this solution I will […]
Read More →How to search a Lucene.Net index in C#

I used this code to perform a search of a Lucene.Net index. Lucene.Net.Store..Directory directory = Lucene.Net.Store.FSDirectory .Open(new DirectoryInfo(textBoxSearchIndex.Text)); Lucene.Net.Analysis.Analyzer analyzer = new Lucene.Net.Analysis.Standard .StandardAnalyzer(LuceneUtil.Version.LUCENE_29); Lucene.Net.Search.Searcher searcher = new Lucene.Net.Search .IndexSearcher(LuceneIndex.IndexReader .Open(directory, true)); Lucene.Net.Search.Query query = new Lucene.Net.QueryParsers .QueryParser(LuceneUtil.Version.LUCENE_29, “contents”, analyzer) .Parse(textBoxSearch.Text); Lucene.Net.Search.Hits hits = […]
Read More →Treeview with checkbox in WPF

On one of my projects I had to provide treeview selection functionality. I searched the internet and pulled everything I could into a this single resource. I wasn’t able to find 1 post that provided all the details and source code to do what I needed. Now there is one and if you find it, […]
Read More →Strings in C#
The String class in .Net has many capabilities. Below is a list of some string methods I use frequently in my development projects. Even when I have completed this list, I am sure it will over cover 5% of the capabilities within the String class. After reading this, I suggest you look over the MSDN […]
Read More →How and why I built a cluster of Raspberry Pi’s (Part 1)

Because it was there and because I could, well maybe not. It actually wasn’t very difficult because these instructions worked perfectly. Following them worked without a hitch, almost. There are few small hiccups but we made it through without much problem. It was rather time consuming to re-image all those disks for the 8 nodes. […]
Read More →Lucene.NET returns results only when using numeric values

I used this code to create a Lucene.Net 2.9.2 index. System.IO.DirectoryInfo indexFileLocation = new System.IO.DirectoryInfo(textBox1.Text); Lucene.Net.Store.Directory directory = Lucene.Net.Store.FSDirectory.Open(indexFileLocation); Lucene.Net.Analysis.Analyzer analyzer = new Lucene.Net .Analysis .Standard .StandardAnalyzer(LuceneUtil.Version.LUCENE_29); IndexWriter writer = new IndexWriter(directory, analyzer, true, IndexWriter.MaxFieldLength.UNLIMITED); foreach (IList item in dataToIndex) { Document doc = new Document(); doc.Add(new Field(“ID”, item[0].ToString(), Field.Store.YES, Field.Index.NO)); …. string contents = […]
Read More →