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


C# Guid.Select方法代碼示例

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


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

示例1: GetClientPath

 /// <summary>
 /// Converts a server-side entity path to a client-side entity path.
 /// </summary>
 /// <param name="path">
 /// The server-side entity path.
 /// </param>
 /// <returns>
 /// The client-side entity path.
 /// </returns>
 /// <remarks>
 /// The client-side entity path expects an extra root ID of "-1",
 /// which this method includes.
 /// </remarks>
 public static string[] GetClientPath(Guid[] path)
 {
     var rootId = CoreConstants.System.Root.ToInvariantString();
     var clientPath = new[] { rootId }
         .Concat(path.Select(x => GuidHelper.GetString(x)))
         .ToArray();
     return clientPath;
 }
開發者ID:rhythmagency,項目名稱:formulate,代碼行數:21,代碼來源:EntityHelper.cs

示例2: GetLastVersionTaskActivityDC

        public static IEnumerable<TaskActivityDC> GetLastVersionTaskActivityDC(Guid[] taskGuids)
        {
            var result = WorkflowsQueryServiceUtility.UsingClientReturn(client => client.TaskActivityGetList(new TaskActivityGetListRequest()
            {
                List = taskGuids.Select(t => new TaskActivityDC() { Guid = t }).ToList(),
            }.SetIncaller()));

            result.StatusReply.CheckErrors();

            return result.List;
        }
開發者ID:barbarossia,項目名稱:CWF,代碼行數:11,代碼來源:TaskService.cs

示例3: CreateFilter

        /// <summary>
        /// Creates a filter from the given properties.
        /// </summary>
        /// <param name="subscriptionIds">The subscriptions to query.</param>
        /// <param name="resourceGroup">The name of the resource group/</param>
        /// <param name="resourceType">The resource type.</param>
        /// <param name="resourceName">The resource name.</param>
        /// <param name="tagName">The tag name.</param>
        /// <param name="tagValue">The tag value.</param>
        /// <param name="filter">The filter.</param>
        public static string CreateFilter(
            Guid[] subscriptionIds,
            string resourceGroup,
            string resourceType,
            string resourceName,
            string tagName,
            string tagValue,
            string filter,
            string nameContains = null,
            string resourceGroupNameContains = null)
        {
            var filterStringBuilder = new StringBuilder();

            if (subscriptionIds.CoalesceEnumerable().Any())
            {
                if (subscriptionIds.Length > 1)
                {
                    filterStringBuilder.Append("(");
                }

                filterStringBuilder.Append(subscriptionIds
                    .Select(subscriptionId => string.Format("subscriptionId EQ '{0}'", subscriptionId))
                    .ConcatStrings(" OR "));

                if (subscriptionIds.Length > 1)
                {
                    filterStringBuilder.Append(")");
                }
            }

            if (!string.IsNullOrWhiteSpace(resourceGroup))
            {
                if (filterStringBuilder.Length > 0)
                {
                    filterStringBuilder.Append(" AND ");
                }

                filterStringBuilder.AppendFormat("resourceGroup EQ '{0}'", resourceGroup);
            }

            var remainderFilter = QueryFilterBuilder.CreateFilter(resourceType, resourceName, tagName, tagValue, filter, nameContains, resourceGroupNameContains);

            if (filterStringBuilder.Length > 0 && !string.IsNullOrWhiteSpace(remainderFilter))
            {
                return filterStringBuilder.ToString() + " AND " + remainderFilter;
            }

            return filterStringBuilder.Length > 0
                ? filterStringBuilder.ToString() 
                : remainderFilter;
        }
開發者ID:docschmidt,項目名稱:azure-powershell,代碼行數:61,代碼來源:QueryFilterBuilder.cs

示例4: DeleteArticles

        /// <summary>
        /// Deletes multiples articles
        /// </summary>
        /// <param name="articlesIds">Array of articles' ids</param>
        public void DeleteArticles(Guid[] articlesIds)
        {
            // Converti le tableau de Guid en tableau de string.
            string[] strIds = articlesIds.Select(id => id.ToString()).ToArray();

            using (var conn = OpenConnection())
            using (var cmd = conn.CreateCommand())
            {
                cmd.CommandText = "dbo.pDeleteArticlesFromIds";
                cmd.CommandType = System.Data.CommandType.StoredProcedure;

                cmd.AddParameterWithValue("articlesids_in",
                    //NpgsqlTypes.NpgsqlDbType.Array | NpgsqlTypes.NpgsqlDbType.Varchar,
                    strIds);

                cmd.ExecuteNonQuery();
            }
        }
