コード例 #1
0
ファイル: Verbalization.cs プロジェクト: ozialien/NORMA
 /// <summary>
 /// Implements <see cref="IVerbalize.GetVerbalization"/>
 /// </summary>
 protected bool GetVerbalization(TextWriter writer, IDictionary <Type, IVerbalizationSets> snippetsDictionary, IVerbalizationContext verbalizationContext, VerbalizationSign sign)
 {
     ORMCore.UniquenessConstraint constraint = UniquenessIsForUniquenessConstraint.GetUniquenessConstraint(this.Uniqueness);
     if (constraint != null)
     {
         verbalizationContext.DeferVerbalization(constraint, DeferVerbalizationOptions.None, null);
     }
     return(false);
 }
コード例 #2
0
ファイル: Verbalization.cs プロジェクト: cjheath/NORMA
		/// <summary>
		/// Implements <see cref="IVerbalize.GetVerbalization"/>
		/// </summary>
		protected bool GetVerbalization(TextWriter writer, IDictionary<Type, IVerbalizationSets> snippetsDictionary, IVerbalizationContext verbalizationContext, VerbalizationSign sign)
		{
			// We are redirected to this point by the associated Table element
			ConceptType conceptType = this.ConceptType;
			ObjectType objectType;
			if (null != (objectType = ConceptTypeIsForObjectType.GetObjectType(conceptType)))
			{
				verbalizationContext.DeferVerbalization(objectType, DeferVerbalizationOptions.None, null);
				foreach (ConceptType alsoForConceptType in TableIsAlsoForConceptType.GetConceptType(this.Table))
				{
					if (null != (objectType = ConceptTypeIsForObjectType.GetObjectType(alsoForConceptType)))
					{
						writer.WriteLine();
						verbalizationContext.DeferVerbalization(objectType, DeferVerbalizationOptions.None, null);
					}
				}
			}
			return false;
		}
コード例 #3
0
ファイル: Verbalization.cs プロジェクト: ozialien/NORMA
        /// <summary>
        /// Implements <see cref="IVerbalize.GetVerbalization"/>
        /// </summary>
        protected bool GetVerbalization(TextWriter writer, IDictionary <Type, IVerbalizationSets> snippetsDictionary, IVerbalizationContext verbalizationContext, VerbalizationSign sign)
        {
            // We are redirected to this point by the associated Table element
            ConceptType conceptType = this.ConceptType;
            ObjectType  objectType;

            if (null != (objectType = ConceptTypeIsForObjectType.GetObjectType(conceptType)))
            {
                verbalizationContext.DeferVerbalization(objectType, DeferVerbalizationOptions.None, null);
                foreach (ConceptType alsoForConceptType in TableIsAlsoForConceptType.GetConceptType(this.Table))
                {
                    if (null != (objectType = ConceptTypeIsForObjectType.GetObjectType(alsoForConceptType)))
                    {
                        writer.WriteLine();
                        verbalizationContext.DeferVerbalization(objectType, DeferVerbalizationOptions.None, null);
                    }
                }
            }
            return(false);
        }
コード例 #4
0
ファイル: Verbalization.cs プロジェクト: cjheath/NORMA
		/// <summary>
		/// Implements <see cref="IVerbalize.GetVerbalization"/>
		/// </summary>
		protected bool GetVerbalization(TextWriter writer, IDictionary<Type, IVerbalizationSets> snippetsDictionary, IVerbalizationContext verbalizationContext, VerbalizationSign sign)
		{
			// We are redirected to this point by the associated Column element
			Column column = this.Column;
			bool firstWrite = true;
			foreach (ConceptTypeChild child in ColumnHasConceptTypeChild.GetConceptTypeChildPath(this.Column))
			{
				foreach (FactType factType in ConceptTypeChildHasPathFactType.GetPathFactTypeCollection(child))
				{
					if (firstWrite)
					{
						firstWrite = false;
					}
					else
					{
						writer.WriteLine();
					}
					verbalizationContext.DeferVerbalization(factType, DeferVerbalizationOptions.MultipleVerbalizations, null);
				}
			}
			return false;
		}
コード例 #5
0
ファイル: Verbalization.cs プロジェクト: ozialien/NORMA
        /// <summary>
        /// Implements <see cref="IVerbalize.GetVerbalization"/>
        /// </summary>
        protected bool GetVerbalization(TextWriter writer, IDictionary <Type, IVerbalizationSets> snippetsDictionary, IVerbalizationContext verbalizationContext, VerbalizationSign sign)
        {
            // We are redirected to this point by the associated Column element
            Column column     = this.Column;
            bool   firstWrite = true;

            foreach (ConceptTypeChild child in ColumnHasConceptTypeChild.GetConceptTypeChildPath(this.Column))
            {
                foreach (FactType factType in ConceptTypeChildHasPathFactType.GetPathFactTypeCollection(child))
                {
                    if (firstWrite)
                    {
                        firstWrite = false;
                    }
                    else
                    {
                        writer.WriteLine();
                    }
                    verbalizationContext.DeferVerbalization(factType, DeferVerbalizationOptions.MultipleVerbalizations, null);
                }
            }
            return(false);
        }
