void ccb_ItemSelectionChanged(object sender, Xceed.Wpf.Toolkit.Primitives.ItemSelectionChangedEventArgs e) { Xceed.Wpf.Toolkit.CheckComboBox ccb = (Xceed.Wpf.Toolkit.CheckComboBox)sender; int mask = 0; foreach (var item in ccb.SelectedItems) { double index = Convert.ToDouble(item.ToString().Substring(6)); mask = mask + (int)Math.Pow(2, index); } ccb.Text = mask.ToString("000"); var Selection = designerCanvas.SelectionService.CurrentSelection; ViewModelDesignerItem Ditem = new ViewModelDesignerItem(); foreach (var slc in Selection) { Ditem = (ViewModelDesignerItem)slc; } DockPanel Sourcepnl = (DockPanel)Ditem.Content; PropertyGrid SelectedPgrid = designerCanvas.TransactionList.Find(x => x.Id == Sourcepnl.Uid).PropertyGrid; string SelectedProperty = property.DisplayName; string newValue = ccb.Text; StateX stated = (StateX)SelectedPgrid.SelectedObject; Type ClassType = stated.GetType(); PropertyInfo propertyName = ClassType.GetProperty(SelectedProperty); propertyName.SetValue(stated, newValue, null); designerCanvas.TransactionList.Find(x => x.Id == Sourcepnl.Uid).PropertyGrid.SelectedObject = stated; }
public override Object FillPropertyGridFromState(Object ClassInstance, PropertyGrid SelectedPgrid) { StateX Selectedstate = new StateX(); StateX Dynamicstate = new StateX(); Selectedstate = (StateX)SelectedPgrid.SelectedObject; Dynamicstate = (StateX)ClassInstance; Dynamicstate.BrandId = Selectedstate.BrandId; Dynamicstate.ConfigId = Selectedstate.ConfigId; Dynamicstate._Description = Selectedstate.StateDescription; Dynamicstate._bufferID = Selectedstate._bufferID; //Dynamicstate._cancelnextState = Selectedstate._cancelnextState; Dynamicstate._numberOfZeroes = Selectedstate._numberOfZeroes; Dynamicstate._Reserved = Selectedstate._Reserved; Dynamicstate._screen = Selectedstate._screen; //Dynamicstate._timeoutnextState = Selectedstate._timeoutnextState; //Dynamicstate._fdkNextState = Selectedstate._fdkNextState; Dynamicstate._ExtensionDescription = Selectedstate.ExtensionDescription; Dynamicstate._AFDKActive = Selectedstate._AFDKActive; Dynamicstate._BFDKActive = Selectedstate._BFDKActive; Dynamicstate._CFDKActive = Selectedstate._CFDKActive; Dynamicstate._DFDKActive = Selectedstate._DFDKActive; Dynamicstate._FFDKActive = Selectedstate._FFDKActive; Dynamicstate._GFDKActive = Selectedstate._GFDKActive; Dynamicstate._HFDKActive = Selectedstate._HFDKActive; Dynamicstate._IFDKActive = Selectedstate._IFDKActive; return(Dynamicstate); }
public override object CreateInsertCommandScript(PropertyGrid SelectedPgrid, string ProjectName, string TransactionName, int ExtensionStateNumber) { StateX State = new StateX(); State = (StateX)SelectedPgrid.SelectedObject; List <string> SqlStringList = new List <string>(); string sql = SqlStr; //Extension string exsql = sql; if (State.ExtensionStateNumber != "255") { exsql = string.Format(exsql, Guid, Status, DateTime.Now.ToString("yyyyMMddHHmmss"), State.ExtensionStateNumber, State.ExtensionDescription, State.ExtensionStateType, ProjectName, TransactionName, State.FDK_A_Active, State.FDK_B_Active, State.FDK_C_Active, State.FDK_D_Active, State.FDK_F_Active, State.FDK_G_Active, State.FDK_H_Active, State.FDK_I_Active, State.ConfigId, State.BrandId, State.ConfigVersion); SqlStringList.Add(exsql); } sql = string.Format(sql, Guid, Status, DateTime.Now.ToString("yyyyMMddHHmmss"), State.StateNumber, State.StateDescription, State.StateType, ProjectName, TransactionName, State.ScreenNumber, State.TimeoutNextState, State.CancelNextState, State.FDKNextState, State.ExtensionStateNumber, State.BufferID + State.PaddingNumberOfZeroes, State.FDKActiveMask, State.Reserved, State.ConfigId, State.BrandId, State.ConfigVersion); SqlStringList.Add(sql); return(SqlStringList); }
public override Object StateChanged(string SelectedProperty, string newValue, Object ClassInstance, PropertyGrid SelectedPgrid) { //FillStateFromPropertyGrid(ClassInstance, SelectedPgrid); StateX Selectedstate = new StateX(); StateX Dynamicstate = new StateX(); Selectedstate = (StateX)SelectedPgrid.SelectedObject; Dynamicstate = (StateX)ClassInstance; Dynamicstate._Description = Selectedstate.StateDescription; Dynamicstate.BrandId = Selectedstate.BrandId; Dynamicstate.ConfigId = Selectedstate.ConfigId; Dynamicstate._bufferID = Selectedstate._bufferID; Dynamicstate._cancelNextState = Selectedstate._cancelNextState; Dynamicstate._numberOfZeroes = Selectedstate._numberOfZeroes; Dynamicstate._Reserved = Selectedstate._Reserved; Dynamicstate._screen = Selectedstate._screen; Dynamicstate._timeoutNextState = Selectedstate._timeoutNextState; Dynamicstate._fdkNextState = Selectedstate._fdkNextState; Dynamicstate._ExtensionDescription = Selectedstate.ExtensionDescription; Dynamicstate._AFDKActive = Selectedstate._AFDKActive; Dynamicstate._BFDKActive = Selectedstate._BFDKActive; Dynamicstate._CFDKActive = Selectedstate._CFDKActive; Dynamicstate._DFDKActive = Selectedstate._DFDKActive; Dynamicstate._FFDKActive = Selectedstate._FFDKActive; Dynamicstate._GFDKActive = Selectedstate._GFDKActive; Dynamicstate._HFDKActive = Selectedstate._HFDKActive; Dynamicstate._IFDKActive = Selectedstate._IFDKActive; return(Dynamicstate); }
public override object FillStatesFromDB(object[] processRow, ArrayList StateList) { StateX state = new StateX(); ModelCanvasStateObject TransStateObj = new ModelCanvasStateObject(); List <ModelParentStateObject> ParentobjList = new List <ModelParentStateObject>(); List <ModelChildStateObject> ChildobjList = new List <ModelChildStateObject>(); state.Status = processRow[1].ToString(); state.StateNumber = processRow[3].ToString(); state.StateDescription = processRow[4].ToString(); state.StateType = processRow[5].ToString(); state._screen = processRow[8].ToString(); state._timeoutNextState = processRow[9].ToString(); state._cancelNextState = processRow[10].ToString(); state._fdkNextState = processRow[11].ToString(); state._ExtensionStateNumber = processRow[12].ToString(); state._bufferID = processRow[13].ToString().Substring(0, 2); state._numberOfZeroes = processRow[13].ToString().Substring(2, 1); state._FDKActiveMask = processRow[14].ToString(); state._Reserved = processRow[15].ToString(); state.ConfigId = processRow[16].ToString(); state.BrandId = processRow[17].ToString(); state.ConfigVersion = processRow[18].ToString(); //Extension if (state.ExtensionStateNumber != "255") { object[] ExtensionStates = GetExtensionState(ref StateList, state.ExtensionStateNumber); state._ExtensionDescription = ExtensionStates[4].ToString(); state._AFDKActive = ExtensionStates[8].ToString(); state._BFDKActive = ExtensionStates[9].ToString(); state._CFDKActive = ExtensionStates[10].ToString(); state._DFDKActive = ExtensionStates[11].ToString(); state._FFDKActive = ExtensionStates[12].ToString(); state._GFDKActive = ExtensionStates[13].ToString(); state._HFDKActive = ExtensionStates[14].ToString(); state._IFDKActive = ExtensionStates[15].ToString(); } //NextState Kontrolu if (state.TimeoutNextState != "255") { ChildobjList.Add(GetChildState("TimeoutNextState", state.TimeoutNextState, StateList, processRow[7].ToString(), state.StateType, state.StateNumber)); } //NextState Kontrolu if (state.CancelNextState != "255") { ChildobjList.Add(GetChildState("CancelNextState", state.CancelNextState, StateList, processRow[7].ToString(), state.StateType, state.StateNumber)); } //NextState Kontrolu if (state.FDKNextState != "255") { ChildobjList.Add(GetChildState("FDKNextState", state.FDKNextState, StateList, processRow[7].ToString(), state.StateType, state.StateNumber)); } TransStateObj.BrandId = state.BrandId; TransStateObj.ConfigId = state.ConfigId; TransStateObj.Id = state.StateNumber; TransStateObj.StateDescription = state.StateDescription; TransStateObj.Type = state.StateType; TransStateObj.TransactionName = processRow[7].ToString(); TransStateObj.PropertyGrid.SelectedObject = state; TransStateObj.ParentStateList = ParentobjList; TransStateObj.ChildStateList = ChildobjList; designerCanvas.TransactionList.Add(TransStateObj); return(StateList); }