Esempio n. 1
0
        public ABCComment( )
        {
            InitializeComponent();

            this.gridView.Appearance.Empty.BackColor            = ABCPresentHelper.GetSkinBackColor();
            this.gridView.Appearance.Empty.Options.UseBackColor = true;
            this.gridView.Appearance.Row.BackColor            = ABCPresentHelper.GetSkinBackColor();
            this.gridView.Appearance.Row.Options.UseBackColor = true;

            this.gridView.OptionsView.RowAutoHeight = true;
            this.gridView.FocusRectStyle            = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.None;
            this.gridView.OptionsSelection.EnableAppearanceFocusedCell = false;
            this.gridView.OptionsSelection.EnableAppearanceFocusedRow  = false;
            this.gridView.CustomDrawCell += new DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventHandler(gridContent_CustomDrawCell);
            this.gridView.Click          += new EventHandler(gridView_Click);
            this.gridView.MouseMove      += new MouseEventHandler(gridView_MouseMove);
            this.gridView.RowCellStyle   += new RowCellStyleEventHandler(gridView_RowCellStyle);
            this.gridView.OptionsBehavior.AllowPartialRedrawOnScrolling = true;
            this.colTime.OptionsColumn.AllowEdit     = false;
            this.colEmployee.OptionsColumn.AllowEdit = false;
            this.colComment.OptionsColumn.AllowEdit  = true;
            this.colComment.OptionsColumn.ReadOnly   = true;

            this.colEmployee.AppearanceCell.TextOptions.VAlignment = DevExpress.Utils.VertAlignment.Top;
            this.colTime.AppearanceCell.TextOptions.VAlignment     = DevExpress.Utils.VertAlignment.Top;
            this.colComment.AppearanceCell.TextOptions.VAlignment  = DevExpress.Utils.VertAlignment.Top;


            tabPanel      = new ABCTagObject();
            tabPanel.Dock = DockStyle.Fill;
            tagPanelContainer.Controls.Add(tabPanel);
        }
Esempio n. 2
0
 public ABCPanelControl( )
 {
     this.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
     this.BackColor   = ABCPresentHelper.GetSkinBackColor();
     //this.Appearance.BorderColor=Color.Transparent;
     //this.Appearance.Options.UseBorderColor=true;
 }
Esempio n. 3
0
 public void Initialize(ABCView view, ABCBindingInfo bindingInfo)
 {
     this.DataSource = bindingInfo.BusName;
     this.DataMember = bindingInfo.FieldName;
     this.TableName  = bindingInfo.TableName;
     this.Text       = ABCPresentHelper.GetLabelCaption(view, this.DataSource, this.DataMember);
 }
