Exemple #1
0
        // === AbstractConnectableNode ==========
        protected virtual Point GetExpectedConnectLocationForConnectedAnchor(
            IAnchor anchor, Rectangle oldBounds, Rectangle newBounds
            )
        {
            var locDelta = newBounds.Location - (Size)oldBounds.Location;

            var newAnchorX = anchor.Location.X + locDelta.X;

            newAnchorX = Math.Min(newAnchorX, newBounds.Right - 1);

            var newAnchorY = anchor.Location.Y + locDelta.Y;

            newAnchorY = Math.Min(newAnchorY, newBounds.Bottom - 1);

            var dir = RectUtil.GetNearestLineDirection(oldBounds, anchor.Location);

            if (EnumUtil.HasAllFlags((int)dir, (int)Directions.Left))
            {
                return(new Point(newBounds.Left, newAnchorY));
            }
            if (EnumUtil.HasAllFlags((int)dir, (int)Directions.Right))
            {
                return(new Point(newBounds.Right - 1, newAnchorY));
            }
            if (EnumUtil.HasAllFlags((int)dir, (int)Directions.Up))
            {
                return(new Point(newAnchorX, newBounds.Top));
            }
            if (EnumUtil.HasAllFlags((int)dir, (int)Directions.Down))
            {
                return(new Point(newAnchorX, newBounds.Bottom - 1));
            }

            throw new ArgumentException();
        }
Exemple #2
0
        private void PopulateBalloonOptions(IList <BalloonOption> options, IEnumerable <BulbActionKey> bulbActions)
        {
            IAnchor groupingAnchor = null;

            foreach (var bulbAction in bulbActions)
            {
                if (groupingAnchor == null)
                {
                    groupingAnchor = bulbAction.GroupingAnchor;
                }

                if (bulbAction.RichText == null)
                {
                    continue;
                }

                var enabled = bulbAction.Executable != null;

                var requiresSeparator = !Equals(bulbAction.GroupingAnchor, groupingAnchor);
                groupingAnchor = bulbAction.GroupingAnchor;
                options.Add(new BalloonOption(bulbAction.RichText.Text, requiresSeparator, enabled, bulbAction));

                PopulateBalloonOptions(options, bulbAction.Subitems);
            }
        }
Exemple #3
0
        public static float GetDistanceBetweenAnchors(IAnchor anc1, IAnchor anc2)
        {
            var origin1 = GetAnchorOrigin(anc1);
            var origin2 = GetAnchorOrigin(anc2);

            return(Vector3.Distance(origin1, origin2));
        }
        /// <summary>
        /// Gets the actions for changing the highlight options for StyleCop rules.
        /// </summary>
        /// <param name="highlighting">
        /// The current highlighting.
        /// </param>
        /// <param name="highlightingRange">
        /// The current highlighting range.
        /// </param>
        /// <param name="sourceFile">
        /// The file.
        /// </param>
        /// <param name="configureAnchor">The anchor for configuration items</param>
        /// <returns>
        /// The available actions.
        /// </returns>
        public IEnumerable <IntentionAction> GetActions(IHighlighting highlighting, DocumentRange highlightingRange, IPsiSourceFile sourceFile,
                                                        IAnchor configureAnchor)
        {
            StyleCopHighlightingBase violation = highlighting as StyleCopHighlightingBase;

            if (violation == null)
            {
                yield break;
            }

            string ruleId      = violation.CheckId;
            string highlightId = HighlightingRegistering.GetHighlightID(ruleId);

            ChangeStyleCopRuleAction changeStyleCopRuleAction = new ChangeStyleCopRuleAction(
                this.highlightingSettingsManager,
                this.settingsStore,
                highlightId,
                this.commonIconsComponent)
            {
                Text = "Inspection Options for \"" + violation.ToolTip + "\""
            };

            yield return
                (new IntentionAction(changeStyleCopRuleAction, changeStyleCopRuleAction.Text, BulbThemedIcons.ContextAction.Id, IntentionsAnchors.ContextActionsAnchor));
        }
