本文整理汇总了C#中IEdge.TryGetValue方法的典型用法代码示例。如果您正苦于以下问题:C# IEdge.TryGetValue方法的具体用法?C# IEdge.TryGetValue怎么用?C# IEdge.TryGetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IEdge
的用法示例。
在下文中一共展示了IEdge.TryGetValue方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AssertValid
GetLabelFontSize
(
IEdge oEdge
)
{
Debug.Assert(oEdge != null);
AssertValid();
// Start with the default font size.
Double dLabelFontSize = m_oFormattedTextManager.FontSize;
Object oPerEdgeLabelFontSizeAsObject;
// Check for a per-edge label font size. Note that the font size is
// stored as a Single in the edge's metadata to reduce memory usage.
if ( oEdge.TryGetValue(ReservedMetadataKeys.PerEdgeLabelFontSize,
typeof(Single), out oPerEdgeLabelFontSizeAsObject) )
{
dLabelFontSize = (Double)(Single)oPerEdgeLabelFontSizeAsObject;
if (dLabelFontSize <= 0)
{
throw new FormatException( String.Format(
"{0}: The edge with the ID {1} has an out-of-range {2}"
+ " value. Values must be greater than zero."
,
this.ClassName,
oEdge.ID,
"ReservedMetadataKeys.PerEdgeLabelFontSize"
) );
}
}
return (dLabelFontSize);
}
示例2: AssertValid
SetCollapsedDConnectorMotifEdgeWidth
(
IEdge oEdge,
Double dWidth
)
{
Debug.Assert(oEdge != null);
AssertValid();
// If the edge already has a width, save it. This will be restored by
// RestoreExternalEdge().
Object oPerEdgeWidthAsObject;
if ( oEdge.TryGetValue(ReservedMetadataKeys.PerEdgeWidth,
typeof(Single), out oPerEdgeWidthAsObject) )
{
oEdge.SetValue(ReservedMetadataKeys.PreCollapsePerEdgeWidth,
oPerEdgeWidthAsObject);
}
// Set the new width.
oEdge.SetValue(ReservedMetadataKeys.PerEdgeWidth, (Single)dWidth);
}
示例3: typeof
RestoreExternalEdge
(
IEdge expandedExternalEdge
)
{
Debug.Assert(expandedExternalEdge != null);
// If this class saved the edge's width before it was collapsed,
// restore it.
Object oPreCollapsePerEdgeWidthAsObject;
if ( expandedExternalEdge.TryGetValue(
ReservedMetadataKeys.PreCollapsePerEdgeWidth, typeof(Single),
out oPreCollapsePerEdgeWidthAsObject) )
{
expandedExternalEdge.SetValue(ReservedMetadataKeys.PerEdgeWidth,
oPreCollapsePerEdgeWidthAsObject);
}
// If this class saved the edge's color before it was collapsed,
// restore it.
Object oPreCollapsePerEdgeColorAsObject;
if ( expandedExternalEdge.TryGetValue(
ReservedMetadataKeys.PreCollapsePerEdgeColor,
typeof(System.Drawing.Color),
out oPreCollapsePerEdgeColorAsObject) )
{
expandedExternalEdge.SetValue(ReservedMetadataKeys.PerColor,
oPreCollapsePerEdgeColorAsObject);
}
}
示例4: return
TryGetEdgeVisibility
(
IEdge oEdge,
String sKey,
out VisibilityKeyValue eVisibility
)
{
Debug.Assert(oEdge != null);
Debug.Assert( !String.IsNullOrEmpty(sKey) );
eVisibility = VisibilityKeyValue.Visible;
Object oVisibilityAsObject;
if ( oEdge.TryGetValue(sKey, typeof(VisibilityKeyValue),
out oVisibilityAsObject) )
{
eVisibility = (VisibilityKeyValue)oVisibilityAsObject;
return (true);
}
return (false);
}
示例5: typeof
TryGetEdgeDrawingHistory
(
IEdge oEdge,
out EdgeDrawingHistory oEdgeDrawingHistory
)
{
Debug.Assert(oEdge != null);
oEdgeDrawingHistory = null;
Object oEdgeDrawingHistoryAsObject;
if ( !oEdge.TryGetValue(ReservedMetadataKeys.EdgeDrawingHistory,
typeof(EdgeDrawingHistory), out oEdgeDrawingHistoryAsObject) )
{
return (false);
}
oEdgeDrawingHistory = (EdgeDrawingHistory)oEdgeDrawingHistoryAsObject;
return (true);
}
示例6: typeof
TryGetIntermediateCurvePoints
(
IEdge edge,
out System.Drawing.PointF [] intermediateCurvePoints
)
{
Debug.Assert(edge != null);
Object oIntermediateCurvePointsAsObject;
if ( edge.TryGetValue(
ReservedMetadataKeys.PerEdgeIntermediateCurvePoints,
typeof( System.Drawing.PointF[] ),
out oIntermediateCurvePointsAsObject) )
{
intermediateCurvePoints = ( System.Drawing.PointF[] )
oIntermediateCurvePointsAsObject;
return (true);
}
intermediateCurvePoints = null;
return (false);
}