Beispiel #1
0
 public frmPrograma(ConfigMenu cf, int posicio, bool edit = false) : this()
 {
     this.cf          = cf;
     this.posicio     = posicio;
     this.edit        = edit;
     lblPosition.Text = posicio.ToString();
 }
Beispiel #2
0
        private void loadConfig()
        {
            string[] args = Environment.GetCommandLineArgs();
            string   fileConfig;

            Logger.Info("Numero de parametros: {0}", (args.Length - 1).ToString());
            if (args.Length < 2)
            {
                fileConfig = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(args[0]), System.IO.Path.GetFileNameWithoutExtension(args[0]) + ".xml");
                Logger.Info("Sin parámetros ({0}) : {1}", args.Length, fileConfig);
            }
            else
            {
                fileConfig = args[2];
            }
            ConfigMenu cfMenu;
            FileInfo   fi = new FileInfo(fileConfig);

            if (fi.Exists)
            {
                Logger.Info("Cargando fichero {0}", fileConfig);
                cfMenu = new ConfigMenu(fileConfig);
            }
            else
            {
                Logger.Info("Creando fichero {0}", fileConfig);
                Properties.Settings settings = Properties.Settings.Default;
                cfMenu = new ConfigMenu();
                cfMenu.SetMatrix(settings.Rows, settings.Columns);
                cfMenu.Save(fileConfig);
            }
            this.configMenu = cfMenu;
            this.fileName   = fileConfig;
        }
Beispiel #3
0
 public frmPrograma(ConfigMenu cf, OpcioMenu opc, int posicio, bool edit = true) : this(cf, posicio, true)
 {
     this.om           = opc;
     txtPrograma.Text  = opc.fileName;
     txtIcono.Text     = opc.fileIcon;
     txtPre.Text       = opc.preExec;
     txtPost.Text      = opc.postExec;
     cbDefault.Checked = opc.execDefaultPreExec;
 }
Beispiel #4
0
        private void Add_Programa(object sender, ConfigMenu menu)
        {
            PictureBox pic = sender as PictureBox;
            dynamic    tag = pic.Tag;
            string     str = $"Coordenadas [{tag.fila},{tag.columna}]";

            MessageBox.Show(str);
            var frmPrograma = new frmPrograma();
        }
Beispiel #5
0
 public frmOpcions(ConfigMenu config)
 {
     InitializeComponent();
     this.config     = config;
     lblColVal.Text  = config.columns.ToString();
     tbColumns.Value = config.columns;
     lblRowVal.Text  = config.rows.ToString();
     tbRows.Value    = config.rows;
     txtPre.Text     = config.defaultPreExec;
     txtPost.Text    = config.defaultPostExec;
     cbExit.Checked  = config.exitOnExit;
 }