Exemple #5
0
        protected virtual IReferenceAnchors FindNearestAnchors(SnapshotPoint point)
        {
            ITextSnapshot   snapshot = point.Snapshot;
            IList <IAnchor> anchors  = GetDynamicAnchorPoints(snapshot);

            // the innermost anchor enclosing the caret
            IAnchor enclosing = null;
            // the last anchor starting before the caret
            IAnchor previous = null;

            if (anchors != null)
            {
                IAnchor next = null;

                // parse the current rule
                foreach (IAnchor anchor in anchors)
                {
                    if (anchor.TrackingSpan.GetStartPoint(snapshot) <= point)
                    {
                        previous = anchor;
                        if (anchor.TrackingSpan.GetEndPoint(snapshot) > point)
                        {
                            enclosing = anchor;
                        }
                    }
                    else
                    {
                        next = anchor;
                        break;
                    }
                }
            }

            return(new ReferenceAnchors(previous, enclosing));
        }
		static Position? PositionFrom(IAnchor anchor)
		{
			var positionAnchor = anchor as PositionAnchor;
			if (positionAnchor == null)
				return null;
			return positionAnchor.Position;
		}
Exemple #7
0
 /// <summary>
 /// 切断のときはnewConnectableEditorにnullを渡す.
 /// </summary>
 public ConnectCommand(IEditor target, IAnchor connectingAnchor, IEditor newConnectableEditor, Point newLocation)
 {
     _target = target;
     _newConnectableEditor = newConnectableEditor;
     _connectingAnchor     = connectingAnchor;
     _newLocation          = newLocation;
 }
Exemple #8
0
 public void SetAnchor(int anchorId, IAnchor value)
 {
     if (_anchors.ContainsKey(anchorId))
     {
         _anchors[anchorId] = value;
     }
 }
    void AppStarted(IAnchor anchor)
    {
        originDetected = true;
        transform.SetPositionAndRotation(anchor.pose.position, anchor.pose.rotation);
        testGO = Instantiate(testPrefab, anchor.pose.position, anchor.pose.rotation, transform);

        mainButton.SetActive(true);
        scanButton.SetActive(true);
    }
Exemple #10
0
        static Position?PositionFrom(IAnchor anchor)
        {
            var positionAnchor = anchor as PositionAnchor;

            if (positionAnchor == null)
            {
                return(null);
            }
            return(positionAnchor.Position);
        }
Exemple #11
0
        static Vector3 GetAnchorOrigin(IAnchor anchor)
        {
            switch (anchor.type)
            {
            case AnchorType.Point:
                return(((PointAnchor)anchor).position);
            }

            return(Vector3.zero);
        }
Exemple #12
0
 internal void RemoveInterruptionFor(IAnchor loop, bool isBreak)
 {
     foreach (var entry in this.interruptions.ToArray())
     {
         if (entry.Key.AssociatedLoop == loop && entry.Key.IsBreak == isBreak)
         {
             this.interruptions.Remove(entry.Key);
         }
     }
 }
 public void enterTarotWorld(IAnchor anchor)
 {
     switch (anchor.imgName)
     {
     case "theStoryteller":
         var tarotGO = Instantiate(Resources.Load(anchor.imgName), anchor.pose.position, anchor.pose.rotation);
         break;
         //write other cases and test
     }
 }
Exemple #14
0
        void SetCursorUI(IAnchor selectedAnchor, ref GameObject cursor)
        {
            switch (selectedAnchor.type)
            {
            case AnchorType.Point:
            default:
                cursor.transform.position = ((PointAnchor)selectedAnchor).position;
                cursor.transform.forward  = UIStateManager.current.m_RootNode.transform.localRotation * ((PointAnchor)selectedAnchor).normal;

                break;
            }
        }
 /// <summary>
 /// Creates a new map message.
 /// </summary>
 /// <param name="text">The message.</param>
 /// <param name="boundary">The boundary object.</param>
 /// <param name="translation">The map translation.</param>
 public MapInfoAnnotation(string text, IAnchor boundary, ITranslation translation)
     : base(text, null, translation)
 {
     // Validate the parameters.
     if (null == boundary) throw new ArgumentNullException("boundary");
     if (null == translation) throw new ArgumentNullException("translation");
     // Set the annotation defaults.
     this.BackgroundColor = Color.White;
     this.Visible = false;
     // Set the boundary anchor.
     this.boundary = boundary;
 }