Esempio n. 4
0
        void Form_Load(object sender, EventArgs e)
        {
            #region ColumnConfigGridCtrl

            this.ColumnConfigGridView.CellValueChanged  += new DevExpress.XtraGrid.Views.Base.CellValueChangedEventHandler(ConfigGridView_CellValueChanged);
            this.ColumnConfigGridView.ValidateRow       += new DevExpress.XtraGrid.Views.Base.ValidateRowEventHandler(ColumnConfigGridView_ValidateRow);
            this.ColumnConfigGridView.KeyDown           += new KeyEventHandler(ColumnConfigGridView_KeyDown);
            this.ColumnConfigGridView.InitNewRow        += new DevExpress.XtraGrid.Views.Grid.InitNewRowEventHandler(ColumnConfigGridView_InitNewRow);
            this.ColumnConfigGridView.CustomRowCellEdit += new DevExpress.XtraGrid.Views.Grid.CustomRowCellEditEventHandler(ColumnConfigGridView_CustomRowCellEdit);

            this.BandConfigGridView.CellValueChanged += new DevExpress.XtraGrid.Views.Base.CellValueChangedEventHandler(BandConfigGridView_CellValueChanged);
            this.BandConfigGridView.KeyDown          += new KeyEventHandler(BandConfigGridView_KeyDown);
            this.BandConfigGridView.ValidateRow      += new DevExpress.XtraGrid.Views.Base.ValidateRowEventHandler(BandConfigGridView_ValidateRow);


            this.ColumnConfigGridCtrl.DataSource = ColumnList;

            //     gridColRepoType.ColumnEdit=ABCPresentUtils.GetRepositoryFromEnum( typeof( ABCRepositoryType ) );
            gridColSumType.ColumnEdit                = ABCPresentHelper.GetRepositoryFromEnum(typeof(ABCSummaryType));
            gridColFixed.ColumnEdit                  = ABCPresentHelper.GetRepositoryFromEnum(typeof(DevExpress.XtraGrid.Columns.FixedStyle));
            this.repoFieldNameChooser.ButtonClick   += new DevExpress.XtraEditors.Controls.ButtonPressedEventHandler(repoFieldNameChooser_ButtonClick);
            this.repoFilterStringEditor.ButtonClick += new DevExpress.XtraEditors.Controls.ButtonPressedEventHandler(repoFilterStringEditor_ButtonClick);
            #endregion

            this.BandConfigGridCtrl.DataSource          = BandsList;
            gridColBandFixed.ColumnEdit                 = ABCPresentHelper.GetRepositoryFromEnum(typeof(DevExpress.XtraGrid.Columns.FixedStyle));
            this.DisplayGridView.BandWidthChanged      += new DevExpress.XtraGrid.Views.BandedGrid.BandEventHandler(DisplayGridView_BandWidthChanged);
            this.DisplayGridView.ColumnPositionChanged += new EventHandler(DisplayGridView_ColumnPositionChanged);
            this.DisplayGridView.ColumnWidthChanged    += new DevExpress.XtraGrid.Views.Base.ColumnEventHandler(DisplayGridView_ColumnWidthChanged);

            RefreshDisplayGrid();
        }
Esempio n. 5
0
        public void Load(XmlDocument doc, ViewMode mode)
        {
            Mode = mode;

            this.SuspendLayout();
            try
            {
                DataConfig = new ABCScreen.ABCScreenConfig(this);
                DataConfig.DeSerialization(doc);

                XmlNodeList nodeList = doc.GetElementsByTagName("C");
                ABCPresentHelper.LoadComponent(this, nodeList[0]);

                ABCDockManager.InitDockManager(this, doc);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message + " : " + ex.StackTrace);
            }

            this.InitControl();
            this.ResumeLayout(false);

            if (this.Surface != null)
            {
                this.Surface.UndoEngine.CleanEngine();
            }
        }
