/// <summary>
        /// This method is called during deserialization to convert a given value to a specific typed value (Html).
        /// </summary>
        /// <param name="serializationContext">The current serialization context instance.</param>
        /// <param name="modelELement">ModdelElement, to which the property belongs to.</param>
        /// <param name="propertyName">The Property name, which value is to be converted.</param>
        /// <param name="value">Value to convert.</param>
        /// <param name="targetType">Type, the object is to be converted to.</param>
        /// <param name="isRequired">True if this property is marked as required in the domain model. Can be null.</param>
        /// <returns>Converted value.</returns>
        public static Tum.PDE.ToolFramework.Modeling.Visualization.VMXExtensions.Html.Html ConvertTypedObjectHtmlFrom(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement modelELement, string propertyName, object value, System.Type targetType, bool? isRequired)
        {
            if (value == null)
                return null;

            string strValue = value.ToString();
            if (!String.IsNullOrEmpty(strValue) && modelELement is DslEditorModeling::IDomainModelOwnable)
            {
                DslEditorModeling::IParentModelElement parent;
                if (modelELement is DslEditorModeling::IParentModelElement)
                    parent = modelELement as DslEditorModeling::IParentModelElement;
                else
                    parent = (modelELement as DslEditorModeling::IDomainModelOwnable).GetDomainModelServices().ElementParentProvider.GetParentModelElement(modelELement);
                if (parent != null)
                {
                    string filePath = parent.DomainFilePath;
                    string directory = new System.IO.FileInfo(filePath).DirectoryName;

                    Tum.PDE.ToolFramework.Modeling.Visualization.VMXExtensions.Html.Html html = new Tum.PDE.ToolFramework.Modeling.Visualization.VMXExtensions.Html.Html(strValue, directory);
                    return html;
                }
                else
                {
                    serializationContext.Result.AddMessage(new DslModeling::SerializationMessage(DslModeling::SerializationMessageKind.Error,
                        "Could not resolve domain directory path.", modelELement.ToString(), 0, 0, null));
                }

            }
            else
                return null;

            return null;
        }
        private global::System.IO.MemoryStream InternalSaveDiagram2(DslModeling::SerializationResult serializationResult, PatternModelSchemaDiagram diagram, string diagramFileName, global::System.Text.Encoding encoding, bool writeOptionalPropertiesWithDefaultValue)
        {
            #region Check Parameters
            global::System.Diagnostics.Debug.Assert(serializationResult != null);
            global::System.Diagnostics.Debug.Assert(diagram != null);
            global::System.Diagnostics.Debug.Assert(!serializationResult.Failed);
            #endregion

            DslModeling::DomainXmlSerializerDirectory directory = this.GetDirectory(diagram.Store);


            global::System.IO.MemoryStream newFileContent = new global::System.IO.MemoryStream();

            DslModeling::SerializationContext serializationContext = new DslModeling::SerializationContext(directory, diagramFileName, serializationResult);
            this.InitializeSerializationContext(diagram.Partition, serializationContext, false);
            // MonikerResolver shouldn't be required in Save operation, so not calling SetupMonikerResolver() here.
            serializationContext.WriteOptionalPropertiesWithDefaultValue = writeOptionalPropertiesWithDefaultValue;
            global::System.Xml.XmlWriterSettings settings = PatternModelSerializationHelper.Instance.CreateXmlWriterSettings(serializationContext, true, encoding);
            using (global::System.Xml.XmlWriter writer = global::System.Xml.XmlWriter.Create(newFileContent, settings))
            {
                this.WriteRootElement(serializationContext, diagram, writer);
            }

            return newFileContent;
        }
		public static bool CanAcceptSourceAndTarget(DslModeling::ModelElement candidateSource, DslModeling::ModelElement candidateTarget)
		{
			// Accepts null, null; source, null; source, target but NOT null, target
			if (candidateSource == null)
			{
				if (candidateTarget != null)
				{
					throw new global::System.ArgumentNullException("candidateSource");
				}
				else // Both null
				{
					return false;
				}
			}
			bool acceptSource = CanAcceptSource(candidateSource);
			// If the source wasn't accepted then there's no point checking targets.
			// If there is no target then the source controls the accept.
			if (!acceptSource || candidateTarget == null)
			{
				return acceptSource;
			}
			else // Check combinations
			{
				if (candidateSource is global::nHydrate2.Dsl.Entity)
				{
					if (candidateTarget is global::nHydrate2.Dsl.Entity)
					{
						return true;
					}
				}
				
			}
			return false;
		}
