|
Kevin Marois wrote: I need to provide Move Up and Move Down functions. I think Bob Janova's suggestion that you include in your Node-whatever base class a 'Parent field is the correct solution, and it will have so much additional functionality, in the long run, it's the "only" solution.
What you leave unspecified in your question are the interesting cases such as:
You wish to move up a child Node of a Parent Node:
a. assuming the Parent Node has other siblings prior to the the Node to be "promoted:" the "promoted node" then remains a sibling of the Parent node, but now precedes the prior sibling in the collection ?
b. assuming the node to be "promoted" is the first child of its Parent Node: the "promoted node" then becomes a sibling of its former Parent node, preceding its former Parent node in the collection ?
I think you can also easily see that you will need to think through other "edge cases" involving moving a Node "down" in the collection/tree.
Also consider that some tree data structures (in computer science algorithmic theory) are based on having a single root node from which all other Nodes descend, and other trees, as you see in the typical TreeView Control in .NET, are based on having an arbitrary collection in which any number of Nodes can be root-level.
Since you use the word "collection" here, I would assume you are allowing multiple root-nodes. In that case the top root-node cannot be moved up, and the last root-node cannot be moved down.
imho it's a useful convention to make the design choice that if the 'Parent field of a Node, in a collection-based tree, contains 'null, then the given Node is a "root-level" node.
Now if you are constructing your own "hierarchic visual display" of this collection/tree structure ... not using some existing TreeView control ... then ... welcome to recursion.
best, Bill
"Humans are amphibians ... half spirit and half animal ... as spirits they belong to the eternal world, but as animals they inhabit time. This means that while their spirit can be directed to an eternal object, their bodies, passions, and imaginations are in continual change, for to be in time, means to change. Their nearest approach to constancy, therefore, is undulation: the repeated return to a level from which they repeatedly fall back, a series of troughs and peaks.” C.S. Lewis
|
|
|
|
|
Hi All,
What it is i would like to do is add a new item into an existing sharepoint list. The fields in this item will be filled out using variables existing in my program.
I've had a look around the internet and its not making much sense so i was hoping one of you guys could shed some light on me?
Many thanks in advance! 
|
|
|
|
|
This really should have been posted in the SharePoint forum. But since the damage is already done...
First, what version of SharePoint, WSS 3, MOSS 2007, 2010 Foundation?
Second, how are you accessing SharePoint? WebServices, server application, service, Client Object Model?
If you give more details about what you are doing you will get a better answer.
Failure is not an option; it's the default selection.
|
|
|
|
|
Hello,
I have one web based application using vb.net codebehing. Now i have to convert this into C#.net. Can anyone help me how to convert whole vb.net web application into C#.net web application. My application has 110 pages so its not possible to convert one by one page. Is it possible to convert whole application ?
Thanks & Regards
Do hard work, you will get your result sure !
|
|
|
|
|
You can use one of the conversion tools[^] to get the code converted, followed by a few sessions of build and test.
Binding 100,000 items to a list box can be just silly regardless of what pattern you are following. Jeremy Likness
|
|
|
|
|
|
I have a collection of NodeObject classes in a hierarchical list. The list can be any number of levels deep.
public class NodeModel : ViewModelBase
{
public Guid Id { get; set; }
public string Caption { get; set; }
public string Description { get; set; }
public NodeType Type { get; set; }
public List<NodeModel> Children { get; set; }
}
How can I remove an item from the list using its Guid Id regardless of where it is in the list?
If it's not broken, fix it until it is
|
|
|
|
|
Just write a recursive delete method.
something like (psuedo code):
public bool DeleteNode(Guid id)
{
return DeleteNode(id, this);
}
private bool DeleteNode(Guid id, NodeModel model)
{
if (id == model.Id) delete model object here; return true;
foreach (NodeModel in Children)
{
if (DeleteNode(id, model))
return true;
}
return false;
}
|
|
|
|
|
If you delete an internal node, what do you do with its children? Your code would leave them orphaned...
Depending on what the original structure is meant to represent, it need rebuilding in some way after a deletion (or maybe deletion should be disallowed for some nodes...)
We need more information from the OP to define then solve his problem.
Cheers,
Peter
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
|
I was thinking more in terms of structures like B-trees (used in database indexing, etc), where deleting a node involves reconnecting any fragments (and in the case of a B-tree) possibly rebalancing the tree.
The point remains that we need to understand the semantics of the structure in order to know what a delete should do.
Cheers,
Peter
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
Any source code out there already for a GE Versimax E05 PLc so that I can exchange data using C#? Already looked at the drivers created already but little pricey for me.
|
|
|
|
|
For something so specific and vertical?? Probably not.
Google is your friend. I'd start with "Versimax E05 PLC C#" and start hunting.
|
|
|
|
|
Hi
This is Chandra and Good evening. My query is, i have one web page. In that web page i have GridView Control. At presnt i can able to export the data to Excel from Gridview control.I have also Charts control in the same Web Page which is displying sales information.
Here My Question is.. Is it possible to export the Chart control as well as Gridview data to Excel format.
Thanks
Chandrakanth
Chandrakanth
|
|
|
|
|
|
Hi Sandeep,
Thanks for your information. Meanwhile in my case i can not hard code the chat names because i have different types of grids like CategoryInfo,SubcategoryInfo Info,ProductInfo, SalesInfo etc. These are all grids contains lot of records and Each Grid has 3 types of charts. In this case how can i approach.
Thanks
Chandrakanth.
|
|
|
|
|
I provided a direction to start. I have not done it myself or played with it. You have to look around for tweaks you want. Try out, it might not be as hard as you think.
|
|
|
|
|
I am doing a university website for my third year project using asp.net the website is only for university staff and registed students so when logging in password and user name need to be validated using the schools active directry this is my 1st website and i dont have any idea of active directry plz help
|
|
|
|
|
|
|
I can't code ila algorithm and quinlan algorithm
please help me source code this algorithm
thanks so much
|
|
|
|
|
This is not a rent-a-coder site. Put some effort in. Turning an algorithm into executable code is a pretty elementary skill for programmers, perhaps you should pay more attention to your course.
|
|
|
|
|
Try this:
NonPublic Unstatic InVoid ILA(Quinlan q)
{
if(q was Quinlan)
{
WhereIsItNow(ILA(UnQuinlan exQ);
}
}
"I do not have to forgive my enemies, I have had them all shot." — Ramón Maria Narváez (1800-68).
|
|
|
|
|
Perhaps the Algorithm forum would be more suited?
|
|
|
|
|
It does not work like this here.
Here is what is expected of enquirers:
1. TRY first what you want to do! You may find that it's not that hard.
2. Formulate what was done by you that looks like an issue/not working.
Try them and tell if you face issues.
|
|
|
|