Exemple #1
0
        private void OnBrandComboGetList(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(SelectedBrand))
            {
                SelectedBrand = Brands.First();
            }

            if (null == e || (e == EventArgs.Empty))
            {
                throw (new ArgumentNullException("Event args required"));
            }

            if (!(e is OleMenuCmdEventArgs eventArgs))
            {
                return;
            }

            var inParam = eventArgs.InValue;
            var vOut    = eventArgs.OutValue;

            if (inParam != null)
            {
                throw (new ArgumentException("In params illegal"));
            }

            if (vOut != IntPtr.Zero)
            {
                Marshal.GetNativeVariantForObject(Brands, vOut);
            }
            else
            {
                throw (new ArgumentException("Out params required"));
            }
        }