コード例 #1
0
        private void DropSceneObject(Type objType, DragEventArgs e)
        {
            if (!ViewModel.SceneObjectTypes.Contains(objType))
            {
                return;
            }
            var dropPoint = e.GetPosition(EditorSceneCanvas);
            var percX     = Math.Round(dropPoint.X / EditorSceneCanvas.ActualWidth * 100, 1);
            var percY     = Math.Round(dropPoint.Y / EditorSceneCanvas.ActualHeight * 100, 1);

            if (!(Activator.CreateInstance(objType) is SceneObject obj))
            {
                Console.WriteLine("Incorrect type (not SceneObject)");
                return;
            }
            obj.PositionPoint = new MutablePoint(percX, percY);
            obj.Direction     = PointDirection.TopLeft;
            _setPropsWin.ShowDialog(obj);
            if (!_setPropsWin.Result)
            {
                return;
            }
            obj.SetParent(ViewModel.EditorScene);
            ViewModel.UpdateObjects();
        }
コード例 #2
0
        private void m_btn_newProperty_Click(object sender, EventArgs e)
        {
            PropertyWindow pw = new PropertyWindow(m_entity, null);
            var            r  = pw.ShowDialog();

            if (r == DialogResult.OK)
            {
                m_entity.Properties.Add(pw.Property);
                ResetPropertiesView();
            }
        }
コード例 #3
0
        private void PART_Mnu_Properties_Click(object sender, RoutedEventArgs e)
        {
            PropertyWindow winProperty = new PropertyWindow();

            winProperty.Owner   = App.MainAppWindow;
            winProperty.Topmost = App.MainAppWindow.Topmost;

            winProperty.ShowDialog();

            if (winProperty.DialogResult == true)
            {
                this.LoadAuthenticator(Settings.SettingsDatabase.SelectedAuthenticatorIndex);
            }
        }
コード例 #4
0
        private void m_btn_alterProperty_Click(object sender, EventArgs e)
        {
            if (!MakeSureSelectOne(m_lv_properties))
            {
                return;
            }

            var            p  = m_lv_properties.SelectedItems[0];
            PropertyWindow pw = new PropertyWindow(m_entity, m_entity.Properties.First(n => n.Name == p.SubItems[0].Text));
            var            r  = pw.ShowDialog();

            if (r == DialogResult.OK)
            {
                ResetPropertiesView();
            }
        }
コード例 #5
0
        private void m_btn_newProperty_Click(object sender, EventArgs e)
        {
            if (m_entity == null)
            {
                MessageBox.Show("没有加载", "提示");
                return;
            }

            PropertyWindow pw = new PropertyWindow(m_entity, null);
            var            r  = pw.ShowDialog();

            if (r == DialogResult.OK)
            {
                m_entity.Properties.Add(pw.Property);
                ResetPropertiesView();
            }
        }
コード例 #6
0
        private void PART_Mnu_Properties_Click(object sender, RoutedEventArgs e)
        {
            PropertyWindow winProperty = new PropertyWindow();
            winProperty.Owner = App.MainAppWindow;
            winProperty.Topmost = App.MainAppWindow.Topmost;

            winProperty.ShowDialog();

            if (winProperty.DialogResult == true)
            {
                this.LoadAuthenticator(Settings.SettingsDatabase.SelectedAuthenticatorIndex);
            }
        }