Esempio n. 1
0
 /// <inheritdoc/>
 public override bool DoesModelPassFilter(string filter) =>
 DateAvailable.Contains(filter) ||
 GrowthTime.ToString().Contains(filter) ||
 Harvest.ToString().Contains(filter) ||
 HarvestWithTending.ToString().Contains(filter) ||
 Seed.DoesModelPassFilter(filter) ||
 Products.Any(product => product.DoesModelPassFilter(filter));
Esempio n. 2
0
 /// <inheritdoc/>
 public override bool DoesModelPassFilter(string filter) =>
 Number.ToString().Contains(filter) ||
 Title.Contains(filter, StringComparison.OrdinalIgnoreCase) ||
 QuestGiver.Contains(filter, StringComparison.OrdinalIgnoreCase) ||
 Location.Contains(filter, StringComparison.OrdinalIgnoreCase) ||
 DateAvailable.Contains(filter) ||
 Prerequisites.Contains(filter, StringComparison.OrdinalIgnoreCase) ||
 Reward.Contains(filter, StringComparison.OrdinalIgnoreCase) ||
 Instructions.Contains(filter, StringComparison.OrdinalIgnoreCase);
Esempio n. 3
0
        /// ------------------------------------------------------------------------------------
        public void Save()
        {
            var project = new XElement("Project");

            project.Add(new XElement("Iso639Code", Iso639Code.NullTrim()));

            project.Add(!TranscriptionFont.Equals(Program.DialogFont)
                                ? new XElement("transcriptionFont", FontHelper.FontToString(TranscriptionFont))
                                : new XElement("transcriptionFont", null));

            project.Add(!FreeTranslationFont.Equals(Program.DialogFont)
                                ? new XElement("freeTranslationFont", FontHelper.FontToString(FreeTranslationFont))
                                : new XElement("freeTranslationFont", null));

            var autoSegmenterSettings = new XElement("AutoSegmentersettings");

            project.Add(autoSegmenterSettings);

            if (AutoSegmenterMinimumSegmentLengthInMilliseconds != Settings.Default.DefaultAutoSegmenterMinimumSegmentLengthInMilliseconds ||
                AutoSegmenterMaximumSegmentLengthInMilliseconds != Settings.Default.DefaultAutoSegmenterMaximumSegmentLengthInMilliseconds ||
                AutoSegmenterPreferrerdPauseLengthInMilliseconds != Settings.Default.DefaultAutoSegmenterPreferrerdPauseLengthInMilliseconds ||
                !AutoSegmenterOptimumLengthClampingFactor.Equals(Settings.Default.DefaultAutoSegmenterOptimumLengthClampingFactor))
            {
                autoSegmenterSettings.Add(new XAttribute("minSegmentLength", AutoSegmenterMinimumSegmentLengthInMilliseconds));
                autoSegmenterSettings.Add(new XAttribute("maxSegmentLength", AutoSegmenterMaximumSegmentLengthInMilliseconds));
                autoSegmenterSettings.Add(new XAttribute("preferrerdPauseLength", AutoSegmenterPreferrerdPauseLengthInMilliseconds));
                autoSegmenterSettings.Add(new XAttribute("optimumLengthClampingFactor", AutoSegmenterOptimumLengthClampingFactor));
            }
            else
            {
                autoSegmenterSettings.Add(new XAttribute("minSegmentLength", "0"));
                autoSegmenterSettings.Add(new XAttribute("maxSegmentLength", "0"));
                autoSegmenterSettings.Add(new XAttribute("preferrerdPauseLength", "0"));
                autoSegmenterSettings.Add(new XAttribute("optimumLengthClampingFactor", "0"));
            }

            // metadata for archiving
            project.Add(new XElement("Title", Title.NullTrim()));
            project.Add(new XElement("FundingProjectTitle", FundingProjectTitle.NullTrim()));
            project.Add(new XElement("ProjectDescription", ProjectDescription.NullTrim()));
            project.Add(new XElement("VernacularISO3CodeAndName", VernacularISO3CodeAndName.NullTrim()));
            project.Add(new XElement("Location", Location.NullTrim()));
            project.Add(new XElement("Region", Region.NullTrim()));
            project.Add(new XElement("Country", Country.NullTrim() ?? "Unspecified"));
            project.Add(new XElement("Continent", Continent.NullTrim() ?? "Unspecified"));
            project.Add(new XElement("ContactPerson", ContactPerson.NullTrim()));
            project.Add(new XElement("AccessProtocol", AccessProtocol.NullTrim()));
            project.Add(new XElement("DateAvailable", DateAvailable.NullTrim()));
            project.Add(new XElement("RightsHolder", RightsHolder.NullTrim()));
            project.Add(new XElement("Depositor", Depositor.NullTrim()));
            project.Add(new XElement("IMDIOutputDirectory", IMDIOutputDirectory.NullTrim()));

            int       retryCount = 1;
            Exception error;

            do
            {
                try
                {
                    error = null;
                    project.Save(SettingsFilePath);
                    break;
                }
                catch (Exception e)
                {
                    error = e;
                    if (retryCount-- == 0)
                    {
                        break;
                    }
                    Thread.Sleep(250);
                }
            } while (true);

            if (error != null)
            {
                ErrorReport.NotifyUserOfProblem(error,
                                                LocalizationManager.GetString("MainWindow.ProblemSavingSayMoreProject",
                                                                              "There was a problem saving the SayMore project:\r\n\r\n{0}"), SettingsFilePath);
            }

            if (_accessProtocolChanged)
            {
                foreach (var editor in Program.GetControlsOfType <SessionBasicEditor>(Program.ProjectWindow))
                {
                    editor.SetAccessProtocol();
                }

                _accessProtocolChanged = false;
            }
        }
Esempio n. 4
0
 /// <inheritdoc/>
 public override bool DoesModelPassFilter(string filter) =>
 DateAvailable.Contains(filter) ||
 Title.Contains(filter, StringComparison.OrdinalIgnoreCase) ||
 Requirement.Contains(filter, StringComparison.OrdinalIgnoreCase) ||
 Effect.Contains(filter, StringComparison.OrdinalIgnoreCase);
Esempio n. 5
0
 public string ToDateAvailable()
 {
     return(DateAvailable.ToString("dd/MM/yyyy"));
 }
 public string ToCSVString()
 {
     return(Tam + "," + DateAvailable.ToString() + "," + ((int)Location).ToString() + "," + ((int)VehicleType).ToString() + "\n");
 }