示例#1
0
        // Update the appearance of a given breakpoint to show the given type.
        public void UpdateBreakpoint(SourceLocation sourceLocation, BreakpointTypes newBreakpointType)
        {
            ModelItem modelItem = this.GetModelItemFromSourceLocation(sourceLocation);

            if (modelItem != null)
            {
                SetBreakpointType(modelItem, newBreakpointType);
            }
            else
            {
                BreakpointTypes oldBreakpointType;
                if (this.unmappedBreakpoints.TryGetValue(sourceLocation, out oldBreakpointType))
                {
                    if (newBreakpointType == BreakpointTypes.None)
                    {
                        this.unmappedBreakpoints.Remove(sourceLocation);
                    }
                    else
                    {
                        this.unmappedBreakpoints[sourceLocation] = newBreakpointType;
                    }
                }
                else if (newBreakpointType != BreakpointTypes.None)
                {
                    this.unmappedBreakpoints.Add(sourceLocation, newBreakpointType);
                }
            }
        }
示例#2
0
        bool IsBreakpointOfType(ModelItem modelItem, BreakpointTypes breakpointType)
        {
            bool            result = false;
            BreakpointTypes actualBreakpointType;

            TryActivateAllUnmappedBreakpoints();
            if (this.breakpoints.TryGetValue(modelItem, out actualBreakpointType))
            {
                result = (actualBreakpointType & breakpointType) > 0;
            }
            return(result);
        }
示例#3
0
        void SetBreakpointType(ModelItem modelItem, BreakpointTypes newBreakpointType)
        {
            BreakpointTypes oldBreakpointType = BreakpointTypes.None;

            if (this.breakpoints.TryGetValue(modelItem, out oldBreakpointType))
            {
                Fx.Assert(oldBreakpointType != BreakpointTypes.None, "Should not store BreakpointType.None");
                if (newBreakpointType == BreakpointTypes.None)
                {
                    this.breakpoints.Remove(modelItem);
                }
                else
                {
                    this.breakpoints[modelItem] = newBreakpointType;
                }
            }
            else if (newBreakpointType != BreakpointTypes.None)
            {
                this.breakpoints.Add(modelItem, newBreakpointType);
            }

            // Now notifying corresponding properties.
            if ((oldBreakpointType & BreakpointTypes.Bounded) !=
                (newBreakpointType & BreakpointTypes.Bounded))
            {
                this.isBreakpointBoundedProperty.NotifyPropertyChanged(modelItem);
            }

            if ((oldBreakpointType & BreakpointTypes.Enabled) !=
                (newBreakpointType & BreakpointTypes.Enabled))
            {
                this.isBreakpointEnabledProperty.NotifyPropertyChanged(modelItem);
            }

            if ((oldBreakpointType & BreakpointTypes.Conditional) !=
                (newBreakpointType & BreakpointTypes.Conditional))
            {
                this.isBreakpointConditionalProperty.NotifyPropertyChanged(modelItem);
            }
        }
 // Update the appearance of a given breakpoint to show the given type.
 public void UpdateBreakpoint(SourceLocation sourceLocation, BreakpointTypes newBreakpointType)
 {
     ModelItem modelItem = this.GetModelItemFromSourceLocation(sourceLocation);
     if (modelItem != null)
     {
         SetBreakpointType(modelItem, newBreakpointType);
     }
     else
     {
         BreakpointTypes oldBreakpointType;
         if (this.unmappedBreakpoints.TryGetValue(sourceLocation, out oldBreakpointType))
         {
             if (newBreakpointType == BreakpointTypes.None)
             {
                 this.unmappedBreakpoints.Remove(sourceLocation);
             }
             else
             {
                 this.unmappedBreakpoints[sourceLocation] = newBreakpointType;
             }
         }
         else if (newBreakpointType != BreakpointTypes.None)
         {
             this.unmappedBreakpoints.Add(sourceLocation, newBreakpointType);
         }
     }
 }
 // Inserting a new breakpoint of a given type.
 public void InsertBreakpoint(SourceLocation sourceLocation, BreakpointTypes breakpointType)
 {
     this.UpdateBreakpoint(sourceLocation, breakpointType);
 }
        void SetBreakpointType(ModelItem modelItem, BreakpointTypes newBreakpointType)
        {
            BreakpointTypes oldBreakpointType = BreakpointTypes.None;
            if (this.breakpoints.TryGetValue(modelItem, out oldBreakpointType))
            {
                Fx.Assert(oldBreakpointType != BreakpointTypes.None, "Should not store BreakpointType.None");
                if (newBreakpointType == BreakpointTypes.None)
                {
                    this.breakpoints.Remove(modelItem);
                }
                else
                {
                    this.breakpoints[modelItem] = newBreakpointType;
                }
            }
            else if (newBreakpointType != BreakpointTypes.None)
            {
                this.breakpoints.Add(modelItem, newBreakpointType);
            }

            // Now notifying corresponding properties.
            if ((oldBreakpointType & BreakpointTypes.Bounded) !=
                (newBreakpointType & BreakpointTypes.Bounded))
            {
                this.isBreakpointBoundedProperty.NotifyPropertyChanged(modelItem);
            }

            if ((oldBreakpointType & BreakpointTypes.Enabled) !=
                (newBreakpointType & BreakpointTypes.Enabled))
            {
                this.isBreakpointEnabledProperty.NotifyPropertyChanged(modelItem);
            }

            if ((oldBreakpointType & BreakpointTypes.Conditional) !=
                (newBreakpointType & BreakpointTypes.Conditional))
            {
                this.isBreakpointConditionalProperty.NotifyPropertyChanged(modelItem);
            }
        }
 bool IsBreakpointOfType(ModelItem modelItem, BreakpointTypes breakpointType)
 {
     bool result = false;
     BreakpointTypes actualBreakpointType;
     TryActivateAllUnmappedBreakpoints();
     if (this.breakpoints.TryGetValue(modelItem, out actualBreakpointType))
     {
         result = (actualBreakpointType & breakpointType) > 0;
     }
     return result;
 }
示例#8
0
 // Inserting a new breakpoint of a given type.
 public void InsertBreakpoint(SourceLocation sourceLocation, BreakpointTypes breakpointType)
 {
     this.UpdateBreakpoint(sourceLocation, breakpointType);
 }