コード例 #6
0
ファイル: Verbalization.cs プロジェクト: cjheath/NORMA
		/// <summary>
		/// Implements <see cref="IVerbalize.GetVerbalization"/>
		/// </summary>
		protected bool GetVerbalization(TextWriter writer, IDictionary<Type, IVerbalizationSets> snippetsDictionary, IVerbalizationContext verbalizationContext, VerbalizationSign sign)
		{
			ORMCore.UniquenessConstraint constraint = UniquenessIsForUniquenessConstraint.GetUniquenessConstraint(this.Uniqueness);
			if (constraint != null)
			{
				verbalizationContext.DeferVerbalization(constraint, DeferVerbalizationOptions.None, null);
			}
			return false;
		}
コード例 #7
0
ファイル: VerbalizationReport.cs プロジェクト: cjheath/NORMA
			/// <summary>
			/// Implements <see cref="IVerbalize.GetVerbalization"/>
			/// </summary>
			protected bool GetVerbalization(TextWriter writer, IDictionary<Type, IVerbalizationSets> snippetsDictionary, IVerbalizationContext verbalizationContext, VerbalizationSign sign)
			{
				verbalizationContext.BeginVerbalization(VerbalizationContent.Normal);
				IVerbalizationSets<ReportVerbalizationSnippetType> snippets = (IVerbalizationSets<ReportVerbalizationSnippetType>)snippetsDictionary[typeof(ReportVerbalizationSnippetType)];
				writer.Write(string.Format(writer.FormatProvider, snippets.GetSnippet(ReportVerbalizationSnippetType.ObjectTypePageHeader), (myVerbalizationObject as ObjectType).Name));
				writer.Write(snippets.GetSnippet(ReportVerbalizationSnippetType.GenericSummaryOpen));
				verbalizationContext.DeferVerbalization(myVerbalizationObject, DeferVerbalizationOptions.AlwaysWriteLine, myFilterChildren);
				// This must be called before additional calls to the writer or an increased indentation will not decrease before
				// the close element is written.
				verbalizationContext.BeginVerbalization(VerbalizationContent.Normal);
				writer.Write(snippets.GetSnippet(ReportVerbalizationSnippetType.GenericSummaryClose));
				return true;
			}
コード例 #8
0
ファイル: VerbalizationReport.cs プロジェクト: cjheath/NORMA
			/// <summary>
			/// Implements <see cref="IVerbalize.GetVerbalization"/>
			/// </summary>
			protected bool GetVerbalization(TextWriter writer, IDictionary<Type, IVerbalizationSets> snippetsDictionary, IVerbalizationContext verbalizationContext, VerbalizationSign sign)
			{
				ORMModel model = myModel;
				if (model != null)
				{
					verbalizationContext.BeginVerbalization(VerbalizationContent.Normal);
					IVerbalizationSets<ReportVerbalizationSnippetType> snippets = (IVerbalizationSets<ReportVerbalizationSnippetType>)snippetsDictionary[typeof(ReportVerbalizationSnippetType)];
					writer.Write(string.Format(writer.FormatProvider, snippets.GetSnippet(myOpenSnippet), model.Name));
					verbalizationContext.DeferVerbalization(model, DeferVerbalizationOptions.AlwaysWriteLine, null);
					verbalizationContext.BeginVerbalization(VerbalizationContent.Normal);
					writer.Write(snippets.GetSnippet(myCloseSnippet));
				}
				return false; // No children to verbalize
			}
コード例 #9
0
ファイル: VerbalizationReport.cs プロジェクト: cjheath/NORMA
			/// <summary>
			/// Implements <see cref="IVerbalize.GetVerbalization"/>
			/// </summary>
			protected bool GetVerbalization(TextWriter writer, IDictionary<Type, IVerbalizationSets> snippetsDictionary, IVerbalizationContext verbalizationContext, VerbalizationSign sign)
			{
				object verbalizationObject = this.myVerbalizationObject;
				if (verbalizationObject == null || verbalizationContext.AlreadyVerbalized(verbalizationObject))
				{
					return false;
				}
				verbalizationContext.BeginVerbalization(VerbalizationContent.Normal);
				IVerbalizationSets<ReportVerbalizationSnippetType> snippets = (IVerbalizationSets<ReportVerbalizationSnippetType>)snippetsDictionary[typeof(ReportVerbalizationSnippetType)];
				writer.Write(snippets.GetSnippet(myOpeningSnippet), TypeDescriptor.GetComponentName(verbalizationObject), TypeDescriptor.GetClassName(verbalizationObject));
				verbalizationContext.DeferVerbalization(verbalizationObject, DeferVerbalizationOptions.AlwaysWriteLine, null);
				// This must be called before additional calls to the writer or an increased indentation will not decrease before
				// the close element is written.
				verbalizationContext.BeginVerbalization(VerbalizationContent.Normal);
				writer.Write(snippets.GetSnippet(myClosingSnippet));
				return true;
			}