Click here to Skip to main content
15,891,841 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to add checkbox to the title of the groupbox in C#.Net Pin
BillWoodruff23-Sep-11 23:13
professionalBillWoodruff23-Sep-11 23:13 
QuestionSample Data Pin
Xarzu23-Sep-11 15:44
Xarzu23-Sep-11 15:44 
AnswerRe: Sample Data Pin
BillWoodruff23-Sep-11 23:34
professionalBillWoodruff23-Sep-11 23:34 
Questionhelp to deal with graph data structure Pin
Mahdi_mnj23-Sep-11 12:10
Mahdi_mnj23-Sep-11 12:10 
AnswerRe: help to deal with graph data structure Pin
SledgeHammer0123-Sep-11 13:53
SledgeHammer0123-Sep-11 13:53 
AnswerRe: help to deal with graph data structure Pin
BillWoodruff24-Sep-11 0:04
professionalBillWoodruff24-Sep-11 0:04 
AnswerRe: help to deal with graph data structure Pin
BobJanova26-Sep-11 1:33
BobJanova26-Sep-11 1:33 
GeneralRe: help to deal with graph data structure Pin
Mahdi_mnj26-Sep-11 4:32
Mahdi_mnj26-Sep-11 4:32 
Dear Sir,
I had tried your kind suggestion ,but unfortunately faild as shown below.please could you help me by making the changes on the following code segment and returned it to me “I’m very sorry to bother you………”

Error 3 foreach statement cannot operate on variables of type 'WindowsApplication4.NodeList<t>' because 'WindowsApplication4.NodeList<t>' does not contain a public definition for 'GetEnumerator'


namespace WindowsApplication4
{
///
/// Represents a graph. A graph is an arbitrary collection of GraphNode
instances.
///

/// <typeparam name="T">The type of data stored in the graph's
nodes.
public class Graph<t> : IEnumerable<t>
{
#region Private Member Variables
private NodeList<t> nodeSet; // the set of nodes in the graph
#endregion

#region Constructors
public Graph() : this(null) { }
public Graph(NodeList<t> nodeSet)
{
if (nodeSet == null)
this.nodeSet = new NodeList<t>();
else
this.nodeSet = nodeSet;
}
#endregion

#region Methods
#region Add
#region AddNode
///
/// Adds a new GraphNode instance to the Graph
///

/// <param name="node" />The GraphNode instance to add.
///

#region IEnumerable<t> Members
///
/// Returns an enumerator that allows for iterating through the
contents of the graph.
public IEnumerator<t> GetEnumerator()
{
foreach (GraphNode<t> gnode in nodeSet)
yield return gnode.Value;

}
#endregion
////////////////////////////////////////////////////////////
IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); }

public void AddNode(GraphNode<t> node)
{
// adds a node to the graph
nodeSet.Add(node);
}

///
/// Adds a new value to the graph.
///

/// <param name="value" />The value to add to the graph
public void AddNode(T value)
{
nodeSet.Add(new GraphNode<t>(value));
}
#endregion

#region Add*Edge Methods
///
/// Adds a directed edge from a GraphNode with one value (from) to a GraphNode with another value (to).
///

/// <param name="from" />The value of the GraphNode from which the directed edge eminates.
/// <param name="to" />The value of the GraphNode to which the edge leads.
public void AddDirectedEdge(T from, T to)
{
AddDirectedEdge(from, to, 0);
}


and if I Changed it to public like this
public IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); }
Error 1 The modifier 'public' is not valid for this item

GeneralRe: help to deal with graph data structure Pin
BobJanova26-Sep-11 5:54
BobJanova26-Sep-11 5:54 
GeneralRe: help to deal with graph data structure Pin
Mahdi_mnj26-Sep-11 4:50
Mahdi_mnj26-Sep-11 4:50 
QuestionVersioning the hard way Pin
lukeer23-Sep-11 4:43
lukeer23-Sep-11 4:43 
AnswerRe: Versioning the hard way Pin
André Kraak23-Sep-11 23:03
André Kraak23-Sep-11 23:03 
GeneralRe: Versioning the hard way Pin
lukeer25-Sep-11 20:40
lukeer25-Sep-11 20:40 
AnswerRe: Versioning the hard way Pin
BobJanova26-Sep-11 2:02
BobJanova26-Sep-11 2:02 
QuestionC sharp GUI help needed! Pin
memed0922-Sep-11 20:42
memed0922-Sep-11 20:42 
AnswerRe: C sharp GUI help needed! Pin
memed0922-Sep-11 20:46
memed0922-Sep-11 20:46 
AnswerRe: C sharp GUI help needed! Pin
ScottM122-Sep-11 20:57
ScottM122-Sep-11 20:57 
GeneralRe: C sharp GUI help needed! Pin
memed0922-Sep-11 21:03
memed0922-Sep-11 21:03 
AnswerRe: C sharp GUI help needed! Pin
DaveAuld22-Sep-11 21:53
professionalDaveAuld22-Sep-11 21:53 
AnswerRe: C sharp GUI help needed! Pin
BillWoodruff23-Sep-11 0:43
professionalBillWoodruff23-Sep-11 0:43 
AnswerRe: C sharp GUI help needed! Pin
Bernhard Hiller26-Sep-11 1:07
Bernhard Hiller26-Sep-11 1:07 
QuestionHow can we restrict a user from changing the download path url's fine name. Pin
Member 825992122-Sep-11 11:21
Member 825992122-Sep-11 11:21 
AnswerRe: How can we restrict a user from changing the download path url's fine name. Pin
André Kraak22-Sep-11 11:47
André Kraak22-Sep-11 11:47 
AnswerRe: How can we restrict a user from changing the download path url's fine name. Pin
ScottM122-Sep-11 21:08
ScottM122-Sep-11 21:08 
AnswerRe: How can we restrict a user from changing the download path url's fine name. Pin
Pete O'Hanlon22-Sep-11 22:26
mvePete O'Hanlon22-Sep-11 22:26 

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.