Ejemplo n.º 1
0
		internal frmScriptProperty(ScriptInformation scriptInformation) {
			InitializeComponent();

			ScriptPropertyAttribute cProperty = scriptInformation.Property;
			labVersion.Text = cProperty.Version;
			labComment.Text = cProperty.Comment;
			labCopyright.Text = cProperty.Copyright;
			labName.Text = scriptInformation.Name;
			labFullName.Text = scriptInformation.FullName;
			labScriptType.Text = cProperty.ScriptType.ToString();
		}
Ejemplo n.º 2
0
		internal void SetScriptInformation(ScriptInformation scriptInformation) {
			__sScriptName = scriptInformation.FullName;
			__cScriptType = scriptInformation.Property.ScriptType;

			switch (__cScriptType) {
				case ScriptType.Script:
					break;
				case ScriptType.Signal:
					__cScriptSetting = new SignalSetting();
					break;
			}
		}
Ejemplo n.º 3
0
		/// <summary>
		///   加入腳本
		/// </summary>
		/// <param name="assembly">Assembly 組件資訊</param>
		public void AddScript(Assembly assembly) {
			Type[] cTypes = assembly.GetTypes();
			foreach (Type cType in cTypes) {
				ScriptPropertyAttribute[] cPropertys = cType.GetCustomAttributes(typeof(ScriptPropertyAttribute), false) as ScriptPropertyAttribute[];
				foreach (ScriptPropertyAttribute cProperty in cPropertys) {
					int iIndex = 0;
					string sFullAssembly = cType.FullName;
					ScriptInformation cScriptInfo = new ScriptInformation(cType, cProperty);

					lock (__cKeys) {
						if (__cKeys.TryGetValue(sFullAssembly, out iIndex)) {
							__cScripts[iIndex] = cScriptInfo;
						} else {
							iIndex = __cScripts.Count;
							__cScripts.Add(cScriptInfo);
							__cKeys.Add(sFullAssembly, iIndex);
						}
					}
				}
			}
		}