internal void Initialize() { if (!initialized) { try { initialized = true; this.UIAPIRawForm.Freeze(true); FormAttribute formAttribute = (FormAttribute)(from attribute in this.GetType().GetCustomAttributes(true) where attribute is FormAttribute select attribute).First(); var asmName = this.GetType().BaseType.Assembly.GetName().FullName; XDocument doc = resourceManager.GetSystemFormXDoc(asmName, formAttribute.Resource, formUID); if (doc != null) // i18n stuff. { string xml = ChangeMethodForUpdate(doc); string title = GetFormTitle(doc); if (!string.IsNullOrEmpty(xml)) { b1UIDAO.LoadBatchAction(xml); this.UIAPIRawForm.Title = title; } } this.OnInitializeComponent(); // UI elements displayed only after form creation. } finally // prevent loop on exceptions. { initialized = true; this.UIAPIRawForm.Freeze(false); } } }
private void UpdateSystemForm() { FormAttribute formAttribute = (FormAttribute)(from attribute in this.GetType().GetCustomAttributes(true) where attribute is FormAttribute select attribute).First(); var asmName = this.GetType().BaseType.Assembly.GetName().FullName; string xml = resourceManager.GetSystemFormXML(asmName, formAttribute.Resource, formUID); b1UIDAO.LoadBatchAction(xml); formEventHandler.RegisterForm(formUID, this); this.OnInitializeComponent(); }