Exemplo n.º 4
0
		public static bool CanAcceptTarget(DslModeling::ModelElement candidate)
		{
			if(candidate == null) return false;
			else if(candidate is global::Microsoft.Practices.ServiceFactory.ServiceContracts.Service)
			{
				return true;
			}
			else if(candidate is global::Microsoft.Practices.ServiceFactory.ServiceContracts.Operation)
			{
				return true;
			}
			else if(candidate is global::Microsoft.Practices.ServiceFactory.ServiceContracts.ServiceContract)
			{
				return true;
			}
			else if(candidate is global::Microsoft.Practices.ServiceFactory.ServiceContracts.MessageBase)
			{
				return true;
			}
			else if(candidate is global::Microsoft.Practices.ServiceFactory.ServiceContracts.Operation)
			{
				return true;
			}
			else
				return false;
		}
		private void NamePropertyChanged(DslModeling::ElementPropertyChangedEventArgs args)
		{
			if( args.NewValue != null )
				this.ElementFullName = args.NewValue.ToString() + " (Domain Element)";
			else
				this.ElementFullName = "Domain Element";
		}
Exemplo n.º 6
0
		public static bool CanAcceptTarget(DslModeling::ModelElement candidate)
		{
			if (candidate == null) return false;
			else if (candidate is global::Architect.WorkflowRule)
			{ 
				return true;
			}
			else if (candidate is global::Architect.Activity)
			{ 
				// Add a custom method to your code with the following signature:
				// private static bool CanAcceptActivityAsTarget(Activity candidate)
				// {
				// }
				return CanAcceptActivityAsTarget((global::Architect.Activity)candidate);
			}
			else if (candidate is global::Architect.Activity)
			{ 
				// Add a custom method to your code with the following signature:
				// private static bool CanAcceptActivityAsTarget(Activity candidate)
				// {
				// }
				return CanAcceptActivityAsTarget((global::Architect.Activity)candidate);
			}
			else
				return false;
		}
Exemplo n.º 7
0
		public static bool CanAcceptTarget(DslModeling::ModelElement candidate)
		{
			if (candidate == null) return false;
			else if (candidate is global::NuPattern.Authoring.WorkflowDesign.ProducedAsset)
			{ 
				return true;
			}
			else if (candidate is global::NuPattern.Authoring.WorkflowDesign.ProducedAsset)
			{ 
				return true;
			}
			else if (candidate is global::NuPattern.Authoring.WorkflowDesign.ProductionTool)
			{ 
				return true;
			}
			else if (candidate is global::NuPattern.Authoring.WorkflowDesign.VariabilityRequirement)
			{ 
				return true;
			}
			else if (candidate is global::NuPattern.Authoring.WorkflowDesign.ProductionTool)
			{ 
				return true;
			}
			else
				return false;
		}
		private void NamePropertyChanged(DslModeling::ElementPropertyChangedEventArgs args)
		{
			if( args.NewValue != null )
				this.ElementFullName = args.NewValue.ToString() + " (V-Modellvariante)";
			else
				this.ElementFullName = "V-Modellvariante";
		}
		private void NamePropertyChanged(DslModeling::ElementPropertyChangedEventArgs args)
		{
			if( args.NewValue != null )
				this.ElementFullName = args.NewValue.ToString() + " (Family Tree Person)";
			else
				this.ElementFullName = "Family Tree Person";
		}
		/// <summary>
		/// This method creates an instance of DesignerDiagram based on the tag currently pointed by the reader. The reader is guaranteed (by the caller)
		/// to be pointed at a serialized instance of DesignerDiagram.
		/// </summary>
		/// <remarks>
		/// The caller will guarantee that the reader is positioned at open XML tag of the ModelRoot instance being read. This method should
		/// not move the reader; the reader should remain at the same position when this method returns.
		/// </remarks>
		/// <param name="serializationContext">Serialization context.</param>
		/// <param name="reader">XmlReader to read serialized data from.</param>
		/// <param name="partition">Partition in which new DesignerDiagram instance should be created.</param>	
		/// <returns>Created DesignerDiagram instance.</returns>
		protected override DslModeling::ModelElement CreateInstance(DslModeling::SerializationContext serializationContext, global::System.Xml.XmlReader reader, DslModeling::Partition partition)
		{
			string idStr = reader.GetAttribute ("Id");
			try
			{
				global::System.Guid id;
				if (string.IsNullOrEmpty(idStr))
				{	// Create a default Id.
					id = global::System.Guid.NewGuid();
					FamilyTreeDSLSerializationBehaviorSerializationMessages.MissingId(serializationContext, reader, id);
				}
				else
				{
					id = new global::System.Guid (idStr);
				}
				return new DesignerDiagram(partition, new DslModeling::PropertyAssignment(DslModeling::ElementFactory.IdPropertyAssignment, id));
			}
		catch (global::System.ArgumentNullException /* anEx */)
		{	
			FamilyTreeDSLSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, "Id", typeof(global::System.Guid), idStr);
		}
		catch (global::System.FormatException /* fEx */)
		{
			FamilyTreeDSLSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, "Id", typeof(global::System.Guid), idStr);
		}
		catch (global::System.OverflowException /* ofEx */)
		{
			FamilyTreeDSLSerializationBehaviorSerializationMessages.InvalidPropertyValue(serializationContext, reader, "Id", typeof(global::System.Guid), idStr);
		}
			return null;
		}		
