string.Format(System.IFormatProvider, string, params object[])

Here are the examples of the csharp api class string.Format(System.IFormatProvider, string, params object[]) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

200 Examples 7

1. Example

Project: vr-studies
Source File: RoomInfo.cs
public string ToStringFull()
    {
        return string.Format("Room: '{0}' {1},{2} {4}/{3} players.\ncustomProps: {5}", this.nameField, this.visibleField ? "visible" : "hidden", this.openField ? "open" : "closed", this.maxPlayersField, this.PlayerCount, this.customPropertiesField.ToStringFull());
    }

2. Example

Project: vr-studies
Source File: CircularDrive.cs
private void UpdateDebugText()
		{
			if ( debugText )
			{
				debugText.text = string.Format( "Linear: {0}\nAngle:  {1}\n", linearMapping.value, outAngle );
			}
		}

3. Example

Project: vr-studies
Source File: Room.cs
public new string ToStringFull()
    {
        return string.Format("Room: '{0}' {1},{2} {4}/{3} players.\ncustomProps: {5}", this.nameField, this.visibleField ? "visible" : "hidden", this.openField ? "open" : "closed", this.maxPlayersField, this.PlayerCount, this.CustomProperties.ToStringFull());
    }

4. Example

Project: 0install-win
Source File: AddRemoveFeedCommand.cs
private IEnumerable<FeedUri> GetInterfaces(FeedUri feedUri, ref Stability suggestedStabilityPolicy)
        {
            var feed = FeedManager.GetFresh(feedUri);
            var interfaces = feed.FeedFor.Select(reference => reference.Target).WhereNotNull().ToList();
            if (interfaces.Count == 0)
                throw new OptionException(string.Format(Resources.MissingFeedFor, feedUri), null);

            if (feed.Elements.Count == 1)
            {
                if (feed.Elements[0] is Implementation singletonImplementation)
                    suggestedStabilityPolicy = singletonImplementation.Stability;
            }

            return interfaces;
        }

5. Example

Project: 0install-win
Source File: CatalogMan.cs
public override SubCommand GetCommand(string commandName)
        {
            #region Sanity checks
            if (commandName == null) throw new ArgumentNullException(nameof(commandName));
            #endregion

            switch (commandName)
            {
                case Search.Name:
                    return new Search(Handler);
                case Refresh.Name:
                    return new Refresh(Handler);
                case Add.Name:
                    return new Add(Handler);
                case Remove.Name:
                    return new Remove(Handler);
                case Reset.Name:
                    return new Reset(Handler);
                case List.Name:
                    return new List(Handler);
                default:
                    throw new OptionException(string.Format(Resources.UnknownCommand, commandName), commandName);
            }
        }

6. Example

Project: 0install-win
Source File: Export.cs
protected override ExitCode ShowOutput()
        {
            Handler.OutputLow(
                title: Resources.ExportComplete,
                message: string.Format(Resources.AllComponentsExported, Selections.Name ?? "app", _outputPath));

            return ExitCode.OK;
        }

7. Example

Project: 0install-win
Source File: IntegrationCommand.cs
private void DetectReplacement(ref FeedTarget target)
        {
            if (target.Feed.ReplacedBy == null || target.Feed.ReplacedBy.Target == null) return;

            if (Handler.Ask(
                string.Format(Resources.FeedReplacedAsk, target.Feed.Name, target.Uri, target.Feed.ReplacedBy.Target),
                defaultAnswer: false, alternateMessage: string.Format(Resources.FeedReplaced, target.Uri, target.Feed.ReplacedBy.Target)))
            {
                target = new FeedTarget(
                    target.Feed.ReplacedBy.Target,
                    FeedManager.GetFresh(target.Feed.ReplacedBy.Target));
            }
        }

8. Example

Project: 0install-win
Source File: MaintenanceMan.cs
public override SubCommand GetCommand(string commandName)
        {
            #region Sanity checks
            if (commandName == null) throw new ArgumentNullException(nameof(commandName));
            #endregion

            switch (commandName)
            {
                case Deploy.Name:
                    return new Deploy(Handler);
                case Remove.Name:
                    return new Remove(Handler);
                case RemoveHelper.Name:
                    return new RemoveHelper(Handler);
                default:
                    throw new OptionException(string.Format(Resources.UnknownCommand, commandName), commandName);
            }
        }

9. Example

