Example #1
0
    public bool CanModifySelectionWith(ISelectionHandler handler)
    {
        if (autoZoomCoroutine != null)
        {
            return(false);
        }

        if (handler != currentSelectionHandler)
        {
            if (currentSelectionHandler != null)
            {
                currentSelectionHandler.Stop();
            }

            currentSelectionHandler = handler;
        }

        if (m_guidelinesVisibility == Visibility.OnDrag)
        {
            for (int i = 0; i < guidelines.Length; i++)
            {
                guidelines[i].enabled = true;
            }
        }

        return(true);
    }
Example #2
0
    public void StopModifySelectionWith(ISelectionHandler handler)
    {
        if (currentSelectionHandler == handler)
        {
            currentSelectionHandler = null;

            if (m_guidelinesVisibility == Visibility.OnDrag)
            {
                for (int i = 0; i < guidelines.Length; i++)
                {
                    guidelines[i].enabled = false;
                }
            }

            if (m_pixelPerfectSelection)
            {
                MakePixelPerfectSelection();
            }

            if (m_autoZoomEnabled)
            {
                StartAutoZoom(false);
            }
        }
    }
        /// <summary>
        /// Uses Microsoft.Build.Locator.MSBuildLocator to locate VisualStudio instances and subsequently the MSBuild executable. Then creates a MSBuildWorkspace.
        /// </summary>
        /// <param name="logger">Logger implementing IDoLog</param>
        /// <param name="selectionHandler">Used when multiple VisualStudio instances are found. Defaults to TakeLastVsInstance.<br/>
        /// If you want to ask the user use SelectVsInstanceOnCli or provide your own implementation.</param>
        public WorkspaceCreator(IDoLog logger = null, ISelectionHandler selectionHandler = null)
        {
            var _ = typeof(Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions); //hack needed to copy Microsoft.CodeAnalysis.CSharp.Workspaces

            _selectionHandler = selectionHandler ?? new TakeLastVsInstance();
            _logger           = logger ?? new NullLogger();
        }
Example #4
0
    private void StopAutoZoom()
    {
        if (autoZoomCoroutine != null)
        {
            StopCoroutine(autoZoomCoroutine);
            autoZoomCoroutine = null;
        }

        if (currentSelectionHandler != null)
        {
            currentSelectionHandler.Stop();
            currentSelectionHandler = null;
        }
    }
Example #5
0
        private void Select(ISelectable selectable)
        {
            if (!Selections.Contains(selectable))
            {
                ISelectionHandler    handler    = selectable.GetSelectionHandler();
                ISelectionVisualizer visualizer = selectable.GetSelectionVisualizer();

                handler.Selectable    = selectable;
                visualizer.Visualized = selectable;

                handler.Controller = this;

                Selections.Add(selectable);
                Handlers.Add(handler);
                Visualizers.Add(visualizer);

                Begin(handler, visualizer);
            }
        }
Example #6
0
 public MinPointFunctionTrain
 (
     IList <object> selectioList,
     IList <object> recombinationList,
     IList <object> mutationList,
     IList <object> functionList
 )
 {
     #region Init
     _selectioList     = selectioList;
     _selectionHandler = new SelectionHandle(_selectioList);
     //---------------------------------------------------------
     _recombinationList    = recombinationList;
     _recombinationHandler = new RecombinationHandler(recombinationList);
     //---------------------------------------------------------
     _mutationList     = mutationList;
     _mutationnHandler = new MutationHandler(mutationList);
     //---------------------------------------------------------
     _functionList    = functionList;
     _functionHandler = new FunctionsHnandler(functionList);
     #endregion
 }
Example #7
0
 void Tick(ISelectionHandler handler, ISelectionVisualizer visualizer, float deltaTime)
 {
     handler.Tick(deltaTime);
     visualizer.Tick(deltaTime);
     _hoveringVisualizer?.Tick(deltaTime);
 }
Example #8
0
 private void End(ISelectionHandler handler, ISelectionVisualizer visualizer)
 {
     handler.End();
     visualizer.End();
 }
Example #9
0
 private void Begin(ISelectionHandler handler, ISelectionVisualizer visualizer)
 {
     handler.Begin();
     visualizer.Begin();
 }
			SelectionAdapter(ISelectionHandler handler) {
				this.handler = handler;
			}