public ControlXmlXsd() { // // The InitializeComponent() call is required for Windows Forms designer support. // InitializeComponent(); // // TODO: Add constructor code after the InitializeComponent() call. // declaracionControl=new ElementoXsd();//nombre control definir el objeto... nodoControl=new XmlDocument(); nodoControl.InnerXml="<Elemento>" + "<Nombre>" + "</Nombre>" + "<PosX>" + "</PosX>" + "<PosY>" + "</PosY>" + "</Elemento>"; TipoDatos=TiposBaseXsd.String; }
public void Reemplazar(ElementoXsd tipo) { Quitar(tipo); Añadir(tipo); }
public bool Añadir(ElementoXsd tipo) { if (tipo.Nombre == null) throw new XsdException("El elemento tiene que tener un nombre"); bool añadir = true; if (!declaracionElementos.ContainsKey(tipo)) declaracionElementos.Add(tipo, null); else añadir = false; return añadir; }
public bool Quitar(ElementoXsd tipo) { bool quitado = true; if (declaracionElementos.ContainsKey(tipo)) declaracionElementos.Remove(tipo); else quitado = false; return quitado; }