Ejemplo n.º 1
0
        public PropertyWindow()
        {
            ClassWindow parent    = Application.Current.Windows.OfType <ClassWindow>().FirstOrDefault();
            var         accessMod = new BasicDataCollection();

            InitializeComponent();
            this.AccessModifier.ItemsSource = accessMod.Modifiers;
            this.Type.ItemsSource           = accessMod.DataTypes;

            if (parent.Class_Pole_List.SelectedIndex != -1)
            {
                pole            = parent.MainClassObject.Properties[parent.Class_Pole_List.SelectedIndex];
                this._Name.Text = pole.Name;
                this.AccessModifier.SelectedItem = pole.AccessModifier;
                this.Type.SelectedItem           = pole.Type;
                foreach (string keyword in pole.Keywords)
                {
                    foreach (CheckBox chk in Keywords.Children)
                    {
                        if (keyword == chk.Content.ToString())
                        {
                            chk.IsChecked = true;
                        }
                    }
                }
            }
            else
            {
                pole = new PropertyObject();
                this.AccessModifier.SelectedIndex = 0;
                this.Type.SelectedIndex           = 0;
            }
        }
Ejemplo n.º 2
0
        public MethodWindow()
        {
            ClassWindow parent    = Application.Current.Windows.OfType <ClassWindow>().FirstOrDefault();
            var         accessMod = new BasicDataCollection();

            InitializeComponent();
            _Access.ItemsSource = accessMod.Modifiers;
            _Type.ItemsSource   = accessMod.DataTypes;
            if (parent._Method_List.SelectedIndex != -1)
            {
                Method                 = parent.MainClassObject.Methods[parent._Method_List.SelectedIndex];
                this._Name.Text        = Method.Name;
                _Arguments.ItemsSource = Method.Arguments;
                _Access.SelectedItem   = Method.AccessModifier;
                _Type.SelectedItem     = Method.ReturnType;
                foreach (string keyword in Method.Keywords)
                {
                    foreach (CheckBox chk in _KeyWord.Children)
                    {
                        if (keyword == chk.Content.ToString())
                        {
                            chk.IsChecked = true;
                        }
                    }
                }
            }
            else
            {
                Method = new MethodObject();
                _Arguments.ItemsSource = Method.Arguments;
                _Access.SelectedIndex  = 0;
                _Type.SelectedIndex    = 0;
            }
        }
Ejemplo n.º 3
0
        private void Dodaj_Click(object sender, RoutedEventArgs e)
        {
            _Class_List.SelectedIndex = -1;
            ClassWindow _ClassWindow = new ClassWindow();

            //   _ClassWindow.Owner = this;
            _ClassWindow.ShowDialog();
            if (_ClassWindow.DialogResult == true)
            {
                Classes.Add(_ClassWindow.MainClassObject);
                //Dalej wpisac na liste
            }
            _Class_List.Items.Refresh();
        }
Ejemplo n.º 4
0
        private void Edytuj_Click(object sender, RoutedEventArgs e)
        {
            ClassWindow _ClassWindow = new ClassWindow();

            //   _ClassWindow.Owner = this;
            if (_Class_List.SelectedIndex != -1)
            {
                _ClassWindow.ShowDialog();
            }
            if (_ClassWindow.DialogResult == true)
            {
                Classes[_Class_List.SelectedIndex] = _ClassWindow.MainClassObject;
                //Dalej wpisac na liste
            }
            _Class_List.Items.Refresh();
            Preview_TextBox.Text = Classes[_Class_List.SelectedIndex].ToFinalString();
        }