예제 #1
0
파일: Dash.cs 프로젝트: sillsdev/wesay
        private void AddButtonGroupToFlow(ButtonGroup buttonGroup)
        {
            var buttonRow = new List <DashboardButton>();

            _buttonRows.Add(buttonRow);
            bool foundAtLeastOne = false;

            foreach (IThingOnDashboard item in ThingsToMakeButtonsFor)
            {
                if (item == this)
                {
                    continue;
                }
                if (item.Group == buttonGroup.Group)
                {
                    buttonRow.Add(MakeButton(item, buttonGroup));
                    foundAtLeastOne = true;
                }
            }
            if (foundAtLeastOne)
            {
                Label header = new Label();
                header.AutoSize = true;
                header.Text     = StringCatalog.Get(buttonGroup.Group.ToString());
                header.Font     = new Font(StringCatalog.LabelFont.FontFamily, 12);
                _panel.Controls.Add(header);
                buttonRow.ForEach(b => _panel.Controls.Add(b));
                _buttonRows.Add(buttonRow);
            }
        }
예제 #2
0
        public string GetDescription()
        {
#if ON_The_Shelf
            string appName = Application.ProductName;

            var builder = new StringBuilder();

            bool first = true;
            foreach (var pair in _actions)
            {
                if (!first)
                {
                    builder.Append(", ");
                }
                first = false;
                builder.Append(pair.Key);
                if (pair.Value > 1)
                {
                    builder.Append(string.Format("({0})", pair.Value));
                }
            }

            var x = builder.ToString();
            if (string.IsNullOrEmpty(x))
            {
                return(StringCatalog.Get(appName + ": no logged activity"));
            }
            return(appName + ": " + x);
#endif
            return(string.Format("[{0}:{1}] auto", Application.ProductName, Application.ProductVersion));
        }
예제 #3
0
파일: WeSayApp.cs 프로젝트: sillsdev/wesay
        private static WeSayWordsProject InitializeProject(string liftPath)
        {
            var project = new WeSayWordsProject();

            liftPath = DetermineActualLiftPath(liftPath);
            if (liftPath == null)
            {
                MessageBox.Show(StringCatalog.Get("Welcome to WeSay.\r\nThe Configuration Tool will now open so that you can make a new project or choose an existing one."), StringCatalog.Get("No Default Project", "The label on the message box which the user sees if WeSay can't figure out what project to open."), MessageBoxButtons.OK, MessageBoxIcon.Information);
                RunConfigTool();
                return(null);
            }

            liftPath = project.UpdateFileStructure(liftPath);

            if (project.LoadFromLiftLexiconPath(liftPath))
            {
                Settings.Default.PreviousLiftPath = liftPath;
            }
            else
            {
                return(null);
            }

            try
            {
                project.MigrateConfigurationXmlIfNeeded();
            }
            catch
            {
                ErrorReport.NotifyUserOfProblem(
                    "WeSay was unable to migrate the WeSay configuration file for the new version of WeSay. This may cause WeSay to not function properly. Try opening the project in the WeSay Configuration Tool to fix this.");
            }

            return(project);
        }
예제 #4
0
        internal void OnSenseDeleteClicked(object sender, EventArgs e)
        {
            var            sendingLayouter          = (Layouter)sender;
            var            sense                    = (LexSense)sendingLayouter.PdoToLayout;
            IConfirmDelete confirmation             = _confirmDeleteFactory();
            var            deletionStringToLocalize = StringCatalog.Get("This will permanently remove the meaning");
            var            meaningText              = (GlossMeaningField ?
                                                       sense.Gloss.GetBestAlternative(ActiveViewTemplate.GetDefaultWritingSystemForField(LexSense.WellKnownProperties.Gloss).Id) :
                                                       sense.Definition.GetBestAlternative(ActiveViewTemplate.GetDefaultWritingSystemForField(LexSense.WellKnownProperties.Definition).Id)
                                                       );

            confirmation.Message = String.Format("{0} {1}.", deletionStringToLocalize,
                                                 meaningText);
            if (!confirmation.DeleteConfirmed)
            {
                return;
            }
            DetailList.SuspendLayout();
            Entry.Senses.Remove(sense);
            DetailList.Clear();
            //for now just relayout the whole thing as the meaning numbers will change etc.
            AddWidgets();
            DetailList.ResumeLayout();
            // For Linux/Mono, merely resuming layout doesn't work -- the display doesn't redraw properly.
            ForceLayoutAndRefresh();
        }