Project: 0install-win
Source File: StoreMan.cs
public override SubCommand GetCommand(string commandName)
        {
            #region Sanity check/n ..... /n //View Source file for more details /n }

10. Example

Project: 0install-win
Source File: StoreMan.Implementations.cs
public override ExitCode Execute()
            {
                var manifestDigest = new ManifestDigest(AdditionalArgs[0]);

                string path = Store.GetPath(manifestDigest);
                if (path == null) throw new ImplementationNotFoundException(manifestDigest);
                Handler.Output(string.Format(Resources.LocalPathOf, AdditionalArgs[0]), path);
                return ExitCode.OK;
            }

11. Example

Project: 0install-win
Source File: ConfigDialog.cs
private void buttonRemoveImplDir_Click(object sender, EventArgs e)
        {
            var toRemove = listBoxImplDirs.SelectedItems.Cast<string>().ToList();

            if (Msg.YesNo(this, string.Format(Resources.RemoveSelectedEntries, toRemove.Count), MsgSeverity.Warn))
            {
                foreach (var store in toRemove)
                    listBoxImplDirs.Items.Remove(store);
            }
        }

12. Example

Project: 0install-win
Source File: ConfigDialog.cs
private void buttonRemoveCatalogSource_Click(object sender, EventArgs e)
        {
            if (Msg.YesNo(this, string.Format(Resources.RemoveSelectedEntries, listBoxCatalogSources.SelectedItems.Count), MsgSeverity.Warn))
            {
                foreach (var item in listBoxCatalogSources.SelectedItems.Cast<object>().ToList())
                    listBoxCatalogSources.Items.Remove(item);
            }
        }

13. Example

Project: VRpportunity
Source File: OVRDebugInfo.cs
void UpdateIPD()
    {
        strIPD = System.String.Format("IPD (mm): {0:F4}", OVRManager.profile.ipd * 1000.0f);
    }

14. Example

Project: VRpportunity
Source File: OVRDebugInfo.cs
void UpdateFOV()
    {
        OVRDisplay.EyeRenderDesc eyeDesc = OVRManager.display.GetEyeRenderDesc(VR.VRNode.LeftEye);
        strFOV = System.String.Format("FOV (deg): {0:F3}", eyeDesc.fov.y);   
    }

15. Example

Project: Borderless-Gaming
Source File: Native.cs
public override string ToString()
            {
                return string.Format(CultureInfo.CurrentCulture, "{{Left={0},Top={1},Right={2},Bottom={3}}}", Left, Top,
                    Right, Bottom);
            }

16. Example

Project: TraceLab
Source File: CoestAnswerSetImporter.cs
public override void Compute()
        {
            string error;
            //do validation
            if (CoestDatasetImporterHelper.ValidatePath(m_config.FilePath, "Answer Set File", out error))
            {
                var answerMatrix = CoestDatasetImporterHelper.ImportAnswerSet(m_config.FilePath, Logger, m_config.TrimElementValues);
                Workspace.Store("answerMatrix", answerMatrix);
                Logger.Trace(String.Format("Answer matrix imported from {0}.", m_config.FilePath));
            }
            else
            {
                throw new ArgumentException(error);
            }
        }

17. Example

Project: TraceLab
Source File: CoestAnswerSetImporterWithValidation.cs
public override void Compute()
        {
            TLArtifactsCollection sourceArtifacts = (TLArtifactsCollection)Workspace.Load("sourceArtifacts");
            TLArtifactsCollection targetArtifacts = (TLArtifactsCollection)Workspace.Load("targetArtifacts");
            if (sourceArtifacts == null)
                throw new ArgumentException("Source artifacts cannot be null.");

            if (targetArtifacts == null)
                throw new ArgumentException("Target artifacts cannot be null.");
            
            string error;
            //do validation
            if (CoestDatasetImporterHelper.ValidatePath(m_config.FilePath, "Answer Set File", out error))
            {
                var answerMatrix = CoestDatasetImporterHelper.ImportAnswerSet(m_config.FilePath, sourceArtifacts, targetArtifacts, Logger, m_config.TrimElementValues);
                Workspace.Store("answerMatrix", answerMatrix);
                Logger.Trace(String.Format("Answer matrix imported from {0}.", m_config.FilePath));
            }
            else
            {
                throw new ArgumentException(error);
            }
        }

18. Example

Project: TraceLab
Source File: CoestArtifactsImporter.cs
public override void Compute()
        {
            string error;
            //do validation
            if (CoestDatasetImporterHelper.ValidatePath(m_config.FilePath, "Artifacts File", out error))
            {
                CoestDatasetImporterHelper.Logger = this.Logger;
                var artifacts = CoestDatasetImporterHelper.ImportArtifacts(m_config.FilePath, m_config.TrimElementValues);
                Workspace.Store("listOfArtifacts", artifacts);
                Logger.Info(String.Format("Collection of artifacts with id '{0}' imported from {1}.", artifacts.CollectionId, m_config.FilePath));
            }
            else
            {
                throw new ComponentException(error);
            }
        }

19. Example

Project: TraceLab
Source File: DatasetGetter.cs
public override void Compute()
        {
            TLDatasetsList listOfDatasets = (TLDatasetsList)Workspace.Load("listOfDatasets");
            if (listOfDatasets == null)
            {
                throw new ComponentException("Received null listOfDatasets");
            }
            if (listOfDatasets.Count == 0)
            {
                throw new ComponentException("Received empty listOfDatasets");
            }

            int index = (int)Workspace.Load("indexOfDataset");
            if (index < 0)
            {
                throw new ComponentException("Received negative indexOfDataset");
            }
            if (index > listOfDatasets.Count)
            {
                throw new ComponentException("Received indexOfDataset is higher that number of datasets in the received list.");
            }

            TLDataset dataset = listOfDatasets[index];

            Workspace.Store("sourceArtifacts", dataset.SourceArtifacts);
            Workspace.Store("targetArtifacts", dataset.TargetArtifacts);
            Workspace.Store("answerSet", dataset.AnswerSet);
            Workspace.Store("datasetName", dataset.Name);

            Logger.Info(String.Format("Loaded dataset '{0}' source artifacts collection (id:{1}), and target artifacts collection (id:{2})", dataset.Name, dataset.SourceArtifacts.CollectionId, dataset.TargetArtifacts.CollectionId));
        }

20. Example

Project: TraceLab
Source File: ArtifactsCollectionExporter.cs
public override void Compute()
        {
            TLArtifactsCollection artifactsCollection = (TLArtifactsCollection)Workspace.Load("artifactsCollection");

            ArtifactsCollectionExporterUtilities.Export(artifactsCollection, Config.Path, Config.CollectionId, Config.CollectionName, Config.CollectionVersion, Config.CollectionDescription);

            Logger.Info(String.Format("Artifacts Collection has been saved into xml file '{0}'", Config.Path.Absolute));
        }

21. Example

Project: TraceLab
Source File: TypedEdge.cs
public override string ToString()
		{
			return string.Format("{0}: {1}-->{2}", type, this.Source, this.Target);
		}

22. Example

Project: TraceLab
Source File: ProgressDialog.cs
private void RunProgressDialog(IntPtr owner, object argument)
        {
            if( _backgroundW/n ..... /n //View Source file for more details /n }

23. Example

Project: TraceLab
Source File: ProgressDialog.cs
private void RunProgressDialog(IntPtr owner, object argument)
        {
            if( _backgroundW/n ..... /n //View Source file for more details /n }

24. Example

Project: TraceLab
Source File: DataPointSingleSeriesWithAxes.cs
[SuppressMessage("Microsoft.Usage", "CA2233:OperationsShouldNotOverflow", MessageId = "newValue+1", Justification = "Impractical to add as many Series as it would take to overflow.")]
        protected virtual void OnGlobalSeriesIndexPropertyChanged(int? oldValue, int? newValue)
        {
            if (!CustomTitleInUse && (null == GetBindingExpression(TitleProperty)))
            {
                Title = newValue.HasValue ? string.Format(CultureInfo.CurrentCulture, Properties.Resources.Series_OnGlobalSeriesIndexPropertyChanged_UntitledSeriesFormatString, newValue.Value + 1) : null;
                // Setting Title will set CustomTitleInUse; reset it now
                CustomTitleInUse = false;
            }
        }

25. Example

Project: TraceLab
Source File: Range.cs
public override string ToString()
        {
            if (!this.HasData)
            {
                return Properties.Resources.Range_ToString_NoData;
            }
            else
            {
                return string.Format(CultureInfo.CurrentCulture, Properties.Resources.Range_ToString_Data, this.Minimum, this.Maximum);
            }
        }

26. Example

Project: TraceLab
Source File: RatingItem.cs
protected virtual void OnIsReadOnlyChanged(bool oldValue, bool newValue)
        {
            if (!_settingIsReadOnly)
            {
                _settingIsReadOnly = true;
                this.IsReadOnly = oldValue;

                throw new InvalidOperationException(string.Format(CultureInfo.CurrentUICulture, Properties.Resources.InvalidAttemptToChangeReadOnlyProperty, "IsReadOnly"));
            }
            else
            {
                _interactionHelper.OnIsReadOnlyChanged(newValue);
            }
        }

27. Example

Project: TraceLab
Source File: ComponentsLibraryCache.cs
public void ProcessComponentScanResults(ComponentScanResults results)
        {
            foreach /n ..... /n //View Source file for more details /n }

28. Example

Project: TraceLab
Source File: BenchmarkWizardViewModel.cs
private void ExecuteDownloadContestPackage(object param)
        {
            //the parameters are /n ..... /n //View Source file for more details /n }

29. Example

Project: cofoundry
Source File: MailMessageRenderer.cs
private string RenderView(IMailTemplate template, string type)
        {
            var path = string.Format("{0}_{1}.cshtml", template.ViewFile, type);
            string view = null;

            try
            {
                view = _viewRenderer.Render(path, template);
            }
            catch (Exception ex)
            {
                throw new TemplateRenderException(path, template, ex);
            }

            return view;
        }

30. Example

Project: cofoundry
Source File: AddCustomEntityCommandHandler.cs
private void EnforceUniquenessResult(bool isUnique, AddCustomEntityCommand command, CustomEntityDefinitionSummary definition)
        {
            if (!isUnique)
            {
                string message;
                string prop;

                if (definition.AutoGenerateUrlSlug)
                {
                    // If the slug is autogenerated then we should show the error with the title
                    message = string.Format("The {1} '{0}' must be unique (symbols and spaces are ignored in the uniqueness check)",
                        command.Title,
                        definition.Terms.GetOrDefault(CustomizableCustomEntityTermKeys.Title, "title").ToLower());
                    prop = "Title";
                }
                else
                {
                    message = string.Format("The {1} '{0}' must be unique", 
                        command.UrlSlug,
                        definition.Terms.GetOrDefault(CustomizableCustomEntityTermKeys.UrlSlug, "url slug").ToLower());
                    prop = "UrlSlug";
                }

                throw new UniqueConstraintViolationException(message, prop, command.UrlSlug);
            }
        }

31. Example

Project: cofoundry
Source File: UpdateCustomEntityUrlCommandHandler.cs
private async Task ValidateIsUnique(UpdateCustomEntityUrlCommand command, CustomEntityDefinitionSummary definition)
        {
            if (!definition.ForceUrlSlugUniqueness) return;

            var query = new IsCustomEntityPathUniqueQuery();
            query.CustomEntityDefinitionCode = definition.CustomEntityDefinitionCode;
            query.CustomEntityId = command.CustomEntityId;
            query.LocaleId = command.LocaleId;
            query.UrlSlug = command.UrlSlug;

            var isUnique = await _queryExecutor.ExecuteAsync(query);
            if (!isUnique)
            {
                var message = string.Format("A {0} already exists with the {2} '{1}'", 
                    definition.Name, 
                    command.UrlSlug, 
                    definition.Terms.GetOrDefault(CustomizableCustomEntityTermKeys.UrlSlug, "url slug").ToLower());
                throw new UniqueConstraintViolationException(message, "UrlSlug", command.UrlSlug);
            }
        }

32. Example

Project: cofoundry
Source File: DeleteUnstructuredDataDependenciesCommandHandler.cs
public async Task ExecuteAsync(DeleteUnstructuredDataDependenciesCommand command, IExecutionContext executionContext)
        {
            string entityName;

            var entityDefinition = _entityDefinitionRepository.GetByCode(command.RootEntityDefinitionCode);
            EntityNotFoundException.ThrowIfNull(entityDefinition, command.RootEntityDefinitionCode);
            entityName = entityDefinition.Name;

            var query = new GetEntityDependencySummaryByRelatedEntityQuery(command.RootEntityDefinitionCode, command.RootEntityId);
            var dependencies = await _queryExecutor.ExecuteAsync(query);

            var requiredDependency = dependencies.FirstOrDefault(d => !d.CanDelete);
            if (requiredDependency != null)
            {
                throw new ValidationException(
                    string.Format("Cannot delete this {0} because {1} '{2}' has a dependency on it.",
                    entityName,
                    requiredDependency.Entity.EntityDefinitionName.ToLower(),
                    requiredDependency.Entity.RootEntityTitle));
            }

            await _entityFrameworkSqlExecutor
                .ExecuteCommandAsync("Cofoundry.UnstructuredDataDependency_Delete",
                    new SqlParameter("EntityDefinitionCode", command.RootEntityDefinitionCode),
                    new SqlParameter("EntityId", command.RootEntityId)
                    );
        }

33. Example

Project: cofoundry
Source File: AddPageCommandHandler.cs
private void ValidateIsUnique(AddPageCommand command, bool isUnique)
        {
            if (!isUnique)
            {
                var message = string.Format("A page already exists with the path '{0}' in that directory", command.UrlPath);
                throw new UniqueConstraintViolationException(message, "UrlPath", command.UrlPath);
            }
        }

34. Example

Project: cofoundry
Source File: AddWebDirectoryCommandHandler.cs
private async Task ValidateIsUnique(AddWebDirectoryCommand command)
        {
            var query = new IsWebDirectoryPathUniqueQuery();
            query.ParentWebDirectoryId = command.ParentWebDirectoryId;
            query.UrlPath = command.UrlPath;

            var isUnique = await _queryExecutor.ExecuteAsync(query);

            if (!isUnique)
            {
                var message = string.Format("A web directory already exists in that parent directory with the path '{0}'", command.UrlPath);
                throw new UniqueConstraintViolationException(message, "UrlPath", command.UrlPath);
            }
        }

35. Example

Project: cofoundry
Source File: UpdateWebDirectoryCommandHandler.cs
private async Task ValidateIsUnique(UpdateWebDirectoryCommand command)
        {
            var query = new IsWebDirectoryPathUniqueQuery();
            query.ParentWebDirectoryId = command.ParentWebDirectoryId;
            query.UrlPath = command.UrlPath;
            query.WebDirectoryId = command.WebDirectoryId;

            var isUnique = await _queryExecutor.ExecuteAsync(query);

            if (!isUnique)
            {
                var message = string.Format("A web directory already exists in that parent directory with the path '{0}'", command.UrlPath);
                throw new UniqueConstraintViolationException(message, "UrlPath", command.UrlPath);
            }
        }

36. Example

Project: Nako
Source File: SyncOperations.cs
public async Task CheckBlockReorganization(SyncConnection connection)
        {
            while (true)
            {
                var block = this.storage.BlockGetBlockCount(1).FirstOrDefault();

                if (block == null)
                {
                    break;
                }

                var client = CryptoClientFactory.Create(connection.ServerDomain, connection.RpcAccessPort, connection.User, connection.Password, connection.Secure);
                var currentHash = await client.GetblockHashAsync(block.BlockIndex);
                if (currentHash == block.BlockHash)
                {
                    break;
                }

                this.tracer.Trace("SyncOperations", string.Format("Deleting block {0}", block.BlockIndex));

                this.storage.DeleteBlock(block.BlockHash);
            }
        }

37. Example

Project: Nako
Source File: SyncOperations.cs
public async Task CheckBlockReorganization(SyncConnection connection)
        {
            while (true)
            {
                var block = this.storage.BlockGetBlockCount(1).FirstOrDefault();

                if (block == null)
                {
                    break;
                }

                var client = CryptoClientFactory.Create(connection.ServerDomain, connection.RpcAccessPort, connection.User, connection.Password, connection.Secure);
                var currentHash = await client.GetblockHashAsync(block.BlockIndex);
                if (currentHash == block.BlockHash)
                {
                    break;
                }

                this.tracer.Trace("SyncOperations", string.Format("Deleting block {0}", block.BlockIndex));

                this.storage.DeleteBlock(block.BlockHash);
            }
        }

38. Example

Project: commandline
Source File: StringExtensions.cs
public static string FormatInvariant(this string value, params object[] arguments)
        {
            return string.Format(CultureInfo.InvariantCulture, value, arguments);
        }

39. Example

Project: commandline
Source File: StringExtensions.cs
public static string FormatLocal(this string value, params object[] arguments)
        {
            return string.Format(CultureInfo.CurrentCulture, value, arguments);
        }

40. Example

Project: More
Source File: FourFourFiveCalendar.cs
public override string ToString()
        {
            return string.Format( CultureInfo.CurrentCulture, "MinSupportedDateTime = {0:d}, MaxSupportedDateTime = {1:d}", MinSupportedDateTime, MaxSupportedDateTime );
        }

41. Example

Project: More
Source File: StringLengthAttribute.cs
private void EnsureLegalLengths()
        {
            if ( MaximumLength < 0 )
            {
                throw new InvalidOperationException( DataAnnotationsResources.StringLengthAttribute_InvalidMaxLength );
            }

            if ( MaximumLength < MinimumLength )
            {
                throw new InvalidOperationException( string.Format( CultureInfo.CurrentCulture, DataAnnotationsResources.RangeAttribute_MinGreaterThanMax, new object[] { MaximumLength, MinimumLength } ) );
            }
        }

42. Example

Project: More
Source File: ValidationAttribute.cs
public virtual string FormatErrorMessage( string name )
        {
            return string.Format( CultureInfo.CurrentCulture, ErrorMessageString, new object[] { name } );
        }

43. Example

Project: xamarin-ios-samples
Source File: MainScreen.cs
void OnHeartRateUpdated (object sender, HeartBeatEventArgs e)
		{
			heartRateUnitLabel.Hidden = false;
			heartRateLabel.Hidden = false;
			heartRateLabel.Text = e.CurrentHeartBeat.Rate.ToString();

			var monitor = (HeartRateMonitor)sender;
			if (monitor.Location == HeartRateMonitorLocation.Unknown) {
				statusLabel.Text = "Connected";
			} else {
				statusLabel.Text = String.Format ("Connected on {0}", monitor.Location);
			}

			deviceNameLabel.Hidden = false;
			deviceNameLabel.Text = monitor.Name;
		}

44. Example

Project: GridDomain
Source File: ExtensionMethods.cs
public static string FormatWith(this string format, params object[] args)
        {
            return string.Format(CultureInfo.InvariantCulture, format ?? string.Empty, args);
        }

45. Example

Project: ContinuousTests
Source File: TestAgency.cs
public void Register( TestAgent agent )
		{
			AgentRecord r = agentData[agent.Id];
			if ( r == null )
                throw new ArgumentException(
                    string.Format("Agent {0} is not in the agency database", agent.Id),
                    "agentId");
            r.Agent = agent;
		}

46. Example

Project: ContinuousTests
Source File: TestAgency.cs
public void ReleaseAgent( TestAgent agent )
		{
			AgentRecord r = agentData[agent.Id];
			if ( r == null )
				log.Error( string.Format( "Unable to release agent {0} - not in database", agent.Id ) );
			else
			{
				r.Status = AgentStatus.Ready;
				log.Debug( "Releasing agent " + agent.Id.ToString() );
			}
		}

47. Example

Project: ContinuousTests
Source File: SourceCodeDisplay.cs
protected void SelectedItemChanged(object sender, EventArgs e)
        {
            ErrorItem item;
            IFormatterCatalog formatter;

            item = _stacktraceView.SelectedItem;

            if (item == null)
            {
                _codeView.Text = null;
                return;
            }

            formatter = _codeView.Formatter;
            _codeView.Language = formatter.LanguageFromExtension(item.FileExtension);

            try
            {
                _codeView.Text = item.ReadFile();
            }
            catch (Exception ex)
            {
                _codeView.Text = String.Format(
                    "Cannot open file: '{0}'\r\nError: '{1}'\r\n",
                    item.Path, ex.Message);
            }

            _codeView.CurrentLine = item.LineNumber - 1;

            return;
        }

48. Example

Project: ContinuousTests
Source File: RuntimeFrameworkTests.cs
public override string ToString()
            {
                return string.Format("<{0}-{1}>", this.runtime, this.frameworkVersion);
            }

49. Example

Project: ContinuousTests
Source File: TestAgency.cs
public void Register( TestAgent agent )
		{
			AgentRecord r = agentData[agent.Id];
			if ( r == null )
                throw new ArgumentException(
                    string.Format("Agent {0} is not in the agency database", agent.Id),
                    "agentId");
            r.Agent = agent;
		}

50. Example

Project: ContinuousTests
Source File: TestAgency.cs
public void ReleaseAgent( TestAgent agent )
		{
			AgentRecord r = agentData[agent.Id];
			if ( r == null )
				log.Error( string.Format( "Unable to release agent {0} - not in database", agent.Id ) );
			else
			{
				r.Status = AgentStatus.Ready;
				log.Debug( "Releasing agent " + agent.Id.ToString() );
			}
		}