本文整理汇总了C#中IVertex.SetValue方法的典型用法代码示例。如果您正苦于以下问题:C# IVertex.SetValue方法的具体用法?C# IVertex.SetValue怎么用?C# IVertex.SetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IVertex
的用法示例。
在下文中一共展示了IVertex.SetValue方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetIndex
//*************************************************************************
// Method: SetIndex()
//
/// <summary>
/// Sets the Index value for a vertex.
/// </summary>
///
/// <param name="oVertex">
/// The vertex to set the Index value for.
/// </param>
///
/// <param name="iIndex">
/// The Index value.
/// </param>
//*************************************************************************
protected void SetIndex(
IVertex oVertex,
Int32 iIndex
)
{
Debug.Assert(oVertex != null);
oVertex.SetValue(
ReservedMetadataKeys.ConnectedComponentCalculatorIndex,
iIndex);
}
示例2: SetLowLink
//*************************************************************************
// Method: SetLowLink()
//
/// <summary>
/// Sets the LowLink value for a vertex.
/// </summary>
///
/// <param name="oVertex">
/// The vertex to set the LowLink value for.
/// </param>
///
/// <param name="iLowLink">
/// The LowLink value.
/// </param>
//*************************************************************************
protected void SetLowLink(
IVertex oVertex,
Int32 iLowLink
)
{
Debug.Assert(oVertex != null);
oVertex.SetValue(
ReservedMetadataKeys.ConnectedComponentCalculatorLowLink,
iLowLink);
}
示例3: AssertValid
ReadLayoutAndZOrder
(
ExcelTableReader.ExcelTableRow oRow,
IVertex oVertex
)
{
Debug.Assert(oRow != null);
Debug.Assert(oVertex != null);
AssertValid();
String sOrder;
if ( !oRow.TryGetNonEmptyStringFromCell(
VertexTableColumnNames.LayoutOrder, out sOrder) )
{
return (false);
}
Single fOrder;
if ( !Single.TryParse(sOrder, out fOrder) )
{
Range oInvalidCell = oRow.GetRangeForCell(
VertexTableColumnNames.LayoutOrder);
OnWorkbookFormatError( String.Format(
"The cell {0} contains an invalid layout order. The layout"
+ " order, which is optional, must be a number."
,
ExcelUtil.GetRangeAddress(oInvalidCell)
),
oInvalidCell
);
}
oVertex.SetValue( ReservedMetadataKeys.SortableLayoutAndZOrder,
fOrder);
return (true);
}
示例4: SetGroupVertexVisualAttributes
//*************************************************************************
// Method: SetGroupVertexVisualAttributes()
//
/// <summary>
/// Sets the visual attributes on the vertex that represents a collapsed
/// group.
/// </summary>
///
/// <param name="oGroupVertex">
/// The vertex that represents a collapsed group.
/// </param>
///
/// <param name="oVerticesToCollapse">
/// The vertices represented by <paramref name="oGroupVertex" />. It's
/// assumed that the collection is not empty.
/// </param>
///
/// <remarks>
/// This method gets called when a group of vertices is collapsed and
/// replaced with a group vertex.
/// </remarks>
//*************************************************************************
protected void SetGroupVertexVisualAttributes(
IVertex oGroupVertex,
ICollection<IVertex> oVerticesToCollapse
)
{
Debug.Assert(oGroupVertex != null);
Debug.Assert(oVerticesToCollapse != null);
Debug.Assert(oVerticesToCollapse.Count > 0);
AssertValid();
// Use the color, shape and location of the first vertex in the group.
IVertex oFirstVertexToCollapse = oVerticesToCollapse.First();
Object oColor;
if ( oFirstVertexToCollapse.TryGetValue(
ReservedMetadataKeys.PerColor, typeof(System.Drawing.Color),
out oColor) )
{
oGroupVertex.SetValue(ReservedMetadataKeys.PerColor,
(System.Drawing.Color)oColor);
}
Object oShape;
if ( oFirstVertexToCollapse.TryGetValue(
ReservedMetadataKeys.PerVertexShape, typeof(VertexShape),
out oShape) )
{
oGroupVertex.SetValue(ReservedMetadataKeys.PerVertexShape,
(VertexShape)oShape);
}
oGroupVertex.Location = oFirstVertexToCollapse.Location;
// Use a size determined by the number of collapsed vertices.
Single fRadius = (Single)Math.Min(
8F + oVerticesToCollapse.Count * 1F,
VertexDrawer.MaximumRadius / 12.0F);
oGroupVertex.SetValue(ReservedMetadataKeys.PerVertexRadius, fRadius);
// To distinguish the group vertex from a single vertex, draw a plus
// sign on top of it.
oGroupVertex.SetValue(ReservedMetadataKeys.PerVertexDrawPlusSign,
null);
}
示例5: AssertValid
SetGroupVertexAttributes
(
GroupInfo oCollapsedGroup,
IVertex oCollapsedGroupVertex,
ICollection<IVertex> oVerticesToCollapse
)
{
Debug.Assert(oCollapsedGroup != null);
Debug.Assert(oCollapsedGroupVertex != null);
Debug.Assert(oVerticesToCollapse != null);
Debug.Assert(oVerticesToCollapse.Count > 0);
AssertValid();
// If the group has no collapsed location, arbitrarily use the location
// of the first vertex in the group.
oCollapsedGroupVertex.Location =
oCollapsedGroup.CollapsedLocation ??
oVerticesToCollapse.First().Location;
Boolean bAllVerticesSelected = true;
Boolean bAllVerticesHidden = true;
foreach (IVertex oVertex in oVerticesToCollapse)
{
if ( !VertexOrEdgeIsSelected(oVertex) )
{
bAllVerticesSelected = false;
}
if (VertexDrawer.GetVisibility(oVertex) !=
VisibilityKeyValue.Hidden)
{
bAllVerticesHidden = false;
}
}
// If all of the group's vertices are selected or hidden, select or
// hide the collapsed group vertex.
if (bAllVerticesSelected)
{
MarkVertexOrEdgeAsSelected(oCollapsedGroupVertex, true);
m_oSelectedVertices.Add(oCollapsedGroupVertex);
}
if (bAllVerticesHidden)
{
oCollapsedGroupVertex.SetValue(ReservedMetadataKeys.Visibility,
VisibilityKeyValue.Hidden);
}
// Store the group information on the collapsed group vertex. This
// gets used by VertexDrawer when the collapsed group vertex is drawn.
oCollapsedGroupVertex.SetValue(
ReservedMetadataKeys.CollapsedGroupInfo, oCollapsedGroup);
// In case a sort order has been specified for the graph's vertices,
// arbitrarily put the group vertex at the top of the sort order.
//
// This is only to avoid an exception that SortableLayoutBase throws
// when it encounters a vertex that is missing the
// SortableLayoutAndZOrder key.
oCollapsedGroupVertex.SetValue(
ReservedMetadataKeys.SortableLayoutAndZOrder, Single.MaxValue);
}
示例6: AssertValid
DrawVertex
(
IVertex oVertex,
GraphDrawingContext oGraphDrawingContext
)
{
Debug.Assert(oVertex != null);
Debug.Assert(oGraphDrawingContext != null);
AssertValid();
VertexDrawingHistory oVertexDrawingHistory;
if ( m_oVertexDrawer.TryDrawVertex(oVertex, oGraphDrawingContext,
out oVertexDrawingHistory) )
{
Debug.Assert(oVertexDrawingHistory != null);
DrawingVisual oVertexChildDrawingVisual =
oVertexDrawingHistory.DrawingVisual;
m_oAllVertexDrawingVisuals.Children.Add(oVertexChildDrawingVisual);
oVertex.SetValue(ReservedMetadataKeys.VertexDrawingHistory,
oVertexDrawingHistory);
// Save the vertex on the DrawingVisual for later retrieval.
SaveVertexOnDrawingVisual(oVertex, oVertexChildDrawingVisual);
}
}
示例7: AssertValid
HideVertex
(
IVertex oVertex
)
{
Debug.Assert(oVertex != null);
AssertValid();
oVertex.SetValue(ReservedMetadataKeys.Visibility,
VisibilityKeyValue.Hidden);
foreach (IEdge oIncidentEdge in oVertex.IncidentEdges)
{
oIncidentEdge.SetValue(ReservedMetadataKeys.Visibility,
VisibilityKeyValue.Hidden);
}
}