Esempio n. 1
0
        public void ProgramRemove(ProgramBlock program)
        {
            program.IsEnabled = false;
            program.Stop();
            automationPrograms.Remove(program);
            // delete program files
            string file = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "programs");

            // remove csharp assembly
            try
            {
                File.Delete(Path.Combine(file, program.Address + ".dll"));
            }
            catch
            {
            }
            // remove arduino folder files
            try
            {
                Directory.Delete(Path.Combine(file, "arduino", program.Address.ToString()), true);
            }
            catch
            {
            }
        }
Esempio n. 2
0
        public void ProgramRemove(ProgramBlock program)
        {
            RaiseProgramModuleEvent(program, Properties.ProgramStatus, "Removed");
            program.IsEnabled = false;
            automationPrograms.Remove(program);
            // delete program files
            // TODO: implement also deleting of data/programs/<pid> folder!
            string file = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "programs");

            // remove csharp assembly
            try
            {
                File.Delete(Path.Combine(file, program.Address + ".dll"));
            }
            catch
            {
            }
            // remove arduino folder files
            try
            {
                Directory.Delete(Path.Combine(file, "arduino", program.Address.ToString()), true);
            } catch { }
        }