Example #1
0
				string IDetailHandler.GetDetailTipText(PartitionChange change, int detailColumn, ToolTipType tipType)
				{
					return null;
				}
Example #2
0
				DomainClassInfo IDetailHandler.GetBaseDomainClassInfo(PartitionChange change)
				{
					return myDetailHandlers[change.ChangeArgs.GetType()].GetBaseDomainClassInfo(change);
				}
Example #3
0
				object IDetailHandler.GetDetailObject(PartitionChange change, int detailColumn, ObjectStyle style)
				{
					if (style == ObjectStyle.SubItemRootBranch && detailColumn == 1)
					{
						return new ChangeToFromBranch((ElementPropertyChangedEventArgs)change.ChangeArgs);
					}
					return null;
				}
Example #4
0
				string IDetailHandler.GetDetailTipText(PartitionChange change, int detailColumn, ToolTipType tipType)
				{
					return myDetailHandlers[change.ChangeArgs.GetType()].GetDetailTipText(change, detailColumn, tipType);
				}
Example #5
0
				bool IDetailHandler.GetDetailIsExpandable(PartitionChange change, int detailColumn)
				{
					IDetailHandler typedHandler;
					if (detailColumn == -1)
					{
						if (myDetailHandlers.TryGetValue(change.ChangeArgs.GetType(), out typedHandler))
						{
							return typedHandler.GetDetailIsExpandable(change, detailColumn);
						}
					}
					else
					{
						return myDetailHandlers[change.ChangeArgs.GetType()].GetDetailIsExpandable(change, detailColumn);
					}
					return false;
				}
Example #6
0
				VirtualTreeDisplayData IDetailHandler.GetDetailDisplayData(PartitionChange change, int detailColumn, VirtualTreeDisplayDataMasks requiredData)
				{
					return VirtualTreeDisplayData.Empty;
				}
Example #7
0
				int IDetailHandler.GetDetailColumnCount(PartitionChange change)
				{
					IDetailHandler typedHandler;
					if (myDetailHandlers.TryGetValue(change.ChangeArgs.GetType(), out typedHandler))
					{
						return typedHandler.GetDetailColumnCount(change);
					}
					return 0;
				}
Example #8
0
				object IDetailHandler.GetDetailObject(PartitionChange change, int detailColumn, ObjectStyle style)
				{
					if (style == ObjectStyle.SubItemRootBranch)
					{
						ElementEventArgs args = (ElementEventArgs)change.ChangeArgs;
						DomainRelationshipInfo relationshipInfo = (DomainRelationshipInfo)args.DomainClass;
						RoleAssignment[] assignments = change.RoleAssignments;
						RoleAssignment assignment = assignments[0];
						return new RoleAssignmentDetailBranch(change.Partition.Store, relationshipInfo.DomainRoles[detailColumn].Id == assignment.DomainRoleId ? assignment : assignments[1]);
					}
					return null;
				}
Example #9
0
				SubItemCellStyles IDetailHandler.GetDetailColumnStyle(PartitionChange change, int detailColumn)
				{
					return (detailColumn == (((RolePlayerChangedEventArgs)change.ChangeArgs).DomainRole.IsSource ? 0 : 1)) ? SubItemCellStyles.Complex : SubItemCellStyles.Simple;
				}
Example #10
0
				bool IDetailHandler.GetDetailIsExpandable(PartitionChange change, int detailColumn)
				{
					return detailColumn == -1 && ((ElementAddedEventArgs)change.ChangeArgs).GetAssignments().Length != 0;
				}
Example #11
0
				int IDetailHandler.GetDetailColumnCount(PartitionChange change)
				{
					return (change.RoleAssignments != null) ? 2 : 0;
				}
Example #12
0
				object IDetailHandler.GetDetailObject(PartitionChange change, int detailColumn, ObjectStyle style)
				{
					if (style == ObjectStyle.ExpandedBranch && detailColumn == -1)
					{
						return new InitialPropertyExpansionBranch(change.Partition.Store, ((ElementAddedEventArgs)change.ChangeArgs).GetAssignments());
					}
					else if (style == ObjectStyle.SubItemRootBranch)
					{
						ElementAddedEventArgs args = (ElementAddedEventArgs)change.ChangeArgs;
						DomainRelationshipInfo relationshipInfo = (DomainRelationshipInfo)args.DomainClass;
						RoleAssignment[] assignments = change.RoleAssignments;
						RoleAssignment assignment = assignments[0];
						return new RoleAssignmentDetailBranch(change.Partition.Store, relationshipInfo.DomainRoles[detailColumn].Id == assignment.DomainRoleId ? assignment : assignments[1]);
					}
					return null;
				}