예제 #5
0
        public StatusBarController(ICountGiver counterGiver)
        {
            _countGiver = counterGiver;

            _launchConfigToolLink = new ToolStripButton()
            {
                Text = "Configure This Project...",
                //doesn't work Alignment = ToolStripItemAlignment.Right
            };
            _launchConfigToolLink.Margin = new Padding(100, 0, 0, 0);
            _launchConfigToolLink.Image  = Resources.WeSayConfigMenuSized;
            _launchConfigToolLink.Click += Dash.OnRunConfigureTool;
            _wordCountLabel      = new ToolStripStatusLabel();
            _wordCountLabel.Font = (Font)StringCatalog.LabelFont.Clone();

            _timer          = new Timer();
            _timer.Interval = 1000;
            var format = StringCatalog.Get("~Dictionary has {0} words", "Shown at the bottom of the screen.");

            _timer.Tick += new EventHandler(
                (o, e) =>
            {
                try
                {
                    _wordCountLabel.Text = String.Format(format, _countGiver.Count);
                }
                catch (Exception)
                {
                    _wordCountLabel.Text = "error";
                }
            }
                );
            _timer.Start();
        }
예제 #6
0
        private void OnRetrieveVirtualItemEvent(object sender, RetrieveVirtualItemEventArgs e)
        {
            RecordToken <LexEntry> recordToken = _records[e.ItemIndex];
            var displayString = (string)recordToken["Form"];

            e.Item = new ListViewItem(displayString);

            if ((string)recordToken["WritingSystem"] != _listWritingSystem.Id)
            {
                displayString = (string)recordToken["Form"];
                e.Item.Font   = new Font(e.Item.Font, FontStyle.Italic);
                //!!! TODO: Get the correct font from the respective writingsystem and maybe put the writingsystem id behind the form!! --TA 8.9.08
            }

            if (string.IsNullOrEmpty(displayString))
            {
                displayString = "(";
                if (IsWritingSystemUsedInLexicalForm(_listWritingSystem.Id))
                {
                    displayString += StringCatalog.Get("~Empty",
                                                       "This is what shows for a word in a list when the user hasn't yet typed anything in for the word.  Like if you click the 'New Word' button repeatedly.");
                }
                else
                {
                    displayString += StringCatalog.Get("~No Gloss",
                                                       "This is what shows if the user is listing words by the glossing language, but the word doesn't have a gloss.");
                }
                displayString += ")";
            }
            e.Item.Text = displayString;
        }
예제 #7
0
파일: Layouter.cs 프로젝트: sillsdev/wesay
 protected Layouter(DetailList table,
                    int beginningRow,
                    ViewTemplate viewTemplate,
                    LexEntryRepository lexEntryRepository,
                    IServiceProvider serviceProvider,
                    PalasoDataObject pdoToLayout)
 {
     if (table == null)
     {
         throw new ArgumentNullException("table");
     }
     if (viewTemplate == null)
     {
         throw new ArgumentNullException("viewTemplate");
     }
     PdoToLayout         = pdoToLayout;
     FirstRow            = beginningRow;
     _detailList         = table;
     _viewTemplate       = viewTemplate;
     _lexEntryRepository = lexEntryRepository;
     _serviceProvider    = serviceProvider;
     //Set up the space for the delete icon
     _deleteButton.Click  += OnDeleteClicked;
     _deleteButton.Active  = false;
     _deleteButton.Visible = false;
     _deleteButton.ToolTip = StringCatalog.Get("Delete Meaning");
     DetailList.Controls.Add(_deleteButton, 2, beginningRow);
     DetailList.MouseEnteredBounds += OnMouseEnteredBounds;
     DetailList.MouseLeftBounds    += OnMouseLeftBounds;
     ChildLayouts       = new List <Layouter>();
     _glossMeaningField = null;
 }
