Ejemplo n.º 1
0
 /// <summary>
 /// 设置控件组是否显示
 /// </summary>
 /// <returns></returns>
 public static void ToVisibility(this DevExpress.XtraLayout.EmptySpaceItem control, bool visible)
 {
     if (visible)
     {
         control.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Always;
     }
     else
     {
         control.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
     }
 }
Ejemplo n.º 2
0
        //public UCPropertyInfo2D(FrmSimpleConditionQuery2D dialog)
        //{
        //    InitializeComponent();
        //    _dtShow = new DataTable();
        //    _dtShow.Columns.AddRange(new DataColumn[] { new DataColumn("Property"), new DataColumn("Value") });
        //    this.gridControl1.DataSource = _dtShow;


        //    ////IFeatureClass fc;
        //    //Dictionary<DF2DFeatureClass, DataTable> dic = dialog.QueryDTByLayer;
        //    //DataTable _dt = null;

        //    //if (dialog.SelectFeatureClass != null)
        //    //{
        //    //    for (int i = 0; i < dialog.SelectFeatureClass.Count; i++)
        //    //    {
        //    //        this.cbLayer.Properties.Items.Add(dialog.SelectFeatureClass[i].GetFeatureClass().AliasName);
        //    //    }
        //    //    this.cbLayer.SelectedItem = this.cbLayer.Properties.Items[0];
        //    //}
        //    //if (this.cbLayer.SelectedItem != null)
        //    //{



        //    //    foreach (KeyValuePair<DF2DFeatureClass, DataTable> v in dic)
        //    //    {
        //    //        if (v.Key.GetFeatureClass().AliasName == this.cbLayer.SelectedItem.ToString())
        //    //        {
        //    //            _dt = v.Value;
        //    //        }
        //    //        continue;


        //    //    }
        //    //}
        //    //if (_dt != null)
        //    //{

        //    //    int _num = 1;
        //    //    ShowProperty(_dtShow, _dt, _num);
        //    //}

        //}
        private void InitializeComponent()
        {
            DevExpress.XtraGrid.GridLevelNode gridLevelNode1         = new DevExpress.XtraGrid.GridLevelNode();
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(UCPropertyInfo2D));
            this.layoutControl1       = new DevExpress.XtraLayout.LayoutControl();
            this.cbLayer              = new DevExpress.XtraEditors.ComboBoxEdit();
            this.gridControl1         = new DevExpress.XtraGrid.GridControl();
            this.gridView1            = new DevExpress.XtraGrid.Views.Grid.GridView();
            this.gridColumn1          = new DevExpress.XtraGrid.Columns.GridColumn();
            this.gridColumn2          = new DevExpress.XtraGrid.Columns.GridColumn();
            this.barManager1          = new DevExpress.XtraBars.BarManager();
            this.bar1                 = new DevExpress.XtraBars.Bar();
            this.bbiFirst             = new DevExpress.XtraBars.BarButtonItem();
            this.bbiPreviousOne       = new DevExpress.XtraBars.BarButtonItem();
            this.bbiNextOne           = new DevExpress.XtraBars.BarButtonItem();
            this.bbiLastOne           = new DevExpress.XtraBars.BarButtonItem();
            this.bsiInfo              = new DevExpress.XtraBars.BarStaticItem();
            this.barDockControlTop    = new DevExpress.XtraBars.BarDockControl();
            this.barDockControlBottom = new DevExpress.XtraBars.BarDockControl();
            this.barDockControlLeft   = new DevExpress.XtraBars.BarDockControl();
            this.barDockControlRight  = new DevExpress.XtraBars.BarDockControl();
            this.imageCollection1     = new DevExpress.Utils.ImageCollection();
            this.layoutControlGroup1  = new DevExpress.XtraLayout.LayoutControlGroup();
            this.emptySpaceItem1      = new DevExpress.XtraLayout.EmptySpaceItem();
            this.layoutControlItem1   = new DevExpress.XtraLayout.LayoutControlItem();
            this.emptySpaceItem3      = new DevExpress.XtraLayout.EmptySpaceItem();
            this.emptySpaceItem2      = new DevExpress.XtraLayout.EmptySpaceItem();
            this.layoutControlItem3   = new DevExpress.XtraLayout.LayoutControlItem();
            ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
            this.layoutControl1.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.cbLayer.Properties)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.gridControl1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.gridView1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.barManager1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.imageCollection1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem3)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem2)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).BeginInit();
            this.SuspendLayout();
            //
            // layoutControl1
            //
            this.layoutControl1.Controls.Add(this.cbLayer);
            this.layoutControl1.Controls.Add(this.gridControl1);
            this.layoutControl1.Dock     = System.Windows.Forms.DockStyle.Fill;
            this.layoutControl1.Location = new System.Drawing.Point(0, 31);
            this.layoutControl1.Name     = "layoutControl1";
            this.layoutControl1.OptionsCustomizationForm.DesignTimeCustomizationFormPositionAndSize = new System.Drawing.Rectangle(327, 210, 543, 464);
            this.layoutControl1.Root     = this.layoutControlGroup1;
            this.layoutControl1.Size     = new System.Drawing.Size(284, 385);
            this.layoutControl1.TabIndex = 0;
            this.layoutControl1.Text     = "layoutControl1";
            //
            // cbLayer
            //
            this.cbLayer.Location = new System.Drawing.Point(75, 2);
            this.cbLayer.Name     = "cbLayer";
            this.cbLayer.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
                new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)
            });
            this.cbLayer.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor;
            this.cbLayer.Size                  = new System.Drawing.Size(197, 22);
            this.cbLayer.StyleController       = this.layoutControl1;
            this.cbLayer.TabIndex              = 0;
            this.cbLayer.SelectedIndexChanged += new System.EventHandler(this.cbLayer_SelectedIndexChanged);
            //
            // gridControl1
            //
            gridLevelNode1.RelationName = "Level1";
            this.gridControl1.LevelTree.Nodes.AddRange(new DevExpress.XtraGrid.GridLevelNode[] {
                gridLevelNode1
            });
            this.gridControl1.Location    = new System.Drawing.Point(2, 28);
            this.gridControl1.MainView    = this.gridView1;
            this.gridControl1.MenuManager = this.barManager1;
            this.gridControl1.Name        = "gridControl1";
            this.gridControl1.Size        = new System.Drawing.Size(280, 345);
            this.gridControl1.TabIndex    = 1;
            this.gridControl1.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
                this.gridView1
            });
            //
            // gridView1
            //
            this.gridView1.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
                this.gridColumn1,
                this.gridColumn2
            });
            this.gridView1.GridControl                = this.gridControl1;
            this.gridView1.IndicatorWidth             = 30;
            this.gridView1.Name                       = "gridView1";
            this.gridView1.OptionsView.ShowGroupPanel = false;
            //
            // gridColumn1
            //
            this.gridColumn1.Caption   = "属性";
            this.gridColumn1.FieldName = "Property";
            this.gridColumn1.Name      = "gridColumn1";
            this.gridColumn1.OptionsColumn.AllowEdit = false;
            this.gridColumn1.Visible      = true;
            this.gridColumn1.VisibleIndex = 0;
            //
            // gridColumn2
            //
            this.gridColumn2.Caption   = "属性值";
            this.gridColumn2.FieldName = "Value";
            this.gridColumn2.Name      = "gridColumn2";
            this.gridColumn2.OptionsColumn.AllowEdit = false;
            this.gridColumn2.Visible      = true;
            this.gridColumn2.VisibleIndex = 1;
            //
            // barManager1
            //
            this.barManager1.Bars.AddRange(new DevExpress.XtraBars.Bar[] {
                this.bar1
            });
            this.barManager1.DockControls.Add(this.barDockControlTop);
            this.barManager1.DockControls.Add(this.barDockControlBottom);
            this.barManager1.DockControls.Add(this.barDockControlLeft);
            this.barManager1.DockControls.Add(this.barDockControlRight);
            this.barManager1.Form   = this;
            this.barManager1.Images = this.imageCollection1;
            this.barManager1.Items.AddRange(new DevExpress.XtraBars.BarItem[] {
                this.bbiFirst,
                this.bbiPreviousOne,
                this.bbiNextOne,
                this.bbiLastOne,
                this.bsiInfo
            });
            this.barManager1.MaxItemId = 9;
            //
            // bar1
            //
            this.bar1.BarName       = "Tools";
            this.bar1.DockCol       = 0;
            this.bar1.DockRow       = 0;
            this.bar1.DockStyle     = DevExpress.XtraBars.BarDockStyle.Top;
            this.bar1.FloatLocation = new System.Drawing.Point(13, 164);
            this.bar1.LinksPersistInfo.AddRange(new DevExpress.XtraBars.LinkPersistInfo[] {
                new DevExpress.XtraBars.LinkPersistInfo(this.bbiFirst),
                new DevExpress.XtraBars.LinkPersistInfo(this.bbiPreviousOne),
                new DevExpress.XtraBars.LinkPersistInfo(this.bbiNextOne),
                new DevExpress.XtraBars.LinkPersistInfo(this.bbiLastOne),
                new DevExpress.XtraBars.LinkPersistInfo(this.bsiInfo)
            });
            this.bar1.OptionsBar.AllowQuickCustomization = false;
            this.bar1.Text = "Tools";
            //
            // bbiFirst
            //
            this.bbiFirst.Caption            = "第一个";
            this.bbiFirst.Id                 = 2;
            this.bbiFirst.ImageIndex         = 0;
            this.bbiFirst.ImageIndexDisabled = 4;
            this.bbiFirst.Name               = "bbiFirst";
            this.bbiFirst.ItemClick         += new DevExpress.XtraBars.ItemClickEventHandler(this.bbiFirst_ItemClick);
            //
            // bbiPreviousOne
            //
            this.bbiPreviousOne.Caption            = "上一个";
            this.bbiPreviousOne.Id                 = 3;
            this.bbiPreviousOne.ImageIndex         = 1;
            this.bbiPreviousOne.ImageIndexDisabled = 5;
            this.bbiPreviousOne.Name               = "bbiPreviousOne";
            this.bbiPreviousOne.ItemClick         += new DevExpress.XtraBars.ItemClickEventHandler(this.bbiPreviousOne_ItemClick);
            //
            // bbiNextOne
            //
            this.bbiNextOne.Caption            = "下一个";
            this.bbiNextOne.Id                 = 4;
            this.bbiNextOne.ImageIndex         = 2;
            this.bbiNextOne.ImageIndexDisabled = 6;
            this.bbiNextOne.Name               = "bbiNextOne";
            this.bbiNextOne.ItemClick         += new DevExpress.XtraBars.ItemClickEventHandler(this.bbiNextOne_ItemClick);
            //
            // bbiLastOne
            //
            this.bbiLastOne.Caption            = "最后一个";
            this.bbiLastOne.Id                 = 5;
            this.bbiLastOne.ImageIndex         = 3;
            this.bbiLastOne.ImageIndexDisabled = 7;
            this.bbiLastOne.Name               = "bbiLastOne";
            this.bbiLastOne.ItemClick         += new DevExpress.XtraBars.ItemClickEventHandler(this.bbiLastOne_ItemClick);
            //
            // bsiInfo
            //
            this.bsiInfo.Caption       = "浏览 0/0";
            this.bsiInfo.Id            = 8;
            this.bsiInfo.Name          = "bsiInfo";
            this.bsiInfo.TextAlignment = System.Drawing.StringAlignment.Near;
            //
            // barDockControlTop
            //
            this.barDockControlTop.CausesValidation = false;
            this.barDockControlTop.Dock             = System.Windows.Forms.DockStyle.Top;
            this.barDockControlTop.Location         = new System.Drawing.Point(0, 0);
            this.barDockControlTop.Size             = new System.Drawing.Size(284, 31);
            //
            // barDockControlBottom
            //
            this.barDockControlBottom.CausesValidation = false;
            this.barDockControlBottom.Dock             = System.Windows.Forms.DockStyle.Bottom;
            this.barDockControlBottom.Location         = new System.Drawing.Point(0, 416);
            this.barDockControlBottom.Size             = new System.Drawing.Size(284, 0);
            //
            // barDockControlLeft
            //
            this.barDockControlLeft.CausesValidation = false;
            this.barDockControlLeft.Dock             = System.Windows.Forms.DockStyle.Left;
            this.barDockControlLeft.Location         = new System.Drawing.Point(0, 31);
            this.barDockControlLeft.Size             = new System.Drawing.Size(0, 385);
            //
            // barDockControlRight
            //
            this.barDockControlRight.CausesValidation = false;
            this.barDockControlRight.Dock             = System.Windows.Forms.DockStyle.Right;
            this.barDockControlRight.Location         = new System.Drawing.Point(284, 31);
            this.barDockControlRight.Size             = new System.Drawing.Size(0, 385);
            //
            // imageCollection1
            //
            this.imageCollection1.ImageStream = ((DevExpress.Utils.ImageCollectionStreamer)(resources.GetObject("imageCollection1.ImageStream")));
            this.imageCollection1.InsertGalleryImage("first_16x16.png", "images/arrows/first_16x16.png", DevExpress.Images.ImageResourceCache.Default.GetImage("images/arrows/first_16x16.png"), 0);
            this.imageCollection1.Images.SetKeyName(0, "first_16x16.png");
            this.imageCollection1.InsertGalleryImage("prev_16x16.png", "images/arrows/prev_16x16.png", DevExpress.Images.ImageResourceCache.Default.GetImage("images/arrows/prev_16x16.png"), 1);
            this.imageCollection1.Images.SetKeyName(1, "prev_16x16.png");
            this.imageCollection1.InsertGalleryImage("next_16x16.png", "images/arrows/next_16x16.png", DevExpress.Images.ImageResourceCache.Default.GetImage("images/arrows/next_16x16.png"), 2);
            this.imageCollection1.Images.SetKeyName(2, "next_16x16.png");
            this.imageCollection1.InsertGalleryImage("last_16x16.png", "images/arrows/last_16x16.png", DevExpress.Images.ImageResourceCache.Default.GetImage("images/arrows/last_16x16.png"), 3);
            this.imageCollection1.Images.SetKeyName(3, "last_16x16.png");
            //
            // layoutControlGroup1
            //
            this.layoutControlGroup1.CustomizationFormText       = "layoutControlGroup1";
            this.layoutControlGroup1.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True;
            this.layoutControlGroup1.GroupBordersVisible         = false;
            this.layoutControlGroup1.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
                this.emptySpaceItem1,
                this.layoutControlItem1,
                this.emptySpaceItem3,
                this.emptySpaceItem2,
                this.layoutControlItem3
            });
            this.layoutControlGroup1.Location    = new System.Drawing.Point(0, 0);
            this.layoutControlGroup1.Name        = "layoutControlGroup1";
            this.layoutControlGroup1.Padding     = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0);
            this.layoutControlGroup1.Size        = new System.Drawing.Size(284, 385);
            this.layoutControlGroup1.Text        = "layoutControlGroup1";
            this.layoutControlGroup1.TextVisible = false;
            //
            // emptySpaceItem1
            //
            this.emptySpaceItem1.AllowHotTrack         = false;
            this.emptySpaceItem1.CustomizationFormText = "emptySpaceItem1";
            this.emptySpaceItem1.Location = new System.Drawing.Point(0, 375);
            this.emptySpaceItem1.Name     = "emptySpaceItem1";
            this.emptySpaceItem1.Size     = new System.Drawing.Size(284, 10);
            this.emptySpaceItem1.Text     = "emptySpaceItem1";
            this.emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0);
            //
            // layoutControlItem1
            //
            this.layoutControlItem1.Control = this.gridControl1;
            this.layoutControlItem1.CustomizationFormText = "layoutControlItem1";
            this.layoutControlItem1.Location = new System.Drawing.Point(0, 26);
            this.layoutControlItem1.Name     = "layoutControlItem1";
            this.layoutControlItem1.Size     = new System.Drawing.Size(284, 349);
            this.layoutControlItem1.Text     = "layoutControlItem1";
            this.layoutControlItem1.TextSize = new System.Drawing.Size(0, 0);
            this.layoutControlItem1.TextToControlDistance = 0;
            this.layoutControlItem1.TextVisible           = false;
            //
            // emptySpaceItem3
            //
            this.emptySpaceItem3.AllowHotTrack         = false;
            this.emptySpaceItem3.CustomizationFormText = "emptySpaceItem3";
            this.emptySpaceItem3.Location = new System.Drawing.Point(274, 0);
            this.emptySpaceItem3.Name     = "emptySpaceItem3";
            this.emptySpaceItem3.Size     = new System.Drawing.Size(10, 26);
            this.emptySpaceItem3.Text     = "emptySpaceItem3";
            this.emptySpaceItem3.TextSize = new System.Drawing.Size(0, 0);
            //
            // emptySpaceItem2
            //
            this.emptySpaceItem2.AllowHotTrack         = false;
            this.emptySpaceItem2.CustomizationFormText = "emptySpaceItem2";
            this.emptySpaceItem2.Location = new System.Drawing.Point(0, 0);
            this.emptySpaceItem2.Name     = "emptySpaceItem2";
            this.emptySpaceItem2.Size     = new System.Drawing.Size(10, 26);
            this.emptySpaceItem2.Text     = "emptySpaceItem2";
            this.emptySpaceItem2.TextSize = new System.Drawing.Size(0, 0);
            //
            // layoutControlItem3
            //
            this.layoutControlItem3.Control = this.cbLayer;
            this.layoutControlItem3.CustomizationFormText = "layoutControlItem3";
            this.layoutControlItem3.Location = new System.Drawing.Point(10, 0);
            this.layoutControlItem3.Name     = "layoutControlItem3";
            this.layoutControlItem3.Size     = new System.Drawing.Size(264, 26);
            this.layoutControlItem3.Text     = "当前图层:";
            this.layoutControlItem3.TextSize = new System.Drawing.Size(60, 14);
            //
            // UCPropertyInfo2D
            //
            this.Controls.Add(this.layoutControl1);
            this.Controls.Add(this.barDockControlLeft);
            this.Controls.Add(this.barDockControlRight);
            this.Controls.Add(this.barDockControlBottom);
            this.Controls.Add(this.barDockControlTop);
            this.Name = "UCPropertyInfo2D";
            this.Size = new System.Drawing.Size(284, 416);
            ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).EndInit();
            this.layoutControl1.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.cbLayer.Properties)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.gridControl1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.gridView1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.barManager1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.imageCollection1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem3)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem2)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).EndInit();
            this.ResumeLayout(false);
        }