Esempio n. 6
0
        public virtual void InitSeries( )
        {
            this.ArgumentScaleType         = DevExpress.XtraCharts.ScaleType.Qualitative;
            seriesLabel.Antialiasing       = true;
            seriesLabel.BackColor          = ABCPresentHelper.GetSkinBackColor();
            seriesLabel.Border.Visible     = false;
            seriesLabel.FillStyle.FillMode = DevExpress.XtraCharts.FillMode.Empty;
            seriesLabel.LineColor          = ABCPresentHelper.GetSkinForeColor();//System.Drawing.Color.FromArgb( ( (int)( ( (byte)( 64 ) ) ) ) , ( (int)( ( (byte)( 64 ) ) ) ) , ( (int)( ( (byte)( 64 ) ) ) ) );
            seriesLabel.LineVisible        = true;

            pointOptions.PointView = DevExpress.XtraCharts.PointView.Values;
            pointOptions.ValueNumericOptions.Format = DevExpress.XtraCharts.NumericFormat.General;
            seriesLabel.PointOptions = pointOptions;

            seriesLabel.ResolveOverlappingMode = DevExpress.XtraCharts.ResolveOverlappingMode.Default;
            seriesLabel.TextColor             = ABCPresentHelper.GetSkinForeColor();//System.Drawing.Color.FromArgb( ( (int)( ( (byte)( 0 ) ) ) ) , ( (int)( ( (byte)( 0 ) ) ) ) , ( (int)( ( (byte)( 128 ) ) ) ) );
            this.Label                        = seriesLabel;
            this.Name                         = "Biểu đồ 1";
            this.View                         = seriesView;
            this.LegendPointOptions.PointView = PointView.Argument;
            ChartParent.Series.Add(this);
            ColorEach = true;

            if (this.seriesView is SideBySideBarSeriesView)
            {
                (this.seriesView as SideBySideBarSeriesView).Shadow.Visible = true;
                (this.seriesView as SideBySideBarSeriesView).Shadow.Size    = 2;
                ((BarSeriesLabel)Label).ShowForZeroValues = false;
            }
            if (this.seriesView is LineSeriesView)
            {
                (this.seriesView as LineSeriesView).Shadow.Visible            = false;
                (this.seriesView as LineSeriesView).LineMarkerOptions.Visible = false;
            }
        }
        void Form_Load(object sender, EventArgs e)
        {
            #region ColumnConfig
            this.ColumnConfigGridView.KeyDown          += new KeyEventHandler(ColumnConfigGridView_KeyDown);
            this.ColumnConfigGridView.CellValueChanged += new DevExpress.XtraGrid.Views.Base.CellValueChangedEventHandler(ColumnConfigGridView_CellValueChanged);

            this.ColumnConfigGridCtrl.DataSource = ColumnList;
            gridColSumType.ColumnEdit            = ABCPresentHelper.GetRepositoryFromEnum(typeof(ABCSummaryType));
            gridColFixed.ColumnEdit = ABCPresentHelper.GetRepositoryFromEnum(typeof(DevExpress.XtraTreeList.Columns.FixedStyle));

            #endregion

            #region DataConfig
            this.repoFieldNameChooser.ButtonClick           += new DevExpress.XtraEditors.Controls.ButtonPressedEventHandler(repoFieldNameChooser_ButtonClick);
            this.repoTableNameChooser.ButtonClick           += new DevExpress.XtraEditors.Controls.ButtonPressedEventHandler(repoTableNameChooser_ButtonClick);
            this.DataConfigTreeCtrl.CellValueChanged        += new CellValueChangedEventHandler(DataConfigTreeCtrl_CellValueChanged);
            this.DataConfigTreeCtrl.FocusedNodeChanged      += new FocusedNodeChangedEventHandler(DataConfigTreeCtrl_FocusedNodeChanged);
            this.DataConfigDetailVGridCtrl.CellValueChanged += new DevExpress.XtraVerticalGrid.Events.CellValueChangedEventHandler(DataConfigDetailVGridCtrl_CellValueChanged);

            #endregion

            #region Display

            this.DisplayTreeListCtrl.InnerTreeList.ColumnChanged      += new DevExpress.XtraTreeList.ColumnChangedEventHandler(DisplayTreeListCtrl_ColumnChanged);
            this.DisplayTreeListCtrl.InnerTreeList.ColumnWidthChanged += new DevExpress.XtraTreeList.ColumnWidthChangedEventHandler(InnerTreeList_ColumnWidthChanged);
            this.DisplayTreeListCtrl.HorizontalScroll.Visible          = true;
            #endregion

            RefreshDataConfigTree();
        }
Esempio n. 8
0
        private void UpdateLabelText( )
        {
            if (this.LayoutItem.Control == null)
            {
                return;
            }

            String strCaption = String.Empty;

            if (String.IsNullOrWhiteSpace(this.DataSource) == false && string.IsNullOrWhiteSpace(this.DataMember) == false)
            {
                strCaption = ABCPresentHelper.GetLabelCaption(OwnerView, this.DataSource, this.DataMember);
            }
            else
            {
                if (String.IsNullOrWhiteSpace(this.TableName) == false && string.IsNullOrWhiteSpace(this.DataMember) == false)
                {
                    strCaption = ABCPresentHelper.GetLabelCaption(this.TableName, this.DataMember);
                }
                else
                {
                    strCaption = DataConfigProvider.GetTableCaption(this.TableName);
                }
            }
            if (String.IsNullOrWhiteSpace(textLabel))
            {
                this.LayoutItem.Text = strCaption;
            }
            else
            {
                this.LayoutItem.Text = textLabel;
            }
        }
