Exemplo n.º 1
0
        private void fileSelector_SelectedFileChanged(object sender, EventArgs e)
        {
            string fileName;

            try
            {
                var fileInfo = new FileInfo(fileSelector.SelectedFile);

                if (!(fileInfo.Exists))
                {
                    return;
                }

                fileName = fileInfo.FullName;
            }
            catch (ArgumentException)
            {
                return;
            }

            if (string.IsNullOrEmpty(fileName))
            {
                return;
            }

            tryAndCatch <Exception>(delegate()
            {
                textBoxIncludePath.Text = MainEngine.GetFormattedPaths(fileName, macrosElementName, includePathElementName);
            });

            tryAndCatch <Exception>(delegate()
            {
                textBoxLibPath.Text = MainEngine.GetFormattedPaths(fileName, macrosElementName, libPathElementName);
            });

            tryAndCatch <Exception>(delegate()
            {
                textBoxUserDefines.Text = MainEngine.GetElementValue(fileName, macrosElementName, userDefinesElementName);
            });
        }