473,583 Members | 3,134 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Array and TreeView

I have a lil problem i am struggling with.
I have a folder LOGFILES that contains subfolder. Like this:
MACHINE1
--DATE1
--DATE2
--DATE3

MACHINE2
--DATE1
--DATE2
--DATE3

Within the folders DATEx there are files. log files. Is there a way i can
create a class that builds up an array or hastable like this:

Machine1 Date1 log1
Machine1 Date2 log1
Machine1 Date3 log1
Machine1 Date3 log2
Machine1 Date3 log3
Machine2 Date1 log1
Machine2 Date1 log2
Machine2 Date1 log2
Machine2 Date2 log1
Machine2 Date3 log1

The reason why i want to do this is because i want to populate a TreeView
control with these data.
The optimal solution would be to generate an object pr file and store that
as a collection in a date object. And the date object as a collection in a
MACHINE object. That way i can populate the treeView control with data from
inside the file insted of the filename.

Like this:

MACHINE1
--DATE1
----log1
--DATE2
----log1
--DATE3
----log1
----log2
----log3
MACHINE2
--DATE1
----log1

and so on

If anyone has a tip or can point me to info related to this I will
appreciate it

best regards
Trond

Nov 16 '05 #1
3 2041
Hi,

I'd build the class hierarchy (the MachineCollecti on class, the Machine
class, the DateFolderColle ction class and the DateFolder class) upfront.
Then, I'd write some facade class capable of populating the root
MachineCollecti on with the data. Finally, I'd create a control inherited
from TreeView which would have a constructor accepting the MachineCollecti on
as a parameter and would then populate the treeview from the given
hierarchy.

--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx

"Trond Hoiberg" <th******@broad park.no> wrote in message
news:41******@n ews.broadpark.n o...
I have a lil problem i am struggling with.
I have a folder LOGFILES that contains subfolder. Like this:
MACHINE1
--DATE1
--DATE2
--DATE3

MACHINE2
--DATE1
--DATE2
--DATE3

Within the folders DATEx there are files. log files. Is there a way i can
create a class that builds up an array or hastable like this:

Machine1 Date1 log1
Machine1 Date2 log1
Machine1 Date3 log1
Machine1 Date3 log2
Machine1 Date3 log3
Machine2 Date1 log1
Machine2 Date1 log2
Machine2 Date1 log2
Machine2 Date2 log1
Machine2 Date3 log1

The reason why i want to do this is because i want to populate a TreeView
control with these data.
The optimal solution would be to generate an object pr file and store that
as a collection in a date object. And the date object as a collection in a
MACHINE object. That way i can populate the treeView control with data
from inside the file insted of the filename.

Like this:

MACHINE1
--DATE1
----log1
--DATE2
----log1
--DATE3
----log1
----log2
----log3
MACHINE2
--DATE1
----log1

and so on

If anyone has a tip or can point me to info related to this I will
appreciate it

best regards
Trond


Nov 16 '05 #2
Thank you, this was a little abstract for me, but i will give it a try and
see if i can solve it. I am a newbee regarding CSharp as you might have
guessed :-)

Best regards
Trond

"Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.c om> wrote
in message news:uO******** ******@TK2MSFTN GP10.phx.gbl...
Hi,

I'd build the class hierarchy (the MachineCollecti on class, the Machine
class, the DateFolderColle ction class and the DateFolder class) upfront.
Then, I'd write some facade class capable of populating the root
MachineCollecti on with the data. Finally, I'd create a control inherited
from TreeView which would have a constructor accepting the
MachineCollecti on as a parameter and would then populate the treeview from
the given hierarchy.

--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx

"Trond Hoiberg" <th******@broad park.no> wrote in message
news:41******@n ews.broadpark.n o...
I have a lil problem i am struggling with.
I have a folder LOGFILES that contains subfolder. Like this:
MACHINE1
--DATE1
--DATE2
--DATE3

MACHINE2
--DATE1
--DATE2
--DATE3

Within the folders DATEx there are files. log files. Is there a way i can
create a class that builds up an array or hastable like this:

Machine1 Date1 log1
Machine1 Date2 log1
Machine1 Date3 log1
Machine1 Date3 log2
Machine1 Date3 log3
Machine2 Date1 log1
Machine2 Date1 log2
Machine2 Date1 log2
Machine2 Date2 log1
Machine2 Date3 log1

The reason why i want to do this is because i want to populate a TreeView
control with these data.
The optimal solution would be to generate an object pr file and store
that as a collection in a date object. And the date object as a
collection in a MACHINE object. That way i can populate the treeView
control with data from inside the file insted of the filename.

Like this:

MACHINE1
--DATE1
----log1
--DATE2
----log1
--DATE3
----log1
----log2
----log3
MACHINE2
--DATE1
----log1

and so on

If anyone has a tip or can point me to info related to this I will
appreciate it