Esempio n. 9
0
        public static bool IsValidProperty(PropertyInfo proInfo)
        {
            if (ABCPresentHelper.GetUsablePropertiesList(proInfo.ReflectedType).Contains(proInfo.Name))
            {
                return(true);
            }

            return(false);
        }
Esempio n. 10
0
        public XmlElement GetXMLLayout(XmlDocument doc)
        {
            XmlElement elManager = ABCPresentHelper.Serialization(doc, this, "DCK");

            foreach (DockPanel ctrl in this.RootPanels)
            {
                XmlElement childEle = doc.CreateElement("PL");
                childEle.InnerText = ctrl.Name;
                elManager.AppendChild(childEle);
            }

            return(elManager);
        }
Esempio n. 11
0
        public void InitLayout(ABCView view, XmlNode node)
        {
            this.TabPages.Clear();

            foreach (XmlNode nodePage in node.SelectNodes("C"))
            {
                Component comp = ABCPresentHelper.LoadComponent(view, nodePage);
                if (comp != null && comp is DevExpress.XtraTab.XtraTabPage)
                {
                    this.TabPages.Add((DevExpress.XtraTab.XtraTabPage)comp);
                }
            }
        }
        void Form_Load(object sender, EventArgs e)
        {
            this.ConfigGridView.KeyDown          += new KeyEventHandler(ConfigGridView_KeyDown);
            this.ConfigGridView.CellValueChanged += new DevExpress.XtraGrid.Views.Base.CellValueChangedEventHandler(ConfigGridView_CellValueChanged);
            this.ConfigGridView.InitNewRow       += new DevExpress.XtraGrid.Views.Grid.InitNewRowEventHandler(ConfigGridView_InitNewRow);

            this.ConfigGridCtrl.DataSource = FieldsList;
            gridColRepoType.ColumnEdit     = ABCPresentHelper.GetRepositoryFromEnum(typeof(ABCRepositoryType));

            this.DisplayGridCtrl.Grid.FieldPropertyChanged += new DevExpress.XtraPivotGrid.PivotFieldPropertyChangedEventHandler(DisplayGridCtrl_FieldPropertyChanged);

            this.repoFieldNameChooser.ButtonClick += new DevExpress.XtraEditors.Controls.ButtonPressedEventHandler(repoFieldNameChooser_ButtonClick);
            RefreshDisplayGrid();
        }
Esempio n. 13
0
        public void InitRunTime( )
        {
            if (OwnerView == null)
            {
                OwnerView = ABCPresentHelper.FindParentView(this);
            }

            InitFilterString();

            InitGridView();

            InitRuntimeEvents();

            this.Properties.Appearance.ForeColor            = Color.Black;
            this.Properties.Appearance.Options.UseForeColor = true;
        }
Esempio n. 14
0
        public void GetChildrenXMLLayout(XmlElement containerElement)
        {
            XmlNode nodeCol = ABCHelper.DOMXMLUtil.GetFirstNode(containerElement, "P", "Editor");

            if (nodeCol != null)
            {
                containerElement.RemoveChild(nodeCol);
            }

            XmlElement eleEditor = ABCPresentHelper.Serialization(containerElement.OwnerDocument, this.EditControl, "C");

            if (eleEditor != null)
            {
                containerElement.AppendChild(eleEditor);
            }
        }