예제 #8
0
        public static ViewTemplate CreateViewTemplate(MissingInfoConfiguration config, ViewTemplate baseTemplate)
        {
            var template = CreateViewTemplateFromListOfFields(baseTemplate, config.FieldsToShowCommaSeparated, config.FieldsToShowReadOnly);

            //see WS-1120 ([email protected]) Add option to limit "add meanings" task to the ones that have a semantic domain
            //for now, let's just turn off all ghosts in these fill-in tasks
            template.DoWantGhosts = false;

            MarkReadOnlyFields(template, config.FieldsToShowReadOnly);

            //hack until we overhaul how Tasks are setup:
            var isBaseFormFillingTask = config.FieldsToShowCommaSeparated.Contains(LexEntry.WellKnownProperties.BaseForm);

            if (isBaseFormFillingTask)
            {
                Field flagField = new Field();
                flagField.DisplayName = StringCatalog.Get("~&This word has no Base Form",
                                                          "The user will click this to say that this word has no baseform.  E.g. Kindness has Kind as a baseform, but Kind has no other word as a baseform.");
                flagField.DataTypeName = "Flag";
                flagField.ClassName    = "LexEntry";
                flagField.FieldName    = "flag-skip-" + config.MissingInfoFieldName;
                flagField.Enabled      = true;
                template.Add(flagField);
            }
            return(template);
        }
예제 #9
0
        private void OnDeleteField_Click(object sender, EventArgs e)
        {
            if (CurrentField == null)
            {
                return;
            }
            if (!CurrentField.UserCanDeleteOrModify)
            {
                return;
            }

            int index = _fieldsListBox.SelectedIndices[0];

            ViewTemplate.Fields.Remove(CurrentField);
            ReportEdit(StringCatalog.Get("Remove field '{0}'", "Checkin description when deleting a field in WeSay Configuration Tool."), CurrentField.Key);

            LoadInventory();
            if (_fieldsListBox.Items.Count > 0)
            {
                _fieldsListBox.SelectedIndices.Clear();
                int indexToSelect = index == 0 ? 0 : index - 1;

                _fieldsListBox.Items[indexToSelect].Selected = true;
                //_fieldsListBox.SelectedIndices.Add(index - 1);//select the item before the deleted one
            }
        }
예제 #10
0
        private void OnFontChanged(object sender, EventArgs e)
        {
            if (_alreadyChanging)
            {
                return;
            }
            Control control = (Control)sender;

            _alreadyChanging = true;
            _originalControlProperties[control].Font = control.Font;
            var hints = control as ILocalizableControl;

            if (hints == null || hints.ShouldModifyFont)
            {
                if (control is LinkLabel && ((LinkLabel)control).UseMnemonic == false)
                {
                    //then that link is for user data, and shouldn't be localized (this came up in Chorus AnnotationEditorView)
                }
                else
                {
                    var font = StringCatalog.ModifyFontForLocalization(control.Font);
                    control.Font = font;
                }
            }
            _alreadyChanging = false;
        }
예제 #11
0
        private void OnFieldsListBox_ItemCheck(object sender, ItemCheckEventArgs e)
        {
            if (CurrentField == null)             //this gets called during population of the list,too
            {
                return;
            }

            //nb: this is not necessarily the Current Field!  you can click check boxes without selecting a different item
            var touchedField = (Field)_fieldsListBox.Items[e.Index].Tag;

            if (e.NewValue == CheckState.Checked)
            {
                touchedField.Enabled = true;
                //((Field) _fieldsListBox.SelectedItem).Enabled = true;
                ReportEdit(StringCatalog.Get("Enabled field '{0}'",
                                             "Checkin description when enabling a field in WeSay Configuration Tool."), touchedField.Key);
            }
            else if (e.NewValue == CheckState.Unchecked)
            {
                if (touchedField.CanOmitFromMainViewTemplate)
                {
                    touchedField.Enabled = false;
                    _logger.WriteConciseHistoricalEvent(StringCatalog.Get("Disabled field '{0}'", "Checkin description when disabling a field in WeSay Configuration Tool."), touchedField.Key);
                }
                else
                {
                    e.NewValue = CheckState.Checked;                     //revert
                }
            }
        }
예제 #12
0
        private void SetupComboControl(IValueHolder <string> selectedOptionRef)
        {
            _control.Font = (Font)StringCatalog.LabelFont.Clone();
            if (!_list.Options.Exists(delegate(Option o) { return(o.Key == string.Empty || o.Key == "unknown"); }))
            {
                MultiText unspecifiedMultiText = new MultiText();
                unspecifiedMultiText.SetAlternative(_preferredWritingSystem.Id,
                                                    StringCatalog.Get("~unknown",
                                                                      "This is shown in a combo-box (list of options, like Part Of Speech) when no option has been chosen, or the user just doesn't know what to put in this field."));
                Option unspecifiedOption = new Option("unknown", unspecifiedMultiText);
                _control.AddItem(new Option.OptionDisplayProxy(unspecifiedOption,
                                                               _preferredWritingSystem.Id));
            }
            _list.Options.Sort(CompareItems);
            foreach (Option o in _list.Options)
            {
                _control.AddItem(o.GetDisplayProxy(_preferredWritingSystem.Id));
            }
            _control.BackColor = Color.White;

            Value = selectedOptionRef.Value;
            _control.ListCompleted();

            _control.SelectedValueChanged += OnSelectedValueChanged;

            //don't let the mousewheel do the scrolling, as it's likely an accident (http://jira.palaso.org/issues/browse/WS-34670)
            ((Control)_control).MouseWheel += (sender, e) => {
                HandledMouseEventArgs he = e as HandledMouseEventArgs;
                if (he != null)
                {
                    he.Handled = true;
                }
            };
        }
