/// <summary>
 /// Initializes the feature overloads and bodies.
 /// </summary>
 /// <param name="context">The initialization context.</param>
 public override void InitOverloadsAndBodies(ICSharpContext context)
 {
     foreach (ICommandOverload Overload in Source.OverloadList)
     {
         ICSharpCommandOverload NewOverload = CSharpCommandOverload.Create(context, Overload, this, Owner);
         OverloadList.Add(NewOverload);
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Initializes a new instance of the CallTipClickEventArgs class.
 /// </summary>
 /// <param name="callTipArrow"></param>
 /// <param name="currentIndex"></param>
 /// <param name="newIndex"></param>
 /// <param name="overloadList"></param>
 /// <param name="highlightStart"></param>
 /// <param name="highlightEnd"></param>
 public CallTipClickEventArgs(CallTipArrow callTipArrow, int currentIndex, int newIndex, OverloadList overloadList, int highlightStart, int highlightEnd)
 {
     _callTipArrow = callTipArrow;
     _currentIndex = currentIndex;
     _newIndex = newIndex;
     _overloadList = overloadList;
     _highlightStart = highlightStart;
     _highlightEnd = highlightEnd;
 }
Esempio n. 3
0
        /// <summary>
        /// Adds an overload to this command. An executable command needs to have at least one overload.
        /// </summary>
        /// <param name="overload">Overload to add to this command.</param>
        /// <returns>This builder.</returns>
        public CommandBuilder WithOverload(CommandOverloadBuilder overload)
        {
            if (OverloadArgumentSets.Contains(overload.ArgumentSet))
            {
                throw new DuplicateOverloadException(Name, overload.Arguments.Select(x => x.Type).ToList(), overload.ArgumentSet);
            }

            OverloadArgumentSets.Add(overload.ArgumentSet);
            OverloadList.Add(overload);

            return(this);
        }
Esempio n. 4
0
        // TODO: Add a constructor that accepts Delegate[].

        /// <summary>
        /// Creates a new LuaOverloadMethod with the given choices.
        /// </summary>
        /// <param name="E">The current environment.</param>
        /// <param name="name">The name of the method, used for errors.</param>
        /// <param name="methods">The method choices, cannot be null.</param>
        /// <param name="targets">The targets for the methods, cannot be null.</param>
        /// <exception cref="System.ArgumentNullException">If methods or targets is null.</exception>
        /// <exception cref="System.ArgumentException">If the length of methods
        /// is not equal to that of targets.</exception>
        public LuaOverloadFunction(string name, IEnumerable <MethodInfo> methods,
                                   IEnumerable <object> targets)
            : base(name)
        {
            _methods = new OverloadList <Tuple <MethodInfo, object> >();
            _methods.AddRange(methods.Zip(targets, (a, b) => Tuple.Create(a, b)), m => {
                var temp = m.Item1.GetCustomAttribute <OverloadAttribute>(false);
                if (temp != null)
                {
                    return(temp.Index);
                }
                else
                {
                    return(null);
                }
            });
        }
Esempio n. 5
0
 /// <summary>
 ///     Shows the calltip with overloads
 /// </summary>
 /// <param name="overloadList">List of overloads to be displayed see <see cref="OverLoadList"/></param>
 /// <param name="startIndex">The index of the initial overload to display</param>
 /// <param name="highlightStart">Start posision of the part of the message that should be selected</param>
 /// <param name="highlightEnd">End posision of the part of the message that should be selected</param>
 /// <remarks>
 ///     ShowOverload automatically handles displaying a calltip with a list of overloads. It automatically shows the
 ///     up and down arrows and cycles through the list of overloads in response to mouse clicks.
 ///     The current document position will be used
 /// </remarks>
 public void ShowOverload(OverloadList overloadList, uint startIndex, int highlightStart, int highlightEnd)
 {
     ShowOverload(overloadList, -1, startIndex, highlightStart, highlightEnd);
 }
Esempio n. 6
0
 /// <summary>
 ///     Shows the calltip with overloads
 /// </summary>
 /// <param name="overloadList">List of overloads to be displayed see <see cref="OverLoadList"/></param>
 /// <param name="startIndex">The index of the initial overload to display</param>
 /// <remarks>
 ///     ShowOverload automatically handles displaying a calltip with a list of overloads. It automatically shows the
 ///     up and down arrows and cycles through the list of overloads in response to mouse clicks.
 ///     The current document position will be used with no highlight
 /// </remarks>
 public void ShowOverload(OverloadList overloadList, uint startIndex)
 {
     ShowOverload(overloadList, -1, startIndex, -1, -1);
 }
Esempio n. 7
0
 /// <summary>
 ///     Shows the calltip with overloads
 /// </summary>
 /// <param name="overloadList">List of overloads to be displayed see <see cref="OverLoadList"/></param>
 /// <param name="position">The document position where the calltip should be displayed</param>
 /// <param name="startIndex">The index of the initial overload to display</param>
 /// <param name="highlightStart">Start posision of the part of the message that should be selected</param>
 /// <param name="highlightEnd">End posision of the part of the message that should be selected</param>
 /// <remarks>
 ///     ShowOverload automatically handles displaying a calltip with a list of overloads. It automatically shows the
 ///     up and down arrows and cycles through the list of overloads in response to mouse clicks.
 /// </remarks>
 public void ShowOverload(OverloadList overloadList, int position, uint startIndex, int highlightStart, int highlightEnd)
 {
     _lastPos = position;
     _overloadList = overloadList;
     unchecked
     {
         _overloadList.CurrentIndex = (int)startIndex;
     }
     _highlightEnd = highlightEnd;
     _highlightStart = highlightStart;
     ShowOverloadInternal();
 }
Esempio n. 8
0
 /// <summary>
 ///     Shows the calltip with overloads
 /// </summary>
 /// <param name="overloadList">List of overloads to be displayed see <see cref="OverLoadList"/></param>
 /// <param name="position">The document position where the calltip should be displayed</param>
 /// <param name="highlightStart">Start posision of the part of the message that should be selected</param>
 /// <param name="highlightEnd">End posision of the part of the message that should be selected</param>
 /// <remarks>
 ///     ShowOverload automatically handles displaying a calltip with a list of overloads. It automatically shows the
 ///     up and down arrows and cycles through the list of overloads in response to mouse clicks.
 ///     The overload startIndex will be 0
 /// </remarks>
 public void ShowOverload(OverloadList overloadList, int position, int highlightStart, int highlightEnd)
 {
     ShowOverload(overloadList, position, 0, highlightStart, highlightEnd);
 }
Esempio n. 9
0
 /// <summary>
 ///     Shows the calltip with overloads
 /// </summary>
 /// <param name="overloadList">List of overloads to be displayed see <see cref="OverLoadList"/></param>
 /// <param name="position">The document position where the calltip should be displayed</param>
 /// <remarks>
 ///     ShowOverload automatically handles displaying a calltip with a list of overloads. It automatically shows the
 ///     up and down arrows and cycles through the list of overloads in response to mouse clicks.
 ///     The overload startIndex will be 0 with no Highlight
 /// </remarks>
 public void ShowOverload(OverloadList overloadList, int position)
 {
     ShowOverload(overloadList, position, 0, -1, -1);
 }
Esempio n. 10
0
 /// <summary>
 ///     Shows the calltip with overloads
 /// </summary>
 /// <param name="overloadList">List of overloads to be displayed see <see cref="OverLoadList"/></param>
 /// <param name="highlightStart">Start posision of the part of the message that should be selected</param>
 /// <param name="highlightEnd">End posision of the part of the message that should be selected</param>
 /// <remarks>
 ///     ShowOverload automatically handles displaying a calltip with a list of overloads. It automatically shows the
 ///     up and down arrows and cycles through the list of overloads in response to mouse clicks.
 ///     The current document position will be used starting at position 0
 /// </remarks>
 public void ShowOverload(OverloadList overloadList, int highlightStart, int highlightEnd)
 {
     ShowOverload(overloadList, -1, 0, highlightStart, highlightEnd);
 }
Esempio n. 11
0
 /// <summary>
 ///     Shows the calltip with overloads
 /// </summary>
 /// <param name="overloadList">List of overloads to be displayed see <see cref="OverLoadList"/></param>
 /// <remarks>
 ///     ShowOverload automatically handles displaying a calltip with a list of overloads. It automatically shows the
 ///     up and down arrows and cycles through the list of overloads in response to mouse clicks.
 ///     The current document position will be used starting at position 0 with no highlight
 /// </remarks>
 public void ShowOverload(OverloadList overloadList)
 {
     ShowOverload(overloadList, -1, 0, -1, -1);
 }
Esempio n. 12
0
        /// <summary>
        ///     Displays a calltip without overloads
        /// </summary>
        /// <param name="message">The calltip message to be displayed</param>
        /// <param name="position">The document position to show the calltip</param>
        /// <param name="highlightStart">Start posision of the part of the message that should be selected</param>
        /// <param name="highlightEnd">End posision of the part of the message that should be selected</param>
        public void Show(string message, int position, int highlightStart, int highlightEnd)
        {
            _lastPos = position;
            if (position < 0)
                position = NativeScintilla.GetCurrentPos();

            _overloadList = null;
            _message = message;
            NativeScintilla.CallTipShow(position, message);
            HighlightStart = highlightStart;
            HighlightEnd = highlightEnd;
        }