Пример #1
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Adds the Notes Data Entry View
		/// </summary>
		/// ------------------------------------------------------------------------------------
		protected virtual void AddNotesView(string viewName, int wsUser)
		{
			m_dataEntryView = new NotesDataEntryView(Cache, m_app, viewName, this);
			m_dataEntryView.Zoom = m_zoomPercent;
			m_dataEntryView.StyleSheet = m_StyleSheet;
			m_dataEntryView.Dock = DockStyle.Fill;
			m_dataEntryView.FilterChanged += NoteFilterChanged;

			// Add this user view to the sidebar tab.
			SBTabItemProperties itemProps = new SBTabItemProperties(this);
			itemProps.Name = viewName;
			itemProps.Text = viewName;
			itemProps.ImageIndex = (int)TeResourceHelper.SideBarIndices.DataEntry;
			itemProps.Tag = m_dataEntryView;
			itemProps.Message = "SwitchActiveView";
			AddSideBarTabItem(kViewsSBTabInternalName, itemProps);

			ClientControls.Add(m_dataEntryView);
			// Bring the draftView to the top of the z-order, so that
			// (if it is the active view) it fills only the remaining space
			m_dataEntryView.BringToFront();
			m_rgClientViews.Add(m_dataEntryView.GetType().Name, m_dataEntryView);
		}
Пример #2
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Adds the Notes Data Entry View
		/// </summary>
		/// <param name="userView"></param>
		/// <param name="wsUser"></param>
		/// ------------------------------------------------------------------------------------
		protected virtual void AddNotesView(UserView userView, int wsUser)
		{
			if (userView.RecordsOC.Count == 0)
			{
				// Scripture is displayed by showing its BookAnnotations (which are ScrBookAnnotations).
				UserViewRec rec = new UserViewRec();
				userView.RecordsOC.Add(rec);
				rec.Clsid = Scripture.kClassId;

				UserViewField field = new UserViewField();
				rec.FieldsOS.Append(field);
				field.Flid = (int)Scripture.ScriptureTags.kflidBookAnnotations;

				// Each ScrBookAnnotations record is displayed by showing its Notes (which are ScrScriptureNotes).
				rec = new UserViewRec();
				userView.RecordsOC.Add(rec);
				rec.Clsid = ScrBookAnnotations.kClassId;

				field = new UserViewField();
				rec.FieldsOS.Append(field);
				field.Flid = (int)ScrBookAnnotations.ScrBookAnnotationsTags.kflidNotes;

				// Each ScrScriptureNote record is displayed by showing its status, references, categories, etc.
				rec = new UserViewRec();
				userView.RecordsOC.Add(rec);
				rec.Clsid = ScrScriptureNote.kClassId;

				field = new UserViewField();
				rec.FieldsOS.Append(field);
				field.Flid = (int)ScrScriptureNote.ScrScriptureNoteTags.kflidResolutionStatus;

				field = new UserViewField();
				rec.FieldsOS.Append(field);
				field.Flid = (int)CmBaseAnnotation.CmBaseAnnotationTags.kflidBeginRef;

				field = new UserViewField();
				rec.FieldsOS.Append(field);
				field.Flid = (int)CmBaseAnnotation.CmBaseAnnotationTags.kflidEndRef;

				field = new UserViewField();
				rec.FieldsOS.Append(field);
				field.Flid = (int)ScrScriptureNote.ScrScriptureNoteTags.kflidCategories;
				field.PossListRAHvo = m_scr.NoteCategoriesOAHvo;

				field = new UserViewField();
				rec.FieldsOS.Append(field);
				field.Flid = (int)ScrScriptureNote.ScrScriptureNoteTags.kflidRecommendation;

				field = new UserViewField();
				rec.FieldsOS.Append(field);
				field.Flid = (int)ScrScriptureNote.ScrScriptureNoteTags.kflidResolution;

				field = new UserViewField();
				rec.FieldsOS.Append(field);
				field.Flid = (int)ScrScriptureNote.ScrScriptureNoteTags.kflidDiscussion;

				field = new UserViewField();
				rec.FieldsOS.Append(field);
				field.Flid = (int)ScrScriptureNote.ScrScriptureNoteTags.kflidResponses;

				field = new UserViewField();
				rec.FieldsOS.Append(field);
				field.Flid = (int)ScrScriptureNote.ScrScriptureNoteTags.kflidQuote;

// TODO: There will be a date created and modified for each of the previous five fields.
// We need to determine how they will be differntiated.
				field = new UserViewField();
				rec.FieldsOS.Append(field);
				field.Flid = (int)StJournalText.StJournalTextTags.kflidDateCreated;

				field = new UserViewField();
				rec.FieldsOS.Append(field);
				field.Flid = (int)StJournalText.StJournalTextTags.kflidDateModified;

				field = new UserViewField();
				rec.FieldsOS.Append(field);
				field.Flid = (int)CmAnnotation.CmAnnotationTags.kflidSource;

				field = new UserViewField();
				rec.FieldsOS.Append(field);
				field.Flid = (int)CmAnnotation.CmAnnotationTags.kflidAnnotationType;
				field.PossListRAHvo = m_cache.LangProject.AnnotationDefsOAHvo;
			}

			m_dataEntryView = new NotesDataEntryView(m_cache, userView, this);
			m_dataEntryView.Zoom = m_zoomPercent;
			m_dataEntryView.StyleSheet = m_StyleSheet;
			m_dataEntryView.Dock = DockStyle.Fill;
			m_dataEntryView.FilterChanged += NoteFilterChanged;

			// Add this user view to the sidebar tab.
			SBTabItemProperties itemProps = new SBTabItemProperties(this);
			string name = string.IsNullOrEmpty(userView.ViewNameShort) ?
			TeResourceHelper.GetResourceString("kstidNotes") : userView.ViewNameShort;
			itemProps.Name = name;
			itemProps.Text = name;
			itemProps.ImageIndex = (int)TeResourceHelper.SideBarIndices.DataEntry;
			itemProps.Tag = m_dataEntryView;
			itemProps.Message = "SwitchActiveView";
			AddSideBarTabItem(kViewsSBTabInternalName, itemProps);

			ClientControls.Add(m_dataEntryView);
			// Bring the draftView to the top of the z-order, so that
			// (if it is the active view) it fills only the remaining space
			m_dataEntryView.BringToFront();
			ClientWindows.Add(m_dataEntryView.GetType().Name, m_dataEntryView);
		}