Esempio n. 15
0
        public void InitLayout(ABCView view, XmlNode node)
        {
            ViewOwner = view;

            this.DropZone.Controls.Clear();

            foreach (XmlNode nodeCtrl in node.SelectNodes("C"))
            {
                Component comp = ABCPresentHelper.LoadComponent(view, nodeCtrl);
                if (comp != null)
                {
                    this.DropZone.Controls.Add((Control)comp);
                }
            }

            if (ViewOwner != null && ViewOwner.Mode != ViewMode.Design)
            {
                SetSearchButton(this);
            }
        }
Esempio n. 16
0
        public void InitLayout(ABCView view, XmlNode node)
        {
            foreach (XmlNode nodePanel in node.SelectNodes("C"))
            {
                DevExpress.XtraEditors.SplitGroupPanel panel = null;
                String strPanelName = nodePanel.Attributes["name"].Value.ToString();
                if (strPanelName.EndsWith("Panel1"))
                {
                    panel = this.Panel1;
                }
                else if (strPanelName.EndsWith("Panel2"))
                {
                    panel = this.Panel2;
                }
                else
                {
                    continue;
                }


                foreach (XmlNode nodeChild in nodePanel.ChildNodes)
                {
                    if (nodeChild.Name == "P")
                    {
                        if (nodeChild.Attributes["name"].Value.ToString() == "Size")
                        {
                            panel.Size  = (Size)TypeDescriptor.GetConverter(typeof(Size)).ConvertFromString(nodeChild.InnerText);
                            panel.Width = panel.Size.Width;
                        }
                    }
                    else if (nodeChild.Name == "C")
                    {
                        Component comp = ABCPresentHelper.LoadComponent(view, nodeChild);
                        if (comp is Control)
                        {
                            ((Control)comp).Parent = panel;
                        }
                    }
                }
            }
        }
Esempio n. 17
0
        private void UpdateLabelText( )
        {
            String strCaption = String.Empty;

            if (String.IsNullOrWhiteSpace(this.DataSource))
            {
                strCaption = ABCPresentHelper.GetLabelCaption(this.TableName, this.DataMember);
            }
            else
            {
                strCaption = ABCPresentHelper.GetLabelCaption(OwnerView, this.DataSource, this.DataMember);
            }

            if (String.IsNullOrWhiteSpace(textLabel))
            {
                this.LayoutItem.Text = strCaption;
            }
            else
            {
                this.LayoutItem.Text = textLabel;
            }
        }
Esempio n. 18
0
        public void InitLayout(ABCView view, XmlNode panelNode)
        {
            InitializeFromXmlNode(panelNode);

            foreach (XmlNode node in panelNode.SelectNodes("C"))
            {
                Component comp = ABCPresentHelper.LoadComponent(view, node);
                if (comp != null)
                {
                    if (comp is DockPanel)
                    {
                        this.Controls.Add((Control)comp);
                    }
                    else
                    {
                        this.ControlContainer.Controls.Add((Control)comp);
                    }
                }
            }


            PerformDock(view);
        }
Esempio n. 19
0
        public static List <PropertyInfo> GetModifiedPropertiesList(object obj)
        {
            List <PropertyInfo> lstProperty = new List <PropertyInfo>();

            Type   type        = obj.GetType();
            object objTemplate = ABCPresentHelper.GetTemplateObject(type);

            foreach (PropertyInfo proInfo in type.GetProperties())
            {
                if (ABCPresentHelper.IsValidProperty(proInfo) == false)
                {
                    continue;
                }
                try
                {
                    #region check temlate component
                    if (objTemplate != null)
                    {
                        object obj1 = proInfo.GetValue(obj, null);
                        object obj2 = proInfo.GetValue(objTemplate, null);
                        if (obj1 == obj2 || (obj1 == null && obj2 == null) || (obj1 != null && obj2 != null && obj1.ToString() == obj2.ToString()))
                        {
                            continue;
                        }
                    }
                    #endregion

                    lstProperty.Add(proInfo);
                }
                catch
                {
                }
            }

            return(lstProperty);
        }
