Click here to Skip to main content
15,885,771 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a dictionary like
C#
Dictionary<double, double> Draw = new Dictionary<double, double>();
                              Draw.Add(7.781,2.96);
                              Draw.Add(7.578, 3.640);
                              Draw.Add(7.5,4.358);
                              Draw.Add(7.625,5.109);
                              Draw.Add(7.578,5.765);
                              Draw.Add(7.546,6.484);
                              Draw.Add(7.5,7.140);
                              Draw.Add(7.546,7.859);
                              Draw.Add(7.5,8.609);


C#
foreach (KeyValuePair<double, double> drop in Draw)
                               {
                                   Shape conductorCable12shape = panelSheet.Drop(conductorCable12, "Key = {0}, Value = {1}");
                               }


But here how can i pass the values as Conductorcable12 is fixed and i have to pass 2 arguments.
Posted
Updated 21-Dec-14 21:51pm
v2
Comments
BillWoodruff 22-Dec-14 5:21am    
If 'ConductorCable12 has a "fixed" value, then why do you need to pass it as a parameter ?

1 solution

Try this:
C#
Shape conductorCable12shape = panelSheet.Drop(conductorCable12, String.Format("Key = {0}, Value = {1}", drop.Key, drop.Value));

String.Format formats the string; it replaces the {0} with the key and {1} with the value.

EDIT: you said in your comment that it takes 3 arguments. Try this:
C#
Shape conductorCable12shape = panelSheet.Drop(conductorCable12, drop.Key, drop.Value);
 
Share this answer
 
v2
Comments
ridoy 22-Dec-14 3:57am    
5ed
Thomas Daniels 22-Dec-14 3:57am    
Thank you!
chandra sekhar 22-Dec-14 3:59am    
It takes total 3 arguments (conductorcable12,x,y);
Thomas Daniels 22-Dec-14 4:03am    
I edited my answer.
chandra sekhar 22-Dec-14 4:13am    
What is the difference between your first and second answer?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900