Exemple #1
0
            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;
                StateD       stated           = (StateD)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;
            }
Exemple #2
0
        public override Object FillPropertyGridFromState(Object ClassInstance, PropertyGrid SelectedPgrid)
        {
            StateD Selectedstate = new StateD();
            StateD Dynamicstate  = new StateD();

            Selectedstate = (StateD)SelectedPgrid.SelectedObject;
            Dynamicstate  = (StateD)ClassInstance;

            Dynamicstate._Description          = Selectedstate.StateDescription;
            Dynamicstate.BrandId               = Selectedstate.BrandId;
            Dynamicstate.ConfigId              = Selectedstate.ConfigId;
            Dynamicstate._APreSetMask          = Selectedstate.APreSetMask;
            Dynamicstate._BPreSetMask          = Selectedstate.BPreSetMask;
            Dynamicstate._clearMask            = Selectedstate.ClearMask;
            Dynamicstate._CPreSetMask          = Selectedstate.CPreSetMask;
            Dynamicstate._DPreSetMask          = Selectedstate.DPreSetMask;
            Dynamicstate._FPreSetMask          = Selectedstate.FPreSetMask;
            Dynamicstate._GPreSetMask          = Selectedstate.GPreSetMask;
            Dynamicstate._HPreSetMask          = Selectedstate.HPreSetMask;
            Dynamicstate._IPreSetMask          = Selectedstate.IPreSetMask;
            Dynamicstate._ExtensionDescription = Selectedstate.ExtensionDescription;
            Dynamicstate._ExtensionStateNumber = Selectedstate.ExtensionStateNumber;

            //Dynamicstate._nextState = Selectedstate._nextState;

            return(Dynamicstate);
        }
Exemple #3
0
        public override object CreateInsertCommandScript(PropertyGrid SelectedPgrid, string ProjectName, string TransactionName, int ExtensionStateNumber)
        {
            StateD Stated = new StateD();

            Stated = (StateD)SelectedPgrid.SelectedObject;
            List <string> SqlStringList = new List <string>();

            string sql = SqlStr;
            //Extension
            string exsql = sql;

            if (Stated.ExtensionStateNumber != "255")
            {
                exsql = string.Format(exsql, Guid, Status, DateTime.Now.ToString("yyyyMMddHHmmss"), Stated.ExtensionStateNumber, Stated.ExtensionDescription,
                                      Stated.ExtensionType, ProjectName, TransactionName, Stated.FPreSetMask, Stated.GPreSetMask, Stated.HPreSetMask, Stated.IPreSetMask,
                                      Stated.ExtensionReserved, Stated.ExtensionReserved, Stated.ExtensionReserved, Stated.ExtensionReserved,
                                      Stated.ConfigId, Stated.BrandId, Stated.ConfigVersion);
                SqlStringList.Add(exsql);
            }

            sql = string.Format(sql, Guid, Status, DateTime.Now.ToString("yyyyMMddHHmmss"), Stated.StateNumber, Stated.StateDescription,
                                Stated.StateType, ProjectName, TransactionName, Stated.NextState, Stated.ClearMask, Stated.APreSetMask, Stated.BPreSetMask,
                                Stated.CPreSetMask, Stated.DPreSetMask, Stated.Reserved, Stated.ExtensionStateNumber, Stated.ConfigId, Stated.BrandId, ConfigVersion);
            SqlStringList.Add(sql);


            return(SqlStringList);
        }
