public void SuppleMentTxt(string filepath) { YML yml = new YML(filepath); using (FileStream fs = new FileStream(filepath, FileMode.Append, FileAccess.Write, FileShare.Write)) { using (StreamWriter sw = new StreamWriter(fs)) { if (!yml.boolnode("x")) { sw.WriteLine("\r\nx: 350"); } if (!yml.boolnode("y")) { sw.WriteLine("\r\ny: 350"); } if (!yml.boolnode("scale")) { sw.WriteLine("\r\nscale: 1.0"); } if (!yml.boolnode("text")) { sw.WriteLine("\r\ntext: "); } sw.Close(); } fs.Close(); } }
public void ReadText(string filepath) { try { YML yml = new YML(filepath); if (yml.read("x", "") != null) { X_T = (double.Parse(yml.read("x", "")) * 2).ToString(); } else { X_T = "250"; } if (yml.read("y", "") != null) { Y_T = (double.Parse(yml.read("y", "")) * 2).ToString(); } else { Y_T = "250"; } if (yml.read("scale", "") != null) { Scale = yml.read("scale", ""); } else { Scale = "1.0"; } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public void SuppleMentGui(string filepath) { YML yml = new YML(filepath); using (FileStream fs = new FileStream(filepath, FileMode.Append, FileAccess.Write, FileShare.Write)) { using (StreamWriter sw = new StreamWriter(fs)) { if (!yml.boolnode("gui")) { sw.WriteLine("\r\ngui: 'https://yun.mc5173.com/images/2019/08/14/mc5173.png'"); } if (!yml.boolnode("x")) { sw.WriteLine("\r\nx: -1"); } if (!yml.boolnode("y")) { sw.WriteLine("\r\ny: -1"); } if (!yml.boolnode("width")) { sw.WriteLine("\r\nwidth: 512"); } if (!yml.boolnode("high")) { sw.WriteLine("\r\nhigh: 512"); } if (!yml.boolnode("xshow")) { sw.WriteLine("\r\nxshow: 512"); } if (!yml.boolnode("yshow")) { sw.WriteLine("\r\nyshow: 512"); } if (!yml.boolnode("image")) { sw.WriteLine("\r\nimage: "); } if (!yml.boolnode("text")) { sw.WriteLine("\r\ntext: "); } if (!yml.boolnode("buttons")) { sw.WriteLine("\r\nbuttons: "); } if (!yml.boolnode("slot")) { sw.WriteLine("\r\nslot: "); } sw.Close(); } fs.Close(); } }
public void SuppleMentIm(string filepath) { YML yml = new YML(filepath); using (FileStream fs = new FileStream(filepath, FileMode.Append, FileAccess.Write, FileShare.Write)) { using (StreamWriter sw = new StreamWriter(fs)) { if (!yml.boolnode("image")) { sw.WriteLine("\r\nimage: 'https://yun.mc5173.com/images/2019/08/14/mc5173.png'"); } if (!yml.boolnode("x")) { sw.WriteLine("\r\nx: 350"); } if (!yml.boolnode("y")) { sw.WriteLine("\r\ny: 350"); } if (!yml.boolnode("width")) { sw.WriteLine("\r\nwidth: 48"); } if (!yml.boolnode("high")) { sw.WriteLine("\r\nhigh: 48"); } if (!yml.boolnode("xshow")) { sw.WriteLine("\r\nxshow: 48"); } if (!yml.boolnode("yshow")) { sw.WriteLine("\r\nyshow: 48"); } if (!yml.boolnode("hovertext")) { sw.WriteLine("\r\nhovertext: ''"); } sw.Close(); } fs.Close(); } }
public void SuppleMentBt(string filepath) { YML yml = new YML(filepath); using (FileStream fs = new FileStream(filepath, FileMode.Append, FileAccess.Write, FileShare.Write)) { using (StreamWriter sw = new StreamWriter(fs)) { if (!yml.boolnode("id")) { sw.WriteLine("\r\nid: "); } if (!yml.boolnode("name")) { sw.WriteLine("\r\nname: ''"); } if (!yml.boolnode("url")) { sw.WriteLine("\r\nurl: 'https://yun.mc5173.com/images/2019/08/14/mc5173.png'"); } if (!yml.boolnode("url2")) { sw.WriteLine("\r\nurl2: 'https://yun.mc5173.com/images/2019/08/14/mc5173.png'"); } if (!yml.boolnode("x")) { sw.WriteLine("\r\nx: 350"); } if (!yml.boolnode("y")) { sw.WriteLine("\r\ny: 350"); } if (!yml.boolnode("width")) { sw.WriteLine("\r\nyshow: 48"); } if (!yml.boolnode("high")) { sw.WriteLine("\r\nhigh: 48"); } if (!yml.boolnode("commands")) { sw.WriteLine("\r\ncommands: "); } if (!yml.boolnode("asop")) { sw.WriteLine("\r\nasop: false"); } if (!yml.boolnode("close")) { sw.WriteLine("\r\nclose: false"); } if (!yml.boolnode("to")) { sw.WriteLine("\r\nto: '-'"); } sw.Close(); } fs.Close(); } }
public void ReadImage(string filepath) { try { YML yml = new YML(filepath); if (yml.read("image", "") != null) { Url_I = yml.read("image", "").Trim('\''); } else { Url_I = ""; } if (yml.read("x", "") != null) { X_I = (double.Parse(yml.read("x", "").Trim('\'')) * 2).ToString(); } else { X_I = "350"; } if (yml.read("y", "") != null) { Y_I = (double.Parse(yml.read("y", "").Trim('\'')) * 2).ToString(); } else { Y_I = "350"; } if (yml.read("width", "") != null) { Width_I = yml.read("width", "").Trim('\''); } else { Width_I = "96"; } if (yml.read("high", "") != null) { High_I = yml.read("high", "").Trim('\''); } else { High_I = "96"; } if (yml.read("xshow", "") != null) { XShow_I = (double.Parse(yml.read("xshow", "").Trim('\'')) * 2).ToString(); } else { XShow_I = "96"; } if (yml.read("yshow", "") != null) { YShow_I = (double.Parse(yml.read("yshow", "").Trim('\'')) * 2).ToString(); } else { YShow_I = "96"; } if (yml.read("hovertext", "") != null) { HoverText = yml.read("hovertext", "").Trim('\''); } else { HoverText = ""; } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public void ReadButton(string filepath) { try { YML yml = new YML(filepath); if (yml.read("id", "") != null) { Id = yml.read("id", "").Trim('\''); } else { Id = ""; } if (yml.read("name", "") != null) { Name_B = yml.read("name", "").Trim('\''); } else { Name_B = ""; } if ((yml.read("x", "") != null)) { X_B = (double.Parse(yml.read("x", "").Trim('\'')) * 2).ToString(); } else { X_B = "300"; } if (yml.read("y", "") != null) { Y_B = (double.Parse(yml.read("y", "").Trim('\'')) * 2).ToString(); } else { Y_B = "300"; } if (yml.read("width", "") != null) { Width_B = (double.Parse(yml.read("width", "").Trim('\'')) * 2).ToString(); } else { Width_B = "96"; } if (yml.read("high", "") != null) { High_B = (double.Parse(yml.read("high", "").Trim('\'')) * 2).ToString(); } else { High_B = "96"; } if (yml.read("url", "") != null) { Url1_B = yml.read("url", "").Trim('\''); } else { Url1_B = ""; } if (yml.read("url2", "") != null) { Url2_B = yml.read("url2", "").Trim('\''); } else { Url2_B = ""; } if (yml.read("asop", "") != null) { Asop = yml.read("asop", "").Trim('\''); } else { Asop = "false"; } if (yml.read("close", "") != null) { Close = yml.read("close", "").Trim('\''); } else { Close = "false"; } if (yml.read("to", "") != null) { To = yml.read("to", "").Trim('\''); } else { To = "-"; } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public void ReadGuiYML(string filepath) { try { YML yml = new YML(filepath); if (yml.read("gui", "") != null) { Url = yml.read("gui", "").Trim('\''); } else { Url = ""; } if (yml.read("x", "") != null) { X = yml.read("x", "").Trim('\''); } else { X = "200"; } if (yml.read("y", "") != null) { Y = yml.read("y", "").Trim('\''); } else { Y = "200"; } if (yml.read("width", "") != null) { Width = yml.read("width", "").Trim('\''); } else { Width = "1024"; } if (yml.read("high", "") != null) { High = yml.read("high", "").Trim('\''); } else { High = "1024"; } if (yml.read("xshow", "") != null) { XShow = (double.Parse(yml.read("xshow", "").Trim('\'')) * 2).ToString(); } else { XShow = "1024"; } if (yml.read("yshow", "") != null) { YShow = (double.Parse(yml.read("yshow", "").Trim('\'')) * 2).ToString(); } else { YShow = "1024"; } } catch (Exception ex) { MessageBox.Show(ex.Message); } }