|
What's wrong with using the IComparer class?
Simon
|
|
|
|
|
His homework assignment specifies to do it another way I presume.
|
|
|
|
|
Yeah, I suspected as much.
Although I'll give him the benefit of the doubt. Maybe he's got a cruel boss. "Write me an XML parser without using anything from the System.Xml namespace, or Strings, or a computer"
Simon
|
|
|
|
|
hi,
we can add another Icomparer class for List view Sorting ,
private void Form1_Load(object sender, EventArgs e)
{
var y = from x in dcontext.CONFIG_CITies
orderby x.str_city descending
where x.bool_active == true
select new { Code = x.int_cityID, CityName = x.str_city };
int i = 0;
foreach (var lst in y)
{
listView1.Items.Add(lst.Code.ToString());
listView1.Items[i].SubItems.Add(lst.CityName);
i++;
}
int j=0;
arr = new string[y.Count()];
foreach (var asd in y)
{
arr[j] = asd.CityName+","+asd.Code;
j++;
}
}
private void listView1_ColumnClick(object sender, ColumnClickEventArgs e)
{
listView1.Columns[1].ListView.Sorting = SortOrder.Descending;
if (listView1.Columns[1].ListView.Sorting == SortOrder.Descending)
{
listView1.Items.Clear();
string[] y;
Array.Sort(arr);
string x;
int j = 0;
for (int i = 0; i < arr.Count(); i++)
{
x = arr.ElementAt(i);
y = x.Split(',');
listView1.Items.Add(y[0]);
listView1.Items[j].SubItems.Add(y[1]);
j++;
}
}
}
i tried this above sample code ,but it is also not working .Please help me.
|
|
|
|
|
Good day,
Any idea how to get what the msagent character is hearing?? Any property/method like the speak but could do the opposite. "speech to text"
Many thanx guys
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
You would have to look into a third-party component for interpreting the sounds that get inputted through microphones, etc on the computer. I do not believe .NET does this natively. Look into SDKs for devices that can already do what you are asking.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my Blog
|
|
|
|
|
Hi All,
I’m looking for a good Unit tester that can test both the UI and the business object models. We are using the DevExpress expressApps framework.
I am aware of NUnit, MBunit, XUnit and TestDriven.net but I’m not sure what ties in the best with DevExpress.
Thanks,
|
|
|
|
|
Have you tried asking at the devexpress forums?
Kevin
|
|
|
|
|
Yes I have and no one has a single solution. Most of them are using a mixture of different unit testing software.
|
|
|
|
|
I use devExress controls and tested it using NUnit. You need to implement some pattern like MVP/MVC and make your views humble. So you can test it easily. It's a huge topic and reading this[^] blog will give you some ideas. Just read his CAB series. It's worth reading.
|
|
|
|
|
Hello,
You can use any unit tester with DevExpress, because they are not specific to any developer tool by design. We even have our own Unit test runner tool[^]
Many of us are using it internally.
As for testing eXpressApp Framework applications, I suggest you have a look at our own functional testing framework - EasyTest[^].
It was specially designed to test XAF applications and we have been successfull using it to test XAF releases internally for more than 6 years. BTW, EasyTest also can be used to test regular non-XAF applications build using DevExpress components.
Please contact our Support Team[^] in case of any questions.
Finally, I suggest you look at the Best practices of creating reusable XAF modules by example of a View Variants module extension[^] blog I recently wrote. You may be interested in it, because it also demonstrates how EasyTest can save you a lot of time.
Thanks,
Dennis
DevExpress Support, R&D, .NET Application Frameworks
|
|
|
|
|
Hi,
How can I pull out the values x, y and z in the below xml string?
"<Type><stringList xmlns=\"http://schemas.company.com/location/[app]/stringList/1.0\"><value>x</value><value>y</value><value>z</value></stringList></Type>"
|
|
|
|
|
Hi,
You could use regular expressions. Or create a XMLDocument-Object and then search for the nodes (traverse the document or use xpath).
|
|
|
|
|
yes, I should have said that I am aware that I can use xmlDocument but not sure how to loop to find <value> nodes.
|
|
|
|
|
Use the SelectNodes method.
|
|
|
|
|
Also, be aware that you have a namespace defined here, so you'll need to take that into account when performing the SelectNodes call.
|
|
|
|
|
Put the string in an XmlDocument, and use .DocumentElement.FirstChild.ChildNodes to get a list with the three value nodes.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
This seems to be working:
foreach (XmlNode valueNode in doc.ChildNodes[0].ChildNodes[0].ChildNodes)
{
}
Thank you all.
|
|
|
|
|
You should be able to use FirstChild instead of ChildNodes[0] .
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
How do I change my existing code to firstchild?
foreach (XmlNode valueNode in doc.ChildNodes[0].ChildNodes[0].ChildNodes)
{
}
Thanks
|
|
|
|
|
arkiboys wrote: How do I change my existing code to firstchild?
foreach (XmlNode valueNode in doc.ChildNodes[0].ChildNodes[0].ChildNodes)
Exactly as I showed you before:
foreach (XmlNode valueNode in doc.DocumentElement.FirstChild.ChildNodes)
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
|
Hi Everyone
I have created a Parent from and a child form. I have a calendar on the Parent form and a schedule on the child form. When i click on a date it will open the schedule form inside the parent form.I want it to create a tab when it opens.
Does any one know how to do this?
Thanks in advance
|
|
|
|
|
I would like to replace the word "Computer Box" to "Computer System" in any sentence i.e. strSentence
string strSentence = "I have a Computer Box";
The string above could be = "I have a computer boc";
Notice the upper case "C" and "b" in computer.
So no matter what the case is in the word, I would like to replace just that word and nothing else in the sentence should change their existing case.
Input:
string strSentence = "I have a Computer Box";
Result:
strSentence = "I have a Computer System"
///////////////////////////
Input:
string strSentence = "I have a computer box";
Result:
strSentence = "I have a Computer System"
This does not seem to be the solution:
strSentence = strSentence.Replace("Computer Box", "Computer System")
The above code works if the case matches, but what if the word is written as "computer box"?
How can the above replace be altere to cater for any case.
Please note that I even tried ToLower(), but that changes everything in the sentence to lower which is not what I want.
Any thoughts please?
Thanks
|
|
|
|
|
There are several ways to do this. You could use regular expressions, or iterate over the string manually searching using IndexOf, etc.
There is an article on CP that lists the possible options, and presents a faster manual technique:
http://www.codeproject.com/KB/string/fastestcscaseinsstringrep.aspx[^]
I suggest you read it, and the comments as some extra discussion of possible options has gone on there.
Simon
|
|
|
|