void showWindowAction_Execute(object sender, SimpleActionExecuteEventArgs e)
        {
            NonXAFForm form = new NonXAFForm();

            form.Text = "Form with the XAF ListView";

            LayoutControl layoutControl = new LayoutControl();

            layoutControl.Dock = System.Windows.Forms.DockStyle.Fill;
            form.Controls.Add(layoutControl);

            LayoutControlItem item1    = layoutControl.Root.AddItem();
            TextBox           textBox1 = new TextBox();

            item1.Text    = "Company";
            item1.Control = textBox1;

            DevExpress.ExpressApp.View listView = Application.CreateListView(typeof(Person), true);
            listView.CreateControls();
            LayoutControlItem item2 = layoutControl.Root.AddItem();

            item2.Text    = "Persons";
            item2.Control = (Control)listView.Control;

            form.ShowDialog();
            listView.Dispose();
            form.Dispose();
        }
예제 #2
0
    public void SetView(DevExpress.ExpressApp.View view)
    {
        ViewSite.Controls.Clear();
        if (view != null)
        {
            contextMenu.CreateControls(view);
            view.CreateControls();
            if (ViewControlAdding != null)
            {
                ViewControlAdding(this, EventArgs.Empty);
            }
            ViewSite.Controls.Add((Control)view.Control);
            ViewCaptionLabel.Text = view.Caption;

            ImageInfo imageInfo = ImageLoader.Instance.GetLargeImageInfo(view.Info.GetAttributeValue("ImageName"));
            if (imageInfo.IsEmpty)
            {
                ViewImage.Visible = false;
            }
            else
            {
                ViewImage.ImageUrl = imageInfo.ImageUrl;
            }
        }
    }
예제 #3
0
 public void SetView(DevExpress.ExpressApp.View view)
 {
     this.ViewSite.Controls.Clear();
     if (view != null)
     {
         contextMenu.CreateControls(view);
         view.CreateControls();
         ViewSite.Controls.Add((Control)view.Control);
         this.ViewCaptionLabel.Text = view.Caption;
         Header.Title = view.Caption + " - " + WebApplication.Instance.Title;
         ImageInfo imageInfo = ImageLoader.Instance.GetLargeImageInfo(view.Model.ModelClass.ImageName);
         if (imageInfo.IsEmpty)
         {
             ViewImage.Visible = false;
         }
         else
         {
             ViewImage.ImageUrl = imageInfo.ImageUrl;
         }
         if (view is DetailView)
         {
             //SearchActionContainer.Visible = false;
             //ObjectsCreationActionContainer.Visible = false;
         }
     }
 }
예제 #4
0
 public void SetView(DevExpress.ExpressApp.View view)
 {
     this.ViewSite.Controls.Clear();
     if (view != null)
     {
         contextMenu.CreateControls(view);
         view.CreateControls();
         ViewSite.Controls.Add((Control)view.Control);
         this.ViewCaption.Text = view.Caption;
         Header.Title          = view.Caption + " - " + WebApplication.Instance.Title;
         ImageInfo imageInfo = ImageLoader.Instance.GetLargeImageInfo(view.Info.GetAttributeValue("ImageName"));
         if (imageInfo.IsEmpty)
         {
             ViewImage.Visible = false;
         }
         else
         {
             ViewImage.ImageUrl = imageInfo.ImageUrl;
         }
         if (view is DetailView)
         {
             SearchActionContainer.Visible          = false;
             ObjectsCreationActionContainer.Visible = false;
         }
         //string colorString = view.Info.GetAttributeValue("BackColor");
         //if(!string.IsNullOrEmpty(colorString)) {
         //	try {
         //		KnownColor kColor = (KnownColor)Enum.Parse(typeof(KnownColor), colorString);
         //		ViewTitle.BackColor = Color.FromKnownColor(kColor);
         //	}
         //	catch(Exception) { }
         //}
     }
 }