Exemple #16
0
        public static ICommand RequestConnect(
            this IEditor editor,
            IAnchor connectingAnchor, IEditor newConnectableEditor, Point location
            )
        {
            var req = new ConnectRequest();

            req.ConnectingAnchor     = connectingAnchor;
            req.NewConnectableEditor = newConnectableEditor;
            req.NewLocation          = location;
            return(editor.PerformRequest(req));
        }
    void ImageAnchorUpdated(IAnchor anchor)
    {
        UAR.Logger.log(UAR.Logger.Type.Info, "Image Category Updated: {0}", anchor.imgName);

        if (anchor.imgName == "StartImg")
        {
            transform.SetPositionAndRotation(anchor.pose.position, anchor.pose.rotation);
        }
        else if (!inWorld)
        {
            enterCategoryWorld(anchor.imgName);
        }
    }
        // ========================================
        // constructor
        // ========================================
        public EdgeCommentAnchorHandle(IAnchor anchor)
        {
            _anchor = anchor;

            _connectRequest = new ConnectRequest();
            _connectRequest.ConnectingAnchor = anchor;

            _tmpConnectRequest = new ConnectRequest();
            _tmpConnectRequest.ConnectingAnchor = anchor;

            _figure     = new SimpleRect();
            _figureSize = new Size(8, 8);
        }
Exemple #19
0
        private BulbMenuItem[] CreateRunTargetMenu(string propertyName, IAnchor gutterMarkAnchor, ISolution solution, ITextControl textControl)
        {
            var runSubMenuAnchor = new SubmenuAnchor(gutterMarkAnchor,
                                                     new SubmenuBehavior(text: null, icon: null, executable: true, removeFirst: true));
            var debugSubMenuAnchor = new SubmenuAnchor(gutterMarkAnchor,
                                                       new SubmenuBehavior(text: null, icon: null, executable: true, removeFirst: true));

            return(new[]
            {
                CreateItem(new RunNukeTargetBulbAction(propertyName), solution, textControl, runSubMenuAnchor),
                CreateItem(new DebugNukeTargetBulbAction(propertyName), solution, textControl, debugSubMenuAnchor),
                CreateItem(new RunSingleNukeTargetBulbAction(propertyName), solution, textControl, runSubMenuAnchor),
                CreateItem(new DebugSingleNukeTargetBulbAction(propertyName), solution, textControl, debugSubMenuAnchor)
            });
        }
        public IEnumerable <IntentionAction> CreateBulbItems()
        {
            List <IntentionAction> list = new List <IntentionAction>();

            IAnchor anchor = _highlight.FileOnDisk.Count == 1 ? BulbMenuAnchors.FirstClassContextItems
                : (IAnchor) new SubmenuAnchor(BulbMenuAnchors.FirstClassContextItems, SubmenuBehavior.ExecutableDuplicateFirst);

            if (_highlight.FileOnDisk.Count > 1)
            {
                list.Add(new RemoveFileBulb(this._highlight.CurrentProject, this._highlight.FileOnDisk.ToArray()).ToQuickFixIntention(anchor, UnnamedThemedIcons.Agent16x16.Id));
            }

            list.AddRange(this._highlight.FileOnDisk.Select(file => new RemoveFileBulb(this._highlight.CurrentProject, new[] { file }).ToQuickFixIntention(anchor, UnnamedThemedIcons.Agent16x16.Id)));

            return(list);
        }
        /// <summary>
        /// Yapay Zekâ
        /// Rastgele noktalar oluşturuyor.
        /// </summary>
        /// <param name="distances"></param>
        /// <param name="particles"></param>
        /// <param name="trainedParticles"></param>
        /// <param name="secondTime"></param>
        /// <returns></returns>
        private ICoordinate GenerateCoordinates2(IEnumerable <IDistance> distances, IList <PJayParticle> particles,
                                                 out IList <PJayParticle> trainedParticles, bool secondTime)
        {
            IDistance[] distanceArray = distances.ToArray();
            var         maxWeight     = 0;

            foreach (PJayParticle particle in particles)
            {
                foreach (IDistance distance in distanceArray)
                {
                    IAnchor anchor       = _anchors[distance.FromAnchorId];
                    var     realDistance = distance.Distance;
                    if (Math.Abs(anchor.Y) > 0.000001)
                    {
                        realDistance = Math.Sqrt(Math.Pow(distance.Distance, 2) - Math.Pow(anchor.Y, 2));
                    }
                    if (IsInsideOfSphere(new Coordinate(particle.X, particle.Z, 0), anchor, realDistance))
                    {
                        particle.Weight++;
                    }

                    if (maxWeight < particle.Weight)
                    {
                        maxWeight = particle.Weight;
                    }
                }
            }

            var weighted      = particles.Where(x => x.Weight == maxWeight);
            var count         = 0;
            var summed        = new Coordinate(0, 0, 0);
            var pJayParticles = weighted.ToList();

            foreach (var particle in pJayParticles)
            {
                summed.X       += particle.X;
                summed.Z       += particle.Z;
                particle.Weight = 0;
                count++;
            }

            summed.X /= count;
            summed.Z /= count;

            trainedParticles = pJayParticles;
            return(summed);
        }
        private (Vector <double> ranges, double[, ] anchors) CreateRangeArray(IReadOnlyList <IDistance> distances)
        {
            var             anchorMatrix = new double[distances.Count, 3];
            Vector <double> ranges       = Vector <double> .Build.Dense(distances.Count);

            for (var i = 0; i < distances.Count; i++)
            {
                if (!_anchorsDic.ContainsKey(distances[i].FromAnchorId))
                {
                    continue;
                }
                IAnchor currentAnchor = _anchorsDic[distances[i].FromAnchorId];
                anchorMatrix[i, 0] = currentAnchor.X;
                anchorMatrix[i, 1] = currentAnchor.Z;
                anchorMatrix[i, 2] = currentAnchor.Y;
                ranges[i]          = distances[i].Distance;
            }

            return(ranges, anchorMatrix);
        }
