473,386 Members | 1,710 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Estimate a code snippet

I've found this curious code in the System.Windows.Forms.dll:

Class: System.Windows.Forms.BindToObject

internal void CheckBinding()
{
if (((this.owner == null) ||
(this.owner.BindableComponent == null)) ||
!this.owner.ControlAtDesignTime())
{
if (((this.owner.BindingManagerBase != null) &&
(this.fieldInfo != null)) &&
(this.owner.BindingManagerBase.IsBinding &&
!(this.owner.BindingManagerBase is CurrencyManager)))
{
this.fieldInfo.RemoveValueChanged(
this.owner.BindingManagerBase.Current,
new EventHandler(this.PropValueChanged));
}
if ((((this.owner != null) &&
(this.owner.BindingManagerBase != null)) &&
((this.owner.BindableComponent != null) &&
this.owner.ComponentCreated)) &&
this.IsDataSourceInitialized)
{
string text1 = this.dataMember.BindingField;
this.fieldInfo =
this.owner.BindingManagerBase.GetItemProperties(). Find(text1, true);
if (((this.owner.BindingManagerBase.DataSource != null) &&
(this.fieldInfo == null)) && (text1.Length > 0))
{
object[] objArray1 = new object[] { text1 } ;
throw new ArgumentException(
SR.GetString("ListBindingBindField", objArray1),
"dataMember");
}
if (((this.fieldInfo != null) &&
this.owner.BindingManagerBase.IsBinding) &&
!(this.owner.BindingManagerBase is CurrencyManager))
{
this.fieldInfo.AddValueChanged(
this.owner.BindingManagerBase.Current,
new EventHandler(this.PropValueChanged));
}
}
else
{
this.fieldInfo = null;
}
}
}

Estimate it. Cheer!

P.S. decompiled with .NET Reflector.

--
Vladimir Nesterovsky
Jan 19 '06 #1
1 1177
> I've found this curious code in the System.Windows.Forms.dll:

Class: System.Windows.Forms.BindToObject

internal void CheckBinding()
{
if ((this.owner == null) || ...)
{
if ((this.owner.BindingManagerBase != null) && ...


In spite of silence I want to believe someone from MS will fix this buggy
code.
When (this.owner == null) you are asking for NullReferenceException.
--
Vladimir Nesterovsky
Jan 23 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Fan Ruo Xin | last post by:
How to estimate the size of log space when I need to run "INSERT INTO tgt_tbl SELECT * FROM src_tbl WHERE..." ? What is the difference of before image between the above INSERT stmt and the...
1
by: Thomas Wang | last post by:
How I can estimate null reference of an object without fire NullReferenceException ? (for example: estimate ListBox.datasource is null or empty) B.Rgds
31
by: Bob | last post by:
I have recently joined a healthcare company where I am the solo programmer. I am going to be starting work on a project. The management has asked me to provide an estimate of hours I am going to...
2
by: daokfella | last post by:
Hi all, I've created a code snippet in VS 2005 and saved it in the proper snippet folder. When I right-click and select Insert Snippet, I navigation to My Code Snippets and it shows my snippet....
9
by: shuisheng | last post by:
Dear All, I have little experience in coding. For a c++ code with 30,000 lines, It is large or small? For two average programmers, usually how long does it take to finish the code? The code...
13
by: frk.won | last post by:
I am interested in learning how to use the VS 2005 code snippets. However, I wish to know what are the best ways to source control the code snippets? Are there any source safe/subversion...
4
by: tshad | last post by:
I was watching a video that used a code snippet to create a property and when you type "prop" tab tab, it would create the private variable as well as the property definitions with the private...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.