예제 #13
0
        public void Launch(Form parentForm, ProjectInfo projectInfo)
        {
            string wesayZipFilePath = Path.Combine(Path.GetTempPath(), projectInfo.Name + "_wesay.zip");

            BackupMaker.BackupToExternal(projectInfo.PathToTopLevelDirectory,
                                         wesayZipFilePath,
                                         projectInfo.FilesBelongingToProject);

            var emailProvider = Palaso.Email.EmailProviderFactory.PreferredEmailProvider();
            var msg           = emailProvider.CreateMessage();

            msg.AttachmentFilePath.Add(wesayZipFilePath);
            msg.To.Add(_settings.Email);
            msg.Subject = StringCatalog.GetFormatted(
                "{0} WeSay Project Data",
                "The subject line of the email send by the 'Send Email' Action. The {0} will be replaced by the name of the project, as in 'Greek WeSay Project Data'",
                projectInfo.Name);
            msg.Body = StringCatalog.Get("The latest WeSay project data is attached.");

            //I tried hard to get this to run in a thread so it wouldn't block wesay,
            //but when called in a thread we always just get the generic '2' back.

            //            EmailMessage emailWorker =
            //                new EmailMessage(
            //                    subject,
            //                    body,
            //                    msg);

            ///emailWorker.SendMail();
            ///

            msg.Send(emailProvider);             // review (CP): This is different from the mapi popup used previously
        }
예제 #14
0
        private ContextMenuStrip GetSuggestionContextMenu(string language, HotSpot.HotSpot hotSpot)
        {
            ContextMenuStrip strip = new ContextMenuStrip();

            strip.ShowImageMargin = false;
            strip.ShowCheckMargin = false;

            ToolStripMenuItem item;
            int suggestionCount = 0;

            foreach (string suggestion in GetSuggestions(language, hotSpot.Text))
            {
                if (++suggestionCount > 10)
                {
                    break;
                }
                item        = new ToolStripMenuItem(suggestion);
                item.Tag    = hotSpot;
                item.Click += OnChooseSuggestedSpelling;
                strip.Items.Add(item);
            }
            if (strip.Items.Count == 0)
            {
                item         = new ToolStripMenuItem(StringCatalog.Get("(No Spelling Suggestions)"));
                item.Enabled = false;
                strip.Items.Add(item);
            }
            strip.Items.Add(new ToolStripSeparator());
            item        = new ToolStripMenuItem(StringCatalog.Get("Add to Dictionary"));
            item.Tag    = hotSpot;
            item.Click += OnAddToDictionary;
            strip.Items.Add(item);
            return(strip);
        }