Exemple #23
0
        public static IServiceCollection AddLocationCalculatorRouter(this IServiceCollection services)
        {
            var locationBuilder = new LocationCalculatorBuilder <GradientDescent, Anchor>();
            var anchors         = new IAnchor[]
            {
                new Anchor(9, 60, 27, 512, 0),
                new Anchor(9, 7, 27, 513, 0),
                new Anchor(35, 96, 27, 514, 0),
                new Anchor(99, 89, 27, 515, 0),
                new Anchor(145, 66, 27, 516, 0),
                new Anchor(160, 9, 27, 517, 0),
                new Anchor(97, 8, 27, 518, 0),
                new Anchor(56, 9, 27, 519, 0),
            };
            // GradientDescent gradientDescent = locationBuilder.WithAnchors(
            //         new Anchor(53.8, 73.4, 92, 208),
            //         new Anchor(905.8, 0, 1.5, 211),
            //         new Anchor(0, 458.5, 76.4, 204),
            //         new Anchor(925.3, 398.3, 92, 206))
            //     .Build();
            GradientDescent gradientDescent = locationBuilder.WithAnchors(anchors).Build();

            var particleFilterBuilder = new LocationCalculatorBuilder <Location.ParticleFilter.ParticleFilter, Anchor>(new Location.ParticleFilter.ParticleFilter(3500, 30));
            var particleFilter        = particleFilterBuilder.WithAnchors(anchors).Build();

            var particleFilter3DBuilder = new LocationCalculatorBuilder <ParticleFilter3D, Anchor>(new ParticleFilter3D(3500, 30));
            var particleFilter3D        = particleFilter3DBuilder.WithAnchors(anchors).Build();

            var particleAreaFilterBuilder = new LocationCalculatorBuilder <ParticleAreaFilter, Anchor>(new ParticleAreaFilter(3500, 30));
            var particleAreaFilter        = particleAreaFilterBuilder.WithAnchors(anchors).Build();

            var comexBuilder = new LocationCalculatorBuilder <ComexCalculator, Anchor>();
            var comex        = comexBuilder.WithAnchors(anchors).Build();

            services.AddLocationCalculatorRouter(builder =>
            {
                builder.AddLocationCalculator <MessageType4>(particleFilter);
            });
            return(services);
        }
    void ImageAnchorAdded(IAnchor anchor)
    {
        UAR.Logger.log(UAR.Logger.Type.Info, "Image Category Added: {0}", anchor.imgName);

        if (anchor.imgName == "StartImg")
        {
            if (!originDetected)
            {
                AppStarted(anchor);
            }
        }
        else if (!inWorld)
        {
            if (anchor.imgName == "theStoryteller" || anchor.imgName == "animalWhisperer" || anchor.imgName == "theGiver" || anchor.imgName == "theSnowFox")
            {
                enterTarotWorld(anchor);
            }
            else
            {
                enterCategoryWorld(anchor.imgName);
            }
        }
    }
