Ok here i have created a program that does multiple copy and adding text into files, tho its run time what i have come up with is a list_ that stores loads of keys then prints back at the end of the process instead of having loads of message boxes coming up this is what i have
the list class.
public class Messageresult : Weaons
{
private List<string> elfenliedtopfan5 = new List<string>();
public List<string> _Message
{
get { return elfenliedtopfan5; }
set { elfenliedtopfan5 = value; }
}
}
and in multiple of classes i call this like so
public void ShowMessage()
{
elfy1 = new Messageresult();
//MessageBox.Show(elfy1._Message.ToString());
update();
refreshlist();
var message = string.Join(Environment.NewLine, elfy1._Message);
MessageBox.Show(message + Environment.NewLine +
createa + Environment.NewLine + results);
elfy1._Message.Clear(); }
so this is what i use in multiple different classes and i use inheritance tis class above is called weapons. and all my other classes inherit weapons but
the issue im having is in certain classes like my thundergun class when i call this.
public void cliantfx()
{
elfy1 = new Messageresult();
string path = modcliant;
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
File.Copy(Properties.Settings.Default.root + "//raw//clientscripts//" + ModName + ".csc", path + ModName + ".csc");
MessageBox.Show(path);
}
if (File.Exists(path + ModName + ".csc"))
{
using (StreamReader elfenliedtopfan6 = new StreamReader((path + ModName + ".csc")))
{
string elfenliedtopfan6_program = elfenliedtopfan6.ReadToEnd();
if (elfenliedtopfan6_program.Contains(@"clientscripts\_thundergun::init();"))
{
//MessageBox.Show(@"clientscripts\_thundergun::init();" + "Already Added:");
refreshlist();
elfy1._Message.Add("clientscripts\\_thundergun::init();" + "Already Added:");
}
if (!elfenliedtopfan6_program.Contains(@"clientscripts\_thundergun::init();"))
{
elfenliedtopfan6.Dispose();
if (File.Exists(path + ModName + ".csc"))
{
{
string s = Environment.NewLine
+ @" clientscripts\_thundergun::init();";
string file = path + ModName + ".csc";
List<string> lines = new List<string>(System.IO.File.ReadAllLines(file));
int index = lines.FindLastIndex(item => item.Contains(@"clientscripts\_zombiemode_tesla::init();"));
if (index != -1)
{
lines.Insert(index + 1, s);//""
}
System.IO.File.WriteAllLines(file, lines);
MessageBox.Show("Added: " + s + "To " + ModName);
}
}
and as you can see elfy1._message.Add("text here....")
is called in weapons but when it executes tho this it just gives a blank message box yet when i execute weapons_gsc it works perfectly fine
and i use the same call methord and the showmessage() function in weapons
yet in sounds class and thundergun class it wont update it or display once its executed
so im not sure how i would go about this.
because it works perfectly fine for weapons_gsc image below show results
image of it working for weapons_gsc and weapons
the sound one you see at the end i had to make a propeties.setting.default.results
and made it = to the sound alais one only way i could get it to display the results all in one message box.