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


C# System.Guid類代碼示例

本文整理匯總了C#中System.Guid的典型用法代碼示例。如果您正苦於以下問題:C# Guid類的具體用法?C# Guid怎麽用?C# Guid使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Guid類屬於System命名空間,在下文中一共展示了Guid類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: ReplicationCursor

 internal ReplicationCursor(DirectoryServer server, string partition, Guid guid, long filter)
 {
     this.partition = partition;
     this.invocationID = guid;
     this.USN = filter;
     this.server = server;
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:7,代碼來源:ReplicationCursor.cs

示例2: IsProfileAllreadyExist

        public bool IsProfileAllreadyExist(Guid UserId, string WPUserId)
        {
            using (NHibernate.ISession session = SessionFactory.GetNewSession())
            {
                //After Session creation, start Transaction.
                using (NHibernate.ITransaction transaction = session.BeginTransaction())
                {
                    try
                    {
                        //Proceed action, to Check if FacebookUser is Exist in database or not by UserId and FbuserId.
                        // And Set the reuired paremeters to find the specific values.
                        List<Domain.Socioboard.Domain.WordpressAccount> alst = session.CreateQuery("from WordpressAccount where UserId = :userid and WpUserId = :WpUserId")
                        .SetParameter("userid", UserId)
                        .SetParameter("WpUserId", WPUserId)
                        .List<Domain.Socioboard.Domain.WordpressAccount>()
                        .ToList<Domain.Socioboard.Domain.WordpressAccount>();
                        if (alst.Count == 0 || alst == null)
                            return false;
                        else
                            return true;
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                        return true;
                    }

                }//End Transaction
            }//End session
        }
開發者ID:prog-moh,項目名稱:socioboard-core,代碼行數:30,代碼來源:WordpressAccountRepository.cs

示例3: GetWordpressAccountById

        public Domain.Socioboard.Domain.WordpressAccount GetWordpressAccountById(Guid id, string wpid)
        {
            using (NHibernate.ISession session = SessionFactory.GetNewSession())
            {
                //After Session creation, start Transaction.
                using (NHibernate.ITransaction transaction = session.BeginTransaction())
                {
                    try
                    {
                        //Proceed action, to Check if FacebookUser is Exist in database or not by UserId and FbuserId.
                        // And Set the reuired paremeters to find the specific values.
                        NHibernate.IQuery query = session.CreateQuery("from WordpressAccount where UserId = :userid and WpUserId = :WpUserId");
                        query.SetParameter("userid", id);
                        query.SetParameter("WpUserId", wpid);
                        return (Domain.Socioboard.Domain.WordpressAccount)query.UniqueResult();
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                        return null;   
                    }

                }//End Transaction
            }//End session
        }
開發者ID:prog-moh,項目名稱:socioboard-core,代碼行數:25,代碼來源:WordpressAccountRepository.cs

示例4: TaskEventArgs

 public TaskEventArgs(Guid instanceId, string id, string assignee, string text)
     :base(instanceId)
 {
     this.idValue = id;
     this.assigneeValue = assignee;
     this.textValue = text;
 }
開發者ID:spzenk,項目名稱:sfdocsamples,代碼行數:7,代碼來源:TaskService.cs

示例5: GetDraft

		/// <summary>
		/// Gets the draft data for the media entity with the given id.
		/// </summary>
		/// <param name="id">The id</param>
		/// <param name="type">The media type</param>
		/// <returns>The draft media data, null if the data wasn't found</returns>
		public virtual byte[] GetDraft(Guid id, MediaType type = MediaType.Media) {
			var path = GetPath(id, true, type);

			if (File.Exists(path))
				return File.ReadAllBytes(path);
			return null;
		}
開發者ID:jerry-he,項目名稱:Piranha,代碼行數:13,代碼來源:LocalMediaProvider.cs

示例6: CreateOpf

        /// <summary>
        /// Generates the manifest and metadata information file used by the .epub reader
        /// (content.opf). For more information, refer to <see cref="http://www.idpf.org/doc_library/epub/OPF_2.0.1_draft.htm#Section2.0"/> 
        /// </summary>
        /// <param name="projInfo">Project information</param>
        /// <param name="contentFolder">Content folder (.../OEBPS)</param>
        /// <param name="bookId">Unique identifier for the book we're generating.</param>
        public void CreateOpf(PublicationInformation projInfo, string contentFolder, Guid bookId)
        {
            XmlWriter opf = XmlWriter.Create(Common.PathCombine(contentFolder, "content.opf"));
            opf.WriteStartDocument();
            // package name
            opf.WriteStartElement("package", "http://www.idpf.org/2007/opf");

            opf.WriteAttributeString("version", "2.0");
            opf.WriteAttributeString("unique-identifier", "BookId");

            // metadata - items defined by the Dublin Core Metadata Initiative:
            Metadata(projInfo, bookId, opf);
            StartManifest(opf);
            if (_parent.EmbedFonts)
            {
                ManifestFontEmbed(opf);
            }
            string[] files = Directory.GetFiles(contentFolder);
            ManifestContent(opf, files, "epub2");
            Spine(opf, files);
            Guide(projInfo, opf, files, "epub2");
            opf.WriteEndElement(); // package
            opf.WriteEndDocument();
            opf.Close();
        }
開發者ID:neilmayhew,項目名稱:pathway,代碼行數:32,代碼來源:EpubManifest.cs

示例7: CloseById

 public void CloseById(Guid id)
 {
     var delAllocation = _unitOfWork.OtherDispatchAllocationRepository.Get().FirstOrDefault(allocation => allocation.OtherDispatchAllocationID == id);
     if (delAllocation != null) delAllocation.IsClosed = true;
     _unitOfWork.OtherDispatchAllocationRepository.Add(delAllocation);
     _unitOfWork.Save();
 }
開發者ID:edgecomputing,項目名稱:cats-hub-module,代碼行數:7,代碼來源:OtherDispatchAllocationService.cs

示例8: Click

 /// <summary>
 /// Initializes a new instance of the Task data contract class given its required properties.
 /// </summary>
 /// <param name="clickGuid">Click Guid</param>
 /// <param name="facilityGuid">Facility Guid</param>
 /// <param name="listingTypeGuid">Listing Type Guid</param>
 /// <param name="timeStamp">Time Stamp</param>
 public Click(Guid clickGuid, Guid facilityGuid, Guid listingTypeGuid, DateTime timeStamp)
 {
     _clickGuid = clickGuid;
     _facilityGuid = facilityGuid;
     _listingTypeGuid = listingTypeGuid;
     _timeStamp = timeStamp;
 }
開發者ID:ankit-defacto,項目名稱:PSS,代碼行數:14,代碼來源:Click.cs

示例9: Article

 public ActionResult Article(Guid id)
 {
     foreach (News item in newsManagement.news)
         if (item.Id == id)
             return View(item);
     return Redirect("/error");
 }
開發者ID:akhroponiuk,項目名稱:NewFolder,代碼行數:7,代碼來源:NewsController.cs

示例10: EnsureDocumentEtagMatchInTransaction

		private void EnsureDocumentEtagMatchInTransaction(string key, Guid? etag)
		{
			Api.JetSetCurrentIndex(session, DocumentsModifiedByTransactions, "by_key");
			Api.MakeKey(session, DocumentsModifiedByTransactions, key, Encoding.Unicode, MakeKeyGrbit.NewKey);
			Guid existingEtag;
			if (Api.TrySeek(session, DocumentsModifiedByTransactions, SeekGrbit.SeekEQ))
			{
				if (Api.RetrieveColumnAsBoolean(session, DocumentsModifiedByTransactions, tableColumnsCache.DocumentsModifiedByTransactionsColumns["delete_document"]) == true)
					return; // we ignore etags on deleted documents
				existingEtag = Api.RetrieveColumn(session, DocumentsModifiedByTransactions, tableColumnsCache.DocumentsModifiedByTransactionsColumns["etag"]).TransfromToGuidWithProperSorting();
			}
			else
			{
				existingEtag = Api.RetrieveColumn(session, Documents, tableColumnsCache.DocumentsColumns["etag"]).TransfromToGuidWithProperSorting();
			}
			if (existingEtag != etag && etag != null)
			{
				throw new ConcurrencyException("PUT attempted on document '" + key +
											   "' using a non current etag")
				{
					ActualETag = etag.Value,
					ExpectedETag = existingEtag
				};
			}
		}
開發者ID:jaircazarin,項目名稱:ravendb,代碼行數:25,代碼來源:Util.cs

示例11: Add

 public static int Add(
     Guid pollGuid,
     Guid siteGuid,
     String question,
     bool anonymousVoting,
     bool allowViewingResultsBeforeVoting,
     bool showOrderNumbers,
     bool showResultsWhenDeactivated,
     bool active,
     DateTime activeFrom,
     DateTime activeTo)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_Polls_Insert", 10);
     sph.DefineSqlParameter("@PollGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, pollGuid);
     sph.DefineSqlParameter("@SiteGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, siteGuid);
     sph.DefineSqlParameter("@Question", SqlDbType.NVarChar, 255, ParameterDirection.Input, question);
     sph.DefineSqlParameter("@AnonymousVoting", SqlDbType.Bit, ParameterDirection.Input, anonymousVoting);
     sph.DefineSqlParameter("@AllowViewingResultsBeforeVoting", SqlDbType.Bit, ParameterDirection.Input, allowViewingResultsBeforeVoting);
     sph.DefineSqlParameter("@ShowOrderNumbers", SqlDbType.Bit, ParameterDirection.Input, showOrderNumbers);
     sph.DefineSqlParameter("@ShowResultsWhenDeactivated", SqlDbType.Bit, ParameterDirection.Input, showResultsWhenDeactivated);
     sph.DefineSqlParameter("@Active", SqlDbType.Bit, ParameterDirection.Input, active);
     sph.DefineSqlParameter("@ActiveFrom", SqlDbType.DateTime, ParameterDirection.Input, activeFrom);
     sph.DefineSqlParameter("@ActiveTo", SqlDbType.DateTime, ParameterDirection.Input, activeTo);
     int rowsAffected = sph.ExecuteNonQuery();
     return rowsAffected;
 }
開發者ID:saiesh86,項目名稱:TravelBlog,代碼行數:26,代碼來源:DBPoll.cs

示例12: Delete

 public static bool Delete(Guid pollGuid)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_Polls_Delete", 1);
     sph.DefineSqlParameter("@PollGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, pollGuid);
     int rowsAffected = sph.ExecuteNonQuery();
     return (rowsAffected > 0);
 }
開發者ID:saiesh86,項目名稱:TravelBlog,代碼行數:7,代碼來源:DBPoll.cs

示例13: Get

 public User Get(Guid id)
 {
     using (var db = base.NewDB())
     {
         return db.Users.Get(id);
     }
 }
開發者ID:yuandong618,項目名稱:mvcsolution,代碼行數:7,代碼來源:UserService.cs

示例14: HasValidSignature

        public static bool HasValidSignature(string fileName) {
            try {
                if (_isValidCache.Contains(fileName)) {
                    return true;
                }
                var wtd = new WinTrustData(fileName);
                var guidAction = new Guid(WINTRUST_ACTION_GENERIC_VERIFY_V2);
                WinVerifyTrustResult result = WinTrust.WinVerifyTrust(INVALID_HANDLE_VALUE, guidAction, wtd);
                bool ret = (result == WinVerifyTrustResult.Success);

                if (ret) {
                    _isValidCache.Add(fileName);
                }
#if COAPP_ENGINE_CORE
                var response = Event<GetResponseInterface>.RaiseFirst();

                if( response != null ) {
                    response.SignatureValidation(fileName, ret, ret ? Verifier.GetPublisherInformation(fileName)["PublisherName"] : null);
                }
#endif
                return ret;
            } catch (Exception) {
                return false;
            }
        }
開發者ID:roomaroo,項目名稱:coapp.powershell,代碼行數:25,代碼來源:Verifier.cs

示例15: ChangeName

        public ActionResult ChangeName(Guid id, string name, int version)
        {
            var command = new RenameInventoryItem(id, name, version);
            _bus.Send(command);

            return RedirectToAction("Index");
        }
開發者ID:MHacker9404,項目名稱:m-r,代碼行數:7,代碼來源:HomeController.cs


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