コード例 #1
0
 /// <summary>
 /// This method overrides the base CopyTo() method for an Markup Item.
 /// </summary>
 /// <param name="receiver">Precision to be modify.</param>
 public override void CopyTo(MarkupItem receiver)
 {
     base.CopyTo(receiver);
     ((Precision)receiver).PrecisionType  = PrecisionType;
     ((Precision)receiver).FaceValue      = FaceValue;
     ((Precision)receiver).NumberOfDigits = NumberOfDigits;
 }
コード例 #2
0
        /// <summary>
        /// This method override the base CopyTo() method for an Markup Item.
        /// </summary>
        /// <param name="receiver">Measure unit to be modify.</param>
        public override void CopyTo(MarkupItem receiver)
        {
            base.CopyTo(receiver);

            ((MeasureUnit)receiver).MeasureUnitType = MeasureUnitType;
            ((MeasureUnit)receiver).CalculationType = CalculationType;

            CopyMeasure(Measure1, ((MeasureUnit)receiver).Measure1);
            CopyMeasure(Measure2, ((MeasureUnit)receiver).Measure2);
        }
コード例 #3
0
        /// <summary>
        /// This method override the base CopyTo() method for an Markup Item.
        /// </summary>
        /// <param name="receiver">Scenario to be modify.</param>

        public override void CopyTo(MarkupItem receiver)
        {
            base.CopyTo(receiver);
            Scenario copy = receiver as Scenario;

            copy.ValueName = ValueName;
            copy.ValueType = ValueType;
            copy.Namespace = Namespace;
            copy.Schema    = Schema;

            if (this.DimensionInfo != null)
            {
                copy.DimensionInfo = this.DimensionInfo.Clone() as ContextDimensionInfo;
            }
            else
            {
                copy.DimensionInfo = null;
            }
        }
コード例 #4
0
        /// <summary>
        /// Determines whether a supplied <see cref="Object"/> is equal to this <see cref="MarkupItem"/>.
        /// </summary>
        /// <param name="obj">The <see cref="Object"/> to be compared to this <see cref="MarkupItem"/>.
        /// Assumed to be a <see cref="MarkupItem"/>.</param>
        /// <returns>True if <paramref name="obj"/> is equal to this <see cref="MarkupItem"/>.</returns>
        /// <remarks>To be equal, the name and IsDefaultForEntity properties for the two <see cref="MarkupItem"/> must be equal.</remarks>
        public override bool Equals(object obj)
        {
            if (!(obj is MarkupItem))
            {
                return(false);
            }

            MarkupItem mi = obj as MarkupItem;

            if (this.Name.CompareTo(mi.Name) != 0)
            {
                return(false);
            }
            if (this.IsDefaultForEntity != mi.IsDefaultForEntity)
            {
                return(false);
            }

            return(ValueEquals(obj));
        }
コード例 #5
0
ファイル: Scale.cs プロジェクト: plamikcho/xbrlpoc
        /// <summary>
        /// This method override the base CopyTo() method for an Markup Item.
        /// </summary>
        /// <param name="receiver">Scale to be modify.</param>
        public override void CopyTo(MarkupItem receiver)
        {
            base.CopyTo (receiver);

            ((Scale)receiver).factor = factor;
        }
コード例 #6
0
ファイル: Scale.cs プロジェクト: plamikcho/xbrlpoc
        /// <summary>
        /// This method override the Isvalid() method defined for the base -- Markup Item to validate the name.
        /// </summary>
        /// <param name="segmentType">Markup type code.</param>
        /// <param name="errorMessages">Exception messages.</param>
        /// <param name="CheckFRTA">Flag indicates if the system should check to see if the name is FRTA compliant.</param>
        /// <returns>Returns true, if the scale is valid.</returns>
        public override bool IsValid(MarkupItem.MarkupTypeCode segmentType, out ArrayList errorMessages, bool CheckFRTA)
        {
            bool isValid = base.IsValid( segmentType, out errorMessages, CheckFRTA );

            return isValid;
        }
