Blog Home  Home Feed your aggregator (RSS 2.0)  
.Net Jonesie - July, 2005
A simple programmers blog
 
# Wednesday, July 20, 2005

After logging in, be sure to visit all the options under Configuration in the Admin Menu Bar above. There are 26 themes to choose from, and you can also create your own.

 

Wednesday, July 20, 2005 7:00:00 PM (New Zealand Standard Time, UTC+12:00)  #    Comments [0]   dasBlog  | 
# Tuesday, July 19, 2005

I'm not the most efficient coder.  Things like Resharper are a waste of time for me.  I prefer to repeat myself 4 million times rather than learn 23,000 keyboard shortcuts.  I think it's something to do with creative flow.

However, sometime you see things that are so easy and quick to use that you just adopt them without thinking.  Snippets are one of these.  David reminded me of this.

So, here's a custom snippet I created for inserting properties. This is pretty much the same as the default prop snippet, but I've added summary comments and I like my member vars to have a leading underscore:

<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets  xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
 <CodeSnippet Format="1.0.0">
  <Header>
   <Title>jprop</Title>
   <Shortcut>jprop</Shortcut>
   <Description>Code snippet for property and backing field</Description>
   <Author>Peter G Jones (modified version of prop from Microsoft Corporation)</Author>
   <SnippetTypes>
    <SnippetType>Expansion</SnippetType>
   </SnippetTypes>
  </Header>
  <Snippet>
   <Declarations>
    <Literal>
     <ID>type</ID>
     <ToolTip>Property type</ToolTip>
     <Default>int</Default>
    </Literal>
    <Literal>
     <ID>property</ID>
     <ToolTip>Property name</ToolTip>
     <Default>MyProperty</Default>
    </Literal>
    <Literal>
     <ID>field</ID>
     <ToolTip>The variable backing this property</ToolTip>
     <Default>_myVar</Default>
    </Literal>
   </Declarations>
   <Code Language="csharp">
        <![CDATA[/// <summary>
  /// Backing variable for property $property$
  /// </summary>     
  private $type$ $field$;
  /// <summary>
  /// Property $property$
  /// </summary>
 public $type$ $property$
 {
  get { return $field$;}
  set { $field$ = value;}
 }
 $end$]]>
   </Code>
  </Snippet>
 </CodeSnippet>
</CodeSnippets>

I can see that creating more elaborate snippets is pretty easy.  I wonder if it would be possible to have CodeSmith snippets?  That would be really cool!

Tuesday, July 19, 2005 7:23:45 AM (New Zealand Standard Time, UTC+12:00)  #    Comments [1]   Visual Studio  | 
# Monday, July 18, 2005
Monday, July 18, 2005 3:40:21 PM (New Zealand Standard Time, UTC+12:00)  #    Comments [0]   General  | 
# Friday, July 15, 2005
Nigel has got the TechEd session schedule up on the event site. 
Friday, July 15, 2005 12:04:32 PM (New Zealand Standard Time, UTC+12:00)  #    Comments [0]   General  | 
# Tuesday, July 12, 2005

We recently had a minor incident with our visa cards - someone who shall remain nameless lost HER purse.  After much searching we decided to do the right thing and cancel our joint visa card.  Ten minutes after doing this, the purse rematerialised.  Joy.

Wev'e been waiting for nearly 2 weeks to get replacements (they are made about 2 minutes walk from where I work) and during that time Telecom tried to charge us.  It failed of course, becuase I don't have the new card number to give them.

Today, we had a call at home from an automated service.  It said to call 128.  Fair enough I guess, their staff must get a lot of abuse so why not have a machine do it. So, I dialled 128 and was given a choice of 5 different options, none of which matched my circumstances, so I picked 'you have been contacted by a collection agency'.  Then I was given another menu with 5 options - I can't remember what that was but I selected something close enough.  Then I had to select whether I was calling from the phone concerned or another phone.  I was calling from work so I selected option 2.  Then I had to enter my home phone number.  Then it wanted the last five digits of my account number - which I didn't have.  Phone home, get the lad to give me the number, repeat.  Got back to where I left off and enter the last 5 digits.  She says "That's Great!".  Yeah right.  But first, I need to enter a pin number.  Arrrrrrrrrgggggggg!!  Or select 0 to speak to a person.  Yay! Finally.

But here's the lovely part, the lady I finally got to speak with did not have my account details in front of her so all that time I wasted entering phone numbers & account numbers was completely pointless.

Grrrrrrr.

Tuesday, July 12, 2005 12:44:30 PM (New Zealand Standard Time, UTC+12:00)  #    Comments [1]   General  | 

Sean has posted about the new pricing of MSDN Universal in NZ.  A 48% price drop is pretty bloody fantastic! 

If you are in the unfortunate position of having to pay for this yourself - or you have to convince a penny pinching boss - then now is the best time ever to get MSDN.  I'd like to know the full retail value of all the software you get in MSDN (plus the free support!) - I'm guessing it's pushing $50k but it could be a lot more.  ~$3500 is a complete steal!

Tuesday, July 12, 2005 7:18:40 AM (New Zealand Standard Time, UTC+12:00)  #    Comments [0]   General  | 

Darryl posted about an interview with Steve Balmer and the subsequent flood of slashdot abuse.

I watched the video.  It's nice to actually see Mr Balmer speaking - albeit for such a short interview. It's gratifying to witness his obvious devotion to developers.  It gave me a brief warm fuzzy feeling.

However, I also read some of the crap that slashdot posters said about his comments on open source and innovation.  There's no point to replying on slashdot, no point at all, so I'm doing it here.

Open Source is good. MS knows this.  They are a significant provider of open source code - just look at MSDN for a while, what about www.ASP.Net, www.GotDotNet.com, www.WinForms.net?  To say that MS doesn't understand or 'get it' is just plain silly.

From a business point of view, GPL and it's ilk are the devils spawn and stiffle innovation.  MS also knows this.  As a large (or small) company it would be extremely unwise to use any code that is covered by GPL.  For MS, this is a huge threat.  There are squillions of eager lawyers just waiting for the smallest infringement.

 

Tuesday, July 12, 2005 7:10:16 AM (New Zealand Standard Time, UTC+12:00)  #    Comments [0]   General  | 
# Monday, July 04, 2005

I'm trying to format contents of a cell in a DataGridView using the following code:

private void RosterGrid_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{
  ShiftCell sc = e.Value as ShiftCell;
  if (sc != null && sc.RosteredShiftRow != null)
  {
   if (!sc.RosteredShiftRow.ShiftRow.IsForegroundColorNull())
     e.CellStyle.ForeColor = Color.FromArgb(sc.RosteredShiftRow.ShiftRow.ForegroundColor);
   if (!sc.RosteredShiftRow.ShiftRow.IsBackGroundColorNull())
     e.CellStyle.BackColor = Color.FromArgb(sc.RosteredShiftRow.ShiftRow.BackGroundColor);
   e.Value = sc.ToString();
   //e.FormattingApplied = true; // tried this and it make no diff
  }
}

This should set the current cell colours for some cells only.

However the result is crap:

Anyone got any ideas?

Update:  I fixed this by making sure I set the background colour to something valid.  Sometimes is was being set to 0 and other times it was not being set at all.  Now I either set both colours or none and it works really well. 

Monday, July 04, 2005 12:20:14 PM (New Zealand Standard Time, UTC+12:00)  #    Comments [1]   General | Visual Studio  | 
Copyright © 2012 Peter G Jones. All rights reserved.
DasBlog 'Portal' theme by Johnny Hughes.
Pick a theme: