public virtual void UpdateContents()
 {
     foreach (Control c in InnerPanel.Controls)
     {
         if (c is DataStructureSidebarItemView)
         {
             DataStructureSidebarItemView dsitemview = (DataStructureSidebarItemView)c;
             if (Parent != null)
             {
                 if (Parent.Parent != null)
                 {
                     if (Parent.Parent is ObjectIDRefCollectionSidebarEditor)
                     {
                         ObjectIDRefCollectionSidebarEditor editorparent = (ObjectIDRefCollectionSidebarEditor)Parent.Parent;
                         if ((_SelectedIndex >= 0) && (_SelectedIndex < editorparent.SelectedCollection.Count))
                         {
                             //editorparent.SelectedCollection.Move(idx, _SelectedIndex);
                         }
                     }
                     else if (Parent.Parent is DataStructureCollectionsEditor)
                     {
                         DataStructureCollectionsEditor editorparent = (DataStructureCollectionsEditor)Parent.Parent;
                         if ((_SelectedIndex >= 0) && (_SelectedIndex < editorparent.SelectedCollection.Count))
                         {
                             dsitemview.Item = editorparent.SelectedCollection[_SelectedIndex];
                         }
                     }
                 }
             }
         }
     }
 }
Exemple #2
0
        private void OnDragDropped(object sender, DragEventArgs e)
        {
            if (EditorUI.GetParentVD2DataIsReadOnly(this))
            {
                return;
            }

            if (e.Data.GetDataPresent("System.Int32"))
            {
                object data = e.Data.GetData("System.Int32");
                if (data is Int32)
                {
                    int idx = (int)data;
                    if (Parent != null)
                    {
                        if (Parent.Parent != null)
                        {
                            if (Parent.Parent is ObjectIDRefCollectionSidebarEditor)
                            {
                                ObjectIDRefCollectionSidebarEditor editorparent = (ObjectIDRefCollectionSidebarEditor)Parent.Parent;
                                if ((idx >= 0) && (idx < editorparent.SelectedCollection.Count))
                                {
                                    editorparent.SelectedCollection.Move(idx, _SelectedIndex);
                                }
                            }
                        }
                    }
                }
            }
        }
 private void SidebarCollectionsEditorItem_DragDrop(object sender, DragEventArgs e)
 {
     if (EditorUI.GetParentVD2DataIsReadOnly(this))
     {
         return;
     }
     if (e.Data.GetDataPresent("System.Int32"))
     {
         object data = e.Data.GetData("System.Int32");
         if (data is Int32)
         {
             int idx = (int)data;
             if (_SelectedIndex != idx)
             {
                 if (Parent != null)
                 {
                     if (Parent.Parent != null)
                     {
                         if (Parent.Parent is ObjectIDRefCollectionSidebarEditor)
                         {
                             ObjectIDRefCollectionSidebarEditor editorparent = (ObjectIDRefCollectionSidebarEditor)Parent.Parent;
                             if ((idx >= 0) && (idx < editorparent.SelectedCollection.Count))
                             {
                                 editorparent.SelectedCollection.Move(idx, _SelectedIndex);
                             }
                         }
                         else if (Parent.Parent is DataStructureCollectionsEditor)
                         {
                             DataStructureCollectionsEditor editorparent = (DataStructureCollectionsEditor)Parent.Parent;
                             if ((idx >= 0) && (idx < editorparent.SelectedCollection.Count))
                             {
                                 editorparent.SelectedCollection.Move(idx, _SelectedIndex);
                             }
                         }
                     }
                 }
             }
             else
             {
                 foreach (Control c in InnerPanel.Controls)
                 {
                     if (c is DataStructureSidebarItemView)
                     {
                         DataStructureSidebarItemView dsitemview = (DataStructureSidebarItemView)c;
                         dsitemview.ToggleCollectionsItemModeCollapse();
                     }
                 }
             }
         }
     }
 }
Exemple #4
0
 private void ObjectIDRefCollectionSidebarEditorItem_Load(object sender, EventArgs e)
 {
     if (Parent != null)
     {
         if (Parent.Parent != null)
         {
             if (Parent.Parent is ObjectIDRefCollectionSidebarEditor)
             {
                 ObjectIDRefCollectionSidebarEditor editorparent = (ObjectIDRefCollectionSidebarEditor)Parent.Parent;
                 editorparent.SelectedCollection.CollectionChanged += SelectedCollection_CollectionChanged;
             }
         }
     }
 }
Exemple #5
0
 private void SelectedCollection_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
 {
     if (Parent != null)
     {
         if (Parent.Parent != null)
         {
             if (Parent.Parent is ObjectIDRefCollectionSidebarEditor)
             {
                 ObjectIDRefCollectionSidebarEditor editorparent = (ObjectIDRefCollectionSidebarEditor)Parent.Parent;
                 if (_SelectedIndex < editorparent.SelectedCollection.Count)
                 {
                     ObjectIDEditor.Text = editorparent.SelectedCollection[_SelectedIndex];
                 }
             }
         }
     }
 }
Exemple #6
0
 private void ObjectIDEditor_TextChanged(object sender, EventArgs e)
 {
     if (EditorUI.GetParentVD2DataIsReadOnly(this))
     {
         if (Parent != null)
         {
             if (Parent.Parent != null)
             {
                 if (Parent.Parent is ObjectIDRefCollectionSidebarEditor)
                 {
                     ObjectIDRefCollectionSidebarEditor editorparent = (ObjectIDRefCollectionSidebarEditor)Parent.Parent;
                     if (_SelectedIndex < editorparent.SelectedCollection.Count)
                     {
                         if (editorparent.SelectedCollection[_SelectedIndex] != ObjectIDEditor.Text)
                         {
                             ObjectIDEditor.TextChanged -= ObjectIDEditor_TextChanged;//dont wanna stack overflow, mates.
                             ObjectIDEditor.Text         = editorparent.SelectedCollection[_SelectedIndex];
                             ObjectIDEditor.TextChanged += ObjectIDEditor_TextChanged;
                         }
                     }
                 }
             }
         }
         return;
     }
     if (Parent != null)
     {
         if (Parent.Parent != null)
         {
             if (Parent.Parent is ObjectIDRefCollectionSidebarEditor)
             {
                 ObjectIDRefCollectionSidebarEditor editorparent = (ObjectIDRefCollectionSidebarEditor)Parent.Parent;
                 if (_SelectedIndex < editorparent.SelectedCollection.Count)
                 {
                     if (editorparent.SelectedCollection[_SelectedIndex] != ObjectIDEditor.Text)
                     {
                         editorparent.SelectedCollection[_SelectedIndex] = ObjectIDEditor.Text;
                     }
                 }
             }
         }
     }
 }
Exemple #7
0
 private void removeToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (EditorUI.GetParentVD2DataIsReadOnly(this))
     {
         return;
     }
     if (Parent != null)
     {
         if (Parent.Parent != null)
         {
             if (Parent.Parent is ObjectIDRefCollectionSidebarEditor)
             {
                 ObjectIDRefCollectionSidebarEditor editorparent = (ObjectIDRefCollectionSidebarEditor)Parent.Parent;
                 if ((_SelectedIndex >= 0) && (_SelectedIndex < editorparent.SelectedCollection.Count))
                 {
                     editorparent.SelectedCollection.RemoveAt(_SelectedIndex);
                 }
             }
         }
     }
 }