Click here to Skip to main content
15,890,186 members
Home / Discussions / C#
   

C#

 
GeneralRe: Threads and TextBox Pin
Luc Pattyn17-May-10 11:08
sitebuilderLuc Pattyn17-May-10 11:08 
GeneralRe: Threads and TextBox Pin
CaesarCZ18-May-10 2:28
CaesarCZ18-May-10 2:28 
Questionimage access using dll Pin
AnirbanChak 17-May-10 9:52
AnirbanChak 17-May-10 9:52 
AnswerRe: image access using dll Pin
Dr.Walt Fair, PE17-May-10 10:20
professionalDr.Walt Fair, PE17-May-10 10:20 
AnswerRe: image access using dll Pin
Alan Balkany18-May-10 4:18
Alan Balkany18-May-10 4:18 
QuestionJava to C# Pin
Zoomlion17-May-10 6:46
Zoomlion17-May-10 6:46 
GeneralRe: Java to C# Pin
harold aptroot17-May-10 7:04
harold aptroot17-May-10 7:04 
AnswerRe: Java to C# Pin
The Man from U.N.C.L.E.17-May-10 7:28
The Man from U.N.C.L.E.17-May-10 7:28 
Not to good at Java, but my understanding is that Put and Get operate on an automaticaly generated parent hashtable of the object in question. c# does not have this at all. You have to create your own dictionary.


This might not be quite right as you did not post the entier code, but the following should help you. Note the dictionary declaration and add/get code. I have used a generic dictionary to enable strong typing.

class TagInfo{
	public int tagOffset;
	public int tagLength;

	public TagInfo(){
	}
}

//	Dictionary to hold Taginfo Objects
System.Collections.Generic.Dictionary<int, TagInfo>; TagInfoDictionary = new System.Collections.Generic.Dictionary<int, TagInfo>();

private void buildMetaData()
{
	
	Record record = getData();
	int offset = IMGREC_TAGLIST_INDEX;
	int numTags = 0 ;
	short tagID = 0;

	try
	{
		numTags = this.getNumberOfTags() ;

		for (int i=0; i < numTags; i++){
			TagInfo info = new TagInfo();

			info.tagOffset = offset;
			info.tagLength = TagRecord.TAG_DATA_INDEX + record.readInt(offset + TagRecord.TAG_DATALEN_INDEX);
			tagID = record.readShort(offset + TagRecord.TAG_ID_INDEX);
			offset += info.tagLength;

			//	Add to the dictionary
			this.TagInfoDictionary.Add(tagID, info);

			Console.WriteLine("tagID = " + tagID);
		}
	}catch (Exception ex){}
	finally{}

	this.imageOffset = offset;
	this.imageSize = record.getLength() - offset;
}

public TagRecord getTagByID(short id)
{
	TagRecord record = null;
	
	//	Get from dictionary
	TagInfo info = this.TagInfoDictionary[id];
	if (info != null){
		byte[] data = this.getData().read(info.tagOffset,info.tagLength);
		record = new TagRecord(data);
	}

	return record;
}

If you have knowledge, let others light their candles at it.
Margaret Fuller (1810 - 1850)
[My Articles]  [My Website]

Questionequivalent Pin
genieabdo17-May-10 4:52
genieabdo17-May-10 4:52 
AnswerRe: equivalent Pin
Abhinav S17-May-10 5:01
Abhinav S17-May-10 5:01 
AnswerRe: equivalent Pin
Luc Pattyn17-May-10 5:37
sitebuilderLuc Pattyn17-May-10 5:37 
GeneralRe: equivalent Pin
genieabdo17-May-10 5:57
genieabdo17-May-10 5:57 
GeneralRe: equivalent Pin
Luc Pattyn17-May-10 6:05
sitebuilderLuc Pattyn17-May-10 6:05 
AnswerRe: equivalent Pin
PIEBALDconsult17-May-10 6:05
mvePIEBALDconsult17-May-10 6:05 
GeneralRe: equivalent Pin
genieabdo17-May-10 6:11
genieabdo17-May-10 6:11 
GeneralRe: equivalent Pin
Luc Pattyn17-May-10 6:12
sitebuilderLuc Pattyn17-May-10 6:12 
GeneralRe: equivalent Pin
genieabdo17-May-10 6:23
genieabdo17-May-10 6:23 
GeneralRe: equivalent Pin
PIEBALDconsult17-May-10 6:24
mvePIEBALDconsult17-May-10 6:24 
GeneralRe: equivalent Pin
Luc Pattyn17-May-10 6:27
sitebuilderLuc Pattyn17-May-10 6:27 
QuestionProduction release: Do you issue a "Release" build or do you simply not roll out the debug's pdb file? Pin
Alaric_17-May-10 3:49
professionalAlaric_17-May-10 3:49 
AnswerRe: Production release: Do I issue a "Release" build or do I simply not copy over the debug's pdb file? Pin
PIEBALDconsult17-May-10 4:04
mvePIEBALDconsult17-May-10 4:04 
GeneralRe: Production release: Do I issue a "Release" build or do I simply not copy over the debug's pdb file? Pin
J4amieC17-May-10 4:53
J4amieC17-May-10 4:53 
GeneralRe: Production release: Do I issue a "Release" build or do I simply not copy over the debug's pdb file? Pin
PIEBALDconsult17-May-10 5:28
mvePIEBALDconsult17-May-10 5:28 
GeneralRe: Production release: Do I issue a "Release" build or do I simply not copy over the debug's pdb file? Pin
The Man from U.N.C.L.E.17-May-10 5:38
The Man from U.N.C.L.E.17-May-10 5:38 
GeneralRe: Production release: Do I issue a "Release" build or do I simply not copy over the debug's pdb file? Pin
PIEBALDconsult17-May-10 5:42
mvePIEBALDconsult17-May-10 5:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.