Chatterer.ToolbarButtonWrapper.TryWrapToolbarButton C# (CSharp) Method

TryWrapToolbarButton() public static method

If ToolbarManager is present, initializes a new instance of the VOID.ToolbarButtonWrapper class.
public static TryWrapToolbarButton ( string ns, string id ) : ToolbarButtonWrapper
ns string Namespace, usually the plugin name.
id string Identifier, unique per namespace.
return ToolbarButtonWrapper
        public static ToolbarButtonWrapper TryWrapToolbarButton(string ns, string id)
        {
            if (ToolbarManagerPresent)
            {
                object button = TBManagerAdd.Invoke(TBManagerInstance, new object[] { ns, id });

                Tools.PostDebugMessage(string.Format(
                    "{0}: Added Button '{1}' with ToolbarManager.  Getting 'Text' property",
                    "ToolbarButtonWrapper",
                    button.ToString()
                ));

                return new ToolbarButtonWrapper(button);
            }
            else
            {
                return null;
            }
        }