best regards
Trond

Nov 16 '05 #3
Hi again, do you have some code that could help me understand your solution?
Best regards
Trond

"Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.c om> wrote
in message news:uO******** ******@TK2MSFTN GP10.phx.gbl...
Hi,

I'd build the class hierarchy (the MachineCollecti on class, the Machine
class, the DateFolderColle ction class and the DateFolder class) upfront.
Then, I'd write some facade class capable of populating the root
MachineCollecti on with the data. Finally, I'd create a control inherited
from TreeView which would have a constructor accepting the
MachineCollecti on as a parameter and would then populate the treeview from
the given hierarchy.

--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx

"Trond Hoiberg" <th******@broad park.no> wrote in message
news:41******@n ews.broadpark.n o...
I have a lil problem i am struggling with.
I have a folder LOGFILES that contains subfolder. Like this:
MACHINE1
--DATE1
--DATE2
--DATE3

MACHINE2
--DATE1
--DATE2
--DATE3

Within the folders DATEx there are files. log files. Is there a way i can
create a class that builds up an array or hastable like this:

Machine1 Date1 log1
Machine1 Date2 log1
Machine1 Date3 log1
Machine1 Date3 log2
Machine1 Date3 log3
Machine2 Date1 log1
Machine2 Date1 log2
Machine2 Date1 log2
Machine2 Date2 log1
Machine2 Date3 log1

The reason why i want to do this is because i want to populate a TreeView
control with these data.
The optimal solution would be to generate an object pr file and store
that as a collection in a date object. And the date object as a
collection in a MACHINE object. That way i can populate the treeView
control with data from inside the file insted of the filename.

Like this:

MACHINE1
--DATE1
----log1
--DATE2
----log1
--DATE3
----log1
----log2
----log3
MACHINE2
--DATE1
----log1

and so on

If anyone has a tip or can point me to info related to this I will
appreciate it

best regards
Trond

Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
6538
by: Jim P. | last post by:
I'm building a Task program. I've got the XMLTextReader working: opening & parsing the XML files, and propagating the TreeView with nodes & childs. But I don't know how to export out the contents of the TreeView into an Array. I then want to take the array and use XMLTextWriter to build an XML file that will be saved to the local disk. ...
6
4917
by: L.M | last post by:
Hello, I knew how to use the treeview under VB6. After migrating to .NET, well, I'm lost. I try to add a new node, either to the same level or as a child to a selected node in the treeview. However, either it only add it to the root level or it only add it on level below, doesn't matter what I select. And in some case, I just get an...
14
15070
by: Mr.D | last post by:
How do I save/load the contents of a Treeview to a file? I have found several good examples written i VB6, but not a single one for VB.NET. Please help. ---- Tim
1
2248
by: Rune Jacobsen | last post by:
Hi all again, My application has a configuration window that is currently using a tabcontrol to separate the different logical aspects of configuring it. That is all well and fine, but I am soon going to have enough pages that this will look really crowded. I decided that the most elegant solution would be to go for a treeview where you...
8
12744
by: Matt MacDonald | last post by:
Hi All, I have a form that displays hierarchical categories in a treeview. Ok so far so good. What I was to do is have users be able to select a node in the treeview as part of filling out the form. I only want to allow single selection, so using checkboxes is out of the question. It works as is, but it makes the form very cumbersome if...
3
2662
by: Sascha Deus | last post by:
Hallo NG, ich möchte gerne die Yahoo UI TreeView Komponenten mit Daten befüllen. die aus PHP per ajay.request asynchron geladen werden. Das Beispiel bei Yahoo stellt alles in html und javascript dar und nicht die Verbindung zu PHP. Es gab einen Artikel in der Internet Professional 09/2006, allerdings ist genau der Teil, wo die Arrays...
1
2895
by: Jeffrey Walton | last post by:
Hi All, I have an array of 16x16 bitmaps (60 total). I've tried adding the array to the ImageList with the Add method, but the TreeView paints as if no BMP is present. The problem is the method does not 'break out' the bitmaps. If I specify Index 0, I get an unexpected result (horizontal compressing of the file).
2
6127
by: Fred Mellender | last post by:
I am trying to use reflection to output the fields (names and values) of an arbitrary object -- an object dump to a TreeView. It works pretty well, but I am having trouble with generic lists, like List<char>. What I have working is : Type type = newObj.GetType(); //newObj is what I'm trying to dump
1
3708
by: hooliovelasko | last post by:
Hello my fellow experts, I use c# and windows forms. I have array of two or more strings. How to add them into treeview(first is root, second is child of root, third is subchild of child and so on..) Example: string names = new string {"Root", "Child", "SubChild"}; should i use some recursive method or ...? Root |---------Child ...
0
7827
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8184
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8328
jinu1996
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6581
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5701
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3845
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2334
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1434
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1158
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.