Example #1
0
 private void WorldListView_KeyDown(object sender, KeyEventArgs e)
 {
     if (Keys.Delete == e.KeyCode)
     {
         ListView listView = sender as ListView;
         if (listView.SelectedItems.Count > 0)
         {
             WorldListViewItem item = listView.SelectedItems[0] as WorldListViewItem;
             if (item != null && item.rtObject != null)
             {
                 var rtObj = item.rtObject;
                 listView.Items.Remove(item);
                 rtObj.Destroy();
             }
         }
     }
 }
Example #2
0
        private void OnRemoveNewSceneObject(RayTracerNet.RayTracerObject rtObject)
        {
            int i = 0;

            while (i < this.worldListView.Items.Count)
            {
                WorldListViewItem item = this.worldListView.Items[i] as WorldListViewItem;
                if (item != null && item.rtObject == rtObject)
                {
                    this.worldListView.Items.RemoveAt(i);
                }
                else
                {
                    i++;
                }
            }
        }
Example #3
0
        private void WorldListView_SelectedIndexChanged(object sender, EventArgs e)
        {
            ListView listView = sender as ListView;

            if (listView != null && listView.SelectedItems.Count > 0)
            {
                WorldListViewItem selectItem = listView.SelectedItems[0] as WorldListViewItem;
                if (selectItem != null && selectItem.rtObject != null)
                {
                    if (selectItem.rtObject is PrimitiveBase)
                    {
                        PrimitiveBase primitive = selectItem.rtObject as PrimitiveBase;
                        if (primitive != null)
                        {
                            primitive.Select();
                        }
                    }
                    ActivePropertyPanel(selectItem.rtObject);
                }
            }
        }