本文整理汇总了C#中ApplicationConfiguration类的典型用法代码示例。如果您正苦于以下问题:C# ApplicationConfiguration类的具体用法?C# ApplicationConfiguration怎么用?C# ApplicationConfiguration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ApplicationConfiguration类属于命名空间,在下文中一共展示了ApplicationConfiguration类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Execute
public void Execute(ApplicationInstructions instructions, ApplicationConfiguration configuration)
{
Validate.ExecuteAlias(instructions.ExecuteAlias);
var isTimedMode = instructions.TimedMode || configuration.IsTimedMode;
var group = TaskCollection.SelectTaskGroup(instructions.ExecuteAlias.Alias);
Validate.TaskGroup(group);
try
{
PrintStartTime(isTimedMode);
if (instructions.ParallelMode)
{
ExecuteASync(group, instructions, configuration);
}
else
{
ExecuteSync(group, instructions, configuration);
}
}
finally
{
PrintEndTime(isTimedMode);
}
}
开发者ID:JonyTek,项目名称:RunForrest,代码行数:27,代码来源:ExecuteGroupTaskInstructions.cs
示例2: TestClient
/// <summary>
/// This constructor loads the configuration.
/// </summary>
/// <remarks> It loads Client configuration, test configuration and
/// initializes contexts for vendor namespaces. </remarks>
public TestClient(ApplicationConfiguration configuration)
{
m_configuration = configuration;
LoadTestConfiguration(null);
m_messageContext = Compare.MessageContext = m_configuration.CreateMessageContext();
TestUtils.InitializeContexts(m_messageContext);
}
开发者ID:yuriik83,项目名称:UA-.NET,代码行数:12,代码来源:TestClient.cs
示例3: ShowDialog
/// <summary>
/// Displays the dialog.
/// </summary>
public ConfiguredEndpoint ShowDialog(ApplicationConfiguration configuration, bool createNew)
{
m_configuration = configuration;
m_endpoint = null;
// create a default collection if none provided.
if (createNew)
{
ApplicationDescription server = new DiscoveredServerListDlg().ShowDialog(null, m_configuration);
if (server != null)
{
return new ConfiguredEndpoint(server, EndpointConfiguration.Create(configuration));
}
return null;
}
ServersCTRL.Initialize(null, configuration);
OkBTN.IsEnabled = false;
Popup myPopup = new Popup();
myPopup.Child = this;
myPopup.IsOpen = true;
return m_endpoint;
}
开发者ID:OPCFoundation,项目名称:UA-.NETStandardLibrary,代码行数:31,代码来源:ConfiguredServerListDlg.xaml.cs
示例4: OverrideUaTcpImplementation
/// <summary>
/// Uses the command line to override the UA TCP implementation specified in the configuration.
/// </summary>
/// <param name="configuration">The configuration instance that stores the configurable information for a UA application.
/// </param>
public static void OverrideUaTcpImplementation(ApplicationConfiguration configuration)
{
// check if UA TCP configuration included.
TransportConfiguration transport = null;
for (int ii = 0; ii < configuration.TransportConfigurations.Count; ii++)
{
if (configuration.TransportConfigurations[ii].UriScheme == Utils.UriSchemeOpcTcp)
{
transport = configuration.TransportConfigurations[ii];
break;
}
}
// check if UA TCP implementation explicitly specified.
if (transport != null)
{
string[] args = Environment.GetCommandLineArgs();
if (args != null && args.Length > 1)
{
if (String.Compare(args[1], "-uaTcpAnsiC", StringComparison.InvariantCultureIgnoreCase) == 0)
{
transport.TypeName = Utils.UaTcpBindingNativeStack;
}
else if (String.Compare(args[1], "-uaTcpDotNet", StringComparison.InvariantCultureIgnoreCase) == 0)
{
transport.TypeName = Utils.UaTcpBindingDefault;
}
}
}
}
开发者ID:yuriik83,项目名称:UA-.NET,代码行数:37,代码来源:GuiUtils.cs
示例5: MainForm
/// <summary>
/// Creates a form which uses the specified client configuration.
/// </summary>
/// <param name="configuration">The configuration to use.</param>
public MainForm(ApplicationConfiguration configuration)
{
InitializeComponent();
ConnectServerCTRL.Configuration = m_configuration = configuration;
ConnectServerCTRL.ServerUrl = "opc.tcp://localhost:62541/Quickstarts/ReferenceServer";
this.Text = m_configuration.ApplicationName;
}
开发者ID:yuriik83,项目名称:UA-.NET,代码行数:11,代码来源:MainForm.cs
示例6: ShouldMapAllConfigFields
public void ShouldMapAllConfigFields()
{
var console = new string[0];
var config = new ApplicationConfiguration
{
IsInGroupMode = true,
IsTimedMode = true,
IsVerbodeMode = true
};
config.DefaultArguments.ExecuteAlias = "alias";
config.DefaultArguments.MethodArguments = new[] { "config" };
config.DefaultArguments.ConstructorArguments = new[] { "config" };
builder = new InstructionBuilder(console, config);
var instructions = builder.Build();
Assert.That(instructions.ExecuteAlias.Alias, Is.EqualTo("alias"));
Assert.That(instructions.Instructions.ContainsKey(InstructionType.DisplayHelp), Is.False);
Assert.That(instructions.Instructions.ContainsKey(InstructionType.DisplayList), Is.False);
Assert.That(instructions.Instructions[InstructionType.Constructor].Arguments, Is.EqualTo(new[] { "config" }));
Assert.That(instructions.Instructions[InstructionType.Method].Arguments, Is.EqualTo(new[] { "config" }));
Assert.That(instructions.Instructions[InstructionType.Group], Is.Not.Null);
Assert.That(instructions.Instructions[InstructionType.Timed], Is.Not.Null);
Assert.That(instructions.Instructions[InstructionType.Verbose], Is.Not.Null);
}
开发者ID:JonyTek,项目名称:RunForrest,代码行数:25,代码来源:InstructionBuilderSpecs.cs
示例7: Create
/// <summary>
/// Creates a new transport channel that supports the IRegistrationChannel service contract.
/// </summary>
/// <param name="configuration">The application configuration.</param>
/// <param name="description">The description for the endpoint.</param>
/// <param name="endpointConfiguration">The configuration to use with the endpoint.</param>
/// <param name="clientCertificate">The client certificate.</param>
/// <param name="messageContext">The message context to use when serializing the messages.</param>
/// <returns></returns>
public static ITransportChannel Create(
ApplicationConfiguration configuration,
EndpointDescription description,
EndpointConfiguration endpointConfiguration,
X509Certificate2 clientCertificate,
ServiceMessageContext messageContext)
{
// create a UA binary channel.
ITransportChannel channel = CreateUaBinaryChannel(
configuration,
description,
endpointConfiguration,
clientCertificate,
messageContext);
// create a WCF XML channel.
if (channel == null)
{
Uri endpointUrl = new Uri(description.EndpointUrl);
channel = new RegistrationChannel();
TransportChannelSettings settings = new TransportChannelSettings();
settings.Configuration = endpointConfiguration;
settings.Description = description;
settings.ClientCertificate = clientCertificate;
channel.Initialize(endpointUrl, settings);
}
return channel;
}
开发者ID:OPCFoundation,项目名称:UA-.NETStandardLibrary,代码行数:39,代码来源:RegistrationClient.cs
示例8: CreateMasterNodeManager
/// <summary>
/// Creates the node managers for the server.
/// </summary>
/// <remarks>
/// This method allows the sub-class create any additional node managers which it uses. The SDK
/// always creates a CoreNodeManager which handles the built-in nodes defined by the specification.
/// Any additional NodeManagers are expected to handle application specific nodes.
/// </remarks>
protected override MasterNodeManager CreateMasterNodeManager(IServerInternal server, ApplicationConfiguration configuration)
{
Utils.Trace("Creating the Node Managers.");
List<INodeManager> nodeManagers = new List<INodeManager>();
// create the custom node managers.
nodeManagers.Add(new TutorialNodeManager(server, configuration));
#region Task #C4 - Add Support for COM Wrapper
// manually configure the COM server to prevent unapproved wrappers.
ComDaClientConfiguration wrapperConfig = new ComDaClientConfiguration();
wrapperConfig.ServerName = "COM";
wrapperConfig.ServerUrl = "opc.com://localhost/OPCSample.OpcDaServer";
wrapperConfig.MaxReconnectWait = 10000;
wrapperConfig.SeperatorChars = null;
wrapperConfig.BrowseToNotSupported = false;
wrapperConfig.ItemIdParser = new ItemIdParser();
// create an instance of the wrapper node manager.
TutorialDaComNodeManager manager = new TutorialDaComNodeManager(
server,
wrapperConfig.ServerUrl,
wrapperConfig,
true);
nodeManagers.Add(manager);
#endregion
// create master node manager.
return new MasterNodeManager(server, configuration, null, nodeManagers.ToArray());
}
开发者ID:yuriik83,项目名称:UA-.NET,代码行数:41,代码来源:TutorialServer.cs
示例9: TestDataNodeManager
/// <summary>
/// Initializes the node manager.
/// </summary>
public TestDataNodeManager(Opc.Ua.Server.IServerInternal server, ApplicationConfiguration configuration)
:
base(server, configuration)
{
// update the namespaces.
List<string> namespaceUris = new List<string>();
namespaceUris.Add(Namespaces.TestData);
namespaceUris.Add(Namespaces.TestData + "/Instance");
NamespaceUris = namespaceUris;
// get the configuration for the node manager.
m_configuration = configuration.ParseExtension<TestDataNodeManagerConfiguration>();
// use suitable defaults if no configuration exists.
if (m_configuration == null)
{
m_configuration = new TestDataNodeManagerConfiguration();
}
m_lastUsedId = m_configuration.NextUnusedId-1;
// create the object used to access the test system.
m_system = new TestDataSystem(this, server.NamespaceUris, server.ServerUris);
// update the default context.
SystemContext.SystemHandle = m_system;
}
开发者ID:OPCFoundation,项目名称:UA-.NETStandardLibrary,代码行数:32,代码来源:TestDataNodeManager.cs
示例10: btnSave_Click
protected void btnSave_Click(object sender, EventArgs e)
{
lblError.Text = string.Empty;
lblSave.Text = string.Empty;
lblMessage.Text = string.Empty;
lblMessage.Visible = false;
lblError.Visible = false;
lblSave.Visible = false;
try {
using (TransactionScope scope = new TransactionScope()) {
ApplicationConfigurationManager.UpdateAppConfigStatus();
ApplicationConfiguration objAppConfig = new ApplicationConfiguration();
objAppConfig.PrimaryProducerCommissionPercent = Convert.ToDecimal(txtPrimeryProducer.Text);
objAppConfig.SecondaryProducerCommissionPercent = Convert.ToDecimal(txtSecondaryProducer.Text);
objAppConfig.EmailNotificationSite1 = txtEmailSite1.Text.Trim();
objAppConfig.EmailNotificationSite2 = txtEmailSite2.Text.Trim();
objAppConfig.EmailNotificationSite3 = txtEmailSite3.Text.Trim();
objAppConfig.Status = 1;
ApplicationConfigurationManager.Save(objAppConfig);
fillRecord();
lblSave.Text = "Record Saved.";
lblSave.Visible = true;
scope.Complete();
}
}
catch (Exception ex) {
lblError.Text = "Record Not Saved.";
lblError.Visible = true;
}
}
开发者ID:Antoniotoress1992,项目名称:asp,代码行数:31,代码来源:ucApplicationConfiguration.ascx.cs
示例11: OnServerStarting
/// <summary>
/// This method loads the configuration for the test server.
/// </summary>
protected override void OnServerStarting(ApplicationConfiguration configuration)
{
base.OnServerStarting(configuration);
LoadTestConfiguration(null);
TestUtils.InitializeContexts(base.MessageContext);
}
开发者ID:yuriik83,项目名称:UA-.NET,代码行数:10,代码来源:TestServer.cs
示例12: CoreNodeManager
/// <summary>
/// Initializes the object with default values.
/// </summary>
public CoreNodeManager(
IServerInternal server,
ApplicationConfiguration configuration,
ushort dynamicNamespaceIndex)
{
if (server == null) throw new ArgumentNullException("server");
if (configuration == null) throw new ArgumentNullException("configuration");
m_server = server;
m_nodes = new NodeTable(server.NamespaceUris, server.ServerUris, server.TypeTree);
m_monitoredItems = new Dictionary<uint,MonitoredItem>();
m_defaultMinimumSamplingInterval = 1000;
m_namespaceUris = new List<string>();
m_dynamicNamespaceIndex = dynamicNamespaceIndex;
#if LEGACY_CORENODEMANAGER
m_eventSources = new Dictionary<object,IEventSource>();
#endif
// use namespace 1 if out of range.
if (m_dynamicNamespaceIndex == 0 || m_dynamicNamespaceIndex >= server.NamespaceUris.Count)
{
m_dynamicNamespaceIndex = 1;
}
m_samplingGroupManager = new SamplingGroupManager(
server,
this,
(uint)configuration.ServerConfiguration.MaxNotificationQueueSize,
configuration.ServerConfiguration.AvailableSamplingRates);
}
开发者ID:OPCFoundation,项目名称:UA-.NETStandardLibrary,代码行数:34,代码来源:CoreNodeManager.cs
示例13: ShowDialog
/// <summary>
/// Displays the dialog.
/// </summary>
public ConfiguredEndpoint ShowDialog(ApplicationConfiguration configuration, bool createNew)
{
m_configuration = configuration;
m_endpoint = null;
// create a default collection if none provided.
if (createNew)
{
ApplicationDescription server = new DiscoveredServerListDlg().ShowDialog(null, m_configuration);
if (server != null)
{
return new ConfiguredEndpoint(server, EndpointConfiguration.Create(configuration));
}
return null;
}
ServersCTRL.Initialize(null, configuration);
OkBTN.Enabled = false;
if (ShowDialog() != DialogResult.OK)
{
return null;
}
return m_endpoint;
}
开发者ID:yuriik83,项目名称:UA-.NET,代码行数:32,代码来源:ConfiguredServerListDlg.cs
示例14: ShowDialog
/// <summary>
/// Displays the dialog.
/// </summary>
public EndpointDescription ShowDialog(
ApplicationConfiguration configuration,
ConfiguredEndpointCollection endpoints,
X509Certificate2 clientCertificate)
{
m_configuration = configuration;
m_endpoints = endpoints;
m_messageContext = configuration.CreateMessageContext();
m_clientCertificate = clientCertificate;
m_running = false;
m_filePath = @".\perftest.csv";
EndpointSelectorCTRL.Initialize(m_endpoints, configuration);
lock (m_lock)
{
OkBTN.Enabled = m_running = false;
}
// show dialog.
if (ShowDialog() != DialogResult.OK)
{
return null;
}
return null;
}
开发者ID:OPCFoundation,项目名称:UA-.NETStandardLibrary,代码行数:30,代码来源:PerformanceTestDlg.cs
示例15: PublisherForm
public PublisherForm(
ServiceMessageContext context,
ApplicationInstance application,
PublisherForm masterForm,
ApplicationConfiguration configuration)
{
InitializeComponent();
this.Icon = ClientUtils.GetAppIcon();
m_masterForm = masterForm;
m_context = context;
m_application = application;
m_server = application.Server as Opc.Ua.Server.StandardServer;
if (m_masterForm == null)
{
m_forms = new List<PublisherForm>();
}
SessionsCTRL.Configuration = m_configuration = configuration;
SessionsCTRL.MessageContext = context;
// get list of cached endpoints.
m_endpoints = m_configuration.LoadCachedEndpoints(true);
m_endpoints.DiscoveryUrls = configuration.ClientConfiguration.WellKnownDiscoveryUrls;
EndpointSelectorCTRL.Initialize(m_endpoints, m_configuration);
// initialize control state.
Disconnect();
//lth: initial MassTransit Publisher
m_massTransitPublisher = new MassTransitPublisher();
this.NotificationsCTRL.ItemsAdded += NotificationsCTRL_ItemsAdded;
}
开发者ID:yuriik83,项目名称:opcesb,代码行数:34,代码来源:PublisherForm.cs
示例16: Initialize
/// <summary>
/// Creates a form which displays the status for a UA server.
/// </summary>
/// <param name="server">The server displayed in the form.</param>
/// <param name="configuration">The configuration used to initialize the server.</param>
public void Initialize(StandardServer server, ApplicationConfiguration configuration)
{
m_server = server;
m_configuration = configuration;
m_dispatcherTimer = new DispatcherTimer();
m_dispatcherTimer.Tick += UpdateTimerCTRL_Tick;
m_dispatcherTimer.Interval = new TimeSpan(0, 0, 5); // tick every 5 seconds
m_dispatcherTimer.Start();
// add the urls to the drop down.
UrlCB.Items.Clear();
foreach (EndpointDescription endpoint in m_server.GetEndpoints())
{
if (!UrlCB.Items.Contains(endpoint.EndpointUrl))
{
UrlCB.Items.Add(endpoint.EndpointUrl);
}
}
if (UrlCB.Items.Count > 0)
{
UrlCB.SelectedIndex = 0;
}
}
开发者ID:OPCFoundation,项目名称:UA-.NETStandardLibrary,代码行数:31,代码来源:ServerDiagnosticsCtrl.xaml.cs
示例17: SubscriptionManager
/// <summary>
/// Initializes the manager with its configuration.
/// </summary>
public SubscriptionManager(
IServerInternal server,
ApplicationConfiguration configuration)
{
if (server == null) throw new ArgumentNullException("server");
if (configuration == null) throw new ArgumentNullException("configuration");
m_server = server;
m_minPublishingInterval = configuration.ServerConfiguration.MinPublishingInterval;
m_maxPublishingInterval = configuration.ServerConfiguration.MaxPublishingInterval;
m_publishingResolution = configuration.ServerConfiguration.PublishingResolution;
m_maxSubscriptionLifetime = (uint)configuration.ServerConfiguration.MaxSubscriptionLifetime;
m_minSubscriptionLifetime = (uint)configuration.ServerConfiguration.MinSubscriptionLifetime;
m_maxMessageCount = (uint)configuration.ServerConfiguration.MaxMessageQueueSize;
m_maxNotificationsPerPublish = (uint)configuration.ServerConfiguration.MaxNotificationsPerPublish;
m_maxPublishRequestCount = configuration.ServerConfiguration.MaxPublishRequestCount;
m_maxSubscriptionCount = configuration.ServerConfiguration.MaxSubscriptionCount;
m_subscriptions = new Dictionary<uint,Subscription>();
m_publishQueues = new Dictionary<NodeId,SessionPublishQueue>();
m_statusMessages = new Dictionary<NodeId, Queue<StatusMessage>>();
// create a event to signal shutdown.
m_shutdownEvent = new ManualResetEvent(true);
}
开发者ID:OPCFoundation,项目名称:UA-.NETStandardLibrary,代码行数:29,代码来源:SubscriptionManager.cs
示例18: Replace
public static string Replace(ApplicationConfiguration.ReplaceInfo[] replaceInfos, string text)
{
foreach (ApplicationConfiguration.ReplaceInfo replaceInfo in replaceInfos)
text = text.Replace(replaceInfo.from, replaceInfo.to);
return text;
}
开发者ID:re-motion,项目名称:Web-CodeGenerator,代码行数:7,代码来源:Replacer.cs
示例19: OnlineSettingsForm
public OnlineSettingsForm(ApplicationConfiguration applicationConfiguration)
{
InitializeComponent();
this.applicationConfiguration = applicationConfiguration;
workingApplicationConfiguration = ObjectCopier.CloneObject<ApplicationConfiguration, ApplicationConfiguration>(applicationConfiguration);
}
开发者ID:nvirus,项目名称:MultiMiner,代码行数:7,代码来源:OnlineSettingsForm.cs
示例20: CreateUserIdentityValidators
/// <summary>
/// Creates the objects used to validate the user identity tokens supported by the server.
/// </summary>
private void CreateUserIdentityValidators(ApplicationConfiguration configuration)
{
for (int ii = 0; ii < configuration.ServerConfiguration.UserTokenPolicies.Count; ii++)
{
UserTokenPolicy policy = configuration.ServerConfiguration.UserTokenPolicies[ii];
// ignore policies without an explicit id.
if (String.IsNullOrEmpty(policy.PolicyId))
{
continue;
}
// create a validator for an issued token policy.
if (policy.TokenType == UserTokenType.IssuedToken)
{
// the name of the element in the configuration file.
XmlQualifiedName qname = new XmlQualifiedName(policy.PolicyId, Namespaces.OpcUa);
// find the id for the issuer certificate.
CertificateIdentifier id = configuration.ParseExtension<CertificateIdentifier>(qname);
if (id == null)
{
Utils.Trace(
(int)Utils.TraceMasks.Error,
"Could not load CertificateIdentifier for UserTokenPolicy {0}",
policy.PolicyId);
continue;
}
m_tokenResolver = CreateSecurityTokenResolver(id);
m_tokenSerializer = WSSecurityTokenSerializer.DefaultInstance;
}
// create a validator for a certificate token policy.
if (policy.TokenType == UserTokenType.Certificate)
{
// the name of the element in the configuration file.
XmlQualifiedName qname = new XmlQualifiedName(policy.PolicyId, Namespaces.OpcUa);
// find the location of the trusted issuers.
CertificateTrustList trustedIssuers = configuration.ParseExtension<CertificateTrustList>(qname);
if (trustedIssuers == null)
{
Utils.Trace(
(int)Utils.TraceMasks.Error,
"Could not load CertificateTrustList for UserTokenPolicy {0}",
policy.PolicyId);
continue;
}
// trusts any certificate in the trusted people store.
m_certificateValidator = X509CertificateValidator.PeerTrust;
}
}
}
开发者ID:OPCFoundation,项目名称:UA-.NET,代码行数:62,代码来源:SampleServer.UserAuthentication.cs
注:本文中的ApplicationConfiguration类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论