コード例 #7
0
ファイル: Scenario.cs プロジェクト: plamikcho/xbrlpoc
        /// <summary>
        /// This method override the Isvalid() method defined for the base -- Markup Item to validate the name.
        /// We need to be more restricting that the xbrl spec with respect to
        /// segments and scenarios as we create ssu.xsd for all the segments and
        /// scenarios and create elements for both type and value
        /// hence both element and value needs to adhere to the xml element name limitations
        /// </summary>
        /// <param name="scenarioType">Markup type code.</param>
        /// <param name="errorMessages">Exception messages.</param>
        /// <param name="CheckFRTA">Flag indicates if the system should check to see if the name is FRTA compliant.</param>
        /// <returns>Returns true, if the scenario is valid.</returns>
        public override bool IsValid(MarkupItem.MarkupTypeCode scenarioType, out ArrayList errorMessages, bool CheckFRTA)
        {
            //we need to be more restricting that the xbrl spec with respect to
            //segments and scenarios as we create ssu.xsd for all the segments and
            //scenarios and create elements for both type and value
            //hence both element and value needs to adhere to the xml element name limitations

            //type does not allow forward slash also
            //3731
            string invalidStringType = @" ~`!@#$%^&*()+={}[]|\/;’'<>?,.";
            char[] invalidCharactersType = invalidStringType.ToCharArray(0, invalidStringType.Length -1);
            string invalidStringName = @" ~`!@#$%^&*()+={}[]|\/;’'<>?,.";
            char[] invalidCharactersName = invalidStringName.ToCharArray(0, invalidStringName.Length -1);

            bool isValid = base.IsValid( scenarioType, out errorMessages, CheckFRTA );

            if( (ValueName == null) || (ValueName.Length <= 0) )
            {
                errorMessages.Add( TraceUtility.FormatStringResource("Common.Error.InvalidValueName",invalidStringName) );
                isValid = false;
            }
            else
            {
                if (ValueName.IndexOfAny(invalidCharactersName, 0, ValueName.Length) >= 0)
                {
                    errorMessages.Add( TraceUtility.FormatStringResource("Common.Error.InvalidValueName",invalidStringName) );
                    isValid = false;
                }

                //Bug 923 - check that it does not start with a number
                if( char.IsDigit(Convert.ToChar(ValueName.Substring(0,1))) )
                {
                    errorMessages.Add( TraceUtility.FormatStringResource("Common.Error.ValueNameStartsWithDigit") );
                    isValid = false;
                }
            }

            if( (ValueType == null) || (ValueType.Length <= 0) )
            {
                errorMessages.Add( TraceUtility.FormatStringResource("Common.Error.InvalidValueType",invalidStringType) );
                isValid = false;
            }
            else
            {
                if (ValueType.IndexOfAny(invalidCharactersType, 0, ValueType.Length) >= 0)
                {
                    errorMessages.Add( TraceUtility.FormatStringResource("Common.Error.InvalidValueType",invalidStringType) );
                    isValid = false;
                }

                //Bug 923 - check that it does not start with a number
                if( char.IsDigit(Convert.ToChar(ValueType.Substring(0,1))) )
                {
                    errorMessages.Add( TraceUtility.FormatStringResource("Common.Error.ValueTypeStartsWithDigit") );
                    isValid = false;
                }
            }

            return isValid;
        }
コード例 #8
0
ファイル: Scenario.cs プロジェクト: plamikcho/xbrlpoc
        /// <summary>
        /// This method override the base CopyTo() method for an Markup Item.
        /// </summary>
        /// <param name="receiver">Scenario to be modify.</param>
        public override void CopyTo(MarkupItem receiver)
        {
            base.CopyTo (receiver);
            Scenario copy = receiver as Scenario;

            copy.ValueName = ValueName;
            copy.ValueType = ValueType;
            copy.Namespace = Namespace;
            copy.Schema = Schema;

            if (this.DimensionInfo != null)
            {
                copy.DimensionInfo = this.DimensionInfo.Clone() as ContextDimensionInfo;
            }
            else
            {
                copy.DimensionInfo = null;
            }
        }
