示例#1
0
 public ElementValueChangedEventArgs(PartElement component, string propertyName, object oldValue, object newValue)
 {
     Element      = component;
     PropertyName = propertyName;
     OldValue     = oldValue;
     NewValue     = newValue;
 }
示例#2
0
 public ValidationMessage(PartElement sourceElement, string messageCode, ValidationLevel level)
 {
     Code          = messageCode;
     Level         = level;
     SourceElement = sourceElement;
     if (sourceElement is PartSurface)
     {
         SourceKey = "SURFACE";
     }
     else if (sourceElement is SurfaceComponent)
     {
         SourceKey = "COMPONENT";
     }
     else if (sourceElement is PartProperties)
     {
         SourceKey = "PART";
     }
     else if (sourceElement is PartBone)
     {
         SourceKey = "BONE";
     }
     else
     {
         SourceKey = "PROJECT";
     }
 }
        public static IElementExtender CreateExtender(PartElement element, Type extensionType)
        {
            var finalType = GetExtenderType(element.GetType(), extensionType);

            if (finalType != null)
            {
                var ctor = finalType.GetConstructor(new Type[] { typeof(PartElement) });
                if (ctor != null)
                {
                    return((IElementExtender)ctor.Invoke(new object[] { element }));
                }

                ctor = finalType.GetConstructor(new Type[] { element.GetType() });
                if (ctor != null)
                {
                    return((IElementExtender)ctor.Invoke(new object[] { element }));
                }

                return((IElementExtender)Activator.CreateInstance(finalType));
            }
            return(null);
        }
示例#4
0
 public CollectionChangeItemInfo(PartElement element, int oldIndex, int newIndex)
 {
     Element  = element;
     OldIndex = oldIndex;
     NewIndex = newIndex;
 }