예제 #15
0
        internal int AddWidgets(LexEntry entry, int insertAtRow)
        {
            DetailList.SuspendLayout();
            Debug.Assert(DetailList.RowCount == 0);
            Debug.Assert(DetailList.ColumnCount == 3);
            Debug.Assert(DetailList.RowStyles.Count == 0);
            FirstRow = 0;
            int   rowCount = 0;
            Field field    = ActiveViewTemplate.GetField(Field.FieldNames.EntryLexicalForm.ToString());

            if (field != null && field.GetDoShow(entry.LexicalForm, ShowNormallyHiddenFields))
            {
                Control formControl = MakeBoundControl(entry.LexicalForm, field);
                DetailList.AddWidgetRow(StringCatalog.Get(field.DisplayName),
                                        true,
                                        formControl,
                                        insertAtRow,
                                        false);
                insertAtRow = DetailList.GetRow(formControl);
                ++rowCount;
            }
            rowCount += AddCustomFields(entry, insertAtRow + rowCount);

            var rowCountBeforeSenses = rowCount;

            LastRow = insertAtRow + rowCount;
            foreach (var lexSense in entry.Senses)
            {
                var layouter = new LexSenseLayouter(
                    DetailList,
                    rowCount,
                    ActiveViewTemplate,
                    RecordListManager,
                    _serviceProvider,
                    lexSense
                    )
                {
                    ShowNormallyHiddenFields = ShowNormallyHiddenFields,
                    Deletable             = _sensesAreDeletable,
                    ShowMinorMeaningLabel = ShowMinorMeaningLabel,
                    ParentLayouter        = this
                };
                layouter.DeleteClicked += OnSenseDeleteClicked;
                rowCount += AddChildrenWidgets(layouter, lexSense, rowCount);
                ChildLayouts.Add(layouter);
            }

            //see: WS-1120 Add option to limit "add meanings" task to the ones that have a semantic domain
            //also: WS-639 ([email protected]) In Add meanings, don't show extra meaning slots just because a sense was created for the semantic domain
            var ghostingRule = ActiveViewTemplate.GetGhostingRuleForField(LexEntry.WellKnownProperties.Sense);

            if (rowCountBeforeSenses == rowCount || ghostingRule.ShowGhost)
            {
                AddSenseGhost(entry, rowCount);
                rowCount++;
            }

            DetailList.ResumeLayout(false);
            return(rowCount);
        }
예제 #16
0
        public void FontsDoNotScaleUp()
        {
            StringCatalog catalog   = new StringCatalog(_poFile, "Onyx", 30);
            Font          normal    = new Font(System.Drawing.FontFamily.GenericSerif, 20);
            Font          localized = StringCatalog.ModifyFontForLocalization(normal);

            Assert.AreEqual(20, Math.Floor(localized.SizeInPoints));
        }
예제 #17
0
        public void FontsDoNotChange()
        {
            StringCatalog catalog   = new StringCatalog(_poFile, FontFamily.GenericSansSerif.Name, 30);
            Font          normal    = new Font(FontFamily.GenericSerif, 20);
            Font          localized = StringCatalog.ModifyFontForLocalization(normal);

            Assert.AreEqual(FontFamily.GenericSerif.Name, localized.FontFamily.Name);
        }
예제 #18
0
        public void ModifyFontForLocation_HugeFont_ValidFont()
        {
            StringCatalog catalog   = new StringCatalog(_poFile, FontFamily.GenericSerif.Name, Single.MaxValue);
            Font          normal    = new Font(FontFamily.GenericSerif, Single.MaxValue);
            Font          localized = StringCatalog.ModifyFontForLocalization(normal);

            Assert.IsNotNull(localized);
        }
예제 #19
0
 public DictionaryStatusControl(int count)
 {
     InitializeComponent();
     _dictionarySizeLabel.Text =
         String.Format(StringCatalog.Get(this._dictionarySizeLabel.Text),
                       count,
                       WeSayWordsProject.Project.Name);
 }
        ConvertTo_LanguageWithoutSpellCheckerInstalled_ReturnsLanguageWithNotInstalledMessage
            ()
        {
            string spellCheckingNotInstalledTail = " (" + StringCatalog.Get("Not installed") + ")";

            Assert.AreEqual("fr_CA" + spellCheckingNotInstalledTail,
                            _spellCheckerIdToDisplayStringConverter.ConvertTo("fr_CA",
                                                                              typeof(string)));
        }
예제 #21
0
        private void btnMoveDown_Click(object sender, EventArgs e)
        {
            Field f = CurrentField;

            ViewTemplate.MoveDownInClass(CurrentField);
            LoadInventory();
            MakeFieldTheSelectedOne(f);
            ReportEdit(StringCatalog.Get("Adjusted field order", "Checkin description when moving a field in WeSay Configuration Tool."));
        }
예제 #22
0
 public BackupDialog(ProjectInfo projectInfo)
 {
     _projectInfo = projectInfo;
     InitializeComponent();
     _topLabel.Text     = "~Looking for USB Flash Drives...";
     pictureBox1.Image  = Resources.backupToDeviceImage;
     _cancelButton.Text = StringCatalog.Get(_cancelButton.Text);
     _cancelButton.Font = (Font)StringCatalog.LabelFont.Clone();
 }
예제 #23
0
 public int AddGhost(LexSense sense, IList <LexExampleSentence> list, int insertAtRow)
 {
     return(MakeGhostWidget(sense, list,
                            Field.FieldNames.ExampleSentence.ToString(),
                            StringCatalog.Get("~Example",
                                              "This is the field containing an example sentence of a sense of a word."),
                            "Sentence",
                            false,
                            insertAtRow));
 }
예제 #24
0
        public void LocalizedStringsFromPretendSample()
        {
            InitializeSampleProject();
            BasilProject project = new BasilProject();

            project.UiOptions.Language = "en";
            project.LoadFromProjectDirectoryPath(_projectDirectory);

            Assert.AreEqual("red", StringCatalog.Get("red"));
        }
예제 #25
0
        public void GetFormatted_TooManyParamsInCatalog_ShowsMessageAndReturnRightMessage()
        {
            StringCatalog catalog = new StringCatalog(_poFile, null, 9);

            using (new ErrorReport.NonFatalErrorReportExpected())
            {
                var answer = StringCatalog.GetFormatted("oneParam", "blah blah");
                Assert.AreEqual("!!first={0}", answer);
            }
        }
예제 #26
0
        private static string GetLabelForMeaning(int itemCount)
        {
            string label = StringCatalog.Get("~Meaning",
                                             "This label is shown once, but has two roles.  1) it labels the defintion field, and 2) marks the beginning of the set of fields which make up a sense. So, in english, if we labelled this 'definition', it would describe the field well but wouldn't label the section well.");

            if (itemCount > 0)
            {
                label += " " + (itemCount + 1);
            }
            return(label);
        }
예제 #27
0
        private void AddWritingSystemToPicker(IWritingSystemDefinition writingSystem, Field field)
        {
            var item = new MenuItem(
                writingSystem.Abbreviation + "\t" + StringCatalog.Get(field.DisplayName),
                OnWritingSystemMenuItemClicked
                );

            item.RadioCheck = true;
            item.Tag        = writingSystem;
            SearchModeMenu.MenuItems.Add(item);
        }
예제 #28
0
        private void OnClassOfFieldChanged(object sender, EventArgs e)
        {
            Field f = CurrentField;

            ViewTemplate.MoveToLastInClass(f);
            LoadInventory();             // show it in its new location
            MakeFieldTheSelectedOne(f);
            ReportEdit(
                StringCatalog.Get("Set class of field '{0}'",
                                  "Checkin description when setting the kind of field in WeSay Configuration Tool."),
                f.Key);
        }
예제 #29
0
        internal override int AddWidgets(PalasoDataObject wsdo, int insertAtRow)
        {
            LexExampleSentence example = (LexExampleSentence)wsdo;

            FirstRow = insertAtRow;

            DetailList.SuspendLayout();
            int rowCount = 0;

            try
            {
                Field field =
                    ActiveViewTemplate.GetField(Field.FieldNames.ExampleSentence.ToString());
                if (field != null && field.GetDoShow(example.Sentence, ShowNormallyHiddenFields))
                {
                    Control control = MakeBoundControl(example.Sentence, field);
                    DetailList.AddWidgetRow(
                        StringCatalog.Get("~Example",
                                          "This is the field containing an example sentence of a sense of a word."),
                        false,
                        control,
                        insertAtRow,
                        false);
                    ++rowCount;
                    insertAtRow = DetailList.GetRow(control);
                }

                field = ActiveViewTemplate.GetField(Field.FieldNames.ExampleTranslation.ToString());
                if (field != null && field.GetDoShow(example.Translation, ShowNormallyHiddenFields))
                {
                    Control entry = MakeBoundControl(example.Translation, field);
                    DetailList.AddWidgetRow(
                        StringCatalog.Get("~Translation",
                                          "This is the field for putting in a translation of an example sentence."),
                        false,
                        entry,
                        insertAtRow + rowCount,
                        false);
                    ++rowCount;
                }

                rowCount += AddCustomFields(example, insertAtRow + rowCount);
            }
            catch (ConfigurationException e)
            {
                ErrorReport.NotifyUserOfProblem(e.Message);
            }

            DetailList.ResumeLayout(false);
            LastRow = insertAtRow + rowCount - 1;               // want index of last row owned, not a limit value
            return(rowCount);
        }
예제 #30
0
 private void _languageCombo_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (_languageCombo.SelectedItem != null)
     {
         var lang = ((PoProxy)_languageCombo.SelectedItem).LanguageCode;
         if (UILanguage != lang)
         {
             UILanguage = lang;
             if (lang == string.Empty)
             {
                 lang = "default";
             }
             _logger.WriteConciseHistoricalEvent(StringCatalog.Get("Changed UI Language to {0}", "Checkin Description in WeSay Config Tool used when you change the User Interface language."), lang);
         }
     }
 }