Exemplo n.º 1
0
        /// <summary>
        /// Implementation of <see cref="IShowProperty.ChildSelected"/>,
        /// raises the <see cref="IShowProperty.StateChangedEvent"/>
        /// </summary>
        /// <param name="theSelectedChild">the now selected child property</param>
        public virtual void ChildSelected(IShowProperty theSelectedChild)
        {
            StateChangedArgs sca = new StateChangedArgs(StateChangedArgs.State.SubEntrySelected);

            sca.SelectedChild = theSelectedChild;
            PropertyEntryChangedState(sca);
        }
Exemplo n.º 2
0
 private void OnPointsStateChanged(IPropertyEntry sender, StateChangedArgs args)
 {
     if (HotspotChangedEvent != null)
     {
         if (args.EventState == StateChangedArgs.State.OpenSubEntries)
         {
             for (int i = 0; i < points.SubEntriesCount; ++i)
             {
                 IHotSpot hsp = points.SubEntries[i] as IHotSpot;
                 if (hsp != null)
                 {
                     HotspotChangedEvent(hsp, HotspotChangeMode.Visible);
                 }
             }
         }
         else if (args.EventState == StateChangedArgs.State.CollapseSubEntries)
         {
             for (int i = 0; i < points.SubEntriesCount; ++i)
             {
                 IHotSpot hsp = points.SubEntries[i] as IHotSpot;
                 if (hsp != null)
                 {
                     HotspotChangedEvent(hsp, HotspotChangeMode.Invisible);
                 }
             }
         }
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// Will be called when the state of an entry in the ControlCenter changes. this implementation must be called by a class overriding this method.
 /// </summary>
 /// <param name="sender">The ShowProperty that changed its state</param>
 /// <param name="args">The new state</param>
 protected void OnShowPropertyStateChanged(IPropertyEntry sender, StateChangedArgs args)
 {
     if (sender is IGeoObjectShowProperty)
     {
         if (args.EventState == StateChangedArgs.State.Selected)
         {
             focusedSelectedObject = (sender as IGeoObjectShowProperty).GetGeoObject();
             if (FocusedObjectChangedEvent != null)
             {
                 FocusedObjectChangedEvent(this, focusedSelectedObject);
             }
         }
         else if (args.EventState == StateChangedArgs.State.UnSelected)
         {
             if (focusedSelectedObject == (sender as IGeoObjectShowProperty).GetGeoObject())
             {
                 focusedSelectedObject = null;
             }
             if (FocusedObjectChangedEvent != null)
             {
                 FocusedObjectChangedEvent(this, focusedSelectedObject);
             }
         }
         else
         {
             return;
         }
         foreach (IView vw in base.Frame.AllViews)
         {
             vw.Invalidate(PaintBuffer.DrawingAspect.Select, vw.DisplayRectangle);
         }
     }
 }
Exemplo n.º 4
0
 private void OnVertexPropertyStateChanged(IPropertyEntry sender, StateChangedArgs args)
 {
     if (args.EventState == StateChangedArgs.State.OpenSubEntries)
     {
         if (rectangleProperty != null && propertyPage != null)
         {
             propertyPage.OpenSubEntries(rectangleProperty as IPropertyEntry, false);
         }
         if (parallelProperty != null && propertyPage != null)
         {
             propertyPage.OpenSubEntries(parallelProperty as IPropertyEntry, false);
         }
     }
     if (HotspotChangedEvent != null)
     {
         if (args.EventState == StateChangedArgs.State.OpenSubEntries)
         {
             for (int i = 0; i < vertexProperty.SubEntries.Length; ++i)
             {
                 HotspotChangedEvent(vertexProperty.SubEntries[i] as IHotSpot, HotspotChangeMode.Visible);
             }
         }
         else if (args.EventState == StateChangedArgs.State.CollapseSubEntries)
         {
             for (int i = 0; i < vertexProperty.SubEntries.Length; ++i)
             {
                 HotspotChangedEvent(vertexProperty.SubEntries[i] as IHotSpot, HotspotChangeMode.Invisible);
             }
         }
     }
 }
Exemplo n.º 5
0
 private void OnParallelPropertyStateChanged(IPropertyEntry sender, StateChangedArgs args)
 {       // hier erfahren wir, ob die Rechteckeigenschaften aufgeklappt
     // oder zugeklappt werden
     if (args.EventState == StateChangedArgs.State.OpenSubEntries)
     {
         vertexProperty.ShowOpen(false);
         if (HotspotChangedEvent != null)
         {
             HotspotChangedEvent(locationParallelProperty, HotspotChangeMode.Visible);
             HotspotChangedEvent(directionXParallelHotSpot, HotspotChangeMode.Visible);
             HotspotChangedEvent(directionYParallelHotSpot, HotspotChangeMode.Visible);
             HotspotChangedEvent(sizeHotSpot, HotspotChangeMode.Visible);
         }
     }
     else if (args.EventState == StateChangedArgs.State.CollapseSubEntries)
     {
         if (HotspotChangedEvent != null)
         {
             HotspotChangedEvent(locationParallelProperty, HotspotChangeMode.Invisible);
             HotspotChangedEvent(directionXParallelHotSpot, HotspotChangeMode.Invisible);
             HotspotChangedEvent(directionYParallelHotSpot, HotspotChangeMode.Invisible);
             HotspotChangedEvent(sizeHotSpot, HotspotChangeMode.Invisible);
         }
     }
 }
Exemplo n.º 6
0
 // OnStateChanged wird gleichermaßen für alle IShowProperties angemeldet. Deshalb muss
 // hier nach dem "sender" unterschieden werden. Hiermit wird geregelt welcher Hotspot
 // als selektierter Hotspot dargestellt werden soll. Bei MultiGeoPointProperty muss
 // man hier einen etwas anderen Weg gehen (siehe z.B. ShowPropertxBSpline)
 private void OnStateChanged(IPropertyEntry sender, StateChangedArgs args)
 {
     if (HotspotChangedEvent != null)
     {
         if (args.EventState == StateChangedArgs.State.Selected || args.EventState == StateChangedArgs.State.SubEntrySelected)
         {
             if (sender == startPointProperty)
             {
                 HotspotChangedEvent(startPointProperty, HotspotChangeMode.Selected);
             }
             else if (sender == endPointProperty)
             {
                 HotspotChangedEvent(endPointProperty, HotspotChangeMode.Selected);
             }
             else if (sender == lengthProperty)
             {
                 HotspotChangedEvent(lengthHotSpot, HotspotChangeMode.Selected);
             }
             else if (sender == directionProperty)
             {
                 HotspotChangedEvent(directionHotSpot, HotspotChangeMode.Selected);
             }
         }
         else if (args.EventState == StateChangedArgs.State.UnSelected)
         {
             if (sender == startPointProperty)
             {
                 HotspotChangedEvent(startPointProperty, HotspotChangeMode.Deselected);
             }
             else if (sender == endPointProperty)
             {
                 HotspotChangedEvent(endPointProperty, HotspotChangeMode.Deselected);
             }
             else if (sender == lengthProperty)
             {
                 HotspotChangedEvent(lengthHotSpot, HotspotChangeMode.Deselected);
             }
             else if (sender == directionProperty)
             {
                 HotspotChangedEvent(directionHotSpot, HotspotChangeMode.Deselected);
             }
         }
     }
 }
Exemplo n.º 7
0
 private void OnStateChanged(IShowProperty sender, StateChangedArgs args)
 {
     if (HotspotChangedEvent != null)
     {
         if (args.EventState == StateChangedArgs.State.Selected || args.EventState == StateChangedArgs.State.SubEntrySelected)
         {
             if (sender == locationProperty)
             {
                 HotspotChangedEvent(locationProperty, HotspotChangeMode.Selected);
             }
         }
         else if (args.EventState == StateChangedArgs.State.UnSelected)
         {
             if (sender == locationProperty)
             {
                 HotspotChangedEvent(locationProperty, HotspotChangeMode.Deselected);
             }
         }
     }
 }
Exemplo n.º 8
0
 void OnVertexStateChanged(IPropertyEntry sender, StateChangedArgs args)
 {
     if (HotspotChangedEvent != null)
     {
         GeoPointProperty vertexProperty = null;
         if (sender is GeoPointProperty)
         {
             vertexProperty = (sender as GeoPointProperty);
         }
         if (vertexProperty == null)
         {
             return;
         }
         if (args.EventState == StateChangedArgs.State.Selected || args.EventState == StateChangedArgs.State.SubEntrySelected)
         {
             HotspotChangedEvent(vertexProperty, HotspotChangeMode.Selected);
         }
         else if (args.EventState == StateChangedArgs.State.UnSelected)
         {
             HotspotChangedEvent(vertexProperty, HotspotChangeMode.Deselected);
         }
     }
 }
Exemplo n.º 9
0
        private void OnStateChanged(IPropertyEntry sender, StateChangedArgs args)
        {
            if (HotspotChangedEvent == null)
            {
                return;
            }

            if (sender is DoubleProperty)
            {
                for (int i = 0; i < textPos.Length; ++i)
                {
                    if (sender == textPos[i])
                    {
                        if (args.EventState == StateChangedArgs.State.Selected)
                        {
                            HotspotChangedEvent(textPosHotSpot[i], HotspotChangeMode.Selected);
                        }
                        else if (args.EventState == StateChangedArgs.State.UnSelected)
                        {
                            HotspotChangedEvent(textPosHotSpot[i], HotspotChangeMode.Deselected);
                        }
                    }
                }
            }
            if (sender == dimLineRef)
            {
                if (args.EventState == StateChangedArgs.State.Selected || args.EventState == StateChangedArgs.State.SubEntrySelected)
                {
                    HotspotChangedEvent(dimLineRef, HotspotChangeMode.Selected);
                }
                else if (args.EventState == StateChangedArgs.State.UnSelected || args.EventState == StateChangedArgs.State.SubEntrySelected)
                {
                    HotspotChangedEvent(dimLineRef, HotspotChangeMode.Deselected);
                }
            }
        }
Exemplo n.º 10
0
 protected void PropertyEntryChangedState(StateChangedArgs args)
 {
     PropertyEntryChangedStateEvent?.Invoke(this, args);
 }
Exemplo n.º 11
0
 private void OnStateChanged(IPropertyEntry sender, StateChangedArgs args)
 {
     if (HotspotChangedEvent != null)
     {
         if (args.EventState == StateChangedArgs.State.Selected || args.EventState == StateChangedArgs.State.SubEntrySelected)
         {
             if (sender == startPointProperty)
             {
                 HotspotChangedEvent(startPointProperty, HotspotChangeMode.Selected);
             }
             else if (sender == endPointProperty)
             {
                 HotspotChangedEvent(endPointProperty, HotspotChangeMode.Selected);
             }
             if (sender == startAngleProperty)
             {
                 HotspotChangedEvent(startAngleHotSpot, HotspotChangeMode.Selected);
             }
             else if (sender == endAngleProperty)
             {
                 HotspotChangedEvent(endAngleHotSpot, HotspotChangeMode.Selected);
             }
             else if (sender == centerProperty)
             {
                 HotspotChangedEvent(centerProperty, HotspotChangeMode.Selected);
             }
             else if (sender == majorRadiusProperty)
             {
                 for (int i = 0; i < majorRadiusHotSpot.Length; i++)
                 {
                     HotspotChangedEvent(majorRadiusHotSpot[i], HotspotChangeMode.Selected);
                 }
             }
             else if (sender == minorRadiusProperty)
             {
                 for (int i = 0; i < minorRadiusHotSpot.Length; i++)
                 {
                     HotspotChangedEvent(minorRadiusHotSpot[i], HotspotChangeMode.Selected);
                 }
             }
             else if (sender == majorAxisProperty)
             {
                 for (int i = 0; i < majorAxisHotSpot.Length; i++)
                 {
                     HotspotChangedEvent(majorAxisHotSpot[i], HotspotChangeMode.Selected);
                 }
             }
             else if (sender == minorAxisProperty)
             {
                 for (int i = 0; i < minorAxisHotSpot.Length; i++)
                 {
                     HotspotChangedEvent(minorAxisHotSpot[i], HotspotChangeMode.Selected);
                 }
             }
         }
         else if (args.EventState == StateChangedArgs.State.UnSelected)
         {
             if (sender == startPointProperty)
             {
                 HotspotChangedEvent(startPointProperty, HotspotChangeMode.Deselected);
             }
             else if (sender == endPointProperty)
             {
                 HotspotChangedEvent(endPointProperty, HotspotChangeMode.Deselected);
             }
             if (sender == startAngleProperty)
             {
                 HotspotChangedEvent(startAngleHotSpot, HotspotChangeMode.Deselected);
             }
             else if (sender == endAngleProperty)
             {
                 HotspotChangedEvent(endAngleHotSpot, HotspotChangeMode.Deselected);
             }
             else if (sender == centerProperty)
             {
                 HotspotChangedEvent(centerProperty, HotspotChangeMode.Deselected);
             }
             else if (sender == majorRadiusProperty)
             {
                 for (int i = 0; i < majorRadiusHotSpot.Length; i++)
                 {
                     HotspotChangedEvent(majorRadiusHotSpot[i], HotspotChangeMode.Deselected);
                 }
             }
             else if (sender == minorRadiusProperty)
             {
                 for (int i = 0; i < minorRadiusHotSpot.Length; i++)
                 {
                     HotspotChangedEvent(minorRadiusHotSpot[i], HotspotChangeMode.Deselected);
                 }
             }
             else if (sender == majorAxisProperty)
             {
                 for (int i = 0; i < majorAxisHotSpot.Length; i++)
                 {
                     HotspotChangedEvent(majorAxisHotSpot[i], HotspotChangeMode.Deselected);
                 }
             }
             else if (sender == minorAxisProperty)
             {
                 for (int i = 0; i < minorAxisHotSpot.Length; i++)
                 {
                     HotspotChangedEvent(minorAxisHotSpot[i], HotspotChangeMode.Deselected);
                 }
             }
         }
     }
 }