開發者ID:mrtryhard,項目名稱:mytryhard,代碼行數:22,代碼來源:AdminArticlesContext.cs

示例5: Add

 public void Add(ReservedIdsSource id, Guid[] ids)
 {
     _db.HandleTransientErrors(db =>
     {
         try
         {
             db.Insert(new ReservedIdRow()
             {
                 Id = ReservedIdRow.GetId(id),
                 Data = ids.Select(d => d.ToString()).StringJoin()
             });
         }
         catch (DbException ex) when (db.IsUniqueViolation(ex))
         {
             //ignore duplicates
         }
     });
 }
開發者ID:DomainBus,項目名稱:DomainBus.Sql,代碼行數:18,代碼來源:ReservedIdStorage.cs

示例6: Delete

        public static void Delete(Guid[] ids)
        {
            using (var session = Workflow.WorkflowInit.Provider.Store.OpenSession())
            {
                var objs = session.Load<Document>(ids.Select(c=>c as ValueType).ToList());
                foreach (Document item in objs)
                {
                    session.Delete(item);
                }

                session.SaveChanges();
            }

            WorkflowInbox[] wis = null;
            do
            {
                foreach (var id in ids)
                {
                    using (var session = Workflow.WorkflowInit.Provider.Store.OpenSession())
                    {
                        wis = session.Query<WorkflowInbox>().Where(c => c.ProcessId == id).ToArray();
                        foreach (var wi in wis)
                            session.Delete<WorkflowInbox>(wi);

                        session.SaveChanges();
                    }
                }
            } while (wis.Length > 0);
        }
開發者ID:kanpinar,項目名稱:unity3.1th,代碼行數:29,代碼來源:DocumentHelper.cs

示例7: Run

 public IObservable<PerfTestResult> Run(Guid[] tests, int start, int step, int end, PerfTestConfiguration configuration, bool parallel = false)
 {
     return TestSuiteManager.Run(tests.Select(x => this.Tests[x]).ToArray(), start, step, end, configuration, parallel);
 }
開發者ID:Orcomp,項目名稱:NPerf,代碼行數:4,代碼來源:PerfLab.cs

示例8: ReorderPhotos

        public Status<string[]> ReorderPhotos(string username, Guid[] photoIds)
        {
            if (photoIds.Length == 0)
                return Status.ValidationError<string[]>(null, "photoIds", "photoIds cannot be empty");

            string[] existingPhotoIds = null;
            Guid primaryPhotoId = photoIds[0];

            using (RentlerContext context = new RentlerContext())
            {
                try
                {
                    var building = (from p in context.Photos
                                        .Include("Building.Photos")
                                    where p.PhotoId == primaryPhotoId &&
                                    p.Building.User.Username == username
                                    select p.Building).SingleOrDefault();

                    if (building == null)
                        return Status.NotFound<string[]>();

                    // save order prior to changing in case we have to restore them
                    var photos = from p in building.Photos
                                 orderby p.SortOrder
                                 select p;

                    existingPhotoIds = photos.Select(p => p.PhotoId.ToString()).ToArray();

                    for (int i = 0; i < photoIds.Length; ++i)
                    {
                        var photo = photos.SingleOrDefault(p => p.PhotoId == photoIds[i]);
                        photo.SortOrder = i;

                        // primary photo
                        if (i == 0)
                        {
                            building.PrimaryPhotoId = photo.PhotoId;
                            building.PrimaryPhotoExtension = photo.Extension;
                        }
                    }

                    context.SaveChanges();

                    string[] resultIds = photoIds.Select(i => i.ToString()).ToArray();

                    InvalidateCache(building.BuildingId);

                    return Status.OK<string[]>(resultIds);
                }
                catch (Exception ex)
                {
                    return Status.Error<string[]>(ex.Message, existingPhotoIds);
                }
            }
        }