Example #13
0
				DomainClassInfo IDetailHandler.GetBaseDomainClassInfo(PartitionChange change)
				{
					ElementPropertyChangedEventArgs args = (ElementPropertyChangedEventArgs)change.ChangeArgs;
					DomainClassInfo propertyClass = args.DomainProperty.DomainClass;
					return (propertyClass != args.DomainClass) ? propertyClass : null;
				}
Example #14
0
				VirtualTreeDisplayData IDetailHandler.GetDetailDisplayData(PartitionChange change, int detailColumn, VirtualTreeDisplayDataMasks requiredData)
				{
					VirtualTreeDisplayData retVal = VirtualTreeDisplayData.Empty;
					if (detailColumn == 0)
					{
						retVal.SelectedImage = retVal.Image = (short)GlyphIndex.DomainProperty;
						retVal.Bold = true;
					}
					return retVal;
				}
Example #15
0
				object IDetailHandler.GetDetailObject(PartitionChange change, int detailColumn, ObjectStyle style)
				{
					if (style == ObjectStyle.SubItemRootBranch)
					{
						RolePlayerOrderChangedEventArgs args = (RolePlayerOrderChangedEventArgs)change.ChangeArgs;
						return (detailColumn == 0) ?
							(IBranch)(new CounterpartRolePlayerDetailBranch(args.CounterpartDomainRole, args.CounterpartRolePlayerId)) :
							new PositionDetailBranch(args.NewOrdinal, args.OldOrdinal);
					}
					return null;
				}
Example #16
0
				string IDetailHandler.GetDetailText(PartitionChange change, int detailColumn)
				{
					// Return the role player name of the opposite role. Unfortunately, we don't actually
					// have the information about the current opposite role player from the transaction log
					return ((RolePlayerChangedEventArgs)change.ChangeArgs).DomainRole.OppositeDomainRole.Name;
				}
Example #17
0
				bool IDetailHandler.GetDetailIsExpandable(PartitionChange change, int detailColumn)
				{
					return false;
				}
Example #18
0
				object IDetailHandler.GetDetailObject(PartitionChange change, int detailColumn, ObjectStyle style)
				{
					if (style == ObjectStyle.SubItemRootBranch)
					{
						RolePlayerChangedEventArgs args = (RolePlayerChangedEventArgs)change.ChangeArgs;
						return new RolePlayerChangeDetailBranch(args.DomainRole, args.OldRolePlayerId, args.NewRolePlayerId);
					}
					return null;
				}
Example #19
0
				DomainClassInfo IDetailHandler.GetBaseDomainClassInfo(PartitionChange change)
				{
					return null;
				}
Example #20
0
				VirtualTreeDisplayData IDetailHandler.GetDetailDisplayData(PartitionChange change, int detailColumn, VirtualTreeDisplayDataMasks requiredData)
				{
					VirtualTreeDisplayData retVal = VirtualTreeDisplayData.Empty;
					retVal.SelectedImage = retVal.Image = ((RolePlayerChangedEventArgs)change.ChangeArgs).DomainRole.OppositeDomainRole.IsSource ? (short)GlyphIndex.SourceDomainRole : (short)GlyphIndex.TargetDomainRole;
					retVal.Bold = true;
					return retVal;
				}
Example #21
0
				SubItemCellStyles IDetailHandler.GetDetailColumnStyle(PartitionChange change, int detailColumn)
				{
					return myDetailHandlers[change.ChangeArgs.GetType()].GetDetailColumnStyle(change, detailColumn);
				}
Example #22
0
				int IDetailHandler.GetDetailColumnCount(PartitionChange change)
				{
					return 2;
				}
Example #23
0
				object IDetailHandler.GetDetailObject(PartitionChange change, int detailColumn, ObjectStyle style)
				{
					return myDetailHandlers[change.ChangeArgs.GetType()].GetDetailObject(change, detailColumn, style);
				}
Example #24
0
				SubItemCellStyles IDetailHandler.GetDetailColumnStyle(PartitionChange change, int detailColumn)
				{
					return SubItemCellStyles.Complex;
				}
Example #25
0
				VirtualTreeDisplayData IDetailHandler.GetDetailDisplayData(PartitionChange change, int detailColumn, VirtualTreeDisplayDataMasks requiredData)
				{
					return myDetailHandlers[change.ChangeArgs.GetType()].GetDetailDisplayData(change, detailColumn, requiredData);
				}
