當前位置: 首頁>>代碼示例>>C#>>正文


C# AnyObjectId.ToString方法代碼示例

本文整理匯總了C#中AnyObjectId.ToString方法的典型用法代碼示例。如果您正苦於以下問題:C# AnyObjectId.ToString方法的具體用法?C# AnyObjectId.ToString怎麽用?C# AnyObjectId.ToString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在AnyObjectId的用法示例。


在下文中一共展示了AnyObjectId.ToString方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: fileFor

 /**
  * Compute the location of a loose object file.
  *
  * @param objectId
  *            identity of the loose object to map to the directory.
  * @return location of the object, if it were to exist as a loose object.
  */
 public FileInfo fileFor(AnyObjectId objectId)
 {
     return fileFor(objectId.ToString());
 }
開發者ID:ArildF,項目名稱:GitSharp,代碼行數:11,代碼來源:ObjectDirectory.cs

示例2: hasObject

 /// <summary>
 /// Does the requested object exist in this database?
 /// <para />
 /// Alternates (if present) are searched automatically.
 /// </summary>
 /// <param name="objectId">identity of the object to test for existence of.</param>
 /// <returns>
 /// True if the specified object is stored in this database, or any
 /// of the alternate databases.
 /// </returns>
 public bool hasObject(AnyObjectId objectId)
 {
     return hasObjectImpl1(objectId) || hasObjectImpl2(objectId.ToString());
 }
開發者ID:drothmaler,項目名稱:GitSharp,代碼行數:14,代碼來源:ObjectDatabase.cs

示例3: ToFile

        /**
	     * Construct a filename where the loose object having a specified SHA-1
	     * should be stored. If the object is stored in a shared repository the path
	     * to the alternative repo will be returned. If the object is not yet store
	     * a usable path in this repo will be returned. It is assumed that callers
	     * will look for objects in a pack first.
	     *
	     * @param objectId
	     * @return suggested file name
	     */

        public FileInfo ToFile(AnyObjectId objectId)
        {
            string n = objectId.ToString();
            string d = n.Substring(0, 2);
            string f = n.Substring(2);
            for (int i = 0; i < _objectsDirs.Count; ++i)
            {
                FileInfo ret = new FileInfo(PathUtil.Combine(_objectsDirs[i].FullName, d, f));
                if (ret.Exists)
                    return ret;
            }
            return new FileInfo(PathUtil.Combine(_objectsDirs[0].FullName, d, f));
        }
開發者ID:gilran,項目名稱:GitSharp,代碼行數:24,代碼來源:Repository.cs

示例4: openObject

        /**
         * Open an object from this database.
         * <p>
         * Alternates (if present) are searched automatically.
         *
         * @param curs
         *            temporary working space associated with the calling thread.
         * @param objectId
         *            identity of the object to open.
         * @return a {@link ObjectLoader} for accessing the data of the named
         *         object, or null if the object does not exist.
         * @
         */
        public virtual ObjectLoader openObject(WindowCursor curs, AnyObjectId objectId)
        {
            if (objectId == null)
                return null;
            ObjectLoader ldr;

            ldr = openObjectImpl1(curs, objectId);
            if (ldr != null)
            {
                return ldr;
            }

            ldr = openObjectImpl2(curs, objectId.ToString(), objectId);
            if (ldr != null)
            {
                return ldr;
            }
            return null;
        }
開發者ID:stephensong,項目名稱:GitSharp,代碼行數:32,代碼來源:ObjectDatabase.cs


注:本文中的AnyObjectId.ToString方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。