開發者ID:wes-cutting,項目名稱:Sandbox-V2,代碼行數:55,代碼來源:IPhotoAdapter.cs

示例9: BeginPublish

        private Guid[] BeginPublish(Guid[] webresourceIds)
        {
            UpdateStatus("Publishing...");

            OrganizationRequest request = new OrganizationRequest { RequestName = "PublishXml" };
            request.Parameters = new ParameterCollection();
            request.Parameters.Add(
                new KeyValuePair<string, object>("ParameterXml",
                    string.Format("<importexportxml><webresources>{0}</webresources></importexportxml>",
                        string.Join("", webresourceIds.Select(a => string.Format("<webresource>{0}</webresource>", a)))
                    )));

            this.Sdk.Execute(request);

            return webresourceIds;
        }
開發者ID:pmalecka,項目名稱:WebResourceLinkerVsix,代碼行數:16,代碼來源:WebResourcePublisher.cs

示例10: StartScanningForDevices

        public async void StartScanningForDevices(Guid[] serviceUuids)
        {
            if (_isScanning)
            {
                Mvx.Trace("Adapter: Already scanning!");
                return;
            }

            _isScanning = true;

            // in ScanTimeout seconds, stop the scan
            _cancellationTokenSource = new CancellationTokenSource();

            try
            {
                // Wait for the PoweredOn state
                await WaitForState(CBCentralManagerState.PoweredOn, _cancellationTokenSource.Token).ConfigureAwait(false);

                Mvx.Trace("Adapter: Starting a scan for devices.");

                CBUUID[] serviceCbuuids = null;
                if (serviceUuids != null && serviceUuids.Any())
                {
                    serviceCbuuids = serviceUuids.Select(u => CBUUID.FromString(u.ToString())).ToArray();
                    Mvx.Trace("Adapter: Scanning for " + serviceCbuuids.First());
                }

                // clear out the list
                _discoveredDevices = new List<IDevice>();

                // start scanning
                _central.ScanForPeripherals(serviceCbuuids);

                await Task.Delay(ScanTimeout, _cancellationTokenSource.Token);

                Mvx.Trace("Adapter: Scan timeout has elapsed.");

                StopScan();

                TryDisposeToken();
                _isScanning = false;

                //important for this to be caled after _isScanning = false so don't move to finally block
                ScanTimeoutElapsed(this, new EventArgs());
            }
            catch (TaskCanceledException)
            {
                Mvx.Trace("Adapter: Scan was cancelled.");
                StopScan();

                TryDisposeToken();
                _isScanning = false;
            }
        }
開發者ID:adolgov,項目名稱:MvvmCross-BluetoothLE,代碼行數:54,代碼來源:Adapter.cs