Example #26
0
				string IDetailHandler.GetDetailText(PartitionChange change, int detailColumn)
				{
					return null;
				}
Example #27
0
			/// <summary>
			/// Return an array of indices into the <paramref name=" changes"/>
			/// array that matches the current state of the filter.
			/// </summary>
			/// <param name="changes">An array of <see cref="PartitionChange"/>s</param>
			/// <param name="filter">On input, this is the previous filter returned
			/// from this method for these changes. If the current filter state has not changed
			/// since the previous call then the array will not be modified.</param>
			/// <returns><see langword="true"/> if the <paramref name="filter"/> array is modified.</returns>
			public bool ApplyFilter(PartitionChange[] changes, ref int[] filter)
			{
				if (!myFilterChanged)
				{
					myFilterChanged = false;
					return false;
				}
				myFilterChanged = false;
				Partition partition = myPartition;
				DomainModelInfo modelInfo = myDomainModel;
				DomainClassInfo classInfo = myDomainClass;
				DomainPropertyInfo propertyInfo = myDomainProperty;
				ChangeSource? source = myChangeSource;
				Guid? elementId = myElementId;
				Type changeType = myChangeType;
				if (partition == null &&
					modelInfo == null &&
					classInfo == null &&
					propertyInfo == null &&
					changeType == null &&
					!source.HasValue &&
					!elementId.HasValue)
				{
					filter = null;
					return true;
				}
				int changeCount = changes.Length;
				int[] newFilter = new int[changeCount];
				int filterCount = 0;
				for (int i = 0; i < changeCount; ++i)
				{
					PartitionChange change = changes[i];
					if (partition != null && change.Partition != partition)
					{
						continue;
					}
					EventArgs changeArgs = change.ChangeArgs;
					if (changeType != null && changeType != changeArgs.GetType())
					{
						continue;
					}
					GenericEventArgs genericArgs = changeArgs as GenericEventArgs;
					ElementPropertyChangedEventArgs propertyChangeArgs = genericArgs as ElementPropertyChangedEventArgs;
					if (modelInfo != null)
					{
						if (propertyChangeArgs != null)
						{
							if (propertyChangeArgs.DomainProperty.DomainModel != modelInfo)
							{
								continue;
							}
						}
						else if (genericArgs == null || modelInfo != genericArgs.DomainModel)
						{
							continue;
						}
					}
					if (classInfo != null &&
						(genericArgs == null || classInfo != genericArgs.DomainClass) &&
						(propertyChangeArgs == null || propertyChangeArgs.DomainProperty.DomainClass != classInfo))
					{
						continue;
					}
					if (propertyInfo != null && (null == propertyChangeArgs || propertyInfo != propertyChangeArgs.DomainProperty))
					{
						continue;
					}
					if (source.HasValue && (genericArgs == null || source.Value != genericArgs.ChangeSource))
					{
						continue;
					}
					if (elementId.HasValue)
					{
						if (genericArgs == null)
						{
							continue;
						}
						else
						{
							Guid id = elementId.Value;
							if (genericArgs.ElementId != id)
							{
								RoleAssignment[] assignments = change.RoleAssignments;
								int assignmentCount = (assignments != null) ? assignments.Length : 0;
								int j = 0;
								for (; j < assignmentCount; ++j)
								{
									if (assignments[j].RolePlayer.Id == id)
									{
										break;
									}
								}
								if (j == assignmentCount)
								{
									RolePlayerChangedEventArgs changedArgs;
									if (null == (changedArgs = genericArgs as RolePlayerChangedEventArgs) ||
										(id != changedArgs.NewRolePlayerId && id != changedArgs.OldRolePlayerId))
									{
										RolePlayerOrderChangedEventArgs orderChangedArgs;
										if (null == (orderChangedArgs = genericArgs as RolePlayerOrderChangedEventArgs) ||
											id != orderChangedArgs.CounterpartRolePlayerId)
										{
											continue;
										}
									}
								}
							}
						}
					}
					newFilter[filterCount] = i;
					++filterCount;
				}
				if (filterCount == changeCount)
				{
					newFilter = null;
				}
				else
				{
					Array.Resize<int>(ref newFilter, filterCount);
				}
				filter = newFilter;
				return true;
			}
Example #28
0
				string IDetailHandler.GetDetailText(PartitionChange change, int detailColumn)
				{
					ElementPropertyChangedEventArgs args = (ElementPropertyChangedEventArgs)change.ChangeArgs;
					switch (detailColumn)
					{
						case 0:
							return args.DomainProperty.Name;
					}
					return null;
				}