Beispiel #1
0
        /// <summary>
        /// Initializes this object.
        /// Use this overload for starting and/or automating other apps.
        /// </summary>
        /// <param name="name">Menu name. Must be valid filename. Currently used only as the initial <b>Name</b> and <b>Text</b> of <see cref="Control"/>.</param>
        /// <param name="f"><see cref="CallerFilePathAttribute"/></param>
        /// <param name="l"><see cref="CallerLineNumberAttribute"/></param>
        /// <remarks>
        /// This overload sets properties:
        /// - <see cref="MTBase.ItemThread"/> = <see cref="MTThread.StaThread"/>.
        /// - <see cref="MTBase.ExtractIconPathFromCode"/> = true.
        ///
        /// Users can right-click a menu item to open/select it in editor.
        /// </remarks>
        public AMenu(string name, [CallerFilePath] string f = null, [CallerLineNumber] int l = 0) : base(f, l)
        {
            if (name.NE())
            {
                throw new ArgumentException("Empty name");
            }
            _name = name;

            _c = new _ContextMenuStrip(this, isMain: true);

            ExtractIconPathFromCode = true;
            ItemThread = MTThread.StaThread;
        }
Beispiel #2
0
 /// <summary>
 /// Initializes this object.
 /// Use this overload for various context menus of your app.
 /// </summary>
 /// <remarks>
 /// Item actions run in this thread by default (see <see cref="MTBase.ItemThread"/>).
 /// Users cannot right-click a menu item to open/select it in editor.
 /// </remarks>
 public AMenu() : base(null, 0)
 {
     _c = new _ContextMenuStrip(this, isMain: true);
 }