Ejemplo n.º 3
0
        private void propertyGridControl1_CellValueChanged(object sender, DevExpress.XtraVerticalGrid.Events.CellValueChangedEventArgs e)
        {
            CampaignQuestionnaire oQuestionnaire = propertyGridControl1.SelectedObject as CampaignQuestionnaire;
            if (oQuestionnaire == null) return;
            propertyGridControl1.SelectedObject = null;
            propertyGridControl1.SelectedObject = oQuestionnaire;

            this.layoutControlGroupPreview.BeginUpdate();
            this.layoutControlGroupPreview.BeginInit();
            //this.layoutControlGroupPreview.Clear();
            DisposeGroupControls(this.layoutControlGroupPreview);
            switch (oQuestionnaire.Type.ToLower()) {
                case QuestionTypeConstants.Dropbox:
                    Dropbox oDropbox = new Dropbox(this.layoutControlPreview);
                    oDropbox.DisableSelection = true;
                    oDropbox.ToolTipController = defaultToolTipController1;
                    oDropbox.Questionnaire = oQuestionnaire;
                    oDropbox.BindControls();
                    this.layoutControlGroupPreview.Add(oDropbox.ControlGroup);
                    break;
                case QuestionTypeConstants.MultipleChoice:
                    Multiplechoice oMultipleChoice = new Multiplechoice(this.layoutControlPreview);
                    oMultipleChoice.DisableSelection = true;
                    oMultipleChoice.Questionnaire = oQuestionnaire;
                    oMultipleChoice.BindControls();
                    this.layoutControlGroupPreview.Add(oMultipleChoice.ControlGroup);
                    break;
                case QuestionTypeConstants.Textbox:
                    Textbox oTextbox = new Textbox(this.layoutControlPreview);
                    oTextbox.DisableSelection = true;
                    oTextbox.Questionnaire = oQuestionnaire;
                    oTextbox.BindControls();
                    this.layoutControlGroupPreview.Add(oTextbox.ControlGroup);
                    break;
                case QuestionTypeConstants.Schedule:
                    Schedule oSchedule = new Schedule(this.layoutControlPreview);
                    oSchedule.DisableSelection = true;
                    oSchedule.Questionnaire = oQuestionnaire;
                    //TODO: Change this during the implementation of component user for account_id
                    oSchedule.Questionnaire.Form.Settings.DataBindings.account_id = "1";
                    oSchedule.BindControls();
                    this.layoutControlGroupPreview.Add(oSchedule.ControlGroup);
                    break;
                case QuestionTypeConstants.SmartText:
                    SmartText oSmartText = new SmartText(this.layoutControlPreview);
                    oSmartText.DisableSelection = true;
                    oSmartText.ToolTipController = defaultToolTipController1;
                    oSmartText.Questionnaire = oQuestionnaire;
                    oSmartText.BindPropertyGrid();
                    oSmartText.BindSampleDataTable();
                    this.layoutControlGroupPreview.Add(oSmartText.ControlGroup);
                    break;
                //case QuestionTypeConstants.Seminar:
                //    Seminar oSeminar = new Seminar(this.layoutControlPreview);
                //    oSeminar.DisableSelection = true;
                //    oSeminar.Questionnaire = oQuestionnaire;
                //    //TODO: Change this during the implementation of component user for account_id
                //    oSeminar.Questionnaire.Form.Settings.DataBindings.account_id = "1";
                //    oSeminar.BindControls();
                //    this.layoutControlGroupPreview.Add(oSeminar.ControlGroup);
                //    break;
            }
            DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem1 = new DevExpress.XtraLayout.EmptySpaceItem();
            emptySpaceItem1.CustomizationFormText = "emptySpaceItemBottom";
            emptySpaceItem1.Name = "emptySpaceItemBottom";
            emptySpaceItem1.ShowInCustomizationForm = false;
            emptySpaceItem1.Size = new System.Drawing.Size(0, 0);
            emptySpaceItem1.Text = "emptySpaceItemBottom";
            emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0);

            //add bottom spacer
            this.layoutControlGroupPreview.AddItem(emptySpaceItem1);
            this.layoutControlGroupPreview.EndInit();
            this.layoutControlGroupPreview.EndUpdate();
        }
