public StateCollectionEditorDialog(StateCollection collection)
        {
            InitializeComponent();

            Collection = new StateCollection(collection.Owner, collection.ItemType);
            foreach (StateItem stateItem in collection)
            {
                if (stateItem.StateText == "Initial"
                    || stateItem.StateText == "Browsed"
                    || stateItem.StateText == "Inserting"
                    || stateItem.StateText == "Editing"
                    || stateItem.StateText == "Applying"
                    || stateItem.StateText == "Changing"
                    || stateItem.StateText == "Querying"
                    || stateItem.StateText == "Printing")
                {
                    foreach (StateItem si in Collection)
                    {
                        if (si.StateText == stateItem.StateText)
                        {
                            si.Collection = Collection;
                            foreach (string ctrlName in stateItem.EnabledControls)
                            {
                                si.EnabledControls.Add(ctrlName);
                            }
                            si.Name = stateItem.Name;
                            si.Description = stateItem.Description;
                            si.EnabledControlsEdited = stateItem.EnabledControlsEdited;
                            break;
                        }
                    }
                }
                else
                {
                    StateItem si = new StateItem();
                    Collection.Add(si);

                    si.Collection = Collection;
                    foreach (string ctrlName in stateItem.EnabledControls)
                    {
                        si.EnabledControls.Add(ctrlName);
                    }
                    si.Name = stateItem.Name;
                    si.StateText = stateItem.StateText;
                    si.Description = stateItem.Description;
                    si.EnabledControlsEdited = stateItem.EnabledControlsEdited;
                }
            }
        }
Пример #2
0
        // End Add
        public InfoNavigator()
        {
            this.SureInsert = false;
            this.SureDelete = true;
            this.QuerySQLSend = true;
            this.InternalQuery = true;
            this._ViewScrollProtect = false;

            m_states = new StateCollection(this, typeof(StateItem));
            //m_sureDeleteText = "Are you sure to delete current record?";
            //m_sureInsertText = "Are you sure to insert record?";

            this.LayoutCompleted += new EventHandler(InfoNavigator_LayoutCompleted);
            _QueryFields = new QueryFieldCollection(this, typeof(QueryField));
            _QueryMode = QueryModeType.ClientQuery;
            _QueryFont = new Font("SimSun", 9.0f);
        }