ImageUtility.float4.Parse C# (CSharp) Method

Parse() public static method

public static Parse ( string v ) : float4
v string
return float4
        public static float4 Parse( string v )
        {
            string[]	Components = v.Split( ';' );
            if ( Components.Length < 4 )
                throw new Exception( "Not enough vector components!" );
            float4		Result = new float4();
            if ( !float.TryParse( Components[0].Trim(), out Result.x ) )
                throw new Exception( "Can't parse X field!" );
            if ( !float.TryParse( Components[1].Trim(), out Result.y ) )
                throw new Exception( "Can't parse Y field!" );
            if ( !float.TryParse( Components[2].Trim(), out Result.z ) )
                throw new Exception( "Can't parse Z field!" );
            if ( !float.TryParse( Components[3].Trim(), out Result.w ) )
                throw new Exception( "Can't parse W field!" );
            return Result;
        }