Ejemplo n.º 4
0
        private void BindPropertyGrid(string questionTypeConstants, CampaignQuestionnaire Questionnaire)
        {
            CampaignQuestionnaire oQuestionnaire = null;

            if (Questionnaire != null) {
                oQuestionnaire = Questionnaire;
                if(oQuestionnaire.Form.Settings.Label == "[Sample label]")
                    oQuestionnaire.Form.Settings.Label = "";
            } else {
                oQuestionnaire = CampaignQuestionnaire.Instanciate(questionTypeConstants);
                oQuestionnaire.Form.Settings.Label = "";
            }
            int langId = 0;
            var obj = gridViewQuestion.GetFocusedRow();
            if (obj != null) {
                DataRowView drRowView = (DataRowView)obj;
                oQuestionnaire.Form.Settings.QuestionText = drRowView.Row["question"].ToString();
                oQuestionnaire.Form.Settings.QuestionHelp = drRowView.Row["helptext"].ToString();
                var langitem = lookUpEditLanguage.EditValue;
                if (langitem != null) {
                    langId = int.Parse(langitem.ToString());
                    var lang = BPContext.languages.FirstOrDefault(x => x.id == langId);
                    if (lang != null)
                        oQuestionnaire.Form.Settings.DataBindings.language_code = lang.code;
                }
            }
            var binding = oQuestionnaire.Form.Settings.DataBindings;
            if (string.IsNullOrEmpty(binding.language_code))
                binding.language_code = "SE";

            binding.account_level = (bool)rgLevel.EditValue;

            currentType = questionTypeConstants;
            this.layoutControlGroupPreview.BeginUpdate();
            //this.layoutControlGroupPreview.Clear();
            DisposeGroupControls(this.layoutControlGroupPreview);
            if (questionTypeConstants == QuestionTypeConstants.Dropbox) {
                Dropbox oDropbox = new Dropbox(this.layoutControlPreview);
                oDropbox.DisableSelection = true;
                oDropbox.ToolTipController = defaultToolTipController1;
                oDropbox.Questionnaire = oQuestionnaire;
                oDropbox.BindControls();
                this.layoutControlGroupPreview.Add(oDropbox.ControlGroup);
            } else if (questionTypeConstants == QuestionTypeConstants.Textbox) {
                Textbox oTextbox = new Textbox(this.layoutControlPreview);
                oTextbox.DisableSelection = true;
                oTextbox.ToolTipController = defaultToolTipController1;
                oTextbox.Questionnaire = oQuestionnaire;
                oTextbox.BindControls();
                this.layoutControlGroupPreview.Add(oTextbox.ControlGroup);
            } else if (questionTypeConstants == QuestionTypeConstants.MultipleChoice) {
                Multiplechoice oMultipleChoice = new Multiplechoice(this.layoutControlPreview);
                oMultipleChoice.DisableSelection = true;
                oMultipleChoice.ToolTipController = defaultToolTipController1;
                oMultipleChoice.Questionnaire = oQuestionnaire;
                oMultipleChoice.BindControls();
                this.layoutControlGroupPreview.Add(oMultipleChoice.ControlGroup);
            } else if (questionTypeConstants == QuestionTypeConstants.Schedule) {
                Schedule oSchedule = new Schedule(this.layoutControlPreview);
                oSchedule.DisableSelection = true;
                oSchedule.ToolTipController = defaultToolTipController1;
                oSchedule.Questionnaire = oQuestionnaire;
                //TODO: Change this during the implementation of component user for account_id
                //oSchedule.Questionnaire.Form.Settings.DataBindings.account_id = "1";
                oSchedule.BindControls();
                this.layoutControlGroupPreview.Add(oSchedule.ControlGroup);
            }
            else if (questionTypeConstants == QuestionTypeConstants.SmartText) {
                SmartText oSmartText = new SmartText(this.layoutControlPreview);
                oSmartText.DisableSelection = true;
                oSmartText.ToolTipController = defaultToolTipController1;
                oSmartText.Questionnaire = oQuestionnaire;
                oSmartText.BindPropertyGrid();
                oSmartText.BindSampleDataTable();
                this.layoutControlGroupPreview.Add(oSmartText.ControlGroup);
            }

            //else if (questionTypeConstants == QuestionTypeConstants.Seminar) {
            //    Seminar oSeminar = new Seminar(this.layoutControlPreview);
            //    oSeminar.DisableSelection = true;
            //    oSeminar.ToolTipController = defaultToolTipController1;
            //    oSeminar.Questionnaire = oQuestionnaire;
            //    //TODO: Change this during the implementation of component user for account_id
            //    oSeminar.Questionnaire.Form.Settings.DataBindings.account_id = "1";
            //    oSeminar.BindControls();
            //    this.layoutControlGroupPreview.Add(oSeminar.ControlGroup);
            //}
            DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem1 = new DevExpress.XtraLayout.EmptySpaceItem();
            emptySpaceItem1.CustomizationFormText = "emptySpaceItemBottom";
            emptySpaceItem1.Name = "emptySpaceItemBottom";
            emptySpaceItem1.ShowInCustomizationForm = false;
            emptySpaceItem1.Size = new System.Drawing.Size(0, 0);
            emptySpaceItem1.Text = "emptySpaceItemBottom";
            emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0);

            //add bottom spacer
            this.layoutControlGroupPreview.AddItem(emptySpaceItem1);
            this.layoutControlGroupPreview.EndUpdate();
            this.layoutControlPreview.BestFit();
            var answerOptionList = oQuestionnaire.Form.Settings.AnswerOptions;
            propertyGridControl1.SelectedObject = oQuestionnaire;
        }
