当前位置: 首页>>代码示例>>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;未经允许,请勿转载。