Monday, September 15, 2003 - Posts

Categories Implemented.

Kris (DotNetJunkie XL on the 7th Floor) has joined the workspace to help me out in generating ATOM feeds ... Cool huh .. Will be making some major changes to include the flexibility to generate all kinds of final feeds ... let's see how it comes out !

I have changed the code to filter by categories while generating the feed for the Unofficial GotDotNet feed. But i am unable to understand on how this is going to help in our current scenario. Since, the project is hosted in one server, it is the choice of the server administrator to manipulate the Config file and decide that the consumers of the feed shall get only these categories .. Now if there is some way to pass this information for every request to the server then probably, the actual value of the filter can be fully perceived ...

If some one gets an idea on how to work this out then drop me a line !! Will be more than glad to hear that :-)

Console.ClearScreen();

Today, one of my colleagues asked me whether a clear screen function just like the one in dos ( cls ) exists in the framework ! I told him 'Of course. It must be there.' . ahem much to my surprise such a function does not exist in the framework's Console class. I was searching for a method to do this when i bumped onto this Article in C# Corner that precisely does what i exactly want and much more...

The author creates a custom Console window with the help of Win32Native commands and then provides functionality to clear screen, SetColor and SetCursorType ... Why weren't these included in the Console Class ?! It really sounds weird now after being stuck with such a problem that the framework inherently does not provide these utility functions...

Actually thinking about it, it seems simple. If there is a way to flush a stream completely, to make the underlying buffer null using managed code, then voila, that's the solution. Because the Console.Out is a TextWriter that writes the output to the Console stream obtained from the Win32Native functions. The flushing of this buffer should do the trick.. But how to do it ?!! I am clueless ... Anyone tried something like this ?!

Is there any other way to achieve this using completely managed code ?