コード例 #1
0
        /// <summary>  Fetches the last modification time of the resource
        /// *
        /// </summary>
        /// <param name="resource">Resource object we are finding timestamp of
        /// </param>
        /// <param name="i_operation">string for logging, indicating caller's intention
        /// *
        /// </param>
        /// <returns>timestamp as long
        ///
        /// </returns>
        private long readLastModified(Resource resource, System.String i_operation)
        {
            /*
             *  get the template name from the resource
             */

            System.String name = resource.Name;
            try {
                System.Data.OleDb.OleDbConnection conn = openDbConnection();

                try {
                    //UPGRADE_TODO: The equivalent of java.sql.ResultSet must call Close() before performing any other operation with the associated connection. 'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="jlca1129"'
                    System.Data.OleDb.OleDbDataReader rs = readData(conn, timestampColumn, name);
                    try {
                        if (rs.Read())
                        {
                            return((System.Convert.ToDateTime(rs[(timestampColumn)]).Ticks - 621355968000000000) / 10000);
                        }
                        else
                        {
                            System.Diagnostics.Process.error("DataSourceResourceLoader Error: while " + i_operation + " could not find resource " + name);
                        }
                    } finally {
                        rs.Close();
                    }
                } finally {
                    closeDbConnection(conn);
                }
            } catch (System.Exception e) {
                System.Diagnostics.Process.error("DataSourceResourceLoader Error: error while " + i_operation + " when trying to load resource " + name + ": " + e.ToString());
            }
            return(0);
        }
コード例 #2
0
 public override long getLastModified(Resource resource)
 {
     return(readLastModified(resource, "getting timestamp"));
 }
コード例 #3
0
 public override bool isSourceModified(Resource resource)
 {
     return(resource.LastModified != readLastModified(resource, "checking timestamp"));
 }
コード例 #4
0
	/// <summary>  Fetches the last modification time of the resource
	/// *
	/// </summary>
	/// <param name="resource">Resource object we are finding timestamp of
	/// </param>
	/// <param name="i_operation">string for logging, indicating caller's intention
	/// *
	/// </param>
	/// <returns>timestamp as long
	///
	/// </returns>
	private long readLastModified(Resource resource, System.String i_operation) {
	    /*
	    *  get the template name from the resource
	    */

	    System.String name = resource.Name;
	    try {
		System.Data.OleDb.OleDbConnection conn = openDbConnection();

		try {
		    //UPGRADE_TODO: The equivalent of java.sql.ResultSet must call Close() before performing any other operation with the associated connection. 'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="jlca1129"'
		    System.Data.OleDb.OleDbDataReader rs = readData(conn, timestampColumn, name);
		    try {
			if (rs.Read()) {
			    return (System.Convert.ToDateTime(rs[(timestampColumn)]).Ticks - 621355968000000000) / 10000;
			} else {
			    System.Diagnostics.Process.error("DataSourceResourceLoader Error: while " + i_operation + " could not find resource " + name);
			}
		    } finally {
			rs.Close();
		    }
		} finally {
		    closeDbConnection(conn);
		}
	    } catch (System.Exception e) {
		System.Diagnostics.Process.error("DataSourceResourceLoader Error: error while " + i_operation + " when trying to load resource " + name + ": " + e.ToString());
	    }
	    return 0;
	}
コード例 #5
0
	public override long getLastModified(Resource resource) {
	    return readLastModified(resource, "getting timestamp");
	}
コード例 #6
0
	public override bool isSourceModified(Resource resource) {
	    return (resource.LastModified != readLastModified(resource, "checking timestamp"));
	}