Exemplo n.º 1
0
        private void OnOk(Dialog sender, DialogCancelArgs args)
        {
            args.Cancel = true;

            string path = m_fileBrowser.Save();

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

            if (SelectDirectory)
            {
                if (Directory.Exists(path))
                {
                    TrySetPath(path);
                }
            }
            else
            {
                if (File.Exists(path))
                {
                    TrySetPath(path);
                }
                else
                {
                    m_fileBrowser.Open();
                }
            }
        }
Exemplo n.º 2
0
        private void OnOk(Dialog sender, DialogCancelArgs args)
        {
            args.Cancel = true;

            string path = m_fileBrowser.Open();

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

            if (!File.Exists(path))
            {
                return;
            }

            TryImport(path);
        }
        private void OnOk(Dialog sender, DialogCancelArgs args)
        {
            args.Cancel = true;

            string path = m_fileBrowser.Save();

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

            if (!System.IO.Path.IsPathRooted(path) || File.Exists(path) || Directory.Exists(System.IO.Path.GetDirectoryName(path)) && !Directory.Exists(path) || !path.Contains("/") && !path.Contains("\\"))
            {
                TrySetPath(path);
            }
            else
            {
                m_fileBrowser.Open();
            }
        }