I'm trying to replicate the behaviour of the Commerce.Dictionary object that
was found in Commerce Server 3.0
By using a hashtable or creating a custom class that implements IDictionary,
you have to add elements by using the following syntax.
DictionaryObject.Add("key","value");
However, the old Commerce Server Dictionary object used the following
syntax.
DictionaryObject.Name = "Fred"
In this instance, the dictionary object creates a new element key called
"Name" and assigns the value of "Fred" to it.
Any thoughts on how to replicate this? 15 7908
What are probably looking to do is create a Dictionary Object and then a
Collection of Dictionary Object, so more like
Public class MyDictObj
{
// has member name
}
public class CMyDictObj : CollectionBase
{
// represents collection of MyDictObj
}
HTH
VJ
"Dave Young" <da***************@softwarespectrum.comwrote in message
news:OB**************@TK2MSFTNGP02.phx.gbl...
I'm trying to replicate the behaviour of the Commerce.Dictionary object
that was found in Commerce Server 3.0
By using a hashtable or creating a custom class that implements
IDictionary, you have to add elements by using the following syntax.
DictionaryObject.Add("key","value");
However, the old Commerce Server Dictionary object used the following
syntax.
DictionaryObject.Name = "Fred"
In this instance, the dictionary object creates a new element key called
"Name" and assigns the value of "Fred" to it.
Any thoughts on how to replicate this?
It's not perfect, but you could use an indexer to reduce the amount of
modification.
private Dictionary<string, stringhash = new Dictionary<string, string>();
public string this[string key]
{
get
{
return hash[key];
}
set
{
hash[key] = value;
}
}
Which means that instead of:
DictionaryObject.Name = "Fred"
you do:
DictionaryObject["Name"] = "Fred";
I think it's not possible to dynamically create properties as C# is a
statically typed language and you will get a compiler error if the property
you are asking for does not exist.
If you REALLY want it to work like this and don't care about bloat you could
write a codeGen to create a class file with every single alphabetical
combination created as a property.
As an example of A:
public string A
{
get
{
return hash["A"];
}
set
{
hash["A"] = value;
}
}
But that would be a seriously LONG file.
HTH
Simon
"Dave Young" <da***************@softwarespectrum.comwrote in message
news:OB**************@TK2MSFTNGP02.phx.gbl...
I'm trying to replicate the behaviour of the Commerce.Dictionary object
that
was found in Commerce Server 3.0
By using a hashtable or creating a custom class that implements
IDictionary,
you have to add elements by using the following syntax.
DictionaryObject.Add("key","value");
However, the old Commerce Server Dictionary object used the following
syntax.
DictionaryObject.Name = "Fred"
In this instance, the dictionary object creates a new element key called
"Name" and assigns the value of "Fred" to it.
Any thoughts on how to replicate this?
I don't really understand the point.
Can't you just use a database?
Is SQL Server more complex than this?
-Todos
On Mar 13, 11:16 am, "Dave Young"
<dave.young.nos...@softwarespectrum.comwrote:
I'm trying to replicate the behaviour of the Commerce.Dictionary object that
was found in Commerce Server 3.0
By using a hashtable or creating a custom class that implements IDictionary,
you have to add elements by using the following syntax.
DictionaryObject.Add("key","value");
However, the old Commerce Server Dictionary object used the following
syntax.
DictionaryObject.Name = "Fred"
In this instance, the dictionary object creates a new element key called
"Name" and assigns the value of "Fred" to it.
Any thoughts on how to replicate this?
I believe that the OP is asking about an in-memory data structure, not
a long-term storage option.
On Mar 13, 1:49 pm, "Todos Menos [MSFT]"
<todos_menos_m...@hotmail.comwrote:
I don't really understand the point.
Can't you just use a database?
Is SQL Server more complex than this?
-Todos
On Mar 13, 11:16 am, "Dave Young"
<dave.young.nos...@softwarespectrum.comwrote:
I'm trying to replicate the behaviour of the Commerce.Dictionary object that
was found in Commerce Server 3.0
By using a hashtable or creating a custom class that implements IDictionary,
you have to add elements by using the following syntax.
DictionaryObject.Add("key","value");
However, the old Commerce Server Dictionary object used the following
syntax.
DictionaryObject.Name = "Fred"
In this instance, the dictionary object creates a new element key called
"Name" and assigns the value of "Fred" to it.
Any thoughts on how to replicate this?
I "think" he's trying to prop up existing code by re-writing this library.
If the API changes then more code needs to be re-written.
That's why I think he's not using a database.
I could be wrong though, if that's the case then you're right a database is
definately the best course of action. Because trying to create a dynamic
type in a statically typed language is like putting a square peg in a round
hole.
"Todos Menos [MSFT]" <to**************@hotmail.comwrote in message
news:11*********************@b75g2000hsg.googlegro ups.com...
I don't really understand the point.
Can't you just use a database?
Is SQL Server more complex than this?
-Todos
On Mar 13, 11:16 am, "Dave Young"
<dave.young.nos...@softwarespectrum.comwrote:
I'm trying to replicate the behaviour of the Commerce.Dictionary object
that
was found in Commerce Server 3.0
By using a hashtable or creating a custom class that implements
IDictionary,
you have to add elements by using the following syntax.
DictionaryObject.Add("key","value");
However, the old Commerce Server Dictionary object used the following
syntax.
DictionaryObject.Name = "Fred"
In this instance, the dictionary object creates a new element key called
"Name" and assigns the value of "Fred" to it.
Any thoughts on how to replicate this?
Simon Tamman <i_**********************************@NOSPAMhotmai l.com>
wrote:
I "think" he's trying to prop up existing code by re-writing this library.
If the API changes then more code needs to be re-written.
That's why I think he's not using a database.
I could be wrong though, if that's the case then you're right a database is
definately the best course of action. Because trying to create a dynamic
type in a statically typed language is like putting a square peg in a round
hole.
"Todos" isn't trying to make serious points - he's just trolling. Best
to ignore.
--
Jon Skeet - <sk***@pobox.com> http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Thanks for the tip. :D
No chance I could get your opinion on my wierd bug I posted yesterday is
there?
I did include a "short but complete" example to demonstrate the problem. :D
"Jon Skeet [C# MVP]" <sk***@pobox.comwrote in message
news:MP************************@msnews.microsoft.c om...
Simon Tamman <i_**********************************@NOSPAMhotmai l.com>
wrote:
I "think" he's trying to prop up existing code by re-writing this
library.
If the API changes then more code needs to be re-written.
That's why I think he's not using a database.
I could be wrong though, if that's the case then you're right a database
is
definately the best course of action. Because trying to create a dynamic
type in a statically typed language is like putting a square peg in a
round
hole.
"Todos" isn't trying to make serious points - he's just trolling. Best
to ignore.
--
Jon Skeet - <sk***@pobox.com> http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
I just think that we should be teaching these Newbies about DATABASES
and not all this ADO.net and XML _CRAP_
that is why we outsource all this crap to india-- because there aren't
enough kids in the good old USA that know how to speak SQL
On Mar 13, 2:00 pm, "Bruce Wood" <brucew...@canada.comwrote:
I believe that the OP is asking about an in-memory data structure, not
a long-term storage option.
On Mar 13, 1:49 pm, "Todos Menos[MSFT]"
<todos_menos_m...@hotmail.comwrote:
I don't really understand the point.
Can't you just use a database?
Is SQL Server more complex than this?
-Todos
On Mar 13, 11:16 am, "Dave Young"
<dave.young.nos...@softwarespectrum.comwrote:
I'm trying to replicate the behaviour of the Commerce.Dictionary object that
was found in Commerce Server 3.0
By using a hashtable or creating a custom class that implements IDictionary,
you have to add elements by using the following syntax.
DictionaryObject.Add("key","value");
However, the old Commerce Server Dictionary object used the following
syntax.
DictionaryObject.Name = "Fred"
In this instance, the dictionary object creates a new element key called
"Name" and assigns the value of "Fred" to it.
Any thoughts on how to replicate this?- Hide quoted text -
- Show quoted text -
Simon Tamman <i_**********************************@NOSPAMhotmai l.com>
wrote:
Thanks for the tip. :D
No chance I could get your opinion on my wierd bug I posted yesterday is
there?
I did include a "short but complete" example to demonstrate the problem. :D
Unfortunately I don't know a lot about the details of Windows Forms.
Have you asked in the Windows Forms newsgroup?
--
Jon Skeet - <sk***@pobox.com> http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
You are correct sir. There an old asp application that our company uses
that was originally built upon Site Server 3.0 and Commerce Server 3.0.
Well, one company aquisition and a datacenter migration tends to make one
want to eliminate, or at least reduce, the number of 3rd party applications
that need to be re-installed. I've been able to migrate all of the
previously used CS and SS dlls that were being used, to C#, but this one
eludes me. I originally attacked it by giving them (the asp dudes) a simple
implementation of IDictionary, but that didn't give them the same usage as
the original. Thus, my post.
If it can't be done, then I'll just tell them so and they can go back and
change their code to use the implementation I gave them.
Thanks
Dave
"Simon Tamman" <i_**********************************@NOSPAMhotmai l.com>
wrote in message news:In***************@newsfe4-gui.ntli.net...
>I "think" he's trying to prop up existing code by re-writing this library.
If the API changes then more code needs to be re-written.
That's why I think he's not using a database.
I could be wrong though, if that's the case then you're right a database
is
definately the best course of action. Because trying to create a dynamic
type in a statically typed language is like putting a square peg in a
round
hole.
"Todos Menos [MSFT]" <to**************@hotmail.comwrote in message
news:11*********************@b75g2000hsg.googlegro ups.com...
>I don't really understand the point.
Can't you just use a database?
Is SQL Server more complex than this?
-Todos
On Mar 13, 11:16 am, "Dave Young" <dave.young.nos...@softwarespectrum.comwrote:
I'm trying to replicate the behaviour of the Commerce.Dictionary object
that
was found in Commerce Server 3.0
By using a hashtable or creating a custom class that implements
IDictionary,
you have to add elements by using the following syntax.
DictionaryObject.Add("key","value");
However, the old Commerce Server Dictionary object used the following
syntax.
DictionaryObject.Name = "Fred"
In this instance, the dictionary object creates a new element key
called
"Name" and assigns the value of "Fred" to it.
Any thoughts on how to replicate this?
yeah 'I dont know Windows forms'
the funny thing is that Iknow of about a hundred PHP kids that can
just flat out-develop these ASP.net fags
-Todos
On Mar 13, 3:19 pm, Jon Skeet [C# MVP] <s...@pobox.comwrote:
Simon Tamman <i_am_GETRIDOFTHISJUNKanti_everyth...@NOSPAMhotmai l.com>
wrote:
Thanks for the tip. :D
No chance I could get your opinion on my wierd bug I posted yesterday is
there?
I did include a "short but complete" example to demonstrate the problem. :D
Unfortunately I don't know a lot about the details of Windows Forms.
Have you asked in the Windows Forms newsgroup?
--
Jon Skeet - <s...@pobox.com>http://www.pobox.com/~skeet Blog:http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
I'm not trolling
I'm throwing molotov cocktails against the oppressive regime in
Redmond
TIME FOR REGIME CHANGE IN REDMOND!
-Todos
On Mar 13, 2:13 pm, Jon Skeet [C# MVP] <s...@pobox.comwrote:
Simon Tamman <i_am_GETRIDOFTHISJUNKanti_everyth...@NOSPAMhotmai l.com>
wrote:
I "think" he's trying to prop up existing code by re-writing this library.
If the API changes then more code needs to be re-written.
That's why I think he's not using a database.
I could be wrong though, if that's the case then you're right a database is
definately the best course of action. Because trying to create a dynamic
type in a statically typed language is like putting a square peg in a round
hole.
"Todos" isn't trying to make serious points - he's just trolling. Best
to ignore.
--
Jon Skeet - <s...@pobox.com>http://www.pobox.com/~skeet Blog:http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
and really. seriously
I don't really understand the point.
Can't you just use a database?
Is SQL Server more complex than this?
-Todos
On Mar 13, 12:21 pm, "Simon Tamman"
<i_am_GETRIDOFTHISJUNKanti_everyth...@NOSPAMhotmai l.comwrote:
It's not perfect, but you could use an indexer to reduce the amount of
modification.
private Dictionary<string, stringhash = new Dictionary<string, string>();
public string this[string key]
{
get
{
return hash[key];
}
set
{
hash[key] = value;
}
}
Which means that instead of:
DictionaryObject.Name = "Fred"
you do:
DictionaryObject["Name"] = "Fred";
I think it's not possible to dynamically create properties as C# is a
statically typed language and you will get a compiler error if the property
you are asking for does not exist.
If you REALLY want it to work like this and don't care about bloat you could
write a codeGen to create a class file with every single alphabetical
combination created as a property.
As an example of A:
public string A
{
get
{
return hash["A"];}
set
{
hash["A"] = value;
}
}
But that would be a seriously LONG file.
HTH
Simon
"Dave Young" <dave.young.nos...@softwarespectrum.comwrote in message
news:OB**************@TK2MSFTNGP02.phx.gbl...
I'm trying to replicate the behaviour of the Commerce.Dictionary object
that
was found in Commerce Server 3.0
By using a hashtable or creating a custom class that implements
IDictionary,
you have to add elements by using the following syntax.
DictionaryObject.Add("key","value");
However, the old Commerce Server Dictionary object used the following
syntax.
DictionaryObject.Name = "Fred"
In this instance, the dictionary object creates a new element key called
"Name" and assigns the value of "Fred" to it.
Any thoughts on how to replicate this?- Hide quoted text -
- Show quoted text -
Well to support the current implementation is it not possible to just
collate all the properties they are using and implement those? Or are there
way too many to implement?
I mean name could be implemented like:
public string Name
{
get
{
return hash["Name"];
}
set
{
hash["Name"] = value;
}
}
I guess it depends on how many dynamic tags they're using on this object.
"Dave Young" <dm************@verizon.netwrote in message
news:eF**************@TK2MSFTNGP06.phx.gbl...
You are correct sir. There an old asp application that our company uses
that was originally built upon Site Server 3.0 and Commerce Server 3.0.
Well, one company aquisition and a datacenter migration tends to make one
want to eliminate, or at least reduce, the number of 3rd party
applications
that need to be re-installed. I've been able to migrate all of the
previously used CS and SS dlls that were being used, to C#, but this one
eludes me. I originally attacked it by giving them (the asp dudes) a
simple
implementation of IDictionary, but that didn't give them the same usage as
the original. Thus, my post.
If it can't be done, then I'll just tell them so and they can go back and
change their code to use the implementation I gave them.
Thanks
Dave
"Simon Tamman" <i_**********************************@NOSPAMhotmai l.com>
wrote in message news:In***************@newsfe4-gui.ntli.net...
I "think" he's trying to prop up existing code by re-writing this
library.
If the API changes then more code needs to be re-written.
That's why I think he's not using a database.
I could be wrong though, if that's the case then you're right a database
is
definately the best course of action. Because trying to create a dynamic
type in a statically typed language is like putting a square peg in a
round
hole.
"Todos Menos [MSFT]" <to**************@hotmail.comwrote in message
news:11*********************@b75g2000hsg.googlegro ups.com...
I don't really understand the point.
Can't you just use a database?
Is SQL Server more complex than this?
-Todos
On Mar 13, 11:16 am, "Dave Young"
<dave.young.nos...@softwarespectrum.comwrote:
I'm trying to replicate the behaviour of the Commerce.Dictionary
object
that
was found in Commerce Server 3.0
By using a hashtable or creating a custom class that implements
IDictionary,
you have to add elements by using the following syntax.
DictionaryObject.Add("key","value");
However, the old Commerce Server Dictionary object used the following
syntax.
DictionaryObject.Name = "Fred"
In this instance, the dictionary object creates a new element key
called
"Name" and assigns the value of "Fred" to it.
Any thoughts on how to replicate this?
That's one approach I hadn't thougth about.
Thanks
"Simon Tamman" <i_**********************************@NOSPAMhotmai l.com>
wrote in message news:QE***************@newsfe5-win.ntli.net...
Well to support the current implementation is it not possible to just
collate all the properties they are using and implement those? Or are
there
way too many to implement?
I mean name could be implemented like:
public string Name
{
get
{
return hash["Name"];
}
set
{
hash["Name"] = value;
}
}
I guess it depends on how many dynamic tags they're using on this object.
"Dave Young" <dm************@verizon.netwrote in message
news:eF**************@TK2MSFTNGP06.phx.gbl...
>You are correct sir. There an old asp application that our company uses that was originally built upon Site Server 3.0 and Commerce Server 3.0.
Well, one company aquisition and a datacenter migration tends to make one want to eliminate, or at least reduce, the number of 3rd party
applications
>that need to be re-installed. I've been able to migrate all of the previously used CS and SS dlls that were being used, to C#, but this one eludes me. I originally attacked it by giving them (the asp dudes) a
simple
>implementation of IDictionary, but that didn't give them the same usage as the original. Thus, my post.
If it can't be done, then I'll just tell them so and they can go back and change their code to use the implementation I gave them.
Thanks Dave
"Simon Tamman" <i_**********************************@NOSPAMhotmai l.com> wrote in message news:In***************@newsfe4-gui.ntli.net...
>I "think" he's trying to prop up existing code by re-writing this
library.
If the API changes then more code needs to be re-written.
That's why I think he's not using a database.
I could be wrong though, if that's the case then you're right a
database
is
definately the best course of action. Because trying to create a
dynamic
type in a statically typed language is like putting a square peg in a
round
hole.
"Todos Menos [MSFT]" <to**************@hotmail.comwrote in message
news:11*********************@b75g2000hsg.googlegro ups.com... I don't really understand the point.
Can't you just use a database?
Is SQL Server more complex than this?
-Todos
On Mar 13, 11:16 am, "Dave Young" <dave.young.nos...@softwarespectrum.comwrote:
I'm trying to replicate the behaviour of the Commerce.Dictionary
object
that
was found in Commerce Server 3.0
By using a hashtable or creating a custom class that implements
IDictionary,
you have to add elements by using the following syntax.
DictionaryObject.Add("key","value");
However, the old Commerce Server Dictionary object used the
following
syntax.
DictionaryObject.Name = "Fred"
In this instance, the dictionary object creates a new element key
called
"Name" and assigns the value of "Fred" to it.
Any thoughts on how to replicate this? This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: boohoo |
last post by:
I can't seem to do this:
I want to take a query string and place two halves of the querystring
into two separate dictionary objects.
So... I loop through the collection of querystring items,...
|
by: orekinbck |
last post by:
Hi There
I am probably missing something fundamental here, but I cannot see a
method to search the values of a generic dictionary so that I can find
the key ? Of course I could enumerate...
|
by: jg |
last post by:
I was trying to get custom dictionary class that can store generic or
string; So I started with the example given by the visual studio 2005 c#
online help for simpledictionay object
That seem...
|
by: Martin Widmer |
last post by:
Hi Folks.
When I iterate through my custom designed collection, I always get the
error:
"Unable to cast object of type 'System.Collections.DictionaryEntry' to type...
|
by: Girish Sahani |
last post by:
I wrote the following code to concatenate every 2 keys of a dictionary and
their corresponding values.
e.g if i have tiDict1 = tiDict1 = {'a':,'b':} i should get
tiDict2={'ab':} and similarly for...
|
by: titan.nyquist |
last post by:
Is there a typical way to create a dictionary (or hash table) with two
values, instead of one?
Currently, my data structure is TWO dictionaries, each with matching
and fully sychronized keys. ...
|
by: csharpula csharp |
last post by:
Hello,
I was wondering if there is a way in c# to append two Dictionaries of
the same type:
Dictionary<string,objectdic1 and Dictionary<string,objectdic2 into
one new Dictionary<string,object?...
|
by: mmm |
last post by:
I found code to undo a dictionary association.
def undict(dd, name_space=globals()):
for key, value in dd.items():
exec "%s = %s" % (key, repr(value)) in name_space
So if i run
I get
|
by: =?Utf-8?B?THVpZ2k=?= |
last post by:
Hi all,
having a dictionary of <int, string(C# 2.0) is there a way to retrieve the
key for a specific value (of type string)?
Obviously I populate the Dictionary with not duplicated strings.
...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
|
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,...
|
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...
|
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...
| |