Exemplo n.º 1
0
 private void addonSelectFrame1_CreateSpecialItem(object sender, CreateSpecialItemEventArgs e)
 {
     if (e.SpecialItem == "s_select_database")
     {
         m_writerChooser = new DatabaseWriterChooser();
         e.Instance      = m_writerChooser;
     }
 }
Exemplo n.º 2
0
 private void addonSelectFrame1_CreateSpecialItem(object sender, CreateSpecialItemEventArgs e)
 {
     if (e.SpecialItem == "s_existing_table")
     {
         m_chooser  = new DataStoreChooser();
         e.Instance = m_chooser;
     }
     if (e.SpecialItem == "s_new_table")
     {
         m_newTableChooser = new NewTableChooser();
         e.Instance        = m_newTableChooser;
     }
 }
Exemplo n.º 3
0
        private void CurrentList_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (m_changingDesign)
            {
                return;
            }
            if (DesignMode)
            {
                return;
            }

            if (CurrentList.SelectedIndex < 0)
            {
                propertyFrame1.SelectedObject = null;
                OnChangedSelectedObject(EventArgs.Empty);
            }
            else
            {
                if (m_objectCache[CurrentList.SelectedIndex] == null)
                {
                    var holder = CurrentItems[CurrentList.SelectedIndex] as AddonHolder;
                    var spec   = CurrentItems[CurrentList.SelectedIndex] as SpecialWrap;
                    if (holder != null)
                    {
                        m_objectCache[CurrentList.SelectedIndex] = holder.CreateInstance();
                        OnCreatedObject(m_objectCache[CurrentList.SelectedIndex]);
                    }
                    if (spec != null)
                    {
                        CreateSpecialItemEventArgs ev = new CreateSpecialItemEventArgs();
                        ev.SpecialItem = spec.Name;
                        CreateSpecialItem(this, ev);
                        m_objectCache[CurrentList.SelectedIndex] = ev.Instance;
                    }
                }
                propertyFrame1.SelectedObject = m_objectCache[CurrentList.SelectedIndex];
                OnChangedSelectedObject(EventArgs.Empty);
            }
            btsaveastemplate.Enabled = SelectedObject is IAddonInstance;
        }