public RunInformationMessage(InformationType type, string project, string assembly, Type runner) { Type = type; Project = project; Assembly = assembly; Runner = runner; }
public SearchNode(TreeNode TreeNode, string Title, InformationType Type, object Data, ClearbytesModule ParentModule) { this.TreeNode = TreeNode; this.Title = Title; this.Type = Type; this.Data = Data; this.ParentModule = ParentModule; }
public void SetDataFrom (BinaryReader reader) { _type = (InformationType) reader.ReadInt32(); _project = reader.ReadString(); _assembly = reader.ReadString(); _timeSpent = new TimeSpan((long) reader.ReadDouble()); _succeeded = reader.ReadBoolean(); }
private void setProperties(InformationType type, string project, string assembly, TimeSpan timeSpent, bool succeeded) { _type = type; _project = project; _assembly = assembly; _timeSpent = timeSpent; _succeeded = succeeded; }
public PageInformation(int margin, Font font, PageInformationBorder border, InformationType left, InformationType center, InformationType right) { _margin = margin; _font = font; _border = border; _left = left; _center = center; _right = right; }
/// <summary> /// Full Constructor /// </summary> /// <param name="iMargin">Margin to use</param> /// <param name="oFont">Font to use </param> /// <param name="eBorder">Border style</param> /// <param name="eLeft">What to print on the left side of the page</param> /// <param name="eCenter">What to print in the center of the page</param> /// <param name="eRight">What to print on the right side of the page</param> public PageInformation(int iMargin, Font oFont, PageInformationBorder eBorder, InformationType eLeft, InformationType eCenter, InformationType eRight) { this._iMargin = iMargin; this._oFont = oFont; this._eBorder = eBorder; this._eLeft = eLeft; this._eCenter = eCenter; this._eRight = eRight; }
public PartyInformationBubble(long time, BubbleDirection direction, string address, string participantAddress, bool party, Service service, string idService, InformationType type, string influencer, string affected) : base(time, direction, address, participantAddress, party, service, null, idService) { Influencer = influencer; Affected = affected; Type = type; }
private static bool RequireQuantifier(InformationType informationType) { switch (informationType) { case InformationType.Date: case InformationType.Time2: case InformationType.Time3: return(false); default: return(true); } }
// CONSTRUCTOR public DualChannelStationBasic() : base() { _defaultType = InformationType.UndefinedInformation; _ClassicStation = ClassicChannelFactory.generateStation(); _ClassicStation.OnTransmit += new EventHandlerStationData(PropagateOnTransmit); _ClassicStation.OnReceive += new EventHandlerStationData(PropagateOnReceive); _quantumStation = QuantumChannelFactory.generateStation(); _quantumStation.OnTransmit += new EventHandlerStationData(PropagateOnTransmit); _quantumStation.OnReceive += new EventHandlerStationData(PropagateOnReceive); }
private void CreateInformationFile(string FileName, InformationType Information) { var FileContents = string.Empty; var FilePathAndName = mSDCard.GetWorkingDirectoryPath() + FileName; Debug.Print("Creating " + mSDCard.GetWorkingDirectoryPath() + FileName + "..."); switch (Information) { case InformationType.LabelFormat: FileContents = Label.DefaultLabel; LabelFormat = Label.DefaultLabel; break; case InformationType.JobNumber: FileContents = "B000000123-000"; JobNumber = FileContents; break; case InformationType.OperationNumber: FileContents = "10"; Operation = FileContents; break; case InformationType.ShopTrakTransactionsURL: FileContents = "http://dataservice.wiretechfab.com:6156/SytelineDataService/ShopTrak/LCLTTransaction/Job=~p0&Suffix=~p1&Operation=~p2"; ShopTrakTransactionsURL = FileContents; break; case InformationType.PieceWeight: var dblPieceWeight = 0.0000001; PieceWeight = dblPieceWeight; FileContents = dblPieceWeight.ToString(); break; case InformationType.NetWeightAdjustment: var dblNetWeightAdjustment = 0.0; NetWeightAdjustment = dblNetWeightAdjustment; FileContents = dblNetWeightAdjustment.ToString(); break; case InformationType.ColorName: var enumBacklightColor = BacklightColor.White; BacklightColor = enumBacklightColor; FileContents = enumBacklightColor.ToString(); break; } mSDCard.WriteLine(mSDCard.GetWorkingDirectoryPath(), FileName, FileMode.Create, FileContents); Debug.Print("Wrote contents: \r\n" + FileContents + "\r\nTo File: " + FilePathAndName); Debug.Print("Finished Write..."); }
private static void UpdateTablesOnDataTypeChange(ValueTypeHasDataType link) { InformationTypeFormat format; LinkedElementCollection <ConceptType> conceptTypes; if (null != (format = InformationTypeFormatIsForValueType.GetInformationTypeFormat(link.ValueType)) && 0 != (conceptTypes = InformationType.GetConceptTypeCollection(format)).Count) { foreach (ConceptType conceptType in conceptTypes) { UpdateTablesForConceptType(conceptType, null, null); } } }
public ResponsResult ApiGetInformation(InformationType type) { ResponsResult result = new ResponsResult(); if (type != InformationType.UseGuide) { result.Data = this.First <Informations>(t => t.Type == (int)type)?.Description ?? ""; } else { result.Data = this.Where <Informations>(t => t.Type == (int)type).Select(t => new { t.Description, t.Id, t.Title, t.Type }).ToList(); } return(result); }
/// <summary> /// Checks if a type string matches the filter. /// Type strings are of the following format: <category name>::<information type name> /// (category name is optional) /// </summary> /// <param name="type">type string to check</param> /// <returns>True if the type string matches the filter</returns> public bool Match(string type) { if (type.Length <= 0) // empty type string matches everything { return(true); } if (!FilterEnabled) { return(true); } if (type.IndexOf("::") > 0) { int nIdx = type.IndexOf("::"); string sCategory = type.Substring(0, nIdx); string sInfotype = type.Substring(nIdx + 2); for (int i = 0; i < _categories.Count; i++) { Category curCat = _categories[i] as Category; if (curCat.Name == sCategory) { for (int j = 0; j < curCat.InformationTypes.Count; j++) { InformationType curType = curCat.InformationTypes[j] as InformationType; if (curType.Name == sInfotype) { return(true); } } } } } else { for (int i = 0; i < _informationTypes.Count; i++) { InformationType curType = _informationTypes[i] as InformationType; if (curType.Name == type) { return(true); } } } return(false); }
public InformationForm(InformationType informationType) { InitializeComponent(); switch (informationType) { case InformationType.AboutAuthor: _informationType = InformationType.AboutAuthor; break; case InformationType.ViewHelp: _informationType = InformationType.ViewHelp; break; } SetAs(); }
/// <summary> /// 1:布玛 2:小林 3:饺子 其他的 btn_test 没用了 /// </summary> /// <param name="mtype">Mtype.</param> /// <param name="m_Text">M_ text.</param> public void SetAllData(InformationType mtype, string m_Text, string m_BtnText1, string m_BtnText2, string m_BtnText3) { for (int i = 0; i < 3; i++) { if ((int)mtype == i + 1) { spt_Role[i].gameObject.SetActive(true); } else { spt_Role[i].gameObject.SetActive(false); } } SetText(m_Text, m_BtnText1); }
public void Write(string content, InformationType type) { try { if (!inited) { Init(); } string logText = DateTime.Now.ToString("hh:mm:ss") + " " + type.ToString() + " " + content; sw.WriteLine(logText); sw.Flush(); } catch (Exception ee) { } }
public static string GetPattern(InformationType informationType, int min, int max) { if (!RequireQuantifier(informationType)) { return(GetPattern(informationType)); } if (min == max) { return(string.Format("{0}{{{1}}}", _informationTypes[informationType], min)); } else { return(string.Format("{0}{{{1},{2}}}", _informationTypes[informationType], min, max)); } }
/// <summary> /// 农机服务信息列表 /// </summary> /// <param name="id"></param> /// <param name="Service"></param> /// <returns></returns> public ActionResult List(int id, InformationType Service) { var time = DateTime.Now; time = time.AddDays(-7); var informations = (from i in DB.Informations where i.CatalogID == id && i.Type == Service && i.Time >= time && i.Verify == true orderby i.Time descending select i).ToList(); ViewBag.Title = Service.ToString(); return(View(informations)); }
public static void ShowMessage(XafApplication application, string message, InformationType type = InformationType.Success, InformationPosition position = InformationPosition.Bottom, int duration = 2000) { if (application == null) { return; } MessageOptions options = new MessageOptions(); options.Duration = duration; options.Message = message; options.Type = type; options.Web.Position = position; application.ShowViewStrategy.ShowMessage(options); }
private static void SetColor(InformationType type) { switch (type) { case InformationType.OnDefault: Console.ForegroundColor = ConsoleColor.White; break; case InformationType.OnError: Console.ForegroundColor = ConsoleColor.Red; break; case InformationType.OnSuccess: Console.ForegroundColor = ConsoleColor.Green; break; } }
public SearchNode AddInformation(string Title, InformationType Type, object Data) { if (Type == InformationType.Image) Bridge.ImageCache.Add((Image)Data); TreeNode tnode = null; _ParentTreeView.Invoke((Action)delegate { tnode = _Parent.Nodes.Add(Title); }); SearchNode node = new SearchNode(tnode, Title, Type, Data, this); Nodes.Add(node); //Pointlessly complicated, but I'm already balls deep so what the hell am I supposed to do? if (!ParentAdded) { _ParentTreeView.Invoke((Action)delegate { _ParentTreeView.Nodes.Add(_Parent); }); ParentAdded = true; } return node; }
public SearchNode AddInformation(string Title, InformationType Type, object Data, bool forcewait = false) { if (Type == InformationType.Image) Bridge.ImageCache.Add((Image)Data); TreeNode tnode = null; if (forcewait) this.ParentModule.Parent.TreeView.Invoke((Action)delegate { tnode = TreeNode.Nodes.Add(Title); }); else this.ParentModule.Parent.TreeView.BeginInvoke((Action)delegate { tnode = TreeNode.Nodes.Add(Title); }); SearchNode node = new SearchNode(tnode, Title, Type, Data, this.ParentModule, this); Nodes.Add(node); return node; }
/// <summary> /// Adds a new information type to the filter /// </summary> /// <param name="infoType">information type to add</param> public void AddInformationType(InformationType infoType) { if (!_informationTypes.Contains(infoType)) { if (infoType.Mode == InformationTypeMode.Exclusive) { _containsExclusive = true; ResetFilter(); _informationTypes.Add(infoType); } else { if (!_containsExclusive) { _informationTypes.Add(infoType); } } } }
public ResponsResult GetInformation(InformationType type, string id) { ResponsResult result = new ResponsResult(); Informations info = null; if (type != InformationType.UseGuide) { info = this.First <Informations>(t => t.Type == (int)type); } else { info = this.Single <Informations>(t => t.Id == id); } if (info == null) { info = default(Informations); } result.Data = info; return(result); }
private async Task Information(string informationText, InformationType informationType, int blink = 0) { if (!string.IsNullOrEmpty(InformationLabel.Text)) { InformationLabel.Text = string.Empty; Thread.Sleep(100); } if (informationType == InformationType.Success) { InformationLabel.ForeColor = Color.Green; } else if (informationType == InformationType.Warrning) { InformationLabel.ForeColor = Color.Yellow; } else if (informationType == InformationType.Error) { InformationLabel.ForeColor = Color.Red; } InformationLabel.Text = informationText; for (int i = 0; i < 10; i++) { await Task.Delay(1500); if (i == 9) { InformationLabel.Text = string.Empty; break; } } for (int i = 0; i < blink; i++) { await Task.Delay(1500); await Information(informationText, informationType); } }
public InformationAttribute(string message, InformationType type, bool messageAfterProperty) { this.Message = message; if (type == InformationType.Error) { this.Type = UnityEditor.MessageType.Error; } if (type == InformationType.Info) { this.Type = UnityEditor.MessageType.Info; } if (type == InformationType.Warning) { this.Type = UnityEditor.MessageType.Warning; } if (type == InformationType.None) { this.Type = UnityEditor.MessageType.None; } this.MessageAfterProperty = messageAfterProperty; }
private static void CreateAttributesAndBinaryRelationships(ConceptType conceptType, INotifyElementAdded notifyAdded, ref int associationCounter) { List <Attribute> attributesForConceptType = new List <Attribute>(); foreach (InformationType informationType in InformationType.GetLinksToInformationTypeFormatCollection(conceptType)) { attributesForConceptType.Add(CreateAttributeForInformationType(informationType, new Stack <ConceptTypeChild>())); } foreach (ConceptTypeRelatesToConceptType conceptTypeRelation in ConceptTypeRelatesToConceptType.GetLinksToRelatedConceptTypeCollection(conceptType)) { if (!CreateBinaryAssociation(conceptTypeRelation, conceptType, conceptTypeRelation.RelatedConceptType, notifyAdded, ref associationCounter)) { //if binary association was not created - let's create an attribute for it attributesForConceptType.AddRange(GetAttributesForConceptTypeRelation(conceptTypeRelation, new Stack <ConceptTypeChild>())); } } foreach (ConceptTypeAssimilatesConceptType conceptTypeAssimilation in ConceptTypeAssimilatesConceptType.GetLinksToAssimilatedConceptTypeCollection(conceptType)) { if (!conceptTypeAssimilation.RefersToSubtype) { CreateBinaryAssociation(conceptTypeAssimilation, conceptType, conceptTypeAssimilation.AssimilatedConceptType, notifyAdded, ref associationCounter); } } EntityType conceptTypeEntity = EntityTypeIsPrimarilyForConceptType.GetEntityType(conceptType); if (conceptTypeEntity != null) { conceptTypeEntity.AttributeCollection.AddRange(attributesForConceptType); if (notifyAdded != null) { foreach (Attribute attr in attributesForConceptType) { notifyAdded.ElementAdded(attr, true); } } } }
public SearchNode AddInformation(string Title, InformationType Type, object Data) { if (Type == InformationType.Image) { Bridge.ImageCache.Add((Image)Data); } TreeNode tnode = null; _ParentTreeView.Invoke((Action) delegate { tnode = _Parent.Nodes.Add(Title); }); SearchNode node = new SearchNode(tnode, Title, Type, Data, this); Nodes.Add(node); //Pointlessly complicated, but I'm already balls deep so what the hell am I supposed to do? if (!ParentAdded) { _ParentTreeView.Invoke((Action) delegate { _ParentTreeView.Nodes.Add(_Parent); }); ParentAdded = true; } return(node); }
private static Attribute CreateAttributeForInformationType(InformationType informationType, Stack <ConceptTypeChild> conceptTypeChildPath) { conceptTypeChildPath.Push(informationType); Attribute attribute = new Attribute(informationType.Store, new PropertyAssignment[] { new PropertyAssignment(Attribute.NameDomainPropertyId, informationType.Name) }); foreach (Uniqueness u in UniquenessIncludesConceptTypeChild.GetUniquenessCollection(informationType)) { if (u.IsPreferred) { attribute.IsPrimaryIdComponent = true; break; } } ConceptTypeChild[] conceptTypeChildPathReverse = conceptTypeChildPath.ToArray(); sys.Array.Reverse(conceptTypeChildPathReverse); AttributeHasConceptTypeChild.GetConceptTypeChildPath(attribute).AddRange(conceptTypeChildPathReverse); conceptTypeChildPath.Pop(); return(attribute); }
private string FormInfo(InformationType informationType, ICollection <Point3D> point3s = null, int[,] matrix = null) { const int border = 50; string result = null; switch (informationType) { case InformationType.obstacleList: case InformationType.grapgVertexes: { foreach (var item in point3s) { if (item.X >= regionGraph.minX - border && item.X <= regionGraph.maxX + border && item.Y >= regionGraph.minY - border && item.Y <= regionGraph.maxY + border && item.Z >= regionGraph.minZ - border && item.Z <= regionGraph.maxZ + border) { result += $"{item.X};{item.Y};{item.Z}|"; } } break; } case InformationType.matrix: { for (int i = 0; i < matrix.GetLength(0); i++) { for (int j = 0; j < matrix.GetLength(1); j++) { result += matrix[i, j] + " "; } result += "|"; } break; } } return(result); }
public ActionResult Edit(int id, string Title, InformationType Type, string Description, int?CatalogID, string Name, string Phone, string Address, int Top) { var information = DB.Informations.Find(id); information.Title = Title; information.Description = Description; information.CatalogID = CatalogID; information.Name = Name; information.Phone = Phone; information.Address = Address; information.Top = Top; information.Type = Type; var Picture = Request.Files["Picture"]; if (Picture != null && Picture.ContentLength > 0) { using (var binaryReader = new BinaryReader(Picture.InputStream)) { information.Picture = binaryReader.ReadBytes(Picture.ContentLength); } } DB.SaveChanges(); return(RedirectToAction("Success", "Shared")); }
/// <summary> /// Called if the user changes the selection of the list view /// </summary> /// <param name="sender">sender of the event</param> /// <param name="e">event parameter</param> private void lvTypes_SelectedIndexChanged(object sender, System.EventArgs e) { if (lvTypes.SelectedItems.Count > 0) { ListViewItem selItem = lvTypes.SelectedItems[0]; InformationType iT = selItem.Tag as InformationType; Category cat = selItem.Tag as Category; if (iT != null) { lblDescription.Text = iT.Description; } if (cat != null) { lblDescription.Text = cat.Description; } } else { lblDescription.Text = ""; } }
private void ResetLeft() { Left = InformationType.Nothing; }
public HeaderInformation(int iMargin, Font oFont, PageInformationBorder eBorder, InformationType eLeft, InformationType eCenter, InformationType eRight) : base(iMargin, oFont, eBorder, eLeft, eCenter, eRight) { }
public InformationAttribute(string message, InformationType type, bool messageAfterProperty) { }
public HasInformationTestLogic(string about, InformationType type) { this.about = about; this.type = type; }
/// <summary> /// Checks if a special information type is part of the filter /// </summary> /// <param name="type">information type to check</param> /// <returns>Returns true if the specified type is part of this filter</returns> public bool ContainsInformationType(InformationType type) { return(_informationTypes.Contains(type)); }
private void RetrieveInformationFromFile(string FileName, InformationType Information) { double dblTemp; string FilePathAndName = mSDCard.GetWorkingDirectoryPath() + FileName; Debug.Print("Reading file: " + FilePathAndName); try { switch (Information) { case InformationType.LabelFormat: LabelFormat = mSDCard.ReadTextFile(FilePathAndName); Debug.Print("LabelFormat Read from SD Card:\r\n" + LabelFormat); break; case InformationType.JobNumber: JobNumber = mSDCard.ReadLine(FilePathAndName); Debug.Print("JobNumber Read from SD Card:\r\n" + JobNumber); break; case InformationType.OperationNumber: Operation = mSDCard.ReadLine(FilePathAndName); Debug.Print("Operation Read from SD Card:\r\n" + Operation); break; case InformationType.ShopTrakTransactionsURL: ShopTrakTransactionsURL = mSDCard.ReadLine(FilePathAndName); Debug.Print("ShopTrakTransactionsURL Read from SD Card:\r\n" + ShopTrakTransactionsURL); break; case InformationType.PieceWeight: var strPieceWeight = mSDCard.ReadLine(FilePathAndName); PieceWeight = double.TryParse(strPieceWeight, out dblTemp) ? dblTemp : 0.0; Debug.Print("PieceWeight Read from SD Card:\r\n" + PieceWeight); break; case InformationType.NetWeightAdjustment: var strNetWeightAdjustment = mSDCard.ReadLine(FilePathAndName); NetWeightAdjustment = double.TryParse(strNetWeightAdjustment, out dblTemp) ? dblTemp : 0.0; Debug.Print("NetWeightAdjustment Read from SD Card:\r\n" + NetWeightAdjustment); break; case InformationType.ColorName: var strBackgroundColor = mSDCard.ReadLine(FilePathAndName); BacklightColor = double.TryParse(strBackgroundColor, out dblTemp) ? (BacklightColor)dblTemp : (BacklightColor)0; Debug.Print("BackgroundColor Read from SD Card:\r\n" + BacklightColor); break; } } catch (NullReferenceException) { Debug.Print("Invalid (Null) File Contents. Deleting File..."); File.Delete(FilePathAndName); Debug.Print("Deleted File: " + FilePathAndName); CreateInformationFile(FileName, Information); } }
/// <summary> /// Generates the appropriate <see cref="ConceptTypeChild">concept type children</see> in <paramref name="parentConceptType"/> /// for <paramref name="factTypeMapping"/>. /// </summary> /// <param name="factTypeMappings"> /// The set of all decided <see cref="FactTypeMapping">fact type mappings</see>. /// </param> /// <param name="parentConceptType"> /// The <see cref="ConceptType"/> into which <see cref="ConceptTypeChild">concept type children</see> should be generated. /// </param> /// <param name="parentConceptTypeHasDeepAway"> /// Test if the parent concept type has a deep mapping away from it. Handles some cyclic cases by making a potential assimilation /// into a reference. Delay calculated because this is not always needed. /// </param> /// <param name="factTypeMapping"> /// The <see cref="FactTypeMapping"/> for which <see cref="ConceptTypeChild">concept type children</see> should be generated. /// </param> /// <param name="factTypePath"> /// The path of <see cref="FactType">fact types</see> leading from <paramref name="parentConceptType"/> to <paramref name="factTypeMapping"/> /// </param> /// <param name="isMandatorySoFar"> /// Indicates whether every step in <paramref name="factTypePath"/> is mandatory for the parent concept type (towards object type). /// </param> private static void GenerateConceptTypeChildrenForFactTypeMapping(FactTypeMappingDictionary factTypeMappings, ConceptType parentConceptType, ref bool? parentConceptTypeHasDeepAway, FactTypeMapping factTypeMapping, List<FactType> factTypePath, bool isMandatorySoFar) { // Push the current fact type onto the path. factTypePath.Add(factTypeMapping.FactType); bool isMandatory = isMandatorySoFar && (factTypeMapping.TowardsRoleMandatory); ConceptTypeChild newConceptTypeChild; ConceptType fromConceptType = ConceptTypeIsForObjectType.GetConceptType(factTypeMapping.FromObjectType); if (fromConceptType != null) { // The mapping is coming from a concept type, so we will create a concept type reference to it. // Set up the property assignments that are common to both kinds of concept type references. PropertyAssignment isMandatoryPropertyAssignment = new PropertyAssignment(ConceptTypeChild.IsMandatoryDomainPropertyId, isMandatory); string name = ResolveRoleName(factTypeMapping.FromRole); string oppositeName = ResolveRoleName(factTypeMapping.TowardsRole); // UNDONE: Yes, these are backwards, but they need to remain so for compatibility reasons until we do a file format change. PropertyAssignment namePropertyAssignment = new PropertyAssignment(ConceptTypeChild.NameDomainPropertyId, oppositeName); PropertyAssignment oppositeNamePropertyAssignment = new PropertyAssignment(ConceptTypeReferencesConceptType.OppositeNameDomainPropertyId, name); if (factTypeMapping.MappingDepth == MappingDepth.Deep) { // Since this is a deep mapping, we will create a concept type assimilation for it. SubtypeFact subtypeFact = factTypeMapping.FactType as SubtypeFact; // UNDONE: The handling here for IsPreferredForParent and IsPreferredForTarget may not be correct // if we have more than one fact type in the fact type path. bool isPreferredForTarget; if (subtypeFact != null) { // For subtype assimilations, IsPreferredForTarget matches the ProvidesPreferredIdentifier // property of the ORM subtype fact. isPreferredForTarget = subtypeFact.ProvidesPreferredIdentifier; } else { // For non-subtype assimilations, IsPreferredForTarget is true if the role played by the object // type corresponding to the parent concept type has the preferred identifying uniqueness constraint // for the target concept type. isPreferredForTarget = factTypeMapping.TowardsRole.SingleRoleAlethicUniquenessConstraint.IsPreferred; } bool isPreferredForParent = factTypeMapping.IsFromPreferredIdentifier; // The IsPreferredForParent property on concept type assimilations indicates that the assimilation, on its own, // provides the preferred identifier for the assimilating concept type. Although the IsFromPreferredIdentifier // property on the fact type mapping will be true even if the from role is part of a multi-role preferred identifier, // ORM currently doesn't allow a role with a single role alethic uniqueness constraint (which is required for this to // be a deep mapping) to be part of any other uniqueness constraint. However, this may change in the future as our // handling of derivations, implications, equivalences, and logical rules becomes more sophisticated. We assert here // in order to make this case easier to catch if it happens, since this method may need to be adjusted in that case // to ensure that it continues to produce correct results. Debug.Assert(!isPreferredForParent || factTypeMapping.FromRole.SingleRoleAlethicUniquenessConstraint.IsPreferred); newConceptTypeChild = new ConceptTypeAssimilatesConceptType(parentConceptType.Partition, new RoleAssignment[] { new RoleAssignment(ConceptTypeAssimilatesConceptType.AssimilatorConceptTypeDomainRoleId, parentConceptType), new RoleAssignment(ConceptTypeAssimilatesConceptType.AssimilatedConceptTypeDomainRoleId, fromConceptType) }, new PropertyAssignment[] { isMandatoryPropertyAssignment, namePropertyAssignment, oppositeNamePropertyAssignment, new PropertyAssignment(ConceptTypeAssimilatesConceptType.RefersToSubtypeDomainPropertyId, subtypeFact != null), new PropertyAssignment(ConceptTypeAssimilatesConceptType.IsPreferredForParentDomainPropertyId, isPreferredForParent), new PropertyAssignment(ConceptTypeAssimilatesConceptType.IsPreferredForTargetDomainPropertyId, isPreferredForTarget), }); } else { Debug.Assert(factTypeMapping.MappingDepth == MappingDepth.Shallow, "Collapse mappings should not come from object types that have a concept type."); // Since this is a shallow mapping, we will create a concept type relation for it. newConceptTypeChild = new ConceptTypeRelatesToConceptType(parentConceptType.Partition, new RoleAssignment[] { new RoleAssignment(ConceptTypeRelatesToConceptType.RelatingConceptTypeDomainRoleId, parentConceptType), new RoleAssignment(ConceptTypeRelatesToConceptType.RelatedConceptTypeDomainRoleId, fromConceptType) }, new PropertyAssignment[] { isMandatoryPropertyAssignment, namePropertyAssignment, oppositeNamePropertyAssignment }); } } else { // The mapping is not coming from a concept type, meaning that we either need an information // type for an atomic value type (which will already have an information type format created // for it), or we need to collapse the preferred identifier of an entity type or structured // value type. InformationTypeFormat fromInformationTypeFormat = InformationTypeFormatIsForValueType.GetInformationTypeFormat(factTypeMapping.FromObjectType); if (fromInformationTypeFormat != null) { // We have an information type format, which means that we need to create an information type. string name = ResolveRoleName(factTypeMapping.FromRole); newConceptTypeChild = new InformationType(parentConceptType.Partition, new RoleAssignment[] { new RoleAssignment(InformationType.ConceptTypeDomainRoleId, parentConceptType), new RoleAssignment(InformationType.InformationTypeFormatDomainRoleId, fromInformationTypeFormat) }, new PropertyAssignment[] { new PropertyAssignment(ConceptTypeChild.IsMandatoryDomainPropertyId, isMandatory), new PropertyAssignment(ConceptTypeChild.NameDomainPropertyId, name) }); } else { // We do not have an information type format, which means that we need to collapse the fact // types in the preferred identifier of the FromObjectType into the parent concept type. newConceptTypeChild = null; UniquenessConstraint preferredIdentifier = factTypeMapping.FromObjectType.PreferredIdentifier; Debug.Assert(preferredIdentifier != null); foreach (Role preferredIdentifierRole in preferredIdentifier.RoleCollection) { // NOTE: We don't need the ShouldIgnoreFactType filter here, because we would have ignored // this object type if we were ignoring any of the fact types in its preferred identifier. FactType preferredIdentifierFactType = preferredIdentifierRole.BinarizedFactType; FactTypeMapping preferredIdentifierFactTypeMapping = factTypeMappings[preferredIdentifierFactType]; if (preferredIdentifierFactType == factTypeMapping.FactType) { // We just got back to the fact that we were already mapping. This should only happen // when the object type has a single fact type in its preferred identifier and it is // deeply mapped away from the object type. Debug.Assert(preferredIdentifier.RoleCollection.Count == 1 && preferredIdentifierFactTypeMapping.MappingDepth == MappingDepth.Deep); // UNDONE: For now, we just ignore this fact type entirely. What we should be doing is: // 1) If everything along the path is mandatory, then we're done, since we know that instances of the parent // concept type always identify an instance of the object type that we're trying to map. // 2) Otherwise, check if there are any other relationships that would allow use to derive whether an instance // of the parent concept type identifies an instance of the object type that we're trying to map. Examples // of things that would allow us to do this would be a mandatory role played by the object type that we're // we're trying to map that gets absorbed into some concept type. The reference to an instance of this concept // type from it allows us to tell if this instance identifies an instance of the object type. // 3) If no other relationship allows us to derive this information, we need to add a boolean information type // that indicates for each instance of the parent concept type whether it identifies an instance of the object // type that we're trying to map. break; } // If we have a single fact type in the preferred identifier, it might be mapped // deeply away from the object type that we are collapsing. For this case, we need // to create a "fake" mapping and process it instead. if (preferredIdentifierFactTypeMapping.TowardsRole == preferredIdentifierRole) { // Make sure this is actually the situation we are trying to handle, since it shouldn't be possible in any other scenario. Debug.Assert(preferredIdentifier.RoleCollection.Count == 1 && preferredIdentifierFactTypeMapping.MappingDepth == MappingDepth.Deep); // UNDONE: Would we ever want to use a depth other than shallow here? Probably not, but it might be worth looking in to. FactTypeMappingFlags currentFlags = preferredIdentifierFactTypeMapping.Flags; preferredIdentifierFactTypeMapping = new FactTypeMapping(preferredIdentifierFactType, preferredIdentifierFactTypeMapping.TowardsRole, preferredIdentifierFactTypeMapping.FromRole, (currentFlags & FactTypeMappingFlags.Subtype) | GetFlags(false, 0 != (currentFlags & FactTypeMappingFlags.TowardsValueType), 0 != (currentFlags & FactTypeMappingFlags.TowardsRoleMandatory), 0 != (currentFlags & FactTypeMappingFlags.TowardsRoleImpliedMandatory), 0 != (currentFlags & FactTypeMappingFlags.FromValueType), 0 != (currentFlags & FactTypeMappingFlags.FromRoleMandatory), 0 != (currentFlags & FactTypeMappingFlags.FromRoleImpliedMandatory))); } else if (preferredIdentifierFactTypeMapping.MappingDepth == MappingDepth.Deep) { // Handle cyclic deep mapping scenario with collapsed entities. // The primary scenario here is: // 1) B is a subtype of A and identified by A's identifier // 2) A and B participate in an objectified 1-1 FactType // 3) The uniqueness constraint on the A role is the preferred identifier // 4) The A role is mandatory // In this case, without this code, you get an assimilation mapping B into A // and mapping A into B. We fix this case by forwarding a shallow mapping, // which generates a reference instad of an assimilation. if (!parentConceptTypeHasDeepAway.HasValue) { ObjectType objectType = ConceptTypeIsForObjectType.GetObjectType(parentConceptType); foreach (Role role in ConceptTypeIsForObjectType.GetObjectType(parentConceptType).PlayedRoleCollection) { FactType factType; FactTypeMapping testMapping; if (null != (factType = role.BinarizedFactType) && factTypeMappings.TryGetValue(factType, out testMapping) && testMapping.MappingDepth == MappingDepth.Deep && testMapping.FromObjectType == objectType) { preferredIdentifierFactTypeMapping = new FactTypeMapping(preferredIdentifierFactType, preferredIdentifierFactTypeMapping.FromRole, preferredIdentifierFactTypeMapping.TowardsRole, preferredIdentifierFactTypeMapping.Flags & ~FactTypeMappingFlags.DeepMapping); parentConceptTypeHasDeepAway = true; break; } } if (!parentConceptTypeHasDeepAway.HasValue) { parentConceptTypeHasDeepAway = false; } } else if (parentConceptTypeHasDeepAway.Value) { preferredIdentifierFactTypeMapping = new FactTypeMapping(preferredIdentifierFactType, preferredIdentifierFactTypeMapping.FromRole, preferredIdentifierFactTypeMapping.TowardsRole, preferredIdentifierFactTypeMapping.Flags & ~FactTypeMappingFlags.DeepMapping); } } GenerateConceptTypeChildrenForFactTypeMapping(factTypeMappings, parentConceptType, ref parentConceptTypeHasDeepAway, preferredIdentifierFactTypeMapping, factTypePath, isMandatory); } } } // If we created a new concept type child, populate its fact type path. if (newConceptTypeChild != null) { foreach (FactType pathFactType in factTypePath) { ConceptTypeChildHasPathFactType conceptTypeChildHasPathFactType = new ConceptTypeChildHasPathFactType(newConceptTypeChild, pathFactType); } } // Pop the current fact type off of the path. Debug.Assert(factTypePath[factTypePath.Count - 1] == factTypeMapping.FactType, "Fact type path stack is corrupt."); factTypePath.RemoveAt(factTypePath.Count - 1); }
private void ResetRight() { this.Right = InformationType.PageNumber; }
public PageInformation(PageInformationBorder border, InformationType left, InformationType center, InformationType right) : this(3, DefaultFont, border, left, center, right) { }
private void ResetLeft() { Left = InformationType.DocumentName; }
private void ResetCenter() { Center = InformationType.Nothing; }
public RunAction(InformationType type, string project, string assembly, TimeSpan timeSpent, bool succeeded) { setProperties(type, project, assembly, timeSpent, succeeded); }
/// <summary> /// Full Constructor /// </summary> /// <param name="iMargin">Margin to use</param> /// <param name="oFont">Font to use </param> /// <param name="eBorder">Border style</param> /// <param name="eLeft">What to print on the left side of the page</param> /// <param name="eCenter">What to print in the center of the page</param> /// <param name="eRight">What to print on the right side of the page</param> public FooterInformation(int iMargin, Font oFont, PageInformationBorder eBorder, InformationType eLeft, InformationType eCenter, InformationType eRight) : base(iMargin, oFont, eBorder, eLeft, eCenter, eRight) { }
/// <summary> /// Normal Use Constructor /// </summary> /// <param name="eBorder">Border style</param> /// <param name="eLeft">What to print on the left side of the page</param> /// <param name="eCenter">What to print in the center of the page</param> /// <param name="eRight">What to print on the right side of the page</param> public FooterInformation(PageInformationBorder eBorder, InformationType eLeft, InformationType eCenter, InformationType eRight) : base(3, DefaultFont, eBorder, eLeft, eCenter, eRight) { }
/// <summary> /// Generages the <see cref="ConceptType"/> objects along with any relationships that they have and adds them to the /// model. /// </summary> /// <param name="factTypeMappings">A dictionary of all the final decided FactTypeMapping objects.</param> private void GenerateConceptTypes(FactTypeMappingDictionary factTypeMappings) { ORMModel model = this.ORMModel; LinkedElementCollection<ObjectType> modelObjectTypes = model.ObjectTypeCollection; AbstractionModel oialModel = this.AbstractionModel; // For each object type in the model... foreach (ObjectType objectType in modelObjectTypes) { if (ShouldIgnoreObjectType(objectType)) { continue; } // If it should have a conctpt type... if (ObjectTypeIsConceptType(objectType, factTypeMappings)) { // Create the ConceptType object. PropertyAssignment name = new PropertyAssignment(ConceptType.NameDomainPropertyId, objectType.Name); ConceptType conceptType = new ConceptType(Store, name); ConceptTypeIsForObjectType conceptTypeIsForObjectType = new ConceptTypeIsForObjectType(conceptType, objectType); // Add it to the model. oialModel.ConceptTypeCollection.Add(conceptType); // If this conceptType is for a ValueType... if (objectType.IsValueType) { InformationTypeFormat valueTypeInformationTypeFormat = InformationTypeFormatIsForValueType.GetInformationTypeFormat(objectType); RoleAssignment conceptTypeRole = new RoleAssignment(InformationType.ConceptTypeDomainRoleId, conceptType); RoleAssignment informationTypeFormat = new RoleAssignment(InformationType.InformationTypeFormatDomainRoleId, valueTypeInformationTypeFormat); RoleAssignment[] roleAssignments = { conceptTypeRole, informationTypeFormat }; PropertyAssignment isMandatory = new PropertyAssignment(InformationType.IsMandatoryDomainPropertyId, true); PropertyAssignment informationTypeNameProperty = new PropertyAssignment(InformationType.NameDomainPropertyId, String.Concat(objectType.Name, "Value")); PropertyAssignment[] informationTypePropertyAssignments = { isMandatory, informationTypeNameProperty }; // ConceptType for conceptType gets an InformationType that references InformationTypeFormat for conceptType. InformationType informationType = new InformationType(Store, roleAssignments, informationTypePropertyAssignments); PropertyAssignment uniquenessNameProperty = new PropertyAssignment(Uniqueness.NameDomainPropertyId, String.Concat(objectType.Name, "Uniqueness")); PropertyAssignment isPreferred = new PropertyAssignment(Uniqueness.IsPreferredDomainPropertyId, true); PropertyAssignment[] uniquenessPropertyAssignments = { uniquenessNameProperty, isPreferred }; // Uniqueness constraint Uniqueness uniqueness = new Uniqueness(Store, uniquenessPropertyAssignments); UniquenessIncludesConceptTypeChild uniquenessIncludesConceptTypeChild = new UniquenessIncludesConceptTypeChild(uniqueness, informationType); conceptType.UniquenessCollection.Add(uniqueness); } } } }
public TellInformationExecute(IExecute operation, int overhearChance, string about, InformationType type) { this.about = about; this.type = type; this.operation = operation; this.overhearChance = overhearChance; }
public Query(InformationType informationType, string where) { InformationType = informationType; Where = where; }
/// <summary> /// Normal Use Constructor /// </summary> /// <param name="eBorder">Border style</param> /// <param name="eLeft">What to print on the left side of the page</param> /// <param name="eCenter">What to print in the center of the page</param> /// <param name="eRight">What to print on the right side of the page</param> public PageInformation(PageInformationBorder eBorder, InformationType eLeft, InformationType eCenter, InformationType eRight) : this(3, DefaultFont, eBorder, eLeft, eCenter, eRight) { }
//DEFAULT CHANNEL public void setDefaultType(InformationType type) { _defaultType = type; }
public InformationInstance ChooseInformationAbout(InformationType type, Character about) { InformationInstance[] information; if (type == InformationType.Positive) information = KnownInformation.Where(info => info.EvaluateOnTold(this, about, Game) > 0.0).ToArray(); else if (type == InformationType.Negative) information = KnownInformation.Where(info => info.EvaluateOnTold(this, about, Game) < 0.0).ToArray(); else information = KnownInformation.ToArray(); int index = OnChooseInformation(information); return information[index]; }
public bool HasInformationAbout(Character about, InformationType type) { Weights weights = GetWeights(this); foreach(var info in KnownInformation) { if (info.IsAbout(about)) { double result = info.EvaluateOnTold(this, about, Game); if (type == InformationType.Positive && result > 0.0) return true; else if (type == InformationType.Negative && result < 0.0) return true; else if (type == InformationType.Neutral && result == 0.0) return true; } } return false; }
public HeaderInformation(PageInformationBorder eBorder, InformationType eLeft, InformationType eCenter, InformationType eRight) : base(3, DefaultFont, eBorder, eLeft, eCenter, eRight) { }
private void ResetRight() { this.Right = InformationType.Nothing; }
public void SwitchPanel(InformationType type) { if (dumpmode) dumptype = type; else main.SwitchPanel(type); }