Example #1
0
        public void Add(DataColumnMsx dataColumn)
        {
            TableColumnMsx tc = new TableColumnMsx();

            tc.DataColumn = dataColumn;
            tc.Width      = DefaultTableColumnWidth;
        }
Example #2
0
        /// <summary>
        /// Adjust secondary references for each Mobius.SpotfireDocument.xxxMsx class
        /// including DataTableMsx, DataColumnMsx, VisualMsx, PageMsx ...
        /// </summary>

        public override void UpdatePostDeserializationSecondaryReferences()
        {
            ValidateNode();

            DataColumnReference = DataColumnMsx.GetInstanceFromReferenceId(App_Document, DataColumnReferenceSerializedId);

            return;
        }
Example #3
0
        /// <summary>
        /// Get serializable reference name from instance
        /// </summary>
        /// <param name="dc"></param>
        /// <returns></returns>

        public static string GetReferenceId(DataColumnMsx dc)
        {
            if (dc != null)
            {
                return(dc.ReferenceId);
            }
            else
            {
                return(null);
            }
        }
Example #4
0
        public bool Contains(DataColumnMsx dataColumn)
        {
            foreach (TableColumnMsx tc in Columns)
            {
                if (tc.DataColumn == dataColumn)
                {
                    return(true);
                }
            }

            return(false);
        }
Example #5
0
        /// <summary>
        /// Try to get a DataColumn by name
        /// </summary>
        /// <param name="name"></param>
        /// <param name="dc"></param>
        /// <returns></returns>

        public bool TryGetColumnByName(string name, out DataColumnMsx dc)
        {
            foreach (DataColumnMsx dc0 in Columns)
            {
                if (String.Equals(name, dc0.Name, StringComparison.OrdinalIgnoreCase))
                {
                    dc = dc0;
                    return(true);
                }
            }

            dc = null;
            return(false);
        }
Example #6
0
        public bool TryGetTableColumn(DataColumnMsx dataColumn, out TableColumnMsx tableColumn)
        {
            foreach (TableColumnMsx tc in Columns)
            {
                if (tc.DataColumn == dataColumn)
                {
                    tableColumn = tc;
                    return(true);
                }
            }

            tableColumn = null;
            return(false);
        }
Example #7
0
        public override string ToString()
        {
            string txt = "DataTableMsx: " + Name + "\r\n" +
                         "Idx, Name, DataType, MobiusRole, MobiusFileColumnName, ExternalName, Origin, ContentType\r\n";

            for (int dci = 0; dci < Columns.Count; dci++)
            {
                DataColumnMsx dc = Columns[dci];

                txt += String.Format("{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}\r\n",
                                     dci, dc.Name, dc.DataType, dc.MobiusRole, dc.MobiusFileColumnName, dc.ExternalName, dc.Origin, dc.ContentType);
            }

            return(txt);
        }
Example #8
0
        /// <summary>
        /// Adjust secondary references for each Mobius.SpotfireDocument.xxxMsx class
        /// including DataTableMsx, DataColumnMsx, VisualMsx, PageMsx ...
        /// </summary>

        public override void UpdatePreSerializationSecondaryReferences()
        {
            DataColumnReferenceSerializedId = DataColumnMsx.GetReferenceId(DataColumnReference);
            return;
        }