示例#1
0
        public void SetResourceOwner(ResourcePointer pointer, CultureInfo culture)
        {
            if (!_loading)
            {
                _loading = true;
                _pointer = pointer;
                _culture = culture;

                this.Image = null;
                if (_pointer != null)
                {
                    try
                    {
                        if (_pointer.UsePictureBox)
                        {
                            object v = _pointer.GetResourceValue(CultureName);
                            this.Image = (Image)v;
                        }
                        else
                        {
                        }
                    }
                    catch (Exception err)
                    {
                        MessageBox.Show(this.FindForm(), err.Message, "Show image", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                _loading = false;
                this.Invalidate();
            }
        }
示例#2
0
 private void mnu_selectFile(object sender, EventArgs e)
 {
     if (_pointer.SelectResourceFile(this.FindForm(), CultureName))
     {
         if (_pointer.UsePictureBox)
         {
             this.Image = (Image)_pointer.GetResourceValue(CultureName);
         }
         _pointer.IsChanged = true;
         this.Invalidate();
     }
 }