The Artima Developer Community
Sponsored Link

.NET Buzz Forum
Changes to C# and .NET Framework

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Dan Fernandez

Posts: 456
Nickname: danielfe
Registered: Aug, 2003

Daniel Fernandez is the Product Manager for C# in the developer division at Microsoft.
Changes to C# and .NET Framework Posted: Apr 1, 2004 10:14 AM
Reply to this message Reply

This post originated from an RSS feed registered with .NET Buzz by Dan Fernandez.
Original Post: Changes to C# and .NET Framework
Feed Title: Dan Fernandez's Blog
Feed URL: /msdnerror.htm?aspxerrorpath=/danielfe/Rss.aspx
Feed Description: Dan discusses Dot Net.
Latest .NET Buzz Posts
Latest .NET Buzz Posts by Dan Fernandez
Latest Posts From Dan Fernandez's Blog

Advertisement

Eric points out some of the new syntax changes we’ve made in C# 2.0 for FCLC compliance.  These changes could break some of your existing code so you should make sure to verify 1.1 code when moving to VS 2005 (Whidbey).

 

You should also be aware of the new BCL changes that will help developers write decent and non-offensive code, including changes to System.String and a new exception class. 

 

System.String

To check whether a string contains indecent content, developers can now call the IsIndecent method which returns true or false if the string is indecent.  Below is the copy/paste from ObjectBrowser on one of our latest VS builds (40326) 

public static bool IsIndecent(string str)

    Member of System.String

 

Summary:

Determines whether a specified System.String object is indecent. 

 

Parameters:

str: A System.String.

 

Return Values:                                       

 true if the value of str is indecent, otherwise, false.  

 

Example:

if (String.IsIndecent(text))

{

//Do something here             

}  

 

We have also added the ability to estimate the cost of an FCLC fine based on the contents of a string using a new method, EstimateFine.

public static float EstimateFine(string str)

    Member of System.String

 

Summary:

Provides an estimate of an indecency fine based on string contents using floating-point precision. 

 

Parameters:

str: A System.String.

 

Return Values:                                       

Single-precision floating point estimate of FCLC fines. 

 

Example:

float f = String.EstimateFine(text);

 

Note – We’ve also added a culture specific overload to EstimateFine which enables you to estimate indecency fines in other cultures.  Currently this returns 0.0 except when the culture is set to ‘EN-US’.

public static float EstimateFine(string str, System.Globalization.CultureInfo culture)

 

We’ve also changed the behavior of strings so that a string marked with a public accessor (ex: public string s;) that contains indecent content will now raise a System.IndecentException as outlined below:

 

System.IndecentException

public class IndecentException : System.Exception

    Member of System

 

Summary:

The exception that is thrown when the content of a string with a public access modifier is indecent. 

 

 

Other keywords

We are still debating this, so any feedback is appreciated.  Are any of the following language constructs, classes, properties, or methods listed below considered offensive or indecent?

  • unsafe
  • using
  • sizeof
  • EntryPointNotFoundException
  • MakeDirty() (System.Windows.Forms.AxHost)
  • SetDirtyObject (System.Web.UI.StateManagedCollection)
  • IsDirty() (System.Runtime.InteropServices)

Your feedback, as always, is appreciated.

Read: Changes to C# and .NET Framework

Topic: WSE 2.0 around the corner ... Previous Topic   Next Topic Topic: XML goodness in .NET 2.0

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use