|
If you find the .NET collections not convenient or flexible enough for your tastes be aware that there are some well-tested alternative open source collection libraries around, e.g.,
PowerCollections[^]
Welcome to Power Collections, A Community Project to Develop the Best Public License type safe Collection Classes for .NET. Power Collections makes heavy use of .NET Generics. The goal of the project is to provide generic collection classes that are not available in the .NET framework. Some of the collections included are the Deque, MultiDictionary, Bag, OrderedBag, OrderedDictionary, Set, OrderedSet, and OrderedMultiDictionary.
and
The C5 Generic Collection Library[^]
C5 is a library of generic collection classes for C# and other CLI languages and works with Microsoft .Net version 2.0 and Mono version 1.2 and later.
C5 provides functionality and data structures not provided by the standard .Net System.Collections.Generic namespace, such as persistent tree data structures, heap based priority queues, hash indexed array lists and linked lists, and events on collection changes. Also, it is more comprehensive than collection class libraries on other similar platforms, such as Java. Unlike many other collection class libraries, C5 is designed with a strict policy of supporting "code to interface not implementation".
I myself have been using PowerCollections in the past few days in connection with user role management. PowerCollections is a little easier to use as it's a natural extension of the framework classes. C5 is more powerful but rather more esoteric. Also PowerCollections is better documented with intellisense tooltips and so on. Both are accompanied by unit tests.
Kevin
|
|
|
|
|
Hi Kees,
1.
SortedList is a HashTable or Dictionary, so it stores (Key,Value) pairs. If you don't
need values, you could specify "null" for all of them.
2.
Yes, I found the collection names a bit confusing; I would expect a Dictionary to always be
sorted (as in: Van Dale) but that is not how .NET sees it.
3.
Maybe this will interest you:
http://www.itu.dk/research/c5/[^]
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Luc Pattyn wrote: I found the collection names a bit confusing; I would expect a Dictionary to always be
sorted
Well, that's probably just because real world dictionaries are sorted in order for us to find anything in them. If you look at how a paper dictionary works, a sorted list would be digital equivalent, but if you instead concentrate on the purpose of a dictionary, i.e. to find single items in a large collection, the naming of the class makes more sense.
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
Yes, I know what they do, but why choose names that are counterintuitive, i.e.
don't match real-world terms.
I would prefer a Map for a .NET Dictionary, and a SortedMap for a .NET SortedList
(it isn't a sorted List, in .NET terms it is a sorted dictionary).
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Luc Pattyn wrote: Yes, I know what they do, but why choose names that are counterintuitive, i.e.
don't match real-world terms.
They match the real-world items if you think of them from a certain point of view.
Computerised real-world concepts often mimic only some aspects but not all. If you take radio buttons for example, they pop out just like buttons on a real radio, but you can't turn them to change the preset frequency.
Luc Pattyn wrote: I would prefer a Map for a .NET Dictionary
A map to me is something that describes two dimensional geographical data, so that would be even more confusing...
Luc Pattyn wrote: and a SortedMap for a .NET SortedList
(it isn't a sorted List, in .NET terms it is a sorted dictionary).
The internal storage for a SortedList is a pair of arrays, so it actually is a sorted list.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hello together,
I start a new process inside a system process (IIS web service) like this:
Dim pProcess As New System.Diagnostics.Process
Dim sArguments As String = ""
pProcess.StartInfo.FileName = "process.exe"
pProcess.StartInfo.Arguments = sArguments
pProcess.StartInfo.WorkingDirectory = "c:\temp"
pProcess.StartInfo.CreateNoWindow = False
pProcess.StartInfo.WindowStyle = ProcessWindowStyle.Normal
pProcess.Start()
Process is startet, but the window is not visible on the desk. I think, the problem is the system process as father. If the new process throws an exception, the window is visible.
Did anybody know, how I can make the process window visible on the desk? Can be some nice parameters on the process object himself or inside the process (source code is written in VB.NET).
Thanks
Stephan
\\\| \\ - -
( @ @ )
+---------------oOOo-(_)-oOOo-----------------+
| Stephan Pilz stephan.pilz@stephan-pilz.de |
| <a href="http://www.stephan-pilz.de">www.stephan-pilz.de</a> |
| ICQ#: 127823481 |
+-----------------------Oooo------------------+
oooO ( )
( ) ) /
\ ( (_/
\_)
|
|
|
|
|
So why would a Web Service be starting an interactive process on the server?
Since services run under they're own desktop, the window is getting created, just on a desktop that is hidden from view.
|
|
|
|
|
Because the web service is only a wrapper to business logic process and I want to see some trace messages from the BL-process. Store this messages in event log or a log file is not a solution for me.
Please don't ask why I do it so, because there is no other way. Please give me hints, tricks or ideas to solve my problem. It's not possible to change the infrastructure.
Stephan
\\\| \\ - -
( @ @ )
+---------------oOOo-(_)-oOOo-----------------+
| Stephan Pilz stephan.pilz@stephan-pilz.de |
| <a href="http://www.stephan-pilz.de">www.stephan-pilz.de</a> |
| ICQ#: 127823481 |
+-----------------------Oooo------------------+
oooO ( )
( ) ) /
\ ( (_/
\_)
|
|
|
|
|
Stephan Pilz wrote: Please don't ask why I do it so, because there is no other way
Keep that up and you'll be completely on your own in no time.
Since your ASP.NET WEb Service cannot show a user interface on the server hosting it, you'll have to supply a UI some other way, like a normal Windows Forms app running a custom TraceListener exposed as a singleton class inside a WCF Service.
Well, a rather convoluted solution would be to create your own implementation of a TraceListener, setup as a singleton, in a host application that shows all incomming trace messages. This trace listener would be exposed through the host as a remotable object, or do the same thing as a WCF service hosted in a Windows Form or Console application.
In your Web Service Global.asax page, in possibly the Application_Start, Session_Start, or Application_BeginRequest handlers, you'd get the reference to the custom trace listener, add it to the Trace.Listeners collection in your Web Service, handle the call and output your trace messages.
The custom TraceListenerwould output any messages to a TextBox, Console window, log to a file, ..., whatever you want.
The downside is that this is a convoluted solution. The up side is that is lets you deploy your web service to multiple servers and still log all trace messages to a single window on a single monitoring workstation.
|
|
|
|
|
I'm using visual studio 2005. I designed a user-defined DataSet using the DataSet designer. I inserted a table and wanted one of its columns to be hidden (not emitted when the DataSet is serialized to XML). The designer by default sets the column mapping to <i>Element</i>. I found no method in the designer (or the property sheet) to set the column mapping. I tried to override this setting by hand editing the .cs (, I'm using c#,) file generated by the designer and changed the mapping type (, the fourth parameter,) in the DataColumn constructor to <i>Hidden</i>. However each time I make any slight change in the DataSet designer, it regenerates the .cs file reverting my change back to the <i>Element</i> setting.
Any idea about how to overcome this problem?
|
|
|
|
|
MSK61 wrote: However each time I make any slight change in the DataSet designer, it regenerates the .cs file reverting my change back to the Element setting.
Any idea about how to overcome this problem?
How often do you change the schema? If your in development and that's why the schema is changing frequently why worry about hiding the column? Just wait until you are finished and then change the class.
led mike
|
|
|
|
|
I'm looking for a free obfuscator tool.
I tried Aspose and Skater Lite, but each one of them throws an exception while processing my assembly.
My assembly doesn't contain reflection.
Do you know any other free (or light versions) of obfuscators (especialy for .NET Compact Framework 1.0) ?
My english is not so good. Please, correct my errors.
Best regards, Alexey.
|
|
|
|
|
|
Dotfuscator Community edition is allowed for non-commercial use only.
My english is not so good. Please, correct my errors.
Best regards, Alexey.
|
|
|
|
|
Can you point me to any tool that could generate a database model (DDL would be great) from a reverse engineered model from C# classes (which are the DTOs) ? Or maybe a combination of tools?
|
|
|
|
|
Xpress Persistent Objects from DevExpress.
|
|
|
|
|
I have a VB.net 2005 solution called MySolution.sln, with a windows project, a windows service, a class libriary, a merge module project and a windows setup project. wen i run the building command in command prompt,
devenv.exe /build release MySolution.sln
nothing is happening and no messages are returned or anything, the prompt simply goes to the next line and prompts for a new command. Has anyone ever encountered this problem, how is it solved?
thanks for looking at least.
|
|
|
|
|
hi there,
i encountered a strange behaviour of my wpf runtime.
every wpf program is displayed wrong, nothis is displayed correctly.
wheter it is kaxaml, vs2008 or any other wpf program i´ve written before.
i tried to reinstall .net 3.5 but the problem just remains.
i don't wanna install everything from scratch.
any ideas?
system: win xp sp2 german with vs2005pro(german), vs2008pro(english)
.net 2.0,3.0,3.5
i´ve no idea what´s going on.
any ideas?
best regards
jk
|
|
|
|
|
We now have a forum on CP for WPF. This is probably a better place to ask this. Also, please try to give a more meaningful problem description that nothing is displayed correctly. You need to identify what exactly is displayed incorrectly.
|
|
|
|
|
well,i thought as wpf is part of the .netframework and i don't think it hasn't anything to do with wpf coding itself, the .net framework forum would be a beter place.
well, e.g. the wpf propertygrid in vs2008 is completely disrupted (as kaxaml and wpfpad also).
vs2008 is not able to display lineargradients anymore (only the last gradientstop color gets displayed), and much more.
it seems like the wpf runtime got set back to a pre-pre-pre-alpha version. (though i know the latest 3.5 framework is installed.)
|
|
|
|
|
Hi everybody
I'm making a web custom control which is just for getting feedbacks from visitors so I have created a database and a dataset via SQRExpress and then in my send buttom click event I have this code:
void _send_Click(object sender, EventArgs e)
{
FeedBackDBDataSetTableAdapters.FDTableTableAdapter ta=new FDTableTableAdapter();
tableAdapter.InsertQuery(Category, textBox1.text); tableAdapter.Dispose();
}
The problem is here that after I run a project which contains this control and press the send buttom, this Error Appears:
A connection was successfully established with the server, but then an error occurred during the login process. (provider: Named Pipes Provider, error: 0 - No process is on the other end of the pipe.)
Does any one know why?
thanks.
|
|
|
|
|
I think that I found the answer to this problem,(of course if any one knows a better way it's very kind of him/her to post it to me). so my answer to me is this:
probably when you want a SQLEXPRESS database to be included in a web custom control, and then drag the control to a web page the page can not log to database for any insertion or update. I made a SQl database some were out side the control and passed the connection string to a dataset in the control and I was very pleased to see it worked!!.
|
|
|
|
|
i'm new in vb.net, i'm using Microsoft Visual Studio .Net 2003
i try to create a system to record customer problem regarding our system, when they call us. each time i submit the record, it will save the data that i've key-in and must generate a unique document number for our reference. i try to create the docNo but it didnt work. how to add data from 3 textbox in one field into my table? HELP..
|
|
|
|
|
zaimah wrote: i try to create the docNo but it didnt work.
The description "didn't work" is a rather useless. What did you do to try to create the docNo, and what happened specifically when you tried this?
Are you using a database? In that case the easiest way to create a unique id is to set up an automaitcally incremented field in the table. How that is done depends on what brand of database you are using.
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
Hi all, quite new to asp.net c# programming, i have a mifare reader PCR310U , i need to develop a website which can retrieve information(like card ID) through website using remote mifare reader in remote computer when surfing the website.
for example, i already published my website, when i'm not at the server computer and at my own house, i have a mifare card reader which is connected to my house's PC and a mifare Card, i wish to register the card ID together with my IC number and save into my system website database. can anyone enlighten me on how to go about doing it?i really have no idea how i can retrieve information through mifare reader through the internet website.
if you can help me pls email me.this system quite urgent for me.
thanks alot
tyrone
tyrone_93@Hotmail.com
|
|
|
|
|