예제 #1
0
        protected string ResolveStringResource(INiPackage package, string key)
        {
            if (package == null)
                throw new ArgumentNullException("package");
            if (key == null)
                throw new ArgumentNullException("key");

            return package.ResolveStringResource(key);
        }
예제 #2
0
        protected string ResolveStringResource(INiPackage package, string key)
        {
            if (package == null)
            {
                throw new ArgumentNullException("package");
            }
            if (key == null)
            {
                throw new ArgumentNullException("key");
            }

            return(package.ResolveStringResource(key));
        }
예제 #3
0
        private object CreateCommandBarPopup(Menu menu)
        {
            INiCommandBarPopup popup;

            ErrorUtil.ThrowOnFailure(_commandManager.CreateCommandBarPopup(
                                         menu.Guid != Guid.Empty ? menu.Guid : Guid.NewGuid(),
                                         menu.Priority,
                                         out popup
                                         ));

            popup.Text         = _package.ResolveStringResource(menu.Text);
            popup.DisplayStyle = Enum <NiCommandDisplayStyle> .Parse(menu.Style.ToString());

            ((NiCommandBarPopup)popup).Bitmap = ResolveBitmapResource(menu.Image);

            foreach (INiCommandBarGroup group in Build(menu.Items))
            {
                ErrorUtil.ThrowOnFailure(popup.Controls.Add(@group));
            }

            return(popup);
        }