Ejemplo n.º 5
0
        private void ShowDialog(string[] sFilter = null)
        {
            int rowcount = 0;
            bool hasRows = gridViewDialog.RowCount > 0;

            bool isContactLevel = true;
            bool isAccountLevel = true;

            if (sFilter != null) {
                if (sFilter.Length == 1) {
                    isContactLevel = sFilter[0].Trim() == "contact";
                    isAccountLevel = sFilter[0].Trim() == "account";
                } else if (sFilter.Length > 1) {
                    isContactLevel = sFilter[0].Trim() == "contact";
                    isAccountLevel = sFilter[1].Trim() == "account";
                }
            }

            DataTable dtDialog = null;

            if (!hasRows) {
                dtDialog = gridControlDialog.DataSource as DataTable;
                if (dtDialog == null || dtDialog.Rows.Count <= 0) {
                    DisposeGroupControls(layoutControlGroupQuestionnaire);
                    return;
                }
                rowcount = dtDialog.Rows.Count;
            } else {
                rowcount = gridViewDialog.RowCount;
            }

            DataRow row;
            CampaignQuestionnaire oQuestionnaire = null;

            layoutControlGroupQuestionnaire.BeginUpdate();
            layoutControlGroupQuestionnaire.BeginInit();
            DisposeGroupControls(layoutControlGroupQuestionnaire);
            bool hasActiveRows = false;
            for (int i = 0; i < rowcount; ++i) {
                if (hasRows)
                    row = gridViewDialog.GetDataRow(i);
                else
                    row = dtDialog.Rows[i];
                if (row.RowState == DataRowState.Deleted) continue;
                hasActiveRows = true;
                if (row["content_json"] == null || string.IsNullOrEmpty(row["content_json"].ToString())) continue;
                oQuestionnaire = CampaignQuestionnaire.InstanciateWith(row["content_json"].ToString());
                if (oQuestionnaire == null) continue;

                if (isAccountLevel && !isContactLevel) {
                    if (!oQuestionnaire.Form.Settings.DataBindings.account_level) continue;
                } else if (isContactLevel && !isAccountLevel) {
                    if (oQuestionnaire.Form.Settings.DataBindings.account_level) continue;
                } else if (!isAccountLevel && !isContactLevel) continue;

                if (row["question_text"] != null)
                    oQuestionnaire.Form.Settings.QuestionText = row["question_text"].ToString();
                if (row["question_help_text"] != null)
                    oQuestionnaire.Form.Settings.QuestionHelp = row["question_help_text"].ToString();
                if (row["language_code"] != null)
                    oQuestionnaire.Form.Settings.DataBindings.language_code = row["language_code"].ToString();

                switch (oQuestionnaire.Type.ToLower()) {
                    case QuestionTypeConstants.Dropbox:
                        Dropbox oDropbox = new Dropbox(this.layoutControlQuestionnaire);
                        oDropbox.DisableSelection = true;
                        oDropbox.ToolTipController = defaultToolTipController1;
                        oDropbox.Questionnaire = oQuestionnaire;
                        oDropbox.BindControls();
                        this.layoutControlGroupQuestionnaire.Add(oDropbox.ControlGroup);
                        break;
                    case QuestionTypeConstants.MultipleChoice:
                        Multiplechoice oMultipleChoice = new Multiplechoice(this.layoutControlQuestionnaire);
                        oMultipleChoice.DisableSelection = true;
                        oMultipleChoice.ToolTipController = defaultToolTipController1;
                        oMultipleChoice.Questionnaire = oQuestionnaire;
                        oMultipleChoice.BindControls();
                        this.layoutControlGroupQuestionnaire.Add(oMultipleChoice.ControlGroup);
                        break;
                    case QuestionTypeConstants.Textbox:
                        Textbox oTextbox = new Textbox(this.layoutControlQuestionnaire);
                        oTextbox.DisableSelection = true;
                        oTextbox.ToolTipController = defaultToolTipController1;
                        oTextbox.Questionnaire = oQuestionnaire;
                        oTextbox.BindControls();
                        this.layoutControlGroupQuestionnaire.Add(oTextbox.ControlGroup);
                        break;
                    case QuestionTypeConstants.Schedule:
                        Schedule oSchedule = new Schedule(this.layoutControlQuestionnaire);
                        oSchedule.DisableSelection = true;
                        oSchedule.ToolTipController = defaultToolTipController1;
                        oSchedule.Questionnaire = oQuestionnaire;
                        oSchedule.BindControls();
                        this.layoutControlGroupQuestionnaire.Add(oSchedule.ControlGroup);
                        break;
                    case QuestionTypeConstants.SmartText:
                        SmartText oSmartText = new SmartText(this.layoutControlQuestionnaire);
                        oSmartText.DisableSelection = true;
                        oSmartText.ToolTipController = defaultToolTipController1;
                        oSmartText.Questionnaire = oQuestionnaire;
                        oSmartText.BindControls();
                        oSmartText.BindPropertyGrid();
                        oSmartText.BindSampleDataTable();
                        this.layoutControlGroupQuestionnaire.Add(oSmartText.ControlGroup);
                        break;

                    //case QuestionTypeConstants.Seminar:
                    //    Seminar oSeminar = new Seminar(this.layoutControlQuestionnaire);
                    //    oSeminar.DisableSelection = true;
                    //    oSeminar.ToolTipController = defaultToolTipController1;
                    //    oSeminar.Questionnaire = oQuestionnaire;
                    //    oSeminar.BindControls();
                    //    this.layoutControlGroupQuestionnaire.Add(oSeminar.ControlGroup);
                    //    break;
                }

               // break;
            }
            if (!hasActiveRows) DisposeGroupControls(layoutControlGroupQuestionnaire);
            DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem1 = new DevExpress.XtraLayout.EmptySpaceItem();
            emptySpaceItem1.CustomizationFormText = "emptySpaceItemBottom";
            emptySpaceItem1.Name = "emptySpaceItemBottom";
            emptySpaceItem1.ShowInCustomizationForm = false;
            emptySpaceItem1.Size = new System.Drawing.Size(0, 0);
            emptySpaceItem1.MaxSize = new System.Drawing.Size(0, 0);
            emptySpaceItem1.Text = "emptySpaceItemBottom";
            emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0);

            //add bottom spacer
            this.layoutControlGroupQuestionnaire.AddItem(emptySpaceItem1);
            this.layoutControlGroupQuestionnaire.EndInit();
            this.layoutControlGroupQuestionnaire.EndUpdate();
            this.layoutControlQuestionnaire.BestFit();
        }