Exemple #4
0
        public override Object StateChanged(string SelectedProperty, string newValue, Object ClassInstance, PropertyGrid SelectedPgrid)
        {
            //FillStateFromPropertyGrid(ClassInstance, SelectedPgrid);
            StateD Selectedstate = new StateD();
            StateD Dynamicstate  = new StateD();

            Selectedstate             = (StateD)SelectedPgrid.SelectedObject;
            Dynamicstate              = (StateD)ClassInstance;
            Dynamicstate._Description = Selectedstate.StateDescription;
            Dynamicstate.BrandId      = Selectedstate.BrandId;
            Dynamicstate.ConfigId     = Selectedstate.ConfigId;

            Dynamicstate._ExtensionStateNumber = Selectedstate.ExtensionStateNumber;
            Dynamicstate._ExtensionDescription = Selectedstate.ExtensionDescription;
            Dynamicstate._APreSetMask          = Selectedstate.APreSetMask;
            Dynamicstate._BPreSetMask          = Selectedstate.BPreSetMask;
            Dynamicstate._clearMask            = Selectedstate.ClearMask;
            Dynamicstate._CPreSetMask          = Selectedstate.CPreSetMask;
            Dynamicstate._DPreSetMask          = Selectedstate.DPreSetMask;
            Dynamicstate._FPreSetMask          = Selectedstate.FPreSetMask;
            Dynamicstate._GPreSetMask          = Selectedstate.GPreSetMask;
            Dynamicstate._HPreSetMask          = Selectedstate.HPreSetMask;
            Dynamicstate._IPreSetMask          = Selectedstate.IPreSetMask;
            Dynamicstate._NextState            = Selectedstate.NextState;

            return(Dynamicstate);
        }
Exemple #5
0
        public override object FillStatesFromDB(object[] processRow, ArrayList StateList)
        {
            StateD stated = new StateD();
            ModelCanvasStateObject        TransStateObj = new ModelCanvasStateObject();
            List <ModelParentStateObject> ParentobjList = new List <ModelParentStateObject>();
            List <ModelChildStateObject>  ChildobjList  = new List <ModelChildStateObject>();

            stated.Status                = processRow[1].ToString();
            stated.StateNumber           = processRow[3].ToString();
            stated.StateDescription      = processRow[4].ToString();
            stated.StateType             = processRow[5].ToString();
            stated._NextState            = processRow[8].ToString();
            stated._clearMask            = processRow[9].ToString();
            stated._APreSetMask          = processRow[10].ToString();
            stated._BPreSetMask          = processRow[11].ToString();
            stated._CPreSetMask          = processRow[12].ToString();
            stated._DPreSetMask          = processRow[13].ToString();
            stated._Reserved             = processRow[14].ToString();
            stated._ExtensionStateNumber = processRow[15].ToString();
            stated.ConfigId              = processRow[16].ToString();
            stated.BrandId               = processRow[17].ToString();
            stated.ConfigVersion         = processRow[18].ToString();

            //Extension State Kontrolu
            if (stated.ExtensionStateNumber != "255")
            {
                object[] ExtensionState = GetExtensionState(ref StateList, stated.ExtensionStateNumber);
                stated._ExtensionDescription = ExtensionState[4].ToString();
                stated._FPreSetMask          = ExtensionState[8].ToString();
                stated._GPreSetMask          = ExtensionState[9].ToString();
                stated._HPreSetMask          = ExtensionState[10].ToString();
                stated._IPreSetMask          = ExtensionState[11].ToString();
            }

            //NextState Kontrolu
            if (stated.NextState != "255")
            {
                ChildobjList.Add(GetChildState("NextState", stated.NextState, StateList, processRow[7].ToString(), stated.StateType, stated.StateNumber));
            }

            TransStateObj.BrandId          = stated.BrandId;
            TransStateObj.ConfigId         = stated.ConfigId;
            TransStateObj.Id               = stated.StateNumber;
            TransStateObj.StateDescription = stated.StateDescription;
            TransStateObj.Type             = stated.StateType;
            TransStateObj.TransactionName  = processRow[7].ToString();

            TransStateObj.PropertyGrid.SelectedObject = stated;
            TransStateObj.ParentStateList             = ParentobjList;
            TransStateObj.ChildStateList = ChildobjList;
            designerCanvas.TransactionList.Add(TransStateObj);

            return(StateList);
        }