February 2007 - Posts

Vista and Office 2007 Preview Handler Pack released
28 February 07 03:54 PM | danieb | 1 comment(s)

File previewers that come with the 2007 Microsoft Office system allow you to preview the following files in Microsoft Office Outlook 2007:

Microsoft Office Outlook 2007 items.
Microsoft Office Word 2007 documents.
Microsoft Office PowerPoint 2007 presentations.
Microsoft Office Excel 2007 worksheets.
Microsoft Office Visio 2007 drawings.
Images and text files.

Check this cool Preview Handler for *.cs and *.aspx. Then here is another previewer from msdn mag for pdf.

   

  

Inheriting Attributes from an Interface
22 February 07 05:15 PM | danieb | with no comments

[AttributeUsage(AttributeTargets.Property | AttributeTargets.Method)]

public class SomeAttribute : System.Attribute { }

 

public interface ISomeInterface

{

[SomeAttribute]

string Property { get; set;}

 

[SomeAttribute]

string GetProperty();

}

 

public class SomeClass : ISomeInterface

{

public string Property

{

get { throw new NotImplementedException(); }

set { throw new NotImplementedException(); }

}

public string GetProperty() { throw new NotImplementedException(); }

}

 

[TestMethod()]

public void TestAttributeOn_ISomeInterface_PropertyInfo()

{

Type t = typeof(ISomeInterface);

PropertyInfo propInfo = t.GetProperty("Property");

 

Assert.IsNotNull(System.Attribute.GetCustomAttribute(propInfo, typeof(SomeAttribute)));

}

[TestMethod()]

public void TestAttributeOn_SomeClass_PropertyInfo()

{

Type t = typeof(SomeClass);

PropertyInfo propInfo = t.GetProperty("Property");

Assert.IsNotNull(System.Attribute.GetCustomAttribute(propInfo, typeof(SomeAttribute), true));

}

[TestMethod()]

public void TestAttributeOn_SomeClass_GetProperty()

{

Type t = typeof(SomeClass);

MethodInfo methodInfo = t.GetMethod("GetProperty");

Assert.IsNotNull(System.Attribute.GetCustomAttribute(methodInfo, typeof(SomeAttribute), true));

}

 

So the second and third test (TestAttributeOn_SomeClass_PropertyInfo, TestAttributeOn_SomeClass_GetProperty) fails.

So if I think of WCF we define an interface with attributes.

 

Example:

 

[ServiceContract]

public interface ICustomers

{

[OperationContract]

string GetCustomer();

}

 

So surely if WCF can inherit attributes we should also be able to do so too!

But wait a minute in WCF only the interface is exposed. Damn!

 

So what is the solution? Recursively check for attributes on inherited interfaces?!

 

 

Vista Drivers
20 February 07 04:32 PM | danieb | with no comments

Here is a cool site if you are looking for Vista Drivers (Has most of the drivers of the big vendors). This will save you some time.

New Releases
19 February 07 08:52 PM | danieb | 2 comment(s)

 

Microsoft SQL Server 2005 Service Pack 2

Virtual PC 2007 Released