Ejemplo n.º 6
0
        private void InitializeComponent()
        {
            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject1 = new DevExpress.Utils.SerializableAppearanceObject();
            this.layoutControl1 = new DevExpress.XtraLayout.LayoutControl();
            this.simpleButtonCancel = new DevExpress.XtraEditors.SimpleButton();
            this.simpleButtonSave = new DevExpress.XtraEditors.SimpleButton();
            this.gridControlHistory = new DevExpress.XtraGrid.GridControl();
            this.gridViewHistory = new DevExpress.XtraGrid.Views.Grid.GridView();
            this.gridColumnId = new DevExpress.XtraGrid.Columns.GridColumn();
            this.gridColumnComment = new DevExpress.XtraGrid.Columns.GridColumn();
            this.repositoryItemMemoEdit1 = new DevExpress.XtraEditors.Repository.RepositoryItemMemoEdit();
            this.repositoryItemMemoEdit2 = new DevExpress.XtraEditors.Repository.RepositoryItemMemoEdit();
            this.gridColumnCreationDate = new DevExpress.XtraGrid.Columns.GridColumn();
            this.gridColumnUser = new DevExpress.XtraGrid.Columns.GridColumn();
            this.gridColumnCustomerContact = new DevExpress.XtraGrid.Columns.GridColumn();
            this.gridColumnDelete = new DevExpress.XtraGrid.Columns.GridColumn();
            this.repositoryItemButtonEdit1 = new DevExpress.XtraEditors.Repository.RepositoryItemButtonEdit();
            this.repositoryItemButtonEdit2 = new DevExpress.XtraEditors.Repository.RepositoryItemButtonEdit();
            this.memoEdit1 = new DevExpress.XtraEditors.MemoEdit();
            this.layoutControlGroupQuestion1 = new DevExpress.XtraLayout.LayoutControlGroup();
            this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem();
            this.layoutControlItem3 = new DevExpress.XtraLayout.LayoutControlItem();
            this.layoutControlItem4 = new DevExpress.XtraLayout.LayoutControlItem();
            this.layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem();
            this.layoutControlItemHeader = new DevExpress.XtraLayout.LayoutControlItem();
            this.layoutControlItemHeader.Name = "layoutControlItemHeader"+Guid.NewGuid().ToString();
            this.layoutControlItemPrefix = new DevExpress.XtraLayout.LayoutControlItem();
            this.emptySpaceItem1 = new DevExpress.XtraLayout.EmptySpaceItem();

            //
            // layoutControlGroupQuestion1
            //
            this.layoutControlGroupQuestion1.CustomizationFormText = "Root";
            this.layoutControlGroupQuestion1.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True;
            this.layoutControlGroupQuestion1.AppearanceGroup.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold);
            this.layoutControlGroupQuestion1.AppearanceGroup.GradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical;
            this.layoutControlGroupQuestion1.AppearanceGroup.Options.UseFont = true;
            this.layoutControlGroupQuestion1.ExpandButtonVisible = false;
            this.layoutControlGroupQuestion1.GroupBordersVisible = true;
            this.layoutControlGroupQuestion1.TextVisible = false;
            //this.layoutControlGroupQuestion1.Location = new System.Drawing.Point(0, 0);
            this.layoutControlGroupQuestion1.Padding = new DevExpress.XtraLayout.Utils.Padding(1, 1, 1, 1);
            this.layoutControlGroupQuestion1.ShowInCustomizationForm = false;
            //this.layoutControlGroupQuestion1.Text = oSettings.Label + " " + oSettings.QuestionText;
            this.layoutControlGroupQuestion1.BeginUpdate();

            #region Prefix
            lprefix = new Label();
            lprefix.Name = "lprefix";
            lprefix.Text = "";
            lprefix.Visible = false;
            this.layoutControlItemPrefix.Location = new System.Drawing.Point(0, 0);
            this.layoutControlItemPrefix.Name = "layoutControlItemPrefix1";
            this.layoutControlItemPrefix.Control = lprefix;
            this.layoutControlItemPrefix.ShowInCustomizationForm = false;
            this.layoutControlItemPrefix.TextVisible = false;
            this.layoutControlItemPrefix.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0);
            this.layoutControlItemPrefix.MinSize = new Size(0, 10);
            this.layoutControlItemPrefix.MaxSize = new Size(0, 10);
            this.layoutControlItemPrefix.SizeConstraintsType = SizeConstraintsType.Custom;
            this.layoutControlItemPrefix.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
            #endregion

            #region Footer
               //bool isCustomerOwned = false;
            //bool isBrightvisionOwned = false;
            //if (oSettings.CustomerOwnership && oSettings.BVOwnership)
            //    isCustomerOwnershipOnly = true;

            //ctlFooter = new Footer() {
            //    IsAccountLevel = oSettings.DataBindings.account_level,
            //    IsCustomerOwnershipOnly = isCustomerOwnershipOnly,
            //    HelpText = oSettings.QuestionHelp,
            //    LanguageCode = oSettings.DataBindings.language_code
            //};
            Settings oSettings = Questionnaire.Form.Settings;
            ctlFooter = new Footer() {
                IsAccountLevel = oSettings.DataBindings.account_level,
                IsCustomerOwned = oSettings.CustomerOwnership,
                IsBrightvisionOwned = oSettings.BVOwnership,
                HelpText = oSettings.QuestionHelp,
                LanguageCode = oSettings.DataBindings.language_code,
                QuestionText = oSettings.Label + " " + oSettings.QuestionText
            };

            ctlFooter.InitializeFooter();
            ctlFooter.Dock = DockStyle.Fill;
            ctlFooter.Height = 20;
            this.layoutControlItemHeader.Control = ctlFooter;
            this.layoutControlItemHeader.ShowInCustomizationForm = false;
            this.layoutControlItemHeader.TextVisible = false;
            this.layoutControlItemHeader.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0);
            this.layoutControlItemHeader.MinSize = new Size(0, 24);
            this.layoutControlItemHeader.MaxSize = new Size(0, 24);
            this.layoutControlItemHeader.Click += new EventHandler(layoutControlGroupQuestion1_Click);
            this.layoutControlItemHeader.SizeConstraintsType = SizeConstraintsType.Default;
               #endregion
             //
            // layoutControl1
            //

            this.layoutControl1.Controls.Add(this.ctlFooter);
            this.layoutControl1.Controls.Add(this.simpleButtonCancel);
            this.layoutControl1.Controls.Add(this.simpleButtonSave);
            this.layoutControl1.Controls.Add(this.gridControlHistory);
            this.layoutControl1.Controls.Add(this.memoEdit1);
            this.layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.layoutControl1.Location = new System.Drawing.Point(0, 0);
            this.layoutControl1.Name = "layoutControl1";
            this.layoutControl1.Root = this.layoutControlGroupQuestion1;
            //this.layoutControl1.Size = new System.Drawing.Size(539, 216);
            this.layoutControl1.TabIndex = 2;
            this.layoutControl1.Text = "layoutControl1";
            //
            // simpleButtonCancel
            //
            this.simpleButtonCancel.Image = global::BrightVision.DQControl.Properties.Resources.cancel_16x16;
            this.simpleButtonCancel.Location = new System.Drawing.Point(498, 41);
            this.simpleButtonCancel.Margin = new System.Windows.Forms.Padding(1);
            this.simpleButtonCancel.Name = "simpleButtonCancel";
            this.simpleButtonCancel.MinimumSize = new System.Drawing.Size(22, 22);
            this.simpleButtonCancel.MaximumSize = new System.Drawing.Size(22, 22);
            this.simpleButtonCancel.ImageLocation = ImageLocation.MiddleCenter;
            this.simpleButtonCancel.StyleController = this.layoutControl1;
            this.simpleButtonCancel.TabIndex = 7;
            this.simpleButtonCancel.ToolTip = "Cancel";
            this.simpleButtonCancel.Click += new EventHandler(simpleButtonCancel_Click);
            //
            // simpleButtonSave
            //
            this.simpleButtonSave.Image = global::BrightVision.DQControl.Properties.Resources.save_16x16;
            this.simpleButtonSave.Location = new System.Drawing.Point(498, 7);
            this.simpleButtonSave.Margin = new System.Windows.Forms.Padding(1);
            this.simpleButtonSave.Name = "simpleButtonSave";
            this.simpleButtonSave.MinimumSize = new System.Drawing.Size(22, 22);
            this.simpleButtonSave.MaximumSize = new System.Drawing.Size(22, 22);
            this.simpleButtonSave.ImageLocation = ImageLocation.MiddleCenter;
            this.simpleButtonSave.StyleController = this.layoutControl1;

            this.simpleButtonSave.TabIndex = 6;
            this.simpleButtonSave.Click += new EventHandler(simpleButtonSave_Click);
            this.simpleButtonSave.ToolTip = "Save";
            //
            // gridControl1
            //
            this.gridControlHistory.Location = new System.Drawing.Point(7, 75);
            this.gridControlHistory.MainView = this.gridViewHistory;
            this.gridControlHistory.Name = "gridControlHistory";
            this.gridControlHistory.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] {
            this.repositoryItemButtonEdit1,
            this.repositoryItemMemoEdit1,
            this.repositoryItemMemoEdit2,
            this.repositoryItemButtonEdit2});
            this.gridControlHistory.MinimumSize = new System.Drawing.Size(0, 150);
            this.gridControlHistory.MaximumSize = new System.Drawing.Size(0, 150);
            this.gridControlHistory.Size = new Size(0, 150);

            this.gridControlHistory.TabIndex = 4;
            this.gridControlHistory.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
            this.gridViewHistory});

            //
            // gridView1
            //
            this.gridViewHistory.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
            this.gridColumnId,
            this.gridColumnComment,
            this.gridColumnCreationDate,
            this.gridColumnUser,
            this.gridColumnCustomerContact,
            this.gridColumnDelete});
            this.gridViewHistory.GridControl = this.gridControlHistory;
            this.gridViewHistory.Name = "gridViewHistory";
            this.gridViewHistory.OptionsSelection.EnableAppearanceFocusedCell = false;
            this.gridViewHistory.OptionsView.RowAutoHeight = true;
            this.gridViewHistory.OptionsView.ShowGroupPanel = false;
            this.gridViewHistory.OptionsBehavior.ReadOnly = true;

            //this.gridViewHistory.VertScrollVisibility = DevExpress.XtraGrid.Views.Base.ScrollVisibility.Always;
            this.gridViewHistory.CustomRowCellEdit += new DevExpress.XtraGrid.Views.Grid.CustomRowCellEditEventHandler(gridViewHistory_CustomRowCellEdit);
            //
            //gridcolumn id
            //
            this.gridColumnId.Caption = "Id";
            this.gridColumnId.FieldName = "id";
            this.gridColumnId.Name = "gridColumnId";
            this.gridColumnId.Visible = false;

            //
            // gridColumn1
            //
            this.gridColumnComment.Caption = "Comment";
            this.gridColumnComment.ColumnEdit = this.repositoryItemMemoEdit1;
            this.gridColumnComment.FieldName = "Comment";
            this.gridColumnComment.Name = "gridColumnComment";
            this.gridColumnComment.Visible = true;
            this.gridColumnComment.VisibleIndex = 0;
            this.gridColumnComment.Width = 200;
            this.gridColumnComment.MaxWidth = 0;
            this.gridColumnComment.MinWidth = 0;
            this.gridColumnComment.ColumnEdit.EditValueChanged += new EventHandler(ColumnEdit_EditValueChanged);
            //
            // repositoryItemMemoEdit1
            //
            this.repositoryItemMemoEdit1.Name = "repositoryItemMemoEdit1";
            this.repositoryItemMemoEdit1.ReadOnly = false;
            this.repositoryItemMemoEdit2.Name = "repositoryItemMemoEdit2";
            this.repositoryItemMemoEdit2.ReadOnly = true;
            //
            // gridColumn2
            //
            this.gridColumnCreationDate.Caption = "Date";
            this.gridColumnCreationDate.FieldName = "CreationDate";
            this.gridColumnCreationDate.Name = "gridColumnCreationDate";
            this.gridColumnCreationDate.Visible = true;
            this.gridColumnCreationDate.VisibleIndex = 1;
            this.gridColumnCreationDate.Width = 50;
            this.gridColumnCreationDate.MaxWidth = 0;
            this.gridColumnCreationDate.MinWidth = 0;
            this.gridColumnCreationDate.DisplayFormat.FormatType = FormatType.Custom;
            this.gridColumnCreationDate.DisplayFormat.Format = new DateCustomFormatter();
            this.gridColumnCreationDate.DisplayFormat.FormatString = "yyyy-MM-dd HH:mm";
            this.gridColumnCreationDate.OptionsColumn.ReadOnly = true;
            //
            // gridColumn3
            //
            this.gridColumnUser.Caption = "User";
            this.gridColumnUser.FieldName = "User";
            this.gridColumnUser.Name = "gridColumnUser";
            this.gridColumnUser.Visible = true;
            this.gridColumnUser.VisibleIndex = 2;
            this.gridColumnUser.Width = 70;
            this.gridColumnUser.MaxWidth = 0;
            this.gridColumnUser.MinWidth = 0;
            this.gridColumnUser.OptionsColumn.ReadOnly = true;
            //
            // gridColumn4
            //
            this.gridColumnCustomerContact.Caption = "Contact";
            this.gridColumnCustomerContact.FieldName = "CustomerContact";
            this.gridColumnCustomerContact.Name = "gridColumnCustomerContact";
            this.gridColumnCustomerContact.Visible = true;
            this.gridColumnCustomerContact.VisibleIndex = 3;
            this.gridColumnCustomerContact.Width = 70;
            this.gridColumnCustomerContact.MaxWidth = 0;
            this.gridColumnCustomerContact.MinWidth = 0;

            this.gridColumnCustomerContact.OptionsColumn.ReadOnly = true;
            //
            // gridColumn5
            //
            this.gridColumnDelete.Caption = "";
            this.gridColumnDelete.ColumnEdit = this.repositoryItemButtonEdit1;
            this.gridColumnDelete.FieldName = "";
            this.gridColumnDelete.MaxWidth = 30;
            this.gridColumnDelete.Name = "gridColumnDelete";
            this.gridColumnDelete.Visible = true;
            this.gridColumnDelete.VisibleIndex = 4;
            this.gridColumnDelete.Width = 30;

            this.gridColumnDelete.OptionsColumn.ReadOnly = true;
            //
            // repositoryItemButtonEdit1
            //
            Image img = ((System.Drawing.Image)(global::BrightVision.DQControl.Properties.Resources.cancel_16x16));
            var btn = new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "", -1, true, true, false, DevExpress.XtraEditors.ImageLocation.MiddleCenter, img, null, null, "Delete");

            this.repositoryItemButtonEdit1.Buttons.Add(btn);
            this.repositoryItemButtonEdit1.Name = "repositoryItemButtonEdit1";
            this.repositoryItemButtonEdit1.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.HideTextEditor;
            //this.repositoryItemButtonEdit1.ButtonClick += new DevExpress.XtraEditors.Controls.ButtonPressedEventHandler(repositoryItemButtonDelete_ButtonClick);
            this.repositoryItemButtonEdit1.Click += new EventHandler(repositoryItemButtonDelete_Click);
            //btn.Appearance.Image = img;

            this.repositoryItemButtonEdit2.Buttons.Add(btn);
            this.repositoryItemButtonEdit2.Name = "repositoryItemButtonEdit1";
            this.repositoryItemButtonEdit2.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.HideTextEditor;
            this.repositoryItemButtonEdit2.ReadOnly = true;
            //
            // memoEdit1
            //
            this.memoEdit1.Location = new System.Drawing.Point(7, 7);
            this.memoEdit1.Name = "memoEdit1";
            //this.memoEdit1.MinimumSize = new Size(100, 52);
            //this.memoEdit1.MaximumSize = new Size(0,0);
            this.memoEdit1.StyleController = this.layoutControl1;
            this.memoEdit1.TabIndex = 8;
            this.memoEdit1.Properties.ScrollBars = ScrollBars.None;
            this.memoEdit1.TextChanged += new EventHandler(memoEdit1_TextChanged);

            //
            // emptySpaceItem1
            //
            this.emptySpaceItem1.AllowHotTrack = false;
            this.emptySpaceItem1.CustomizationFormText = "emptySpaceItem1";
            this.emptySpaceItem1.Location = new System.Drawing.Point(383, 52);
            this.emptySpaceItem1.Name = "emptySpaceItem1";
            this.emptySpaceItem1.Size = new System.Drawing.Size(22, 212);
            this.emptySpaceItem1.Text = "emptySpaceItem1";
            this.emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0);
            //
            //gridControl
            //
            this.layoutControlItem1.Control = this.gridControlHistory;
            this.layoutControlItem1.CustomizationFormText = "layoutControlItem1";
            this.layoutControlItem1.Location = new System.Drawing.Point(0, 68);
            //this.layoutControlItem1.MinSize = new System.Drawing.Size(0, 100);
            //this.layoutControlItem1.MaxSize = new System.Drawing.Size(0, 200);
            this.Size = new Size(0, 150);
            this.layoutControlItem1.Name = "layoutControlItem1";
            this.layoutControlItem1.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.SupportHorzAlignment;
            this.layoutControlItem1.ControlAlignment = ContentAlignment.BottomCenter;
            //this.layoutControlItem1.Size = new Size(0, 150);
            this.layoutControlItem1.Text = "layoutControlItem1";
            this.layoutControlItem1.TextSize = new System.Drawing.Size(0, 0);
            this.layoutControlItem1.TextToControlDistance = 0;
            this.layoutControlItem1.TextVisible = false;
             //
            // layoutControlItem3
            //
            this.layoutControlItem3.Control = this.simpleButtonSave;
            this.layoutControlItem3.CustomizationFormText = "layoutControlItem3";
            this.layoutControlItem3.Location = new System.Drawing.Point(491, 0);
            this.layoutControlItem3.MaxSize = new System.Drawing.Size(22, 22);
            this.layoutControlItem3.MinSize = new System.Drawing.Size(22, 22);
            this.layoutControlItem3.Padding = new DevExpress.XtraLayout.Utils.Padding(1);
            this.layoutControlItem3.Name = "layoutControlItem3";
            this.layoutControlItem3.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Default;
            this.layoutControlItem3.Text = "layoutControlItem3";
            this.layoutControlItem3.TextSize = new System.Drawing.Size(0, 0);
            this.layoutControlItem3.TextToControlDistance = 0;
            this.layoutControlItem3.TextVisible = false;
            //
            // layoutControlItem4
            //
            this.layoutControlItem4.Control = this.simpleButtonCancel;
            this.layoutControlItem4.CustomizationFormText = "layoutControlItem4";
            this.layoutControlItem4.Location = new System.Drawing.Point(491, 34);
            this.layoutControlItem4.MaxSize = new System.Drawing.Size(22, 102);
            this.layoutControlItem4.MinSize = new System.Drawing.Size(22, 22);
            this.layoutControlItem4.Size = new Size(22, 102);
            this.layoutControlItem4.Padding = new DevExpress.XtraLayout.Utils.Padding(1);

            this.layoutControlItem4.Name = "layoutControlItem4";
            this.layoutControlItem4.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Default;
            this.layoutControlItem4.Text = "layoutControlItem4";
            this.layoutControlItem4.TextSize = new System.Drawing.Size(0, 0);
            this.layoutControlItem4.TextToControlDistance = 0;
            this.layoutControlItem4.TextVisible = false;
            //
            // layoutControlItem2
            //
            this.layoutControlItem2.Control = this.memoEdit1;
            this.layoutControlItem2.CustomizationFormText = "layoutControlItem2";
            this.layoutControlItem2.Location = new System.Drawing.Point(0, 0);
            this.layoutControlItem2.Name = "layoutControlItem2";
            this.layoutControlItem2.Text = "layoutControlItem2";
            this.layoutControlItem2.TextSize = new System.Drawing.Size(0, 0);
            this.layoutControlItem1.MinSize = new Size(0, 24);
            this.layoutControlItem1.MaxSize = new Size(0, 24);
            this.layoutControlItem2.TextToControlDistance = 0;
            this.layoutControlItem2.TextVisible = false;
            this.layoutControlItem2.SizeConstraintsType = SizeConstraintsType.SupportHorzAlignment;
            //
            // testinglayout
            //
            this.layoutControlGroupQuestion1.AddItem(this.layoutControlItemHeader);
            this.layoutControlGroupQuestion1.AddItem(this.layoutControlItemPrefix);
            this.layoutControlGroupQuestion1.AddItem(this.layoutControlItem2);
            this.layoutControlGroupQuestion1.AddItem(this.layoutControlItem3, this.layoutControlItem2, DevExpress.XtraLayout.Utils.InsertType.Right);
            this.layoutControlGroupQuestion1.AddItem(this.layoutControlItem4, this.layoutControlItem3, DevExpress.XtraLayout.Utils.InsertType.Bottom);
            this.layoutControlGroupQuestion1.AddItem(this.layoutControlItem1);

            this.layoutControlGroupQuestion1.Click += new EventHandler(layoutControlGroupQuestion1_Click);

            this.layoutControlGroupQuestion1.EndUpdate();
        }
