Пример #1
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Displays a dialog box from which a user may choose an FW7 (or later) project.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        public static bool GetFw7Project(Form frm, out string name, out string server)
        {
            var rc       = Properties.Settings.Default.Fw7OpenDialogBounds;
            int splitPos = Properties.Settings.Default.Fw7OpenDialogSplitterPos;

            using (var helper = new PaFieldWorksHelper())
            {
                var retVal = helper.ShowFwOpenProject(frm, ref rc, ref splitPos, out name, out server);
                Properties.Settings.Default.Fw7OpenDialogBounds      = rc;
                Properties.Settings.Default.Fw7OpenDialogSplitterPos = splitPos;
                return(retVal);
            }
        }
Пример #2
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Gets the lexical entries from the project and server specified in the data source
        /// information.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        public static IEnumerable <IPaLexEntry> GetLexEntriesFromFw7Project(FwDataSourceInfo dsInfo)
        {
            using (var helper = new PaFieldWorksHelper())
            {
                if (helper.Initialize(dsInfo.Name, dsInfo.Server,
                                      Properties.Settings.Default.Fw7TimeToWaitForProcessStart, Properties.Settings.Default.Fw7TimeToWaitForDataLoad))
                {
                    return(helper.LexEntries.ToList());
                }
            }

            return(null);
        }
Пример #3
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Gets the writing systems from the specified FW7 project on the specified server.
        /// When the project is not a db40 project, then server is null.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        public static IEnumerable <FwWritingSysInfo> GetWritingSystemsForFw7Project(string name, string server)
        {
            using (var helper = new PaFieldWorksHelper())
            {
                if (helper.LoadOnlyWritingSystems(name, server,
                                                  Properties.Settings.Default.Fw7TimeToWaitForProcessStart, Properties.Settings.Default.Fw7TimeToWaitForDataLoad))
                {
                    return(helper.WritingSystems.Select(ws => new FwWritingSysInfo(ws.IsVernacular ?
                                                                                   FwWritingSystemType.Vernacular : FwWritingSystemType.Analysis, ws.Id, ws.DisplayName)
                    {
                        DefaultFontName = ws.DefaultFontName,
                        IsDefaultAnalysis = ws.IsDefaultAnalysis,
                        IsDefaultVernacular = ws.IsDefaultVernacular
                    }).ToList());
                }
            }

            return(null);
        }