Exemplo n.º 11
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="partition">Partition where new element is to be created.</param>
 /// <param name="propertyAssignments">List of domain property id/value pairs to set once the element is created.</param>
 public EntityShape(DslModeling::Partition partition, params DslModeling::PropertyAssignment[] propertyAssignments)
     : base(partition, propertyAssignments)
 {
     //cache.FillColor = this.FillColor;
     //cache.TextColor = this.TextColor;
     //cache.OutlineColor = this.OutlineColor;
     //cache.OutlineDashStyle = this.OutlineDashStyle;
 }
		/// <summary>
		/// Called whenever properties change.
		/// </summary>
		/// <param name="args"></param>
		protected virtual void OnElementPropertyChanged(DslModeling::ElementPropertyChangedEventArgs args)
		{
			if( this.IsDisposed )
				return;
		
			if( args.DomainProperty.Id == global::Tum.StateMachineDSL.Transition.ConditionDomainPropertyId )
				OnPropertyChanged("Element_Condition");
		}
        /// <summary>
        /// Adds a new key to the ID list. 
        /// </summary>
        /// <param name="modelElement">Domain model element to add the Id for.</param>
        public virtual void AddKey(DslModeling::ModelElement modelElement)
        {
        	//if( HasKey(modelElement.Id ))
            //    throw new System.ArgumentException("Duplicate ID: modelElementId already in IDList for " + modelElement.ToString());
			
			if( modelElement is DslEditorModeling::IDableElement )            
            	IDList.Add(modelElement.Id);
        }
		/// <summary>
		/// Loads a MetaModel instance into the default partition of the given store.
		/// </summary>
		/// <param name="serializationResult">Stores serialization result from the load operation.</param>
		/// <param name="store">The new MetaModel instance will be created into the default partition of this store.</param>
		/// <param name="fileName">Name of the file from which the MetaModel instance will be deserialized.</param>
		/// <param name="schemaResolver">
		/// An ISchemaResolver that allows the serializer to do schema validation on the root element (and everything inside it).
		/// If null is passed, schema validation will not be performed.
		/// </param>
		/// <param name="validationController">
		/// A ValidationController that will be used to do load-time validation (validations with validation category "Load"). If null
		/// is passed, load-time validation will not be performed.
		/// </param>
		/// <param name="serializerLocator">
		/// An ISerializerLocator that will be used to locate any additional domain model types required to load the model. Can be null.
		/// </param>
		/// <returns>The loaded MetaModel instance.</returns>
		public virtual global::Tum.FamilyTreeDSL.FamilyTreeModel LoadModel(DslModeling::SerializationResult serializationResult, DslModeling::Store store, string fileName, DslModeling::ISchemaResolver schemaResolver, DslValidation::ValidationController validationController, DslModeling::ISerializerLocator serializerLocator)
		{
			#region Check Parameters
			if (store == null) 
				throw new global::System.ArgumentNullException("store");
			#endregion
			
			return this.LoadModelFamilyTreeModel(serializationResult, store.DefaultPartition, fileName, schemaResolver, validationController, serializerLocator);
		}
Exemplo n.º 15
0
		public static bool CanAcceptTarget(DslModeling::ModelElement candidate)
		{
			if (candidate == null) return false;
			else if (candidate is global::FourDeep.Dizzle.DomainCommand)
			{ 
				return true;
			}
			else
				return false;
		}
