예제 #1
0
        void UpdateControlRepositoreies()
        {
            ControlRepositories = new Dictionary <string, RepositoryItem>();
            List <BaseEdit> editorList = EditorFinder.FindEditors(_drawControl);

            foreach (Control control in editorList)
            {
                BaseEdit editor = control as BaseEdit;
                if (editor == null)
                {
                    continue;
                }
                ConstructorInfo cConstructor = editor.Properties.GetType().GetConstructor(BindingFlags.Instance | BindingFlags.Public | BindingFlags.CreateInstance | BindingFlags.NonPublic, null, new Type[] { }, null);
                RepositoryItem  ri           = cConstructor.Invoke(null) as RepositoryItem;
                if (!ControlRepositories.ContainsKey(ri.EditorTypeName))
                {
                    ControlRepositories.Add(ri.EditorTypeName, ri);
                }
            }
        }
예제 #2
0
        public override void Draw(ControlGraphicsInfoArgs info)
        {
            base.Draw(info);

            EM_RadioValueEditorViewInfo       vi  = info.ViewInfo as EM_RadioValueEditorViewInfo;
            RepositoryItemEM_RadioValueEditor cri = vi.Item as RepositoryItemEM_RadioValueEditor;

            if (cri.ControlType == null)
            {
                return;
            }
            (cri.DrawControl as IEditValue).EditValue = vi.EditValue;
            cri.DrawControl.Bounds = info.Bounds;
            Bitmap bm = new Bitmap(info.Bounds.Width, info.Bounds.Height);

            cri.DrawControl.DrawToBitmap(bm, new Rectangle(0, 0, bm.Width, bm.Height));
            info.Graphics.DrawImage(bm, info.Bounds.Location);

            List <BaseEdit> editors = new List <BaseEdit>();

            editors = EditorFinder.FindEditors(cri.DrawControl);
            DrawEditors(editors, info, cri);
        }