public EshuMethod GetEshuMethod()
        {
            EshuMethod eshuMethod = new EshuMethod(this.MethodName, this.MethodReturnType);

            eshuMethod.Parameters = new List <EshuProperty>();
            foreach (ParameterEditor parameterEditor in this.listBoxParameters.Items.OfType <ParameterEditor>())
            {
                EshuProperty eshuProperty = parameterEditor.GetEshuProperty();
                eshuMethod.Parameters.Add(eshuProperty);
            }
            return(eshuMethod);
        }
        public MethodEditor(EshuMethod method)
            : this()
        {
            // TODO: Complete member initialization
            //this.m = m;
            this.textBlockMethod.Text = method.Name;
            this.textBlockType.Text   = method.ReturnType;

            foreach (EshuProperty p in method.Parameters)
            {
                this.listBoxParameters.Items.Add(new ParameterEditor(p));
            }
        }
Esempio n. 3
0
        private void buttonSave_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                this.InterfaceObject.Name = this.textBoxInterfaceName.Text;
                EshuInterface eshuInterface = this.InterfaceObject.Eshu;
                eshuInterface.ClearMethods();

                foreach (MethodEditor methodEditor in this.stackPanelMethodEditor.Children.OfType <MethodEditor>())
                {
                    EshuMethod eshuMethod = methodEditor.GetEshuMethod();
                    eshuInterface.AddMethod(eshuMethod);
                }
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "PlugSPL Error", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }