示例#1
0
        public string StoryBtHtml(ProjectSettings projectSettings, TeamMembersData membersData,
                                  StoryStageLogic stageLogic, TeamMemberData loggedOnMember, int nVerseIndex,
                                  ViewItemToInsureOn viewItemToInsureOn, int nNumCols)
        {
            string strRow = null;

            if (IsViewItemOn(viewItemToInsureOn, ViewItemToInsureOn.eVernacularLangField))
            {
                strRow += String.Format(Properties.Resources.HTML_TableCellWidthAlignTop, 100 / nNumCols,
                                        String.Format(Properties.Resources.HTML_Textarea,
                                                      TextareaId(nVerseIndex, StoryLineControl.CstrFieldNameVernacular),
                                                      StoryData.CstrLangVernacularStyleClassName,
                                                      VernacularText));
            }

            if (IsViewItemOn(viewItemToInsureOn, ViewItemToInsureOn.eNationalLangField))
            {
                strRow += String.Format(Properties.Resources.HTML_TableCellWidthAlignTop, 100 / nNumCols,
                                        String.Format(Properties.Resources.HTML_Textarea,
                                                      TextareaId(nVerseIndex, StoryLineControl.CstrFieldNameNationalBt),
                                                      StoryData.CstrLangNationalBtStyleClassName,
                                                      NationalBTText));
            }

            if (IsViewItemOn(viewItemToInsureOn, ViewItemToInsureOn.eEnglishBTField))
            {
                strRow += String.Format(Properties.Resources.HTML_TableCellWidthAlignTop, 100 / nNumCols,
                                        String.Format(Properties.Resources.HTML_Textarea,
                                                      TextareaId(nVerseIndex, StoryLineControl.CstrFieldNameInternationalBt),
                                                      StoryData.CstrLangInternationalBtStyleClassName,
                                                      InternationalBTText));
            }

            string strStoryLineRow = String.Format(Properties.Resources.HTML_TableRow,
                                                   strRow);

            if (IsViewItemOn(viewItemToInsureOn, ViewItemToInsureOn.eAnchorFields))
            {
                strStoryLineRow += Anchors.Html(nVerseIndex, nNumCols);
            }

            if (IsViewItemOn(viewItemToInsureOn, ViewItemToInsureOn.eRetellingFields) &&
                (Retellings.Count > 0))
            {
                strStoryLineRow += Retellings.Html(nVerseIndex, nNumCols);
            }

            if (IsViewItemOn(viewItemToInsureOn, ViewItemToInsureOn.eStoryTestingQuestionFields) &&
                (TestQuestions.Count > 0))
            {
                strStoryLineRow += TestQuestions.Html(projectSettings, viewItemToInsureOn,
                                                      stageLogic, loggedOnMember, nVerseIndex, nNumCols,
                                                      membersData.HasOutsideEnglishBTer);
            }

            return(strStoryLineRow);
        }
示例#2
0
        /// <summary>
        /// This version of the constructor should *always* be followed by a call to InitializeProjectSettings()
        /// </summary>
        public StoryProjectData()
        {
            TeamMembers         = new TeamMembersData();
            PanoramaFrontMatter = Properties.Resources.IDS_DefaultPanoramaFrontMatter;

            // start with to stories sets (the current one and the obsolete ones)
            Add(Properties.Resources.IDS_MainStoriesSet, new StoriesData(Properties.Resources.IDS_MainStoriesSet));
            Add(Properties.Resources.IDS_ObsoleteStoriesSet, new StoriesData(Properties.Resources.IDS_ObsoleteStoriesSet));
        }
示例#3
0
        public string VersesHtml(ProjectSettings projSettings, bool bViewHidden,
                                 TeamMembersData membersData, TeamMemberData loggedOnMember,
                                 VerseData.ViewItemToInsureOn viewItemToInsureOn)
        {
            string strHtml = Verses.StoryBtHtml(projSettings, bViewHidden, ProjStage,
                                                membersData, loggedOnMember, viewItemToInsureOn);

            return(String.Format(Properties.Resources.HTML_HeaderStoryBt,
                                 StylePrefix(projSettings),
                                 Properties.Resources.HTML_DOM_PrefixStoryBt,
                                 strHtml));
        }
示例#4
0
 static string MemberGuid(TeamMembersData members, string strName, TeamMemberData.UserTypes eType)
 {
     if (String.IsNullOrEmpty(strName))
     {
         return(strName);
     }
     if (!members.ContainsKey(strName))
     {
         members.Add(strName, new TeamMemberData(strName, eType, "mem-" + Guid.NewGuid(), null, null, null, null, null, null));
     }
     return(members[strName].MemberGuid);
 }
示例#5
0
        public string StoryBtHtml(ProjectSettings projectSettings, bool bViewHidden,
                                  StoryStageLogic stageLogic, TeamMembersData membersData, TeamMemberData loggedOnMember,
                                  VerseData.ViewItemToInsureOn viewItemToInsureOn)
        {
            int nColSpan = CalculateColumns(viewItemToInsureOn);

            // add a row indicating which languages are in what columns
            string strHtml = null;

            if (VerseData.IsViewItemOn(viewItemToInsureOn, VerseData.ViewItemToInsureOn.eVernacularLangField))
            {
                strHtml += String.Format(Properties.Resources.HTML_TableCell,
                                         projectSettings.Vernacular.LangName);
            }
            if (VerseData.IsViewItemOn(viewItemToInsureOn, VerseData.ViewItemToInsureOn.eNationalLangField))
            {
                strHtml += String.Format(Properties.Resources.HTML_TableCell,
                                         projectSettings.NationalBT.LangName);
            }
            if (VerseData.IsViewItemOn(viewItemToInsureOn, VerseData.ViewItemToInsureOn.eEnglishBTField))
            {
                strHtml += String.Format(Properties.Resources.HTML_TableCell,
                                         projectSettings.InternationalBT.LangName);
            }

            strHtml = String.Format(Properties.Resources.HTML_TableRow,
                                    strHtml);
            ;
            for (int i = 1; i <= Count; i++)
            {
                VerseData aVerseData = this[i - 1];
                if (aVerseData.IsVisible || bViewHidden)
                {
                    strHtml += GetHeaderRow("Ln: " + i, i, aVerseData.IsVisible, nColSpan);

                    strHtml += aVerseData.StoryBtHtml(projectSettings, membersData,
                                                      stageLogic, loggedOnMember, i, viewItemToInsureOn, nColSpan);
                }
            }

            return(String.Format(Properties.Resources.HTML_Table, strHtml));
        }
示例#6
0
        public StoryProjectData(NewDataSet projFile, ProjectSettings projSettings)
        {
            // this version comes with a project settings object
            ProjSettings = projSettings;

            // if the project file we opened doesn't have anything yet.. (shouldn't really happen)
            if (projFile.StoryProject.Count == 0)
            {
                projFile.StoryProject.AddStoryProjectRow(XmlDataVersion, ProjSettings.ProjectName, Properties.Resources.IDS_DefaultPanoramaFrontMatter);
            }
            else
            {
                projFile.StoryProject[0].ProjectName = ProjSettings.ProjectName;                 // in case the user changed it.
                if (projFile.StoryProject[0].version.CompareTo(XmlDataVersion) > 0)
                {
                    MessageBox.Show(Properties.Resources.IDS_GetNewVersion, Properties.Resources.IDS_Caption);
                    throw StoryEditor.BackOutWithNoUI;
                }
            }

            PanoramaFrontMatter = projFile.StoryProject[0].PanoramaFrontMatter;
            if (String.IsNullOrEmpty(PanoramaFrontMatter))
            {
                PanoramaFrontMatter = Properties.Resources.IDS_DefaultPanoramaFrontMatter;
            }

            if (projFile.stories.Count == 0)
            {
                projFile.stories.AddstoriesRow(Properties.Resources.IDS_MainStoriesSet, projFile.StoryProject[0]);
                projFile.stories.AddstoriesRow(Properties.Resources.IDS_ObsoleteStoriesSet, projFile.StoryProject[0]);
            }

            TeamMembers = new TeamMembersData(projFile);
            ProjSettings.SerializeProjectSettings(projFile);

            // finally, if it's not new, then it might (should) have stories as well
            foreach (NewDataSet.storiesRow aStoriesRow in projFile.StoryProject[0].GetstoriesRows())
            {
                Add(aStoriesRow.SetName, new StoriesData(aStoriesRow, projFile,
                                                         TeamMembers.HasIndependentConsultant));
            }
        }
示例#7
0
        public TeamMemberForm(TeamMembersData dataTeamMembers, string strOKLabel)
        {
            _dataTeamMembers = dataTeamMembers;
            InitializeComponent();

            foreach (TeamMemberData aMember in _dataTeamMembers.Values)
            {
                listBoxTeamMembers.Items.Add(aMember.Name);
                listBoxMemberRoles.Items.Add(TeamMemberData.GetMemberTypeAsDisplayString(aMember.MemberType));
            }

            if ((listBoxTeamMembers.Items.Count > 0) && !String.IsNullOrEmpty(Properties.Settings.Default.LastMemberLogin))
            {
                listBoxTeamMembers.SelectedItem = Properties.Settings.Default.LastMemberLogin;
            }

            /*
             * // initialize the keyboard combo list
             * foreach (KeyboardController.KeyboardDescriptor keyboard in
             *      KeyboardController.GetAvailableKeyboards(KeyboardController.Engines.All))
             * {
             *      comboBoxKeyboardVernacular.Items.Add(keyboard.Name);
             *      comboBoxKeyboardNationalBT.Items.Add(keyboard.Name);
             * }
             *
             * // initialize the vernacular language controls
             * if (_projSettings.Vernacular.HasData)
             * {
             *      textBoxVernacular.Text = ((String.IsNullOrEmpty(_projSettings.Vernacular.LangName)) ? _projSettings.ProjectName : _projSettings.Vernacular.LangName);
             *      textBoxVernacularEthCode.Text = _projSettings.Vernacular.LangCode;
             *
             *      // select the configured keyboard in the combo box (this is made complicated by the fact
             *      //  that members may have overridden the default keyboard for their own system)
             *      // First check if the logged in member (which is approximated by being the 'last member')
             *      //  has an override for the keyboard
             *      if ((_tmdLastMember != null)
             *              && !String.IsNullOrEmpty(_tmdLastMember.OverrideVernacularKeyboard)
             *              && comboBoxKeyboardVernacular.Items.Contains(_tmdLastMember.OverrideVernacularKeyboard))
             *      {
             *              comboBoxKeyboardVernacular.SelectedItem = _tmdLastMember.OverrideVernacularKeyboard;
             *      }
             *      else if (!String.IsNullOrEmpty(_projSettings.Vernacular.DefaultKeyboard)
             *              && comboBoxKeyboardVernacular.Items.Contains(_projSettings.Vernacular.DefaultKeyboard))
             *      {
             *              comboBoxKeyboardVernacular.SelectedItem = _projSettings.Vernacular.DefaultKeyboard;
             *      }
             *      checkBoxVernacularRTL.Checked = _projSettings.Vernacular.IsRTL;
             *      checkBoxVernacular.Checked = true;
             * }
             * else
             *      checkBoxVernacular.Checked = false;
             *
             * // even if there's no Vern, these should still be set (in case they check the box for Vern)
             * textBoxVernSentFullStop.Font = _projSettings.Vernacular.LangFont;
             * textBoxVernSentFullStop.ForeColor = _projSettings.Vernacular.FontColor;
             * textBoxVernSentFullStop.Text = _projSettings.Vernacular.FullStop;
             * toolTip.SetToolTip(buttonVernacularFont, String.Format(CstrDefaultFontTooltipVernacular,
             *                                                                                                         Environment.NewLine, _projSettings.Vernacular.LangFont,
             *                                                                                                         _projSettings.Vernacular.FontColor,
             *                                                                                                         _projSettings.Vernacular.IsRTL));
             *
             * // if there is a national language configured, then initialize those as well.
             * if (_projSettings.NationalBT.HasData)
             * {
             *      textBoxNationalBTLanguage.Text = _projSettings.NationalBT.LangName;
             *      textBoxNationalBTEthCode.Text = _projSettings.NationalBT.LangCode;
             *
             *      // select the configured keyboard in the combo box (this is made complicated by the fact
             *      //  that members may have overridden the default keyboard for their own system)
             *      // First check if the logged in member (which is approximated by being the 'last member')
             *      //  has an override for the keyboard
             *      if ((_tmdLastMember != null)
             *              && !String.IsNullOrEmpty(_tmdLastMember.OverrideNationalBTKeyboard)
             *              && comboBoxKeyboardNationalBT.Items.Contains(_tmdLastMember.OverrideNationalBTKeyboard))
             *      {
             *              comboBoxKeyboardNationalBT.SelectedItem = _tmdLastMember.OverrideNationalBTKeyboard;
             *      }
             *      else if (!String.IsNullOrEmpty(_projSettings.NationalBT.DefaultKeyboard)
             *              && comboBoxKeyboardNationalBT.Items.Contains(_projSettings.NationalBT.DefaultKeyboard))
             *      {
             *              comboBoxKeyboardNationalBT.SelectedItem = _projSettings.NationalBT.DefaultKeyboard;
             *      }
             *
             *      checkBoxNationalRTL.Checked = _projSettings.NationalBT.IsRTL;
             *      checkBoxNationalLangBT.Checked = true;
             * }
             * else
             *      checkBoxNationalLangBT.Checked = false;
             *
             * // even if there's no National language BT, these should still be set (in case they check the box for National language BT)
             * textBoxNationalBTSentFullStop.Font = _projSettings.NationalBT.LangFont;
             * textBoxNationalBTSentFullStop.ForeColor = _projSettings.NationalBT.FontColor;
             * textBoxNationalBTSentFullStop.Text = _projSettings.NationalBT.FullStop;
             * toolTip.SetToolTip(buttonNationalBTFont, String.Format(CstrDefaultFontTooltipNationalBT,
             *                                                                                                         Environment.NewLine, _projSettings.NationalBT.LangFont,
             *                                                                                                         _projSettings.NationalBT.FontColor,
             *                                                                                                         _projSettings.NationalBT.IsRTL));
             *
             * // even if there's no English BT, these should still be set (in case they check the box for English BT)
             * toolTip.SetToolTip(buttonInternationalBTFont, String.Format(CstrDefaultFontTooltipInternationalBT,
             *                                                                                                         Environment.NewLine, _projSettings.InternationalBT.LangFont,
             *                                                                                                         _projSettings.InternationalBT.FontColor,
             *                                                                                                         _projSettings.InternationalBT.IsRTL));
             *
             *
             * textBoxProjectName.Text = _projSettings.ProjectName;
             */
            if (!String.IsNullOrEmpty(strOKLabel))
            {
                buttonOK.Text = strOKLabel;
            }

            /*
             * // if the user hasn't configured the language information, send them there first
             * if (!_projSettings.IsConfigured)
             *      tabControlProjectMetaData.SelectedTab = tabPageLanguageInfo;
             *
             * if (_projSettings.Vernacular.HasData && !String.IsNullOrEmpty(textBoxVernacular.Text) && String.IsNullOrEmpty(textBoxVernacularEthCode.Text))
             *      ProposeEthnologueCode(textBoxVernacular.Text, textBoxVernacularEthCode);
             */
        }