Archive

Posts Tagged ‘C#’

Twikini Releases v1

May 19th, 2009

Listen to this Reading

Kyle Tolle reading ‘Twikini Releases v1′

Update:

As per the instructions on the Twikini website, I emailed CJ about this blog post. Within minutes he responded and sent out my serial number for v1.0. I can also happily say that it installed and connected to Twitter perfectly. I entered the serial number and am good to go. Very excited to test out all the new features I’ve not had a chance to see yet!  I take back what I said about the customer support: I’m quite impressed.

Twikini is a Windows Mobile Twitter client written in C++.  It’s lightweight, quick but is decently powerful. Twikini v1.0 just released and I’m hoping to give it a try soon.  I had downloaded v0.6 and really enjoyed it, but v0.8 never did work. I had upgraded because of DM (Direct Message) support.  Same bones with v0.9. Keeps saying there’s no network to connect to. I am hoping that I can get v1.0 to work.  I’d recommended Twikini in a tweet and Aoss tried it out.

A screen shot of Twikini

A screen shot of Twikini

Trinket Software, the people who make Twikini, just introduce a pricing plan for the product, and I’m hoping to get a copy for writing this blog post. Did I mention I’m crossing my fingers that it works this time? I’ve @’d Twikini several times about my issues, but haven’t ever heard back. Customer service could be a bit better…

Have you heard of Twikini? Have you tried it out? What are your impressions? Have any of you had the same issue with getting it to connect to the internet? Please tell me I’m not alone!

Kyle Tolle Review, Software, Tutorial , , , , , ,

Call One Constructor from Another in C#

January 30th, 2009

I am working on an assignment for Professor Cawfis’ C#/.NET class I am taking this quarter at The Ohio State University.</plug> The assignment asks us to write a hierarchy of Tanks for a water plant. For a specific tank, we want a constructor that will take a parameter volume. But we also want to have a parameterless constructor that will create a tank with a default volume for the tanks in this system.

Here’s what we initially have:

using Liter = System.Single

namespace KyleTolle.Tanks
{
    class Tank: TankBase
        {

            public Tank()
            {
                // Want this to create a tank of a default volume.
            }

            public Tank(Liters maximumVolume)
            {
                this.Volume = maximumVolume;
            }
    }
}

All we need to do to have the parameterless constructor create a tank with a default value is have it call the other constructor, passing in a default value for the volume. But how do we do that?

It’s simple. To call another constructor in this class, we just add a bit more code before the method’s body braces:

public TypeConstructor(): this (parameters) { }

Want to call a constructor in the base class? Just change the previous example to say “base” instead of “this”:

public TypeConstructor(): base (parameters) { }

This could be helpful if the parent class has a constructor with the desired behavior.

So to call another constructor in our Tank example, we end up with:

using Liter = System.Single

namespace KyleTolle.Tanks
{
    class Tank: TankBase
        {

            public Tank() : this(100F)
            {
                // This creates a tank with a default volume.
            }

            public Tank(Liters maximumVolume)
            {
                this.Volume = maximumVolume;
            }
    }
}

I decided to write this post because it wasn’t immediately apparent to me how to call one constructor from another. Google did lead me to the solution, but I give a bit more concrete example of what this can be used for.

See Also:
C# FAQ: How can one constructor call another

Kyle Tolle Software ,