Пример #1
0
        public void ShowEditor(AbstractComponent comp)
        {
            FAnim = comp.GetCompByType(typeof(FrameAnimator)) as FrameAnimator;
            Sprite = comp.GetCompByType(typeof(Sprite)) as Sprite;

            if (FAnim != null && Sprite != null)
            {
                this.Show();
            }
            else
            {
                FAnim = null;
                Sprite = null;
                MessageBox.Show("AnimEditor必要组件:FrameAnimator、Sprite");
            }
        }
 public ComponentConfigResult(AbstractComponent component)
 {
     this.component = component;
 }
		/// <summary> Tests table values for ID, IS, and CE types.  An empty list is returned for 
		/// all other types or if the table name or number is missing.  
		/// </summary>
        private NuGenHL7Exception[] testTypeAgainstTable(Genetibase.NuGenHL7.model.Type type, AbstractComponent profile, System.String profileID)
		{
			System.Collections.ArrayList exList = new System.Collections.ArrayList();
			if (profile.Table != null && type.Name.Equals("IS") || type.Name.Equals("ID"))
			{
				System.String codeSystem = makeTableName(profile.Table);
				System.String value_Renamed = ((Primitive) type).Value;
				addTableTestResult(exList, profileID, codeSystem, value_Renamed);
			}
			else if (type.Name.Equals("CE"))
			{
				System.String value_Renamed = Terser.getPrimitive(type, 1, 1).Value;
				System.String codeSystem = Terser.getPrimitive(type, 3, 1).Value;
				addTableTestResult(exList, profileID, codeSystem, value_Renamed);
				
				value_Renamed = Terser.getPrimitive(type, 4, 1).Value;
				codeSystem = Terser.getPrimitive(type, 6, 1).Value;
				addTableTestResult(exList, profileID, codeSystem, value_Renamed);
			}
			return this.toArray(exList);
		}
		/// <summary> Tests a Type against the corresponding section of a profile.</summary>
		/// <param name="encoded">optional encoded form of type (if you want to specify this -- if null,  
		/// default pipe-encoded form is used to check length and constant val)
		/// </param>
        public virtual NuGenHL7Exception[] testType(Genetibase.NuGenHL7.model.Type type, AbstractComponent profile, System.String encoded, System.String profileID)
		{
			System.Collections.ArrayList exList = new System.Collections.ArrayList();
			if (encoded == null)
				encoded = NuGenPipeParser.encode(type, this.enc);
			
			NuGenHL7Exception ue = testUsage(encoded, profile.Usage, profile.Name);
			if (ue != null)
				exList.Add(ue);
			
			if (!profile.Usage.Equals("X"))
			{
				//check datatype
				System.String typeClass = type.GetType().FullName;
				if (typeClass.IndexOf("." + profile.Datatype) < 0)
				{
					typeClass = typeClass.Substring(typeClass.LastIndexOf('.') + 1);
					exList.Add(new NuGenProfileNotHL7CompliantException("HL7 datatype " + typeClass + " doesn't match profile datatype " + profile.Datatype));
				}
				
				//check length
				if (encoded.Length > profile.Length)
					exList.Add(new NuGenProfileNotFollowedException("The type " + profile.Name + " has length " + encoded.Length + " which exceeds max of " + profile.Length));
				
				//check constant value
				if (profile.ConstantValue != null && profile.ConstantValue.Length > 0)
				{
					if (!encoded.Equals(profile.ConstantValue))
						exList.Add(new NuGenProfileNotFollowedException("'" + encoded + "' doesn't equal constant value of '" + profile.ConstantValue + "'"));
				}
				
				NuGenHL7Exception[] te = testTypeAgainstTable(type, profile, profileID);
				for (int i = 0; i < te.Length; i++)
				{
					exList.Add(te[i]);
				}
			}
			
			return this.toArray(exList);
		}
Пример #5
0
 public static ComponentConfigResult ComponentConfig(this System.Web.Mvc.Controller controller, AbstractComponent component)
 {
     return(new ComponentConfigResult(component));
 }
 public void Set(AbstractComponent component)
 {
     this.components[component.GetType()] = component;
 }
 public override void Visit(AbstractComponent component)
 {
 }
Пример #8
0
 public ItemEditForm(AbstractComponent item)
 {
     InitializeComponent();
 }
Пример #9
0
 public void AddComponent(AbstractComponent component)
 {
     this.components.Add(component.GetType().Name, component);
 }