Exemple #25
0
 public ExtensionContext(IWriteSession session, IAnchor anchor, IStorageEngine engine)
 {
     Session = session;
     Anchor = anchor;
     Engine = engine;
 }
 /// <summary>
 /// Creates a new map message.
 /// </summary>
 /// <param name="text">The message.</param>
 /// <param name="anchor">The anchor object.</param>
 /// <param name="translation">The map translation.</param>
 public MapTextAnnotation(string text, IAnchor anchor, ITranslation translation)
     : base(anchor, translation)
 {
     // Set the message properties.
     this.text = text;
 }
 private IntentionAction CreateAction(IAnchor anchor = null)
 {
     return new IntentionAction(this, Text, BulbThemedIcons.ContextAction.Id, anchor);
 }
Exemple #28
0
        public IReadSession OpenReadSession(IAnchor anchor)
        {
            statistics.IncrementHistoricalReadSessionsOpened();

            return new HistoricalReadSession(storageEngine, encoders, anchor, DisposeHistoricalReadSession);
        }
Exemple #29
0
        public void Visit(IAnchor anchor, IStorageVisitor visitorloaded)
        {
            var gitReference = anchor as GitSnapshotAnchor;
            if (gitReference == null) throw new InvalidOperationException("Not a valid time reference");
            if (gitReference.Commit == null)
            {
                return;
            }

            sync.EnterReadLock();
            try
            {
                var tree = gitReference.Commit.Tree;
                LoadTree("", tree, visitorloaded);
            }
            finally
            {
                sync.ExitReadLock();
            }
        }
Exemple #30
0
        private ICoordinate GenerateCoordinates(IEnumerable <IDistance> distances, IList <PJayParticle> particles,
                                                out IList <PJayParticle> trainedParticles, bool secondTime)
        {
            var weights   = new List <double>(_numberOfParticles);
            var maxWeight = 0d;

            distances = distances.OrderBy(x => x.Distance);
            IDistance[] distanceArray = distances.ToArray();
            double      distanceSum   = distanceArray.Sum(x => x.Distance);

            foreach (PJayParticle pJay in particles)
            {
                double prob = 1;
                foreach (IDistance distance in distanceArray)
                {
                    IAnchor anchor = _anchors[distance.FromAnchorId];
                    double  dist   = Math.Sqrt(Math.Pow(pJay.X - anchor.X, 2) + Math.Pow(pJay.Z - anchor.Z, 2));
                    prob *= GaussianProbabilityDistribution(dist, pJay.NumberOfCircleDistances, distance.Distance)
                            // *(1 - (distance.Distance / distanceSum))
                    ;
                }

                weights.Add(prob);
                if (maxWeight < prob)
                {
                    maxWeight = prob;
                }
            }

            var    newParticles   = new List <PJayParticle>(_numberOfParticles);
            double beta           = (secondTime ? 0.9 : 0.7) * maxWeight;
            var    resultPosition = new Coordinate(0, 0, 0);
            var    weightTotal    = 0d;

            for (var i = 0; i < _numberOfParticles; i++)
            {
                if (beta < weights[i])
                {
                    newParticles.Add(particles[i]);
                    resultPosition.X += particles[i].X * weights[i];
                    resultPosition.Z += particles[i].Z * weights[i];
                    weightTotal      += weights[i];
                }
            }

            resultPosition.X /= weightTotal;
            resultPosition.Z /= weightTotal;

            if (!secondTime)
            {
                var i = 0;
                int currentParticleNumber = newParticles.Count;
                while (_numberOfParticles > newParticles.Count)
                {
                    i %= currentParticleNumber;
                    double xx = newParticles[i].X + Random.Next(-_numberOfCircleDistances, _numberOfCircleDistances);
                    double zz = newParticles[i].Z + Random.Next(-_numberOfCircleDistances, _numberOfCircleDistances);

                    var particle = new PJayParticle(xx, zz);
                    particle.SetNoise(_numberOfCircleDistances);
                    newParticles.Add(particle);
                    i++;
                }
            }

            particles        = newParticles;
            trainedParticles = newParticles;
            if (!secondTime)
            {
                return(GenerateCoordinates(distanceArray, particles, out trainedParticles, true));
            }

            return(resultPosition);
        }
