Пример #1
0
        public MarshalEditorControl(COMRegistry registry, COMObjRef objref)
        {
            m_objref   = objref;
            m_registry = registry;
            InitializeComponent();
            textBoxObjRefType.Text = objref.Flags.ToString();
            textBoxIid.Text        = objref.Iid.FormatGuid();
            textBoxIIdName.Text    = registry.MapIidToInterface(objref.Iid).Name;
            Control ctl = null;

            if (objref is COMObjRefStandard)
            {
                ctl = new StandardMarshalEditorControl(registry, (COMObjRefStandard)objref);
            }
            else if (objref is COMObjRefCustom)
            {
                ctl = new CustomMarshalEditorControl(registry, (COMObjRefCustom)objref);
            }

            if (ctl != null)
            {
                tableLayoutPanel.Controls.Add(ctl, 0, 1);
                tableLayoutPanel.SetColumnSpan(ctl, tableLayoutPanel.ColumnCount);
                ctl.Dock = DockStyle.Fill;
            }

            Text = string.Format("Marshal Viewer - {0}", objref.Flags);
        }
Пример #2
0
 private void btnMarshalProps_Click(object sender, EventArgs e)
 {
     try
     {
         COMObjRef objref = COMObjRef.FromArray(hexEditor.Bytes);
         EntryPoint.GetMainForm(m_registry).HostControl(new MarshalEditorControl(m_registry, objref));
     }
     catch (Exception ex)
     {
         EntryPoint.ShowError(this, ex);
     }
 }