private void DisplayModelInformation(ImportExportModel model) { StringBuilder info = new StringBuilder(); info.AppendLine(string.Format("模板名称:{0}", model.Name)); info.AppendLine(string.Format("模板类型:{0}", TranslateModelTypeToString(model.Type))); info.AppendLine(string.Format("信息种类:{0}", model.CardProperties.Count)); info.AppendLine(string.Format("模板说明:{0}", model.Description)); lblModelInfo.Text = info.ToString(); }
private void LoadAllModels() { string[] modelArray = Directory.GetFiles(modelDir, "*.iem", SearchOption.TopDirectoryOnly); lbxModelList.Items.Clear(); modelList.Clear(); foreach (string modelPath in modelArray) { try { ImportExportModel model = new ImportExportModel(); model = ObjectXMLSerialize<ImportExportModel>.Load(model, modelPath); model.Path = modelPath; modelList.Add(model); lbxModelList.Items.Add(model.Name); if (lbxModelList.Items.Count > 0) { lbxModelList.SelectedIndex = 0; } } catch { continue; } } }
private void LoadModel() { currentModel = ObjectXMLSerialize<ImportExportModel>.Load(currentModel, currentModel.Path); }
private void FillListModeCardProperties(ImportExportModel model) { lbxListModeCardProperties.Items.Clear(); this.currentModel.Assign(model); tbxModelDescription.Text = currentModel.Description; tbxModelName.Text = currentModel.Name; foreach (CardProperty property in model.CardProperties) { lbxListModeCardProperties.Items.Add(GenerateListModeCardPropertyText(property)); } if (lbxListModeCardProperties.Items.Count > 0) { lbxListModeCardProperties.SelectedIndex = 0; } }
private void FillCardPropertiesList(ImportExportModel model) { switch (model.Type) { case ImportModelType.List: FillListModeCardProperties(model); break; case ImportModelType.Table: break; } }
public void Assign(ImportExportModel another) { this.Name = another.Name; this.Path = another.Path; this.Description = another.Description; this.Type = another.Type; this.CardProperties.Clear(); this.CardProperties.AddRange(another.CardProperties.ToArray()); }