Ejemplo n.º 7
0
        private void BindPropertyGrid(string questionTypeConstants, CampaignQuestionnaire Questionnaire)
        {
            CampaignQuestionnaire oQuestionnaire = null;
            if (Questionnaire != null) {
                oQuestionnaire = Questionnaire;
            } else {
                oQuestionnaire = CampaignQuestionnaire.Instanciate(questionTypeConstants);
            }
            currentType = questionTypeConstants;
            this.layoutControlGroupPreview.BeginUpdate();
            //this.layoutControlGroupPreview.Clear();
            DisposeGroupControls(this.layoutControlGroupPreview);
            if (questionTypeConstants == QuestionTypeConstants.Dropbox) {
                Dropbox oDropbox = new Dropbox(this.layoutControlPreview);
                oDropbox.DisableSelection = true;
                oDropbox.ToolTipController = defaultToolTipController1;
                oDropbox.Questionnaire = oQuestionnaire;
                oDropbox.BindControls();
                this.layoutControlGroupPreview.Add(oDropbox.ControlGroup);
            } else if (questionTypeConstants == QuestionTypeConstants.Textbox) {
                Textbox oTextbox = new Textbox(this.layoutControlPreview);
                oTextbox.DisableSelection = true;
                oTextbox.ToolTipController = defaultToolTipController1;
                oTextbox.Questionnaire = oQuestionnaire;
                oTextbox.BindControls();
                this.layoutControlGroupPreview.Add(oTextbox.ControlGroup);
            } else if (questionTypeConstants == QuestionTypeConstants.MultipleChoice) {
                Multiplechoice oMultipleChoice = new Multiplechoice(this.layoutControlPreview);
                oMultipleChoice.DisableSelection = true;
                oMultipleChoice.ToolTipController = defaultToolTipController1;
                oMultipleChoice.Questionnaire = oQuestionnaire;
                oMultipleChoice.BindControls();
                this.layoutControlGroupPreview.Add(oMultipleChoice.ControlGroup);
            } else if (questionTypeConstants == QuestionTypeConstants.Schedule) {
                Schedule oSchedule = new Schedule(this.layoutControlPreview);
                oSchedule.DisableSelection = true;
                oSchedule.ToolTipController = defaultToolTipController1;
                oSchedule.Questionnaire = oQuestionnaire;
                //TODO: Change this during the implementation of component user for account_id
                oSchedule.Questionnaire.Form.Settings.DataBindings.account_id = "1";
                oSchedule.BindControls();
                this.layoutControlGroupPreview.Add(oSchedule.ControlGroup);
            }
            //else if (questionTypeConstants == QuestionTypeConstants.Seminar) {
            //    Seminar oSeminar = new Seminar(this.layoutControlPreview);
            //    oSeminar.DisableSelection = true;
            //    oSeminar.ToolTipController = defaultToolTipController1;
            //    oSeminar.Questionnaire = oQuestionnaire;
            //    //TODO: Change this during the implementation of component user for account_id
            //    oSeminar.Questionnaire.Form.Settings.DataBindings.account_id = "1";
            //    oSeminar.BindControls();
            //    this.layoutControlGroupPreview.Add(oSeminar.ControlGroup);
            //}
            DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem1 = new DevExpress.XtraLayout.EmptySpaceItem();
            emptySpaceItem1.CustomizationFormText = "emptySpaceItemBottom";
            emptySpaceItem1.Name = "emptySpaceItemBottom";
            emptySpaceItem1.ShowInCustomizationForm = false;
            emptySpaceItem1.Size = new System.Drawing.Size(0, 0);
            emptySpaceItem1.Text = "emptySpaceItemBottom";
            emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0);

            //add bottom spacer
            this.layoutControlGroupPreview.AddItem(emptySpaceItem1);
            this.layoutControlGroupPreview.EndUpdate();
            this.layoutControlPreview.BestFit();
            var answerOptionList = oQuestionnaire.Form.Settings.AnswerOptions;
            repositoryItemButtonEditAnswerOptions.Click += new EventHandler(repositoryItemButtonEditAnswerOptions_ButtonClick);
            propertyGridControl1.DefaultEditors.Add(typeof(List<AnswerOption>), repositoryItemButtonEditAnswerOptions);
            propertyGridControl1.SelectedObject = oQuestionnaire;
        }
