예제 #1
0
        internal static bool IsFileAlreadyOpen(Form1 form, String fileName, out XtraTabPage tabPageFound)
        {
            XtraTabControl pagesTabControl = form.pagesTabControl;

            tabPageFound = null;

            foreach (XtraTabPage tabPage in pagesTabControl.TabPages)
            {
                if (ProgramUtil.GetFilenameTabPage(tabPage) == fileName)
                {
                    tabPageFound = tabPage;
                }
            }

            return(tabPageFound != null);
        }
예제 #2
0
        internal static String GetInitialFolder(Form1 form)
        {
            XtraTabControl pagesTabControl = form.pagesTabControl;
            String         filename        = ProgramUtil.GetFilenameTabPage(pagesTabControl.SelectedTabPage);

            if (!String.IsNullOrEmpty(filename) && ConfigUtil.GetBoolParameter("OverrideFolderWithActiveFile"))
            {
                String path = Path.GetDirectoryName(filename);
                if (!String.IsNullOrEmpty(path) && Directory.Exists(path))
                {
                    return(path);
                }
            }

            return(ConfigUtil.GetStringParameter(ConfigUtil.GetIntParameter("SettingFolder") == 1 ? "LastUserFolder" : "SpecificFolder"));
        }