Esempio n. 20
0
        public XmlElement ComponentSerialization(XmlDocument doc, IComponent currentCom)
        {
            if (currentCom is ABCView && currentCom == this.Surface.DesignerHost.RootComponent)
            {
                ((ABCView)currentCom).Location = new Point(0, 0);
            }

            Type type = currentCom.GetType();

            XmlElement ele = ABCPresentHelper.Serialization(doc, currentCom, "C");

            if (currentCom is ABCView)
            {
                if (currentCom == this.Surface.DesignerHost.RootComponent)
                {
                    ele.SetAttribute("isRoot", "true");
                }
                else
                {
                    ele.SetAttribute("ID", ((ABCView)currentCom).ViewID.ToString());
                    CompNameList.Add(currentCom.Site.Name);
                    return(ele);
                }
            }

            #region Get ChildrenNode

            if (currentCom is ABCGridControl)
            {
                ((ABCGridControl)currentCom).GetChildrenXMLLayout(ele);
            }
            else if (currentCom is ABCGridBandedControl)
            {
                ((ABCGridBandedControl)currentCom).GetChildrenXMLLayout(ele);
            }
            else if (currentCom is ABCPivotGridControl)
            {
                ((ABCPivotGridControl)currentCom).GetChildrenXMLLayout(ele);
            }
            else if (currentCom is ABCTreeList)
            {
                ((ABCTreeList)currentCom).GetChildrenXMLLayout(ele);
            }
            else if (currentCom is ABCChartBaseControl)
            {
                ((ABCChartBaseControl)currentCom).GetChildrenXMLLayout(ele);
            }
            else if (currentCom is DevExpress.XtraBars.Docking.DockPanel)
            {
                ABCDockPanel.GetChildrenXMLLayout(this, (DevExpress.XtraBars.Docking.DockPanel)currentCom, ele);
            }
            else if (currentCom is ABCBindingBaseEdit)
            {
                ((ABCBindingBaseEdit)currentCom).GetChildrenXMLLayout(ele);
            }
            else if (currentCom is ABCSearchPanel)
            {
                ((ABCSearchPanel)currentCom).GetChildrenXMLLayout(this, ele);
            }
            //else if ( currentCom is ABCDataPanel )
            //{
            //    ( (ABCDataPanel)currentCom ).GetChildrenXMLLayout( this , ele );
            //}
            else
            {
                #region Default Component
                if (OwnerView != null && OwnerView.Mode == ViewMode.Design)
                {
                    ComponentDesigner designer = (ComponentDesigner)this.Surface.DesignerHost.GetDesigner(currentCom);
                    if (designer != null && designer.AssociatedComponents != null)
                    {
                        List <XmlElement> lstTemp = new List <XmlElement>();
                        foreach (object associatedComponent in designer.AssociatedComponents)
                        {
                            XmlElement eleChild = ComponentSerialization(doc, (IComponent)associatedComponent);
                            if (eleChild != null)
                            {
                                ele.AppendChild(eleChild);
                            }
                        }
                    }
                }
                else
                {
                    List <XmlElement> lstTemp = new List <XmlElement>();
                    foreach (object associatedComponent in (currentCom as Control).Controls)
                    {
                        XmlElement eleChild = ComponentSerialization(doc, (IComponent)associatedComponent);
                        if (eleChild != null)
                        {
                            ele.AppendChild(eleChild);
                        }
                    }
                }
                #endregion
            }

            #endregion

            if (OwnerView != null && OwnerView.Mode == ViewMode.Design)
            {
                CompNameList.Add(currentCom.Site.Name);
            }
            else
            {
                CompNameList.Add((currentCom as Control).Name);
            }
            return(ele);
        }