Ejemplo n.º 8
0
        private void simpleButtonShowDialog_Click(object sender, EventArgs e)
        {
            GridView view = gridViewDialog;
            if (view == null || view.RowCount == 0) return;

            DataRow row;
            CampaignQuestionnaire oQuestionnaire = null;

            layoutControlGroupQuestionnaire.BeginUpdate();
            layoutControlGroupQuestionnaire.BeginInit();
            DisposeGroupControls(layoutControlGroupQuestionnaire);

            for (int i = 0; i < view.RowCount; i++) {
                row = view.GetDataRow(i);
                if (row["content_json"] == null || string.IsNullOrEmpty(row["content_json"].ToString())) continue;
                oQuestionnaire = CampaignQuestionnaire.InstanciateWith(row["content_json"].ToString());
                if (oQuestionnaire == null) continue;
                if (row["question_text"] != null)
                    oQuestionnaire.Form.Settings.QuestionText = row["question_text"].ToString();
                if (row["question_help_text"] != null)
                    oQuestionnaire.Form.Settings.QuestionHelp = row["question_help_text"].ToString();
                switch (oQuestionnaire.Type.ToLower()) {
                    case QuestionTypeConstants.Dropbox:
                        Dropbox oDropbox = new Dropbox(this.layoutControlQuestionnaire);
                        oDropbox.DisableSelection = true;
                        oDropbox.ToolTipController = defaultToolTipController1;
                        oDropbox.Questionnaire = oQuestionnaire;
                        oDropbox.BindControls();
                        this.layoutControlGroupQuestionnaire.Add(oDropbox.ControlGroup);
                        break;
                    case QuestionTypeConstants.MultipleChoice:
                        Multiplechoice oMultipleChoice = new Multiplechoice(this.layoutControlQuestionnaire);
                        oMultipleChoice.DisableSelection = true;
                        oMultipleChoice.ToolTipController = defaultToolTipController1;
                        oMultipleChoice.Questionnaire = oQuestionnaire;
                        oMultipleChoice.BindControls();
                        this.layoutControlGroupQuestionnaire.Add(oMultipleChoice.ControlGroup);
                        break;
                    case QuestionTypeConstants.Textbox:
                        Textbox oTextbox = new Textbox(this.layoutControlQuestionnaire);
                        oTextbox.DisableSelection = true;
                        oTextbox.ToolTipController = defaultToolTipController1;
                        oTextbox.Questionnaire = oQuestionnaire;
                        oTextbox.BindControls();
                        this.layoutControlGroupQuestionnaire.Add(oTextbox.ControlGroup);
                        break;
                    case QuestionTypeConstants.Schedule:
                        Schedule oSchedule = new Schedule(this.layoutControlQuestionnaire);
                        oSchedule.DisableSelection = true;
                        oSchedule.ToolTipController = defaultToolTipController1;
                        oSchedule.Questionnaire = oQuestionnaire;
                        oSchedule.BindControls();
                        this.layoutControlGroupQuestionnaire.Add(oSchedule.ControlGroup);
                        break;
                    //case QuestionTypeConstants.Seminar:
                    //    Seminar oSeminar = new Seminar(this.layoutControlQuestionnaire);
                    //    oSeminar.DisableSelection = true;
                    //    oSeminar.ToolTipController = defaultToolTipController1;
                    //    oSeminar.Questionnaire = oQuestionnaire;
                    //    oSeminar.BindControls();
                    //    this.layoutControlGroupQuestionnaire.Add(oSeminar.ControlGroup);
                    //    break;
                }
            }
            DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem1 = new DevExpress.XtraLayout.EmptySpaceItem();
            emptySpaceItem1.CustomizationFormText = "emptySpaceItemBottom";
            emptySpaceItem1.Name = "emptySpaceItemBottom";
            emptySpaceItem1.ShowInCustomizationForm = false;
            emptySpaceItem1.Size = new System.Drawing.Size(0, 0);
            emptySpaceItem1.Text = "emptySpaceItemBottom";
            emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0);

            //add bottom spacer
            this.layoutControlGroupQuestionnaire.AddItem(emptySpaceItem1);
            this.layoutControlGroupQuestionnaire.EndInit();
            this.layoutControlGroupQuestionnaire.EndUpdate();
        }
Ejemplo n.º 9
0
 /// <summary>
 /// 获取控件组是否为显示状态
 /// </summary>
 /// <param name="control"></param>
 /// <returns></returns>
 public static bool GetVisibility(this DevExpress.XtraLayout.EmptySpaceItem control)
 {
     return(control.Visibility == DevExpress.XtraLayout.Utils.LayoutVisibility.Always);
 }