private void Create(object sender, RoutedEventArgs e) { RecordsManager manager = new RecordsManager(); TreeViewItem attributes = FindName("databaseName") as TreeViewItem; foreach (TreeAttribute att in attributes.Items) { FieldInterface attInterface = att.AttributeContent as FieldInterface; if ((attInterface as FieldGeneric) != null) { //TODO say all invalid nodes that his has MessageBox.Show("Some input is invalid. Node ( " + att.Header + " )", "Invalid Entry", MessageBoxButton.OK); return; // do nothing } RecordDescription desc = attInterface.GetRecordDescription(); // TODO remove this and add binding desc.Name = att.Header.ToString(); manager.AddDescription(desc); } manager.ChangeName(attributes.Header as String); OnInfo("Saving database"); manager.Save(); Results w = new Results(manager); OnInfo("Database saved"); OnResult(w); }
private ProtocolParametersFieldUserControl(Type FieldType,string title) : this() { Fieldlabel.Text = title; if (FieldType==typeof(int)) { Field = new IntField(); } else if(FieldType==typeof(double)) { Field = new DoubleField(); } else if(FieldType==typeof(bool)) { Field = new BoolField(); } else if(FieldType==typeof(int[])) { Field = new IntArrayField(); } else if(FieldType==typeof(string)) { Field = new StringField(); } else if(FieldType==typeof(double[])) { Field = new DoubleArrayField(); } else if(FieldType==typeof(DateTime)) { Field = new DateTimeField(); } else { throw new NotImplementedException("Parameter Type (" + FieldType.ToString() + ") Not Implemented yet"); } }
private ProtocolParametersFieldUserControl(Type FieldType, string title) : this() { Fieldlabel.Text = title; if (FieldType == typeof(int)) { Field = new IntField(); } else if (FieldType == typeof(double)) { Field = new DoubleField(); } else if (FieldType == typeof(bool)) { Field = new BoolField(); } else if (FieldType == typeof(int[])) { Field = new IntArrayField(); } else if (FieldType == typeof(string)) { Field = new StringField(); } else if (FieldType == typeof(double[])) { Field = new DoubleArrayField(); } else if (FieldType == typeof(DateTime)) { Field = new DateTimeField(); } else { throw new NotImplementedException("Parameter Type (" + FieldType.ToString() + ") Not Implemented yet"); } }