public void SetData(String Bereich, WCFStandardsNS.WCFStandards ParentsDataBase, object Sender, string TableNameParameter, String TitlePart, string ID, string [] Additionals, string [] BackAdditionals) { m_Bereich = Bereich; m_Sender = Sender; TableName = TableNameParameter; m_ID = ID; m_Additionals = Additionals; m_BackAdditionals = BackAdditionals; this.Title = TitlePart + " aus " + TableName + " kann ausgewählt werden"; m_TableUserControlHelper.TableName = TableName; m_TableHandlerDefinition = m_TableUserControlHelper.HandlerDefinition; m_TableUserControlHelper.InsertSqlStatement = InsertSqlStatement; m_TableUserControlHelper.DeleteSqlStatement = DeleteSqlStatement; m_TableUserControlHelper.FillSqlStatement = FillSqlStatement; m_TableUserControlHelper.ReadableSqlStatement = ReadableSqlStatement; m_TableUserControlHelper.ActuallSpecialFieldProcessing = ActuallSpecialFieldProcessing; Assembly SelectionAssembly = Assembly.LoadFrom (m_TableHandlerDefinition.m_SelectionControlAssemblyNameForThisTable); Object SelectionInstance = SelectionAssembly.CreateInstance (m_TableHandlerDefinition.m_SelectionControlClassNameForThisTable); Type SelectionType = SelectionInstance.GetType (); this.Content = ((System.Windows.Controls.UserControl) SelectionInstance); ISpecialTableInterface SpecialTableInterface = SelectionInstance as ISpecialTableInterface; if (SpecialTableInterface != null) { if (ProcessSelectableChangedCall != null) SpecialTableInterface.ProcessSelectableChangedCall += ProcessSelectableChangedCall; if (ProcessSelectableCreatingCall != null) SpecialTableInterface.ProcessSelectableCreatingCall += ProcessSelectableCreatingCall; if (ProcessSelectableModifyingCall != null) SpecialTableInterface.ProcessSelectableModifyingCall += ProcessSelectableModifyingCall; if (ProcessSelectableDeletingCall != null) SpecialTableInterface.ProcessSelectableDeletingCall += ProcessSelectableDeletingCall; if (ProcessSelectableCreatedCall != null) SpecialTableInterface.ProcessSelectableCreatedCall += ProcessSelectableCreatedCall; if (ProcessSelectableModifiedCall != null) SpecialTableInterface.ProcessSelectableModifiedCall += ProcessSelectableModifiedCall; if (ProcessSelectableDeletedCall != null) SpecialTableInterface.ProcessSelectableDeletedCall += ProcessSelectableDeletedCall; if (ProcessGetSelectedCall != null) SpecialTableInterface.ProcessGetSelectedCall += ProcessGetSelectedCall; if (ProcessNothingSelectedCall != null) SpecialTableInterface.ProcessNothingSelectedCall += ProcessNothingSelectedCall; if (ProcessNothingToProcessCall != null) SpecialTableInterface.ProcessNothingToProcessCall += ProcessNothingToProcessCall; if (CheckTheSelectionFillStatementCall != null) SpecialTableInterface.CheckTheSelectionFillStatementCall += CheckTheSelectionFillStatementCall; SpecialTableInterface.ActuallSpecialFieldProcessing = ActuallSpecialFieldProcessing; } //ToDO implement m_ICommonTableInterface = SelectionInstance as ICommonTableInterface; if (m_ICommonTableInterface == null) { throw new NotImplementedException (); } m_ICommonTableInterface.TableName = TableName; m_ICommonTableInterface.OldID = ID; m_ICommonTableInterface.m_DataBase = ParentsDataBase; m_ICommonTableInterface.SelectionWindowInstance = this; //this.SizeToContent = SizeToContent.WidthAndHeight; m_ICommonTableInterface.SetAdditionalRowFilterCall += SetAdditionalRowFilterCall; m_ICommonTableInterface.GetAdditionalLateBindingContextMenuEntriesCall += GetAdditionalLateBindingContextMenuEntriesCall; m_ICommonTableInterface.DoDataGridStylingBeforeShowCall += DoDataGridStylingBeforeShowCall; m_ICommonTableInterface.HandleShowAndEditListBoxEntry_MouseRightButtonUpCall += new HandleShowAndEditListBoxEntry_MouseRightButtonUpEvent (m_ICommonTableInterface_HandleShowAndEditListBoxEntry_MouseRightButtonUpCall); m_ICommonTableInterface.DoTableHandlingStartup (); }
public void SetData (String Bereich, CommonDataBase.DataBase ParentsDataBase, object Sender, string TableNameParameter, String ConnectionFieldName, string ID, string [] Additionals, string [] BackAdditionals) { m_Bereich = Bereich; m_Sender = Sender; TableName = TableNameParameter; m_ID = ID; m_Additionals = Additionals; m_BackAdditionals = BackAdditionals; this.Title = ConnectionFieldName + " aus " + TableName + " kann ausgewählt werden"; if (WMB.WPMediaApplicationState.Instance.Properties ["HandlerFor_" + TableName] != null) m_TableHandlerDefinition = (CommonDataBase.TableHandlerDefinition) WMB.WPMediaApplicationState.Instance.Properties ["HandlerFor_" + TableName]; else m_TableHandlerDefinition = new CommonDataBase.TableHandlerDefinition (null); SelectionRootGrid.Children.Clear (); Assembly SelectionAssembly = Assembly.LoadFrom (m_TableHandlerDefinition.m_SelectionControlAssemblyNameForThisTable); Object SelectionInstance = SelectionAssembly.CreateInstance (m_TableHandlerDefinition.m_SelectionControlClassNameForThisTable); Type SelectionType = SelectionInstance.GetType (); SelectionRootGrid.Children.Add ((System.Windows.UIElement) SelectionInstance); m_ICommonTableInterface = SelectionInstance as ICommonTableInterface; if (m_ICommonTableInterface == null) { throw new NotImplementedException (); } m_ICommonTableInterface.OldID = ID; m_ICommonTableInterface.DataBase = ParentsDataBase; m_ICommonTableInterface.SelectionWindowInstance = this; m_ICommonTableInterface.LayoutDefinitionsPropertyToken = "TableLayoutDefinitions_"; this.SizeToContent = SizeToContent.WidthAndHeight; }