blob: 111d21d9f671966decfd5b15aaa0d595f0d3c271 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
// **********************************************************************
//
// Copyright (c) 2003-present ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
namespace IceInternal
{
using System.Collections.Generic;
public sealed class ValueFactoryManagerI : Ice.ValueFactoryManager
{
public void add(Ice.ValueFactory factory, string id)
{
lock(this)
{
if(_factoryMap.ContainsKey(id))
{
Ice.AlreadyRegisteredException ex = new Ice.AlreadyRegisteredException();
ex.id = id;
ex.kindOfObject = "value factory";
throw ex;
}
_factoryMap[id] = factory;
}
}
public Ice.ValueFactory find(string id)
{
lock(this)
{
Ice.ValueFactory factory = null;
_factoryMap.TryGetValue(id, out factory);
return factory;
}
}
private Dictionary<string, Ice.ValueFactory> _factoryMap = new Dictionary<string, Ice.ValueFactory>();
}
}
|