Exemple #31
0
        public ICoordinate GetResult(int objectId, params IDistance[] distances)
        {
            double minH = double.MaxValue;
            double maxH = 0;
            double maxW = 0;
            double minW = double.MaxValue;

            foreach (IDistance distance in distances)
            {
                IAnchor anchor = _anchors[distance.FromAnchorId];
                if (maxH < anchor.Z + distance.Distance)
                {
                    maxH = anchor.Z + distance.Distance;
                }

                if (minH > anchor.Z - distance.Distance)
                {
                    minH = anchor.Z - distance.Distance;
                }

                if (maxW < anchor.X + distance.Distance)
                {
                    maxW = anchor.X + distance.Distance;
                }

                if (minW > anchor.X - distance.Distance)
                {
                    minW = anchor.X - distance.Distance;
                }
            }

            maxH += 50;
            minH -= 50;
            maxW += 50;
            minW -= 50;

            var worldSizeInfo = new WorldSizeInfo();

            worldSizeInfo.WorldSizeWidthMin  = minW;
            worldSizeInfo.WorldSizeWidthMax  = maxW;
            worldSizeInfo.WorldSizeHeightMin = minH;
            worldSizeInfo.WorldSizeHeightMax = maxH;
            List <PJayParticle> particles;
            bool doesExist = false;

            if (_particles.ContainsKey(objectId))
            {
                particles = _particles[objectId].Particles;
                doesExist = true;
            }
            else
            {
                particles = new List <PJayParticle>(_numberOfParticles);
                for (int i = 0; i < _numberOfParticles; i++)
                {
                    double x = Random.Next((int)worldSizeInfo.WorldSizeWidthMin,
                                           (int)worldSizeInfo.WorldSizeWidthMax);
                    double z = Random.Next((int)worldSizeInfo.WorldSizeHeightMin,
                                           (int)worldSizeInfo.WorldSizeHeightMax);

                    var particle = new PJayParticle(x, z);
                    particle.SetNoise(_numberOfCircleDistances);
                    particles.Add(particle);
                }

                _particles.Add(objectId, new ParticleHistory(10)
                {
                    Particles = particles,
                });
            }
            // particles = new List<PJayParticle>(_numberOfParticles);


            ICoordinate result   = GenerateCoordinates(distances, particles, out IList <PJayParticle> trainedParticles, doesExist);
            double      averageX = trainedParticles.Average(x => x.X);
            double      averageZ = trainedParticles.Average(x => x.Z);

            for (int i = trainedParticles.Count; i < _numberOfParticles; i++)
            {
                double x = averageX + Random.Next(-_numberOfCircleDistances, _numberOfCircleDistances);
                double z = averageZ + Random.Next(-_numberOfCircleDistances, _numberOfCircleDistances);

                var particle = new PJayParticle(x, z);
                particle.SetNoise(_numberOfCircleDistances);
                trainedParticles.Add(particle);
            }

            _particles[objectId].Particles = trainedParticles as List <PJayParticle> ?? trainedParticles.ToList();
            DateTime now = DateTime.Now;

            if (_particles[objectId].GetAcceleration(result, now, out double acceleration) && !double.IsNaN(acceleration))
            {
                double std = _particles[objectId].AccelerationStd;
                if (!double.IsNaN(std))
                {
                    var kalmanFilter = new KalmanFilter2D(3, acceleration, _particles[objectId].AccelerationStd);
                    foreach (CoordinateHistory coordinateHistory in _particles[objectId].GeneratedCoordinate)
                    {
                        kalmanFilter.Push(coordinateHistory.Coordinate.X, coordinateHistory.Coordinate.Z);
                    }

                    result.X = (result.X + kalmanFilter.X) * .5;
                    result.Z = (result.Z + kalmanFilter.Y) * .5;
                }
            }
            _particles[objectId].AddHistoric(result, now);

            return(result);
        }
