本文整理汇总了C#中ApplicationType类的典型用法代码示例。如果您正苦于以下问题:C# ApplicationType类的具体用法?C# ApplicationType怎么用?C# ApplicationType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ApplicationType类属于命名空间,在下文中一共展示了ApplicationType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OfficeApplicationObjectProvider
public OfficeApplicationObjectProvider(object officeApplicationObject, ApplicationType applicationType)
{
// TODO: Complete member initialization
this.officeApplicationObject = officeApplicationObject;
m_bExternalApplication = officeApplicationObject != null;
this.applicationType = applicationType;
}
示例2: SemanticConstraintRegistry
/// <summary>
/// Constructor
/// </summary>
public SemanticConstraintRegistry(FileFormatVersions format, ApplicationType appType)
{
_format = format;
_appType = appType;
Initialize();
}
示例3: Element
internal Element(BaseStorage storage, Guid obj, ApplicationType appType, int identifier)
{
_storage = storage;
_obj = obj;
_appType = appType;
_identifier = identifier;
}
示例4: SemanticValidator
public SemanticValidator(FileFormatVersions format, ApplicationType app)
{
FileFormat = format;
AppType = app;
_curReg = new SemanticConstraintRegistry(format, app);
}
示例5: Start
internal static MonoProcess Start(ApplicationType type, string _targetExe)
{
if (type == ApplicationType.Desktopapplication)
return new MonoDesktopProcess(_targetExe);
if (type == ApplicationType.Webapplication)
return new MonoWebProcess();
throw new Exception("Unknown ApplicationType");
}
示例6: RegisterConstraint
/// <summary>
/// Register a constraint to this registry.
/// </summary>
public void RegisterConstraint(int elementTypeID, int ancestorTypeID, FileFormatVersions fileFormat, ApplicationType appType, SemanticConstraint constraint )
{
if ((fileFormat & _format) == _format && (appType & _appType) == _appType)
{
AddConstraintToDic(constraint, ancestorTypeID, _cleanList);
AddConstraintToDic(constraint, elementTypeID, _semConstraintMap);
}
}
示例7: HelloWorld
public async Task HelloWorld(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, string applicationBaseUrl, ServerType delegateServer, ApplicationType applicationType)
{
var logger = new LoggerFactory()
.AddConsole()
.AddDebug()
.CreateLogger($"HelloWorld:{serverType}:{runtimeFlavor}:{architecture}:{delegateServer}");
using (logger.BeginScope("HelloWorldTest"))
{
var deploymentParameters = new DeploymentParameters(Helpers.GetTestSitesPath(applicationType), serverType, runtimeFlavor, architecture)
{
ApplicationBaseUriHint = applicationBaseUrl,
EnvironmentName = "HelloWorld", // Will pick the Start class named 'StartupHelloWorld',
ServerConfigTemplateContent = (serverType == ServerType.IISExpress) ? File.ReadAllText("Http.config") : null,
SiteName = "HttpTestSite", // This is configured in the Http.config
TargetFramework = runtimeFlavor == RuntimeFlavor.Clr ? "net451" : "netcoreapp1.0",
ApplicationType = applicationType
};
using (var deployer = ApplicationDeployerFactory.Create(deploymentParameters, logger))
{
var deploymentResult = deployer.Deploy();
var httpClientHandler = new HttpClientHandler();
var httpClient = new HttpClient(httpClientHandler)
{
BaseAddress = new Uri(deploymentResult.ApplicationBaseUri),
Timeout = TimeSpan.FromSeconds(5),
};
// Request to base address and check if various parts of the body are rendered & measure the cold startup time.
var response = await RetryHelper.RetryRequest(() =>
{
return httpClient.GetAsync(string.Empty);
}, logger, deploymentResult.HostShutdownToken, retryCount: 30);
var responseText = await response.Content.ReadAsStringAsync();
try
{
Assert.Equal("Hello World", responseText);
response = await httpClient.GetAsync("/Path%3F%3F?query");
responseText = await response.Content.ReadAsStringAsync();
Assert.Equal("/Path??", responseText);
response = await httpClient.GetAsync("/Query%3FPath?query?");
responseText = await response.Content.ReadAsStringAsync();
Assert.Equal("?query?", responseText);
}
catch (XunitException)
{
logger.LogWarning(response.ToString());
logger.LogWarning(responseText);
throw;
}
}
}
}
示例8: GetDefaultProgramDataFolder
/// <summary>
/// Get the directory for the default location of the CruiseControl.NET data files.
/// </summary>
/// <param name="application">Type of the application. E.g. Server or WebDashboard.</param>
/// <returns>The location of the CruiseControl.NET data files.</returns>
public string GetDefaultProgramDataFolder(ApplicationType application)
{
if (application == ApplicationType.Unknown)
{
throw new ArgumentOutOfRangeException("application");
}
var pgfPath = AppDomain.CurrentDomain.BaseDirectory;
return pgfPath;
}
示例9: NonWindowsOS
public async Task NonWindowsOS(
ServerType serverType,
RuntimeFlavor runtimeFlavor,
RuntimeArchitecture architecture,
ApplicationType applicationType,
string applicationBaseUrl)
{
var smokeTestRunner = new SmokeTests(_logger);
await smokeTestRunner.SmokeTestSuite(serverType, runtimeFlavor, architecture, applicationType, applicationBaseUrl);
}
示例10: GetHandler
public static INodeCartridge GetHandler(ApplicationType applicationType)
{
switch (applicationType)
{
case ApplicationType.Mono:
return new MonoCartridge();
default:
throw new MonoscapeException("Unknown application type found");
}
}
示例11: Application
public Application(ApplicationType type, string applicant, string destacc, string destname, string memo)
{
AppType = type;
Applicant = applicant;
DestAcc = destacc;
DestName = destname;
Memo = memo;
CreationTime = DateTime.Now;
AppType = ApplicationType.APerson;
}
示例12: Save
public void Save(ApplicationType type)
{
if (type == ApplicationType.Application && MainFunc != null)
{
MethodInfo wrappedMain = WrapMain(MainFunc);
_assemblyBuilder.SetEntryPoint(wrappedMain, PEFileKinds.ConsoleApplication);
}
SaveAssembly(_fileName, _assemblyBuilder);
}
示例13: NtlmAuthenticationTest
public async Task NtlmAuthenticationTest(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, ApplicationType applicationType, string applicationBaseUrl)
{
using (_logger.BeginScope("NtlmAuthenticationTest"))
{
var musicStoreDbName = DbUtils.GetUniqueName();
var deploymentParameters = new DeploymentParameters(Helpers.GetApplicationPath(applicationType), serverType, runtimeFlavor, architecture)
{
PublishApplicationBeforeDeployment = true,
TargetFramework = runtimeFlavor == RuntimeFlavor.Clr ? "net451" : "netcoreapp1.0",
ApplicationType = applicationType,
ApplicationBaseUriHint = applicationBaseUrl,
EnvironmentName = "NtlmAuthentication", //Will pick the Start class named 'StartupNtlmAuthentication'
ServerConfigTemplateContent = (serverType == ServerType.IISExpress) ? File.ReadAllText("NtlmAuthentation.config") : null,
SiteName = "MusicStoreNtlmAuthentication", //This is configured in the NtlmAuthentication.config
UserAdditionalCleanup = parameters =>
{
DbUtils.DropDatabase(musicStoreDbName, _logger);
}
};
// Override the connection strings using environment based configuration
deploymentParameters.EnvironmentVariables
.Add(new KeyValuePair<string, string>(
MusicStore.StoreConfig.ConnectionStringKey,
DbUtils.CreateConnectionString(musicStoreDbName)));
using (var deployer = ApplicationDeployerFactory.Create(deploymentParameters, _logger))
{
var deploymentResult = deployer.Deploy();
var httpClientHandler = new HttpClientHandler() { UseDefaultCredentials = true };
var httpClient = new HttpClient(httpClientHandler) { BaseAddress = new Uri(deploymentResult.ApplicationBaseUri) };
// Request to base address and check if various parts of the body are rendered & measure the cold startup time.
var response = await RetryHelper.RetryRequest(async () =>
{
return await httpClient.GetAsync(string.Empty);
}, logger: _logger, cancellationToken: deploymentResult.HostShutdownToken);
Assert.False(response == null, "Response object is null because the client could not " +
"connect to the server after multiple retries");
var validator = new Validator(httpClient, httpClientHandler, _logger, deploymentResult);
Console.WriteLine("Verifying home page");
await validator.VerifyNtlmHomePage(response);
Console.WriteLine("Verifying access to store with permissions");
await validator.AccessStoreWithPermissions();
_logger.LogInformation("Variation completed successfully.");
}
}
}
示例14: NonWindowsOS
public async Task NonWindowsOS(
ServerType serverType,
RuntimeFlavor runtimeFlavor,
RuntimeArchitecture architecture,
ApplicationType applicationType,
string applicationBaseUrl,
bool noSource)
{
var testRunner = new PublishAndRunTests(_logger);
await testRunner.Publish_And_Run_Tests(
serverType, runtimeFlavor, architecture, applicationType, applicationBaseUrl, noSource);
}
示例15: CreateLogServerComponent
public static LogServerComponent CreateLogServerComponent(ApplicationType appType,
LogServerComponentType logServer)
{
var ht = GetHost(appType, logServer.hostID);
var component = new LogServerComponent(logServer.componentID, appType.applicationID, ht)
{
WorkingDir = logServer.workingDir,
Port = logServer.port,
HostName = ht.hostname
};
return component;
}