Exemplo n.º 1
0
        private void selectionAdapter_SelectedItemHit(object sender, DiagramHitEventArgs e)
        {
            m_itemHitRecord = e.HitRecord;
            // hit on diagram label part?
            DiagramLabel hitLabel = e.HitRecord.Part.As <DiagramLabel>();

            if (hitLabel != null)
            {
                INamingContext namingContext = AdaptedControl.ContextAs <INamingContext>();
                if (namingContext != null)
                {
                    // if label editing is enabled, mouse is over label, and item can be named, open it for edit
                    if (namingContext.CanSetName(e.HitRecord.Item))
                    {
                        m_hitLabel = hitLabel;
                        m_labelEditTimer.Interval = SystemInformation.DoubleClickTime;
                        m_labelEditTimer.Enabled  = true;
                    }
                }
            }
        }
Exemplo n.º 2
0
        private void selectionAdapter_SelectedItemHit(object sender, DiagramHitEventArgs e)
        {

            m_itemHitRecord = e.HitRecord;
            // hit on diagram label part?
            DiagramLabel hitLabel = e.HitRecord.Part.As<DiagramLabel>();
            if (hitLabel != null)
            {
                INamingContext namingContext = AdaptedControl.ContextAs<INamingContext>();
                if (namingContext != null)
                {
                    // if label editing is enabled, mouse is over label, and item can be named, open it for edit
                    if (namingContext.CanSetName(e.HitRecord.Item))
                    {
                        m_hitLabel = hitLabel;
                        m_labelEditTimer.Interval = SystemInformation.DoubleClickTime;
                        m_labelEditTimer.Enabled = true;
                    }
                }
            }
        }