Exemple #32
0
 private BulbMenuItem CreateItem(IBulbAction bulbAction, ISolution solution, ITextControl textControl, IAnchor anchor)
 {
     return(new BulbMenuItem(new IntentionAction.MyExecutableProxi(bulbAction, solution, textControl),
                             bulbAction.Text,
                             LogoThemedIcons.NukeLogo.Id,
                             anchor));
 }
 protected AddInspectorAttributeAction(ICSharpContextActionDataProvider dataProvider, IAnchor anchor)
 {
     myDataProvider = dataProvider;
     myAnchor       = anchor;
 }
 /// <summary>
 /// Creates a new map annotation instance.
 /// </summary>
 /// <param name="anchor">The annotation anchor.</param>
 /// <param name="translation">The annotation translation.</param>
 public MapAnnotation(IAnchor anchor, ITranslation translation)
 {
     this.anchor = anchor;
     this.translation = translation;
 }
 public ReferenceAnchors(IAnchor previous, IAnchor enclosing)
 {
     _previous = previous;
     _enclosing = enclosing;
 }
Exemple #36
0
 public static IAnchor CreateGroupAnchor([NotNull] IAnchor ownerAnchor)
 {
     return(new SubmenuAnchor(ownerAnchor, SubmenuBehavior.Executable));
 }
 public static IList <IntentionAction> ToHelpersContextActionIntentions([NotNull] this IBulbAction action, [CanBeNull] IAnchor customAnchor = null, [CanBeNull] IconId customIcon = null)
 {
     return(new[]
     {
         action.ToHelpersContextActionIntention(customAnchor, customIcon)
     });
 }
		public void NavigateTo(string fileName, IAnchor anchor = null)
		{
			CodeEditorWindow.OpenWindowFor(fileName, PositionFrom(anchor));
		}
 /// <summary>
 /// Changes the anchor of the map annotation.
 /// </summary>
 /// <param name="anchor">The new anchor.</param>
 protected virtual void OnAnchorChanged(IAnchor anchor)
 {
     // Check the anchor is not null.
     if (null == anchor) throw new ArgumentNullException("anchor");
     // Set the anchor.
     this.anchor = anchor;
     // Update the bounds measurements.
     this.OnMeasureBounds();
 }
 public static IntentionAction ToHelpersContextActionIntention([NotNull] this IBulbAction action, [CanBeNull] IAnchor customAnchor = null, [CanBeNull] IconId customIcon = null)
 {
     return(action.ToContextActionIntention(customAnchor ?? HelperActionsConstants.ContextActionsAnchor, customIcon ?? MyIcons.ContextActionIcon));
 }
Exemple #41
0
        /// <summary>
        /// Shows the specified annotation.
        /// </summary>
        /// <param name="annotation">The text annotation</param>
        /// <param name="text">The message text.</param>
        /// <param name="anchor">The message anchor.</param>
        private void OnShowAnnotation(MapTextAnnotation annotation, string text, IAnchor anchor)
        {
            // Get the old message bounds.
            Rectangle oldBounds = annotation.Bounds;

            // Suspend the message layout.
            annotation.SuspendLayout();
            // Set the new message properties.
            annotation.Text = text;
            annotation.Anchor = anchor;
            // Result the message layout.
            annotation.ResumeLayout();

            // Get the new message bounds.
            Rectangle newBounds = annotation.Bounds;
            // If the message is currently visible.
            if (annotation.Visible)
            {
                // Invalidate the area corresponding to the old annotation bounds.
                this.Invalidate(oldBounds);
            }
            else
            {
                // Set the annotation visibility to true.
                annotation.Visible = true;
            }
            // Invalidated the area corresponding to the new annotation bounds.
            this.Invalidate(newBounds);
        }
 private IntentionAction CreateAction(IAnchor anchor = null)
 {
     return(new IntentionAction(this, Text, BulbThemedIcons.ContextAction.Id, anchor));
 }