コード例 #1
0
        public CommandBar(View parentView, int toolbarResource, HandleCommandDelegate handleDelegate)
        {
            // Save the command handling delegate
            commandDelegate = handleDelegate;

            // Create the toolbar
            Toolbar = parentView.FindViewById <Toolbar>(toolbarResource);

            if (Toolbar != null)
            {
                // Iterate through the children of this toolbar looking for ImageButton
                for (int index = 0; index < Toolbar.ChildCount; ++index)
                {
                    if (Toolbar.GetChildAt(index) is AppCompatImageButton imageButton)
                    {
                        // Get the name of the resource form the id and use it to form the name of the image resource
                        string[] packageSplit = Application.Context.Resources.GetResourceName(imageButton.Id).Split(':');
                        string   imageName    = string.Format("{0}:drawable/{1}", packageSplit[0], packageSplit[1].Split('/')[1]);

                        imageButton.SetImageResource(Application.Context.Resources.GetIdentifier(imageName, null, null));

                        // Store the button id and button in an hash table to enable them to be bound
                        Buttons.Add(imageButton.Id, imageButton);

                        imageButton.Click += ButtonClicked;
                    }
                }

                // Hide the toolbar initially
                Toolbar.Visibility = ViewStates.Gone;
            }
        }
コード例 #2
0
 public ConsoleCommand(string cmd, string argHint, string desc, HandleCommandDelegate handler)
 {
     command        = cmd;
     argsHint       = argHint;
     description    = desc;
     commandHandler = handler;
 }
コード例 #3
0
 public ChatCommand(CommandAttribute attribute, HandleCommandDelegate handler)
 {
     Name         = attribute.Name;
     Permission   = attribute.RBAC;
     AllowConsole = attribute.AllowConsole;
     Handler      = handler;
     Help         = attribute.Help;
 }
コード例 #4
0
ファイル: IMCommands.cs プロジェクト: ElRakiti/ARGUS-TV
 public void AddCommand(string commandName, HandleCommandDelegate handleCommandDelegate)
 {
     AddCommand(commandName, String.Empty, handleCommandDelegate);
 }
コード例 #5
0
ファイル: IMCommands.cs プロジェクト: ElRakiti/ARGUS-TV
 public CommandParser(HandleCommandDelegate handleCommandDelegate)
 {
     _handleCommandDelegate = handleCommandDelegate;
 }
コード例 #6
0
ファイル: IMCommands.cs プロジェクト: ElRakiti/ARGUS-TV
 public void AddCommand(string commandName, string shortcut, HandleCommandDelegate handleCommandDelegate)
 {
     AddCommand(commandName, shortcut, new CommandParser(handleCommandDelegate));
 }
コード例 #7
0
 public void AddCommand(string commandName, string shortcut, HandleCommandDelegate handleCommandDelegate)
 {
     AddCommand(commandName, shortcut, new CommandParser(handleCommandDelegate));
 }
コード例 #8
0
 public void AddCommand(string commandName, HandleCommandDelegate handleCommandDelegate)
 {
     AddCommand(commandName, String.Empty, handleCommandDelegate);
 }
コード例 #9
0
 public CommandParser(HandleCommandDelegate handleCommandDelegate)
 {
     _handleCommandDelegate = handleCommandDelegate;
 }