当前位置: 首页>>代码示例>>C#>>正文


C# IEdge.TryGetValue方法代码示例

本文整理汇总了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);
    }
开发者ID:2014-sed-team3,项目名称:term-project,代码行数:38,代码来源:EdgeDrawer.cs

示例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);
    }
开发者ID:2014-sed-team3,项目名称:term-project,代码行数:25,代码来源:CollapsedGroupDrawingManager.cs

示例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);
        }
    }
开发者ID:2014-sed-team3,项目名称:term-project,代码行数:34,代码来源:CollapsedGroupDrawingManager.cs

示例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);
    }
开发者ID:2014-sed-team3,项目名称:term-project,代码行数:23,代码来源:GroupMetadataManager.cs

示例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);
    }
开发者ID:2014-sed-team3,项目名称:term-project,代码行数:20,代码来源:DrawerBase.cs

示例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);
    }
开发者ID:2014-sed-team3,项目名称:term-project,代码行数:24,代码来源:EdgeUtil.cs


注:本文中的IEdge.TryGetValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。