Esempio n. 21
0
        public void InitLayout(ABCView view, XmlNode node)
        {
            OwnerView = view;

            XmlNode child = node.SelectNodes("C")[0];

            if (child == null)
            {
                return;
            }

            String strType = child.Attributes["type"].Value.ToString();

            String strChildType = child.Attributes["type"].Value.ToString();
            Type   type         = TypeResolutionService.CurrentService.GetType(strChildType);

            if (type == null)
            {
                return;
            }

            Component comp = (Component)ABCDynamicInvoker.CreateInstanceObject(type);

            ABCPresentHelper.DeSerialization(comp, child);
            ((IABCControl)comp).OwnerView = view;
            ((IABCControl)comp).InitControl();
            (comp as Control).Parent = this;
            this.EditControl         = (IABCBindableControl)comp;

            if (view.Mode != ViewMode.Design && comp is ABCGridLookUpEdit)
            {
                if (((ABCGridLookUpEdit)comp).Properties.View.Columns.Count <= 2)
                {
                    Component comp2 = (Component)ABCDynamicInvoker.CreateInstanceObject(typeof(ABCLookUpEdit));
                    ((IABCBindableControl)comp2).DataSource = this.DataSource;
                    ((IABCBindableControl)comp2).DataMember = this.DataMember;
                    ((IABCBindableControl)comp2).TableName  = this.TableName;

                    ((IABCControl)comp2).OwnerView = view;
                    ((IABCControl)comp2).InitControl();
                    (comp2 as Control).Parent = this;
                    this.EditControl          = (IABCBindableControl)comp2;
                }
            }

            InvalidateControl();

            if (this.OwnerView == null || (this.OwnerView != null && this.OwnerView.Mode != ViewMode.Design))
            {
                bool   isUse      = true;
                String strRealCol = this.DataMember.Split(':')[0];
                if (!DataStructureProvider.IsTableColumn(this.TableName, strRealCol))
                {
                    isUse = false;
                }

                else if (!DataConfigProvider.TableConfigList.ContainsKey(this.TableName) || !DataConfigProvider.TableConfigList[this.TableName].FieldConfigList.ContainsKey(strRealCol))
                {
                    isUse = false;
                }

                else if (!DataConfigProvider.TableConfigList[this.TableName].FieldConfigList[strRealCol].InUse)
                {
                    isUse = false;
                }

                if (!isUse)
                {
                    this.Visible = false;
                }
            }
        }
Esempio n. 22
0
        public static XmlElement Serialization(XmlDocument doc, object obj, String strTag)
        {
            if (obj == null)
            {
                return(null);
            }

            Type type = obj.GetType();

            XmlElement ele = doc.CreateElement(strTag);

            if (obj is IComponent)
            {
                IComponent objTemp = (IComponent)obj;
                if (objTemp.Site != null)
                {
                    ele.SetAttribute("name", objTemp.Site.Name);
                }
                else
                {
                    ele.SetAttribute("name", ((Control)objTemp).Name);
                }
            }
            ele.SetAttribute("type", type.Name);


            List <PropertyInfo> lstProperties = ABCPresentHelper.GetModifiedPropertiesList(obj);

            foreach (PropertyInfo proInfo in lstProperties)
            {
                if (obj is IComponent && proInfo.Name == "Name")
                {
                    continue;
                }

                try
                {
                    object objValue = proInfo.GetValue(obj, null);
                    if (objValue == null)
                    {
                        continue;
                    }

                    XmlElement eleP = doc.CreateElement("P");
                    eleP.SetAttribute("name", proInfo.Name);

                    TypeConverter converter = TypeDescriptor.GetConverter(proInfo.PropertyType);
                    if (converter != null)
                    {
                        eleP.InnerText = converter.ConvertToString(objValue);
                    }
                    else
                    {
                        eleP.InnerText = objValue.ToString();
                    }
                    //if ( eleP.InnerText.StartsWith( "(" )||eleP.InnerText.EndsWith( ")" ) )
                    //    continue;

                    ele.AppendChild(eleP);
                }
                catch
                {
                }
            }
            return(ele);
        }