示例11: StartLeScan

        private async void StartLeScan(Guid[] serviceUuids)
        {
            if (_isScanning)
            {
                Mvx.Trace("Adapter: Already scanning.");
                return;
            }

            _isScanning = true;

            // clear out the list
            _discoveredDevices = new List<IDevice>();

            if (serviceUuids == null || !serviceUuids.Any())
            {
                if (Build.VERSION.SdkInt < BuildVersionCodes.Lollipop)
                {
                    Mvx.Trace("Adapter < 21: Starting a scan for devices.");
                    //without filter
                    _adapter.StartLeScan(this);
                }
                else
                {
                    Mvx.Trace("Adapter >= 21: Starting a scan for devices.");
                    if (_adapter.BluetoothLeScanner != null)
                    {
                        _adapter.BluetoothLeScanner.StartScan(_api21ScanCallback);
                    }
                    else
                    {
                        Mvx.Trace("Adapter >= 21: Scan failed. Bluetooth is probably off");
                    }
                }

            }
            else
            {
                if (Build.VERSION.SdkInt < BuildVersionCodes.Lollipop)
                {
                    var uuids = serviceUuids.Select(u => UUID.FromString(u.ToString())).ToArray();
                    Mvx.Trace("Adapter < 21: Starting a scan for devices.");
                    _adapter.StartLeScan(uuids, this);
                }
                else
                {

                    Mvx.Trace("Adapter >=21: Starting a scan for devices with service ID {0}.", serviceUuids.First());

                    var scanFilters = new List<ScanFilter>();
                    foreach (var serviceUuid in serviceUuids)
                    {
                        var sfb = new ScanFilter.Builder();
                        sfb.SetServiceUuid(ParcelUuid.FromString(serviceUuid.ToString()));
                        scanFilters.Add(sfb.Build());
                    }

                    var ssb = new ScanSettings.Builder();
                    //ssb.SetCallbackType(ScanCallbackType.AllMatches);

                    if (_adapter.BluetoothLeScanner != null)
                    {
                        _adapter.BluetoothLeScanner.StartScan(scanFilters, ssb.Build(), _api21ScanCallback);
                    }
                    else
                    {
                        Mvx.Trace("Adapter >= 21: Scan failed. Bluetooth is probably off");
                    }
                }

            }

            // in ScanTimeout seconds, stop the scan
            _cancellationTokenSource = new CancellationTokenSource();

            try
            {
                await Task.Delay(ScanTimeout, _cancellationTokenSource.Token);

                Mvx.Trace("Adapter: Scan timeout has elapsed.");

                StopScan();

                TryDisposeToken();
                _isScanning = false;

                //important for this to be caled after _isScanning = false;
                ScanTimeoutElapsed(this, new EventArgs());
            }
            catch (TaskCanceledException)
            {
                Mvx.Trace("Adapter: Scan was cancelled.");
                StopScan();

                TryDisposeToken();
                _isScanning = false;
            }
        }
開發者ID:adolgov,項目名稱:MvvmCross-BluetoothLE,代碼行數:97,代碼來源:Adapter.cs

示例12: GetSystemConnectedOrPairedDevices

        public override List<IDevice> GetSystemConnectedOrPairedDevices(Guid[] services = null)
        {
            CBUUID[] serviceUuids = null;
            if (services != null)
            {
                serviceUuids = services.Select(guid => CBUUID.FromString(guid.ToString())).ToArray();
            }           

            var nativeDevices = _centralManager.RetrieveConnectedPeripherals(serviceUuids);

            return nativeDevices.Select(d => new Device(this, d)).Cast<IDevice>().ToList();
        }
開發者ID:xabre,項目名稱:xamarin-bluetooth-le,代碼行數:12,代碼來源:Adapter.cs

示例13: AddWorkspaceCheckoutId

 public void AddWorkspaceCheckoutId(Guid[] workspaceCheckoutId)
 {
     if (workspaceCheckoutId == null || workspaceCheckoutId.Length == 0)
     {
         return;
     }
     var strings = workspaceCheckoutId.Select(g => g.ToString()).ToArray();
     Contract.Assume(strings.Length > 0);
     AddFilterPart("workspacecheckoutid", strings);
 }
開發者ID:powercode,項目名稱:PSPlastic,代碼行數:10,代碼來源:FindFilterBuilder.cs

示例14: GetMailAddress

 public virtual MailAddress[] GetMailAddress(Guid[] userIds)
 {
     return userIds.Select(x => GetMailAddress(x)).ToArray();
 }
開發者ID:cagrawal21,項目名稱:x360ce,代碼行數:4,代碼來源:WebMail.cs

示例15: ListRawDataForCharacteristics

		/// <summary> 
		/// Fetches a list of raw data information for the characteristic identified by <paramref name="charateristicUuids"/>. 
		/// </summary>
		/// <param name="charateristicUuids">The list of characteristic uuids the raw data information should be fetched for.</param>
		/// <param name="cancellationToken">A token to cancel the asynchronous operation.</param>
		public Task<RawDataInformation[]> ListRawDataForCharacteristics( Guid[] charateristicUuids, CancellationToken cancellationToken = default( CancellationToken ) )
		{
			return ListRawData( RawDataEntity.Characteristic, charateristicUuids.Select( u => u.ToString() ).ToArray(), cancellationToken );
		}
開發者ID:darksun190,項目名稱:PiWeb-Api,代碼行數:9,代碼來源:RawDataServiceRestClient.cs


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