예제 #5
0
    public void SetView(DevExpress.ExpressApp.View view)
    {
        ViewSite.Controls.Clear();
        if (view != null)
        {
            contextMenu.CreateControls(view);
            view.CreateControls();
            if (ViewControlAdding != null)
            {
                ViewControlAdding(this, EventArgs.Empty);
            }
            ViewSite.Controls.Add((Control)view.Control);
            ViewCaption.Text = view.Caption;

            ImageInfo imageInfo = ImageLoader.Instance.GetLargeImageInfo(view.Info.GetAttributeValue("ImageName"));
            if (imageInfo.IsEmpty)
            {
                ViewImage.Visible = false;
            }
            else
            {
                ViewImage.ImageUrl = imageInfo.ImageUrl;
            }
            string colorString = view.Info.GetAttributeValue("BackColor");
            //if(!string.IsNullOrEmpty(colorString)) {
            //	try {
            //		KnownColor kColor = (KnownColor)Enum.Parse(typeof(KnownColor), colorString);
            //		//ViewTitle.BackColor = Color.FromKnownColor(kColor);
            //	}
            //	catch(Exception) { }
            //}
        }
    }
예제 #6
0
        private void BuildContent()
        {
            Content.Controls.Clear();
            ControlUniqueIDList.Clear();
            switch (ViewType)
            {
            case Web.ViewType.DetailView:
                if (View == null)
                {
                    return;
                }

                if (ControlToRender == null)
                {
                    if (View is DetailView && !(View as DetailView).IsControlCreated)
                    {
                        View.CreateControls();
                    }
                }


                AddContent(new HTMLText()
                {
                    Text = @"<div>"
                }, Content);
                if (ControlToRender != null)
                {
                    BuildRecursiveElement(ControlToRender, null, ElemType.SingleObject, Content);
                }
                else
                {
                    BuildRecursiveElement((Control)View.Control, null, ElemType.SingleObject, Content);
                }
                AddContent(new HTMLText()
                {
                    Text = @"</div>"
                }, Content);

                break;

            case Web.ViewType.ListView:
                ListTable = new XafBootstrapTable();

                ListTable.ListView      = (IModelListView)(WebApplication.Instance as XafApplication).Model.Views[ModelListViewID];
                ListTable.DataSource    = DataSource;
                ListTable.PropertyName  = PropertyName;
                ListTable.SelectionType = SelectionType;
                Content.Controls.Clear();
                Content.Controls.Add(ListTable);
                break;
            }
        }
 public void SetView(DevExpress.ExpressApp.View view)
 {
     ViewSite.Controls.Clear();
     if (view != null)
     {
         contextMenu.CreateControls(view);
         view.CreateControls();
         ViewSite.Controls.Add((Control)view.Control);
         ViewCaptionLabel.Text = view.Caption;
         ImageInfo imageInfo = ImageLoader.Instance.GetImageInfo(view.Model.ModelClass.ImageName);
         if (imageInfo.IsEmpty)
         {
             ViewImage.Visible  = false;
             ViewImage.ImageUrl = null;
         }
         else
         {
             ViewImage.ImageUrl = imageInfo.ImageUrl;
         }
     }
 }
예제 #8
0
 public void SetView(DevExpress.ExpressApp.View view)
 {
     ViewSite.Controls.Clear();
     if (view != null)
     {
         contextMenu.CreateControls(view);
         view.CreateControls();
         ViewSite.Controls.Add((Control)view.Control);
         ViewCaption.Text = view.Caption;
         ImageInfo imageInfo = ImageLoader.Instance.GetImageInfo(view.Info.GetAttributeValue("ImageName"));
         if (imageInfo.IsEmpty)
         {
             ViewImage.Visible  = false;
             ViewImage.ImageUrl = null;
         }
         else
         {
             ViewImage.ImageUrl = imageInfo.ImageUrl;
         }
         OnViewInfoChanged();
     }
 }
예제 #9
0
 public void SetView(DevExpress.ExpressApp.View view)
 {
     this.ViewSite.Controls.Clear();
     if (view != null)
     {
         view.CreateControls();
         if (ViewControlAdding != null)
         {
             ViewControlAdding(this, EventArgs.Empty);
         }
         ViewSite.Controls.Add((Control)view.Control);
         ViewCaptionLabel.Text = view.Caption;
         Header.Title          = view.Caption;
         ImageInfo imageInfo = ImageLoader.Instance.GetLargeImageInfo(view.Model.ImageName);
         if (imageInfo.IsEmpty)
         {
             ViewImage.Visible = false;
         }
         else
         {
             ViewImage.ImageUrl = imageInfo.ImageUrl;
         }
     }
 }