This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The idea is to collect this kind of parsing nearest possible to the enum itself | |
// Why? Because the enum is the reason to the Method and are easy to find and modify | |
// Also it's natural to extend with other kind of parsing. Just insert more methods. | |
// The main drawback, is that I have to state the enum more explicit (i.e. Something.TypeOf) | |
// Also the code design appears no standard and would apply if the enum was for internal use in the class. | |
// So, the question | |
// How would you do this more nice? I tried abstract, base inheritance, partial. None of them apply. | |
// This is a shortened down and renamed sample of a code that should be better coded. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = | |
// My problem description. You are welcome to comment/fork your own tried/functional versions of this. | |
// Appearently I have successed the queue on all needed situations. Except a trivial one, the ervice aren't really dequeue. | |
// The two methods below is two services that are ranned simultaneous within same application (a Windows Service). | |
// | |
// 1# As I can see, the line 'if (queue.TryDequeue(..))' never get looped/waked-up.. | |
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = | |
// The object that will Enqueue, put object into Queue (can be put into a console application) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void Main() | |
{ | |
//Dictionary if there happen to be different software to run, per row. | |
Dictionary<string,string> actions = new Dictionary<string,string>(); | |
actions.Add("http://www.site1.com", @"C:\Program Files\Mozilla Firefox\firefox.exe"); | |
actions.Add("http://site2.com", @"C:\Program Files\Mozilla Firefox\firefox.exe"); | |
actions.Add("http://site3.org/", @"C:\Program Files\Mozilla Firefox\firefox.exe"); | |
foreach (var row in actions) |
NewerOlder