content stringlengths 5 1.04M | avg_line_length float64 1.75 12.9k | max_line_length int64 2 244k | alphanum_fraction float64 0 0.98 | licenses list | repository_name stringlengths 7 92 | path stringlengths 3 249 | size int64 5 1.04M | lang stringclasses 2
values |
|---|---|---|---|---|---|---|---|---|
//-----------------------------------------------------------------------
// XAML Test Data Loader Sample Application by Nicholas Armstrong
// Available online at http://nicholasarmstrong.com
//
// This code is designed for illustration purposes only.
// Exception handling and other coding practices required for production
// systems may have been ignored in order to reduce this code to its
// simplest possible form.
//-----------------------------------------------------------------------
using System;
namespace NicholasArmstrong.Posts.TestDataLoader
{
/// <summary>
/// Represents an attribute of a smart device that can be controlled.
/// </summary>
[Serializable]
public class Attribute
{
#region Properties
/// <summary>
/// Gets or sets the name of the attribute.
/// </summary>
public string Name { get; set; }
/// <summary>
/// Gets or sets the attribute's numerical identifier.
/// </summary>
public int Id { get; set; }
/// <summary>
/// Gets or sets the power usage of the attribute.
/// </summary>
public string Power { get; set; }
/// <summary>
/// Gets or sets the display position of the attribute.
/// </summary>
public int Position { get; set; }
/// <summary>
/// Gets or sets the type of attribute.
/// </summary>
public AttributeType Type { get; set; }
#endregion
}
}
| 31.755102 | 75 | 0.52635 | [
"MIT"
] | ndrarmstrong/blog | TestDataLoader/TestDataLoader/Attribute.cs | 1,558 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections;
using System.ComponentModel;
using System.Threading;
using game_Simulation.Entities.Server;
using game_Simulation.Structs;
namespace game_Simulation.Entities
{
public delegate void UpdateClientDelegate(int listNumber);
public class Bank
{
int _capital,
_totalWithdraw,
_totalDeposit,
_totalServed;
double _effectiveReputation;
Queue<Client> _clients;
BaseServer[] _servers;
BaseServer _mostAvailable;
bool _working;
List<Loan> _loans;
public UpdateClientDelegate RemoveClient;
public UpdateClientDelegate AddClient;
public Bank()
{
Capital = 0;
EffectiveReputation = 200.0;
Clients = new Queue<Client>();
Servers = new BaseServer[7];
CreaterNewTeller();
MostAvailable = Servers[0];
Loans = new List<Loan>();
}
public List<Loan> Loans
{
get { return _loans; }
set { _loans = value; }
}
public int WithdrawCount
{
get;
set;
}
public int DepositCount
{
get;
set;
}
public double CustomerFlowRate
{
get
{
return Calculations.BankCalculations.CalculateCustomerFlowRate(EffectiveReputation);
}
}
public int TotalServed
{
get { return _totalServed; }
set
{
if (value >= 0)
{
_totalServed = value;
calculateReputation();
}
}
}
public bool IsWorking
{
get { return _working; }
private set { _working = value; }
}
public BaseServer MostAvailable
{
get { return _mostAvailable; }
private set { _mostAvailable = value; }
}
public BaseServer[] Servers
{
get { return _servers; }
private set { _servers = value; }
}
[DefaultValue(200)]
public double EffectiveReputation
{
get { return _effectiveReputation; }
private set
{
if (value > 10000 || value < 200)
return;
_effectiveReputation = value;
}
}
public string Reputation
{
get
{
return Enums.BankTitleExtensions.GetBankTitle(EffectiveReputation);
}
}
internal Queue<Client> Clients
{
get { return _clients; }
private set { _clients = value; }
}
public int TotalWithdraw
{
get { return _totalWithdraw; }
private set { _totalWithdraw = value; }
}
public int TotalDeposit
{
get { return _totalDeposit; }
private set { _totalDeposit = value; }
}
public int Capital
{
get { return _capital; }
set { _capital = value; }
}
public Boolean CreaterNewTeller()
{
for (int i = 0; i < Calculations.BankCalculations.MaxTellers; i++)
{
if (Servers[i] == null)
{
Teller _teller = new Teller();
_teller.Bank = this;
_teller.ID = i + 1;
Servers[i] = _teller;
return true;
}
}
return false;
}
public bool BuyTeller()
{
if(Capital >= Calculations.BankCalculations.TellerPrice)
{
return CreaterNewTeller();
}
return false;
}
public bool BuyATM()
{
if (Capital >= Calculations.BankCalculations.ATMPrice)
{
return CreateATMs();
}
return false;
}
public bool BuyOB()
{
if (Capital >= Calculations.BankCalculations.OBPrice)
{
return CreateOB();
}
return false;
}
public bool CreateOB()
{
if(Servers[6] == null)
{
OnlineBanking _ob = new OnlineBanking();
_ob.Bank = this;
Servers[6] = _ob;
return true;
}
return false;
}
public bool CreateATMs()
{
if (Servers[5] == null)
{
ATM _atms = new ATM();
_atms.Bank = this;
Servers[5] = _atms;
return true;
}
return false;
}
public void Deposit(int amount, int tellerID)
{
Capital += amount;
TotalDeposit += amount;
updateAfterTransaction(tellerID);
//Console.WriteLine("Deposit: " + ++DepositCount);
}
public void Withdraw(int amount, int tellerID)
{
Capital -= amount;
TotalWithdraw += amount;
updateAfterTransaction(tellerID);
// Console.WriteLine("Withdraw: " + ++WithdrawCount);
}
void updateAfterTransaction(int tellerID)
{
TotalServed++;
RemoveClient(tellerID);
}
public bool EnqueueClient(Client c)
{
if (MostAvailable.Queue.Count < MostAvailable.MaxQueueLength)
{
MostAvailable.Queue.Enqueue(c);
AddClient(MostAvailable.ID);
foreach (BaseServer bs in Servers)
if (bs != null && bs.MaxQueueLength - bs.Queue.Count > MostAvailable.MaxQueueLength - MostAvailable.Queue.Count)
MostAvailable = bs;
return true;
}
else
TotalServed--;
return false;
}
public void StartTransactions()
{
if (IsWorking)
return;
IsWorking = true;
foreach (BaseServer server in Servers)
if(server != null)
server.StartTransactions();
}
public void StopTransactions(bool kill)
{
if (!IsWorking)
return;
IsWorking = false;
foreach (BaseServer server in Servers)
if (server != null)
if (!kill)
server.PauseTransactions();
else
server.StopTransactions();
}
void calculateReputation()
{
EffectiveReputation = Calculations.BankCalculations.CalculateReputation(TotalServed);
//Console.WriteLine(Calculations.BankCalculations.CalculateReputation(TotalServed) + " REPU");
}
public BankInfo GetInfo()
{
return new BankInfo(Capital, TotalWithdraw, TotalDeposit, TotalServed, Reputation, (int)EffectiveReputation);
}
public bool AddLoan(Loan loan)
{
if (Loans.Count >= Calculations.BankCalculations.MaxLoans)
return false;
Loans.Add(loan);
Capital -= loan.LoanAmount;
return true;
}
public int ProcessLoans()
{
int loanInstallementsGained = 0;
foreach (Loan loan in Loans)
{
if (loan.RemainingInstallements > 0)
loanInstallementsGained += loan.GetInstallement();
}
Loans.RemoveAll(loan => loan.RemainingInstallements <= 0);
Capital += loanInstallementsGained;
return loanInstallementsGained;
}
public bool UpgradeTeller(Teller teller)
{
int price = 0;
if (Servers.Contains(teller))
{
switch (teller.Level)
{
case 1: price = Calculations.BankCalculations.TellerL2Price; break;
case 2: price = Calculations.BankCalculations.TellerL3Price; ; break;
case 3: price = Calculations.BankCalculations.TellerL4Price; ; break;
case 4: price = Calculations.BankCalculations.TellerL5Price; ; break;
}
if (Capital >= price)
{
Capital -= price;
teller.Level++;
return true;
}
else
return false;
}
else
return false;
}
}
}
| 30.837209 | 133 | 0.463047 | [
"MIT"
] | michael-kamel/BankSim | game_Simulation/Entities/Bank.cs | 9,284 | C# |
using System;
using System.Windows.Forms;
namespace Jabra.CiscoSpark
{
public partial class BrowserForm : Form
{
public string Code { get; set; }
public BrowserForm()
{
InitializeComponent();
}
private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
string returnUri = e.Url.AbsoluteUri;
if (returnUri.StartsWith("http://localhost"))
{
var responseParameters = e.Url.Query.Split('&');
var state = responseParameters[1].Split('=')[1];
if (state == "success")
{
Code = responseParameters[0].Split('=')[1];
Properties.Settings.Default["Code"] = Code;
Properties.Settings.Default.Save();
}
webBrowser1.Stop();
webBrowser1.Navigate("about:blank");
// Close();
}
if (returnUri.StartsWith("about:blank"))
{
Close();
}
}
private void BrowserForm_Load(object sender, EventArgs e)
{
webBrowser1.Navigate("https://api.ciscospark.com/v1/authorize?client_id=C556432f895d42da8181b0d392efe4c4fa37535619d8db3b5e29bc4c826b28615&response_type=code&redirect_uri=http%3A%2F%2Flocalhost%2Fredirect.html&scope=spark%3Aall%20spark%3Akms&state=success");
}
public void NavigateTo()
{
}
}
}
| 27.696429 | 269 | 0.551257 | [
"MIT"
] | gnaudio/cisco-spark-integration | src/Jabra.CiscoSpark/BrowserForm.cs | 1,553 | C# |
using System.Threading.Tasks;
using Playground.Domain.Events;
using Playground.Messaging;
namespace Playground.Domain.Persistence.PostgreSQL.PerformanceTests.GenericIdentifer.Helpers
{
internal class DummyDispatcher : IEventDispatcherWithGenericIdentity
{
public Task RaiseEvent<TEvent>(TEvent domainEvent)
where TEvent : DomainEventForAggregateRootWithIdentity
{
return Task.FromResult(0);
}
}
} | 30.533333 | 92 | 0.737991 | [
"MIT"
] | carlos-vicente/Playground | Playground.Domain.Persistence.PostgreSQL.PerformanceTests/GenericIdentifer/Helpers/DummyDispatcher.cs | 460 | C# |
//Copyright 2018, Davin Carten, All rights reserved
#if PUN_2_OR_NEWER || MIRROR || !UNITY_2019_1_OR_NEWER
using System.Diagnostics;
using UnityEngine;
using emotitron.Compression;
namespace emotitron.NST
{
public enum BandwidthLogType { MasterIn, MasterOut, UpdateSend, UpdateRcv, UpdateMirror }
/// <summary>
/// Only used in Editor mode - this class collects and reports the size of NST Updates. May later change this from conditional
/// to a #if UNITY_EDITOR, but for now this is much cleaner.
/// </summary>
public static class BandwidthUsage
{
static bool enabled;
static BandwidthLogType logType;
static uint nstid;
static string summary;
static string objectName;
static int lastPtr;
static int startPtr;
static float masterInTotalBits, masterOutTotalBits, masterInStartTimer, masterOutStartTimer;
// construct
static BandwidthUsage()
{
enabled = (DebuggingSettings.Single.logDataUse);
}
[Conditional("UNITY_EDITOR")]
public static void AddUsage(ref UdpBitStream bitstream, string _itemname)
{
if (!enabled)
return;
int size = bitstream.ptr - lastPtr;
summary += _itemname.PadRight(16) + "\t" + size + "\n";
lastPtr = bitstream.ptr;
}
[Conditional("UNITY_EDITOR")]
public static void PrintSummary()
{
if (!enabled)
return;
string color =
(logType == BandwidthLogType.UpdateRcv) ? "<color=navy>" :
(logType == BandwidthLogType.UpdateSend) ? "<color=olive>" :
"<color=purple>"; // mirror
UnityEngine.Debug.Log(Time.time + " <b>" + color + logType + "</color></b> for NstId:" + nstid + " " + objectName + "\nTotal: " + (lastPtr - startPtr) + " bits / " + Mathf.CeilToInt((lastPtr - startPtr) / 8) + " bytes. \n" + summary);
}
[Conditional("UNITY_EDITOR")]
public static void SetName(NetworkSyncTransform nst)
{
if (!enabled)
return;
objectName = nst.name;
nstid = nst.NstId;
}
[Conditional("UNITY_EDITOR")]
public static void Start(ref UdpBitStream bitStream, BandwidthLogType _logType)
{
if (!enabled)
return;
logType = _logType;
lastPtr = bitStream.ptr;
startPtr = lastPtr;
summary = "";
}
[Conditional("UNITY_EDITOR")]
public static void ReportMasterBits(ref UdpBitStream bitstream, BandwidthLogType logType)
{
if (!enabled)
return;
// log start time if this is the first call.
if (logType == BandwidthLogType.MasterIn)
if (masterInStartTimer == 0)
masterInStartTimer = Time.time;
else
if (masterOutStartTimer == 0)
masterOutStartTimer = Time.time;
if (logType == BandwidthLogType.MasterIn)
masterInTotalBits += bitstream.ptr;
else
masterOutTotalBits += bitstream.ptr;
float elapstedTime = Time.time - ((logType == BandwidthLogType.MasterIn) ? masterInStartTimer : masterOutStartTimer);
string color = (logType == BandwidthLogType.MasterIn) ? "<color=blue>" : "<color=green>";
string avg = ( masterInTotalBits / elapstedTime).ToString();
UnityEngine.Debug.Log(Time.time + " " + color + "<b>" + logType + " Summary:</b></color> " + bitstream.ptr + " bits / " + bitstream.BytesUsed + " Bytes / " + avg + " b/s ");
}
}
}
#endif | 28.540541 | 238 | 0.683712 | [
"MIT"
] | TwoTenPvP/NetworkSyncTransform | Assets/emotitron/NST Core/Scripts/NST/Utility/BandwidthUsage.cs | 3,170 | C# |
// Distrubuted under the MIT license
// ===================================================
// SharpMC uses the permissive MIT license.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the “Software”), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software
//
// THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
// ©Copyright Kenny van Vulpen - 2015
using SharpMC.Core.Utils;
namespace SharpMC.Core.Networking.Packages
{
internal class Ping : Package<Ping>
{
public long Time = 0;
public Ping(ClientWrapper client) : base(client)
{
ReadId = 0x01;
SendId = 0x01;
}
public Ping(ClientWrapper client, DataBuffer buffer) : base(client, buffer)
{
ReadId = 0x01;
SendId = 0x01;
}
public override void Read()
{
if (Buffer != null)
{
if (Client.Player != null)
{
Client.UpdatePing();
}
long d = Buffer.ReadLong();
new Ping(Client){Time = d}.Write();
}
}
public override void Write()
{
if (Buffer != null)
{
Buffer.WriteVarInt(SendId);
Buffer.WriteLong(Time);
Buffer.FlushData();
}
}
}
} | 29.205882 | 80 | 0.684794 | [
"MIT"
] | AVollane/SharpMC | src/SharpMC.Core/Networking/Packages/Ping.cs | 1,997 | C# |
// Copyright 2016-2017 Confluent Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Refer to LICENSE for more information.
using Confluent.Kafka.Serdes;
using System;
using System.Collections.Generic;
using Xunit;
namespace Confluent.Kafka.UnitTests.Serialization
{
public class FloatTests
{
[Fact]
public void CanReconstructFloat()
{
foreach (var value in TestData)
{
Assert.Equal(value, Deserializers.Single.Deserialize(Serializers.Single.Serialize(value, false, null, null), false, false, null, null));
}
}
[Fact]
public void IsBigEndian()
{
var buffer = new byte[] { 23, 0, 0, 0 };
var value = BitConverter.ToSingle(buffer, 0);
var data = Serializers.Single.Serialize(value, false, null, null);
Assert.Equal(23, data[3]);
Assert.Equal(0, data[0]);
}
[Fact]
public void DeserializeArgNullThrow()
{
Assert.ThrowsAny<DeserializationException>(() => Deserializers.Single.Deserialize(null, true, false, null, null));
}
[Fact]
public void DeserializeArgLengthNotEqual4Throw()
{
Assert.ThrowsAny<DeserializationException>(() => Deserializers.Single.Deserialize(new byte[0], false, false, null, null));
Assert.ThrowsAny<DeserializationException>(() => Deserializers.Single.Deserialize(new byte[3], false, false, null, null));
Assert.ThrowsAny<DeserializationException>(() => Deserializers.Single.Deserialize(new byte[5], false, false, null, null));
}
public static float[] TestData
{
get
{
float[] testData = new float[]
{
0, 1, -1, 42, -42, 127, 128, 129, -127, -128,
-129,254, 255, 256, 257, -254, -255, -256, -257,
short.MinValue-1, short.MinValue, short.MinValue+1,
short.MaxValue-1, short.MaxValue,short.MaxValue+1,
int.MaxValue-1, int.MaxValue, int.MinValue, int.MinValue + 1,
float.MaxValue-1,float.MaxValue,float.MinValue,float.MinValue+1,
float.NaN,float.PositiveInfinity,float.NegativeInfinity,float.Epsilon,-float.Epsilon,
0.1f, -0.1f
};
return testData;
}
}
}
}
| 36.753086 | 152 | 0.599597 | [
"Apache-2.0"
] | karayakar/confluent-kafka-dotnet | test/Confluent.Kafka.UnitTests/Serialization/Float.cs | 2,979 | C# |
namespace StoreUI
{
public interface ICustomerMenu
{
public void Start();
}
} | 14 | 34 | 0.602041 | [
"MIT"
] | 210215-USF-NET/Hans_Mittig-P0 | StoreUI/ICustomerMenu.cs | 98 | C# |
// DirectXSharp
//
// Copyright (C) 2021 Ronald van Manen <rvanmanen@gmail.com>
//
// MIT License
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
namespace DirectXSharp.Interop
{
/// <include file='D3DAUTHENTICATEDCHANNEL_CONFIGUREPROTECTION.xml' path='doc/member[@name="D3DAUTHENTICATEDCHANNEL_CONFIGUREPROTECTION"]/*' />
public partial struct D3DAUTHENTICATEDCHANNEL_CONFIGUREPROTECTION
{
/// <include file='D3DAUTHENTICATEDCHANNEL_CONFIGUREPROTECTION.xml' path='doc/member[@name="D3DAUTHENTICATEDCHANNEL_CONFIGUREPROTECTION.Parameters"]/*' />
public D3DAUTHENTICATEDCHANNEL_CONFIGURE_INPUT Parameters;
/// <include file='D3DAUTHENTICATEDCHANNEL_CONFIGUREPROTECTION.xml' path='doc/member[@name="D3DAUTHENTICATEDCHANNEL_CONFIGUREPROTECTION.Protections"]/*' />
public D3DAUTHENTICATEDCHANNEL_PROTECTION_FLAGS Protections;
}
}
| 51.513514 | 163 | 0.769675 | [
"MIT"
] | ronaldvanmanen/DirectXSharp | sources/DirectXSharp.Interop/d3d9/D3DAUTHENTICATEDCHANNEL_CONFIGUREPROTECTION.cs | 1,906 | C# |
using System;
using Clarity.Common.Infra.TreeReadWrite.Serialization.Handlers;
using Clarity.Common.Numericals.Algebra;
using Clarity.Common.Numericals.Colors;
using Clarity.Common.Numericals.Geometry;
namespace Clarity.Common.Infra.TreeReadWrite.Serialization.HandlerFamilies
{
public class NumericalsTrwHandlerFamily : ITrwSerializationHandlerFamily
{
public bool TryCreateHandlerFor(Type type, ITrwSerializationHandlerContainer container, out ITrwSerializationHandler handler)
{
if (type == typeof(Vector4))
{
handler = new Vector4TrwHandler();
return true;
}
if (type == typeof(Vector3))
{
handler = new Vector3TrwHandler();
return true;
}
if (type == typeof(Vector2))
{
handler = new Vector2TrwHandler();
return true;
}
if (type == typeof(Transform))
{
handler = new TransformTrwHandler();
return true;
}
if (type == typeof(Color4))
{
handler = new ProxyTrwHandler<Color4, Vector4>(x => x.Raw, x => new Color4(x), false);
return true;
}
if (type == typeof(Quaternion))
{
handler = new ProxyTrwHandler<Quaternion, Vector4>(x => x.Raw, x => new Quaternion(x), false);
return true;
}
if (type == typeof(AaRectangle2))
{
handler = new ProxyTrwHandler<AaRectangle2, Vector4>(
x => new Vector4(x.Center.X, x.Center.Y, x.HalfWidth, x.HalfHeight),
x => new AaRectangle2(new Vector2(x.X, x.Y), x.Z, x.W),
false);
return true;
}
if (type == typeof(IntSize2))
{
handler = new ProxyTrwHandler<IntSize2, Vector2>(x => new Vector2(x.Width, x.Height), x => new IntSize2((int)x.X, (int)x.Y), false);
return true;
}
handler = null;
return false;
}
}
} | 36.180328 | 148 | 0.517898 | [
"MIT"
] | Zulkir/ClarityWorlds | Source/Clarity.Common/Infra/TreeReadWrite/Serialization/HandlerFamilies/NumericalsTrwHandlerFamily.cs | 2,209 | C# |
// *** WARNING: this file was generated by the Pulumi SDK Generator. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
namespace Pulumi.AzureNextGen.MachineLearningServices.V20190501
{
/// <summary>
/// An object that represents a machine learning workspace.
/// </summary>
public partial class Workspace : Pulumi.CustomResource
{
/// <summary>
/// ARM id of the application insights associated with this workspace. This cannot be changed once the workspace has been created
/// </summary>
[Output("applicationInsights")]
public Output<string?> ApplicationInsights { get; private set; } = null!;
/// <summary>
/// ARM id of the container registry associated with this workspace. This cannot be changed once the workspace has been created
/// </summary>
[Output("containerRegistry")]
public Output<string?> ContainerRegistry { get; private set; } = null!;
/// <summary>
/// The creation time of the machine learning workspace in ISO8601 format.
/// </summary>
[Output("creationTime")]
public Output<string> CreationTime { get; private set; } = null!;
/// <summary>
/// The description of this workspace.
/// </summary>
[Output("description")]
public Output<string?> Description { get; private set; } = null!;
/// <summary>
/// Url for the discovery service to identify regional endpoints for machine learning experimentation services
/// </summary>
[Output("discoveryUrl")]
public Output<string?> DiscoveryUrl { get; private set; } = null!;
/// <summary>
/// The friendly name for this workspace. This name in mutable
/// </summary>
[Output("friendlyName")]
public Output<string?> FriendlyName { get; private set; } = null!;
/// <summary>
/// The identity of the resource.
/// </summary>
[Output("identity")]
public Output<Outputs.IdentityResponse?> Identity { get; private set; } = null!;
/// <summary>
/// ARM id of the key vault associated with this workspace. This cannot be changed once the workspace has been created
/// </summary>
[Output("keyVault")]
public Output<string?> KeyVault { get; private set; } = null!;
/// <summary>
/// Specifies the location of the resource.
/// </summary>
[Output("location")]
public Output<string?> Location { get; private set; } = null!;
/// <summary>
/// Specifies the name of the resource.
/// </summary>
[Output("name")]
public Output<string> Name { get; private set; } = null!;
/// <summary>
/// The current deployment state of workspace resource. The provisioningState is to indicate states for resource provisioning.
/// </summary>
[Output("provisioningState")]
public Output<string> ProvisioningState { get; private set; } = null!;
/// <summary>
/// ARM id of the storage account associated with this workspace. This cannot be changed once the workspace has been created
/// </summary>
[Output("storageAccount")]
public Output<string?> StorageAccount { get; private set; } = null!;
/// <summary>
/// Contains resource tags defined as key/value pairs.
/// </summary>
[Output("tags")]
public Output<ImmutableDictionary<string, string>?> Tags { get; private set; } = null!;
/// <summary>
/// Specifies the type of the resource.
/// </summary>
[Output("type")]
public Output<string> Type { get; private set; } = null!;
/// <summary>
/// The immutable id associated with this workspace.
/// </summary>
[Output("workspaceId")]
public Output<string> WorkspaceId { get; private set; } = null!;
/// <summary>
/// Create a Workspace resource with the given unique name, arguments, and options.
/// </summary>
///
/// <param name="name">The unique name of the resource</param>
/// <param name="args">The arguments used to populate this resource's properties</param>
/// <param name="options">A bag of options that control this resource's behavior</param>
public Workspace(string name, WorkspaceArgs args, CustomResourceOptions? options = null)
: base("azure-nextgen:machinelearningservices/v20190501:Workspace", name, args ?? new WorkspaceArgs(), MakeResourceOptions(options, ""))
{
}
private Workspace(string name, Input<string> id, CustomResourceOptions? options = null)
: base("azure-nextgen:machinelearningservices/v20190501:Workspace", name, null, MakeResourceOptions(options, id))
{
}
private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
{
var defaultOptions = new CustomResourceOptions
{
Version = Utilities.Version,
Aliases =
{
new Pulumi.Alias { Type = "azure-nextgen:machinelearningservices/latest:Workspace"},
new Pulumi.Alias { Type = "azure-nextgen:machinelearningservices/v20180301preview:Workspace"},
new Pulumi.Alias { Type = "azure-nextgen:machinelearningservices/v20181119:Workspace"},
new Pulumi.Alias { Type = "azure-nextgen:machinelearningservices/v20190601:Workspace"},
new Pulumi.Alias { Type = "azure-nextgen:machinelearningservices/v20191101:Workspace"},
new Pulumi.Alias { Type = "azure-nextgen:machinelearningservices/v20200101:Workspace"},
new Pulumi.Alias { Type = "azure-nextgen:machinelearningservices/v20200218preview:Workspace"},
new Pulumi.Alias { Type = "azure-nextgen:machinelearningservices/v20200301:Workspace"},
new Pulumi.Alias { Type = "azure-nextgen:machinelearningservices/v20200401:Workspace"},
new Pulumi.Alias { Type = "azure-nextgen:machinelearningservices/v20200501preview:Workspace"},
new Pulumi.Alias { Type = "azure-nextgen:machinelearningservices/v20200515preview:Workspace"},
new Pulumi.Alias { Type = "azure-nextgen:machinelearningservices/v20200601:Workspace"},
new Pulumi.Alias { Type = "azure-nextgen:machinelearningservices/v20200801:Workspace"},
new Pulumi.Alias { Type = "azure-nextgen:machinelearningservices/v20200901preview:Workspace"},
},
};
var merged = CustomResourceOptions.Merge(defaultOptions, options);
// Override the ID if one was specified for consistency with other language SDKs.
merged.Id = id ?? merged.Id;
return merged;
}
/// <summary>
/// Get an existing Workspace resource's state with the given name, ID, and optional extra
/// properties used to qualify the lookup.
/// </summary>
///
/// <param name="name">The unique name of the resulting resource.</param>
/// <param name="id">The unique provider ID of the resource to lookup.</param>
/// <param name="options">A bag of options that control this resource's behavior</param>
public static Workspace Get(string name, Input<string> id, CustomResourceOptions? options = null)
{
return new Workspace(name, id, options);
}
}
public sealed class WorkspaceArgs : Pulumi.ResourceArgs
{
/// <summary>
/// ARM id of the application insights associated with this workspace. This cannot be changed once the workspace has been created
/// </summary>
[Input("applicationInsights")]
public Input<string>? ApplicationInsights { get; set; }
/// <summary>
/// ARM id of the container registry associated with this workspace. This cannot be changed once the workspace has been created
/// </summary>
[Input("containerRegistry")]
public Input<string>? ContainerRegistry { get; set; }
/// <summary>
/// The description of this workspace.
/// </summary>
[Input("description")]
public Input<string>? Description { get; set; }
/// <summary>
/// Url for the discovery service to identify regional endpoints for machine learning experimentation services
/// </summary>
[Input("discoveryUrl")]
public Input<string>? DiscoveryUrl { get; set; }
/// <summary>
/// The friendly name for this workspace. This name in mutable
/// </summary>
[Input("friendlyName")]
public Input<string>? FriendlyName { get; set; }
/// <summary>
/// The identity of the resource.
/// </summary>
[Input("identity")]
public Input<Inputs.IdentityArgs>? Identity { get; set; }
/// <summary>
/// ARM id of the key vault associated with this workspace. This cannot be changed once the workspace has been created
/// </summary>
[Input("keyVault")]
public Input<string>? KeyVault { get; set; }
/// <summary>
/// Specifies the location of the resource.
/// </summary>
[Input("location")]
public Input<string>? Location { get; set; }
/// <summary>
/// Name of the resource group in which workspace is located.
/// </summary>
[Input("resourceGroupName", required: true)]
public Input<string> ResourceGroupName { get; set; } = null!;
/// <summary>
/// ARM id of the storage account associated with this workspace. This cannot be changed once the workspace has been created
/// </summary>
[Input("storageAccount")]
public Input<string>? StorageAccount { get; set; }
[Input("tags")]
private InputMap<string>? _tags;
/// <summary>
/// Contains resource tags defined as key/value pairs.
/// </summary>
public InputMap<string> Tags
{
get => _tags ?? (_tags = new InputMap<string>());
set => _tags = value;
}
/// <summary>
/// Name of Azure Machine Learning workspace.
/// </summary>
[Input("workspaceName", required: true)]
public Input<string> WorkspaceName { get; set; } = null!;
public WorkspaceArgs()
{
}
}
}
| 43.059524 | 148 | 0.606304 | [
"Apache-2.0"
] | test-wiz-sec/pulumi-azure-nextgen | sdk/dotnet/MachineLearningServices/V20190501/Workspace.cs | 10,851 | C# |
using System;
using System.Collections.Generic;
using System.Text;
namespace GameRankServer.Storage
{
public class GameRanks : EFBase<long>
{
/// <summary>
/// 游戏ID
/// </summary>
public long GameId { get; set; }
/// <summary>
/// 昵称
/// </summary>
public long Userid { get; set; }
/// <summary>
/// 分数
/// </summary>
public long Score { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateTime { get; set; }
}
}
| 19.266667 | 48 | 0.480969 | [
"MIT"
] | yktudou/gamerankserver | GameRankServer/GameRankServer.Storage/GameRanks.cs | 600 | C# |
// Generated from https://github.com/nuke-build/nuke/blob/master/build/specifications/Octopus.json
using JetBrains.Annotations;
using Newtonsoft.Json;
using Nuke.Common;
using Nuke.Common.Execution;
using Nuke.Common.Tooling;
using Nuke.Common.Tools;
using Nuke.Common.Utilities.Collections;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
using System.Text;
namespace Nuke.Common.Tools.Octopus
{
/// <summary>
/// <p>Octopus Deploy is an automated deployment server, which you install yourself, much like you would install SQL Server, Team Foundation Server or JetBrains TeamCity. Octopus makes it easy to automate deployment of ASP.NET web applications and Windows Services into development, test and production environments.<para/>Along with the Octopus Deploy server, you'll also install a lightweight agent service on each of the machines that you plan to deploy to, for example your web and application servers. We call this the Tentacle agent; the idea being that one Octopus server controls many Tentacles, potentially a lot more than 8! With Octopus and Tentacle, you can easily deploy to your own servers, or cloud services from providers like Amazon Web Services or Microsoft Azure.</p>
/// <p>For more details, visit the <a href="https://octopus.com/">official website</a>.</p>
/// </summary>
[PublicAPI]
[ExcludeFromCodeCoverage]
public static partial class OctopusTasks
{
/// <summary>
/// Path to the Octopus executable.
/// </summary>
public static string OctopusPath =>
ToolPathResolver.TryGetEnvironmentExecutable("OCTOPUS_EXE") ??
ToolPathResolver.GetPackageExecutable("OctopusTools", "Octo.exe");
public static Action<OutputType, string> OctopusLogger { get; set; } = ProcessTasks.DefaultLogger;
/// <summary>
/// <p>Octopus Deploy is an automated deployment server, which you install yourself, much like you would install SQL Server, Team Foundation Server or JetBrains TeamCity. Octopus makes it easy to automate deployment of ASP.NET web applications and Windows Services into development, test and production environments.<para/>Along with the Octopus Deploy server, you'll also install a lightweight agent service on each of the machines that you plan to deploy to, for example your web and application servers. We call this the Tentacle agent; the idea being that one Octopus server controls many Tentacles, potentially a lot more than 8! With Octopus and Tentacle, you can easily deploy to your own servers, or cloud services from providers like Amazon Web Services or Microsoft Azure.</p>
/// <p>For more details, visit the <a href="https://octopus.com/">official website</a>.</p>
/// </summary>
public static IReadOnlyCollection<Output> Octopus(string arguments, string workingDirectory = null, IReadOnlyDictionary<string, string> environmentVariables = null, int? timeout = null, bool? logOutput = null, bool? logInvocation = null, Func<string, string> outputFilter = null)
{
var process = ProcessTasks.StartProcess(OctopusPath, arguments, workingDirectory, environmentVariables, timeout, logOutput, logInvocation, OctopusLogger, outputFilter);
process.AssertZeroExitCode();
return process.Output;
}
/// <summary>
/// <p>The <c>Octo.exe pack</c> command provides a number of other useful parameters that can be used to customize the way your package gets created, such as output folder, files to include and release notes.</p>
/// <p>For more details, visit the <a href="https://octopus.com/">official website</a>.</p>
/// </summary>
/// <remarks>
/// <p>This is a <a href="http://www.nuke.build/docs/authoring-builds/cli-tools.html#fluent-apis">CLI wrapper with fluent API</a> that allows to modify the following arguments:</p>
/// <ul>
/// <li><c>--author</c> via <see cref="OctopusPackSettings.Authors"/></li>
/// <li><c>--basePath</c> via <see cref="OctopusPackSettings.BasePath"/></li>
/// <li><c>--description</c> via <see cref="OctopusPackSettings.Description"/></li>
/// <li><c>--format</c> via <see cref="OctopusPackSettings.Format"/></li>
/// <li><c>--id</c> via <see cref="OctopusPackSettings.Id"/></li>
/// <li><c>--include</c> via <see cref="OctopusPackSettings.Include"/></li>
/// <li><c>--outFolder</c> via <see cref="OctopusPackSettings.OutputFolder"/></li>
/// <li><c>--overwrite</c> via <see cref="OctopusPackSettings.Overwrite"/></li>
/// <li><c>--releaseNotes</c> via <see cref="OctopusPackSettings.ReleaseNotes"/></li>
/// <li><c>--releaseNotesFile</c> via <see cref="OctopusPackSettings.ReleaseNotesFile"/></li>
/// <li><c>--title</c> via <see cref="OctopusPackSettings.Title"/></li>
/// <li><c>--verbose</c> via <see cref="OctopusPackSettings.Verbose"/></li>
/// <li><c>--version</c> via <see cref="OctopusPackSettings.Version"/></li>
/// </ul>
/// </remarks>
public static IReadOnlyCollection<Output> OctopusPack(OctopusPackSettings toolSettings = null)
{
toolSettings = toolSettings ?? new OctopusPackSettings();
var process = ProcessTasks.StartProcess(toolSettings);
process.AssertZeroExitCode();
return process.Output;
}
/// <summary>
/// <p>The <c>Octo.exe pack</c> command provides a number of other useful parameters that can be used to customize the way your package gets created, such as output folder, files to include and release notes.</p>
/// <p>For more details, visit the <a href="https://octopus.com/">official website</a>.</p>
/// </summary>
/// <remarks>
/// <p>This is a <a href="http://www.nuke.build/docs/authoring-builds/cli-tools.html#fluent-apis">CLI wrapper with fluent API</a> that allows to modify the following arguments:</p>
/// <ul>
/// <li><c>--author</c> via <see cref="OctopusPackSettings.Authors"/></li>
/// <li><c>--basePath</c> via <see cref="OctopusPackSettings.BasePath"/></li>
/// <li><c>--description</c> via <see cref="OctopusPackSettings.Description"/></li>
/// <li><c>--format</c> via <see cref="OctopusPackSettings.Format"/></li>
/// <li><c>--id</c> via <see cref="OctopusPackSettings.Id"/></li>
/// <li><c>--include</c> via <see cref="OctopusPackSettings.Include"/></li>
/// <li><c>--outFolder</c> via <see cref="OctopusPackSettings.OutputFolder"/></li>
/// <li><c>--overwrite</c> via <see cref="OctopusPackSettings.Overwrite"/></li>
/// <li><c>--releaseNotes</c> via <see cref="OctopusPackSettings.ReleaseNotes"/></li>
/// <li><c>--releaseNotesFile</c> via <see cref="OctopusPackSettings.ReleaseNotesFile"/></li>
/// <li><c>--title</c> via <see cref="OctopusPackSettings.Title"/></li>
/// <li><c>--verbose</c> via <see cref="OctopusPackSettings.Verbose"/></li>
/// <li><c>--version</c> via <see cref="OctopusPackSettings.Version"/></li>
/// </ul>
/// </remarks>
public static IReadOnlyCollection<Output> OctopusPack(Configure<OctopusPackSettings> configurator)
{
return OctopusPack(configurator(new OctopusPackSettings()));
}
/// <summary>
/// <p>The <c>Octo.exe pack</c> command provides a number of other useful parameters that can be used to customize the way your package gets created, such as output folder, files to include and release notes.</p>
/// <p>For more details, visit the <a href="https://octopus.com/">official website</a>.</p>
/// </summary>
/// <remarks>
/// <p>This is a <a href="http://www.nuke.build/docs/authoring-builds/cli-tools.html#fluent-apis">CLI wrapper with fluent API</a> that allows to modify the following arguments:</p>
/// <ul>
/// <li><c>--author</c> via <see cref="OctopusPackSettings.Authors"/></li>
/// <li><c>--basePath</c> via <see cref="OctopusPackSettings.BasePath"/></li>
/// <li><c>--description</c> via <see cref="OctopusPackSettings.Description"/></li>
/// <li><c>--format</c> via <see cref="OctopusPackSettings.Format"/></li>
/// <li><c>--id</c> via <see cref="OctopusPackSettings.Id"/></li>
/// <li><c>--include</c> via <see cref="OctopusPackSettings.Include"/></li>
/// <li><c>--outFolder</c> via <see cref="OctopusPackSettings.OutputFolder"/></li>
/// <li><c>--overwrite</c> via <see cref="OctopusPackSettings.Overwrite"/></li>
/// <li><c>--releaseNotes</c> via <see cref="OctopusPackSettings.ReleaseNotes"/></li>
/// <li><c>--releaseNotesFile</c> via <see cref="OctopusPackSettings.ReleaseNotesFile"/></li>
/// <li><c>--title</c> via <see cref="OctopusPackSettings.Title"/></li>
/// <li><c>--verbose</c> via <see cref="OctopusPackSettings.Verbose"/></li>
/// <li><c>--version</c> via <see cref="OctopusPackSettings.Version"/></li>
/// </ul>
/// </remarks>
public static IEnumerable<(OctopusPackSettings Settings, IReadOnlyCollection<Output> Output)> OctopusPack(CombinatorialConfigure<OctopusPackSettings> configurator, int degreeOfParallelism = 1, bool completeOnFailure = false)
{
return configurator.Invoke(OctopusPack, OctopusLogger, degreeOfParallelism, completeOnFailure);
}
/// <summary>
/// <p>The <c>Octo.exe push</c> command can push any of the supported packages types listed on this <a href="https://octopus.com/docs/packaging-applications/supported-packages">page</a>.</p>
/// <p>For more details, visit the <a href="https://octopus.com/">official website</a>.</p>
/// </summary>
/// <remarks>
/// <p>This is a <a href="http://www.nuke.build/docs/authoring-builds/cli-tools.html#fluent-apis">CLI wrapper with fluent API</a> that allows to modify the following arguments:</p>
/// <ul>
/// <li><c>--apiKey</c> via <see cref="OctopusPushSettings.ApiKey"/></li>
/// <li><c>--configFile</c> via <see cref="OctopusPushSettings.ConfigFile"/></li>
/// <li><c>--debug</c> via <see cref="OctopusPushSettings.Debug"/></li>
/// <li><c>--enableServiceMessages</c> via <see cref="OctopusPushSettings.EnableServiceMessages"/></li>
/// <li><c>--ignoreSslErrors</c> via <see cref="OctopusPushSettings.IgnoreSslErrors"/></li>
/// <li><c>--logLevel</c> via <see cref="OctopusPushSettings.LogLevel"/></li>
/// <li><c>--package</c> via <see cref="OctopusPushSettings.Package"/></li>
/// <li><c>--pass</c> via <see cref="OctopusPushSettings.Password"/></li>
/// <li><c>--proxy</c> via <see cref="OctopusPushSettings.Proxy"/></li>
/// <li><c>--proxyPass</c> via <see cref="OctopusPushSettings.ProxyPassword"/></li>
/// <li><c>--proxyUser</c> via <see cref="OctopusPushSettings.ProxyUsername"/></li>
/// <li><c>--replace-existing</c> via <see cref="OctopusPushSettings.ReplaceExisting"/></li>
/// <li><c>--server</c> via <see cref="OctopusPushSettings.Server"/></li>
/// <li><c>--space</c> via <see cref="OctopusPushSettings.Space"/></li>
/// <li><c>--timeout</c> via <see cref="OctopusPushSettings.Timeout"/></li>
/// <li><c>--user</c> via <see cref="OctopusPushSettings.Username"/></li>
/// </ul>
/// </remarks>
public static IReadOnlyCollection<Output> OctopusPush(OctopusPushSettings toolSettings = null)
{
toolSettings = toolSettings ?? new OctopusPushSettings();
var process = ProcessTasks.StartProcess(toolSettings);
process.AssertZeroExitCode();
return process.Output;
}
/// <summary>
/// <p>The <c>Octo.exe push</c> command can push any of the supported packages types listed on this <a href="https://octopus.com/docs/packaging-applications/supported-packages">page</a>.</p>
/// <p>For more details, visit the <a href="https://octopus.com/">official website</a>.</p>
/// </summary>
/// <remarks>
/// <p>This is a <a href="http://www.nuke.build/docs/authoring-builds/cli-tools.html#fluent-apis">CLI wrapper with fluent API</a> that allows to modify the following arguments:</p>
/// <ul>
/// <li><c>--apiKey</c> via <see cref="OctopusPushSettings.ApiKey"/></li>
/// <li><c>--configFile</c> via <see cref="OctopusPushSettings.ConfigFile"/></li>
/// <li><c>--debug</c> via <see cref="OctopusPushSettings.Debug"/></li>
/// <li><c>--enableServiceMessages</c> via <see cref="OctopusPushSettings.EnableServiceMessages"/></li>
/// <li><c>--ignoreSslErrors</c> via <see cref="OctopusPushSettings.IgnoreSslErrors"/></li>
/// <li><c>--logLevel</c> via <see cref="OctopusPushSettings.LogLevel"/></li>
/// <li><c>--package</c> via <see cref="OctopusPushSettings.Package"/></li>
/// <li><c>--pass</c> via <see cref="OctopusPushSettings.Password"/></li>
/// <li><c>--proxy</c> via <see cref="OctopusPushSettings.Proxy"/></li>
/// <li><c>--proxyPass</c> via <see cref="OctopusPushSettings.ProxyPassword"/></li>
/// <li><c>--proxyUser</c> via <see cref="OctopusPushSettings.ProxyUsername"/></li>
/// <li><c>--replace-existing</c> via <see cref="OctopusPushSettings.ReplaceExisting"/></li>
/// <li><c>--server</c> via <see cref="OctopusPushSettings.Server"/></li>
/// <li><c>--space</c> via <see cref="OctopusPushSettings.Space"/></li>
/// <li><c>--timeout</c> via <see cref="OctopusPushSettings.Timeout"/></li>
/// <li><c>--user</c> via <see cref="OctopusPushSettings.Username"/></li>
/// </ul>
/// </remarks>
public static IReadOnlyCollection<Output> OctopusPush(Configure<OctopusPushSettings> configurator)
{
return OctopusPush(configurator(new OctopusPushSettings()));
}
/// <summary>
/// <p>The <c>Octo.exe push</c> command can push any of the supported packages types listed on this <a href="https://octopus.com/docs/packaging-applications/supported-packages">page</a>.</p>
/// <p>For more details, visit the <a href="https://octopus.com/">official website</a>.</p>
/// </summary>
/// <remarks>
/// <p>This is a <a href="http://www.nuke.build/docs/authoring-builds/cli-tools.html#fluent-apis">CLI wrapper with fluent API</a> that allows to modify the following arguments:</p>
/// <ul>
/// <li><c>--apiKey</c> via <see cref="OctopusPushSettings.ApiKey"/></li>
/// <li><c>--configFile</c> via <see cref="OctopusPushSettings.ConfigFile"/></li>
/// <li><c>--debug</c> via <see cref="OctopusPushSettings.Debug"/></li>
/// <li><c>--enableServiceMessages</c> via <see cref="OctopusPushSettings.EnableServiceMessages"/></li>
/// <li><c>--ignoreSslErrors</c> via <see cref="OctopusPushSettings.IgnoreSslErrors"/></li>
/// <li><c>--logLevel</c> via <see cref="OctopusPushSettings.LogLevel"/></li>
/// <li><c>--package</c> via <see cref="OctopusPushSettings.Package"/></li>
/// <li><c>--pass</c> via <see cref="OctopusPushSettings.Password"/></li>
/// <li><c>--proxy</c> via <see cref="OctopusPushSettings.Proxy"/></li>
/// <li><c>--proxyPass</c> via <see cref="OctopusPushSettings.ProxyPassword"/></li>
/// <li><c>--proxyUser</c> via <see cref="OctopusPushSettings.ProxyUsername"/></li>
/// <li><c>--replace-existing</c> via <see cref="OctopusPushSettings.ReplaceExisting"/></li>
/// <li><c>--server</c> via <see cref="OctopusPushSettings.Server"/></li>
/// <li><c>--space</c> via <see cref="OctopusPushSettings.Space"/></li>
/// <li><c>--timeout</c> via <see cref="OctopusPushSettings.Timeout"/></li>
/// <li><c>--user</c> via <see cref="OctopusPushSettings.Username"/></li>
/// </ul>
/// </remarks>
public static IEnumerable<(OctopusPushSettings Settings, IReadOnlyCollection<Output> Output)> OctopusPush(CombinatorialConfigure<OctopusPushSettings> configurator, int degreeOfParallelism = 1, bool completeOnFailure = false)
{
return configurator.Invoke(OctopusPush, OctopusLogger, degreeOfParallelism, completeOnFailure);
}
/// <summary>
/// <p>The <c>Octo.exe create-release</c> can be used to automate the creation of releases. This allows you to easily integrate Octopus with other continuous integration servers.</p>
/// <p>For more details, visit the <a href="https://octopus.com/">official website</a>.</p>
/// </summary>
/// <remarks>
/// <p>This is a <a href="http://www.nuke.build/docs/authoring-builds/cli-tools.html#fluent-apis">CLI wrapper with fluent API</a> that allows to modify the following arguments:</p>
/// <ul>
/// <li><c>--apiKey</c> via <see cref="OctopusCreateReleaseSettings.ApiKey"/></li>
/// <li><c>--cancelontimeout</c> via <see cref="OctopusCreateReleaseSettings.CancelOnTimeout"/></li>
/// <li><c>--channel</c> via <see cref="OctopusCreateReleaseSettings.Channel"/></li>
/// <li><c>--configFile</c> via <see cref="OctopusCreateReleaseSettings.ConfigFile"/></li>
/// <li><c>--debug</c> via <see cref="OctopusCreateReleaseSettings.Debug"/></li>
/// <li><c>--deployat</c> via <see cref="OctopusCreateReleaseSettings.DeployAt"/></li>
/// <li><c>--deploymentchecksleepcycle</c> via <see cref="OctopusCreateReleaseSettings.DeploymentCheckSleepCycle"/></li>
/// <li><c>--deploymenttimeout</c> via <see cref="OctopusCreateReleaseSettings.DeploymentTimeout"/></li>
/// <li><c>--deployto</c> via <see cref="OctopusCreateReleaseSettings.DeployTo"/></li>
/// <li><c>--enableServiceMessages</c> via <see cref="OctopusCreateReleaseSettings.EnableServiceMessages"/></li>
/// <li><c>--force</c> via <see cref="OctopusCreateReleaseSettings.Force"/></li>
/// <li><c>--forcepackagedownload</c> via <see cref="OctopusCreateReleaseSettings.ForcePackageDownload"/></li>
/// <li><c>--guidedfailure</c> via <see cref="OctopusCreateReleaseSettings.GuidedFailure"/></li>
/// <li><c>--ignorechannelrules</c> via <see cref="OctopusCreateReleaseSettings.IgnoreChannelRules"/></li>
/// <li><c>--ignoreexisting</c> via <see cref="OctopusCreateReleaseSettings.IgnoreExisting"/></li>
/// <li><c>--ignoreSslErrors</c> via <see cref="OctopusCreateReleaseSettings.IgnoreSslErrors"/></li>
/// <li><c>--logLevel</c> via <see cref="OctopusCreateReleaseSettings.LogLevel"/></li>
/// <li><c>--norawlog</c> via <see cref="OctopusCreateReleaseSettings.NoRawLog"/></li>
/// <li><c>--package</c> via <see cref="OctopusCreateReleaseSettings.PackageVersions"/></li>
/// <li><c>--packageprerelease</c> via <see cref="OctopusCreateReleaseSettings.PackagePrerelease"/></li>
/// <li><c>--packagesFolder</c> via <see cref="OctopusCreateReleaseSettings.PackagesFolder"/></li>
/// <li><c>--packageversion</c> via <see cref="OctopusCreateReleaseSettings.DefaultPackageVersion"/></li>
/// <li><c>--pass</c> via <see cref="OctopusCreateReleaseSettings.Password"/></li>
/// <li><c>--progress</c> via <see cref="OctopusCreateReleaseSettings.Progress"/></li>
/// <li><c>--project</c> via <see cref="OctopusCreateReleaseSettings.Project"/></li>
/// <li><c>--proxy</c> via <see cref="OctopusCreateReleaseSettings.Proxy"/></li>
/// <li><c>--proxyPass</c> via <see cref="OctopusCreateReleaseSettings.ProxyPassword"/></li>
/// <li><c>--proxyUser</c> via <see cref="OctopusCreateReleaseSettings.ProxyUsername"/></li>
/// <li><c>--rawlogfile</c> via <see cref="OctopusCreateReleaseSettings.RawLogFile"/></li>
/// <li><c>--releasenotes</c> via <see cref="OctopusCreateReleaseSettings.ReleaseNotes"/></li>
/// <li><c>--releasenotesfile</c> via <see cref="OctopusCreateReleaseSettings.ReleaseNotesFile"/></li>
/// <li><c>--server</c> via <see cref="OctopusCreateReleaseSettings.Server"/></li>
/// <li><c>--skip</c> via <see cref="OctopusCreateReleaseSettings.Skip"/></li>
/// <li><c>--space</c> via <see cref="OctopusCreateReleaseSettings.Space"/></li>
/// <li><c>--specificmachines</c> via <see cref="OctopusCreateReleaseSettings.SpecificMachines"/></li>
/// <li><c>--tenant</c> via <see cref="OctopusCreateReleaseSettings.Tenant"/></li>
/// <li><c>--tenanttag</c> via <see cref="OctopusCreateReleaseSettings.TenantTag"/></li>
/// <li><c>--timeout</c> via <see cref="OctopusCreateReleaseSettings.Timeout"/></li>
/// <li><c>--user</c> via <see cref="OctopusCreateReleaseSettings.Username"/></li>
/// <li><c>--variable</c> via <see cref="OctopusCreateReleaseSettings.Variables"/></li>
/// <li><c>--version</c> via <see cref="OctopusCreateReleaseSettings.Version"/></li>
/// <li><c>--waitfordeployment</c> via <see cref="OctopusCreateReleaseSettings.WaitForDeployment"/></li>
/// <li><c>--whatif</c> via <see cref="OctopusCreateReleaseSettings.WhatIf"/></li>
/// </ul>
/// </remarks>
public static IReadOnlyCollection<Output> OctopusCreateRelease(OctopusCreateReleaseSettings toolSettings = null)
{
toolSettings = toolSettings ?? new OctopusCreateReleaseSettings();
var process = ProcessTasks.StartProcess(toolSettings);
process.AssertZeroExitCode();
return process.Output;
}
/// <summary>
/// <p>The <c>Octo.exe create-release</c> can be used to automate the creation of releases. This allows you to easily integrate Octopus with other continuous integration servers.</p>
/// <p>For more details, visit the <a href="https://octopus.com/">official website</a>.</p>
/// </summary>
/// <remarks>
/// <p>This is a <a href="http://www.nuke.build/docs/authoring-builds/cli-tools.html#fluent-apis">CLI wrapper with fluent API</a> that allows to modify the following arguments:</p>
/// <ul>
/// <li><c>--apiKey</c> via <see cref="OctopusCreateReleaseSettings.ApiKey"/></li>
/// <li><c>--cancelontimeout</c> via <see cref="OctopusCreateReleaseSettings.CancelOnTimeout"/></li>
/// <li><c>--channel</c> via <see cref="OctopusCreateReleaseSettings.Channel"/></li>
/// <li><c>--configFile</c> via <see cref="OctopusCreateReleaseSettings.ConfigFile"/></li>
/// <li><c>--debug</c> via <see cref="OctopusCreateReleaseSettings.Debug"/></li>
/// <li><c>--deployat</c> via <see cref="OctopusCreateReleaseSettings.DeployAt"/></li>
/// <li><c>--deploymentchecksleepcycle</c> via <see cref="OctopusCreateReleaseSettings.DeploymentCheckSleepCycle"/></li>
/// <li><c>--deploymenttimeout</c> via <see cref="OctopusCreateReleaseSettings.DeploymentTimeout"/></li>
/// <li><c>--deployto</c> via <see cref="OctopusCreateReleaseSettings.DeployTo"/></li>
/// <li><c>--enableServiceMessages</c> via <see cref="OctopusCreateReleaseSettings.EnableServiceMessages"/></li>
/// <li><c>--force</c> via <see cref="OctopusCreateReleaseSettings.Force"/></li>
/// <li><c>--forcepackagedownload</c> via <see cref="OctopusCreateReleaseSettings.ForcePackageDownload"/></li>
/// <li><c>--guidedfailure</c> via <see cref="OctopusCreateReleaseSettings.GuidedFailure"/></li>
/// <li><c>--ignorechannelrules</c> via <see cref="OctopusCreateReleaseSettings.IgnoreChannelRules"/></li>
/// <li><c>--ignoreexisting</c> via <see cref="OctopusCreateReleaseSettings.IgnoreExisting"/></li>
/// <li><c>--ignoreSslErrors</c> via <see cref="OctopusCreateReleaseSettings.IgnoreSslErrors"/></li>
/// <li><c>--logLevel</c> via <see cref="OctopusCreateReleaseSettings.LogLevel"/></li>
/// <li><c>--norawlog</c> via <see cref="OctopusCreateReleaseSettings.NoRawLog"/></li>
/// <li><c>--package</c> via <see cref="OctopusCreateReleaseSettings.PackageVersions"/></li>
/// <li><c>--packageprerelease</c> via <see cref="OctopusCreateReleaseSettings.PackagePrerelease"/></li>
/// <li><c>--packagesFolder</c> via <see cref="OctopusCreateReleaseSettings.PackagesFolder"/></li>
/// <li><c>--packageversion</c> via <see cref="OctopusCreateReleaseSettings.DefaultPackageVersion"/></li>
/// <li><c>--pass</c> via <see cref="OctopusCreateReleaseSettings.Password"/></li>
/// <li><c>--progress</c> via <see cref="OctopusCreateReleaseSettings.Progress"/></li>
/// <li><c>--project</c> via <see cref="OctopusCreateReleaseSettings.Project"/></li>
/// <li><c>--proxy</c> via <see cref="OctopusCreateReleaseSettings.Proxy"/></li>
/// <li><c>--proxyPass</c> via <see cref="OctopusCreateReleaseSettings.ProxyPassword"/></li>
/// <li><c>--proxyUser</c> via <see cref="OctopusCreateReleaseSettings.ProxyUsername"/></li>
/// <li><c>--rawlogfile</c> via <see cref="OctopusCreateReleaseSettings.RawLogFile"/></li>
/// <li><c>--releasenotes</c> via <see cref="OctopusCreateReleaseSettings.ReleaseNotes"/></li>
/// <li><c>--releasenotesfile</c> via <see cref="OctopusCreateReleaseSettings.ReleaseNotesFile"/></li>
/// <li><c>--server</c> via <see cref="OctopusCreateReleaseSettings.Server"/></li>
/// <li><c>--skip</c> via <see cref="OctopusCreateReleaseSettings.Skip"/></li>
/// <li><c>--space</c> via <see cref="OctopusCreateReleaseSettings.Space"/></li>
/// <li><c>--specificmachines</c> via <see cref="OctopusCreateReleaseSettings.SpecificMachines"/></li>
/// <li><c>--tenant</c> via <see cref="OctopusCreateReleaseSettings.Tenant"/></li>
/// <li><c>--tenanttag</c> via <see cref="OctopusCreateReleaseSettings.TenantTag"/></li>
/// <li><c>--timeout</c> via <see cref="OctopusCreateReleaseSettings.Timeout"/></li>
/// <li><c>--user</c> via <see cref="OctopusCreateReleaseSettings.Username"/></li>
/// <li><c>--variable</c> via <see cref="OctopusCreateReleaseSettings.Variables"/></li>
/// <li><c>--version</c> via <see cref="OctopusCreateReleaseSettings.Version"/></li>
/// <li><c>--waitfordeployment</c> via <see cref="OctopusCreateReleaseSettings.WaitForDeployment"/></li>
/// <li><c>--whatif</c> via <see cref="OctopusCreateReleaseSettings.WhatIf"/></li>
/// </ul>
/// </remarks>
public static IReadOnlyCollection<Output> OctopusCreateRelease(Configure<OctopusCreateReleaseSettings> configurator)
{
return OctopusCreateRelease(configurator(new OctopusCreateReleaseSettings()));
}
/// <summary>
/// <p>The <c>Octo.exe create-release</c> can be used to automate the creation of releases. This allows you to easily integrate Octopus with other continuous integration servers.</p>
/// <p>For more details, visit the <a href="https://octopus.com/">official website</a>.</p>
/// </summary>
/// <remarks>
/// <p>This is a <a href="http://www.nuke.build/docs/authoring-builds/cli-tools.html#fluent-apis">CLI wrapper with fluent API</a> that allows to modify the following arguments:</p>
/// <ul>
/// <li><c>--apiKey</c> via <see cref="OctopusCreateReleaseSettings.ApiKey"/></li>
/// <li><c>--cancelontimeout</c> via <see cref="OctopusCreateReleaseSettings.CancelOnTimeout"/></li>
/// <li><c>--channel</c> via <see cref="OctopusCreateReleaseSettings.Channel"/></li>
/// <li><c>--configFile</c> via <see cref="OctopusCreateReleaseSettings.ConfigFile"/></li>
/// <li><c>--debug</c> via <see cref="OctopusCreateReleaseSettings.Debug"/></li>
/// <li><c>--deployat</c> via <see cref="OctopusCreateReleaseSettings.DeployAt"/></li>
/// <li><c>--deploymentchecksleepcycle</c> via <see cref="OctopusCreateReleaseSettings.DeploymentCheckSleepCycle"/></li>
/// <li><c>--deploymenttimeout</c> via <see cref="OctopusCreateReleaseSettings.DeploymentTimeout"/></li>
/// <li><c>--deployto</c> via <see cref="OctopusCreateReleaseSettings.DeployTo"/></li>
/// <li><c>--enableServiceMessages</c> via <see cref="OctopusCreateReleaseSettings.EnableServiceMessages"/></li>
/// <li><c>--force</c> via <see cref="OctopusCreateReleaseSettings.Force"/></li>
/// <li><c>--forcepackagedownload</c> via <see cref="OctopusCreateReleaseSettings.ForcePackageDownload"/></li>
/// <li><c>--guidedfailure</c> via <see cref="OctopusCreateReleaseSettings.GuidedFailure"/></li>
/// <li><c>--ignorechannelrules</c> via <see cref="OctopusCreateReleaseSettings.IgnoreChannelRules"/></li>
/// <li><c>--ignoreexisting</c> via <see cref="OctopusCreateReleaseSettings.IgnoreExisting"/></li>
/// <li><c>--ignoreSslErrors</c> via <see cref="OctopusCreateReleaseSettings.IgnoreSslErrors"/></li>
/// <li><c>--logLevel</c> via <see cref="OctopusCreateReleaseSettings.LogLevel"/></li>
/// <li><c>--norawlog</c> via <see cref="OctopusCreateReleaseSettings.NoRawLog"/></li>
/// <li><c>--package</c> via <see cref="OctopusCreateReleaseSettings.PackageVersions"/></li>
/// <li><c>--packageprerelease</c> via <see cref="OctopusCreateReleaseSettings.PackagePrerelease"/></li>
/// <li><c>--packagesFolder</c> via <see cref="OctopusCreateReleaseSettings.PackagesFolder"/></li>
/// <li><c>--packageversion</c> via <see cref="OctopusCreateReleaseSettings.DefaultPackageVersion"/></li>
/// <li><c>--pass</c> via <see cref="OctopusCreateReleaseSettings.Password"/></li>
/// <li><c>--progress</c> via <see cref="OctopusCreateReleaseSettings.Progress"/></li>
/// <li><c>--project</c> via <see cref="OctopusCreateReleaseSettings.Project"/></li>
/// <li><c>--proxy</c> via <see cref="OctopusCreateReleaseSettings.Proxy"/></li>
/// <li><c>--proxyPass</c> via <see cref="OctopusCreateReleaseSettings.ProxyPassword"/></li>
/// <li><c>--proxyUser</c> via <see cref="OctopusCreateReleaseSettings.ProxyUsername"/></li>
/// <li><c>--rawlogfile</c> via <see cref="OctopusCreateReleaseSettings.RawLogFile"/></li>
/// <li><c>--releasenotes</c> via <see cref="OctopusCreateReleaseSettings.ReleaseNotes"/></li>
/// <li><c>--releasenotesfile</c> via <see cref="OctopusCreateReleaseSettings.ReleaseNotesFile"/></li>
/// <li><c>--server</c> via <see cref="OctopusCreateReleaseSettings.Server"/></li>
/// <li><c>--skip</c> via <see cref="OctopusCreateReleaseSettings.Skip"/></li>
/// <li><c>--space</c> via <see cref="OctopusCreateReleaseSettings.Space"/></li>
/// <li><c>--specificmachines</c> via <see cref="OctopusCreateReleaseSettings.SpecificMachines"/></li>
/// <li><c>--tenant</c> via <see cref="OctopusCreateReleaseSettings.Tenant"/></li>
/// <li><c>--tenanttag</c> via <see cref="OctopusCreateReleaseSettings.TenantTag"/></li>
/// <li><c>--timeout</c> via <see cref="OctopusCreateReleaseSettings.Timeout"/></li>
/// <li><c>--user</c> via <see cref="OctopusCreateReleaseSettings.Username"/></li>
/// <li><c>--variable</c> via <see cref="OctopusCreateReleaseSettings.Variables"/></li>
/// <li><c>--version</c> via <see cref="OctopusCreateReleaseSettings.Version"/></li>
/// <li><c>--waitfordeployment</c> via <see cref="OctopusCreateReleaseSettings.WaitForDeployment"/></li>
/// <li><c>--whatif</c> via <see cref="OctopusCreateReleaseSettings.WhatIf"/></li>
/// </ul>
/// </remarks>
public static IEnumerable<(OctopusCreateReleaseSettings Settings, IReadOnlyCollection<Output> Output)> OctopusCreateRelease(CombinatorialConfigure<OctopusCreateReleaseSettings> configurator, int degreeOfParallelism = 1, bool completeOnFailure = false)
{
return configurator.Invoke(OctopusCreateRelease, OctopusLogger, degreeOfParallelism, completeOnFailure);
}
/// <summary>
/// <p>The <c>Octo.exe deploy-release</c> can be used to automate the deployment of releases to environments. This allows you to easily integrate Octopus with other continuous integration servers.</p>
/// <p>For more details, visit the <a href="https://octopus.com/">official website</a>.</p>
/// </summary>
/// <remarks>
/// <p>This is a <a href="http://www.nuke.build/docs/authoring-builds/cli-tools.html#fluent-apis">CLI wrapper with fluent API</a> that allows to modify the following arguments:</p>
/// <ul>
/// <li><c>--apiKey</c> via <see cref="OctopusDeployReleaseSettings.ApiKey"/></li>
/// <li><c>--cancelontimeout</c> via <see cref="OctopusDeployReleaseSettings.CancelOnTimeout"/></li>
/// <li><c>--channel</c> via <see cref="OctopusDeployReleaseSettings.Channel"/></li>
/// <li><c>--configFile</c> via <see cref="OctopusDeployReleaseSettings.ConfigFile"/></li>
/// <li><c>--debug</c> via <see cref="OctopusDeployReleaseSettings.Debug"/></li>
/// <li><c>--deployat</c> via <see cref="OctopusDeployReleaseSettings.DeployAt"/></li>
/// <li><c>--deploymentchecksleepcycle</c> via <see cref="OctopusDeployReleaseSettings.DeploymentCheckSleepCycle"/></li>
/// <li><c>--deploymenttimeout</c> via <see cref="OctopusDeployReleaseSettings.DeploymentTimeout"/></li>
/// <li><c>--deployto</c> via <see cref="OctopusDeployReleaseSettings.DeployTo"/></li>
/// <li><c>--enableServiceMessages</c> via <see cref="OctopusDeployReleaseSettings.EnableServiceMessages"/></li>
/// <li><c>--force</c> via <see cref="OctopusDeployReleaseSettings.Force"/></li>
/// <li><c>--forcepackagedownload</c> via <see cref="OctopusDeployReleaseSettings.ForcePackageDownload"/></li>
/// <li><c>--guidedfailure</c> via <see cref="OctopusDeployReleaseSettings.GuidedFailure"/></li>
/// <li><c>--ignoreSslErrors</c> via <see cref="OctopusDeployReleaseSettings.IgnoreSslErrors"/></li>
/// <li><c>--logLevel</c> via <see cref="OctopusDeployReleaseSettings.LogLevel"/></li>
/// <li><c>--norawlog</c> via <see cref="OctopusDeployReleaseSettings.NoRawLog"/></li>
/// <li><c>--pass</c> via <see cref="OctopusDeployReleaseSettings.Password"/></li>
/// <li><c>--progress</c> via <see cref="OctopusDeployReleaseSettings.Progress"/></li>
/// <li><c>--project</c> via <see cref="OctopusDeployReleaseSettings.Project"/></li>
/// <li><c>--proxy</c> via <see cref="OctopusDeployReleaseSettings.Proxy"/></li>
/// <li><c>--proxyPass</c> via <see cref="OctopusDeployReleaseSettings.ProxyPassword"/></li>
/// <li><c>--proxyUser</c> via <see cref="OctopusDeployReleaseSettings.ProxyUsername"/></li>
/// <li><c>--rawlogfile</c> via <see cref="OctopusDeployReleaseSettings.RawLogFile"/></li>
/// <li><c>--server</c> via <see cref="OctopusDeployReleaseSettings.Server"/></li>
/// <li><c>--skip</c> via <see cref="OctopusDeployReleaseSettings.Skip"/></li>
/// <li><c>--space</c> via <see cref="OctopusDeployReleaseSettings.Space"/></li>
/// <li><c>--specificmachines</c> via <see cref="OctopusDeployReleaseSettings.SpecificMachines"/></li>
/// <li><c>--tenant</c> via <see cref="OctopusDeployReleaseSettings.Tenant"/></li>
/// <li><c>--tenanttag</c> via <see cref="OctopusDeployReleaseSettings.TenantTag"/></li>
/// <li><c>--timeout</c> via <see cref="OctopusDeployReleaseSettings.Timeout"/></li>
/// <li><c>--updateVariables</c> via <see cref="OctopusDeployReleaseSettings.UpdateVariables"/></li>
/// <li><c>--user</c> via <see cref="OctopusDeployReleaseSettings.Username"/></li>
/// <li><c>--variable</c> via <see cref="OctopusDeployReleaseSettings.Variables"/></li>
/// <li><c>--version</c> via <see cref="OctopusDeployReleaseSettings.Version"/></li>
/// <li><c>--waitfordeployment</c> via <see cref="OctopusDeployReleaseSettings.WaitForDepployment"/></li>
/// </ul>
/// </remarks>
public static IReadOnlyCollection<Output> OctopusDeployRelease(OctopusDeployReleaseSettings toolSettings = null)
{
toolSettings = toolSettings ?? new OctopusDeployReleaseSettings();
var process = ProcessTasks.StartProcess(toolSettings);
process.AssertZeroExitCode();
return process.Output;
}
/// <summary>
/// <p>The <c>Octo.exe deploy-release</c> can be used to automate the deployment of releases to environments. This allows you to easily integrate Octopus with other continuous integration servers.</p>
/// <p>For more details, visit the <a href="https://octopus.com/">official website</a>.</p>
/// </summary>
/// <remarks>
/// <p>This is a <a href="http://www.nuke.build/docs/authoring-builds/cli-tools.html#fluent-apis">CLI wrapper with fluent API</a> that allows to modify the following arguments:</p>
/// <ul>
/// <li><c>--apiKey</c> via <see cref="OctopusDeployReleaseSettings.ApiKey"/></li>
/// <li><c>--cancelontimeout</c> via <see cref="OctopusDeployReleaseSettings.CancelOnTimeout"/></li>
/// <li><c>--channel</c> via <see cref="OctopusDeployReleaseSettings.Channel"/></li>
/// <li><c>--configFile</c> via <see cref="OctopusDeployReleaseSettings.ConfigFile"/></li>
/// <li><c>--debug</c> via <see cref="OctopusDeployReleaseSettings.Debug"/></li>
/// <li><c>--deployat</c> via <see cref="OctopusDeployReleaseSettings.DeployAt"/></li>
/// <li><c>--deploymentchecksleepcycle</c> via <see cref="OctopusDeployReleaseSettings.DeploymentCheckSleepCycle"/></li>
/// <li><c>--deploymenttimeout</c> via <see cref="OctopusDeployReleaseSettings.DeploymentTimeout"/></li>
/// <li><c>--deployto</c> via <see cref="OctopusDeployReleaseSettings.DeployTo"/></li>
/// <li><c>--enableServiceMessages</c> via <see cref="OctopusDeployReleaseSettings.EnableServiceMessages"/></li>
/// <li><c>--force</c> via <see cref="OctopusDeployReleaseSettings.Force"/></li>
/// <li><c>--forcepackagedownload</c> via <see cref="OctopusDeployReleaseSettings.ForcePackageDownload"/></li>
/// <li><c>--guidedfailure</c> via <see cref="OctopusDeployReleaseSettings.GuidedFailure"/></li>
/// <li><c>--ignoreSslErrors</c> via <see cref="OctopusDeployReleaseSettings.IgnoreSslErrors"/></li>
/// <li><c>--logLevel</c> via <see cref="OctopusDeployReleaseSettings.LogLevel"/></li>
/// <li><c>--norawlog</c> via <see cref="OctopusDeployReleaseSettings.NoRawLog"/></li>
/// <li><c>--pass</c> via <see cref="OctopusDeployReleaseSettings.Password"/></li>
/// <li><c>--progress</c> via <see cref="OctopusDeployReleaseSettings.Progress"/></li>
/// <li><c>--project</c> via <see cref="OctopusDeployReleaseSettings.Project"/></li>
/// <li><c>--proxy</c> via <see cref="OctopusDeployReleaseSettings.Proxy"/></li>
/// <li><c>--proxyPass</c> via <see cref="OctopusDeployReleaseSettings.ProxyPassword"/></li>
/// <li><c>--proxyUser</c> via <see cref="OctopusDeployReleaseSettings.ProxyUsername"/></li>
/// <li><c>--rawlogfile</c> via <see cref="OctopusDeployReleaseSettings.RawLogFile"/></li>
/// <li><c>--server</c> via <see cref="OctopusDeployReleaseSettings.Server"/></li>
/// <li><c>--skip</c> via <see cref="OctopusDeployReleaseSettings.Skip"/></li>
/// <li><c>--space</c> via <see cref="OctopusDeployReleaseSettings.Space"/></li>
/// <li><c>--specificmachines</c> via <see cref="OctopusDeployReleaseSettings.SpecificMachines"/></li>
/// <li><c>--tenant</c> via <see cref="OctopusDeployReleaseSettings.Tenant"/></li>
/// <li><c>--tenanttag</c> via <see cref="OctopusDeployReleaseSettings.TenantTag"/></li>
/// <li><c>--timeout</c> via <see cref="OctopusDeployReleaseSettings.Timeout"/></li>
/// <li><c>--updateVariables</c> via <see cref="OctopusDeployReleaseSettings.UpdateVariables"/></li>
/// <li><c>--user</c> via <see cref="OctopusDeployReleaseSettings.Username"/></li>
/// <li><c>--variable</c> via <see cref="OctopusDeployReleaseSettings.Variables"/></li>
/// <li><c>--version</c> via <see cref="OctopusDeployReleaseSettings.Version"/></li>
/// <li><c>--waitfordeployment</c> via <see cref="OctopusDeployReleaseSettings.WaitForDepployment"/></li>
/// </ul>
/// </remarks>
public static IReadOnlyCollection<Output> OctopusDeployRelease(Configure<OctopusDeployReleaseSettings> configurator)
{
return OctopusDeployRelease(configurator(new OctopusDeployReleaseSettings()));
}
/// <summary>
/// <p>The <c>Octo.exe deploy-release</c> can be used to automate the deployment of releases to environments. This allows you to easily integrate Octopus with other continuous integration servers.</p>
/// <p>For more details, visit the <a href="https://octopus.com/">official website</a>.</p>
/// </summary>
/// <remarks>
/// <p>This is a <a href="http://www.nuke.build/docs/authoring-builds/cli-tools.html#fluent-apis">CLI wrapper with fluent API</a> that allows to modify the following arguments:</p>
/// <ul>
/// <li><c>--apiKey</c> via <see cref="OctopusDeployReleaseSettings.ApiKey"/></li>
/// <li><c>--cancelontimeout</c> via <see cref="OctopusDeployReleaseSettings.CancelOnTimeout"/></li>
/// <li><c>--channel</c> via <see cref="OctopusDeployReleaseSettings.Channel"/></li>
/// <li><c>--configFile</c> via <see cref="OctopusDeployReleaseSettings.ConfigFile"/></li>
/// <li><c>--debug</c> via <see cref="OctopusDeployReleaseSettings.Debug"/></li>
/// <li><c>--deployat</c> via <see cref="OctopusDeployReleaseSettings.DeployAt"/></li>
/// <li><c>--deploymentchecksleepcycle</c> via <see cref="OctopusDeployReleaseSettings.DeploymentCheckSleepCycle"/></li>
/// <li><c>--deploymenttimeout</c> via <see cref="OctopusDeployReleaseSettings.DeploymentTimeout"/></li>
/// <li><c>--deployto</c> via <see cref="OctopusDeployReleaseSettings.DeployTo"/></li>
/// <li><c>--enableServiceMessages</c> via <see cref="OctopusDeployReleaseSettings.EnableServiceMessages"/></li>
/// <li><c>--force</c> via <see cref="OctopusDeployReleaseSettings.Force"/></li>
/// <li><c>--forcepackagedownload</c> via <see cref="OctopusDeployReleaseSettings.ForcePackageDownload"/></li>
/// <li><c>--guidedfailure</c> via <see cref="OctopusDeployReleaseSettings.GuidedFailure"/></li>
/// <li><c>--ignoreSslErrors</c> via <see cref="OctopusDeployReleaseSettings.IgnoreSslErrors"/></li>
/// <li><c>--logLevel</c> via <see cref="OctopusDeployReleaseSettings.LogLevel"/></li>
/// <li><c>--norawlog</c> via <see cref="OctopusDeployReleaseSettings.NoRawLog"/></li>
/// <li><c>--pass</c> via <see cref="OctopusDeployReleaseSettings.Password"/></li>
/// <li><c>--progress</c> via <see cref="OctopusDeployReleaseSettings.Progress"/></li>
/// <li><c>--project</c> via <see cref="OctopusDeployReleaseSettings.Project"/></li>
/// <li><c>--proxy</c> via <see cref="OctopusDeployReleaseSettings.Proxy"/></li>
/// <li><c>--proxyPass</c> via <see cref="OctopusDeployReleaseSettings.ProxyPassword"/></li>
/// <li><c>--proxyUser</c> via <see cref="OctopusDeployReleaseSettings.ProxyUsername"/></li>
/// <li><c>--rawlogfile</c> via <see cref="OctopusDeployReleaseSettings.RawLogFile"/></li>
/// <li><c>--server</c> via <see cref="OctopusDeployReleaseSettings.Server"/></li>
/// <li><c>--skip</c> via <see cref="OctopusDeployReleaseSettings.Skip"/></li>
/// <li><c>--space</c> via <see cref="OctopusDeployReleaseSettings.Space"/></li>
/// <li><c>--specificmachines</c> via <see cref="OctopusDeployReleaseSettings.SpecificMachines"/></li>
/// <li><c>--tenant</c> via <see cref="OctopusDeployReleaseSettings.Tenant"/></li>
/// <li><c>--tenanttag</c> via <see cref="OctopusDeployReleaseSettings.TenantTag"/></li>
/// <li><c>--timeout</c> via <see cref="OctopusDeployReleaseSettings.Timeout"/></li>
/// <li><c>--updateVariables</c> via <see cref="OctopusDeployReleaseSettings.UpdateVariables"/></li>
/// <li><c>--user</c> via <see cref="OctopusDeployReleaseSettings.Username"/></li>
/// <li><c>--variable</c> via <see cref="OctopusDeployReleaseSettings.Variables"/></li>
/// <li><c>--version</c> via <see cref="OctopusDeployReleaseSettings.Version"/></li>
/// <li><c>--waitfordeployment</c> via <see cref="OctopusDeployReleaseSettings.WaitForDepployment"/></li>
/// </ul>
/// </remarks>
public static IEnumerable<(OctopusDeployReleaseSettings Settings, IReadOnlyCollection<Output> Output)> OctopusDeployRelease(CombinatorialConfigure<OctopusDeployReleaseSettings> configurator, int degreeOfParallelism = 1, bool completeOnFailure = false)
{
return configurator.Invoke(OctopusDeployRelease, OctopusLogger, degreeOfParallelism, completeOnFailure);
}
}
#region OctopusPackSettings
/// <summary>
/// Used within <see cref="OctopusTasks"/>.
/// </summary>
[PublicAPI]
[ExcludeFromCodeCoverage]
[Serializable]
public partial class OctopusPackSettings : ToolSettings
{
/// <summary>
/// Path to the Octopus executable.
/// </summary>
public override string ToolPath => base.ToolPath ?? OctopusTasks.OctopusPath;
public override Action<OutputType, string> CustomLogger => OctopusTasks.OctopusLogger;
/// <summary>
/// The ID of the package. E.g. <c>MyCompany.MyApp</c>.
/// </summary>
public virtual string Id { get; internal set; }
/// <summary>
/// Package format. Options are: NuPkg, Zip. Defaults to NuPkg, though we recommend Zip going forward.
/// </summary>
public virtual OctopusPackFormat Format { get; internal set; }
/// <summary>
/// The version of the package; must be a valid SemVer. Defaults to a timestamp-based version.
/// </summary>
public virtual string Version { get; internal set; }
/// <summary>
/// The folder into which the generated NUPKG file will be written. Defaults to <c>.</c>.
/// </summary>
public virtual string OutputFolder { get; internal set; }
/// <summary>
/// The root folder containing files and folders to pack. Defaults to <c>.</c>.
/// </summary>
public virtual string BasePath { get; internal set; }
/// <summary>
/// List more detailed output. E.g. Which files are being added.
/// </summary>
public virtual bool? Verbose { get; internal set; }
/// <summary>
/// Add an author to the package metadata. Defaults to the current user.
/// </summary>
public virtual IReadOnlyList<string> Authors => AuthorsInternal.AsReadOnly();
internal List<string> AuthorsInternal { get; set; } = new List<string>();
/// <summary>
/// The title of the package.
/// </summary>
public virtual string Title { get; internal set; }
/// <summary>
/// A description of the package. Defaults to a generic description.
/// </summary>
public virtual string Description { get; internal set; }
/// <summary>
/// Release notes for this version of the package.
/// </summary>
public virtual string ReleaseNotes { get; internal set; }
/// <summary>
/// A file containing release notes for this version of the package.
/// </summary>
public virtual string ReleaseNotesFile { get; internal set; }
/// <summary>
/// Add a file pattern to include, relative to the base path. E.g. <c>/bin/-*.dll</c> - if none are specified, defaults to <c>**</c>.
/// </summary>
public virtual string Include { get; internal set; }
/// <summary>
/// Allow an existing package file of the same ID/version to be overwritten.
/// </summary>
public virtual bool? Overwrite { get; internal set; }
protected override Arguments ConfigureArguments(Arguments arguments)
{
arguments
.Add("pack")
.Add("--id={value}", Id)
.Add("--format={value}", Format)
.Add("--version={value}", Version)
.Add("--outFolder={value}", OutputFolder)
.Add("--basePath={value}", BasePath)
.Add("--verbose", Verbose)
.Add("--author={value}", Authors)
.Add("--title={value}", Title)
.Add("--description={value}", Description)
.Add("--releaseNotes={value}", ReleaseNotes)
.Add("--releaseNotesFile={value}", ReleaseNotesFile)
.Add("--include={value}", Include)
.Add("--overwrite", Overwrite);
return base.ConfigureArguments(arguments);
}
}
#endregion
#region OctopusPushSettings
/// <summary>
/// Used within <see cref="OctopusTasks"/>.
/// </summary>
[PublicAPI]
[ExcludeFromCodeCoverage]
[Serializable]
public partial class OctopusPushSettings : ToolSettings
{
/// <summary>
/// Path to the Octopus executable.
/// </summary>
public override string ToolPath => base.ToolPath ?? OctopusTasks.OctopusPath;
public override Action<OutputType, string> CustomLogger => OctopusTasks.OctopusLogger;
/// <summary>
/// Package file to push.
/// </summary>
public virtual IReadOnlyList<string> Package => PackageInternal.AsReadOnly();
internal List<string> PackageInternal { get; set; } = new List<string>();
/// <summary>
/// If the package already exists in the repository, the default behavior is to reject the new package being pushed. You can pass this flag to overwrite the existing package.
/// </summary>
public virtual bool? ReplaceExisting { get; internal set; }
/// <summary>
/// The base URL for your Octopus server - e.g., http://your-octopus/
/// </summary>
public virtual string Server { get; internal set; }
/// <summary>
/// Your API key. Get this from the user profile page. Your must provide an apiKey or username and password. If the guest account is enabled, a key of API-GUEST can be used.
/// </summary>
public virtual string ApiKey { get; internal set; }
/// <summary>
/// Username to use when authenticating with the server. Your must provide an apiKey or username and password.
/// </summary>
public virtual string Username { get; internal set; }
/// <summary>
/// Password to use when authenticating with the server.
/// </summary>
public virtual string Password { get; internal set; }
/// <summary>
/// Text file of default values, with one 'key = value' per line.
/// </summary>
public virtual string ConfigFile { get; internal set; }
/// <summary>
/// Enable debug logging.
/// </summary>
public virtual bool? Debug { get; internal set; }
/// <summary>
/// Set this flag if your Octopus server uses HTTPS but the certificate is not trusted on this machine. Any certificate errors will be ignored. WARNING: this option may create a security vulnerability.
/// </summary>
public virtual bool? IgnoreSslErrors { get; internal set; }
/// <summary>
/// Enable TeamCity or Team Foundation Build service messages when logging.
/// </summary>
public virtual bool? EnableServiceMessages { get; internal set; }
/// <summary>
/// Timeout in seconds for network operations. Default is 600.
/// </summary>
public virtual int? Timeout { get; internal set; }
/// <summary>
/// The URI of the proxy to use, e.g., http://example.com:8080.
/// </summary>
public virtual string Proxy { get; internal set; }
/// <summary>
/// The username for the proxy.
/// </summary>
public virtual string ProxyUsername { get; internal set; }
/// <summary>
/// The password for the proxy. If both the username and password are omitted and proxyAddress is specified, the default credentials are used.
/// </summary>
public virtual string ProxyPassword { get; internal set; }
/// <summary>
/// The name of a space within which this command will be executed. The default space will be used if it is omitted.
/// </summary>
public virtual string Space { get; internal set; }
/// <summary>
/// The log level. Valid options are verbose, debug, information, warning, error and fatal. Defaults to 'debug'.
/// </summary>
public virtual string LogLevel { get; internal set; }
protected override Arguments ConfigureArguments(Arguments arguments)
{
arguments
.Add("push")
.Add("--package={value}", Package)
.Add("--replace-existing", ReplaceExisting)
.Add("--server={value}", Server)
.Add("--apiKey={value}", ApiKey, secret: true)
.Add("--user={value}", Username)
.Add("--pass={value}", Password, secret: true)
.Add("--configFile={value}", ConfigFile)
.Add("--debug", Debug)
.Add("--ignoreSslErrors", IgnoreSslErrors)
.Add("--enableServiceMessages", EnableServiceMessages)
.Add("--timeout={value}", Timeout)
.Add("--proxy={value}", Proxy)
.Add("--proxyUser={value}", ProxyUsername)
.Add("--proxyPass={value}", ProxyPassword, secret: true)
.Add("--space={value}", Space)
.Add("--logLevel={value}", LogLevel);
return base.ConfigureArguments(arguments);
}
}
#endregion
#region OctopusCreateReleaseSettings
/// <summary>
/// Used within <see cref="OctopusTasks"/>.
/// </summary>
[PublicAPI]
[ExcludeFromCodeCoverage]
[Serializable]
public partial class OctopusCreateReleaseSettings : ToolSettings
{
/// <summary>
/// Path to the Octopus executable.
/// </summary>
public override string ToolPath => base.ToolPath ?? OctopusTasks.OctopusPath;
public override Action<OutputType, string> CustomLogger => OctopusTasks.OctopusLogger;
/// <summary>
/// Name of the project.
/// </summary>
public virtual string Project { get; internal set; }
/// <summary>
/// Default version number of all packages to use for this release.
/// </summary>
public virtual string DefaultPackageVersion { get; internal set; }
/// <summary>
/// Release number to use for the new release.
/// </summary>
public virtual string Version { get; internal set; }
/// <summary>
/// Channel to use for the new release. Omit this argument to automatically select the best channel.
/// </summary>
public virtual string Channel { get; internal set; }
/// <summary>
/// Version number to use for a step or package in the release. Format: <c>--package=StepNameOrPackageId:Version</c>.
/// </summary>
public virtual IReadOnlyDictionary<string, string> PackageVersions => PackageVersionsInternal.AsReadOnly();
internal Dictionary<string, string> PackageVersionsInternal { get; set; } = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
/// <summary>
/// A folder containing NuGet packages from which we should get versions.
/// </summary>
public virtual string PackagesFolder { get; internal set; }
/// <summary>
/// Release Notes for the new release. Styling with Markdown is supported.
/// </summary>
public virtual string ReleaseNotes { get; internal set; }
/// <summary>
/// Path to a file that contains Release Notes for the new release. Supports Markdown files.
/// </summary>
public virtual string ReleaseNotesFile { get; internal set; }
/// <summary>
/// Don't create this release if there is already one with the same version number.
/// </summary>
public virtual bool? IgnoreExisting { get; internal set; }
/// <summary>
/// Create the release ignoring any version rules specified by the channel.
/// </summary>
public virtual bool? IgnoreChannelRules { get; internal set; }
/// <summary>
/// Pre-release for latest version of all packages to use for this release.
/// </summary>
public virtual string PackagePrerelease { get; internal set; }
/// <summary>
/// Perform a dry run but don't actually create/deploy release.
/// </summary>
public virtual bool? WhatIf { get; internal set; }
/// <summary>
/// Show progress of the deployment.
/// </summary>
public virtual bool? Progress { get; internal set; }
/// <summary>
/// Whether to force downloading of already installed packages (flag, default false).
/// </summary>
public virtual bool? ForcePackageDownload { get; internal set; }
/// <summary>
/// Whether to wait synchronously for deployment to finish.
/// </summary>
public virtual bool? WaitForDeployment { get; internal set; }
/// <summary>
/// Specifies maximum time (timespan format) that the console session will wait for the deployment to finish(default 00:10:00). This will not stop the deployment. Requires <c>--waitfordeployment</c> parameter set.
/// </summary>
public virtual string DeploymentTimeout { get; internal set; }
/// <summary>
/// Whether to cancel the deployment if the deployment timeout is reached (flag, default false).
/// </summary>
public virtual bool? CancelOnTimeout { get; internal set; }
/// <summary>
/// Specifies how much time (timespan format) should elapse between deployment status checks (default 00:00:10).
/// </summary>
public virtual string DeploymentCheckSleepCycle { get; internal set; }
/// <summary>
/// Whether to use Guided Failure mode. (True or False. If not specified, will use default setting from environment).
/// </summary>
public virtual bool? GuidedFailure { get; internal set; }
/// <summary>
/// A comma-separated list of machines names to target in the deployed environment. If not specified all machines in the environment will be considered.
/// </summary>
public virtual IReadOnlyList<string> SpecificMachines => SpecificMachinesInternal.AsReadOnly();
internal List<string> SpecificMachinesInternal { get; set; } = new List<string>();
/// <summary>
/// If a project is configured to skip packages with already-installed versions, override this setting to force re-deployment (flag, default false).
/// </summary>
public virtual bool? Force { get; internal set; }
/// <summary>
/// Skip a step by name.
/// </summary>
public virtual IReadOnlyList<string> Skip => SkipInternal.AsReadOnly();
internal List<string> SkipInternal { get; set; } = new List<string>();
/// <summary>
/// Don't print the raw log of failed tasks.
/// </summary>
public virtual bool? NoRawLog { get; internal set; }
/// <summary>
/// Redirect the raw log of failed tasks to a file.
/// </summary>
public virtual string RawLogFile { get; internal set; }
/// <summary>
/// Values for any prompted variables in the format Label:Value. For JSON values, embedded quotation marks should be escaped with a backslash.
/// </summary>
public virtual IReadOnlyDictionary<string, string> Variables => VariablesInternal.AsReadOnly();
internal Dictionary<string, string> VariablesInternal { get; set; } = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
/// <summary>
/// Time at which deployment should start (scheduled deployment), specified as any valid DateTimeOffset format, and assuming the time zone is the current local time zone.
/// </summary>
public virtual string DeployAt { get; internal set; }
/// <summary>
/// Environment to automatically deploy to, e.g., <c>Production</c>.
/// </summary>
public virtual string DeployTo { get; internal set; }
/// <summary>
/// A tenant the deployment will be performed for; specify this argument multiple times to add multiple tenants or use <c>*</c> wildcard to deploy to tenants able to deploy.
/// </summary>
public virtual string Tenant { get; internal set; }
/// <summary>
/// A tenant tag used to match tenants that the deployment will be performed for; specify this argument multiple times to add multiple tenant tags.
/// </summary>
public virtual string TenantTag { get; internal set; }
/// <summary>
/// The base URL for your Octopus server - e.g., http://your-octopus/
/// </summary>
public virtual string Server { get; internal set; }
/// <summary>
/// Your API key. Get this from the user profile page. Your must provide an apiKey or username and password. If the guest account is enabled, a key of API-GUEST can be used.
/// </summary>
public virtual string ApiKey { get; internal set; }
/// <summary>
/// Username to use when authenticating with the server. Your must provide an apiKey or username and password.
/// </summary>
public virtual string Username { get; internal set; }
/// <summary>
/// Password to use when authenticating with the server.
/// </summary>
public virtual string Password { get; internal set; }
/// <summary>
/// Text file of default values, with one 'key = value' per line.
/// </summary>
public virtual string ConfigFile { get; internal set; }
/// <summary>
/// Enable debug logging.
/// </summary>
public virtual bool? Debug { get; internal set; }
/// <summary>
/// Set this flag if your Octopus server uses HTTPS but the certificate is not trusted on this machine. Any certificate errors will be ignored. WARNING: this option may create a security vulnerability.
/// </summary>
public virtual bool? IgnoreSslErrors { get; internal set; }
/// <summary>
/// Enable TeamCity or Team Foundation Build service messages when logging.
/// </summary>
public virtual bool? EnableServiceMessages { get; internal set; }
/// <summary>
/// Timeout in seconds for network operations. Default is 600.
/// </summary>
public virtual int? Timeout { get; internal set; }
/// <summary>
/// The URI of the proxy to use, e.g., http://example.com:8080.
/// </summary>
public virtual string Proxy { get; internal set; }
/// <summary>
/// The username for the proxy.
/// </summary>
public virtual string ProxyUsername { get; internal set; }
/// <summary>
/// The password for the proxy. If both the username and password are omitted and proxyAddress is specified, the default credentials are used.
/// </summary>
public virtual string ProxyPassword { get; internal set; }
/// <summary>
/// The name of a space within which this command will be executed. The default space will be used if it is omitted.
/// </summary>
public virtual string Space { get; internal set; }
/// <summary>
/// The log level. Valid options are verbose, debug, information, warning, error and fatal. Defaults to 'debug'.
/// </summary>
public virtual string LogLevel { get; internal set; }
protected override Arguments ConfigureArguments(Arguments arguments)
{
arguments
.Add("create-release")
.Add("--project={value}", Project)
.Add("--packageversion={value}", DefaultPackageVersion)
.Add("--version={value}", Version)
.Add("--channel={value}", Channel)
.Add("--package={value}", PackageVersions, "{key}:{value}")
.Add("--packagesFolder={value}", PackagesFolder)
.Add("--releasenotes={value}", ReleaseNotes)
.Add("--releasenotesfile={value}", ReleaseNotesFile)
.Add("--ignoreexisting", IgnoreExisting)
.Add("--ignorechannelrules", IgnoreChannelRules)
.Add("--packageprerelease={value}", PackagePrerelease)
.Add("--whatif", WhatIf)
.Add("--progress", Progress)
.Add("--forcepackagedownload", ForcePackageDownload)
.Add("--waitfordeployment", WaitForDeployment)
.Add("--deploymenttimeout={value}", DeploymentTimeout)
.Add("--cancelontimeout", CancelOnTimeout)
.Add("--deploymentchecksleepcycle={value}", DeploymentCheckSleepCycle)
.Add("--guidedfailure={value}", GuidedFailure)
.Add("--specificmachines={value}", SpecificMachines)
.Add("--force", Force)
.Add("--skip={value}", Skip)
.Add("--norawlog", NoRawLog)
.Add("--rawlogfile={value}", RawLogFile)
.Add("--variable={value}", Variables, "{key}:{value}")
.Add("--deployat={value}", DeployAt)
.Add("--deployto={value}", DeployTo)
.Add("--tenant={value}", Tenant)
.Add("--tenanttag={value}", TenantTag)
.Add("--server={value}", Server)
.Add("--apiKey={value}", ApiKey, secret: true)
.Add("--user={value}", Username)
.Add("--pass={value}", Password, secret: true)
.Add("--configFile={value}", ConfigFile)
.Add("--debug", Debug)
.Add("--ignoreSslErrors", IgnoreSslErrors)
.Add("--enableServiceMessages", EnableServiceMessages)
.Add("--timeout={value}", Timeout)
.Add("--proxy={value}", Proxy)
.Add("--proxyUser={value}", ProxyUsername)
.Add("--proxyPass={value}", ProxyPassword, secret: true)
.Add("--space={value}", Space)
.Add("--logLevel={value}", LogLevel);
return base.ConfigureArguments(arguments);
}
}
#endregion
#region OctopusDeployReleaseSettings
/// <summary>
/// Used within <see cref="OctopusTasks"/>.
/// </summary>
[PublicAPI]
[ExcludeFromCodeCoverage]
[Serializable]
public partial class OctopusDeployReleaseSettings : ToolSettings
{
/// <summary>
/// Path to the Octopus executable.
/// </summary>
public override string ToolPath => base.ToolPath ?? OctopusTasks.OctopusPath;
public override Action<OutputType, string> CustomLogger => OctopusTasks.OctopusLogger;
/// <summary>
/// Show progress of the deployment.
/// </summary>
public virtual bool? Progress { get; internal set; }
/// <summary>
/// Whether to force downloading of already installed packages (flag, default false).
/// </summary>
public virtual bool? ForcePackageDownload { get; internal set; }
/// <summary>
/// Whether to wait synchronously for deployment to finish.
/// </summary>
public virtual bool? WaitForDepployment { get; internal set; }
/// <summary>
/// Specifies maximum time (timespan format) that the console session will wait for the deployment to finish(default 00:10:00). This will not stop the deployment. Requires <c>WaitForDeployment</c> parameter set.
/// </summary>
public virtual string DeploymentTimeout { get; internal set; }
/// <summary>
/// Whether to cancel the deployment if the deployment timeout is reached (flag, default false).
/// </summary>
public virtual bool? CancelOnTimeout { get; internal set; }
/// <summary>
/// Specifies how much time (timespan format) should elapse between deployment status checks (default 00:00:10).
/// </summary>
public virtual string DeploymentCheckSleepCycle { get; internal set; }
/// <summary>
/// Whether to use Guided Failure mode. (True or False. If not specified, will use default setting from environment).
/// </summary>
public virtual bool? GuidedFailure { get; internal set; }
/// <summary>
/// A comma-separated list of machines names to target in the deployed environment. If not specified all machines in the environment will be considered.
/// </summary>
public virtual IReadOnlyList<string> SpecificMachines => SpecificMachinesInternal.AsReadOnly();
internal List<string> SpecificMachinesInternal { get; set; } = new List<string>();
/// <summary>
/// If a project is configured to skip packages with already-installed versions, override this setting to force re-deployment (flag, default false).
/// </summary>
public virtual bool? Force { get; internal set; }
/// <summary>
/// Skip a step by name.
/// </summary>
public virtual IReadOnlyList<string> Skip => SkipInternal.AsReadOnly();
internal List<string> SkipInternal { get; set; } = new List<string>();
/// <summary>
/// Don't print the raw log of failed tasks.
/// </summary>
public virtual bool? NoRawLog { get; internal set; }
/// <summary>
/// Redirect the raw log of failed tasks to a file.
/// </summary>
public virtual string RawLogFile { get; internal set; }
/// <summary>
/// Values for any prompted variables. For JSON values, embedded quotation marks should be escaped with a backslash.
/// </summary>
public virtual IReadOnlyDictionary<string, string> Variables => VariablesInternal.AsReadOnly();
internal Dictionary<string, string> VariablesInternal { get; set; } = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
/// <summary>
/// Time at which deployment should start (scheduled deployment), specified as any valid DateTimeOffset format, and assuming the time zone is the current local time zone.
/// </summary>
public virtual string DeployAt { get; internal set; }
/// <summary>
/// Create a deployment for this tenant; specify this argument multiple times to add multiple tenants or use <c>*</c> wildcard to deploy to all tenants who are ready for this release (according to lifecycle).
/// </summary>
public virtual string Tenant { get; internal set; }
/// <summary>
/// Create a deployment for tenants matching this tag; specify this argument multiple times to build a query/filter with multiple tags, just like you can in the user interface.
/// </summary>
public virtual string TenantTag { get; internal set; }
/// <summary>
/// Name of the project.
/// </summary>
public virtual string Project { get; internal set; }
/// <summary>
/// Environment to deploy to, e.g. <c>Production</c>.
/// </summary>
public virtual string DeployTo { get; internal set; }
/// <summary>
/// Version number of the release to deploy. Or specify 'latest' for the latest release.
/// </summary>
public virtual string Version { get; internal set; }
/// <summary>
/// Channel to use when getting the release to deploy
/// </summary>
public virtual string Channel { get; internal set; }
/// <summary>
/// Overwrite the variable snapshot for the release by re-importing the variables from the project
/// </summary>
public virtual bool? UpdateVariables { get; internal set; }
/// <summary>
/// The base URL for your Octopus server - e.g., http://your-octopus/
/// </summary>
public virtual string Server { get; internal set; }
/// <summary>
/// Your API key. Get this from the user profile page. Your must provide an apiKey or username and password. If the guest account is enabled, a key of API-GUEST can be used.
/// </summary>
public virtual string ApiKey { get; internal set; }
/// <summary>
/// Username to use when authenticating with the server. Your must provide an apiKey or username and password.
/// </summary>
public virtual string Username { get; internal set; }
/// <summary>
/// Password to use when authenticating with the server.
/// </summary>
public virtual string Password { get; internal set; }
/// <summary>
/// Text file of default values, with one 'key = value' per line.
/// </summary>
public virtual string ConfigFile { get; internal set; }
/// <summary>
/// Enable debug logging.
/// </summary>
public virtual bool? Debug { get; internal set; }
/// <summary>
/// Set this flag if your Octopus server uses HTTPS but the certificate is not trusted on this machine. Any certificate errors will be ignored. WARNING: this option may create a security vulnerability.
/// </summary>
public virtual bool? IgnoreSslErrors { get; internal set; }
/// <summary>
/// Enable TeamCity or Team Foundation Build service messages when logging.
/// </summary>
public virtual bool? EnableServiceMessages { get; internal set; }
/// <summary>
/// Timeout in seconds for network operations. Default is 600.
/// </summary>
public virtual int? Timeout { get; internal set; }
/// <summary>
/// The URI of the proxy to use, e.g., http://example.com:8080.
/// </summary>
public virtual string Proxy { get; internal set; }
/// <summary>
/// The username for the proxy.
/// </summary>
public virtual string ProxyUsername { get; internal set; }
/// <summary>
/// The password for the proxy. If both the username and password are omitted and proxyAddress is specified, the default credentials are used.
/// </summary>
public virtual string ProxyPassword { get; internal set; }
/// <summary>
/// The name of a space within which this command will be executed. The default space will be used if it is omitted.
/// </summary>
public virtual string Space { get; internal set; }
/// <summary>
/// The log level. Valid options are verbose, debug, information, warning, error and fatal. Defaults to 'debug'.
/// </summary>
public virtual string LogLevel { get; internal set; }
protected override Arguments ConfigureArguments(Arguments arguments)
{
arguments
.Add("deploy-release")
.Add("--progress", Progress)
.Add("--forcepackagedownload", ForcePackageDownload)
.Add("--waitfordeployment", WaitForDepployment)
.Add("--deploymenttimeout={value}", DeploymentTimeout)
.Add("--cancelontimeout", CancelOnTimeout)
.Add("--deploymentchecksleepcycle={value}", DeploymentCheckSleepCycle)
.Add("--guidedfailure={value}", GuidedFailure)
.Add("--specificmachines={value}", SpecificMachines)
.Add("--force", Force)
.Add("--skip={value}", Skip)
.Add("--norawlog", NoRawLog)
.Add("--rawlogfile={value}", RawLogFile)
.Add("--variable={value}", Variables, "{key}:{value}")
.Add("--deployat={value}", DeployAt)
.Add("--tenant={value}", Tenant)
.Add("--tenanttag={value}", TenantTag)
.Add("--project={value}", Project)
.Add("--deployto={value}", DeployTo)
.Add("--version={value}", Version)
.Add("--channel={value}", Channel)
.Add("--updateVariables", UpdateVariables)
.Add("--server={value}", Server)
.Add("--apiKey={value}", ApiKey, secret: true)
.Add("--user={value}", Username)
.Add("--pass={value}", Password, secret: true)
.Add("--configFile={value}", ConfigFile)
.Add("--debug", Debug)
.Add("--ignoreSslErrors", IgnoreSslErrors)
.Add("--enableServiceMessages", EnableServiceMessages)
.Add("--timeout={value}", Timeout)
.Add("--proxy={value}", Proxy)
.Add("--proxyUser={value}", ProxyUsername)
.Add("--proxyPass={value}", ProxyPassword, secret: true)
.Add("--space={value}", Space)
.Add("--logLevel={value}", LogLevel);
return base.ConfigureArguments(arguments);
}
}
#endregion
#region OctopusPackSettingsExtensions
/// <summary>
/// Used within <see cref="OctopusTasks"/>.
/// </summary>
[PublicAPI]
[ExcludeFromCodeCoverage]
public static partial class OctopusPackSettingsExtensions
{
#region Id
/// <summary>
/// <p><em>Sets <see cref="OctopusPackSettings.Id"/></em></p>
/// <p>The ID of the package. E.g. <c>MyCompany.MyApp</c>.</p>
/// </summary>
[Pure]
public static OctopusPackSettings SetId(this OctopusPackSettings toolSettings, string id)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Id = id;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusPackSettings.Id"/></em></p>
/// <p>The ID of the package. E.g. <c>MyCompany.MyApp</c>.</p>
/// </summary>
[Pure]
public static OctopusPackSettings ResetId(this OctopusPackSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Id = null;
return toolSettings;
}
#endregion
#region Format
/// <summary>
/// <p><em>Sets <see cref="OctopusPackSettings.Format"/></em></p>
/// <p>Package format. Options are: NuPkg, Zip. Defaults to NuPkg, though we recommend Zip going forward.</p>
/// </summary>
[Pure]
public static OctopusPackSettings SetFormat(this OctopusPackSettings toolSettings, OctopusPackFormat format)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Format = format;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusPackSettings.Format"/></em></p>
/// <p>Package format. Options are: NuPkg, Zip. Defaults to NuPkg, though we recommend Zip going forward.</p>
/// </summary>
[Pure]
public static OctopusPackSettings ResetFormat(this OctopusPackSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Format = null;
return toolSettings;
}
#endregion
#region Version
/// <summary>
/// <p><em>Sets <see cref="OctopusPackSettings.Version"/></em></p>
/// <p>The version of the package; must be a valid SemVer. Defaults to a timestamp-based version.</p>
/// </summary>
[Pure]
public static OctopusPackSettings SetVersion(this OctopusPackSettings toolSettings, string version)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Version = version;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusPackSettings.Version"/></em></p>
/// <p>The version of the package; must be a valid SemVer. Defaults to a timestamp-based version.</p>
/// </summary>
[Pure]
public static OctopusPackSettings ResetVersion(this OctopusPackSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Version = null;
return toolSettings;
}
#endregion
#region OutputFolder
/// <summary>
/// <p><em>Sets <see cref="OctopusPackSettings.OutputFolder"/></em></p>
/// <p>The folder into which the generated NUPKG file will be written. Defaults to <c>.</c>.</p>
/// </summary>
[Pure]
public static OctopusPackSettings SetOutputFolder(this OctopusPackSettings toolSettings, string outputFolder)
{
toolSettings = toolSettings.NewInstance();
toolSettings.OutputFolder = outputFolder;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusPackSettings.OutputFolder"/></em></p>
/// <p>The folder into which the generated NUPKG file will be written. Defaults to <c>.</c>.</p>
/// </summary>
[Pure]
public static OctopusPackSettings ResetOutputFolder(this OctopusPackSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.OutputFolder = null;
return toolSettings;
}
#endregion
#region BasePath
/// <summary>
/// <p><em>Sets <see cref="OctopusPackSettings.BasePath"/></em></p>
/// <p>The root folder containing files and folders to pack. Defaults to <c>.</c>.</p>
/// </summary>
[Pure]
public static OctopusPackSettings SetBasePath(this OctopusPackSettings toolSettings, string basePath)
{
toolSettings = toolSettings.NewInstance();
toolSettings.BasePath = basePath;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusPackSettings.BasePath"/></em></p>
/// <p>The root folder containing files and folders to pack. Defaults to <c>.</c>.</p>
/// </summary>
[Pure]
public static OctopusPackSettings ResetBasePath(this OctopusPackSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.BasePath = null;
return toolSettings;
}
#endregion
#region Verbose
/// <summary>
/// <p><em>Sets <see cref="OctopusPackSettings.Verbose"/></em></p>
/// <p>List more detailed output. E.g. Which files are being added.</p>
/// </summary>
[Pure]
public static OctopusPackSettings SetVerbose(this OctopusPackSettings toolSettings, bool? verbose)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Verbose = verbose;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusPackSettings.Verbose"/></em></p>
/// <p>List more detailed output. E.g. Which files are being added.</p>
/// </summary>
[Pure]
public static OctopusPackSettings ResetVerbose(this OctopusPackSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Verbose = null;
return toolSettings;
}
/// <summary>
/// <p><em>Enables <see cref="OctopusPackSettings.Verbose"/></em></p>
/// <p>List more detailed output. E.g. Which files are being added.</p>
/// </summary>
[Pure]
public static OctopusPackSettings EnableVerbose(this OctopusPackSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Verbose = true;
return toolSettings;
}
/// <summary>
/// <p><em>Disables <see cref="OctopusPackSettings.Verbose"/></em></p>
/// <p>List more detailed output. E.g. Which files are being added.</p>
/// </summary>
[Pure]
public static OctopusPackSettings DisableVerbose(this OctopusPackSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Verbose = false;
return toolSettings;
}
/// <summary>
/// <p><em>Toggles <see cref="OctopusPackSettings.Verbose"/></em></p>
/// <p>List more detailed output. E.g. Which files are being added.</p>
/// </summary>
[Pure]
public static OctopusPackSettings ToggleVerbose(this OctopusPackSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Verbose = !toolSettings.Verbose;
return toolSettings;
}
#endregion
#region Authors
/// <summary>
/// <p><em>Sets <see cref="OctopusPackSettings.Authors"/> to a new list</em></p>
/// <p>Add an author to the package metadata. Defaults to the current user.</p>
/// </summary>
[Pure]
public static OctopusPackSettings SetAuthors(this OctopusPackSettings toolSettings, params string[] authors)
{
toolSettings = toolSettings.NewInstance();
toolSettings.AuthorsInternal = authors.ToList();
return toolSettings;
}
/// <summary>
/// <p><em>Sets <see cref="OctopusPackSettings.Authors"/> to a new list</em></p>
/// <p>Add an author to the package metadata. Defaults to the current user.</p>
/// </summary>
[Pure]
public static OctopusPackSettings SetAuthors(this OctopusPackSettings toolSettings, IEnumerable<string> authors)
{
toolSettings = toolSettings.NewInstance();
toolSettings.AuthorsInternal = authors.ToList();
return toolSettings;
}
/// <summary>
/// <p><em>Adds values to <see cref="OctopusPackSettings.Authors"/></em></p>
/// <p>Add an author to the package metadata. Defaults to the current user.</p>
/// </summary>
[Pure]
public static OctopusPackSettings AddAuthors(this OctopusPackSettings toolSettings, params string[] authors)
{
toolSettings = toolSettings.NewInstance();
toolSettings.AuthorsInternal.AddRange(authors);
return toolSettings;
}
/// <summary>
/// <p><em>Adds values to <see cref="OctopusPackSettings.Authors"/></em></p>
/// <p>Add an author to the package metadata. Defaults to the current user.</p>
/// </summary>
[Pure]
public static OctopusPackSettings AddAuthors(this OctopusPackSettings toolSettings, IEnumerable<string> authors)
{
toolSettings = toolSettings.NewInstance();
toolSettings.AuthorsInternal.AddRange(authors);
return toolSettings;
}
/// <summary>
/// <p><em>Clears <see cref="OctopusPackSettings.Authors"/></em></p>
/// <p>Add an author to the package metadata. Defaults to the current user.</p>
/// </summary>
[Pure]
public static OctopusPackSettings ClearAuthors(this OctopusPackSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.AuthorsInternal.Clear();
return toolSettings;
}
/// <summary>
/// <p><em>Removes values from <see cref="OctopusPackSettings.Authors"/></em></p>
/// <p>Add an author to the package metadata. Defaults to the current user.</p>
/// </summary>
[Pure]
public static OctopusPackSettings RemoveAuthors(this OctopusPackSettings toolSettings, params string[] authors)
{
toolSettings = toolSettings.NewInstance();
var hashSet = new HashSet<string>(authors);
toolSettings.AuthorsInternal.RemoveAll(x => hashSet.Contains(x));
return toolSettings;
}
/// <summary>
/// <p><em>Removes values from <see cref="OctopusPackSettings.Authors"/></em></p>
/// <p>Add an author to the package metadata. Defaults to the current user.</p>
/// </summary>
[Pure]
public static OctopusPackSettings RemoveAuthors(this OctopusPackSettings toolSettings, IEnumerable<string> authors)
{
toolSettings = toolSettings.NewInstance();
var hashSet = new HashSet<string>(authors);
toolSettings.AuthorsInternal.RemoveAll(x => hashSet.Contains(x));
return toolSettings;
}
#endregion
#region Title
/// <summary>
/// <p><em>Sets <see cref="OctopusPackSettings.Title"/></em></p>
/// <p>The title of the package.</p>
/// </summary>
[Pure]
public static OctopusPackSettings SetTitle(this OctopusPackSettings toolSettings, string title)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Title = title;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusPackSettings.Title"/></em></p>
/// <p>The title of the package.</p>
/// </summary>
[Pure]
public static OctopusPackSettings ResetTitle(this OctopusPackSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Title = null;
return toolSettings;
}
#endregion
#region Description
/// <summary>
/// <p><em>Sets <see cref="OctopusPackSettings.Description"/></em></p>
/// <p>A description of the package. Defaults to a generic description.</p>
/// </summary>
[Pure]
public static OctopusPackSettings SetDescription(this OctopusPackSettings toolSettings, string description)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Description = description;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusPackSettings.Description"/></em></p>
/// <p>A description of the package. Defaults to a generic description.</p>
/// </summary>
[Pure]
public static OctopusPackSettings ResetDescription(this OctopusPackSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Description = null;
return toolSettings;
}
#endregion
#region ReleaseNotes
/// <summary>
/// <p><em>Sets <see cref="OctopusPackSettings.ReleaseNotes"/></em></p>
/// <p>Release notes for this version of the package.</p>
/// </summary>
[Pure]
public static OctopusPackSettings SetReleaseNotes(this OctopusPackSettings toolSettings, string releaseNotes)
{
toolSettings = toolSettings.NewInstance();
toolSettings.ReleaseNotes = releaseNotes;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusPackSettings.ReleaseNotes"/></em></p>
/// <p>Release notes for this version of the package.</p>
/// </summary>
[Pure]
public static OctopusPackSettings ResetReleaseNotes(this OctopusPackSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.ReleaseNotes = null;
return toolSettings;
}
#endregion
#region ReleaseNotesFile
/// <summary>
/// <p><em>Sets <see cref="OctopusPackSettings.ReleaseNotesFile"/></em></p>
/// <p>A file containing release notes for this version of the package.</p>
/// </summary>
[Pure]
public static OctopusPackSettings SetReleaseNotesFile(this OctopusPackSettings toolSettings, string releaseNotesFile)
{
toolSettings = toolSettings.NewInstance();
toolSettings.ReleaseNotesFile = releaseNotesFile;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusPackSettings.ReleaseNotesFile"/></em></p>
/// <p>A file containing release notes for this version of the package.</p>
/// </summary>
[Pure]
public static OctopusPackSettings ResetReleaseNotesFile(this OctopusPackSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.ReleaseNotesFile = null;
return toolSettings;
}
#endregion
#region Include
/// <summary>
/// <p><em>Sets <see cref="OctopusPackSettings.Include"/></em></p>
/// <p>Add a file pattern to include, relative to the base path. E.g. <c>/bin/-*.dll</c> - if none are specified, defaults to <c>**</c>.</p>
/// </summary>
[Pure]
public static OctopusPackSettings SetInclude(this OctopusPackSettings toolSettings, string include)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Include = include;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusPackSettings.Include"/></em></p>
/// <p>Add a file pattern to include, relative to the base path. E.g. <c>/bin/-*.dll</c> - if none are specified, defaults to <c>**</c>.</p>
/// </summary>
[Pure]
public static OctopusPackSettings ResetInclude(this OctopusPackSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Include = null;
return toolSettings;
}
#endregion
#region Overwrite
/// <summary>
/// <p><em>Sets <see cref="OctopusPackSettings.Overwrite"/></em></p>
/// <p>Allow an existing package file of the same ID/version to be overwritten.</p>
/// </summary>
[Pure]
public static OctopusPackSettings SetOverwrite(this OctopusPackSettings toolSettings, bool? overwrite)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Overwrite = overwrite;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusPackSettings.Overwrite"/></em></p>
/// <p>Allow an existing package file of the same ID/version to be overwritten.</p>
/// </summary>
[Pure]
public static OctopusPackSettings ResetOverwrite(this OctopusPackSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Overwrite = null;
return toolSettings;
}
/// <summary>
/// <p><em>Enables <see cref="OctopusPackSettings.Overwrite"/></em></p>
/// <p>Allow an existing package file of the same ID/version to be overwritten.</p>
/// </summary>
[Pure]
public static OctopusPackSettings EnableOverwrite(this OctopusPackSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Overwrite = true;
return toolSettings;
}
/// <summary>
/// <p><em>Disables <see cref="OctopusPackSettings.Overwrite"/></em></p>
/// <p>Allow an existing package file of the same ID/version to be overwritten.</p>
/// </summary>
[Pure]
public static OctopusPackSettings DisableOverwrite(this OctopusPackSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Overwrite = false;
return toolSettings;
}
/// <summary>
/// <p><em>Toggles <see cref="OctopusPackSettings.Overwrite"/></em></p>
/// <p>Allow an existing package file of the same ID/version to be overwritten.</p>
/// </summary>
[Pure]
public static OctopusPackSettings ToggleOverwrite(this OctopusPackSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Overwrite = !toolSettings.Overwrite;
return toolSettings;
}
#endregion
}
#endregion
#region OctopusPushSettingsExtensions
/// <summary>
/// Used within <see cref="OctopusTasks"/>.
/// </summary>
[PublicAPI]
[ExcludeFromCodeCoverage]
public static partial class OctopusPushSettingsExtensions
{
#region Package
/// <summary>
/// <p><em>Sets <see cref="OctopusPushSettings.Package"/> to a new list</em></p>
/// <p>Package file to push.</p>
/// </summary>
[Pure]
public static OctopusPushSettings SetPackage(this OctopusPushSettings toolSettings, params string[] package)
{
toolSettings = toolSettings.NewInstance();
toolSettings.PackageInternal = package.ToList();
return toolSettings;
}
/// <summary>
/// <p><em>Sets <see cref="OctopusPushSettings.Package"/> to a new list</em></p>
/// <p>Package file to push.</p>
/// </summary>
[Pure]
public static OctopusPushSettings SetPackage(this OctopusPushSettings toolSettings, IEnumerable<string> package)
{
toolSettings = toolSettings.NewInstance();
toolSettings.PackageInternal = package.ToList();
return toolSettings;
}
/// <summary>
/// <p><em>Adds values to <see cref="OctopusPushSettings.Package"/></em></p>
/// <p>Package file to push.</p>
/// </summary>
[Pure]
public static OctopusPushSettings AddPackage(this OctopusPushSettings toolSettings, params string[] package)
{
toolSettings = toolSettings.NewInstance();
toolSettings.PackageInternal.AddRange(package);
return toolSettings;
}
/// <summary>
/// <p><em>Adds values to <see cref="OctopusPushSettings.Package"/></em></p>
/// <p>Package file to push.</p>
/// </summary>
[Pure]
public static OctopusPushSettings AddPackage(this OctopusPushSettings toolSettings, IEnumerable<string> package)
{
toolSettings = toolSettings.NewInstance();
toolSettings.PackageInternal.AddRange(package);
return toolSettings;
}
/// <summary>
/// <p><em>Clears <see cref="OctopusPushSettings.Package"/></em></p>
/// <p>Package file to push.</p>
/// </summary>
[Pure]
public static OctopusPushSettings ClearPackage(this OctopusPushSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.PackageInternal.Clear();
return toolSettings;
}
/// <summary>
/// <p><em>Removes values from <see cref="OctopusPushSettings.Package"/></em></p>
/// <p>Package file to push.</p>
/// </summary>
[Pure]
public static OctopusPushSettings RemovePackage(this OctopusPushSettings toolSettings, params string[] package)
{
toolSettings = toolSettings.NewInstance();
var hashSet = new HashSet<string>(package);
toolSettings.PackageInternal.RemoveAll(x => hashSet.Contains(x));
return toolSettings;
}
/// <summary>
/// <p><em>Removes values from <see cref="OctopusPushSettings.Package"/></em></p>
/// <p>Package file to push.</p>
/// </summary>
[Pure]
public static OctopusPushSettings RemovePackage(this OctopusPushSettings toolSettings, IEnumerable<string> package)
{
toolSettings = toolSettings.NewInstance();
var hashSet = new HashSet<string>(package);
toolSettings.PackageInternal.RemoveAll(x => hashSet.Contains(x));
return toolSettings;
}
#endregion
#region ReplaceExisting
/// <summary>
/// <p><em>Sets <see cref="OctopusPushSettings.ReplaceExisting"/></em></p>
/// <p>If the package already exists in the repository, the default behavior is to reject the new package being pushed. You can pass this flag to overwrite the existing package.</p>
/// </summary>
[Pure]
public static OctopusPushSettings SetReplaceExisting(this OctopusPushSettings toolSettings, bool? replaceExisting)
{
toolSettings = toolSettings.NewInstance();
toolSettings.ReplaceExisting = replaceExisting;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusPushSettings.ReplaceExisting"/></em></p>
/// <p>If the package already exists in the repository, the default behavior is to reject the new package being pushed. You can pass this flag to overwrite the existing package.</p>
/// </summary>
[Pure]
public static OctopusPushSettings ResetReplaceExisting(this OctopusPushSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.ReplaceExisting = null;
return toolSettings;
}
/// <summary>
/// <p><em>Enables <see cref="OctopusPushSettings.ReplaceExisting"/></em></p>
/// <p>If the package already exists in the repository, the default behavior is to reject the new package being pushed. You can pass this flag to overwrite the existing package.</p>
/// </summary>
[Pure]
public static OctopusPushSettings EnableReplaceExisting(this OctopusPushSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.ReplaceExisting = true;
return toolSettings;
}
/// <summary>
/// <p><em>Disables <see cref="OctopusPushSettings.ReplaceExisting"/></em></p>
/// <p>If the package already exists in the repository, the default behavior is to reject the new package being pushed. You can pass this flag to overwrite the existing package.</p>
/// </summary>
[Pure]
public static OctopusPushSettings DisableReplaceExisting(this OctopusPushSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.ReplaceExisting = false;
return toolSettings;
}
/// <summary>
/// <p><em>Toggles <see cref="OctopusPushSettings.ReplaceExisting"/></em></p>
/// <p>If the package already exists in the repository, the default behavior is to reject the new package being pushed. You can pass this flag to overwrite the existing package.</p>
/// </summary>
[Pure]
public static OctopusPushSettings ToggleReplaceExisting(this OctopusPushSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.ReplaceExisting = !toolSettings.ReplaceExisting;
return toolSettings;
}
#endregion
#region Server
/// <summary>
/// <p><em>Sets <see cref="OctopusPushSettings.Server"/></em></p>
/// <p>The base URL for your Octopus server - e.g., http://your-octopus/</p>
/// </summary>
[Pure]
public static OctopusPushSettings SetServer(this OctopusPushSettings toolSettings, string server)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Server = server;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusPushSettings.Server"/></em></p>
/// <p>The base URL for your Octopus server - e.g., http://your-octopus/</p>
/// </summary>
[Pure]
public static OctopusPushSettings ResetServer(this OctopusPushSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Server = null;
return toolSettings;
}
#endregion
#region ApiKey
/// <summary>
/// <p><em>Sets <see cref="OctopusPushSettings.ApiKey"/></em></p>
/// <p>Your API key. Get this from the user profile page. Your must provide an apiKey or username and password. If the guest account is enabled, a key of API-GUEST can be used.</p>
/// </summary>
[Pure]
public static OctopusPushSettings SetApiKey(this OctopusPushSettings toolSettings, string apiKey)
{
toolSettings = toolSettings.NewInstance();
toolSettings.ApiKey = apiKey;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusPushSettings.ApiKey"/></em></p>
/// <p>Your API key. Get this from the user profile page. Your must provide an apiKey or username and password. If the guest account is enabled, a key of API-GUEST can be used.</p>
/// </summary>
[Pure]
public static OctopusPushSettings ResetApiKey(this OctopusPushSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.ApiKey = null;
return toolSettings;
}
#endregion
#region Username
/// <summary>
/// <p><em>Sets <see cref="OctopusPushSettings.Username"/></em></p>
/// <p>Username to use when authenticating with the server. Your must provide an apiKey or username and password.</p>
/// </summary>
[Pure]
public static OctopusPushSettings SetUsername(this OctopusPushSettings toolSettings, string username)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Username = username;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusPushSettings.Username"/></em></p>
/// <p>Username to use when authenticating with the server. Your must provide an apiKey or username and password.</p>
/// </summary>
[Pure]
public static OctopusPushSettings ResetUsername(this OctopusPushSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Username = null;
return toolSettings;
}
#endregion
#region Password
/// <summary>
/// <p><em>Sets <see cref="OctopusPushSettings.Password"/></em></p>
/// <p>Password to use when authenticating with the server.</p>
/// </summary>
[Pure]
public static OctopusPushSettings SetPassword(this OctopusPushSettings toolSettings, string password)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Password = password;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusPushSettings.Password"/></em></p>
/// <p>Password to use when authenticating with the server.</p>
/// </summary>
[Pure]
public static OctopusPushSettings ResetPassword(this OctopusPushSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Password = null;
return toolSettings;
}
#endregion
#region ConfigFile
/// <summary>
/// <p><em>Sets <see cref="OctopusPushSettings.ConfigFile"/></em></p>
/// <p>Text file of default values, with one 'key = value' per line.</p>
/// </summary>
[Pure]
public static OctopusPushSettings SetConfigFile(this OctopusPushSettings toolSettings, string configFile)
{
toolSettings = toolSettings.NewInstance();
toolSettings.ConfigFile = configFile;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusPushSettings.ConfigFile"/></em></p>
/// <p>Text file of default values, with one 'key = value' per line.</p>
/// </summary>
[Pure]
public static OctopusPushSettings ResetConfigFile(this OctopusPushSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.ConfigFile = null;
return toolSettings;
}
#endregion
#region Debug
/// <summary>
/// <p><em>Sets <see cref="OctopusPushSettings.Debug"/></em></p>
/// <p>Enable debug logging.</p>
/// </summary>
[Pure]
public static OctopusPushSettings SetDebug(this OctopusPushSettings toolSettings, bool? debug)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Debug = debug;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusPushSettings.Debug"/></em></p>
/// <p>Enable debug logging.</p>
/// </summary>
[Pure]
public static OctopusPushSettings ResetDebug(this OctopusPushSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Debug = null;
return toolSettings;
}
/// <summary>
/// <p><em>Enables <see cref="OctopusPushSettings.Debug"/></em></p>
/// <p>Enable debug logging.</p>
/// </summary>
[Pure]
public static OctopusPushSettings EnableDebug(this OctopusPushSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Debug = true;
return toolSettings;
}
/// <summary>
/// <p><em>Disables <see cref="OctopusPushSettings.Debug"/></em></p>
/// <p>Enable debug logging.</p>
/// </summary>
[Pure]
public static OctopusPushSettings DisableDebug(this OctopusPushSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Debug = false;
return toolSettings;
}
/// <summary>
/// <p><em>Toggles <see cref="OctopusPushSettings.Debug"/></em></p>
/// <p>Enable debug logging.</p>
/// </summary>
[Pure]
public static OctopusPushSettings ToggleDebug(this OctopusPushSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Debug = !toolSettings.Debug;
return toolSettings;
}
#endregion
#region IgnoreSslErrors
/// <summary>
/// <p><em>Sets <see cref="OctopusPushSettings.IgnoreSslErrors"/></em></p>
/// <p>Set this flag if your Octopus server uses HTTPS but the certificate is not trusted on this machine. Any certificate errors will be ignored. WARNING: this option may create a security vulnerability.</p>
/// </summary>
[Pure]
public static OctopusPushSettings SetIgnoreSslErrors(this OctopusPushSettings toolSettings, bool? ignoreSslErrors)
{
toolSettings = toolSettings.NewInstance();
toolSettings.IgnoreSslErrors = ignoreSslErrors;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusPushSettings.IgnoreSslErrors"/></em></p>
/// <p>Set this flag if your Octopus server uses HTTPS but the certificate is not trusted on this machine. Any certificate errors will be ignored. WARNING: this option may create a security vulnerability.</p>
/// </summary>
[Pure]
public static OctopusPushSettings ResetIgnoreSslErrors(this OctopusPushSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.IgnoreSslErrors = null;
return toolSettings;
}
/// <summary>
/// <p><em>Enables <see cref="OctopusPushSettings.IgnoreSslErrors"/></em></p>
/// <p>Set this flag if your Octopus server uses HTTPS but the certificate is not trusted on this machine. Any certificate errors will be ignored. WARNING: this option may create a security vulnerability.</p>
/// </summary>
[Pure]
public static OctopusPushSettings EnableIgnoreSslErrors(this OctopusPushSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.IgnoreSslErrors = true;
return toolSettings;
}
/// <summary>
/// <p><em>Disables <see cref="OctopusPushSettings.IgnoreSslErrors"/></em></p>
/// <p>Set this flag if your Octopus server uses HTTPS but the certificate is not trusted on this machine. Any certificate errors will be ignored. WARNING: this option may create a security vulnerability.</p>
/// </summary>
[Pure]
public static OctopusPushSettings DisableIgnoreSslErrors(this OctopusPushSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.IgnoreSslErrors = false;
return toolSettings;
}
/// <summary>
/// <p><em>Toggles <see cref="OctopusPushSettings.IgnoreSslErrors"/></em></p>
/// <p>Set this flag if your Octopus server uses HTTPS but the certificate is not trusted on this machine. Any certificate errors will be ignored. WARNING: this option may create a security vulnerability.</p>
/// </summary>
[Pure]
public static OctopusPushSettings ToggleIgnoreSslErrors(this OctopusPushSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.IgnoreSslErrors = !toolSettings.IgnoreSslErrors;
return toolSettings;
}
#endregion
#region EnableServiceMessages
/// <summary>
/// <p><em>Sets <see cref="OctopusPushSettings.EnableServiceMessages"/></em></p>
/// <p>Enable TeamCity or Team Foundation Build service messages when logging.</p>
/// </summary>
[Pure]
public static OctopusPushSettings SetEnableServiceMessages(this OctopusPushSettings toolSettings, bool? enableServiceMessages)
{
toolSettings = toolSettings.NewInstance();
toolSettings.EnableServiceMessages = enableServiceMessages;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusPushSettings.EnableServiceMessages"/></em></p>
/// <p>Enable TeamCity or Team Foundation Build service messages when logging.</p>
/// </summary>
[Pure]
public static OctopusPushSettings ResetEnableServiceMessages(this OctopusPushSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.EnableServiceMessages = null;
return toolSettings;
}
/// <summary>
/// <p><em>Enables <see cref="OctopusPushSettings.EnableServiceMessages"/></em></p>
/// <p>Enable TeamCity or Team Foundation Build service messages when logging.</p>
/// </summary>
[Pure]
public static OctopusPushSettings EnableEnableServiceMessages(this OctopusPushSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.EnableServiceMessages = true;
return toolSettings;
}
/// <summary>
/// <p><em>Disables <see cref="OctopusPushSettings.EnableServiceMessages"/></em></p>
/// <p>Enable TeamCity or Team Foundation Build service messages when logging.</p>
/// </summary>
[Pure]
public static OctopusPushSettings DisableEnableServiceMessages(this OctopusPushSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.EnableServiceMessages = false;
return toolSettings;
}
/// <summary>
/// <p><em>Toggles <see cref="OctopusPushSettings.EnableServiceMessages"/></em></p>
/// <p>Enable TeamCity or Team Foundation Build service messages when logging.</p>
/// </summary>
[Pure]
public static OctopusPushSettings ToggleEnableServiceMessages(this OctopusPushSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.EnableServiceMessages = !toolSettings.EnableServiceMessages;
return toolSettings;
}
#endregion
#region Timeout
/// <summary>
/// <p><em>Sets <see cref="OctopusPushSettings.Timeout"/></em></p>
/// <p>Timeout in seconds for network operations. Default is 600.</p>
/// </summary>
[Pure]
public static OctopusPushSettings SetTimeout(this OctopusPushSettings toolSettings, int? timeout)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Timeout = timeout;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusPushSettings.Timeout"/></em></p>
/// <p>Timeout in seconds for network operations. Default is 600.</p>
/// </summary>
[Pure]
public static OctopusPushSettings ResetTimeout(this OctopusPushSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Timeout = null;
return toolSettings;
}
#endregion
#region Proxy
/// <summary>
/// <p><em>Sets <see cref="OctopusPushSettings.Proxy"/></em></p>
/// <p>The URI of the proxy to use, e.g., http://example.com:8080.</p>
/// </summary>
[Pure]
public static OctopusPushSettings SetProxy(this OctopusPushSettings toolSettings, string proxy)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Proxy = proxy;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusPushSettings.Proxy"/></em></p>
/// <p>The URI of the proxy to use, e.g., http://example.com:8080.</p>
/// </summary>
[Pure]
public static OctopusPushSettings ResetProxy(this OctopusPushSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Proxy = null;
return toolSettings;
}
#endregion
#region ProxyUsername
/// <summary>
/// <p><em>Sets <see cref="OctopusPushSettings.ProxyUsername"/></em></p>
/// <p>The username for the proxy.</p>
/// </summary>
[Pure]
public static OctopusPushSettings SetProxyUsername(this OctopusPushSettings toolSettings, string proxyUsername)
{
toolSettings = toolSettings.NewInstance();
toolSettings.ProxyUsername = proxyUsername;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusPushSettings.ProxyUsername"/></em></p>
/// <p>The username for the proxy.</p>
/// </summary>
[Pure]
public static OctopusPushSettings ResetProxyUsername(this OctopusPushSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.ProxyUsername = null;
return toolSettings;
}
#endregion
#region ProxyPassword
/// <summary>
/// <p><em>Sets <see cref="OctopusPushSettings.ProxyPassword"/></em></p>
/// <p>The password for the proxy. If both the username and password are omitted and proxyAddress is specified, the default credentials are used.</p>
/// </summary>
[Pure]
public static OctopusPushSettings SetProxyPassword(this OctopusPushSettings toolSettings, string proxyPassword)
{
toolSettings = toolSettings.NewInstance();
toolSettings.ProxyPassword = proxyPassword;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusPushSettings.ProxyPassword"/></em></p>
/// <p>The password for the proxy. If both the username and password are omitted and proxyAddress is specified, the default credentials are used.</p>
/// </summary>
[Pure]
public static OctopusPushSettings ResetProxyPassword(this OctopusPushSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.ProxyPassword = null;
return toolSettings;
}
#endregion
#region Space
/// <summary>
/// <p><em>Sets <see cref="OctopusPushSettings.Space"/></em></p>
/// <p>The name of a space within which this command will be executed. The default space will be used if it is omitted.</p>
/// </summary>
[Pure]
public static OctopusPushSettings SetSpace(this OctopusPushSettings toolSettings, string space)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Space = space;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusPushSettings.Space"/></em></p>
/// <p>The name of a space within which this command will be executed. The default space will be used if it is omitted.</p>
/// </summary>
[Pure]
public static OctopusPushSettings ResetSpace(this OctopusPushSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Space = null;
return toolSettings;
}
#endregion
#region LogLevel
/// <summary>
/// <p><em>Sets <see cref="OctopusPushSettings.LogLevel"/></em></p>
/// <p>The log level. Valid options are verbose, debug, information, warning, error and fatal. Defaults to 'debug'.</p>
/// </summary>
[Pure]
public static OctopusPushSettings SetLogLevel(this OctopusPushSettings toolSettings, string logLevel)
{
toolSettings = toolSettings.NewInstance();
toolSettings.LogLevel = logLevel;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusPushSettings.LogLevel"/></em></p>
/// <p>The log level. Valid options are verbose, debug, information, warning, error and fatal. Defaults to 'debug'.</p>
/// </summary>
[Pure]
public static OctopusPushSettings ResetLogLevel(this OctopusPushSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.LogLevel = null;
return toolSettings;
}
#endregion
}
#endregion
#region OctopusCreateReleaseSettingsExtensions
/// <summary>
/// Used within <see cref="OctopusTasks"/>.
/// </summary>
[PublicAPI]
[ExcludeFromCodeCoverage]
public static partial class OctopusCreateReleaseSettingsExtensions
{
#region Project
/// <summary>
/// <p><em>Sets <see cref="OctopusCreateReleaseSettings.Project"/></em></p>
/// <p>Name of the project.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings SetProject(this OctopusCreateReleaseSettings toolSettings, string project)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Project = project;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusCreateReleaseSettings.Project"/></em></p>
/// <p>Name of the project.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings ResetProject(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Project = null;
return toolSettings;
}
#endregion
#region DefaultPackageVersion
/// <summary>
/// <p><em>Sets <see cref="OctopusCreateReleaseSettings.DefaultPackageVersion"/></em></p>
/// <p>Default version number of all packages to use for this release.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings SetDefaultPackageVersion(this OctopusCreateReleaseSettings toolSettings, string defaultPackageVersion)
{
toolSettings = toolSettings.NewInstance();
toolSettings.DefaultPackageVersion = defaultPackageVersion;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusCreateReleaseSettings.DefaultPackageVersion"/></em></p>
/// <p>Default version number of all packages to use for this release.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings ResetDefaultPackageVersion(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.DefaultPackageVersion = null;
return toolSettings;
}
#endregion
#region Version
/// <summary>
/// <p><em>Sets <see cref="OctopusCreateReleaseSettings.Version"/></em></p>
/// <p>Release number to use for the new release.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings SetVersion(this OctopusCreateReleaseSettings toolSettings, string version)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Version = version;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusCreateReleaseSettings.Version"/></em></p>
/// <p>Release number to use for the new release.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings ResetVersion(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Version = null;
return toolSettings;
}
#endregion
#region Channel
/// <summary>
/// <p><em>Sets <see cref="OctopusCreateReleaseSettings.Channel"/></em></p>
/// <p>Channel to use for the new release. Omit this argument to automatically select the best channel.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings SetChannel(this OctopusCreateReleaseSettings toolSettings, string channel)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Channel = channel;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusCreateReleaseSettings.Channel"/></em></p>
/// <p>Channel to use for the new release. Omit this argument to automatically select the best channel.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings ResetChannel(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Channel = null;
return toolSettings;
}
#endregion
#region PackageVersions
/// <summary>
/// <p><em>Sets <see cref="OctopusCreateReleaseSettings.PackageVersions"/> to a new dictionary</em></p>
/// <p>Version number to use for a step or package in the release. Format: <c>--package=StepNameOrPackageId:Version</c>.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings SetPackageVersions(this OctopusCreateReleaseSettings toolSettings, IDictionary<string, string> packageVersions)
{
toolSettings = toolSettings.NewInstance();
toolSettings.PackageVersionsInternal = packageVersions.ToDictionary(x => x.Key, x => x.Value, StringComparer.OrdinalIgnoreCase);
return toolSettings;
}
/// <summary>
/// <p><em>Clears <see cref="OctopusCreateReleaseSettings.PackageVersions"/></em></p>
/// <p>Version number to use for a step or package in the release. Format: <c>--package=StepNameOrPackageId:Version</c>.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings ClearPackageVersions(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.PackageVersionsInternal.Clear();
return toolSettings;
}
/// <summary>
/// <p><em>Adds a new key-value-pair <see cref="OctopusCreateReleaseSettings.PackageVersions"/></em></p>
/// <p>Version number to use for a step or package in the release. Format: <c>--package=StepNameOrPackageId:Version</c>.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings AddPackageVersion(this OctopusCreateReleaseSettings toolSettings, string packageVersionKey, string packageVersionValue)
{
toolSettings = toolSettings.NewInstance();
toolSettings.PackageVersionsInternal.Add(packageVersionKey, packageVersionValue);
return toolSettings;
}
/// <summary>
/// <p><em>Removes a key-value-pair from <see cref="OctopusCreateReleaseSettings.PackageVersions"/></em></p>
/// <p>Version number to use for a step or package in the release. Format: <c>--package=StepNameOrPackageId:Version</c>.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings RemovePackageVersion(this OctopusCreateReleaseSettings toolSettings, string packageVersionKey)
{
toolSettings = toolSettings.NewInstance();
toolSettings.PackageVersionsInternal.Remove(packageVersionKey);
return toolSettings;
}
/// <summary>
/// <p><em>Sets a key-value-pair in <see cref="OctopusCreateReleaseSettings.PackageVersions"/></em></p>
/// <p>Version number to use for a step or package in the release. Format: <c>--package=StepNameOrPackageId:Version</c>.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings SetPackageVersion(this OctopusCreateReleaseSettings toolSettings, string packageVersionKey, string packageVersionValue)
{
toolSettings = toolSettings.NewInstance();
toolSettings.PackageVersionsInternal[packageVersionKey] = packageVersionValue;
return toolSettings;
}
#endregion
#region PackagesFolder
/// <summary>
/// <p><em>Sets <see cref="OctopusCreateReleaseSettings.PackagesFolder"/></em></p>
/// <p>A folder containing NuGet packages from which we should get versions.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings SetPackagesFolder(this OctopusCreateReleaseSettings toolSettings, string packagesFolder)
{
toolSettings = toolSettings.NewInstance();
toolSettings.PackagesFolder = packagesFolder;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusCreateReleaseSettings.PackagesFolder"/></em></p>
/// <p>A folder containing NuGet packages from which we should get versions.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings ResetPackagesFolder(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.PackagesFolder = null;
return toolSettings;
}
#endregion
#region ReleaseNotes
/// <summary>
/// <p><em>Sets <see cref="OctopusCreateReleaseSettings.ReleaseNotes"/></em></p>
/// <p>Release Notes for the new release. Styling with Markdown is supported.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings SetReleaseNotes(this OctopusCreateReleaseSettings toolSettings, string releaseNotes)
{
toolSettings = toolSettings.NewInstance();
toolSettings.ReleaseNotes = releaseNotes;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusCreateReleaseSettings.ReleaseNotes"/></em></p>
/// <p>Release Notes for the new release. Styling with Markdown is supported.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings ResetReleaseNotes(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.ReleaseNotes = null;
return toolSettings;
}
#endregion
#region ReleaseNotesFile
/// <summary>
/// <p><em>Sets <see cref="OctopusCreateReleaseSettings.ReleaseNotesFile"/></em></p>
/// <p>Path to a file that contains Release Notes for the new release. Supports Markdown files.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings SetReleaseNotesFile(this OctopusCreateReleaseSettings toolSettings, string releaseNotesFile)
{
toolSettings = toolSettings.NewInstance();
toolSettings.ReleaseNotesFile = releaseNotesFile;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusCreateReleaseSettings.ReleaseNotesFile"/></em></p>
/// <p>Path to a file that contains Release Notes for the new release. Supports Markdown files.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings ResetReleaseNotesFile(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.ReleaseNotesFile = null;
return toolSettings;
}
#endregion
#region IgnoreExisting
/// <summary>
/// <p><em>Sets <see cref="OctopusCreateReleaseSettings.IgnoreExisting"/></em></p>
/// <p>Don't create this release if there is already one with the same version number.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings SetIgnoreExisting(this OctopusCreateReleaseSettings toolSettings, bool? ignoreExisting)
{
toolSettings = toolSettings.NewInstance();
toolSettings.IgnoreExisting = ignoreExisting;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusCreateReleaseSettings.IgnoreExisting"/></em></p>
/// <p>Don't create this release if there is already one with the same version number.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings ResetIgnoreExisting(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.IgnoreExisting = null;
return toolSettings;
}
/// <summary>
/// <p><em>Enables <see cref="OctopusCreateReleaseSettings.IgnoreExisting"/></em></p>
/// <p>Don't create this release if there is already one with the same version number.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings EnableIgnoreExisting(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.IgnoreExisting = true;
return toolSettings;
}
/// <summary>
/// <p><em>Disables <see cref="OctopusCreateReleaseSettings.IgnoreExisting"/></em></p>
/// <p>Don't create this release if there is already one with the same version number.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings DisableIgnoreExisting(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.IgnoreExisting = false;
return toolSettings;
}
/// <summary>
/// <p><em>Toggles <see cref="OctopusCreateReleaseSettings.IgnoreExisting"/></em></p>
/// <p>Don't create this release if there is already one with the same version number.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings ToggleIgnoreExisting(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.IgnoreExisting = !toolSettings.IgnoreExisting;
return toolSettings;
}
#endregion
#region IgnoreChannelRules
/// <summary>
/// <p><em>Sets <see cref="OctopusCreateReleaseSettings.IgnoreChannelRules"/></em></p>
/// <p>Create the release ignoring any version rules specified by the channel.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings SetIgnoreChannelRules(this OctopusCreateReleaseSettings toolSettings, bool? ignoreChannelRules)
{
toolSettings = toolSettings.NewInstance();
toolSettings.IgnoreChannelRules = ignoreChannelRules;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusCreateReleaseSettings.IgnoreChannelRules"/></em></p>
/// <p>Create the release ignoring any version rules specified by the channel.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings ResetIgnoreChannelRules(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.IgnoreChannelRules = null;
return toolSettings;
}
/// <summary>
/// <p><em>Enables <see cref="OctopusCreateReleaseSettings.IgnoreChannelRules"/></em></p>
/// <p>Create the release ignoring any version rules specified by the channel.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings EnableIgnoreChannelRules(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.IgnoreChannelRules = true;
return toolSettings;
}
/// <summary>
/// <p><em>Disables <see cref="OctopusCreateReleaseSettings.IgnoreChannelRules"/></em></p>
/// <p>Create the release ignoring any version rules specified by the channel.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings DisableIgnoreChannelRules(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.IgnoreChannelRules = false;
return toolSettings;
}
/// <summary>
/// <p><em>Toggles <see cref="OctopusCreateReleaseSettings.IgnoreChannelRules"/></em></p>
/// <p>Create the release ignoring any version rules specified by the channel.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings ToggleIgnoreChannelRules(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.IgnoreChannelRules = !toolSettings.IgnoreChannelRules;
return toolSettings;
}
#endregion
#region PackagePrerelease
/// <summary>
/// <p><em>Sets <see cref="OctopusCreateReleaseSettings.PackagePrerelease"/></em></p>
/// <p>Pre-release for latest version of all packages to use for this release.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings SetPackagePrerelease(this OctopusCreateReleaseSettings toolSettings, string packagePrerelease)
{
toolSettings = toolSettings.NewInstance();
toolSettings.PackagePrerelease = packagePrerelease;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusCreateReleaseSettings.PackagePrerelease"/></em></p>
/// <p>Pre-release for latest version of all packages to use for this release.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings ResetPackagePrerelease(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.PackagePrerelease = null;
return toolSettings;
}
#endregion
#region WhatIf
/// <summary>
/// <p><em>Sets <see cref="OctopusCreateReleaseSettings.WhatIf"/></em></p>
/// <p>Perform a dry run but don't actually create/deploy release.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings SetWhatIf(this OctopusCreateReleaseSettings toolSettings, bool? whatIf)
{
toolSettings = toolSettings.NewInstance();
toolSettings.WhatIf = whatIf;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusCreateReleaseSettings.WhatIf"/></em></p>
/// <p>Perform a dry run but don't actually create/deploy release.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings ResetWhatIf(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.WhatIf = null;
return toolSettings;
}
/// <summary>
/// <p><em>Enables <see cref="OctopusCreateReleaseSettings.WhatIf"/></em></p>
/// <p>Perform a dry run but don't actually create/deploy release.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings EnableWhatIf(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.WhatIf = true;
return toolSettings;
}
/// <summary>
/// <p><em>Disables <see cref="OctopusCreateReleaseSettings.WhatIf"/></em></p>
/// <p>Perform a dry run but don't actually create/deploy release.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings DisableWhatIf(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.WhatIf = false;
return toolSettings;
}
/// <summary>
/// <p><em>Toggles <see cref="OctopusCreateReleaseSettings.WhatIf"/></em></p>
/// <p>Perform a dry run but don't actually create/deploy release.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings ToggleWhatIf(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.WhatIf = !toolSettings.WhatIf;
return toolSettings;
}
#endregion
#region Progress
/// <summary>
/// <p><em>Sets <see cref="OctopusCreateReleaseSettings.Progress"/></em></p>
/// <p>Show progress of the deployment.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings SetProgress(this OctopusCreateReleaseSettings toolSettings, bool? progress)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Progress = progress;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusCreateReleaseSettings.Progress"/></em></p>
/// <p>Show progress of the deployment.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings ResetProgress(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Progress = null;
return toolSettings;
}
/// <summary>
/// <p><em>Enables <see cref="OctopusCreateReleaseSettings.Progress"/></em></p>
/// <p>Show progress of the deployment.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings EnableProgress(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Progress = true;
return toolSettings;
}
/// <summary>
/// <p><em>Disables <see cref="OctopusCreateReleaseSettings.Progress"/></em></p>
/// <p>Show progress of the deployment.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings DisableProgress(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Progress = false;
return toolSettings;
}
/// <summary>
/// <p><em>Toggles <see cref="OctopusCreateReleaseSettings.Progress"/></em></p>
/// <p>Show progress of the deployment.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings ToggleProgress(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Progress = !toolSettings.Progress;
return toolSettings;
}
#endregion
#region ForcePackageDownload
/// <summary>
/// <p><em>Sets <see cref="OctopusCreateReleaseSettings.ForcePackageDownload"/></em></p>
/// <p>Whether to force downloading of already installed packages (flag, default false).</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings SetForcePackageDownload(this OctopusCreateReleaseSettings toolSettings, bool? forcePackageDownload)
{
toolSettings = toolSettings.NewInstance();
toolSettings.ForcePackageDownload = forcePackageDownload;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusCreateReleaseSettings.ForcePackageDownload"/></em></p>
/// <p>Whether to force downloading of already installed packages (flag, default false).</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings ResetForcePackageDownload(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.ForcePackageDownload = null;
return toolSettings;
}
/// <summary>
/// <p><em>Enables <see cref="OctopusCreateReleaseSettings.ForcePackageDownload"/></em></p>
/// <p>Whether to force downloading of already installed packages (flag, default false).</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings EnableForcePackageDownload(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.ForcePackageDownload = true;
return toolSettings;
}
/// <summary>
/// <p><em>Disables <see cref="OctopusCreateReleaseSettings.ForcePackageDownload"/></em></p>
/// <p>Whether to force downloading of already installed packages (flag, default false).</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings DisableForcePackageDownload(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.ForcePackageDownload = false;
return toolSettings;
}
/// <summary>
/// <p><em>Toggles <see cref="OctopusCreateReleaseSettings.ForcePackageDownload"/></em></p>
/// <p>Whether to force downloading of already installed packages (flag, default false).</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings ToggleForcePackageDownload(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.ForcePackageDownload = !toolSettings.ForcePackageDownload;
return toolSettings;
}
#endregion
#region WaitForDeployment
/// <summary>
/// <p><em>Sets <see cref="OctopusCreateReleaseSettings.WaitForDeployment"/></em></p>
/// <p>Whether to wait synchronously for deployment to finish.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings SetWaitForDeployment(this OctopusCreateReleaseSettings toolSettings, bool? waitForDeployment)
{
toolSettings = toolSettings.NewInstance();
toolSettings.WaitForDeployment = waitForDeployment;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusCreateReleaseSettings.WaitForDeployment"/></em></p>
/// <p>Whether to wait synchronously for deployment to finish.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings ResetWaitForDeployment(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.WaitForDeployment = null;
return toolSettings;
}
/// <summary>
/// <p><em>Enables <see cref="OctopusCreateReleaseSettings.WaitForDeployment"/></em></p>
/// <p>Whether to wait synchronously for deployment to finish.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings EnableWaitForDeployment(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.WaitForDeployment = true;
return toolSettings;
}
/// <summary>
/// <p><em>Disables <see cref="OctopusCreateReleaseSettings.WaitForDeployment"/></em></p>
/// <p>Whether to wait synchronously for deployment to finish.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings DisableWaitForDeployment(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.WaitForDeployment = false;
return toolSettings;
}
/// <summary>
/// <p><em>Toggles <see cref="OctopusCreateReleaseSettings.WaitForDeployment"/></em></p>
/// <p>Whether to wait synchronously for deployment to finish.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings ToggleWaitForDeployment(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.WaitForDeployment = !toolSettings.WaitForDeployment;
return toolSettings;
}
#endregion
#region DeploymentTimeout
/// <summary>
/// <p><em>Sets <see cref="OctopusCreateReleaseSettings.DeploymentTimeout"/></em></p>
/// <p>Specifies maximum time (timespan format) that the console session will wait for the deployment to finish(default 00:10:00). This will not stop the deployment. Requires <c>--waitfordeployment</c> parameter set.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings SetDeploymentTimeout(this OctopusCreateReleaseSettings toolSettings, string deploymentTimeout)
{
toolSettings = toolSettings.NewInstance();
toolSettings.DeploymentTimeout = deploymentTimeout;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusCreateReleaseSettings.DeploymentTimeout"/></em></p>
/// <p>Specifies maximum time (timespan format) that the console session will wait for the deployment to finish(default 00:10:00). This will not stop the deployment. Requires <c>--waitfordeployment</c> parameter set.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings ResetDeploymentTimeout(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.DeploymentTimeout = null;
return toolSettings;
}
#endregion
#region CancelOnTimeout
/// <summary>
/// <p><em>Sets <see cref="OctopusCreateReleaseSettings.CancelOnTimeout"/></em></p>
/// <p>Whether to cancel the deployment if the deployment timeout is reached (flag, default false).</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings SetCancelOnTimeout(this OctopusCreateReleaseSettings toolSettings, bool? cancelOnTimeout)
{
toolSettings = toolSettings.NewInstance();
toolSettings.CancelOnTimeout = cancelOnTimeout;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusCreateReleaseSettings.CancelOnTimeout"/></em></p>
/// <p>Whether to cancel the deployment if the deployment timeout is reached (flag, default false).</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings ResetCancelOnTimeout(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.CancelOnTimeout = null;
return toolSettings;
}
/// <summary>
/// <p><em>Enables <see cref="OctopusCreateReleaseSettings.CancelOnTimeout"/></em></p>
/// <p>Whether to cancel the deployment if the deployment timeout is reached (flag, default false).</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings EnableCancelOnTimeout(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.CancelOnTimeout = true;
return toolSettings;
}
/// <summary>
/// <p><em>Disables <see cref="OctopusCreateReleaseSettings.CancelOnTimeout"/></em></p>
/// <p>Whether to cancel the deployment if the deployment timeout is reached (flag, default false).</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings DisableCancelOnTimeout(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.CancelOnTimeout = false;
return toolSettings;
}
/// <summary>
/// <p><em>Toggles <see cref="OctopusCreateReleaseSettings.CancelOnTimeout"/></em></p>
/// <p>Whether to cancel the deployment if the deployment timeout is reached (flag, default false).</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings ToggleCancelOnTimeout(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.CancelOnTimeout = !toolSettings.CancelOnTimeout;
return toolSettings;
}
#endregion
#region DeploymentCheckSleepCycle
/// <summary>
/// <p><em>Sets <see cref="OctopusCreateReleaseSettings.DeploymentCheckSleepCycle"/></em></p>
/// <p>Specifies how much time (timespan format) should elapse between deployment status checks (default 00:00:10).</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings SetDeploymentCheckSleepCycle(this OctopusCreateReleaseSettings toolSettings, string deploymentCheckSleepCycle)
{
toolSettings = toolSettings.NewInstance();
toolSettings.DeploymentCheckSleepCycle = deploymentCheckSleepCycle;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusCreateReleaseSettings.DeploymentCheckSleepCycle"/></em></p>
/// <p>Specifies how much time (timespan format) should elapse between deployment status checks (default 00:00:10).</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings ResetDeploymentCheckSleepCycle(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.DeploymentCheckSleepCycle = null;
return toolSettings;
}
#endregion
#region GuidedFailure
/// <summary>
/// <p><em>Sets <see cref="OctopusCreateReleaseSettings.GuidedFailure"/></em></p>
/// <p>Whether to use Guided Failure mode. (True or False. If not specified, will use default setting from environment).</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings SetGuidedFailure(this OctopusCreateReleaseSettings toolSettings, bool? guidedFailure)
{
toolSettings = toolSettings.NewInstance();
toolSettings.GuidedFailure = guidedFailure;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusCreateReleaseSettings.GuidedFailure"/></em></p>
/// <p>Whether to use Guided Failure mode. (True or False. If not specified, will use default setting from environment).</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings ResetGuidedFailure(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.GuidedFailure = null;
return toolSettings;
}
/// <summary>
/// <p><em>Enables <see cref="OctopusCreateReleaseSettings.GuidedFailure"/></em></p>
/// <p>Whether to use Guided Failure mode. (True or False. If not specified, will use default setting from environment).</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings EnableGuidedFailure(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.GuidedFailure = true;
return toolSettings;
}
/// <summary>
/// <p><em>Disables <see cref="OctopusCreateReleaseSettings.GuidedFailure"/></em></p>
/// <p>Whether to use Guided Failure mode. (True or False. If not specified, will use default setting from environment).</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings DisableGuidedFailure(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.GuidedFailure = false;
return toolSettings;
}
/// <summary>
/// <p><em>Toggles <see cref="OctopusCreateReleaseSettings.GuidedFailure"/></em></p>
/// <p>Whether to use Guided Failure mode. (True or False. If not specified, will use default setting from environment).</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings ToggleGuidedFailure(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.GuidedFailure = !toolSettings.GuidedFailure;
return toolSettings;
}
#endregion
#region SpecificMachines
/// <summary>
/// <p><em>Sets <see cref="OctopusCreateReleaseSettings.SpecificMachines"/> to a new list</em></p>
/// <p>A comma-separated list of machines names to target in the deployed environment. If not specified all machines in the environment will be considered.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings SetSpecificMachines(this OctopusCreateReleaseSettings toolSettings, params string[] specificMachines)
{
toolSettings = toolSettings.NewInstance();
toolSettings.SpecificMachinesInternal = specificMachines.ToList();
return toolSettings;
}
/// <summary>
/// <p><em>Sets <see cref="OctopusCreateReleaseSettings.SpecificMachines"/> to a new list</em></p>
/// <p>A comma-separated list of machines names to target in the deployed environment. If not specified all machines in the environment will be considered.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings SetSpecificMachines(this OctopusCreateReleaseSettings toolSettings, IEnumerable<string> specificMachines)
{
toolSettings = toolSettings.NewInstance();
toolSettings.SpecificMachinesInternal = specificMachines.ToList();
return toolSettings;
}
/// <summary>
/// <p><em>Adds values to <see cref="OctopusCreateReleaseSettings.SpecificMachines"/></em></p>
/// <p>A comma-separated list of machines names to target in the deployed environment. If not specified all machines in the environment will be considered.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings AddSpecificMachines(this OctopusCreateReleaseSettings toolSettings, params string[] specificMachines)
{
toolSettings = toolSettings.NewInstance();
toolSettings.SpecificMachinesInternal.AddRange(specificMachines);
return toolSettings;
}
/// <summary>
/// <p><em>Adds values to <see cref="OctopusCreateReleaseSettings.SpecificMachines"/></em></p>
/// <p>A comma-separated list of machines names to target in the deployed environment. If not specified all machines in the environment will be considered.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings AddSpecificMachines(this OctopusCreateReleaseSettings toolSettings, IEnumerable<string> specificMachines)
{
toolSettings = toolSettings.NewInstance();
toolSettings.SpecificMachinesInternal.AddRange(specificMachines);
return toolSettings;
}
/// <summary>
/// <p><em>Clears <see cref="OctopusCreateReleaseSettings.SpecificMachines"/></em></p>
/// <p>A comma-separated list of machines names to target in the deployed environment. If not specified all machines in the environment will be considered.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings ClearSpecificMachines(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.SpecificMachinesInternal.Clear();
return toolSettings;
}
/// <summary>
/// <p><em>Removes values from <see cref="OctopusCreateReleaseSettings.SpecificMachines"/></em></p>
/// <p>A comma-separated list of machines names to target in the deployed environment. If not specified all machines in the environment will be considered.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings RemoveSpecificMachines(this OctopusCreateReleaseSettings toolSettings, params string[] specificMachines)
{
toolSettings = toolSettings.NewInstance();
var hashSet = new HashSet<string>(specificMachines);
toolSettings.SpecificMachinesInternal.RemoveAll(x => hashSet.Contains(x));
return toolSettings;
}
/// <summary>
/// <p><em>Removes values from <see cref="OctopusCreateReleaseSettings.SpecificMachines"/></em></p>
/// <p>A comma-separated list of machines names to target in the deployed environment. If not specified all machines in the environment will be considered.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings RemoveSpecificMachines(this OctopusCreateReleaseSettings toolSettings, IEnumerable<string> specificMachines)
{
toolSettings = toolSettings.NewInstance();
var hashSet = new HashSet<string>(specificMachines);
toolSettings.SpecificMachinesInternal.RemoveAll(x => hashSet.Contains(x));
return toolSettings;
}
#endregion
#region Force
/// <summary>
/// <p><em>Sets <see cref="OctopusCreateReleaseSettings.Force"/></em></p>
/// <p>If a project is configured to skip packages with already-installed versions, override this setting to force re-deployment (flag, default false).</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings SetForce(this OctopusCreateReleaseSettings toolSettings, bool? force)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Force = force;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusCreateReleaseSettings.Force"/></em></p>
/// <p>If a project is configured to skip packages with already-installed versions, override this setting to force re-deployment (flag, default false).</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings ResetForce(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Force = null;
return toolSettings;
}
/// <summary>
/// <p><em>Enables <see cref="OctopusCreateReleaseSettings.Force"/></em></p>
/// <p>If a project is configured to skip packages with already-installed versions, override this setting to force re-deployment (flag, default false).</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings EnableForce(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Force = true;
return toolSettings;
}
/// <summary>
/// <p><em>Disables <see cref="OctopusCreateReleaseSettings.Force"/></em></p>
/// <p>If a project is configured to skip packages with already-installed versions, override this setting to force re-deployment (flag, default false).</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings DisableForce(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Force = false;
return toolSettings;
}
/// <summary>
/// <p><em>Toggles <see cref="OctopusCreateReleaseSettings.Force"/></em></p>
/// <p>If a project is configured to skip packages with already-installed versions, override this setting to force re-deployment (flag, default false).</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings ToggleForce(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Force = !toolSettings.Force;
return toolSettings;
}
#endregion
#region Skip
/// <summary>
/// <p><em>Sets <see cref="OctopusCreateReleaseSettings.Skip"/> to a new list</em></p>
/// <p>Skip a step by name.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings SetSkip(this OctopusCreateReleaseSettings toolSettings, params string[] skip)
{
toolSettings = toolSettings.NewInstance();
toolSettings.SkipInternal = skip.ToList();
return toolSettings;
}
/// <summary>
/// <p><em>Sets <see cref="OctopusCreateReleaseSettings.Skip"/> to a new list</em></p>
/// <p>Skip a step by name.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings SetSkip(this OctopusCreateReleaseSettings toolSettings, IEnumerable<string> skip)
{
toolSettings = toolSettings.NewInstance();
toolSettings.SkipInternal = skip.ToList();
return toolSettings;
}
/// <summary>
/// <p><em>Adds values to <see cref="OctopusCreateReleaseSettings.Skip"/></em></p>
/// <p>Skip a step by name.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings AddSkip(this OctopusCreateReleaseSettings toolSettings, params string[] skip)
{
toolSettings = toolSettings.NewInstance();
toolSettings.SkipInternal.AddRange(skip);
return toolSettings;
}
/// <summary>
/// <p><em>Adds values to <see cref="OctopusCreateReleaseSettings.Skip"/></em></p>
/// <p>Skip a step by name.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings AddSkip(this OctopusCreateReleaseSettings toolSettings, IEnumerable<string> skip)
{
toolSettings = toolSettings.NewInstance();
toolSettings.SkipInternal.AddRange(skip);
return toolSettings;
}
/// <summary>
/// <p><em>Clears <see cref="OctopusCreateReleaseSettings.Skip"/></em></p>
/// <p>Skip a step by name.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings ClearSkip(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.SkipInternal.Clear();
return toolSettings;
}
/// <summary>
/// <p><em>Removes values from <see cref="OctopusCreateReleaseSettings.Skip"/></em></p>
/// <p>Skip a step by name.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings RemoveSkip(this OctopusCreateReleaseSettings toolSettings, params string[] skip)
{
toolSettings = toolSettings.NewInstance();
var hashSet = new HashSet<string>(skip);
toolSettings.SkipInternal.RemoveAll(x => hashSet.Contains(x));
return toolSettings;
}
/// <summary>
/// <p><em>Removes values from <see cref="OctopusCreateReleaseSettings.Skip"/></em></p>
/// <p>Skip a step by name.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings RemoveSkip(this OctopusCreateReleaseSettings toolSettings, IEnumerable<string> skip)
{
toolSettings = toolSettings.NewInstance();
var hashSet = new HashSet<string>(skip);
toolSettings.SkipInternal.RemoveAll(x => hashSet.Contains(x));
return toolSettings;
}
#endregion
#region NoRawLog
/// <summary>
/// <p><em>Sets <see cref="OctopusCreateReleaseSettings.NoRawLog"/></em></p>
/// <p>Don't print the raw log of failed tasks.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings SetNoRawLog(this OctopusCreateReleaseSettings toolSettings, bool? noRawLog)
{
toolSettings = toolSettings.NewInstance();
toolSettings.NoRawLog = noRawLog;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusCreateReleaseSettings.NoRawLog"/></em></p>
/// <p>Don't print the raw log of failed tasks.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings ResetNoRawLog(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.NoRawLog = null;
return toolSettings;
}
/// <summary>
/// <p><em>Enables <see cref="OctopusCreateReleaseSettings.NoRawLog"/></em></p>
/// <p>Don't print the raw log of failed tasks.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings EnableNoRawLog(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.NoRawLog = true;
return toolSettings;
}
/// <summary>
/// <p><em>Disables <see cref="OctopusCreateReleaseSettings.NoRawLog"/></em></p>
/// <p>Don't print the raw log of failed tasks.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings DisableNoRawLog(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.NoRawLog = false;
return toolSettings;
}
/// <summary>
/// <p><em>Toggles <see cref="OctopusCreateReleaseSettings.NoRawLog"/></em></p>
/// <p>Don't print the raw log of failed tasks.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings ToggleNoRawLog(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.NoRawLog = !toolSettings.NoRawLog;
return toolSettings;
}
#endregion
#region RawLogFile
/// <summary>
/// <p><em>Sets <see cref="OctopusCreateReleaseSettings.RawLogFile"/></em></p>
/// <p>Redirect the raw log of failed tasks to a file.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings SetRawLogFile(this OctopusCreateReleaseSettings toolSettings, string rawLogFile)
{
toolSettings = toolSettings.NewInstance();
toolSettings.RawLogFile = rawLogFile;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusCreateReleaseSettings.RawLogFile"/></em></p>
/// <p>Redirect the raw log of failed tasks to a file.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings ResetRawLogFile(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.RawLogFile = null;
return toolSettings;
}
#endregion
#region Variables
/// <summary>
/// <p><em>Sets <see cref="OctopusCreateReleaseSettings.Variables"/> to a new dictionary</em></p>
/// <p>Values for any prompted variables in the format Label:Value. For JSON values, embedded quotation marks should be escaped with a backslash.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings SetVariables(this OctopusCreateReleaseSettings toolSettings, IDictionary<string, string> variables)
{
toolSettings = toolSettings.NewInstance();
toolSettings.VariablesInternal = variables.ToDictionary(x => x.Key, x => x.Value, StringComparer.OrdinalIgnoreCase);
return toolSettings;
}
/// <summary>
/// <p><em>Clears <see cref="OctopusCreateReleaseSettings.Variables"/></em></p>
/// <p>Values for any prompted variables in the format Label:Value. For JSON values, embedded quotation marks should be escaped with a backslash.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings ClearVariables(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.VariablesInternal.Clear();
return toolSettings;
}
/// <summary>
/// <p><em>Adds a new key-value-pair <see cref="OctopusCreateReleaseSettings.Variables"/></em></p>
/// <p>Values for any prompted variables in the format Label:Value. For JSON values, embedded quotation marks should be escaped with a backslash.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings AddVariable(this OctopusCreateReleaseSettings toolSettings, string variableKey, string variableValue)
{
toolSettings = toolSettings.NewInstance();
toolSettings.VariablesInternal.Add(variableKey, variableValue);
return toolSettings;
}
/// <summary>
/// <p><em>Removes a key-value-pair from <see cref="OctopusCreateReleaseSettings.Variables"/></em></p>
/// <p>Values for any prompted variables in the format Label:Value. For JSON values, embedded quotation marks should be escaped with a backslash.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings RemoveVariable(this OctopusCreateReleaseSettings toolSettings, string variableKey)
{
toolSettings = toolSettings.NewInstance();
toolSettings.VariablesInternal.Remove(variableKey);
return toolSettings;
}
/// <summary>
/// <p><em>Sets a key-value-pair in <see cref="OctopusCreateReleaseSettings.Variables"/></em></p>
/// <p>Values for any prompted variables in the format Label:Value. For JSON values, embedded quotation marks should be escaped with a backslash.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings SetVariable(this OctopusCreateReleaseSettings toolSettings, string variableKey, string variableValue)
{
toolSettings = toolSettings.NewInstance();
toolSettings.VariablesInternal[variableKey] = variableValue;
return toolSettings;
}
#endregion
#region DeployAt
/// <summary>
/// <p><em>Sets <see cref="OctopusCreateReleaseSettings.DeployAt"/></em></p>
/// <p>Time at which deployment should start (scheduled deployment), specified as any valid DateTimeOffset format, and assuming the time zone is the current local time zone.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings SetDeployAt(this OctopusCreateReleaseSettings toolSettings, string deployAt)
{
toolSettings = toolSettings.NewInstance();
toolSettings.DeployAt = deployAt;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusCreateReleaseSettings.DeployAt"/></em></p>
/// <p>Time at which deployment should start (scheduled deployment), specified as any valid DateTimeOffset format, and assuming the time zone is the current local time zone.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings ResetDeployAt(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.DeployAt = null;
return toolSettings;
}
#endregion
#region DeployTo
/// <summary>
/// <p><em>Sets <see cref="OctopusCreateReleaseSettings.DeployTo"/></em></p>
/// <p>Environment to automatically deploy to, e.g., <c>Production</c>.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings SetDeployTo(this OctopusCreateReleaseSettings toolSettings, string deployTo)
{
toolSettings = toolSettings.NewInstance();
toolSettings.DeployTo = deployTo;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusCreateReleaseSettings.DeployTo"/></em></p>
/// <p>Environment to automatically deploy to, e.g., <c>Production</c>.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings ResetDeployTo(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.DeployTo = null;
return toolSettings;
}
#endregion
#region Tenant
/// <summary>
/// <p><em>Sets <see cref="OctopusCreateReleaseSettings.Tenant"/></em></p>
/// <p>A tenant the deployment will be performed for; specify this argument multiple times to add multiple tenants or use <c>*</c> wildcard to deploy to tenants able to deploy.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings SetTenant(this OctopusCreateReleaseSettings toolSettings, string tenant)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Tenant = tenant;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusCreateReleaseSettings.Tenant"/></em></p>
/// <p>A tenant the deployment will be performed for; specify this argument multiple times to add multiple tenants or use <c>*</c> wildcard to deploy to tenants able to deploy.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings ResetTenant(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Tenant = null;
return toolSettings;
}
#endregion
#region TenantTag
/// <summary>
/// <p><em>Sets <see cref="OctopusCreateReleaseSettings.TenantTag"/></em></p>
/// <p>A tenant tag used to match tenants that the deployment will be performed for; specify this argument multiple times to add multiple tenant tags.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings SetTenantTag(this OctopusCreateReleaseSettings toolSettings, string tenantTag)
{
toolSettings = toolSettings.NewInstance();
toolSettings.TenantTag = tenantTag;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusCreateReleaseSettings.TenantTag"/></em></p>
/// <p>A tenant tag used to match tenants that the deployment will be performed for; specify this argument multiple times to add multiple tenant tags.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings ResetTenantTag(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.TenantTag = null;
return toolSettings;
}
#endregion
#region Server
/// <summary>
/// <p><em>Sets <see cref="OctopusCreateReleaseSettings.Server"/></em></p>
/// <p>The base URL for your Octopus server - e.g., http://your-octopus/</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings SetServer(this OctopusCreateReleaseSettings toolSettings, string server)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Server = server;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusCreateReleaseSettings.Server"/></em></p>
/// <p>The base URL for your Octopus server - e.g., http://your-octopus/</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings ResetServer(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Server = null;
return toolSettings;
}
#endregion
#region ApiKey
/// <summary>
/// <p><em>Sets <see cref="OctopusCreateReleaseSettings.ApiKey"/></em></p>
/// <p>Your API key. Get this from the user profile page. Your must provide an apiKey or username and password. If the guest account is enabled, a key of API-GUEST can be used.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings SetApiKey(this OctopusCreateReleaseSettings toolSettings, string apiKey)
{
toolSettings = toolSettings.NewInstance();
toolSettings.ApiKey = apiKey;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusCreateReleaseSettings.ApiKey"/></em></p>
/// <p>Your API key. Get this from the user profile page. Your must provide an apiKey or username and password. If the guest account is enabled, a key of API-GUEST can be used.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings ResetApiKey(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.ApiKey = null;
return toolSettings;
}
#endregion
#region Username
/// <summary>
/// <p><em>Sets <see cref="OctopusCreateReleaseSettings.Username"/></em></p>
/// <p>Username to use when authenticating with the server. Your must provide an apiKey or username and password.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings SetUsername(this OctopusCreateReleaseSettings toolSettings, string username)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Username = username;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusCreateReleaseSettings.Username"/></em></p>
/// <p>Username to use when authenticating with the server. Your must provide an apiKey or username and password.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings ResetUsername(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Username = null;
return toolSettings;
}
#endregion
#region Password
/// <summary>
/// <p><em>Sets <see cref="OctopusCreateReleaseSettings.Password"/></em></p>
/// <p>Password to use when authenticating with the server.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings SetPassword(this OctopusCreateReleaseSettings toolSettings, string password)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Password = password;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusCreateReleaseSettings.Password"/></em></p>
/// <p>Password to use when authenticating with the server.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings ResetPassword(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Password = null;
return toolSettings;
}
#endregion
#region ConfigFile
/// <summary>
/// <p><em>Sets <see cref="OctopusCreateReleaseSettings.ConfigFile"/></em></p>
/// <p>Text file of default values, with one 'key = value' per line.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings SetConfigFile(this OctopusCreateReleaseSettings toolSettings, string configFile)
{
toolSettings = toolSettings.NewInstance();
toolSettings.ConfigFile = configFile;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusCreateReleaseSettings.ConfigFile"/></em></p>
/// <p>Text file of default values, with one 'key = value' per line.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings ResetConfigFile(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.ConfigFile = null;
return toolSettings;
}
#endregion
#region Debug
/// <summary>
/// <p><em>Sets <see cref="OctopusCreateReleaseSettings.Debug"/></em></p>
/// <p>Enable debug logging.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings SetDebug(this OctopusCreateReleaseSettings toolSettings, bool? debug)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Debug = debug;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusCreateReleaseSettings.Debug"/></em></p>
/// <p>Enable debug logging.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings ResetDebug(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Debug = null;
return toolSettings;
}
/// <summary>
/// <p><em>Enables <see cref="OctopusCreateReleaseSettings.Debug"/></em></p>
/// <p>Enable debug logging.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings EnableDebug(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Debug = true;
return toolSettings;
}
/// <summary>
/// <p><em>Disables <see cref="OctopusCreateReleaseSettings.Debug"/></em></p>
/// <p>Enable debug logging.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings DisableDebug(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Debug = false;
return toolSettings;
}
/// <summary>
/// <p><em>Toggles <see cref="OctopusCreateReleaseSettings.Debug"/></em></p>
/// <p>Enable debug logging.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings ToggleDebug(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Debug = !toolSettings.Debug;
return toolSettings;
}
#endregion
#region IgnoreSslErrors
/// <summary>
/// <p><em>Sets <see cref="OctopusCreateReleaseSettings.IgnoreSslErrors"/></em></p>
/// <p>Set this flag if your Octopus server uses HTTPS but the certificate is not trusted on this machine. Any certificate errors will be ignored. WARNING: this option may create a security vulnerability.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings SetIgnoreSslErrors(this OctopusCreateReleaseSettings toolSettings, bool? ignoreSslErrors)
{
toolSettings = toolSettings.NewInstance();
toolSettings.IgnoreSslErrors = ignoreSslErrors;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusCreateReleaseSettings.IgnoreSslErrors"/></em></p>
/// <p>Set this flag if your Octopus server uses HTTPS but the certificate is not trusted on this machine. Any certificate errors will be ignored. WARNING: this option may create a security vulnerability.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings ResetIgnoreSslErrors(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.IgnoreSslErrors = null;
return toolSettings;
}
/// <summary>
/// <p><em>Enables <see cref="OctopusCreateReleaseSettings.IgnoreSslErrors"/></em></p>
/// <p>Set this flag if your Octopus server uses HTTPS but the certificate is not trusted on this machine. Any certificate errors will be ignored. WARNING: this option may create a security vulnerability.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings EnableIgnoreSslErrors(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.IgnoreSslErrors = true;
return toolSettings;
}
/// <summary>
/// <p><em>Disables <see cref="OctopusCreateReleaseSettings.IgnoreSslErrors"/></em></p>
/// <p>Set this flag if your Octopus server uses HTTPS but the certificate is not trusted on this machine. Any certificate errors will be ignored. WARNING: this option may create a security vulnerability.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings DisableIgnoreSslErrors(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.IgnoreSslErrors = false;
return toolSettings;
}
/// <summary>
/// <p><em>Toggles <see cref="OctopusCreateReleaseSettings.IgnoreSslErrors"/></em></p>
/// <p>Set this flag if your Octopus server uses HTTPS but the certificate is not trusted on this machine. Any certificate errors will be ignored. WARNING: this option may create a security vulnerability.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings ToggleIgnoreSslErrors(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.IgnoreSslErrors = !toolSettings.IgnoreSslErrors;
return toolSettings;
}
#endregion
#region EnableServiceMessages
/// <summary>
/// <p><em>Sets <see cref="OctopusCreateReleaseSettings.EnableServiceMessages"/></em></p>
/// <p>Enable TeamCity or Team Foundation Build service messages when logging.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings SetEnableServiceMessages(this OctopusCreateReleaseSettings toolSettings, bool? enableServiceMessages)
{
toolSettings = toolSettings.NewInstance();
toolSettings.EnableServiceMessages = enableServiceMessages;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusCreateReleaseSettings.EnableServiceMessages"/></em></p>
/// <p>Enable TeamCity or Team Foundation Build service messages when logging.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings ResetEnableServiceMessages(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.EnableServiceMessages = null;
return toolSettings;
}
/// <summary>
/// <p><em>Enables <see cref="OctopusCreateReleaseSettings.EnableServiceMessages"/></em></p>
/// <p>Enable TeamCity or Team Foundation Build service messages when logging.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings EnableEnableServiceMessages(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.EnableServiceMessages = true;
return toolSettings;
}
/// <summary>
/// <p><em>Disables <see cref="OctopusCreateReleaseSettings.EnableServiceMessages"/></em></p>
/// <p>Enable TeamCity or Team Foundation Build service messages when logging.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings DisableEnableServiceMessages(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.EnableServiceMessages = false;
return toolSettings;
}
/// <summary>
/// <p><em>Toggles <see cref="OctopusCreateReleaseSettings.EnableServiceMessages"/></em></p>
/// <p>Enable TeamCity or Team Foundation Build service messages when logging.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings ToggleEnableServiceMessages(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.EnableServiceMessages = !toolSettings.EnableServiceMessages;
return toolSettings;
}
#endregion
#region Timeout
/// <summary>
/// <p><em>Sets <see cref="OctopusCreateReleaseSettings.Timeout"/></em></p>
/// <p>Timeout in seconds for network operations. Default is 600.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings SetTimeout(this OctopusCreateReleaseSettings toolSettings, int? timeout)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Timeout = timeout;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusCreateReleaseSettings.Timeout"/></em></p>
/// <p>Timeout in seconds for network operations. Default is 600.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings ResetTimeout(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Timeout = null;
return toolSettings;
}
#endregion
#region Proxy
/// <summary>
/// <p><em>Sets <see cref="OctopusCreateReleaseSettings.Proxy"/></em></p>
/// <p>The URI of the proxy to use, e.g., http://example.com:8080.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings SetProxy(this OctopusCreateReleaseSettings toolSettings, string proxy)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Proxy = proxy;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusCreateReleaseSettings.Proxy"/></em></p>
/// <p>The URI of the proxy to use, e.g., http://example.com:8080.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings ResetProxy(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Proxy = null;
return toolSettings;
}
#endregion
#region ProxyUsername
/// <summary>
/// <p><em>Sets <see cref="OctopusCreateReleaseSettings.ProxyUsername"/></em></p>
/// <p>The username for the proxy.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings SetProxyUsername(this OctopusCreateReleaseSettings toolSettings, string proxyUsername)
{
toolSettings = toolSettings.NewInstance();
toolSettings.ProxyUsername = proxyUsername;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusCreateReleaseSettings.ProxyUsername"/></em></p>
/// <p>The username for the proxy.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings ResetProxyUsername(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.ProxyUsername = null;
return toolSettings;
}
#endregion
#region ProxyPassword
/// <summary>
/// <p><em>Sets <see cref="OctopusCreateReleaseSettings.ProxyPassword"/></em></p>
/// <p>The password for the proxy. If both the username and password are omitted and proxyAddress is specified, the default credentials are used.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings SetProxyPassword(this OctopusCreateReleaseSettings toolSettings, string proxyPassword)
{
toolSettings = toolSettings.NewInstance();
toolSettings.ProxyPassword = proxyPassword;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusCreateReleaseSettings.ProxyPassword"/></em></p>
/// <p>The password for the proxy. If both the username and password are omitted and proxyAddress is specified, the default credentials are used.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings ResetProxyPassword(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.ProxyPassword = null;
return toolSettings;
}
#endregion
#region Space
/// <summary>
/// <p><em>Sets <see cref="OctopusCreateReleaseSettings.Space"/></em></p>
/// <p>The name of a space within which this command will be executed. The default space will be used if it is omitted.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings SetSpace(this OctopusCreateReleaseSettings toolSettings, string space)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Space = space;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusCreateReleaseSettings.Space"/></em></p>
/// <p>The name of a space within which this command will be executed. The default space will be used if it is omitted.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings ResetSpace(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Space = null;
return toolSettings;
}
#endregion
#region LogLevel
/// <summary>
/// <p><em>Sets <see cref="OctopusCreateReleaseSettings.LogLevel"/></em></p>
/// <p>The log level. Valid options are verbose, debug, information, warning, error and fatal. Defaults to 'debug'.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings SetLogLevel(this OctopusCreateReleaseSettings toolSettings, string logLevel)
{
toolSettings = toolSettings.NewInstance();
toolSettings.LogLevel = logLevel;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusCreateReleaseSettings.LogLevel"/></em></p>
/// <p>The log level. Valid options are verbose, debug, information, warning, error and fatal. Defaults to 'debug'.</p>
/// </summary>
[Pure]
public static OctopusCreateReleaseSettings ResetLogLevel(this OctopusCreateReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.LogLevel = null;
return toolSettings;
}
#endregion
}
#endregion
#region OctopusDeployReleaseSettingsExtensions
/// <summary>
/// Used within <see cref="OctopusTasks"/>.
/// </summary>
[PublicAPI]
[ExcludeFromCodeCoverage]
public static partial class OctopusDeployReleaseSettingsExtensions
{
#region Progress
/// <summary>
/// <p><em>Sets <see cref="OctopusDeployReleaseSettings.Progress"/></em></p>
/// <p>Show progress of the deployment.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings SetProgress(this OctopusDeployReleaseSettings toolSettings, bool? progress)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Progress = progress;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusDeployReleaseSettings.Progress"/></em></p>
/// <p>Show progress of the deployment.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings ResetProgress(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Progress = null;
return toolSettings;
}
/// <summary>
/// <p><em>Enables <see cref="OctopusDeployReleaseSettings.Progress"/></em></p>
/// <p>Show progress of the deployment.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings EnableProgress(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Progress = true;
return toolSettings;
}
/// <summary>
/// <p><em>Disables <see cref="OctopusDeployReleaseSettings.Progress"/></em></p>
/// <p>Show progress of the deployment.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings DisableProgress(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Progress = false;
return toolSettings;
}
/// <summary>
/// <p><em>Toggles <see cref="OctopusDeployReleaseSettings.Progress"/></em></p>
/// <p>Show progress of the deployment.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings ToggleProgress(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Progress = !toolSettings.Progress;
return toolSettings;
}
#endregion
#region ForcePackageDownload
/// <summary>
/// <p><em>Sets <see cref="OctopusDeployReleaseSettings.ForcePackageDownload"/></em></p>
/// <p>Whether to force downloading of already installed packages (flag, default false).</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings SetForcePackageDownload(this OctopusDeployReleaseSettings toolSettings, bool? forcePackageDownload)
{
toolSettings = toolSettings.NewInstance();
toolSettings.ForcePackageDownload = forcePackageDownload;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusDeployReleaseSettings.ForcePackageDownload"/></em></p>
/// <p>Whether to force downloading of already installed packages (flag, default false).</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings ResetForcePackageDownload(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.ForcePackageDownload = null;
return toolSettings;
}
/// <summary>
/// <p><em>Enables <see cref="OctopusDeployReleaseSettings.ForcePackageDownload"/></em></p>
/// <p>Whether to force downloading of already installed packages (flag, default false).</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings EnableForcePackageDownload(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.ForcePackageDownload = true;
return toolSettings;
}
/// <summary>
/// <p><em>Disables <see cref="OctopusDeployReleaseSettings.ForcePackageDownload"/></em></p>
/// <p>Whether to force downloading of already installed packages (flag, default false).</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings DisableForcePackageDownload(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.ForcePackageDownload = false;
return toolSettings;
}
/// <summary>
/// <p><em>Toggles <see cref="OctopusDeployReleaseSettings.ForcePackageDownload"/></em></p>
/// <p>Whether to force downloading of already installed packages (flag, default false).</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings ToggleForcePackageDownload(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.ForcePackageDownload = !toolSettings.ForcePackageDownload;
return toolSettings;
}
#endregion
#region WaitForDepployment
/// <summary>
/// <p><em>Sets <see cref="OctopusDeployReleaseSettings.WaitForDepployment"/></em></p>
/// <p>Whether to wait synchronously for deployment to finish.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings SetWaitForDepployment(this OctopusDeployReleaseSettings toolSettings, bool? waitForDepployment)
{
toolSettings = toolSettings.NewInstance();
toolSettings.WaitForDepployment = waitForDepployment;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusDeployReleaseSettings.WaitForDepployment"/></em></p>
/// <p>Whether to wait synchronously for deployment to finish.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings ResetWaitForDepployment(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.WaitForDepployment = null;
return toolSettings;
}
/// <summary>
/// <p><em>Enables <see cref="OctopusDeployReleaseSettings.WaitForDepployment"/></em></p>
/// <p>Whether to wait synchronously for deployment to finish.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings EnableWaitForDepployment(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.WaitForDepployment = true;
return toolSettings;
}
/// <summary>
/// <p><em>Disables <see cref="OctopusDeployReleaseSettings.WaitForDepployment"/></em></p>
/// <p>Whether to wait synchronously for deployment to finish.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings DisableWaitForDepployment(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.WaitForDepployment = false;
return toolSettings;
}
/// <summary>
/// <p><em>Toggles <see cref="OctopusDeployReleaseSettings.WaitForDepployment"/></em></p>
/// <p>Whether to wait synchronously for deployment to finish.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings ToggleWaitForDepployment(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.WaitForDepployment = !toolSettings.WaitForDepployment;
return toolSettings;
}
#endregion
#region DeploymentTimeout
/// <summary>
/// <p><em>Sets <see cref="OctopusDeployReleaseSettings.DeploymentTimeout"/></em></p>
/// <p>Specifies maximum time (timespan format) that the console session will wait for the deployment to finish(default 00:10:00). This will not stop the deployment. Requires <c>WaitForDeployment</c> parameter set.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings SetDeploymentTimeout(this OctopusDeployReleaseSettings toolSettings, string deploymentTimeout)
{
toolSettings = toolSettings.NewInstance();
toolSettings.DeploymentTimeout = deploymentTimeout;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusDeployReleaseSettings.DeploymentTimeout"/></em></p>
/// <p>Specifies maximum time (timespan format) that the console session will wait for the deployment to finish(default 00:10:00). This will not stop the deployment. Requires <c>WaitForDeployment</c> parameter set.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings ResetDeploymentTimeout(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.DeploymentTimeout = null;
return toolSettings;
}
#endregion
#region CancelOnTimeout
/// <summary>
/// <p><em>Sets <see cref="OctopusDeployReleaseSettings.CancelOnTimeout"/></em></p>
/// <p>Whether to cancel the deployment if the deployment timeout is reached (flag, default false).</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings SetCancelOnTimeout(this OctopusDeployReleaseSettings toolSettings, bool? cancelOnTimeout)
{
toolSettings = toolSettings.NewInstance();
toolSettings.CancelOnTimeout = cancelOnTimeout;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusDeployReleaseSettings.CancelOnTimeout"/></em></p>
/// <p>Whether to cancel the deployment if the deployment timeout is reached (flag, default false).</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings ResetCancelOnTimeout(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.CancelOnTimeout = null;
return toolSettings;
}
/// <summary>
/// <p><em>Enables <see cref="OctopusDeployReleaseSettings.CancelOnTimeout"/></em></p>
/// <p>Whether to cancel the deployment if the deployment timeout is reached (flag, default false).</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings EnableCancelOnTimeout(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.CancelOnTimeout = true;
return toolSettings;
}
/// <summary>
/// <p><em>Disables <see cref="OctopusDeployReleaseSettings.CancelOnTimeout"/></em></p>
/// <p>Whether to cancel the deployment if the deployment timeout is reached (flag, default false).</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings DisableCancelOnTimeout(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.CancelOnTimeout = false;
return toolSettings;
}
/// <summary>
/// <p><em>Toggles <see cref="OctopusDeployReleaseSettings.CancelOnTimeout"/></em></p>
/// <p>Whether to cancel the deployment if the deployment timeout is reached (flag, default false).</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings ToggleCancelOnTimeout(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.CancelOnTimeout = !toolSettings.CancelOnTimeout;
return toolSettings;
}
#endregion
#region DeploymentCheckSleepCycle
/// <summary>
/// <p><em>Sets <see cref="OctopusDeployReleaseSettings.DeploymentCheckSleepCycle"/></em></p>
/// <p>Specifies how much time (timespan format) should elapse between deployment status checks (default 00:00:10).</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings SetDeploymentCheckSleepCycle(this OctopusDeployReleaseSettings toolSettings, string deploymentCheckSleepCycle)
{
toolSettings = toolSettings.NewInstance();
toolSettings.DeploymentCheckSleepCycle = deploymentCheckSleepCycle;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusDeployReleaseSettings.DeploymentCheckSleepCycle"/></em></p>
/// <p>Specifies how much time (timespan format) should elapse between deployment status checks (default 00:00:10).</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings ResetDeploymentCheckSleepCycle(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.DeploymentCheckSleepCycle = null;
return toolSettings;
}
#endregion
#region GuidedFailure
/// <summary>
/// <p><em>Sets <see cref="OctopusDeployReleaseSettings.GuidedFailure"/></em></p>
/// <p>Whether to use Guided Failure mode. (True or False. If not specified, will use default setting from environment).</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings SetGuidedFailure(this OctopusDeployReleaseSettings toolSettings, bool? guidedFailure)
{
toolSettings = toolSettings.NewInstance();
toolSettings.GuidedFailure = guidedFailure;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusDeployReleaseSettings.GuidedFailure"/></em></p>
/// <p>Whether to use Guided Failure mode. (True or False. If not specified, will use default setting from environment).</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings ResetGuidedFailure(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.GuidedFailure = null;
return toolSettings;
}
/// <summary>
/// <p><em>Enables <see cref="OctopusDeployReleaseSettings.GuidedFailure"/></em></p>
/// <p>Whether to use Guided Failure mode. (True or False. If not specified, will use default setting from environment).</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings EnableGuidedFailure(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.GuidedFailure = true;
return toolSettings;
}
/// <summary>
/// <p><em>Disables <see cref="OctopusDeployReleaseSettings.GuidedFailure"/></em></p>
/// <p>Whether to use Guided Failure mode. (True or False. If not specified, will use default setting from environment).</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings DisableGuidedFailure(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.GuidedFailure = false;
return toolSettings;
}
/// <summary>
/// <p><em>Toggles <see cref="OctopusDeployReleaseSettings.GuidedFailure"/></em></p>
/// <p>Whether to use Guided Failure mode. (True or False. If not specified, will use default setting from environment).</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings ToggleGuidedFailure(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.GuidedFailure = !toolSettings.GuidedFailure;
return toolSettings;
}
#endregion
#region SpecificMachines
/// <summary>
/// <p><em>Sets <see cref="OctopusDeployReleaseSettings.SpecificMachines"/> to a new list</em></p>
/// <p>A comma-separated list of machines names to target in the deployed environment. If not specified all machines in the environment will be considered.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings SetSpecificMachines(this OctopusDeployReleaseSettings toolSettings, params string[] specificMachines)
{
toolSettings = toolSettings.NewInstance();
toolSettings.SpecificMachinesInternal = specificMachines.ToList();
return toolSettings;
}
/// <summary>
/// <p><em>Sets <see cref="OctopusDeployReleaseSettings.SpecificMachines"/> to a new list</em></p>
/// <p>A comma-separated list of machines names to target in the deployed environment. If not specified all machines in the environment will be considered.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings SetSpecificMachines(this OctopusDeployReleaseSettings toolSettings, IEnumerable<string> specificMachines)
{
toolSettings = toolSettings.NewInstance();
toolSettings.SpecificMachinesInternal = specificMachines.ToList();
return toolSettings;
}
/// <summary>
/// <p><em>Adds values to <see cref="OctopusDeployReleaseSettings.SpecificMachines"/></em></p>
/// <p>A comma-separated list of machines names to target in the deployed environment. If not specified all machines in the environment will be considered.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings AddSpecificMachines(this OctopusDeployReleaseSettings toolSettings, params string[] specificMachines)
{
toolSettings = toolSettings.NewInstance();
toolSettings.SpecificMachinesInternal.AddRange(specificMachines);
return toolSettings;
}
/// <summary>
/// <p><em>Adds values to <see cref="OctopusDeployReleaseSettings.SpecificMachines"/></em></p>
/// <p>A comma-separated list of machines names to target in the deployed environment. If not specified all machines in the environment will be considered.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings AddSpecificMachines(this OctopusDeployReleaseSettings toolSettings, IEnumerable<string> specificMachines)
{
toolSettings = toolSettings.NewInstance();
toolSettings.SpecificMachinesInternal.AddRange(specificMachines);
return toolSettings;
}
/// <summary>
/// <p><em>Clears <see cref="OctopusDeployReleaseSettings.SpecificMachines"/></em></p>
/// <p>A comma-separated list of machines names to target in the deployed environment. If not specified all machines in the environment will be considered.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings ClearSpecificMachines(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.SpecificMachinesInternal.Clear();
return toolSettings;
}
/// <summary>
/// <p><em>Removes values from <see cref="OctopusDeployReleaseSettings.SpecificMachines"/></em></p>
/// <p>A comma-separated list of machines names to target in the deployed environment. If not specified all machines in the environment will be considered.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings RemoveSpecificMachines(this OctopusDeployReleaseSettings toolSettings, params string[] specificMachines)
{
toolSettings = toolSettings.NewInstance();
var hashSet = new HashSet<string>(specificMachines);
toolSettings.SpecificMachinesInternal.RemoveAll(x => hashSet.Contains(x));
return toolSettings;
}
/// <summary>
/// <p><em>Removes values from <see cref="OctopusDeployReleaseSettings.SpecificMachines"/></em></p>
/// <p>A comma-separated list of machines names to target in the deployed environment. If not specified all machines in the environment will be considered.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings RemoveSpecificMachines(this OctopusDeployReleaseSettings toolSettings, IEnumerable<string> specificMachines)
{
toolSettings = toolSettings.NewInstance();
var hashSet = new HashSet<string>(specificMachines);
toolSettings.SpecificMachinesInternal.RemoveAll(x => hashSet.Contains(x));
return toolSettings;
}
#endregion
#region Force
/// <summary>
/// <p><em>Sets <see cref="OctopusDeployReleaseSettings.Force"/></em></p>
/// <p>If a project is configured to skip packages with already-installed versions, override this setting to force re-deployment (flag, default false).</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings SetForce(this OctopusDeployReleaseSettings toolSettings, bool? force)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Force = force;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusDeployReleaseSettings.Force"/></em></p>
/// <p>If a project is configured to skip packages with already-installed versions, override this setting to force re-deployment (flag, default false).</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings ResetForce(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Force = null;
return toolSettings;
}
/// <summary>
/// <p><em>Enables <see cref="OctopusDeployReleaseSettings.Force"/></em></p>
/// <p>If a project is configured to skip packages with already-installed versions, override this setting to force re-deployment (flag, default false).</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings EnableForce(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Force = true;
return toolSettings;
}
/// <summary>
/// <p><em>Disables <see cref="OctopusDeployReleaseSettings.Force"/></em></p>
/// <p>If a project is configured to skip packages with already-installed versions, override this setting to force re-deployment (flag, default false).</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings DisableForce(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Force = false;
return toolSettings;
}
/// <summary>
/// <p><em>Toggles <see cref="OctopusDeployReleaseSettings.Force"/></em></p>
/// <p>If a project is configured to skip packages with already-installed versions, override this setting to force re-deployment (flag, default false).</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings ToggleForce(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Force = !toolSettings.Force;
return toolSettings;
}
#endregion
#region Skip
/// <summary>
/// <p><em>Sets <see cref="OctopusDeployReleaseSettings.Skip"/> to a new list</em></p>
/// <p>Skip a step by name.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings SetSkip(this OctopusDeployReleaseSettings toolSettings, params string[] skip)
{
toolSettings = toolSettings.NewInstance();
toolSettings.SkipInternal = skip.ToList();
return toolSettings;
}
/// <summary>
/// <p><em>Sets <see cref="OctopusDeployReleaseSettings.Skip"/> to a new list</em></p>
/// <p>Skip a step by name.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings SetSkip(this OctopusDeployReleaseSettings toolSettings, IEnumerable<string> skip)
{
toolSettings = toolSettings.NewInstance();
toolSettings.SkipInternal = skip.ToList();
return toolSettings;
}
/// <summary>
/// <p><em>Adds values to <see cref="OctopusDeployReleaseSettings.Skip"/></em></p>
/// <p>Skip a step by name.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings AddSkip(this OctopusDeployReleaseSettings toolSettings, params string[] skip)
{
toolSettings = toolSettings.NewInstance();
toolSettings.SkipInternal.AddRange(skip);
return toolSettings;
}
/// <summary>
/// <p><em>Adds values to <see cref="OctopusDeployReleaseSettings.Skip"/></em></p>
/// <p>Skip a step by name.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings AddSkip(this OctopusDeployReleaseSettings toolSettings, IEnumerable<string> skip)
{
toolSettings = toolSettings.NewInstance();
toolSettings.SkipInternal.AddRange(skip);
return toolSettings;
}
/// <summary>
/// <p><em>Clears <see cref="OctopusDeployReleaseSettings.Skip"/></em></p>
/// <p>Skip a step by name.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings ClearSkip(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.SkipInternal.Clear();
return toolSettings;
}
/// <summary>
/// <p><em>Removes values from <see cref="OctopusDeployReleaseSettings.Skip"/></em></p>
/// <p>Skip a step by name.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings RemoveSkip(this OctopusDeployReleaseSettings toolSettings, params string[] skip)
{
toolSettings = toolSettings.NewInstance();
var hashSet = new HashSet<string>(skip);
toolSettings.SkipInternal.RemoveAll(x => hashSet.Contains(x));
return toolSettings;
}
/// <summary>
/// <p><em>Removes values from <see cref="OctopusDeployReleaseSettings.Skip"/></em></p>
/// <p>Skip a step by name.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings RemoveSkip(this OctopusDeployReleaseSettings toolSettings, IEnumerable<string> skip)
{
toolSettings = toolSettings.NewInstance();
var hashSet = new HashSet<string>(skip);
toolSettings.SkipInternal.RemoveAll(x => hashSet.Contains(x));
return toolSettings;
}
#endregion
#region NoRawLog
/// <summary>
/// <p><em>Sets <see cref="OctopusDeployReleaseSettings.NoRawLog"/></em></p>
/// <p>Don't print the raw log of failed tasks.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings SetNoRawLog(this OctopusDeployReleaseSettings toolSettings, bool? noRawLog)
{
toolSettings = toolSettings.NewInstance();
toolSettings.NoRawLog = noRawLog;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusDeployReleaseSettings.NoRawLog"/></em></p>
/// <p>Don't print the raw log of failed tasks.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings ResetNoRawLog(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.NoRawLog = null;
return toolSettings;
}
/// <summary>
/// <p><em>Enables <see cref="OctopusDeployReleaseSettings.NoRawLog"/></em></p>
/// <p>Don't print the raw log of failed tasks.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings EnableNoRawLog(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.NoRawLog = true;
return toolSettings;
}
/// <summary>
/// <p><em>Disables <see cref="OctopusDeployReleaseSettings.NoRawLog"/></em></p>
/// <p>Don't print the raw log of failed tasks.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings DisableNoRawLog(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.NoRawLog = false;
return toolSettings;
}
/// <summary>
/// <p><em>Toggles <see cref="OctopusDeployReleaseSettings.NoRawLog"/></em></p>
/// <p>Don't print the raw log of failed tasks.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings ToggleNoRawLog(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.NoRawLog = !toolSettings.NoRawLog;
return toolSettings;
}
#endregion
#region RawLogFile
/// <summary>
/// <p><em>Sets <see cref="OctopusDeployReleaseSettings.RawLogFile"/></em></p>
/// <p>Redirect the raw log of failed tasks to a file.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings SetRawLogFile(this OctopusDeployReleaseSettings toolSettings, string rawLogFile)
{
toolSettings = toolSettings.NewInstance();
toolSettings.RawLogFile = rawLogFile;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusDeployReleaseSettings.RawLogFile"/></em></p>
/// <p>Redirect the raw log of failed tasks to a file.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings ResetRawLogFile(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.RawLogFile = null;
return toolSettings;
}
#endregion
#region Variables
/// <summary>
/// <p><em>Sets <see cref="OctopusDeployReleaseSettings.Variables"/> to a new dictionary</em></p>
/// <p>Values for any prompted variables. For JSON values, embedded quotation marks should be escaped with a backslash. </p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings SetVariables(this OctopusDeployReleaseSettings toolSettings, IDictionary<string, string> variables)
{
toolSettings = toolSettings.NewInstance();
toolSettings.VariablesInternal = variables.ToDictionary(x => x.Key, x => x.Value, StringComparer.OrdinalIgnoreCase);
return toolSettings;
}
/// <summary>
/// <p><em>Clears <see cref="OctopusDeployReleaseSettings.Variables"/></em></p>
/// <p>Values for any prompted variables. For JSON values, embedded quotation marks should be escaped with a backslash. </p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings ClearVariables(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.VariablesInternal.Clear();
return toolSettings;
}
/// <summary>
/// <p><em>Adds a new key-value-pair <see cref="OctopusDeployReleaseSettings.Variables"/></em></p>
/// <p>Values for any prompted variables. For JSON values, embedded quotation marks should be escaped with a backslash. </p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings AddVariable(this OctopusDeployReleaseSettings toolSettings, string variableKey, string variableValue)
{
toolSettings = toolSettings.NewInstance();
toolSettings.VariablesInternal.Add(variableKey, variableValue);
return toolSettings;
}
/// <summary>
/// <p><em>Removes a key-value-pair from <see cref="OctopusDeployReleaseSettings.Variables"/></em></p>
/// <p>Values for any prompted variables. For JSON values, embedded quotation marks should be escaped with a backslash. </p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings RemoveVariable(this OctopusDeployReleaseSettings toolSettings, string variableKey)
{
toolSettings = toolSettings.NewInstance();
toolSettings.VariablesInternal.Remove(variableKey);
return toolSettings;
}
/// <summary>
/// <p><em>Sets a key-value-pair in <see cref="OctopusDeployReleaseSettings.Variables"/></em></p>
/// <p>Values for any prompted variables. For JSON values, embedded quotation marks should be escaped with a backslash. </p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings SetVariable(this OctopusDeployReleaseSettings toolSettings, string variableKey, string variableValue)
{
toolSettings = toolSettings.NewInstance();
toolSettings.VariablesInternal[variableKey] = variableValue;
return toolSettings;
}
#endregion
#region DeployAt
/// <summary>
/// <p><em>Sets <see cref="OctopusDeployReleaseSettings.DeployAt"/></em></p>
/// <p>Time at which deployment should start (scheduled deployment), specified as any valid DateTimeOffset format, and assuming the time zone is the current local time zone.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings SetDeployAt(this OctopusDeployReleaseSettings toolSettings, string deployAt)
{
toolSettings = toolSettings.NewInstance();
toolSettings.DeployAt = deployAt;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusDeployReleaseSettings.DeployAt"/></em></p>
/// <p>Time at which deployment should start (scheduled deployment), specified as any valid DateTimeOffset format, and assuming the time zone is the current local time zone.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings ResetDeployAt(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.DeployAt = null;
return toolSettings;
}
#endregion
#region Tenant
/// <summary>
/// <p><em>Sets <see cref="OctopusDeployReleaseSettings.Tenant"/></em></p>
/// <p>Create a deployment for this tenant; specify this argument multiple times to add multiple tenants or use <c>*</c> wildcard to deploy to all tenants who are ready for this release (according to lifecycle).</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings SetTenant(this OctopusDeployReleaseSettings toolSettings, string tenant)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Tenant = tenant;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusDeployReleaseSettings.Tenant"/></em></p>
/// <p>Create a deployment for this tenant; specify this argument multiple times to add multiple tenants or use <c>*</c> wildcard to deploy to all tenants who are ready for this release (according to lifecycle).</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings ResetTenant(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Tenant = null;
return toolSettings;
}
#endregion
#region TenantTag
/// <summary>
/// <p><em>Sets <see cref="OctopusDeployReleaseSettings.TenantTag"/></em></p>
/// <p>Create a deployment for tenants matching this tag; specify this argument multiple times to build a query/filter with multiple tags, just like you can in the user interface.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings SetTenantTag(this OctopusDeployReleaseSettings toolSettings, string tenantTag)
{
toolSettings = toolSettings.NewInstance();
toolSettings.TenantTag = tenantTag;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusDeployReleaseSettings.TenantTag"/></em></p>
/// <p>Create a deployment for tenants matching this tag; specify this argument multiple times to build a query/filter with multiple tags, just like you can in the user interface.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings ResetTenantTag(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.TenantTag = null;
return toolSettings;
}
#endregion
#region Project
/// <summary>
/// <p><em>Sets <see cref="OctopusDeployReleaseSettings.Project"/></em></p>
/// <p>Name of the project.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings SetProject(this OctopusDeployReleaseSettings toolSettings, string project)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Project = project;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusDeployReleaseSettings.Project"/></em></p>
/// <p>Name of the project.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings ResetProject(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Project = null;
return toolSettings;
}
#endregion
#region DeployTo
/// <summary>
/// <p><em>Sets <see cref="OctopusDeployReleaseSettings.DeployTo"/></em></p>
/// <p>Environment to deploy to, e.g. <c>Production</c>.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings SetDeployTo(this OctopusDeployReleaseSettings toolSettings, string deployTo)
{
toolSettings = toolSettings.NewInstance();
toolSettings.DeployTo = deployTo;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusDeployReleaseSettings.DeployTo"/></em></p>
/// <p>Environment to deploy to, e.g. <c>Production</c>.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings ResetDeployTo(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.DeployTo = null;
return toolSettings;
}
#endregion
#region Version
/// <summary>
/// <p><em>Sets <see cref="OctopusDeployReleaseSettings.Version"/></em></p>
/// <p>Version number of the release to deploy. Or specify 'latest' for the latest release.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings SetVersion(this OctopusDeployReleaseSettings toolSettings, string version)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Version = version;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusDeployReleaseSettings.Version"/></em></p>
/// <p>Version number of the release to deploy. Or specify 'latest' for the latest release.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings ResetVersion(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Version = null;
return toolSettings;
}
#endregion
#region Channel
/// <summary>
/// <p><em>Sets <see cref="OctopusDeployReleaseSettings.Channel"/></em></p>
/// <p>Channel to use when getting the release to deploy</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings SetChannel(this OctopusDeployReleaseSettings toolSettings, string channel)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Channel = channel;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusDeployReleaseSettings.Channel"/></em></p>
/// <p>Channel to use when getting the release to deploy</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings ResetChannel(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Channel = null;
return toolSettings;
}
#endregion
#region UpdateVariables
/// <summary>
/// <p><em>Sets <see cref="OctopusDeployReleaseSettings.UpdateVariables"/></em></p>
/// <p>Overwrite the variable snapshot for the release by re-importing the variables from the project</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings SetUpdateVariables(this OctopusDeployReleaseSettings toolSettings, bool? updateVariables)
{
toolSettings = toolSettings.NewInstance();
toolSettings.UpdateVariables = updateVariables;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusDeployReleaseSettings.UpdateVariables"/></em></p>
/// <p>Overwrite the variable snapshot for the release by re-importing the variables from the project</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings ResetUpdateVariables(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.UpdateVariables = null;
return toolSettings;
}
/// <summary>
/// <p><em>Enables <see cref="OctopusDeployReleaseSettings.UpdateVariables"/></em></p>
/// <p>Overwrite the variable snapshot for the release by re-importing the variables from the project</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings EnableUpdateVariables(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.UpdateVariables = true;
return toolSettings;
}
/// <summary>
/// <p><em>Disables <see cref="OctopusDeployReleaseSettings.UpdateVariables"/></em></p>
/// <p>Overwrite the variable snapshot for the release by re-importing the variables from the project</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings DisableUpdateVariables(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.UpdateVariables = false;
return toolSettings;
}
/// <summary>
/// <p><em>Toggles <see cref="OctopusDeployReleaseSettings.UpdateVariables"/></em></p>
/// <p>Overwrite the variable snapshot for the release by re-importing the variables from the project</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings ToggleUpdateVariables(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.UpdateVariables = !toolSettings.UpdateVariables;
return toolSettings;
}
#endregion
#region Server
/// <summary>
/// <p><em>Sets <see cref="OctopusDeployReleaseSettings.Server"/></em></p>
/// <p>The base URL for your Octopus server - e.g., http://your-octopus/</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings SetServer(this OctopusDeployReleaseSettings toolSettings, string server)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Server = server;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusDeployReleaseSettings.Server"/></em></p>
/// <p>The base URL for your Octopus server - e.g., http://your-octopus/</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings ResetServer(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Server = null;
return toolSettings;
}
#endregion
#region ApiKey
/// <summary>
/// <p><em>Sets <see cref="OctopusDeployReleaseSettings.ApiKey"/></em></p>
/// <p>Your API key. Get this from the user profile page. Your must provide an apiKey or username and password. If the guest account is enabled, a key of API-GUEST can be used.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings SetApiKey(this OctopusDeployReleaseSettings toolSettings, string apiKey)
{
toolSettings = toolSettings.NewInstance();
toolSettings.ApiKey = apiKey;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusDeployReleaseSettings.ApiKey"/></em></p>
/// <p>Your API key. Get this from the user profile page. Your must provide an apiKey or username and password. If the guest account is enabled, a key of API-GUEST can be used.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings ResetApiKey(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.ApiKey = null;
return toolSettings;
}
#endregion
#region Username
/// <summary>
/// <p><em>Sets <see cref="OctopusDeployReleaseSettings.Username"/></em></p>
/// <p>Username to use when authenticating with the server. Your must provide an apiKey or username and password.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings SetUsername(this OctopusDeployReleaseSettings toolSettings, string username)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Username = username;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusDeployReleaseSettings.Username"/></em></p>
/// <p>Username to use when authenticating with the server. Your must provide an apiKey or username and password.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings ResetUsername(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Username = null;
return toolSettings;
}
#endregion
#region Password
/// <summary>
/// <p><em>Sets <see cref="OctopusDeployReleaseSettings.Password"/></em></p>
/// <p>Password to use when authenticating with the server.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings SetPassword(this OctopusDeployReleaseSettings toolSettings, string password)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Password = password;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusDeployReleaseSettings.Password"/></em></p>
/// <p>Password to use when authenticating with the server.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings ResetPassword(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Password = null;
return toolSettings;
}
#endregion
#region ConfigFile
/// <summary>
/// <p><em>Sets <see cref="OctopusDeployReleaseSettings.ConfigFile"/></em></p>
/// <p>Text file of default values, with one 'key = value' per line.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings SetConfigFile(this OctopusDeployReleaseSettings toolSettings, string configFile)
{
toolSettings = toolSettings.NewInstance();
toolSettings.ConfigFile = configFile;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusDeployReleaseSettings.ConfigFile"/></em></p>
/// <p>Text file of default values, with one 'key = value' per line.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings ResetConfigFile(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.ConfigFile = null;
return toolSettings;
}
#endregion
#region Debug
/// <summary>
/// <p><em>Sets <see cref="OctopusDeployReleaseSettings.Debug"/></em></p>
/// <p>Enable debug logging.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings SetDebug(this OctopusDeployReleaseSettings toolSettings, bool? debug)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Debug = debug;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusDeployReleaseSettings.Debug"/></em></p>
/// <p>Enable debug logging.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings ResetDebug(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Debug = null;
return toolSettings;
}
/// <summary>
/// <p><em>Enables <see cref="OctopusDeployReleaseSettings.Debug"/></em></p>
/// <p>Enable debug logging.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings EnableDebug(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Debug = true;
return toolSettings;
}
/// <summary>
/// <p><em>Disables <see cref="OctopusDeployReleaseSettings.Debug"/></em></p>
/// <p>Enable debug logging.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings DisableDebug(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Debug = false;
return toolSettings;
}
/// <summary>
/// <p><em>Toggles <see cref="OctopusDeployReleaseSettings.Debug"/></em></p>
/// <p>Enable debug logging.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings ToggleDebug(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Debug = !toolSettings.Debug;
return toolSettings;
}
#endregion
#region IgnoreSslErrors
/// <summary>
/// <p><em>Sets <see cref="OctopusDeployReleaseSettings.IgnoreSslErrors"/></em></p>
/// <p>Set this flag if your Octopus server uses HTTPS but the certificate is not trusted on this machine. Any certificate errors will be ignored. WARNING: this option may create a security vulnerability.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings SetIgnoreSslErrors(this OctopusDeployReleaseSettings toolSettings, bool? ignoreSslErrors)
{
toolSettings = toolSettings.NewInstance();
toolSettings.IgnoreSslErrors = ignoreSslErrors;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusDeployReleaseSettings.IgnoreSslErrors"/></em></p>
/// <p>Set this flag if your Octopus server uses HTTPS but the certificate is not trusted on this machine. Any certificate errors will be ignored. WARNING: this option may create a security vulnerability.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings ResetIgnoreSslErrors(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.IgnoreSslErrors = null;
return toolSettings;
}
/// <summary>
/// <p><em>Enables <see cref="OctopusDeployReleaseSettings.IgnoreSslErrors"/></em></p>
/// <p>Set this flag if your Octopus server uses HTTPS but the certificate is not trusted on this machine. Any certificate errors will be ignored. WARNING: this option may create a security vulnerability.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings EnableIgnoreSslErrors(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.IgnoreSslErrors = true;
return toolSettings;
}
/// <summary>
/// <p><em>Disables <see cref="OctopusDeployReleaseSettings.IgnoreSslErrors"/></em></p>
/// <p>Set this flag if your Octopus server uses HTTPS but the certificate is not trusted on this machine. Any certificate errors will be ignored. WARNING: this option may create a security vulnerability.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings DisableIgnoreSslErrors(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.IgnoreSslErrors = false;
return toolSettings;
}
/// <summary>
/// <p><em>Toggles <see cref="OctopusDeployReleaseSettings.IgnoreSslErrors"/></em></p>
/// <p>Set this flag if your Octopus server uses HTTPS but the certificate is not trusted on this machine. Any certificate errors will be ignored. WARNING: this option may create a security vulnerability.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings ToggleIgnoreSslErrors(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.IgnoreSslErrors = !toolSettings.IgnoreSslErrors;
return toolSettings;
}
#endregion
#region EnableServiceMessages
/// <summary>
/// <p><em>Sets <see cref="OctopusDeployReleaseSettings.EnableServiceMessages"/></em></p>
/// <p>Enable TeamCity or Team Foundation Build service messages when logging.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings SetEnableServiceMessages(this OctopusDeployReleaseSettings toolSettings, bool? enableServiceMessages)
{
toolSettings = toolSettings.NewInstance();
toolSettings.EnableServiceMessages = enableServiceMessages;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusDeployReleaseSettings.EnableServiceMessages"/></em></p>
/// <p>Enable TeamCity or Team Foundation Build service messages when logging.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings ResetEnableServiceMessages(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.EnableServiceMessages = null;
return toolSettings;
}
/// <summary>
/// <p><em>Enables <see cref="OctopusDeployReleaseSettings.EnableServiceMessages"/></em></p>
/// <p>Enable TeamCity or Team Foundation Build service messages when logging.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings EnableEnableServiceMessages(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.EnableServiceMessages = true;
return toolSettings;
}
/// <summary>
/// <p><em>Disables <see cref="OctopusDeployReleaseSettings.EnableServiceMessages"/></em></p>
/// <p>Enable TeamCity or Team Foundation Build service messages when logging.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings DisableEnableServiceMessages(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.EnableServiceMessages = false;
return toolSettings;
}
/// <summary>
/// <p><em>Toggles <see cref="OctopusDeployReleaseSettings.EnableServiceMessages"/></em></p>
/// <p>Enable TeamCity or Team Foundation Build service messages when logging.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings ToggleEnableServiceMessages(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.EnableServiceMessages = !toolSettings.EnableServiceMessages;
return toolSettings;
}
#endregion
#region Timeout
/// <summary>
/// <p><em>Sets <see cref="OctopusDeployReleaseSettings.Timeout"/></em></p>
/// <p>Timeout in seconds for network operations. Default is 600.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings SetTimeout(this OctopusDeployReleaseSettings toolSettings, int? timeout)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Timeout = timeout;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusDeployReleaseSettings.Timeout"/></em></p>
/// <p>Timeout in seconds for network operations. Default is 600.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings ResetTimeout(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Timeout = null;
return toolSettings;
}
#endregion
#region Proxy
/// <summary>
/// <p><em>Sets <see cref="OctopusDeployReleaseSettings.Proxy"/></em></p>
/// <p>The URI of the proxy to use, e.g., http://example.com:8080.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings SetProxy(this OctopusDeployReleaseSettings toolSettings, string proxy)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Proxy = proxy;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusDeployReleaseSettings.Proxy"/></em></p>
/// <p>The URI of the proxy to use, e.g., http://example.com:8080.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings ResetProxy(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Proxy = null;
return toolSettings;
}
#endregion
#region ProxyUsername
/// <summary>
/// <p><em>Sets <see cref="OctopusDeployReleaseSettings.ProxyUsername"/></em></p>
/// <p>The username for the proxy.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings SetProxyUsername(this OctopusDeployReleaseSettings toolSettings, string proxyUsername)
{
toolSettings = toolSettings.NewInstance();
toolSettings.ProxyUsername = proxyUsername;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusDeployReleaseSettings.ProxyUsername"/></em></p>
/// <p>The username for the proxy.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings ResetProxyUsername(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.ProxyUsername = null;
return toolSettings;
}
#endregion
#region ProxyPassword
/// <summary>
/// <p><em>Sets <see cref="OctopusDeployReleaseSettings.ProxyPassword"/></em></p>
/// <p>The password for the proxy. If both the username and password are omitted and proxyAddress is specified, the default credentials are used.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings SetProxyPassword(this OctopusDeployReleaseSettings toolSettings, string proxyPassword)
{
toolSettings = toolSettings.NewInstance();
toolSettings.ProxyPassword = proxyPassword;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusDeployReleaseSettings.ProxyPassword"/></em></p>
/// <p>The password for the proxy. If both the username and password are omitted and proxyAddress is specified, the default credentials are used.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings ResetProxyPassword(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.ProxyPassword = null;
return toolSettings;
}
#endregion
#region Space
/// <summary>
/// <p><em>Sets <see cref="OctopusDeployReleaseSettings.Space"/></em></p>
/// <p>The name of a space within which this command will be executed. The default space will be used if it is omitted.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings SetSpace(this OctopusDeployReleaseSettings toolSettings, string space)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Space = space;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusDeployReleaseSettings.Space"/></em></p>
/// <p>The name of a space within which this command will be executed. The default space will be used if it is omitted.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings ResetSpace(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.Space = null;
return toolSettings;
}
#endregion
#region LogLevel
/// <summary>
/// <p><em>Sets <see cref="OctopusDeployReleaseSettings.LogLevel"/></em></p>
/// <p>The log level. Valid options are verbose, debug, information, warning, error and fatal. Defaults to 'debug'.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings SetLogLevel(this OctopusDeployReleaseSettings toolSettings, string logLevel)
{
toolSettings = toolSettings.NewInstance();
toolSettings.LogLevel = logLevel;
return toolSettings;
}
/// <summary>
/// <p><em>Resets <see cref="OctopusDeployReleaseSettings.LogLevel"/></em></p>
/// <p>The log level. Valid options are verbose, debug, information, warning, error and fatal. Defaults to 'debug'.</p>
/// </summary>
[Pure]
public static OctopusDeployReleaseSettings ResetLogLevel(this OctopusDeployReleaseSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.LogLevel = null;
return toolSettings;
}
#endregion
}
#endregion
#region OctopusPackFormat
/// <summary>
/// Used within <see cref="OctopusTasks"/>.
/// </summary>
[PublicAPI]
[Serializable]
[ExcludeFromCodeCoverage]
[TypeConverter(typeof(TypeConverter<OctopusPackFormat>))]
public partial class OctopusPackFormat : Enumeration
{
public static OctopusPackFormat NuPkg = (OctopusPackFormat) "NuPkg";
public static OctopusPackFormat Zip = (OctopusPackFormat) "Zip";
public static explicit operator OctopusPackFormat(string value)
{
return new OctopusPackFormat { Value = value };
}
}
#endregion
}
| 52.348833 | 796 | 0.619541 | [
"MIT"
] | ElijahReva/nuke | source/Nuke.Common/Tools/Octopus/Octopus.Generated.cs | 273,575 | C# |
using System;
using Android.App;
using Android.Content.PM;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;
namespace Flowers.Forms.Droid
{
[Activity(Label = "Flowers.Forms", Icon = "@drawable/icon", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsApplicationActivity
{
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
global::Xamarin.Forms.Forms.Init(this, bundle);
LoadApplication(new App());
}
}
}
| 26.56 | 162 | 0.695783 | [
"MIT"
] | lbugnion/sample-2015-bbv | Flowers - Start/Flowers.Forms/Flowers.Forms.Droid/MainActivity.cs | 666 | C# |
/*
* Copyright (c) 2018 THL A29 Limited, a Tencent company. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
namespace TencentCloud.Dbbrain.V20191016.Models
{
using Newtonsoft.Json;
using System.Collections.Generic;
using TencentCloud.Common;
public class DescribeMailProfileRequest : AbstractModel
{
/// <summary>
/// 配置类型,支持值包括:"dbScan_mail_configuration" - 数据库巡检邮件配置,"scheduler_mail_configuration" - 定期生成邮件配置。
/// </summary>
[JsonProperty("ProfileType")]
public string ProfileType{ get; set; }
/// <summary>
/// 服务产品类型,支持值包括: "mysql" - 云数据库 MySQL, "cynosdb" - 云数据库 TDSQL-C for MySQL,默认为"mysql"。
/// </summary>
[JsonProperty("Product")]
public string Product{ get; set; }
/// <summary>
/// 分页偏移量。
/// </summary>
[JsonProperty("Offset")]
public long? Offset{ get; set; }
/// <summary>
/// 分页单位,最大支持50。
/// </summary>
[JsonProperty("Limit")]
public long? Limit{ get; set; }
/// <summary>
/// 根据邮件配置名称查询,定期发送的邮件配置名称遵循:"scheduler_"+{instanceId}的规则。
/// </summary>
[JsonProperty("ProfileName")]
public string ProfileName{ get; set; }
/// <summary>
/// For internal usage only. DO NOT USE IT.
/// </summary>
public override void ToMap(Dictionary<string, string> map, string prefix)
{
this.SetParamSimple(map, prefix + "ProfileType", this.ProfileType);
this.SetParamSimple(map, prefix + "Product", this.Product);
this.SetParamSimple(map, prefix + "Offset", this.Offset);
this.SetParamSimple(map, prefix + "Limit", this.Limit);
this.SetParamSimple(map, prefix + "ProfileName", this.ProfileName);
}
}
}
| 33.125 | 105 | 0.617191 | [
"Apache-2.0"
] | TencentCloud/tencentcloud-sdk-dotnet | TencentCloud/Dbbrain/V20191016/Models/DescribeMailProfileRequest.cs | 2,589 | C# |
/*
* DocuSign REST API
*
* The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign.
*
* OpenAPI spec version: v2
* Contact: devcenter@docusign.com
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*/
using System;
using System.Linq;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.ComponentModel.DataAnnotations;
namespace DocuSign.eSign.Model
{
/// <summary>
/// Defines a billing plan response object.
/// </summary>
[DataContract]
public partial class BillingPlanResponse : IEquatable<BillingPlanResponse>, IValidatableObject
{
public BillingPlanResponse()
{
// Empty Constructor
}
/// <summary>
/// Initializes a new instance of the <see cref="BillingPlanResponse" /> class.
/// </summary>
/// <param name="BillingPlan">BillingPlan.</param>
/// <param name="SuccessorPlans">.</param>
public BillingPlanResponse(BillingPlan BillingPlan = default(BillingPlan), List<BillingPlan> SuccessorPlans = default(List<BillingPlan>))
{
this.BillingPlan = BillingPlan;
this.SuccessorPlans = SuccessorPlans;
}
/// <summary>
/// Gets or Sets BillingPlan
/// </summary>
[DataMember(Name="billingPlan", EmitDefaultValue=false)]
public BillingPlan BillingPlan { get; set; }
/// <summary>
///
/// </summary>
/// <value></value>
[DataMember(Name="successorPlans", EmitDefaultValue=false)]
public List<BillingPlan> SuccessorPlans { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
var sb = new StringBuilder();
sb.Append("class BillingPlanResponse {\n");
sb.Append(" BillingPlan: ").Append(BillingPlan).Append("\n");
sb.Append(" SuccessorPlans: ").Append(SuccessorPlans).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public string ToJson()
{
return JsonConvert.SerializeObject(this, Formatting.Indented);
}
/// <summary>
/// Returns true if objects are equal
/// </summary>
/// <param name="obj">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object obj)
{
// credit: http://stackoverflow.com/a/10454552/677735
return this.Equals(obj as BillingPlanResponse);
}
/// <summary>
/// Returns true if BillingPlanResponse instances are equal
/// </summary>
/// <param name="other">Instance of BillingPlanResponse to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(BillingPlanResponse other)
{
// credit: http://stackoverflow.com/a/10454552/677735
if (other == null)
return false;
return
(
this.BillingPlan == other.BillingPlan ||
this.BillingPlan != null &&
this.BillingPlan.Equals(other.BillingPlan)
) &&
(
this.SuccessorPlans == other.SuccessorPlans ||
this.SuccessorPlans != null &&
this.SuccessorPlans.SequenceEqual(other.SuccessorPlans)
);
}
/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
// credit: http://stackoverflow.com/a/263416/677735
unchecked // Overflow is fine, just wrap
{
int hash = 41;
// Suitable nullity checks etc, of course :)
if (this.BillingPlan != null)
hash = hash * 59 + this.BillingPlan.GetHashCode();
if (this.SuccessorPlans != null)
hash = hash * 59 + this.SuccessorPlans.GetHashCode();
return hash;
}
}
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
{
yield break;
}
}
}
| 34.104895 | 145 | 0.572688 | [
"MIT"
] | CameronLoewen/docusign-csharp-client | sdk/src/DocuSign.eSign/Model/BillingPlanResponse.cs | 4,877 | C# |
using System;
class Program
{
static void Main()
{
int n = 3;
int[] arr = new int[n];
for (int i = 0; i < arr.Length; i++)
{
arr[i] = i + 1;
}
Permutation(arr, 0);
}
private static void Permutation(int[] arr, int index)
{
if (index == arr.Length)
{
Console.WriteLine(string.Join(", ", arr));
return;
}
for (int i = index; i < arr.Length; i++)
{
Swap(arr, i, index);
Permutation(arr, index + 1);
Swap(arr, i, index);
}
}
private static void Swap(int[] arr, int i, int j)
{
int temp = arr[i];
arr[i] = arr[j];
arr[j] = temp;
}
} | 19.487179 | 57 | 0.419737 | [
"MIT"
] | evlogihr/TelerikAcademy-Exercises | Workshop-Arrays/Permutations/Program.cs | 762 | C# |
namespace LogicMonitor.Provisioning.Config;
public abstract class NamedItem
{
public string Name { get; set; } = string.Empty;
}
| 18.714286 | 49 | 0.763359 | [
"MIT"
] | PanoramicDag/LogicMonitor.Provisioning | LogicMonitor.Provisioning/Config/NamedItem.cs | 131 | C# |
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using SeresProducoes.Models;
namespace SeresProducoes.Migrations
{
[DbContext(typeof(AppDbContext))]
[Migration("20200316224410_MinorUpdates")]
partial class MinorUpdates
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "2.2.6-servicing-10079")
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("SeresProducoes.Models.Article", b =>
{
b.Property<int>("Id");
b.Property<string>("Content");
b.Property<DateTime>("Date");
b.Property<string>("Headline");
b.Property<string>("Image");
b.Property<string>("Link");
b.HasKey("Id");
b.ToTable("Articles");
b.HasData(
new
{
Id = 1,
Content = "Alexandros Djkevingr & Greg Ignatovich (Parquet Recordings, Diynamic) from Greek came up with the idea for a big collaboration that unites different countries and music styles from all over the world...",
Date = new DateTime(2020, 2, 29, 0, 0, 0, 0, DateTimeKind.Unspecified),
Headline = "Music can unite and spread more...",
Image = "/images/articles/n01.jpeg",
Link = "https://medium.com/@seresproducoes/alexandros-djkevingr-greg-ignatovich-vs-bruce-leroys-and-daniel-rateuke-that-music-can-9cac40c4d013"
},
new
{
Id = 2,
Content = "Drunky Daniels estão de Volta depois do Album ‘’Zabumba’’ lancado no ano passado com destaque na Mixmag, Bantumen e muito outros magazines. A Seres Producões apresenta o seu mais recente Single dos Drunky Daniels, com origens bem brasileiras viajando por drums africanos...",
Date = new DateTime(2020, 2, 19, 0, 0, 0, 0, DateTimeKind.Unspecified),
Headline = "Curitiba on Afro House map with the Brazilian duo Drunky Daniels.",
Image = "/images/articles/n02.jpeg",
Link = "https://medium.com/@seresproducoes/curitiba-on-afro-house-map-with-the-brazilian-duo-drunky-daniels-617e22f2cfeb"
},
new
{
Id = 3,
Content = "There’s something in the Two Strong duo, that’s making their music growing each day at the Angolan music scene and places around the world...",
Date = new DateTime(2020, 2, 15, 0, 0, 0, 0, DateTimeKind.Unspecified),
Headline = "Duo Two Strong starting the year in Force.",
Image = "/images/articles/n03.jpeg",
Link = "https://medium.com/@seresproducoes/duo-two-strong-starting-the-year-in-force-37cfa7480f39"
},
new
{
Id = 4,
Content = "Tswelelo ‘Tswex’ Malabola is a self taught underground house music producer.The diversity in his sound comes from the inspiration brought by listening to different genres. His love for house music started from an early age of 11 years and following that, he was able to start producing as well...",
Date = new DateTime(2020, 2, 6, 0, 0, 0, 0, DateTimeKind.Unspecified),
Headline = "“Can’t Stay Away EP” Tswex Malabola!",
Image = "/images/articles/n04.jpeg",
Link = "https://medium.com/@seresproducoes/cant-stay-away-ep-tswex-malabola-ff37e96bcec2"
},
new
{
Id = 5,
Content = "Sonar born of African-Shangani descent in Cottondale Acornhoek Bushbuckridge. Sonar loved to sing and make music and his teacher would constantly cite him for disturbing the peace of the classroom through his spontaneous need to tap rhythms on whatever he had on hand...",
Date = new DateTime(2020, 2, 3, 0, 0, 0, 0, DateTimeKind.Unspecified),
Headline = "Today Sonar has his fingerprints in our humble home.",
Image = "/images/articles/n05.jpeg",
Link = "https://medium.com/@seresproducoes/today-sonar-has-his-fingerprints-in-our-humble-home-3783cc9e20ba"
});
});
modelBuilder.Entity("SeresProducoes.Models.Artist", b =>
{
b.Property<int>("Id");
b.Property<string>("Bio");
b.Property<string>("FacebookLink");
b.Property<string>("Image");
b.Property<string>("Name");
b.Property<string>("SoundCloudLink");
b.Property<string>("TwitterLink");
b.HasKey("Id");
b.ToTable("Artists");
b.HasData(
new
{
Id = 1,
Bio = "Danykas Dj was born in Lisbon, Portugal. The love of music has always been a constant in her life, atmosphere felt early on in their home. A musical spirit cultivated by her father, a passion that exists in the whole family. Never leaving the corners of her room, in 2015 comes the first invitation to expose itself to the public in the Room System Project at Casa Independente, Lisbon ,held by Seres Producoes where she's working currently. Was the place where she could express her vibes through the simbiose of Afro Electronic Music and Deep House. The desire was increasing, the willingness to take the aspect of music more 'serious' as well, which allowed her to go through places like Lux Frágil, Festival Musa Cascais, Douro Rock Festival, Maus Hábitos, Musicbox Lisboa, two clubs in UK and host a Show at Quântica Rádio invited by Violet.",
FacebookLink = "https://www.facebook.com/danykasdj/",
Image = "/images/artists/DANYKAS.jpg",
Name = "DANYKAS DJ",
SoundCloudLink = "https://soundcloud.com/danykasdj",
TwitterLink = "https://twitter.com/danykasdj"
},
new
{
Id = 2,
Bio = "DJ Satelite, a native of Luanda, started his career by raw, passionate curiosity and quickly became one of the main drivers of Afro House and Kuduro in many lusophone countries. After dedicating years on his own productions, in 2006 he achieved notoriety as one of the co-producers of the album Estado Maior do Kuduro dos Lambas. It is also known as the first album produced by a local artist and gained stellar reviews in Angola. In particular, the hit single, ‘Se desfio’ conquered the hearts of a huge fan base. Satelite’s productions have been featured on the critically acclaimed film ‘I Love Kuduro’. Internationally acclaimed as one of the most prominent Angolan beatmakers, He also launched his own record label, Seres Produções in order to expose extraordinary music, including his new release ‘If Only’ with the Moroccan producer Cee ElAssaad. 2016 was an exceptional year of top quality releases with additional productions such as ‘Malembe na Soukouss’, ‘Abantu’ & ‘Xe Mana Bella’. Including collaborations with Ancestral Soul master Boddhi Satva and the unique voice of Freddy Massamba, released by the globally recognized label Offering Recordings. Satelite’s journey has taken him to some of the biggest events and organizations, such as Red Bull Music Academy and the Ibiza International Music Summit. He also got to show his live skills on Boiler Room, alongside Batida. He has also graced some established and innovative festivals such as Sfinks Festival, AfricaNouveau and the Ten Cities project. He has played for the legendary British DJ Fatboy Slim. DJ Satelite is an ambassador of the new Angolan sound and a pioneer of the African Electronic Music scene that burns dance floors all across the globe.",
FacebookLink = "https://www.facebook.com/OfficialDJSatelite",
Image = "/images/artists/SATELITE.jpg",
Name = "DJ Satelite",
SoundCloudLink = "https://soundcloud.com/djsatelite",
TwitterLink = "https://twitter.com/djsatelite_"
},
new
{
Id = 3,
Bio = "Inami is an Artist/Singer/Songwriter/performer/instrumentalist/producer/vocal trainer based in Africa (Nairobi – Kenya). INAMI simply means the Inner me and stands for IN me African Music Inspired. Internationally acclaimed as the first Lady of Equatorial House Music, Inami is a passionate and driven Kenyan musician who is slowly taking over and further strengthening its position, in the movement of house music in Nairobi to the world. Her first release was in February 2013 where she collaborated with Boneless (A Kenyan kamba House artist) on the song ‘Supasta’, produced by Saint Evo. The song was a Kamba tune based on the notion, that all people are born superstars and we can achieve that status, only if we believe in ourselves. Her smooth vocals and catchy hook in collaboration with Boneless’ rapping drove the track and made it a hit. A follow up video to ‘Supasta’ was released thereafter. With the great reception locally and airplay from radio to TV stations, the track ushered Inami into the Kenyan music scene. Mid 2013 saw the release of her first Equatorial House music Debut EP Album, under Celsius Degree Entertainment, titled Little Lost. The EP was inspired by the theme Love, peace and music and is made up of four songs which include: Little Lost, Constant Craving, Musiq Lingo and Peace. The Ep received great reviews and air play both locally and internationally, from Nairobi to Nigeria, DRC, Colombia, New Delhi, Australia and London. She later that year dropped a single titled “Don’t Look Back” – a soulful house track it’s a jazzy feel, that talked about not letting the past define who we are instead focus on the purpose that we resolved to effect in our futures. ‘Don’t Look Back’ is produced by Marcus Ezra, a drum & bass, house, electronic, progressive and retro music producer and artist of soul Bros Records. In 2014 she was officially signed on to Celsius Degree Entertainment, being the first signed artist of the label. She then released a follow up to the Little lost Ep: Part 2, titled “Little Lost Re-incarnation” which was made up of seven songs and a stunning video of the single titled “constant craving” to her debut EP, Little Lost. The songs included: Little Lost (Acoustic mix) which she co-produced with Saint Evo The Myth, Whispers of Love, Became Mucho(House Version), Constant Craving (Saint Evo’s Lounge Mix), Little Lost(Brackish Remix), Music Lingo (Reprise mix) and Jole. Mid 2014, the hit track ‘supasta’s official remix by Saint Evo was released. In 2015, Inami released an EP titled “Burn Hard” which comprised of the original mix by Saint Evo The Myth and a remix by Melo Mokoena, a producer and artist of Soul Candi Records. The EP was inspired by the theme ‘Love gone sour’ In 2016, the single “constant Craving” was remixed by The Exchange Project, an initiative made up of producers from Angola, Sierra Leone and Kenya aimed at bridging borders with sound. Inami also feature in a song titled, “Mapenzi” on Saint Evo The Myth’s ‘Early Years EP. In April 2016 she featured on Saint Evo’s EP “The Vika Vu EP” that consists of two tracks, namely, “Vika Vu” & “On My Way Home”, featuring the sultry vocals and creative writing of the First Lady Of Equatorial House, Inami. The EP was inspired by the theme, life’s Journey that talked about the firm resolve on a determined soul on a journey to greatness. The EP went global, courtesy of Seres Producoes, a record label in Angola making it available on traxsource, iTunes, Google Play, spotify, YouTube, beatport, junodownload and tidal. Following the Vika Vu Ep, Inami collaborated on a hit single titled ‘All OR Nothing’ produced by DJ Leah SA, a house producer from South Africa that was recently released under Seres Producoes and is now available on traxsource, iTunes, Google Play, Amazon, spotify, YouTube, beatport, junodownload, tidal and deezer. 2016 and 2017 were set to be exceptional years with forth coming releases, an Album as well as her own productions.",
FacebookLink = "https://www.facebook.com/inamikenya/",
Image = "/images/artists/INAMI.jpg",
Name = "INAMI",
SoundCloudLink = "https://soundcloud.com/inami-3",
TwitterLink = "https://twitter.com/fi_inami "
},
new
{
Id = 4,
Bio = "K.O.D is a Producer| Artist| Songwriter| Entrepreneur| Philanthropist| Re-mixer and Poet currently residing in Bulawayo (Zimbabwe). Born in Simbarashe Kodzai on August 06 1990, he was introduced to House music in 2003 and was provided the opportunity to record in 2005. He went on to start making his own production in 2008 because he wanted to have full control of his career and creativity. Determined to make a break on the House scene he joined forces with Herbal 3 Records based in South Africa releasing smash hits In The Name Of love and Iculo Lothando which did well on the local scene. Determined to break into the international market he aligns himself with Seres Producoes a record label based in Luanda (Angola). He is heavily influenced by the likes of Kanye West, Grego Salto, Oskido, Black Coffee, Euphonic, Dj Fresh Sa, Ganyani, and Black Motion in the same level of work ethic. K.O.D (King Of Drums) is a self motivated individual, hard working and God fearing, set to change his life and of those around him with his musical gift.",
FacebookLink = "https://www.facebook.com/KODworldwide/",
Image = "/images/artists/KOD.jpg",
Name = "K.O.D",
SoundCloudLink = "https://soundcloud.com/kod_worldwide",
TwitterLink = "https://twitter.com/KOD_worldwide"
},
new
{
Id = 5,
Bio = "Rosario, born in Luanda, Angola. Made his debut in the world of House Music in 2011 posting sets of Afro House on soundcloud by the Mbambu Records group ( with Dj Nax and Braga Havaiana). Later in 2012 he joined “Tainted House Records”, based in South Africa, where he released several projects such as “Kalunga Kianda” with Braga Havaina and “Destiny” with Jackie Queens.And several remixes on tracks like “Roots” and “Tyityimba” authored by Rune Sibiya, and “You Don’t Deserve Me” by Reel Skaps(Global Deep Recordings). Currently in Mbambu Records group known as the author of the hits songs “Me Mata” (with Dj Jesus) and “Tatau” (with Bebucho Q Kuia), and other projects that are having a high impact on today’s african house scene. Later he meets with Dj Satelite on the record label ”Seres Produções” from Angola, becoming a member on the label, releasing tracks in collaboration with South African artists like Jackie Queens and Lebo Snookums with whom he released the single ‘Silly Of Me” and other projects.",
FacebookLink = "https://www.facebook.com/Rosariokalenga",
Image = "/images/artists/ROSARIO.jpg",
Name = "ROSARIO",
SoundCloudLink = "https://soundcloud.com/rosariokalenga",
TwitterLink = "https://twitter.com/rosariokalenga"
},
new
{
Id = 6,
Bio = "(Felisberto Arthur) a young Talented, born in Luanda (Angola), Dj and producer of Music house which his name does not ass unnoticed in the Angolan music, specifically in the style house Music. His passion for the art of music began at age 14 and had as their major influences artists like John Legend, Atjazz, Salif Keita, Michael Jackson, Dennis Ferrer, Bob Sinclar, Phil Collins, Kassav, Daft Punk and many others. In his career as a music producer, went through many styles including: Kuduro, Rap, Kizomba and finally his passion for art quickened in House music. Considered as one of the mentors of souful style and african - house in Angola. His remixes and His songs touch on several radio and television channels, having already launched several themes on various labels such as: Arrecha Records, Oluwki Music, “Seres Produções (where he is currently a member and partner), and many others. Throughout his career, Wilson has been present in Several bars and clubs COUNTRY and beyond. In 2012 he decided to join with other Angolan producer name Tiuze Money, with whom he formed the label VOZES QUENTES, where launched and have launched many musical themes rolling in Angola and in the world outside is expected to more than double in the coming months and years, and it is believed that could be heading for a great way to success!",
FacebookLink = "https://www.facebook.com/djwilsonkentura",
Image = "/images/artists/WILSON.jpg",
Name = "WILSON KENTURA",
SoundCloudLink = "https://soundcloud.com/wilson-kentura",
TwitterLink = "https://twitter.com/wilsonkentura"
});
});
modelBuilder.Entity("SeresProducoes.Models.Event", b =>
{
b.Property<int>("Id");
b.Property<DateTime>("Date");
b.Property<string>("DescriptiveDate");
b.Property<string>("Host");
b.Property<string>("Image");
b.Property<string>("Link");
b.Property<string>("Name");
b.HasKey("Id");
b.ToTable("Events");
b.HasData(
new
{
Id = 1,
Date = new DateTime(2020, 2, 27, 0, 0, 0, 0, DateTimeKind.Unspecified),
DescriptiveDate = "Thursday, February 27, 2020 at 11:59 PM – 6 AM UTC",
Host = "Hosted by Seres Produções, MUSICBOX LISBOA, DJ Satelite, DANYKAS DJ",
Image = "/images/events/e1.jpg",
Name = "DJ Satelite + Danykas DJ"
},
new
{
Id = 2,
Date = new DateTime(2020, 1, 16, 0, 0, 0, 0, DateTimeKind.Unspecified),
DescriptiveDate = "Thursday, January 16, 2020 at 11:45 PM – 6 AM UTC",
Host = "Hosted by Lux Frágil and Batida",
Image = "/images/events/e2.jpg",
Name = "Batida b2b Satelite"
},
new
{
Id = 3,
Date = new DateTime(2020, 1, 9, 0, 0, 0, 0, DateTimeKind.Unspecified),
DescriptiveDate = "Thursday, January 9, 2020 at 11:45 PM – 6 AM UTC",
Host = "Hosted by Lux Frágil and Rádio Quântica",
Image = "/images/events/e3.jpg",
Name = "Rádio Quântica: Lsdxoxo x Danykas x Prec x Poly Garbo x Pachinko"
},
new
{
Id = 4,
Date = new DateTime(2019, 12, 14, 0, 0, 0, 0, DateTimeKind.Unspecified),
DescriptiveDate = "Saturday, December 14, 2019 at 11:55 PM – 6 AM UTC",
Host = "Hosted by Room System, Village Underground Lisboa",
Image = "/images/events/e4.jpg",
Link = "https://www.residentadvisor.net/events/1348378?fbclid=IwAR2VzS6jFFBotx6I3p1KO2MnzrpkWcocCjgakDZpr1oHT7zR4sfpKGorONU.",
Name = "Room System #8"
});
});
modelBuilder.Entity("SeresProducoes.Models.Release", b =>
{
b.Property<int>("Id");
b.Property<string>("Artist");
b.Property<string>("Image");
b.Property<string>("Link");
b.Property<string>("Title");
b.HasKey("Id");
b.ToTable("Releases");
b.HasData(
new
{
Id = 1,
Artist = "ERAN YAARI",
Image = "/images/releases/1_Komanta.jpg",
Link = "https://www.traxsource.com/title/1288428/komanta",
Title = "KOMANTA"
},
new
{
Id = 2,
Artist = "SATELITE & K.O.D",
Image = "/images/releases/2_Zona.jpg",
Link = "https://www.traxsource.com/title/1288476/zona-vermelha",
Title = "ZONA VERMELHA"
},
new
{
Id = 3,
Artist = "ALEXANDROS DJKEVINGR & GREG IGNATOVICH, BRUCE LEROYS, DANIEL RATEUK",
Image = "/images/releases/3_BlackCurse.jpg",
Link = "https://www.traxsource.com/title/1288475/black-curse-of-sarapast",
Title = "BLACK CURSE OF SARAPAST"
},
new
{
Id = 4,
Artist = "DRUNKY DANIELS",
Image = "/images/releases/4_Janaina.jpg",
Link = "https://www.traxsource.com/title/1280077/janaina",
Title = "JANAINA"
},
new
{
Id = 5,
Artist = "TSWEX MALABOLA",
Image = "/images/releases/5_CantStayAway.jpg",
Link = "https://www.traxsource.com/title/1272414/cant-stay-away-ep",
Title = "CAN'T STAY AWAY EP"
},
new
{
Id = 6,
Artist = "2 STRONG",
Image = "/images/releases/6_obcecado.jpg",
Link = "https://www.traxsource.com/title/1281222/obcecado-ep",
Title = "OBCECADO EP"
},
new
{
Id = 7,
Artist = "ROSARIO",
Image = "/images/releases/7_mojo.jpg",
Link = "https://www.traxsource.com/title/1264053/mojo",
Title = "MOJO"
},
new
{
Id = 8,
Artist = "SONAR ft. TIKWE",
Image = "/images/releases/8_MoreLife.jpg",
Link = "https://www.traxsource.com/title/1272046/more-life",
Title = "MORE LIFE"
});
});
#pragma warning restore 612, 618
}
}
}
| 79.77116 | 4,023 | 0.568161 | [
"Apache-2.0"
] | KatlegoMokethi/Seres-Producies-Website | SeresProducoes/Migrations/20200316224410_MinorUpdates.Designer.cs | 25,655 | C# |
// <auto-generated>
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
// </auto-generated>
namespace Microsoft.Azure.Management.Compute.Models
{
/// <summary>
/// Defines values for CapacityReservationInstanceViewTypes.
/// </summary>
public static class CapacityReservationInstanceViewTypes
{
public const string InstanceView = "instanceView";
}
}
| 29.272727 | 74 | 0.726708 | [
"MIT"
] | 93mishra/azure-sdk-for-net | sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/CapacityReservationInstanceViewTypes.cs | 644 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using OpFlix.WebApi.Domains;
using OpFlix.WebApi.Interfaces;
using OpFlix.WebApi.Repositories;
namespace OpFlix.WebApi.Controllers
{
[Route("api/[controller]")]
[Produces("application/json")]
[ApiController]
public class UsuariosController : ControllerBase
{
public IUsuarioRepository UsuarioRepository { get; set; }
public UsuariosController()
{
UsuarioRepository = new UsuarioRepository();
}
/// <summary>
/// Chama método para listar Usuário
/// </summary>
/// <returns>Lista de Usuários</returns>
[Authorize(Roles = "Administrador")]
[HttpGet]
public IActionResult Listar()
{
return Ok(UsuarioRepository.Listar());
}
/// <summary>
/// Chama método para buscar Usuário por Id
/// </summary>
/// <param name="id">IdUsuário</param>
/// <returns>Lista de Usuários</returns>
[HttpGet("{id}")]
[Authorize(Roles = "Administrador")]
public IActionResult BuscarPorId (int id)
{
try
{
Usuarios usuario = UsuarioRepository.BuscarPorId(id);
if (usuario == null)
return NotFound();
return Ok(usuario);
}
catch (Exception ex)
{
return BadRequest(new { mensagem = "Oops! Tem erro aqui! " + ex.Message });
}
}
/// <summary>
/// Chama método para Cadastrar Usuário a ser cadas'trado como comum, livre!
/// </summary>
/// <param name="id">IdUsuário</param>
/// <returns>Usuário Cadastrado</returns>
[HttpPost("CadastrarCliente")]
public IActionResult CadastrarCliente(Usuarios usuario)
{
try
{
usuario.IdPerfil = 2;
UsuarioRepository.Cadastrar(usuario);
return Ok(usuario);
}
catch (Exception ex)
{
return BadRequest(new { mensagem = "Oops! Tem erro aqui! " + ex.Message });
}
}
/// <summary>
/// Chama método para Cadastrar Usuário a ser cadastrado!
/// </summary>
/// <param name="id">IdUsuário</param>
/// <returns>Usuário Cadastrado</returns>
[HttpPost]
[Authorize(Roles = "Administrador")]
public IActionResult Cadastrar(Usuarios usuario)
{
try
{
UsuarioRepository.Cadastrar(usuario);
return Ok(usuario);
}
catch (Exception ex)
{
return BadRequest(new { mensagem = "Oops! Tem erro aqui! " + ex.Message });
}
}
/// <summary>
/// Atualiza Usuário Cadastrado
/// </summary>
/// <param name="id">IdUsuario</param>
[HttpPut("{id}")]
[Authorize(Roles = "Administrador")]
public IActionResult Atualizar(int id, Usuarios usuario)
{
try
{
Usuarios UsuarioBuscado = UsuarioRepository.BuscarPorId(id);
if (UsuarioBuscado == null)
return NotFound();
usuario.IdUsuario = UsuarioBuscado.IdUsuario;
UsuarioRepository.Atualizar(usuario);
return Ok();
}
catch (Exception ex)
{
return BadRequest(new { mensagem = "Oops! Tem erro aqui! " + ex.Message });
}
}
/// <summary>
/// Deleta Usuário cadastrado
/// </summary>
/// <param name="id">IdUsuário</param>
[HttpDelete("{id}")]
[Authorize(Roles = "Administrador")]
public IActionResult Deletar(int id)
{
try
{
UsuarioRepository.Deletar(id);
return NoContent();
}
catch (Exception ex)
{
return BadRequest(new { mensagem = "Oops! Tem erro aqui! " + ex.Message });
}
}
}
} | 29.89726 | 91 | 0.51638 | [
"MIT"
] | CleAurora/2s2019-OpFlix | Sprint-2-API/OpFlix.WebApi/OpFlix.WebApi/Controllers/UsuariosController.cs | 4,385 | C# |
using System;
namespace inventario
{
class Program
{
static void Main(string[] args)
{
string opcion = "";
Inventario inventario = new Inventario();
while (true)
{
Console.Clear();
Console.WriteLine("Sistema de Inventario");
Console.WriteLine("*********************");
Console.WriteLine("");
Console.WriteLine("1 - Productos");
Console.WriteLine("2 - Ingreso de Inventario");
Console.WriteLine("3 - Salida de Inventario");
Console.WriteLine("4 - ajuste Negativo");
Console.WriteLine("5 - ajuste Positivo");
Console.WriteLine("0 - Salir");
opcion = Console.ReadLine();
switch (opcion)
{
case "1":
inventario.listarProductos();
break;
case "2":
inventario.ingresoDeInventario();
break;
case "4":
inventario.ajusteNegativo();
break;
case "5":
inventario.ajustePositivo();
break;
default:
break;
}
if (opcion == "0") {
break;
}
}
}
}
}
| 31.686275 | 64 | 0.35953 | [
"MIT"
] | JoseERamirezO/c-sharp | inventario-POO/Program.cs | 1,618 | C# |
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
namespace Nop.Plugin.Api.DTOs.ShoppingCarts
{
public class ShoppingCartItemsRootObject : ISerializableObject
{
public ShoppingCartItemsRootObject()
{
ShoppingCartItems = new List<ShoppingCartItemDto>();
}
[JsonProperty("shopping_carts")]
public IList<ShoppingCartItemDto> ShoppingCartItems { get; set; }
public string GetPrimaryPropertyName()
{
return "shopping_carts";
}
public Type GetPrimaryPropertyType()
{
return typeof (ShoppingCartItemDto);
}
}
} | 24.62963 | 73 | 0.640602 | [
"MIT"
] | ApertureLabsInc/api-plugin-for-nopcommerce | Nop.Plugin.Api/DTOs/ShoppingCarts/ShoppingCartItemsRootObject.cs | 667 | C# |
// <auto-generated>
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
// </auto-generated>
namespace Microsoft.Bot.Schema
{
/// <summary>
/// Defines values for DeliveryModes.
/// </summary>
public static class DeliveryModes
{
public const string Normal = "normal";
public const string Notification = "notification";
public const string ExpectReplies = "expectReplies";
public const string Ephemeral = "ephemeral";
}
}
| 29.56 | 74 | 0.690122 | [
"MIT"
] | Bhaskers-Blu-Org2/botbuilder-dotnet | libraries/Microsoft.Bot.Schema/DeliveryModes.cs | 741 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using BL.UI;
using System.Runtime.CompilerServices;
using System.Html;
namespace BL.Site
{
public class TwitterTimeline : Control
{
private String url;
private String widgetId;
private bool displayFooter = true;
private bool displayHeader = true;
private bool displayBorders = true;
private bool displayScrollbar = true;
private bool transparent = false;
[ScriptName("b_transparent")]
public bool Transparent
{
get
{
return this.transparent;
}
set
{
this.transparent = value;
}
}
[ScriptName("b_displayScrollbar")]
public bool DisplayScrollbar
{
get
{
return this.displayScrollbar;
}
set
{
this.displayScrollbar = value;
}
}
[ScriptName("b_displayBorders")]
public bool DisplayBorders
{
get
{
return this.displayBorders;
}
set
{
this.displayBorders = value;
}
}
[ScriptName("b_displayHeader")]
public bool DisplayHeader
{
get
{
return this.displayHeader;
}
set
{
this.displayHeader = value;
}
}
[ScriptName("b_displayFooter")]
public bool DisplayFooter
{
get
{
return this.displayFooter;
}
set
{
this.displayFooter = value;
}
}
[ScriptName("e_timelineContainer")]
private AnchorElement timelineContainer;
[ScriptName("s_url")]
public String Url
{
get
{
return this.url;
}
set
{
this.url = value;
}
}
[ScriptName("s_widgetId")]
public String WidgetId
{
get
{
return this.widgetId;
}
set
{
this.widgetId = value;
}
}
protected override void OnInit()
{
base.OnInit();
InjectTwitterScript();
}
public static void InjectTwitterScript()
{
// script based on the twitter embed script
//!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];
//if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");
ScriptElement js = null;
if (Document.GetElementById("twitter-wjs") == null)
{
Element fjs = Document.GetElementsByTagName("SCRIPT")[0];
js = (ScriptElement)Document.CreateElement("SCRIPT");
js.ID = "twitter-wjs";
js.Src = "//platform.twitter.com/widgets.js";
fjs.ParentNode.InsertBefore(js, fjs);
}
}
protected override void OnUpdate()
{
base.OnUpdate();
if (this.timelineContainer == null)
{
return;
}
if (this.url != null)
{
this.timelineContainer.Href = this.url;
}
if (this.widgetId != null)
{
this.timelineContainer.SetAttribute("data-widget-id", this.widgetId);
}
String options = String.Empty;
if (!this.displayFooter)
{
options += " nofooter";
}
if (!this.displayHeader)
{
options += " noheader";
}
if (!this.displayBorders)
{
options += " noborders";
}
if (!this.displayScrollbar)
{
options += " noscrollbar";
}
if (this.transparent)
{
options += " transparent";
}
if (options.Length > 0)
{
this.timelineContainer.SetAttribute("data-chrome", options.TrimStart());
}
}
}
}
| 22.742574 | 186 | 0.444057 | [
"Apache-2.0"
] | bendyline/Siter | Script/TwitterTimeline.cs | 4,596 | C# |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("NinjAcademyCommonTypes")]
[assembly: AssemblyProduct("NinjAcademyCommonTypes")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2010")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type. Only Windows
// assemblies support COM.
[assembly: ComVisible(false)]
// On Windows, the following GUID is for the ID of the typelib if this
// project is exposed to COM. On other platforms, it unique identifies the
// title storage container when deploying this assembly to the device.
[assembly: Guid("86a0a0ab-c884-4796-865c-93a53e944d16")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
[assembly: AssemblyVersion("1.0.0.0")]
| 39 | 77 | 0.761905 | [
"MIT"
] | Lajbert/XNAGameStudio-1 | Samples/NinjAcademy/NinjAcademyCommonTypes/Properties/AssemblyInfo.cs | 1,368 | C# |
namespace HumanResourcesSystem.ProjectInfo
{
using System;
using System.Collections.Generic;
public class Project
{
private string deliveryDirectorName;
//All prop for any project.
public string Ceo { get; set; }
public string DeliveryDirectorName
{
get { return this.deliveryDirectorName; }
set { this.deliveryDirectorName = value; }
}
public int ProjectId { get; set; }
public string ProjectName { get; set; }
public List<Employee> AssignedEmployeesToProject { get; set; }
}
}
| 23.461538 | 70 | 0.609836 | [
"MIT"
] | Mihaildimitrov/CSharpFirstDEMO | HumanResourcesSystem/HumanResourcesSystem/ProjectInfo/Project.cs | 612 | C# |
using System;
using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Identity.Owin;
using Microsoft.Owin;
using Microsoft.Owin.Security.Cookies;
using Microsoft.Owin.Security.Google;
using Owin;
using OnlineOrderSystem.Web.Models;
namespace OnlineOrderSystem.Web
{
public partial class Startup
{
// 如需設定驗證的詳細資訊,請瀏覽 http://go.microsoft.com/fwlink/?LinkId=301864
public void ConfigureAuth(IAppBuilder app)
{
// 設定資料庫內容、使用者管理員和登入管理員,以針對每個要求使用單一執行個體
app.CreatePerOwinContext(ApplicationDbContext.Create);
app.CreatePerOwinContext<ApplicationUserManager>(ApplicationUserManager.Create);
app.CreatePerOwinContext<ApplicationSignInManager>(ApplicationSignInManager.Create);
// 讓應用程式使用 Cookie 儲存已登入使用者的資訊
// 並使用 Cookie 暫時儲存使用者利用協力廠商登入提供者登入的相關資訊;
// 在 Cookie 中設定簽章
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
LoginPath = new PathString("/Account/Login"),
Provider = new CookieAuthenticationProvider
{
// 讓應用程式在使用者登入時驗證安全性戳記。
// 這是您變更密碼或將外部登入新增至帳戶時所使用的安全性功能。
OnValidateIdentity = SecurityStampValidator.OnValidateIdentity<ApplicationUserManager, ApplicationUser>(
validateInterval: TimeSpan.FromMinutes(30),
regenerateIdentity: (manager, user) => user.GenerateUserIdentityAsync(manager))
}
});
app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie);
// 讓應用程式在雙因素驗證程序中驗證第二個因素時暫時儲存使用者資訊。
app.UseTwoFactorSignInCookie(DefaultAuthenticationTypes.TwoFactorCookie, TimeSpan.FromMinutes(5));
// 讓應用程式記住第二個登入驗證因素 (例如電話或電子郵件)。
// 核取此選項之後,將會在用來登入的裝置上記住登入程序期間的第二個驗證步驟。
// 這類似於登入時的 RememberMe 選項。
app.UseTwoFactorRememberBrowserCookie(DefaultAuthenticationTypes.TwoFactorRememberBrowserCookie);
// 註銷下列各行以啟用利用協力廠商登入提供者登入
//app.UseMicrosoftAccountAuthentication(
// clientId: "",
// clientSecret: "");
//app.UseTwitterAuthentication(
// consumerKey: "",
// consumerSecret: "");
//app.UseFacebookAuthentication(
// appId: "",
// appSecret: "");
//app.UseGoogleAuthentication(new GoogleOAuth2AuthenticationOptions()
//{
// ClientId = "",
// ClientSecret = ""
//});
}
}
} | 39.794118 | 124 | 0.621582 | [
"Apache-2.0"
] | ringlelai/TDDDay2 | HSDc.TDD/OnlineOrderSystem.Web/App_Start/Startup.Auth.cs | 3,268 | C# |
using System;
using PoESkillTree.Computation.Common;
namespace PoESkillTree.Computation.IntegrationTests.Core
{
internal class ValueTransformation : IValueTransformation
{
private readonly Func<IValue, IValue> _transformation;
public ValueTransformation(Func<IValue, IValue> transformation)
{
_transformation = transformation;
}
public IValue Transform(IValue value) => _transformation(value);
}
} | 28.294118 | 73 | 0.68815 | [
"MIT"
] | ManuelOTuga/PoE | PoESkillTree.Computation.IntegrationTests/Core/ValueTransformation.cs | 467 | C# |
using System.IO;
namespace FileScanner
{
public interface IHandler
{
void Handle(FileInfo file);
string Name { get; }
string GetStatistics();
}
}
| 11.117647 | 35 | 0.582011 | [
"MIT"
] | rzeeders/FileScanner | FileScanner/IHandler.cs | 191 | C# |
// Copyright (c) 2020, Phoenix Contact GmbH & Co. KG
// Licensed under the Apache License, Version 2.0
using System;
namespace Moryx.Runtime.Modules
{
/// <summary>
/// Enum flags: Notify - Reincarnate
/// </summary>
[Flags]
public enum FailureBehaviour
{
/// <summary>
/// Module is stopped when an exception occurs
/// </summary>
Stop = 0x00,
/// <summary>
/// Module is stopped and failure processed by notification components
/// </summary>
StopAndNotify = 0x02,
}
}
| 22.64 | 78 | 0.584806 | [
"Apache-2.0"
] | 1nf0rmagician/MORYX-Core | src/Moryx.Runtime/Modules/FailureBehaviour.cs | 566 | C# |
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
namespace CommonUtils
{
public class JaggedByteComparer : IEqualityComparer<byte[]>
{
private readonly double threshold;
public JaggedByteComparer(double threshold)
{
this.threshold = threshold;
}
public bool Equals(byte[] x, byte[] y)
{
return (x.SequenceEqual<byte>(y, new ByteComparer(threshold)));
}
public int GetHashCode(byte[] obj)
{
return obj.GetHashCode();
}
}
public class ByteComparer : IEqualityComparer<byte>
{
private readonly double threshold;
public ByteComparer(double threshold)
{
this.threshold = threshold;
}
public bool Equals(byte x, byte y)
{
return Math.Abs(x - y) < this.threshold;
}
public int GetHashCode(byte obj)
{
return obj.GetHashCode();
}
}
} | 21.978723 | 75 | 0.571152 | [
"MIT"
] | perivar/AbletonLiveConverter | PresetConverterProject/CommonUtils/ByteComparer.cs | 1,033 | C# |
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
namespace Galagram.Collections
{
/// <summary>
/// Inversed list collection
/// </summary>
/// <typeparam name="T">
/// Type of items
/// </typeparam>
public class ReverseCollection<T> : ICollection<T>, IList<T>, INotifyCollectionChanged
{
// FIELDS
LinkedList<T> baseCollection;
bool isIndexReseted;
int currentIndex;
LinkedListNode<T> currentNode;
// CONSTRUCTORS
/// <summary>
/// Initializes a new instance of <see cref="ReverseCollection{T}"/>
/// </summary>
public ReverseCollection()
{
baseCollection = new LinkedList<T>();
isIndexReseted = true;
currentIndex = Core.Configuration.Constants.WRONG_INDEX;
currentNode = null;
}
/// <summary>
/// Initializes a new instance of <see cref="ReverseCollection{T}"/>
/// </summary>
/// <param name="collection">
/// The collection to copy elements from.
/// </param>
public ReverseCollection(IEnumerable<T> collection)
{
baseCollection = new LinkedList<T>(System.Linq.Enumerable.Reverse(collection));
isIndexReseted = true;
currentIndex = Core.Configuration.Constants.WRONG_INDEX;
currentNode = null;
}
// PROPERTIES
/// <summary>
/// Gets the number of elements contained in the <see cref="ReverseCollection{T}"/>
/// </summary>
public int Count => baseCollection.Count;
/// <summary>
/// Determines if collection can be modified
/// </summary>
public bool IsReadOnly => false;
/// <summary>
/// Determines whether collection is empty
/// </summary>
public bool IsEmpty => this.Count == 0;
// INDEXERS
/// <summary>
/// Gets or sets the element at the specified index.
/// </summary>
/// <param name="index">
/// The zero-based index of the element to get or set.
/// </param>
/// <returns>
/// The element at the specified index.
/// </returns>
/// <exception cref="ArgumentOutOfRangeException">
/// <paramref name="index"/> is not a valid index in the <see cref="ReverseCollection{T}"/>
/// </exception>
public T this[int index]
{
get
{
// check index
if (IsIndexWrong(index)) throw new IndexOutOfRangeException();
// move to node
MoveToIndex(index);
// get value
return currentNode.Value;
}
set
{
// check index
if (IsIndexWrong(index)) throw new IndexOutOfRangeException();
// move to node
MoveToIndex(index);
// notify
OnCollectionChanged(new NotifyCollectionChangedEventArgs(action: NotifyCollectionChangedAction.Replace,
oldItem: currentNode.Value,
newItem: value,
index: index));
// change item
currentNode.Value = value;
}
}
private void MoveToIndex(int index)
{
// if index is reseted, start from beginning
FirstStep();
// lift behaviour
// stays at current node
// if index is higher, move up
// if index is lowwer, move down
while (currentIndex < index) NextIndex();
while (currentIndex > index) PreviousIndex();
}
private void MoveToItemFromStart(T item)
{
while (currentNode != null && !currentNode.Value.Equals(item))
{
NextIndex();
}
}
private void MoveToItemFromEnd(T item)
{
while (currentNode != null && !currentNode.Value.Equals(item))
{
PreviousIndex();
}
}
private void NextIndex()
{
currentNode = currentNode.Next;
++currentIndex;
}
private void PreviousIndex()
{
currentNode = currentNode.Previous;
--currentIndex;
}
private void ResetIndex()
{
isIndexReseted = true;
currentNode = null;
currentIndex = Core.Configuration.Constants.WRONG_INDEX;
}
private void FirstStep()
{
if (this.IsEmpty) throw new InvalidOperationException();
if (!isIndexReseted) return;
isIndexReseted = false;
currentNode = baseCollection.First;
currentIndex = 0;
}
private bool IsIndexWrong(int index)
{
return index < 0 || index >= baseCollection.Count;
}
// EVENTS
/// <summary>
/// Occurs when the collection changes
/// </summary>
public event NotifyCollectionChangedEventHandler CollectionChanged;
// METHODS
// ADDING
#region ADDING
/// <summary>
/// Inserts an object to collection
/// </summary>
/// <param name="item">
/// Inserted item
/// </param>
public void Add(T item)
{
baseCollection.AddFirst(item);
OnCollectionChanged(new NotifyCollectionChangedEventArgs(action: NotifyCollectionChangedAction.Add, changedItem: item, index: 0));
}
/// <summary>
/// Inserts an item to the <see cref="ReverseCollection{T}"/> at the specified index.
/// </summary>
/// <param name="index">
/// The zero-based index at which item should be inserted.
/// </param>
/// <param name="item">
/// The object to insert into the <see cref="ReverseCollection{T}"/>
/// </param>
/// <exception cref="ArgumentOutOfRangeException">
/// <paramref name="index"/> is less than zero or greater than amount of item in <see cref="ReverseCollection{T}"/>
/// </exception>
public void Insert(int index, T item)
{
// check index
if (IsIndexWrong(index)) throw new ArgumentOutOfRangeException(nameof(index));
// search for index
MoveToIndex(index);
// insert
baseCollection.AddBefore(currentNode, item);
// notify
OnCollectionChanged(new NotifyCollectionChangedEventArgs(action: NotifyCollectionChangedAction.Add, changedItem: item, index: index));
}
#endregion
// SEARCHING
#region SEARCHING
/// <summary>
/// Determines whether a value is in the <see cref="ReverseCollection{T}"/>
/// </summary>
/// <param name="item">
/// The value to locate in the <see cref="ReverseCollection{T}"/>. The value can be null for reference types.
/// </param>
/// <returns>
/// True if value is found in the <see cref="ReverseCollection{T}"/>; otherwise — false.
/// </returns>
public bool Contains(T item)
{
return baseCollection.Contains(item);
}
/// <summary>
/// Determines the index of a specific item in the <see cref="ReverseCollection{T}"/>
/// </summary>
/// <param name="item">
/// The object to locate in the <see cref="ReverseCollection{T}"/>
/// </param>
/// <returns>
/// The index of item if found in the list; otherwise — -1.
/// </returns>
public int IndexOf(T item)
{
// start searching from first item
ResetIndex();
FirstStep();
// search item
MoveToItemFromStart(item);
// return result : has item or not
return currentNode != null ? currentIndex : Core.Configuration.Constants.WRONG_INDEX;
}
#endregion
// REMOVING
#region REMOVING
/// <summary>
/// Removes the <see cref="ReverseCollection{T}"/> item at the specified index.
/// </summary>
/// <param name="index">
/// The zero-based index of the item to remove.
/// </param>
/// <exception cref="ArgumentOutOfRangeException">
/// <paramref name="index"/> is not a valid index in the <see cref="ReverseCollection{T}"/>
/// </exception>
public void RemoveAt(int index)
{
// check index
if (IsIndexWrong(index)) throw new ArgumentOutOfRangeException(nameof(index));
// find item
MoveToIndex(index);
// delete item
baseCollection.Remove(currentNode);
// notify
OnCollectionChanged(new NotifyCollectionChangedEventArgs(action: NotifyCollectionChangedAction.Remove,
changedItem: currentNode.Value,
index: index));
}
/// <summary>
/// Removes the first occurrence of <paramref name="item"/> from the <see cref="ReverseCollection{T}"/>
/// </summary>
/// <param name="item">
/// The value to remove from the <see cref="ReverseCollection{T}"/>.
/// </param>
/// <returns>
/// True if the element containing value is successfully removed; otherwise — false.
/// <para/>
/// This method also returns false if value was not found in the original <see cref="ReverseCollection{T}"/>.
/// </returns>
public bool Remove(T item)
{
// start searching from first item
ResetIndex();
FirstStep();
// search item
MoveToItemFromStart(item);
// remove item, if can
if (currentNode != null)
{
baseCollection.Remove(currentNode);
// notify
OnCollectionChanged(new NotifyCollectionChangedEventArgs(action: NotifyCollectionChangedAction.Remove,
changedItem: currentNode.Value,
index: currentIndex));
// removing result
return true;
}
else return false;
}
/// <summary>
/// Removes all items from the <see cref="ReverseCollection{T}"/>
/// </summary>
public void Clear()
{
baseCollection.Clear();
OnCollectionChanged(new NotifyCollectionChangedEventArgs(action: NotifyCollectionChangedAction.Reset));
}
#endregion
/// <summary>
/// Copies the entire <see cref="ReverseCollection{T}"/> to a compatible one-dimensional <see cref="Array"/>, starting at the specified index of the target array.
/// </summary>
/// <param name="array">
/// The one-dimensional <see cref="Array"/> that is the destination of the elements copied from <see cref="ReverseCollection{T}"/>.
/// </param>
/// <param name="arrayIndex">
/// The zero-based index in array at which copying begins
/// </param>
/// <exception cref="ArgumentNullException">
/// <paramref name="array"/> is null
/// </exception>
/// <exception cref="ArgumentOutOfRangeException">
/// <paramref name="arrayIndex"/> is less than zero or greater than amount of item in <see cref="ReverseCollection{T}"/>
/// </exception>
/// <exception cref="ArgumentException">
/// The number of elements in the source <see cref="ReverseCollection{T}"/> is greater than the available space from index to the end of the destination array.
/// </exception>
public void CopyTo(T[] array, int arrayIndex)
{
baseCollection.CopyTo(array, arrayIndex);
}
/// <summary>
/// Returns an enumerator for <see cref="ReverseCollection{T}"/>
/// </summary>
/// <returns>
/// An instance of <see cref="IEnumerator{T}"/>
/// </returns>
public IEnumerator<T> GetEnumerator()
{
return baseCollection.GetEnumerator();
}
IEnumerator IEnumerable.GetEnumerator()
{
return baseCollection.GetEnumerator();
}
/// <summary>
/// Raises <see cref="CollectionChanged"/>
/// </summary>
/// <param name="notifyCollectionChangedEventArgs">
/// Provides data for <see cref="CollectionChanged"/> event
/// </param>
protected void OnCollectionChanged(NotifyCollectionChangedEventArgs notifyCollectionChangedEventArgs)
{
CollectionChanged?.Invoke(this, notifyCollectionChangedEventArgs);
}
}
} | 36.367847 | 170 | 0.532629 | [
"Apache-2.0"
] | iamprovidence/Coursework | Project/Galagram/Collections/ReverseCollection.cs | 13,355 | C# |
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using seyself;
public class SVGParserDemo : MonoBehaviour
{
void Start()
{
SVGParser parser = new SVGParser();
List<SVGPath> svgPath = parser.Parse("Data/sample.svg");
// List<SVGPath> svgPath = parser.ParseText( FileIO.ReadText("Data/sample.svg") );
SVGViewer viewer = gameObject.AddComponent<SVGViewer>();
viewer.Draw(svgPath);
}
}
| 27.411765 | 90 | 0.680258 | [
"MIT"
] | seyself/SVGParserForUnity | Assets/SVGParser/Demo/SVGParserDemo.cs | 466 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Identity;
namespace MultiTenancyServer.Samples.AspNetIdentityAndEFCore.Models
{
// Add profile data for application users by adding properties to the ApplicationUser class
public class ApplicationUser : IdentityUser
{
}
}
| 26 | 95 | 0.793956 | [
"Apache-2.0"
] | T-Systems-MMS/MultiTenancyServer.Samples | src/AspNetIdentityAndEFCore/Models/ApplicationUser.cs | 366 | C# |
namespace CompanyName.Notebook.NoteTaking.Core.Application.Messages
{
public class NewNoteMessage
{
public string Text { get; set; }
}
} | 22.285714 | 67 | 0.692308 | [
"MIT"
] | smashingboxes/reference-architecture-api | src/Core/Application/Messages/NewNoteMessage.cs | 156 | C# |
using ExhaustiveMatching;
namespace Adamant.Tools.Compiler.Bootstrap.Core.Operators
{
public static class AccessOperatorExtensions
{
public static string ToSymbolString(this AccessOperator @operator)
{
return @operator switch
{
AccessOperator.Standard => ".",
AccessOperator.Conditional => "?.",
_ => throw ExhaustiveMatch.Failed(@operator)
};
}
}
}
| 27.111111 | 75 | 0.563525 | [
"MIT"
] | adamant/adamant.tools.compiler.bootstrap | Core/Operators/AccessOperatorExtensions.cs | 488 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
namespace Pwned.Web
{
public class Startup
{
// This method gets called by the runtime. Use this method to add services to the container.
// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
public void ConfigureServices(IServiceCollection services)
{
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.Run(async (context) =>
{
await context.Response.WriteAsync("Hello World!");
});
}
}
}
| 30.942857 | 122 | 0.654663 | [
"MIT"
] | johnwpowell/efcoresqlite | src/Pwned.Web/Startup.cs | 1,085 | C# |
public class Hero
{
private string name;
private int experience;
private IWeapon weapon;
public Hero(IWeapon weapon, string name)
{
this.name = name;
this.experience = 0;
this.weapon = weapon;
}
public string Name
{
get { return this.name; }
}
public int Experience
{
get { return this.experience; }
}
public IWeapon Weapon
{
get { return this.weapon; }
}
public void Attack(ITarget target)
{
this.weapon.Attack(target);
if (target.IsDead())
{
this.experience += target.GiveExperience();
}
}
} | 17.473684 | 55 | 0.542169 | [
"MIT"
] | CaptainUltra/IT-Career-Course | Year 2/Module 5 - OOP/UnitTesting/Skeleton/Hero.cs | 666 | C# |
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated from a template.
//
// Manual changes to this file may cause unexpected behavior in your application.
// Manual changes to this file will be overwritten if the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace WWTMVC5.Models
{
using System;
using System.Collections.Generic;
[global::System.CodeDom.Compiler.GeneratedCode("EdmxTool", "1.0.0.0")]
public partial class InviteRequestContent
{
public InviteRequestContent()
{
this.InviteRequest = new HashSet<InviteRequest>();
}
public int InviteRequestContentID { get; set; }
public long CommunityID { get; set; }
public int RoleID { get; set; }
public string Subject { get; set; }
public string Body { get; set; }
public Nullable<long> InvitedByID { get; set; }
public Nullable<System.DateTime> InvitedDate { get; set; }
public virtual Community Community { get; set; }
public virtual Role Role { get; set; }
public virtual User User { get; set; }
public virtual ICollection<InviteRequest> InviteRequest { get; set; }
}
}
| 36.621622 | 84 | 0.563838 | [
"MIT"
] | Carifio24/wwt-website | src/WWTMVC5/Models/InviteRequestContent.cs | 1,355 | C# |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// アセンブリに関する一般情報は以下の属性セットをとおして制御されます。
// アセンブリに関連付けられている情報を変更するには、
// これらの属性値を変更してください。
[assembly: AssemblyTitle("TMOProportion")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("TMOProportion")]
[assembly: AssemblyCopyright("Copyright © 2009")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから
// 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、
// その型の ComVisible 属性を true に設定してください。
[assembly: ComVisible(false)]
// 次の GUID は、このプロジェクトが COM に公開される場合の、typelib の ID です
[assembly: Guid("89884274-612f-4eec-8b46-684d9529839a")]
// アセンブリのバージョン情報は、以下の 4 つの値で構成されています:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を
// 既定値にすることができます:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| 29.648649 | 57 | 0.74567 | [
"MIT"
] | 3dcustom/tsoview | TMOProportion/Properties/AssemblyInfo.cs | 1,622 | C# |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Microsoft.VisualStudio.Composition.Tests
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xunit;
using MefV1 = System.ComponentModel.Composition;
public class NestedTypeTests
{
[MefFact(CompositionEngines.V1Compat)]
public void NestedTypeOfGenericType(IContainer container)
{
var export = container.GetExportedValue<OuterDerivedPart>();
Assert.NotNull(export);
}
public abstract class OuterBasePart<T>
{
[MefV1.Import]
public NestedType Value { get; set; } = null!;
[MefV1.Export]
public class NestedType { }
[MefV1.Export]
public class NestedType2 { }
}
[MefV1.Export]
public class OuterDerivedPart : OuterBasePart<int> { }
}
}
| 28 | 101 | 0.635531 | [
"MIT"
] | AArnott/vs-mef | test/Microsoft.VisualStudio.Composition.Tests/NestedTypeTests.cs | 1,094 | C# |
// <copyright file="DedicatedThreadWorker.cs" company="ClrCoder project">
// Copyright (c) ClrCoder project. All rights reserved.
// Licensed under the Apache 2.0 license. See LICENSE file in the project root for full license information.
// </copyright>
namespace ClrCoder.Threading
{
using System;
using System.Collections.Concurrent;
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
using JetBrains.Annotations;
/// <summary>
/// Worker that uses same thread for all tasks.
/// </summary>
[PublicAPI]
public class DedicatedThreadWorker : IAsyncHandler, IDisposable
{
[NotNull]
private readonly Task _workerTask;
private readonly BlockingCollection<Action> _workItems = new BlockingCollection<Action>(32768);
private readonly CancellationTokenSource _cts = new CancellationTokenSource();
private CancellationToken _ct;
/// <summary>
/// Initializes a new instance of the <see cref="DedicatedThreadWorker"/> class.
/// </summary>
public DedicatedThreadWorker()
{
_workerTask = Task.Factory.StartNew(WorkerThreadProc, TaskCreationOptions.LongRunning);
_ct = _cts.Token;
}
/// <summary>
/// Finalizes an instance of the <see cref="DedicatedThreadWorker"/> class.
/// </summary>
~DedicatedThreadWorker()
{
Debug.Assert(false, "Worker should be disposed from code.");
// ReSharper disable once HeuristicUnreachableCode
Dispose(false);
}
/// <inheritdoc/>
public void Dispose()
{
Dispose(true);
}
/// <inheritdoc/>
public void RunAsync(Action action)
{
if (action == null)
{
throw new ArgumentNullException(nameof(action));
}
try
{
_ct.ThrowIfCancellationRequested();
_workItems.Add(action, _ct);
}
catch (OperationCanceledException ex)
{
throw ReThrowOperationCanceled(ex);
}
}
/// <inheritdoc/>
public void RunAsync<T>(Action<T> action, [CanBeNull] T arg)
{
if (action == null)
{
throw new ArgumentNullException(nameof(action));
}
try
{
_ct.ThrowIfCancellationRequested();
// This is non optimal implementation.
_workItems.Add(
() => { action(arg); },
_ct);
}
catch (OperationCanceledException ex)
{
throw ReThrowOperationCanceled(ex);
}
}
/// <inheritdoc/>
public void RunAsync<T1, T2>(Action<T1, T2> action, [CanBeNull] T1 arg1, [CanBeNull] T2 arg2)
{
if (action == null)
{
throw new ArgumentNullException(nameof(action));
}
try
{
_ct.ThrowIfCancellationRequested();
// This is non optimal implementation.
_workItems.Add(
() => { action(arg1, arg2); },
_ct);
}
catch (OperationCanceledException ex)
{
throw ReThrowOperationCanceled(ex);
}
}
/// <inheritdoc/>
public void RunAsync<T1, T2, T3>(
Action<T1, T2, T3> action,
[CanBeNull] T1 arg1,
[CanBeNull] T2 arg2,
[CanBeNull] T3 arg3)
{
try
{
_ct.ThrowIfCancellationRequested();
// This is non optimal implementation.
_workItems.Add(
() => { action(arg1, arg2, arg3); },
_ct);
}
catch (OperationCanceledException ex)
{
throw ReThrowOperationCanceled(ex);
}
}
/// <inheritdoc/>
public void RunAsync<T1, T2, T3, T4>(
Action<T1, T2, T3, T4> action,
[CanBeNull] T1 arg1,
[CanBeNull] T2 arg2,
[CanBeNull] T3 arg3,
[CanBeNull] T4 arg4)
{
if (action == null)
{
throw new ArgumentNullException(nameof(action));
}
try
{
_ct.ThrowIfCancellationRequested();
// This is non optimal implementation.
_workItems.Add(
() => { action(arg1, arg2, arg3, arg4); },
_ct);
}
catch (OperationCanceledException ex)
{
throw ReThrowOperationCanceled(ex);
}
}
/// <inheritdoc/>
public void RunAsync<T1, T2, T3, T4, T5>(
Action<T1, T2, T3, T4, T5> action,
[CanBeNull] T1 arg1,
[CanBeNull] T2 arg2,
[CanBeNull] T3 arg3,
[CanBeNull] T4 arg4,
[CanBeNull] T5 arg5)
{
if (action == null)
{
throw new ArgumentNullException(nameof(action));
}
try
{
_ct.ThrowIfCancellationRequested();
// This is non optimal implementation.
_workItems.Add(
() => { action(arg1, arg2, arg3, arg4, arg5); },
_ct);
}
catch (OperationCanceledException ex)
{
throw ReThrowOperationCanceled(ex);
}
}
/// <inheritdoc/>
public void RunAsync<T1, T2, T3, T4, T5, T6>(
Action<T1, T2, T3, T4, T5, T6> action,
[CanBeNull] T1 arg1,
[CanBeNull] T2 arg2,
[CanBeNull] T3 arg3,
[CanBeNull] T4 arg4,
[CanBeNull] T5 arg5,
[CanBeNull] T6 arg6)
{
if (action == null)
{
throw new ArgumentNullException(nameof(action));
}
try
{
_ct.ThrowIfCancellationRequested();
// This is non optimal implementation.
_workItems.Add(
() => { action(arg1, arg2, arg3, arg4, arg5, arg6); },
_ct);
}
catch (OperationCanceledException ex)
{
throw ReThrowOperationCanceled(ex);
}
}
/// <inheritdoc/>
public void RunAsync<T1, T2, T3, T4, T5, T6, T7>(
Action<T1, T2, T3, T4, T5, T6, T7> action,
[CanBeNull] T1 arg1,
[CanBeNull] T2 arg2,
[CanBeNull] T3 arg3,
[CanBeNull] T4 arg4,
[CanBeNull] T5 arg5,
[CanBeNull] T6 arg6,
[CanBeNull] T7 arg7)
{
if (action == null)
{
throw new ArgumentNullException(nameof(action));
}
try
{
_ct.ThrowIfCancellationRequested();
// This is non optimal implementation.
_workItems.Add(
() => { action(arg1, arg2, arg3, arg4, arg5, arg6, arg7); },
_ct);
}
catch (OperationCanceledException ex)
{
throw ReThrowOperationCanceled(ex);
}
}
/// <summary>
/// Schedules task to be executed in the worker thread.
/// </summary>
/// <param name="action">Action to execute.</param>
public void RunSync(Action action)
{
try
{
_ct.ThrowIfCancellationRequested();
var taskCompletionSource = new TaskCompletionSource<VoidResult>();
_workItems.Add(
() =>
{
try
{
action();
taskCompletionSource.SetResult(default(VoidResult));
}
catch (Exception ex)
{
taskCompletionSource.SetException(ex);
}
},
_ct);
taskCompletionSource.Task.Wait(_ct);
}
catch (OperationCanceledException ex)
{
throw ReThrowOperationCanceled(ex);
}
}
/// <summary>
/// Schedules task to be executed in the worker thread.
/// </summary>
/// <typeparam name="T">Result type.</typeparam>
/// <param name="func">Function to execute.</param>
/// <returns>Function result.</returns>
public T RunSync<T>(Func<T> func)
{
try
{
_ct.ThrowIfCancellationRequested();
var taskCompletionSource = new TaskCompletionSource<T>();
_workItems.Add(
() =>
{
try
{
taskCompletionSource.SetResult(func());
}
catch (Exception ex)
{
taskCompletionSource.SetException(ex);
}
},
_ct);
taskCompletionSource.Task.Wait(_ct);
return taskCompletionSource.Task.Result;
}
catch (OperationCanceledException ex)
{
throw ReThrowOperationCanceled(ex);
}
}
/// <summary>
/// Disposes <c>object</c>.
/// </summary>
/// <param name="disposing">Indicates that dispose was directly called.</param>
protected virtual void Dispose(bool disposing)
{
lock (_cts)
{
try
{
_ct.ThrowIfCancellationRequested();
if (disposing)
{
GC.SuppressFinalize(this);
}
_cts.Cancel();
// ReSharper disable once MethodSupportsCancellation
_workerTask.Wait();
}
catch (OperationCanceledException ex)
{
throw ReThrowOperationCanceled(ex);
}
}
}
private void EnsureNotDisposing()
{
if (_ct.IsCancellationRequested)
{
throw new InvalidOperationException("Worker disposed or disposing.");
}
}
private void HandleException(Exception ex)
{
// Fire and forget.
// ReSharper disable once MethodSupportsCancellation
Task.Factory.StartNew(() => throw ex);
}
private Exception ReThrowOperationCanceled(OperationCanceledException ex)
{
return new InvalidOperationException("Worker disposed or disposing.");
}
private void WorkerThreadProc()
{
for (;;)
{
Action action;
if (!_workItems.TryTake(out action))
{
try
{
if (_ct.IsCancellationRequested)
{
return;
}
action = _workItems.Take(_ct);
}
catch (OperationCanceledException)
{
continue;
}
}
try
{
action();
}
catch (Exception ex)
{
HandleException(ex);
}
}
}
}
}
| 29.551807 | 108 | 0.443249 | [
"MIT"
] | ClrCoder/ClrCoderFX | src/ClrCoder/Threading/DedicatedThreadWorker.cs | 12,264 | C# |
#region Copyright
///////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) Phoenix Contact GmbH & Co KG
// This software is licensed under Apache-2.0
//
///////////////////////////////////////////////////////////////////////////////
#endregion
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using PlcncliServices.CommandResults;
using PlcncliServices.PLCnCLI;
using PlcNextVSExtension.Properties;
namespace PlcNextVSExtension.PlcNextProject.NewProjectInformationDialog
{
public class NewProjectInformationModel : INotifyPropertyChanged
{
private readonly string _projectName;
private string _projectNamespace;
private string _initialComponentName;
private string _initialProgramName;
private IEnumerable<TargetResult> _allTargets = new List<TargetResult>();
private readonly IPlcncliCommunication _plcncliCommunication;
public string ProjectNamespace
{
get => _projectNamespace;
set { _projectNamespace = value; OnPropertyChanged(); }
}
public string InitialComponentName
{
get => _initialComponentName;
set { _initialComponentName = value; OnPropertyChanged(); }
}
public string InitialProgramName
{
get => _initialProgramName;
set { _initialProgramName = value; OnPropertyChanged(); }
}
public IEnumerable<TargetResult> AllTargets
{
get => _allTargets;
set { _allTargets = value; OnPropertyChanged(); }
}
public IEnumerable<TargetResult> ProjectTargets { get; set; } = Enumerable.Empty<TargetResult>();
public string ProjectType { get; }
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
public NewProjectInformationModel(IPlcncliCommunication plcncliCommunication, string projectName,
string projectType)
{
_plcncliCommunication = plcncliCommunication;
_projectName = projectName;
ProjectNamespace = _projectName;
InitialComponentName = $"{_projectName}Component";
InitialProgramName = $"{_projectName}Program";
ProjectType = projectType;
UpdateTargets();
}
public void UpdateTargets()
{
var result = _plcncliCommunication.ExecuteCommand(Resources.Command_get_targets, null, typeof(TargetsCommandResult)) as TargetsCommandResult;
if (result != null) AllTargets = result.Targets;
}
}
}
| 34.345238 | 153 | 0.632929 | [
"Apache-2.0"
] | PLCnext/PLCnext_CLI_VS | src/PlcNextVSExtension/PlcNextProject/NewProjectInformationDialog/NewProjectInformationModel.cs | 2,887 | C# |
using System.ComponentModel.DataAnnotations;
namespace FastFood.Web.ViewModels.Orders
{
public class CreateOrderInputModel
{
[Required]
[StringLength(30, MinimumLength = 3)]
public string Customer { get; set; }
public int ItemId { get; set; }
public int EmployeeId { get; set; }
public string OrderType { get; set; }
[Range(1, 10000)]
public int Quantity { get; set; }
}
}
| 21.666667 | 45 | 0.608791 | [
"MIT"
] | NaskoVasilev/Databases-Advanced-EntityFramework-Core | Auto Mapping Objects/Fast Food/FastFood.Web/ViewModels/Orders/CreateOrderInputModel.cs | 457 | C# |
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Utils;
namespace osu.Framework.Bindables
{
public interface IBindableWithCurrent<T> : IBindable<T>, IHasCurrentValue<T>
{
/// <summary>
/// Creates a new <see cref="IBindableWithCurrent{T}"/> according to the specified value type.
/// If the value type is one supported by the <see cref="BindableNumber{T}"/>, an instance of <see cref="BindableNumberWithCurrent{T}"/> will be returned.
/// Otherwise an instance of <see cref="BindableWithCurrent{T}"/> will be returned instead.
/// </summary>
public static IBindableWithCurrent<T> Create()
{
if (Validation.IsSupportedBindableNumberType<T>())
return (IBindableWithCurrent<T>)Activator.CreateInstance(typeof(BindableNumberWithCurrent<>).MakeGenericType(typeof(T)), default(T));
return new BindableWithCurrent<T>();
}
}
}
| 43.884615 | 163 | 0.669588 | [
"MIT"
] | ATiltedTree/osu-framework | osu.Framework/Bindables/IBindableWithCurrent.cs | 1,116 | C# |
/*-----------------------------+-------------------------------\
| |
| !!!NOTICE!!! |
| |
| These libraries are under heavy development so they are |
| subject to make many changes as development continues. |
| For this reason, the libraries may not be well commented. |
| THANK YOU for supporting forge with all your feedback |
| suggestions, bug reports and comments! |
| |
| - The Forge Team |
| Bearded Man Studios, Inc. |
| |
| This source code, project files, and associated files are |
| copyrighted by Bearded Man Studios, Inc. (2012-2017) and |
| may not be redistributed without written permission. |
| |
\------------------------------+------------------------------*/
using BeardedManStudios.Forge.Networking.Frame;
using System;
using System.Collections.Generic;
namespace BeardedManStudios.Forge.Networking.DataStore
{
/// <summary>
/// The main class for managing and communicating data from the server cache
/// </summary>
/// <remarks>
/// Cache is used to store any arbitrary data for your game, you can deposit supported data types to the server with a key, then access them again
/// on any client by using the key to access the specific data stored. Cache.Set() and Cache.Request() being the two primary ways to use Cache.
/// </remarks>
public class Cache
{
public const int DEFAULT_CACHE_SERVER_PORT = 15942;
// Default expiry datetime for a cached object.
private readonly DateTime maxDateTime = DateTime.MaxValue;
/// <summary>
/// The memory cache for the data
/// </summary>
private Dictionary<string, CachedObject> memory = new Dictionary<string, CachedObject>();
/// <summary>
/// The main socket for communicating the cache back and forth
/// </summary>
public NetWorker Socket { get; private set; }
// TODO: Possibly make this global
/// <summary>
/// The set of types that are allowed and a byte mapping to them
/// </summary>
private static Dictionary<byte, Type> typeMap = new Dictionary<byte, Type>() {
{ 0, typeof(byte) },
{ 1, typeof(char) },
{ 2, typeof(short) },
{ 3, typeof(ushort) },
{ 4, typeof(int) },
{ 5, typeof(uint) },
{ 6, typeof(long) },
{ 7, typeof(ulong) },
{ 8, typeof(bool) },
{ 9, typeof(float) },
{ 10, typeof(double) },
{ 11, typeof(string) },
{ 12, typeof(Vector) },/*
{ 12, typeof(Vector2) },
{ 13, typeof(Vector3) },
{ 14, typeof(Vector4) },
{ 15, typeof(Quaternion) },
{ 16, typeof(Color) }*/
};
/// <summary>
/// The current id that the callback stack is on
/// </summary>
private int responseHookIncrementer = 0;
/// <summary>
/// The main callback stack for when requesting data
/// </summary>
private Dictionary<int, Action<object>> responseHooks = new Dictionary<int, Action<object>>();
public Cache(NetWorker socket)
{
Socket = socket;
Socket.binaryMessageReceived += BinaryMessageReceived;
}
private void RemoveExpiredObjects()
{
foreach (KeyValuePair<string, CachedObject> entry in memory)
if (entry.Value.IsExpired())
memory.Remove(entry.Key);
}
/// <summary>
/// Called when the network as interpreted that a cache message has been sent from the server
/// </summary>
/// <param name="player">The server</param>
/// <param name="frame">The data that was received</param>
private void BinaryMessageReceived(NetworkingPlayer player, Binary frame, NetWorker sender)
{
if (frame.GroupId != MessageGroupIds.CACHE)
return;
if (sender is IServer)
{
byte type = ObjectMapper.Instance.Map<byte>(frame.StreamData);
int responseHookId = ObjectMapper.Instance.Map<int>(frame.StreamData);
string key = ObjectMapper.Instance.Map<string>(frame.StreamData);
object obj = Get(key);
// TODO: Let the client know it is null
if (obj == null)
return;
BMSByte data = ObjectMapper.BMSByte(type, responseHookId, obj);
Binary sendFrame = new Binary(sender.Time.Timestep, sender is TCPClient, data, Receivers.Target, MessageGroupIds.CACHE, sender is BaseTCP);
if (sender is BaseTCP)
((TCPServer)sender).Send(player.TcpClientHandle, sendFrame);
else
((UDPServer)sender).Send(player, sendFrame, true);
}
else
{
byte type = ObjectMapper.Instance.Map<byte>(frame.StreamData);
int responseHookId = ObjectMapper.Instance.Map<int>(frame.StreamData);
object obj = null;
if (typeMap[type] == typeof(string))
obj = ObjectMapper.Instance.Map<string>(frame.StreamData);
/*else if (typeMap[type] == typeof(Vector2))
obj = ObjectMapper.Map<Vector2>(stream);
else if (typeMap[type] == typeof(Vector3))
obj = ObjectMapper.Map<Vector3>(stream);
else if (typeMap[type] == typeof(Vector4))
obj = ObjectMapper.Map<Vector4>(stream);
else if (typeMap[type] == typeof(Color))
obj = ObjectMapper.Map<Color>(stream);
else if (typeMap[type] == typeof(Quaternion))
obj = ObjectMapper.Map<Quaternion>(stream);*/
else
obj = ObjectMapper.Instance.Map(typeMap[type], frame.StreamData);
if (responseHooks.ContainsKey(responseHookId))
{
responseHooks[responseHookId](obj);
responseHooks.Remove(responseHookId);
}
}
}
/// <summary>
/// Get an object from cache
/// </summary>
/// <typeparam name="T">The type of object to store</typeparam>
/// <param name="key">The name variable used for storing the desired object</param>
/// <returns>Return object from key otherwise return the default value of the type or null</returns>
private T Get<T>(string key)
{
if (!Socket.IsServer)
return default(T);
if (!memory.ContainsKey(key))
return default(T);
if (memory[key] is T)
return (T)memory[key].Value;
return default(T);
}
/// <summary>
/// Used on the server to get an object at a given key from cache
/// </summary>
/// <param name="key">The key to be used in the dictionary lookup</param>
/// <returns>The object at the given key in cache otherwise null</returns>
private object Get(string key)
{
if (!Socket.IsServer)
return null;
if (memory.ContainsKey(key))
return memory[key].Value;
return null;
}
/// <summary>
/// Get an object from cache
/// </summary>
/// <param name="key">The name variable used for storing the desired object</param>
/// <returns>The string data at the desired key or null</returns>
/// <remarks>
/// Allows a client (or the server) to get a value from the Cache, the value is read directly from the server.
/// A callback must be specified, this is because the code has to be executed after a moment when the response from the server
/// is received. Request can be done like this:
/// <code>
/// void getServerDescription(){
/// Cache.Request<string>("server_description", delegate (object response){
/// Debug.Log(((string) response));
/// });
/// }
/// </code>
/// The Cache only supports Forge's supported data Types, you can find a list of supported data Types in the NetSync documentation...
/// </remarks>
public void Request<T>(string key, Action<object> callback)
{
if (callback == null)
throw new Exception("A callback is needed when requesting data from the server");
if (Socket.IsServer)
{
callback(Get<T>(key));
return;
}
responseHooks.Add(responseHookIncrementer, callback);
byte targetType = byte.MaxValue;
foreach (KeyValuePair<byte, Type> kv in typeMap)
{
if (typeof(T) == kv.Value)
{
targetType = kv.Key;
break;
}
}
if (targetType == byte.MaxValue)
throw new Exception("Invalid type specified");
BMSByte data = ObjectMapper.BMSByte(targetType, responseHookIncrementer, key);
Binary sendFrame = new Binary(Socket.Time.Timestep, Socket is TCPClient, data, Receivers.Server, MessageGroupIds.CACHE, Socket is BaseTCP);
if (Socket is SteamP2PClient)
((SteamP2PClient)Socket).Send(sendFrame, true);
else if (Socket is BaseTCP)
((TCPClient)Socket).Send(sendFrame);
else
((UDPClient)Socket).Send(sendFrame, true);
responseHookIncrementer++;
}
/// <summary>
/// Inserts a NEW key/value into cache
/// </summary>
/// <typeparam name="T">The serializable type of object</typeparam>
/// <param name="key">The name variable used for storing the specified object</param>
/// <param name="value">The object that is to be stored into cache</param>
/// <returns>True if successful insert or False if the key already exists</returns>
public bool Insert<T>(string key, T value)
{
return Insert(key, value, maxDateTime);
}
/// <summary>
/// Inserts a NEW key/value into cache
/// </summary>
/// <typeparam name="T">The serializable type of object</typeparam>
/// <param name="key">The name variable used for storing the specified object</param>
/// <param name="value">The object that is to be stored into cache</param>
/// <param name="expireAt">The DateTime defining when the cached object should expire</param>
/// <returns>True if successful insert or False if the key already exists</returns>
public bool Insert<T>(string key, T value, DateTime expireAt)
{
if (!(Socket is IServer))
throw new Exception("Inserting cache values is not yet supported for clients!");
if (!memory.ContainsKey(key))
return false;
memory.Add(key, new CachedObject(value, expireAt));
return true;
}
/// <summary>
/// Inserts a new key/value or updates a key's value in cache
/// </summary>
/// <typeparam name="T">The serializable type of object</typeparam>
/// <param name="key">The name variable used for storing the specified object</param>
/// <param name="value">The object that is to be stored into cache</param>
/// <remarks>
/// This inputs a value into the cache, this can only be called on the server, you can only input Types forge supports (See NetSync for supported Types).
/// </remarks>
public void Set<T>(string key, T value)
{
Set(key, value, maxDateTime);
}
/// <summary>
/// Inserts a new key/value or updates a key's value in cache
/// </summary>
/// <typeparam name="T">The serializable type of object</typeparam>
/// <param name="key">The name variable used for storing the specified object</param>
/// <param name="value">The object that is to be stored into cache</param>
/// <param name="expireAt">The DateTime defining when the cached object should expire</param>
public void Set<T>(string key, T value, DateTime expireAt)
{
if (!(Socket is IServer))
throw new Exception("Setting cache values is not yet supported for clients!");
var cachedObject = new CachedObject(value, expireAt);
if (!memory.ContainsKey(key))
memory.Add(key, cachedObject);
else
memory[key] = cachedObject;
}
/// <summary>
/// CachedObject class.
/// </summary>
public class CachedObject
{
public object Value { get; private set; }
public DateTime ExpireAt { get; private set; }
public CachedObject(object value, DateTime expireAt)
{
Value = value;
ExpireAt = expireAt;
}
public bool IsExpired()
{
return DateTime.Now >= ExpireAt;
}
}
}
} | 34.093567 | 155 | 0.638336 | [
"MIT"
] | cschoenig/ForgeNetworkingRemastered | BeardedManStudios/Source/Forge/DataStore/Cache.cs | 11,662 | C# |
using System.Numerics;
using SixLabors.Fonts;
using SixLabors.Primitives;
namespace SixLabors.Shapes.Temp
{
/// <summary>
/// Text drawing extensions for a PathBuilder
/// </summary>
public static class TextBuilder
{
/// <summary>
/// Generates the shapes corresponding the glyphs described by the font and with the setting ing withing the FontSpan
/// </summary>
/// <param name="text">The text to generate glyphs for</param>
/// <param name="location">The location</param>
/// <param name="style">The style and settings to use while rendering the glyphs</param>
/// <returns></returns>
public static (IPathCollection paths, IPathCollection boxes, IPath textBox) GenerateGlyphsWithBox(string text, Vector2 location, RendererOptions style)
{
var glyphBuilder = new GlyphBuilder(location);
var renderer = new TextRenderer(glyphBuilder);
renderer.RenderText(text, style);
return (glyphBuilder.Paths, glyphBuilder.Boxes, glyphBuilder.TextBox);
}
/// <summary>
/// Generates the shapes corresponding the glyphs described by the font and with the setting ing withing the FontSpan
/// </summary>
/// <param name="text">The text to generate glyphs for</param>
/// <param name="location">The location</param>
/// <param name="style">The style and settings to use while rendering the glyphs</param>
/// <returns></returns>
public static IPathCollection GenerateGlyphs(string text, Vector2 location, RendererOptions style)
{
return GenerateGlyphsWithBox(text, location, style).paths;
}
/// <summary>
/// Generates the shapes corresponding the glyphs described by the font and with the setting ing withing the FontSpan
/// </summary>
/// <param name="text">The text to generate glyphs for</param>
/// <param name="style">The style and settings to use while rendering the glyphs</param>
/// <returns></returns>
public static IPathCollection GenerateGlyphs(string text, RendererOptions style)
{
return GenerateGlyphs(text, Vector2.Zero, style);
}
/// <summary>
/// Generates the shapes corresponding the glyphs described by the font and with the setting ing withing the FontSpan
/// </summary>
/// <param name="text">The text to generate glyphs for</param>
/// <param name="style">The style and settings to use while rendering the glyphs</param>
/// <returns></returns>
public static (IPathCollection paths, IPathCollection boxes, IPath textBox) GenerateGlyphsWithBox(string text, RendererOptions style)
{
return GenerateGlyphsWithBox(text, Vector2.Zero, style);
}
/// <summary>
/// Generates the shapes corresponding the glyphs described by the font and with the setting in within the FontSpan along the described path.
/// </summary>
/// <param name="text">The text to generate glyphs for</param>
/// <param name="path">The path to draw the text in relation to</param>
/// <param name="style">The style and settings to use while rendering the glyphs</param>
/// <returns></returns>
public static IPathCollection GenerateGlyphs(string text, IPath path, RendererOptions style)
{
var glyphBuilder = new PathGlyphBuilder(path);
var renderer = new TextRenderer(glyphBuilder);
renderer.RenderText(text, style);
return glyphBuilder.Paths;
}
}
}
| 44.313253 | 159 | 0.646819 | [
"Apache-2.0"
] | jakubmisek/Fonts | samples/DrawWithImageSharp/TextBuilder/TextBuilder.cs | 3,678 | C# |
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using System;
public class GameSceneScript : Scene<TransitionData>
{
public bool endGame;
public static bool hasWon { get; private set; }
public const int LEFT_CLICK = 0;
public const int RIGHT_CLICK = 1;
TaskManager _tm = new TaskManager();
private void Start()
{
}
internal override void OnEnter(TransitionData data)
{
}
public void EnterScene()
{
}
public void SwapScene()
{
Services.AudioManager.SetVolume(1.0f);
Services.Scenes.Swap<TitleSceneScript>();
}
public void SceneTransition()
{
_tm.Do
(
new ActionTask(SwapScene)
);
}
private void EndGame()
{
Services.AudioManager.FadeAudio();
}
public void EndTransition()
{
}
// Update is called once per frame
void Update ()
{
_tm.Update();
}
}
| 16.84375 | 56 | 0.561224 | [
"Unlicense"
] | chrsjwilliams/Grief | Grief/Assets/Scripts/_ChrsUtils/SceneManager/GameSceneScript.cs | 1,080 | C# |
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering;
public class CameraRayCast: MonoBehaviour
{
public static float drawRadius = 0.05f;
public static bool isRayCast = false;
public static Vector4 currentPos;
Camera m_camera;
// Start is called before the first frame update
void Start()
{
m_camera = Camera.main;
}
// Update is called once per frame
void Update()
{
isRayCast = false;
if (Input.GetMouseButton(0))
{
Ray ray = m_camera.ScreenPointToRay(Input.mousePosition);
RaycastHit hit = new RaycastHit();
if (Physics.Raycast(ray, out hit))
{
isRayCast = true;
currentPos = new Vector4(hit.textureCoord.x, hit.textureCoord.y, drawRadius);
Shader.SetGlobalVector("_HitPoint", currentPos);
}
}
}
}
| 21.218182 | 94 | 0.500428 | [
"MIT"
] | alen-cell/URP-UniversalWaterTool | UniversalWater-PartOneCode/Scripts/CameraRayCast.cs | 1,169 | C# |
namespace BA.Configuration
{
public static class Configuration
{
private static ApplicationSettings AppSet = null;
static Configuration()
{ AppSet = new ApplicationSettings(); }
public static ApplicationSettings AppSets
{ get { return AppSet; } }
}
}
| 23.461538 | 57 | 0.642623 | [
"Apache-2.0"
] | mustafasacli/BuroAsistan.Repo | BuroAsistan/BA.Configuration/Configuration.cs | 307 | C# |
using Dapper;
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using System.Linq;
namespace GhoulSQL.Sql
{
/// <summary>
/// 这是一个SQL生成工具类,避免繁琐的SQL拼接工作
/// </summary>
public class SqlBuilder
{
/// <summary>
/// 拼接模式(SqlBuilder会根据不同的拼接模式生成不同的Sql)
/// </summary>
enum Mode
{
SELECT = 0,
INSERT = 1,
UPDATE = 2,
DELETE = 3,
REPLACE = 4,
}
Mode _mode = Mode.SELECT;
bool _selectScopeIdentify = false;
DynamicParameters _parameters = new DynamicParameters();
IDictionary<string, List<object>> sqlParts;
public SqlBuilder()
{
this.sqlParts = new Dictionary<string, List<object>>();
}
/// <summary>
/// SqlBuilder的快速声明方式,通过此方法,您可以快速调用,例如:
/// SqlBuilder.Instance().Table....而不需要New SqlBuilder().Table...
/// </summary>
/// <returns></returns>
public static SqlBuilder Instance()
{
return new SqlBuilder();
}
private void AddSqlPart(string name, object value)
{
if (!this.sqlParts.ContainsKey(name))
this.sqlParts.Add(name, new List<object>());
this.sqlParts[name].Add(value);
}
private void RemoveSqlPart(string name)
{
if (this.sqlParts.ContainsKey(name))
this.sqlParts.Remove(name);
}
private List<object> GetSqlPart(string name)
{
if (!this.sqlParts.ContainsKey(name)) return null;
return this.sqlParts[name];
}
/// <summary>
/// 用于生成插入语句,只允许调用一次
/// </summary>
/// <param name="tableName">要插入的表名.</param>
/// <returns></returns>
public SqlBuilder Insert(string tableName)
{
this._mode = Mode.INSERT;
this.AddSqlPart("table", tableName);
return this;
}
/// <summary>
/// Duplicates the specified update keys.
/// </summary>
/// <param name="updateKeys">需要更新的Key.</param>
/// <param name="replace">是否替换,true则直接替换,false则 = oldValue+newValue </param>
/// <returns></returns>
public SqlBuilder Duplicate(string fieldName, string fieldValue)
{
if (!this.IsInsert) return this;
if (string.IsNullOrEmpty(fieldName) || string.IsNullOrEmpty(fieldValue)) return this;
this.AddSqlPart("duplicate_update", new KeyValuePair<string, string>(fieldName, fieldValue));
return this;
}
/// <summary>
/// Insert语句的数据,在Insert之后调用,可多次调用,代表插入不同列的值.
/// 例如: SqlBuilder().Insert('Table').Value("Name","Name").Value("Age",13)
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="fieldName">字段名.</param>
/// <param name="fieldValue">字段值.</param>
/// <param name="isLiteral">是否原生,例如在调用GETDATE()等方法是,传入“GETDATE()”会直接写在SQL中.</param>
/// <returns></returns>
public SqlBuilder Value<T>(string fieldName, T fieldValue, bool isLiteral = false)
{
if (isLiteral)
{
this.AddSqlPart("insert_value", new object[] { fieldName, fieldValue });
}
else
{
var parameterName = fieldName.Replace("`", "");
this.AddSqlPart("insert_value", new object[] { fieldName, "@" + parameterName });
this._parameters.Add(parameterName, fieldValue);
}
return this;
}
/// <summary>
/// 是否查询更改(用在Insert语句中)
/// </summary>
/// <returns></returns>
public SqlBuilder SelectIdentity()
{
if (this._mode != Mode.INSERT) return this;
this._selectScopeIdentify = true;
return this;
}
/// <summary>
/// 用户生成Update语句,只允许调用一次
/// </summary>
/// <param name="tableName">Name of the table.</param>
/// <returns></returns>
public SqlBuilder Update(string tableName)
{
this._mode = Mode.UPDATE;
this.AddSqlPart("table", tableName);
return this;
}
/// <summary>
/// 在生成Update语句时使用。例如:
/// SqlBuilder.Instance().Update("Talbe").Set("Name","New Name").Set...
/// <typeparam name="T"></typeparam>
/// <param name="fieldName">字段名.</param>
/// <param name="fieldValue">字段值.</param>
/// <param name="isLiteral">是否原生,例如在调用GETDATE()等方法是,传入“GETDATE()”会直接写在SQL中.</param>
/// <returns></returns>
public SqlBuilder Set<T>(string fieldName, T fieldValue, bool isLiteral = false)
{
//if (fieldValue == null) return this;
if (isLiteral)
{
this.AddSqlPart("update_value", string.Format("{0}={1}", fieldName, fieldValue));
}
else
{
string setStatement = string.Empty;
// 纯字段
var isField = Regex.IsMatch(fieldName, @"^\w+$");
if (isField)
{
setStatement = $"`{fieldName}`=@{fieldName}";
this._parameters.Add(fieldName.Replace("`", ""), fieldValue);
}
else
{
var parameterName = this.ParseParametersName(fieldName).FirstOrDefault().Replace("@", "").Replace("`", "");
if (string.IsNullOrEmpty(parameterName)) return this;
setStatement = $"`{parameterName}`=@{parameterName}";
this._parameters.Add(parameterName, fieldValue);
}
this.AddSqlPart("update_value", setStatement);
}
return this;
}
/// <summary>
/// 在生成Update语句时使用。例如:
/// SqlBuilder.Instance().Update("Talbe").Set(CheckName(),"Name","New Name").Set...
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="isExtend">是否扩展Set语句,如果为True,则后续增加Where,使用本重载可避免判断If(condition.IsContains<T>..),增加连贯性 ,.</param>
/// <param name="fieldName">Name of the field.</param>
/// <param name="fieldValue">The field value.</param>
/// <param name="isLiteral">if set to <c>true</c> [is literal].</param>
/// <returns></returns>
public SqlBuilder Set<T>(bool isExtend, string fieldName, T fieldValue, bool isLiteral = false)
{
if (isExtend)
return this.Set(fieldName, fieldValue, isLiteral);
return this;
}
/// <summary>
/// 用于生成删除语句,只允许调用一次
/// </summary>
/// <param name="tableName">Name of the table.</param>
/// <returns></returns>
public SqlBuilder Delete(string tableName)
{
this._mode = Mode.DELETE;
this.AddSqlPart("table", tableName);
return this;
}
/// <summary>
/// 用于生成查询语句设置表名,可多次调用。例如:
/// SqlBuilder.Instance().Table("Table1").Table("Table2")
/// 这样会生成Sql select ... from Table1,Table2...
/// </summary>
/// <param name="tableName">Name of the table.</param>
/// <param name="alias">The alias.</param>
/// <returns></returns>
public SqlBuilder Table(string tableName, string alias = null)
{
var tableStr = string.IsNullOrEmpty(alias) ? tableName : string.Format("{0} {1}", tableName, alias);
this.AddSqlPart("table", tableStr);
return this;
}
public SqlBuilder Join(string table, string alias, string onCondition, string joinType = "")
{
var joinStr = string.Format("{0} JOIN {1} {2} ON {3}", joinType, table, alias, onCondition);
this.AddSqlPart("join", joinStr);
return this;
}
public SqlBuilder StraightJoin(string table, string alias, string onCondition)
{
var joinStr = string.Format(" STRAIGHT_JOIN {0} {1} ON {2}", table, alias, onCondition);
this.AddSqlPart("join", joinStr);
return this;
}
public SqlBuilder LeftJoin(string table, string alias, string onCondition)
{
return Join(table, alias, onCondition, " LEFT");
}
public SqlBuilder RightJoin(string table, string alias, string onCondition)
{
return Join(table, alias, onCondition, " Right");
}
public SqlBuilder InnerJoin(string table, string alias, string onCondition)
{
return Join(table, alias, onCondition, " Inner");
}
//寻找参数正则
Regex _parameterReg = new Regex(@"@\w+", RegexOptions.IgnoreCase);
private IEnumerable<string> ParseParametersName(string plainText)
{
var matches = _parameterReg.Matches(plainText);
foreach (Match match in matches)
yield return match.Groups[0].Value;
}
/// <summary>
/// Where条件,可在Select,Update,Delete模式下使用。例如:
/// Where("Name=@Name","Hello").Where("Age=1")
/// </summary>
/// <param name="isExtend">是否扩展Where语句,如果为True,则后续增加Where,使用本重载可避免判断If(condition.IsContains<T>..),增加连贯性 ,</param>
/// <param name="condition">The condition.</param>
/// <param name="args">The arguments.</param>
/// <returns></returns>
public SqlBuilder Where(bool isExtend, string condition, params object[] args)
{
if (isExtend)
return this.Where(condition, args);
return this;
}
/// <summary>
/// Where条件,可在Select,Update,Delete模式下使用。例如:
/// Where("Name=@Name","Hello").Where("Age=1")
/// </summary>
/// <param name="condition">Where条件,条件中带有@时认为需要传入参数,该方法会自动生成对应的SqlParameter..</param>
/// <param name="args"参数,数量必须等于条件中带@变量的数量,否则此条件不成立。</param>
/// <returns></returns>
public SqlBuilder Where(string condition, params object[] args)
{
return this.WhereEnumerable(condition, args);
}
public SqlBuilder WhereEnumerable<T>(string condition, IEnumerable<T> args)
{
//获取条件中的参数
//var matches = _parameterReg.Matches(condition);
//if (matches == null || matches.Count != args.Length) return this;
var parameters = ParseParametersName(condition).ToList();
// 如果参数数量等于条件中参数数量,则说明未使用匿名实例,按顺序匹配参数
if (parameters.Count != 0 && (args.Count() == parameters.Count))
{
for (var i = 0; i < parameters.Count; i++)
this._parameters.Add(parameters[i].Replace("`", ""), args.ElementAt(i));
}
else
{
foreach (var arg in args)
this._parameters.AddDynamicParams(arg);
}
this.AddSqlPart("where", condition);
return this;
}
public SqlBuilder WhereIn<T>(bool isExtend, string fieldName, IEnumerable<T> args)
{
if (isExtend)
this.WhereIn(fieldName, args);
return this;
}
public SqlBuilder WhereIn<T>(string fieldName, IEnumerable<T> args)
{
string[] inArgs = new string[args.Count()];
for (var i = 0; i < args.Count(); i++)
inArgs[i] = $"@{fieldName.Replace(".", "_")}_IN_{i}";
var conditions = $"{fieldName} in ({string.Join(",", inArgs)})";
return this.WhereEnumerable(conditions, args);
}
public SqlBuilder Select(params string[] selects)
{
foreach (var select in selects)
this.AddSqlPart("select", select);
return this;
}
/// <summary>
/// 清除已声明的Select语句,常用于对复用SQL Builder的复写。
/// </summary>
/// <returns></returns>
public SqlBuilder ClearSelect()
{
this.RemoveSqlPart("select");
return this;
}
public SqlBuilder ForUpdate()
{
this.AddSqlPart("forupdate", true);
return this;
}
/// <summary>
/// 分页
/// </summary>
/// <param name="pageIndex">页码.</param>
/// <param name="pageSize">页查询数.</param>
/// <param name="isCountTotal">是否附加Count语句,True的话最终生成的语句中多一个SELECT COUNT(0) ...语句.</param>
/// <param name="totals">用于做聚合查询的语句,如: Sum(Amount) as Amount,Sum(Balance) as Balance</param>
/// <returns></returns>
public SqlBuilder Page(int pageIndex, int pageSize, bool isCountTotal = true, string totals = "")
{
int skip = (pageIndex - 1) * pageSize;
this.AddSqlPart("page_args", skip);
this.AddSqlPart("page_args", pageSize);
this.AddSqlPart("page_args", isCountTotal);
this.AddSqlPart("page_args", totals);
return this;
}
public SqlBuilder OrderBy(string field, string orderType = "DESC")
{
if (string.IsNullOrEmpty(field))
field = "1";
string orderStr = string.Format("{0} {1}", field, orderType);
this.AddSqlPart("orderby", orderStr);
return this;
}
public SqlBuilder GroupBy(params string[] fields)
{
foreach (var field in fields)
this.AddSqlPart("groupby", field);
return this;
}
public SqlBuilder Limit(int offset, int rows)
{
this.AddSqlPart("limit", offset);
this.AddSqlPart("limit", rows);
return this;
}
public string ToSql()
{
switch (this._mode)
{
case Mode.INSERT: return PasrseInsertSql();
case Mode.UPDATE: return ParseUpdateSql();
case Mode.DELETE: return ParseDeleteSql();
default: return ParseSelectSql();
}
}
private string PasrseInsertSql()
{
var tableParts = this.GetSqlPart("table");
if (tableParts == null || tableParts.Count != 1) throw new Exception("Insert require a table.Only One!");
var table = tableParts[0].ToString();
var valueParts = this.GetSqlPart("insert_value");
if (valueParts == null || valueParts.Count == 0) throw new Exception("Insert require name and value");
string[] keys = new string[valueParts.Count];
string[] values = new string[valueParts.Count];
for (var i = 0; i < valueParts.Count; i++)
{
var valArr = (object[])valueParts[i];
keys[i] = valArr[0].ToString();
values[i] = valArr[1].ToString();
}
var sql = string.Format("Insert into {0} ({1}) values ({2})", table, string.Join(",", keys), string.Join(",", values));
var duplicate = this.GetSqlPart("duplicate_update");
if (duplicate != null)
{
sql += " ON DUPLICATE KEY UPDATE ";
bool isFirst = true;
foreach (KeyValuePair<string, string> item in duplicate)
{
if (isFirst) isFirst = false;
else sql += ",";
var valueExp = $"{item.Key}={item.Value}";
sql += valueExp;
}
}
if (_selectScopeIdentify)
sql += ";select last_insert_id() as id;";
return sql;
}
private string ParseUpdateSql()
{
var tableParts = this.GetSqlPart("table");
if (tableParts == null || tableParts.Count != 1) throw new Exception("Update require a table.Only One!");
var table = tableParts[0].ToString();
var valueParts = this.GetSqlPart("update_value");
if (valueParts == null || valueParts.Count == 0) throw new Exception("Update require name and value");
string[] setArr = new string[valueParts.Count];
for (var i = 0; i < valueParts.Count; i++)
{
setArr[i] = valueParts[i].ToString();
}
var whereParts = this.GetSqlPart("where");
var whereStr = whereParts == null ? "" : (" where " + string.Join(" and ", whereParts));
return string.Format("update {0} set {1}", table, string.Join(",", setArr)) + whereStr;
}
private string ParseDeleteSql()
{
var tableParts = this.GetSqlPart("table");
if (tableParts == null || tableParts.Count != 1) throw new Exception("Delete require a table.Only One!");
var table = tableParts[0].ToString();
var whereParts = this.GetSqlPart("where");
var whereStr = whereParts == null ? "" : (" where " + string.Join(" and ", whereParts));
return string.Format("delete from {0} ", table) + whereStr;
}
private string ParseSelectSql()
{
var sb = new StringBuilder();
var selectParts = this.GetSqlPart("select");
var selectStr = selectParts == null ? "*" : string.Join(",", selectParts);
var tableParts = this.GetSqlPart("table");
if (tableParts == null) throw new Exception("Table Can't be null.");
var tableStr = string.Join(",", tableParts);
var pageParts = this.GetSqlPart("page_args");
var isPage = pageParts != null && pageParts.Count == 4;
var forUpdateParts = this.GetSqlPart("forupdate");
var forUpdate = forUpdateParts != null && forUpdateParts.Count == 1 && (bool)forUpdateParts[0];
sb.AppendFormat("select {0} from {1}", selectStr, tableStr);
var joinParts = this.GetSqlPart("join");
var joinStr = joinParts == null ? "" : string.Join(" ", joinParts);
var whereParts = this.GetSqlPart("where");
var whereStr = whereParts == null ? "" : (" where " + string.Join(" and ", whereParts));
var groupbyParts = this.GetSqlPart("groupby");
var groupbyStr = groupbyParts == null ? "" : (" group by " + string.Join(",", groupbyParts));
var orderbyParts = this.GetSqlPart("orderby");
var orderbyStr = orderbyParts == null ? "" : (" order by " + string.Join(",", orderbyParts));
var limitParts = this.GetSqlPart("limit");
var limitStr = limitParts != null && limitParts.Count == 2 ? (" limit " + string.Join(",", limitParts)) : "";
sb.Append(joinStr).Append(whereStr).Append(groupbyStr).Append(orderbyStr).Append(limitStr);
var isPageCountTotal = false;
if (isPage)
{
isPageCountTotal = (bool)pageParts[2];
var sql = $"{sb.ToString()} limit {pageParts[0]}, {pageParts[1]}";
if (forUpdate)
sql += " for update";
if (isPageCountTotal)
{
var pageTotals = pageParts[3].ToString();
if (!string.IsNullOrEmpty(pageTotals))
pageTotals = " ," + pageTotals;
sql += string.Format(";select count(0) as Count{1} from ({0}) CT", sb.ToString(), pageTotals);
}
return sql;
}
else
{
if (forUpdate)
sb.Append(" for update");
return sb.ToString();
}
}
/// <summary>
/// 分页查询是否有附加获取全部总数语句
/// </summary>
/// <value>
/// <c>true</c> if this instance is count total; otherwise, <c>false</c>.
/// </value>
public bool IsCountTotal
{
get
{
var pageParts = this.GetSqlPart("page_args");
var isPage = pageParts != null && pageParts.Count == 3;
if (isPage)
{
return (bool)pageParts[2];
}
return false;
}
}
public DynamicParameters Parameters
{
get
{
return this._parameters;
}
}
public bool IsUpdate
{
get
{
return this._mode == Mode.UPDATE;
}
}
public bool IsInsert
{
get
{
return this._mode == Mode.INSERT;
}
}
public bool IsDelete
{
get
{
return this._mode == Mode.DELETE;
}
}
public bool IsSelect
{
get
{
return this._mode == Mode.SELECT;
}
}
}
/// <summary>
/// 锁类型
/// http://www.cnblogs.com/wuyifu/archive/2013/11/28/3447870.html
/// </summary>
public enum LockType
{
/// <summary>
/// NOLOCK(不加锁)
/// 此选项被选中时,SQL Server 在读取或修改数据时不加任何锁。
/// 在这种情况下,用户有可能读取到未完成事务(Uncommited Transaction)或回滚(Roll Back)中的数据, 即所谓的“脏数据”。
/// </summary>
NOLOCK = 0,
/// <summary>
/// HOLDLOCK(保持锁)
/// 此选项被选中时,SQL Server 会将此共享锁保持至整个事务结束,而不会在途中释放。
/// </summary>
HOLDLOCK = 1,
/// <summary>
/// UPDLOCK(修改锁)
/// 此选项被选中时,SQL Server 在读取数据时使用修改锁来代替共享锁,并将此锁保持至整个事务或命令结束。
/// 使用此选项能够保证多个进程能同时读取数据但只有该进程能修改数据
/// </summary>
UPDLOCK = 2
}
}
| 34.543444 | 131 | 0.518705 | [
"Apache-2.0"
] | yosalo/GhoulSQL | src/GhoulSQL/Sql/SqlBuilder.cs | 23,370 | C# |
namespace System.Web.Mvc {
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Web.Mvc.Resources;
internal sealed class ActionMethodSelector {
public ActionMethodSelector(Type controllerType) {
ControllerType = controllerType;
PopulateLookupTables();
}
public Type ControllerType {
get;
private set;
}
public MethodInfo[] AliasedMethods {
get;
private set;
}
public ILookup<string, MethodInfo> NonAliasedMethods {
get;
private set;
}
private AmbiguousMatchException CreateAmbiguousMatchException(List<MethodInfo> ambiguousMethods, string actionName) {
StringBuilder exceptionMessageBuilder = new StringBuilder();
foreach (MethodInfo methodInfo in ambiguousMethods) {
string controllerAction = Convert.ToString(methodInfo, CultureInfo.CurrentCulture);
string controllerType = methodInfo.DeclaringType.FullName;
exceptionMessageBuilder.AppendLine();
exceptionMessageBuilder.AppendFormat(CultureInfo.CurrentCulture, MvcResources.ActionMethodSelector_AmbiguousMatchType, controllerAction, controllerType);
}
string message = String.Format(CultureInfo.CurrentCulture, MvcResources.ActionMethodSelector_AmbiguousMatch,
actionName, ControllerType.Name, exceptionMessageBuilder);
return new AmbiguousMatchException(message);
}
public MethodInfo FindActionMethod(ControllerContext controllerContext, string actionName) {
List<MethodInfo> methodsMatchingName = GetMatchingAliasedMethods(controllerContext, actionName);
methodsMatchingName.AddRange(NonAliasedMethods[actionName]);
List<MethodInfo> finalMethods = RunSelectionFilters(controllerContext, methodsMatchingName);
switch (finalMethods.Count) {
case 0:
return null;
case 1:
return finalMethods[0];
default:
throw CreateAmbiguousMatchException(finalMethods, actionName);
}
}
internal List<MethodInfo> GetMatchingAliasedMethods(ControllerContext controllerContext, string actionName) {
// find all aliased methods which are opting in to this request
// to opt in, all attributes defined on the method must return true
var methods = from methodInfo in AliasedMethods
let attrs = ReflectedAttributeCache.GetActionNameSelectorAttributes(methodInfo)
where attrs.All(attr => attr.IsValidName(controllerContext, actionName, methodInfo))
select methodInfo;
return methods.ToList();
}
private static bool IsMethodDecoratedWithAliasingAttribute(MethodInfo methodInfo) {
return methodInfo.IsDefined(typeof(ActionNameSelectorAttribute), true /* inherit */);
}
private static bool IsValidActionMethod(MethodInfo methodInfo) {
return !(methodInfo.IsSpecialName ||
methodInfo.GetBaseDefinition().DeclaringType.IsAssignableFrom(typeof(Controller)));
}
private void PopulateLookupTables() {
MethodInfo[] allMethods = ControllerType.GetMethods(BindingFlags.InvokeMethod | BindingFlags.Instance | BindingFlags.Public);
MethodInfo[] actionMethods = Array.FindAll(allMethods, IsValidActionMethod);
AliasedMethods = Array.FindAll(actionMethods, IsMethodDecoratedWithAliasingAttribute);
NonAliasedMethods = actionMethods.Except(AliasedMethods).ToLookup(method => method.Name, StringComparer.OrdinalIgnoreCase);
}
private static List<MethodInfo> RunSelectionFilters(ControllerContext controllerContext, List<MethodInfo> methodInfos) {
// remove all methods which are opting out of this request
// to opt out, at least one attribute defined on the method must return false
List<MethodInfo> matchesWithSelectionAttributes = new List<MethodInfo>();
List<MethodInfo> matchesWithoutSelectionAttributes = new List<MethodInfo>();
foreach (MethodInfo methodInfo in methodInfos) {
ICollection<ActionMethodSelectorAttribute> attrs = ReflectedAttributeCache.GetActionMethodSelectorAttributes(methodInfo);
if (attrs.Count == 0) {
matchesWithoutSelectionAttributes.Add(methodInfo);
}
else if (attrs.All(attr => attr.IsValidForRequest(controllerContext, methodInfo))) {
matchesWithSelectionAttributes.Add(methodInfo);
}
}
// if a matching action method had a selection attribute, consider it more specific than a matching action method
// without a selection attribute
return (matchesWithSelectionAttributes.Count > 0) ? matchesWithSelectionAttributes : matchesWithoutSelectionAttributes;
}
}
}
| 46.394737 | 169 | 0.66591 | [
"Apache-2.0"
] | 121468615/mono | mcs/class/System.Web.Mvc3/Mvc/ActionMethodSelector.cs | 5,291 | C# |
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the rds-2014-10-31.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.RDS.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
namespace Amazon.RDS.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for DBProxyEndpointNotFoundException operation
/// </summary>
public class DBProxyEndpointNotFoundExceptionUnmarshaller : IErrorResponseUnmarshaller<DBProxyEndpointNotFoundException, XmlUnmarshallerContext>
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public DBProxyEndpointNotFoundException Unmarshall(XmlUnmarshallerContext context)
{
return this.Unmarshall(context, new ErrorResponse());
}
/// <summary>
/// Unmarshaller error response to exception.
/// </summary>
/// <param name="context"></param>
/// <param name="errorResponse"></param>
/// <returns></returns>
public DBProxyEndpointNotFoundException Unmarshall(XmlUnmarshallerContext context, ErrorResponse errorResponse)
{
DBProxyEndpointNotFoundException response = new DBProxyEndpointNotFoundException(errorResponse.Message, errorResponse.InnerException,
errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode);
int originalDepth = context.CurrentDepth;
int targetDepth = originalDepth + 1;
if (context.IsStartOfDocument)
targetDepth += 2;
while (context.ReadAtDepth(originalDepth))
{
if (context.IsStartElement || context.IsAttribute)
{
}
}
return response;
}
private static DBProxyEndpointNotFoundExceptionUnmarshaller _instance = new DBProxyEndpointNotFoundExceptionUnmarshaller();
/// <summary>
/// Gets the singleton.
/// </summary>
public static DBProxyEndpointNotFoundExceptionUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 36.045455 | 148 | 0.656999 | [
"Apache-2.0"
] | ChristopherButtars/aws-sdk-net | sdk/src/Services/RDS/Generated/Model/Internal/MarshallTransformations/DBProxyEndpointNotFoundExceptionUnmarshaller.cs | 3,172 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
namespace Angular2WebpackVisualStudio.Controllers
{
[Route("api/[controller]")]
public class ValuesController : Microsoft.AspNetCore.Mvc.Controller
{
// GET: api/values
[HttpGet]
public IActionResult Get()
{
return new JsonResult(new string[] { "value1", "value2" });
}
// GET api/values/5
[HttpGet("{id}")]
public IActionResult Get(int id)
{
return new JsonResult("value");
}
// POST api/values
[HttpPost]
public IActionResult Post([FromBody]string value)
{
return new CreatedAtRouteResult("anyroute", null);
}
// PUT api/values/5
[HttpPut("{id}")]
public IActionResult Put(int id, [FromBody]string value)
{
return new OkResult();
}
// DELETE api/values/5
[HttpDelete("{id}")]
public IActionResult Delete(int id)
{
return new NoContentResult();
}
}
}
| 25.208333 | 72 | 0.542149 | [
"ISC"
] | manuelmoyaroldan/material | Angular2WebpackVisualStudio/src/Angular2WebpackVisualStudio/Controllers/ValuesController.cs | 1,212 | C# |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("WebApiToTypeScript.Cmd")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("WebApiToTypeScript.Cmd")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("de598024-709a-45f1-a203-16bfdda12e95")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| 39.27027 | 85 | 0.728837 | [
"MIT"
] | amiserda/webapi-typescript-endpoints | WebApiToTypeScript/WebApiToTypeScript.Cmd/Properties/AssemblyInfo.cs | 1,456 | C# |
using System;
using System.Collections.Immutable;
namespace PostSharp.Engineering.BuildTools.Dependencies.Model
{
public static class Dependencies
{
public static DependencyDefinition MetalamaCompiler { get; } = new(
"Metalama.Compiler",
VcsProvider.AzureRepos,
"Metalama" )
{
// The release build is intentionally used for the debug configuration because we want dependencies to consume the release
// build, for performance reasons. The debug build will be used only locally, and for this we don't need a configuration here.
CiBuildTypes = new ConfigurationSpecific<string>(
"Metalama_MetalamaCompiler_ReleaseBuild",
"Metalama_MetalamaCompiler_ReleaseBuild",
"Metalama_MetalamaCompiler_PublicBuild" )
};
public static DependencyDefinition Metalama { get; } = new(
"Metalama",
VcsProvider.AzureRepos,
"Metalama" );
public static DependencyDefinition MetalamaSamples { get; } = new( "Metalama.Samples", VcsProvider.GitHub, "Metalama", false );
public static DependencyDefinition MetalamaDocumentation { get; } = new( "Metalama.Documentation", VcsProvider.GitHub, "Metalama", false );
public static DependencyDefinition MetalamaTry { get; } = new( "Metalama.Try", VcsProvider.AzureRepos, "Metalama", false );
public static DependencyDefinition MetalamaVsx { get; } = new( "Metalama.Vsx", VcsProvider.AzureRepos, "Metalama" );
public static DependencyDefinition MetalamaOpenAutoCancellationToken { get; } =
new( "Metalama.Open.AutoCancellationToken", VcsProvider.GitHub, "Metalama" )
{
// Metalama.Open.AutoCancellationToken is part of Metalama.Open products, which is propagated to build type string.
CiBuildTypes = new ConfigurationSpecific<string>(
"Metalama_MetalamaOpen_MetalamaOpenAutoCancellationToken_DebugBuild",
"Metalama_MetalamaOpen_MetalamaOpenAutoCancellationToken_ReleaseBuild",
"Metalama_MetalamaOpen_MetalamaOpenAutoCancellationToken_PublicBuild" ),
DeploymentBuildType = "Metalama_MetalamaOpen_MetalamaOpenAutoCancellationToken_PublicDeployment",
BumpBuildType = "Metalama_MetalamaOpen_MetalamaOpenAutoCancellationToken_VersionBump"
};
public static DependencyDefinition PostSharpEngineering { get; } = new(
"PostSharp.Engineering",
VcsProvider.GitHub,
"postsharp" )
{
GenerateSnapshotDependency = false,
// We always use the debug build for engineering.
CiBuildTypes = new ConfigurationSpecific<string>(
"PostSharpEngineering_DebugBuild",
"PostSharpEngineering_DebugBuild",
"PostSharpEngineering_DebugBuild" )
};
[Obsolete( "Renamed to MetalamaBackstage" )]
public static DependencyDefinition PostSharpBackstageSettings { get; } = new(
"PostSharp.Backstage.Settings",
VcsProvider.AzureRepos,
"Metalama" );
public static DependencyDefinition MetalamaBackstage { get; } = new(
"Metalama.Backstage",
VcsProvider.AzureRepos,
"Metalama" );
public static ImmutableArray<DependencyDefinition> All { get; } = ImmutableArray.Create(
MetalamaCompiler,
Metalama,
MetalamaDocumentation,
MetalamaSamples,
MetalamaTry,
MetalamaVsx,
MetalamaOpenAutoCancellationToken,
PostSharpEngineering,
MetalamaBackstage );
}
} | 46.146341 | 147 | 0.655127 | [
"MIT"
] | postsharp/PostSharp.Engineering | src/PostSharp.Engineering.BuildTools/Dependencies/Model/Dependencies.cs | 3,784 | C# |
//
// Copyright (C) DataStax Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
namespace Cassandra.IntegrationTests.Core
{
using System.Threading.Tasks;
using Cassandra.IntegrationTests.TestBase;
using NUnit.Framework;
[TestFixture, Category("short"), Category("realcluster")]
public class SchemaAgreementTests : SharedClusterTest
{
public SchemaAgreementTests() : base(2, false, true)
{
}
private Cluster _cluster;
private Session _session;
private const int MaxSchemaAgreementWaitSeconds = 30;
private const int MaxTestSchemaAgreementRetries = 240;
public override void OneTimeSetUp()
{
base.OneTimeSetUp();
_cluster = Cluster.Builder().AddContactPoint(TestCluster.InitialContactPoint)
.WithSocketOptions(new SocketOptions()
.SetReadTimeoutMillis(15000)
.SetConnectTimeoutMillis(60000))
.WithMaxSchemaAgreementWaitSeconds(MaxSchemaAgreementWaitSeconds)
.Build();
_session = (Session)_cluster.Connect();
_session.CreateKeyspace(KeyspaceName, null, false);
_session.ChangeKeyspace(KeyspaceName);
}
[Test]
public async Task Should_CheckSchemaAgreementReturnFalse_When_ADdlStatementIsExecutedAndOneNodeIsDown()
{
//// this test can't be done with simulacron because there's no support for schema_changed responses
TestCluster.PauseNode(2);
var tableName = TestUtils.GetUniqueTableName().ToLower();
var cql = new SimpleStatement(
$"CREATE TABLE {tableName} (id int PRIMARY KEY, description text)");
await _session.ExecuteAsync(cql).ConfigureAwait(false);
Assert.IsFalse(await _cluster.Metadata.CheckSchemaAgreementAsync().ConfigureAwait(false));
}
[Test]
public async Task Should_SchemaInAgreementReturnTrue_When_ADdlStatementIsExecutedAndAllNodesUp()
{
//// this test can't be done with simulacron because there's no support for schema_changed responses
var tableName = TestUtils.GetUniqueTableName().ToLower();
var cql = new SimpleStatement(
$"CREATE TABLE {tableName} (id int PRIMARY KEY, description text)");
var rowSet = await _session.ExecuteAsync(cql).ConfigureAwait(false);
Assert.IsTrue(rowSet.Info.IsSchemaInAgreement);
}
[Test]
public async Task Should_SchemaInAgreementReturnFalse_When_ADdlStatementIsExecutedAndOneNodeIsDown()
{
//// this test can't be done with simulacron because there's no support for schema_changed responses
TestCluster.PauseNode(2);
var tableName = TestUtils.GetUniqueTableName().ToLower();
var cql = new SimpleStatement(
$"CREATE TABLE {tableName} (id int PRIMARY KEY, description text)");
var rowSet = await _session.ExecuteAsync(cql).ConfigureAwait(false);
Assert.IsFalse(rowSet.Info.IsSchemaInAgreement);
}
[TearDown]
public void TearDown()
{
TestCluster.ResumeNode(2);
TestUtils.WaitForSchemaAgreement(_cluster, false, true, MaxTestSchemaAgreementRetries);
}
public override void OneTimeTearDown()
{
_session.Dispose();
_cluster.Dispose();
base.OneTimeTearDown();
}
}
} | 39.895238 | 112 | 0.635713 | [
"Apache-2.0"
] | mintsoft/csharp-driver | src/Cassandra.IntegrationTests/Core/SchemaAgreementTests.cs | 4,189 | C# |
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using Benchmarks;
using Newtonsoft.Json.Linq;
namespace BombardierClient
{
class Program
{
private static readonly HttpClient _httpClient;
private static readonly HttpClientHandler _httpClientHandler;
private static Dictionary<PlatformID, string> _bombardierUrls = new Dictionary<PlatformID, string>()
{
{ PlatformID.Win32NT, "https://github.com/codesenberg/bombardier/releases/download/v1.2.4/bombardier-windows-amd64.exe" },
{ PlatformID.Unix, "https://github.com/codesenberg/bombardier/releases/download/v1.2.4/bombardier-linux-amd64" },
};
static Program()
{
// Configuring the http client to trust the self-signed certificate
_httpClientHandler = new HttpClientHandler();
_httpClientHandler.ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator;
_httpClientHandler.AutomaticDecompression = System.Net.DecompressionMethods.GZip | System.Net.DecompressionMethods.Deflate;
_httpClient = new HttpClient(_httpClientHandler);
}
static async Task Main(string[] args)
{
Console.WriteLine("Bombardier Client");
Console.WriteLine("args: " + String.Join(' ', args));
var bombardierUrl = _bombardierUrls[Environment.OSVersion.Platform];
var bombardierFileName = Path.GetFileName(bombardierUrl);
using (var downloadStream = await _httpClient.GetStreamAsync(bombardierUrl))
using (var fileStream = File.Create(bombardierFileName))
{
await downloadStream.CopyToAsync(fileStream);
if (Environment.OSVersion.Platform == PlatformID.Unix)
{
Process.Start("chmod", "+x " + bombardierFileName);
}
}
var process = new Process()
{
StartInfo = {
FileName = bombardierFileName,
Arguments = String.Join(' ', args) + " --print r --format json",
RedirectStandardOutput = true,
UseShellExecute = false,
},
EnableRaisingEvents = true
};
var stringBuilder = new StringBuilder();
process.OutputDataReceived += (_, e) =>
{
if (e != null && e.Data != null)
{
stringBuilder.AppendLine(e.Data);
}
};
process.Start();
process.BeginOutputReadLine();
process.WaitForExit();
Console.WriteLine(stringBuilder);
var document = JObject.Parse(stringBuilder.ToString());
BenchmarksEventSource.Log.Metadata("bombardier/requests", "max", "sum", "Requests", "Total number of requests", "n0");
BenchmarksEventSource.Log.Metadata("bombardier/badresponses", "max", "sum", "Bad responses", "Non-2xx or 3xx responses", "n0");
BenchmarksEventSource.Log.Metadata("bombardier/latency/mean", "max", "sum", "Mean latency (us)", "Mean latency (us)", "n0");
BenchmarksEventSource.Log.Metadata("bombardier/latency/max", "max", "sum", "Max latency (us)", "Max latency (us)", "n0");
BenchmarksEventSource.Log.Metadata("bombardier/rps/max", "max", "sum", "Max RPS", "RPS: max", "n0");
BenchmarksEventSource.Log.Metadata("bombardier/raw", "all", "all", "Raw results", "Raw results", "json");
var total =
document["result"]["req1xx"].Value<int>()
+ document["result"]["req2xx"].Value<int>()
+ document["result"]["req3xx"].Value<int>()
+ document["result"]["req3xx"].Value<int>()
+ document["result"]["req4xx"].Value<int>()
+ document["result"]["req5xx"].Value<int>()
+ document["result"]["others"].Value<int>();
var success = document["result"]["req2xx"].Value<int>() + document["result"]["req3xx"].Value<int>();
BenchmarksEventSource.Measure("bombardier/requests", total);
BenchmarksEventSource.Measure("bombardier/badresponses", total - success);
BenchmarksEventSource.Measure("bombardier/latency/mean", document["result"]["latency"]["mean"].Value<double>());
BenchmarksEventSource.Measure("bombardier/latency/max", document["result"]["latency"]["max"].Value<double>());
BenchmarksEventSource.Measure("bombardier/rps/max", document["result"]["rps"]["max"].Value<double>());
BenchmarksEventSource.Measure("bombardier/raw", stringBuilder.ToString());
}
}
}
| 42.431034 | 139 | 0.602194 | [
"Apache-2.0"
] | aik-jahoda/Benchmarks | src/BombardierClient/Program.cs | 4,924 | C# |
#pragma checksum "G:\Yogesh\SEO\Yogihosting\new\Xaero\Xaero\Views\Movie\Index.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "3ee6179f90138729ce3f5de94a4c70ed9e1118f5"
// <auto-generated/>
#pragma warning disable 1591
[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.Views_Movie_Index), @"mvc.1.0.view", @"/Views/Movie/Index.cshtml")]
namespace AspNetCore
{
#line hidden
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.AspNetCore.Mvc.ViewFeatures;
#nullable restore
#line 1 "G:\Yogesh\SEO\Yogihosting\new\Xaero\Xaero\Views\_ViewImports.cshtml"
using Xaero.Models;
#line default
#line hidden
#nullable disable
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"3ee6179f90138729ce3f5de94a4c70ed9e1118f5", @"/Views/Movie/Index.cshtml")]
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"3c10609fed8cd1ab2cfce2802fea69a627c90a7b", @"/Views/_ViewImports.cshtml")]
public class Views_Movie_Index : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<List<Movie>>
{
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_0 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("asp-action", "Create", global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_1 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("class", new global::Microsoft.AspNetCore.Html.HtmlString("btn btn-secondary"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_2 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("class", new global::Microsoft.AspNetCore.Html.HtmlString("btn btn-sm btn-danger"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_3 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("asp-controller", "MovieDistribution", global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_4 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("asp-action", "Update", global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_5 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("class", new global::Microsoft.AspNetCore.Html.HtmlString("btn btn-sm btn-primary"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_6 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("asp-action", "Delete", global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_7 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("method", "post", global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_8 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("class", new global::Microsoft.AspNetCore.Html.HtmlString("pagingDiv"), global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_9 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("page-action", "Index", global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_10 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("page-class", "paging", global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
private static readonly global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute __tagHelperAttribute_11 = new global::Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute("page-class-selected", "active", global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
#line hidden
#pragma warning disable 0649
private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperExecutionContext __tagHelperExecutionContext;
#pragma warning restore 0649
private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner __tagHelperRunner = new global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner();
#pragma warning disable 0169
private string __tagHelperStringValueBuffer;
#pragma warning restore 0169
private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager __backed__tagHelperScopeManager = null;
private global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager __tagHelperScopeManager
{
get
{
if (__backed__tagHelperScopeManager == null)
{
__backed__tagHelperScopeManager = new global::Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperScopeManager(StartTagHelperWritingScope, EndTagHelperWritingScope);
}
return __backed__tagHelperScopeManager;
}
}
private global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper;
private global::Microsoft.AspNetCore.Mvc.TagHelpers.FormTagHelper __Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper;
private global::Microsoft.AspNetCore.Mvc.TagHelpers.RenderAtEndOfFormTagHelper __Microsoft_AspNetCore_Mvc_TagHelpers_RenderAtEndOfFormTagHelper;
private global::Xaero.Infrastructure.PageLinkTagHelper __Xaero_Infrastructure_PageLinkTagHelper;
#pragma warning disable 1998
public async override global::System.Threading.Tasks.Task ExecuteAsync()
{
WriteLiteral("\r\n");
#nullable restore
#line 3 "G:\Yogesh\SEO\Yogihosting\new\Xaero\Xaero\Views\Movie\Index.cshtml"
ViewData["Title"] = "Movie";
#line default
#line hidden
#nullable disable
WriteLiteral("\r\n<h1 class=\"bg-info text-white\">Movies</h1>\r\n");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "3ee6179f90138729ce3f5de94a4c70ed9e1118f57375", async() => {
WriteLiteral("Create Movie");
}
);
__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>();
__tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper);
__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Action = (string)__tagHelperAttribute_0.Value;
__tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_1);
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
if (!__tagHelperExecutionContext.Output.IsContentModified)
{
await __tagHelperExecutionContext.SetOutputContentAsync();
}
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
WriteLiteral(@"
<table class=""table table-sm table-bordered"">
<tr>
<th class=""sort"">Id</th>
<th class=""sort"">Name</th>
<th>Production Company</th>
<th>Poster</th>
<th class=""sort"">Budget</th>
<th class=""sort"">Gross</th>
<th class=""sort"">Release Date</th>
<th>Movie Distribution</th>
<th>Update</th>
<th>Delete</th>
</tr>
");
#nullable restore
#line 23 "G:\Yogesh\SEO\Yogihosting\new\Xaero\Xaero\Views\Movie\Index.cshtml"
foreach (Movie movie in Model)
{
#line default
#line hidden
#nullable disable
WriteLiteral(" <tr>\r\n <td>");
#nullable restore
#line 26 "G:\Yogesh\SEO\Yogihosting\new\Xaero\Xaero\Views\Movie\Index.cshtml"
Write(movie.Id);
#line default
#line hidden
#nullable disable
WriteLiteral("</td>\r\n <td>");
#nullable restore
#line 27 "G:\Yogesh\SEO\Yogihosting\new\Xaero\Xaero\Views\Movie\Index.cshtml"
Write(movie.MovieDetail_R.Name);
#line default
#line hidden
#nullable disable
WriteLiteral("</td>\r\n <td>");
#nullable restore
#line 28 "G:\Yogesh\SEO\Yogihosting\new\Xaero\Xaero\Views\Movie\Index.cshtml"
Write(movie.ProductionCompany_R.Name);
#line default
#line hidden
#nullable disable
WriteLiteral("</td>\r\n <td><img");
BeginWriteAttribute("src", " src=\"", 796, "\"", 842, 1);
#nullable restore
#line 29 "G:\Yogesh\SEO\Yogihosting\new\Xaero\Xaero\Views\Movie\Index.cshtml"
WriteAttributeValue("", 802, Url.Content(movie.MovieDetail_R.Poster), 802, 40, false);
#line default
#line hidden
#nullable disable
EndWriteAttribute();
WriteLiteral(" /></td>\r\n <td>");
#nullable restore
#line 30 "G:\Yogesh\SEO\Yogihosting\new\Xaero\Xaero\Views\Movie\Index.cshtml"
Write(movie.MovieDetail_R.Budget.ToString("F2"));
#line default
#line hidden
#nullable disable
WriteLiteral("</td>\r\n <td>");
#nullable restore
#line 31 "G:\Yogesh\SEO\Yogihosting\new\Xaero\Xaero\Views\Movie\Index.cshtml"
Write(movie.MovieDetail_R.Gross.ToString("F2"));
#line default
#line hidden
#nullable disable
WriteLiteral("</td>\r\n <td>");
#nullable restore
#line 32 "G:\Yogesh\SEO\Yogihosting\new\Xaero\Xaero\Views\Movie\Index.cshtml"
Write(movie.MovieDetail_R.ReleaseDate.ToString("d"));
#line default
#line hidden
#nullable disable
WriteLiteral("</td>\r\n <td>\r\n ");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "3ee6179f90138729ce3f5de94a4c70ed9e1118f511255", async() => {
WriteLiteral("\r\n Movie Distribution\r\n ");
}
);
__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>();
__tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_2);
__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Controller = (string)__tagHelperAttribute_3.Value;
__tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_3);
__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Action = (string)__tagHelperAttribute_4.Value;
__tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_4);
if (__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues == null)
{
throw new InvalidOperationException(InvalidTagHelperIndexerAssignment("asp-route-id", "Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper", "RouteValues"));
}
BeginWriteTagHelperAttribute();
#nullable restore
#line 34 "G:\Yogesh\SEO\Yogihosting\new\Xaero\Xaero\Views\Movie\Index.cshtml"
WriteLiteral(movie.Id);
#line default
#line hidden
#nullable disable
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues["id"] = __tagHelperStringValueBuffer;
__tagHelperExecutionContext.AddTagHelperAttribute("asp-route-id", __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues["id"], global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
if (!__tagHelperExecutionContext.Output.IsContentModified)
{
await __tagHelperExecutionContext.SetOutputContentAsync();
}
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
WriteLiteral("\r\n </td>\r\n <td>\r\n ");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "3ee6179f90138729ce3f5de94a4c70ed9e1118f513862", async() => {
WriteLiteral("\r\n Update\r\n ");
}
);
__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>();
__tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_5);
__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Action = (string)__tagHelperAttribute_4.Value;
__tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_4);
if (__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues == null)
{
throw new InvalidOperationException(InvalidTagHelperIndexerAssignment("asp-route-id", "Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper", "RouteValues"));
}
BeginWriteTagHelperAttribute();
#nullable restore
#line 39 "G:\Yogesh\SEO\Yogihosting\new\Xaero\Xaero\Views\Movie\Index.cshtml"
WriteLiteral(movie.Id);
#line default
#line hidden
#nullable disable
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues["id"] = __tagHelperStringValueBuffer;
__tagHelperExecutionContext.AddTagHelperAttribute("asp-route-id", __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues["id"], global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
if (!__tagHelperExecutionContext.Output.IsContentModified)
{
await __tagHelperExecutionContext.SetOutputContentAsync();
}
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
WriteLiteral("\r\n </td>\r\n <td>\r\n ");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("form", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "3ee6179f90138729ce3f5de94a4c70ed9e1118f516217", async() => {
WriteLiteral("\r\n <button type=\"submit\" class=\"btn btn-sm btn-danger\">\r\n Delete\r\n </button>\r\n ");
}
);
__Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.FormTagHelper>();
__tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper);
__Microsoft_AspNetCore_Mvc_TagHelpers_RenderAtEndOfFormTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.RenderAtEndOfFormTagHelper>();
__tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_RenderAtEndOfFormTagHelper);
__Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper.Action = (string)__tagHelperAttribute_6.Value;
__tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_6);
if (__Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper.RouteValues == null)
{
throw new InvalidOperationException(InvalidTagHelperIndexerAssignment("asp-route-id", "Microsoft.AspNetCore.Mvc.TagHelpers.FormTagHelper", "RouteValues"));
}
BeginWriteTagHelperAttribute();
#nullable restore
#line 44 "G:\Yogesh\SEO\Yogihosting\new\Xaero\Xaero\Views\Movie\Index.cshtml"
WriteLiteral(movie.Id);
#line default
#line hidden
#nullable disable
__tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
__Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper.RouteValues["id"] = __tagHelperStringValueBuffer;
__tagHelperExecutionContext.AddTagHelperAttribute("asp-route-id", __Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper.RouteValues["id"], global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
__Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper.Method = (string)__tagHelperAttribute_7.Value;
__tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_7);
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
if (!__tagHelperExecutionContext.Output.IsContentModified)
{
await __tagHelperExecutionContext.SetOutputContentAsync();
}
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
WriteLiteral("\r\n </td>\r\n </tr>\r\n");
#nullable restore
#line 51 "G:\Yogesh\SEO\Yogihosting\new\Xaero\Xaero\Views\Movie\Index.cshtml"
}
#line default
#line hidden
#nullable disable
WriteLiteral("</table>\r\n\r\n");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("div", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "3ee6179f90138729ce3f5de94a4c70ed9e1118f519231", async() => {
}
);
__Xaero_Infrastructure_PageLinkTagHelper = CreateTagHelper<global::Xaero.Infrastructure.PageLinkTagHelper>();
__tagHelperExecutionContext.Add(__Xaero_Infrastructure_PageLinkTagHelper);
__tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_8);
#nullable restore
#line 54 "G:\Yogesh\SEO\Yogihosting\new\Xaero\Xaero\Views\Movie\Index.cshtml"
__Xaero_Infrastructure_PageLinkTagHelper.PageModel = ViewBag.PagingInfo;
#line default
#line hidden
#nullable disable
__tagHelperExecutionContext.AddTagHelperAttribute("page-model", __Xaero_Infrastructure_PageLinkTagHelper.PageModel, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
__Xaero_Infrastructure_PageLinkTagHelper.PageAction = (string)__tagHelperAttribute_9.Value;
__tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_9);
#nullable restore
#line 54 "G:\Yogesh\SEO\Yogihosting\new\Xaero\Xaero\Views\Movie\Index.cshtml"
__Xaero_Infrastructure_PageLinkTagHelper.PageClassesEnabled = true;
#line default
#line hidden
#nullable disable
__tagHelperExecutionContext.AddTagHelperAttribute("page-classes-enabled", __Xaero_Infrastructure_PageLinkTagHelper.PageClassesEnabled, global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
__Xaero_Infrastructure_PageLinkTagHelper.PageClass = (string)__tagHelperAttribute_10.Value;
__tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_10);
__Xaero_Infrastructure_PageLinkTagHelper.PageClassSelected = (string)__tagHelperAttribute_11.Value;
__tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_11);
await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
if (!__tagHelperExecutionContext.Output.IsContentModified)
{
await __tagHelperExecutionContext.SetOutputContentAsync();
}
Write(__tagHelperExecutionContext.Output);
__tagHelperExecutionContext = __tagHelperScopeManager.End();
}
#pragma warning restore 1998
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; }
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; }
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; }
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; }
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<List<Movie>> Html { get; private set; }
}
}
#pragma warning restore 1591
| 66.801802 | 360 | 0.735356 | [
"MIT"
] | yogyogi/Xaero | version 3.1/Xaero/obj/Debug/netcoreapp3.1/Razor/Views/Movie/Index.cshtml.g.cs | 22,245 | C# |
// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Processing.Processors;
using SixLabors.Primitives;
using Xunit;
namespace SixLabors.ImageSharp.Tests.Processing.Filters
{
public class SepiaTest : BaseImageOperationsExtensionTest
{
[Fact]
public void Sepia_amount_SepiaProcessorDefaultsSet()
{
this.operations.Sepia();
var processor = this.Verify<SepiaProcessor<Rgba32>>();
}
[Fact]
public void Sepia_amount_rect_SepiaProcessorDefaultsSet()
{
this.operations.Sepia(this.rect);
var processor = this.Verify<SepiaProcessor<Rgba32>>(this.rect);
}
}
} | 29.222222 | 75 | 0.678074 | [
"Apache-2.0"
] | axunonb/ImageSharp | tests/ImageSharp.Tests/Processing/Filters/SepiaTest.cs | 791 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Agebull.Common.Logging;
using Agebull.Common.Rpc;
using Agebull.ZeroNet.Core;
using Gboxt.Common.DataModel;
using Newtonsoft.Json;
using ZeroMQ;
namespace Agebull.ZeroNet.ZeroApi
{
/// <summary>
/// Api站点
/// </summary>
public class ApiClient
{
#region Properties
/// <summary>
/// 返回值
/// </summary>
public string Result => _json;
/// <summary>
/// 请求站点
/// </summary>
public string Station { get; set; }
/// <summary>
/// 请求站点
/// </summary>
public string RequestId { get; } = RandomOperate.Generate(8);
/// <summary>
/// 调用命令
/// </summary>
public string Commmand { get; set; }
/// <summary>
/// 参数
/// </summary>
public string Argument { get; set; }
/// <summary>
/// 扩展参数
/// </summary>
public string ExtendArgument { get; set; }
/// <summary>
/// 请求时申请的全局标识(本地)
/// </summary>
public string GlobalId;
/// <summary>
/// 结果状态
/// </summary>
public ZeroOperatorStateType State { get; set; }
/// <summary>
/// 简单调用
/// </summary>
/// <remarks>
/// 1 不获取全局标识
/// 2 无远程定向路由,
/// 3 无上下文信息
/// </remarks>
public bool Simple { set; get; }
/// <summary>
/// 返回的数据
/// </summary>
private string _json;
#endregion
#region Command
/// <summary>
/// 远程调用
/// </summary>
/// <param name="station"></param>
/// <param name="commmand"></param>
/// <param name="argument"></param>
/// <returns></returns>
public static async Task<string> CallSync(string station, string commmand, string argument)
{
return await CallTask(station, commmand, argument);
}
/// <summary>
/// 远程调用
/// </summary>
/// <param name="station"></param>
/// <param name="commmand"></param>
/// <param name="argument"></param>
/// <returns></returns>
public static Task<string> CallTask(string station, string commmand, string argument)
{
return Task.Factory.StartNew(() => Call(station, commmand, argument));
}
/// <summary>
/// 远程调用
/// </summary>
/// <param name="station"></param>
/// <param name="commmand"></param>
/// <param name="argument"></param>
/// <returns></returns>
public static string Call(string station, string commmand, string argument)
{
var client = new ApiClient
{
Station = station,
Commmand = commmand,
Argument = argument
};
client.CallCommand();
return client.Result;
}
/// <summary>
/// 远程调用
/// </summary>
/// <returns></returns>
public void CallCommand()
{
using (MonitorScope.CreateScope("内部Zero调用"))
{
Prepare();
Call();
End();
}
}
#endregion
#region Flow
/// <summary>
/// 检查在非成功状态下的返回值
/// </summary>
public void CheckStateResult()
{
if (_json != null)
return;
switch (State)
{
case ZeroOperatorStateType.LocalNoReady:
case ZeroOperatorStateType.LocalZmqError:
_json = ApiResult.NoReadyJson;
return;
case ZeroOperatorStateType.LocalSendError:
case ZeroOperatorStateType.LocalRecvError:
_json = ApiResult.NetworkErrorJson;
return;
case ZeroOperatorStateType.LocalException:
_json = ApiResult.LocalExceptionJson;
return;
case ZeroOperatorStateType.Plan:
case ZeroOperatorStateType.Runing:
case ZeroOperatorStateType.VoteBye:
case ZeroOperatorStateType.Wecome:
case ZeroOperatorStateType.VoteSend:
case ZeroOperatorStateType.VoteWaiting:
case ZeroOperatorStateType.VoteStart:
case ZeroOperatorStateType.VoteEnd:
_json = JsonConvert.SerializeObject(ApiResult.Error(ErrorCode.Success, State.Text()));
return;
case ZeroOperatorStateType.Error:
_json = ApiResult.InnerErrorJson;
return;
case ZeroOperatorStateType.Unavailable:
_json = ApiResult.UnavailableJson;
return;
case ZeroOperatorStateType.NotSupport:
case ZeroOperatorStateType.NotFind:
case ZeroOperatorStateType.NoWorker:
//ApiContext.Current.LastError = ErrorCode.NoFind;
_json = ApiResult.NoFindJson;
return;
case ZeroOperatorStateType.ArgumentInvalid:
//ApiContext.Current.LastError = ErrorCode.LogicalError;
_json = ApiResult.ArgumentErrorJson;
return;
case ZeroOperatorStateType.TimeOut:
_json = ApiResult.TimeOutJson;
return;
case ZeroOperatorStateType.FrameInvalid:
//ApiContext.Current.LastError = ErrorCode.NetworkError;
_json = ApiResult.NetworkErrorJson;
return;
case ZeroOperatorStateType.NetError:
//ApiContext.Current.LastError = ErrorCode.NetworkError;
_json = ApiResult.NetworkErrorJson;
return;
case ZeroOperatorStateType.Failed:
case ZeroOperatorStateType.Bug:
//ApiContext.Current.LastError = ErrorCode.LocalError;
_json = ApiResult.LogicalErrorJson;
return;
case ZeroOperatorStateType.Pause:
//ApiContext.Current.LastError = ErrorCode.LocalError;
_json = ApiResult.LogicalErrorJson;
return;
default:
_json = ApiResult.PauseJson;
return;
case ZeroOperatorStateType.Ok:
//ApiContext.Current.LastError = ErrorCode.Success;
return;
}
}
/// <summary>
/// 远程调用
/// </summary>
/// <returns></returns>
private void Call()
{
if (!ZeroApplication.ZerCenterIsRun)
{
State = ZeroOperatorStateType.LocalNoReady;
return;
}
var socket = ZeroConnectionPool.GetSocket(Station, GlobalContext.RequestInfo.RequestId);
if (socket.Socket == null)
{
//ApiContext.Current.LastError = ErrorCode.NoReady;
_json = ApiResult.NoReadyJson;
State = ZeroOperatorStateType.LocalNoReady;
return;
}
using (socket)
{
ReadNetWork(socket);
}
}
#endregion
#region 操作注入
/// <summary>
/// Api处理器
/// </summary>
public interface IHandler
{
/// <summary>
/// 准备
/// </summary>
/// <param name="item"></param>
/// <returns></returns>
void Prepare(ApiClient item);
/// <summary>
/// 结束处理
/// </summary>
/// <param name="item"></param>
void End(ApiClient item);
}
/// <summary>
/// 处理器
/// </summary>
private static readonly List<Func<IHandler>> ApiHandlers = new List<Func<IHandler>>();
/// <summary>
/// 注册处理器
/// </summary>
public static void RegistHandlers<THandler>() where THandler : class, IHandler, new()
{
ApiHandlers.Add(() => new THandler());
}
private readonly List<IHandler> _handlers = new List<IHandler>();
/// <summary>
/// 注册处理器
/// </summary>
public ApiClient()
{
foreach (var func in ApiHandlers)
_handlers.Add(func());
}
private void Prepare()
{
if (Simple)
return;
LogRecorder.MonitorTrace($"Station:{Station},Command:{Commmand}");
foreach (var handler in _handlers)
try
{
handler.Prepare(this);
}
catch (Exception e)
{
ZeroTrace.WriteException(Station, e, "PreActions", Commmand);
}
}
private void End()
{
CheckStateResult();
if (Simple)
return;
LogRecorder.MonitorTrace($"Result:{Result}");
foreach (var handler in _handlers)
{
try
{
handler.End(this);
}
catch (Exception e)
{
ZeroTrace.WriteException(Station, e, "EndActions", Commmand);
}
}
}
#endregion
#region Socket
/// <summary>
/// 请求格式说明
/// </summary>
private static readonly byte[] SimpleCallDescription =
{
4,
(byte)ZeroByteCommand.General,
ZeroFrameType.Command,
ZeroFrameType.RequestId,
ZeroFrameType.Argument,
ZeroFrameType.Requester,
ZeroFrameType.End
};
/// <summary>
/// 请求格式说明
/// </summary>
private static readonly byte[] CallDescription =
{
8,
(byte)ZeroByteCommand.General,
ZeroFrameType.Command,
ZeroFrameType.RequestId,
ZeroFrameType.Context,
ZeroFrameType.Argument,
ZeroFrameType.Content,
ZeroFrameType.Requester,
ZeroFrameType.Responser,
ZeroFrameType.GlobalId
};
/// <summary>
/// 请求格式说明
/// </summary>
private static readonly byte[] GetGlobalIdDescription =
{
1,
(byte)ZeroByteCommand.GetGlobalId,
ZeroFrameType.RequestId,
ZeroFrameType.End
};
private void ReadNetWork(PoolSocket socket)
{
ZeroResultData result;
var old = GlobalContext.RequestInfo.LocalGlobalId;
if (Simple)
{
result = socket.Socket.QuietSend(CallDescription,
Commmand,
GlobalContext.RequestInfo.RequestId,
null,//JsonConvert.SerializeObject(GlobalContext.Current),
Argument,
null,
ZeroApplication.Config.StationName,
null,
"0");
}
else
{
result = socket.Socket.QuietSend(GetGlobalIdDescription, GlobalContext.RequestInfo.RequestId);
if (!result.InteractiveSuccess)
{
socket.HaseFailed = true;
//ZeroTrace.WriteError("GetGlobalId", "Send Failed", station, commmand, argument);
//ApiContext.Current.LastError = ErrorCode.NetworkError;
State = ZeroOperatorStateType.LocalSendError;
return;
}
if (result.State == ZeroOperatorStateType.Pause)
{
socket.HaseFailed = true;
State = ZeroOperatorStateType.Pause;
return;
}
result = ReceiveString(socket.Socket);
if (!result.InteractiveSuccess)
{
socket.HaseFailed = true;
//ZeroTrace.WriteError("GlobalId", "Recv Failed", station, commmand, argument);
//ApiContext.Current.LastError = ErrorCode.NetworkError;
State = ZeroOperatorStateType.LocalRecvError;
return;
}
if (result.TryGetValue(ZeroFrameType.GlobalId, out GlobalId))
{
GlobalContext.RequestInfo.LocalGlobalId = GlobalId;
LogRecorder.MonitorTrace($"GlobalId:{GlobalId}");
}
result = socket.Socket.QuietSend(CallDescription,
Commmand,
GlobalContext.RequestInfo.RequestId,
JsonConvert.SerializeObject(GlobalContext.Current),
Argument,
ExtendArgument,
ZeroApplication.Config.StationName,
GlobalContext.Current.Organizational.RouteName,
GlobalContext.RequestInfo.LocalGlobalId);
GlobalContext.RequestInfo.LocalGlobalId = old;
}
if (!result.InteractiveSuccess)
{
socket.HaseFailed = true;
//ZeroTrace.WriteError(station, "Send Failed", commmand, argument);
//ApiContext.Current.LastError = ErrorCode.NetworkError;
State = ZeroOperatorStateType.LocalSendError;
return;
}
result = ReceiveString(socket.Socket);
if (!result.InteractiveSuccess)
{
socket.HaseFailed = true;
//ZeroTrace.WriteError("API", "incorrigible", commmand, globalId);
//ApiContext.Current.LastError = ErrorCode.NetworkError;
State = ZeroOperatorStateType.LocalRecvError;
return;
}
//if (result.State == ZeroOperatorStateType.NoWorker)
//{
// return;
//}
//var lr = socket.Socket.QuietSend(CloseDescription, name, globalId);
//if (!lr.InteractiveSuccess)
//{
// ZeroTrace.WriteError(station, "Close Failed", commmand, globalId);
//}
//lr = ReceiveString(socket.Socket);
//if (!lr.InteractiveSuccess)
//{
// socket.HaseFailed = true;
// ZeroTrace.WriteError(station, "Close Failed", commmand, globalId, lr.ZmqErrorMessage);
//}
result.TryGetValue(ZeroFrameType.JsonValue, out _json);
State = result.State;
}
/// <summary>
/// 接收文本
/// </summary>
/// <param name="socket"></param>
/// <returns></returns>
private ZeroResultData ReceiveString(ZSocket socket)
{
if (!ZeroApplication.ZerCenterIsRun)
return new ZeroResultData
{
State = ZeroOperatorStateType.LocalRecvError,
InteractiveSuccess = false
};
if (!socket.Recv(out var messages))
{
if (!Equals(socket.LastError, ZError.EAGAIN))
ZeroTrace.WriteError("Receive", socket.Connects.LinkToString(','), socket.LastError.Text,
$"Socket Ptr:{socket.SocketPtr}");
return new ZeroResultData
{
State = ZeroOperatorStateType.LocalRecvError
//ZmqErrorMessage = error?.Text,
//ZmqErrorCode = error?.Number ?? 0
};
}
try
{
var description = messages[0].Read();
if (description.Length == 0)
{
ZeroTrace.WriteError("Receive", "LaoutError", socket.Connects.LinkToString(','),
description.LinkToString(p => p.ToString("X2"), ""), $"Socket Ptr:{socket.SocketPtr}.");
return new ZeroResultData
{
State = ZeroOperatorStateType.FrameInvalid,
Message = "网络格式错误"
};
}
var end = description[0] + 1;
if (end != messages.Count)
{
ZeroTrace.WriteError("Receive", "LaoutError", socket.Connects.LinkToString(','),
$"FrameSize{messages.Count}", description.LinkToString(p => p.ToString("X2"), ""),
$"Socket Ptr:{socket.SocketPtr}.");
return new ZeroResultData
{
State = ZeroOperatorStateType.FrameInvalid,
Message = "网络格式错误"
};
}
var result = new ZeroResultData
{
InteractiveSuccess = true,
State = (ZeroOperatorStateType)description[1]
};
for (var idx = 1; idx < end; idx++)
result.Add(description[idx + 1], Encoding.UTF8.GetString(messages[idx].Read()));
return result;
}
catch (Exception e)
{
ZeroTrace.WriteException("Receive", e, socket.Connects.LinkToString(','),
$"Socket Ptr:{socket.SocketPtr}.");
return new ZeroResultData
{
State = ZeroOperatorStateType.LocalException,
Exception = e
};
}
finally
{
messages.Dispose();
}
}
#endregion
#region 快捷方法
/// <summary>
/// 调用远程方法
/// </summary>
/// <typeparam name="TArgument">参数类型</typeparam>
/// <typeparam name="TResult">返回值类型</typeparam>
/// <param name="station">站点</param>
/// <param name="api">api名称</param>
/// <param name="arg">参数</param>
/// <returns></returns>
public static TResult Call<TArgument, TResult>(string station, string api, TArgument arg)
{
ApiClient client = new ApiClient
{
Station = station,
Commmand = api,
Argument = arg == null ? null : JsonConvert.SerializeObject(arg)
};
client.CallCommand();
if (client.State != ZeroOperatorStateType.Ok)
{
client.CheckStateResult();
}
return JsonConvert.DeserializeObject<TResult>(client.Result);
}
/// <summary>
/// 调用远程方法
/// </summary>
/// <typeparam name="TArgument">参数类型</typeparam>
/// <typeparam name="TResult">返回值类型</typeparam>
/// <param name="station">站点</param>
/// <param name="api">api名称</param>
/// <param name="arg">参数</param>
/// <returns></returns>
public static ApiResult<TResult> CallApi<TArgument, TResult>(string station, string api, TArgument arg)
{
ApiClient client = new ApiClient
{
Station = station,
Commmand = api,
Argument = arg == null ? null : JsonConvert.SerializeObject(arg)
};
client.CallCommand();
if (client.State != ZeroOperatorStateType.Ok)
{
client.CheckStateResult();
}
return JsonConvert.DeserializeObject<ApiResult<TResult>>(client.Result);
}
/// <summary>
/// 调用远程方法
/// </summary>
/// <typeparam name="TArgument">参数类型</typeparam>
/// <param name="station">站点</param>
/// <param name="api">api名称</param>
/// <param name="arg">参数</param>
/// <returns></returns>
public static ApiResult CallApi<TArgument>(string station, string api, TArgument arg)
{
ApiClient client = new ApiClient
{
Station = station,
Commmand = api,
Argument = arg == null ? null : JsonConvert.SerializeObject(arg)
};
client.CallCommand();
if (client.State != ZeroOperatorStateType.Ok)
{
client.CheckStateResult();
}
return JsonConvert.DeserializeObject<ApiResult>(client.Result);
}
/// <summary>
/// 调用远程方法
/// </summary>
/// <param name="station">站点</param>
/// <param name="api">api名称</param>
/// <returns></returns>
public static ApiResult CallApi(string station, string api)
{
ApiClient client = new ApiClient
{
Station = station,
Commmand = api
};
client.CallCommand();
if (client.State != ZeroOperatorStateType.Ok)
{
client.CheckStateResult();
}
return JsonConvert.DeserializeObject<ApiResult>(client.Result);
}
#endregion
}
} | 33.233945 | 112 | 0.483966 | [
"MPL-2.0",
"MPL-2.0-no-copyleft-exception"
] | agebullhu/MicroZero | src/Core/ZeroNetCore/ZeroApi/ApiClient.cs | 22,209 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Medical.Controller.AnomalousMvc;
using MyGUIPlugin;
using Engine;
using Anomalous.GuiFramework;
namespace Medical.GUI.AnomalousMvc
{
public class MyGUIViewHost : ViewHost
{
private ViewHostComponent component;
private VariableSizeMyGUILayoutContainer layoutContainer;
private AnomalousMvcContext context;
private MyGUIView myGUIView;
public event Action<ViewHost> ViewClosing;
public event Action<ViewHost> ViewOpening;
public event Action<ViewHost> ViewResized;
public MyGUIViewHost(AnomalousMvcContext context, MyGUIView view)
{
this.context = context;
this.Name = view.Name;
this.myGUIView = view;
}
public void setTopComponent(ViewHostComponent component)
{
this.component = component;
layoutContainer = new VariableSizeMyGUILayoutContainer(component.Widget, getDesiredSize);
layoutContainer.LayoutChanged += layoutContainer_LayoutChanged;
layoutContainer.AnimatedResizeStarted += layoutContainer_AnimatedResizeStarted;
layoutContainer.AnimatedResizeCompleted += layoutContainer_AnimatedResizeCompleted;
}
public void Dispose()
{
component.Dispose();
}
public void opening()
{
Open = true;
component.opening();
if (!String.IsNullOrEmpty(View.OpeningAction))
{
context.queueRunAction(View.OpeningAction, this);
}
if (ViewOpening != null)
{
ViewOpening.Invoke(this);
}
}
public void closing()
{
Open = false;
if (ViewClosing != null)
{
ViewClosing.Invoke(this);
}
if (!String.IsNullOrEmpty(View.ClosingAction))
{
context.queueRunAction(View.ClosingAction, this);
}
component.closing();
}
public void populateViewData(IDataProvider dataProvider)
{
component.populateViewData(dataProvider);
}
public void analyzeViewData(IDataProvider dataProvider)
{
component.analyzeViewData(dataProvider);
}
public ViewHostControl findControl(String name)
{
return component.findControl(name);
}
public void changeScale(float newScale)
{
component.changeScale(newScale);
}
public LayoutContainer Container
{
get
{
return layoutContainer;
}
}
public AnomalousMvcContext Context
{
get
{
return context;
}
}
public String Name { get; private set; }
public View View
{
get
{
return myGUIView;
}
}
public bool _RequestClosed { get; set; }
public bool Open { get; private set; }
public bool Animating { get; private set; }
/// <summary>
/// A callback to send to the GUI manager that will be called when it is done with this view host.
/// </summary>
public void _finishedWithView()
{
Dispose();
InputManager.Instance.refreshMouseWidget();
}
IntSize2 getDesiredSize()
{
IntSize2 workingSize;
if (!myGUIView.fireGetDesiredSizeOverride(layoutContainer, layoutContainer.WidgetOriginalSize, out workingSize))
{
workingSize = layoutContainer.WidgetOriginalSize;
}
return workingSize;
}
void layoutContainer_LayoutChanged()
{
component.topLevelResized();
if (ViewResized != null)
{
ViewResized.Invoke(this);
}
}
void layoutContainer_AnimatedResizeCompleted(IntSize2 finalSize)
{
Animating = false;
component.animatedResizeCompleted(finalSize);
}
void layoutContainer_AnimatedResizeStarted(IntSize2 finalSize)
{
Animating = true;
component.animatedResizeStarted(finalSize);
}
}
}
| 27.993976 | 125 | 0.545298 | [
"MIT"
] | AnomalousMedical/Medical | Standalone/GUI/AnomalousMvc/MyGUIViewHost.cs | 4,649 | C# |
using DOTNET_TEMPLATE_ARQ_LIMPO.Core.ProjectAggregate;
using Xunit;
namespace DOTNET_TEMPLATE_ARQ_LIMPO.UnitTests.Core.ProjectAggregate;
public class Project_AddItem
{
private Project _testProject = new Project("some name");
[Fact]
public void AddsItemToItems()
{
var _testItem = new ToDoItem
{
Title = "title",
Description = "description"
};
_testProject.AddItem(_testItem);
Assert.Contains(_testItem, _testProject.Items);
}
[Fact]
public void ThrowsExceptionGivenNullItem()
{
#nullable disable
Action action = () => _testProject.AddItem(null);
#nullable enable
var ex = Assert.Throws<ArgumentNullException>(action);
Assert.Equal("newItem", ex.ParamName);
}
}
| 21.857143 | 69 | 0.684967 | [
"MIT"
] | DaniloOPinheiro/DOTNET-TEMPLATE-ARQ-LIMPO | tests/DOTNET-TEMPLATE-ARQ-LIMPO.UnitTests/Core/ProjectAggregate/Project_AddItem.cs | 767 | C# |
using System;
using System.Xml;
using Shoko.Commons.Queue;
using Shoko.Models.Queue;
using Shoko.Models.Server;
using Shoko.Server.Providers.TraktTV;
using Shoko.Server.Repositories;
using Shoko.Server.Server;
using Shoko.Server.Settings;
using Shoko.Server.Utilities;
namespace Shoko.Server.Commands
{
[Serializable]
[Command(CommandRequestType.Trakt_SyncCollection)]
public class CommandRequest_TraktSyncCollection : CommandRequestImplementation
{
public bool ForceRefresh { get; set; }
public override CommandRequestPriority DefaultPriority => CommandRequestPriority.Priority8;
public override QueueStateStruct PrettyDescription => new QueueStateStruct {queueState = QueueStateEnum.SyncTrakt, extraParams = new string[0]};
public CommandRequest_TraktSyncCollection()
{
}
public CommandRequest_TraktSyncCollection(bool forced)
{
Priority = (int) DefaultPriority;
ForceRefresh = forced;
GenerateCommandID();
}
public override void ProcessCommand()
{
logger.Info("Processing CommandRequest_TraktSyncCollection");
try
{
if (!ServerSettings.Instance.TraktTv.Enabled || string.IsNullOrEmpty(ServerSettings.Instance.TraktTv.AuthToken)) return;
ScheduledUpdate sched =
RepoFactory.ScheduledUpdate.GetByUpdateType((int) ScheduledUpdateType.TraktSync);
if (sched == null)
{
sched = new ScheduledUpdate
{
UpdateType = (int)ScheduledUpdateType.TraktSync,
UpdateDetails = string.Empty
};
}
else
{
int freqHours = Utils.GetScheduledHours(ServerSettings.Instance.TraktTv.SyncFrequency);
// if we have run this in the last xxx hours then exit
TimeSpan tsLastRun = DateTime.Now - sched.LastUpdate;
if (tsLastRun.TotalHours < freqHours)
{
if (!ForceRefresh) return;
}
}
sched.LastUpdate = DateTime.Now;
RepoFactory.ScheduledUpdate.Save(sched);
TraktTVHelper.SyncCollectionToTrakt();
}
catch (Exception ex)
{
logger.Error("Error processing CommandRequest_TraktSyncCollection: {0}", ex);
}
}
/// <summary>
/// This should generate a unique key for a command
/// It will be used to check whether the command has already been queued before adding it
/// </summary>
public override void GenerateCommandID()
{
CommandID = "CommandRequest_TraktSyncCollection";
}
public override bool LoadFromDBCommand(CommandRequest cq)
{
CommandID = cq.CommandID;
CommandRequestID = cq.CommandRequestID;
Priority = cq.Priority;
CommandDetails = cq.CommandDetails;
DateTimeUpdated = cq.DateTimeUpdated;
// read xml to get parameters
if (CommandDetails.Trim().Length > 0)
{
XmlDocument docCreator = new XmlDocument();
docCreator.LoadXml(CommandDetails);
// populate the fields
ForceRefresh =
bool.Parse(TryGetProperty(docCreator, "CommandRequest_TraktSyncCollection", "ForceRefresh"));
}
return true;
}
public override CommandRequest ToDatabaseObject()
{
GenerateCommandID();
CommandRequest cq = new CommandRequest
{
CommandID = CommandID,
CommandType = CommandType,
Priority = Priority,
CommandDetails = ToXML(),
DateTimeUpdated = DateTime.Now
};
return cq;
}
}
} | 33.639344 | 152 | 0.572612 | [
"MIT"
] | Hitsounds/ShokoServer | Shoko.Server/Commands/Trakt/CommandRequest_TraktSyncCollection.cs | 4,106 | C# |
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.LanguageServices;
using Microsoft.CodeAnalysis.Shared.Extensions;
using Roslyn.Utilities;
namespace Microsoft.CodeAnalysis.FindSymbols.Finders
{
internal class OrdinaryMethodReferenceFinder : AbstractMethodOrPropertyOrEventSymbolReferenceFinder<IMethodSymbol>
{
protected override bool CanFind(IMethodSymbol symbol)
{
return
symbol.MethodKind == MethodKind.Ordinary ||
symbol.MethodKind == MethodKind.DelegateInvoke ||
symbol.MethodKind == MethodKind.DeclareMethod ||
symbol.MethodKind == MethodKind.ReducedExtension ||
symbol.MethodKind == MethodKind.LocalFunction;
}
protected override async Task<IEnumerable<ISymbol>> DetermineCascadedSymbolsAsync(
IMethodSymbol symbol,
Solution solution,
IImmutableSet<Project> projects,
CancellationToken cancellationToken)
{
// If it's a delegate method, then cascade to the type as well. These guys are
// practically equivalent for users.
if (symbol.ContainingType.TypeKind == TypeKind.Delegate)
{
return SpecializedCollections.SingletonEnumerable((ISymbol)symbol.ContainingType);
}
else
{
var otherPartsOfPartial = GetOtherPartsOfPartial(symbol);
var baseCascadedSymbols = await base.DetermineCascadedSymbolsAsync(symbol, solution, projects, cancellationToken).ConfigureAwait(false);
if (otherPartsOfPartial == null && baseCascadedSymbols == null)
{
return null;
}
otherPartsOfPartial = otherPartsOfPartial ?? SpecializedCollections.EmptyEnumerable<ISymbol>();
baseCascadedSymbols = baseCascadedSymbols ?? SpecializedCollections.EmptyEnumerable<ISymbol>();
return otherPartsOfPartial.Concat(baseCascadedSymbols);
}
}
private IEnumerable<ISymbol> GetOtherPartsOfPartial(IMethodSymbol symbol)
{
if (symbol.PartialDefinitionPart != null)
{
return SpecializedCollections.SingletonEnumerable(symbol.PartialDefinitionPart);
}
if (symbol.PartialImplementationPart != null)
{
return SpecializedCollections.SingletonEnumerable(symbol.PartialImplementationPart);
}
return null;
}
protected override async Task<IEnumerable<Document>> DetermineDocumentsToSearchAsync(
IMethodSymbol methodSymbol,
Project project,
IImmutableSet<Document> documents,
CancellationToken cancellationToken)
{
// TODO(cyrusn): Handle searching for IDisposable.Dispose (or an implementation
// thereof). in that case, we need to look at documents that have a using in them
// and see if that using binds to this dispose method. We also need to look at
// 'foreach's as the will call 'Dispose' afterwards.
// TODO(cyrusn): Handle searching for linq methods. If the user searches for 'Cast',
// 'Where', 'Select', 'SelectMany', 'Join', 'GroupJoin', 'OrderBy',
// 'OrderByDescending', 'GroupBy', 'ThenBy' or 'ThenByDescending', then we want to
// search in files that have query expressions and see if any query clause binds to
// these methods.
// TODO(cyrusn): Handle searching for Monitor.Enter and Monitor.Exit. If a user
// searches for these, then we should find usages of 'lock(foo)' or 'synclock(foo)'
// since they implicitly call those methods.
var ordinaryDocuments = await FindDocumentsAsync(project, documents, cancellationToken, methodSymbol.Name).ConfigureAwait(false);
var forEachDocuments = IsForEachMethod(methodSymbol)
? await FindDocumentsWithForEachStatementsAsync(project, documents, cancellationToken).ConfigureAwait(false)
: SpecializedCollections.EmptyEnumerable<Document>();
return ordinaryDocuments.Concat(forEachDocuments);
}
private bool IsForEachMethod(IMethodSymbol methodSymbol)
{
return
methodSymbol.Name == WellKnownMemberNames.GetEnumeratorMethodName ||
methodSymbol.Name == WellKnownMemberNames.MoveNextMethodName;
}
protected override async Task<IEnumerable<ReferenceLocation>> FindReferencesInDocumentAsync(
IMethodSymbol symbol,
Document document,
CancellationToken cancellationToken)
{
var syntaxFacts = document.GetLanguageService<ISyntaxFactsService>();
var nameMatches = await FindReferencesInDocumentUsingSymbolNameAsync(
symbol,
document,
cancellationToken).ConfigureAwait(false);
var forEachMatches = IsForEachMethod(symbol)
? await FindReferencesInForEachStatementsAsync(symbol, document, cancellationToken).ConfigureAwait(false)
: SpecializedCollections.EmptyEnumerable<ReferenceLocation>();
return nameMatches.Concat(forEachMatches);
}
}
}
| 45.52 | 161 | 0.654833 | [
"Apache-2.0"
] | OceanYan/roslyn | src/Workspaces/Core/Portable/FindSymbols/FindReferences/Finders/OrdinaryMethodReferenceFinder.cs | 5,692 | C# |
using Ocelot.Errors;
namespace Ocelot.LoadBalancer.LoadBalancers
{
public class ServicesAreNullError : Error
{
public ServicesAreNullError(string message)
: base(message, OcelotErrorCode.ServicesAreNullError, 404)
{
}
}
}
| 21.692308 | 71 | 0.641844 | [
"MIT"
] | Amoeslund/Ocelot | src/Ocelot/LoadBalancer/LoadBalancers/ServicesAreNullError.cs | 282 | C# |
using System;
using UnityEngine.UI;
public static class ActionHelper
{
public static void Add(this Button.ButtonClickedEvent buttonClickedEvent, Action action)
{
buttonClickedEvent.AddListener(() => { action(); });
}
} | 21.909091 | 92 | 0.705394 | [
"Apache-2.0"
] | lukaozi/MetaGame | client/Assets/Scripts/CSharp/Game/Libs/Util/ActionHelper.cs | 243 | C# |
using System.Collections.Generic;
using System.Management;
namespace WindowsMonitor.Hardware.Network.Ntlm
{
/// <summary>
/// </summary>
public sealed class NtlmValidateUser
{
public string LogonDomain { get; private set; }
public string LogonServer { get; private set; }
public uint Success { get; private set; }
public string UserName { get; private set; }
public string Workstation { get; private set; }
public static IEnumerable<NtlmValidateUser> Retrieve(string remote, string username, string password)
{
var options = new ConnectionOptions
{
Impersonation = ImpersonationLevel.Impersonate,
Username = username,
Password = password
};
var managementScope = new ManagementScope(new ManagementPath($"\\\\{remote}\\root\\wmi"), options);
managementScope.Connect();
return Retrieve(managementScope);
}
public static IEnumerable<NtlmValidateUser> Retrieve()
{
var managementScope = new ManagementScope(new ManagementPath("root\\wmi"));
return Retrieve(managementScope);
}
public static IEnumerable<NtlmValidateUser> Retrieve(ManagementScope managementScope)
{
var objectQuery = new ObjectQuery("SELECT * FROM NtlmValidateUser_End");
var objectSearcher = new ManagementObjectSearcher(managementScope, objectQuery);
var objectCollection = objectSearcher.Get();
foreach (ManagementObject managementObject in objectCollection)
yield return new NtlmValidateUser
{
LogonDomain = (string) (managementObject.Properties["LogonDomain"]?.Value ?? default(string)),
LogonServer = (string) (managementObject.Properties["LogonServer"]?.Value ?? default(string)),
Success = (uint) (managementObject.Properties["Success"]?.Value ?? default(uint)),
UserName = (string) (managementObject.Properties["UserName"]?.Value ?? default(string)),
Workstation = (string) (managementObject.Properties["Workstation"]?.Value ?? default(string))
};
}
}
} | 40.851852 | 115 | 0.648685 | [
"MIT"
] | Biztactix/WindowsMonitor | WindowsMonitor.Standard/Hardware/Network/Ntlm/NtlmValidateUser.cs | 2,206 | C# |
using System;
using System.Linq.Expressions;
namespace AutoOperator
{
/// <summary>
/// Used to construct a Equality Expression
/// </summary>
/// <typeparam name="T1">The type of the 1.</typeparam>
/// <typeparam name="T2">The type of the 2.</typeparam>
/// <seealso cref="AutoOperator.IRelationalOperaton{T1, T2}"/>
public class RelationalOperaton<T1, T2> : IRelationalOperaton<T1, T2>
{
private ExpresionList<T1, T2> parts = new ExpresionList<T1, T2>();
private ExpresionList<T2, T1> partsReversed = new ExpresionList<T2, T1>();
internal ExpresionList<T1, T2> Parts
{
get
{
return parts;
}
}
internal ExpresionList<T2, T1> PartsReversed
{
get
{
return partsReversed;
}
}
/// <summary>
/// Adds another block to the boolean operation.
/// </summary>
/// <typeparam name="TReturn1">The type of the return1.</typeparam>
/// <typeparam name="TReturn2">The type of the return2.</typeparam>
/// <param name="a">a.</param>
/// <param name="b">The b.</param>
/// <returns></returns>
public IRelationalOperaton<T1, T2> Operation<TReturn1, TReturn2>(Expression<Func<T1, TReturn1>> a, Expression<Func<T2, TReturn2>> b)
{
parts.Add((IRelationalExpressionBuilder builder) => builder.BuildExpression<T1, T2, TReturn1, TReturn2>(a, b));
partsReversed.Add((IRelationalExpressionBuilder builder) => builder.BuildExpression<T2, T1, TReturn2, TReturn1>(b, a));
return this;
}
}
} | 30.208333 | 134 | 0.68 | [
"MIT"
] | sdedalus/AutoOperator | src/AutoOperator/RelationalOperaton.cs | 1,452 | C# |
/*
--------------------------------------------------
| Copyright © 2008 Mr-Alan. All rights reserved. |
| Website: www.0x69h.com |
| Mail: mr.alan.china@gmail.com |
| QQ: 835988221 |
--------------------------------------------------
*/
using System;
using System.Collections.Generic;
using BlackFire.Unity.Editor.Runtime;
using UnityEngine;
namespace CatEditor
{
public class UnitTest:UnitTestBase
{
public int public_SubInt;
private int private_SubInt;
private static int private_static_SubInt;
public int public_SubInt_P { get; set; }
private int private_SubInt_P { get; set; }
private static int private_static_SubInt_P { get; set; }
private void Start()
{
var ro = new ReflectObject(this);
}
}
[RequireComponent(typeof(Transform))]
[Groups("...")]
public class UnitTestBase:MonoBehaviour
{
public int public_BaseInt;
private int private_BaseInt;
private static int private_static_BaseInt;
public int public_BaseInt_P { get; set; }
private int private_BaseInt_P { get; set; }
private static int private_static_BaseInt_P { get; set; }
private void Start()
{
var ro = new ReflectObject(this.GetType());
}
}
} | 25.086207 | 65 | 0.531271 | [
"MIT"
] | BlackFire-Studio/BlackFire.Unity | Runtime/Script/Common/CatEditor/Runtime/UnitTest/UnitTest.cs | 1,456 | C# |
// ------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
// ------------------------------------------------------------------------------
// **NOTE** This file was generated by a tool and any changes will be overwritten.
// <auto-generated/>
// Template Source: EntityRequestBuilder.cs.tt
namespace Microsoft.Graph
{
using System;
using System.Collections.Generic;
using System.IO;
/// <summary>
/// The type AccessReviewStageRequestBuilder.
/// </summary>
public partial class AccessReviewStageRequestBuilder : EntityRequestBuilder, IAccessReviewStageRequestBuilder
{
/// <summary>
/// Constructs a new AccessReviewStageRequestBuilder.
/// </summary>
/// <param name="requestUrl">The URL for the built request.</param>
/// <param name="client">The <see cref="IBaseClient"/> for handling requests.</param>
public AccessReviewStageRequestBuilder(
string requestUrl,
IBaseClient client)
: base(requestUrl, client)
{
}
/// <summary>
/// Builds the request.
/// </summary>
/// <returns>The built request.</returns>
public new IAccessReviewStageRequest Request()
{
return this.Request(null);
}
/// <summary>
/// Builds the request.
/// </summary>
/// <param name="options">The query and header options for the request.</param>
/// <returns>The built request.</returns>
public new IAccessReviewStageRequest Request(IEnumerable<Option> options)
{
return new AccessReviewStageRequest(this.RequestUrl, this.Client, options);
}
/// <summary>
/// Gets the request builder for Decisions.
/// </summary>
/// <returns>The <see cref="IAccessReviewStageDecisionsCollectionRequestBuilder"/>.</returns>
public IAccessReviewStageDecisionsCollectionRequestBuilder Decisions
{
get
{
return new AccessReviewStageDecisionsCollectionRequestBuilder(this.AppendSegmentToRequestUrl("decisions"), this.Client);
}
}
/// <summary>
/// Gets the request builder for AccessReviewStageStop.
/// </summary>
/// <returns>The <see cref="IAccessReviewStageStopRequestBuilder"/>.</returns>
public IAccessReviewStageStopRequestBuilder Stop()
{
return new AccessReviewStageStopRequestBuilder(
this.AppendSegmentToRequestUrl("microsoft.graph.stop"),
this.Client);
}
}
}
| 36.128205 | 153 | 0.585167 | [
"MIT"
] | ScriptBox99/msgraph-beta-sdk-dotnet | src/Microsoft.Graph/Generated/requests/AccessReviewStageRequestBuilder.cs | 2,818 | C# |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("04MaximalSequence")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("04MaximalSequence")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("47ab0c57-63d7-4b25-91d5-a7c22411098a")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| 38.027027 | 84 | 0.746979 | [
"MIT"
] | ReniGetskova/CSharp-Part-2 | Arrays/04MaximalSequence/Properties/AssemblyInfo.cs | 1,410 | C# |
using System.Linq;
using CefSharp;
using TweetLib.Browser.CEF.Interfaces;
namespace TweetImpl.CefSharp.Adapters {
sealed class CefFileDialogCallbackAdapter : IFileDialogCallbackAdapter<IFileDialogCallback> {
public static CefFileDialogCallbackAdapter Instance { get; } = new CefFileDialogCallbackAdapter();
private CefFileDialogCallbackAdapter() {}
public void Continue(IFileDialogCallback callback, int selectedAcceptFilter, string[] filePaths) {
callback.Continue(selectedAcceptFilter, filePaths.ToList());
}
public void Cancel(IFileDialogCallback callback) {
callback.Cancel();
}
public void Dispose(IFileDialogCallback callback) {
callback.Dispose();
}
}
}
| 28.875 | 100 | 0.787879 | [
"MIT"
] | chylex/TweetDick | windows/TweetImpl.CefSharp/Adapters/CefFileDialogCallbackAdapter.cs | 693 | C# |
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using Microsoft.Extensions.DependencyModel;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using NuGet.Packaging.Core;
using NuGet.ProjectModel;
using NuGet.Versioning;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace Microsoft.NET.Build.Tasks
{
/// <summary>
/// Generates the $(project).deps.json file.
/// </summary>
public class GenerateDepsFile : TaskBase
{
[Required]
public string ProjectPath { get; set; }
public string AssetsFilePath { get; set; }
[Required]
public string DepsFilePath { get; set; }
[Required]
public string TargetFramework { get; set; }
public string RuntimeIdentifier { get; set; }
public string PlatformLibraryName { get; set; }
public ITaskItem[] RuntimeFrameworks { get; set; }
[Required]
public string AssemblyName { get; set; }
[Required]
public string AssemblyExtension { get; set; }
[Required]
public string AssemblyVersion { get; set; }
public ITaskItem[] AssemblySatelliteAssemblies { get; set; } = Array.Empty<ITaskItem>();
[Required]
public bool IncludeMainProject { get; set; }
public ITaskItem[] ReferencePaths { get; set; } = Array.Empty<ITaskItem>();
public ITaskItem[] ReferenceDependencyPaths { get; set; } = Array.Empty<ITaskItem>();
public ITaskItem[] ReferenceSatellitePaths { get; set; } = Array.Empty<ITaskItem>();
public ITaskItem[] ReferenceAssemblies { get; set; } = Array.Empty<ITaskItem>();
public ITaskItem[] RuntimePackAssets { get; set; } = Array.Empty<ITaskItem>();
public ITaskItem CompilerOptions { get; set; }
public ITaskItem[] RuntimeStorePackages { get; set; }
[Required]
public ITaskItem[] CompileReferences { get; set; }
// NativeCopyLocalItems, ResourceCopyLocalItems, RuntimeCopyLocalItems
[Required]
public ITaskItem[] ResolvedNuGetFiles { get; set; }
[Required]
public ITaskItem[] ResolvedRuntimeTargetsFiles { get; set; }
public bool IsSelfContained { get; set; }
public bool IncludeRuntimeFileVersions { get; set; }
List<ITaskItem> _filesWritten = new List<ITaskItem>();
[Output]
public ITaskItem[] FilesWritten
{
get { return _filesWritten.ToArray(); }
}
private Dictionary<PackageIdentity, string> GetFilteredPackages()
{
Dictionary<PackageIdentity, string> filteredPackages = null;
if (RuntimeStorePackages != null && RuntimeStorePackages.Length > 0)
{
filteredPackages = new Dictionary<PackageIdentity, string>();
foreach (var package in RuntimeStorePackages)
{
filteredPackages.Add(
ItemUtilities.GetPackageIdentity(package),
package.GetMetadata(MetadataKeys.RuntimeStoreManifestNames));
}
}
return filteredPackages;
}
private void WriteDepsFile(string depsFilePath)
{
LockFile lockFile = new LockFileCache(this).GetLockFile(AssetsFilePath);
CompilationOptions compilationOptions = CompilationOptionsConverter.ConvertFrom(CompilerOptions);
SingleProjectInfo mainProject = SingleProjectInfo.Create(
ProjectPath,
AssemblyName,
AssemblyExtension,
AssemblyVersion,
AssemblySatelliteAssemblies);
IEnumerable<ReferenceInfo> referenceAssemblyInfos =
ReferenceInfo.CreateReferenceInfos(ReferenceAssemblies);
IEnumerable<ReferenceInfo> directReferences =
ReferenceInfo.CreateDirectReferenceInfos(ReferencePaths, ReferenceSatellitePaths);
IEnumerable<ReferenceInfo> dependencyReferences =
ReferenceInfo.CreateDependencyReferenceInfos(ReferenceDependencyPaths, ReferenceSatellitePaths);
Dictionary<string, SingleProjectInfo> referenceProjects = SingleProjectInfo.CreateProjectReferenceInfos(
ReferencePaths,
ReferenceDependencyPaths,
ReferenceSatellitePaths);
IEnumerable<RuntimePackAssetInfo> runtimePackAssets =
IsSelfContained ? RuntimePackAssets.Select(item => RuntimePackAssetInfo.FromItem(item)) : Enumerable.Empty<RuntimePackAssetInfo>();
ProjectContext projectContext = lockFile.CreateProjectContext(
NuGetUtils.ParseFrameworkName(TargetFramework),
RuntimeIdentifier,
PlatformLibraryName,
RuntimeFrameworks,
IsSelfContained);
var builder = new DependencyContextBuilder(mainProject, projectContext, IncludeRuntimeFileVersions);
builder = builder
.WithMainProjectInDepsFile(IncludeMainProject)
.WithReferenceAssemblies(referenceAssemblyInfos)
.WithDirectReferences(directReferences)
.WithDependencyReferences(dependencyReferences)
.WithReferenceProjectInfos(referenceProjects)
.WithRuntimePackAssets(runtimePackAssets)
.WithCompilationOptions(compilationOptions)
.WithReferenceAssembliesPath(FrameworkReferenceResolver.GetDefaultReferenceAssembliesPath())
.WithPackagesThatWereFiltered(GetFilteredPackages());
if (CompileReferences.Length > 0)
{
builder = builder.WithCompileReferences(ReferenceInfo.CreateReferenceInfos(CompileReferences));
}
var resolvedNuGetFiles = ResolvedNuGetFiles.Select(f => new ResolvedFile(f, false))
.Concat(ResolvedRuntimeTargetsFiles.Select(f => new ResolvedFile(f, true)));
builder = builder.WithResolvedNuGetFiles(resolvedNuGetFiles);
DependencyContext dependencyContext = builder.Build();
var writer = new DependencyContextWriter();
using (var fileStream = File.Create(depsFilePath))
{
writer.Write(dependencyContext, fileStream);
}
_filesWritten.Add(new TaskItem(depsFilePath));
}
protected override void ExecuteCore()
{
WriteDepsFile(DepsFilePath);
}
}
}
| 36.826087 | 147 | 0.645661 | [
"MIT"
] | SeppPenner/sdk-1 | src/Tasks/Microsoft.NET.Build.Tasks/GenerateDepsFile.cs | 6,778 | C# |
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class RadarGraph : Image
{
[HideInInspector]
public Pattern.Radar radar;
[HideInInspector]
public float size;
protected override void OnPopulateMesh(VertexHelper toFill)
{
toFill.Clear();
UIVertex vert = UIVertex.simpleVert;
vert.position = Vector2.zero;
vert.color = color;
toFill.AddVert(vert);
Action<int, float> addPoint =
(int normalized, float angleInDegree) =>
{
UIVertex vert = UIVertex.simpleVert;
float distance = normalized * 0.01f * size;
float angleInRadian = angleInDegree * Mathf.Deg2Rad;
vert.position = new Vector2(
Mathf.Cos(angleInRadian),
Mathf.Sin(angleInRadian)
) * distance;
vert.color = color;
toFill.AddVert(vert);
};
addPoint(radar.density.normalized, 90f);
addPoint(radar.async.normalized, 162f);
addPoint(radar.chaos.normalized, 234f);
addPoint(radar.speed.normalized, 306f);
addPoint(radar.voltage.normalized, 18f);
for (int i = 0; i < 5; i++)
{
toFill.AddTriangle(i + 1, (i + 1) % 5 + 1, 0);
}
}
}
| 27.673469 | 64 | 0.586283 | [
"MIT"
] | Rodin1a/techmania | TECHMANIA/Assets/Scripts/Components/UI/RadarGraph.cs | 1,356 | C# |
/*******************************************************************************
* Copyright 2012-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use
* this file except in compliance with the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file.
* This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
* *****************************************************************************
*
* AWS Tools for Windows (TM) PowerShell (TM)
*
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Management.Automation;
using System.Text;
using Amazon.PowerShell.Common;
using Amazon.Runtime;
using Amazon.CodeGuruProfiler;
using Amazon.CodeGuruProfiler.Model;
namespace Amazon.PowerShell.Cmdlets.CGP
{
/// <summary>
/// Returns the time series of values for a requested list of frame metrics from a time
/// period.
/// </summary>
[Cmdlet("Get", "CGPGetFrameMetricData")]
[OutputType("Amazon.CodeGuruProfiler.Model.BatchGetFrameMetricDataResponse")]
[AWSCmdlet("Calls the Amazon CodeGuru Profiler BatchGetFrameMetricData API operation.", Operation = new[] {"BatchGetFrameMetricData"}, SelectReturnType = typeof(Amazon.CodeGuruProfiler.Model.BatchGetFrameMetricDataResponse))]
[AWSCmdletOutput("Amazon.CodeGuruProfiler.Model.BatchGetFrameMetricDataResponse",
"This cmdlet returns an Amazon.CodeGuruProfiler.Model.BatchGetFrameMetricDataResponse object containing multiple properties. The object can also be referenced from properties attached to the cmdlet entry in the $AWSHistory stack."
)]
public partial class GetCGPGetFrameMetricDataCmdlet : AmazonCodeGuruProfilerClientCmdlet, IExecutor
{
#region Parameter EndTime
/// <summary>
/// <para>
/// <para> The end time of the time period for the returned time series values. This is specified
/// using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond
/// past June 1, 2020 1:15:02 PM UTC. </para>
/// </para>
/// </summary>
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.DateTime? EndTime { get; set; }
#endregion
#region Parameter FrameMetric
/// <summary>
/// <para>
/// <para> The details of the metrics that are used to request a time series of values. The
/// metric includes the name of the frame, the aggregation type to calculate the metric
/// value for the frame, and the thread states to use to get the count for the metric
/// value of the frame.</para>
/// </para>
/// </summary>
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[Alias("FrameMetrics")]
public Amazon.CodeGuruProfiler.Model.FrameMetric[] FrameMetric { get; set; }
#endregion
#region Parameter Period
/// <summary>
/// <para>
/// <para> The duration of the frame metrics used to return the time series values. Specify
/// using the ISO 8601 format. The maximum period duration is one day (<code>PT24H</code>
/// or <code>P1D</code>). </para>
/// </para>
/// </summary>
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.String Period { get; set; }
#endregion
#region Parameter ProfilingGroupName
/// <summary>
/// <para>
/// <para> The name of the profiling group associated with the the frame metrics used to return
/// the time series values. </para>
/// </para>
/// </summary>
#if !MODULAR
[System.Management.Automation.Parameter(Position = 0, ValueFromPipelineByPropertyName = true, ValueFromPipeline = true)]
#else
[System.Management.Automation.Parameter(Position = 0, ValueFromPipelineByPropertyName = true, ValueFromPipeline = true, Mandatory = true)]
[System.Management.Automation.AllowEmptyString]
[System.Management.Automation.AllowNull]
#endif
[Amazon.PowerShell.Common.AWSRequiredParameter]
public System.String ProfilingGroupName { get; set; }
#endregion
#region Parameter StartTime
/// <summary>
/// <para>
/// <para> The start time of the time period for the frame metrics used to return the time series
/// values. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z
/// represents 1 millisecond past June 1, 2020 1:15:02 PM UTC. </para>
/// </para>
/// </summary>
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.DateTime? StartTime { get; set; }
#endregion
#region Parameter TargetResolution
/// <summary>
/// <para>
/// <para>The requested resolution of time steps for the returned time series of values. If
/// the requested target resolution is not available due to data not being retained we
/// provide a best effort result by falling back to the most granular available resolution
/// after the target resolution. There are 3 valid values. </para><ul><li><para><code>P1D</code> — 1 day </para></li><li><para><code>PT1H</code> — 1 hour </para></li><li><para><code>PT5M</code> — 5 minutes </para></li></ul>
/// </para>
/// </summary>
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[AWSConstantClassSource("Amazon.CodeGuruProfiler.AggregationPeriod")]
public Amazon.CodeGuruProfiler.AggregationPeriod TargetResolution { get; set; }
#endregion
#region Parameter Select
/// <summary>
/// Use the -Select parameter to control the cmdlet output. The default value is '*'.
/// Specifying -Select '*' will result in the cmdlet returning the whole service response (Amazon.CodeGuruProfiler.Model.BatchGetFrameMetricDataResponse).
/// Specifying the name of a property of type Amazon.CodeGuruProfiler.Model.BatchGetFrameMetricDataResponse will result in that property being returned.
/// Specifying -Select '^ParameterName' will result in the cmdlet returning the selected cmdlet parameter value.
/// </summary>
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public string Select { get; set; } = "*";
#endregion
#region Parameter PassThru
/// <summary>
/// Changes the cmdlet behavior to return the value passed to the ProfilingGroupName parameter.
/// The -PassThru parameter is deprecated, use -Select '^ProfilingGroupName' instead. This parameter will be removed in a future version.
/// </summary>
[System.Obsolete("The -PassThru parameter is deprecated, use -Select '^ProfilingGroupName' instead. This parameter will be removed in a future version.")]
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public SwitchParameter PassThru { get; set; }
#endregion
protected override void ProcessRecord()
{
base.ProcessRecord();
var context = new CmdletContext();
// allow for manipulation of parameters prior to loading into context
PreExecutionContextLoad(context);
#pragma warning disable CS0618, CS0612 //A class member was marked with the Obsolete attribute
if (ParameterWasBound(nameof(this.Select)))
{
context.Select = CreateSelectDelegate<Amazon.CodeGuruProfiler.Model.BatchGetFrameMetricDataResponse, GetCGPGetFrameMetricDataCmdlet>(Select) ??
throw new System.ArgumentException("Invalid value for -Select parameter.", nameof(this.Select));
if (this.PassThru.IsPresent)
{
throw new System.ArgumentException("-PassThru cannot be used when -Select is specified.", nameof(this.Select));
}
}
else if (this.PassThru.IsPresent)
{
context.Select = (response, cmdlet) => this.ProfilingGroupName;
}
#pragma warning restore CS0618, CS0612 //A class member was marked with the Obsolete attribute
context.EndTime = this.EndTime;
if (this.FrameMetric != null)
{
context.FrameMetric = new List<Amazon.CodeGuruProfiler.Model.FrameMetric>(this.FrameMetric);
}
context.Period = this.Period;
context.ProfilingGroupName = this.ProfilingGroupName;
#if MODULAR
if (this.ProfilingGroupName == null && ParameterWasBound(nameof(this.ProfilingGroupName)))
{
WriteWarning("You are passing $null as a value for parameter ProfilingGroupName which is marked as required. In case you believe this parameter was incorrectly marked as required, report this by opening an issue at https://github.com/aws/aws-tools-for-powershell/issues.");
}
#endif
context.StartTime = this.StartTime;
context.TargetResolution = this.TargetResolution;
// allow further manipulation of loaded context prior to processing
PostExecutionContextLoad(context);
var output = Execute(context) as CmdletOutput;
ProcessOutput(output);
}
#region IExecutor Members
public object Execute(ExecutorContext context)
{
var cmdletContext = context as CmdletContext;
// create request
var request = new Amazon.CodeGuruProfiler.Model.BatchGetFrameMetricDataRequest();
if (cmdletContext.EndTime != null)
{
request.EndTime = cmdletContext.EndTime.Value;
}
if (cmdletContext.FrameMetric != null)
{
request.FrameMetrics = cmdletContext.FrameMetric;
}
if (cmdletContext.Period != null)
{
request.Period = cmdletContext.Period;
}
if (cmdletContext.ProfilingGroupName != null)
{
request.ProfilingGroupName = cmdletContext.ProfilingGroupName;
}
if (cmdletContext.StartTime != null)
{
request.StartTime = cmdletContext.StartTime.Value;
}
if (cmdletContext.TargetResolution != null)
{
request.TargetResolution = cmdletContext.TargetResolution;
}
CmdletOutput output;
// issue call
var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint);
try
{
var response = CallAWSServiceOperation(client, request);
object pipelineOutput = null;
pipelineOutput = cmdletContext.Select(response, this);
output = new CmdletOutput
{
PipelineOutput = pipelineOutput,
ServiceResponse = response
};
}
catch (Exception e)
{
output = new CmdletOutput { ErrorResponse = e };
}
return output;
}
public ExecutorContext CreateContext()
{
return new CmdletContext();
}
#endregion
#region AWS Service Operation Call
private Amazon.CodeGuruProfiler.Model.BatchGetFrameMetricDataResponse CallAWSServiceOperation(IAmazonCodeGuruProfiler client, Amazon.CodeGuruProfiler.Model.BatchGetFrameMetricDataRequest request)
{
Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon CodeGuru Profiler", "BatchGetFrameMetricData");
try
{
#if DESKTOP
return client.BatchGetFrameMetricData(request);
#elif CORECLR
return client.BatchGetFrameMetricDataAsync(request).GetAwaiter().GetResult();
#else
#error "Unknown build edition"
#endif
}
catch (AmazonServiceException exc)
{
var webException = exc.InnerException as System.Net.WebException;
if (webException != null)
{
throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException);
}
throw;
}
}
#endregion
internal partial class CmdletContext : ExecutorContext
{
public System.DateTime? EndTime { get; set; }
public List<Amazon.CodeGuruProfiler.Model.FrameMetric> FrameMetric { get; set; }
public System.String Period { get; set; }
public System.String ProfilingGroupName { get; set; }
public System.DateTime? StartTime { get; set; }
public Amazon.CodeGuruProfiler.AggregationPeriod TargetResolution { get; set; }
public System.Func<Amazon.CodeGuruProfiler.Model.BatchGetFrameMetricDataResponse, GetCGPGetFrameMetricDataCmdlet, object> Select { get; set; } =
(response, cmdlet) => response;
}
}
}
| 47.191275 | 289 | 0.617009 | [
"Apache-2.0"
] | QPC-database/aws-tools-for-powershell | modules/AWSPowerShell/Cmdlets/CodeGuruProfiler/Basic/Get-CGPGetFrameMetricData-Cmdlet.cs | 14,069 | C# |
using OnlineTeachingSystem.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace OnlineTeachingSystem.ViewModels
{
public class ExamViewModel : BaseViewModel
{
public string Name { set; get; }
public List<Exam> QuestionList { set; get; }
public int QuestionNum { get; set; }
public int ExamScore { get; set; }
}
} | 24.058824 | 52 | 0.684597 | [
"MIT"
] | Dwayneten/OnlineTeachingSystem | OnlineTeachingSystem/ViewModels/ExamViewModel.cs | 411 | C# |
/*
* Copyright (c) 2018 THL A29 Limited, a Tencent company. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
namespace TencentCloud.Sqlserver.V20180328.Models
{
using Newtonsoft.Json;
using System.Collections.Generic;
using TencentCloud.Common;
public class RestartDBInstanceRequest : AbstractModel
{
/// <summary>
/// 数据库实例ID,形如mssql-njj2mtpl
/// </summary>
[JsonProperty("InstanceId")]
public string InstanceId{ get; set; }
/// <summary>
/// 内部实现,用户禁止调用
/// </summary>
internal override void ToMap(Dictionary<string, string> map, string prefix)
{
this.SetParamSimple(map, prefix + "InstanceId", this.InstanceId);
}
}
}
| 29.5 | 83 | 0.664099 | [
"Apache-2.0"
] | Darkfaker/tencentcloud-sdk-dotnet | TencentCloud/Sqlserver/V20180328/Models/RestartDBInstanceRequest.cs | 1,336 | C# |
/*
* tilia Phoenix API
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* OpenAPI spec version: 7.0.6
*
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*/
using System;
using System.Linq;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.ComponentModel.DataAnnotations;
using SwaggerDateConverter = TiliaLabs.Phoenix.Client.SwaggerDateConverter;
namespace TiliaLabs.Phoenix.Model
{
/// <summary>
/// Lists of products and/or specific layout dies to snap artwork into
/// </summary>
[DataContract]
public partial class AutosnapProductDiesEntity : IEquatable<AutosnapProductDiesEntity>, IValidatableObject
{
/// <summary>
/// Initializes a new instance of the <see cref="AutosnapProductDiesEntity" /> class.
/// </summary>
/// <param name="path">Local path of artwork file (required).</param>
/// <param name="frontPage">Page number of front artwork. When not specified defaults to page 1 unless back page is defined in which case only back side of die is snapped.</param>
/// <param name="backPage">Page number of back artwork. Default: none.</param>
/// <param name="cutInk">Name if spot cut line ink. Ink automatically detected when not specified.</param>
/// <param name="products">Names of products to snap artwork into.</param>
/// <param name="dies">Current layout dies to snap artwork into.</param>
public AutosnapProductDiesEntity(string path = default(string), int? frontPage = default(int?), int? backPage = default(int?), string cutInk = default(string), List<string> products = default(List<string>), List<DieEntity> dies = default(List<DieEntity>))
{
// to ensure "path" is required (not null)
if (path == null)
{
throw new InvalidDataException("path is a required property for AutosnapProductDiesEntity and cannot be null");
}
else
{
this.Path = path;
}
this.FrontPage = frontPage;
this.BackPage = backPage;
this.CutInk = cutInk;
this.Products = products;
this.Dies = dies;
}
/// <summary>
/// Local path of artwork file
/// </summary>
/// <value>Local path of artwork file</value>
[DataMember(Name="path", EmitDefaultValue=false)]
public string Path { get; set; }
/// <summary>
/// Page number of front artwork. When not specified defaults to page 1 unless back page is defined in which case only back side of die is snapped
/// </summary>
/// <value>Page number of front artwork. When not specified defaults to page 1 unless back page is defined in which case only back side of die is snapped</value>
[DataMember(Name="front-page", EmitDefaultValue=false)]
public int? FrontPage { get; set; }
/// <summary>
/// Page number of back artwork. Default: none
/// </summary>
/// <value>Page number of back artwork. Default: none</value>
[DataMember(Name="back-page", EmitDefaultValue=false)]
public int? BackPage { get; set; }
/// <summary>
/// Name if spot cut line ink. Ink automatically detected when not specified
/// </summary>
/// <value>Name if spot cut line ink. Ink automatically detected when not specified</value>
[DataMember(Name="cut-ink", EmitDefaultValue=false)]
public string CutInk { get; set; }
/// <summary>
/// Names of products to snap artwork into
/// </summary>
/// <value>Names of products to snap artwork into</value>
[DataMember(Name="products", EmitDefaultValue=false)]
public List<string> Products { get; set; }
/// <summary>
/// Current layout dies to snap artwork into
/// </summary>
/// <value>Current layout dies to snap artwork into</value>
[DataMember(Name="dies", EmitDefaultValue=false)]
public List<DieEntity> Dies { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
var sb = new StringBuilder();
sb.Append("class AutosnapProductDiesEntity {\n");
sb.Append(" Path: ").Append(Path).Append("\n");
sb.Append(" FrontPage: ").Append(FrontPage).Append("\n");
sb.Append(" BackPage: ").Append(BackPage).Append("\n");
sb.Append(" CutInk: ").Append(CutInk).Append("\n");
sb.Append(" Products: ").Append(Products).Append("\n");
sb.Append(" Dies: ").Append(Dies).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return JsonConvert.SerializeObject(this, Formatting.Indented);
}
/// <summary>
/// Returns true if objects are equal
/// </summary>
/// <param name="input">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object input)
{
return this.Equals(input as AutosnapProductDiesEntity);
}
/// <summary>
/// Returns true if AutosnapProductDiesEntity instances are equal
/// </summary>
/// <param name="input">Instance of AutosnapProductDiesEntity to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(AutosnapProductDiesEntity input)
{
if (input == null)
return false;
return
(
this.Path == input.Path ||
(this.Path != null &&
this.Path.Equals(input.Path))
) &&
(
this.FrontPage == input.FrontPage ||
(this.FrontPage != null &&
this.FrontPage.Equals(input.FrontPage))
) &&
(
this.BackPage == input.BackPage ||
(this.BackPage != null &&
this.BackPage.Equals(input.BackPage))
) &&
(
this.CutInk == input.CutInk ||
(this.CutInk != null &&
this.CutInk.Equals(input.CutInk))
) &&
(
this.Products == input.Products ||
this.Products != null &&
input.Products != null &&
this.Products.SequenceEqual(input.Products)
) &&
(
this.Dies == input.Dies ||
this.Dies != null &&
input.Dies != null &&
this.Dies.SequenceEqual(input.Dies)
);
}
/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
int hashCode = 41;
if (this.Path != null)
hashCode = hashCode * 59 + this.Path.GetHashCode();
if (this.FrontPage != null)
hashCode = hashCode * 59 + this.FrontPage.GetHashCode();
if (this.BackPage != null)
hashCode = hashCode * 59 + this.BackPage.GetHashCode();
if (this.CutInk != null)
hashCode = hashCode * 59 + this.CutInk.GetHashCode();
if (this.Products != null)
hashCode = hashCode * 59 + this.Products.GetHashCode();
if (this.Dies != null)
hashCode = hashCode * 59 + this.Dies.GetHashCode();
return hashCode;
}
}
/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
yield break;
}
}
}
| 40.835616 | 263 | 0.557755 | [
"Apache-2.0"
] | matthewkayy/tilia-phoenix-client-csharp | src/TiliaLabs.Phoenix/Model/AutosnapProductDiesEntity.cs | 8,943 | C# |
using System.Runtime.Serialization;
namespace Checkout.Common
{
public enum PaymentSourceType
{
[EnumMember(Value = "card")] Card,
[EnumMember(Value = "id")] Id,
[EnumMember(Value = "network_token")] NetworkToken,
[EnumMember(Value = "token")] Token,
[EnumMember(Value = "customer")] Customer,
[EnumMember(Value = "dlocal")] DLocal,
[EnumMember(Value = "currency_account")]
CurrencyAccount,
[EnumMember(Value = "baloto")] Baloto,
[EnumMember(Value = "boleto")] Boleto,
[EnumMember(Value = "fawry")] Fawry,
[EnumMember(Value = "giropay")] Giropay,
[EnumMember(Value = "ideal")] Ideal,
[EnumMember(Value = "oxxo")] Oxxo,
[EnumMember(Value = "pagofacil")] PagoFacil,
[EnumMember(Value = "rapipago")] RapiPago,
[EnumMember(Value = "klarna")] Klarna,
[EnumMember(Value = "sofort")] Sofort,
}
} | 33.857143 | 59 | 0.597046 | [
"MIT"
] | checkout/checkout-sdk-net | src/CheckoutSdk/Common/PaymentSourceType.cs | 950 | C# |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Students Grades")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Students Grades")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("40b1132d-1bcf-49c0-a029-b017047156e1")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| 37.783784 | 84 | 0.747496 | [
"MIT"
] | iamjarif/SWE-4202-Lab-Tasks-Summer-2021 | Lab01_Students Number Grading/Properties/AssemblyInfo.cs | 1,401 | C# |
using System;
using System.Globalization;
using System.Linq;
using System.Reflection;
using System.Web.Http.Controllers;
using System.Web.Http.Description;
using System.Xml.XPath;
using RingwraithMICGOR.Areas.HelpPage.ModelDescriptions;
namespace RingwraithMICGOR.Areas.HelpPage
{
/// <summary>
/// A custom <see cref="IDocumentationProvider"/> that reads the API documentation from an XML documentation file.
/// </summary>
public class XmlDocumentationProvider : IDocumentationProvider, IModelDocumentationProvider
{
private XPathNavigator _documentNavigator;
private const string TypeExpression = "/doc/members/member[@name='T:{0}']";
private const string MethodExpression = "/doc/members/member[@name='M:{0}']";
private const string PropertyExpression = "/doc/members/member[@name='P:{0}']";
private const string FieldExpression = "/doc/members/member[@name='F:{0}']";
private const string ParameterExpression = "param[@name='{0}']";
/// <summary>
/// Initializes a new instance of the <see cref="XmlDocumentationProvider"/> class.
/// </summary>
/// <param name="documentPath">The physical path to XML document.</param>
public XmlDocumentationProvider(string documentPath)
{
if (documentPath == null)
{
throw new ArgumentNullException("documentPath");
}
XPathDocument xpath = new XPathDocument(documentPath);
_documentNavigator = xpath.CreateNavigator();
}
public string GetDocumentation(HttpControllerDescriptor controllerDescriptor)
{
XPathNavigator typeNode = GetTypeNode(controllerDescriptor.ControllerType);
return GetTagValue(typeNode, "summary");
}
public virtual string GetDocumentation(HttpActionDescriptor actionDescriptor)
{
XPathNavigator methodNode = GetMethodNode(actionDescriptor);
return GetTagValue(methodNode, "summary");
}
public virtual string GetDocumentation(HttpParameterDescriptor parameterDescriptor)
{
ReflectedHttpParameterDescriptor reflectedParameterDescriptor = parameterDescriptor as ReflectedHttpParameterDescriptor;
if (reflectedParameterDescriptor != null)
{
XPathNavigator methodNode = GetMethodNode(reflectedParameterDescriptor.ActionDescriptor);
if (methodNode != null)
{
string parameterName = reflectedParameterDescriptor.ParameterInfo.Name;
XPathNavigator parameterNode = methodNode.SelectSingleNode(String.Format(CultureInfo.InvariantCulture, ParameterExpression, parameterName));
if (parameterNode != null)
{
return parameterNode.Value.Trim();
}
}
}
return null;
}
public string GetResponseDocumentation(HttpActionDescriptor actionDescriptor)
{
XPathNavigator methodNode = GetMethodNode(actionDescriptor);
return GetTagValue(methodNode, "returns");
}
public string GetDocumentation(MemberInfo member)
{
string memberName = String.Format(CultureInfo.InvariantCulture, "{0}.{1}", GetTypeName(member.DeclaringType), member.Name);
string expression = member.MemberType == MemberTypes.Field ? FieldExpression : PropertyExpression;
string selectExpression = String.Format(CultureInfo.InvariantCulture, expression, memberName);
XPathNavigator propertyNode = _documentNavigator.SelectSingleNode(selectExpression);
return GetTagValue(propertyNode, "summary");
}
public string GetDocumentation(Type type)
{
XPathNavigator typeNode = GetTypeNode(type);
return GetTagValue(typeNode, "summary");
}
private XPathNavigator GetMethodNode(HttpActionDescriptor actionDescriptor)
{
ReflectedHttpActionDescriptor reflectedActionDescriptor = actionDescriptor as ReflectedHttpActionDescriptor;
if (reflectedActionDescriptor != null)
{
string selectExpression = String.Format(CultureInfo.InvariantCulture, MethodExpression, GetMemberName(reflectedActionDescriptor.MethodInfo));
return _documentNavigator.SelectSingleNode(selectExpression);
}
return null;
}
private static string GetMemberName(MethodInfo method)
{
string name = String.Format(CultureInfo.InvariantCulture, "{0}.{1}", GetTypeName(method.DeclaringType), method.Name);
ParameterInfo[] parameters = method.GetParameters();
if (parameters.Length != 0)
{
string[] parameterTypeNames = parameters.Select(param => GetTypeName(param.ParameterType)).ToArray();
name += String.Format(CultureInfo.InvariantCulture, "({0})", String.Join(",", parameterTypeNames));
}
return name;
}
private static string GetTagValue(XPathNavigator parentNode, string tagName)
{
if (parentNode != null)
{
XPathNavigator node = parentNode.SelectSingleNode(tagName);
if (node != null)
{
return node.Value.Trim();
}
}
return null;
}
private XPathNavigator GetTypeNode(Type type)
{
string controllerTypeName = GetTypeName(type);
string selectExpression = String.Format(CultureInfo.InvariantCulture, TypeExpression, controllerTypeName);
return _documentNavigator.SelectSingleNode(selectExpression);
}
private static string GetTypeName(Type type)
{
string name = type.FullName;
if (type.IsGenericType)
{
// Format the generic type name to something like: Generic{System.Int32,System.String}
Type genericType = type.GetGenericTypeDefinition();
Type[] genericArguments = type.GetGenericArguments();
string genericTypeName = genericType.FullName;
// Trim the generic parameter counts from the name
genericTypeName = genericTypeName.Substring(0, genericTypeName.IndexOf('`'));
string[] argumentTypeNames = genericArguments.Select(t => GetTypeName(t)).ToArray();
name = String.Format(CultureInfo.InvariantCulture, "{0}{{{1}}}", genericTypeName, String.Join(",", argumentTypeNames));
}
if (type.IsNested)
{
// Changing the nested type name from OuterType+InnerType to OuterType.InnerType to match the XML documentation syntax.
name = name.Replace("+", ".");
}
return name;
}
}
}
| 43.432099 | 160 | 0.63303 | [
"MIT"
] | M1nified/SOA | Kolokwium1/RingwraithMICGOR/Ringwraith/Areas/HelpPage/XmlDocumentationProvider.cs | 7,036 | C# |
using System;
using System.Linq;
namespace Problem_2.Rotate_and_Sum
{
class RotateAndSum
{
static void Main(string[] args)
{
int[] array = Console.ReadLine().Split(new[] {' '}, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse)
.ToArray();
int n = int.Parse(Console.ReadLine());
int[] summedArray = RotateAndSumArray(array, n);
Console.WriteLine(string.Join(" ", summedArray));
}
static int[] RotateAndSumArray(int[] arrayToRotate, int timesToRotate)
{
int arrayLength = arrayToRotate.Length;
int[] summedArray = new int[arrayLength];
for (int j = 0; j < timesToRotate; j++) //itterate through all rotations
{
int[] tempArr = new int[arrayLength];
for (int i = 0; i < arrayLength; i++) //rotate an array right once
{
tempArr[i] = arrayToRotate[(arrayLength - 1 + i) % arrayLength];
}
// Sum array with the temporary rotated one.
for (int i = 0; i < arrayLength; i++)
{
summedArray[i] += tempArr[i];
}
arrayToRotate = tempArr;
}
return summedArray;
}
}
} | 30.266667 | 120 | 0.504405 | [
"MIT"
] | Supbads/Softuni-Education | 07 ProgrammingFundamentals 05.17/07. Arrays-Exercises/Problem 2. Rotate and Sum/RotateAndSum.cs | 1,364 | C# |
/*
* Copyright 2013 ThirdMotion, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @class SimplifyIoC.Commands.CommandBinding
*
* The Binding for CommandBinder.
*
* The only real distinction between CommandBinding and Binding
* is the addition of `Once()`, which signals that the Binding
* should be destroyed immediately after a single use.
*/
using SimplifyIoC.Framework;
namespace SimplifyIoC.Commands
{
public class CommandBinding : Binding, ICommandBinding
{
public bool isOneOff{ get; set; }
public bool isSequence{ get; set; }
public bool isPooled{ get; set; }
public CommandBinding() : base()
{
_value.uniqueValues = false;
}
public CommandBinding (Binder.BindingResolver resolver) : base(resolver)
{
_value.uniqueValues = false;
}
public ICommandBinding Once()
{
isOneOff = true;
return this;
}
public ICommandBinding InParallel()
{
isSequence = false;
return this;
}
public ICommandBinding InSequence()
{
isSequence = true;
return this;
}
public ICommandBinding Pooled()
{
isPooled = true;
resolver (this);
return this;
}
//Everything below this point is simply facade on Binding to ensure fluent interface
new public ICommandBinding Bind<T>()
{
return base.Bind<T> () as ICommandBinding;
}
new public ICommandBinding Bind(object key)
{
return base.Bind (key) as ICommandBinding;
}
new public ICommandBinding To<T>()
{
return base.To<T> () as ICommandBinding;
}
new public ICommandBinding To(object o)
{
return base.To (o) as ICommandBinding;
}
new public ICommandBinding ToName<T>()
{
return base.ToName<T> () as ICommandBinding;
}
new public ICommandBinding ToName(object o)
{
return base.ToName (o) as ICommandBinding;
}
new public ICommandBinding Named<T>()
{
return base.Named<T> () as ICommandBinding;
}
new public ICommandBinding Named(object o)
{
return base.Named (o) as ICommandBinding;
}
}
}
| 21.504274 | 86 | 0.700318 | [
"Apache-2.0"
] | JiphuTzu/SimplifyIoC | Assets/SimplifyIoC/Runtime/SimplifyIoC/Commands/impl/CommandBinding.cs | 2,516 | C# |
using CleanArchitecture.Domain.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CleanArchitecture.Domain.Event.ModifyTodoListName
{
public class ModifyTodoListNameChanges : IDomainEventChanges
{
public string Title { get; set; }
public Guid ModifiedBy { get; set; }
public DateTime DateModified { get; set; }
}
}
| 25.647059 | 64 | 0.733945 | [
"MIT"
] | itsdaniellucas/clean-architecture-dotnet | src/CleanArchitecture.Domain/Event/ModifyTodoListName/ModifyTodoListNameChanges.cs | 438 | C# |
using UnityEngine;
using System;
using System.IO;
using System.Collections.Generic;
using UI;
using UI.State;
using UI.State.Town;
using UI.State.Menu;
using Mordor.Importers;
using Mordor;
using Data;
using UnityEngine.Analytics;
using Engines;
using Culler;
using System.Collections;
public delegate void GameTrigger();
/** Manages the display of the gui layer, and holds some shared resources. */
public class CoM : Engine
{
/** Called when a new message is posted */
public static event MessagePostedEvent OnMessagePosted;
public delegate void MessagePostedEvent(object source,EventArgs e);
// ---------------------------------------------------------
// static variables
/** The singleton instance of this class (cast as a mordorGame) */
new public static CoM Instance { get { return (Engine.Instance as CoM); } }
public static List<MessageEntry> MessageLog = new List<MessageEntry>();
/** The games dungeon */
public static MDRDungeon Dungeon;
/** Used to temporarily disable analytics. */
public static bool DisableAnalytics = false;
// -----------------------------------------------------
// Static data
// -----------------------------------------------------
/** The games monster classes */
public static MDRMonsterClassLibrary MonsterClasses;
/** The games monster types */
public static MDRMonsterTypeLibrary MonsterTypes;
/** The games monsters */
public static MDRMonsterLibrary Monsters;
/** The games damage types */
public static MDRDamageTypeLibrary DamageTypes;
/** The games skills */
public static MDRSkillLibrary Skills;
/** The games guilds */
public static MDRGuildLibrary Guilds;
/** The games races */
public static MDRRaceLibrary Races;
/** The games spells classes */
public static MDRSpellClassLibrary SpellClasses;
/** The games spells */
public static MDRSpellLibrary Spells;
/** The games items */
public static MDRItemLibrary Items;
/** The games item subtypes */
public static MDRItemTypeLibrary ItemTypes;
/** The games item subtypes */
public static MDRItemClassLibrary ItemClasses;
/** Stores data specific to this user. */
public static UserProfile Profile;
// -----------------------------------------------------
// Dynamic data
// -----------------------------------------------------
public static GameStateManager State;
/** The currently selected party */
public static MDRParty Party;
public static MDRCharacter SelectedCharacter {
get {
return (Party == null) ? null : Party.Selected;
}
}
/** True once the game data base been loaded. This means the dungeon, monsters, items, etc have all been loaded */
public static bool GameDataLoaded { get { return _gameDataLoaded; } }
/** True once the game data base been loaded. This means the dungeon, monsters, items, etc have all been loaded */
public static bool SaveFileLoaded { get { return State.Loaded; } }
/** True once the game data base been loaded. This means the dungeon, monsters, items, etc have all been loaded */
public static bool AllDataLoaded { get { return GameDataLoaded && SaveFileLoaded; } }
/** True once the game graphics has been read in. */
public static bool GraphicsLoaded { get { return _graphicsLoaded; } }
/** True once the all the data and graphics have been loaded */
public static bool Loaded { get { return GraphicsLoaded && AllDataLoaded; } }
/** If true game will be saved just before the application closes */
public static bool SaveOnExit = true;
/** The number of messages to record until we start removing them */
private const int MAX_MESSAGES = 32;
/** Used to remove objects that can not be seen */
public static AStarCuller Culler;
/** Next time town is loaded we will open the temple. */
public static bool AutoGotoTemple;
// ---------------------------------------------------------
// Stock styles
private static GUIStyle _subtextStyle;
/** Small yellow text */
public static GUIStyle SubtextStyle {
get {
if (_subtextStyle == null) {
_subtextStyle = new GUIStyle(GUIStyle.none);
}
_subtextStyle.fontSize = 12;
_subtextStyle.alignment = TextAnchor.UpperLeft;
_subtextStyle.normal.textColor = Color.yellow;
return _subtextStyle;
}
}
// ---------------------------------------------------------
// Links to gamestate, because of system where CoM was used for most things.
public static GameRecords GameStats { get { return State.GameStats; } }
public static MDRCharacterLibrary CharacterList { get { return State.CharacterList; } }
public static MDRPartyLibrary PartyList { get { return State.PartyList; } }
public static MDRStore Store { get { return State.Store; } }
public static MDRDungeon ExploredDungeon { get { return State.ExploredDungeon; } }
// ---------------------------------------------------------
// Private static
private static bool _gameDataLoaded = false;
private static bool _graphicsLoaded = false;
private const string MiscAtlasPath = "Gfx/Misc";
private const string MonsterAtlasPath = "Gfx/Monsters";
private const string MapIconsAtlasPath = "Gfx/Map";
private const string ItemIconsAtlasPath = "Gfx/Items";
private const string SpellIconsAtlasPath = "Gfx/Spells";
private const string IconsAtlasPath = "Icons";
private const string PortraitsXMLPath = "Gfx/Portraits";
/** The data files that are required to make the game run */
public static string[] RequiredStaticData;
// ---------------------------------------------------------
// Public to editor
public GameObject DungeonObject;
public GameObject FloorMap;
public Light FloodLightObject;
public Transform MonsterAvatar;
/** Number of second between autosaves, 0 to disable. */
const int AutoSaveInterval = 60;
/** Number of second between phone homes, 0 to disable. */
const int PhoneHomeInterval = 600;
/** Number of second between update ticks*/
const int TickInterval = 10;
// ---------------------------------------------------------
// Graphics
internal SpriteLibrary MiscSprites;
internal SpriteLibrary MonsterSprites;
internal SpriteLibrary MapIconSprites;
internal SpriteLibrary ItemIconSprites;
internal SpriteLibrary SpellIconSprites;
internal SpriteLibrary IconSprites;
internal SpriteLibrary Portraits;
protected GuiButton OptionsButton;
internal DungeonState DungeonState;
public static bool BenchmarkModeEnabled = false;
/** If true dungeon will be rebuilt on startup. Useful having the dungeon build on startup rather than have it packaged (which can take up extra space) */
public bool RebuildDungeonOnStart = true;
//todo: dungeon state?
/** The dungeon level we are currently showing */
public int CurrentDungeonLevel = -1;
public override void Initialize()
{
Trace.Log("Starting game");
RequiredStaticData = new string[] {
//"Dungeon",
"Guilds",
"Races",
"ItemClasses",
"ItemTypes",
"Items",
"MonsterClasses",
"MonsterTypes",
"Monsters",
"SpellClasses",
"Spells",
"Skills",
"DamageTypes"
};
State = new GameStateManager();
Settings.ReadSettings();
ProcessParameters();
base.Initialize();
SetFloodLight(Settings.Advanced.FloodLight);
PostMessage("Welcome to Endurance.");
Culler = new AStarCuller();
PushState(new LoadingState());
if (AutoSaveInterval != 0)
StartCoroutine(AutoSaveTimer());
if (PhoneHomeInterval != 0)
StartCoroutine(PhoneHomeTimer());
StartCoroutine(UpdateTickTimer());
ResourceManager.UpdateHighDPI();
}
#if UNITY_WEBPLAYER || UNITY_IPHONE
private static void ProcessParameters()
{
}
#else
private static void ProcessParameters()
{
foreach (string arg in System.Environment.GetCommandLineArgs()) {
if (string.Compare(arg, "-bench", StringComparison.OrdinalIgnoreCase) == 0)
BenchmarkModeEnabled = true;
}
}
#endif
/** Starts playing the game with given party. Game will be initalized, and dungeon loaded as appropriate */
public static void LoadParty(MDRParty newParty)
{
Util.Assert(AllDataLoaded, "Data must be loaded before a party can be run.");
Util.Assert(newParty != null, "Can not start game with null party.");
Trace.Log("Starting game with party " + newParty);
Party = newParty;
//2: work out which level we need to instantiate
Instance.DungeonState = new DungeonState();
PopAllStates();
PushState(Instance.DungeonState);
PartyController.Instance.Party = Party;
}
/**
* Loads the specific dungeon level and displays it. If level 0 is loaded the town state will be shown.
* todo: should this be dungeon states job?
*/
public static void LoadDungeonLevel(int newLevel)
{
Util.Assert(AllDataLoaded, "Data must be loaded before dungeon level.");
Util.Assert(GraphicsLoaded, "Graphics must be loaded before dungeon level.");
if ((newLevel < 0) || (newLevel >= CoM.Dungeon.Floor.Length))
throw new Exception("Invalid level index to load " + newLevel);
if (newLevel == 0) {
GetDungeonBuilder().SelectedMap = 0;
EnableCamera = false;
PushState(new TownState());
if (AutoGotoTemple) {
PushState(new TempleState());
AutoGotoTemple = false;
}
} else {
Trace.Log("Loading dungeon level " + newLevel + "/" + CoM.Dungeon.Floors);
GetDungeonBuilder().SelectedMap = newLevel;
EnableCamera = true;
Culler.Initialize(Party, newLevel);
}
if (Instance.DungeonState != null)
Instance.DungeonState.AutoMap.Map = Party.ExploredMap;
Instance.CurrentDungeonLevel = newLevel;
//stub: reset monsters
State.ForceRespawn();
FPSCounter.Reset();
}
public static DungeonBuilder GetDungeonBuilder()
{
return Instance.DungeonObject.GetComponent<DungeonBuilder>();
}
/**
* Loads a file from storage and returns it.
* Provides validiation and logging.
* If the type is a library the library will be set as the global library for that type.
* If min version is set an exception will be thrown if data doesn't meet minimum version.
*/
private static T LoadData<T>(string source, float minVersion = 0.0f, bool silent = false) where T: DataObject
{
if (!StateStorage.HasData(source))
throw new Exception("Source not found [" + source + "]");
T result = StateStorage.LoadData<T>(source);
if (result.Version < minVersion)
throw new Exception(String.Format("File {0} has an old version, expecting {1} but found {2}", source, minVersion, result.Version));
if (!silent)
Trace.Log(" - Loaded [" + source + "] (v" + result.Version.ToString("0.0") + ")");
return result;
}
/**
* Loads a library and returns it.
* Provides validiation and logging.
* If SetAsGlobal is true it will be set as the global library for that type.
* If no items are loaded an exception will be generated.
*/
private static T LoadLibrary<T, U>(string source, float minVersion = 0.0f, bool setAsGlobal = true, bool ignoreEmptyLibrarys = false)
where T:DataLibrary<U>
where U:NamedDataObject
{
T library;
try {
library = LoadData<T>(source, minVersion, true);
} catch (Exception e) {
throw new Exception(string.Format("Could not load library [{0}]\n", source) + e.Message + "\n\n" + e.StackTrace, e.InnerException);
}
if (library == null)
return null;
Trace.Log(" - Loaded " + library.Count + " from [" + source + "] (v" + library.Version.ToString("0.0") + ")");
if (setAsGlobal)
NamedDataObject.AddGlobalLibrary(library);
if ((library.Count == 0) && (!ignoreEmptyLibrarys))
throw new Exception("Error loading library: [" + library + "], no records found.");
return library;
}
/** Loads all the static data, this includes things like monsters, items, etc. These values do not change as the game progresses */
public static void LoadGameData()
{
DateTime startTime = DateTime.Now;
Trace.Log("Loading game data:");
DamageTypes = LoadLibrary<MDRDamageTypeLibrary,MDRDamageType>("DamageTypes", 0, true);
Skills = LoadLibrary<MDRSkillLibrary,MDRSkill>("Skills", 0, true);
SpellClasses = LoadLibrary<MDRSpellClassLibrary,MDRSpellClass>("SpellClasses");
Spells = LoadLibrary<MDRSpellLibrary,MDRSpell>("Spells");
Races = LoadLibrary<MDRRaceLibrary,MDRRace>("Races");
Guilds = LoadLibrary<MDRGuildLibrary,MDRGuild>("Guilds");
ItemClasses = LoadLibrary<MDRItemClassLibrary,MDRItemClass>("ItemClasses");
ItemTypes = LoadLibrary<MDRItemTypeLibrary,MDRItemType>("ItemTypes");
Items = LoadLibrary<MDRItemLibrary,MDRItem>("Items");
MonsterClasses = LoadLibrary<MDRMonsterClassLibrary,MDRMonsterClass>("MonsterClasses");
MonsterTypes = LoadLibrary<MDRMonsterTypeLibrary,MDRMonsterType>("MonsterTypes");
Monsters = LoadLibrary<MDRMonsterLibrary,MDRMonster>("Monsters");
// stub: import dungeon
var importer = new MapImporter();
Dungeon = importer.LoadDungeon(Util.ResourceToStream("Data/MDATA11"));
//Dungeon = LoadData<MDRDungeon>("Dungeon", 2.0f);
Trace.Log("Game data loading completed in " + (DateTime.Now - startTime).TotalMilliseconds.ToString("0.0") + "ms.");
_gameDataLoaded = true;
}
/** Checks characters to see if any of them set a new record.
* @param silent if true notifications will not be displayed when a record is set.
*/
public static void UpdateCharacteRecords(Boolean silent = false)
{
if (silent)
GameStats.PostNotifications = false;
foreach (MDRCharacter character in CharacterList)
GameStats.CheckCharacterRecords(character);
if (silent)
GameStats.PostNotifications = true;
}
public static void DeleteSaveFile()
{
Trace.Log("Deleting save file");
StateStorage.DeleteData("Characters");
StateStorage.DeleteData("Parties");
StateStorage.DeleteData("Store");
StateStorage.DeleteData("ExploredDungeon");
StateStorage.DeleteData("Monsters");
}
public static void DeleteGameStats()
{
StateStorage.DeleteData("GameStats");
}
/**
* Deletes all the games files, reseting the game back to when it was first run
*/
public static void FullReset()
{
Trace.Log("Full Reset");
DeleteSaveFile();
DeleteGameStats();
Settings.DeleteSettings();
PlayerPrefs.DeleteAll();
}
/** Returns true only if all the requied static game files are present. */
public static bool HasAllStaticData()
{
foreach (var file in RequiredStaticData)
if (!StateStorage.HasData(file)) {
Trace.LogDebug("Missing file {0}", file);
return false;
}
return true;
}
/** Writes all static game data to storage with optional compression */
public static void WriteStaticDataToStorage(bool compression = false)
{
StateStorage.SaveData("Dungeon", Dungeon, compression);
StateStorage.SaveData("Guilds", Guilds, compression);
StateStorage.SaveData("Races", Races, compression);
StateStorage.SaveData("ItemClasses", ItemClasses, compression);
StateStorage.SaveData("ItemTypes", ItemTypes, compression);
StateStorage.SaveData("Items", Items, compression);
StateStorage.SaveData("MonsterClasses", MonsterClasses, compression);
StateStorage.SaveData("MonsterTypes", MonsterTypes, compression);
StateStorage.SaveData("Monsters", Monsters, compression);
StateStorage.SaveData("SpellClasses", SpellClasses, compression);
StateStorage.SaveData("Spells", Spells, compression);
}
/** Create global controls */
private void CreateControls()
{
OptionsButton = new GuiButton("Options");
OptionsButton.OnMouseClicked += delegate {
if (!(CurrentState is SettingsMenuState))
PushState(new SettingsMenuState());
};
}
/** Draw overlayed ui. todo: maybe itemInfo should be part of an always present overlay state */
public override void DoDraw()
{
base.DoDraw();
// check if the game is loadeding and don't draw if we are...
if (CurrentState is LoadingState) {
return;
}
if (Settings.Advanced.PowerMode && (OptionsButton != null) && (!HideGUI)) {
CurrentState.PositionComponent(OptionsButton, 10, -10);
OptionsButton.Update();
OptionsButton.Draw();
}
}
/**
* Takes a screenshot, saving with the current filename. If no filename is given the date and time will be used */
public static void TakeScreenshot(string filename = "")
{
string path = Application.persistentDataPath + "/Screenshots";
if (!Directory.Exists(path))
Directory.CreateDirectory(path);
if (filename == "")
filename = "Endurance " + DateTime.Now.ToString("yyyy-MM-dd-hh-m-s");
string fullPath = path + "/" + filename + ".png";
GUI.matrix = Matrix4x4.identity;
ScreenCapture.CaptureScreenshot(fullPath);
PostMessage("Screenshot taken {0}", Util.Colorise(filename, Color.green));
}
/** Enables or disabled a map wide flood light. */
public void SetFloodLight(bool value)
{
if (FloodLightObject != null) {
FloodLightObject.GetComponent<Light>().enabled = value;
}
}
/** Enables or disabled the floor map. */
public void SetFloorMap(bool value)
{
if (FloorMap != null) {
FloorMap.GetComponent<Renderer>().enabled = value;
}
}
override protected void processKeys(bool ctrl, bool alt, bool shift)
{
base.processKeys(ctrl, alt, shift);
if (Input.GetKeyUp(KeyCode.Print))
TakeScreenshot();
if (Input.GetKeyUp(KeyCode.F10)) {
if (CurrentState is DungeonState || CurrentState is TownState)
PushState(new InGameMenuState());
}
if (Settings.Advanced.PowerMode) {
if (Input.GetKey(KeyCode.RightShift))
Time.timeScale = 0.1f;
else
Time.timeScale = 1.0f;
if (shift) {
if (Input.GetKeyDown(KeyCode.F1))
ApplyQualityLevel(0);
if (Input.GetKeyDown(KeyCode.F2))
ApplyQualityLevel(1);
if (Input.GetKeyDown(KeyCode.F3))
ApplyQualityLevel(2);
} else {
if (Input.GetKeyUp(KeyCode.F1))
Settings.Advanced.ShowLogs = !Settings.Advanced.ShowLogs;
if (Input.GetKeyUp(KeyCode.F2))
Settings.Advanced.ShowGuiBounds = !Settings.Advanced.ShowGuiBounds;
if (Input.GetKeyUp(KeyCode.F3))
Settings.Advanced.ShowGuiMaterial = !Settings.Advanced.ShowGuiMaterial;
if (Input.GetKeyUp(KeyCode.F4))
Settings.Advanced.UseHighDPIGui = !Settings.Advanced.UseHighDPIGui;
if (Input.GetKeyUp(KeyCode.F5))
HideGUI = !HideGUI;
if (Input.GetKeyUp(KeyCode.F6))
DungeonObject.SetActive(!DungeonObject.activeSelf);
if (Input.GetKeyUp(KeyCode.F7))
CoM.Party.Selected.GiveItem(MDRItemInstance.Create(CoM.Items[0]));
if (Input.GetKeyUp(KeyCode.F8))
Settings.Advanced.GuiCaching = !Settings.Advanced.GuiCaching;
if (Input.GetKeyUp(KeyCode.F9))
Settings.Advanced.ShowLogs = !Settings.Advanced.ShowLogs;
if (Input.GetKeyUp(KeyCode.F11))
Settings.General.FXStyle = (Settings.General.FXStyle.Next());
}
}
}
/** Coroutine to handle autosaving at regular intervals. */
private IEnumerator AutoSaveTimer()
{
while (true) {
SaveGame();
yield return new WaitForSeconds(AutoSaveInterval);
}
}
/** Coroutine to handle phone home at regular intervals. */
private IEnumerator PhoneHomeTimer()
{
while (true) {
WebServer.PostCheckIn();
yield return new WaitForSeconds(PhoneHomeInterval);
}
}
/** Coroutine to update low priority things such as the time played. */
private IEnumerator UpdateTickTimer()
{
while (true) {
if (!Loaded) {
yield return new WaitForSeconds(TickInterval);
continue;
}
if (!Engine.Idle) {
Profile.TotalPlayTime += TickInterval;
if (Party != null)
foreach (MDRCharacter character in Party) {
if (character != null)
character.PlayTime += TickInterval;
}
}
yield return new WaitForSeconds(TickInterval);
}
}
/** Updates the game */
public override void DoUpdate()
{
// check if the game has loaded and move us to the main menu
if (CurrentState is LoadingState) {
if (Loaded) {
CreateControls();
PopState();
PushState(new MenuDungeonBackground());
PushState(new MainMenuState());
} else {
base.DoUpdate();
return;
}
}
// update culling
if (Culler != null)
Culler.Update();
// update settings
//error: object not set to an instance of an object (when a few minutes into game in menu...)
SetFloodLight(Settings.Advanced.FloodLight);
SetFloorMap(Settings.Advanced.FloorMap);
base.DoUpdate();
}
/**
* Loads graphical resources at given path, returns a SpriteLibrary contianing the sprites.
* Will throw execptions if the path is not defined, or if there are no sprites at that path.
*
* @param path The path to use when loading the graphical resource (relative to Resources folder)
* @param resourceName The name to display use for the resource in the case of an error
*
* @returns A list of sprites found at that location.
*/
private static SpriteLibrary LoadGraphicResources(string path, string defaultSpriteName = "", string resourceName = "")
{
if (path == "")
throw new Exception("No path defined for " + resourceName + " sprites.");
var result = SpriteLibrary.FromResourcePath(path, defaultSpriteName);
if (result.Count == 0)
throw new Exception("No " + (resourceName == "" ? "" : "[" + resourceName + "]") + " sprites found at " + path);
return result;
}
/** Finds and organises all the sprites required to display the gui. */
public static void LoadGraphics()
{
DateTime startTime = DateTime.Now;
Trace.Log("Loading graphic resources:");
Instance.MiscSprites = LoadGraphicResources(MiscAtlasPath);
Instance.MonsterSprites = LoadGraphicResources(MonsterAtlasPath);
Instance.MapIconSprites = LoadGraphicResources(MapIconsAtlasPath);
Instance.ItemIconSprites = LoadGraphicResources(ItemIconsAtlasPath);
Instance.SpellIconSprites = LoadGraphicResources(SpellIconsAtlasPath);
Instance.IconSprites = LoadGraphicResources(IconsAtlasPath, "NotFound");
Instance.Portraits = SpriteLibrary.FromXML(PortraitsXMLPath);
Util.Assert(TextureMagic.IsReadable(Instance.MapIconSprites[0].texture), "Map sprites atlas needs to be set to readable under import settings (advanced).");
Trace.Log("Graphic resource loading completed in " + (DateTime.Now - startTime).TotalMilliseconds.ToString("0.0") + "ms.");
_graphicsLoaded = true;
}
/** Causes game to autosave (assuming everything is loaded up) */
public static void SaveGame()
{
Settings.SaveSettings();
if (SaveFileLoaded)
State.Save();
PlayerPrefs.Save();
}
/** Save on pause, iOS calls this for soft shutdown.*/
void OnApplicationPause(bool pauseStatus)
{
if (SaveOnExit && pauseStatus) {
SaveGame();
}
}
/** Shuts the game down. */
public void ShutDown()
{
WebServer.PostEvent("Shutdown");
WebServer.PostCheckIn();
if (SaveOnExit) {
SaveGame();
}
}
/** Save on exit */
void OnApplicationQuit()
{
ShutDown();
}
/** Redraws the given map tile. X and Y are 1 based */
public void RefreshMapTile(int x, int y)
{
if (DungeonState == null)
return;
DungeonState.AutoMap.RenderTile(x, y, TileRenderMode.Full, true);
DungeonState.AutoMap.MapCanvas.Apply();
}
/** Processes a list of objects, finding any that can be formated, and replacing them with their string formatted
* representation. I.e. if the list contains a spell the spell will be replaced with the colorised name of the spell */
public static object[] FormatParameters(object[] args)
{
var list = new List<object>();
foreach (var obj in args) {
object formattedObject = null;
if (obj is MDRCharacter)
formattedObject = CoM.Format(obj as MDRCharacter);
if (obj is MDRSpell)
formattedObject = CoM.Format(obj as MDRSpell);
if (obj is MDRItemInstance)
formattedObject = CoM.Format(obj as MDRItemInstance);
list.Add(formattedObject ?? obj);
}
return list.ToArray();
}
/** Pops all states, returns to main menu. */
public static void ReturnToMainMenu(object source, EventArgs e)
{
ReturnToMainMenu();
}
/** Pops all states, returns to main menu. */
public static void ReturnToMainMenu()
{
PopAllStates();
PartyController.Instance.Party = null;
PushState(new MenuDungeonBackground());
PushState(new MainMenuState());
}
/**
* Converts coins into an amount of gold, silver, and copper.
* @param value Number of coins. I.e. 104 = 1 silver, 4 copper.
* @param full If true gold, silver, and copper will always be mentioned even if they are zero.
* @param colorize. Values will be colorised.
*/
public static string CoinsAmount(int value, bool full = false)
{
int gold = (int)(value / 10000);
int silver = (int)(value / 100) % 100;
int copper = value % 100;
string goldAmount = Util.Colorise(gold, Color.yellow) + " gold ";
string silverAmount = Util.Colorise(silver, Color.yellow) + " silver ";
string copperAmount = Util.Colorise(copper, Color.yellow) + " copper ";
bool showGold = gold != 0 || full;
bool showSilver = silver != 0 || full;
bool showCopper = copper != 0 || full || (value == 0);
string result = (showGold ? goldAmount : "") + (showSilver ? silverAmount : "") + (showCopper ? copperAmount : "");
return result.TrimEnd(' ');
}
/** Displays a new message to the player */
public static void PostMessage(string message, params object[] args)
{
MessageLog.Add(new MessageEntry(String.Format(message, FormatParameters(args))));
if (OnMessagePosted != null)
OnMessagePosted(null, new EventArgs());
}
/**
* Returns all the characters that are currently located in the same area as the player.
* @param includePartyMembers if true current party memebers will be included in the list
* STUB: for the moment we include characters anywhere in the game, also need to implement area not location matching
*/
static public List<MDRCharacter> GetCharactersInCurrentArea(bool includePartyMembers = false)
{
List<MDRCharacter> result = new List<MDRCharacter>();
foreach (MDRCharacter character in CharacterList) {
bool inParty = Party.Contains(character);
//bool sameLocation = ((character.LocationX == Party.LocationX) && (character.LocationY == Party.LocationY) && (character.Depth == Party.Depth));
if ((!inParty) || includePartyMembers)
result.Add(character);
}
return result;
}
// ----------------------------------------------
// Formating
// ----------------------------------------------
/** Formats spell name, including coloring */
public static string Format(MDRSpell spell)
{
return Util.Colorise(spell.Name, Colors.SPELL_COLOR);
}
/** Formats item instance including coloring */
public static string Format(MDRItemInstance item)
{
return Util.Colorise(item.Name, item.Item.QualityColor);
}
/** Formats characters name, including coloring */
public static string Format(MDRCharacter character)
{
return Util.Colorise(character.Name, Colors.CHARACTER_COLOR);
}
/** Formats monster name, including coloring. Count is used for detecting plurals. */
public static string Format(MDRMonster monster, int count = 1)
{
return Util.Colorise(monster.Name + ((count > 1) ? "s" : ""), Colors.MONSTER_COLOR);
}
/** Formats monster name, including coloring. Count is used for detecting plurals. */
public static string Format(MDRMonsterInstance monster, int count = 1)
{
return Format(monster.MonsterType, count);
}
public static string Format(int value)
{
return Util.Colorise(value.ToString(), Colors.VALUES_COLOR);
}
/** Removes parties with 0 characters. */
public static void CleanParties()
{
for (int lp = PartyList.Count - 1; lp >= 0; lp--) {
if (PartyList[lp].MemberCount == 0)
PartyList.Remove(lp);
}
}
} | 29.357906 | 158 | 0.695477 | [
"MIT"
] | bsimser/CoM | Assets/Scripts/CoM.cs | 27,479 | C# |
//[?] 1부터 20까지의 정수 중 홀수의 합을 구하는 프로그램
// 1, 3, 5, 7, 9, ...
using System;
/// <summary>
/// 등차수열(Arithmetic Sequence): 연속하는 두 수의 차이가 일정한 수열
/// </summary>
class ArithmeticSequence
{
static void Main()
{
//[1] Input
var sum = 0;
//[2] Process
for (int i = 1; i <= 20; i++) // 주어진 범위
{
if (i % 2 != 0) // 주어진 조건: 필터링(홀수)
{
sum += i; // SUM
Console.Write("{0, 2} ", i); // SEQUENCE -> Arithmetic Sequence
}
}
//[3] Output
Console.WriteLine($"\n1부터 20까지의 홀수의 합: {sum}");
}
}
| 21.310345 | 79 | 0.432039 | [
"MIT"
] | VisualAcademy/DotNet | DotNet/DotNet/31_Algorithms/ArithmeticSequence/ArithmeticSequence.cs | 746 | C# |
using System;
namespace Fennec.NetCore.Tests
{
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
public class TestProjectReferenceAttribute : Attribute
{
public TestProjectReferenceAttribute(string name, string path)
{
Name = name;
Path = path;
}
public string Name { get; }
public string Path { get; }
}
}
| 22.5 | 70 | 0.619753 | [
"MIT"
] | nielstanis/Fennec.NetCore | test/Fennec.NetCore.Tests/TestProjectReferenceAttribute.cs | 405 | C# |
using System;
using Intersect.Enums;
namespace Intersect.GameObjects.Events
{
public enum ConditionTypes
{
VariableIs = 0,
HasItem = 4,
ClassIs,
KnowsSpell,
LevelOrStat,
SelfSwitch, //Only works for events.. not for checking if you can destroy a resource or something like that
AccessIs,
TimeBetween,
CanStartQuest,
QuestInProgress,
QuestCompleted,
NoNpcsOnMap,
GenderIs,
MapIs,
IsItemEquipped,
HasFreeInventorySlots,
}
public class Condition
{
public virtual ConditionTypes Type { get; }
public bool Negated { get; set; }
/// <summary>
/// Configures whether or not this condition does or does not have an else branch.
/// </summary>
public bool ElseEnabled { get; set; } = true;
}
public class VariableIsCondition : Condition
{
public override ConditionTypes Type { get; } = ConditionTypes.VariableIs;
public VariableTypes VariableType { get; set; } = VariableTypes.PlayerVariable;
public Guid VariableId { get; set; }
public VariableCompaison Comparison { get; set; } = new VariableCompaison();
}
public class HasItemCondition : Condition
{
public override ConditionTypes Type { get; } = ConditionTypes.HasItem;
public Guid ItemId { get; set; }
public int Quantity { get; set; }
}
public class ClassIsCondition : Condition
{
public override ConditionTypes Type { get; } = ConditionTypes.ClassIs;
public Guid ClassId { get; set; }
}
public class KnowsSpellCondition : Condition
{
public override ConditionTypes Type { get; } = ConditionTypes.KnowsSpell;
public Guid SpellId { get; set; }
}
public class LevelOrStatCondition : Condition
{
public override ConditionTypes Type { get; } = ConditionTypes.LevelOrStat;
public bool ComparingLevel { get; set; }
public Stats Stat { get; set; }
public VariableComparators Comparator { get; set; } = VariableComparators.Equal;
public int Value { get; set; }
public bool IgnoreBuffs { get; set; }
}
public class SelfSwitchCondition : Condition
{
public override ConditionTypes Type { get; } = ConditionTypes.SelfSwitch;
public int SwitchIndex { get; set; } //0 through 3
public bool Value { get; set; }
}
public class AccessIsCondition : Condition
{
public override ConditionTypes Type { get; } = ConditionTypes.AccessIs;
public Access Access { get; set; }
}
public class TimeBetweenCondition : Condition
{
public override ConditionTypes Type { get; } = ConditionTypes.TimeBetween;
public int[] Ranges { get; set; } = new int[2];
}
public class CanStartQuestCondition : Condition
{
public override ConditionTypes Type { get; } = ConditionTypes.CanStartQuest;
public Guid QuestId { get; set; }
}
public class QuestInProgressCondition : Condition
{
public override ConditionTypes Type { get; } = ConditionTypes.QuestInProgress;
public Guid QuestId { get; set; }
public QuestProgressState Progress { get; set; } = QuestProgressState.OnAnyTask;
public Guid TaskId { get; set; }
}
public class QuestCompletedCondition : Condition
{
public override ConditionTypes Type { get; } = ConditionTypes.QuestCompleted;
public Guid QuestId { get; set; }
}
public class NoNpcsOnMapCondition : Condition
{
public override ConditionTypes Type { get; } = ConditionTypes.NoNpcsOnMap;
}
public class GenderIsCondition : Condition
{
public override ConditionTypes Type { get; } = ConditionTypes.GenderIs;
public Gender Gender { get; set; } = Gender.Male;
}
public class MapIsCondition : Condition
{
public override ConditionTypes Type { get; } = ConditionTypes.MapIs;
public Guid MapId { get; set; }
}
public class IsItemEquippedCondition : Condition
{
public override ConditionTypes Type { get; } = ConditionTypes.IsItemEquipped;
public Guid ItemId { get; set; }
}
/// <summary>
/// Defines the condition class used when checking for a player's free inventory slots.
/// </summary>
public class HasFreeInventorySlots : Condition
{
/// <summary>
/// Defines the type of condition.
/// </summary>
public override ConditionTypes Type { get; } = ConditionTypes.HasFreeInventorySlots;
/// <summary>
/// Defines the amount of inventory slots that need to be free to clear this condition.
/// </summary>
public int Quantity { get; set; }
}
public class VariableCompaison
{
}
public class BooleanVariableComparison : VariableCompaison
{
public VariableTypes CompareVariableType { get; set; } = VariableTypes.PlayerVariable;
public Guid CompareVariableId { get; set; }
public bool ComparingEqual { get; set; }
public bool Value { get; set; }
}
public class IntegerVariableComparison : VariableCompaison
{
public VariableComparators Comparator { get; set; } = VariableComparators.Equal;
public VariableTypes CompareVariableType { get; set; } = VariableTypes.PlayerVariable;
public Guid CompareVariableId { get; set; }
public long Value { get; set; }
}
public class StringVariableComparison : VariableCompaison
{
public StringVariableComparators Comparator { get; set; } = StringVariableComparators.Equal;
public string Value { get; set; }
}
}
| 21.847584 | 115 | 0.632636 | [
"Unlicense"
] | Claytoo/Archisect-Online | Intersect (Core)/GameObjects/Events/Condition.cs | 5,879 | C# |
using System;
using Framework.Core;
using Framework.DomainDriven.Generation;
namespace Framework.Configuration.TestGenerate
{
public abstract class GeneratorsBase
{
protected ICheckOutService CheckOutService { get; } = Framework.DomainDriven.Generation.CheckOutService.Trace;
protected virtual string FrameworkPath { get; } = System.Environment.CurrentDirectory.Replace(@"\",@"/").TakeWhileNot(@"/src/", StringComparison.InvariantCultureIgnoreCase);
protected abstract string GeneratePath { get; }
}
}
| 32.882353 | 182 | 0.729875 | [
"MIT"
] | Luxoft/BSSFramework | src/_Configuration/Framework.Configuration.TestGenerate/_Base/GeneratorsBase.cs | 545 | C# |
using Newtonsoft.Json;
namespace Omie.Api.Client.Request {
/// <remarks/>
public sealed class ApiExceptionResult {
/// <remarks/>
[JsonProperty("faultstring")]
public string FaultString { get; set; }
/// <remarks/>
[JsonProperty("faultcode")]
public string FaultCode { get; set; }
}
} | 24.785714 | 47 | 0.587896 | [
"MIT"
] | simixsistemas/Omie.Api.Client | Omie.Api.Client/Request/ApiExceptionResult.cs | 349 | C# |
using System;
using System.Linq;
using WebApi.DBOperations;
using AutoMapper;
namespace WebApi.BookOperations.CreateBook
{
public class CreateBookCommand
{
public CreateBookModel Model { get; set; }
private readonly BookStoreDbContext _dbContext;
private readonly IMapper _mapper;
public CreateBookCommand(BookStoreDbContext dbContext, IMapper mapper)
{
_dbContext = dbContext;
_mapper = mapper;
}
public void Handle()
{
var book = _dbContext.Books.SingleOrDefault(x => x.Title == Model.Title);
if (book is not null)
{
throw new InvalidOperationException("Kitap zaten mevcut");
}
// book = new Book();
// book.Title = Model.Title;
// book.PublishDate = Model.PublishDate;
// book.PageCount = Model.PageCount;
// book.GenreId = Model.GenreId;
book = _mapper.Map<Book>(Model);
_dbContext.Books.Add(book);
_dbContext.SaveChanges();
}
public class CreateBookModel
{
public string Title { get; set; }
public int GenreId { get; set; }
public int PageCount { get; set; }
public DateTime PublishDate { get; set; }
}
}
} | 28.87234 | 85 | 0.565217 | [
"MIT"
] | Aligndzcyln/BookStore | BookStore/WebApi/BookOperaions/CreateBook/CreateBookCommand.cs | 1,357 | C# |
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace NetworkOperator.OperandSelectors.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("NetworkOperator.OperandSelectors.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}
| 44.171875 | 198 | 0.618323 | [
"MIT"
] | vabalcar/NetworkOperator | Sources/OperandSelectors/ScreenEdgeSelector/Properties/Resources.Designer.cs | 2,829 | C# |
namespace Hive.SeedWorks.TacticalPatterns.Repository
{
/// <summary>
/// Интерфейс репозитория команд.
/// </summary>
/// <typeparam name="TBoundedContext">Ограниченный контест.</typeparam>
public interface ICommandRepository<TBoundedContext, TModel> :
IRepositoryCreate<TBoundedContext, TModel>,
IRepositoryUpdate<TBoundedContext, TModel>,
IRepositoryDelete<TBoundedContext, TModel>
where TBoundedContext : IBoundedContext
where TModel : AnemicModel<TBoundedContext>
{
}
}
| 31.6875 | 73 | 0.757396 | [
"MIT"
] | Ekstrem/Hive | Source/TacticalPatterns/Repository/ICommandRepository.cs | 554 | C# |
namespace Okta.Core.Models
{
using System;
using Newtonsoft.Json;
/// <summary>
/// A link between a <see cref="User"/> and an <see cref="App"/>
/// </summary>
public class AppLink : OktaObject
{
[JsonProperty("label")]
public string Label { get; set; }
[JsonProperty("linkUrl")]
public Uri LinkUrl { get; set; }
[JsonProperty("logoUrl")]
public Uri LogoUrl { get; set; }
[JsonProperty("appName")]
public string AppName { get; set; }
[JsonProperty("appInstanceId")]
public string AppInstanceId { get; set; }
[JsonProperty("appAssignmentId")]
public string AppAssignmentId { get; set; }
[JsonProperty("credentialsSetup")]
public bool CredentialsSetup { get; set; }
[JsonProperty("hidden")]
public bool Hidden { get; set; }
/// <summary>
/// Gets or sets the sort order.
/// </summary>
/// <value>
/// The index of the <see cref="AppLink"/> relative to the other links
/// </value>
[JsonProperty("sortOrder")]
public int SortOrder { get; set; }
}
} | 26.222222 | 78 | 0.55678 | [
"Apache-2.0"
] | YoungRyuCode/OKTA.Core | Okta.Core/Models/Users/AppLink.cs | 1,180 | C# |
using System.Windows.Forms;
namespace BrawlLib.Internal.Windows.Controls.EditAllDialog
{
public class EditAllSRT0Editor : UserControl
{
private CheckBox srtTexRename;
private CheckBox srtModMat;
private TextBox textBox7;
private TextBox srtMatName;
private TextBox srtTexName;
private TextBox textBox3;
private TextBox textBox4;
private TextBox textBox6;
private TextBox textBox9;
private TextBox textBox10;
private TextBox textBox12;
private CheckBox srtLoopEnable;
private Label label2;
private Label srtScaleX;
private Label srtScaleY;
private Label srtRot;
private Label srtTransX;
private Label srtTransY;
private CheckBox srtScaleSubtract;
private CheckBox srtScaleAdd;
private CheckBox srtScaleReplace;
private CheckBox srtRotSubtract;
private CheckBox srtRotAdd;
private CheckBox srtRotReplace;
private CheckBox srtTransSubtract;
private CheckBox srtTransAdd;
private CheckBox srtTransReplace;
private CheckBox srtCopyKF;
private CheckBox chkSrtVersion;
private ComboBox srtVersion;
private CheckBox srtEditLoop;
#region Designer
private GroupBox groupBox1;
private void InitializeComponent()
{
groupBox1 = new GroupBox();
srtTexRename = new CheckBox();
srtModMat = new CheckBox();
textBox7 = new TextBox();
srtMatName = new TextBox();
srtTexName = new TextBox();
textBox3 = new TextBox();
textBox4 = new TextBox();
textBox6 = new TextBox();
textBox9 = new TextBox();
textBox10 = new TextBox();
textBox12 = new TextBox();
srtLoopEnable = new CheckBox();
label2 = new Label();
srtScaleX = new Label();
srtScaleY = new Label();
srtRot = new Label();
srtTransX = new Label();
srtTransY = new Label();
srtScaleSubtract = new CheckBox();
srtScaleAdd = new CheckBox();
srtScaleReplace = new CheckBox();
srtRotSubtract = new CheckBox();
srtRotAdd = new CheckBox();
srtRotReplace = new CheckBox();
srtTransSubtract = new CheckBox();
srtTransAdd = new CheckBox();
srtTransReplace = new CheckBox();
srtCopyKF = new CheckBox();
chkSrtVersion = new CheckBox();
srtVersion = new ComboBox();
srtEditLoop = new CheckBox();
groupBox1.SuspendLayout();
SuspendLayout();
//
// groupBox1
//
groupBox1.Controls.Add(srtTexRename);
groupBox1.Controls.Add(srtModMat);
groupBox1.Controls.Add(textBox7);
groupBox1.Controls.Add(srtMatName);
groupBox1.Controls.Add(srtTexName);
groupBox1.Controls.Add(textBox3);
groupBox1.Controls.Add(textBox4);
groupBox1.Controls.Add(textBox6);
groupBox1.Controls.Add(textBox9);
groupBox1.Controls.Add(textBox10);
groupBox1.Controls.Add(textBox12);
groupBox1.Controls.Add(srtLoopEnable);
groupBox1.Controls.Add(label2);
groupBox1.Controls.Add(srtScaleX);
groupBox1.Controls.Add(srtScaleY);
groupBox1.Controls.Add(srtRot);
groupBox1.Controls.Add(srtTransX);
groupBox1.Controls.Add(srtTransY);
groupBox1.Controls.Add(srtScaleSubtract);
groupBox1.Controls.Add(srtScaleAdd);
groupBox1.Controls.Add(srtScaleReplace);
groupBox1.Controls.Add(srtRotSubtract);
groupBox1.Controls.Add(srtRotAdd);
groupBox1.Controls.Add(srtRotReplace);
groupBox1.Controls.Add(srtTransSubtract);
groupBox1.Controls.Add(srtTransAdd);
groupBox1.Controls.Add(srtTransReplace);
groupBox1.Controls.Add(srtCopyKF);
groupBox1.Controls.Add(chkSrtVersion);
groupBox1.Controls.Add(srtVersion);
groupBox1.Controls.Add(srtEditLoop);
groupBox1.Dock = DockStyle.Fill;
groupBox1.Location = new System.Drawing.Point(0, 0);
groupBox1.Name = "groupBox1";
groupBox1.Size = new System.Drawing.Size(396, 243);
groupBox1.TabIndex = 86;
groupBox1.TabStop = false;
groupBox1.Text = "SRT0";
//
// srtTexRename
//
srtTexRename.AutoSize = true;
srtTexRename.Location = new System.Drawing.Point(201, 103);
srtTexRename.Name = "srtTexRename";
srtTexRename.Size = new System.Drawing.Size(69, 17);
srtTexRename.TabIndex = 112;
srtTexRename.Text = "Rename:";
srtTexRename.UseVisualStyleBackColor = true;
//
// srtModMat
//
srtModMat.AutoSize = true;
srtModMat.Location = new System.Drawing.Point(200, 15);
srtModMat.Name = "srtModMat";
srtModMat.Size = new System.Drawing.Size(196, 17);
srtModMat.TabIndex = 111;
srtModMat.Text = "Only modify materials with the name:";
srtModMat.UseVisualStyleBackColor = true;
//
// textBox7
//
textBox7.HideSelection = false;
textBox7.Location = new System.Drawing.Point(200, 120);
textBox7.Name = "textBox7";
textBox7.Size = new System.Drawing.Size(189, 20);
textBox7.TabIndex = 110;
//
// srtMatName
//
srtMatName.HideSelection = false;
srtMatName.Location = new System.Drawing.Point(200, 32);
srtMatName.Name = "srtMatName";
srtMatName.Size = new System.Drawing.Size(189, 20);
srtMatName.TabIndex = 108;
//
// srtTexName
//
srtTexName.HideSelection = false;
srtTexName.Location = new System.Drawing.Point(7, 32);
srtTexName.Name = "srtTexName";
srtTexName.Size = new System.Drawing.Size(187, 20);
srtTexName.TabIndex = 82;
//
// textBox3
//
textBox3.Enabled = false;
textBox3.Location = new System.Drawing.Point(77, 80);
textBox3.Name = "textBox3";
textBox3.Size = new System.Drawing.Size(119, 20);
textBox3.TabIndex = 84;
//
// textBox4
//
textBox4.Enabled = false;
textBox4.Location = new System.Drawing.Point(77, 101);
textBox4.Name = "textBox4";
textBox4.Size = new System.Drawing.Size(119, 20);
textBox4.TabIndex = 85;
//
// textBox6
//
textBox6.Enabled = false;
textBox6.Location = new System.Drawing.Point(78, 146);
textBox6.Name = "textBox6";
textBox6.Size = new System.Drawing.Size(119, 20);
textBox6.TabIndex = 88;
//
// textBox9
//
textBox9.Enabled = false;
textBox9.Location = new System.Drawing.Point(77, 195);
textBox9.Name = "textBox9";
textBox9.Size = new System.Drawing.Size(119, 20);
textBox9.TabIndex = 89;
//
// textBox10
//
textBox10.Enabled = false;
textBox10.Location = new System.Drawing.Point(77, 216);
textBox10.Name = "textBox10";
textBox10.Size = new System.Drawing.Size(119, 20);
textBox10.TabIndex = 90;
//
// textBox12
//
textBox12.Enabled = false;
textBox12.Location = new System.Drawing.Point(200, 80);
textBox12.Name = "textBox12";
textBox12.Size = new System.Drawing.Size(189, 20);
textBox12.TabIndex = 104;
//
// srtLoopEnable
//
srtLoopEnable.AutoSize = true;
srtLoopEnable.Enabled = false;
srtLoopEnable.Location = new System.Drawing.Point(275, 173);
srtLoopEnable.Name = "srtLoopEnable";
srtLoopEnable.Size = new System.Drawing.Size(92, 17);
srtLoopEnable.TabIndex = 109;
srtLoopEnable.Text = "Loop Enabled";
srtLoopEnable.UseVisualStyleBackColor = true;
//
// label2
//
label2.AutoSize = true;
label2.Location = new System.Drawing.Point(6, 16);
label2.Name = "label2";
label2.Size = new System.Drawing.Size(169, 13);
label2.TabIndex = 83;
label2.Text = "Change all textures with the name:";
//
// srtScaleX
//
srtScaleX.AutoSize = true;
srtScaleX.Location = new System.Drawing.Point(8, 83);
srtScaleX.Name = "srtScaleX";
srtScaleX.Size = new System.Drawing.Size(47, 13);
srtScaleX.TabIndex = 86;
srtScaleX.Text = "Scale X:";
//
// srtScaleY
//
srtScaleY.AutoSize = true;
srtScaleY.Location = new System.Drawing.Point(7, 104);
srtScaleY.Name = "srtScaleY";
srtScaleY.Size = new System.Drawing.Size(47, 13);
srtScaleY.TabIndex = 87;
srtScaleY.Text = "Scale Y:";
//
// srtRot
//
srtRot.AutoSize = true;
srtRot.Location = new System.Drawing.Point(8, 149);
srtRot.Name = "srtRot";
srtRot.Size = new System.Drawing.Size(50, 13);
srtRot.TabIndex = 91;
srtRot.Text = "Rotation:";
//
// srtTransX
//
srtTransX.AutoSize = true;
srtTransX.Location = new System.Drawing.Point(7, 199);
srtTransX.Name = "srtTransX";
srtTransX.Size = new System.Drawing.Size(64, 13);
srtTransX.TabIndex = 92;
srtTransX.Text = "Translate X:";
//
// srtTransY
//
srtTransY.AutoSize = true;
srtTransY.Location = new System.Drawing.Point(7, 221);
srtTransY.Name = "srtTransY";
srtTransY.Size = new System.Drawing.Size(64, 13);
srtTransY.TabIndex = 93;
srtTransY.Text = "Translate Y:";
//
// srtScaleSubtract
//
srtScaleSubtract.AutoSize = true;
srtScaleSubtract.Location = new System.Drawing.Point(119, 58);
srtScaleSubtract.Name = "srtScaleSubtract";
srtScaleSubtract.Size = new System.Drawing.Size(66, 17);
srtScaleSubtract.TabIndex = 96;
srtScaleSubtract.Text = "Subtract";
srtScaleSubtract.UseVisualStyleBackColor = true;
//
// srtScaleAdd
//
srtScaleAdd.AutoSize = true;
srtScaleAdd.Location = new System.Drawing.Point(73, 58);
srtScaleAdd.Name = "srtScaleAdd";
srtScaleAdd.Size = new System.Drawing.Size(45, 17);
srtScaleAdd.TabIndex = 95;
srtScaleAdd.Text = "Add";
srtScaleAdd.UseVisualStyleBackColor = true;
//
// srtScaleReplace
//
srtScaleReplace.AutoSize = true;
srtScaleReplace.Location = new System.Drawing.Point(8, 58);
srtScaleReplace.Name = "srtScaleReplace";
srtScaleReplace.Size = new System.Drawing.Size(66, 17);
srtScaleReplace.TabIndex = 94;
srtScaleReplace.Text = "Replace";
srtScaleReplace.UseVisualStyleBackColor = true;
//
// srtRotSubtract
//
srtRotSubtract.AutoSize = true;
srtRotSubtract.Location = new System.Drawing.Point(119, 125);
srtRotSubtract.Name = "srtRotSubtract";
srtRotSubtract.Size = new System.Drawing.Size(66, 17);
srtRotSubtract.TabIndex = 99;
srtRotSubtract.Text = "Subtract";
srtRotSubtract.UseVisualStyleBackColor = true;
//
// srtRotAdd
//
srtRotAdd.AutoSize = true;
srtRotAdd.Location = new System.Drawing.Point(73, 125);
srtRotAdd.Name = "srtRotAdd";
srtRotAdd.Size = new System.Drawing.Size(45, 17);
srtRotAdd.TabIndex = 98;
srtRotAdd.Text = "Add";
srtRotAdd.UseVisualStyleBackColor = true;
//
// srtRotReplace
//
srtRotReplace.AutoSize = true;
srtRotReplace.Location = new System.Drawing.Point(8, 125);
srtRotReplace.Name = "srtRotReplace";
srtRotReplace.Size = new System.Drawing.Size(66, 17);
srtRotReplace.TabIndex = 97;
srtRotReplace.Text = "Replace";
srtRotReplace.UseVisualStyleBackColor = true;
//
// srtTransSubtract
//
srtTransSubtract.AutoSize = true;
srtTransSubtract.Location = new System.Drawing.Point(119, 173);
srtTransSubtract.Name = "srtTransSubtract";
srtTransSubtract.Size = new System.Drawing.Size(66, 17);
srtTransSubtract.TabIndex = 102;
srtTransSubtract.Text = "Subtract";
srtTransSubtract.UseVisualStyleBackColor = true;
//
// srtTransAdd
//
srtTransAdd.AutoSize = true;
srtTransAdd.Location = new System.Drawing.Point(73, 173);
srtTransAdd.Name = "srtTransAdd";
srtTransAdd.Size = new System.Drawing.Size(45, 17);
srtTransAdd.TabIndex = 101;
srtTransAdd.Text = "Add";
srtTransAdd.UseVisualStyleBackColor = true;
//
// srtTransReplace
//
srtTransReplace.AutoSize = true;
srtTransReplace.Location = new System.Drawing.Point(8, 173);
srtTransReplace.Name = "srtTransReplace";
srtTransReplace.Size = new System.Drawing.Size(66, 17);
srtTransReplace.TabIndex = 100;
srtTransReplace.Text = "Replace";
srtTransReplace.UseVisualStyleBackColor = true;
//
// srtCopyKF
//
srtCopyKF.AutoSize = true;
srtCopyKF.Location = new System.Drawing.Point(201, 58);
srtCopyKF.Name = "srtCopyKF";
srtCopyKF.Size = new System.Drawing.Size(127, 17);
srtCopyKF.TabIndex = 103;
srtCopyKF.Text = "Copy keyframes from:";
srtCopyKF.UseVisualStyleBackColor = true;
//
// chkSrtVersion
//
chkSrtVersion.AutoSize = true;
chkSrtVersion.Location = new System.Drawing.Point(201, 148);
chkSrtVersion.Name = "chkSrtVersion";
chkSrtVersion.Size = new System.Drawing.Size(103, 17);
chkSrtVersion.TabIndex = 105;
chkSrtVersion.Text = "Change version:";
chkSrtVersion.UseVisualStyleBackColor = true;
//
// srtVersion
//
srtVersion.Enabled = false;
srtVersion.FormattingEnabled = true;
srtVersion.Items.AddRange(new object[]
{
"4",
"5"
});
srtVersion.Location = new System.Drawing.Point(310, 146);
srtVersion.Name = "srtVersion";
srtVersion.Size = new System.Drawing.Size(79, 21);
srtVersion.TabIndex = 106;
//
// srtEditLoop
//
srtEditLoop.AutoSize = true;
srtEditLoop.Location = new System.Drawing.Point(201, 173);
srtEditLoop.Name = "srtEditLoop";
srtEditLoop.Size = new System.Drawing.Size(74, 17);
srtEditLoop.TabIndex = 107;
srtEditLoop.Text = "Edit Loop:";
srtEditLoop.UseVisualStyleBackColor = true;
//
// EditAllSRT0Editor
//
Controls.Add(groupBox1);
Name = "EditAllSRT0Editor";
Size = new System.Drawing.Size(396, 243);
groupBox1.ResumeLayout(false);
groupBox1.PerformLayout();
ResumeLayout(false);
}
#endregion
public EditAllSRT0Editor()
{
InitializeComponent();
}
}
} | 39.393023 | 75 | 0.543657 | [
"MIT"
] | GamendeMier/BrawlCrate | BrawlLib/Internal/Windows/Controls/EditAllDialog/SRT0.cs | 16,941 | C# |
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
/*============================================================
**
**
**
** Purpose: This class will encapsulate an uint and
** provide an Object representation of it.
**
**
===========================================================*/
using System.Diagnostics.Contracts;
using System.Globalization;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
namespace System
{
[Serializable]
[CLSCompliant(false)]
[StructLayout(LayoutKind.Sequential)]
[TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
public struct UInt32 : IComparable, IConvertible, IFormattable, IComparable<UInt32>, IEquatable<UInt32>
{
private uint m_value; // Do not rename (binary serialization)
public const uint MaxValue = (uint)0xffffffff;
public const uint MinValue = 0U;
// Compares this object to another object, returning an integer that
// indicates the relationship.
// Returns a value less than zero if this object
// null is considered to be less than any instance.
// If object is not of type UInt32, this method throws an ArgumentException.
//
public int CompareTo(Object value)
{
if (value == null)
{
return 1;
}
if (value is UInt32)
{
// Need to use compare because subtraction will wrap
// to positive for very large neg numbers, etc.
uint i = (uint)value;
if (m_value < i) return -1;
if (m_value > i) return 1;
return 0;
}
throw new ArgumentException(SR.Arg_MustBeUInt32);
}
public int CompareTo(UInt32 value)
{
// Need to use compare because subtraction will wrap
// to positive for very large neg numbers, etc.
if (m_value < value) return -1;
if (m_value > value) return 1;
return 0;
}
public override bool Equals(Object obj)
{
if (!(obj is UInt32))
{
return false;
}
return m_value == ((UInt32)obj).m_value;
}
[NonVersionable]
public bool Equals(UInt32 obj)
{
return m_value == obj;
}
// The absolute value of the int contained.
public override int GetHashCode()
{
return ((int)m_value);
}
// The base 10 representation of the number with no extra padding.
public override String ToString()
{
Contract.Ensures(Contract.Result<String>() != null);
return Number.FormatUInt32(m_value, null, NumberFormatInfo.CurrentInfo);
}
public String ToString(IFormatProvider provider)
{
Contract.Ensures(Contract.Result<String>() != null);
return Number.FormatUInt32(m_value, null, NumberFormatInfo.GetInstance(provider));
}
public String ToString(String format)
{
Contract.Ensures(Contract.Result<String>() != null);
return Number.FormatUInt32(m_value, format, NumberFormatInfo.CurrentInfo);
}
public String ToString(String format, IFormatProvider provider)
{
Contract.Ensures(Contract.Result<String>() != null);
return Number.FormatUInt32(m_value, format, NumberFormatInfo.GetInstance(provider));
}
[CLSCompliant(false)]
public static uint Parse(String s)
{
if (s == null) ThrowHelper.ThrowArgumentNullException(ExceptionArgument.s);
return Number.ParseUInt32(s.AsReadOnlySpan(), NumberStyles.Integer, NumberFormatInfo.CurrentInfo);
}
[CLSCompliant(false)]
public static uint Parse(String s, NumberStyles style)
{
NumberFormatInfo.ValidateParseStyleInteger(style);
if (s == null) ThrowHelper.ThrowArgumentNullException(ExceptionArgument.s);
return Number.ParseUInt32(s.AsReadOnlySpan(), style, NumberFormatInfo.CurrentInfo);
}
[CLSCompliant(false)]
public static uint Parse(String s, IFormatProvider provider)
{
if (s == null) ThrowHelper.ThrowArgumentNullException(ExceptionArgument.s);
return Number.ParseUInt32(s.AsReadOnlySpan(), NumberStyles.Integer, NumberFormatInfo.GetInstance(provider));
}
[CLSCompliant(false)]
public static uint Parse(String s, NumberStyles style, IFormatProvider provider)
{
NumberFormatInfo.ValidateParseStyleInteger(style);
if (s == null) ThrowHelper.ThrowArgumentNullException(ExceptionArgument.s);
return Number.ParseUInt32(s.AsReadOnlySpan(), style, NumberFormatInfo.GetInstance(provider));
}
[CLSCompliant(false)]
public static uint Parse(ReadOnlySpan<char> s, NumberStyles style = NumberStyles.Integer, IFormatProvider provider = null)
{
NumberFormatInfo.ValidateParseStyleInteger(style);
return Number.ParseUInt32(s, style, NumberFormatInfo.GetInstance(provider));
}
[CLSCompliant(false)]
public static bool TryParse(String s, out UInt32 result)
{
if (s == null)
{
result = 0;
return false;
}
return Number.TryParseUInt32(s.AsReadOnlySpan(), NumberStyles.Integer, NumberFormatInfo.CurrentInfo, out result);
}
[CLSCompliant(false)]
public static bool TryParse(String s, NumberStyles style, IFormatProvider provider, out UInt32 result)
{
NumberFormatInfo.ValidateParseStyleInteger(style);
if (s == null)
{
result = 0;
return false;
}
return Number.TryParseUInt32(s.AsReadOnlySpan(), style, NumberFormatInfo.GetInstance(provider), out result);
}
[CLSCompliant(false)]
public static bool TryParse(ReadOnlySpan<char> s, out UInt32 result, NumberStyles style = NumberStyles.Integer, IFormatProvider provider = null)
{
NumberFormatInfo.ValidateParseStyleInteger(style);
return Number.TryParseUInt32(s, style, NumberFormatInfo.GetInstance(provider), out result);
}
//
// IConvertible implementation
//
public TypeCode GetTypeCode()
{
return TypeCode.UInt32;
}
bool IConvertible.ToBoolean(IFormatProvider provider)
{
return Convert.ToBoolean(m_value);
}
char IConvertible.ToChar(IFormatProvider provider)
{
return Convert.ToChar(m_value);
}
sbyte IConvertible.ToSByte(IFormatProvider provider)
{
return Convert.ToSByte(m_value);
}
byte IConvertible.ToByte(IFormatProvider provider)
{
return Convert.ToByte(m_value);
}
short IConvertible.ToInt16(IFormatProvider provider)
{
return Convert.ToInt16(m_value);
}
ushort IConvertible.ToUInt16(IFormatProvider provider)
{
return Convert.ToUInt16(m_value);
}
int IConvertible.ToInt32(IFormatProvider provider)
{
return Convert.ToInt32(m_value);
}
uint IConvertible.ToUInt32(IFormatProvider provider)
{
return m_value;
}
long IConvertible.ToInt64(IFormatProvider provider)
{
return Convert.ToInt64(m_value);
}
ulong IConvertible.ToUInt64(IFormatProvider provider)
{
return Convert.ToUInt64(m_value);
}
float IConvertible.ToSingle(IFormatProvider provider)
{
return Convert.ToSingle(m_value);
}
double IConvertible.ToDouble(IFormatProvider provider)
{
return Convert.ToDouble(m_value);
}
Decimal IConvertible.ToDecimal(IFormatProvider provider)
{
return Convert.ToDecimal(m_value);
}
DateTime IConvertible.ToDateTime(IFormatProvider provider)
{
throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "UInt32", "DateTime"));
}
Object IConvertible.ToType(Type type, IFormatProvider provider)
{
return Convert.DefaultToType((IConvertible)this, type, provider);
}
}
}
| 32.811111 | 152 | 0.599278 | [
"MIT"
] | AlexGhiondea/coreclr | src/mscorlib/shared/System/UInt32.cs | 8,859 | C# |
namespace honyaku
{
partial class MainForm
{
/// <summary>
/// 必要なデザイナー変数です。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 使用中のリソースをすべてクリーンアップします。
/// </summary>
/// <param name="disposing">マネージ リソースを破棄する場合は true を指定し、その他の場合は false を指定します。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows フォーム デザイナーで生成されたコード
/// <summary>
/// デザイナー サポートに必要なメソッドです。このメソッドの内容を
/// コード エディターで変更しないでください。
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.BackToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.TranslateToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ReTranslateToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.表示VToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.StealthModeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.翻訳コンテナToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.LateralSplitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.VerticalitySplitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator();
this.HideSourceTextToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripSeparator();
this.ExplorerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ToolsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.QuickTranslateToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.PlaceManagementToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.SettingToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.CaptureRegionPanel = new System.Windows.Forms.Panel();
this.TranslatorSplitContainer = new System.Windows.Forms.SplitContainer();
this.SourceLanguageLabel = new System.Windows.Forms.Label();
this.SourceTextBox = new System.Windows.Forms.TextBox();
this.TargetLanguageLabel = new System.Windows.Forms.Label();
this.TargetTextBox = new System.Windows.Forms.TextBox();
this.HotKeyTimer = new System.Windows.Forms.Timer(this.components);
this.LanguageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.menuStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.TranslatorSplitContainer)).BeginInit();
this.TranslatorSplitContainer.Panel1.SuspendLayout();
this.TranslatorSplitContainer.Panel2.SuspendLayout();
this.TranslatorSplitContainer.SuspendLayout();
this.SuspendLayout();
//
// menuStrip1
//
this.menuStrip1.GripMargin = new System.Windows.Forms.Padding(2);
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.BackToolStripMenuItem,
this.TranslateToolStripMenuItem,
this.ReTranslateToolStripMenuItem,
this.表示VToolStripMenuItem,
this.ToolsToolStripMenuItem,
this.SettingToolStripMenuItem,
this.LanguageToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Padding = new System.Windows.Forms.Padding(6, 2, 6, 2);
this.menuStrip1.Size = new System.Drawing.Size(502, 24);
this.menuStrip1.TabIndex = 1;
this.menuStrip1.Text = "menuStrip1";
this.menuStrip1.MouseEnter += new System.EventHandler(this.MenuStrip1_MouseEnter);
this.menuStrip1.MouseLeave += new System.EventHandler(this.MenuStrip1_MouseLeave);
//
// BackToolStripMenuItem
//
this.BackToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("BackToolStripMenuItem.Image")));
this.BackToolStripMenuItem.Name = "BackToolStripMenuItem";
this.BackToolStripMenuItem.Size = new System.Drawing.Size(56, 20);
this.BackToolStripMenuItem.Text = "戻る";
this.BackToolStripMenuItem.Visible = false;
this.BackToolStripMenuItem.Click += new System.EventHandler(this.BackToolStripMenuItem_Click);
//
// TranslateToolStripMenuItem
//
this.TranslateToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("TranslateToolStripMenuItem.Image")));
this.TranslateToolStripMenuItem.Name = "TranslateToolStripMenuItem";
this.TranslateToolStripMenuItem.Size = new System.Drawing.Size(110, 20);
this.TranslateToolStripMenuItem.Text = "キャプチャ+翻訳";
this.TranslateToolStripMenuItem.Click += new System.EventHandler(this.TranslateToolStripMenuItem_Click);
//
// ReTranslateToolStripMenuItem
//
this.ReTranslateToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("ReTranslateToolStripMenuItem.Image")));
this.ReTranslateToolStripMenuItem.Name = "ReTranslateToolStripMenuItem";
this.ReTranslateToolStripMenuItem.Size = new System.Drawing.Size(71, 20);
this.ReTranslateToolStripMenuItem.Text = "再翻訳";
this.ReTranslateToolStripMenuItem.Visible = false;
this.ReTranslateToolStripMenuItem.Click += new System.EventHandler(this.ReTranslateToolStripMenuItem_Click);
//
// 表示VToolStripMenuItem
//
this.表示VToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.StealthModeToolStripMenuItem,
this.翻訳コンテナToolStripMenuItem,
this.toolStripMenuItem2,
this.ExplorerToolStripMenuItem});
this.表示VToolStripMenuItem.Name = "表示VToolStripMenuItem";
this.表示VToolStripMenuItem.Size = new System.Drawing.Size(58, 20);
this.表示VToolStripMenuItem.Text = "表示(&V)";
//
// StealthModeToolStripMenuItem
//
this.StealthModeToolStripMenuItem.CheckOnClick = true;
this.StealthModeToolStripMenuItem.Name = "StealthModeToolStripMenuItem";
this.StealthModeToolStripMenuItem.Size = new System.Drawing.Size(157, 22);
this.StealthModeToolStripMenuItem.Text = "ステルスモード";
this.StealthModeToolStripMenuItem.Click += new System.EventHandler(this.StealthModeToolStripMenuItem_Click);
//
// 翻訳コンテナToolStripMenuItem
//
this.翻訳コンテナToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.LateralSplitToolStripMenuItem,
this.VerticalitySplitToolStripMenuItem,
this.toolStripMenuItem1,
this.HideSourceTextToolStripMenuItem});
this.翻訳コンテナToolStripMenuItem.Name = "翻訳コンテナToolStripMenuItem";
this.翻訳コンテナToolStripMenuItem.Size = new System.Drawing.Size(157, 22);
this.翻訳コンテナToolStripMenuItem.Text = "翻訳コンテナ";
//
// LateralSplitToolStripMenuItem
//
this.LateralSplitToolStripMenuItem.Checked = true;
this.LateralSplitToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
this.LateralSplitToolStripMenuItem.Name = "LateralSplitToolStripMenuItem";
this.LateralSplitToolStripMenuItem.Size = new System.Drawing.Size(186, 22);
this.LateralSplitToolStripMenuItem.Text = "左右に分割";
this.LateralSplitToolStripMenuItem.Click += new System.EventHandler(this.LateralSplitToolStripMenuItem_Click);
//
// VerticalitySplitToolStripMenuItem
//
this.VerticalitySplitToolStripMenuItem.Name = "VerticalitySplitToolStripMenuItem";
this.VerticalitySplitToolStripMenuItem.Size = new System.Drawing.Size(186, 22);
this.VerticalitySplitToolStripMenuItem.Text = "上下に分割";
this.VerticalitySplitToolStripMenuItem.Click += new System.EventHandler(this.VerticalitySplitToolStripMenuItem_Click);
//
// toolStripMenuItem1
//
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
this.toolStripMenuItem1.Size = new System.Drawing.Size(183, 6);
//
// HideSourceTextToolStripMenuItem
//
this.HideSourceTextToolStripMenuItem.CheckOnClick = true;
this.HideSourceTextToolStripMenuItem.Name = "HideSourceTextToolStripMenuItem";
this.HideSourceTextToolStripMenuItem.Size = new System.Drawing.Size(186, 22);
this.HideSourceTextToolStripMenuItem.Text = "翻訳前のテキストを隠す";
this.HideSourceTextToolStripMenuItem.Click += new System.EventHandler(this.HideSourceTextToolStripMenuItem_Click);
//
// toolStripMenuItem2
//
this.toolStripMenuItem2.Name = "toolStripMenuItem2";
this.toolStripMenuItem2.Size = new System.Drawing.Size(154, 6);
//
// ExplorerToolStripMenuItem
//
this.ExplorerToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("ExplorerToolStripMenuItem.Image")));
this.ExplorerToolStripMenuItem.Name = "ExplorerToolStripMenuItem";
this.ExplorerToolStripMenuItem.Size = new System.Drawing.Size(157, 22);
this.ExplorerToolStripMenuItem.Text = "エクスプローラー(&E)";
this.ExplorerToolStripMenuItem.Click += new System.EventHandler(this.ExplorerToolStripMenuItem_Click);
//
// ToolsToolStripMenuItem
//
this.ToolsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.QuickTranslateToolStripMenuItem,
this.PlaceManagementToolStripMenuItem});
this.ToolsToolStripMenuItem.Name = "ToolsToolStripMenuItem";
this.ToolsToolStripMenuItem.Size = new System.Drawing.Size(60, 20);
this.ToolsToolStripMenuItem.Text = "ツール(&T)";
//
// QuickTranslateToolStripMenuItem
//
this.QuickTranslateToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("QuickTranslateToolStripMenuItem.Image")));
this.QuickTranslateToolStripMenuItem.Name = "QuickTranslateToolStripMenuItem";
this.QuickTranslateToolStripMenuItem.Size = new System.Drawing.Size(173, 22);
this.QuickTranslateToolStripMenuItem.Text = "簡易キャプチャ+翻訳";
this.QuickTranslateToolStripMenuItem.Click += new System.EventHandler(this.QuickTranslateToolStripMenuItem_Click);
//
// PlaceManagementToolStripMenuItem
//
this.PlaceManagementToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("PlaceManagementToolStripMenuItem.Image")));
this.PlaceManagementToolStripMenuItem.Name = "PlaceManagementToolStripMenuItem";
this.PlaceManagementToolStripMenuItem.Size = new System.Drawing.Size(173, 22);
this.PlaceManagementToolStripMenuItem.Text = "ウィンドウ配置管理";
this.PlaceManagementToolStripMenuItem.Click += new System.EventHandler(this.PlaceManagementToolStripMenuItem_Click);
//
// SettingToolStripMenuItem
//
this.SettingToolStripMenuItem.Name = "SettingToolStripMenuItem";
this.SettingToolStripMenuItem.Size = new System.Drawing.Size(60, 20);
this.SettingToolStripMenuItem.Text = "設定(&O)";
this.SettingToolStripMenuItem.Click += new System.EventHandler(this.SettingToolStripMenuItem_Click);
//
// CaptureRegionPanel
//
this.CaptureRegionPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.CaptureRegionPanel.BackColor = System.Drawing.SystemColors.ControlDark;
this.CaptureRegionPanel.Location = new System.Drawing.Point(6, 24);
this.CaptureRegionPanel.Name = "CaptureRegionPanel";
this.CaptureRegionPanel.Size = new System.Drawing.Size(490, 312);
this.CaptureRegionPanel.TabIndex = 2;
//
// TranslatorSplitContainer
//
this.TranslatorSplitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
this.TranslatorSplitContainer.Location = new System.Drawing.Point(0, 24);
this.TranslatorSplitContainer.Name = "TranslatorSplitContainer";
//
// TranslatorSplitContainer.Panel1
//
this.TranslatorSplitContainer.Panel1.Controls.Add(this.SourceLanguageLabel);
this.TranslatorSplitContainer.Panel1.Controls.Add(this.SourceTextBox);
this.TranslatorSplitContainer.Panel1MinSize = 0;
//
// TranslatorSplitContainer.Panel2
//
this.TranslatorSplitContainer.Panel2.Controls.Add(this.TargetLanguageLabel);
this.TranslatorSplitContainer.Panel2.Controls.Add(this.TargetTextBox);
this.TranslatorSplitContainer.Panel2MinSize = 0;
this.TranslatorSplitContainer.Size = new System.Drawing.Size(502, 318);
this.TranslatorSplitContainer.SplitterDistance = 250;
this.TranslatorSplitContainer.SplitterWidth = 2;
this.TranslatorSplitContainer.TabIndex = 3;
this.TranslatorSplitContainer.Visible = false;
//
// SourceLanguageLabel
//
this.SourceLanguageLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.SourceLanguageLabel.AutoSize = true;
this.SourceLanguageLabel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.SourceLanguageLabel.Location = new System.Drawing.Point(3, 334);
this.SourceLanguageLabel.Name = "SourceLanguageLabel";
this.SourceLanguageLabel.Size = new System.Drawing.Size(31, 14);
this.SourceLanguageLabel.TabIndex = 2;
this.SourceLanguageLabel.Text = "英語";
//
// SourceTextBox
//
this.SourceTextBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.SourceTextBox.Font = new System.Drawing.Font("MS ゴシック", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
this.SourceTextBox.Location = new System.Drawing.Point(0, 0);
this.SourceTextBox.Margin = new System.Windows.Forms.Padding(4);
this.SourceTextBox.MaxLength = 1000;
this.SourceTextBox.Multiline = true;
this.SourceTextBox.Name = "SourceTextBox";
this.SourceTextBox.Size = new System.Drawing.Size(250, 318);
this.SourceTextBox.TabIndex = 1;
//
// TargetLanguageLabel
//
this.TargetLanguageLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.TargetLanguageLabel.AutoSize = true;
this.TargetLanguageLabel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.TargetLanguageLabel.Location = new System.Drawing.Point(3, 334);
this.TargetLanguageLabel.Name = "TargetLanguageLabel";
this.TargetLanguageLabel.Size = new System.Drawing.Size(43, 14);
this.TargetLanguageLabel.TabIndex = 3;
this.TargetLanguageLabel.Text = "日本語";
//
// TargetTextBox
//
this.TargetTextBox.BackColor = System.Drawing.Color.White;
this.TargetTextBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.TargetTextBox.Font = new System.Drawing.Font("MS ゴシック", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
this.TargetTextBox.Location = new System.Drawing.Point(0, 0);
this.TargetTextBox.Margin = new System.Windows.Forms.Padding(4);
this.TargetTextBox.Multiline = true;
this.TargetTextBox.Name = "TargetTextBox";
this.TargetTextBox.ReadOnly = true;
this.TargetTextBox.Size = new System.Drawing.Size(250, 318);
this.TargetTextBox.TabIndex = 1;
//
// HotKeyTimer
//
this.HotKeyTimer.Interval = 500;
//
// LanguageToolStripMenuItem
//
this.LanguageToolStripMenuItem.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
this.LanguageToolStripMenuItem.Enabled = false;
this.LanguageToolStripMenuItem.Name = "LanguageToolStripMenuItem";
this.LanguageToolStripMenuItem.Size = new System.Drawing.Size(152, 20);
this.LanguageToolStripMenuItem.Text = "{language} -> {language}";
//
// MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(502, 342);
this.Controls.Add(this.TranslatorSplitContainer);
this.Controls.Add(this.CaptureRegionPanel);
this.Controls.Add(this.menuStrip1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MainMenuStrip = this.menuStrip1;
this.MaximizeBox = false;
this.MinimumSize = new System.Drawing.Size(200, 88);
this.Name = "MainForm";
this.Text = "Honyaku";
this.TopMost = true;
this.TransparencyKey = System.Drawing.SystemColors.ControlDark;
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing);
this.Load += new System.EventHandler(this.MainForm_Load);
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
this.TranslatorSplitContainer.Panel1.ResumeLayout(false);
this.TranslatorSplitContainer.Panel1.PerformLayout();
this.TranslatorSplitContainer.Panel2.ResumeLayout(false);
this.TranslatorSplitContainer.Panel2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.TranslatorSplitContainer)).EndInit();
this.TranslatorSplitContainer.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.MenuStrip menuStrip1;
private System.Windows.Forms.Panel CaptureRegionPanel;
private System.Windows.Forms.ToolStripMenuItem TranslateToolStripMenuItem;
private System.Windows.Forms.SplitContainer TranslatorSplitContainer;
private System.Windows.Forms.TextBox SourceTextBox;
private System.Windows.Forms.TextBox TargetTextBox;
private System.Windows.Forms.ToolStripMenuItem BackToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem ReTranslateToolStripMenuItem;
private System.Windows.Forms.Label SourceLanguageLabel;
private System.Windows.Forms.Label TargetLanguageLabel;
private System.Windows.Forms.ToolStripMenuItem 表示VToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 翻訳コンテナToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem LateralSplitToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem VerticalitySplitToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem StealthModeToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem SettingToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem ToolsToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem PlaceManagementToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem QuickTranslateToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem HideSourceTextToolStripMenuItem;
private System.Windows.Forms.Timer HotKeyTimer;
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem2;
private System.Windows.Forms.ToolStripMenuItem ExplorerToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem LanguageToolStripMenuItem;
}
}
| 58.929539 | 169 | 0.670177 | [
"MIT"
] | shiyuetc/honyaku | honyaku/MainForm.Designer.cs | 22,361 | C# |
using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using Collections.Pooled;
using revghost.Shared;
namespace revghost.Utility;
public static class IListExtensions
{
public static void ClearReference<T>(this PooledList<T> list)
{
list.Span.Clear();
list.Clear();
}
public static void AddRange<TList, TValue, TOriginal>(this TList list, IEnumerable<TValue> elements)
where TList : IList<TOriginal>
where TValue : TOriginal
{
foreach (var element in elements)
list.Add(element);
}
public static void AddRange<TList, T>(this TList list, IEnumerable<T> elements)
where TList : IList<T>
{
foreach (var element in elements)
list.Add(element);
}
public static void AddRange<TList>(this TList list, Stream stream) where TList : IList<byte>
{
switch (list)
{
case PooledList<byte> cast:
var span = cast.AddSpan((int) stream.Length);
stream.Read(span);
return;
case List<byte> cast:
cast.Capacity = Math.Max(cast.Capacity, cast.Count + (int) stream.Length);
stream.Read(CollectionsMarshal.AsSpan(cast).Slice(cast.Count, (int) stream.Length));
return;
}
using var disposable = DisposableArray<byte>.Rent((int) stream.Length, out var mem);
stream.Read(mem, 0, (int) stream.Length);
var length = stream.Length;
for (var i = 0; i < length; i++)
list.Add(mem[0]);
}
public static async Task AddRangeAsync<TList>(this TList list, Stream stream) where TList : IList<byte>
{
using var disposable = DisposableArray<byte>.Rent((int) stream.Length, out var mem);
await stream.ReadAsync(mem.AsMemory(0, (int) stream.Length));
switch (list)
{
case PooledList<byte> cast:
cast.AddRange(mem);
return;
case List<byte> cast:
cast.AddRange(mem);
return;
}
var length = stream.Length;
for (var i = 0; i < length; i++)
list.Add(mem[0]);
}
} | 29.818182 | 107 | 0.585366 | [
"MIT"
] | guerro323/GameHost | revghost/Utility/IListExtensions.cs | 2,296 | C# |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.