Exemplo n.º 16
0
		public static bool CanAcceptSource(DslModeling::ModelElement candidate)
		{
			if (candidate == null) return false;
			else if (candidate is global::FourDeep.Dizzle.AggregateRoot)
			{ 
				return true;
			}
			else
				return false;
		}
Exemplo n.º 17
0
		public static bool CanAcceptTarget(DslModeling::ModelElement candidate)
		{
			if (candidate == null) return false;
			else if (candidate is global::Microsoft.Practices.ServiceFactory.HostDesigner.Endpoint)
			{ 
				return true;
			}
			else
				return false;
		}
Exemplo n.º 18
0
		public static bool CanAcceptSource(DslModeling::ModelElement candidate)
		{
			if (candidate == null) return false;
			else if (candidate is global::Evaluant.Uss.SqlMapper.Mapping.SqlMapperMappingDiagram)
			{ 
				return true;
			}
			else
				return false;
		}
		public static bool CanAcceptTarget(DslModeling::ModelElement candidate)
		{
			if (candidate == null) return false;
			else if (candidate is global::DmitriNesteruk.AsyncDsl.Comment)
			{ 
				return true;
			}
			else
				return false;
		}
Exemplo n.º 20
0
		public static bool CanAcceptSource(DslModeling::ModelElement candidate)
		{
			if (candidate == null) return false;
			else if (candidate is global::Microsoft.Practices.ServiceFactory.DataContracts.DataContractBase)
			{ 
				return true;
			}
			else
				return false;
		}
Exemplo n.º 21
0
		public static bool CanAcceptTarget(DslModeling::ModelElement candidate)
		{
			if (candidate == null) return false;
			else if (candidate is global::Navigation.Designer.State)
			{ 
				return true;
			}
			else
				return false;
		}
Exemplo n.º 22
0
		public static bool CanAcceptTarget(DslModeling::ModelElement candidate)
		{
			if (candidate == null) return false;
			else if (candidate is global::Com.Lotos.BinbinDomainLanguage.ValueObjectModel)
			{ 
				return true;
			}
			else
				return false;
		}
Exemplo n.º 23
0
		public static bool CanAcceptTarget(DslModeling::ModelElement candidate)
		{
			if (candidate == null) return false;
			else if (candidate is global::Evaluant.Uss.SqlMapper.Mapping.EntityShape)
			{ 
				return true;
			}
			else
				return false;
		}
Exemplo n.º 24
0
		public static bool CanAcceptTarget(DslModeling::ModelElement candidate)
		{
			if (candidate == null) return false;
			else if (candidate is global::LinqToRdf.Design.ModelClass)
			{ 
				return true;
			}
			else
				return false;
		}
		public static bool CanAcceptTarget(DslModeling::ModelElement candidate)
		{
			if (candidate == null) return false;
			else if (candidate is global::Tum.PDE.LanguageDSL.DomainRole)
			{ 
				return true;
			}
			else
				return false;
		}
Exemplo n.º 26
0
		public static bool CanAcceptTarget(DslModeling::ModelElement candidate)
		{
			if (candidate == null) return false;
			else if (candidate is global::Altinoren.ActiveWriter.ModelClass)
			{ 
				return true;
			}
			else
				return false;
		}
		public static bool CanAcceptTarget(DslModeling::ModelElement candidate)
		{
			if (candidate == null) return false;
			else if (candidate is global::nHydrate2.Dsl.Entity)
			{ 
				return true;
			}
			else
				return false;
		}
		public static bool CanAcceptSource(DslModeling::ModelElement candidate)
		{
			if (candidate == null) return false;
			else if (candidate is global::DmitriNesteruk.AsyncDsl.Operation)
			{ 
				return true;
			}
			else
				return false;
		}
Exemplo n.º 29
0
		public static bool CanAcceptSource(DslModeling::ModelElement candidate)
		{
			if (candidate == null) return false;
			else if (candidate is global::Com.Lotos.BinbinDomainLanguage.EntityModel)
			{ 
				return true;
			}
			else
				return false;
		}
Exemplo n.º 30
0
		public static bool CanAcceptSource(DslModeling::ModelElement candidate)
		{
			if (candidate == null) return false;
			else if (candidate is global::Castle.ActiveWriter.ModelClass)
			{ 
				return true;
			}
			else
				return false;
		}