コード例 #9
0
 /// <summary>
 /// This method copies the name and if the markup item is default for the entity to the receiver.
 /// </summary>
 /// <param name="receiver">The markup item the name and is default for the entity falg would be copied to.</param>
 public virtual void CopyTo(MarkupItem receiver)
 {
     receiver.Name = Name;
     receiver.IsDefaultForEntity = this.IsDefaultForEntity;
 }
コード例 #10
0
ファイル: MarkupItem.cs プロジェクト: plamikcho/xbrlpoc
 /// <summary>
 /// This method copies the name and if the markup item is default for the entity to the receiver.
 /// </summary>
 /// <param name="receiver">The markup item the name and is default for the entity falg would be copied to.</param>
 public virtual void CopyTo( MarkupItem receiver )
 {
     receiver.Name				= Name;
     receiver.IsDefaultForEntity = this.IsDefaultForEntity;
 }
コード例 #11
0
        /// <summary>
        /// This method override the base CopyTo() method for an Markup Item.
        /// </summary>
        /// <param name="receiver">Scale to be modify.</param>
        public override void CopyTo(MarkupItem receiver)
        {
            base.CopyTo(receiver);

            ((Scale)receiver).factor = factor;
        }
コード例 #12
0
ファイル: Segment.cs プロジェクト: plamikcho/xbrlpoc
        /// <summary>
        /// This method override the Isvalid() method defined for the base -- Markup Item to validate the name.
        /// We need to be more restricting that the xbrl spec with respect to
        /// segments and scenarios as we create ssu.xsd for all the segments and
        /// scenarios and create elements for both type and value
        /// hence both element and value needs to adhere to the xml element name limitations
        /// </summary>
        /// <param name="segmentType">Markup type code.</param>
        /// <param name="errorMessages">Exception messages.</param>
        /// <param name="CheckFRTA">Flag indicates if the system should check to see if the name is FRTA compliant.</param>
        /// <returns>Returns true, if the segment is valid.</returns>
        public override bool IsValid(MarkupItem.MarkupTypeCode segmentType, out ArrayList errorMessages, bool CheckFRTA)
        {
            string invalidStringType = @" ~`!@#$%^&*()+={}[]|\/;’'<>?,.";
            char[] invalidCharactersType = invalidStringType.ToCharArray(0, invalidStringType.Length -1);
            string invalidStringName = @" ~`!@#$%^&*()+={}[]|\/;’'<>?,.";
            char[] invalidCharactersName = invalidStringName.ToCharArray(0, invalidStringName.Length -1);

            bool isValid = base.IsValid( segmentType, out errorMessages, CheckFRTA);

            if( (ValueName == null) || (ValueName.Length <= 0) )
            {
                errorMessages.Add( TraceUtility.FormatStringResource("Common.Error.InvalidValueName",invalidStringName) );
                isValid = false;
            }
            else
            {
                if (ValueName.IndexOfAny(invalidCharactersName, 0, ValueName.Length) >= 0)
                {
                    errorMessages.Add( TraceUtility.FormatStringResource("Common.Error.InvalidValueName",invalidStringName) );
                    isValid = false;
                }

                //Bug 923 - check that it does not start with a number
                if( char.IsDigit(Convert.ToChar(ValueName.Substring(0,1))) )
                {
                    errorMessages.Add( TraceUtility.FormatStringResource("Common.Error.ValueNameStartsWithDigit") );
                    isValid = false;
                }
            }

            if( (ValueType == null) || (ValueType.Length <= 0) )
            {
                errorMessages.Add( TraceUtility.FormatStringResource("Common.Error.InvalidValueType",invalidStringType) );
                isValid = false;
            }
            else
            {
                if (ValueType.IndexOfAny(invalidCharactersType, 0, ValueType.Length) >= 0)
                {
                    errorMessages.Add( TraceUtility.FormatStringResource("Common.Error.InvalidValueType",invalidStringType) );
                    isValid = false;
                }

                //Bug 923 - check that it does not start with a number
                if( char.IsDigit(Convert.ToChar(ValueType.Substring(0,1))) )
                {
                    errorMessages.Add( TraceUtility.FormatStringResource("Common.Error.ValueTypeStartsWithDigit") );
                    isValid = false;
                }
            }

            return isValid;
        }
コード例 #13
0
ファイル: Precision.cs プロジェクト: plamikcho/xbrlpoc
 /// <summary>
 /// This method overrides the base CopyTo() method for an Markup Item.
 /// </summary>
 /// <param name="receiver">Precision to be modify.</param>
 public override void CopyTo(MarkupItem receiver)
 {
     base.CopyTo (receiver);
     ((Precision)receiver).PrecisionType = PrecisionType;
     ((Precision)receiver).FaceValue		= FaceValue;
     ((Precision)receiver).NumberOfDigits= NumberOfDigits;
 }
コード例 #14
0
ファイル: MeasureUnit.cs プロジェクト: plamikcho/xbrlpoc
        /// <summary>
        /// This method override the Isvalid() method defined for the base -- Markup Item to validate the name.
        /// </summary>
        /// <param name="markupType">Markup type code.</param>
        /// <param name="errorMessages">Exception messages.</param>
        /// <param name="CheckFRTA">Flag indicates if the system should check to see if the name is FRTA compliant.</param>
        /// <returns>Returns true, if the measure unit is valid.</returns>
        public override bool IsValid(MarkupItem.MarkupTypeCode markupType, out ArrayList errorMessages, bool CheckFRTA)
        {
            bool isValid = base.IsValid( markupType, out errorMessages, CheckFRTA );

            if (!isValid)
                return false;

            // always validate measure 1
            isValid = Measure1.IsValid( markupType, errorMessages );

            if ( IsComplexType() )
            {
                if (CalculationType == CalculationTypeCode.NA )
                {
                    errorMessages.Add( StringResourceUtility.GetString("Common.Error.ChooseCalculationType") );
                    isValid = false;
                }

                // validate measure 2
                if ( !Measure2.IsValid( markupType, errorMessages ) )
                    isValid = false;
            }

            return isValid;
        }
コード例 #15
0
ファイル: MeasureUnit.cs プロジェクト: plamikcho/xbrlpoc
        /// <summary>
        /// This method override the base CopyTo() method for an Markup Item.
        /// </summary>
        /// <param name="receiver">Measure unit to be modify.</param>
        public override void CopyTo(MarkupItem receiver)
        {
            base.CopyTo (receiver);

            ((MeasureUnit)receiver).MeasureUnitType = MeasureUnitType;
            ((MeasureUnit)receiver).CalculationType = CalculationType;

            CopyMeasure( Measure1, ((MeasureUnit)receiver).Measure1 );
            CopyMeasure( Measure2, ((MeasureUnit)receiver).Measure2 );
        }
コード例 #16
0
ファイル: MeasureUnit.cs プロジェクト: plamikcho/xbrlpoc
        /// <summary>
        /// This method override the Isvalid() method defined for the base -- Markup Item to validate the name.
        /// Specially, this method doesn't check for FRTA compliance as other markup items.
        /// </summary>
        /// <param name="markupType">Markup type code.</param>
        /// <param name="errorMessages">Exception messages.</param>
        /// <returns>Returns true, if the scenario is valid.</returns>
        public bool IsValid(MarkupItem.MarkupTypeCode markupType, ArrayList errorMessages)
        {
            string invalidString = @" ~`!@#$%^&*()+={}[]|\/;’'<>?,.";
            char[] invalidCharacters = invalidString.ToCharArray(0, invalidString.Length -1);

            bool isValid = true;
            if ( MeasureType == MeasureTypeCode.Unknown )
            {
                errorMessages.Add( StringResourceUtility.GetString("Common.Error.MeasureTypeMustBeSelected") );
                isValid = false;
            }

            if( (ValueName == null) || (ValueName.Length <= 0) )
            {
                errorMessages.Add( TraceUtility.FormatStringResource("Common.Error.InvalidValueName",invalidString) );
                isValid = false;
            }
            else
            {
                if (ValueName.IndexOfAny(invalidCharacters, 0, ValueName.Length) >= 0)
                {
                    errorMessages.Add( TraceUtility.FormatStringResource("Common.Error.InvalidValueName",invalidString) );
                    isValid = false;
                }
            }

            return isValid;
        }