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
using System; namespace NPOI.Util { /// <summary> /// Adapts a plain byte array to <see cref="T:NPOI.Util.ILittleEndianInput" /> /// </summary> /// <remarks>@author Josh Micich</remarks> public class LittleEndianByteArrayInputStream : ILittleEndianInput { private byte[] _buf; private int _endIndex; private int _ReadIndex; public LittleEndianByteArrayInputStream(byte[] buf, int startOffset, int maxReadLen) { _buf = buf; _ReadIndex = startOffset; _endIndex = startOffset + maxReadLen; } public LittleEndianByteArrayInputStream(byte[] buf, int startOffset) : this(buf, startOffset, buf.Length - startOffset) { } public LittleEndianByteArrayInputStream(byte[] buf) : this(buf, 0, buf.Length) { } public int Available() { return _endIndex - _ReadIndex; } private void CheckPosition(int i) { if (i > _endIndex - _ReadIndex) { throw new RuntimeException("Buffer overrun"); } } public int GetReadIndex() { return _ReadIndex; } public int ReadByte() { CheckPosition(1); return _buf[_ReadIndex++]; } public int ReadInt() { CheckPosition(4); int num = _ReadIndex; int num3 = _buf[num++] & 0xFF; int num5 = _buf[num++] & 0xFF; int num7 = _buf[num++] & 0xFF; int num9 = _buf[num++] & 0xFF; _ReadIndex = num; return (num9 << 24) + (num7 << 16) + (num5 << 8) + num3; } public long ReadLong() { CheckPosition(8); int num = _ReadIndex; int num3 = _buf[num++] & 0xFF; int num5 = _buf[num++] & 0xFF; int num7 = _buf[num++] & 0xFF; int num9 = _buf[num++] & 0xFF; int num11 = _buf[num++] & 0xFF; int num13 = _buf[num++] & 0xFF; int num15 = _buf[num++] & 0xFF; int num17 = _buf[num++] & 0xFF; _ReadIndex = num; return ((long)num17 << 56) + ((long)num15 << 48) + ((long)num13 << 40) + ((long)num11 << 32) + ((long)num9 << 24) + (num7 << 16) + (num5 << 8) + num3; } public short ReadShort() { return (short)ReadUShort(); } public int ReadUByte() { CheckPosition(1); return _buf[_ReadIndex++] & 0xFF; } public int ReadUShort() { CheckPosition(2); int num = _ReadIndex; int num3 = _buf[num++] & 0xFF; int num5 = _buf[num++] & 0xFF; _ReadIndex = num; return (num5 << 8) + num3; } public void ReadFully(byte[] buf, int off, int len) { CheckPosition(len); Array.Copy(_buf, _ReadIndex, buf, off, len); _ReadIndex += len; } public void ReadFully(byte[] buf) { ReadFully(buf, 0, buf.Length); } public double ReadDouble() { return BitConverter.Int64BitsToDouble(ReadLong()); } } }
20.92
153
0.617591
[ "MIT" ]
iNeverSleeeeep/NPOI-For-Unity
NPOI.Util/LittleEndianByteArrayInputStream.cs
2,615
C#
using MbDotNet.Models.Predicates; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace MbDotNet.Tests.Models.Predicates { [TestClass] public class StartsWithPredicateTests : PredicateTestBase { [TestMethod] public void StartsWithPredicate_Constructor_SetsFieldObject() { var expectedFields = new TestPredicateFields(); var predicate = new StartsWithPredicate<TestPredicateFields>(expectedFields); Assert.AreSame(expectedFields, predicate.Fields); } [TestMethod] public void StartsWithPredicate_Constructor_SetsCaseSensitivity() { var fields = new TestPredicateFields(); var predicate = new StartsWithPredicate<TestPredicateFields>(fields, isCaseSensitive: true); Assert.IsTrue(predicate.IsCaseSensitive); } [TestMethod] public void StartsWithPredicate_Constructor_SetsExceptExpression() { const string expectedExceptRegex = "!$"; var fields = new TestPredicateFields(); var predicate = new StartsWithPredicate<TestPredicateFields>(fields, exceptExpression: expectedExceptRegex); Assert.AreEqual(expectedExceptRegex, predicate.ExceptExpression); } [TestMethod] public void StartsWithPredicate_Constructor_SetsXpathSelector() { var expectedXPathSelector = new XPathSelector("!$"); var fields = new TestPredicateFields(); var predicate = new StartsWithPredicate<TestPredicateFields>(fields, xpath: expectedXPathSelector); Assert.AreEqual(expectedXPathSelector, predicate.XPathSelector); } [TestMethod] public void StartsWithPredicate_Constructor_SetsJsonPathSelector() { var expectedJsonPathSelector = new JsonPathSelector("$..title"); var fields = new TestPredicateFields(); var predicate = new StartsWithPredicate<TestPredicateFields>(fields, jsonpath: expectedJsonPathSelector); Assert.AreEqual(expectedJsonPathSelector, predicate.JsonPathSelector); } } }
38.678571
120
0.683287
[ "MIT" ]
putnap/MbDotNet
MbDotNet.Tests/Models/Predicates/StartsWithPredicateTests.cs
2,168
C#
using GraphicsLayer; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using GraphsCore; namespace Graphs { public class GraphCanvas : GraphicsLayer.IPaintable { public event Action<Graph> GraphModified; public event Action<string> NameModified; const int DefaultBaseViewScale = 800; public int BaseViewScale = DefaultBaseViewScale; const int MaxZoomScale = 6000; double ZoomDelta = 0.15; double MinZoom = 0.15; public void SetZoomDelta(double d) { ZoomDelta = d; MinZoom = d; } bool _zoomFitNextPaint; bool _snapToGrid = true; double _gridStep = 0.05; bool _drawGrid = true; public bool SnapToGrid { get { return _snapToGrid; } set { var needRedraw = value && !_snapToGrid; _snapToGrid = value; if (needRedraw) Invalidate(); } } public double GridStep { get { return _gridStep; } set { var needRedraw = SnapToGrid && value != _gridStep; _gridStep = value; if (needRedraw) Invalidate(); } } public bool DrawGrid { get { return _drawGrid; } set { var needRedraw = _drawGrid != value; _drawGrid = value; if (needRedraw) Invalidate(); } } public bool HasPainted { get; private set; } Graph _graph; int Width { get; set; } int Height { get; set; } #region dragging vertex variables Vertex _DraggedVertex = null; #endregion #region dragging selection variables List<Box> _selectionPoints = new List<Box>(); object _SelectionPointsToken = new object(); bool _controlWasDown; #endregion #region children items public Graph Graph { get { return _graph; } } ICanvas _canvas; public ICanvas Canvas { get { return _canvas; } set { _canvas = value; _canvas.MouseMoved += OnMouseMove; _canvas.MouseButtonDown += OnMouseDown; _canvas.MouseButtonUp += OnMouseUp; _canvas.MouseButtonDoubleClicked += OnMouseDoubleClick; } } #endregion double Zoom { set { if (value == _Zoom) return; _Zoom = value; var scale = (int)(_Zoom * BaseViewScale); if (scale > MaxZoomScale) { scale = MaxZoomScale; _Zoom = scale / BaseViewScale; } ViewScale = scale; } } public int ViewScale { get { return _viewScale; } protected set { if (value == _viewScale) return; _viewScale = value; } } public bool IsEmpty { get { return _graph.Vertices.Count <= 0; } } States _state = States.Idle; int _viewScale = DefaultBaseViewScale; double _Zoom = 1.0; Func<Choosability.Graph, Graph> _layoutEngine; Func<string, Graph> _secondaryConverter; List<HistoricalGraph> _history = new List<HistoricalGraph>(); int _historyIndex = 0; static readonly ARGB SelectionPenColor = new ARGB(0, 0, 255); static readonly ARGB GridPenColor = new ARGB(30, 0, 0, 0); enum States { Idle, DraggingVertex, DraggingSelectionRegion, DraggingSelectedVertices } static readonly ARGB BackgroundColor = new ARGB(0xf7, 0xf7, 0xf7); public GraphCanvas(Graph graph, Func<Choosability.Graph, Graph> layoutEngine = null, Func<string, Graph> secondaryConverter = null) { _graph = graph != null ? graph : new Graph(); _layoutEngine = layoutEngine; _secondaryConverter = secondaryConverter; _history.Add(new HistoricalGraph() { Graph = _graph.Clone(), Zoom = _Zoom, ViewScale = _viewScale }); } public void Invalidate() { if (Canvas != null) Canvas.Invalidate(); } public void GraphChanged() { _history.RemoveRange(_historyIndex + 1, _history.Count - _historyIndex - 1); _history.Add(new HistoricalGraph() { Graph = _graph.Clone(), Zoom = _Zoom, ViewScale = _viewScale }); _historyIndex = _history.Count - 1; if (GraphModified != null) GraphModified(Graph); } public bool DoUndo() { if (_historyIndex <= 0) return false; _historyIndex--; ObeyHistory(); return _historyIndex > 0; } public bool DoRedo() { if (_historyIndex >= _history.Count - 1) return false; _historyIndex++; ObeyHistory(); return _historyIndex < _history.Count - 1; } void ObeyHistory() { _graph = _history[_historyIndex].Graph.Clone(); ViewScale = _history[_historyIndex].ViewScale; Zoom = _history[_historyIndex].Zoom; _graph.ParametersDirty = true; if (GraphModified != null) GraphModified(Graph); Invalidate(); } #region actions public bool Close() { return true; } public string Save(string name) { _graph.Name = name; return _graph.Serialize(); } public void DoZoom(int amount, Box location) { int width = Width; int height = Height; var oldCenter = new Vector((double)width / (double)_viewScale * location.X, (double)height / (double)_viewScale * location.Y); Zoom = Math.Max(MinZoom, _Zoom + ZoomDelta * amount); var center = new Vector((double)width / (double)_viewScale * location.X, (double)height / (double)_viewScale * location.Y); _graph.Translate(center - oldCenter); Invalidate(); } public void DoZoomFit() { if (_graph.Vertices.Count <= 0) { Zoom = 1; Invalidate(); return; } int width = Width; int height = Height; var bounds = _graph.SelectedBoundingRectangle; var c = new Vector(bounds.Left + bounds.Width / 2, bounds.Top + bounds.Height / 2); var actual = Math.Min(width, height); Zoom = 0.8 * actual / Math.Max(bounds.Width, bounds.Height) / BaseViewScale; var center = new Vector((double)width / (double)_viewScale * 0.5, (double)height / (double)_viewScale * 0.5); _graph.Translate(center - c); Invalidate(); } public void DoDelete() { if (_graph.SelectedVertices.Count > 0) { foreach (var v in _graph.SelectedVertices) _graph.RemoveVertex(v); } if (_graph.SelectedEdges.Count > 0) { foreach (var e in _graph.SelectedEdges) _graph.RemoveEdge(e.V1, e.V2); } Invalidate(); GraphChanged(); } public void DoReverseSelected() { if (_graph.SelectedEdges.Count > 0) { var removed = new List<Edge>(); foreach (var e in _graph.SelectedEdges) { removed.Add(e); _graph.RemoveEdge(e.V1, e.V2); } foreach (var e in removed) { var oo = e.Orientation; if (oo == Edge.Orientations.Forward) oo = Edge.Orientations.Backward; else if (oo == Edge.Orientations.Backward) oo = Edge.Orientations.Forward; _graph.AddEdge(e.V2, e.V1, oo, e.Multiplicity, e.Thickness, e.Style, e.Label); } Invalidate(); GraphChanged(); } } public void DoCut() { DoCopy(); DoDelete(); } public void DoCopy(bool verbose = false) { var h = _graph.InducedSubgraph(_graph.SelectedVertices); var s = verbose ? h.Serialize() : CompactSerializer.Serialize(h); if (!string.IsNullOrEmpty(s)) { try { Canvas.SetClipboardText(s); } catch { } } } public void DoPaste() { var s = Canvas.GetClipboardText() ?? ""; Graph g; if (s.Contains("tikzpicture")) { g = TeXConverter.FromTikz(s); } else if (CompactSerializer.LooksLikeASerializedGraph(s)) { g = CompactSerializer.Deserialize(s); } else { g = Graph.Deserialize(s); } if (g != null) { _graph.DisjointUnion(g); Invalidate(); GraphChanged(); } else if (s.Trim().Split(' ').All(x => { int d; return x.StartsWith("[") || int.TryParse(x, out d); })) { try { g = GraphIO.GraphFromEdgeWeightString(s); if (g != null) { _graph.DisjointUnion(g); Invalidate(); GraphChanged(); } } catch { } } else { try { g = GraphIO.GraphFromGraph6(s.Trim()); if (g != null) { var empty = _graph.Vertices.Count <= 0; _graph.DisjointUnion(g); if (empty) NameModified(g.Name); Invalidate(); GraphChanged(); } } catch { } } } public void DoComplement() { for (int i = 0; i < _graph.SelectedVertices.Count; i++) { for (int j = i + 1; j < _graph.SelectedVertices.Count; j++) { var v1 = _graph.SelectedVertices[i]; var v2 = _graph.SelectedVertices[j]; var edgeExists = _graph.EdgeExists(v1, v2) || _graph.EdgeExists(v2, v1); if (edgeExists) { _graph.RemoveEdge(v1, v2); _graph.RemoveEdge(v2, v1); } else { _graph.AddEdge(v1, v2); } } } Invalidate(); GraphChanged(); } public Graph DoSquare() { var g = new Graph(); var vertexMap = new Dictionary<Vertex, Vertex>(); foreach (var v in _graph.Vertices) { var w = new Vertex(v.X, v.Y, v.Label); g.AddVertex(w); vertexMap[v] = w; } foreach (var v in _graph.Vertices) { var q = _graph.FindNeighbors(v).Union(new[] { v }).ToList(); for (int i = 0; i < q.Count; i++) { for (int j = i + 1; j < q.Count; j++) { g.AddEdge(vertexMap[q[i]], vertexMap[q[j]]); } } } return g; } public Graph DoLineGraph() { var g = new Graph(); var edgeToCliqueMap = new Dictionary<Edge, List<Vertex>>(); foreach (var e in _graph.Edges) { var clique = new List<Vertex>(); for (int i = 0; i < e.Multiplicity; i++) { var v = new Vertex((e.V1.X + e.V2.X) / 2, (e.V1.Y + e.V2.Y) / 2); g.AddVertex(v); v.Label = e.Label; foreach (var other in clique) g.AddEdge(other, v); clique.Add(v); } edgeToCliqueMap[e] = clique; } for (int i = 0; i < _graph.Edges.Count; i++) { for (int j = i + 1; j < _graph.Edges.Count; j++) { if (_graph.Edges[i].Meets(_graph.Edges[j])) { foreach (var v1 in edgeToCliqueMap[_graph.Edges[i]]) { foreach (var v2 in edgeToCliqueMap[_graph.Edges[j]]) { g.AddEdge(v1, v2); } } } } } return g; } public void DoContractSelectedSubgraph() { var selected = _graph.SelectedVertices; if (selected.Count <= 0) return; var x = selected.Average(z => z.X); var y = selected.Average(z => z.Y); var contractedVertex = new Vertex(x, y); _graph.AddVertex(contractedVertex); var neighbors = selected.SelectMany(v => _graph.FindNeighbors(v)).Distinct(); foreach (var neighbor in neighbors) _graph.AddEdge(contractedVertex, neighbor); foreach (var v in selected) _graph.RemoveVertex(v); Invalidate(); GraphChanged(); } public void DoIndexLabeling() { var g = new Choosability.Graph(_graph.GetEdgeWeights()); for (int i = 0; i < _graph.Vertices.Count; i++) _graph.Vertices[i].Label = i.ToString(); Invalidate(); GraphChanged(); } public void DoDegreeLabeling() { var g = new Choosability.Graph(_graph.GetEdgeWeights()); for (int i = 0; i < _graph.Vertices.Count; i++) _graph.Vertices[i].Label = g.Degree(i).ToString(); Invalidate(); GraphChanged(); } public void DoInDegreeLabeling() { var g = new Choosability.Graph(_graph.GetEdgeWeights()); for (int i = 0; i < _graph.Vertices.Count; i++) _graph.Vertices[i].Label = g.InDegree(i).ToString(); Invalidate(); GraphChanged(); } public void DoOutDegreeLabeling() { var g = new Choosability.Graph(_graph.GetEdgeWeights()); for (int i = 0; i < _graph.Vertices.Count; i++) _graph.Vertices[i].Label = g.OutDegree(i).ToString(); Invalidate(); GraphChanged(); } public void DoOutDegreePlusOneLabeling() { var g = new Choosability.Graph(_graph.GetEdgeWeights()); for (int i = 0; i < _graph.Vertices.Count; i++) _graph.Vertices[i].Label = (g.OutDegree(i) + 1).ToString(); Invalidate(); GraphChanged(); } public void DoClearLabels(string s = "", IEnumerable<int> vertices = null) { if (vertices == null || vertices.Count() <= 0) vertices = Enumerable.Range(0, _graph.Vertices.Count); foreach (var v in vertices) _graph.Vertices[v].Label = s; Invalidate(); GraphChanged(); } public void DoSnapToGrid() { if (GridStep <= 0) return; foreach (var v in _graph.Vertices) { v.X = (float)(_gridStep * Math.Round(v.X / _gridStep)); v.Y = (float)(_gridStep * Math.Round(v.Y / _gridStep)); } } #endregion void PaintGrid(IGraphics g) { if (!DrawGrid || GridStep <= 0) return; var x = 0.0; while (x <= Width) { g.DrawLine(GridPenColor, x, 0, x, Height); x += GridStep * _viewScale; } var y = 0.0; while (y <= Height) { g.DrawLine(GridPenColor, 0, y, Width, y); y += GridStep * _viewScale; } } IHittable GetHit(double x, double y) { return _graph.HitTest(x, y); } class HistoricalGraph { public Graph Graph { get; set; } public int ViewScale { get; set; } public double Zoom { get; set; } } public void Paint(GraphicsLayer.IGraphics g, int width, int height) { if (width == 0 || height == 0) return; try { Width = width; Height = height; if (SnapToGrid) DoSnapToGrid(); g.Clear(BackgroundColor); PaintGrid(g); _graph.Paint(g, _viewScale, _viewScale); switch (_state) { case States.Idle: break; case States.DraggingVertex: break; case States.DraggingSelectionRegion: { List<Box> selectionPoints; lock (_SelectionPointsToken) { selectionPoints = new List<Box>(_selectionPoints.Count); foreach (var p in _selectionPoints) selectionPoints.Add(new Box(p.X * _viewScale, p.Y * _viewScale)); } if (selectionPoints.Count > 1) g.DrawLines(SelectionPenColor, selectionPoints); break; } } } catch { } HasPainted = true; if (_zoomFitNextPaint) { _zoomFitNextPaint = false; DoZoomFit(); DoZoom(4, new GraphicsLayer.Box(0.5, 0.5)); } } public void OnMouseMove(double X, double Y) { var x = X / _viewScale; var y = Y / _viewScale; switch (_state) { case States.Idle: break; case States.DraggingVertex: { _DraggedVertex.X = _DraggedVertex.DragOffset.X + x; _DraggedVertex.Y = _DraggedVertex.DragOffset.Y + y; Invalidate(); break; } case States.DraggingSelectionRegion: { lock (_SelectionPointsToken) { _selectionPoints.Add(new Box(x, y)); Invalidate(); } break; } case States.DraggingSelectedVertices: { foreach (var v in _graph.SelectedVertices) { v.X = v.DragOffset.X + x; v.Y = v.DragOffset.Y + y; } Invalidate(); break; } } } public void OnMouseDown(double X, double Y, GraphicsLayer.MouseButton button) { _controlWasDown = Canvas.IsControlKeyDown; var x = X / _viewScale; var y = Y / _viewScale; var o = GetHit(x, y); switch (_state) { case States.Idle: { if (button == MouseButton.Left) { if (o == null) { _selectionPoints.Clear(); _selectionPoints.Add(new Box(x, y)); _state = States.DraggingSelectionRegion; } else if (o is Vertex) { if (((Vertex)o).IsSelected) { foreach (Vertex v in _graph.SelectedVertices) { v.DragOffset = new Box(v.X - x, v.Y - y); } _state = States.DraggingSelectedVertices; } else { _DraggedVertex = (Vertex)o; _DraggedVertex.DragOffset = new Box(_DraggedVertex.X - x, _DraggedVertex.Y - y); _state = States.DraggingVertex; } } else if (o is Edge) { } } else if (button == MouseButton.Right) { if (o == null) { } else if (o is Vertex) { } else if (o is Edge) { } } break; } case States.DraggingVertex: break; case States.DraggingSelectionRegion: break; } } public void OnMouseUp(double X, double Y, GraphicsLayer.MouseButton button) { var x = X / _viewScale; var y = Y / _viewScale; var o = GetHit(x, y); switch (_state) { case States.Idle: { break; } case States.DraggingVertex: { if (button == MouseButton.Left) { _state = States.Idle; if (SnapToGrid) DoSnapToGrid(); GraphChanged(); } break; } case States.DraggingSelectionRegion: { if (button == MouseButton.Left) { _state = States.Idle; List<Box> selectionPoints; lock (_SelectionPointsToken) { selectionPoints = new List<Box>(_selectionPoints); if (selectionPoints.Count > 2) { _graph.SelectObjects(selectionPoints, _controlWasDown); } Canvas.SelectedObjects = _graph.SelectedItems.Cast<object>(); Invalidate(); } } break; } case States.DraggingSelectedVertices: { if (button == MouseButton.Left) { _state = States.Idle; GraphChanged(); } break; } } Invalidate(); } public void OnMouseDoubleClick(double X, double Y, GraphicsLayer.MouseButton button) { var x = X / _viewScale; var y = Y / _viewScale; var o = GetHit(x, y); var graphChanged = false; if (_state == States.Idle && !Canvas.IsControlKeyDown) { if (button == MouseButton.Left) { if (o == null) { var v = new Vertex(x, y); if (_graph.AddVertex(v)) graphChanged = true; } else if (o is Vertex) { var endVertex = (Vertex)o; foreach (var v in _graph.SelectedVertices) { if (_graph.AddEdge(v, endVertex)) graphChanged = true; } } } else if (button == MouseButton.Right) { if (o is Vertex) { if (_graph.RemoveVertex((Vertex)o)) graphChanged = true; } } } Invalidate(); if (graphChanged) GraphChanged(); } public void ZoomFitNextPaint() { _zoomFitNextPaint = true; Invalidate(); } } }
30.107955
168
0.410153
[ "MIT" ]
landon/WebGraphs
GraphsCore/GraphCanvas.cs
26,497
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("Taulukko 3.1")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Taulukko 3.1")] [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("65857e20-a869-46d6-96e1-d0ae0a33a86b")] // 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.621622
84
0.744971
[ "MIT" ]
JiiSPee/ohjelmoinnin-perusteet
Arrays_/Taulukko 3.1/Taulukko 3.1/Properties/AssemblyInfo.cs
1,395
C#
using System.Collections; using System.Collections.Generic; using System; using NetRuntimeSystem = System; using System.ComponentModel; using NetOffice.Attributes; using NetOffice.CollectionsGeneric; namespace NetOffice.VisioApi { /// <summary> /// DispatchInterface IVDataColumns /// SupportByVersion Visio, 12,14,15,16 /// </summary> [SupportByVersion("Visio", 12,14,15,16)] [EntityType(EntityType.IsDispatchInterface), BaseType, Enumerator(Enumerator.Reference, EnumeratorInvoke.Property), HasIndexProperty(IndexInvoke.Property, "Item")] public class IVDataColumns : COMObject, IEnumerableProvider<NetOffice.VisioApi.IVDataColumn> { #pragma warning disable #region Type Information /// <summary> /// Instance Type /// </summary> [EditorBrowsable(EditorBrowsableState.Advanced), Browsable(false), Category("NetOffice"), CoreOverridden] public override Type InstanceType { get { return LateBindingApiWrapperType; } } private static Type _type; [EditorBrowsable(EditorBrowsableState.Never), Browsable(false)] public static Type LateBindingApiWrapperType { get { if (null == _type) _type = typeof(IVDataColumns); return _type; } } #endregion #region Ctor /// <param name="factory">current used factory core</param> /// <param name="parentObject">object there has created the proxy</param> /// <param name="proxyShare">proxy share instead if com proxy</param> public IVDataColumns(Core factory, ICOMObject parentObject, COMProxyShare proxyShare) : base(factory, parentObject, proxyShare) { } ///<param name="factory">current used factory core</param> ///<param name="parentObject">object there has created the proxy</param> ///<param name="comProxy">inner wrapped COM proxy</param> public IVDataColumns(Core factory, ICOMObject parentObject, object comProxy) : base(factory, parentObject, comProxy) { } ///<param name="parentObject">object there has created the proxy</param> ///<param name="comProxy">inner wrapped COM proxy</param> [EditorBrowsable(EditorBrowsableState.Never), Browsable(false)] public IVDataColumns(ICOMObject parentObject, object comProxy) : base(parentObject, comProxy) { } ///<param name="factory">current used factory core</param> ///<param name="parentObject">object there has created the proxy</param> ///<param name="comProxy">inner wrapped COM proxy</param> ///<param name="comProxyType">Type of inner wrapped COM proxy"</param> [EditorBrowsable(EditorBrowsableState.Never), Browsable(false)] public IVDataColumns(Core factory, ICOMObject parentObject, object comProxy, NetRuntimeSystem.Type comProxyType) : base(factory, parentObject, comProxy, comProxyType) { } ///<param name="parentObject">object there has created the proxy</param> ///<param name="comProxy">inner wrapped COM proxy</param> ///<param name="comProxyType">Type of inner wrapped COM proxy"</param> [EditorBrowsable(EditorBrowsableState.Never), Browsable(false)] public IVDataColumns(ICOMObject parentObject, object comProxy, NetRuntimeSystem.Type comProxyType) : base(parentObject, comProxy, comProxyType) { } ///<param name="replacedObject">object to replaced. replacedObject are not usable after this action</param> [EditorBrowsable(EditorBrowsableState.Never), Browsable(false)] public IVDataColumns(ICOMObject replacedObject) : base(replacedObject) { } [EditorBrowsable(EditorBrowsableState.Never), Browsable(false)] public IVDataColumns() : base() { } /// <param name="progId">registered progID</param> [EditorBrowsable(EditorBrowsableState.Never), Browsable(false)] public IVDataColumns(string progId) : base(progId) { } #endregion #region Properties /// <summary> /// SupportByVersion Visio 12, 14, 15, 16 /// Get /// </summary> [SupportByVersion("Visio", 12,14,15,16)] [BaseResult] public NetOffice.VisioApi.IVApplication Application { get { return Factory.ExecuteBaseReferencePropertyGet<NetOffice.VisioApi.IVApplication>(this, "Application"); } } /// <summary> /// SupportByVersion Visio 12, 14, 15, 16 /// Get /// </summary> [SupportByVersion("Visio", 12,14,15,16)] public Int16 Stat { get { return Factory.ExecuteInt16PropertyGet(this, "Stat"); } } /// <summary> /// SupportByVersion Visio 12, 14, 15, 16 /// Get /// </summary> [SupportByVersion("Visio", 12,14,15,16)] [BaseResult] public NetOffice.VisioApi.IVDocument Document { get { return Factory.ExecuteBaseReferencePropertyGet<NetOffice.VisioApi.IVDocument>(this, "Document"); } } /// <summary> /// SupportByVersion Visio 12, 14, 15, 16 /// Get /// </summary> [SupportByVersion("Visio", 12,14,15,16)] public Int16 ObjectType { get { return Factory.ExecuteInt16PropertyGet(this, "ObjectType"); } } /// <summary> /// SupportByVersion Visio 12, 14, 15, 16 /// Get /// </summary> [SupportByVersion("Visio", 12,14,15,16)] [BaseResult] public NetOffice.VisioApi.IVDataRecordset DataRecordset { get { return Factory.ExecuteBaseReferencePropertyGet<NetOffice.VisioApi.IVDataRecordset>(this, "DataRecordset"); } } /// <summary> /// SupportByVersion Visio 12, 14, 15, 16 /// Get /// </summary> [SupportByVersion("Visio", 12,14,15,16)] public Int32 Count { get { return Factory.ExecuteInt32PropertyGet(this, "Count"); } } /// <summary> /// SupportByVersion Visio 12, 14, 15, 16 /// Get /// </summary> /// <param name="indexOrName">object indexOrName</param> [SupportByVersion("Visio", 12,14,15,16)] [BaseResult] [NetRuntimeSystem.Runtime.CompilerServices.IndexerName("Item"), IndexProperty] public NetOffice.VisioApi.IVDataColumn this[object indexOrName] { get { return Factory.ExecuteBaseReferencePropertyGet<NetOffice.VisioApi.IVDataColumn>(this, "Item", indexOrName); } } #endregion #region Methods /// <summary> /// SupportByVersion Visio 12, 14, 15, 16 /// </summary> /// <param name="columnNames">String[] columnNames</param> /// <param name="properties">Int32[] properties</param> /// <param name="values">object[] values</param> [SupportByVersion("Visio", 12,14,15,16)] public void SetColumnProperties(String[] columnNames, Int32[] properties, object[] values) { object[] paramsArray = Invoker.ValidateParamsArray((object)columnNames, (object)properties, (object)values); Invoker.Method(this, "SetColumnProperties", paramsArray); } #endregion #region IEnumerableProvider<NetOffice.VisioApi.IVDataColumn> ICOMObject IEnumerableProvider<NetOffice.VisioApi.IVDataColumn>.GetComObjectEnumerator(ICOMObject parent) { return NetOffice.Utils.GetComObjectEnumeratorAsProperty(parent, this, false); } IEnumerable IEnumerableProvider<NetOffice.VisioApi.IVDataColumn>.FetchVariantComObjectEnumerator(ICOMObject parent, ICOMObject enumerator) { return NetOffice.Utils.FetchVariantComObjectEnumerator(parent, enumerator, false); } #endregion #region IEnumerable<NetOffice.VisioApi.IVDataColumn> /// <summary> /// SupportByVersion Visio, 12,14,15,16 /// </summary> [SupportByVersion("Visio", 12, 14, 15, 16)] public IEnumerator<NetOffice.VisioApi.IVDataColumn> GetEnumerator() { NetRuntimeSystem.Collections.IEnumerable innerEnumerator = (this as NetRuntimeSystem.Collections.IEnumerable); foreach (NetOffice.VisioApi.IVDataColumn item in innerEnumerator) yield return item; } #endregion #region IEnumerable /// <summary> /// SupportByVersion Visio, 12,14,15,16 /// </summary> [SupportByVersion("Visio", 12,14,15,16)] IEnumerator NetRuntimeSystem.Collections.IEnumerable.GetEnumerator() { return NetOffice.Utils.GetProxyEnumeratorAsProperty(this, false); } #endregion #pragma warning restore } }
30.285714
168
0.685776
[ "MIT" ]
DominikPalo/NetOffice
Source/Visio/DispatchInterfaces/IVDataColumns.cs
8,270
C#
using System.Collections; using System.Collections.Generic; using System.Globalization; using UnityEngine; using UnityEngine.UI; using UnityEngine.XR.ARFoundation; using UnityEngine.SceneManagement; using LevelManagement.Data; public class UIManager: MonoBehaviour { public Text appleCountText; public Text bananaCountText; public Text pizzaCountText; public GameObject endGameUI; public Text endUIText; public GameObject reloadButton; public GameObject reloadPanel; public GameObject highScoreUI; public GameObject handScanUI; public RectTransform scorePanel; public GameObject scoreCounterUI; public RectTransform panelParent; public RectTransform bodyParent; public SnakeController snakeController; int appleCount; int bananaCount; int pizzaCount; int score = 0; string bodyBite = "That turn was pretty steep.\n" + "The Snake bit itself.\n\n" + "Tap Anywhere to play again!"; string bombBite = "Ah, our poor snake\ncan't digest a BOMB \n\n" + "Tap Anywhere to play again!"; private DataManager dataManager; private void OnEnable() { FoodConsumer.SelfAnnihilation += ShowGameOverUI; SceneController.PlaneSelected += GameRestarted; FoodConsumer.FoodConsumed += FoodCountUpdate; dataManager = FindObjectOfType<DataManager>(); } private void OnDisable() { FoodConsumer.SelfAnnihilation -= ShowGameOverUI; SceneController.PlaneSelected -= GameRestarted; FoodConsumer.FoodConsumed -= FoodCountUpdate; } void Start() { endGameUI.SetActive(false); } void FoodCountUpdate(string name) { score++; if (name == "Apple") { appleCount++; CounterTextUpdate(); } else if (name == "Banana") { bananaCount++; CounterTextUpdate(); } else if (name == "Pizza") { pizzaCount++; CounterTextUpdate(); } else { Debug.LogWarning("Unknown food consumed: " + name); } } void ShowGameOverUI(BiteType biteType) { //endUIText.text = biteType == BiteType.Body ? bodyBite : bombBite; dataManager.Load(); if (score > dataManager.HighScore) { dataManager.HighScore = score; dataManager.Save(); highScoreUI.SetActive(true); } else { highScoreUI.SetActive(false); } if (biteType == BiteType.Body) { endUIText.text = bodyBite; } else { endUIText.text = bombBite; } endGameUI.SetActive(true); reloadButton.SetActive(false); scoreCounterUI.SetActive(true); scoreCounterUI.transform.GetChild(0).GetComponent<Text>().text = string.Format("Score = {0}", score); scorePanel.SetParent(bodyParent); scorePanel.localPosition = Vector3.zero; } void GameRestarted(ARPlane detectedPlane) { endGameUI.SetActive(false); reloadButton.SetActive(true); scoreCounterUI.SetActive(false); handScanUI.SetActive(false); panelParent.gameObject.SetActive(true); appleCount = 0; bananaCount = 0; pizzaCount = 0; CounterTextUpdate(); scorePanel.SetParent(panelParent); scorePanel.localPosition = Vector3.zero; score = 0; } void CounterTextUpdate() { appleCountText.text = appleCount.ToString(); bananaCountText.text = bananaCount.ToString(); pizzaCountText.text = pizzaCount.ToString(); } public void ReloadCurrentScene() { reloadPanel.SetActive(true); reloadButton.SetActive(false); scorePanel.gameObject.SetActive(false); handScanUI.SetActive(false); SceneController.playing = false; StartCoroutine(LevelReloadRoutine()); snakeController.gameObject.SetActive(false); score = 0; } IEnumerator LevelReloadRoutine() { yield return new WaitForSeconds(1.5f); SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex); } }
25.845238
110
0.613082
[ "Apache-2.0" ]
creativehims/snake-arcore-codelab
Assets/Scripts/UIManager.cs
4,344
C#
namespace Venture.CaseOffice.Application { public static class CaseOfficeApplicationAssemblyTag { } }
20.8
58
0.826923
[ "MIT" ]
Eshva/Eshva.Poezd
samples/Venture/CaseOffice/Venture.CaseOffice.Application/CaseOfficeApplicationAssemblyTag.cs
104
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.AzureNative.Network.V20200501.Outputs { [OutputType] public sealed class ContainerNetworkInterfaceConfigurationResponse { /// <summary> /// A list of container network interfaces created from this container network interface configuration. /// </summary> public readonly ImmutableArray<Outputs.SubResourceResponse> ContainerNetworkInterfaces; /// <summary> /// A unique read-only string that changes whenever the resource is updated. /// </summary> public readonly string Etag; /// <summary> /// Resource ID. /// </summary> public readonly string? Id; /// <summary> /// A list of ip configurations of the container network interface configuration. /// </summary> public readonly ImmutableArray<Outputs.IPConfigurationProfileResponse> IpConfigurations; /// <summary> /// The name of the resource. This name can be used to access the resource. /// </summary> public readonly string? Name; /// <summary> /// The provisioning state of the container network interface configuration resource. /// </summary> public readonly string ProvisioningState; /// <summary> /// Sub Resource type. /// </summary> public readonly string Type; [OutputConstructor] private ContainerNetworkInterfaceConfigurationResponse( ImmutableArray<Outputs.SubResourceResponse> containerNetworkInterfaces, string etag, string? id, ImmutableArray<Outputs.IPConfigurationProfileResponse> ipConfigurations, string? name, string provisioningState, string type) { ContainerNetworkInterfaces = containerNetworkInterfaces; Etag = etag; Id = id; IpConfigurations = ipConfigurations; Name = name; ProvisioningState = provisioningState; Type = type; } } }
33.478873
111
0.635675
[ "Apache-2.0" ]
pulumi-bot/pulumi-azure-native
sdk/dotnet/Network/V20200501/Outputs/ContainerNetworkInterfaceConfigurationResponse.cs
2,377
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 MineCalc.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", "15.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("MineCalc.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; } } /// <summary> /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// </summary> internal static System.Drawing.Icon icon { get { object obj = ResourceManager.GetObject("icon", resourceCulture); return ((System.Drawing.Icon)(obj)); } } } }
42.594595
174
0.600888
[ "MIT" ]
GamesFaix/MineCalc
MineCalc/Properties/Resources.Designer.cs
3,154
C#
using UnityEngine; using System.Collections.Generic; using AppodealCM.Unity.Common; namespace AppodealCM.Unity.Platforms { public class Dummy : IConsentManager, IConsentForm, IVendor, IVendorBuilder, IConsentFormBuilder, IConsentManagerException, IConsent { #region Dummy private const string DummyMessage = "Not supported on this platform"; public void requestConsentInfoUpdate(string appodealAppKey, IConsentInfoUpdateListener listener) { Debug.Log(DummyMessage); } public void setCustomVendor(Vendor customVendor) { Debug.Log(DummyMessage); } public Vendor getCustomVendor(string bundle) { Debug.Log(DummyMessage); return null; } public ConsentManagerStorage getStorage() { Debug.Log(DummyMessage); return ConsentManagerStorage.NONE; } public void setStorage(ConsentManagerStorage iabStorage) { Debug.Log(DummyMessage); } public ConsentShouldShow shouldShowConsentDialog() { Debug.Log(DummyMessage); return ConsentShouldShow.UNKNOWN; } public ConsentZone getConsentZone() { Debug.Log(DummyMessage); return ConsentZone.UNKNOWN; } public ConsentStatus getConsentStatus() { Debug.Log(DummyMessage); return ConsentStatus.UNKNOWN; } public Consent getConsent() { Debug.Log(DummyMessage); return null; } public void disableAppTrackingTransparencyRequest() { Debug.Log(DummyMessage); } public void load() { Debug.Log(DummyMessage); } public void showAsActivity() { Debug.Log(DummyMessage); } public void showAsDialog() { Debug.Log(DummyMessage); } public bool isLoaded() { Debug.Log(DummyMessage); return false; } public bool isShowing() { Debug.Log(DummyMessage); return false; } public string getName() { Debug.Log(DummyMessage); return DummyMessage; } public string getBundle() { Debug.Log(DummyMessage); return DummyMessage; } public string getPolicyUrl() { Debug.Log(DummyMessage); return DummyMessage; } public List<int> getPurposeIds() { Debug.Log(DummyMessage); return new List<int>(); } public List<int> getFeatureIds() { Debug.Log(DummyMessage); return new List<int>(); } public List<int> getLegitimateInterestPurposeIds() { Debug.Log(DummyMessage); return new List<int>(); } IVendor IVendorBuilder.build() { Debug.Log(DummyMessage); return null; } public void withListener(IConsentFormListener consentFormListener) { Debug.Log(DummyMessage); } public void setPurposeIds(IEnumerable<int> purposeIds) { Debug.Log(DummyMessage); } public void setFeatureIds(IEnumerable<int> featureIds) { Debug.Log(DummyMessage); } public void setLegitimateInterestPurposeIds(IEnumerable<int> legitimateInterestPurposeIds) { Debug.Log(DummyMessage); } IConsentForm IConsentFormBuilder.build() { Debug.Log(DummyMessage); return null; } public string getReason() { Debug.Log(DummyMessage); return DummyMessage; } public int getCode() { Debug.Log(DummyMessage); return 0; } public ConsentZone getZone() { Debug.Log(DummyMessage); return ConsentZone.UNKNOWN; } public ConsentStatus getStatus() { Debug.Log(DummyMessage); return ConsentStatus.UNKNOWN; } public ConsentAuthorizationStatus getAuthorizationStatus() { Debug.Log(DummyMessage); return ConsentAuthorizationStatus.NOT_DETERMINED; } public HasConsent hasConsentForVendor(string bundle) { Debug.Log(DummyMessage); return HasConsent.UNKNOWN; } public string getIabConsentString() { Debug.Log(DummyMessage); return DummyMessage; } #endregion } }
23.166667
104
0.540596
[ "Apache-2.0" ]
appodeal/appodeal-unity-plugin-upm
Runtime/Platforms/ConsentManager/Dummy/Dummy.cs
4,865
C#
// Copyright (c) 2020, Phoenix Contact GmbH & Co. KG // Licensed under the Apache License, Version 2.0 namespace Moryx.Runtime.Modules { /// <summary> /// Interface for all modules offering an API Facade /// </summary> /// <typeparam name="TFacade">Type of facade offered by this module</typeparam> public interface IFacadeContainer<out TFacade> { /// <summary> /// Facade controlled by this module /// </summary> /// <remarks> /// The hard-coded name of this property is also used in Moryx.Runtime.Kernel\ModuleManagement\Components\ModuleDependencyManager.cs /// </remarks> TFacade Facade { get; } } }
32.809524
140
0.640058
[ "Apache-2.0" ]
1nf0rmagician/MORYX-Core
src/Moryx.Runtime/Modules/IFacadeContainer.cs
689
C#
using System.Concepts; using System.Concepts.Enumerable; using System.Concepts.Monoid; using System.Concepts.Prelude; namespace TinyLinq { /// <summary> /// Concept for summing over an enumerable. /// </summary> public concept CSum<TColl, [AssociatedType] TElem> { /// <summary> /// Sums over all of the elements of an enumerable. /// </summary> /// <param name="source"> /// The enumerator to sum. /// </param> /// <returns> /// The sum of all elements in the enumerable /// </returns> TElem Sum(this TColl source); } public class MonoidInstances { /// <summary> /// Summation over a general enumerator, when the element is a monoid. /// Summation is iterated monoid append with monoid empty as a unit. /// </summary> public instance Sum_Enumerable_Monoid<TSourceColl, [AssociatedType]TSourceEnum, [AssociatedType]TSource, implicit Eb, implicit Et, implicit M> : CSum<TSourceColl, TSource> where Eb : CEnumerable<TSourceColl, TSourceEnum> where Et : CEnumerator<TSourceEnum, TSource> where M : Monoid<TSource> { TSource Sum(this TSourceColl source) { var e = source.RefGetEnumerator(); var sum = M.Empty; while (e.MoveNext()) { sum = sum.Append(e.Current()); } return sum; } } } /// <summary> /// Summing over a general enumerable, when the element is a number. /// </summary> [Overlappable] public instance Sum_Enumerable_Num<TSourceColl, [AssociatedType] TSourceEnum, [AssociatedType]TSource, implicit Eb, implicit Et, implicit N> : CSum<TSourceColl, TSource> where Eb : CEnumerable<TSourceColl, TSourceEnum> where Et : CEnumerator<TSourceEnum, TSource> where N : Num<TSource> { TSource Sum(this TSourceColl source) { var e = source.RefGetEnumerator(); var sum = N.FromInteger(0); while (e.MoveNext()) { sum += e.Current(); } return sum; } } }
30.905405
179
0.56056
[ "Apache-2.0" ]
ElanHasson/roslyn
concepts/code/TinyLinq/TinyLinq.Core/Sum.cs
2,289
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. using System.ComponentModel; using System.Diagnostics; namespace System.Windows.Forms { /// <summary> /// CategoryAttribute that can access WinForms localized strings. /// </summary> [AttributeUsage(AttributeTargets.All)] internal sealed class WinCategoryAttribute : CategoryAttribute { /// <summary> /// Initializes a new instance of the <see cref="CategoryAttribute"/> class. /// </summary> public WinCategoryAttribute(string category) : base(category) { } /// <summary> /// This method is called the first time the category property /// is accessed. It provides a way to lookup a localized string for /// the given category. Classes may override this to add their /// own localized names to categories. If a localized string is /// available for the given value, the method should return it. /// Otherwise, it should return null. /// </summary> protected override string GetLocalizedString(string value) { string? localizedValue = base.GetLocalizedString(value); if (localizedValue is null) { localizedValue = (string?)GetSRObject("WinFormsCategory" + value); } // This attribute is internal, and we should never have a missing resource string. Debug.Assert(localizedValue is not null, "All Windows Forms category attributes should have localized strings. Category '" + value + "' not found."); return localizedValue; } private static object? GetSRObject(string name) { object? resourceObject = null; try { resourceObject = SR.ResourceManager.GetObject(name); } catch (Resources.MissingManifestResourceException) { } return resourceObject; } } }
36.79661
162
0.61953
[ "MIT" ]
AndreRRR/winforms
src/System.Windows.Forms/src/System/Windows/Forms/WinCategoryAttribute.cs
2,173
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. using System.Collections.Immutable; using System.Diagnostics; using Microsoft.CodeAnalysis.CSharp.Syntax; namespace Microsoft.CodeAnalysis.CSharp.Symbols { internal sealed class SynthesizedRecordPropertySymbol : SourcePropertySymbolBase { public SourceParameterSymbol BackingParameter { get; } public SynthesizedRecordPropertySymbol( SourceMemberContainerTypeSymbol containingType, CSharpSyntaxNode syntax, ParameterSymbol backingParameter, bool isOverride, BindingDiagnosticBag diagnostics) : base( containingType, syntax: syntax, hasGetAccessor: true, hasSetAccessor: true, isExplicitInterfaceImplementation: false, explicitInterfaceType: null, aliasQualifierOpt: null, modifiers: DeclarationModifiers.Public | (isOverride ? DeclarationModifiers.Override : DeclarationModifiers.None), hasInitializer: true, // Synthesized record properties always have a synthesized initializer isAutoProperty: true, isExpressionBodied: false, isInitOnly: ShouldUseInit(containingType), RefKind.None, backingParameter.Name, indexerNameAttributeLists: new SyntaxList<AttributeListSyntax>(), backingParameter.Locations[0], diagnostics) { BackingParameter = (SourceParameterSymbol)backingParameter; } public override IAttributeTargetSymbol AttributesOwner => BackingParameter as IAttributeTargetSymbol ?? this; protected override Location TypeLocation => ((ParameterSyntax)CSharpSyntaxNode).Type!.Location; public override SyntaxList<AttributeListSyntax> AttributeDeclarationSyntaxList => BackingParameter.AttributeDeclarationList; protected override SourcePropertyAccessorSymbol CreateGetAccessorSymbol(bool isAutoPropertyAccessor, BindingDiagnosticBag diagnostics) { Debug.Assert(isAutoPropertyAccessor); return CreateAccessorSymbol(isGet: true, CSharpSyntaxNode, diagnostics); } protected override SourcePropertyAccessorSymbol CreateSetAccessorSymbol(bool isAutoPropertyAccessor, BindingDiagnosticBag diagnostics) { Debug.Assert(isAutoPropertyAccessor); return CreateAccessorSymbol(isGet: false, CSharpSyntaxNode, diagnostics); } private static bool ShouldUseInit(TypeSymbol container) { // the setter is always init-only in record class and in readonly record struct return !container.IsStructType() || container.IsReadOnly; } private SourcePropertyAccessorSymbol CreateAccessorSymbol( bool isGet, CSharpSyntaxNode syntax, BindingDiagnosticBag diagnostics) { var usesInit = !isGet && ShouldUseInit(ContainingType); return SourcePropertyAccessorSymbol.CreateAccessorSymbol( isGet, usesInit, ContainingType, this, _modifiers, ((ParameterSyntax)syntax).Identifier.GetLocation(), syntax, diagnostics); } protected override (TypeWithAnnotations Type, ImmutableArray<ParameterSymbol> Parameters) MakeParametersAndBindType(BindingDiagnosticBag diagnostics) { return (BackingParameter.TypeWithAnnotations, ImmutableArray<ParameterSymbol>.Empty); } protected override bool HasPointerTypeSyntactically // Since we already bound the type, don't bother looking at syntax => TypeWithAnnotations.DefaultType.IsPointerOrFunctionPointer(); public static bool HaveCorrespondingSynthesizedRecordPropertySymbol(SourceParameterSymbol parameter) { return parameter.ContainingSymbol is SynthesizedRecordConstructor && parameter.ContainingType.GetMembersUnordered().Any((s, parameter) => (s as SynthesizedRecordPropertySymbol)?.BackingParameter == (object)parameter, parameter); } } }
43.805825
178
0.669548
[ "MIT" ]
333fred/roslyn
src/Compilers/CSharp/Portable/Symbols/Synthesized/Records/SynthesizedRecordPropertySymbol.cs
4,514
C#
using AngleSharp; using AngleSharp.Dom; using AngleSharp.Parser.Html; using Racing; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; namespace RacingWebScraper { public partial class SLifeRacingScraper { async Task<LastRace> ScrapeLastRace(String horseUrl, String horseName) { // Get horse profile page var profileDocument = await HtmlService.GetDocumentAsync(horseUrl).ConfigureAwait(false); // Get required data from profile var positionInField = ScrapeLastPositionInField(profileDocument.DocumentElement); var position = ScrapeLastPosition(profileDocument.DocumentElement); //var lastClass = ScrapeLastClass(profileDocument); // Get page for last race var lastRaceUrlSelector = "[data-test-id='profile-table'] tr:nth-of-type(1) [href*='results']"; //"td:nth-child(1) > a.profile-racing-form-racecard-link"; string strId = Regex.Match(horseUrl, @"\d+").Value; Int32 horseId = Int32.Parse(strId); String lastRaceCardUrl = ""; try { lastRaceCardUrl = SITE_PREFIX + ScrapeUrl(profileDocument, lastRaceUrlSelector); } catch (System.Exception ex) { log.Error("Failed to get last race card url for : " + horseName); throw ex; } var lastRaceResultUrl = lastRaceCardUrl.Replace("/racecards/", "/results/") .Replace("/racecard/", "/"); IDocument lastRaceDocument = null; try { lastRaceDocument = await HtmlService.GetDocumentAsync(lastRaceResultUrl).ConfigureAwait(false); } catch (System.Exception ex) { log.Error("Failed to get last race doc from url : " + lastRaceResultUrl); throw ex; } // Scrape data LastRace lastRace = new LastRace(); String errMsg = "Failed to scrape last race data for " + horseName; if (!IsWeighedIn(lastRaceDocument)) return lastRace; try { RaceAdditionalInfo raceAdditionalInfo = ScrapeRaceAdditionalInfo(lastRaceDocument); lastRace.Class = raceAdditionalInfo.RaceClass; lastRace.Distance = raceAdditionalInfo.Distance; lastRace.Going = raceAdditionalInfo.Going; } catch (System.Exception ex) { log.Error(errMsg + ": raceAdditionalInfo"); } //try //{ // lastRace.Class = ScrapeLastClass(lastRaceDocument); //} //catch (System.Exception ex) //{ // log.Error(errMsg + ": class"); //} //try //{ // lastRace.Distance = ScrapeLastDistance(lastRaceDocument); //} //catch (System.Exception ex) //{ // log.Error(errMsg + ": distance"); //} //try //{ // lastRace.Going = ScrapeLastGoing(lastRaceDocument); //} //catch (System.Exception ex) //{ // log.Error(errMsg + ": going"); //} try { lastRace.Course = ScrapeLastCourse(lastRaceDocument); } catch (System.Exception ex) { log.Error(errMsg + ": course"); } if (position > 0) { try { lastRace.Weight = ScrapeLastWeight(lastRaceDocument, position); } catch (System.Exception ex) { log.Error(errMsg + ": weight" + ex.Message); } try { lastRace.Odds = ScrapeLastOdds(lastRaceDocument, position); } catch (System.Exception ex) { log.Error(errMsg + ": odds"); } try { lastRace.Analysis = ScrapeLastAnalysis(lastRaceDocument, position); } catch (System.Exception ex) { log.Error(errMsg + ": analysis"); } try { lastRace.BeatenLengths = ScrapeBeatenLengths(lastRaceDocument, position, horseId); } catch (System.Exception e) { log.Error("Failed to scrape beaten lengths: " + e.Message); } } else { log.Info("Unknown position " + position); } try { lastRace.WinningTime = ScrapeLastWinningTime(lastRaceDocument); } catch (System.Exception ex) { log.Error(errMsg + ": winning time"); } try { lastRace.LastRacePrizes = ScrapeResultWinPrize(lastRaceDocument); } catch (System.Exception ex) { log.Error(errMsg + ": prizes"); } //lastRace.Class = lastClass; lastRace.Position = positionInField; return lastRace; } private class RaceAdditionalInfo { public String Distance { get; set; } = ""; public String Going { get; set; } = ""; public String RaceClass { get; set; } = ""; } private RaceAdditionalInfo ScrapeRaceAdditionalInfo (IDocument lastRaceDocument) { RaceAdditionalInfo raceInfo = new RaceAdditionalInfo(); // 3YO plus | Class 4 | 2m 4f 88y | Good | 7 Runners | Turf // 1m 2f 150y | Standard | 13 Runners | Polytrack // Class 1 | 2m 4f 10y | 7 Runners | Turf // Class 5 | 2m 128y | 9 Runners | Turf // 2m 2f | 23 Runners | Turf // Class 5 | 1m 2f 42y | Standard / Slow | 11 Runners | Allweather var infoSelector = "div > [class^='RacingRacecardSummary__StyledAdditionalInfo-']"; String summary = ScrapeTextContent(lastRaceDocument, infoSelector); List<String> summaryElems = summary.Split('|').Select(info => info.Trim()).ToList(); int ageIdx = 0; int classIdx = 1; int distIdx = 2; int goingIdx = 3; if (!summaryElems.ElementAt(ageIdx).Contains("YO")) { ageIdx = -1; --classIdx; --distIdx; --goingIdx; } if (!summaryElems.ElementAt(classIdx).Contains("Class")) { classIdx = -1; --distIdx; --goingIdx; } // If the element at distance + 1 contaings "Runners", then no going available if(summaryElems.ElementAt(distIdx + 1).Contains("Runners")) { goingIdx = -1; } if (distIdx >= 0) { raceInfo.Distance = summaryElems.ElementAt(distIdx); } if (goingIdx >= 0) { raceInfo.Going = summaryElems.ElementAt(goingIdx); } if (classIdx >= 0) { String raceClass = "C" + Regex.Match(summaryElems.ElementAt(classIdx), @"\d+").Value; String raceTitleSelector = "[data-test-id='racecard-race-name']"; String rxGrade = "Grade (\\d)"; int grade = ScrapeIntFromTextContent(lastRaceDocument, raceTitleSelector, rxGrade); if(!grade.Equals(-1)) { // Add Grade to Class raceClass = raceClass + " G" + grade; } String raceTitle = ScrapeTextContent(lastRaceDocument, raceTitleSelector); if (raceTitle.Contains("Listed")) { // Add Listed to Class raceClass += " Listed"; } raceInfo.RaceClass = raceClass; } return raceInfo; } private List<int> GetAllFinisherIds(IDocument lastRaceDocument) { var selector = "[class*='RaceCardsWrapper']:nth-of-type(1) [class^='ResultRunner'] [href^='/racing/profiles/horse/']"; IHtmlCollection<IElement> elems = lastRaceDocument.QuerySelectorAll(selector); List<int> finisherIds = new List<int>(); foreach (IElement elem in elems) { string url = elem.GetAttribute("href"); string strId = Regex.Match(url, @"\d+").Value; finisherIds.Add(Int32.Parse(strId)); } return finisherIds; } private int GetRunnerId(IElement runnerElem) { var selector = "[href^='/racing/profiles/horse/']"; IElement urlElem = runnerElem.QuerySelector(selector); string url = urlElem.GetAttribute("href"); string strId = Regex.Match(url, @"\d+").Value; return Int32.Parse(strId); } private bool IsWeighedIn(IDocument lastRaceDocument) { var selector = "[class^='RacingRacecardSummary__StyledEndedState']"; var element = ScrapeTextContent(lastRaceDocument, selector); if (!String.IsNullOrEmpty(element) && element.ToLower().Contains("weighed in")) { return true; } else { return false; } } private string ScrapeLastCourse(IDocument lastRaceDocument) { var selector = "[class^='CourseListingHeader__StyledMainTitle']"; const String rx = "\\d{2}:\\d{2}\\s+(.+)"; var course = ScrapeStringFromTextContent(lastRaceDocument, selector, rx); return course; } private string ScrapeLastAnalysis(IDocument lastRaceDocument, int position) { var entrantElements = ScrapeResultRunnerElements(lastRaceDocument); var selector = "[data-test-id='ride-description']"; var textContent = ScrapeTextContent(entrantElements[position - 1], selector); return textContent; } private String ScrapeLastWinningTime(IDocument lastRaceDocument) { var selector = "[class^='RacingRacecardSummary']"; IHtmlCollection<IElement> elems = lastRaceDocument.QuerySelectorAll(selector); var winTime = ""; foreach (var elem in elems) { if (!elem.TextContent.ToLower().Contains("winning time")) { continue; } winTime = elem.TextContent .Split(':').ElementAt(3) .Trim(); } return winTime; } private String ScrapeLastClass(IDocument lastRaceDocument) { //1) Ireland, France: 1m 2f 150y | Standard | 13 Runners | Polytrack //2) UK : Class 1 | 2m 4f 10y | 7 Runners | Turf //3) 2m 2f | 23 Runners | Turf //4) Class 5 | 1m 2f 42y | Standard / Slow | 11 Runners | Allweather // If Class in 1st column, type 2), else type 1) // Virgin Bet Cotswold Chase (Grade 2) (GBB Race) // Grade is now in race title for Class 1 races String classInfo = ""; var classSelector = "div > [class^='RacingRacecardSummary__StyledAdditionalInfo-']"; String summary = ScrapeTextContent(lastRaceDocument, classSelector); // check class String rx = "Class (\\d)"; int raceClass = ScrapeIntFromTextContent(lastRaceDocument, classSelector, rx); classInfo = "C" + raceClass; if (raceClass < 1) { return ""; } else if (raceClass > 1) { return classInfo; } else if (raceClass.Equals(1)) { rx = "\\(Grade (\\d)\\)"; int grade = ScrapeIntFromTextContent(lastRaceDocument.DocumentElement, classSelector, rx); if (grade.Equals(-1)) { if (summary.Contains("(Listed)")) { return classInfo + " Listed"; } } else { return classInfo + " G" + grade; } } return classInfo; } private String ScrapeResultWinPrize(IDocument lastRaceDocument) { var selector = "[class^='PrizeMoney__Prize-']:nth-of-type(1) > span:nth-of-type(2)"; var prize = ScrapeTextContent(lastRaceDocument, selector); return prize; } private String ScrapeLastOdds(IDocument lastRaceDocument, int position) { var entrantElements = ScrapeResultRunnerElements(lastRaceDocument); var selector = "[class^='BetLink'] span"; var odds = ScrapeTextContent(entrantElements[position - 1], selector); return odds; } private string ScrapeLastWeight(IDocument lastRaceDocument, int position) { var entrantElements = ScrapeResultRunnerElements(lastRaceDocument); var selector = "[data-test-id='horse-sub-info'] span:nth-child(2)"; var weight = ScrapeTextContent(entrantElements[position - 1], selector); return weight; } private static IHtmlCollection<IElement> ScrapeResultRunnerElements(IDocument document) { var selector = "[class^='ResultRunner__StyledResultRunnerWrapper']"; return document.QuerySelectorAll(selector); } private double ScrapeBeatenLengths(IDocument lastRaceDocument, int position, int horseId) { // winner has no beaten lengths if (position == 1) return 0; List<int> finisherIds = GetAllFinisherIds(lastRaceDocument); if (!finisherIds.Contains(horseId)) { return -1; } IHtmlCollection<IElement> runnerElements = ScrapeResultRunnerElements(lastRaceDocument); if (runnerElements.Length == 0) { log.Error(String.Format("0 entrants found in : {0}", HtmlService.GetCanonicalUrl(lastRaceDocument))); return -1; } // Sum the finisher distances up to and including the target horseId double sumDistance = 0.0; // start at i = 1 to skip the winner who has no beaten dist for (int i = 1; i < runnerElements.Length; i++) { IElement elem = runnerElements.ElementAt(i); var distSelector = "[class^='StyledRaceCardsWrapper']:nth-of-type(1) [class^='ResultRunner__StyledFinishDistance']"; string strDist = ScrapeTextContent(elem, distSelector); if (String.IsNullOrEmpty(strDist)) { log.Error(String.Format("No distance found in element : i:{0}, selector:{1} url{2} : ", i, distSelector, lastRaceDocument.Url)); return -1; } var currentDistance = Distance.ConvertLengthsToDouble(strDist); sumDistance += currentDistance; log.Debug(String.Format("sum distance: idx:{0} strCur:{1} cur:{2} sum:{3}", i, strDist, currentDistance, sumDistance)); int curHorseId = GetRunnerId(elem); if (curHorseId == horseId) { break; } } return sumDistance; } private List<String> GetNonRunnerNames(IDocument lastRaceDocument) { var selector = "[id='nonrunners'] [data-test-id='runner-horse-name']"; IHtmlCollection<IElement> elems = lastRaceDocument.QuerySelectorAll(selector); List<String> nonRunnerNames = new List<String>(); foreach (var elem in elems) { var textContent = elem.TextContent; } return nonRunnerNames; } private List<int> GetNonRunnerClothNos(IDocument lastRaceDocument) { var selector = "[id='nonrunners'] [data-test-id='runner-cloth-number']"; IHtmlCollection<IElement> elems = lastRaceDocument.QuerySelectorAll(selector); List<int> nonRunnerClothNos = new List<int>(); foreach (var elem in elems) { var textContent = elem.TextContent; if (textContent != null) { Regex rx = new Regex("(\\d+)"); Match match = rx.Match(textContent); if (match.Success) { int clothNo; bool res = int.TryParse(match.Groups[1].Value, out clothNo); if (res == true) { nonRunnerClothNos.Add(clothNo); } } } } return nonRunnerClothNos; } private bool IsNonRunner(IElement element, List<int> nonRunnerClothNos) { const String select = "span.hr-racing-nonrunner-position-no"; var textContent = ScrapeTextContent(element, select); if (!String.IsNullOrEmpty(textContent)) { return true; } else { return false; } } String ScrapeLastPositionInField(IElement element) { var selector = "[data-test-id='profile-table'] tr:nth-of-type(1) > td:nth-of-type(2)"; var textContent = ScrapeTextContent(element, selector); return textContent; } int ScrapeLastPosition(IElement element) { var selector = "[data-test-id='profile-table'] tr:nth-of-type(1) > td:nth-of-type(2)"; const String rx = "(.+)/.+"; var pos = ScrapeIntFromTextContent(element, selector, rx); return pos; } String ScrapeLastDistance(IDocument document) { var selector = "[class^='RacingRacecardSummary__StyledAdditionalInfo']"; var textContent = ScrapeTextContent(document, selector); var distance = textContent .Split('|').ElementAt(1) .Trim(); return distance; } private string ScrapeLastGoing(IDocument document) { var selector = "[class^='RacingRacecardSummary__StyledAdditionalInfo']"; var textContent = ScrapeTextContent(document, selector); var going = textContent .Split('|').ElementAt(2) .Trim(); return going; } } }
36.303309
148
0.509595
[ "MIT" ]
cjsheehan/race-analyser
RacingWebScraper/SportingLife/ScrapeLastRace.cs
19,751
C#
using Xamarin.Forms; using Xamarin.Forms.PlatformConfiguration; using Xamarin.Forms.PlatformConfiguration.iOSSpecific; using Xamarin.Forms.Xaml; namespace Sample.Views { [XamlCompilation(XamlCompilationOptions.Compile)] public partial class LottieViewsPage : ContentPage, IBindablePage { public LottieViewsPage() { InitializeComponent(); ResourcesHelper.SetSublimeGameMode(); } protected override void OnAppearing() { base.OnAppearing(); var safeInsets = On<iOS>().SafeAreaInsets(); safeInsets.Bottom = 0; Padding = safeInsets; } } }
24.962963
69
0.64095
[ "MIT" ]
danielMd2805/Sharpnado.TaskLoaderView
Retronado/Sample/Views/LottieViewsPage.xaml.cs
676
C#
using System; using System.Collections.Generic; using System.Runtime.Serialization; using Elasticsearch.Net.Utf8Json; namespace Nest { /// <summary> /// An analyzer of type custom that allows to combine a Tokenizer with zero or more Token Filters, /// and zero or more Char Filters. /// <para> /// The custom analyzer accepts a logical/registered name of the tokenizer to use, and a list of /// logical/registered names of token filters. /// </para> /// </summary> public interface ICustomAnalyzer : IAnalyzer { /// <summary> /// The logical / registered name of the tokenizer to use. /// </summary> [DataMember(Name ="char_filter")] [JsonFormatter(typeof(SingleOrEnumerableFormatter<string>))] IEnumerable<string> CharFilter { get; set; } /// <summary> /// An optional list of logical / registered name of token filters. /// </summary> [DataMember(Name ="filter")] [JsonFormatter(typeof(SingleOrEnumerableFormatter<string>))] IEnumerable<string> Filter { get; set; } /// <summary> /// An optional number of positions to increment between each field value of a /// field using this analyzer. /// <para /> /// Deprecated, use <see cref="PositionIncrementGap"/> /// </summary> [Obsolete("Deprecated, use PositionIncrementGap instead")] [DataMember(Name ="position_offset_gap")] [JsonFormatter(typeof(NullableStringIntFormatter))] int? PositionOffsetGap { get; set; } /// <summary> /// When indexing an array of text values, Elasticsearch inserts a fake "gap" between the last term of one value /// and the first term of the next value to ensure that a phrase query doesn’t match two terms from different array elements. /// Defaults to 100. /// </summary> [DataMember(Name ="position_increment_gap")] [JsonFormatter(typeof(NullableStringIntFormatter))] int? PositionIncrementGap { get; set; } /// <summary> /// An optional list of logical / registered name of char filters. /// </summary> [DataMember(Name ="tokenizer")] string Tokenizer { get; set; } } public class CustomAnalyzer : AnalyzerBase, ICustomAnalyzer { public CustomAnalyzer() : base("custom") { } /// <inheritdoc /> public IEnumerable<string> CharFilter { get; set; } /// <inheritdoc /> public IEnumerable<string> Filter { get; set; } /// <inheritdoc /> [Obsolete("Deprecated, use PositionIncrementGap instead")] public int? PositionOffsetGap { get; set; } /// <inheritdoc /> public int? PositionIncrementGap { get; set; } /// <inheritdoc /> public string Tokenizer { get; set; } } public class CustomAnalyzerDescriptor : AnalyzerDescriptorBase<CustomAnalyzerDescriptor, ICustomAnalyzer>, ICustomAnalyzer { protected override string Type => "custom"; IEnumerable<string> ICustomAnalyzer.CharFilter { get; set; } IEnumerable<string> ICustomAnalyzer.Filter { get; set; } int? ICustomAnalyzer.PositionOffsetGap { get; set; } int? ICustomAnalyzer.PositionIncrementGap { get; set; } string ICustomAnalyzer.Tokenizer { get; set; } /// <inheritdoc /> public CustomAnalyzerDescriptor Filters(params string[] filters) => Assign(filters, (a, v) => a.Filter = v); /// <inheritdoc /> public CustomAnalyzerDescriptor Filters(IEnumerable<string> filters) => Assign(filters, (a, v) => a.Filter = v); /// <inheritdoc /> public CustomAnalyzerDescriptor CharFilters(params string[] charFilters) => Assign(charFilters, (a, v) => a.CharFilter = v); /// <inheritdoc /> public CustomAnalyzerDescriptor CharFilters(IEnumerable<string> charFilters) => Assign(charFilters, (a, v) => a.CharFilter = v); /// <inheritdoc /> public CustomAnalyzerDescriptor Tokenizer(string tokenizer) => Assign(tokenizer, (a, v) => a.Tokenizer = v); /// <inheritdoc /> [Obsolete("Deprecated, use PositionIncrementGap instead")] public CustomAnalyzerDescriptor PositionOffsetGap(int? positionOffsetGap) => Assign(positionOffsetGap, (a, v) => a.PositionOffsetGap = v); /// <inheritdoc /> public CustomAnalyzerDescriptor PositionIncrementGap(int? positionIncrementGap) => Assign(positionIncrementGap, (a, v) => a.PositionIncrementGap = v); } }
35.689655
130
0.710145
[ "Apache-2.0" ]
adamralph/elasticsearch-net
src/Nest/Analysis/Analyzers/CustomAnalyzer.cs
4,144
C#
using System; using System.IO; using System.Collections.Generic; using System.Threading.Tasks; using Nancy; using SwaggerPlayground.Common; using FluentValidation; namespace PetStoreApp.PetStore { public partial class CreateUserRequest { public User Body {get; set; } public override bool Equals(object obj) { return obj is CreateUserRequest && obj.GetHashCode() == GetHashCode(); } public override int GetHashCode() { unchecked { var hashCode = nameof(CreateUserRequest).GetHashCode(); if(default != Body) hashCode = (hashCode * 397) ^ Body.GetHashCode(); return hashCode; } } } public class CreateUserRequestValidator : AbstractValidator<CreateUserRequest> { public CreateUserRequestValidator() { } } }
20.044444
85
0.611973
[ "Apache-2.0" ]
thomasraynal/SwaggerPlayground
PetStore/PetStore/_Generated/Request/CreateUserRequest.generated.cs
902
C#
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Globalization; using Microsoft.AspNetCore.Analyzer.Testing; namespace Microsoft.AspNetCore.Analyzers.RouteHandlers; public partial class DisallowMvcBindArgumentsOnParametersTest { private TestDiagnosticAnalyzerRunner Runner { get; } = new(new RouteHandlerAnalyzer()); [Fact] public async Task MinimalAction_WithoutBindAttributes_Works() { // Arrange var source = @" using Microsoft.AspNetCore.Builder; var webApp = WebApplication.Create(); webApp.MapGet(""/"", (string name) => {}); "; // Act var diagnostics = await Runner.GetDiagnosticsAsync(source); // Assert Assert.Empty(diagnostics); } [Fact] public async Task MinimalAction_WithAllowedMvcAttributes_Works() { // Arrange var source = @" using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Mvc; var webApp = WebApplication.Create(); webApp.MapGet(""/{id}"", ([FromBody] string name, [FromRoute] int id, [FromQuery] int age) => {}); "; // Act var diagnostics = await Runner.GetDiagnosticsAsync(source); // Assert Assert.Empty(diagnostics); } [Fact] public async Task MinimalAction_Lambda_WithBindAttributes_ProducesDiagnostics() { // Arrange var source = TestSource.Read(@" using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Mvc; var webApp = WebApplication.Create(); webApp.MapGet(""/"", (/*MM*/[Bind] string name) => {}); "); // Act var diagnostics = await Runner.GetDiagnosticsAsync(source.Source); // Assert var diagnostic = Assert.Single(diagnostics); Assert.Same(DiagnosticDescriptors.DoNotUseModelBindingAttributesOnRouteHandlerParameters, diagnostic.Descriptor); AnalyzerAssert.DiagnosticLocation(source.DefaultMarkerLocation, diagnostic.Location); Assert.Equal("BindAttribute should not be specified for a MapGet Delegate parameter", diagnostic.GetMessage(CultureInfo.InvariantCulture)); } [Fact] public async Task MinimalAction_MethodReference_WithBindAttributes_ProducesDiagnostics() { // Arrange var source = TestSource.Read(@" using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Mvc; var webApp = WebApplication.Create(); webApp.MapPost(""/"", PostWithBind); static void PostWithBind(/*MM*/[ModelBinder] string name) {} "); // Act var diagnostics = await Runner.GetDiagnosticsAsync(source.Source); // Assert var diagnostic = Assert.Single(diagnostics); Assert.Same(DiagnosticDescriptors.DoNotUseModelBindingAttributesOnRouteHandlerParameters, diagnostic.Descriptor); AnalyzerAssert.DiagnosticLocation(source.DefaultMarkerLocation, diagnostic.Location); Assert.Equal("ModelBinderAttribute should not be specified for a MapPost Delegate parameter", diagnostic.GetMessage(CultureInfo.InvariantCulture)); } }
34.573034
155
0.714982
[ "MIT" ]
3ejki/aspnetcore
src/Framework/AspNetCoreAnalyzers/test/RouteHandlers/DisallowMvcBindArgumentsOnParametersTest.cs
3,077
C#
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. namespace StyleCop.Analyzers.Test.CSharp9.MaintainabilityRules { using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.Testing; using StyleCop.Analyzers.Test.CSharp8.MaintainabilityRules; using Xunit; using static StyleCop.Analyzers.Test.Verifiers.StyleCopCodeFixVerifier< StyleCop.Analyzers.MaintainabilityRules.SA1119StatementMustNotUseUnnecessaryParenthesis, StyleCop.Analyzers.MaintainabilityRules.SA1119CodeFixProvider>; public class SA1119CSharp9UnitTests : SA1119CSharp8UnitTests { /// <summary> /// Verifies that a type cast followed by a <c>with</c> expression is handled correctly. /// </summary> /// <returns>A <see cref="Task"/> representing the asynchronous unit test.</returns> [Fact] [WorkItem(3239, "https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/3239")] public async Task TestTypeCastFollowedByWithExpressionIsHandledCorrectlyAsync() { const string testCode = @" record Foo(int Value) { public object TestMethod(Foo n, int a) { return (object)(n with { Value = a }); } } "; await new CSharpTest(LanguageVersion.CSharp9) { ReferenceAssemblies = ReferenceAssemblies.Net.Net50, TestCode = testCode, }.RunAsync(CancellationToken.None).ConfigureAwait(false); } /// <summary> /// Verifies that a type cast followed by a <c>with</c> expression with unnecessary parentheses is handled /// correctly. /// </summary> /// <returns>A <see cref="Task"/> representing the asynchronous unit test.</returns> [Fact] [WorkItem(3239, "https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/3239")] public async Task TestTypeCastFollowedByWithExpressionWithUnnecessaryParenthesesIsHandledCorrectlyAsync() { const string testCode = @" record Foo(int Value) { public object TestMethod(Foo n, int a) { return (object){|#0:{|#1:(|}(n with { Value = a }){|#2:)|}|}; } } "; const string fixedCode = @" record Foo(int Value) { public object TestMethod(Foo n, int a) { return (object)(n with { Value = a }); } } "; await new CSharpTest(LanguageVersion.CSharp9) { ReferenceAssemblies = ReferenceAssemblies.Net.Net50, TestCode = testCode, ExpectedDiagnostics = { Diagnostic(DiagnosticId).WithLocation(0), Diagnostic(ParenthesesDiagnosticId).WithLocation(1), Diagnostic(ParenthesesDiagnosticId).WithLocation(2), }, FixedCode = fixedCode, }.RunAsync(CancellationToken.None).ConfigureAwait(false); } /// <summary> /// Verifies that a <c>with</c> expression with unnecessary parentheses is handled correcly. /// </summary> /// <returns>A <see cref="Task"/> representing the asynchronous unit test.</returns> [Fact] [WorkItem(3239, "https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/3239")] public async Task TestWithExpressionWithUnnecessaryParenthesesAsync() { const string testCode = @" record Foo(int Value) { public void TestMethod(Foo n, int a) { var test = {|#0:{|#1:(|}n with { Value = a }{|#2:)|}|}; } } "; const string fixedCode = @" record Foo(int Value) { public void TestMethod(Foo n, int a) { var test = n with { Value = a }; } } "; await new CSharpTest(LanguageVersion.CSharp9) { ReferenceAssemblies = ReferenceAssemblies.Net.Net50, TestCode = testCode, ExpectedDiagnostics = { Diagnostic(DiagnosticId).WithLocation(0), Diagnostic(ParenthesesDiagnosticId).WithLocation(1), Diagnostic(ParenthesesDiagnosticId).WithLocation(2), }, FixedCode = fixedCode, }.RunAsync(CancellationToken.None).ConfigureAwait(false); } [Theory] [InlineData(".ToString()")] [InlineData("?.ToString()")] [InlineData("[0]")] [InlineData("?[0]")] [WorkItem(3239, "https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/3239")] public async Task TestWithExpressionFollowedByDereferenceAsync(string operation) { string testCode = $@" record Foo(int Value) {{ public object this[int index] => null; public object TestMethod(Foo n, int a) {{ return (n with {{ Value = a }}){operation}; }} }} "; await new CSharpTest(LanguageVersion.CSharp9) { ReferenceAssemblies = ReferenceAssemblies.Net.Net50, TestCode = testCode, }.RunAsync(CancellationToken.None).ConfigureAwait(false); } } }
33.903846
114
0.607865
[ "MIT" ]
AraHaan/StyleCopAnalyzers
StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp9/MaintainabilityRules/SA1119CSharp9UnitTests.cs
5,291
C#
using System.Linq; using RaftCore.Models; using TinyFp.Extensions; using static RaftCore.Node.LogRequestChecks; using static RaftCore.Node.Checks; using static RaftCore.Utils; using static RaftCore.Constants.Logs; namespace RaftCore.Node { public partial class Agent { public Status AppendEntries(LogRequestMessage message, Status status) => TruncateLog(message, status) .Map(s => AppendNewEntries(message, s)) .Map(s => NotifyApplication(message, s)); private Status TruncateLog(LogRequestMessage message, Status status) => IsEntriesLogLengthOk(message, status) .Bind(_ => IsEntriesTermNotOk(message, _)) .Match(_ => _.Map(s => new Status { CurrentTerm = s.CurrentTerm, VotedFor = s.VotedFor, Log = s.Log.Take(message.LogLength).ToArray(), CommitLenght = s.CommitLenght, CurrentRole = s.CurrentRole, CurrentLeader = s.CurrentLeader, VotesReceived = s.VotesReceived, SentLength = s.SentLength, AckedLength = s.AckedLength }) .Tee(s => _status = s) .Tee(s => _logger.Information(LOG_TRUNCATED)), _ => status); private Status AppendNewEntries(LogRequestMessage message, Status status) => AreThereEntriesToAdd(message, status) .Match(_ => _.Map(s => new Status { CurrentTerm = s.CurrentTerm, VotedFor = s.VotedFor, Log = s.Log.Concat(message.Entries).ToArray(), CommitLenght = s.CommitLenght, CurrentRole = s.CurrentRole, CurrentLeader = s.CurrentLeader, VotesReceived = s.VotesReceived, SentLength = s.SentLength, AckedLength = s.AckedLength }) .Tee(s => _status = s) .Tee(s => _logger.Information(LOG_APPEND_ENTRIES)), _ => status); private Status NotifyApplication(LogRequestMessage message, Status status) => AreThereUncommitedMessages(message, status) .Match(_ => _.Tee(s => s.Log .TakeLast(message.CommitLength - status.CommitLenght) .ForEach(log => _application.NotifyMessage(log.Message))) .Map(s => new Status { CurrentTerm = s.CurrentTerm, VotedFor = s.VotedFor, Log = s.Log, CommitLenght = message.CommitLength, CurrentRole = s.CurrentRole, CurrentLeader = s.CurrentLeader, VotesReceived = s.VotesReceived, SentLength = s.SentLength, AckedLength = s.AckedLength }) .Tee(s => _status = s) .Tee(s => _logger.Information(NOTIFY_TO_APPLICATION)), _ => status); public Status ReplicateLog(Status status, int follower) => status.SentLength[follower] .Map(length => (Length: length, PrevLogTerm: length > 0 ? status.Log[length - 1].Term : 0)) .Tee(_ => _cluster.SendMessage(follower, new LogRequestMessage { Type = MessageType.LogRequest, LeaderId = _nodeConfiguration.Id, Term = status.CurrentTerm, LogLength = _.Length, LogTerm = _.PrevLogTerm, CommitLength = status.CommitLenght, Entries = status.Log.TakeLast(status.Log.Length - status.SentLength[follower] - 1).ToArray() })) .Map(_ => status); public Status CommitLogEntries(Status status) => Enumerable .Range(1, status.Log.Length) .Filter(index => HasQuorum(status, index)) .ToArray() .ToOption(_ => _.Length == 0) .Map(_ => _.Max()) .Match( ready => IsApplicationToBeNotified(status, ready) .Match(desc => NotifyToApplication(desc, ready), _ => status), () => status ); private bool HasQuorum(Status status, int index) => status .AckedLength .Filter(ack => ack.Value >= index) .Count() >= GetQuorum(_cluster); private Status NotifyToApplication(Status status, int ready) => Enumerable .Range(status.CommitLenght, ready - status.CommitLenght) .ForEach(_ => _application.NotifyMessage(status.Log[_].Message)) .Map(_ => status) .Map(s => new Status { CurrentTerm = s.CurrentTerm, VotedFor = s.VotedFor, Log = s.Log, CommitLenght = ready, CurrentRole = s.CurrentRole, CurrentLeader = s.CurrentLeader, VotesReceived = s.VotesReceived, SentLength = s.SentLength, AckedLength = s.AckedLength }) .Tee(s => _status = s); } }
48.053846
113
0.444213
[ "MIT" ]
FrancoMelandri/raft
src/core/Node/Agent/Agent.Core.cs
6,249
C#
/* * Copyright 2010-2014 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 cloudfront-2019-03-26.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.CloudFront.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; namespace Amazon.CloudFront.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for ListDistributionsByWebACLId operation /// </summary> public class ListDistributionsByWebACLIdResponseUnmarshaller : XmlResponseUnmarshaller { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) { ListDistributionsByWebACLIdResponse response = new ListDistributionsByWebACLIdResponse(); UnmarshallResult(context,response); return response; } private static void UnmarshallResult(XmlUnmarshallerContext context, ListDistributionsByWebACLIdResponse response) { int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; while (context.Read()) { if (context.IsStartElement || context.IsAttribute) { if (context.TestExpression("DistributionList", targetDepth)) { var unmarshaller = DistributionListUnmarshaller.Instance; response.DistributionList = unmarshaller.Unmarshall(context); continue; } } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { return; } } return; } /// <summary> /// Unmarshaller error response to exception. /// </summary> /// <param name="context"></param> /// <param name="innerException"></param> /// <param name="statusCode"></param> /// <returns></returns> public override AmazonServiceException UnmarshallException(XmlUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { ErrorResponse errorResponse = ErrorResponseUnmarshaller.GetInstance().Unmarshall(context); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; var responseBodyBytes = context.GetResponseBodyBytes(); using (var streamCopy = new MemoryStream(responseBodyBytes)) using (var contextCopy = new XmlUnmarshallerContext(streamCopy, false, null)) { if (errorResponse.Code != null && errorResponse.Code.Equals("InvalidArgument")) { return InvalidArgumentExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InvalidWebACLId")) { return InvalidWebACLIdExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonCloudFrontException(errorResponse.Message, innerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, statusCode); } private static ListDistributionsByWebACLIdResponseUnmarshaller _instance = new ListDistributionsByWebACLIdResponseUnmarshaller(); internal static ListDistributionsByWebACLIdResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static ListDistributionsByWebACLIdResponseUnmarshaller Instance { get { return _instance; } } } }
38.039063
165
0.633806
[ "Apache-2.0" ]
JeffAshton/aws-sdk-net
sdk/src/Services/CloudFront/Generated/Model/Internal/MarshallTransformations/ListDistributionsByWebACLIdResponseUnmarshaller.cs
4,869
C#
using LiveClientDesktop.Enums; namespace LiveClientDesktop.Models { public class SwitchDemonstrationSceneContext { public SceneType Source { get; set; } public DemonstratioType SceneType { get; set; } public object UseDevice { get; set; } } }
21.692308
55
0.680851
[ "MIT" ]
schifflee/LiveClient
LiveClientDesktop/Models/SwitchDemonstrationSceneContext.cs
284
C#
using System; using System.IO; using System.Text; using Microsoft.TemplateEngine.Abstractions; using Microsoft.TemplateEngine.Core.Contracts; using Microsoft.TemplateEngine.TestHelper; using Microsoft.TemplateEngine.Utils; using Xunit; namespace Microsoft.TemplateEngine.Core.UnitTests { public abstract class TestBase { protected TestBase() { ITemplateEngineHost host = new TestHost { HostIdentifier = "TestRunner", Version = "1.0.0.0", }; EnvironmentSettings = new EngineEnvironmentSettings(host, s => null); string home = "%USERPROFILE%"; if (Path.DirectorySeparatorChar == '/') { home = "%HOME%"; } host.VirtualizeDirectory(Environment.ExpandEnvironmentVariables($"{home}/.templateengine")); } protected IEngineEnvironmentSettings EnvironmentSettings { get; } protected static void RunAndVerify(string originalValue, string expectedValue, IProcessor processor, int bufferSize, bool? changeOverride = null) { byte[] valueBytes = Encoding.UTF8.GetBytes(originalValue); MemoryStream input = new MemoryStream(valueBytes); MemoryStream output = new MemoryStream(); bool changed = processor.Run(input, output, bufferSize); Verify(Encoding.UTF8, output, changed, originalValue, expectedValue, changeOverride); } protected static void Verify(Encoding encoding, Stream output, bool changed, string source, string expected, bool? changeOverride = null) { output.Position = 0; byte[] resultBytes = new byte[output.Length]; output.Read(resultBytes, 0, resultBytes.Length); string actual = encoding.GetString(resultBytes); Assert.Equal(expected, actual); bool expectedChange = changeOverride ?? !string.Equals(expected, source, StringComparison.Ordinal); string modifier = expectedChange ? "" : "not "; if (expectedChange ^ changed) { Assert.False(true, $"Expected value to {modifier} be changed"); } } } }
36.901639
153
0.628165
[ "MIT" ]
ajeckmans/templating
test/Microsoft.TemplateEngine.Core.UnitTests/TestBase.cs
2,253
C#
using System; using System.Collections.Generic; using System.Threading.Tasks; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace BoatTrackerBot.Tests { [TestClass] public class TestIntentCheckReservations { [ClassInitialize] public static void Initialize(TestContext context) { TestRunner.EnsureAllReservationsCleared(context).Wait(); var steps = new List<BotTestCase>(); steps.AddRange(TestUtils.SignOut()); // // Make a couple of reservations // steps.AddRange(TestUtils.SignIn(TestUtils.User4)); steps.AddRange(TestUtils.CreateTestReservations()); steps.AddRange(TestUtils.SignOut()); TestRunner.RunTestCases(steps, null, 0).Wait(); } [ClassCleanup] public static void Cleanup() { TestRunner.EnsureAllReservationsCleared(General.testContext).Wait(); } [TestMethod] public async Task CheckReservations() { var steps = new List<BotTestCase>(); steps.AddRange(TestUtils.SignOut()); steps.AddRange(TestUtils.SignIn(TestUtils.User4)); steps.Add(new BotTestCase { Action = "show my reservations", ExpectedReply = "I found the following reservations for you:", Verified = (reply) => { reply = reply.ToLower(); Assert.IsTrue(reply.Contains("9:00 am pinta (2 hours)"), "Pinta reservation missing"); Assert.IsTrue(reply.Contains("2:00 pm santa maria w/ test user2 (2 hours)"), "Santa Maria reservation missing"); } }); steps.Add(new BotTestCase { Action = "show my reservations for next friday", ExpectedReply = "I found the following reservations for you on ", Verified = (reply) => { reply = reply.ToLower(); Assert.IsTrue(reply.Contains("9:00 am pinta (2 hours)"), "Pinta reservation missing"); Assert.IsTrue(reply.Contains("2:00 pm santa maria w/ test user2 (2 hours)"), "Santa Maria reservation missing"); } }); steps.Add(new BotTestCase { Action = "show my reservations for next thursday", ExpectedReply = "I don't see any reservations for you on" }); steps.Add(new BotTestCase { Action = "show reservations for the pinta", ExpectedReply = "I found the following reservation for the Pinta:", Verified = (reply) => { reply = reply.ToLower(); Assert.IsTrue(reply.Contains("9:00 am pinta (2 hours)"), "Pinta reservation missing"); } }); steps.Add(new BotTestCase { Action = "show reservations for the pinta next friday", ExpectedReply = "I found the following reservation for the Pinta on", Verified = (reply) => { reply = reply.ToLower(); Assert.IsTrue(reply.Contains("9:00 am pinta (2 hours)"), "Pinta reservation missing"); } }); steps.Add(new BotTestCase { Action = "show my reservations for the pinta next thursday", ExpectedReply = "I don't see any reservations for the Pinta on" }); steps.AddRange(TestUtils.SignOut()); await TestRunner.RunTestCases(steps, null, 0); } } }
35.259259
132
0.531775
[ "MIT" ]
CrewNerd/BoatTracker
src/BoatTrackerBot.Tests/TestIntentCheckReservations.cs
3,810
C#
using System; namespace cloudscribe.Core.Models { public interface IUserToken { Guid SiteId { get; set; } Guid UserId { get; set; } string LoginProvider { get; set; } string Name { get; set; } string Value { get; set; } } }
19.857143
42
0.561151
[ "Apache-2.0" ]
4L4M1N/cloudscribe
src/cloudscribe.Core.Models/Identity/IUserToken.cs
280
C#
//----------------------------------------------------------------------- // <copyright file="CslaPrincipal.cs" company="Marimer LLC"> // Copyright (c) Marimer LLC. All rights reserved. // Website: http://www.lhotka.net/cslanet/ // </copyright> // <summary>Base class from which custom principal</summary> //----------------------------------------------------------------------- using System; using System.Security.Principal; using Csla.Serialization.Mobile; namespace Csla.Security { /// <summary> /// Base class from which custom principal /// objects should inherit to operate /// properly with the data portal. /// </summary> [Serializable()] public class CslaPrincipal : Csla.Core.MobileObject, IPrincipal, ICslaPrincipal { private IIdentity _identity; /// <summary> /// Creates an instance of the object. /// </summary> protected CslaPrincipal() { _identity = new UnauthenticatedIdentity(); } /// <summary> /// Returns the user's identity object. /// </summary> public virtual IIdentity Identity { get { return _identity; } } /// <summary> /// Returns a value indicating whether the /// user is in a given role. /// </summary> /// <param name="role">Name of the role.</param> public virtual bool IsInRole(string role) { var check = _identity as ICheckRoles; if (check != null) return check.IsInRole(role); else return false; } /// <summary> /// Creates an instance of the object. /// </summary> /// <param name="identity">Identity object for the user.</param> protected CslaPrincipal(IIdentity identity) { _identity = identity; } /// <summary> /// Override this method to get custom field values /// from the serialization stream. /// </summary> /// <param name="info">Serialization info.</param> /// <param name="mode">Serialization mode.</param> protected override void OnGetState(Csla.Serialization.Mobile.SerializationInfo info, Csla.Core.StateMode mode) { info.AddValue("CslaPrincipal.Identity", MobileFormatter.Serialize(_identity)); base.OnGetState(info, mode); } /// <summary> /// Override this method to set custom field values /// ito the serialization stream. /// </summary> /// <param name="info">Serialization info.</param> /// <param name="mode">Serialization mode.</param> protected override void OnSetState(Csla.Serialization.Mobile.SerializationInfo info, Csla.Core.StateMode mode) { base.OnSetState(info, mode); _identity = (IIdentity)MobileFormatter.Deserialize(info.GetValue<byte[]>("CslaPrincipal.Identity")); } } }
32.404762
114
0.620132
[ "MIT" ]
angtianqiang/csla
Source/Csla.Shared/Security/CslaPrincipal.cs
2,722
C#
#region Copyright © 2020-2021 Vladimir Deryagin. 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. */ #endregion using MediatR; using MIS.Application.ViewModels; namespace MIS.Application.Queries { public class DateListItemsQuery : IRequest<DateItemViewModel[]> { public DateListItemsQuery(ResourceViewModel resource) { Resource = resource; } public ResourceViewModel Resource { get; } } }
29.34375
75
0.750799
[ "Apache-2.0" ]
jeydo6/MIS
MIS.Application/Queries/Date/ListItems/DateListItemsQuery.cs
942
C#
using System.Reflection; 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("AWSSDK.SimpleDB")] [assembly: AssemblyDescription("The Amazon Web Services SDK for .NET (3.5) - Amazon SimpleDB. Amazon SimpleDB is a highly available, scalable, and flexible non-relational data store that enables you to store and query data items using web services requests.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyProduct("Amazon Web Services SDK for .NET")] [assembly: AssemblyCompany("Amazon.com, Inc")] [assembly: AssemblyCopyright("Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.")] [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)] // 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("3.3")] [assembly: AssemblyFileVersion("3.7.0.60")]
47.5625
260
0.7523
[ "Apache-2.0" ]
ebattalio/aws-sdk-net
sdk/code-analysis/ServiceAnalysis/SimpleDB/Properties/AssemblyInfo.cs
1,522
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("03.PrintNumbers")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("03.PrintNumbers")] [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("bea3237d-31b5-4f4f-bc98-a04ac0511564")] // 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.918919
84
0.744833
[ "MIT" ]
TemplarRei/TelerikAcademy
CSharpOne/01.HomeWork.IntroToProgramming/03.PrintNumbers/Properties/AssemblyInfo.cs
1,406
C#
using CloudyMobile.Client; using DevHops.Maui.Services.Abstractions; using Microsoft.Maui.Controls; using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Input; namespace DevHops.Maui.ViewModels { public class SearchRecipeViewModel : BaseViewModel { private readonly IRecipeService recipeService; private readonly IBatchService batchService; public ObservableCollection<RecipeDto> Results { get; set; } = new ObservableCollection<RecipeDto>(); public string NameSearchTerm { get; set; } public string StyleSearchTerm { get; set; } public RecipeDto RecipeDetails { get; set; } public bool ShowRecipeDetails { get; set; } = false; public bool RecipeDetailsVisible { get; set; } = false; public ICommand SearchButtonCommand { get; set; } public ICommand ViewRecipeDetailsCommand { get; set; } public ICommand RecipeSelectedCommand { get; set; } public ICommand HideRecipeDetailsCommand { get; set; } public string ResultNames { get; set; } public SearchRecipeViewModel(IRecipeService recipeService, IBatchService batchService) { this.recipeService = recipeService; this.batchService = batchService; IsBusy = true; SearchButtonCommand = new Command(async () => await UpdateSearchResults()); ViewRecipeDetailsCommand = new Command<RecipeDto>((recipe) => ViewRecipeDetails(recipe)); HideRecipeDetailsCommand = new Command(() => { ShowRecipeDetails = false; OnPropertyChanged(nameof(ShowRecipeDetails)); }); RecipeSelectedCommand = new Command(async () => await RecipeSelected()); } public async Task UpdateSearchResults() { Console.WriteLine("Getting recipe search results"); IsBusy = true; OnPropertyChanged(nameof(IsBusy)); try { Results.Clear(); OnPropertyChanged(nameof(Results)); var results = await recipeService.SearchRecipes(NameSearchTerm, StyleSearchTerm); foreach(var rescipe in results.Recipes) { Results.Add(rescipe); ResultNames += $"{rescipe.Name}, "; Console.WriteLine($"Got recipe {rescipe.Name}"); } } catch (System.Exception ex) { Console.WriteLine("Failed to get recipes"); Console.WriteLine(ex.Message); } Console.WriteLine($"Got {Results.Count} recipes"); IsBusy = false; OnPropertyChanged(nameof(IsBusy)); OnPropertyChanged(nameof(Results)); OnPropertyChanged(nameof(ResultNames)); } public void ViewRecipeDetails(RecipeDto recipe) { Console.WriteLine($"Recipe {recipe.Name} tapped"); RecipeDetails = recipe; ShowRecipeDetails = true; RaisePropertyChanged(nameof(RecipeDetails), nameof(ShowRecipeDetails)); } public async Task RecipeSelected() { batchService.SelectedRecipe = RecipeDetails; MessagingCenter.Send<object>(this, "RecipeSelected"); await Navigation.PopAsync(); } } }
33.557692
135
0.616905
[ "MIT" ]
matt-goldman/2-gt4
src/MAUI/DevHops.Maui/DevHops.Maui/ViewModels/SearchRecipeViewModel.cs
3,492
C#
using Autofac; using Surging.Core.CPlatform.Support; using System.Linq; using Surging.Core.CPlatform.Routing; using Surging.Core.CPlatform.Address; using System.Threading.Tasks; using Surging.Core.ServiceHosting.Internal; using Surging.Core.CPlatform.Runtime.Server; using System.Net; using System.Net.NetworkInformation; using Microsoft.Extensions.Logging; using Surging.Core.CPlatform.Runtime.Client; using System; using Surging.Core.CPlatform.Configurations; using Surging.Core.CPlatform.Module; using System.Diagnostics; using Surging.Core.CPlatform.Engines; using Surging.Core.CPlatform.Utilities; using System.Collections.Generic; using Microsoft.Extensions.Configuration; using System.IO; using Surging.Core.CPlatform.Transport.Implementation; namespace Surging.Core.CPlatform { public static class ServiceHostBuilderExtensions { public static IServiceHostBuilder UseServer(this IServiceHostBuilder hostBuilder, string ip, int port, string token = "True") { return hostBuilder.MapServices(async mapper => { mapper.Resolve<IServiceTokenGenerator>().GeneratorToken(token); int _port = AppConfig.ServerOptions.Port = AppConfig.ServerOptions.Port == 0 ? port : AppConfig.ServerOptions.Port; string _ip = AppConfig.ServerOptions.Ip = AppConfig.ServerOptions.Ip ?? ip; _port = AppConfig.ServerOptions.Port = AppConfig.ServerOptions.IpEndpoint?.Port ?? _port; _ip = AppConfig.ServerOptions.Ip = AppConfig.ServerOptions.IpEndpoint?.Address.ToString() ?? _ip; _ip = NetUtils.GetHostAddress(_ip); mapper.Resolve<IModuleProvider>().Initialize(); if (!AppConfig.ServerOptions.DisableServiceRegistration) { await mapper.Resolve<IServiceCommandManager>().SetServiceCommandsAsync(); await ConfigureRoute(mapper); } var serviceHosts = mapper.Resolve<IList<Runtime.Server.IServiceHost>>(); Task.Factory.StartNew(async () => { foreach (var serviceHost in serviceHosts) await serviceHost.StartAsync(_ip, _port); mapper.Resolve<IServiceEngineLifetime>().NotifyStarted(); }).Wait(); }); } public static IServiceHostBuilder UseServer(this IServiceHostBuilder hostBuilder, Action<SurgingServerOptions> options) { var serverOptions = new SurgingServerOptions(); options.Invoke(serverOptions); AppConfig.ServerOptions = serverOptions; return hostBuilder.UseServer(serverOptions.Ip, serverOptions.Port, serverOptions.Token); } public static IServiceHostBuilder UseClient(this IServiceHostBuilder hostBuilder) { return hostBuilder.MapServices(mapper => { var serviceEntryManager = mapper.Resolve<IServiceEntryManager>(); var addressDescriptors = serviceEntryManager.GetEntries().Select(i => { i.Descriptor.Metadatas = null; return new ServiceSubscriber { Address = new[] { new IpAddressModel { Ip = Dns.GetHostEntry(Dns.GetHostName()) .AddressList.FirstOrDefault<IPAddress> (a => a.AddressFamily.ToString().Equals("InterNetwork")).ToString() } }, ServiceDescriptor = i.Descriptor }; }).ToList(); mapper.Resolve<IServiceSubscribeManager>().SetSubscribersAsync(addressDescriptors); mapper.Resolve<IModuleProvider>().Initialize(); }); } public static void BuildServiceEngine(IContainer container) { if (container.IsRegistered<IServiceEngine>()) { } } public static async Task ConfigureRoute(IContainer mapper) { if (AppConfig.ServerOptions.Protocol == CommunicationProtocol.Tcp || AppConfig.ServerOptions.Protocol == CommunicationProtocol.None) { var routeProvider = mapper.Resolve<IServiceRouteProvider>(); if (AppConfig.ServerOptions.EnableRouteWatch) new ServiceRouteWatch(mapper.Resolve<CPlatformContainer>(), async () => await routeProvider.RegisterRoutes( Math.Round(Convert.ToDecimal(Process.GetCurrentProcess().TotalProcessorTime.TotalSeconds), 2, MidpointRounding.AwayFromZero))); else await routeProvider.RegisterRoutes(0); } } } }
44.145455
151
0.623353
[ "MIT" ]
herryhxl/surging
src/Surging.Core/Surging.Core.CPlatform/ServiceHostBuilderExtensions.cs
4,858
C#
using MonkeyFinder.Model; using System; using System.Diagnostics; using System.Threading.Tasks; using Xamarin.Essentials; using Xamarin.Forms; namespace MonkeyFinder.ViewModel { public class MonkeyDetailsViewModel : BaseViewModel { public Command OpenMapCommand { get; } public MonkeyDetailsViewModel() { OpenMapCommand = new Command(async () => await OpenMapAsync()); } public MonkeyDetailsViewModel(Monkey monkey) : this() { Monkey = monkey; Title = $"{Monkey.Name} Details"; } Monkey monkey; public Monkey Monkey { get => monkey; set { if (monkey == value) return; monkey = value; OnPropertyChanged(); } } async Task OpenMapAsync() { try { await Map.OpenAsync(Monkey.Latitude, Monkey.Longitude); } catch (Exception ex) { Debug.WriteLine($"Unable to launch maps: {ex.Message}"); await Application.Current.MainPage.DisplayAlert("Error, no Maps app!", ex.Message, "OK"); } } } }
24.396226
105
0.511214
[ "MIT" ]
AzureAdvocateBit/xamarin.forms-workshop-1
Finish/MonkeyFinder/MonkeyFinder/ViewModel/MonkeyDetailsViewModel.cs
1,295
C#
// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using Bicep.Core.Json; using Bicep.RegistryModuleTool.Exceptions; using Bicep.RegistryModuleTool.ModuleFiles; using Bicep.RegistryModuleTool.Schemas; using Json.Schema; using Microsoft.Extensions.Logging; using System.Linq; using System.Text; using System.Text.Json; namespace Bicep.RegistryModuleTool.ModuleFileValidators { public sealed class JsonSchemaValidator : IModuleFileValidator { private const string AdditionalPropertiesSchemaLocationSuffix = "/additionalProperties/$false"; private const string RegexSchemaLocationSuffix = "/pattern"; private readonly ILogger logger; public JsonSchemaValidator(ILogger logger) { this.logger = logger; } public void Validate(MetadataFile file) => this.Validate(file.Path, JsonSchemaManager.MetadataSchema, file.RootElement); public void Validate(MainArmTemplateParametersFile file) => this.Validate(file.Path, JsonSchemaManager.ArmTemplateParametersSchema, file.RootElement); private void Validate(string filePath, JsonSchema schema, JsonElement element) { this.logger.LogDebug("Validating \"{FilePath}\" against JSON schema...", filePath); var results = schema.Validate(element, new ValidationOptions { OutputFormat = OutputFormat.Basic, // Indicates that all nodes will be listed as children of the top node. ValidateAs = Draft.Draft7 }); if (!results.IsValid) { var errorMessageBuilder = new StringBuilder(); errorMessageBuilder.AppendLine($"The file \"{filePath}\" is invalid:"); // TODO: enumerable. var invalidResults = results.NestedResults.Count == 0 ? new[] { results } : results.NestedResults; var shouldSkipAdditionalPropertyError = invalidResults.Any(x => !IsAdditionalPropertyError(x)); foreach (var result in invalidResults) { var isAdditionalPropertyError = IsAdditionalPropertyError(result); if (isAdditionalPropertyError && shouldSkipAdditionalPropertyError) { // According to the JSON schema spec, if any non-additional property is not valid, "properties" doesn't // generate any annotaion. As a result, "additionalProperties": false applies to all properties, which // creates additional property errors even for non-additional properties. To make it less confusing, // we skip additional property errors if there are other error types. // See https://github.com/gregsdennis/json-everything/issues/39#issuecomment-730116851 for details. continue; } errorMessageBuilder.Append(" "); errorMessageBuilder.Append(result.InstanceLocation.Source); errorMessageBuilder.Append(": "); if (isAdditionalPropertyError) { // The built-in error message is "All values fail against the false schema" which is not very intuitive. errorMessageBuilder.AppendLine("The property is not allowed"); // All errors are additional property errors. Only keep the first one as the others could be on the parent // properties which are triggered by the child property, e.g., an additional property /properties/foo/bar // can make /properties/foo fail against the "additionalProperties": false check if it is also declared on // the property foo. Technically this complies with what the spec defines and is what Json.Schema implements, // but it may confuse users. break; } else if (IsRegexError(result)) { // The built-in error message does not include the regex pattern. var schemaElement = JsonElementFactory.CreateElement(JsonSerializer.Serialize(schema)); var regex = result.SchemaLocation.Evaluate(schemaElement); errorMessageBuilder.AppendLine($"Value does not match the pattern of \"{regex}\""); } else { errorMessageBuilder.AppendLine(result.Message); } } throw new InvalidModuleFileException(errorMessageBuilder.ToString()); } } private static bool IsAdditionalPropertyError(ValidationResults results) => results.SchemaLocation.Source.EndsWith(AdditionalPropertiesSchemaLocationSuffix); private static bool IsRegexError(ValidationResults results) => results.SchemaLocation.Source.EndsWith(RegexSchemaLocationSuffix); } }
48.130841
158
0.61767
[ "MIT" ]
PedroC88/bicep
src/Bicep.RegistryModuleTool/ModuleFileValidators/JsonSchemaValidator.cs
5,150
C#
/* * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. * If a copy of the MPL was not distributed with this file, You can obtain one at * http://mozilla.org/MPL/2.0/. */ using System; using System.Collections.Generic; using System.Linq; using System.Text; using FSO.Content.Framework; using Microsoft.Xna.Framework.Graphics; using FSO.Content.Codecs; using System.Text.RegularExpressions; using FSO.Vitaboy; namespace FSO.Content { /// <summary> /// Provides access to mesh (*.mesh) data in FAR3 archives. /// </summary> public class AvatarMeshProvider : FAR3Provider<Mesh>{ public AvatarMeshProvider(Content contentManager, GraphicsDevice device) : base(contentManager, new MeshCodec(), new Regex(".*/meshes/.*\\.dat")) { } } }
29.142857
153
0.703431
[ "MPL-2.0", "MPL-2.0-no-copyleft-exception" ]
francot514/FreeSims
SimsVille/ContentManager/AvatarMeshProvider.cs
818
C#
#region Copyright (c) 2013 Jens Thiel, http://thielj.github.io/MetroFramework /* MetroFramework - Windows Modern UI for .NET WinForms applications Copyright (c) 2013 Jens Thiel, http://thielj.github.io/MetroFramework 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. Portions of this software are (c) 2011 Sven Walter, http://github.com/viperneo */ #endregion using System; using System.Drawing; using System.Drawing.Drawing2D; using System.ComponentModel; using System.Windows.Forms; using MetroFramework.Drawing; namespace MetroFramework.Controls { [ToolboxBitmap(typeof(RadioButton))] [Designer("MetroFramework.Design.MetroRadioButtonDesigner, " + AssemblyRef.MetroFrameworkDesignSN)] public partial class MetroRadioButton : MetroRadioButtonBase { protected override string MetroControlCategory { get { return "CheckBox"; } } public MetroRadioButton() { SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw, true); UseTransparency(); UseSelectable(); UseStyleColor(); UseFontStyle(); } protected override void OnPaintForeground(PaintEventArgs e) { e.Graphics.SmoothingMode = SmoothingMode.HighQuality; using (Pen p = new Pen(GetThemeColor("BorderColor"))) { Rectangle boxRect = new Rectangle(0, Height / 2 - 6, 12, 12); e.Graphics.DrawEllipse(p, boxRect); } if (Checked) { using (SolidBrush b = new SolidBrush(GetStyleColor())) { Rectangle boxRect = new Rectangle(3, Height / 2 - 3, 6, 6); e.Graphics.FillEllipse(b, boxRect); } } e.Graphics.SmoothingMode = SmoothingMode.Default; Rectangle textRect = new Rectangle(16, 0, Width - 16, Height); TextRenderer.DrawText(e.Graphics, Text, EffectiveFont, textRect, EffectiveForeColor, TextAlign.AsTextFormatFlags() | TextFormatFlags.EndEllipsis); } protected override void OnCheckedChanged(EventArgs e) { base.OnCheckedChanged(e); Invalidate(); } public override Size GetPreferredSize(Size proposedSize) { using (var g = CreateGraphics()) { proposedSize = new Size(int.MaxValue, int.MaxValue); Size preferredSize = TextRenderer.MeasureText(g, Text, EffectiveFont, proposedSize, TextAlign.AsTextFormatFlags() | TextFormatFlags.EndEllipsis); preferredSize.Width += 16; return preferredSize; } } } }
38.295918
161
0.672795
[ "MIT" ]
4ep/MetroFramework
MetroFramework/Controls/MetroRadioButton.cs
3,755
C#
using System; using System.Collections.Generic; using System.Reactive.Linq; using System.Text; using System.Threading.Tasks; using io.nem1.sdk.Infrastructure.HttpRepositories; using io.nem1.sdk.Model.Accounts; using io.nem1.sdk.Model.Blockchain; using io.nem1.sdk.Model.Mosaics; using io.nem1.sdk.Model.Transactions; using io.nem1.sdk.Model.Transactions.Messages; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace IntegrationTest.infrastructure.Transactions { [TestClass] public class SignatureTransactionTests { [TestMethod] public async Task CanSignMultisigTransaction() { var cosignatory = KeyPair.CreateFromPrivateKey("8db858dcc8e2827074498204b3829154ec4c4f24d13738d3f501003b518ef256"); var secondCosig = KeyPair.CreateFromPrivateKey("cfe47dd9801a5d4fe37183e8f6ca49fff532a2fe6fe099436df93b3d62fe17d5"); var multisigAccount = PublicAccount.CreateFromPublicKey("29c4a4aa674953749053c8a35399b37b713dedd5d002cb29b3331e56ff1ea65a", NetworkType.Types.TEST_NET); var recipient = new Account("E45030D2A22D97FDC4C78923C4BBF7602BBAC3B018FFAD2ED278FB49CD6F218C", NetworkType.Types.TEST_NET); var transaction = TransferTransaction.Create( NetworkType.Types.TEST_NET, Deadline.CreateHours(2), recipient.Address, new List<Mosaic> { Mosaic.CreateFromIdentifier("nem:xem", 1000000) }, PlainMessage.Create("hello") ); var multisigTransaction = MultisigTransaction .Create(NetworkType.Types.TEST_NET, Deadline.CreateHours(1), transaction) .SignWith(cosignatory, multisigAccount); var response = await new TransactionHttp("http://" + Config.Domain + ":7890").Announce(multisigTransaction); Assert.AreEqual("SUCCESS", response.Message); var signatureTransaction = CosignatureTransaction.Create( NetworkType.Types.TEST_NET, Deadline.CreateHours(1), "59f5f7cbbdaa996b8d3c45ce814280aab3b5d322a98fe95c00ae516cf436172d", multisigAccount.Address ).SignWith(secondCosig); var response2 = await new TransactionHttp("http://" + Config.Domain + ":7890").Announce(signatureTransaction); Assert.AreEqual("FAILURE_MULTISIG_NO_MATCHING_MULTISIG", response2.Message); } } }
44.25
164
0.696529
[ "Apache-2.0" ]
LykkeCity/nem1-sdk-csharp
src/integration-test/infrastructure/Transactions/SignatureTransactionTests.cs
2,480
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Web.Mvc; namespace Marsman.UmbracoCodeFirst.ViewHelpers { /// <summary> /// A set of specialised helpers for use with the document and view models in code-first strongly-typed views /// </summary> /// <typeparam name="Tdocument">The document type</typeparam> /// <typeparam name="Tviewmodel">The view model type</typeparam> public interface ICodeFirstViewHelper<Tdocument, Tviewmodel> { /// <summary> /// A HTML helper for the document model /// </summary> HtmlHelper<Tdocument> DocumentHelper { get; } /// <summary> /// A HTML helper for the view model /// </summary> HtmlHelper<Tviewmodel> ViewModelHelper { get; } /// <summary> /// The document model /// </summary> Tdocument Document { get; } /// <summary> /// The view model /// </summary> Tviewmodel ViewModel { get; } } }
28.236842
113
0.615098
[ "MIT" ]
DanMannMann/UmbracoCodeFirst
Felinesoft.UmbracoCodeFirst/ViewHelpers/ICodeFirstViewHelper.cs
1,075
C#
using System; using System.Diagnostics; #nullable enable namespace CSharpE.Syntax.Internals { readonly struct Union<T1, T2> where T1 : class where T2 : class { private readonly object value; public Union(T1 value) => this.value = value; public Union(T2 value) => this.value = value; public TResult Switch<TResult>(Func<T1, TResult> selector1, Func<T2, TResult> selector2) { if (value is T1 value1) return selector1(value1); return selector2((T2)value); } /// <remarks> /// This exists, because the C# 9 compiler can't correctly infer nullability from the <c>null</c> literal. /// </remarks> public TResult? SwitchN<TResult>(Func<T1, TResult?> selector1, Func<T2, TResult?> selector2) where TResult : class { if (value is T1 value1) return selector1(value1); return selector2((T2)value); } public TBase? GetBase<TBase>() { Debug.Assert(typeof(TBase).IsAssignableFrom(typeof(T1)) && typeof(TBase).IsAssignableFrom(typeof(T1))); return (TBase)value; } public static implicit operator Union<T1, T2>(T1 value) => new(value); public static implicit operator Union<T1, T2>(T2 value) => new(value); public static Union<T1, T2> FromEither(object? value) { if (value is T1 value1) return new(value1); if (value is T2 value2) return new(value2); if (value is null) return new(); throw new ArgumentException($"Value was expected to be of type {typeof(T1)} or {typeof(T2)}, but it was of type {value.GetType()}."); } } }
31.45614
145
0.576129
[ "MIT" ]
svick/CSharpE
src/Syntax/Internals/Union.cs
1,795
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. namespace Microsoft.CodeAnalysis.CSharp { internal enum ErrorCode { Void = InternalErrorCode.Void, Unknown = InternalErrorCode.Unknown, #region diagnostics introduced in C# 4 and earlier //FTL_InternalError = 1, //FTL_FailedToLoadResource = 2, //FTL_NoMemory = 3, //ERR_WarningAsError = 4, //ERR_MissingOptionArg = 5, ERR_NoMetadataFile = 6, //FTL_ComPlusInit = 7, //FTL_MetadataImportFailure = 8, no longer used in Roslyn. FTL_MetadataCantOpenFile = 9, //ERR_FatalError = 10, //ERR_CantImportBase = 11, ERR_NoTypeDef = 12, //FTL_MetadataEmitFailure = 13, Roslyn does not catch stream writing exceptions. Those are propagated to the caller. //FTL_RequiredFileNotFound = 14, //ERR_ClassNameTooLong = 15, Deprecated in favor of ERR_MetadataNameTooLong. ERR_OutputWriteFailed = 16, ERR_MultipleEntryPoints = 17, //ERR_UnimplementedOp = 18, ERR_BadBinaryOps = 19, ERR_IntDivByZero = 20, ERR_BadIndexLHS = 21, ERR_BadIndexCount = 22, ERR_BadUnaryOp = 23, //ERR_NoStdLib = 25, not used in Roslyn ERR_ThisInStaticMeth = 26, ERR_ThisInBadContext = 27, WRN_InvalidMainSig = 28, ERR_NoImplicitConv = 29, // Requires SymbolDistinguisher. ERR_NoExplicitConv = 30, // Requires SymbolDistinguisher. ERR_ConstOutOfRange = 31, ERR_AmbigBinaryOps = 34, ERR_AmbigUnaryOp = 35, ERR_InAttrOnOutParam = 36, ERR_ValueCantBeNull = 37, //ERR_WrongNestedThis = 38, No longer given in Roslyn. Less specific ERR_ObjectRequired "An object reference is required for the non-static..." ERR_NoExplicitBuiltinConv = 39, // Requires SymbolDistinguisher. //FTL_DebugInit = 40, Not used in Roslyn. Roslyn gives FTL_DebugEmitFailure with specific error code info. FTL_DebugEmitFailure = 41, //FTL_DebugInitFile = 42, Not used in Roslyn. Roslyn gives ERR_CantOpenFileWrite with specific error info. //FTL_BadPDBFormat = 43, Not used in Roslyn. Roslyn gives FTL_DebugEmitFailure with specific error code info. ERR_BadVisReturnType = 50, ERR_BadVisParamType = 51, ERR_BadVisFieldType = 52, ERR_BadVisPropertyType = 53, ERR_BadVisIndexerReturn = 54, ERR_BadVisIndexerParam = 55, ERR_BadVisOpReturn = 56, ERR_BadVisOpParam = 57, ERR_BadVisDelegateReturn = 58, ERR_BadVisDelegateParam = 59, ERR_BadVisBaseClass = 60, ERR_BadVisBaseInterface = 61, ERR_EventNeedsBothAccessors = 65, ERR_EventNotDelegate = 66, WRN_UnreferencedEvent = 67, ERR_InterfaceEventInitializer = 68, //ERR_EventPropertyInInterface = 69, ERR_BadEventUsage = 70, ERR_ExplicitEventFieldImpl = 71, ERR_CantOverrideNonEvent = 72, ERR_AddRemoveMustHaveBody = 73, ERR_AbstractEventInitializer = 74, ERR_PossibleBadNegCast = 75, ERR_ReservedEnumerator = 76, ERR_AsMustHaveReferenceType = 77, WRN_LowercaseEllSuffix = 78, ERR_BadEventUsageNoField = 79, ERR_ConstraintOnlyAllowedOnGenericDecl = 80, ERR_TypeParamMustBeIdentifier = 81, ERR_MemberReserved = 82, ERR_DuplicateParamName = 100, ERR_DuplicateNameInNS = 101, ERR_DuplicateNameInClass = 102, ERR_NameNotInContext = 103, ERR_AmbigContext = 104, WRN_DuplicateUsing = 105, ERR_BadMemberFlag = 106, ERR_BadMemberProtection = 107, WRN_NewRequired = 108, WRN_NewNotRequired = 109, ERR_CircConstValue = 110, ERR_MemberAlreadyExists = 111, ERR_StaticNotVirtual = 112, ERR_OverrideNotNew = 113, WRN_NewOrOverrideExpected = 114, ERR_OverrideNotExpected = 115, ERR_NamespaceUnexpected = 116, ERR_NoSuchMember = 117, ERR_BadSKknown = 118, ERR_BadSKunknown = 119, ERR_ObjectRequired = 120, ERR_AmbigCall = 121, ERR_BadAccess = 122, ERR_MethDelegateMismatch = 123, ERR_RetObjectRequired = 126, ERR_RetNoObjectRequired = 127, ERR_LocalDuplicate = 128, ERR_AssgLvalueExpected = 131, ERR_StaticConstParam = 132, ERR_NotConstantExpression = 133, ERR_NotNullConstRefField = 134, // ERR_NameIllegallyOverrides = 135, // Not used in Roslyn anymore due to 'Single Meaning' relaxation changes ERR_LocalIllegallyOverrides = 136, ERR_BadUsingNamespace = 138, ERR_NoBreakOrCont = 139, ERR_DuplicateLabel = 140, ERR_NoConstructors = 143, ERR_NoNewAbstract = 144, ERR_ConstValueRequired = 145, ERR_CircularBase = 146, ERR_BadDelegateConstructor = 148, ERR_MethodNameExpected = 149, ERR_ConstantExpected = 150, // ERR_V6SwitchGoverningTypeValueExpected shares the same error code (CS0151) with ERR_IntegralTypeValueExpected in Dev10 compiler. // However ERR_IntegralTypeValueExpected is currently unused and hence being removed. If we need to generate this error in future // we can use error code CS0166. CS0166 was originally reserved for ERR_SwitchFallInto in Dev10, but was never used. ERR_V6SwitchGoverningTypeValueExpected = 151, ERR_DuplicateCaseLabel = 152, ERR_InvalidGotoCase = 153, ERR_PropertyLacksGet = 154, ERR_BadExceptionType = 155, ERR_BadEmptyThrow = 156, ERR_BadFinallyLeave = 157, ERR_LabelShadow = 158, ERR_LabelNotFound = 159, ERR_UnreachableCatch = 160, ERR_ReturnExpected = 161, WRN_UnreachableCode = 162, ERR_SwitchFallThrough = 163, WRN_UnreferencedLabel = 164, ERR_UseDefViolation = 165, //ERR_NoInvoke = 167, WRN_UnreferencedVar = 168, WRN_UnreferencedField = 169, ERR_UseDefViolationField = 170, ERR_UnassignedThis = 171, ERR_AmbigQM = 172, ERR_InvalidQM = 173, // Requires SymbolDistinguisher. ERR_NoBaseClass = 174, ERR_BaseIllegal = 175, ERR_ObjectProhibited = 176, ERR_ParamUnassigned = 177, ERR_InvalidArray = 178, ERR_ExternHasBody = 179, ERR_AbstractAndExtern = 180, ERR_BadAttributeParamType = 181, ERR_BadAttributeArgument = 182, WRN_IsAlwaysTrue = 183, WRN_IsAlwaysFalse = 184, ERR_LockNeedsReference = 185, ERR_NullNotValid = 186, ERR_UseDefViolationThis = 188, ERR_ArgsInvalid = 190, ERR_AssgReadonly = 191, ERR_RefReadonly = 192, ERR_PtrExpected = 193, ERR_PtrIndexSingle = 196, WRN_ByRefNonAgileField = 197, ERR_AssgReadonlyStatic = 198, ERR_RefReadonlyStatic = 199, ERR_AssgReadonlyProp = 200, ERR_IllegalStatement = 201, ERR_BadGetEnumerator = 202, ERR_TooManyLocals = 204, ERR_AbstractBaseCall = 205, ERR_RefProperty = 206, // WRN_OldWarning_UnsafeProp = 207, // This error code is unused. ERR_ManagedAddr = 208, ERR_BadFixedInitType = 209, ERR_FixedMustInit = 210, ERR_InvalidAddrOp = 211, ERR_FixedNeeded = 212, ERR_FixedNotNeeded = 213, ERR_UnsafeNeeded = 214, ERR_OpTFRetType = 215, ERR_OperatorNeedsMatch = 216, ERR_BadBoolOp = 217, ERR_MustHaveOpTF = 218, WRN_UnreferencedVarAssg = 219, ERR_CheckedOverflow = 220, ERR_ConstOutOfRangeChecked = 221, ERR_BadVarargs = 224, ERR_ParamsMustBeArray = 225, ERR_IllegalArglist = 226, ERR_IllegalUnsafe = 227, //ERR_NoAccessibleMember = 228, ERR_AmbigMember = 229, ERR_BadForeachDecl = 230, ERR_ParamsLast = 231, ERR_SizeofUnsafe = 233, ERR_DottedTypeNameNotFoundInNS = 234, ERR_FieldInitRefNonstatic = 236, ERR_SealedNonOverride = 238, ERR_CantOverrideSealed = 239, //ERR_NoDefaultArgs = 241, ERR_VoidError = 242, ERR_ConditionalOnOverride = 243, ERR_PointerInAsOrIs = 244, ERR_CallingFinalizeDeprecated = 245, //Dev10: ERR_CallingFinalizeDepracated ERR_SingleTypeNameNotFound = 246, ERR_NegativeStackAllocSize = 247, ERR_NegativeArraySize = 248, ERR_OverrideFinalizeDeprecated = 249, ERR_CallingBaseFinalizeDeprecated = 250, WRN_NegativeArrayIndex = 251, WRN_BadRefCompareLeft = 252, WRN_BadRefCompareRight = 253, ERR_BadCastInFixed = 254, ERR_StackallocInCatchFinally = 255, ERR_VarargsLast = 257, ERR_MissingPartial = 260, ERR_PartialTypeKindConflict = 261, ERR_PartialModifierConflict = 262, ERR_PartialMultipleBases = 263, ERR_PartialWrongTypeParams = 264, ERR_PartialWrongConstraints = 265, ERR_NoImplicitConvCast = 266, // Requires SymbolDistinguisher. ERR_PartialMisplaced = 267, ERR_ImportedCircularBase = 268, ERR_UseDefViolationOut = 269, ERR_ArraySizeInDeclaration = 270, ERR_InaccessibleGetter = 271, ERR_InaccessibleSetter = 272, ERR_InvalidPropertyAccessMod = 273, ERR_DuplicatePropertyAccessMods = 274, //ERR_PropertyAccessModInInterface = 275, ERR_AccessModMissingAccessor = 276, ERR_UnimplementedInterfaceAccessor = 277, WRN_PatternIsAmbiguous = 278, WRN_PatternStaticOrInaccessible = 279, WRN_PatternBadSignature = 280, ERR_FriendRefNotEqualToThis = 281, WRN_SequentialOnPartialClass = 282, ERR_BadConstType = 283, ERR_NoNewTyvar = 304, ERR_BadArity = 305, ERR_BadTypeArgument = 306, ERR_TypeArgsNotAllowed = 307, ERR_HasNoTypeVars = 308, ERR_NewConstraintNotSatisfied = 310, ERR_GenericConstraintNotSatisfiedRefType = 311, // Requires SymbolDistinguisher. ERR_GenericConstraintNotSatisfiedNullableEnum = 312, // Uses (but doesn't require) SymbolDistinguisher. ERR_GenericConstraintNotSatisfiedNullableInterface = 313, // Uses (but doesn't require) SymbolDistinguisher. ERR_GenericConstraintNotSatisfiedTyVar = 314, // Requires SymbolDistinguisher. ERR_GenericConstraintNotSatisfiedValType = 315, // Requires SymbolDistinguisher. ERR_DuplicateGeneratedName = 316, // unused 317-399 ERR_GlobalSingleTypeNameNotFound = 400, ERR_NewBoundMustBeLast = 401, WRN_MainCantBeGeneric = 402, ERR_TypeVarCantBeNull = 403, ERR_AttributeCantBeGeneric = 404, ERR_DuplicateBound = 405, ERR_ClassBoundNotFirst = 406, ERR_BadRetType = 407, ERR_DuplicateConstraintClause = 409, //ERR_WrongSignature = 410, unused in Roslyn ERR_CantInferMethTypeArgs = 411, ERR_LocalSameNameAsTypeParam = 412, ERR_AsWithTypeVar = 413, WRN_UnreferencedFieldAssg = 414, ERR_BadIndexerNameAttr = 415, ERR_AttrArgWithTypeVars = 416, ERR_NewTyvarWithArgs = 417, ERR_AbstractSealedStatic = 418, WRN_AmbiguousXMLReference = 419, WRN_VolatileByRef = 420, // WRN_IncrSwitchObsolete = 422, // This error code is unused. ERR_ComImportWithImpl = 423, ERR_ComImportWithBase = 424, ERR_ImplBadConstraints = 425, ERR_DottedTypeNameNotFoundInAgg = 426, ERR_MethGrpToNonDel = 428, // WRN_UnreachableExpr = 429, // This error code is unused. ERR_BadExternAlias = 430, ERR_ColColWithTypeAlias = 431, ERR_AliasNotFound = 432, ERR_SameFullNameAggAgg = 433, ERR_SameFullNameNsAgg = 434, WRN_SameFullNameThisNsAgg = 435, WRN_SameFullNameThisAggAgg = 436, WRN_SameFullNameThisAggNs = 437, ERR_SameFullNameThisAggThisNs = 438, ERR_ExternAfterElements = 439, WRN_GlobalAliasDefn = 440, ERR_SealedStaticClass = 441, ERR_PrivateAbstractAccessor = 442, ERR_ValueExpected = 443, // WRN_UnexpectedPredefTypeLoc = 444, // This error code is unused. ERR_UnboxNotLValue = 445, ERR_AnonMethGrpInForEach = 446, //ERR_AttrOnTypeArg = 447, unused in Roslyn. The scenario for which this error exists should, and does generate a parse error. ERR_BadIncDecRetType = 448, ERR_RefValBoundMustBeFirst = 449, ERR_RefValBoundWithClass = 450, ERR_NewBoundWithVal = 451, ERR_RefConstraintNotSatisfied = 452, ERR_ValConstraintNotSatisfied = 453, ERR_CircularConstraint = 454, ERR_BaseConstraintConflict = 455, ERR_ConWithValCon = 456, ERR_AmbigUDConv = 457, WRN_AlwaysNull = 458, // ERR_AddrOnReadOnlyLocal = 459, // no longer an error ERR_OverrideWithConstraints = 460, ERR_AmbigOverride = 462, ERR_DecConstError = 463, WRN_CmpAlwaysFalse = 464, WRN_FinalizeMethod = 465, ERR_ExplicitImplParams = 466, // WRN_AmbigLookupMeth = 467, //no longer issued in Roslyn //ERR_SameFullNameThisAggThisAgg = 468, no longer used in Roslyn WRN_GotoCaseShouldConvert = 469, ERR_MethodImplementingAccessor = 470, //ERR_TypeArgsNotAllowedAmbig = 471, no longer issued in Roslyn WRN_NubExprIsConstBool = 472, WRN_ExplicitImplCollision = 473, // unused 474-499 ERR_AbstractHasBody = 500, ERR_ConcreteMissingBody = 501, ERR_AbstractAndSealed = 502, ERR_AbstractNotVirtual = 503, ERR_StaticConstant = 504, ERR_CantOverrideNonFunction = 505, ERR_CantOverrideNonVirtual = 506, ERR_CantChangeAccessOnOverride = 507, ERR_CantChangeReturnTypeOnOverride = 508, ERR_CantDeriveFromSealedType = 509, ERR_AbstractInConcreteClass = 513, ERR_StaticConstructorWithExplicitConstructorCall = 514, ERR_StaticConstructorWithAccessModifiers = 515, ERR_RecursiveConstructorCall = 516, ERR_ObjectCallingBaseConstructor = 517, ERR_PredefinedTypeNotFound = 518, //ERR_PredefinedTypeBadType = 520, ERR_StructWithBaseConstructorCall = 522, ERR_StructLayoutCycle = 523, //ERR_InterfacesCannotContainTypes = 524, ERR_InterfacesCantContainFields = 525, ERR_InterfacesCantContainConstructors = 526, ERR_NonInterfaceInInterfaceList = 527, ERR_DuplicateInterfaceInBaseList = 528, ERR_CycleInInterfaceInheritance = 529, //ERR_InterfaceMemberHasBody = 531, ERR_HidingAbstractMethod = 533, ERR_UnimplementedAbstractMethod = 534, ERR_UnimplementedInterfaceMember = 535, ERR_ObjectCantHaveBases = 537, ERR_ExplicitInterfaceImplementationNotInterface = 538, ERR_InterfaceMemberNotFound = 539, ERR_ClassDoesntImplementInterface = 540, ERR_ExplicitInterfaceImplementationInNonClassOrStruct = 541, ERR_MemberNameSameAsType = 542, ERR_EnumeratorOverflow = 543, ERR_CantOverrideNonProperty = 544, ERR_NoGetToOverride = 545, ERR_NoSetToOverride = 546, ERR_PropertyCantHaveVoidType = 547, ERR_PropertyWithNoAccessors = 548, ERR_NewVirtualInSealed = 549, ERR_ExplicitPropertyAddingAccessor = 550, ERR_ExplicitPropertyMissingAccessor = 551, ERR_ConversionWithInterface = 552, ERR_ConversionWithBase = 553, ERR_ConversionWithDerived = 554, ERR_IdentityConversion = 555, ERR_ConversionNotInvolvingContainedType = 556, ERR_DuplicateConversionInClass = 557, ERR_OperatorsMustBeStatic = 558, ERR_BadIncDecSignature = 559, ERR_BadUnaryOperatorSignature = 562, ERR_BadBinaryOperatorSignature = 563, ERR_BadShiftOperatorSignature = 564, ERR_InterfacesCantContainConversionOrEqualityOperators = 567, ERR_StructsCantContainDefaultConstructor = 568, ERR_CantOverrideBogusMethod = 569, ERR_BindToBogus = 570, ERR_CantCallSpecialMethod = 571, ERR_BadTypeReference = 572, ERR_FieldInitializerInStruct = 573, ERR_BadDestructorName = 574, ERR_OnlyClassesCanContainDestructors = 575, ERR_ConflictAliasAndMember = 576, ERR_ConditionalOnSpecialMethod = 577, ERR_ConditionalMustReturnVoid = 578, ERR_DuplicateAttribute = 579, ERR_ConditionalOnInterfaceMethod = 582, //ERR_ICE_Culprit = 583, No ICE in Roslyn. All of these are unused //ERR_ICE_Symbol = 584, //ERR_ICE_Node = 585, //ERR_ICE_File = 586, //ERR_ICE_Stage = 587, //ERR_ICE_Lexer = 588, //ERR_ICE_Parser = 589, ERR_OperatorCantReturnVoid = 590, ERR_InvalidAttributeArgument = 591, ERR_AttributeOnBadSymbolType = 592, ERR_FloatOverflow = 594, ERR_InvalidReal = 595, ERR_ComImportWithoutUuidAttribute = 596, ERR_InvalidNamedArgument = 599, ERR_DllImportOnInvalidMethod = 601, // WRN_FeatureDeprecated = 602, // This error code is unused. // ERR_NameAttributeOnOverride = 609, // removed in Roslyn ERR_FieldCantBeRefAny = 610, ERR_ArrayElementCantBeRefAny = 611, WRN_DeprecatedSymbol = 612, ERR_NotAnAttributeClass = 616, ERR_BadNamedAttributeArgument = 617, WRN_DeprecatedSymbolStr = 618, ERR_DeprecatedSymbolStr = 619, ERR_IndexerCantHaveVoidType = 620, ERR_VirtualPrivate = 621, ERR_ArrayInitToNonArrayType = 622, ERR_ArrayInitInBadPlace = 623, ERR_MissingStructOffset = 625, WRN_ExternMethodNoImplementation = 626, WRN_ProtectedInSealed = 628, ERR_InterfaceImplementedByConditional = 629, ERR_InterfaceImplementedImplicitlyByVariadic = 630, ERR_IllegalRefParam = 631, ERR_BadArgumentToAttribute = 633, //ERR_MissingComTypeOrMarshaller = 635, ERR_StructOffsetOnBadStruct = 636, ERR_StructOffsetOnBadField = 637, ERR_AttributeUsageOnNonAttributeClass = 641, WRN_PossibleMistakenNullStatement = 642, ERR_DuplicateNamedAttributeArgument = 643, ERR_DeriveFromEnumOrValueType = 644, //ERR_IdentifierTooLong = 645, //not used in Roslyn. See ERR_MetadataNameTooLong ERR_DefaultMemberOnIndexedType = 646, //ERR_CustomAttributeError = 647, ERR_BogusType = 648, WRN_UnassignedInternalField = 649, ERR_CStyleArray = 650, WRN_VacuousIntegralComp = 652, ERR_AbstractAttributeClass = 653, ERR_BadNamedAttributeArgumentType = 655, ERR_MissingPredefinedMember = 656, WRN_AttributeLocationOnBadDeclaration = 657, WRN_InvalidAttributeLocation = 658, WRN_EqualsWithoutGetHashCode = 659, WRN_EqualityOpWithoutEquals = 660, WRN_EqualityOpWithoutGetHashCode = 661, ERR_OutAttrOnRefParam = 662, ERR_OverloadRefKind = 663, ERR_LiteralDoubleCast = 664, WRN_IncorrectBooleanAssg = 665, ERR_ProtectedInStruct = 666, //ERR_FeatureDeprecated = 667, ERR_InconsistentIndexerNames = 668, // Named 'ERR_InconsistantIndexerNames' in native compiler ERR_ComImportWithUserCtor = 669, ERR_FieldCantHaveVoidType = 670, WRN_NonObsoleteOverridingObsolete = 672, ERR_SystemVoid = 673, ERR_ExplicitParamArray = 674, WRN_BitwiseOrSignExtend = 675, ERR_VolatileStruct = 677, ERR_VolatileAndReadonly = 678, // WRN_OldWarning_ProtectedInternal = 679, // This error code is unused. // WRN_OldWarning_AccessibleReadonly = 680, // This error code is unused. ERR_AbstractField = 681, ERR_BogusExplicitImpl = 682, ERR_ExplicitMethodImplAccessor = 683, WRN_CoClassWithoutComImport = 684, ERR_ConditionalWithOutParam = 685, ERR_AccessorImplementingMethod = 686, ERR_AliasQualAsExpression = 687, ERR_DerivingFromATyVar = 689, //FTL_MalformedMetadata = 690, ERR_DuplicateTypeParameter = 692, WRN_TypeParameterSameAsOuterTypeParameter = 693, ERR_TypeVariableSameAsParent = 694, ERR_UnifyingInterfaceInstantiations = 695, ERR_GenericDerivingFromAttribute = 698, ERR_TyVarNotFoundInConstraint = 699, ERR_BadBoundType = 701, ERR_SpecialTypeAsBound = 702, ERR_BadVisBound = 703, ERR_LookupInTypeVariable = 704, ERR_BadConstraintType = 706, ERR_InstanceMemberInStaticClass = 708, ERR_StaticBaseClass = 709, ERR_ConstructorInStaticClass = 710, ERR_DestructorInStaticClass = 711, ERR_InstantiatingStaticClass = 712, ERR_StaticDerivedFromNonObject = 713, ERR_StaticClassInterfaceImpl = 714, ERR_OperatorInStaticClass = 715, ERR_ConvertToStaticClass = 716, ERR_ConstraintIsStaticClass = 717, ERR_GenericArgIsStaticClass = 718, ERR_ArrayOfStaticClass = 719, ERR_IndexerInStaticClass = 720, ERR_ParameterIsStaticClass = 721, ERR_ReturnTypeIsStaticClass = 722, ERR_VarDeclIsStaticClass = 723, ERR_BadEmptyThrowInFinally = 724, //ERR_InvalidDecl = 725, ERR_InvalidSpecifier = 726, //ERR_InvalidSpecifierUnk = 727, WRN_AssignmentToLockOrDispose = 728, ERR_ForwardedTypeInThisAssembly = 729, ERR_ForwardedTypeIsNested = 730, ERR_CycleInTypeForwarder = 731, //ERR_FwdedGeneric = 733, ERR_AssemblyNameOnNonModule = 734, ERR_InvalidFwdType = 735, ERR_CloseUnimplementedInterfaceMemberStatic = 736, ERR_CloseUnimplementedInterfaceMemberNotPublic = 737, ERR_CloseUnimplementedInterfaceMemberWrongReturnType = 738, ERR_DuplicateTypeForwarder = 739, ERR_ExpectedSelectOrGroup = 742, ERR_ExpectedContextualKeywordOn = 743, ERR_ExpectedContextualKeywordEquals = 744, ERR_ExpectedContextualKeywordBy = 745, ERR_InvalidAnonymousTypeMemberDeclarator = 746, ERR_InvalidInitializerElementInitializer = 747, ERR_InconsistentLambdaParameterUsage = 748, ERR_PartialMethodInvalidModifier = 750, ERR_PartialMethodOnlyInPartialClass = 751, // ERR_PartialMethodCannotHaveOutParameters = 752, Removed as part of 'extended partial methods' feature // ERR_PartialMethodOnlyMethods = 753, Removed as it is subsumed by ERR_PartialMisplaced ERR_PartialMethodNotExplicit = 754, ERR_PartialMethodExtensionDifference = 755, ERR_PartialMethodOnlyOneLatent = 756, ERR_PartialMethodOnlyOneActual = 757, ERR_PartialMethodParamsDifference = 758, ERR_PartialMethodMustHaveLatent = 759, ERR_PartialMethodInconsistentConstraints = 761, ERR_PartialMethodToDelegate = 762, ERR_PartialMethodStaticDifference = 763, ERR_PartialMethodUnsafeDifference = 764, ERR_PartialMethodInExpressionTree = 765, // ERR_PartialMethodMustReturnVoid = 766, Removed as part of 'extended partial methods' feature ERR_ExplicitImplCollisionOnRefOut = 767, ERR_IndirectRecursiveConstructorCall = 768, // unused 769-799 //ERR_NoEmptyArrayRanges = 800, //ERR_IntegerSpecifierOnOneDimArrays = 801, //ERR_IntegerSpecifierMustBePositive = 802, //ERR_ArrayRangeDimensionsMustMatch = 803, //ERR_ArrayRangeDimensionsWrong = 804, //ERR_IntegerSpecifierValidOnlyOnArrays = 805, //ERR_ArrayRangeSpecifierValidOnlyOnArrays = 806, //ERR_UseAdditionalSquareBrackets = 807, //ERR_DotDotNotAssociative = 808, WRN_ObsoleteOverridingNonObsolete = 809, WRN_DebugFullNameTooLong = 811, // Dev11 name: ERR_DebugFullNameTooLong ERR_ImplicitlyTypedVariableAssignedBadValue = 815, // Dev10 name: ERR_ImplicitlyTypedLocalAssignedBadValue ERR_ImplicitlyTypedVariableWithNoInitializer = 818, // Dev10 name: ERR_ImplicitlyTypedLocalWithNoInitializer ERR_ImplicitlyTypedVariableMultipleDeclarator = 819, // Dev10 name: ERR_ImplicitlyTypedLocalMultipleDeclarator ERR_ImplicitlyTypedVariableAssignedArrayInitializer = 820, // Dev10 name: ERR_ImplicitlyTypedLocalAssignedArrayInitializer ERR_ImplicitlyTypedLocalCannotBeFixed = 821, ERR_ImplicitlyTypedVariableCannotBeConst = 822, // Dev10 name: ERR_ImplicitlyTypedLocalCannotBeConst WRN_ExternCtorNoImplementation = 824, ERR_TypeVarNotFound = 825, ERR_ImplicitlyTypedArrayNoBestType = 826, ERR_AnonymousTypePropertyAssignedBadValue = 828, ERR_ExpressionTreeContainsBaseAccess = 831, ERR_ExpressionTreeContainsAssignment = 832, ERR_AnonymousTypeDuplicatePropertyName = 833, ERR_StatementLambdaToExpressionTree = 834, ERR_ExpressionTreeMustHaveDelegate = 835, ERR_AnonymousTypeNotAvailable = 836, ERR_LambdaInIsAs = 837, ERR_ExpressionTreeContainsMultiDimensionalArrayInitializer = 838, ERR_MissingArgument = 839, //ERR_AutoPropertiesMustHaveBothAccessors = 840, ERR_VariableUsedBeforeDeclaration = 841, //ERR_ExplicitLayoutAndAutoImplementedProperty = 842, ERR_UnassignedThisAutoProperty = 843, ERR_VariableUsedBeforeDeclarationAndHidesField = 844, ERR_ExpressionTreeContainsBadCoalesce = 845, ERR_ArrayInitializerExpected = 846, ERR_ArrayInitializerIncorrectLength = 847, // ERR_OverloadRefOutCtor = 851, Replaced By ERR_OverloadRefKind ERR_ExpressionTreeContainsNamedArgument = 853, ERR_ExpressionTreeContainsOptionalArgument = 854, ERR_ExpressionTreeContainsIndexedProperty = 855, ERR_IndexedPropertyRequiresParams = 856, ERR_IndexedPropertyMustHaveAllOptionalParams = 857, //ERR_FusionConfigFileNameTooLong = 858, unused in Roslyn. We give ERR_CantReadConfigFile now. // unused 859-1000 ERR_IdentifierExpected = 1001, ERR_SemicolonExpected = 1002, ERR_SyntaxError = 1003, ERR_DuplicateModifier = 1004, ERR_DuplicateAccessor = 1007, ERR_IntegralTypeExpected = 1008, ERR_IllegalEscape = 1009, ERR_NewlineInConst = 1010, ERR_EmptyCharConst = 1011, ERR_TooManyCharsInConst = 1012, ERR_InvalidNumber = 1013, ERR_GetOrSetExpected = 1014, ERR_ClassTypeExpected = 1015, ERR_NamedArgumentExpected = 1016, ERR_TooManyCatches = 1017, ERR_ThisOrBaseExpected = 1018, ERR_OvlUnaryOperatorExpected = 1019, ERR_OvlBinaryOperatorExpected = 1020, ERR_IntOverflow = 1021, ERR_EOFExpected = 1022, ERR_BadEmbeddedStmt = 1023, ERR_PPDirectiveExpected = 1024, ERR_EndOfPPLineExpected = 1025, ERR_CloseParenExpected = 1026, ERR_EndifDirectiveExpected = 1027, ERR_UnexpectedDirective = 1028, ERR_ErrorDirective = 1029, WRN_WarningDirective = 1030, ERR_TypeExpected = 1031, ERR_PPDefFollowsToken = 1032, //ERR_TooManyLines = 1033, unused in Roslyn. //ERR_LineTooLong = 1034, unused in Roslyn. ERR_OpenEndedComment = 1035, ERR_OvlOperatorExpected = 1037, ERR_EndRegionDirectiveExpected = 1038, ERR_UnterminatedStringLit = 1039, ERR_BadDirectivePlacement = 1040, ERR_IdentifierExpectedKW = 1041, ERR_SemiOrLBraceExpected = 1043, ERR_MultiTypeInDeclaration = 1044, ERR_AddOrRemoveExpected = 1055, ERR_UnexpectedCharacter = 1056, ERR_ProtectedInStatic = 1057, WRN_UnreachableGeneralCatch = 1058, ERR_IncrementLvalueExpected = 1059, // WRN_UninitializedField = 1060, // unused in Roslyn. ERR_NoSuchMemberOrExtension = 1061, WRN_DeprecatedCollectionInitAddStr = 1062, ERR_DeprecatedCollectionInitAddStr = 1063, WRN_DeprecatedCollectionInitAdd = 1064, ERR_DefaultValueNotAllowed = 1065, WRN_DefaultValueForUnconsumedLocation = 1066, ERR_PartialWrongTypeParamsVariance = 1067, ERR_GlobalSingleTypeNameNotFoundFwd = 1068, ERR_DottedTypeNameNotFoundInNSFwd = 1069, ERR_SingleTypeNameNotFoundFwd = 1070, //ERR_NoSuchMemberOnNoPIAType = 1071, //EE WRN_IdentifierOrNumericLiteralExpected = 1072, ERR_UnexpectedToken = 1073, // unused 1074-1098 // ERR_EOLExpected = 1099, // EE // ERR_NotSupportedinEE = 1100, // EE ERR_BadThisParam = 1100, // ERR_BadRefWithThis = 1101, replaced by ERR_BadParameterModifiers // ERR_BadOutWithThis = 1102, replaced by ERR_BadParameterModifiers ERR_BadTypeforThis = 1103, ERR_BadParamModThis = 1104, ERR_BadExtensionMeth = 1105, ERR_BadExtensionAgg = 1106, ERR_DupParamMod = 1107, // ERR_MultiParamMod = 1108, replaced by ERR_BadParameterModifiers ERR_ExtensionMethodsDecl = 1109, ERR_ExtensionAttrNotFound = 1110, //ERR_ExtensionTypeParam = 1111, ERR_ExplicitExtension = 1112, ERR_ValueTypeExtDelegate = 1113, // unused 1114-1199 // Below five error codes are unused. // WRN_FeatureDeprecated2 = 1200, // WRN_FeatureDeprecated3 = 1201, // WRN_FeatureDeprecated4 = 1202, // WRN_FeatureDeprecated5 = 1203, // WRN_OldWarning_FeatureDefaultDeprecated = 1204, // unused 1205-1500 ERR_BadArgCount = 1501, //ERR_BadArgTypes = 1502, ERR_BadArgType = 1503, ERR_NoSourceFile = 1504, ERR_CantRefResource = 1507, ERR_ResourceNotUnique = 1508, ERR_ImportNonAssembly = 1509, ERR_RefLvalueExpected = 1510, ERR_BaseInStaticMeth = 1511, ERR_BaseInBadContext = 1512, ERR_RbraceExpected = 1513, ERR_LbraceExpected = 1514, ERR_InExpected = 1515, ERR_InvalidPreprocExpr = 1517, //ERR_BadTokenInType = 1518, unused in Roslyn ERR_InvalidMemberDecl = 1519, ERR_MemberNeedsType = 1520, ERR_BadBaseType = 1521, WRN_EmptySwitch = 1522, ERR_ExpectedEndTry = 1524, ERR_InvalidExprTerm = 1525, ERR_BadNewExpr = 1526, ERR_NoNamespacePrivate = 1527, ERR_BadVarDecl = 1528, ERR_UsingAfterElements = 1529, //ERR_NoNewOnNamespaceElement = 1530, EDMAURER we now give BadMemberFlag which is only a little less specific than this. //ERR_DontUseInvoke = 1533, ERR_BadBinOpArgs = 1534, ERR_BadUnOpArgs = 1535, ERR_NoVoidParameter = 1536, ERR_DuplicateAlias = 1537, ERR_BadProtectedAccess = 1540, //ERR_CantIncludeDirectory = 1541, ERR_AddModuleAssembly = 1542, ERR_BindToBogusProp2 = 1545, ERR_BindToBogusProp1 = 1546, ERR_NoVoidHere = 1547, //ERR_CryptoFailed = 1548, //ERR_CryptoNotFound = 1549, ERR_IndexerNeedsParam = 1551, ERR_BadArraySyntax = 1552, ERR_BadOperatorSyntax = 1553, //ERR_BadOperatorSyntax2 = 1554, Not used in Roslyn. ERR_MainClassNotFound = 1555, ERR_MainClassNotClass = 1556, //ERR_MainClassWrongFile = 1557, Not used in Roslyn. This was used only when compiling and producing two outputs. ERR_NoMainInClass = 1558, //ERR_MainClassIsImport = 1559, Not used in Roslyn. Scenario occurs so infrequently that it is not worth re-implementing. //ERR_FileNameTooLong = 1560, //ERR_OutputFileNameTooLong = 1561, Not used in Roslyn. We report a more generic error that doesn't mention "output file" but is fine. ERR_OutputNeedsName = 1562, //ERR_OutputNeedsInput = 1563, ERR_CantHaveWin32ResAndManifest = 1564, ERR_CantHaveWin32ResAndIcon = 1565, ERR_CantReadResource = 1566, //ERR_AutoResGen = 1567, ERR_DocFileGen = 1569, WRN_XMLParseError = 1570, WRN_DuplicateParamTag = 1571, WRN_UnmatchedParamTag = 1572, WRN_MissingParamTag = 1573, WRN_BadXMLRef = 1574, ERR_BadStackAllocExpr = 1575, ERR_InvalidLineNumber = 1576, //ERR_ALinkFailed = 1577, No alink usage in Roslyn ERR_MissingPPFile = 1578, ERR_ForEachMissingMember = 1579, WRN_BadXMLRefParamType = 1580, WRN_BadXMLRefReturnType = 1581, ERR_BadWin32Res = 1583, WRN_BadXMLRefSyntax = 1584, ERR_BadModifierLocation = 1585, ERR_MissingArraySize = 1586, WRN_UnprocessedXMLComment = 1587, //ERR_CantGetCORSystemDir = 1588, WRN_FailedInclude = 1589, WRN_InvalidInclude = 1590, WRN_MissingXMLComment = 1591, WRN_XMLParseIncludeError = 1592, ERR_BadDelArgCount = 1593, //ERR_BadDelArgTypes = 1594, // WRN_OldWarning_MultipleTypeDefs = 1595, // This error code is unused. // WRN_OldWarning_DocFileGenAndIncr = 1596, // This error code is unused. ERR_UnexpectedSemicolon = 1597, // WRN_XMLParserNotFound = 1598, // No longer used (though, conceivably, we could report it if Linq to Xml is missing at compile time). ERR_MethodReturnCantBeRefAny = 1599, ERR_CompileCancelled = 1600, ERR_MethodArgCantBeRefAny = 1601, ERR_AssgReadonlyLocal = 1604, ERR_RefReadonlyLocal = 1605, //ERR_ALinkCloseFailed = 1606, WRN_ALinkWarn = 1607, ERR_CantUseRequiredAttribute = 1608, ERR_NoModifiersOnAccessor = 1609, // WRN_DeleteAutoResFailed = 1610, // Unused. ERR_ParamsCantBeWithModifier = 1611, ERR_ReturnNotLValue = 1612, ERR_MissingCoClass = 1613, ERR_AmbiguousAttribute = 1614, ERR_BadArgExtraRef = 1615, WRN_CmdOptionConflictsSource = 1616, ERR_BadCompatMode = 1617, ERR_DelegateOnConditional = 1618, ERR_CantMakeTempFile = 1619, //changed to now accept only one argument ERR_BadArgRef = 1620, ERR_YieldInAnonMeth = 1621, ERR_ReturnInIterator = 1622, ERR_BadIteratorArgType = 1623, ERR_BadIteratorReturn = 1624, ERR_BadYieldInFinally = 1625, ERR_BadYieldInTryOfCatch = 1626, ERR_EmptyYield = 1627, ERR_AnonDelegateCantUse = 1628, ERR_IllegalInnerUnsafe = 1629, //ERR_BadWatsonMode = 1630, ERR_BadYieldInCatch = 1631, ERR_BadDelegateLeave = 1632, WRN_IllegalPragma = 1633, WRN_IllegalPPWarning = 1634, WRN_BadRestoreNumber = 1635, ERR_VarargsIterator = 1636, ERR_UnsafeIteratorArgType = 1637, //ERR_ReservedIdentifier = 1638, ERR_BadCoClassSig = 1639, ERR_MultipleIEnumOfT = 1640, ERR_FixedDimsRequired = 1641, ERR_FixedNotInStruct = 1642, ERR_AnonymousReturnExpected = 1643, //ERR_NonECMAFeature = 1644, WRN_NonECMAFeature = 1645, ERR_ExpectedVerbatimLiteral = 1646, //FTL_StackOverflow = 1647, ERR_AssgReadonly2 = 1648, ERR_RefReadonly2 = 1649, ERR_AssgReadonlyStatic2 = 1650, ERR_RefReadonlyStatic2 = 1651, ERR_AssgReadonlyLocal2Cause = 1654, ERR_RefReadonlyLocal2Cause = 1655, ERR_AssgReadonlyLocalCause = 1656, ERR_RefReadonlyLocalCause = 1657, WRN_ErrorOverride = 1658, // WRN_OldWarning_ReservedIdentifier = 1659, // This error code is unused. ERR_AnonMethToNonDel = 1660, ERR_CantConvAnonMethParams = 1661, ERR_CantConvAnonMethReturns = 1662, ERR_IllegalFixedType = 1663, ERR_FixedOverflow = 1664, ERR_InvalidFixedArraySize = 1665, ERR_FixedBufferNotFixed = 1666, ERR_AttributeNotOnAccessor = 1667, WRN_InvalidSearchPathDir = 1668, ERR_IllegalVarArgs = 1669, ERR_IllegalParams = 1670, ERR_BadModifiersOnNamespace = 1671, ERR_BadPlatformType = 1672, ERR_ThisStructNotInAnonMeth = 1673, ERR_NoConvToIDisp = 1674, // ERR_InvalidGenericEnum = 1675, replaced with 7002 ERR_BadParamRef = 1676, ERR_BadParamExtraRef = 1677, ERR_BadParamType = 1678, // Requires SymbolDistinguisher. ERR_BadExternIdentifier = 1679, ERR_AliasMissingFile = 1680, ERR_GlobalExternAlias = 1681, // WRN_MissingTypeNested = 1682, // unused in Roslyn. // In Roslyn, we generate errors ERR_MissingTypeInSource and ERR_MissingTypeInAssembly instead of warnings WRN_MissingTypeInSource and WRN_MissingTypeInAssembly respectively. // WRN_MissingTypeInSource = 1683, // WRN_MissingTypeInAssembly = 1684, WRN_MultiplePredefTypes = 1685, ERR_LocalCantBeFixedAndHoisted = 1686, WRN_TooManyLinesForDebugger = 1687, ERR_CantConvAnonMethNoParams = 1688, ERR_ConditionalOnNonAttributeClass = 1689, WRN_CallOnNonAgileField = 1690, // WRN_BadWarningNumber = 1691, // we no longer generate this warning for an unrecognized warning ID specified as an argument to /nowarn or /warnaserror. WRN_InvalidNumber = 1692, // WRN_FileNameTooLong = 1694, //unused. WRN_IllegalPPChecksum = 1695, WRN_EndOfPPLineExpected = 1696, WRN_ConflictingChecksum = 1697, // WRN_AssumedMatchThis = 1698, // This error code is unused. // WRN_UseSwitchInsteadOfAttribute = 1699, // This error code is unused. WRN_InvalidAssemblyName = 1700, WRN_UnifyReferenceMajMin = 1701, WRN_UnifyReferenceBldRev = 1702, ERR_DuplicateImport = 1703, ERR_DuplicateImportSimple = 1704, ERR_AssemblyMatchBadVersion = 1705, //ERR_AnonMethNotAllowed = 1706, Unused in Roslyn. Previously given when a lambda was supplied as an attribute argument. // WRN_DelegateNewMethBind = 1707, // This error code is unused. ERR_FixedNeedsLvalue = 1708, // WRN_EmptyFileName = 1709, // This error code is unused. WRN_DuplicateTypeParamTag = 1710, WRN_UnmatchedTypeParamTag = 1711, WRN_MissingTypeParamTag = 1712, //FTL_TypeNameBuilderError = 1713, //ERR_ImportBadBase = 1714, // This error code is unused and replaced with ERR_NoTypeDef ERR_CantChangeTypeOnOverride = 1715, ERR_DoNotUseFixedBufferAttr = 1716, WRN_AssignmentToSelf = 1717, WRN_ComparisonToSelf = 1718, ERR_CantOpenWin32Res = 1719, WRN_DotOnDefault = 1720, ERR_NoMultipleInheritance = 1721, ERR_BaseClassMustBeFirst = 1722, WRN_BadXMLRefTypeVar = 1723, //ERR_InvalidDefaultCharSetValue = 1724, Not used in Roslyn. ERR_FriendAssemblyBadArgs = 1725, ERR_FriendAssemblySNReq = 1726, //ERR_WatsonSendNotOptedIn = 1727, We're not doing any custom Watson processing in Roslyn. In modern OSs, Watson behavior is configured with machine policy settings. ERR_DelegateOnNullable = 1728, ERR_BadCtorArgCount = 1729, ERR_GlobalAttributesNotFirst = 1730, //ERR_CantConvAnonMethReturnsNoDelegate = 1731, Not used in Roslyn. When there is no delegate, we reuse the message that contains a substitution string for the delegate type. //ERR_ParameterExpected = 1732, Not used in Roslyn. ERR_ExpressionExpected = 1733, WRN_UnmatchedParamRefTag = 1734, WRN_UnmatchedTypeParamRefTag = 1735, ERR_DefaultValueMustBeConstant = 1736, ERR_DefaultValueBeforeRequiredValue = 1737, ERR_NamedArgumentSpecificationBeforeFixedArgument = 1738, ERR_BadNamedArgument = 1739, ERR_DuplicateNamedArgument = 1740, ERR_RefOutDefaultValue = 1741, ERR_NamedArgumentForArray = 1742, ERR_DefaultValueForExtensionParameter = 1743, ERR_NamedArgumentUsedInPositional = 1744, ERR_DefaultValueUsedWithAttributes = 1745, ERR_BadNamedArgumentForDelegateInvoke = 1746, ERR_NoPIAAssemblyMissingAttribute = 1747, ERR_NoCanonicalView = 1748, //ERR_TypeNotFoundForNoPIA = 1749, ERR_NoConversionForDefaultParam = 1750, ERR_DefaultValueForParamsParameter = 1751, ERR_NewCoClassOnLink = 1752, ERR_NoPIANestedType = 1754, //ERR_InvalidTypeIdentifierConstructor = 1755, ERR_InteropTypeMissingAttribute = 1756, ERR_InteropStructContainsMethods = 1757, ERR_InteropTypesWithSameNameAndGuid = 1758, ERR_NoPIAAssemblyMissingAttributes = 1759, ERR_AssemblySpecifiedForLinkAndRef = 1760, ERR_LocalTypeNameClash = 1761, WRN_ReferencedAssemblyReferencesLinkedPIA = 1762, ERR_NotNullRefDefaultParameter = 1763, ERR_FixedLocalInLambda = 1764, // WRN_TypeNotFoundForNoPIAWarning = 1765, // This error code is unused. ERR_MissingMethodOnSourceInterface = 1766, ERR_MissingSourceInterface = 1767, ERR_GenericsUsedInNoPIAType = 1768, ERR_GenericsUsedAcrossAssemblies = 1769, ERR_NoConversionForNubDefaultParam = 1770, //ERR_MemberWithGenericsUsedAcrossAssemblies = 1771, //ERR_GenericsUsedInBaseTypeAcrossAssemblies = 1772, ERR_InvalidSubsystemVersion = 1773, ERR_InteropMethodWithBody = 1774, // unused 1775-1899 ERR_BadWarningLevel = 1900, ERR_BadDebugType = 1902, //ERR_UnknownTestSwitch = 1903, ERR_BadResourceVis = 1906, ERR_DefaultValueTypeMustMatch = 1908, //ERR_DefaultValueBadParamType = 1909, // Replaced by ERR_DefaultValueBadValueType in Roslyn. ERR_DefaultValueBadValueType = 1910, ERR_MemberAlreadyInitialized = 1912, ERR_MemberCannotBeInitialized = 1913, ERR_StaticMemberInObjectInitializer = 1914, ERR_ReadonlyValueTypeInObjectInitializer = 1917, ERR_ValueTypePropertyInObjectInitializer = 1918, ERR_UnsafeTypeInObjectCreation = 1919, ERR_EmptyElementInitializer = 1920, ERR_InitializerAddHasWrongSignature = 1921, ERR_CollectionInitRequiresIEnumerable = 1922, //ERR_InvalidCollectionInitializerType = 1925, unused in Roslyn. Occurs so infrequently in real usage that it is not worth reimplementing. ERR_CantOpenWin32Manifest = 1926, WRN_CantHaveManifestForModule = 1927, //ERR_BadExtensionArgTypes = 1928, unused in Roslyn (replaced by ERR_BadInstanceArgType) ERR_BadInstanceArgType = 1929, ERR_QueryDuplicateRangeVariable = 1930, ERR_QueryRangeVariableOverrides = 1931, ERR_QueryRangeVariableAssignedBadValue = 1932, //ERR_QueryNotAllowed = 1933, unused in Roslyn. This specific message is not necessary for correctness and adds little. ERR_QueryNoProviderCastable = 1934, ERR_QueryNoProviderStandard = 1935, ERR_QueryNoProvider = 1936, ERR_QueryOuterKey = 1937, ERR_QueryInnerKey = 1938, ERR_QueryOutRefRangeVariable = 1939, ERR_QueryMultipleProviders = 1940, ERR_QueryTypeInferenceFailedMulti = 1941, ERR_QueryTypeInferenceFailed = 1942, ERR_QueryTypeInferenceFailedSelectMany = 1943, ERR_ExpressionTreeContainsPointerOp = 1944, ERR_ExpressionTreeContainsAnonymousMethod = 1945, ERR_AnonymousMethodToExpressionTree = 1946, ERR_QueryRangeVariableReadOnly = 1947, ERR_QueryRangeVariableSameAsTypeParam = 1948, ERR_TypeVarNotFoundRangeVariable = 1949, ERR_BadArgTypesForCollectionAdd = 1950, ERR_ByRefParameterInExpressionTree = 1951, ERR_VarArgsInExpressionTree = 1952, // ERR_MemGroupInExpressionTree = 1953, unused in Roslyn (replaced by ERR_LambdaInIsAs) ERR_InitializerAddHasParamModifiers = 1954, ERR_NonInvocableMemberCalled = 1955, WRN_MultipleRuntimeImplementationMatches = 1956, WRN_MultipleRuntimeOverrideMatches = 1957, ERR_ObjectOrCollectionInitializerWithDelegateCreation = 1958, ERR_InvalidConstantDeclarationType = 1959, ERR_IllegalVarianceSyntax = 1960, ERR_UnexpectedVariance = 1961, ERR_BadDynamicTypeof = 1962, ERR_ExpressionTreeContainsDynamicOperation = 1963, ERR_BadDynamicConversion = 1964, ERR_DeriveFromDynamic = 1965, ERR_DeriveFromConstructedDynamic = 1966, ERR_DynamicTypeAsBound = 1967, ERR_ConstructedDynamicTypeAsBound = 1968, ERR_DynamicRequiredTypesMissing = 1969, ERR_ExplicitDynamicAttr = 1970, ERR_NoDynamicPhantomOnBase = 1971, ERR_NoDynamicPhantomOnBaseIndexer = 1972, ERR_BadArgTypeDynamicExtension = 1973, WRN_DynamicDispatchToConditionalMethod = 1974, ERR_NoDynamicPhantomOnBaseCtor = 1975, ERR_BadDynamicMethodArgMemgrp = 1976, ERR_BadDynamicMethodArgLambda = 1977, ERR_BadDynamicMethodArg = 1978, ERR_BadDynamicQuery = 1979, ERR_DynamicAttributeMissing = 1980, WRN_IsDynamicIsConfusing = 1981, //ERR_DynamicNotAllowedInAttribute = 1982, // Replaced by ERR_BadAttributeParamType in Roslyn. ERR_BadAsyncReturn = 1983, ERR_BadAwaitInFinally = 1984, ERR_BadAwaitInCatch = 1985, ERR_BadAwaitArg = 1986, ERR_BadAsyncArgType = 1988, ERR_BadAsyncExpressionTree = 1989, //ERR_WindowsRuntimeTypesMissing = 1990, // unused in Roslyn ERR_MixingWinRTEventWithRegular = 1991, ERR_BadAwaitWithoutAsync = 1992, //ERR_MissingAsyncTypes = 1993, // unused in Roslyn ERR_BadAsyncLacksBody = 1994, ERR_BadAwaitInQuery = 1995, ERR_BadAwaitInLock = 1996, ERR_TaskRetNoObjectRequired = 1997, WRN_AsyncLacksAwaits = 1998, ERR_FileNotFound = 2001, WRN_FileAlreadyIncluded = 2002, //ERR_DuplicateResponseFile = 2003, ERR_NoFileSpec = 2005, ERR_SwitchNeedsString = 2006, ERR_BadSwitch = 2007, WRN_NoSources = 2008, ERR_OpenResponseFile = 2011, ERR_CantOpenFileWrite = 2012, ERR_BadBaseNumber = 2013, // WRN_UseNewSwitch = 2014, //unused. ERR_BinaryFile = 2015, FTL_BadCodepage = 2016, ERR_NoMainOnDLL = 2017, //FTL_NoMessagesDLL = 2018, FTL_InvalidTarget = 2019, //ERR_BadTargetForSecondInputSet = 2020, Roslyn doesn't support building two binaries at once! FTL_InvalidInputFileName = 2021, //ERR_NoSourcesInLastInputSet = 2022, Roslyn doesn't support building two binaries at once! WRN_NoConfigNotOnCommandLine = 2023, ERR_InvalidFileAlignment = 2024, //ERR_NoDebugSwitchSourceMap = 2026, no sourcemap support in Roslyn. //ERR_SourceMapFileBinary = 2027, WRN_DefineIdentifierRequired = 2029, //ERR_InvalidSourceMap = 2030, //ERR_NoSourceMapFile = 2031, //ERR_IllegalOptionChar = 2032, FTL_OutputFileExists = 2033, ERR_OneAliasPerReference = 2034, ERR_SwitchNeedsNumber = 2035, ERR_MissingDebugSwitch = 2036, ERR_ComRefCallInExpressionTree = 2037, WRN_BadUILang = 2038, ERR_InvalidFormatForGuidForOption = 2039, ERR_MissingGuidForOption = 2040, ERR_InvalidOutputName = 2041, ERR_InvalidDebugInformationFormat = 2042, ERR_LegacyObjectIdSyntax = 2043, ERR_SourceLinkRequiresPdb = 2044, ERR_CannotEmbedWithoutPdb = 2045, ERR_BadSwitchValue = 2046, // unused 2047-2999 WRN_CLS_NoVarArgs = 3000, WRN_CLS_BadArgType = 3001, // Requires SymbolDistinguisher. WRN_CLS_BadReturnType = 3002, WRN_CLS_BadFieldPropType = 3003, // WRN_CLS_BadUnicode = 3004, //unused WRN_CLS_BadIdentifierCase = 3005, WRN_CLS_OverloadRefOut = 3006, WRN_CLS_OverloadUnnamed = 3007, WRN_CLS_BadIdentifier = 3008, WRN_CLS_BadBase = 3009, WRN_CLS_BadInterfaceMember = 3010, WRN_CLS_NoAbstractMembers = 3011, WRN_CLS_NotOnModules = 3012, WRN_CLS_ModuleMissingCLS = 3013, WRN_CLS_AssemblyNotCLS = 3014, WRN_CLS_BadAttributeType = 3015, WRN_CLS_ArrayArgumentToAttribute = 3016, WRN_CLS_NotOnModules2 = 3017, WRN_CLS_IllegalTrueInFalse = 3018, WRN_CLS_MeaninglessOnPrivateType = 3019, WRN_CLS_AssemblyNotCLS2 = 3021, WRN_CLS_MeaninglessOnParam = 3022, WRN_CLS_MeaninglessOnReturn = 3023, WRN_CLS_BadTypeVar = 3024, WRN_CLS_VolatileField = 3026, WRN_CLS_BadInterface = 3027, FTL_BadChecksumAlgorithm = 3028, #endregion diagnostics introduced in C# 4 and earlier // unused 3029-3999 #region diagnostics introduced in C# 5 // 4000 unused ERR_BadAwaitArgIntrinsic = 4001, // 4002 unused ERR_BadAwaitAsIdentifier = 4003, ERR_AwaitInUnsafeContext = 4004, ERR_UnsafeAsyncArgType = 4005, ERR_VarargsAsync = 4006, ERR_ByRefTypeAndAwait = 4007, ERR_BadAwaitArgVoidCall = 4008, ERR_NonTaskMainCantBeAsync = 4009, ERR_CantConvAsyncAnonFuncReturns = 4010, ERR_BadAwaiterPattern = 4011, ERR_BadSpecialByRefLocal = 4012, ERR_SpecialByRefInLambda = 4013, WRN_UnobservedAwaitableExpression = 4014, ERR_SynchronizedAsyncMethod = 4015, ERR_BadAsyncReturnExpression = 4016, ERR_NoConversionForCallerLineNumberParam = 4017, ERR_NoConversionForCallerFilePathParam = 4018, ERR_NoConversionForCallerMemberNameParam = 4019, ERR_BadCallerLineNumberParamWithoutDefaultValue = 4020, ERR_BadCallerFilePathParamWithoutDefaultValue = 4021, ERR_BadCallerMemberNameParamWithoutDefaultValue = 4022, ERR_BadPrefer32OnLib = 4023, WRN_CallerLineNumberParamForUnconsumedLocation = 4024, WRN_CallerFilePathParamForUnconsumedLocation = 4025, WRN_CallerMemberNameParamForUnconsumedLocation = 4026, ERR_DoesntImplementAwaitInterface = 4027, ERR_BadAwaitArg_NeedSystem = 4028, ERR_CantReturnVoid = 4029, ERR_SecurityCriticalOrSecuritySafeCriticalOnAsync = 4030, ERR_SecurityCriticalOrSecuritySafeCriticalOnAsyncInClassOrStruct = 4031, ERR_BadAwaitWithoutAsyncMethod = 4032, ERR_BadAwaitWithoutVoidAsyncMethod = 4033, ERR_BadAwaitWithoutAsyncLambda = 4034, // ERR_BadAwaitWithoutAsyncAnonMeth = 4035, Merged with ERR_BadAwaitWithoutAsyncLambda in Roslyn ERR_NoSuchMemberOrExtensionNeedUsing = 4036, #endregion diagnostics introduced in C# 5 // unused 4037-4999 #region diagnostics introduced in C# 6 // WRN_UnknownOption = 5000, //unused in Roslyn ERR_NoEntryPoint = 5001, // huge gap here; available 5002-6999 ERR_UnexpectedAliasedName = 7000, ERR_UnexpectedGenericName = 7002, ERR_UnexpectedUnboundGenericName = 7003, ERR_GlobalStatement = 7006, ERR_BadUsingType = 7007, ERR_ReservedAssemblyName = 7008, ERR_PPReferenceFollowsToken = 7009, ERR_ExpectedPPFile = 7010, ERR_ReferenceDirectiveOnlyAllowedInScripts = 7011, ERR_NameNotInContextPossibleMissingReference = 7012, ERR_MetadataNameTooLong = 7013, ERR_AttributesNotAllowed = 7014, ERR_ExternAliasNotAllowed = 7015, ERR_ConflictingAliasAndDefinition = 7016, ERR_GlobalDefinitionOrStatementExpected = 7017, ERR_ExpectedSingleScript = 7018, ERR_RecursivelyTypedVariable = 7019, ERR_YieldNotAllowedInScript = 7020, ERR_NamespaceNotAllowedInScript = 7021, WRN_MainIgnored = 7022, ERR_StaticInAsOrIs = 7023, ERR_InvalidDelegateType = 7024, ERR_BadVisEventType = 7025, ERR_GlobalAttributesNotAllowed = 7026, ERR_PublicKeyFileFailure = 7027, ERR_PublicKeyContainerFailure = 7028, ERR_FriendRefSigningMismatch = 7029, ERR_CannotPassNullForFriendAssembly = 7030, ERR_SignButNoPrivateKey = 7032, WRN_DelaySignButNoKey = 7033, ERR_InvalidVersionFormat = 7034, WRN_InvalidVersionFormat = 7035, ERR_NoCorrespondingArgument = 7036, // Moot: WRN_DestructorIsNotFinalizer = 7037, ERR_ModuleEmitFailure = 7038, // ERR_NameIllegallyOverrides2 = 7039, // Not used anymore due to 'Single Meaning' relaxation changes // ERR_NameIllegallyOverrides3 = 7040, // Not used anymore due to 'Single Meaning' relaxation changes ERR_ResourceFileNameNotUnique = 7041, ERR_DllImportOnGenericMethod = 7042, ERR_EncUpdateFailedMissingAttribute = 7043, ERR_ParameterNotValidForType = 7045, ERR_AttributeParameterRequired1 = 7046, ERR_AttributeParameterRequired2 = 7047, ERR_SecurityAttributeMissingAction = 7048, ERR_SecurityAttributeInvalidAction = 7049, ERR_SecurityAttributeInvalidActionAssembly = 7050, ERR_SecurityAttributeInvalidActionTypeOrMethod = 7051, ERR_PrincipalPermissionInvalidAction = 7052, ERR_FeatureNotValidInExpressionTree = 7053, ERR_MarshalUnmanagedTypeNotValidForFields = 7054, ERR_MarshalUnmanagedTypeOnlyValidForFields = 7055, ERR_PermissionSetAttributeInvalidFile = 7056, ERR_PermissionSetAttributeFileReadError = 7057, ERR_InvalidVersionFormat2 = 7058, ERR_InvalidAssemblyCultureForExe = 7059, //ERR_AsyncBeforeVersionFive = 7060, ERR_DuplicateAttributeInNetModule = 7061, //WRN_PDBConstantStringValueTooLong = 7063, gave up on this warning ERR_CantOpenIcon = 7064, ERR_ErrorBuildingWin32Resources = 7065, ERR_IteratorInInteractive = 7066, ERR_BadAttributeParamDefaultArgument = 7067, ERR_MissingTypeInSource = 7068, ERR_MissingTypeInAssembly = 7069, ERR_SecurityAttributeInvalidTarget = 7070, ERR_InvalidAssemblyName = 7071, //ERR_PartialTypesBeforeVersionTwo = 7072, //ERR_PartialMethodsBeforeVersionThree = 7073, //ERR_QueryBeforeVersionThree = 7074, //ERR_AnonymousTypeBeforeVersionThree = 7075, //ERR_ImplicitArrayBeforeVersionThree = 7076, //ERR_ObjectInitializerBeforeVersionThree = 7077, //ERR_LambdaBeforeVersionThree = 7078, ERR_NoTypeDefFromModule = 7079, WRN_CallerFilePathPreferredOverCallerMemberName = 7080, WRN_CallerLineNumberPreferredOverCallerMemberName = 7081, WRN_CallerLineNumberPreferredOverCallerFilePath = 7082, ERR_InvalidDynamicCondition = 7083, ERR_WinRtEventPassedByRef = 7084, ERR_ByRefReturnUnsupported = 7085, ERR_NetModuleNameMismatch = 7086, ERR_BadModuleName = 7087, ERR_BadCompilationOptionValue = 7088, ERR_BadAppConfigPath = 7089, WRN_AssemblyAttributeFromModuleIsOverridden = 7090, ERR_CmdOptionConflictsSource = 7091, ERR_FixedBufferTooManyDimensions = 7092, ERR_CantReadConfigFile = 7093, ERR_BadAwaitInCatchFilter = 7094, WRN_FilterIsConstantTrue = 7095, ERR_EncNoPIAReference = 7096, //ERR_EncNoDynamicOperation = 7097, // dynamic operations are now allowed ERR_LinkedNetmoduleMetadataMustProvideFullPEImage = 7098, ERR_MetadataReferencesNotSupported = 7099, ERR_InvalidAssemblyCulture = 7100, ERR_EncReferenceToAddedMember = 7101, ERR_MutuallyExclusiveOptions = 7102, ERR_InvalidDebugInfo = 7103, #endregion diagnostics introduced in C# 6 // unused 7104-8000 #region more diagnostics introduced in Roslyn (C# 6) WRN_UnimplementedCommandLineSwitch = 8001, WRN_ReferencedAssemblyDoesNotHaveStrongName = 8002, ERR_InvalidSignaturePublicKey = 8003, ERR_ExportedTypeConflictsWithDeclaration = 8004, ERR_ExportedTypesConflict = 8005, ERR_ForwardedTypeConflictsWithDeclaration = 8006, ERR_ForwardedTypesConflict = 8007, ERR_ForwardedTypeConflictsWithExportedType = 8008, WRN_RefCultureMismatch = 8009, ERR_AgnosticToMachineModule = 8010, ERR_ConflictingMachineModule = 8011, WRN_ConflictingMachineAssembly = 8012, ERR_CryptoHashFailed = 8013, ERR_MissingNetModuleReference = 8014, ERR_NetModuleNameMustBeUnique = 8015, ERR_UnsupportedTransparentIdentifierAccess = 8016, ERR_ParamDefaultValueDiffersFromAttribute = 8017, WRN_UnqualifiedNestedTypeInCref = 8018, HDN_UnusedUsingDirective = 8019, HDN_UnusedExternAlias = 8020, WRN_NoRuntimeMetadataVersion = 8021, ERR_FeatureNotAvailableInVersion1 = 8022, // Note: one per version to make telemetry easier ERR_FeatureNotAvailableInVersion2 = 8023, ERR_FeatureNotAvailableInVersion3 = 8024, ERR_FeatureNotAvailableInVersion4 = 8025, ERR_FeatureNotAvailableInVersion5 = 8026, // ERR_FeatureNotAvailableInVersion6 is below ERR_FieldHasMultipleDistinctConstantValues = 8027, ERR_ComImportWithInitializers = 8028, WRN_PdbLocalNameTooLong = 8029, ERR_RetNoObjectRequiredLambda = 8030, ERR_TaskRetNoObjectRequiredLambda = 8031, WRN_AnalyzerCannotBeCreated = 8032, WRN_NoAnalyzerInAssembly = 8033, WRN_UnableToLoadAnalyzer = 8034, ERR_CantReadRulesetFile = 8035, ERR_BadPdbData = 8036, // available 8037-8039 INF_UnableToLoadSomeTypesInAnalyzer = 8040, // available 8041-8049 ERR_InitializerOnNonAutoProperty = 8050, ERR_AutoPropertyMustHaveGetAccessor = 8051, // ERR_AutoPropertyInitializerInInterface = 8052, ERR_InstancePropertyInitializerInInterface = 8053, ERR_EnumsCantContainDefaultConstructor = 8054, ERR_EncodinglessSyntaxTree = 8055, // ERR_AccessorListAndExpressionBody = 8056, Deprecated in favor of ERR_BlockBodyAndExpressionBody ERR_BlockBodyAndExpressionBody = 8057, ERR_FeatureIsExperimental = 8058, ERR_FeatureNotAvailableInVersion6 = 8059, // available 8062-8069 ERR_SwitchFallOut = 8070, // available = 8071, ERR_NullPropagatingOpInExpressionTree = 8072, WRN_NubExprIsConstBool2 = 8073, ERR_DictionaryInitializerInExpressionTree = 8074, ERR_ExtensionCollectionElementInitializerInExpressionTree = 8075, ERR_UnclosedExpressionHole = 8076, ERR_SingleLineCommentInExpressionHole = 8077, ERR_InsufficientStack = 8078, ERR_UseDefViolationProperty = 8079, ERR_AutoPropertyMustOverrideSet = 8080, ERR_ExpressionHasNoName = 8081, ERR_SubexpressionNotInNameof = 8082, ERR_AliasQualifiedNameNotAnExpression = 8083, ERR_NameofMethodGroupWithTypeParameters = 8084, ERR_NoAliasHere = 8085, ERR_UnescapedCurly = 8086, ERR_EscapedCurly = 8087, ERR_TrailingWhitespaceInFormatSpecifier = 8088, ERR_EmptyFormatSpecifier = 8089, ERR_ErrorInReferencedAssembly = 8090, ERR_ExternHasConstructorInitializer = 8091, ERR_ExpressionOrDeclarationExpected = 8092, ERR_NameofExtensionMethod = 8093, WRN_AlignmentMagnitude = 8094, ERR_ConstantStringTooLong = 8095, ERR_DebugEntryPointNotSourceMethodDefinition = 8096, ERR_LoadDirectiveOnlyAllowedInScripts = 8097, ERR_PPLoadFollowsToken = 8098, ERR_SourceFileReferencesNotSupported = 8099, ERR_BadAwaitInStaticVariableInitializer = 8100, ERR_InvalidPathMap = 8101, ERR_PublicSignButNoKey = 8102, ERR_TooManyUserStrings = 8103, ERR_PeWritingFailure = 8104, #endregion diagnostics introduced in Roslyn (C# 6) #region diagnostics introduced in C# 6 updates WRN_AttributeIgnoredWhenPublicSigning = 8105, ERR_OptionMustBeAbsolutePath = 8106, #endregion diagnostics introduced in C# 6 updates ERR_FeatureNotAvailableInVersion7 = 8107, #region diagnostics for local functions introduced in C# 7 ERR_DynamicLocalFunctionParamsParameter = 8108, ERR_ExpressionTreeContainsLocalFunction = 8110, #endregion diagnostics for local functions introduced in C# 7 #region diagnostics for instrumentation ERR_InvalidInstrumentationKind = 8111, #endregion ERR_LocalFunctionMissingBody = 8112, ERR_InvalidHashAlgorithmName = 8113, // Unused 8113, 8114, 8115 #region diagnostics for pattern-matching introduced in C# 7 ERR_ThrowMisplaced = 8115, ERR_PatternNullableType = 8116, ERR_BadPatternExpression = 8117, ERR_SwitchExpressionValueExpected = 8119, ERR_SwitchCaseSubsumed = 8120, ERR_PatternWrongType = 8121, ERR_ExpressionTreeContainsIsMatch = 8122, #endregion diagnostics for pattern-matching introduced in C# 7 #region tuple diagnostics introduced in C# 7 WRN_TupleLiteralNameMismatch = 8123, ERR_TupleTooFewElements = 8124, ERR_TupleReservedElementName = 8125, ERR_TupleReservedElementNameAnyPosition = 8126, ERR_TupleDuplicateElementName = 8127, ERR_PredefinedTypeMemberNotFoundInAssembly = 8128, ERR_MissingDeconstruct = 8129, ERR_TypeInferenceFailedForImplicitlyTypedDeconstructionVariable = 8130, ERR_DeconstructRequiresExpression = 8131, ERR_DeconstructWrongCardinality = 8132, ERR_CannotDeconstructDynamic = 8133, ERR_DeconstructTooFewElements = 8134, ERR_ConversionNotTupleCompatible = 8135, ERR_DeconstructionVarFormDisallowsSpecificType = 8136, ERR_TupleElementNamesAttributeMissing = 8137, ERR_ExplicitTupleElementNamesAttribute = 8138, ERR_CantChangeTupleNamesOnOverride = 8139, ERR_DuplicateInterfaceWithTupleNamesInBaseList = 8140, ERR_ImplBadTupleNames = 8141, ERR_PartialMethodInconsistentTupleNames = 8142, ERR_ExpressionTreeContainsTupleLiteral = 8143, ERR_ExpressionTreeContainsTupleConversion = 8144, #endregion tuple diagnostics introduced in C# 7 #region diagnostics for ref locals and ref returns introduced in C# 7 ERR_AutoPropertyCannotBeRefReturning = 8145, ERR_RefPropertyMustHaveGetAccessor = 8146, ERR_RefPropertyCannotHaveSetAccessor = 8147, ERR_CantChangeRefReturnOnOverride = 8148, ERR_MustNotHaveRefReturn = 8149, ERR_MustHaveRefReturn = 8150, ERR_RefReturnMustHaveIdentityConversion = 8151, ERR_CloseUnimplementedInterfaceMemberWrongRefReturn = 8152, ERR_RefReturningCallInExpressionTree = 8153, ERR_BadIteratorReturnRef = 8154, ERR_BadRefReturnExpressionTree = 8155, ERR_RefReturnLvalueExpected = 8156, ERR_RefReturnNonreturnableLocal = 8157, ERR_RefReturnNonreturnableLocal2 = 8158, ERR_RefReturnRangeVariable = 8159, ERR_RefReturnReadonly = 8160, ERR_RefReturnReadonlyStatic = 8161, ERR_RefReturnReadonly2 = 8162, ERR_RefReturnReadonlyStatic2 = 8163, // ERR_RefReturnCall = 8164, we use more general ERR_EscapeCall now // ERR_RefReturnCall2 = 8165, we use more general ERR_EscapeCall2 now ERR_RefReturnParameter = 8166, ERR_RefReturnParameter2 = 8167, ERR_RefReturnLocal = 8168, ERR_RefReturnLocal2 = 8169, ERR_RefReturnStructThis = 8170, ERR_InitializeByValueVariableWithReference = 8171, ERR_InitializeByReferenceVariableWithValue = 8172, ERR_RefAssignmentMustHaveIdentityConversion = 8173, ERR_ByReferenceVariableMustBeInitialized = 8174, ERR_AnonDelegateCantUseLocal = 8175, ERR_BadIteratorLocalType = 8176, ERR_BadAsyncLocalType = 8177, ERR_RefReturningCallAndAwait = 8178, #endregion diagnostics for ref locals and ref returns introduced in C# 7 #region stragglers for C# 7 ERR_PredefinedValueTupleTypeNotFound = 8179, // We need a specific error code for ValueTuple as an IDE codefix depends on it (AddNuget) ERR_SemiOrLBraceOrArrowExpected = 8180, ERR_NewWithTupleTypeSyntax = 8181, ERR_PredefinedValueTupleTypeMustBeStruct = 8182, ERR_DiscardTypeInferenceFailed = 8183, ERR_MixedDeconstructionUnsupported = 8184, ERR_DeclarationExpressionNotPermitted = 8185, ERR_MustDeclareForeachIteration = 8186, ERR_TupleElementNamesInDeconstruction = 8187, ERR_ExpressionTreeContainsThrowExpression = 8188, ERR_DelegateRefMismatch = 8189, #endregion stragglers for C# 7 #region diagnostics for parse options ERR_BadSourceCodeKind = 8190, ERR_BadDocumentationMode = 8191, ERR_BadLanguageVersion = 8192, #endregion // Unused 8193-8195 #region diagnostics for out var ERR_ImplicitlyTypedOutVariableUsedInTheSameArgumentList = 8196, ERR_TypeInferenceFailedForImplicitlyTypedOutVariable = 8197, ERR_ExpressionTreeContainsOutVariable = 8198, #endregion diagnostics for out var #region more stragglers for C# 7 ERR_VarInvocationLvalueReserved = 8199, //ERR_ExpressionVariableInConstructorOrFieldInitializer = 8200, //ERR_ExpressionVariableInQueryClause = 8201, ERR_PublicSignNetModule = 8202, ERR_BadAssemblyName = 8203, ERR_BadAsyncMethodBuilderTaskProperty = 8204, ERR_AttributesInLocalFuncDecl = 8205, ERR_TypeForwardedToMultipleAssemblies = 8206, ERR_ExpressionTreeContainsDiscard = 8207, ERR_PatternDynamicType = 8208, ERR_VoidAssignment = 8209, ERR_VoidInTuple = 8210, #endregion more stragglers for C# 7 #region diagnostics introduced for C# 7.1 ERR_Merge_conflict_marker_encountered = 8300, ERR_InvalidPreprocessingSymbol = 8301, ERR_FeatureNotAvailableInVersion7_1 = 8302, ERR_LanguageVersionCannotHaveLeadingZeroes = 8303, ERR_CompilerAndLanguageVersion = 8304, WRN_Experimental = 8305, ERR_TupleInferredNamesNotAvailable = 8306, ERR_TypelessTupleInAs = 8307, ERR_NoRefOutWhenRefOnly = 8308, ERR_NoNetModuleOutputWhenRefOutOrRefOnly = 8309, ERR_BadOpOnNullOrDefaultOrNew = 8310, // ERR_BadDynamicMethodArgDefaultLiteral = 8311, ERR_DefaultLiteralNotValid = 8312, // ERR_DefaultInSwitch = 8313, ERR_PatternWrongGenericTypeInVersion = 8314, ERR_AmbigBinaryOpsOnDefault = 8315, #endregion diagnostics introduced for C# 7.1 #region diagnostics introduced for C# 7.2 ERR_FeatureNotAvailableInVersion7_2 = 8320, WRN_UnreferencedLocalFunction = 8321, ERR_DynamicLocalFunctionTypeParameter = 8322, ERR_BadNonTrailingNamedArgument = 8323, ERR_NamedArgumentSpecificationBeforeFixedArgumentInDynamicInvocation = 8324, #endregion diagnostics introduced for C# 7.2 #region diagnostics introduced for `ref readonly`, `ref conditional` and `ref-like` features in C# 7.2 ERR_RefConditionalAndAwait = 8325, ERR_RefConditionalNeedsTwoRefs = 8326, ERR_RefConditionalDifferentTypes = 8327, ERR_BadParameterModifiers = 8328, ERR_RefReadonlyNotField = 8329, ERR_RefReadonlyNotField2 = 8330, ERR_AssignReadonlyNotField = 8331, ERR_AssignReadonlyNotField2 = 8332, ERR_RefReturnReadonlyNotField = 8333, ERR_RefReturnReadonlyNotField2 = 8334, ERR_ExplicitReservedAttr = 8335, ERR_TypeReserved = 8336, ERR_RefExtensionMustBeValueTypeOrConstrainedToOne = 8337, ERR_InExtensionMustBeValueType = 8338, // ERR_BadParameterModifiersOrder = 8339, // Modifier ordering is relaxed ERR_FieldsInRoStruct = 8340, ERR_AutoPropsInRoStruct = 8341, ERR_FieldlikeEventsInRoStruct = 8342, ERR_RefStructInterfaceImpl = 8343, ERR_BadSpecialByRefIterator = 8344, ERR_FieldAutoPropCantBeByRefLike = 8345, ERR_StackAllocConversionNotPossible = 8346, ERR_EscapeCall = 8347, ERR_EscapeCall2 = 8348, ERR_EscapeOther = 8349, ERR_CallArgMixing = 8350, ERR_MismatchedRefEscapeInTernary = 8351, ERR_EscapeLocal = 8352, ERR_EscapeStackAlloc = 8353, ERR_RefReturnThis = 8354, ERR_OutAttrOnInParam = 8355, #endregion diagnostics introduced for `ref readonly`, `ref conditional` and `ref-like` features in C# 7.2 ERR_PredefinedValueTupleTypeAmbiguous3 = 8356, ERR_InvalidVersionFormatDeterministic = 8357, ERR_AttributeCtorInParameter = 8358, #region diagnostics for FilterIsConstant warning message fix WRN_FilterIsConstantFalse = 8359, WRN_FilterIsConstantFalseRedundantTryCatch = 8360, #endregion diagnostics for FilterIsConstant warning message fix ERR_ConditionalInInterpolation = 8361, ERR_CantUseVoidInArglist = 8362, ERR_InDynamicMethodArg = 8364, #region diagnostics introduced for C# 7.3 ERR_FeatureNotAvailableInVersion7_3 = 8370, WRN_AttributesOnBackingFieldsNotAvailable = 8371, ERR_DoNotUseFixedBufferAttrOnProperty = 8372, ERR_RefLocalOrParamExpected = 8373, ERR_RefAssignNarrower = 8374, ERR_NewBoundWithUnmanaged = 8375, ERR_UnmanagedConstraintMustBeFirst = 8376, ERR_UnmanagedConstraintNotSatisfied = 8377, ERR_CantUseInOrOutInArglist = 8378, ERR_ConWithUnmanagedCon = 8379, ERR_UnmanagedBoundWithClass = 8380, ERR_InvalidStackAllocArray = 8381, ERR_ExpressionTreeContainsTupleBinOp = 8382, WRN_TupleBinopLiteralNameMismatch = 8383, ERR_TupleSizesMismatchForBinOps = 8384, ERR_ExprCannotBeFixed = 8385, ERR_InvalidObjectCreation = 8386, #endregion diagnostics introduced for C# 7.3 WRN_TypeParameterSameAsOuterMethodTypeParameter = 8387, ERR_OutVariableCannotBeByRef = 8388, #region diagnostics introduced for C# 8.0 ERR_FeatureNotAvailableInVersion8 = 8400, ERR_AltInterpolatedVerbatimStringsNotAvailable = 8401, // Unused 8402 ERR_IteratorMustBeAsync = 8403, ERR_NoConvToIAsyncDisp = 8410, ERR_AwaitForEachMissingMember = 8411, ERR_BadGetAsyncEnumerator = 8412, ERR_MultipleIAsyncEnumOfT = 8413, ERR_ForEachMissingMemberWrongAsync = 8414, ERR_AwaitForEachMissingMemberWrongAsync = 8415, ERR_BadDynamicAwaitForEach = 8416, ERR_NoConvToIAsyncDispWrongAsync = 8417, ERR_NoConvToIDispWrongAsync = 8418, ERR_PossibleAsyncIteratorWithoutYield = 8419, ERR_PossibleAsyncIteratorWithoutYieldOrAwait = 8420, ERR_StaticLocalFunctionCannotCaptureVariable = 8421, ERR_StaticLocalFunctionCannotCaptureThis = 8422, ERR_AttributeNotOnEventAccessor = 8423, WRN_UnconsumedEnumeratorCancellationAttributeUsage = 8424, WRN_UndecoratedCancellationTokenParameter = 8425, ERR_MultipleEnumeratorCancellationAttributes = 8426, ERR_VarianceInterfaceNesting = 8427, ERR_ImplicitIndexIndexerWithName = 8428, ERR_ImplicitRangeIndexerWithName = 8429, // available range #region diagnostics introduced for recursive patterns ERR_WrongNumberOfSubpatterns = 8502, ERR_PropertyPatternNameMissing = 8503, ERR_MissingPattern = 8504, ERR_DefaultPattern = 8505, ERR_SwitchExpressionNoBestType = 8506, // ERR_SingleElementPositionalPatternRequiresDisambiguation = 8507, // Retired C# 8 diagnostic ERR_VarMayNotBindToType = 8508, WRN_SwitchExpressionNotExhaustive = 8509, ERR_SwitchArmSubsumed = 8510, ERR_ConstantPatternVsOpenType = 8511, WRN_CaseConstantNamedUnderscore = 8512, WRN_IsTypeNamedUnderscore = 8513, ERR_ExpressionTreeContainsSwitchExpression = 8514, ERR_SwitchGoverningExpressionRequiresParens = 8515, ERR_TupleElementNameMismatch = 8516, ERR_DeconstructParameterNameMismatch = 8517, ERR_IsPatternImpossible = 8518, WRN_GivenExpressionNeverMatchesPattern = 8519, WRN_GivenExpressionAlwaysMatchesConstant = 8520, ERR_PointerTypeInPatternMatching = 8521, ERR_ArgumentNameInITuplePattern = 8522, ERR_DiscardPatternInSwitchStatement = 8523, // available 8524-8596 #endregion diagnostics introduced for recursive patterns WRN_ThrowPossibleNull = 8597, ERR_IllegalSuppression = 8598, // available 8599, WRN_ConvertingNullableToNonNullable = 8600, WRN_NullReferenceAssignment = 8601, WRN_NullReferenceReceiver = 8602, WRN_NullReferenceReturn = 8603, WRN_NullReferenceArgument = 8604, WRN_UnboxPossibleNull = 8605, // WRN_NullReferenceIterationVariable = 8606 (unavailable, may be used in warning suppressions in early C# 8.0 code) WRN_DisallowNullAttributeForbidsMaybeNullAssignment = 8607, WRN_NullabilityMismatchInTypeOnOverride = 8608, WRN_NullabilityMismatchInReturnTypeOnOverride = 8609, WRN_NullabilityMismatchInParameterTypeOnOverride = 8610, WRN_NullabilityMismatchInParameterTypeOnPartial = 8611, WRN_NullabilityMismatchInTypeOnImplicitImplementation = 8612, WRN_NullabilityMismatchInReturnTypeOnImplicitImplementation = 8613, WRN_NullabilityMismatchInParameterTypeOnImplicitImplementation = 8614, WRN_NullabilityMismatchInTypeOnExplicitImplementation = 8615, WRN_NullabilityMismatchInReturnTypeOnExplicitImplementation = 8616, WRN_NullabilityMismatchInParameterTypeOnExplicitImplementation = 8617, WRN_UninitializedNonNullableField = 8618, WRN_NullabilityMismatchInAssignment = 8619, WRN_NullabilityMismatchInArgument = 8620, WRN_NullabilityMismatchInReturnTypeOfTargetDelegate = 8621, WRN_NullabilityMismatchInParameterTypeOfTargetDelegate = 8622, ERR_ExplicitNullableAttribute = 8623, WRN_NullabilityMismatchInArgumentForOutput = 8624, WRN_NullAsNonNullable = 8625, //WRN_AsOperatorMayReturnNull = 8626, ERR_NullableUnconstrainedTypeParameter = 8627, ERR_AnnotationDisallowedInObjectCreation = 8628, WRN_NullableValueTypeMayBeNull = 8629, ERR_NullableOptionNotAvailable = 8630, WRN_NullabilityMismatchInTypeParameterConstraint = 8631, WRN_MissingNonNullTypesContextForAnnotation = 8632, WRN_NullabilityMismatchInConstraintsOnImplicitImplementation = 8633, WRN_NullabilityMismatchInTypeParameterReferenceTypeConstraint = 8634, ERR_TripleDotNotAllowed = 8635, ERR_BadNullableContextOption = 8636, ERR_NullableDirectiveQualifierExpected = 8637, //WRN_ConditionalAccessMayReturnNull = 8638, ERR_BadNullableTypeof = 8639, ERR_ExpressionTreeCantContainRefStruct = 8640, ERR_ElseCannotStartStatement = 8641, ERR_ExpressionTreeCantContainNullCoalescingAssignment = 8642, WRN_NullabilityMismatchInExplicitlyImplementedInterface = 8643, WRN_NullabilityMismatchInInterfaceImplementedByBase = 8644, WRN_DuplicateInterfaceWithNullabilityMismatchInBaseList = 8645, ERR_DuplicateExplicitImpl = 8646, ERR_UsingVarInSwitchCase = 8647, ERR_GoToForwardJumpOverUsingVar = 8648, ERR_GoToBackwardJumpOverUsingVar = 8649, ERR_IsNullableType = 8650, ERR_AsNullableType = 8651, ERR_FeatureInPreview = 8652, //WRN_DefaultExpressionMayIntroduceNullT = 8653, //WRN_NullLiteralMayIntroduceNullT = 8654, WRN_SwitchExpressionNotExhaustiveForNull = 8655, WRN_ImplicitCopyInReadOnlyMember = 8656, ERR_StaticMemberCantBeReadOnly = 8657, ERR_AutoSetterCantBeReadOnly = 8658, ERR_AutoPropertyWithSetterCantBeReadOnly = 8659, ERR_InvalidPropertyReadOnlyMods = 8660, ERR_DuplicatePropertyReadOnlyMods = 8661, ERR_FieldLikeEventCantBeReadOnly = 8662, ERR_PartialMethodReadOnlyDifference = 8663, ERR_ReadOnlyModMissingAccessor = 8664, ERR_OverrideRefConstraintNotSatisfied = 8665, ERR_OverrideValConstraintNotSatisfied = 8666, WRN_NullabilityMismatchInConstraintsOnPartialImplementation = 8667, ERR_NullableDirectiveTargetExpected = 8668, WRN_MissingNonNullTypesContextForAnnotationInGeneratedCode = 8669, WRN_NullReferenceInitializer = 8670, ERR_MultipleAnalyzerConfigsInSameDir = 8700, ERR_RuntimeDoesNotSupportDefaultInterfaceImplementation = 8701, ERR_RuntimeDoesNotSupportDefaultInterfaceImplementationForMember = 8702, ERR_DefaultInterfaceImplementationModifier = 8703, ERR_ImplicitImplementationOfNonPublicInterfaceMember = 8704, ERR_MostSpecificImplementationIsNotFound = 8705, ERR_LanguageVersionDoesNotSupportDefaultInterfaceImplementationForMember = 8706, ERR_RuntimeDoesNotSupportProtectedAccessForInterfaceMember = 8707, //ERR_NotBaseOrImplementedInterface = 8708, //ERR_NotImplementedInBase = 8709, //ERR_NotDeclaredInBase = 8710, ERR_DefaultInterfaceImplementationInNoPIAType = 8711, ERR_AbstractEventHasAccessors = 8712, ERR_NotNullConstraintMustBeFirst = 8713, WRN_NullabilityMismatchInTypeParameterNotNullConstraint = 8714, ERR_DuplicateNullSuppression = 8715, ERR_DefaultLiteralNoTargetType = 8716, ERR_ReAbstractionInNoPIAType = 8750, #endregion diagnostics introduced for C# 8.0 #region diagnostics introduced in preview ERR_InternalError = 8751, ERR_TypelessNewIllegalTargetType = 8752, ERR_TypelessNewNotValid = 8753, ERR_TypelessNewNoTargetType = 8754, ERR_BadFuncPointerParamModifier = 8755, ERR_BadFuncPointerArgCount = 8756, ERR_MethFuncPtrMismatch = 8757, ERR_FuncPtrRefMismatch = 8758, ERR_FuncPtrMethMustBeStatic = 8759, ERR_ExternEventInitializer = 8760, ERR_AmbigBinaryOpsOnUnconstrainedDefault = 8761, WRN_ParameterConditionallyDisallowsNull = 8762, WRN_ShouldNotReturn = 8763, WRN_TopLevelNullabilityMismatchInReturnTypeOnOverride = 8764, WRN_TopLevelNullabilityMismatchInParameterTypeOnOverride = 8765, WRN_TopLevelNullabilityMismatchInReturnTypeOnImplicitImplementation = 8766, WRN_TopLevelNullabilityMismatchInParameterTypeOnImplicitImplementation = 8767, WRN_TopLevelNullabilityMismatchInReturnTypeOnExplicitImplementation = 8768, WRN_TopLevelNullabilityMismatchInParameterTypeOnExplicitImplementation = 8769, WRN_DoesNotReturnMismatch = 8770, ERR_NoOutputDirectory = 8771, ERR_StdInOptionProvidedButConsoleInputIsNotRedirected = 8772, // available 8773 WRN_MemberNotNull = 8774, WRN_MemberNotNullWhen = 8775, WRN_MemberNotNullBadMember = 8776, WRN_ParameterDisallowsNull = 8777, ERR_DesignatorBeneathPatternCombinator = 8780, ERR_UnsupportedTypeForRelationalPattern = 8781, ERR_RelationalPatternWithNaN = 8782, ERR_ConditionalOnLocalFunction = 8783, WRN_GeneratorFailedDuringInitialization = 8784, WRN_GeneratorFailedDuringGeneration = 8785, ERR_WrongFuncPtrCallingConvention = 8786, ERR_MissingAddressOf = 8787, ERR_CannotUseReducedExtensionMethodInAddressOf = 8788, ERR_CannotUseFunctionPointerAsFixedLocal = 8789, ERR_ExpressionTreeContainsPatternIndexOrRangeIndexer = 8790, ERR_ExpressionTreeContainsFromEndIndexExpression = 8791, ERR_ExpressionTreeContainsRangeExpression = 8792, WRN_GivenExpressionAlwaysMatchesPattern = 8793, WRN_IsPatternAlways = 8794, ERR_PartialMethodWithAccessibilityModsMustHaveImplementation = 8795, ERR_PartialMethodWithNonVoidReturnMustHaveAccessMods = 8796, ERR_PartialMethodWithOutParamMustHaveAccessMods = 8797, ERR_PartialMethodWithExtendedModMustHaveAccessMods = 8798, ERR_PartialMethodAccessibilityDifference = 8799, ERR_PartialMethodExtendedModDifference = 8800, ERR_SimpleProgramLocalIsReferencedOutsideOfTopLevelStatement = 8801, ERR_SimpleProgramMultipleUnitsWithTopLevelStatements = 8802, ERR_TopLevelStatementAfterNamespaceOrType = 8803, ERR_SimpleProgramDisallowsMainType = 8804, ERR_SimpleProgramNotAnExecutable = 8805, ERR_UnsupportedCallingConvention = 8806, ERR_InvalidFunctionPointerCallingConvention = 8807, ERR_InvalidFuncPointerReturnTypeModifier = 8808, ERR_DupReturnTypeMod = 8809, ERR_AddressOfMethodGroupInExpressionTree = 8810, ERR_CannotConvertAddressOfToDelegate = 8811, ERR_AddressOfToNonFunctionPointer = 8812, ERR_BadRecordDeclaration = 8850, ERR_DuplicateRecordConstructor = 8851, ERR_AssignmentInitOnly = 8852, ERR_CantChangeInitOnlyOnOverride = 8853, ERR_CloseUnimplementedInterfaceMemberWrongInitOnly = 8854, ERR_ExplicitPropertyMismatchInitOnly = 8855, ERR_BadInitAccessor = 8856, ERR_InvalidWithReceiverType = 8857, ERR_NoSingleCloneMethod = 8858, ERR_UnexpectedArgumentList = 8861, ERR_UnexpectedOrMissingConstructorInitializerInRecord = 8862, ERR_MultipleRecordParameterLists = 8863, ERR_BadRecordBase = 8864, ERR_BadInheritanceFromRecord = 8865, ERR_BadRecordMemberForPositionalParameter = 8866, ERR_NoCopyConstructorInBaseType = 8867, ERR_CopyConstructorMustInvokeBaseCopyConstructor = 8868, #endregion // Note: you will need to re-generate compiler code after adding warnings (eng\generate-compiler-code.cmd) } }
45.380694
186
0.698932
[ "MIT" ]
Kuinox/roslyn
src/Compilers/CSharp/Portable/Errors/ErrorCode.cs
83,684
C#
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.18444 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ namespace pwiz.Topograph.ui.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); public static Settings Default { get { return defaultInstance; } } [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("")] public string WorkspaceDirectory { get { return ((string)(this["WorkspaceDirectory"])); } set { this["WorkspaceDirectory"] = value; } } [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("")] public string SearchResultsDirectory { get { return ((string)(this["SearchResultsDirectory"])); } set { this["SearchResultsDirectory"] = value; } } [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("")] public string RawFilesDirectory { get { return ((string)(this["RawFilesDirectory"])); } set { this["RawFilesDirectory"] = value; } } [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("False")] public bool PeaksAsVerticalLines { get { return ((bool)(this["PeaksAsVerticalLines"])); } set { this["PeaksAsVerticalLines"] = value; } } [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("True")] public bool PeaksAsHorizontalLines { get { return ((bool)(this["PeaksAsHorizontalLines"])); } set { this["PeaksAsHorizontalLines"] = value; } } [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("False")] public bool SmoothChromatograms { get { return ((bool)(this["SmoothChromatograms"])); } set { this["SmoothChromatograms"] = value; } } [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("8")] public int MruLength { get { return ((int)(this["MruLength"])); } set { this["MruLength"] = value; } } [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("200000")] public double MassAccuracy { get { return ((double)(this["MassAccuracy"])); } set { this["MassAccuracy"] = value; } } [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("False")] public bool ShowChromatogramScore { get { return ((bool)(this["ShowChromatogramScore"])); } set { this["ShowChromatogramScore"] = value; } } [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("")] public string ExportResultsDirectory { get { return ((string)(this["ExportResultsDirectory"])); } set { this["ExportResultsDirectory"] = value; } } [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("")] public string FastaDirectory { get { return ((string)(this["FastaDirectory"])); } set { this["FastaDirectory"] = value; } } [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("1")] public float ChromatogramLineWidth { get { return ((float)(this["ChromatogramLineWidth"])); } set { this["ChromatogramLineWidth"] = value; } } } }
38.807018
152
0.550633
[ "Apache-2.0" ]
shze/pwizard-deb
pwiz_tools/Topograph/TopographApp/Properties/Settings.Designer.cs
6,638
C#
namespace ex36PastelariaMVC.Utils { public class MenuUtil { public static void MenuDeslogado(){ System.Console.WriteLine("-------------------------------------------"); System.Console.WriteLine("----------Restaurante PastelStore----------"); System.Console.WriteLine("-------------------Conta-------------------"); System.Console.WriteLine("-------------------------------------------"); System.Console.WriteLine(" (1) Cadastrar Usuário "); System.Console.WriteLine(" (2) Efetuar Login "); System.Console.WriteLine(" (3) Listar "); System.Console.WriteLine("-------------------------------------------"); System.Console.WriteLine(" (0)Sair "); System.Console.WriteLine("-------------------------------------------"); System.Console.WriteLine(" Escolha uma opção "); } public static void MenuLogado(){ System.Console.WriteLine("-------------------------------------------"); System.Console.WriteLine("----------Restaurante PastelStore----------"); System.Console.WriteLine("-----------------Cardápio------------------"); System.Console.WriteLine("-------------------------------------------"); System.Console.WriteLine(" (1) Cadastrar Produto "); System.Console.WriteLine(" (2) Listar todos os produtos "); System.Console.WriteLine(" (3) Buscar Produto por ID "); System.Console.WriteLine("-------------------------------------------"); System.Console.WriteLine(" (0)Sair "); System.Console.WriteLine("-------------------------------------------"); System.Console.WriteLine(" Escolha uma opção "); } } }
55.972973
84
0.377113
[ "MIT" ]
CleAurora/C-
ex36PastelariaMVC/Utils/MenuUtil.cs
2,077
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 guardduty-2017-11-28.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.GuardDuty.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.GuardDuty.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for PortProbeAction Object /// </summary> public class PortProbeActionUnmarshaller : IUnmarshaller<PortProbeAction, XmlUnmarshallerContext>, IUnmarshaller<PortProbeAction, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> PortProbeAction IUnmarshaller<PortProbeAction, XmlUnmarshallerContext>.Unmarshall(XmlUnmarshallerContext context) { throw new NotImplementedException(); } /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public PortProbeAction Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) return null; PortProbeAction unmarshalledObject = new PortProbeAction(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("blocked", targetDepth)) { var unmarshaller = BoolUnmarshaller.Instance; unmarshalledObject.Blocked = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("portProbeDetails", targetDepth)) { var unmarshaller = new ListUnmarshaller<PortProbeDetail, PortProbeDetailUnmarshaller>(PortProbeDetailUnmarshaller.Instance); unmarshalledObject.PortProbeDetails = unmarshaller.Unmarshall(context); continue; } } return unmarshalledObject; } private static PortProbeActionUnmarshaller _instance = new PortProbeActionUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static PortProbeActionUnmarshaller Instance { get { return _instance; } } } }
36.326531
159
0.620225
[ "Apache-2.0" ]
philasmar/aws-sdk-net
sdk/src/Services/GuardDuty/Generated/Model/Internal/MarshallTransformations/PortProbeActionUnmarshaller.cs
3,560
C#
using UnityEngine; using System.Collections; using System.Collections.Generic; namespace mx { namespace Grids { public class GridMover : MonoBehaviour { [SerializeField] private int m_speed = 1; [SerializeField] private string[] m_gridNames; private GridData m_gridData = null; private GridPoint m_gridPosition; private Vector3 m_offset; private void Awake() { if (m_gridNames.Length > 0) { // You can easily access your grids at runtime via their "ID" property on the GridData object. // GridManager follows the Singleton pattern: it creates itself the first time you call it. m_gridData = GridManager.instance.GetGrid(m_gridNames[0]); } ResetGridPosition(); } private void Update() { // Some simple arrow key movement using GridPoints. // Technically GridPoints are almost exactly the same as Vector3, except that they use // integers instead of floats for their components. This allows you to be more precise and clear // when you're using grid-space calculations vs when you're using unity-space. GridPoint direction = GridPoint.zero; if (Input.GetKeyDown(KeyCode.UpArrow) || Input.GetKeyDown(KeyCode.W)) { direction += GridPoint.forward; } if (Input.GetKeyDown(KeyCode.DownArrow) || Input.GetKeyDown(KeyCode.S)) { direction -= GridPoint.forward; } if (Input.GetKeyDown(KeyCode.RightArrow) || Input.GetKeyDown(KeyCode.D)) { direction += GridPoint.right; } if (Input.GetKeyDown(KeyCode.LeftArrow) || Input.GetKeyDown(KeyCode.A)) { direction -= GridPoint.right; } if (direction != GridPoint.zero) { Move(direction * m_speed); } } private void Move(GridPoint delta) { // Change the gridposition by delta, but GridPoint has no context what grid its related to, // so for it to obey clamping/wrapping etc. we ask the Grid to snap our new GridPoint. m_gridPosition = m_gridData.SnapGridPoint(m_gridPosition + delta); // This is the actual position update of the GameObject. this.transform.position = m_gridData.GridPointToWorldPosition(m_gridPosition); } private void ResetGridPosition() { // Ensure our grid position represents our world position appropriately m_gridPosition = m_gridData.WorldPositionToGridPoint(this.transform.position); // And make sure we're actually snapped to the grid this.transform.position = m_gridData.SnapPosition(this.transform.position); } private void OnGUI() { foreach (string gridName in m_gridNames) { GUI.color = (m_gridData.name == gridName ? Color.green : Color.white); if (GUILayout.Button(gridName)) { m_gridData = GridManager.instance.GetGrid(gridName); ResetGridPosition(); } GUI.color = Color.white; } GUILayout.Label("Current Grid: " + m_gridData.name); GUILayout.Label("Grid Coordinates: " + m_gridPosition); GUILayout.Label(""); GUILayout.Label("Use the arrow keys or WASD to move the \npiece along the selected grid."); } } } }
30.961538
101
0.667081
[ "MIT" ]
madya121/Window
Window/Assets/Grids MX/Examples/2-IngameExample/Scripts/GridMover.cs
3,222
C#
using System; namespace Vs.Core.Web.OpenApi.v1.Dto.ProtocolErrors { /// <summary> /// Standard resource not found response (404). /// </summary> public class NotFound404Response { /// <summary> /// The endoint of the resource that could not be obtained. /// </summary> /// <value> /// The endpoint. /// </value> public Uri Endpoint { get; set; } } }
22.736842
67
0.548611
[ "MIT" ]
sjefvanleeuwen/morstead
src/core/Vs.Core.Web.OpenApi/v1/Dto/ProtocolErrors/NotFound404Response.cs
434
C#
namespace Test.Fluentmigrator.Exceptions { public class TriggerNotFoundException : MigrationFailedException { public TriggerNotFoundException(string databaseName, string tableName, string triggerName, string triggerContent) : base($"The {triggerName} Trigger was not found in the {tableName} table in the {databaseName} database. Content: {triggerContent}") { } } }
56.428571
149
0.751899
[ "MIT" ]
samukce/test.fluentmigrator
Test.Fluentmigrator/Exceptions/TriggerNotFoundException.cs
397
C#
using System; using Microsoft.AspNetCore.Components; namespace Blazored.Modal.Services { public interface IModalService { /// <summary> /// Invoked when the modal component closes. /// </summary> event Action<ModalResult> OnClose; /// <summary> /// Shows the modal using the specified title and component type. /// </summary> /// <param name="title">Modal title.</param> void Show<T>(string title) where T : ComponentBase; /// <summary> /// Shows the modal using the specified title and component type. /// </summary> /// <param name="title">Modal title.</param> /// <param name="options">Options to configure the modal.</param> void Show<T>(string title, ModalOptions options) where T : ComponentBase; /// <summary> /// Shows the modal using the specified <paramref name="title"/> and <paramref name="componentType"/>, /// passing the specified <paramref name="parameters"/>. /// </summary> /// <param name="title">Modal title.</param> /// <param name="parameters">Key/Value collection of parameters to pass to component being displayed.</param> void Show<T>(string title, ModalParameters parameters) where T : ComponentBase; /// <summary> /// Shows the modal for the specified component type using the specified <paramref name="title"/> /// and the specified <paramref name="parameters"/> and settings a custom modal <paramref name="options"/> /// </summary> /// <typeparam name="T">Type of component to display.</typeparam> /// <param name="title">Modal title.</param> /// <param name="parameters">Key/Value collection of parameters to pass to component being displayed.</param> /// <param name="options">Options to configure the modal.</param> void Show<T>(string title, ModalParameters parameters = null, ModalOptions options = null) where T : ComponentBase; /// <summary> /// Cancels the modal and invokes the <see cref="OnClose"/> event. /// </summary> void Cancel(); /// <summary> /// Closes the modal and invokes the <see cref="OnClose"/> event with the specified <paramref name="modalResult"/>. /// </summary> /// <param name="modalResult"></param> void Close(ModalResult modalResult); } }
44.589286
124
0.605927
[ "MIT" ]
ambiguousrocket/Modal
src/Blazored.Modal/Services/IModalService.cs
2,499
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("16.00 Tricky Strings")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("16.00 Tricky Strings")] [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("953313bf-fc5d-4764-8706-c1679ba6c5d0")] // 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.054054
84
0.746449
[ "MIT" ]
GabrielRezendi/Programming-Fundamentals-2017
02.Extented Fundamentals/09.DATA TYPES - EXERCISES/16.00 Tricky Strings/Properties/AssemblyInfo.cs
1,411
C#
using System.Net.Http; using EasyAbp.Abp.Aliyun.Common; using EasyAbp.Abp.Aliyun.Common.Model; namespace EasyAbp.Abp.Aliyun.Sms.Model.Request { public class QuerySendDetailsRequest : CommonRequest { public QuerySendDetailsRequest() { RequestParameters["Action"] = "QuerySendDetails"; RequestParameters["Version"] = "2017-05-25"; Method = HttpMethod.Get; } public QuerySendDetailsRequest(string phoneNumber, string sendDate, int pageSize, int currentPage) : this() { RequestParameters.Add("PhoneNumber",phoneNumber); RequestParameters.Add("SendDate",sendDate); RequestParameters.Add("PageSize",pageSize.ToString()); RequestParameters.Add("CurrentPage",currentPage.ToString()); } } }
31.962963
72
0.630359
[ "MIT" ]
zhaoqishan/Abp.Aliyun
src/EasyAbp.Abp.Aliyun.Sms/Model/Request/QuerySendDetailsRequest.cs
863
C#
using Live.Models; namespace Live.Data { public interface IUow { IRepository<Book> Books { get; } IRepository<Theme> Themes { get; } IRepository<Author> Authors { get; } void SaveChanges(); } }
18.384615
44
0.589958
[ "MIT" ]
QuinntyneBrown/live
Live/Data/IUow.cs
239
C#
using NHapi.Base.Parser; using NHapi.Base; using NHapi.Base.Log; using System; using System.Collections.Generic; using NHapi.Model.V251.Segment; using NHapi.Model.V251.Datatype; using NHapi.Base.Model; namespace NHapi.Model.V251.Group { ///<summary> ///Represents the SQR_S25_PATIENT Group. A Group is an ordered collection of message /// segments that can repeat together or be optionally in/excluded together. /// This Group contains the following elements: ///<ol> ///<li>0: PID (Patient Identification) </li> ///<li>1: PV1 (Patient Visit) optional </li> ///<li>2: PV2 (Patient Visit - Additional Information) optional </li> ///<li>3: DG1 (Diagnosis) optional </li> ///</ol> ///</summary> [Serializable] public class SQR_S25_PATIENT : AbstractGroup { ///<summary> /// Creates a new SQR_S25_PATIENT Group. ///</summary> public SQR_S25_PATIENT(IGroup parent, IModelClassFactory factory) : base(parent, factory){ try { this.add(typeof(PID), true, false); this.add(typeof(PV1), false, false); this.add(typeof(PV2), false, false); this.add(typeof(DG1), false, false); } catch(HL7Exception e) { HapiLogFactory.GetHapiLog(GetType()).Error("Unexpected error creating SQR_S25_PATIENT - this is probably a bug in the source code generator.", e); } } ///<summary> /// Returns PID (Patient Identification) - creates it if necessary ///</summary> public PID PID { get{ PID ret = null; try { ret = (PID)this.GetStructure("PID"); } catch(HL7Exception e) { HapiLogFactory.GetHapiLog(GetType()).Error("Unexpected error accessing data - this is probably a bug in the source code generator.", e); throw new System.Exception("An unexpected error ocurred",e); } return ret; } } ///<summary> /// Returns PV1 (Patient Visit) - creates it if necessary ///</summary> public PV1 PV1 { get{ PV1 ret = null; try { ret = (PV1)this.GetStructure("PV1"); } catch(HL7Exception e) { HapiLogFactory.GetHapiLog(GetType()).Error("Unexpected error accessing data - this is probably a bug in the source code generator.", e); throw new System.Exception("An unexpected error ocurred",e); } return ret; } } ///<summary> /// Returns PV2 (Patient Visit - Additional Information) - creates it if necessary ///</summary> public PV2 PV2 { get{ PV2 ret = null; try { ret = (PV2)this.GetStructure("PV2"); } catch(HL7Exception e) { HapiLogFactory.GetHapiLog(GetType()).Error("Unexpected error accessing data - this is probably a bug in the source code generator.", e); throw new System.Exception("An unexpected error ocurred",e); } return ret; } } ///<summary> /// Returns DG1 (Diagnosis) - creates it if necessary ///</summary> public DG1 DG1 { get{ DG1 ret = null; try { ret = (DG1)this.GetStructure("DG1"); } catch(HL7Exception e) { HapiLogFactory.GetHapiLog(GetType()).Error("Unexpected error accessing data - this is probably a bug in the source code generator.", e); throw new System.Exception("An unexpected error ocurred",e); } return ret; } } } }
29.849057
153
0.666877
[ "MPL-2.0", "MPL-2.0-no-copyleft-exception" ]
AMCN41R/nHapi
src/NHapi.Model.V251/Group/SQR_S25_PATIENT.cs
3,164
C#
using UnityEngine; using UnityEngine.UI; using System.Linq; using System.Collections; public class TrainingMode : MonoBehaviour { public bool start = true; public bool update; public bool defaultState; public Sprite spriteOnItem; public Sprite spriteOnAction; public Sprite spriteItemDefault; public Sprite spriteActionDefault; public int steps = 0; // Use this for initialization void Start() { } // Update is called once per frame void Update() { } public void DefaultState() { IsInteractible("Main Interface/MainToolsDisplay(Clone)", true, "", false); IsInteractible("Main Interface/ActionsDisplay(Clone)", true, "", false); Debug.Log("Default set"); } public void AtStart() { IsInteractible("Main Interface/MainToolsDisplay(Clone)", false, "gloves_item", true); IsInteractible("Main Interface/ActionsDisplay(Clone)", false, "wear_examination_action", true); } public void AtSteps(string step) { switch (step) { case "1": IsInteractible("Main Interface/MainToolsDisplay(Clone)", false, "gauze_balls_item", true); IsInteractible("Main Interface/ActionsDisplay(Clone)", false, "spirit_p70_action", true); update = false; break; case "2": IsInteractible("Main Interface/MainToolsDisplay(Clone)", false, "tweezers_item", true); IsInteractible("Main Interface/ActionsDisplay(Clone)", false, "tweezers_balls_action", true); update = false; break; case "3": IsInteractible("Main Interface/MainToolsDisplay(Clone)", false, "tweezers_item", true); IsInteractible("Main Interface/ActionsDisplay(Clone)", false, "top_down_action", true); update = false; break; case "4": IsInteractible("Main Interface/MainToolsDisplay(Clone)", false, "gloves_item", true); IsInteractible("Main Interface/ActionsDisplay(Clone)", false, "wear_sterile_action", true); update = false; break; case "5": IsInteractible("Main Interface/MainToolsDisplay(Clone)", false, "syringe_item", true); IsInteractible("Main Interface/ActionsDisplay(Clone)", false, "anesthesia_needle_action", true); update = false; break; case "6": IsInteractible("Main Interface/MainToolsDisplay(Clone)", false, "syringe_item", true); IsInteractible("Main Interface/ActionsDisplay(Clone)", false, "anesthesia_action", true); break; case "7": IsInteractible("Main Interface/MainToolsDisplay(Clone)", false, "syringe_item", true); IsInteractible("Main Interface/ActionsDisplay(Clone)", false, "a45_d10_punction_needle_action", true); break; case "8": IsInteractible("Main Interface/MainToolsDisplay(Clone)", false, "syringe_item", true); IsInteractible("Main Interface/ActionsDisplay(Clone)", false, "filling_novocaine_half_action", true); break; case "9": IsInteractible("Main Interface/MainToolsDisplay(Clone)", false, "tweezers_item_action", true); IsInteractible("Main Interface/ActionsDisplay(Clone)", false, "tweezers_balls_action", true); break; case "10": IsInteractible("Main Interface/MainToolsDisplay(Clone)", false, "tweezers_item_action", true); IsInteractible("Main Interface/ActionsDisplay(Clone)", false, "tweezers_balls_action", true); break; default: break; } } public void IsInteractible(string goPath, bool state, string goExclusion, bool spriteOn) { if (GameObject.Find(goPath)) { Transform goTransform = GameObject.Find(goPath).GetComponent<Transform>(); if (GameObject.Find(goPath).name.Contains("MainToolsDisplay")) { if (goTransform != null) { for (int i = 0; i < goTransform.childCount; ++i) { if (goTransform.GetChild(i).name == goExclusion && goTransform.GetChild(i).name.Contains("item") && spriteOn) { goTransform.GetChild(i).GetComponent<Image>().sprite = spriteOnItem; } if (goTransform.GetChild(i).name == goExclusion && goTransform.GetChild(i).name.Contains("item") && !spriteOn) { goTransform.GetChild(i).GetComponent<Image>().sprite = spriteItemDefault; } if (goTransform.GetChild(i).name != goExclusion && goTransform.GetChild(i).GetComponent<Button>()) { goTransform.GetChild(i).GetComponent<Button>().interactable = state; Debug.Log("State in"+ goExclusion); } } } } if (GameObject.Find(goPath).name.Contains("ActionsDisplay")) { if (goTransform != null) { for (int i = 0; i < goTransform.childCount; ++i) { if (goTransform.GetChild(i).name == goExclusion && goTransform.GetChild(i).name.Contains("action") && spriteOn) { goTransform.GetChild(i).GetComponent<Image>().sprite = spriteOnAction; } if (goTransform.GetChild(i).name == goExclusion && goTransform.GetChild(i).name.Contains("action") && !spriteOn) { goTransform.GetChild(i).GetComponent<Image>().sprite = spriteActionDefault; } if (goTransform.GetChild(i).name != goExclusion && goTransform.GetChild(i).GetComponent<Button>()) { goTransform.GetChild(i).GetComponent<Button>().interactable = state; Debug.Log("State in"); start = false; } } } } //if (goTransform.GetChild(i).name == goExclusion) //{ // goTransform.GetChild(i).GetComponent<Image>().color = new Color32(15, 121, 195, 255); // var colors = goTransform.GetChild(i).GetComponent<Button>().colors; // colors.normalColor = new Color32(15, 121, 195, 255); // goTransform.GetChild(i).GetComponent<Button>().colors = colors; //} } } } //public static class Extensions //{ // public static Transform Search(this Transform target, string name) // { // if (target.name == name) return target; // for (int i = 0; i < target.childCount; ++i) // { // var result = Search(target.GetChild(i), name); // if (result != null) return result; // } // return null; // } //}
42.227778
136
0.529272
[ "MIT" ]
levabd/dolls
Assets/Resources/Scripts/Inventory/training_mode/TrainingMode.cs
7,603
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("DMS_Email_Manager")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("DMS_Email_Manager")] [assembly: AssemblyCopyright("Copyright © 2018")] [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("fed59c45-7e5a-4e9f-9ac2-f2baf8f089b3")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // [assembly: AssemblyVersion("1.3.*")]
36.205882
85
0.735175
[ "BSD-2-Clause" ]
PNNL-Comp-Mass-Spec/DMS-EMail-Manager
Properties/AssemblyInfo.cs
1,234
C#
using UnityEngine; public class PanelTests : MonoBehaviour { private Panel _panel; private const string Show = "Show"; private const string Hide = "Hide"; private const string Center = "Center"; private void Start() { _panel = GetComponent<Panel>(); Panel.Position centerPos = new Panel.Position(Center, TextAnchor.MiddleCenter, TextAnchor.MiddleCenter); _panel.AddPosition(centerPos); } private void OnGUI() { if (GUI.Button(new Rect(10, 10, 100, 30), Show)) { _panel.SetPosition(Show, true); } if (GUI.Button(new Rect(10, 50, 100, 30), Hide)) { _panel.SetPosition(Hide, true); } if (GUI.Button(new Rect(10, 90, 100, 30), Center)) { Tweener t = _panel.SetPosition(Center, true); t.equation = EasingEquations.EaseInOutBack; } } }
23.075
112
0.580715
[ "Apache-2.0" ]
Kassout/unityProject_RogueTactics
RogueTactics/Assets/Scripts/Tests/PanelTests.cs
923
C#
using System; using System.Collections.Generic; using System.Linq; using System.ComponentModel; using UnityEngine; namespace UnityEditor.VFX.Block { class OrientationModeProvider : VariantProvider { protected override sealed Dictionary<string, object[]> variants { get { return new Dictionary<string, object[]> { { "mode", Enum.GetValues(typeof(Orient.Mode)).Cast<object>().ToArray() } }; } } } [VFXInfo(category = "Orientation", variantProvider = typeof(OrientationModeProvider))] class Orient : VFXBlock { public enum Mode { FaceCameraPlane, FaceCameraPosition, LookAtPosition, LookAtLine, Advanced, FixedAxis, AlongVelocity, } public enum AxesPair { XY = 0, YZ = 1, ZX = 2, YX = 3, ZY = 4, XZ = 5, } [VFXSetting, Tooltip("Specifies the orientation mode of the particle. It can face towards the camera or a specific position, orient itself along the velocity or a fixed axis, or use more advanced facing behavior.")] public Mode mode; [VFXSetting, Tooltip("Specifies which two axes to use for the particle orientation.")] public AxesPair axes = AxesPair.ZY; protected override IEnumerable<string> filteredOutSettings { get { if (mode != Mode.Advanced) { yield return "axes"; } } } public override string name { get { return "Orient : " + ObjectNames.NicifyVariableName(mode.ToString()); } } public override VFXContextType compatibleContexts { get { return VFXContextType.Output; } } public override VFXDataType compatibleData { get { return VFXDataType.Particle; } } public override IEnumerable<VFXAttributeInfo> attributes { get { yield return new VFXAttributeInfo(VFXAttribute.AxisX, VFXAttributeMode.Write); yield return new VFXAttributeInfo(VFXAttribute.AxisY, VFXAttributeMode.Write); yield return new VFXAttributeInfo(VFXAttribute.AxisZ, VFXAttributeMode.Write); if (mode != Mode.Advanced && mode != Mode.FaceCameraPlane) yield return new VFXAttributeInfo(VFXAttribute.Position, VFXAttributeMode.Read); if (mode == Mode.AlongVelocity) yield return new VFXAttributeInfo(VFXAttribute.Velocity, VFXAttributeMode.Read); } } protected override IEnumerable<VFXPropertyWithValue> inputProperties { get { switch (mode) { case Mode.LookAtPosition: yield return new VFXPropertyWithValue(new VFXProperty(typeof(Position), "Position")); break; case Mode.LookAtLine: yield return new VFXPropertyWithValue(new VFXProperty(typeof(Line), "Line"), Line.defaultValue); break; case Mode.Advanced: { string axis1, axis2; Vector3 vector1, vector2; AxesPairToUI(axes, out axis1, out axis2); AxesPairToVector(axes, out vector1, out vector2); yield return new VFXPropertyWithValue(new VFXProperty(typeof(DirectionType), axis1), new DirectionType() { direction = vector1 }); yield return new VFXPropertyWithValue(new VFXProperty(typeof(DirectionType), axis2), new DirectionType() { direction = vector2 }); break; } case Mode.FixedAxis: yield return new VFXPropertyWithValue(new VFXProperty(typeof(DirectionType), "Up"), new DirectionType() { direction = Vector3.up }); break; } } } public override string source { get { switch (mode) { case Mode.FaceCameraPlane: return @" float3x3 viewRot = GetVFXToViewRotMatrix(); axisX = viewRot[0].xyz; axisY = viewRot[1].xyz; #if VFX_LOCAL_SPACE // Need to remove potential scale in local transform axisX = normalize(axisX); axisY = normalize(axisY); axisZ = cross(axisX,axisY); #else axisZ = -viewRot[2].xyz; #endif "; case Mode.FaceCameraPosition: return @" if (unity_OrthoParams.w == 1.0f) // Face plane for ortho { float3x3 viewRot = GetVFXToViewRotMatrix(); axisX = viewRot[0].xyz; axisY = viewRot[1].xyz; #if VFX_LOCAL_SPACE // Need to remove potential scale in local transform axisX = normalize(axisX); axisY = normalize(axisY); axisZ = cross(axisX,axisY); #else axisZ = -viewRot[2].xyz; #endif } else { axisZ = normalize(position - GetViewVFXPosition()); axisX = normalize(cross(GetVFXToViewRotMatrix()[1].xyz,axisZ)); axisY = cross(axisZ,axisX); } "; case Mode.LookAtPosition: return @" axisZ = normalize(position - Position); axisX = normalize(cross(GetVFXToViewRotMatrix()[1].xyz,axisZ)); axisY = cross(axisZ,axisX); "; case Mode.LookAtLine: return @" float3 lineDir = normalize(Line_end - Line_start); float3 target = dot(position - Line_start,lineDir) * lineDir + Line_start; axisZ = normalize(position - target); axisX = normalize(cross(GetVFXToViewRotMatrix()[1].xyz,axisZ)); axisY = cross(axisZ,axisX); "; case Mode.Advanced: { string rotAxis1, rotAxis2, rotAxis3, uiAxis1, uiAxis2; AxesPairToHLSL(axes, out rotAxis1, out rotAxis2, out rotAxis3); AxesPairToUI(axes, out uiAxis1, out uiAxis2); string code = string.Format(@" {0} = normalize({3}); {2} = normalize({4}); {1} = {5}; ", rotAxis1, rotAxis2, rotAxis3, uiAxis1, LeftHandedBasis(axes, uiAxis1, uiAxis2), LeftHandedBasis(GetSecondAxesPair(axes), rotAxis1, rotAxis3)); return code; } case Mode.FixedAxis: return @" axisY = Up; axisZ = position - GetViewVFXPosition(); axisX = normalize(cross(axisY,axisZ)); axisZ = cross(axisX,axisY); "; case Mode.AlongVelocity: return @" axisY = normalize(velocity); axisZ = position - GetViewVFXPosition(); axisX = normalize(cross(axisY,axisZ)); axisZ = cross(axisX,axisY); "; default: throw new NotImplementedException(); } } } public override void Sanitize(int version) { if (mode == Mode.LookAtPosition) { /* Slot of type position has changed from undefined VFXSlot to VFXSlotPosition*/ if (GetNbInputSlots() > 0 && !(GetInputSlot(0) is VFXSlotPosition)) { var oldValue = GetInputSlot(0).value; RemoveSlot(GetInputSlot(0)); AddSlot(VFXSlot.Create(new VFXProperty(typeof(Position), "Position"), VFXSlot.Direction.kInput, oldValue)); } } base.Sanitize(version); } private void AxesPairToHLSL(AxesPair axes, out string axis1, out string axis2, out string axis3) { const string X = "axisX"; const string Y = "axisY"; const string Z = "axisZ"; switch (axes) { case AxesPair.XY: axis1 = X; axis2 = Y; axis3 = Z; break; case AxesPair.XZ: axis1 = X; axis2 = Z; axis3 = Y; break; case AxesPair.YX: axis1 = Y; axis2 = X; axis3 = Z; break; case AxesPair.YZ: axis1 = Y; axis2 = Z; axis3 = X; break; case AxesPair.ZX: axis1 = Z; axis2 = X; axis3 = Y; break; case AxesPair.ZY: axis1 = Z; axis2 = Y; axis3 = X; break; default: throw new InvalidEnumArgumentException("Unsupported axes pair"); } } private void AxesPairToUI(AxesPair pair, out string uiAxis1, out string uiAxis2) { string axis1, axis2, axis3; AxesPairToHLSL(pair, out axis1, out axis2, out axis3); uiAxis1 = "Axis" + axis1[axis1.Length - 1]; uiAxis2 = "Axis" + axis2[axis2.Length - 1]; } private void AxesPairToVector(AxesPair pair, out Vector3 axis1, out Vector3 axis2) { Vector3 X = Vector3.right, Y = Vector3.up, Z = Vector3.forward; switch (pair) { case AxesPair.XY: axis1 = X; axis2 = Y; break; case AxesPair.XZ: axis1 = X; axis2 = Z; break; case AxesPair.YX: axis1 = Y; axis2 = X; break; case AxesPair.YZ: axis1 = Y; axis2 = Z; break; case AxesPair.ZX: axis1 = Z; axis2 = X; break; case AxesPair.ZY: axis1 = Z; axis2 = Y; break; default: throw new InvalidEnumArgumentException("Unsupported axes pair"); } } /// <summary> /// Given two axes in (X, Y, Z), compute the third one so that the resulting basis is left handed /// </summary> /// <param name="axis1">hlsl value of first axis in pair</param> /// <param name="axis2">hlsl value of second axis</param> private string LeftHandedBasis(AxesPair axes, string axis1, string axis2) { if (axes <= AxesPair.ZX) return "cross(" + axis1 + ", " + axis2 + ")"; else return "cross(" + axis2 + ", " + axis1 + ")"; } private AxesPair GetSecondAxesPair(AxesPair axes) { switch (axes) { case AxesPair.XY: return AxesPair.XZ; case AxesPair.YZ: return AxesPair.YX; case AxesPair.ZX: return AxesPair.ZY; case AxesPair.YX: return AxesPair.YZ; case AxesPair.ZY: return AxesPair.ZX; case AxesPair.XZ: return AxesPair.XY; default: throw new InvalidEnumArgumentException("Unsupported axes pair"); } } } }
34.393586
223
0.494787
[ "Apache-2.0" ]
CrazyJohn16/JoaoArena
Library/PackageCache/com.unity.visualeffectgraph@7.3.1/Editor/Models/Blocks/Implementations/Orientation/Orient.cs
11,797
C#
//----------------------------------------------------------------------- // <copyright file="SQArray.cs" company="None"> // Copyright (c) IIHOSHI Yoshinori. // Licensed under the BSD-2-Clause license. See LICENSE.txt file in the project root for full license information. // </copyright> //----------------------------------------------------------------------- #pragma warning disable SA1600 // Elements should be documented using System.Collections.Generic; using System.IO; using System.Linq; using ThScoreFileConverter.Extensions; using ThScoreFileConverter.Properties; namespace ThScoreFileConverter.Squirrel { internal sealed class SQArray : SQObject { public SQArray() : this(Enumerable.Empty<SQObject>()) { } public SQArray(IEnumerable<SQObject> enumerable) : base(SQObjectType.Array) { this.Value = enumerable; } public new IEnumerable<SQObject> Value { get => (IEnumerable<SQObject>)base.Value; private set => base.Value = value.ToArray(); } public static SQArray Create(BinaryReader reader, bool skipType = false) { if (!skipType) { var type = reader.ReadInt32(); if (type != (int)SQObjectType.Array) throw new InvalidDataException(Resources.InvalidDataExceptionWrongType); } var num = reader.ReadInt32(); if (num < 0) throw new InvalidDataException(Resources.InvalidDataExceptionNumElementsMustNotBeNegative); var dictionary = new Dictionary<int, SQObject>(); for (var count = 0; count < num; count++) { var index = SQObject.Create(reader); var value = SQObject.Create(reader); if (index is not SQInteger i) throw new InvalidDataException(Resources.InvalidDataExceptionIndexMustBeAnInteger); if (i >= num) throw new InvalidDataException(Resources.InvalidDataExceptionIndexIsOutOfRange); dictionary.Add(i, value); } var sentinel = SQObject.Create(reader); if (sentinel is not SQNull) throw new InvalidDataException(Resources.InvalidDataExceptionWrongSentinel); var array = new SQObject[num]; foreach (var pair in dictionary) array[pair.Key] = pair.Value; return new SQArray(array); } public override string? ToString() { return "[ " + string.Join(", ", this.Value.Select(element => element.ToNonNullString())) + " ]"; } } }
33.463415
114
0.560496
[ "BSD-2-Clause" ]
armadillo-winX/ThScoreFileConverter
ThScoreFileConverter/Squirrel/SQArray.cs
2,746
C#
using InvertedTomato.IO.Messages; using System; using System.Collections.Generic; using System.Threading; namespace InvertedTomato.Net.Zeta { class Program { static void Main(String[] args) { //netsh http add urlacl url=http://*:8000/ user=Everyone var revisions = new Dictionary<UInt32, UInt32>(); var values = new Dictionary<UInt32, String>(); var rnd = new Random(); Console.Write("Starting server... "); var server = new ZetaWsPublisher("http://+:8000/"); Console.WriteLine("done"); Console.Write("Starting client... "); var client = new ZetaWsSubscriber("ws://localhost:8000/"); Console.WriteLine("done"); Console.Write("Subscribing client... "); client.Subscribe((UInt32 topic, UInt32 revision, StringMessage message) => { revisions[topic] = revision; values[topic] = message.ToString(); Console.WriteLine($" {topic}#{revision}: {message}"); }); Console.WriteLine("done"); Console.WriteLine("Sending payloads..."); server.Publish(new StringMessage("Topic 0, message 1"), 0); server.Publish(new StringMessage("Topic 1, message 1"), 1); server.Publish(new StringMessage("Topic 1, message 2"), 1); server.Publish(new StringMessage("Topic 2, message 1"), 2); for(var i = 2; i <= 50; i++) { server.Publish(new StringMessage($"Topic 1, message {i}"), 1); if(rnd.Next(0, 10) > 5) { Thread.Sleep(1); } } Thread.Sleep(1000); Console.WriteLine("done"); Console.ReadKey(true); Console.Write("Stopping... "); client.Dispose(); server.Dispose(); Console.WriteLine("done"); } } }
36.054545
88
0.530509
[ "Apache-2.0" ]
invertedtomato/zeta
WsDemo/Program.cs
1,985
C#
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // // Generation parameters: // - DataFilename: Patterns\German\German-NumbersWithUnit.yaml // - Language: German // - ClassName: NumbersWithUnitDefinitions // </auto-generated> // // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // ------------------------------------------------------------------------------ namespace Microsoft.Recognizers.Definitions.German { using System; using System.Collections.Generic; public static class NumbersWithUnitDefinitions { public static readonly Dictionary<string, string> AgeSuffixList = new Dictionary<string, string> { { @"Year", @"jahr alt|jahre alt|jahren|jahre|lebensjahr" }, { @"Month", @"monat alt|monate alt|monaten|monate" }, { @"Week", @"woche alt|wochen alt|wochen|woche" }, { @"Day", @"tag alt|tage alt|tagen|tage" } }; public static readonly IList<string> AmbiguousAgeUnitList = new List<string> { @"jahren", @"jahre", @"monaten", @"monate", @"wochen", @"woche", @"tagen", @"tage" }; public static readonly Dictionary<string, string> AreaSuffixList = new Dictionary<string, string> { { @"Square kilometer", @"qkm|quadratkilometer|km^2|km²" }, { @"Square hectometer", @"qhm|quadrathektometer|hm^2|hm²|hektar" }, { @"Square decameter", @"quadratdekameter|dam^2|dam²" }, { @"Square meter", @"qm|quadratmeter|m^2|m²" }, { @"Square decimeter", @"qdm|quadratdezimeter|dm^2|dm²" }, { @"Square centimeter", @"qcm|quadratzentimeter|cm^2|cm²" }, { @"Square millimeter", @"qmm|quadratmillimeter|mm^2|mm²" }, { @"Square inch", @"sqin|quadratzoll|in^2|in²" }, { @"Square foot", @"sqft|quadratfuß|fuß^2|fuß²|ft2|ft^2|ft²" }, { @"Square mile", @"sqmi|quadratmeile|mi^2|mi²" }, { @"Square yard", @"sqyd|quadratyard|yd^2|yd²" }, { @"Acre", @"-acre|acre|acres" } }; public static readonly Dictionary<string, string> CurrencySuffixList = new Dictionary<string, string> { { @"Abkhazian apsar", @"abkhazian apsar|apsars" }, { @"Afghan afghani", @"afghanischer afghani|afghanische afghani|afghanischen afghani|؋|afn|afghani" }, { @"Pul", @"pul" }, { @"Euro", @"euro|€|eur" }, { @"Cent", @"cent|-cent" }, { @"Albanian lek", @"albaninischer Lek|albanische Lek|albanischen Lek" }, { @"Qindarkë", @"qindarkë|qindarkës|qindarke|qindarkes" }, { @"Angolan kwanza", @"angolanischer kwanza|angolanische kwanza|angolanischen kwanza|kz|aoa|kwanza|kwanzas" }, { @"Armenian dram", @"armeninischer dram|armeninische dram|armeninischen dram" }, { @"Aruban florin", @"Aruba-Florin|ƒ|awg" }, { @"Bangladeshi taka", @"bangladesischer taka|bengalischer taka|bangladesische taka|bengalische taka|bangladesischen taka|bengalischen taka|৳|bdt|taka" }, { @"Paisa", @"poisha|paisa" }, { @"Bhutanese ngultrum", @"bhutanischer ngultrum|bhutanische ngultrum|bhutanischen ngultrum|nu.|btn" }, { @"Chetrum", @"chetrum" }, { @"Bolivian boliviano", @"bolivianischer boliviano|bolivianische boliviano|bolivianischen boliviano|bob|bs.|boliviano" }, { @"Bosnia and Herzegovina convertible mark", @"bosnischer konvertible mark|bosnisch-herzegowinischer konvertible mark|bosnische konvertible mark|bosnisch-herzegowinische konvertible mark|bosnischen konvertible mark|bosnisch-herzegowinischen konvertible mark|konvertible mark|bam" }, { @"Fening", @"Fening" }, { @"Botswana pula", @"botswanischer pula|botswanische pula|botswanischen pula|bwp|pula" }, { @"Thebe", @"thebe" }, { @"Brazilian real", @"brazilianischer real|brazilianische real|brazilianischen real|r$|brl|real" }, { @"Bulgarian lev", @"bulgarischer lew|bulgarische lew|bulgarischen lew|bgn|лв|lew" }, { @"Stotinka", @"stotinki|stotinka" }, { @"Cambodian riel", @"kambodschanischer riel|kambodschanische riel|kambodschanischen riel|khr|៛|riel" }, { @"Cape Verdean escudo", @"kap-verde-escudo|cve" }, { @"Costa Rican colón", @"costa-rica-colón|costa-rica-colon|crc|₡" }, { @"Salvadoran colón", @"svc|el-salvador-colón|el-salvador-colon" }, { @"Céntimo", @"céntimo" }, { @"Croatian kuna", @"kroatischer kuna|kroatische kuna|kroatischen kuna|kn|hrk|kuna" }, { @"Lipa", @"lipa" }, { @"Czech koruna", @"tschechische krone|tschechischen kronen|tschechischer kronen|czk|kč" }, { @"Haléř", @"haléř" }, { @"Eritrean nakfa", @"eritreischer nakfa|eritreische nakfa|eritreischen nakfa|nfk|ern|nakfa" }, { @"Ethiopian birr", @"äthiopischer birr|äthiopische birr|äthiopischen birr|etb" }, { @"Gambian dalasi", @"gambischer dalasi|gambische dalasi|gambischen dalasi|gmd" }, { @"Butut", @"bututs|butut" }, { @"Georgian lari", @"georgischer lari|georgische lari|georgischen lari|lari|gel|₾" }, { @"Tetri", @"tetri" }, { @"Ghanaian cedi", @"ghanaischer cedi|ghanaische cedi|ghanaischen cedi|Ghana cedi|ghs|₵|gh₵" }, { @"Pesewa", @"pesewas|pesewa" }, { @"Guatemalan quetzal", @"guatemaltekischer quetzal|guatemaltekische quetzal|guatemaltekischen quetzal|gtq|quetzal" }, { @"Haitian gourde", @"haitianischer gourde|haitianische gourde|haitianischen gourde|htg" }, { @"Honduran lempira", @"honduranischer lempira|honduranische lempira|honduranischen lempira|hnl" }, { @"Hungarian forint", @"ungarischer forint|ungarische forint|ungarischen forint|huf|ft|forint" }, { @"Fillér", @"fillér" }, { @"Iranian rial", @"iranischer rial|iranische rial|iranischen rial|irr" }, { @"Yemeni rial", @"jemen-rial|yer" }, { @"Israeli new shekel", @"₪|ils|agora" }, { @"Lithuanian litas", @"ltl|litauischer litas|litauische litas|litauischen litas" }, { @"Japanese yen", @"japaneser yen|japanese yen|japanesen yen|jpy|yen|¥" }, { @"Kazakhstani tenge", @"kasachischer tenge|kasachische tenge|kasachischen tenge|kzt" }, { @"Kenyan shilling", @"kenia-schilling|kes" }, { @"North Korean won", @"nordkoreanischer won|nordkoreanische won|nordkoreanischen won|kpw" }, { @"South Korean won", @"südkoreanischer won|südkoreanische won|südkoreanischen won|krw" }, { @"Korean won", @"koreanischer won|koreanische won|koreanischen won|₩" }, { @"Kyrgyzstani som", @"kirgisischer som|kirgisische som|kirgisischen som|kgs" }, { @"Uzbekitan som", @"usbekischer som|usbekische som|usbekischen som|usbekischer sum|usbekische sum|usbekischen sum|usbekischer so'm|usbekische so'm|usbekischen so'm|usbekischer soum|usbekische soum|usbekischen soum|uzs" }, { @"Lao kip", @"laotischer kip|laotische kip|laotischen kip|lak|₭n|₭" }, { @"Att", @"att" }, { @"Lesotho loti", @"lesothischer loti|lesothische loti|lesothischen loti|lsl|loti" }, { @"Sente", @"sente|lisente" }, { @"South African rand", @"südafrikanischer rand|südafrikanische rand|südafrikanischen rand|zar" }, { @"Macanese pataca", @"macao-pataca|mop$|mop" }, { @"Avo", @"avos|avo" }, { @"Macedonian denar", @"mazedonischer denar|mazedonische denar|mazedonischen denar|mkd|ден" }, { @"Deni", @"deni" }, { @"Malagasy ariary", @"madagassischer ariary|madagassische ariary|madagassischen ariary|ariary|mga" }, { @"Iraimbilanja", @"iraimbilanja" }, { @"Malawian kwacha", @"malawi-kwacha|mk|mwk" }, { @"Tambala", @"tambala" }, { @"Malaysian ringgit", @"malaysischer ringgit|malaysische ringgit|malaysischen ringgit|rm|myr" }, { @"Mauritanian ouguiya", @"mauretanischer ouguiya|mauretanische ouguiya|mauretanischen ouguiya|mro" }, { @"Khoums", @"khoums" }, { @"Mongolian tögrög", @"mongolischer tögrög|mongolische tögrög|mongolischen tögrög|mongolischer tugrik|mongolische tugrik|mongolischen tugrik|mnt|₮" }, { @"Mozambican metical", @"mosambik-metical|mosambik metical|mt|mzn" }, { @"Burmese kyat", @"myanmar-kyat|myanmar kyat|ks|mmk" }, { @"Pya", @"pya" }, { @"Nicaraguan córdoba", @"nicaraguanischer córdoba oro|nicaraguanische córdoba oro|nicaraguanischen córdoba oro|nicaraguanischer córdoba|nicaraguanische córdoba|nicaraguanischen córdoba|nio|córdoba|córdoba oro" }, { @"Nigerian naira", @"nigerianischer naira|nigerianische naira|nigerianischen naira|naira|ngn|₦|nigeria naira" }, { @"Kobo", @"kobo" }, { @"Turkish lira", @"türkischer lira|türkische lira|türkischen lira|tuerkischer lira|tuerkische lira|tuerkischen lira|try|tl" }, { @"Kuruş", @"kuruş" }, { @"Omani rial", @"omanischer rial|omanische rial|omanischen rial|omr|ر.ع." }, { @"Panamanian balboa", @"panamaischer balboa|panamaische balboa|panamaischen balboa|b/.|pab" }, { @"Centesimo", @"centesimo" }, { @"Papua New Guinean kina", @"papua-neuguinea-kina|kina|pgk" }, { @"Toea", @"toea" }, { @"Paraguayan guaraní", @"paraguayischer guaraní|paraguayische guaraní|paraguayischen guaraní|guaraní|₲|pyg" }, { @"Peruvian sol", @"peruanischer sol|peruanische sol|peruanischen sol|soles|sol" }, { @"Polish złoty", @"polnischer złoty|polnische złoty|polnischen złoty|polnischer zloty|polnische zloty|polnischen zloty|zł|pln|złoty|zloty" }, { @"Grosz", @"groszy|grosz|grosze" }, { @"Qatari riyal", @"katar-riyal|katar riyal|qatari riyal|qar" }, { @"Saudi riyal", @"saudi-riyal|sar" }, { @"Riyal", @"riyal|﷼" }, { @"Dirham", @"dirham|dirhem|dirhm" }, { @"Halala", @"halalas|halala" }, { @"Samoan tālā", @"samoanischer tala|samoanische tala|samoanischen tala|samoanischer tālā|samoanische tālā|samoanischen tālā|tālā|tala|ws$|samoa|wst|samoa-tālā|samoa-tala" }, { @"Sene", @"sene" }, { @"São Tomé and Príncipe dobra", @"são-toméischer dobra|são-toméische dobra|são-toméischen dobra|dobra|std" }, { @"Sierra Leonean leone", @"sierra-leonischer leone|sierra-leonische leone|sierra-leonischen leone|sll|leone|le" }, { @"Peseta", @"pesetas|peseta" }, { @"Netherlands guilder", @"florin|antillen-gulden|niederländische-antillen-gulden|antillen gulden|ang|niederländischer gulden|niederländische gulden|niederländischen gulden|gulden|fl" }, { @"Swazi lilangeni", @"swazi-lilangeni|swazi lilangeni|lilangeni|szl|swazi-emalangeni|swazi emalangeni" }, { @"Tajikistani somoni", @"tadschikischer somoni|tadschikische somoni|tadschikischen somoni|tadschikistan-somoni|tadschikistan somoni|tajikischer somoni|tajikische somoni|tajikischen somoni|tajikistan-somoni|tajikistan somoni|tjs" }, { @"Diram", @"dirams|diram" }, { @"Thai baht", @"thailändischer baht|thailändische baht|thailändischen baht|thailaendischer baht|thailaendische baht|thailaendischen baht|thai baht|thai-baht|฿|thb" }, { @"Satang", @"satang|satangs" }, { @"Tongan paʻanga", @"tongaischer paʻanga|tongaische paʻanga|tongaischen paʻanga|paʻanga|tonga paʻanga|tongaischer pa'anga|tongaische pa'anga|tongaischen pa'anga|pa'anga|tonga pa'anga" }, { @"Seniti", @"seniti" }, { @"Ukrainian hryvnia", @"ukrainischer hrywnja|ukrainische hrywnja|ukrainischen hrywnja|hrywnja|uah|₴" }, { @"Vanuatu vatu", @"vanuatu-vatu|vanuatu vatu|vatu|vuv" }, { @"Venezuelan bolívar", @"venezolanischer bolívar|venezolanische bolívar|venezolanischen bolívar|bs.f.|vef" }, { @"Vietnamese dong", @"vietnamesischer đồng|vietnamesische đồng|vietnamesischen đồng|vietnamesischer dong|vietnamesische dong|vietnamesischen dong|vnd|đồng" }, { @"Zambian kwacha", @"sambischer kwacha|sambische kwacha|sambischen kwacha|zk|zmw" }, { @"Moroccan dirham", @"marokkanischer dirham|marokkanische dirham|marokkanischen dirham|mad|د.م." }, { @"United Arab Emirates dirham", @"vae dirham|vae-dirham|dirham der vereinigten arabischen emirate|د.إ|aed" }, { @"Azerbaijani manat", @"aserbaidschan-manat|azn" }, { @"Turkmenistan manat", @"turkmenistan-manat|tmt" }, { @"Manat", @"manat" }, { @"Qəpik", @"qəpik" }, { @"Somali shilling", @"somalia-schilling|sh.so.|sos" }, { @"Somaliland shilling", @"somaliland-schilling" }, { @"Tanzanian shilling", @"tansania-schilling|tsh|tzs" }, { @"Ugandan shilling", @"uganda-schilling|ugx" }, { @"Romanian leu", @"rumänischer leu|rumänische leu|rumänischen leu|rumaenischer leu|rumaenische leu|rumaenischen leu|lei|ron" }, { @"Moldovan leu", @"moldauischer leu|moldauische leu|moldauischen leu|mdl|moldau leu" }, { @"Leu", @"leu" }, { @"Ban", @"bani|ban" }, { @"Nepalese rupee", @"nepalesischer rupie|nepalesische rupie|nepalesischen rupie|nepalesische rupien|nepalesischer rupien|nepalesischen rupien|npr" }, { @"Pakistani rupee", @"pakistanischer rupie|pakistanische rupie|pakistanischen rupie|pakistanischer rupien|pakistanische rupien|pakistanischen rupien|pkr" }, { @"Indian rupee", @"indischer rupie|indische rupie|indischen rupie|indischer rupien|indische rupien|indischen rupien|inr|₹" }, { @"Seychellois rupee", @"seychellen-rupie|seychellen-rupien|scr|sr|sre" }, { @"Mauritian rupee", @"mauritius-rupie|mauritius-rupien|mur" }, { @"Maldivian rufiyaa", @"maledivischer rufiyaa|maledivische rufiyaa|maledivischen rufiyaa|mvr|.ރ" }, { @"Sri Lankan rupee", @"sri-lanka-rupie|sri-lanka-rupien|lkr|රු|ரூ" }, { @"Indonesian rupiah", @"indonesischer rupiah|indonesische rupiah|indonesischen rupiah|rupiah|perak|rp|idr" }, { @"Rupee", @"rupie|rs" }, { @"Danish krone", @"dänische krone|dänischen krone|dänischer kronen|dänische kronen|dänischen kronen|daenische krone|daenischen krone|daenischer kronen|daenische kronen|daenischen kronen|dkk" }, { @"Norwegian krone", @"norwegische krone|norwegischen krone|norwegischer kronen|norwegische kronen|norwegischen kronen|nok" }, { @"Faroese króna", @"färöische króna|färöische krone|färöischen krone|färöischer kronen|färöische kronen|färöischen kronen" }, { @"Icelandic króna", @"isländische krone|isländischen krone|isländischer kronen|isländische kronen|isländischen kronen|isk" }, { @"Swedish krona", @"schwedische krone|schwedischen krone|schwedischer kronen|schwedische kronen|schwedischen kronen|sek" }, { @"Krone", @"krone|kronen|kr|-kr" }, { @"Øre", @"Øre|oyra|eyrir" }, { @"West African CFA franc", @"west african cfa franc|xof|westafrikanische cfa franc|westafrikanische-cfa-franc" }, { @"Central African CFA franc", @"central african cfa franc|xaf|zentralafrikanische cfa franc|zentralafrikanische-cfa-franc" }, { @"Comorian franc", @"komoren-franc|kmf" }, { @"Congolese franc", @"kongo-franc|cdf" }, { @"Burundian franc", @"burundi-franc|bif" }, { @"Djiboutian franc", @"dschibuti-franc|djf" }, { @"CFP franc", @"cfp-franc|xpf" }, { @"Guinean franc", @"franc guinéen|franc-guinéen|gnf" }, { @"Swiss franc", @"schweizer franken|schweizer-franken|chf|sfr." }, { @"Rwandan franc", @"ruanda-franc|rwf|rf|r₣|frw" }, { @"Belgian franc", @"belgischer franken|belgische franken|belgischen franken|bi.|b.fr.|bef" }, { @"Rappen", @"rappen|-rappen" }, { @"Franc", @"franc|französischer franc|französische franc|französischen franc|französischer franken|französische franken|französischen franken|franken|fr.|fs" }, { @"Centime", @"centimes|centime|santim" }, { @"Russian ruble", @"russischer rubel|russische rubel|russischen rubel|₽|rub" }, { @"New Belarusian ruble", @"neuer weißrussischer rubel|neue weißrussische rubel|neuen weißrussischen rubel|neuem weißrussischen rubel" }, { @"Old Belarusian ruble", @"alter weißrussischer rubel|alte weißrussische rubel|alten weißrussischen rubel|altem weißrussischen rubel" }, { @"Transnistrian ruble", @"transnistrischer rubel|transnistrische rubel|transnistrischen rubel|prb|р." }, { @"Belarusian ruble", @"weißrussischer rubel|weißrussische rubel|weißrussischen rubel" }, { @"Kopek", @"kopek|kopeks" }, { @"Kapyeyka", @"kapyeyka" }, { @"Ruble", @"rubel|br" }, { @"Algerian dinar", @"algerischer dinar|algerische dinar|algerischen dinar|د.ج|dzd" }, { @"Bahraini dinar", @"bahrain-dinar|bhd|.د.ب" }, { @"Santeem", @"santeem|santeeme" }, { @"Iraqi dinar", @"irakischer dinar|irakische dinar|irakischen dinar|iqd|ع.د" }, { @"Jordanian dinar", @"jordanischer dinar|jordanische dinar|jordanischen dinar|د.ا|jod" }, { @"Kuwaiti dinar", @"kuwait-dinar|kwd|د.ك" }, { @"Libyan dinar", @"libyscher dinar|libysche dinar|libyschen dinar|lyd" }, { @"Serbian dinar", @"serbischer dinar|serbische dinar|serbischen dinar|din.|rsd|дин." }, { @"Tunisian dinar", @"tunesischer dinar|tunesische dinar|tunesischen dinar|tnd" }, { @"Yugoslav dinar", @"jugoslawischer dinar|jugoslawische dinar|jugoslawischen dinar|yun" }, { @"Dinar", @"dinar|denar" }, { @"Fils", @"fils|fulūs" }, { @"Para", @"para|napa" }, { @"Millime", @"millime" }, { @"Argentine peso", @"argentinischer peso|argentinische peso|argentinischen peso|ars" }, { @"Chilean peso", @"chilenischer peso|chilenische peso|chilenischen peso|clp" }, { @"Colombian peso", @"kolumbianischer peso|kolumbianische peso|kolumbianischen peso|cop" }, { @"Cuban convertible peso", @"kubanischer peso convertible|kubanische peso convertible|kubanischen peso convertible|peso convertible|cuc" }, { @"Cuban peso", @"kubanischer peso|kubanische peso|kubanischen peso|cup" }, { @"Dominican peso", @"dominican pesos|dominican peso|dop|dominica pesos|dominica peso" }, { @"Mexican peso", @"mexikanischer peso|mexikanische peso|mexikanischen peso|mxn" }, { @"Philippine peso", @"piso|philippinischer peso|philippinische peso|philippinischen peso|₱|php" }, { @"Uruguayan peso", @"uruguayischer peso|uruguayische peso|uruguayischen peso|uyu" }, { @"Peso", @"peso" }, { @"Centavo", @"centavos|centavo" }, { @"Alderney pound", @"alderney pfund|alderney £" }, { @"British pound", @"britischer pfund|britische pfund|britischen pfund|british £|gbp|pfund sterling" }, { @"Guernsey pound", @"guernsey-pfund|guernsey £|ggp" }, { @"Ascension pound", @"ascension-pfund|ascension pound|ascension £" }, { @"Saint Helena pound", @"st.-helena-pfund|saint helena £|shp" }, { @"Egyptian pound", @"ägyptisches pfund|ägyptische pfund|ägyptischen pfund|ägyptisches £|egp|ج.م" }, { @"Falkland Islands pound", @"falkland-pfund|falkland £|fkp|falkland-£" }, { @"Gibraltar pound", @"gibraltar-pfund|gibraltar £|gibraltar-£|gip" }, { @"Manx pound", @"isle-of-man-pfund|isle-of-man-£|imp" }, { @"Jersey pound", @"jersey-pfund|jersey-£|jep" }, { @"Lebanese pound", @"libanesisches pfund|libanesische pfund|libanesischen pfund|libanesisches-£|lbp|ل.ل" }, { @"South Georgia and the South Sandwich Islands pound", @"süd-georgien & die südlichen sandwichinseln pfund|süd-georgien & die südlichen sandwichinseln £" }, { @"South Sudanese pound", @"südsudanesisches pfund|südsudanesische pfund|südsudanesischen pfund|südsudanesisches £|ssp|südsudanesische £" }, { @"Sudanese pound", @"sudanesisches pfund|sudanesische pfund|sudanesischen pfund|sudanesisches £|ج.س.|sdg|sudanesische £" }, { @"Syrian pound", @"syrisches pfund|syrische pfund|syrischen pfund|syrisches £|ل.س|syp|syrische £" }, { @"Tristan da Cunha pound", @"tristan-da-cunha-pfund|tristan-da-cunha-£" }, { @"Pound", @"pfund|£" }, { @"Pence", @"pence" }, { @"Shilling", @"shillings|shilling|shilingi|sh" }, { @"Penny", @"pennies|penny" }, { @"United States dollar", @"us-dollar|us$|usd|amerikanischer dollar|amerikanische dollar|amerikanischen dollar" }, { @"East Caribbean dollar", @"ostkaribischer dollar|ostkaribische dollar|ostkaribischen dollar|ostkaribische $|xcd" }, { @"Australian dollar", @"australischer dollar|australische dollar|australischen dollar|australische $|aud" }, { @"Bahamian dollar", @"bahama-dollar|bahama-$|bsd" }, { @"Barbadian dollar", @"barbados-dollar|barbados-$|bbd" }, { @"Belize dollar", @"belize-dollar|belize-$|bzd" }, { @"Bermudian dollar", @"bermuda-dollar|bermuda-$|bmd" }, { @"British Virgin Islands dollar", @"british virgin islands dollars|british virgin islands dollar|british virgin islands $|bvi$|virgin islands dollars|virgin islands dolalr|virgin islands $|virgin island dollars|virgin island dollar|virgin island $" }, { @"Brunei dollar", @"brunei-dollar|brunei $|bnd" }, { @"Sen", @"sen" }, { @"Singapore dollar", @"singapur-dollar|singapur-$|s$|sgd" }, { @"Canadian dollar", @"kanadischer dollar|kanadische dollar|kanadischen dollar|cad|can$|c$" }, { @"Cayman Islands dollar", @"kaiman-dollar|kaiman-$|kyd|ci$" }, { @"New Zealand dollar", @"neuseeland-dollar|neuseeland-$|nz$|nzd|kiwi" }, { @"Cook Islands dollar", @"cookinseln-dollar|cookinseln-$" }, { @"Fijian dollar", @"fidschi-dollar|fidschi-$|fjd" }, { @"Guyanese dollar", @"guyana-dollar|gyd|gy$" }, { @"Hong Kong dollar", @"hongkong-dollar|hong kong $|hk$|hkd|hk dollars|hk dollar|hk $|hongkong$" }, { @"Jamaican dollar", @"jamaika-dollar|jamaika-$|j$" }, { @"Kiribati dollar", @"kiribati-dollar|kiribati-$" }, { @"Liberian dollar", @"liberianischer dollar|liberianische dollar|liberianischen dollar|liberianische $|lrd" }, { @"Micronesian dollar", @"mikronesischer dollar|mikronesische dollar|mikronesischen dollar|mikronesische $" }, { @"Namibian dollar", @"namibia-dollar|namibia-$|nad|n$" }, { @"Nauruan dollar", @"nauru-dollar|nauru-$" }, { @"Niue dollar", @"niue-dollar|niue-$" }, { @"Palauan dollar", @"palau-dollar|palau-$" }, { @"Pitcairn Islands dollar", @"pitcairninseln-dollar|pitcairninseln-$" }, { @"Solomon Islands dollar", @"salomonen-dollar|salomonen-$|si$|sbd" }, { @"Surinamese dollar", @"suriname-dollar|suriname-$|srd" }, { @"New Taiwan dollar", @"neuer taiwan-dollar|neue taiwan-dollar|neuen taiwan-dollar|nt$|twd|ntd" }, { @"Trinidad and Tobago dollar", @"trinidad-und-tobago-dollar|trinidad-und-tobago-$|ttd" }, { @"Tuvaluan dollar", @"tuvaluischer dollar|tuvaluische dollar|tuvaluischen dollar|tuvaluische $" }, { @"Dollar", @"dollar|$" }, { @"Chinese yuan", @"yuan|chinesischer yuan|chinesische yuan|chinesischen yuan|renminbi|cny|rmb|¥" }, { @"Fen", @"fen" }, { @"Jiao", @"jiao" }, { @"Finnish markka", @"suomen markka|finnish markka|finsk mark|fim|markkaa|markka|finnische mark|finnischen mark" }, { @"Penni", @"penniä|penni" } }; public const string CompoundUnitConnectorRegex = @"(?<spacer>[^.])"; public static readonly Dictionary<string, string> CurrencyPrefixList = new Dictionary<string, string> { { @"Dollar", @"$" }, { @"United States dollar", @"united states $|us$|us $|u.s. $|u.s $" }, { @"East Caribbean dollar", @"east caribbean $" }, { @"Australian dollar", @"australian $|australia $" }, { @"Bahamian dollar", @"bahamian $|bahamia $" }, { @"Barbadian dollar", @"barbadian $|barbadin $" }, { @"Belize dollar", @"belize $" }, { @"Bermudian dollar", @"bermudian $" }, { @"British Virgin Islands dollar", @"british virgin islands $|bvi$|virgin islands $|virgin island $|british virgin island $" }, { @"Brunei dollar", @"brunei $|b$" }, { @"Sen", @"sen" }, { @"Singapore dollar", @"singapore $|s$" }, { @"Canadian dollar", @"canadian $|can$|c$|c $|canada $" }, { @"Cayman Islands dollar", @"cayman islands $|ci$|cayman island $" }, { @"New Zealand dollar", @"new zealand $|nz$|nz $" }, { @"Cook Islands dollar", @"cook islands $|cook island $" }, { @"Fijian dollar", @"fijian $|fiji $" }, { @"Guyanese dollar", @"gy$|gy $|g$|g $" }, { @"Hong Kong dollar", @"hong kong $|hk$|hkd|hk $" }, { @"Jamaican dollar", @"jamaican $|j$|jamaica $" }, { @"Kiribati dollar", @"kiribati $" }, { @"Liberian dollar", @"liberian $|liberia $" }, { @"Micronesian dollar", @"micronesian $" }, { @"Namibian dollar", @"namibian $|nad|n$|namibia $" }, { @"Nauruan dollar", @"nauruan $" }, { @"Niue dollar", @"niue $" }, { @"Palauan dollar", @"palauan $" }, { @"Pitcairn Islands dollar", @"pitcairn islands $|pitcairn island $" }, { @"Solomon Islands dollar", @"solomon islands $|si$|si $|solomon island $" }, { @"Surinamese dollar", @"surinamese $|surinam $" }, { @"New Taiwan dollar", @"nt$|nt $" }, { @"Trinidad and Tobago dollar", @"trinidad and tobago $|trinidad $|trinidadian $" }, { @"Tuvaluan dollar", @"tuvaluan $" }, { @"Samoan tālā", @"ws$" }, { @"Chinese yuan", @"¥" }, { @"Japanese yen", @"¥" }, { @"Euro", @"€" }, { @"Pound", @"£" }, { @"Costa Rican colón", @"₡" }, { @"Turkish lira", @"₺" } }; public static readonly IList<string> AmbiguousCurrencyUnitList = new List<string> { @"din.", @"kiwi", @"kina", @"kobo", @"lari", @"lipa", @"napa", @"para", @"sfr.", @"taka", @"tala", @"toea", @"vatu", @"yuan", @"ang", @"ban", @"bob", @"btn", @"byr", @"cad", @"cop", @"cup", @"dop", @"gip", @"jod", @"kgs", @"lak", @"lei", @"mga", @"mop", @"nad", @"omr", @"pul", @"sar", @"sbd", @"scr", @"sdg", @"sek", @"sen", @"sol", @"sos", @"std", @"try", @"yer", @"yen" }; public static readonly Dictionary<string, string> InformationSuffixList = new Dictionary<string, string> { { @"Bit", @"-bit|bit|bits" }, { @"Kilobit", @"kilobit|kilobits|kb|kbit" }, { @"Megabit", @"megabit|megabits|Mb|Mbit" }, { @"Gigabit", @"gigabit|gigabits|Gb|Gbit" }, { @"Terabit", @"terabit|terabits|Tb|Tbit" }, { @"Petabit", @"petabit|petabits|Pb|Pbit" }, { @"Byte", @"byte|bytes" }, { @"Kilobyte", @"kilobyte|kB|kilobytes|kilo byte|kilo bytes|kByte" }, { @"Megabyte", @"megabyte|mB|megabytes|mega byte|mega bytes|MByte" }, { @"Gigabyte", @"gigabyte|gB|gigabytes|giga byte|giga bytes|GByte" }, { @"Terabyte", @"terabyte|tB|terabytes|tera byte|tera bytes|TByte" }, { @"Petabyte", @"petabyte|pB|petabytes|peta byte|peta bytes|PByte" } }; public static readonly IList<string> AmbiguousDimensionUnitList = new List<string> { @"barrel", @"grain", @"gran", @"grän", @"korn", @"pfund", @"stone", @"yard", @"cord", @"dram", @"fuß", @"gill", @"knoten", @"peck", @"cup", @"fps", @"pts", @"in", @"""" }; public const string BuildPrefix = @"(?<=(\s|^))"; public const string BuildSuffix = @"(?=(\s|\W|$))"; public static readonly Dictionary<string, string> LengthSuffixList = new Dictionary<string, string> { { @"Kilometer", @"km|kilometer|kilometern" }, { @"Hectometer", @"hm|hektometer|hektometern" }, { @"Decameter", @"dam|dekameter|dekametern" }, { @"Meter", @"m|meter|metern" }, { @"Decimeter", @"dm|dezimeter|dezimetern" }, { @"Centimeter", @"cm|zentimeter|centimeter|zentimetern|centimetern" }, { @"Millimeter", @"mm|millimeter|millimetern" }, { @"Micrometer", @"μm|mikrometer|mikrometern" }, { @"Nanometer", @"nm|nanometer|nanometern" }, { @"Picometer", @"pm|pikometer|picometer|pikometern|picometern" }, { @"Mile", @"meile|meilen" }, { @"Yard", @"yard|yards" }, { @"Inch", @"zoll|inch|in|""" }, { @"Foot", @"fuß|ft" }, { @"Light year", @"lichtjahr|lichtjahre|lichtjahren" }, { @"Pt", @"pt|pts" } }; public static readonly IList<string> AmbiguousLengthUnitList = new List<string> { @"m", @"yard", @"yards", @"pm", @"pt", @"pts" }; public static readonly Dictionary<string, string> SpeedSuffixList = new Dictionary<string, string> { { @"Meter per second", @"meter/sekunde|m/s|meter pro sekunde|metern pro sekunde" }, { @"Kilometer per hour", @"km/h|kilometer/stunde|kilometer pro stunde|kilometern pro stunde" }, { @"Kilometer per minute", @"km/min|kilometer pro minute|kilometern pro minute" }, { @"Kilometer per second", @"km/s|kilometer pro sekunde|kilometern pro sekunde" }, { @"Mile per hour", @"mph|mi/h|meilen pro stunde|meilen/stunde|meile pro stunde" }, { @"Knot", @"kt|knoten|kn" }, { @"Foot per second", @"ft/s|fuß/sekunde|fuß pro sekunde|fps" }, { @"Foot per minute", @"ft/min|fuß/minute|fuß pro minute" }, { @"Yard per minute", @"yard pro minute|yard/minute|yard/min" }, { @"Yard per second", @"yard pro sekunde|yard/sekunde|yard/s" } }; public static readonly Dictionary<string, string> TemperatureSuffixList = new Dictionary<string, string> { { @"F", @"grad fahrenheit|°fahrenheit|°f|fahrenheit" }, { @"K", @"k|K|kelvin|grad kelvin|°kelvin|°k|°K" }, { @"R", @"rankine|°r" }, { @"D", @"delisle|°de" }, { @"C", @"grad celsius|°celsius|°c|celsius" }, { @"Degree", @"grad|°" } }; public static readonly IList<string> AmbiguousTemperatureUnitList = new List<string> { @"c", @"f", @"k" }; public static readonly Dictionary<string, string> VolumeSuffixList = new Dictionary<string, string> { { @"Cubic meter", @"m3|kubikmeter|m³" }, { @"Cubic centimeter", @"kubikzentimeter|cm³" }, { @"Cubic millimiter", @"kubikmillimeter|mm³" }, { @"Hectoliter", @"hektoliter" }, { @"Decaliter", @"dekaliter" }, { @"Liter", @"l|liter" }, { @"Deciliter", @"dl|deziliter" }, { @"Centiliter", @"cl|zentiliter" }, { @"Milliliter", @"ml|mls|milliliter" }, { @"Cubic yard", @"kubikyard" }, { @"Cubic inch", @"kubikzoll" }, { @"Cubic foot", @"kubikfuß" }, { @"Cubic mile", @"kubikmeile" }, { @"Fluid ounce", @"fl oz|flüssigunze|fluessigunze" }, { @"Teaspoon", @"teelöffel|teeloeffel" }, { @"Tablespoon", @"esslöffel|essloeffel" }, { @"Pint", @"pinte" }, { @"Volume unit", @"fluid dram|Fluid drachm|Flüssigdrachme|Gill|Quart|Minim|Barrel|Cord|Peck|Beck|Scheffel|Hogshead|Oxhoft" } }; public static readonly IList<string> AmbiguousVolumeUnitList = new List<string> { @"l", @"unze", @"oz", @"cup", @"peck", @"cord", @"gill" }; public static readonly Dictionary<string, string> WeightSuffixList = new Dictionary<string, string> { { @"Kilogram", @"kg|kilogramm|kilo" }, { @"Gram", @"g|gramm" }, { @"Milligram", @"mg|milligramm" }, { @"Barrel", @"barrel" }, { @"Gallon", @"gallone|gallonen" }, { @"Metric ton", @"metrische tonne|metrische tonnen" }, { @"Ton", @"tonne|tonnen" }, { @"Pound", @"pfund|lb" }, { @"Ounce", @"unze|unzen|oz|ounces" }, { @"Weight unit", @"pennyweight|grain|british long ton|US short hundredweight|stone|dram" } }; public static readonly IList<string> AmbiguousWeightUnitList = new List<string> { @"g", @"oz", @"stone", @"dram" }; } }
64.557587
296
0.563419
[ "MIT" ]
AmmariJawher/Recognizers-Text
.NET/Microsoft.Recognizers.Definitions.Common/German/NumbersWithUnitDefinitions.cs
35,652
C#
#region License // Copyright (c) 2007 James Newton-King // // 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. #endregion using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using Microsoft.Identity.Json.Utilities; namespace Microsoft.Identity.Json { internal enum JsonContainerType { None = 0, Object = 1, Array = 2, Constructor = 3 } internal struct JsonPosition { private static readonly char[] SpecialCharacters = { '.', ' ', '\'', '/', '"', '[', ']', '(', ')', '\t', '\n', '\r', '\f', '\b', '\\', '\u0085', '\u2028', '\u2029' }; internal JsonContainerType Type; internal int Position; internal string PropertyName; internal bool HasIndex; public JsonPosition(JsonContainerType type) { Type = type; HasIndex = TypeHasIndex(type); Position = -1; PropertyName = null; } internal int CalculateLength() { switch (Type) { case JsonContainerType.Object: return PropertyName.Length + 5; case JsonContainerType.Array: case JsonContainerType.Constructor: return MathUtils.IntLength((ulong)Position) + 2; default: throw new ArgumentOutOfRangeException(nameof(Type)); } } internal void WriteTo(StringBuilder sb, ref StringWriter writer, ref char[] buffer) { switch (Type) { case JsonContainerType.Object: string propertyName = PropertyName; if (propertyName.IndexOfAny(SpecialCharacters) != -1) { sb.Append(@"['"); if (writer == null) { writer = new StringWriter(sb, CultureInfo.InvariantCulture); } JavaScriptUtils.WriteEscapedJavaScriptString(writer, propertyName, '\'', false, JavaScriptUtils.SingleQuoteCharEscapeFlags, StringEscapeHandling.Default, null, ref buffer); sb.Append(@"']"); } else { if (sb.Length > 0) { sb.Append('.'); } sb.Append(propertyName); } break; case JsonContainerType.Array: case JsonContainerType.Constructor: sb.Append('['); sb.Append(Position); sb.Append(']'); break; } } internal static bool TypeHasIndex(JsonContainerType type) { return (type == JsonContainerType.Array || type == JsonContainerType.Constructor); } internal static string BuildPath(List<JsonPosition> positions, JsonPosition? currentPosition) { int capacity = 0; if (positions != null) { for (int i = 0; i < positions.Count; i++) { capacity += positions[i].CalculateLength(); } } if (currentPosition != null) { capacity += currentPosition.GetValueOrDefault().CalculateLength(); } StringBuilder sb = new StringBuilder(capacity); StringWriter writer = null; char[] buffer = null; if (positions != null) { foreach (JsonPosition state in positions) { state.WriteTo(sb, ref writer, ref buffer); } } if (currentPosition != null) { currentPosition.GetValueOrDefault().WriteTo(sb, ref writer, ref buffer); } return sb.ToString(); } internal static string FormatMessage(IJsonLineInfo lineInfo, string path, string message) { // don't add a fullstop and space when message ends with a new line if (!message.EndsWith(Environment.NewLine, StringComparison.Ordinal)) { message = message.Trim(); if (!message.EndsWith('.')) { message += "."; } message += " "; } message += "Path '{0}'".FormatWith(CultureInfo.InvariantCulture, path); if (lineInfo != null && lineInfo.HasLineInfo()) { message += ", line {0}, position {1}".FormatWith(CultureInfo.InvariantCulture, lineInfo.LineNumber, lineInfo.LinePosition); } message += "."; return message; } } }
34.033898
196
0.530876
[ "MIT" ]
vboctor/azure-activedirectory-library-for-dotnet
msal/src/Microsoft.Identity.Client/json/JsonPosition.cs
6,024
C#
using _02.Card_Rank.Enums; using System; namespace _02.Card_Rank { public class Program { public static void Main() { string input = Console.ReadLine(); string[] cards = typeof(CardRanks).GetEnumNames(); Console.WriteLine("Card Ranks:"); foreach (var card in cards) { CardRanks parsed = (CardRanks)Enum.Parse(typeof(CardRanks), card); Console.WriteLine($"Ordinal value: {(int)parsed}; Name value: {parsed}"); } } } }
23.416667
89
0.544484
[ "MIT" ]
HristoSpasov/C-Sharp-Advanced
08. Exercise Enums and Attributes/Exercises Enumerations and Attributes/02. Card Rank/Program.cs
564
C#
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // ANTLR Version: 4.7.1 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ // Generated from Expr.g4 by ANTLR 4.7.1 // Unreachable code detected #pragma warning disable 0162 // The variable '...' is assigned but its value is never used #pragma warning disable 0219 // Missing XML comment for publicly visible type or member '...' #pragma warning disable 1591 // Ambiguous reference in cref attribute #pragma warning disable 419 namespace ExpressionInterpreter { using System; using System.IO; using System.Text; using Antlr4.Runtime; using Antlr4.Runtime.Atn; using Antlr4.Runtime.Misc; using DFA = Antlr4.Runtime.Dfa.DFA; [System.CodeDom.Compiler.GeneratedCode("ANTLR", "4.7.1")] [System.CLSCompliant(false)] public partial class ExprLexer : Lexer { protected static DFA[] decisionToDFA; protected static PredictionContextCache sharedContextCache = new PredictionContextCache(); public const int WS=1, NUM=2, ID=3, PREVAR=4, ADD=5, SUB=6, MUL=7, DIV=8, LP=9, RP=10, COMMA=11; public static string[] channelNames = { "DEFAULT_TOKEN_CHANNEL", "HIDDEN" }; public static string[] modeNames = { "DEFAULT_MODE" }; public static readonly string[] ruleNames = { "DIGIT", "LETTER", "WS", "NUM", "ID", "PREVAR", "ADD", "SUB", "MUL", "DIV", "LP", "RP", "COMMA" }; public ExprLexer(ICharStream input) : this(input, Console.Out, Console.Error) { } public ExprLexer(ICharStream input, TextWriter output, TextWriter errorOutput) : base(input, output, errorOutput) { Interpreter = new LexerATNSimulator(this, _ATN, decisionToDFA, sharedContextCache); } private static readonly string[] _LiteralNames = { null, null, null, null, null, "'+'", "'-'", "'*'", "'/'", "'('", "')'", "','" }; private static readonly string[] _SymbolicNames = { null, "WS", "NUM", "ID", "PREVAR", "ADD", "SUB", "MUL", "DIV", "LP", "RP", "COMMA" }; public static readonly IVocabulary DefaultVocabulary = new Vocabulary(_LiteralNames, _SymbolicNames); [NotNull] public override IVocabulary Vocabulary { get { return DefaultVocabulary; } } public override string GrammarFileName { get { return "Expr.g4"; } } public override string[] RuleNames { get { return ruleNames; } } public override string[] ChannelNames { get { return channelNames; } } public override string[] ModeNames { get { return modeNames; } } public override string SerializedAtn { get { return new string(_serializedATN); } } static ExprLexer() { decisionToDFA = new DFA[_ATN.NumberOfDecisions]; for (int i = 0; i < _ATN.NumberOfDecisions; i++) { decisionToDFA[i] = new DFA(_ATN.GetDecisionState(i), i); } } private static char[] _serializedATN = { '\x3', '\x608B', '\xA72A', '\x8133', '\xB9ED', '\x417C', '\x3BE7', '\x7786', '\x5964', '\x2', '\r', 'Q', '\b', '\x1', '\x4', '\x2', '\t', '\x2', '\x4', '\x3', '\t', '\x3', '\x4', '\x4', '\t', '\x4', '\x4', '\x5', '\t', '\x5', '\x4', '\x6', '\t', '\x6', '\x4', '\a', '\t', '\a', '\x4', '\b', '\t', '\b', '\x4', '\t', '\t', '\t', '\x4', '\n', '\t', '\n', '\x4', '\v', '\t', '\v', '\x4', '\f', '\t', '\f', '\x4', '\r', '\t', '\r', '\x4', '\xE', '\t', '\xE', '\x3', '\x2', '\x3', '\x2', '\x3', '\x3', '\x3', '\x3', '\x3', '\x4', '\x6', '\x4', '#', '\n', '\x4', '\r', '\x4', '\xE', '\x4', '$', '\x3', '\x4', '\x3', '\x4', '\x3', '\x5', '\x6', '\x5', '*', '\n', '\x5', '\r', '\x5', '\xE', '\x5', '+', '\x3', '\x5', '\x3', '\x5', '\x6', '\x5', '\x30', '\n', '\x5', '\r', '\x5', '\xE', '\x5', '\x31', '\x5', '\x5', '\x34', '\n', '\x5', '\x3', '\x6', '\x3', '\x6', '\x3', '\x6', '\a', '\x6', '\x39', '\n', '\x6', '\f', '\x6', '\xE', '\x6', '<', '\v', '\x6', '\x3', '\a', '\x3', '\a', '\x6', '\a', '@', '\n', '\a', '\r', '\a', '\xE', '\a', '\x41', '\x3', '\b', '\x3', '\b', '\x3', '\t', '\x3', '\t', '\x3', '\n', '\x3', '\n', '\x3', '\v', '\x3', '\v', '\x3', '\f', '\x3', '\f', '\x3', '\r', '\x3', '\r', '\x3', '\xE', '\x3', '\xE', '\x2', '\x2', '\xF', '\x3', '\x2', '\x5', '\x2', '\a', '\x3', '\t', '\x4', '\v', '\x5', '\r', '\x6', '\xF', '\a', '\x11', '\b', '\x13', '\t', '\x15', '\n', '\x17', '\v', '\x19', '\f', '\x1B', '\r', '\x3', '\x2', '\x5', '\x3', '\x2', '\x32', ';', '\x4', '\x2', '\x43', '\\', '\x63', '|', '\x5', '\x2', '\v', '\f', '\xF', '\xF', '\"', '\"', '\x2', 'U', '\x2', '\a', '\x3', '\x2', '\x2', '\x2', '\x2', '\t', '\x3', '\x2', '\x2', '\x2', '\x2', '\v', '\x3', '\x2', '\x2', '\x2', '\x2', '\r', '\x3', '\x2', '\x2', '\x2', '\x2', '\xF', '\x3', '\x2', '\x2', '\x2', '\x2', '\x11', '\x3', '\x2', '\x2', '\x2', '\x2', '\x13', '\x3', '\x2', '\x2', '\x2', '\x2', '\x15', '\x3', '\x2', '\x2', '\x2', '\x2', '\x17', '\x3', '\x2', '\x2', '\x2', '\x2', '\x19', '\x3', '\x2', '\x2', '\x2', '\x2', '\x1B', '\x3', '\x2', '\x2', '\x2', '\x3', '\x1D', '\x3', '\x2', '\x2', '\x2', '\x5', '\x1F', '\x3', '\x2', '\x2', '\x2', '\a', '\"', '\x3', '\x2', '\x2', '\x2', '\t', ')', '\x3', '\x2', '\x2', '\x2', '\v', '\x35', '\x3', '\x2', '\x2', '\x2', '\r', '=', '\x3', '\x2', '\x2', '\x2', '\xF', '\x43', '\x3', '\x2', '\x2', '\x2', '\x11', '\x45', '\x3', '\x2', '\x2', '\x2', '\x13', 'G', '\x3', '\x2', '\x2', '\x2', '\x15', 'I', '\x3', '\x2', '\x2', '\x2', '\x17', 'K', '\x3', '\x2', '\x2', '\x2', '\x19', 'M', '\x3', '\x2', '\x2', '\x2', '\x1B', 'O', '\x3', '\x2', '\x2', '\x2', '\x1D', '\x1E', '\t', '\x2', '\x2', '\x2', '\x1E', '\x4', '\x3', '\x2', '\x2', '\x2', '\x1F', ' ', '\t', '\x3', '\x2', '\x2', ' ', '\x6', '\x3', '\x2', '\x2', '\x2', '!', '#', '\t', '\x4', '\x2', '\x2', '\"', '!', '\x3', '\x2', '\x2', '\x2', '#', '$', '\x3', '\x2', '\x2', '\x2', '$', '\"', '\x3', '\x2', '\x2', '\x2', '$', '%', '\x3', '\x2', '\x2', '\x2', '%', '&', '\x3', '\x2', '\x2', '\x2', '&', '\'', '\b', '\x4', '\x2', '\x2', '\'', '\b', '\x3', '\x2', '\x2', '\x2', '(', '*', '\x5', '\x3', '\x2', '\x2', ')', '(', '\x3', '\x2', '\x2', '\x2', '*', '+', '\x3', '\x2', '\x2', '\x2', '+', ')', '\x3', '\x2', '\x2', '\x2', '+', ',', '\x3', '\x2', '\x2', '\x2', ',', '\x33', '\x3', '\x2', '\x2', '\x2', '-', '/', '\a', '\x30', '\x2', '\x2', '.', '\x30', '\x5', '\x3', '\x2', '\x2', '/', '.', '\x3', '\x2', '\x2', '\x2', '\x30', '\x31', '\x3', '\x2', '\x2', '\x2', '\x31', '/', '\x3', '\x2', '\x2', '\x2', '\x31', '\x32', '\x3', '\x2', '\x2', '\x2', '\x32', '\x34', '\x3', '\x2', '\x2', '\x2', '\x33', '-', '\x3', '\x2', '\x2', '\x2', '\x33', '\x34', '\x3', '\x2', '\x2', '\x2', '\x34', '\n', '\x3', '\x2', '\x2', '\x2', '\x35', ':', '\x5', '\x5', '\x3', '\x2', '\x36', '\x39', '\x5', '\x5', '\x3', '\x2', '\x37', '\x39', '\x5', '\x3', '\x2', '\x2', '\x38', '\x36', '\x3', '\x2', '\x2', '\x2', '\x38', '\x37', '\x3', '\x2', '\x2', '\x2', '\x39', '<', '\x3', '\x2', '\x2', '\x2', ':', '\x38', '\x3', '\x2', '\x2', '\x2', ':', ';', '\x3', '\x2', '\x2', '\x2', ';', '\f', '\x3', '\x2', '\x2', '\x2', '<', ':', '\x3', '\x2', '\x2', '\x2', '=', '?', '\a', '&', '\x2', '\x2', '>', '@', '\x5', '\x3', '\x2', '\x2', '?', '>', '\x3', '\x2', '\x2', '\x2', '@', '\x41', '\x3', '\x2', '\x2', '\x2', '\x41', '?', '\x3', '\x2', '\x2', '\x2', '\x41', '\x42', '\x3', '\x2', '\x2', '\x2', '\x42', '\xE', '\x3', '\x2', '\x2', '\x2', '\x43', '\x44', '\a', '-', '\x2', '\x2', '\x44', '\x10', '\x3', '\x2', '\x2', '\x2', '\x45', '\x46', '\a', '/', '\x2', '\x2', '\x46', '\x12', '\x3', '\x2', '\x2', '\x2', 'G', 'H', '\a', ',', '\x2', '\x2', 'H', '\x14', '\x3', '\x2', '\x2', '\x2', 'I', 'J', '\a', '\x31', '\x2', '\x2', 'J', '\x16', '\x3', '\x2', '\x2', '\x2', 'K', 'L', '\a', '*', '\x2', '\x2', 'L', '\x18', '\x3', '\x2', '\x2', '\x2', 'M', 'N', '\a', '+', '\x2', '\x2', 'N', '\x1A', '\x3', '\x2', '\x2', '\x2', 'O', 'P', '\a', '.', '\x2', '\x2', 'P', '\x1C', '\x3', '\x2', '\x2', '\x2', '\n', '\x2', '$', '+', '\x31', '\x33', '\x38', ':', '\x41', '\x3', '\b', '\x2', '\x2', }; public static readonly ATN _ATN = new ATNDeserializer().Deserialize(_serializedATN); } } // namespace ExpressionInterpreter
48.691429
103
0.397019
[ "MIT" ]
whoisfpc/SimpleExpressionInterpreter
SimpleExpressionInterpreter/Antlr/ExprLexer.cs
8,521
C#
/* * * (c) Copyright Ascensio System Limited 2010-2020 * * 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. * */ using System; using System.IO; using System.Collections.Generic; using System.Text; using System.Net; using System.Net.Sockets; namespace LumiSoft.Net.HTTP.Server { /// <summary> /// Default constructor. /// </summary> public class HTTP_Session : SocketServerSession { private HTTP_Server m_pServer = null; /// <summary> /// Default constructor. /// </summary> /// <param name="sessionID">Session ID.</param> /// <param name="socket">Server connected socket.</param> /// <param name="bindInfo">BindInfo what accepted socket.</param> /// <param name="server">Reference to server.</param> internal HTTP_Session(string sessionID,SocketEx socket,BindInfo bindInfo,HTTP_Server server) : base(sessionID,socket,bindInfo,server) { m_pServer = server; StartSession(); } #region method StartSession /// <summary> /// Starts session. /// </summary> private void StartSession() { // Add session to session list m_pServer.AddSession(this); try{ BeginRecieveCmd();/* // Check if ip is allowed to connect this computer if(m_pServer.OnValidate_IpAddress(this.LocalEndPoint,this.RemoteEndPoint)){ //--- Dedicated SSL connection, switch to SSL -----------------------------------// if(this.BindInfo.SSL){ try{ this.Socket.SwitchToSSL(this.BindInfo.SSL_Certificate); if(this.Socket.Logger != null){ this.Socket.Logger.AddTextEntry("SSL negotiation completed successfully."); } } catch(Exception x){ if(this.Socket.Logger != null){ this.Socket.Logger.AddTextEntry("SSL handshake failed ! " + x.Message); EndSession(); return; } } } //-------------------------------------------------------------------------------// BeginRecieveCmd(); } else{ EndSession(); }*/ } catch(Exception x){ OnError(x); } } #endregion #region method EndSession /// <summary> /// Ends session, closes socket. /// </summary> private void EndSession() { try{ // Write logs to log file, if needed if(m_pServer.LogCommands){ this.Socket.Logger.Flush(); } if(this.Socket != null){ this.Socket.Shutdown(SocketShutdown.Both); this.Socket.Disconnect(); //this.Socket = null; } } catch{ // We don't need to check errors here, because they only may be Socket closing errors. } finally{ m_pServer.RemoveSession(this); } } #endregion #region method OnError /// <summary> /// Is called when error occures. /// </summary> /// <param name="x"></param> private void OnError(Exception x) { try{ // We must see InnerException too, SocketException may be as inner exception. SocketException socketException = null; if(x is SocketException){ socketException = (SocketException)x; } else if(x.InnerException != null && x.InnerException is SocketException){ socketException = (SocketException)x.InnerException; } if(socketException != null){ // Client disconnected without shutting down if(socketException.ErrorCode == 10054 || socketException.ErrorCode == 10053){ if(m_pServer.LogCommands){ this.Socket.Logger.AddTextEntry("Client aborted/disconnected"); } EndSession(); // Exception handled, return return; } } m_pServer.OnSysError("",x); } catch(Exception ex){ m_pServer.OnSysError("",ex); } } #endregion #region method BeginRecieveCmd /// <summary> /// Starts recieveing command. /// </summary> private void BeginRecieveCmd() { MemoryStream strm = new MemoryStream(); this.Socket.BeginReadLine(strm,1024,strm,new SocketCallBack(this.EndRecieveCmd)); } #endregion #region method EndRecieveCmd /// <summary> /// Is called if command is recieved. /// </summary> /// <param name="result"></param> /// <param name="exception"></param> /// <param name="count"></param> /// <param name="tag"></param> private void EndRecieveCmd(SocketCallBackResult result,long count,Exception exception,object tag) { try{ switch(result) { case SocketCallBackResult.Ok: MemoryStream strm = (MemoryStream)tag; string cmdLine = System.Text.Encoding.Default.GetString(strm.ToArray()); // Exceute command if(SwitchCommand(cmdLine)){ // Session end, close session EndSession(); } break; case SocketCallBackResult.LengthExceeded: this.Socket.WriteLine("-ERR Line too long."); BeginRecieveCmd(); break; case SocketCallBackResult.SocketClosed: EndSession(); break; case SocketCallBackResult.Exception: OnError(exception); break; } } catch(Exception x){ OnError(x); } } #endregion #region method SwitchCommand /// <summary> /// Parses and executes HTTP commmand. /// </summary> /// <param name="commandLine">Command line.</param> /// <returns>Returns true,if session must be terminated.</returns> private bool SwitchCommand(string commandLine) { /* RFC 2616 5.1 Request-Line The Request-Line begins with a method token, followed by the Request-URI and the protocol version, and ending with CRLF. The elements are separated by SP characters. No CR or LF is allowed except in the final CRLF sequence. Request-Line = Method SP Request-URI SP HTTP-Version CRLF */ string[] parts = TextUtils.SplitQuotedString(commandLine,' '); string method = parts[0].ToUpper(); string uri = parts[1]; string httpVersion = parts[2]; //if(method == "OPTIONS"){ //} if(method == "GET"){ }/* else if(method == "HEAD"){ } else if(method == "POST"){ } else if(method == "PUT"){ } else if(method == "DELETE"){ } else if(method == "TRACE"){ } else if(method == "CONNECT"){ }*/ else{ } return false; } #endregion private void GET() { } } }
26.814035
141
0.549463
[ "Apache-2.0" ]
Ektai-Solution-Pty-Ltd/CommunityServer
module/ASC.Mail.Autoreply/ASC.Mail.Core/Net/HTTP/Server/HTTP_Session.cs
7,642
C#
using UnityEngine; namespace Es.InkPainter.Sample { [RequireComponent(typeof(Collider), typeof(MeshRenderer))] public class CollisionPainter : MonoBehaviour { [SerializeField] private Brush brush = null; [SerializeField] private int wait = 3; private int waitCount; public void Awake() { GetComponent<MeshRenderer>().material.color = brush.Color; } public void FixedUpdate() { ++waitCount; } public void OnCollisionStay(Collision collision) { if(waitCount < wait) return; waitCount = 0; foreach(var p in collision.contacts) { var canvas = p.otherCollider.GetComponent<InkCanvas>(); if(canvas != null) canvas.Paint(brush, p.point); } } } }
18.536585
62
0.642105
[ "MIT" ]
BryantSuen/THUAI4
interaction/InkPainter/CollisionPainter.cs
762
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("PhantasmaGateway")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("PhantasmaGateway")] [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("5f20137b-7544-44ec-9f5c-64cb2790254c")] // 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.810811
85
0.730501
[ "MIT" ]
Relfos/phantasma-poc
PhantasmaGateway/Properties/AssemblyInfo.cs
1,439
C#
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.1 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ namespace WpfTestApplication.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); public static Settings Default { get { return defaultInstance; } } } }
35.451613
152
0.566879
[ "MIT" ]
LokiMidgard/wpfUndo
WpfTestApplication/Properties/Settings.Designer.cs
1,101
C#
// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. // Ported from include/pulse/mainloop-api.h in PulseAudio 13.0 // Original source is Copyright © Holders. Licensed under the GNU Lesser Public License 2.1 (LGPL-2.1). See Notice.md in the repository root for more information. namespace TerraFX.Interop.PulseAudio { public partial struct pa_time_event { } }
38.916667
162
0.760171
[ "MIT" ]
tannergooding/terrafx.interop.pulseaudio
sources/Interop/PulseAudio/PulseAudio/pulse/mainloop-api/pa_time_event.cs
469
C#
using System; using System.Collections.Generic; using System.Linq; using System.Net.Http; using System.Threading.Tasks; using Xunit; namespace ProxyFairy.IntegrationTests.Tests { public class CustomerControllerTests : IClassFixture<CustomWebApplicationFactory<Startup>> { private readonly HttpClient _client; private readonly CustomWebApplicationFactory<Startup> _factory; public CustomerControllerTests(CustomWebApplicationFactory<ProxyFairy.Startup> factory) { _client = factory.CreateClient(); _factory = factory; } //TODO: this test should be changed in future [Fact] public async Task Get_CustomerPage() { //arrange var url = "/customer"; //act var response = await _client.GetAsync(url); //assert response.EnsureSuccessStatusCode(); Assert.Equal("text/html; charset=utf-8", response.Content.Headers.ContentType.ToString()); } } }
28.162162
102
0.647793
[ "MIT" ]
thelukkz/ProxyFairy
ProxyFairy.IntegrationTests/Tests/CustomerControllerTests.cs
1,044
C#
using System.Collections.Immutable; using System.Threading; using System.Threading.Tasks; using Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.Data; using Microsoft.VisualStudio.Text; using Microsoft.VisualStudio.Text.Editor; namespace Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion { /// <summary> /// Represents a class that filters and sorts available <see cref="CompletionItem"/>s given the current state of the editor. /// It also declares which completion filters are available for the returned subset of <see cref="CompletionItem"/>s. /// All methods are called on background thread. /// </summary> /// <remarks> /// Instances of this class should be created by <see cref="IAsyncCompletionItemManagerProvider"/>, which is a MEF part. /// </remarks> public interface IAsyncCompletionItemManager { /// <summary> /// This method is called before completion is about to appear, /// on subsequent typing events and when user toggles completion filters. /// <paramref name="session"/> tracks user user's input tracked with <see cref="IAsyncCompletionSession.ApplicableToSpan"/>. /// <paramref name="data"/> provides applicable <see cref="AsyncCompletionSessionDataSnapshot.Snapshot"/> and /// and <see cref="AsyncCompletionSessionDataSnapshot.SelectedFilters"/>s that indicate user's filter selection. /// </summary> /// <param name="session">The active <see cref="IAsyncCompletionSession"/>. See <see cref="IAsyncCompletionSession.ApplicableToSpan"/> and <see cref="IAsyncCompletionSession.TextView"/></param> /// <param name="data">Contains properties applicable at the time this method is invoked.</param> /// <param name="token">Cancellation token that may interrupt this operation</param> /// <returns>Instance of <see cref="FilteredCompletionModel"/> that contains completion items to render, filters to display and recommended item to select</returns> Task<FilteredCompletionModel> UpdateCompletionListAsync( IAsyncCompletionSession session, AsyncCompletionSessionDataSnapshot data, CancellationToken token); /// <summary> /// This method is first called before completion is about to appear. /// The result of this method will be used in subsequent invocations of <see cref="UpdateCompletionListAsync"/> /// <paramref name="session"/> tracks user user's input tracked with <see cref="IAsyncCompletionSession.ApplicableToSpan"/>. /// <paramref name="data"/> provides applicable <see cref="AsyncCompletionSessionDataSnapshot.Snapshot"/> and /// </summary> /// <param name="session">The active <see cref="IAsyncCompletionSession"/>. See <see cref="IAsyncCompletionSession.TextView"/></param> /// <param name="data">Contains properties applicable at the time this method is invoked.</param> /// <param name="token">Cancellation token that may interrupt this operation</param> /// <returns>Sorted <see cref="ImmutableArray"/> of <see cref="CompletionItem"/> that will be subsequently passed to <see cref="UpdateCompletionListAsync"/></returns> Task<ImmutableArray<CompletionItem>> SortCompletionListAsync( IAsyncCompletionSession session, AsyncCompletionSessionInitialDataSnapshot data, CancellationToken token); } }
66.423077
201
0.71685
[ "MIT" ]
AmadeusW/vs-editor-api
src/Editor/Language/Def/Language/AsyncCompletion/IAsyncCompletionItemManager.cs
3,456
C#
using System; using System.Collections.Generic; using HotChocolate.Types; using HotChocolate.Types.Descriptors; namespace HotChocolate.Configuration { public static class SchemaTypeResolver { private static readonly Type _keyValuePair = typeof(KeyValuePair<,>); public static bool TryInferSchemaType( ITypeInspector typeInspector, ExtendedTypeReference unresolvedType, out ExtendedTypeReference schemaType) { if (typeInspector is null) { throw new ArgumentNullException(nameof(typeInspector)); } if (unresolvedType is null) { throw new ArgumentNullException(nameof(unresolvedType)); } if (IsObjectTypeExtension(unresolvedType)) { schemaType = unresolvedType.With( type: typeInspector.GetType( typeof(ObjectTypeExtension<>).MakeGenericType(unresolvedType.Type.Type))); } else if (IsUnionType(unresolvedType)) { schemaType = unresolvedType.With( type: typeInspector.GetType( typeof(UnionType<>).MakeGenericType(unresolvedType.Type.Type))); } else if (IsInterfaceType(unresolvedType)) { schemaType = unresolvedType.With( type: typeInspector.GetType( typeof(InterfaceType<>).MakeGenericType(unresolvedType.Type.Type))); } else if (IsObjectType(unresolvedType)) { schemaType = unresolvedType.With( type: typeInspector.GetType( typeof(ObjectType<>).MakeGenericType(unresolvedType.Type.Type))); } else if (IsInputObjectType(unresolvedType)) { schemaType = unresolvedType.With( type: typeInspector.GetType( typeof(InputObjectType<>).MakeGenericType(unresolvedType.Type.Type))); } else if (IsEnumType(unresolvedType)) { schemaType = unresolvedType.With( type: typeInspector.GetType( typeof(EnumType<>).MakeGenericType(unresolvedType.Type.Type))); } else if (Scalars.TryGetScalar(unresolvedType.Type.Type, out Type scalarType)) { schemaType = unresolvedType.With(type: typeInspector.GetType(scalarType)); } else { schemaType = null; } return schemaType != null; } public static bool TryInferSchemaTypeKind( ExtendedTypeReference unresolvedType, out TypeKind kind) { if (unresolvedType == null) { throw new ArgumentNullException(nameof(unresolvedType)); } if (IsObjectTypeExtension(unresolvedType)) { kind = TypeKind.Object; return true; } if (IsUnionType(unresolvedType)) { kind = TypeKind.Union; return true; } if (IsInterfaceType(unresolvedType)) { kind = TypeKind.Interface; return true; } if (IsObjectType(unresolvedType)) { kind = TypeKind.Object; return true; } if (IsInputObjectType(unresolvedType)) { kind = TypeKind.InputObject; return true; } if (IsEnumType(unresolvedType)) { kind = TypeKind.Enum; return true; } if (Scalars.TryGetScalar(unresolvedType.Type.Type, out _)) { kind = TypeKind.Scalar; return true; } kind = default; return false; } private static bool IsObjectType(ExtendedTypeReference unresolvedType) { return (IsComplexType(unresolvedType) || unresolvedType.Type.Type.IsDefined(typeof(ObjectTypeAttribute), true)) && (unresolvedType.Context == TypeContext.Output || unresolvedType.Context == TypeContext.None); } private static bool IsObjectTypeExtension(ExtendedTypeReference unresolvedType) => unresolvedType.Type.Type.IsDefined(typeof(ExtendObjectTypeAttribute), true); private static bool IsUnionType(ExtendedTypeReference unresolvedType) { return unresolvedType.Type.Type.IsDefined(typeof(UnionTypeAttribute), true) && (unresolvedType.Context == TypeContext.Output || unresolvedType.Context == TypeContext.None); } private static bool IsInterfaceType(ExtendedTypeReference unresolvedType) { return (unresolvedType.Type.IsInterface || unresolvedType.Type.Type.IsDefined(typeof(InterfaceTypeAttribute), true)) && (unresolvedType.Context == TypeContext.Output || unresolvedType.Context == TypeContext.None); } private static bool IsInputObjectType(ExtendedTypeReference unresolvedType) { return (IsComplexType(unresolvedType) || unresolvedType.Type.Type.IsDefined(typeof(InputObjectTypeAttribute), true)) && !unresolvedType.Type.Type.IsAbstract && unresolvedType.Context == TypeContext.Input; } private static bool IsEnumType(ExtendedTypeReference unresolvedType) { return (unresolvedType.Type.Type.IsEnum || unresolvedType.Type.Type.IsDefined(typeof(EnumTypeAttribute), true)) && IsPublic(unresolvedType); } private static bool IsComplexType(ExtendedTypeReference unresolvedType) { bool isComplexType = unresolvedType.Type.Type.IsClass && IsPublic(unresolvedType) && unresolvedType.Type.Type != typeof(string); if (!isComplexType && unresolvedType.Type.IsGeneric) { Type typeDefinition = unresolvedType.Type.Definition; return typeDefinition == _keyValuePair; } return isComplexType; } private static bool IsPublic(ExtendedTypeReference unresolvedType) { return unresolvedType.Type.Type.IsPublic || unresolvedType.Type.Type.IsNestedPublic; } } }
35.118557
98
0.553501
[ "MIT" ]
GraemeF/hotchocolate
src/HotChocolate/Core/src/Types/Configuration/SchemaTypeResolver.cs
6,813
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using AuthorizeNet.Api.Contracts.V1; using AuthorizeNet.Api.Controllers; using AuthorizeNet.Api.Controllers.Bases; namespace net.authorize.sample { public class GetCustomerProfile { public static ANetApiResponse Run(String ApiLoginID, String ApiTransactionKey, string customerProfileId) { Console.WriteLine("Get Customer Profile sample"); ApiOperationBase<ANetApiRequest, ANetApiResponse>.RunEnvironment = AuthorizeNet.Environment.SANDBOX; // define the merchant information (authentication / transaction id) ApiOperationBase<ANetApiRequest, ANetApiResponse>.MerchantAuthentication = new merchantAuthenticationType() { name = ApiLoginID, ItemElementName = ItemChoiceType.transactionKey, Item = ApiTransactionKey, }; var request = new getCustomerProfileRequest(); request.customerProfileId = customerProfileId; // instantiate the controller that will call the service var controller = new getCustomerProfileController(request); controller.Execute(); // get the response from the service (errors contained if any) var response = controller.GetApiResponse(); if (response != null && response.messages.resultCode == messageTypeEnum.Ok) { Console.WriteLine(response.messages.message[0].text); Console.WriteLine("Customer Profile Id: " + response.profile.customerProfileId); if (response.subscriptionIds != null && response.subscriptionIds.Length > 0) { Console.WriteLine("List of subscriptions : "); for (int i = 0; i < response.subscriptionIds.Length; i++) Console.WriteLine(response.subscriptionIds[i]); } } else if(response != null) { Console.WriteLine("Error: " + response.messages.message[0].code + " " + response.messages.message[0].text); } return response; } } }
37.901639
119
0.615484
[ "MIT" ]
arbogire/sample-code-csharp
CustomerProfiles/GetCustomerProfile.cs
2,314
C#
/* * Copyright 2010-2014 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 swf-2012-01-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Xml.Serialization; using System.Text; using System.IO; using Amazon.Runtime; using Amazon.Runtime.Internal; namespace Amazon.SimpleWorkflow.Model { /// <summary> /// Provides the details of the <code>ChildWorkflowExecutionCompleted</code> event. /// </summary> public partial class ChildWorkflowExecutionCompletedEventAttributes { private long? _initiatedEventId; private string _result; private long? _startedEventId; private WorkflowExecution _workflowExecution; private WorkflowType _workflowType; /// <summary> /// Gets and sets the property InitiatedEventId. /// <para> /// The ID of the <code>StartChildWorkflowExecutionInitiated</code> event corresponding /// to the <code>StartChildWorkflowExecution</code> <a>Decision</a> to start this child /// workflow execution. This information can be useful for diagnosing problems by tracing /// back the chain of events leading up to this event. /// </para> /// </summary> public long InitiatedEventId { get { return this._initiatedEventId.GetValueOrDefault(); } set { this._initiatedEventId = value; } } // Check to see if InitiatedEventId property is set internal bool IsSetInitiatedEventId() { return this._initiatedEventId.HasValue; } /// <summary> /// Gets and sets the property Result. /// <para> /// The result of the child workflow execution. /// </para> /// </summary> public string Result { get { return this._result; } set { this._result = value; } } // Check to see if Result property is set internal bool IsSetResult() { return this._result != null; } /// <summary> /// Gets and sets the property StartedEventId. /// <para> /// The ID of the <code>ChildWorkflowExecutionStarted</code> event recorded when this /// child workflow execution was started. This information can be useful for diagnosing /// problems by tracing back the chain of events leading up to this event. /// </para> /// </summary> public long StartedEventId { get { return this._startedEventId.GetValueOrDefault(); } set { this._startedEventId = value; } } // Check to see if StartedEventId property is set internal bool IsSetStartedEventId() { return this._startedEventId.HasValue; } /// <summary> /// Gets and sets the property WorkflowExecution. /// <para> /// The child workflow execution that was completed. /// </para> /// </summary> public WorkflowExecution WorkflowExecution { get { return this._workflowExecution; } set { this._workflowExecution = value; } } // Check to see if WorkflowExecution property is set internal bool IsSetWorkflowExecution() { return this._workflowExecution != null; } /// <summary> /// Gets and sets the property WorkflowType. /// <para> /// The type of the child workflow execution. /// </para> /// </summary> public WorkflowType WorkflowType { get { return this._workflowType; } set { this._workflowType = value; } } // Check to see if WorkflowType property is set internal bool IsSetWorkflowType() { return this._workflowType != null; } } }
32.80292
101
0.609924
[ "Apache-2.0" ]
Bio2hazard/aws-sdk-net
sdk/src/Services/SimpleWorkflow/Generated/Model/ChildWorkflowExecutionCompletedEventAttributes.cs
4,494
C#
// ---------------------------------------------------------------------------------- // // Copyright Microsoft Corporation // 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. // ---------------------------------------------------------------------------------- using Microsoft.Azure.Commands.Common.Authentication; using Microsoft.Azure.Commands.Common.Authentication.Abstractions; using Microsoft.Azure.Management.Sql; using Microsoft.Azure.Management.Sql.Models; using Microsoft.Rest.Azure; using System; using System.Collections.Generic; using System.Linq; namespace Microsoft.Azure.Commands.Sql.DataClassification.Services { internal class DataClassificationEndpointsCommunicator { private ISqlManagementClient SqlManagementClient { get; set; } private IAzureSubscription Subscription { get; set; } private IAzureContext Context { get; set; } internal DataClassificationEndpointsCommunicator(IAzureContext context) { Context = context; if (context?.Subscription != Subscription) { Subscription = context?.Subscription; SqlManagementClient = null; } } internal void SetSensitivityLabel(string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabel sensitivityLabel) { GetCurrentSqlManagementClient().SensitivityLabels.CreateOrUpdate(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, sensitivityLabel); } internal void SetManagedDatabaseSensitivityLabel(string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName, SensitivityLabel sensitivityLabel) { GetCurrentSqlManagementClient().ManagedDatabaseSensitivityLabels.CreateOrUpdate(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName, sensitivityLabel); } internal void DeleteSensitivityLabel(string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName) { GetCurrentSqlManagementClient().SensitivityLabels.Delete(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName); } internal void DeleteManagedDatabaseSensitivityLabel(string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName) { GetCurrentSqlManagementClient().ManagedDatabaseSensitivityLabels.Delete(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName); } internal List<SensitivityLabel> GetSensitivityLabel(string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName) { SensitivityLabel sensitivityLabel = GetCurrentSqlManagementClient().SensitivityLabels.Get( resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, SensitivityLabelSource.Current); return ToList(sensitivityLabel); } internal List<SensitivityLabel> GetManagedDatabaseSensitivityLabel(string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName) { SensitivityLabel sensitivityLabel = GetCurrentSqlManagementClient().ManagedDatabaseSensitivityLabels.Get( resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName, SensitivityLabelSource.Current); return ToList(sensitivityLabel); } internal List<SensitivityLabel> GetCurrentSensitivityLabels(string resourceGroupName, string serverName, string databaseName) { return IterateOverPages( () => GetCurrentSqlManagementClient().SensitivityLabels.ListCurrentByDatabase( resourceGroupName, serverName, databaseName), nextPageLink => GetCurrentSqlManagementClient().SensitivityLabels.ListCurrentByDatabaseNext(nextPageLink)); } internal List<SensitivityLabel> GetRecommendedSensitivityLabels(string resourceGroupName, string serverName, string databaseName) { return IterateOverPages( () => GetCurrentSqlManagementClient().SensitivityLabels.ListRecommendedByDatabase( resourceGroupName, serverName, databaseName), nextPageLink => GetCurrentSqlManagementClient().SensitivityLabels.ListRecommendedByDatabaseNext(nextPageLink)); } internal List<SensitivityLabel> GetManagedDatabaseCurrentSensitivityLabels(string resourceGroupName, string managedInstanceName, string databaseName) { return IterateOverPages( () => GetCurrentSqlManagementClient().ManagedDatabaseSensitivityLabels.ListCurrentByDatabase( resourceGroupName, managedInstanceName, databaseName), nextPageLink => GetCurrentSqlManagementClient().ManagedDatabaseSensitivityLabels.ListCurrentByDatabaseNext(nextPageLink)); } internal List<SensitivityLabel> GetManagedDatabaseRecommendedSensitivityLabels(string resourceGroupName, string managedInstanceName, string databaseName) { return IterateOverPages( () => GetCurrentSqlManagementClient().ManagedDatabaseSensitivityLabels.ListRecommendedByDatabase( resourceGroupName, managedInstanceName, databaseName), nextPageLink => GetCurrentSqlManagementClient().ManagedDatabaseSensitivityLabels.ListRecommendedByDatabaseNext(nextPageLink)); } internal void EnableSensitivityRecommendation(string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName) { GetCurrentSqlManagementClient().SensitivityLabels.EnableRecommendation(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName); } internal void DisableSensitivityRecommendation(string resourceGroupName, string serverName, string databaseName, string schemaName, string tableName, string columnName) { GetCurrentSqlManagementClient().SensitivityLabels.DisableRecommendation(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName); } internal void EnableManagedDatabaseSensitivityRecommendation(string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName) { GetCurrentSqlManagementClient().ManagedDatabaseSensitivityLabels.EnableRecommendation(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName); } internal void DisableManagedDatabaseSensitivityRecommendation(string resourceGroupName, string managedInstanceName, string databaseName, string schemaName, string tableName, string columnName) { GetCurrentSqlManagementClient().ManagedDatabaseSensitivityLabels.DisableRecommendation(resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName); } private List<SensitivityLabel> IterateOverPages( Func<IPage<SensitivityLabel>> listByDatabase, Func<string, IPage<SensitivityLabel>> listByNextPageLink) { IPage<SensitivityLabel> sensitivityLabelsPage = listByDatabase(); List<SensitivityLabel> sensitivityLabelsList = ToList(sensitivityLabelsPage); string nextPageLink = sensitivityLabelsPage?.NextPageLink; while (!string.IsNullOrEmpty(nextPageLink)) { sensitivityLabelsPage = listByNextPageLink(nextPageLink); nextPageLink = sensitivityLabelsPage?.NextPageLink; sensitivityLabelsList.AddRange(ToList(sensitivityLabelsPage)); } return sensitivityLabelsList; } private static List<SensitivityLabel> ToList(IPage<SensitivityLabel> sensitivityLabelsPage) { return sensitivityLabelsPage == null ? new List<SensitivityLabel>() : sensitivityLabelsPage.ToList(); } private static List<SensitivityLabel> ToList(SensitivityLabel sensitivityLabel) { return sensitivityLabel == null ? new List<SensitivityLabel>() : new List<SensitivityLabel> { sensitivityLabel }; } private ISqlManagementClient GetCurrentSqlManagementClient() { if (SqlManagementClient == null) { SqlManagementClient = AzureSession.Instance.ClientFactory.CreateArmClient<SqlManagementClient>(Context, AzureEnvironment.Endpoint.ResourceManager); } return SqlManagementClient; } } }
51.176768
164
0.680647
[ "MIT" ]
AikoTsuruoka/azure-powershell
src/Sql/Sql/DataClassification/Services/DataClassificationEndpointsCommunicator.cs
9,938
C#
using Cosmetics.Cart; using Cosmetics.Products; using System; namespace Cosmetics.Core.Engine { public class CosmeticsFactory { public Category CreateCategory(string name) { return new Category(name); } public Product CreateProduct(string name, string brand, decimal price, string gender) { throw new NotImplementedException(); } public ShoppingCart ShoppingCart() { return new ShoppingCart(); } } }
21.791667
93
0.608031
[ "MIT" ]
VeselinovStf/Telerik_Alpha_NET_Prep
CSharp/11_OOPWorshop01/Cosmetics-Skeleton/Cosmetics.Core/Engine/CosmeticsFactory.cs
525
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("WebApplicationMvcGlimpse")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("WebApplicationMvcGlimpse")] [assembly: AssemblyCopyright("Copyright © 2013")] [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("e824aa55-2994-4227-a73f-faa62a004355")] // 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 Revision and Build Numbers // by using the '*' as shown below: [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
38.361111
84
0.753077
[ "MIT" ]
TelerikAcademy/SchoolAcademy
2015-02-ASP.NET-MVC/02. ASP.NET MVC Essentials/WebApplicationMvcGlimpse/Properties/AssemblyInfo.cs
1,384
C#
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; // For more information on enabling MVC for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860 namespace Microsoft.eShopOnContainers.Services.Ordering.API.Controllers { public class HomeController : Controller { // GET: /<controller>/ public IActionResult Index() { return new RedirectResult("~/swagger/ui"); } } }
26
111
0.7
[ "MIT" ]
DavidsCavalcante/eShopOnAzure
src/Services/Ordering/Ordering.API/Controllers/HomeController.cs
522
C#
using System; using Android.App; using Android.Content; using Android.OS; using Android.Views; using Android.Widget; namespace XamSnap.Droid { [Activity(Label = "Messages")] public class MessagesActivity : BaseActivity<MessageViewModel> { ListView listView; EditText messageText; Button sendButton; Adapter adapter; protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); Title = viewModel.Conversation.UserName; SetContentView(Resource.Layout.Messages); listView = FindViewById<ListView>(Resource.Id.messageList); messageText = FindViewById<EditText>(Resource.Id.messageText); sendButton = FindViewById<Button>(Resource.Id.sendButton); listView.Adapter = adapter = new Adapter(this); sendButton.Click += async (sender, e) => { viewModel.Text = messageText.Text; try { await viewModel.SendMessage(); messageText.Text = string.Empty; adapter.NotifyDataSetInvalidated(); } catch (Exception exc) { DisplayError(exc); } }; } protected async override void OnResume() { base.OnResume(); try { await viewModel.GetMessages(); adapter.NotifyDataSetInvalidated(); listView.SetSelection(adapter.Count); } catch (Exception exc) { DisplayError(exc); } } class Adapter : BaseAdapter<Message> { readonly MessageViewModel messageViewModel = ServiceContainer.Resolve<MessageViewModel>(); readonly ISettings settings = ServiceContainer.Resolve<ISettings>(); readonly LayoutInflater inflater; const int MyMessageType = 0, TheirMessageType = 1; public Adapter(Context context) { inflater = (LayoutInflater)context.GetSystemService(Context.LayoutInflaterService); } public override long GetItemId(int position) { return position; } public override int Count { get { return messageViewModel.Messages == null ? 0 : messageViewModel.Messages.Length; } } public override Message this[int position] { get { return messageViewModel.Messages[position]; } } public override int ViewTypeCount { get { return 2; } } public override int GetItemViewType(int position) { var message = this[position]; return message.UserName == settings.User.Name ? MyMessageType : TheirMessageType; } public override View GetView(int position, View convertView, ViewGroup parent) { var message = this[position]; int type = GetItemViewType(position); if (convertView == null) { if (type == MyMessageType) { convertView = inflater.Inflate(Resource.Layout.MyMessageListItem, null); } else { convertView = inflater.Inflate(Resource.Layout.TheirMessageListItem, null); } } TextView messageText; if (type == MyMessageType) { messageText = convertView.FindViewById<TextView>(Resource.Id.myMessageText); } else { messageText = convertView.FindViewById<TextView>(Resource.Id.theirMessageText); } messageText.Text = message.Text; return convertView; } } } }
32.220588
103
0.493154
[ "MIT" ]
PacktPublishing/Xamarin4x-Cross-Platform-Application-Development-Third-Edition
Chapter06/XamSnap-06/XamSnap-master/Droid/Activities/MessagesActivity.cs
4,384
C#
using System; namespace ConsoleInteractive.InputValidation { /// <summary> /// Exception to throw when doing a validation, same as returning (false, "") /// </summary> public class ValidationException : Exception { public ValidationException(string message) : base(message) {} } }
26.083333
81
0.674121
[ "MIT" ]
Davidblkx/ConsoleInteractive
ConsoleInteractive/InputValidation/ValidationException.cs
313
C#
using System; using System.IO; using System.Collections; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; using System.Net; namespace QuickJS.Utils { using Native; using Utils; public class DefaultAsyncManager : IAsyncManager { private class JSTaskCompletionArgs { public System.Threading.Tasks.Task task; public SafeRelease safeRelease; public JSTaskCompletionArgs(System.Threading.Tasks.Task task, SafeRelease safeRelease) { this.task = task; this.safeRelease = safeRelease; } } private int _mainThreadId; #if !JSB_UNITYLESS private Unity.UnityCoroutineContext _mb = null; #endif public DefaultAsyncManager() { } public void Initialize(int mainThreadId) { _mainThreadId = mainThreadId; } #if !JSB_UNITYLESS private void GetUnityContext() { if (_mb == null && _mainThreadId == Thread.CurrentThread.ManagedThreadId) { var container = new UnityEngine.GameObject("JSRuntimeContainer"); container.hideFlags = UnityEngine.HideFlags.HideInHierarchy; UnityEngine.Object.DontDestroyOnLoad(container); _mb = container.AddComponent<Unity.UnityCoroutineContext>(); } } #endif public void Destroy() { #if !JSB_UNITYLESS if (_mb != null) { UnityEngine.Object.DestroyImmediate(_mb.gameObject); _mb = null; } #endif } // return promise public JSValue Yield(ScriptContext context, object awaitObject) { if (awaitObject is System.Threading.Tasks.Task) { var resolving_funcs = new[] { JSApi.JS_UNDEFINED, JSApi.JS_UNDEFINED }; var promise = JSApi.JS_NewPromiseCapability(context, resolving_funcs); var safeRelease = new SafeRelease(context).Append(resolving_funcs); var task = awaitObject as System.Threading.Tasks.Task; var runtime = context.GetRuntime(); #if JSB_COMPATIBLE task.ContinueWith(antecedent => runtime.EnqueueAction(_OnTaskCompleted, new JSTaskCompletionArgs(task, safeRelease))); #else task.GetAwaiter().OnCompleted(() => { runtime.EnqueueAction(_OnTaskCompleted, new JSTaskCompletionArgs(task, safeRelease)); }); #endif return promise; } #if !JSB_UNITYLESS else if (awaitObject is IEnumerator) { //TODO: 合并 IEnumerator 和 YieldInstruction 写法 GetUnityContext(); if (_mb == null) { return JSApi.JS_ThrowInternalError(context, "no MonoBehaviour for Coroutines"); } if (_mainThreadId != Thread.CurrentThread.ManagedThreadId) { return JSApi.JS_ThrowInternalError(context, "not supported on background thread"); } var resolving_funcs = new[] { JSApi.JS_UNDEFINED, JSApi.JS_UNDEFINED }; var promise = JSApi.JS_NewPromiseCapability(context, resolving_funcs); _mb.StartCoroutine(_Pending(awaitObject as IEnumerator, context, resolving_funcs)); return promise; } else { GetUnityContext(); if (_mb == null) { return JSApi.JS_ThrowInternalError(context, "no MonoBehaviour for Coroutines"); } if (_mainThreadId != Thread.CurrentThread.ManagedThreadId) { return JSApi.JS_ThrowInternalError(context, "not supported on background thread"); } var resolving_funcs = new[] { JSApi.JS_UNDEFINED, JSApi.JS_UNDEFINED }; var promise = JSApi.JS_NewPromiseCapability(context, resolving_funcs); _mb.StartCoroutine(_Pending(awaitObject as UnityEngine.YieldInstruction, context, resolving_funcs)); return promise; } #else return JSApi.JS_ThrowInternalError(context, "not supported await object"); #endif // !JSB_UNITYLESS } private static void _OnTaskCompleted(ScriptRuntime runtime, JSAction action) { var context = runtime.GetMainContext(); var logger = runtime.GetLogger(); var args = (JSTaskCompletionArgs)action.args; var task = args.task; var safeRelease = args.safeRelease; if (!safeRelease.isValid) { logger?.Write(LogLevel.Error, "pormise func has already been released"); return; } object result = null; var taskType = task.GetType(); if (taskType.IsGenericType && taskType.GetGenericTypeDefinition() == typeof(Task<>)) { try { result = taskType.GetProperty("Result").GetValue(task, null); } catch (Exception exception) { logger?.WriteException(exception); } } var ctx = (JSContext)context; var backVal = Binding.Values.js_push_var(ctx, result); if (backVal.IsException()) { ctx.print_exception(); safeRelease.Release(); return; } var argv = new[] { backVal }; var rval = JSApi.JS_Call(ctx, safeRelease[0], JSApi.JS_UNDEFINED, 1, argv); JSApi.JS_FreeValue(ctx, backVal); if (rval.IsException()) { ctx.print_exception(); safeRelease.Release(); return; } JSApi.JS_FreeValue(ctx, rval); safeRelease.Release(); context.GetRuntime().ExecutePendingJob(); } #if !JSB_UNITYLESS private IEnumerator _Pending(UnityEngine.YieldInstruction instruction, ScriptContext context, JSValue[] resolving_funcs) { var safeRelease = new SafeRelease(context).Append(resolving_funcs); yield return instruction; if (!context.IsValid()) { yield break; } var ctx = (JSContext)context; var backVal = Binding.Values.js_push_classvalue(ctx, instruction); if (backVal.IsException()) { ctx.print_exception(); safeRelease.Release(); yield break; } var argv = new[] { backVal }; var rval = JSApi.JS_Call(ctx, resolving_funcs[0], JSApi.JS_UNDEFINED, 1, argv); JSApi.JS_FreeValue(ctx, backVal); if (rval.IsException()) { ctx.print_exception(); safeRelease.Release(); yield break; } JSApi.JS_FreeValue(ctx, rval); safeRelease.Release(); context.GetRuntime().ExecutePendingJob(); } private IEnumerator _Pending(IEnumerator enumerator, ScriptContext context, JSValue[] resolving_funcs) { var safeRelease = new SafeRelease(context).Append(resolving_funcs); while (enumerator.MoveNext()) { var current = enumerator.Current; if (current is UnityEngine.YieldInstruction) { yield return current; } yield return null; } if (!context.IsValid()) { yield break; } var ctx = (JSContext)context; var backVal = Binding.Values.js_push_var(ctx, enumerator.Current); if (backVal.IsException()) { ctx.print_exception(); safeRelease.Release(); yield break; } var argv = new[] { backVal }; var rval = JSApi.JS_Call(ctx, resolving_funcs[0], JSApi.JS_UNDEFINED, 1, argv); JSApi.JS_FreeValue(ctx, backVal); if (rval.IsException()) { ctx.print_exception(); safeRelease.Release(); yield break; } JSApi.JS_FreeValue(ctx, rval); safeRelease.Release(); context.GetRuntime().ExecutePendingJob(); } #endif // !JSB_UNITYLESS } }
31.992727
134
0.5391
[ "MIT" ]
iospectar/unity-jsb
Assets/jsb/Source/Utils/DefaultAsyncManager.cs
8,810
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. using System; using System.Collections; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using Microsoft.ML.AutoML; using Microsoft.ML.CodeGenerator.CodeGenerator.CSharp.Interface; using Microsoft.ML.CodeGenerator.CSharp; using Microsoft.ML.CodeGenerator.Templates.Azure.Model; using Microsoft.ML.CodeGenerator.Templates.Console; using Microsoft.ML.CodeGenerator.Utilities; namespace Microsoft.ML.CodeGenerator.CodeGenerator.CSharp.AzureCodeGenerator { internal class AzureAttachModelCodeGenerator : ICSharpProjectGenerator { private readonly Pipeline _pipeline; private readonly CodeGeneratorSettings _settings; private readonly ColumnInferenceResults _columnInferenceResult; private readonly string _nameSpaceValue; public ICSharpFile ModelInputClass { get; private set; } public ICSharpFile AzureImageModelOutputClass { get; private set; } public ICSharpFile AzureObjectDetectionModelOutputClass { get; private set; } public ICSharpFile ModelProject { get; private set; } public ICSharpFile ConsumeModel { get; private set; } public ICSharpFile LabelMapping { get; private set; } public ICSharpFile ImageLabelMapping { get; private set; } public ICSharpFile ObjectDetectionConsumeModel { get; private set; } public string Name { get; set; } public AzureAttachModelCodeGenerator(Pipeline pipeline, ColumnInferenceResults columnInferenceResults, CodeGeneratorSettings options, string namespaceValue) { _pipeline = pipeline; _settings = options; _columnInferenceResult = columnInferenceResults; _nameSpaceValue = namespaceValue; Name = $"{_settings.OutputName}.Model"; ModelInputClass = new CSharpCodeFile() { File = new ModelInputClass() { Namespace = _nameSpaceValue, ClassLabels = Utilities.Utils.GenerateClassLabels(_columnInferenceResult, _settings.OnnxInputMapping), Target = _settings.Target }.TransformText(), Name = "ModelInput.cs", }; var labelType = _columnInferenceResult.TextLoaderOptions.Columns.Where(t => t.Name == _settings.LabelName).First().DataKind; Type labelTypeCsharp = Utils.GetCSharpType(labelType); AzureImageModelOutputClass = new CSharpCodeFile() { File = new AzureImageModelOutputClass() { Namespace = _nameSpaceValue, Target = _settings.Target, Labels = _settings.ClassificationLabel, }.TransformText(), Name = "ModelOutput.cs", }; AzureObjectDetectionModelOutputClass = new CSharpCodeFile() { File = new AzureObjectDetectionModelOutputClass() { Namespace = _nameSpaceValue, Target = _settings.Target, Labels = _settings.ObjectLabel, }.TransformText(), Name = "ModelOutput.cs", }; ModelProject = new CSharpProjectFile() { File = new ModelProject() { IncludeFastTreePackage = false, IncludeImageClassificationPackage = false, IncludeImageTransformerPackage = _settings.IsImage, IncludeLightGBMPackage = false, IncludeMklComponentsPackage = false, IncludeOnnxModel = true, IncludeOnnxRuntime = _settings.IsObjectDetection, IncludeRecommenderPackage = false, StablePackageVersion = _settings.StablePackageVersion, UnstablePackageVersion = _settings.UnstablePackageVersion, OnnxRuntimePackageVersion = _settings.OnnxRuntimePackageVersion, Target = _settings.Target, }.TransformText(), Name = $"{ _settings.OutputName }.Model.csproj", }; ConsumeModel = new CSharpCodeFile() { File = new ConsumeModel() { Namespace = _nameSpaceValue, Target = _settings.Target, MLNetModelName = _settings.ModelName, OnnxModelName = _settings.OnnxModelName, IsAzureImage = _settings.IsAzureAttach && _settings.IsImage, IsAzureObjectDetection = _settings.IsObjectDetection && _settings.IsAzureAttach, }.TransformText(), Name = "ConsumeModel.cs", }; } public ICSharpProject ToProject() { CSharpProject project; if (_settings.IsImage) { project = new CSharpProject() { ModelInputClass, AzureImageModelOutputClass, ConsumeModel, ModelProject, }; } else if (_settings.IsObjectDetection) { project = new CSharpProject() { ModelInputClass, AzureObjectDetectionModelOutputClass, ConsumeModel, ModelProject, }; } else { project = new CSharpProject() { ModelInputClass, AzureImageModelOutputClass, ConsumeModel, ModelProject, }; } project.Name = Name; return project; } } }
39.876623
164
0.572545
[ "MIT" ]
GitHubPang/machinelearning
src/Microsoft.ML.CodeGenerator/CodeGenerator/CSharp/AzureCodeGenerator/AzureAttachModelCodeGenerator.cs
6,143
C#
using System; using System.Diagnostics; namespace Wimt.CachingFramework.Logging { public class DebugCacheLogger : ICacheLogger { public void LogInfo(string message) { Debug.WriteLine(String.Format("INFO. {0}.", message)); } public void LogInfo(string cacheName, string message) { Debug.WriteLine(String.Format("INFO. Cache: {0}. {1}.", cacheName, message)); } public void LogCacheEvent(string cacheName, CacheEvent cacheEvent, int elapsedMilliseconds, string key) { Debug.WriteLine(String.Format("EVENT. Cache: {0}. Event: {1}. ElapsedMilliseconds: {2}. Key: {3}.", cacheName, cacheEvent.ToString(), elapsedMilliseconds, key)); } public void LogWarning(string cacheName, string message) { Debug.WriteLine(String.Format("WARNING. Cache: {0}. {1}.", cacheName, message)); } public void LogFatal(string cacheName, string message) { Debug.WriteLine(String.Format("FATAL. Cache: {0}. {1}.", cacheName, message)); } public void LogFatal(string cacheName, string message, Exception exception) { Debug.WriteLine(String.Format("FATAL. Cache: {0}. {1}. {2}", cacheName, message, exception.ToString())); } } }
35.078947
173
0.614404
[ "MIT" ]
oofpez/NgPakshare3
Logging/DebugCacheLogger.cs
1,335
C#
using System; using System.Numerics; using System.Reflection; using System.Runtime.InteropServices; using System.Security; using AltV.Net.Data; using AltV.Net.Native; using AltV.Net.Elements.Args; using AltV.Net.Elements.Entities; namespace AltV.Net.Native { public unsafe interface ILibrary { public delegate* unmanaged[Cdecl]<nint, Position*, void> Checkpoint_GetPosition { get; } public delegate* unmanaged[Cdecl]<nint, Position, void> Checkpoint_SetPosition { get; } public delegate* unmanaged[Cdecl]<nint, int> Checkpoint_GetDimension { get; } public delegate* unmanaged[Cdecl]<nint, int, void> Checkpoint_SetDimension { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint> Checkpoint_GetMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint, void> Checkpoint_SetMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, byte> Checkpoint_HasMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Checkpoint_DeleteMetaData { get; } public delegate* unmanaged[Cdecl]<nint, void> Checkpoint_AddRef { get; } public delegate* unmanaged[Cdecl]<nint, void> Checkpoint_RemoveRef { get; } public delegate* unmanaged[Cdecl]<nint, byte> Checkpoint_GetCheckpointType { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Checkpoint_SetCheckpointType { get; } public delegate* unmanaged[Cdecl]<nint, float> Checkpoint_GetHeight { get; } public delegate* unmanaged[Cdecl]<nint, float, void> Checkpoint_SetHeight { get; } public delegate* unmanaged[Cdecl]<nint, float> Checkpoint_GetRadius { get; } public delegate* unmanaged[Cdecl]<nint, float, void> Checkpoint_SetRadius { get; } public delegate* unmanaged[Cdecl]<nint, Rgba*, void> Checkpoint_GetColor { get; } public delegate* unmanaged[Cdecl]<nint, Rgba, void> Checkpoint_SetColor { get; } public delegate* unmanaged[Cdecl]<nint, nint, byte> Checkpoint_IsPlayerIn { get; } public delegate* unmanaged[Cdecl]<nint, nint, byte> Checkpoint_IsVehicleIn { get; } public delegate* unmanaged[Cdecl]<nint, byte> Checkpoint_GetColShapeType { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Checkpoint_SetPlayersOnly { get; } public delegate* unmanaged[Cdecl]<nint, byte> Checkpoint_IsPlayersOnly { get; } public delegate* unmanaged[Cdecl]<nint, Position*, void> Checkpoint_GetNextPosition { get; } public delegate* unmanaged[Cdecl]<nint, Position, void> Checkpoint_SetNextPosition { get; } public delegate* unmanaged[Cdecl]<nint, void> Event_Cancel { get; } public delegate* unmanaged[Cdecl]<nint, byte> Event_WasCancelled { get; } public delegate* unmanaged[Cdecl]<nint, ushort> Player_GetID { get; } public delegate* unmanaged[Cdecl]<nint, nint> Player_GetNetworkOwner { get; } public delegate* unmanaged[Cdecl]<nint, uint> Player_GetModel { get; } public delegate* unmanaged[Cdecl]<nint, uint, void> Player_SetModel { get; } public delegate* unmanaged[Cdecl]<nint, Position*, void> Player_GetPosition { get; } public delegate* unmanaged[Cdecl]<nint, float*, float*, float*, int*, void> Player_GetPositionCoords { get; } public delegate* unmanaged[Cdecl]<nint, Position, void> Player_SetPosition { get; } public delegate* unmanaged[Cdecl]<nint, Rotation*, void> Player_GetRotation { get; } public delegate* unmanaged[Cdecl]<nint, Rotation, void> Player_SetRotation { get; } public delegate* unmanaged[Cdecl]<nint, int> Player_GetDimension { get; } public delegate* unmanaged[Cdecl]<nint, int, void> Player_SetDimension { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint> Player_GetMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint, void> Player_SetMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, byte> Player_HasMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Player_DeleteMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint> Player_GetSyncedMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint, void> Player_SetSyncedMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, byte> Player_HasSyncedMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Player_DeleteSyncedMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint> Player_GetStreamSyncedMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint, void> Player_SetStreamSyncedMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, byte> Player_HasStreamSyncedMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Player_DeleteStreamSyncedMetaData { get; } public delegate* unmanaged[Cdecl]<nint, void> Player_AddRef { get; } public delegate* unmanaged[Cdecl]<nint, void> Player_RemoveRef { get; } public delegate* unmanaged[Cdecl]<nint, byte> Player_GetVisible { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Player_SetVisible { get; } public delegate* unmanaged[Cdecl]<nint, byte> Player_GetStreamed { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Player_SetStreamed { get; } public delegate* unmanaged[Cdecl]<nint, byte> Player_IsConnected { get; } public delegate* unmanaged[Cdecl]<nint, Position, uint, void> Player_Spawn { get; } public delegate* unmanaged[Cdecl]<nint, void> Player_Despawn { get; } public delegate* unmanaged[Cdecl]<nint, nint*, void> Player_GetName { get; } public delegate* unmanaged[Cdecl]<nint, ulong> Player_GetSocialID { get; } public delegate* unmanaged[Cdecl]<nint, ulong> Player_GetHwidHash { get; } public delegate* unmanaged[Cdecl]<nint, ulong> Player_GetHwidExHash { get; } public delegate* unmanaged[Cdecl]<nint, nint*, void> Player_GetAuthToken { get; } public delegate* unmanaged[Cdecl]<nint, ushort> Player_GetHealth { get; } public delegate* unmanaged[Cdecl]<nint, ushort, void> Player_SetHealth { get; } public delegate* unmanaged[Cdecl]<nint, ushort> Player_GetMaxHealth { get; } public delegate* unmanaged[Cdecl]<nint, ushort, void> Player_SetMaxHealth { get; } public delegate* unmanaged[Cdecl]<nint, int, int, int, int, int, int, void> Player_SetDateTime { get; } public delegate* unmanaged[Cdecl]<nint, uint, void> Player_SetWeather { get; } public delegate* unmanaged[Cdecl]<nint, uint, int, byte, void> Player_GiveWeapon { get; } public delegate* unmanaged[Cdecl]<nint, uint, byte> Player_RemoveWeapon { get; } public delegate* unmanaged[Cdecl]<nint, void> Player_RemoveAllWeapons { get; } public delegate* unmanaged[Cdecl]<nint, uint, uint, void> Player_AddWeaponComponent { get; } public delegate* unmanaged[Cdecl]<nint, uint, uint, void> Player_RemoveWeaponComponent { get; } public delegate* unmanaged[Cdecl]<nint, uint, uint, byte> Player_HasWeaponComponent { get; } public delegate* unmanaged[Cdecl]<nint, UIntArray*, void> Player_GetCurrentWeaponComponents { get; } public delegate* unmanaged[Cdecl]<nint, uint, byte, void> Player_SetWeaponTintIndex { get; } public delegate* unmanaged[Cdecl]<nint, uint, byte> Player_GetWeaponTintIndex { get; } public delegate* unmanaged[Cdecl]<nint, byte> Player_GetCurrentWeaponTintIndex { get; } public delegate* unmanaged[Cdecl]<nint, uint> Player_GetCurrentWeapon { get; } public delegate* unmanaged[Cdecl]<nint, uint, void> Player_SetCurrentWeapon { get; } public delegate* unmanaged[Cdecl]<nint, byte> Player_IsDead { get; } public delegate* unmanaged[Cdecl]<nint, byte> Player_IsJumping { get; } public delegate* unmanaged[Cdecl]<nint, byte> Player_IsInRagdoll { get; } public delegate* unmanaged[Cdecl]<nint, byte> Player_IsAiming { get; } public delegate* unmanaged[Cdecl]<nint, byte> Player_IsShooting { get; } public delegate* unmanaged[Cdecl]<nint, byte> Player_IsReloading { get; } public delegate* unmanaged[Cdecl]<nint, ushort> Player_GetArmor { get; } public delegate* unmanaged[Cdecl]<nint, ushort, void> Player_SetArmor { get; } public delegate* unmanaged[Cdecl]<nint, ushort> Player_GetMaxArmor { get; } public delegate* unmanaged[Cdecl]<nint, ushort, void> Player_SetMaxArmor { get; } public delegate* unmanaged[Cdecl]<nint, float> Player_GetMoveSpeed { get; } public delegate* unmanaged[Cdecl]<nint, Position*, void> Player_GetAimPos { get; } public delegate* unmanaged[Cdecl]<nint, Rotation*, void> Player_GetHeadRotation { get; } public delegate* unmanaged[Cdecl]<nint, byte> Player_IsInVehicle { get; } public delegate* unmanaged[Cdecl]<nint, nint> Player_GetVehicle { get; } public delegate* unmanaged[Cdecl]<nint, byte> Player_GetSeat { get; } public delegate* unmanaged[Cdecl]<nint, BaseObjectType*, nint> Player_GetEntityAimingAt { get; } public delegate* unmanaged[Cdecl]<nint, Position*, void> Player_GetEntityAimOffset { get; } public delegate* unmanaged[Cdecl]<nint, byte> Player_IsFlashlightActive { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Player_Kick { get; } public delegate* unmanaged[Cdecl]<nint, uint> Player_GetPing { get; } public delegate* unmanaged[Cdecl]<nint, nint*, void> Player_GetIP { get; } public delegate* unmanaged[Cdecl]<nint, float*, float*, float*, float*, float*, float*, int*, void> Player_GetPositionCoords2 { get; } public delegate* unmanaged[Cdecl]<nint, nint, byte, void> Player_SetNetworkOwner { get; } public delegate* unmanaged[Cdecl]<nint, void> Player_ClearBloodDamage { get; } public delegate* unmanaged[Cdecl]<nint, byte, Cloth*, void> Player_GetClothes { get; } public delegate* unmanaged[Cdecl]<nint, byte, ushort, byte, byte, void> Player_SetClothes { get; } public delegate* unmanaged[Cdecl]<nint, byte, DlcCloth*, void> Player_GetDlcClothes { get; } public delegate* unmanaged[Cdecl]<nint, byte, ushort, byte, byte, uint, void> Player_SetDlcClothes { get; } public delegate* unmanaged[Cdecl]<nint, byte, Prop*, void> Player_GetProps { get; } public delegate* unmanaged[Cdecl]<nint, byte, ushort, byte, void> Player_SetProps { get; } public delegate* unmanaged[Cdecl]<nint, byte, DlcProp*, void> Player_GetDlcProps { get; } public delegate* unmanaged[Cdecl]<nint, byte, ushort, byte, uint, void> Player_SetDlcProps { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Player_ClearProps { get; } public delegate* unmanaged[Cdecl]<nint, nint, byte> Player_IsEntityInStreamingRange_Player { get; } public delegate* unmanaged[Cdecl]<nint, nint, byte> Player_IsEntityInStreamingRange_Vehicle { get; } public delegate* unmanaged[Cdecl]<nint, nint, short, short, Position, Rotation, byte, byte, void> Player_AttachToEntity_Player { get; } public delegate* unmanaged[Cdecl]<nint, nint, short, short, Position, Rotation, byte, byte, void> Player_AttachToEntity_Vehicle { get; } public delegate* unmanaged[Cdecl]<nint, void> Player_Detach { get; } public delegate* unmanaged[Cdecl]<nint, byte> Player_GetInvincible { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Player_SetInvincible { get; } public delegate* unmanaged[Cdecl]<nint, nint, byte, void> Player_SetIntoVehicle { get; } public delegate* unmanaged[Cdecl]<nint, byte> Player_IsSuperJumpEnabled { get; } public delegate* unmanaged[Cdecl]<nint, byte> Player_IsCrouching { get; } public delegate* unmanaged[Cdecl]<nint, byte> Player_IsStealthy { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint, uint, void> Player_PlayAmbientSpeech { get; } public delegate* unmanaged[Cdecl]<nint, ushort> Vehicle_GetID { get; } public delegate* unmanaged[Cdecl]<nint, nint> Vehicle_GetNetworkOwner { get; } public delegate* unmanaged[Cdecl]<nint, uint> Vehicle_GetModel { get; } public delegate* unmanaged[Cdecl]<nint, Position*, void> Vehicle_GetPosition { get; } public delegate* unmanaged[Cdecl]<nint, Position, void> Vehicle_SetPosition { get; } public delegate* unmanaged[Cdecl]<nint, Rotation*, void> Vehicle_GetRotation { get; } public delegate* unmanaged[Cdecl]<nint, Rotation, void> Vehicle_SetRotation { get; } public delegate* unmanaged[Cdecl]<nint, int> Vehicle_GetDimension { get; } public delegate* unmanaged[Cdecl]<nint, int, void> Vehicle_SetDimension { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint> Vehicle_GetMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint, void> Vehicle_SetMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, byte> Vehicle_HasMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Vehicle_DeleteMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint> Vehicle_GetSyncedMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint, void> Vehicle_SetSyncedMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, byte> Vehicle_HasSyncedMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Vehicle_DeleteSyncedMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint> Vehicle_GetStreamSyncedMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint, void> Vehicle_SetStreamSyncedMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, byte> Vehicle_HasStreamSyncedMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Vehicle_DeleteStreamSyncedMetaData { get; } public delegate* unmanaged[Cdecl]<nint, void> Vehicle_AddRef { get; } public delegate* unmanaged[Cdecl]<nint, void> Vehicle_RemoveRef { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_GetVisible { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Vehicle_SetVisible { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_GetStreamed { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Vehicle_SetStreamed { get; } public delegate* unmanaged[Cdecl]<nint, nint> Vehicle_GetDriver { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_IsDestroyed { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte> Vehicle_GetMod { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte> Vehicle_GetModsCount { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte, byte> Vehicle_SetMod { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_GetModKitsCount { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_GetModKit { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte> Vehicle_SetModKit { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_IsPrimaryColorRGB { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_GetPrimaryColor { get; } public delegate* unmanaged[Cdecl]<nint, Rgba*, void> Vehicle_GetPrimaryColorRGB { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Vehicle_SetPrimaryColor { get; } public delegate* unmanaged[Cdecl]<nint, Rgba, void> Vehicle_SetPrimaryColorRGB { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_IsSecondaryColorRGB { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_GetSecondaryColor { get; } public delegate* unmanaged[Cdecl]<nint, Rgba*, void> Vehicle_GetSecondaryColorRGB { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Vehicle_SetSecondaryColor { get; } public delegate* unmanaged[Cdecl]<nint, Rgba, void> Vehicle_SetSecondaryColorRGB { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_GetPearlColor { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Vehicle_SetPearlColor { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_GetWheelColor { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Vehicle_SetWheelColor { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_GetInteriorColor { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Vehicle_SetInteriorColor { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_GetDashboardColor { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Vehicle_SetDashboardColor { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_IsTireSmokeColorCustom { get; } public delegate* unmanaged[Cdecl]<nint, Rgba*, void> Vehicle_GetTireSmokeColor { get; } public delegate* unmanaged[Cdecl]<nint, Rgba, void> Vehicle_SetTireSmokeColor { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_GetWheelType { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_GetWheelVariation { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_GetRearWheelVariation { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte, void> Vehicle_SetWheels { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Vehicle_SetRearWheels { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_GetCustomTires { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Vehicle_SetCustomTires { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_GetSpecialDarkness { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Vehicle_SetSpecialDarkness { get; } public delegate* unmanaged[Cdecl]<nint, uint> Vehicle_GetNumberplateIndex { get; } public delegate* unmanaged[Cdecl]<nint, uint, void> Vehicle_SetNumberplateIndex { get; } public delegate* unmanaged[Cdecl]<nint, nint*, void> Vehicle_GetNumberplateText { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Vehicle_SetNumberplateText { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_GetWindowTint { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Vehicle_SetWindowTint { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_GetDirtLevel { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Vehicle_SetDirtLevel { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte> Vehicle_IsExtraOn { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte, void> Vehicle_ToggleExtra { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_IsNeonActive { get; } public delegate* unmanaged[Cdecl]<nint, byte*, byte*, byte*, byte*, void> Vehicle_GetNeonActive { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte, byte, byte, void> Vehicle_SetNeonActive { get; } public delegate* unmanaged[Cdecl]<nint, Rgba*, void> Vehicle_GetNeonColor { get; } public delegate* unmanaged[Cdecl]<nint, Rgba, void> Vehicle_SetNeonColor { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_GetLivery { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Vehicle_SetLivery { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_GetRoofLivery { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Vehicle_SetRoofLivery { get; } public delegate* unmanaged[Cdecl]<nint, nint*, void> Vehicle_GetAppearanceDataBase64 { get; } public delegate* unmanaged[Cdecl]<nint, string, void> Vehicle_LoadAppearanceDataFromBase64 { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_IsEngineOn { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Vehicle_SetEngineOn { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_IsHandbrakeActive { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_GetHeadlightColor { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Vehicle_SetHeadlightColor { get; } public delegate* unmanaged[Cdecl]<nint, uint> Vehicle_GetRadioStationIndex { get; } public delegate* unmanaged[Cdecl]<nint, uint, void> Vehicle_SetRadioStationIndex { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_IsSirenActive { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Vehicle_SetSirenActive { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_GetLockState { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Vehicle_SetLockState { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte> Vehicle_GetDoorState { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte, void> Vehicle_SetDoorState { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte> Vehicle_IsWindowOpened { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte, void> Vehicle_SetWindowOpened { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_IsDaylightOn { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_IsNightlightOn { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_GetRoofState { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Vehicle_SetRoofState { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_IsFlamethrowerActive { get; } public delegate* unmanaged[Cdecl]<nint, float> Vehicle_GetLightsMultiplier { get; } public delegate* unmanaged[Cdecl]<nint, float, void> Vehicle_SetLightsMultiplier { get; } public delegate* unmanaged[Cdecl]<nint, nint*, void> Vehicle_GetGameStateBase64 { get; } public delegate* unmanaged[Cdecl]<nint, string, void> Vehicle_LoadGameStateFromBase64 { get; } public delegate* unmanaged[Cdecl]<nint, int> Vehicle_GetEngineHealth { get; } public delegate* unmanaged[Cdecl]<nint, int, void> Vehicle_SetEngineHealth { get; } public delegate* unmanaged[Cdecl]<nint, int> Vehicle_GetPetrolTankHealth { get; } public delegate* unmanaged[Cdecl]<nint, int, void> Vehicle_SetPetrolTankHealth { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_GetWheelsCount { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte> Vehicle_IsWheelBurst { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte, void> Vehicle_SetWheelBurst { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte> Vehicle_DoesWheelHasTire { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte, void> Vehicle_SetWheelHasTire { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte> Vehicle_IsWheelDetached { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte, void> Vehicle_SetWheelDetached { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte> Vehicle_IsWheelOnFire { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte, void> Vehicle_SetWheelOnFire { get; } public delegate* unmanaged[Cdecl]<nint, byte, float> Vehicle_GetWheelHealth { get; } public delegate* unmanaged[Cdecl]<nint, byte, float, void> Vehicle_SetWheelHealth { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Vehicle_SetWheelFixed { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_GetRepairsCount { get; } public delegate* unmanaged[Cdecl]<nint, uint> Vehicle_GetBodyHealth { get; } public delegate* unmanaged[Cdecl]<nint, uint, void> Vehicle_SetBodyHealth { get; } public delegate* unmanaged[Cdecl]<nint, uint> Vehicle_GetBodyAdditionalHealth { get; } public delegate* unmanaged[Cdecl]<nint, uint, void> Vehicle_SetBodyAdditionalHealth { get; } public delegate* unmanaged[Cdecl]<nint, nint*, void> Vehicle_GetHealthDataBase64 { get; } public delegate* unmanaged[Cdecl]<nint, string, void> Vehicle_LoadHealthDataFromBase64 { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte> Vehicle_GetPartDamageLevel { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte, void> Vehicle_SetPartDamageLevel { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte> Vehicle_GetPartBulletHoles { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte, void> Vehicle_SetPartBulletHoles { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte> Vehicle_IsLightDamaged { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte, void> Vehicle_SetLightDamaged { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte> Vehicle_IsWindowDamaged { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte, void> Vehicle_SetWindowDamaged { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte> Vehicle_IsSpecialLightDamaged { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte, void> Vehicle_SetSpecialLightDamaged { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_HasArmoredWindows { get; } public delegate* unmanaged[Cdecl]<nint, byte, float> Vehicle_GetArmoredWindowHealth { get; } public delegate* unmanaged[Cdecl]<nint, byte, float, void> Vehicle_SetArmoredWindowHealth { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte> Vehicle_GetArmoredWindowShootCount { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte, void> Vehicle_SetArmoredWindowShootCount { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte> Vehicle_GetBumperDamageLevel { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte, void> Vehicle_SetBumperDamageLevel { get; } public delegate* unmanaged[Cdecl]<nint, nint*, void> Vehicle_GetDamageDataBase64 { get; } public delegate* unmanaged[Cdecl]<nint, string, void> Vehicle_LoadDamageDataFromBase64 { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Vehicle_SetManualEngineControl { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_IsManualEngineControl { get; } public delegate* unmanaged[Cdecl]<nint, nint*, void> Vehicle_GetScriptDataBase64 { get; } public delegate* unmanaged[Cdecl]<nint, string, void> Vehicle_LoadScriptDataFromBase64 { get; } public delegate* unmanaged[Cdecl]<nint, float*, float*, float*, float*, float*, float*, int*, void> Vehicle_GetPositionCoords2 { get; } public delegate* unmanaged[Cdecl]<nint, nint, byte, void> Vehicle_SetNetworkOwner { get; } public delegate* unmanaged[Cdecl]<nint, nint> Vehicle_GetAttached { get; } public delegate* unmanaged[Cdecl]<nint, nint> Vehicle_GetAttachedTo { get; } public delegate* unmanaged[Cdecl]<nint, void> Vehicle_Repair { get; } public delegate* unmanaged[Cdecl]<nint, nint, short, short, Position, Rotation, byte, byte, void> Vehicle_AttachToEntity_Player { get; } public delegate* unmanaged[Cdecl]<nint, nint, short, short, Position, Rotation, byte, byte, void> Vehicle_AttachToEntity_Vehicle { get; } public delegate* unmanaged[Cdecl]<nint, void> Vehicle_Detach { get; } public delegate* unmanaged[Cdecl]<nint, Vector3*, void> Vehicle_GetVelocity { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Vehicle_SetDriftMode { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_IsDriftMode { get; } public delegate* unmanaged[Cdecl]<nint, Position*, void> ColShape_GetPosition { get; } public delegate* unmanaged[Cdecl]<nint, Position, void> ColShape_SetPosition { get; } public delegate* unmanaged[Cdecl]<nint, int> ColShape_GetDimension { get; } public delegate* unmanaged[Cdecl]<nint, int, void> ColShape_SetDimension { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint> ColShape_GetMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint, void> ColShape_SetMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, byte> ColShape_HasMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> ColShape_DeleteMetaData { get; } public delegate* unmanaged[Cdecl]<nint, void> ColShape_AddRef { get; } public delegate* unmanaged[Cdecl]<nint, void> ColShape_RemoveRef { get; } public delegate* unmanaged[Cdecl]<nint, byte> ColShape_GetColShapeType { get; } public delegate* unmanaged[Cdecl]<nint, nint, byte> ColShape_IsPlayerIn { get; } public delegate* unmanaged[Cdecl]<nint, nint, byte> ColShape_IsVehicleIn { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> ColShape_SetPlayersOnly { get; } public delegate* unmanaged[Cdecl]<nint, byte> ColShape_IsPlayersOnly { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint> VoiceChannel_GetMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint, void> VoiceChannel_SetMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, byte> VoiceChannel_HasMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> VoiceChannel_DeleteMetaData { get; } public delegate* unmanaged[Cdecl]<nint, void> VoiceChannel_AddRef { get; } public delegate* unmanaged[Cdecl]<nint, void> VoiceChannel_RemoveRef { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> VoiceChannel_AddPlayer { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> VoiceChannel_RemovePlayer { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> VoiceChannel_MutePlayer { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> VoiceChannel_UnmutePlayer { get; } public delegate* unmanaged[Cdecl]<nint, nint, byte> VoiceChannel_HasPlayer { get; } public delegate* unmanaged[Cdecl]<nint, nint, byte> VoiceChannel_IsPlayerMuted { get; } public delegate* unmanaged[Cdecl]<nint, byte> VoiceChannel_IsSpatial { get; } public delegate* unmanaged[Cdecl]<nint, float> VoiceChannel_GetMaxDistance { get; } public delegate* unmanaged[Cdecl]<nint, Position*, void> Blip_GetPosition { get; } public delegate* unmanaged[Cdecl]<nint, Position, void> Blip_SetPosition { get; } public delegate* unmanaged[Cdecl]<nint, int> Blip_GetDimension { get; } public delegate* unmanaged[Cdecl]<nint, int, void> Blip_SetDimension { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint> Blip_GetMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint, void> Blip_SetMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, byte> Blip_HasMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Blip_DeleteMetaData { get; } public delegate* unmanaged[Cdecl]<nint, void> Blip_AddRef { get; } public delegate* unmanaged[Cdecl]<nint, void> Blip_RemoveRef { get; } public delegate* unmanaged[Cdecl]<nint, byte> Blip_IsGlobal { get; } public delegate* unmanaged[Cdecl]<nint, byte> Blip_IsAttached { get; } public delegate* unmanaged[Cdecl]<nint, BaseObjectType*, nint> Blip_AttachedTo { get; } public delegate* unmanaged[Cdecl]<nint, byte> Blip_GetType { get; } public delegate* unmanaged[Cdecl]<nint, Vector2*, void> Blip_GetScaleXY { get; } public delegate* unmanaged[Cdecl]<nint, Vector2, void> Blip_SetScaleXY { get; } public delegate* unmanaged[Cdecl]<nint, short> Blip_GetDisplay { get; } public delegate* unmanaged[Cdecl]<nint, short, void> Blip_SetDisplay { get; } public delegate* unmanaged[Cdecl]<nint, ushort> Blip_GetSprite { get; } public delegate* unmanaged[Cdecl]<nint, ushort, void> Blip_SetSprite { get; } public delegate* unmanaged[Cdecl]<nint, byte> Blip_GetColor { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Blip_SetColor { get; } public delegate* unmanaged[Cdecl]<nint, Rgba*, void> Blip_GetSecondaryColor { get; } public delegate* unmanaged[Cdecl]<nint, Rgba, void> Blip_SetSecondaryColor { get; } public delegate* unmanaged[Cdecl]<nint, byte> Blip_GetAlpha { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Blip_SetAlpha { get; } public delegate* unmanaged[Cdecl]<nint, ushort> Blip_GetFlashTimer { get; } public delegate* unmanaged[Cdecl]<nint, ushort, void> Blip_SetFlashTimer { get; } public delegate* unmanaged[Cdecl]<nint, ushort> Blip_GetFlashInterval { get; } public delegate* unmanaged[Cdecl]<nint, ushort, void> Blip_SetFlashInterval { get; } public delegate* unmanaged[Cdecl]<nint, byte> Blip_GetAsFriendly { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Blip_SetAsFriendly { get; } public delegate* unmanaged[Cdecl]<nint, byte> Blip_GetRoute { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Blip_SetRoute { get; } public delegate* unmanaged[Cdecl]<nint, byte> Blip_GetBright { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Blip_SetBright { get; } public delegate* unmanaged[Cdecl]<nint, ushort> Blip_GetNumber { get; } public delegate* unmanaged[Cdecl]<nint, ushort, void> Blip_SetNumber { get; } public delegate* unmanaged[Cdecl]<nint, byte> Blip_GetShowCone { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Blip_SetShowCone { get; } public delegate* unmanaged[Cdecl]<nint, byte> Blip_GetFlashes { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Blip_SetFlashes { get; } public delegate* unmanaged[Cdecl]<nint, byte> Blip_GetFlashesAlternate { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Blip_SetFlashesAlternate { get; } public delegate* unmanaged[Cdecl]<nint, byte> Blip_GetAsShortRange { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Blip_SetAsShortRange { get; } public delegate* unmanaged[Cdecl]<nint, ushort> Blip_GetPriority { get; } public delegate* unmanaged[Cdecl]<nint, ushort, void> Blip_SetPriority { get; } public delegate* unmanaged[Cdecl]<nint, float> Blip_GetRotation { get; } public delegate* unmanaged[Cdecl]<nint, float, void> Blip_SetRotation { get; } public delegate* unmanaged[Cdecl]<nint, nint*, void> Blip_GetGxtName { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Blip_SetGxtName { get; } public delegate* unmanaged[Cdecl]<nint, nint*, void> Blip_GetName { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Blip_SetName { get; } public delegate* unmanaged[Cdecl]<nint, Rgba*, void> Blip_GetRouteColor { get; } public delegate* unmanaged[Cdecl]<nint, Rgba, void> Blip_SetRouteColor { get; } public delegate* unmanaged[Cdecl]<nint, byte> Blip_GetPulse { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Blip_SetPulse { get; } public delegate* unmanaged[Cdecl]<nint, byte> Blip_GetAsMissionCreator { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Blip_SetAsMissionCreator { get; } public delegate* unmanaged[Cdecl]<nint, byte> Blip_GetTickVisible { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Blip_SetTickVisible { get; } public delegate* unmanaged[Cdecl]<nint, byte> Blip_GetHeadingIndicatorVisible { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Blip_SetHeadingIndicatorVisible { get; } public delegate* unmanaged[Cdecl]<nint, byte> Blip_GetOutlineIndicatorVisible { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Blip_SetOutlineIndicatorVisible { get; } public delegate* unmanaged[Cdecl]<nint, byte> Blip_GetFriendIndicatorVisible { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Blip_SetFriendIndicatorVisible { get; } public delegate* unmanaged[Cdecl]<nint, byte> Blip_GetCrewIndicatorVisible { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Blip_SetCrewIndicatorVisible { get; } public delegate* unmanaged[Cdecl]<nint, ushort> Blip_GetCategory { get; } public delegate* unmanaged[Cdecl]<nint, ushort, void> Blip_SetCategory { get; } public delegate* unmanaged[Cdecl]<nint, byte> Blip_GetAsHighDetail { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Blip_SetAsHighDetail { get; } public delegate* unmanaged[Cdecl]<nint, byte> Blip_GetShrinked { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Blip_SetShrinked { get; } public delegate* unmanaged[Cdecl]<nint, uint, uint, void> Blip_Fade { get; } public delegate* unmanaged[Cdecl]<nint, ulong> Resource_GetExportsCount { get; } public delegate* unmanaged[Cdecl]<nint, nint[], nint[], void> Resource_GetExports { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint> Resource_GetExport { get; } public delegate* unmanaged[Cdecl]<nint, int> Resource_GetDependenciesSize { get; } public delegate* unmanaged[Cdecl]<nint, nint[], int, void> Resource_GetDependencies { get; } public delegate* unmanaged[Cdecl]<nint, int> Resource_GetDependantsSize { get; } public delegate* unmanaged[Cdecl]<nint, nint[], int, void> Resource_GetDependants { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint, nint, void> Resource_SetExport { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint[], nint[], int, void> Resource_SetExports { get; } public delegate* unmanaged[Cdecl]<nint, nint*, void> Resource_GetPath { get; } public delegate* unmanaged[Cdecl]<nint, nint*, void> Resource_GetName { get; } public delegate* unmanaged[Cdecl]<nint, nint*, void> Resource_GetMain { get; } public delegate* unmanaged[Cdecl]<nint, nint*, void> Resource_GetType { get; } public delegate* unmanaged[Cdecl]<nint, byte> Resource_IsStarted { get; } public delegate* unmanaged[Cdecl]<nint, void> Resource_Start { get; } public delegate* unmanaged[Cdecl]<nint, void> Resource_Stop { get; } public delegate* unmanaged[Cdecl]<nint, nint> Resource_GetImpl { get; } public delegate* unmanaged[Cdecl]<nint, nint> Resource_GetCSharpImpl { get; } public delegate* unmanaged[Cdecl]<nint, MValueFunctionCallback, nint> Invoker_Create { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Invoker_Destroy { get; } public delegate* unmanaged[Cdecl]<nint, byte> MValueConst_GetBool { get; } public delegate* unmanaged[Cdecl]<nint, long> MValueConst_GetInt { get; } public delegate* unmanaged[Cdecl]<nint, ulong> MValueConst_GetUInt { get; } public delegate* unmanaged[Cdecl]<nint, double> MValueConst_GetDouble { get; } public delegate* unmanaged[Cdecl]<nint, nint*, ulong*, byte> MValueConst_GetString { get; } public delegate* unmanaged[Cdecl]<nint, ulong> MValueConst_GetListSize { get; } public delegate* unmanaged[Cdecl]<nint, nint[], byte> MValueConst_GetList { get; } public delegate* unmanaged[Cdecl]<nint, ulong> MValueConst_GetDictSize { get; } public delegate* unmanaged[Cdecl]<nint, nint[], nint[], byte> MValueConst_GetDict { get; } public delegate* unmanaged[Cdecl]<nint, BaseObjectType*, nint> MValueConst_GetEntity { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint[], ulong, nint> MValueConst_CallFunction { get; } public delegate* unmanaged[Cdecl]<nint, Position*, void> MValueConst_GetVector3 { get; } public delegate* unmanaged[Cdecl]<nint, Rgba*, void> MValueConst_GetRGBA { get; } public delegate* unmanaged[Cdecl]<nint, ulong, nint, void> MValueConst_GetByteArray { get; } public delegate* unmanaged[Cdecl]<nint, ulong> MValueConst_GetByteArraySize { get; } public delegate* unmanaged[Cdecl]<nint, void> MValueConst_AddRef { get; } public delegate* unmanaged[Cdecl]<nint, void> MValueConst_RemoveRef { get; } public delegate* unmanaged[Cdecl]<nint, void> MValueConst_Delete { get; } public delegate* unmanaged[Cdecl]<nint, byte> MValueConst_GetType { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Server_LogInfo { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Server_LogDebug { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Server_LogWarning { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Server_LogError { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Server_LogColored { get; } public delegate* unmanaged[Cdecl]<nint, ushort, AltV.Net.Server.EventCallback, void> Server_SubscribeEvent { get; } public delegate* unmanaged[Cdecl]<nint, AltV.Net.Server.TickCallback, void> Server_SubscribeTick { get; } public delegate* unmanaged[Cdecl]<nint, nint, AltV.Net.Server.CommandCallback, byte> Server_SubscribeCommand { get; } public delegate* unmanaged[Cdecl]<nint, nint, byte> Server_FileExists { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint*, void> Server_FileRead { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint[], int, void> Server_TriggerServerEvent { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint, nint[], int, void> Server_TriggerClientEvent { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint[], int, void> Server_TriggerClientEventForAll { get; } public delegate* unmanaged[Cdecl]<nint, nint[], int, nint, nint[], int, void> Server_TriggerClientEventForSome { get; } public delegate* unmanaged[Cdecl]<nint, uint, Position, Rotation, ushort*, nint> Server_CreateVehicle { get; } public delegate* unmanaged[Cdecl]<nint, byte, Position, float, float, Rgba, nint> Server_CreateCheckpoint { get; } public delegate* unmanaged[Cdecl]<nint, nint, byte, Position, nint> Server_CreateBlip { get; } public delegate* unmanaged[Cdecl]<nint, nint, byte, nint, nint> Server_CreateBlipAttached { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint> Server_GetResource { get; } public delegate* unmanaged[Cdecl]<nint, byte, float, nint> Server_CreateVoiceChannel { get; } public delegate* unmanaged[Cdecl]<nint, Position, float, float, nint> Server_CreateColShapeCylinder { get; } public delegate* unmanaged[Cdecl]<nint, Position, float, nint> Server_CreateColShapeSphere { get; } public delegate* unmanaged[Cdecl]<nint, Position, float, nint> Server_CreateColShapeCircle { get; } public delegate* unmanaged[Cdecl]<nint, Position, Position, nint> Server_CreateColShapeCube { get; } public delegate* unmanaged[Cdecl]<nint, float, float, float, float, float, nint> Server_CreateColShapeRectangle { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Server_DestroyVehicle { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Server_DestroyBlip { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Server_DestroyCheckpoint { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Server_DestroyVoiceChannel { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Server_DestroyColShape { get; } public delegate* unmanaged[Cdecl]<nint, int> Server_GetNetTime { get; } public delegate* unmanaged[Cdecl]<nint, nint*, void> Server_GetRootDirectory { get; } public delegate* unmanaged[Cdecl]<nint, ulong> Server_GetPlayerCount { get; } public delegate* unmanaged[Cdecl]<nint, nint[], ulong, void> Server_GetPlayers { get; } public delegate* unmanaged[Cdecl]<nint, ulong> Server_GetVehicleCount { get; } public delegate* unmanaged[Cdecl]<nint, nint[], ulong, void> Server_GetVehicles { get; } public delegate* unmanaged[Cdecl]<nint, ushort, byte*, nint> Server_GetEntityById { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Server_StartResource { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Server_StopResource { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Server_RestartResource { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint> Server_GetMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint, void> Server_SetMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, byte> Server_HasMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Server_DeleteMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint> Server_GetSyncedMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint, void> Server_SetSyncedMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, byte> Server_HasSyncedMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Server_DeleteSyncedMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint> Core_CreateMValueNil { get; } public delegate* unmanaged[Cdecl]<nint, byte, nint> Core_CreateMValueBool { get; } public delegate* unmanaged[Cdecl]<nint, long, nint> Core_CreateMValueInt { get; } public delegate* unmanaged[Cdecl]<nint, ulong, nint> Core_CreateMValueUInt { get; } public delegate* unmanaged[Cdecl]<nint, double, nint> Core_CreateMValueDouble { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint> Core_CreateMValueString { get; } public delegate* unmanaged[Cdecl]<nint, nint[], ulong, nint> Core_CreateMValueList { get; } public delegate* unmanaged[Cdecl]<nint, nint[], nint[], ulong, nint> Core_CreateMValueDict { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint> Core_CreateMValueCheckpoint { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint> Core_CreateMValueBlip { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint> Core_CreateMValueVoiceChannel { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint> Core_CreateMValuePlayer { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint> Core_CreateMValueVehicle { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint> Core_CreateMValueFunction { get; } public delegate* unmanaged[Cdecl]<nint, Position, nint> Core_CreateMValueVector3 { get; } public delegate* unmanaged[Cdecl]<nint, Rgba, nint> Core_CreateMValueRgba { get; } public delegate* unmanaged[Cdecl]<nint, ulong, nint, nint> Core_CreateMValueByteArray { get; } public delegate* unmanaged[Cdecl]<nint, byte> Core_IsDebug { get; } public delegate* unmanaged[Cdecl]<nint, nint*, ulong*, void> Core_GetVersion { get; } public delegate* unmanaged[Cdecl]<nint, nint*, ulong*, void> Core_GetBranch { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Core_SetPassword { get; } public delegate* unmanaged[Cdecl]<UIntArray*, void> FreeUIntArray { get; } public delegate* unmanaged[Cdecl]<nint, void> FreeCharArray { get; } } public unsafe class Library : ILibrary { private const string DllName = "csharp-module"; public delegate* unmanaged[Cdecl]<nint, Position*, void> Checkpoint_GetPosition { get; } public delegate* unmanaged[Cdecl]<nint, Position, void> Checkpoint_SetPosition { get; } public delegate* unmanaged[Cdecl]<nint, int> Checkpoint_GetDimension { get; } public delegate* unmanaged[Cdecl]<nint, int, void> Checkpoint_SetDimension { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint> Checkpoint_GetMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint, void> Checkpoint_SetMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, byte> Checkpoint_HasMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Checkpoint_DeleteMetaData { get; } public delegate* unmanaged[Cdecl]<nint, void> Checkpoint_AddRef { get; } public delegate* unmanaged[Cdecl]<nint, void> Checkpoint_RemoveRef { get; } public delegate* unmanaged[Cdecl]<nint, byte> Checkpoint_GetCheckpointType { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Checkpoint_SetCheckpointType { get; } public delegate* unmanaged[Cdecl]<nint, float> Checkpoint_GetHeight { get; } public delegate* unmanaged[Cdecl]<nint, float, void> Checkpoint_SetHeight { get; } public delegate* unmanaged[Cdecl]<nint, float> Checkpoint_GetRadius { get; } public delegate* unmanaged[Cdecl]<nint, float, void> Checkpoint_SetRadius { get; } public delegate* unmanaged[Cdecl]<nint, Rgba*, void> Checkpoint_GetColor { get; } public delegate* unmanaged[Cdecl]<nint, Rgba, void> Checkpoint_SetColor { get; } public delegate* unmanaged[Cdecl]<nint, nint, byte> Checkpoint_IsPlayerIn { get; } public delegate* unmanaged[Cdecl]<nint, nint, byte> Checkpoint_IsVehicleIn { get; } public delegate* unmanaged[Cdecl]<nint, byte> Checkpoint_GetColShapeType { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Checkpoint_SetPlayersOnly { get; } public delegate* unmanaged[Cdecl]<nint, byte> Checkpoint_IsPlayersOnly { get; } public delegate* unmanaged[Cdecl]<nint, Position*, void> Checkpoint_GetNextPosition { get; } public delegate* unmanaged[Cdecl]<nint, Position, void> Checkpoint_SetNextPosition { get; } public delegate* unmanaged[Cdecl]<nint, void> Event_Cancel { get; } public delegate* unmanaged[Cdecl]<nint, byte> Event_WasCancelled { get; } public delegate* unmanaged[Cdecl]<nint, ushort> Player_GetID { get; } public delegate* unmanaged[Cdecl]<nint, nint> Player_GetNetworkOwner { get; } public delegate* unmanaged[Cdecl]<nint, uint> Player_GetModel { get; } public delegate* unmanaged[Cdecl]<nint, uint, void> Player_SetModel { get; } public delegate* unmanaged[Cdecl]<nint, Position*, void> Player_GetPosition { get; } public delegate* unmanaged[Cdecl]<nint, float*, float*, float*, int*, void> Player_GetPositionCoords { get; } public delegate* unmanaged[Cdecl]<nint, Position, void> Player_SetPosition { get; } public delegate* unmanaged[Cdecl]<nint, Rotation*, void> Player_GetRotation { get; } public delegate* unmanaged[Cdecl]<nint, Rotation, void> Player_SetRotation { get; } public delegate* unmanaged[Cdecl]<nint, int> Player_GetDimension { get; } public delegate* unmanaged[Cdecl]<nint, int, void> Player_SetDimension { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint> Player_GetMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint, void> Player_SetMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, byte> Player_HasMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Player_DeleteMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint> Player_GetSyncedMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint, void> Player_SetSyncedMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, byte> Player_HasSyncedMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Player_DeleteSyncedMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint> Player_GetStreamSyncedMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint, void> Player_SetStreamSyncedMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, byte> Player_HasStreamSyncedMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Player_DeleteStreamSyncedMetaData { get; } public delegate* unmanaged[Cdecl]<nint, void> Player_AddRef { get; } public delegate* unmanaged[Cdecl]<nint, void> Player_RemoveRef { get; } public delegate* unmanaged[Cdecl]<nint, byte> Player_GetVisible { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Player_SetVisible { get; } public delegate* unmanaged[Cdecl]<nint, byte> Player_GetStreamed { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Player_SetStreamed { get; } public delegate* unmanaged[Cdecl]<nint, byte> Player_IsConnected { get; } public delegate* unmanaged[Cdecl]<nint, Position, uint, void> Player_Spawn { get; } public delegate* unmanaged[Cdecl]<nint, void> Player_Despawn { get; } public delegate* unmanaged[Cdecl]<nint, nint*, void> Player_GetName { get; } public delegate* unmanaged[Cdecl]<nint, ulong> Player_GetSocialID { get; } public delegate* unmanaged[Cdecl]<nint, ulong> Player_GetHwidHash { get; } public delegate* unmanaged[Cdecl]<nint, ulong> Player_GetHwidExHash { get; } public delegate* unmanaged[Cdecl]<nint, nint*, void> Player_GetAuthToken { get; } public delegate* unmanaged[Cdecl]<nint, ushort> Player_GetHealth { get; } public delegate* unmanaged[Cdecl]<nint, ushort, void> Player_SetHealth { get; } public delegate* unmanaged[Cdecl]<nint, ushort> Player_GetMaxHealth { get; } public delegate* unmanaged[Cdecl]<nint, ushort, void> Player_SetMaxHealth { get; } public delegate* unmanaged[Cdecl]<nint, int, int, int, int, int, int, void> Player_SetDateTime { get; } public delegate* unmanaged[Cdecl]<nint, uint, void> Player_SetWeather { get; } public delegate* unmanaged[Cdecl]<nint, uint, int, byte, void> Player_GiveWeapon { get; } public delegate* unmanaged[Cdecl]<nint, uint, byte> Player_RemoveWeapon { get; } public delegate* unmanaged[Cdecl]<nint, void> Player_RemoveAllWeapons { get; } public delegate* unmanaged[Cdecl]<nint, uint, uint, void> Player_AddWeaponComponent { get; } public delegate* unmanaged[Cdecl]<nint, uint, uint, void> Player_RemoveWeaponComponent { get; } public delegate* unmanaged[Cdecl]<nint, uint, uint, byte> Player_HasWeaponComponent { get; } public delegate* unmanaged[Cdecl]<nint, UIntArray*, void> Player_GetCurrentWeaponComponents { get; } public delegate* unmanaged[Cdecl]<nint, uint, byte, void> Player_SetWeaponTintIndex { get; } public delegate* unmanaged[Cdecl]<nint, uint, byte> Player_GetWeaponTintIndex { get; } public delegate* unmanaged[Cdecl]<nint, byte> Player_GetCurrentWeaponTintIndex { get; } public delegate* unmanaged[Cdecl]<nint, uint> Player_GetCurrentWeapon { get; } public delegate* unmanaged[Cdecl]<nint, uint, void> Player_SetCurrentWeapon { get; } public delegate* unmanaged[Cdecl]<nint, byte> Player_IsDead { get; } public delegate* unmanaged[Cdecl]<nint, byte> Player_IsJumping { get; } public delegate* unmanaged[Cdecl]<nint, byte> Player_IsInRagdoll { get; } public delegate* unmanaged[Cdecl]<nint, byte> Player_IsAiming { get; } public delegate* unmanaged[Cdecl]<nint, byte> Player_IsShooting { get; } public delegate* unmanaged[Cdecl]<nint, byte> Player_IsReloading { get; } public delegate* unmanaged[Cdecl]<nint, ushort> Player_GetArmor { get; } public delegate* unmanaged[Cdecl]<nint, ushort, void> Player_SetArmor { get; } public delegate* unmanaged[Cdecl]<nint, ushort> Player_GetMaxArmor { get; } public delegate* unmanaged[Cdecl]<nint, ushort, void> Player_SetMaxArmor { get; } public delegate* unmanaged[Cdecl]<nint, float> Player_GetMoveSpeed { get; } public delegate* unmanaged[Cdecl]<nint, Position*, void> Player_GetAimPos { get; } public delegate* unmanaged[Cdecl]<nint, Rotation*, void> Player_GetHeadRotation { get; } public delegate* unmanaged[Cdecl]<nint, byte> Player_IsInVehicle { get; } public delegate* unmanaged[Cdecl]<nint, nint> Player_GetVehicle { get; } public delegate* unmanaged[Cdecl]<nint, byte> Player_GetSeat { get; } public delegate* unmanaged[Cdecl]<nint, BaseObjectType*, nint> Player_GetEntityAimingAt { get; } public delegate* unmanaged[Cdecl]<nint, Position*, void> Player_GetEntityAimOffset { get; } public delegate* unmanaged[Cdecl]<nint, byte> Player_IsFlashlightActive { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Player_Kick { get; } public delegate* unmanaged[Cdecl]<nint, uint> Player_GetPing { get; } public delegate* unmanaged[Cdecl]<nint, nint*, void> Player_GetIP { get; } public delegate* unmanaged[Cdecl]<nint, float*, float*, float*, float*, float*, float*, int*, void> Player_GetPositionCoords2 { get; } public delegate* unmanaged[Cdecl]<nint, nint, byte, void> Player_SetNetworkOwner { get; } public delegate* unmanaged[Cdecl]<nint, void> Player_ClearBloodDamage { get; } public delegate* unmanaged[Cdecl]<nint, byte, Cloth*, void> Player_GetClothes { get; } public delegate* unmanaged[Cdecl]<nint, byte, ushort, byte, byte, void> Player_SetClothes { get; } public delegate* unmanaged[Cdecl]<nint, byte, DlcCloth*, void> Player_GetDlcClothes { get; } public delegate* unmanaged[Cdecl]<nint, byte, ushort, byte, byte, uint, void> Player_SetDlcClothes { get; } public delegate* unmanaged[Cdecl]<nint, byte, Prop*, void> Player_GetProps { get; } public delegate* unmanaged[Cdecl]<nint, byte, ushort, byte, void> Player_SetProps { get; } public delegate* unmanaged[Cdecl]<nint, byte, DlcProp*, void> Player_GetDlcProps { get; } public delegate* unmanaged[Cdecl]<nint, byte, ushort, byte, uint, void> Player_SetDlcProps { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Player_ClearProps { get; } public delegate* unmanaged[Cdecl]<nint, nint, byte> Player_IsEntityInStreamingRange_Player { get; } public delegate* unmanaged[Cdecl]<nint, nint, byte> Player_IsEntityInStreamingRange_Vehicle { get; } public delegate* unmanaged[Cdecl]<nint, nint, short, short, Position, Rotation, byte, byte, void> Player_AttachToEntity_Player { get; } public delegate* unmanaged[Cdecl]<nint, nint, short, short, Position, Rotation, byte, byte, void> Player_AttachToEntity_Vehicle { get; } public delegate* unmanaged[Cdecl]<nint, void> Player_Detach { get; } public delegate* unmanaged[Cdecl]<nint, byte> Player_GetInvincible { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Player_SetInvincible { get; } public delegate* unmanaged[Cdecl]<nint, nint, byte, void> Player_SetIntoVehicle { get; } public delegate* unmanaged[Cdecl]<nint, byte> Player_IsSuperJumpEnabled { get; } public delegate* unmanaged[Cdecl]<nint, byte> Player_IsCrouching { get; } public delegate* unmanaged[Cdecl]<nint, byte> Player_IsStealthy { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint, uint, void> Player_PlayAmbientSpeech { get; } public delegate* unmanaged[Cdecl]<nint, ushort> Vehicle_GetID { get; } public delegate* unmanaged[Cdecl]<nint, nint> Vehicle_GetNetworkOwner { get; } public delegate* unmanaged[Cdecl]<nint, uint> Vehicle_GetModel { get; } public delegate* unmanaged[Cdecl]<nint, Position*, void> Vehicle_GetPosition { get; } public delegate* unmanaged[Cdecl]<nint, Position, void> Vehicle_SetPosition { get; } public delegate* unmanaged[Cdecl]<nint, Rotation*, void> Vehicle_GetRotation { get; } public delegate* unmanaged[Cdecl]<nint, Rotation, void> Vehicle_SetRotation { get; } public delegate* unmanaged[Cdecl]<nint, int> Vehicle_GetDimension { get; } public delegate* unmanaged[Cdecl]<nint, int, void> Vehicle_SetDimension { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint> Vehicle_GetMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint, void> Vehicle_SetMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, byte> Vehicle_HasMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Vehicle_DeleteMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint> Vehicle_GetSyncedMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint, void> Vehicle_SetSyncedMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, byte> Vehicle_HasSyncedMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Vehicle_DeleteSyncedMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint> Vehicle_GetStreamSyncedMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint, void> Vehicle_SetStreamSyncedMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, byte> Vehicle_HasStreamSyncedMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Vehicle_DeleteStreamSyncedMetaData { get; } public delegate* unmanaged[Cdecl]<nint, void> Vehicle_AddRef { get; } public delegate* unmanaged[Cdecl]<nint, void> Vehicle_RemoveRef { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_GetVisible { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Vehicle_SetVisible { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_GetStreamed { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Vehicle_SetStreamed { get; } public delegate* unmanaged[Cdecl]<nint, nint> Vehicle_GetDriver { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_IsDestroyed { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte> Vehicle_GetMod { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte> Vehicle_GetModsCount { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte, byte> Vehicle_SetMod { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_GetModKitsCount { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_GetModKit { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte> Vehicle_SetModKit { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_IsPrimaryColorRGB { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_GetPrimaryColor { get; } public delegate* unmanaged[Cdecl]<nint, Rgba*, void> Vehicle_GetPrimaryColorRGB { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Vehicle_SetPrimaryColor { get; } public delegate* unmanaged[Cdecl]<nint, Rgba, void> Vehicle_SetPrimaryColorRGB { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_IsSecondaryColorRGB { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_GetSecondaryColor { get; } public delegate* unmanaged[Cdecl]<nint, Rgba*, void> Vehicle_GetSecondaryColorRGB { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Vehicle_SetSecondaryColor { get; } public delegate* unmanaged[Cdecl]<nint, Rgba, void> Vehicle_SetSecondaryColorRGB { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_GetPearlColor { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Vehicle_SetPearlColor { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_GetWheelColor { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Vehicle_SetWheelColor { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_GetInteriorColor { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Vehicle_SetInteriorColor { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_GetDashboardColor { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Vehicle_SetDashboardColor { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_IsTireSmokeColorCustom { get; } public delegate* unmanaged[Cdecl]<nint, Rgba*, void> Vehicle_GetTireSmokeColor { get; } public delegate* unmanaged[Cdecl]<nint, Rgba, void> Vehicle_SetTireSmokeColor { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_GetWheelType { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_GetWheelVariation { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_GetRearWheelVariation { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte, void> Vehicle_SetWheels { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Vehicle_SetRearWheels { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_GetCustomTires { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Vehicle_SetCustomTires { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_GetSpecialDarkness { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Vehicle_SetSpecialDarkness { get; } public delegate* unmanaged[Cdecl]<nint, uint> Vehicle_GetNumberplateIndex { get; } public delegate* unmanaged[Cdecl]<nint, uint, void> Vehicle_SetNumberplateIndex { get; } public delegate* unmanaged[Cdecl]<nint, nint*, void> Vehicle_GetNumberplateText { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Vehicle_SetNumberplateText { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_GetWindowTint { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Vehicle_SetWindowTint { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_GetDirtLevel { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Vehicle_SetDirtLevel { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte> Vehicle_IsExtraOn { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte, void> Vehicle_ToggleExtra { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_IsNeonActive { get; } public delegate* unmanaged[Cdecl]<nint, byte*, byte*, byte*, byte*, void> Vehicle_GetNeonActive { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte, byte, byte, void> Vehicle_SetNeonActive { get; } public delegate* unmanaged[Cdecl]<nint, Rgba*, void> Vehicle_GetNeonColor { get; } public delegate* unmanaged[Cdecl]<nint, Rgba, void> Vehicle_SetNeonColor { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_GetLivery { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Vehicle_SetLivery { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_GetRoofLivery { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Vehicle_SetRoofLivery { get; } public delegate* unmanaged[Cdecl]<nint, nint*, void> Vehicle_GetAppearanceDataBase64 { get; } public delegate* unmanaged[Cdecl]<nint, string, void> Vehicle_LoadAppearanceDataFromBase64 { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_IsEngineOn { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Vehicle_SetEngineOn { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_IsHandbrakeActive { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_GetHeadlightColor { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Vehicle_SetHeadlightColor { get; } public delegate* unmanaged[Cdecl]<nint, uint> Vehicle_GetRadioStationIndex { get; } public delegate* unmanaged[Cdecl]<nint, uint, void> Vehicle_SetRadioStationIndex { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_IsSirenActive { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Vehicle_SetSirenActive { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_GetLockState { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Vehicle_SetLockState { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte> Vehicle_GetDoorState { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte, void> Vehicle_SetDoorState { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte> Vehicle_IsWindowOpened { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte, void> Vehicle_SetWindowOpened { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_IsDaylightOn { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_IsNightlightOn { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_GetRoofState { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Vehicle_SetRoofState { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_IsFlamethrowerActive { get; } public delegate* unmanaged[Cdecl]<nint, float> Vehicle_GetLightsMultiplier { get; } public delegate* unmanaged[Cdecl]<nint, float, void> Vehicle_SetLightsMultiplier { get; } public delegate* unmanaged[Cdecl]<nint, nint*, void> Vehicle_GetGameStateBase64 { get; } public delegate* unmanaged[Cdecl]<nint, string, void> Vehicle_LoadGameStateFromBase64 { get; } public delegate* unmanaged[Cdecl]<nint, int> Vehicle_GetEngineHealth { get; } public delegate* unmanaged[Cdecl]<nint, int, void> Vehicle_SetEngineHealth { get; } public delegate* unmanaged[Cdecl]<nint, int> Vehicle_GetPetrolTankHealth { get; } public delegate* unmanaged[Cdecl]<nint, int, void> Vehicle_SetPetrolTankHealth { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_GetWheelsCount { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte> Vehicle_IsWheelBurst { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte, void> Vehicle_SetWheelBurst { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte> Vehicle_DoesWheelHasTire { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte, void> Vehicle_SetWheelHasTire { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte> Vehicle_IsWheelDetached { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte, void> Vehicle_SetWheelDetached { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte> Vehicle_IsWheelOnFire { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte, void> Vehicle_SetWheelOnFire { get; } public delegate* unmanaged[Cdecl]<nint, byte, float> Vehicle_GetWheelHealth { get; } public delegate* unmanaged[Cdecl]<nint, byte, float, void> Vehicle_SetWheelHealth { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Vehicle_SetWheelFixed { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_GetRepairsCount { get; } public delegate* unmanaged[Cdecl]<nint, uint> Vehicle_GetBodyHealth { get; } public delegate* unmanaged[Cdecl]<nint, uint, void> Vehicle_SetBodyHealth { get; } public delegate* unmanaged[Cdecl]<nint, uint> Vehicle_GetBodyAdditionalHealth { get; } public delegate* unmanaged[Cdecl]<nint, uint, void> Vehicle_SetBodyAdditionalHealth { get; } public delegate* unmanaged[Cdecl]<nint, nint*, void> Vehicle_GetHealthDataBase64 { get; } public delegate* unmanaged[Cdecl]<nint, string, void> Vehicle_LoadHealthDataFromBase64 { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte> Vehicle_GetPartDamageLevel { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte, void> Vehicle_SetPartDamageLevel { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte> Vehicle_GetPartBulletHoles { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte, void> Vehicle_SetPartBulletHoles { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte> Vehicle_IsLightDamaged { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte, void> Vehicle_SetLightDamaged { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte> Vehicle_IsWindowDamaged { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte, void> Vehicle_SetWindowDamaged { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte> Vehicle_IsSpecialLightDamaged { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte, void> Vehicle_SetSpecialLightDamaged { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_HasArmoredWindows { get; } public delegate* unmanaged[Cdecl]<nint, byte, float> Vehicle_GetArmoredWindowHealth { get; } public delegate* unmanaged[Cdecl]<nint, byte, float, void> Vehicle_SetArmoredWindowHealth { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte> Vehicle_GetArmoredWindowShootCount { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte, void> Vehicle_SetArmoredWindowShootCount { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte> Vehicle_GetBumperDamageLevel { get; } public delegate* unmanaged[Cdecl]<nint, byte, byte, void> Vehicle_SetBumperDamageLevel { get; } public delegate* unmanaged[Cdecl]<nint, nint*, void> Vehicle_GetDamageDataBase64 { get; } public delegate* unmanaged[Cdecl]<nint, string, void> Vehicle_LoadDamageDataFromBase64 { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Vehicle_SetManualEngineControl { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_IsManualEngineControl { get; } public delegate* unmanaged[Cdecl]<nint, nint*, void> Vehicle_GetScriptDataBase64 { get; } public delegate* unmanaged[Cdecl]<nint, string, void> Vehicle_LoadScriptDataFromBase64 { get; } public delegate* unmanaged[Cdecl]<nint, float*, float*, float*, float*, float*, float*, int*, void> Vehicle_GetPositionCoords2 { get; } public delegate* unmanaged[Cdecl]<nint, nint, byte, void> Vehicle_SetNetworkOwner { get; } public delegate* unmanaged[Cdecl]<nint, nint> Vehicle_GetAttached { get; } public delegate* unmanaged[Cdecl]<nint, nint> Vehicle_GetAttachedTo { get; } public delegate* unmanaged[Cdecl]<nint, void> Vehicle_Repair { get; } public delegate* unmanaged[Cdecl]<nint, nint, short, short, Position, Rotation, byte, byte, void> Vehicle_AttachToEntity_Player { get; } public delegate* unmanaged[Cdecl]<nint, nint, short, short, Position, Rotation, byte, byte, void> Vehicle_AttachToEntity_Vehicle { get; } public delegate* unmanaged[Cdecl]<nint, void> Vehicle_Detach { get; } public delegate* unmanaged[Cdecl]<nint, Vector3*, void> Vehicle_GetVelocity { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Vehicle_SetDriftMode { get; } public delegate* unmanaged[Cdecl]<nint, byte> Vehicle_IsDriftMode { get; } public delegate* unmanaged[Cdecl]<nint, Position*, void> ColShape_GetPosition { get; } public delegate* unmanaged[Cdecl]<nint, Position, void> ColShape_SetPosition { get; } public delegate* unmanaged[Cdecl]<nint, int> ColShape_GetDimension { get; } public delegate* unmanaged[Cdecl]<nint, int, void> ColShape_SetDimension { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint> ColShape_GetMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint, void> ColShape_SetMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, byte> ColShape_HasMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> ColShape_DeleteMetaData { get; } public delegate* unmanaged[Cdecl]<nint, void> ColShape_AddRef { get; } public delegate* unmanaged[Cdecl]<nint, void> ColShape_RemoveRef { get; } public delegate* unmanaged[Cdecl]<nint, byte> ColShape_GetColShapeType { get; } public delegate* unmanaged[Cdecl]<nint, nint, byte> ColShape_IsPlayerIn { get; } public delegate* unmanaged[Cdecl]<nint, nint, byte> ColShape_IsVehicleIn { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> ColShape_SetPlayersOnly { get; } public delegate* unmanaged[Cdecl]<nint, byte> ColShape_IsPlayersOnly { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint> VoiceChannel_GetMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint, void> VoiceChannel_SetMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, byte> VoiceChannel_HasMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> VoiceChannel_DeleteMetaData { get; } public delegate* unmanaged[Cdecl]<nint, void> VoiceChannel_AddRef { get; } public delegate* unmanaged[Cdecl]<nint, void> VoiceChannel_RemoveRef { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> VoiceChannel_AddPlayer { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> VoiceChannel_RemovePlayer { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> VoiceChannel_MutePlayer { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> VoiceChannel_UnmutePlayer { get; } public delegate* unmanaged[Cdecl]<nint, nint, byte> VoiceChannel_HasPlayer { get; } public delegate* unmanaged[Cdecl]<nint, nint, byte> VoiceChannel_IsPlayerMuted { get; } public delegate* unmanaged[Cdecl]<nint, byte> VoiceChannel_IsSpatial { get; } public delegate* unmanaged[Cdecl]<nint, float> VoiceChannel_GetMaxDistance { get; } public delegate* unmanaged[Cdecl]<nint, Position*, void> Blip_GetPosition { get; } public delegate* unmanaged[Cdecl]<nint, Position, void> Blip_SetPosition { get; } public delegate* unmanaged[Cdecl]<nint, int> Blip_GetDimension { get; } public delegate* unmanaged[Cdecl]<nint, int, void> Blip_SetDimension { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint> Blip_GetMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint, void> Blip_SetMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, byte> Blip_HasMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Blip_DeleteMetaData { get; } public delegate* unmanaged[Cdecl]<nint, void> Blip_AddRef { get; } public delegate* unmanaged[Cdecl]<nint, void> Blip_RemoveRef { get; } public delegate* unmanaged[Cdecl]<nint, byte> Blip_IsGlobal { get; } public delegate* unmanaged[Cdecl]<nint, byte> Blip_IsAttached { get; } public delegate* unmanaged[Cdecl]<nint, BaseObjectType*, nint> Blip_AttachedTo { get; } public delegate* unmanaged[Cdecl]<nint, byte> Blip_GetType { get; } public delegate* unmanaged[Cdecl]<nint, Vector2*, void> Blip_GetScaleXY { get; } public delegate* unmanaged[Cdecl]<nint, Vector2, void> Blip_SetScaleXY { get; } public delegate* unmanaged[Cdecl]<nint, short> Blip_GetDisplay { get; } public delegate* unmanaged[Cdecl]<nint, short, void> Blip_SetDisplay { get; } public delegate* unmanaged[Cdecl]<nint, ushort> Blip_GetSprite { get; } public delegate* unmanaged[Cdecl]<nint, ushort, void> Blip_SetSprite { get; } public delegate* unmanaged[Cdecl]<nint, byte> Blip_GetColor { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Blip_SetColor { get; } public delegate* unmanaged[Cdecl]<nint, Rgba*, void> Blip_GetSecondaryColor { get; } public delegate* unmanaged[Cdecl]<nint, Rgba, void> Blip_SetSecondaryColor { get; } public delegate* unmanaged[Cdecl]<nint, byte> Blip_GetAlpha { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Blip_SetAlpha { get; } public delegate* unmanaged[Cdecl]<nint, ushort> Blip_GetFlashTimer { get; } public delegate* unmanaged[Cdecl]<nint, ushort, void> Blip_SetFlashTimer { get; } public delegate* unmanaged[Cdecl]<nint, ushort> Blip_GetFlashInterval { get; } public delegate* unmanaged[Cdecl]<nint, ushort, void> Blip_SetFlashInterval { get; } public delegate* unmanaged[Cdecl]<nint, byte> Blip_GetAsFriendly { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Blip_SetAsFriendly { get; } public delegate* unmanaged[Cdecl]<nint, byte> Blip_GetRoute { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Blip_SetRoute { get; } public delegate* unmanaged[Cdecl]<nint, byte> Blip_GetBright { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Blip_SetBright { get; } public delegate* unmanaged[Cdecl]<nint, ushort> Blip_GetNumber { get; } public delegate* unmanaged[Cdecl]<nint, ushort, void> Blip_SetNumber { get; } public delegate* unmanaged[Cdecl]<nint, byte> Blip_GetShowCone { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Blip_SetShowCone { get; } public delegate* unmanaged[Cdecl]<nint, byte> Blip_GetFlashes { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Blip_SetFlashes { get; } public delegate* unmanaged[Cdecl]<nint, byte> Blip_GetFlashesAlternate { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Blip_SetFlashesAlternate { get; } public delegate* unmanaged[Cdecl]<nint, byte> Blip_GetAsShortRange { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Blip_SetAsShortRange { get; } public delegate* unmanaged[Cdecl]<nint, ushort> Blip_GetPriority { get; } public delegate* unmanaged[Cdecl]<nint, ushort, void> Blip_SetPriority { get; } public delegate* unmanaged[Cdecl]<nint, float> Blip_GetRotation { get; } public delegate* unmanaged[Cdecl]<nint, float, void> Blip_SetRotation { get; } public delegate* unmanaged[Cdecl]<nint, nint*, void> Blip_GetGxtName { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Blip_SetGxtName { get; } public delegate* unmanaged[Cdecl]<nint, nint*, void> Blip_GetName { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Blip_SetName { get; } public delegate* unmanaged[Cdecl]<nint, Rgba*, void> Blip_GetRouteColor { get; } public delegate* unmanaged[Cdecl]<nint, Rgba, void> Blip_SetRouteColor { get; } public delegate* unmanaged[Cdecl]<nint, byte> Blip_GetPulse { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Blip_SetPulse { get; } public delegate* unmanaged[Cdecl]<nint, byte> Blip_GetAsMissionCreator { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Blip_SetAsMissionCreator { get; } public delegate* unmanaged[Cdecl]<nint, byte> Blip_GetTickVisible { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Blip_SetTickVisible { get; } public delegate* unmanaged[Cdecl]<nint, byte> Blip_GetHeadingIndicatorVisible { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Blip_SetHeadingIndicatorVisible { get; } public delegate* unmanaged[Cdecl]<nint, byte> Blip_GetOutlineIndicatorVisible { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Blip_SetOutlineIndicatorVisible { get; } public delegate* unmanaged[Cdecl]<nint, byte> Blip_GetFriendIndicatorVisible { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Blip_SetFriendIndicatorVisible { get; } public delegate* unmanaged[Cdecl]<nint, byte> Blip_GetCrewIndicatorVisible { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Blip_SetCrewIndicatorVisible { get; } public delegate* unmanaged[Cdecl]<nint, ushort> Blip_GetCategory { get; } public delegate* unmanaged[Cdecl]<nint, ushort, void> Blip_SetCategory { get; } public delegate* unmanaged[Cdecl]<nint, byte> Blip_GetAsHighDetail { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Blip_SetAsHighDetail { get; } public delegate* unmanaged[Cdecl]<nint, byte> Blip_GetShrinked { get; } public delegate* unmanaged[Cdecl]<nint, byte, void> Blip_SetShrinked { get; } public delegate* unmanaged[Cdecl]<nint, uint, uint, void> Blip_Fade { get; } public delegate* unmanaged[Cdecl]<nint, ulong> Resource_GetExportsCount { get; } public delegate* unmanaged[Cdecl]<nint, nint[], nint[], void> Resource_GetExports { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint> Resource_GetExport { get; } public delegate* unmanaged[Cdecl]<nint, int> Resource_GetDependenciesSize { get; } public delegate* unmanaged[Cdecl]<nint, nint[], int, void> Resource_GetDependencies { get; } public delegate* unmanaged[Cdecl]<nint, int> Resource_GetDependantsSize { get; } public delegate* unmanaged[Cdecl]<nint, nint[], int, void> Resource_GetDependants { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint, nint, void> Resource_SetExport { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint[], nint[], int, void> Resource_SetExports { get; } public delegate* unmanaged[Cdecl]<nint, nint*, void> Resource_GetPath { get; } public delegate* unmanaged[Cdecl]<nint, nint*, void> Resource_GetName { get; } public delegate* unmanaged[Cdecl]<nint, nint*, void> Resource_GetMain { get; } public delegate* unmanaged[Cdecl]<nint, nint*, void> Resource_GetType { get; } public delegate* unmanaged[Cdecl]<nint, byte> Resource_IsStarted { get; } public delegate* unmanaged[Cdecl]<nint, void> Resource_Start { get; } public delegate* unmanaged[Cdecl]<nint, void> Resource_Stop { get; } public delegate* unmanaged[Cdecl]<nint, nint> Resource_GetImpl { get; } public delegate* unmanaged[Cdecl]<nint, nint> Resource_GetCSharpImpl { get; } public delegate* unmanaged[Cdecl]<nint, MValueFunctionCallback, nint> Invoker_Create { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Invoker_Destroy { get; } public delegate* unmanaged[Cdecl]<nint, byte> MValueConst_GetBool { get; } public delegate* unmanaged[Cdecl]<nint, long> MValueConst_GetInt { get; } public delegate* unmanaged[Cdecl]<nint, ulong> MValueConst_GetUInt { get; } public delegate* unmanaged[Cdecl]<nint, double> MValueConst_GetDouble { get; } public delegate* unmanaged[Cdecl]<nint, nint*, ulong*, byte> MValueConst_GetString { get; } public delegate* unmanaged[Cdecl]<nint, ulong> MValueConst_GetListSize { get; } public delegate* unmanaged[Cdecl]<nint, nint[], byte> MValueConst_GetList { get; } public delegate* unmanaged[Cdecl]<nint, ulong> MValueConst_GetDictSize { get; } public delegate* unmanaged[Cdecl]<nint, nint[], nint[], byte> MValueConst_GetDict { get; } public delegate* unmanaged[Cdecl]<nint, BaseObjectType*, nint> MValueConst_GetEntity { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint[], ulong, nint> MValueConst_CallFunction { get; } public delegate* unmanaged[Cdecl]<nint, Position*, void> MValueConst_GetVector3 { get; } public delegate* unmanaged[Cdecl]<nint, Rgba*, void> MValueConst_GetRGBA { get; } public delegate* unmanaged[Cdecl]<nint, ulong, nint, void> MValueConst_GetByteArray { get; } public delegate* unmanaged[Cdecl]<nint, ulong> MValueConst_GetByteArraySize { get; } public delegate* unmanaged[Cdecl]<nint, void> MValueConst_AddRef { get; } public delegate* unmanaged[Cdecl]<nint, void> MValueConst_RemoveRef { get; } public delegate* unmanaged[Cdecl]<nint, void> MValueConst_Delete { get; } public delegate* unmanaged[Cdecl]<nint, byte> MValueConst_GetType { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Server_LogInfo { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Server_LogDebug { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Server_LogWarning { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Server_LogError { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Server_LogColored { get; } public delegate* unmanaged[Cdecl]<nint, ushort, AltV.Net.Server.EventCallback, void> Server_SubscribeEvent { get; } public delegate* unmanaged[Cdecl]<nint, AltV.Net.Server.TickCallback, void> Server_SubscribeTick { get; } public delegate* unmanaged[Cdecl]<nint, nint, AltV.Net.Server.CommandCallback, byte> Server_SubscribeCommand { get; } public delegate* unmanaged[Cdecl]<nint, nint, byte> Server_FileExists { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint*, void> Server_FileRead { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint[], int, void> Server_TriggerServerEvent { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint, nint[], int, void> Server_TriggerClientEvent { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint[], int, void> Server_TriggerClientEventForAll { get; } public delegate* unmanaged[Cdecl]<nint, nint[], int, nint, nint[], int, void> Server_TriggerClientEventForSome { get; } public delegate* unmanaged[Cdecl]<nint, uint, Position, Rotation, ushort*, nint> Server_CreateVehicle { get; } public delegate* unmanaged[Cdecl]<nint, byte, Position, float, float, Rgba, nint> Server_CreateCheckpoint { get; } public delegate* unmanaged[Cdecl]<nint, nint, byte, Position, nint> Server_CreateBlip { get; } public delegate* unmanaged[Cdecl]<nint, nint, byte, nint, nint> Server_CreateBlipAttached { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint> Server_GetResource { get; } public delegate* unmanaged[Cdecl]<nint, byte, float, nint> Server_CreateVoiceChannel { get; } public delegate* unmanaged[Cdecl]<nint, Position, float, float, nint> Server_CreateColShapeCylinder { get; } public delegate* unmanaged[Cdecl]<nint, Position, float, nint> Server_CreateColShapeSphere { get; } public delegate* unmanaged[Cdecl]<nint, Position, float, nint> Server_CreateColShapeCircle { get; } public delegate* unmanaged[Cdecl]<nint, Position, Position, nint> Server_CreateColShapeCube { get; } public delegate* unmanaged[Cdecl]<nint, float, float, float, float, float, nint> Server_CreateColShapeRectangle { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Server_DestroyVehicle { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Server_DestroyBlip { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Server_DestroyCheckpoint { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Server_DestroyVoiceChannel { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Server_DestroyColShape { get; } public delegate* unmanaged[Cdecl]<nint, int> Server_GetNetTime { get; } public delegate* unmanaged[Cdecl]<nint, nint*, void> Server_GetRootDirectory { get; } public delegate* unmanaged[Cdecl]<nint, ulong> Server_GetPlayerCount { get; } public delegate* unmanaged[Cdecl]<nint, nint[], ulong, void> Server_GetPlayers { get; } public delegate* unmanaged[Cdecl]<nint, ulong> Server_GetVehicleCount { get; } public delegate* unmanaged[Cdecl]<nint, nint[], ulong, void> Server_GetVehicles { get; } public delegate* unmanaged[Cdecl]<nint, ushort, byte*, nint> Server_GetEntityById { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Server_StartResource { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Server_StopResource { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Server_RestartResource { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint> Server_GetMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint, void> Server_SetMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, byte> Server_HasMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Server_DeleteMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint> Server_GetSyncedMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint, void> Server_SetSyncedMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, byte> Server_HasSyncedMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Server_DeleteSyncedMetaData { get; } public delegate* unmanaged[Cdecl]<nint, nint> Core_CreateMValueNil { get; } public delegate* unmanaged[Cdecl]<nint, byte, nint> Core_CreateMValueBool { get; } public delegate* unmanaged[Cdecl]<nint, long, nint> Core_CreateMValueInt { get; } public delegate* unmanaged[Cdecl]<nint, ulong, nint> Core_CreateMValueUInt { get; } public delegate* unmanaged[Cdecl]<nint, double, nint> Core_CreateMValueDouble { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint> Core_CreateMValueString { get; } public delegate* unmanaged[Cdecl]<nint, nint[], ulong, nint> Core_CreateMValueList { get; } public delegate* unmanaged[Cdecl]<nint, nint[], nint[], ulong, nint> Core_CreateMValueDict { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint> Core_CreateMValueCheckpoint { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint> Core_CreateMValueBlip { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint> Core_CreateMValueVoiceChannel { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint> Core_CreateMValuePlayer { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint> Core_CreateMValueVehicle { get; } public delegate* unmanaged[Cdecl]<nint, nint, nint> Core_CreateMValueFunction { get; } public delegate* unmanaged[Cdecl]<nint, Position, nint> Core_CreateMValueVector3 { get; } public delegate* unmanaged[Cdecl]<nint, Rgba, nint> Core_CreateMValueRgba { get; } public delegate* unmanaged[Cdecl]<nint, ulong, nint, nint> Core_CreateMValueByteArray { get; } public delegate* unmanaged[Cdecl]<nint, byte> Core_IsDebug { get; } public delegate* unmanaged[Cdecl]<nint, nint*, ulong*, void> Core_GetVersion { get; } public delegate* unmanaged[Cdecl]<nint, nint*, ulong*, void> Core_GetBranch { get; } public delegate* unmanaged[Cdecl]<nint, nint, void> Core_SetPassword { get; } public delegate* unmanaged[Cdecl]<UIntArray*, void> FreeUIntArray { get; } public delegate* unmanaged[Cdecl]<nint, void> FreeCharArray { get; } public Library() { const DllImportSearchPath dllImportSearchPath = DllImportSearchPath.LegacyBehavior | DllImportSearchPath.AssemblyDirectory | DllImportSearchPath.SafeDirectories | DllImportSearchPath.System32 | DllImportSearchPath.UserDirectories | DllImportSearchPath.ApplicationDirectory | DllImportSearchPath.UseDllDirectoryForDependencies; var handle = NativeLibrary.Load(DllName, Assembly.GetExecutingAssembly(), dllImportSearchPath); Checkpoint_GetPosition = (delegate* unmanaged[Cdecl]<nint, Position*, void>) NativeLibrary.GetExport(handle, "Checkpoint_GetPosition"); Checkpoint_SetPosition = (delegate* unmanaged[Cdecl]<nint, Position, void>) NativeLibrary.GetExport(handle, "Checkpoint_SetPosition"); Checkpoint_GetDimension = (delegate* unmanaged[Cdecl]<nint, int>) NativeLibrary.GetExport(handle, "Checkpoint_GetDimension"); Checkpoint_SetDimension = (delegate* unmanaged[Cdecl]<nint, int, void>) NativeLibrary.GetExport(handle, "Checkpoint_SetDimension"); Checkpoint_GetMetaData = (delegate* unmanaged[Cdecl]<nint, nint, nint>) NativeLibrary.GetExport(handle, "Checkpoint_GetMetaData"); Checkpoint_SetMetaData = (delegate* unmanaged[Cdecl]<nint, nint, nint, void>) NativeLibrary.GetExport(handle, "Checkpoint_SetMetaData"); Checkpoint_HasMetaData = (delegate* unmanaged[Cdecl]<nint, nint, byte>) NativeLibrary.GetExport(handle, "Checkpoint_HasMetaData"); Checkpoint_DeleteMetaData = (delegate* unmanaged[Cdecl]<nint, nint, void>) NativeLibrary.GetExport(handle, "Checkpoint_DeleteMetaData"); Checkpoint_AddRef = (delegate* unmanaged[Cdecl]<nint, void>) NativeLibrary.GetExport(handle, "Checkpoint_AddRef"); Checkpoint_RemoveRef = (delegate* unmanaged[Cdecl]<nint, void>) NativeLibrary.GetExport(handle, "Checkpoint_RemoveRef"); Checkpoint_GetCheckpointType = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Checkpoint_GetCheckpointType"); Checkpoint_SetCheckpointType = (delegate* unmanaged[Cdecl]<nint, byte, void>) NativeLibrary.GetExport(handle, "Checkpoint_SetCheckpointType"); Checkpoint_GetHeight = (delegate* unmanaged[Cdecl]<nint, float>) NativeLibrary.GetExport(handle, "Checkpoint_GetHeight"); Checkpoint_SetHeight = (delegate* unmanaged[Cdecl]<nint, float, void>) NativeLibrary.GetExport(handle, "Checkpoint_SetHeight"); Checkpoint_GetRadius = (delegate* unmanaged[Cdecl]<nint, float>) NativeLibrary.GetExport(handle, "Checkpoint_GetRadius"); Checkpoint_SetRadius = (delegate* unmanaged[Cdecl]<nint, float, void>) NativeLibrary.GetExport(handle, "Checkpoint_SetRadius"); Checkpoint_GetColor = (delegate* unmanaged[Cdecl]<nint, Rgba*, void>) NativeLibrary.GetExport(handle, "Checkpoint_GetColor"); Checkpoint_SetColor = (delegate* unmanaged[Cdecl]<nint, Rgba, void>) NativeLibrary.GetExport(handle, "Checkpoint_SetColor"); Checkpoint_IsPlayerIn = (delegate* unmanaged[Cdecl]<nint, nint, byte>) NativeLibrary.GetExport(handle, "Checkpoint_IsPlayerIn"); Checkpoint_IsVehicleIn = (delegate* unmanaged[Cdecl]<nint, nint, byte>) NativeLibrary.GetExport(handle, "Checkpoint_IsVehicleIn"); Checkpoint_GetColShapeType = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Checkpoint_GetColShapeType"); Checkpoint_SetPlayersOnly = (delegate* unmanaged[Cdecl]<nint, byte, void>) NativeLibrary.GetExport(handle, "Checkpoint_SetPlayersOnly"); Checkpoint_IsPlayersOnly = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Checkpoint_IsPlayersOnly"); Checkpoint_GetNextPosition = (delegate* unmanaged[Cdecl]<nint, Position*, void>) NativeLibrary.GetExport(handle, "Checkpoint_GetNextPosition"); Checkpoint_SetNextPosition = (delegate* unmanaged[Cdecl]<nint, Position, void>) NativeLibrary.GetExport(handle, "Checkpoint_SetNextPosition"); Event_Cancel = (delegate* unmanaged[Cdecl]<nint, void>) NativeLibrary.GetExport(handle, "Event_Cancel"); Event_WasCancelled = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Event_WasCancelled"); Player_GetID = (delegate* unmanaged[Cdecl]<nint, ushort>) NativeLibrary.GetExport(handle, "Player_GetID"); Player_GetNetworkOwner = (delegate* unmanaged[Cdecl]<nint, nint>) NativeLibrary.GetExport(handle, "Player_GetNetworkOwner"); Player_GetModel = (delegate* unmanaged[Cdecl]<nint, uint>) NativeLibrary.GetExport(handle, "Player_GetModel"); Player_SetModel = (delegate* unmanaged[Cdecl]<nint, uint, void>) NativeLibrary.GetExport(handle, "Player_SetModel"); Player_GetPosition = (delegate* unmanaged[Cdecl]<nint, Position*, void>) NativeLibrary.GetExport(handle, "Player_GetPosition"); Player_GetPositionCoords = (delegate* unmanaged[Cdecl]<nint, float*, float*, float*, int*, void>) NativeLibrary.GetExport(handle, "Player_GetPositionCoords"); Player_SetPosition = (delegate* unmanaged[Cdecl]<nint, Position, void>) NativeLibrary.GetExport(handle, "Player_SetPosition"); Player_GetRotation = (delegate* unmanaged[Cdecl]<nint, Rotation*, void>) NativeLibrary.GetExport(handle, "Player_GetRotation"); Player_SetRotation = (delegate* unmanaged[Cdecl]<nint, Rotation, void>) NativeLibrary.GetExport(handle, "Player_SetRotation"); Player_GetDimension = (delegate* unmanaged[Cdecl]<nint, int>) NativeLibrary.GetExport(handle, "Player_GetDimension"); Player_SetDimension = (delegate* unmanaged[Cdecl]<nint, int, void>) NativeLibrary.GetExport(handle, "Player_SetDimension"); Player_GetMetaData = (delegate* unmanaged[Cdecl]<nint, nint, nint>) NativeLibrary.GetExport(handle, "Player_GetMetaData"); Player_SetMetaData = (delegate* unmanaged[Cdecl]<nint, nint, nint, void>) NativeLibrary.GetExport(handle, "Player_SetMetaData"); Player_HasMetaData = (delegate* unmanaged[Cdecl]<nint, nint, byte>) NativeLibrary.GetExport(handle, "Player_HasMetaData"); Player_DeleteMetaData = (delegate* unmanaged[Cdecl]<nint, nint, void>) NativeLibrary.GetExport(handle, "Player_DeleteMetaData"); Player_GetSyncedMetaData = (delegate* unmanaged[Cdecl]<nint, nint, nint>) NativeLibrary.GetExport(handle, "Player_GetSyncedMetaData"); Player_SetSyncedMetaData = (delegate* unmanaged[Cdecl]<nint, nint, nint, void>) NativeLibrary.GetExport(handle, "Player_SetSyncedMetaData"); Player_HasSyncedMetaData = (delegate* unmanaged[Cdecl]<nint, nint, byte>) NativeLibrary.GetExport(handle, "Player_HasSyncedMetaData"); Player_DeleteSyncedMetaData = (delegate* unmanaged[Cdecl]<nint, nint, void>) NativeLibrary.GetExport(handle, "Player_DeleteSyncedMetaData"); Player_GetStreamSyncedMetaData = (delegate* unmanaged[Cdecl]<nint, nint, nint>) NativeLibrary.GetExport(handle, "Player_GetStreamSyncedMetaData"); Player_SetStreamSyncedMetaData = (delegate* unmanaged[Cdecl]<nint, nint, nint, void>) NativeLibrary.GetExport(handle, "Player_SetStreamSyncedMetaData"); Player_HasStreamSyncedMetaData = (delegate* unmanaged[Cdecl]<nint, nint, byte>) NativeLibrary.GetExport(handle, "Player_HasStreamSyncedMetaData"); Player_DeleteStreamSyncedMetaData = (delegate* unmanaged[Cdecl]<nint, nint, void>) NativeLibrary.GetExport(handle, "Player_DeleteStreamSyncedMetaData"); Player_AddRef = (delegate* unmanaged[Cdecl]<nint, void>) NativeLibrary.GetExport(handle, "Player_AddRef"); Player_RemoveRef = (delegate* unmanaged[Cdecl]<nint, void>) NativeLibrary.GetExport(handle, "Player_RemoveRef"); Player_GetVisible = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Player_GetVisible"); Player_SetVisible = (delegate* unmanaged[Cdecl]<nint, byte, void>) NativeLibrary.GetExport(handle, "Player_SetVisible"); Player_GetStreamed = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Player_GetStreamed"); Player_SetStreamed = (delegate* unmanaged[Cdecl]<nint, byte, void>) NativeLibrary.GetExport(handle, "Player_SetStreamed"); Player_IsConnected = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Player_IsConnected"); Player_Spawn = (delegate* unmanaged[Cdecl]<nint, Position, uint, void>) NativeLibrary.GetExport(handle, "Player_Spawn"); Player_Despawn = (delegate* unmanaged[Cdecl]<nint, void>) NativeLibrary.GetExport(handle, "Player_Despawn"); Player_GetName = (delegate* unmanaged[Cdecl]<nint, nint*, void>) NativeLibrary.GetExport(handle, "Player_GetName"); Player_GetSocialID = (delegate* unmanaged[Cdecl]<nint, ulong>) NativeLibrary.GetExport(handle, "Player_GetSocialID"); Player_GetHwidHash = (delegate* unmanaged[Cdecl]<nint, ulong>) NativeLibrary.GetExport(handle, "Player_GetHwidHash"); Player_GetHwidExHash = (delegate* unmanaged[Cdecl]<nint, ulong>) NativeLibrary.GetExport(handle, "Player_GetHwidExHash"); Player_GetAuthToken = (delegate* unmanaged[Cdecl]<nint, nint*, void>) NativeLibrary.GetExport(handle, "Player_GetAuthToken"); Player_GetHealth = (delegate* unmanaged[Cdecl]<nint, ushort>) NativeLibrary.GetExport(handle, "Player_GetHealth"); Player_SetHealth = (delegate* unmanaged[Cdecl]<nint, ushort, void>) NativeLibrary.GetExport(handle, "Player_SetHealth"); Player_GetMaxHealth = (delegate* unmanaged[Cdecl]<nint, ushort>) NativeLibrary.GetExport(handle, "Player_GetMaxHealth"); Player_SetMaxHealth = (delegate* unmanaged[Cdecl]<nint, ushort, void>) NativeLibrary.GetExport(handle, "Player_SetMaxHealth"); Player_SetDateTime = (delegate* unmanaged[Cdecl]<nint, int, int, int, int, int, int, void>) NativeLibrary.GetExport(handle, "Player_SetDateTime"); Player_SetWeather = (delegate* unmanaged[Cdecl]<nint, uint, void>) NativeLibrary.GetExport(handle, "Player_SetWeather"); Player_GiveWeapon = (delegate* unmanaged[Cdecl]<nint, uint, int, byte, void>) NativeLibrary.GetExport(handle, "Player_GiveWeapon"); Player_RemoveWeapon = (delegate* unmanaged[Cdecl]<nint, uint, byte>) NativeLibrary.GetExport(handle, "Player_RemoveWeapon"); Player_RemoveAllWeapons = (delegate* unmanaged[Cdecl]<nint, void>) NativeLibrary.GetExport(handle, "Player_RemoveAllWeapons"); Player_AddWeaponComponent = (delegate* unmanaged[Cdecl]<nint, uint, uint, void>) NativeLibrary.GetExport(handle, "Player_AddWeaponComponent"); Player_RemoveWeaponComponent = (delegate* unmanaged[Cdecl]<nint, uint, uint, void>) NativeLibrary.GetExport(handle, "Player_RemoveWeaponComponent"); Player_HasWeaponComponent = (delegate* unmanaged[Cdecl]<nint, uint, uint, byte>) NativeLibrary.GetExport(handle, "Player_HasWeaponComponent"); Player_GetCurrentWeaponComponents = (delegate* unmanaged[Cdecl]<nint, UIntArray*, void>) NativeLibrary.GetExport(handle, "Player_GetCurrentWeaponComponents"); Player_SetWeaponTintIndex = (delegate* unmanaged[Cdecl]<nint, uint, byte, void>) NativeLibrary.GetExport(handle, "Player_SetWeaponTintIndex"); Player_GetWeaponTintIndex = (delegate* unmanaged[Cdecl]<nint, uint, byte>) NativeLibrary.GetExport(handle, "Player_GetWeaponTintIndex"); Player_GetCurrentWeaponTintIndex = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Player_GetCurrentWeaponTintIndex"); Player_GetCurrentWeapon = (delegate* unmanaged[Cdecl]<nint, uint>) NativeLibrary.GetExport(handle, "Player_GetCurrentWeapon"); Player_SetCurrentWeapon = (delegate* unmanaged[Cdecl]<nint, uint, void>) NativeLibrary.GetExport(handle, "Player_SetCurrentWeapon"); Player_IsDead = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Player_IsDead"); Player_IsJumping = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Player_IsJumping"); Player_IsInRagdoll = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Player_IsInRagdoll"); Player_IsAiming = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Player_IsAiming"); Player_IsShooting = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Player_IsShooting"); Player_IsReloading = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Player_IsReloading"); Player_GetArmor = (delegate* unmanaged[Cdecl]<nint, ushort>) NativeLibrary.GetExport(handle, "Player_GetArmor"); Player_SetArmor = (delegate* unmanaged[Cdecl]<nint, ushort, void>) NativeLibrary.GetExport(handle, "Player_SetArmor"); Player_GetMaxArmor = (delegate* unmanaged[Cdecl]<nint, ushort>) NativeLibrary.GetExport(handle, "Player_GetMaxArmor"); Player_SetMaxArmor = (delegate* unmanaged[Cdecl]<nint, ushort, void>) NativeLibrary.GetExport(handle, "Player_SetMaxArmor"); Player_GetMoveSpeed = (delegate* unmanaged[Cdecl]<nint, float>) NativeLibrary.GetExport(handle, "Player_GetMoveSpeed"); Player_GetAimPos = (delegate* unmanaged[Cdecl]<nint, Position*, void>) NativeLibrary.GetExport(handle, "Player_GetAimPos"); Player_GetHeadRotation = (delegate* unmanaged[Cdecl]<nint, Rotation*, void>) NativeLibrary.GetExport(handle, "Player_GetHeadRotation"); Player_IsInVehicle = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Player_IsInVehicle"); Player_GetVehicle = (delegate* unmanaged[Cdecl]<nint, nint>) NativeLibrary.GetExport(handle, "Player_GetVehicle"); Player_GetSeat = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Player_GetSeat"); Player_GetEntityAimingAt = (delegate* unmanaged[Cdecl]<nint, BaseObjectType*, nint>) NativeLibrary.GetExport(handle, "Player_GetEntityAimingAt"); Player_GetEntityAimOffset = (delegate* unmanaged[Cdecl]<nint, Position*, void>) NativeLibrary.GetExport(handle, "Player_GetEntityAimOffset"); Player_IsFlashlightActive = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Player_IsFlashlightActive"); Player_Kick = (delegate* unmanaged[Cdecl]<nint, nint, void>) NativeLibrary.GetExport(handle, "Player_Kick"); Player_GetPing = (delegate* unmanaged[Cdecl]<nint, uint>) NativeLibrary.GetExport(handle, "Player_GetPing"); Player_GetIP = (delegate* unmanaged[Cdecl]<nint, nint*, void>) NativeLibrary.GetExport(handle, "Player_GetIP"); Player_GetPositionCoords2 = (delegate* unmanaged[Cdecl]<nint, float*, float*, float*, float*, float*, float*, int*, void>) NativeLibrary.GetExport(handle, "Player_GetPositionCoords2"); Player_SetNetworkOwner = (delegate* unmanaged[Cdecl]<nint, nint, byte, void>) NativeLibrary.GetExport(handle, "Player_SetNetworkOwner"); Player_ClearBloodDamage = (delegate* unmanaged[Cdecl]<nint, void>) NativeLibrary.GetExport(handle, "Player_ClearBloodDamage"); Player_GetClothes = (delegate* unmanaged[Cdecl]<nint, byte, Cloth*, void>) NativeLibrary.GetExport(handle, "Player_GetClothes"); Player_SetClothes = (delegate* unmanaged[Cdecl]<nint, byte, ushort, byte, byte, void>) NativeLibrary.GetExport(handle, "Player_SetClothes"); Player_GetDlcClothes = (delegate* unmanaged[Cdecl]<nint, byte, DlcCloth*, void>) NativeLibrary.GetExport(handle, "Player_GetDlcClothes"); Player_SetDlcClothes = (delegate* unmanaged[Cdecl]<nint, byte, ushort, byte, byte, uint, void>) NativeLibrary.GetExport(handle, "Player_SetDlcClothes"); Player_GetProps = (delegate* unmanaged[Cdecl]<nint, byte, Prop*, void>) NativeLibrary.GetExport(handle, "Player_GetProps"); Player_SetProps = (delegate* unmanaged[Cdecl]<nint, byte, ushort, byte, void>) NativeLibrary.GetExport(handle, "Player_SetProps"); Player_GetDlcProps = (delegate* unmanaged[Cdecl]<nint, byte, DlcProp*, void>) NativeLibrary.GetExport(handle, "Player_GetDlcProps"); Player_SetDlcProps = (delegate* unmanaged[Cdecl]<nint, byte, ushort, byte, uint, void>) NativeLibrary.GetExport(handle, "Player_SetDlcProps"); Player_ClearProps = (delegate* unmanaged[Cdecl]<nint, byte, void>) NativeLibrary.GetExport(handle, "Player_ClearProps"); Player_IsEntityInStreamingRange_Player = (delegate* unmanaged[Cdecl]<nint, nint, byte>) NativeLibrary.GetExport(handle, "Player_IsEntityInStreamingRange_Player"); Player_IsEntityInStreamingRange_Vehicle = (delegate* unmanaged[Cdecl]<nint, nint, byte>) NativeLibrary.GetExport(handle, "Player_IsEntityInStreamingRange_Vehicle"); Player_AttachToEntity_Player = (delegate* unmanaged[Cdecl]<nint, nint, short, short, Position, Rotation, byte, byte, void>) NativeLibrary.GetExport(handle, "Player_AttachToEntity_Player"); Player_AttachToEntity_Vehicle = (delegate* unmanaged[Cdecl]<nint, nint, short, short, Position, Rotation, byte, byte, void>) NativeLibrary.GetExport(handle, "Player_AttachToEntity_Vehicle"); Player_Detach = (delegate* unmanaged[Cdecl]<nint, void>) NativeLibrary.GetExport(handle, "Player_Detach"); Player_GetInvincible = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Player_GetInvincible"); Player_SetInvincible = (delegate* unmanaged[Cdecl]<nint, byte, void>) NativeLibrary.GetExport(handle, "Player_SetInvincible"); Player_SetIntoVehicle = (delegate* unmanaged[Cdecl]<nint, nint, byte, void>) NativeLibrary.GetExport(handle, "Player_SetIntoVehicle"); Player_IsSuperJumpEnabled = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Player_IsSuperJumpEnabled"); Player_IsCrouching = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Player_IsCrouching"); Player_IsStealthy = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Player_IsStealthy"); Player_PlayAmbientSpeech = (delegate* unmanaged[Cdecl]<nint, nint, nint, uint, void>) NativeLibrary.GetExport(handle, "Player_PlayAmbientSpeech"); Vehicle_GetID = (delegate* unmanaged[Cdecl]<nint, ushort>) NativeLibrary.GetExport(handle, "Vehicle_GetID"); Vehicle_GetNetworkOwner = (delegate* unmanaged[Cdecl]<nint, nint>) NativeLibrary.GetExport(handle, "Vehicle_GetNetworkOwner"); Vehicle_GetModel = (delegate* unmanaged[Cdecl]<nint, uint>) NativeLibrary.GetExport(handle, "Vehicle_GetModel"); Vehicle_GetPosition = (delegate* unmanaged[Cdecl]<nint, Position*, void>) NativeLibrary.GetExport(handle, "Vehicle_GetPosition"); Vehicle_SetPosition = (delegate* unmanaged[Cdecl]<nint, Position, void>) NativeLibrary.GetExport(handle, "Vehicle_SetPosition"); Vehicle_GetRotation = (delegate* unmanaged[Cdecl]<nint, Rotation*, void>) NativeLibrary.GetExport(handle, "Vehicle_GetRotation"); Vehicle_SetRotation = (delegate* unmanaged[Cdecl]<nint, Rotation, void>) NativeLibrary.GetExport(handle, "Vehicle_SetRotation"); Vehicle_GetDimension = (delegate* unmanaged[Cdecl]<nint, int>) NativeLibrary.GetExport(handle, "Vehicle_GetDimension"); Vehicle_SetDimension = (delegate* unmanaged[Cdecl]<nint, int, void>) NativeLibrary.GetExport(handle, "Vehicle_SetDimension"); Vehicle_GetMetaData = (delegate* unmanaged[Cdecl]<nint, nint, nint>) NativeLibrary.GetExport(handle, "Vehicle_GetMetaData"); Vehicle_SetMetaData = (delegate* unmanaged[Cdecl]<nint, nint, nint, void>) NativeLibrary.GetExport(handle, "Vehicle_SetMetaData"); Vehicle_HasMetaData = (delegate* unmanaged[Cdecl]<nint, nint, byte>) NativeLibrary.GetExport(handle, "Vehicle_HasMetaData"); Vehicle_DeleteMetaData = (delegate* unmanaged[Cdecl]<nint, nint, void>) NativeLibrary.GetExport(handle, "Vehicle_DeleteMetaData"); Vehicle_GetSyncedMetaData = (delegate* unmanaged[Cdecl]<nint, nint, nint>) NativeLibrary.GetExport(handle, "Vehicle_GetSyncedMetaData"); Vehicle_SetSyncedMetaData = (delegate* unmanaged[Cdecl]<nint, nint, nint, void>) NativeLibrary.GetExport(handle, "Vehicle_SetSyncedMetaData"); Vehicle_HasSyncedMetaData = (delegate* unmanaged[Cdecl]<nint, nint, byte>) NativeLibrary.GetExport(handle, "Vehicle_HasSyncedMetaData"); Vehicle_DeleteSyncedMetaData = (delegate* unmanaged[Cdecl]<nint, nint, void>) NativeLibrary.GetExport(handle, "Vehicle_DeleteSyncedMetaData"); Vehicle_GetStreamSyncedMetaData = (delegate* unmanaged[Cdecl]<nint, nint, nint>) NativeLibrary.GetExport(handle, "Vehicle_GetStreamSyncedMetaData"); Vehicle_SetStreamSyncedMetaData = (delegate* unmanaged[Cdecl]<nint, nint, nint, void>) NativeLibrary.GetExport(handle, "Vehicle_SetStreamSyncedMetaData"); Vehicle_HasStreamSyncedMetaData = (delegate* unmanaged[Cdecl]<nint, nint, byte>) NativeLibrary.GetExport(handle, "Vehicle_HasStreamSyncedMetaData"); Vehicle_DeleteStreamSyncedMetaData = (delegate* unmanaged[Cdecl]<nint, nint, void>) NativeLibrary.GetExport(handle, "Vehicle_DeleteStreamSyncedMetaData"); Vehicle_AddRef = (delegate* unmanaged[Cdecl]<nint, void>) NativeLibrary.GetExport(handle, "Vehicle_AddRef"); Vehicle_RemoveRef = (delegate* unmanaged[Cdecl]<nint, void>) NativeLibrary.GetExport(handle, "Vehicle_RemoveRef"); Vehicle_GetVisible = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Vehicle_GetVisible"); Vehicle_SetVisible = (delegate* unmanaged[Cdecl]<nint, byte, void>) NativeLibrary.GetExport(handle, "Vehicle_SetVisible"); Vehicle_GetStreamed = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Vehicle_GetStreamed"); Vehicle_SetStreamed = (delegate* unmanaged[Cdecl]<nint, byte, void>) NativeLibrary.GetExport(handle, "Vehicle_SetStreamed"); Vehicle_GetDriver = (delegate* unmanaged[Cdecl]<nint, nint>) NativeLibrary.GetExport(handle, "Vehicle_GetDriver"); Vehicle_IsDestroyed = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Vehicle_IsDestroyed"); Vehicle_GetMod = (delegate* unmanaged[Cdecl]<nint, byte, byte>) NativeLibrary.GetExport(handle, "Vehicle_GetMod"); Vehicle_GetModsCount = (delegate* unmanaged[Cdecl]<nint, byte, byte>) NativeLibrary.GetExport(handle, "Vehicle_GetModsCount"); Vehicle_SetMod = (delegate* unmanaged[Cdecl]<nint, byte, byte, byte>) NativeLibrary.GetExport(handle, "Vehicle_SetMod"); Vehicle_GetModKitsCount = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Vehicle_GetModKitsCount"); Vehicle_GetModKit = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Vehicle_GetModKit"); Vehicle_SetModKit = (delegate* unmanaged[Cdecl]<nint, byte, byte>) NativeLibrary.GetExport(handle, "Vehicle_SetModKit"); Vehicle_IsPrimaryColorRGB = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Vehicle_IsPrimaryColorRGB"); Vehicle_GetPrimaryColor = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Vehicle_GetPrimaryColor"); Vehicle_GetPrimaryColorRGB = (delegate* unmanaged[Cdecl]<nint, Rgba*, void>) NativeLibrary.GetExport(handle, "Vehicle_GetPrimaryColorRGB"); Vehicle_SetPrimaryColor = (delegate* unmanaged[Cdecl]<nint, byte, void>) NativeLibrary.GetExport(handle, "Vehicle_SetPrimaryColor"); Vehicle_SetPrimaryColorRGB = (delegate* unmanaged[Cdecl]<nint, Rgba, void>) NativeLibrary.GetExport(handle, "Vehicle_SetPrimaryColorRGB"); Vehicle_IsSecondaryColorRGB = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Vehicle_IsSecondaryColorRGB"); Vehicle_GetSecondaryColor = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Vehicle_GetSecondaryColor"); Vehicle_GetSecondaryColorRGB = (delegate* unmanaged[Cdecl]<nint, Rgba*, void>) NativeLibrary.GetExport(handle, "Vehicle_GetSecondaryColorRGB"); Vehicle_SetSecondaryColor = (delegate* unmanaged[Cdecl]<nint, byte, void>) NativeLibrary.GetExport(handle, "Vehicle_SetSecondaryColor"); Vehicle_SetSecondaryColorRGB = (delegate* unmanaged[Cdecl]<nint, Rgba, void>) NativeLibrary.GetExport(handle, "Vehicle_SetSecondaryColorRGB"); Vehicle_GetPearlColor = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Vehicle_GetPearlColor"); Vehicle_SetPearlColor = (delegate* unmanaged[Cdecl]<nint, byte, void>) NativeLibrary.GetExport(handle, "Vehicle_SetPearlColor"); Vehicle_GetWheelColor = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Vehicle_GetWheelColor"); Vehicle_SetWheelColor = (delegate* unmanaged[Cdecl]<nint, byte, void>) NativeLibrary.GetExport(handle, "Vehicle_SetWheelColor"); Vehicle_GetInteriorColor = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Vehicle_GetInteriorColor"); Vehicle_SetInteriorColor = (delegate* unmanaged[Cdecl]<nint, byte, void>) NativeLibrary.GetExport(handle, "Vehicle_SetInteriorColor"); Vehicle_GetDashboardColor = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Vehicle_GetDashboardColor"); Vehicle_SetDashboardColor = (delegate* unmanaged[Cdecl]<nint, byte, void>) NativeLibrary.GetExport(handle, "Vehicle_SetDashboardColor"); Vehicle_IsTireSmokeColorCustom = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Vehicle_IsTireSmokeColorCustom"); Vehicle_GetTireSmokeColor = (delegate* unmanaged[Cdecl]<nint, Rgba*, void>) NativeLibrary.GetExport(handle, "Vehicle_GetTireSmokeColor"); Vehicle_SetTireSmokeColor = (delegate* unmanaged[Cdecl]<nint, Rgba, void>) NativeLibrary.GetExport(handle, "Vehicle_SetTireSmokeColor"); Vehicle_GetWheelType = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Vehicle_GetWheelType"); Vehicle_GetWheelVariation = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Vehicle_GetWheelVariation"); Vehicle_GetRearWheelVariation = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Vehicle_GetRearWheelVariation"); Vehicle_SetWheels = (delegate* unmanaged[Cdecl]<nint, byte, byte, void>) NativeLibrary.GetExport(handle, "Vehicle_SetWheels"); Vehicle_SetRearWheels = (delegate* unmanaged[Cdecl]<nint, byte, void>) NativeLibrary.GetExport(handle, "Vehicle_SetRearWheels"); Vehicle_GetCustomTires = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Vehicle_GetCustomTires"); Vehicle_SetCustomTires = (delegate* unmanaged[Cdecl]<nint, byte, void>) NativeLibrary.GetExport(handle, "Vehicle_SetCustomTires"); Vehicle_GetSpecialDarkness = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Vehicle_GetSpecialDarkness"); Vehicle_SetSpecialDarkness = (delegate* unmanaged[Cdecl]<nint, byte, void>) NativeLibrary.GetExport(handle, "Vehicle_SetSpecialDarkness"); Vehicle_GetNumberplateIndex = (delegate* unmanaged[Cdecl]<nint, uint>) NativeLibrary.GetExport(handle, "Vehicle_GetNumberplateIndex"); Vehicle_SetNumberplateIndex = (delegate* unmanaged[Cdecl]<nint, uint, void>) NativeLibrary.GetExport(handle, "Vehicle_SetNumberplateIndex"); Vehicle_GetNumberplateText = (delegate* unmanaged[Cdecl]<nint, nint*, void>) NativeLibrary.GetExport(handle, "Vehicle_GetNumberplateText"); Vehicle_SetNumberplateText = (delegate* unmanaged[Cdecl]<nint, nint, void>) NativeLibrary.GetExport(handle, "Vehicle_SetNumberplateText"); Vehicle_GetWindowTint = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Vehicle_GetWindowTint"); Vehicle_SetWindowTint = (delegate* unmanaged[Cdecl]<nint, byte, void>) NativeLibrary.GetExport(handle, "Vehicle_SetWindowTint"); Vehicle_GetDirtLevel = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Vehicle_GetDirtLevel"); Vehicle_SetDirtLevel = (delegate* unmanaged[Cdecl]<nint, byte, void>) NativeLibrary.GetExport(handle, "Vehicle_SetDirtLevel"); Vehicle_IsExtraOn = (delegate* unmanaged[Cdecl]<nint, byte, byte>) NativeLibrary.GetExport(handle, "Vehicle_IsExtraOn"); Vehicle_ToggleExtra = (delegate* unmanaged[Cdecl]<nint, byte, byte, void>) NativeLibrary.GetExport(handle, "Vehicle_ToggleExtra"); Vehicle_IsNeonActive = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Vehicle_IsNeonActive"); Vehicle_GetNeonActive = (delegate* unmanaged[Cdecl]<nint, byte*, byte*, byte*, byte*, void>) NativeLibrary.GetExport(handle, "Vehicle_GetNeonActive"); Vehicle_SetNeonActive = (delegate* unmanaged[Cdecl]<nint, byte, byte, byte, byte, void>) NativeLibrary.GetExport(handle, "Vehicle_SetNeonActive"); Vehicle_GetNeonColor = (delegate* unmanaged[Cdecl]<nint, Rgba*, void>) NativeLibrary.GetExport(handle, "Vehicle_GetNeonColor"); Vehicle_SetNeonColor = (delegate* unmanaged[Cdecl]<nint, Rgba, void>) NativeLibrary.GetExport(handle, "Vehicle_SetNeonColor"); Vehicle_GetLivery = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Vehicle_GetLivery"); Vehicle_SetLivery = (delegate* unmanaged[Cdecl]<nint, byte, void>) NativeLibrary.GetExport(handle, "Vehicle_SetLivery"); Vehicle_GetRoofLivery = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Vehicle_GetRoofLivery"); Vehicle_SetRoofLivery = (delegate* unmanaged[Cdecl]<nint, byte, void>) NativeLibrary.GetExport(handle, "Vehicle_SetRoofLivery"); Vehicle_GetAppearanceDataBase64 = (delegate* unmanaged[Cdecl]<nint, nint*, void>) NativeLibrary.GetExport(handle, "Vehicle_GetAppearanceDataBase64"); Vehicle_LoadAppearanceDataFromBase64 = (delegate* unmanaged[Cdecl]<nint, string, void>) NativeLibrary.GetExport(handle, "Vehicle_LoadAppearanceDataFromBase64"); Vehicle_IsEngineOn = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Vehicle_IsEngineOn"); Vehicle_SetEngineOn = (delegate* unmanaged[Cdecl]<nint, byte, void>) NativeLibrary.GetExport(handle, "Vehicle_SetEngineOn"); Vehicle_IsHandbrakeActive = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Vehicle_IsHandbrakeActive"); Vehicle_GetHeadlightColor = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Vehicle_GetHeadlightColor"); Vehicle_SetHeadlightColor = (delegate* unmanaged[Cdecl]<nint, byte, void>) NativeLibrary.GetExport(handle, "Vehicle_SetHeadlightColor"); Vehicle_GetRadioStationIndex = (delegate* unmanaged[Cdecl]<nint, uint>) NativeLibrary.GetExport(handle, "Vehicle_GetRadioStationIndex"); Vehicle_SetRadioStationIndex = (delegate* unmanaged[Cdecl]<nint, uint, void>) NativeLibrary.GetExport(handle, "Vehicle_SetRadioStationIndex"); Vehicle_IsSirenActive = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Vehicle_IsSirenActive"); Vehicle_SetSirenActive = (delegate* unmanaged[Cdecl]<nint, byte, void>) NativeLibrary.GetExport(handle, "Vehicle_SetSirenActive"); Vehicle_GetLockState = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Vehicle_GetLockState"); Vehicle_SetLockState = (delegate* unmanaged[Cdecl]<nint, byte, void>) NativeLibrary.GetExport(handle, "Vehicle_SetLockState"); Vehicle_GetDoorState = (delegate* unmanaged[Cdecl]<nint, byte, byte>) NativeLibrary.GetExport(handle, "Vehicle_GetDoorState"); Vehicle_SetDoorState = (delegate* unmanaged[Cdecl]<nint, byte, byte, void>) NativeLibrary.GetExport(handle, "Vehicle_SetDoorState"); Vehicle_IsWindowOpened = (delegate* unmanaged[Cdecl]<nint, byte, byte>) NativeLibrary.GetExport(handle, "Vehicle_IsWindowOpened"); Vehicle_SetWindowOpened = (delegate* unmanaged[Cdecl]<nint, byte, byte, void>) NativeLibrary.GetExport(handle, "Vehicle_SetWindowOpened"); Vehicle_IsDaylightOn = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Vehicle_IsDaylightOn"); Vehicle_IsNightlightOn = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Vehicle_IsNightlightOn"); Vehicle_GetRoofState = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Vehicle_GetRoofState"); Vehicle_SetRoofState = (delegate* unmanaged[Cdecl]<nint, byte, void>) NativeLibrary.GetExport(handle, "Vehicle_SetRoofState"); Vehicle_IsFlamethrowerActive = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Vehicle_IsFlamethrowerActive"); Vehicle_GetLightsMultiplier = (delegate* unmanaged[Cdecl]<nint, float>) NativeLibrary.GetExport(handle, "Vehicle_GetLightsMultiplier"); Vehicle_SetLightsMultiplier = (delegate* unmanaged[Cdecl]<nint, float, void>) NativeLibrary.GetExport(handle, "Vehicle_SetLightsMultiplier"); Vehicle_GetGameStateBase64 = (delegate* unmanaged[Cdecl]<nint, nint*, void>) NativeLibrary.GetExport(handle, "Vehicle_GetGameStateBase64"); Vehicle_LoadGameStateFromBase64 = (delegate* unmanaged[Cdecl]<nint, string, void>) NativeLibrary.GetExport(handle, "Vehicle_LoadGameStateFromBase64"); Vehicle_GetEngineHealth = (delegate* unmanaged[Cdecl]<nint, int>) NativeLibrary.GetExport(handle, "Vehicle_GetEngineHealth"); Vehicle_SetEngineHealth = (delegate* unmanaged[Cdecl]<nint, int, void>) NativeLibrary.GetExport(handle, "Vehicle_SetEngineHealth"); Vehicle_GetPetrolTankHealth = (delegate* unmanaged[Cdecl]<nint, int>) NativeLibrary.GetExport(handle, "Vehicle_GetPetrolTankHealth"); Vehicle_SetPetrolTankHealth = (delegate* unmanaged[Cdecl]<nint, int, void>) NativeLibrary.GetExport(handle, "Vehicle_SetPetrolTankHealth"); Vehicle_GetWheelsCount = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Vehicle_GetWheelsCount"); Vehicle_IsWheelBurst = (delegate* unmanaged[Cdecl]<nint, byte, byte>) NativeLibrary.GetExport(handle, "Vehicle_IsWheelBurst"); Vehicle_SetWheelBurst = (delegate* unmanaged[Cdecl]<nint, byte, byte, void>) NativeLibrary.GetExport(handle, "Vehicle_SetWheelBurst"); Vehicle_DoesWheelHasTire = (delegate* unmanaged[Cdecl]<nint, byte, byte>) NativeLibrary.GetExport(handle, "Vehicle_DoesWheelHasTire"); Vehicle_SetWheelHasTire = (delegate* unmanaged[Cdecl]<nint, byte, byte, void>) NativeLibrary.GetExport(handle, "Vehicle_SetWheelHasTire"); Vehicle_IsWheelDetached = (delegate* unmanaged[Cdecl]<nint, byte, byte>) NativeLibrary.GetExport(handle, "Vehicle_IsWheelDetached"); Vehicle_SetWheelDetached = (delegate* unmanaged[Cdecl]<nint, byte, byte, void>) NativeLibrary.GetExport(handle, "Vehicle_SetWheelDetached"); Vehicle_IsWheelOnFire = (delegate* unmanaged[Cdecl]<nint, byte, byte>) NativeLibrary.GetExport(handle, "Vehicle_IsWheelOnFire"); Vehicle_SetWheelOnFire = (delegate* unmanaged[Cdecl]<nint, byte, byte, void>) NativeLibrary.GetExport(handle, "Vehicle_SetWheelOnFire"); Vehicle_GetWheelHealth = (delegate* unmanaged[Cdecl]<nint, byte, float>) NativeLibrary.GetExport(handle, "Vehicle_GetWheelHealth"); Vehicle_SetWheelHealth = (delegate* unmanaged[Cdecl]<nint, byte, float, void>) NativeLibrary.GetExport(handle, "Vehicle_SetWheelHealth"); Vehicle_SetWheelFixed = (delegate* unmanaged[Cdecl]<nint, byte, void>) NativeLibrary.GetExport(handle, "Vehicle_SetWheelFixed"); Vehicle_GetRepairsCount = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Vehicle_GetRepairsCount"); Vehicle_GetBodyHealth = (delegate* unmanaged[Cdecl]<nint, uint>) NativeLibrary.GetExport(handle, "Vehicle_GetBodyHealth"); Vehicle_SetBodyHealth = (delegate* unmanaged[Cdecl]<nint, uint, void>) NativeLibrary.GetExport(handle, "Vehicle_SetBodyHealth"); Vehicle_GetBodyAdditionalHealth = (delegate* unmanaged[Cdecl]<nint, uint>) NativeLibrary.GetExport(handle, "Vehicle_GetBodyAdditionalHealth"); Vehicle_SetBodyAdditionalHealth = (delegate* unmanaged[Cdecl]<nint, uint, void>) NativeLibrary.GetExport(handle, "Vehicle_SetBodyAdditionalHealth"); Vehicle_GetHealthDataBase64 = (delegate* unmanaged[Cdecl]<nint, nint*, void>) NativeLibrary.GetExport(handle, "Vehicle_GetHealthDataBase64"); Vehicle_LoadHealthDataFromBase64 = (delegate* unmanaged[Cdecl]<nint, string, void>) NativeLibrary.GetExport(handle, "Vehicle_LoadHealthDataFromBase64"); Vehicle_GetPartDamageLevel = (delegate* unmanaged[Cdecl]<nint, byte, byte>) NativeLibrary.GetExport(handle, "Vehicle_GetPartDamageLevel"); Vehicle_SetPartDamageLevel = (delegate* unmanaged[Cdecl]<nint, byte, byte, void>) NativeLibrary.GetExport(handle, "Vehicle_SetPartDamageLevel"); Vehicle_GetPartBulletHoles = (delegate* unmanaged[Cdecl]<nint, byte, byte>) NativeLibrary.GetExport(handle, "Vehicle_GetPartBulletHoles"); Vehicle_SetPartBulletHoles = (delegate* unmanaged[Cdecl]<nint, byte, byte, void>) NativeLibrary.GetExport(handle, "Vehicle_SetPartBulletHoles"); Vehicle_IsLightDamaged = (delegate* unmanaged[Cdecl]<nint, byte, byte>) NativeLibrary.GetExport(handle, "Vehicle_IsLightDamaged"); Vehicle_SetLightDamaged = (delegate* unmanaged[Cdecl]<nint, byte, byte, void>) NativeLibrary.GetExport(handle, "Vehicle_SetLightDamaged"); Vehicle_IsWindowDamaged = (delegate* unmanaged[Cdecl]<nint, byte, byte>) NativeLibrary.GetExport(handle, "Vehicle_IsWindowDamaged"); Vehicle_SetWindowDamaged = (delegate* unmanaged[Cdecl]<nint, byte, byte, void>) NativeLibrary.GetExport(handle, "Vehicle_SetWindowDamaged"); Vehicle_IsSpecialLightDamaged = (delegate* unmanaged[Cdecl]<nint, byte, byte>) NativeLibrary.GetExport(handle, "Vehicle_IsSpecialLightDamaged"); Vehicle_SetSpecialLightDamaged = (delegate* unmanaged[Cdecl]<nint, byte, byte, void>) NativeLibrary.GetExport(handle, "Vehicle_SetSpecialLightDamaged"); Vehicle_HasArmoredWindows = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Vehicle_HasArmoredWindows"); Vehicle_GetArmoredWindowHealth = (delegate* unmanaged[Cdecl]<nint, byte, float>) NativeLibrary.GetExport(handle, "Vehicle_GetArmoredWindowHealth"); Vehicle_SetArmoredWindowHealth = (delegate* unmanaged[Cdecl]<nint, byte, float, void>) NativeLibrary.GetExport(handle, "Vehicle_SetArmoredWindowHealth"); Vehicle_GetArmoredWindowShootCount = (delegate* unmanaged[Cdecl]<nint, byte, byte>) NativeLibrary.GetExport(handle, "Vehicle_GetArmoredWindowShootCount"); Vehicle_SetArmoredWindowShootCount = (delegate* unmanaged[Cdecl]<nint, byte, byte, void>) NativeLibrary.GetExport(handle, "Vehicle_SetArmoredWindowShootCount"); Vehicle_GetBumperDamageLevel = (delegate* unmanaged[Cdecl]<nint, byte, byte>) NativeLibrary.GetExport(handle, "Vehicle_GetBumperDamageLevel"); Vehicle_SetBumperDamageLevel = (delegate* unmanaged[Cdecl]<nint, byte, byte, void>) NativeLibrary.GetExport(handle, "Vehicle_SetBumperDamageLevel"); Vehicle_GetDamageDataBase64 = (delegate* unmanaged[Cdecl]<nint, nint*, void>) NativeLibrary.GetExport(handle, "Vehicle_GetDamageDataBase64"); Vehicle_LoadDamageDataFromBase64 = (delegate* unmanaged[Cdecl]<nint, string, void>) NativeLibrary.GetExport(handle, "Vehicle_LoadDamageDataFromBase64"); Vehicle_SetManualEngineControl = (delegate* unmanaged[Cdecl]<nint, byte, void>) NativeLibrary.GetExport(handle, "Vehicle_SetManualEngineControl"); Vehicle_IsManualEngineControl = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Vehicle_IsManualEngineControl"); Vehicle_GetScriptDataBase64 = (delegate* unmanaged[Cdecl]<nint, nint*, void>) NativeLibrary.GetExport(handle, "Vehicle_GetScriptDataBase64"); Vehicle_LoadScriptDataFromBase64 = (delegate* unmanaged[Cdecl]<nint, string, void>) NativeLibrary.GetExport(handle, "Vehicle_LoadScriptDataFromBase64"); Vehicle_GetPositionCoords2 = (delegate* unmanaged[Cdecl]<nint, float*, float*, float*, float*, float*, float*, int*, void>) NativeLibrary.GetExport(handle, "Vehicle_GetPositionCoords2"); Vehicle_SetNetworkOwner = (delegate* unmanaged[Cdecl]<nint, nint, byte, void>) NativeLibrary.GetExport(handle, "Vehicle_SetNetworkOwner"); Vehicle_GetAttached = (delegate* unmanaged[Cdecl]<nint, nint>) NativeLibrary.GetExport(handle, "Vehicle_GetAttached"); Vehicle_GetAttachedTo = (delegate* unmanaged[Cdecl]<nint, nint>) NativeLibrary.GetExport(handle, "Vehicle_GetAttachedTo"); Vehicle_Repair = (delegate* unmanaged[Cdecl]<nint, void>) NativeLibrary.GetExport(handle, "Vehicle_Repair"); Vehicle_AttachToEntity_Player = (delegate* unmanaged[Cdecl]<nint, nint, short, short, Position, Rotation, byte, byte, void>) NativeLibrary.GetExport(handle, "Vehicle_AttachToEntity_Player"); Vehicle_AttachToEntity_Vehicle = (delegate* unmanaged[Cdecl]<nint, nint, short, short, Position, Rotation, byte, byte, void>) NativeLibrary.GetExport(handle, "Vehicle_AttachToEntity_Vehicle"); Vehicle_Detach = (delegate* unmanaged[Cdecl]<nint, void>) NativeLibrary.GetExport(handle, "Vehicle_Detach"); Vehicle_GetVelocity = (delegate* unmanaged[Cdecl]<nint, Vector3*, void>) NativeLibrary.GetExport(handle, "Vehicle_GetVelocity"); Vehicle_SetDriftMode = (delegate* unmanaged[Cdecl]<nint, byte, void>) NativeLibrary.GetExport(handle, "Vehicle_SetDriftMode"); Vehicle_IsDriftMode = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Vehicle_IsDriftMode"); ColShape_GetPosition = (delegate* unmanaged[Cdecl]<nint, Position*, void>) NativeLibrary.GetExport(handle, "ColShape_GetPosition"); ColShape_SetPosition = (delegate* unmanaged[Cdecl]<nint, Position, void>) NativeLibrary.GetExport(handle, "ColShape_SetPosition"); ColShape_GetDimension = (delegate* unmanaged[Cdecl]<nint, int>) NativeLibrary.GetExport(handle, "ColShape_GetDimension"); ColShape_SetDimension = (delegate* unmanaged[Cdecl]<nint, int, void>) NativeLibrary.GetExport(handle, "ColShape_SetDimension"); ColShape_GetMetaData = (delegate* unmanaged[Cdecl]<nint, nint, nint>) NativeLibrary.GetExport(handle, "ColShape_GetMetaData"); ColShape_SetMetaData = (delegate* unmanaged[Cdecl]<nint, nint, nint, void>) NativeLibrary.GetExport(handle, "ColShape_SetMetaData"); ColShape_HasMetaData = (delegate* unmanaged[Cdecl]<nint, nint, byte>) NativeLibrary.GetExport(handle, "ColShape_HasMetaData"); ColShape_DeleteMetaData = (delegate* unmanaged[Cdecl]<nint, nint, void>) NativeLibrary.GetExport(handle, "ColShape_DeleteMetaData"); ColShape_AddRef = (delegate* unmanaged[Cdecl]<nint, void>) NativeLibrary.GetExport(handle, "ColShape_AddRef"); ColShape_RemoveRef = (delegate* unmanaged[Cdecl]<nint, void>) NativeLibrary.GetExport(handle, "ColShape_RemoveRef"); ColShape_GetColShapeType = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "ColShape_GetColShapeType"); ColShape_IsPlayerIn = (delegate* unmanaged[Cdecl]<nint, nint, byte>) NativeLibrary.GetExport(handle, "ColShape_IsPlayerIn"); ColShape_IsVehicleIn = (delegate* unmanaged[Cdecl]<nint, nint, byte>) NativeLibrary.GetExport(handle, "ColShape_IsVehicleIn"); ColShape_SetPlayersOnly = (delegate* unmanaged[Cdecl]<nint, byte, void>) NativeLibrary.GetExport(handle, "ColShape_SetPlayersOnly"); ColShape_IsPlayersOnly = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "ColShape_IsPlayersOnly"); VoiceChannel_GetMetaData = (delegate* unmanaged[Cdecl]<nint, nint, nint>) NativeLibrary.GetExport(handle, "VoiceChannel_GetMetaData"); VoiceChannel_SetMetaData = (delegate* unmanaged[Cdecl]<nint, nint, nint, void>) NativeLibrary.GetExport(handle, "VoiceChannel_SetMetaData"); VoiceChannel_HasMetaData = (delegate* unmanaged[Cdecl]<nint, nint, byte>) NativeLibrary.GetExport(handle, "VoiceChannel_HasMetaData"); VoiceChannel_DeleteMetaData = (delegate* unmanaged[Cdecl]<nint, nint, void>) NativeLibrary.GetExport(handle, "VoiceChannel_DeleteMetaData"); VoiceChannel_AddRef = (delegate* unmanaged[Cdecl]<nint, void>) NativeLibrary.GetExport(handle, "VoiceChannel_AddRef"); VoiceChannel_RemoveRef = (delegate* unmanaged[Cdecl]<nint, void>) NativeLibrary.GetExport(handle, "VoiceChannel_RemoveRef"); VoiceChannel_AddPlayer = (delegate* unmanaged[Cdecl]<nint, nint, void>) NativeLibrary.GetExport(handle, "VoiceChannel_AddPlayer"); VoiceChannel_RemovePlayer = (delegate* unmanaged[Cdecl]<nint, nint, void>) NativeLibrary.GetExport(handle, "VoiceChannel_RemovePlayer"); VoiceChannel_MutePlayer = (delegate* unmanaged[Cdecl]<nint, nint, void>) NativeLibrary.GetExport(handle, "VoiceChannel_MutePlayer"); VoiceChannel_UnmutePlayer = (delegate* unmanaged[Cdecl]<nint, nint, void>) NativeLibrary.GetExport(handle, "VoiceChannel_UnmutePlayer"); VoiceChannel_HasPlayer = (delegate* unmanaged[Cdecl]<nint, nint, byte>) NativeLibrary.GetExport(handle, "VoiceChannel_HasPlayer"); VoiceChannel_IsPlayerMuted = (delegate* unmanaged[Cdecl]<nint, nint, byte>) NativeLibrary.GetExport(handle, "VoiceChannel_IsPlayerMuted"); VoiceChannel_IsSpatial = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "VoiceChannel_IsSpatial"); VoiceChannel_GetMaxDistance = (delegate* unmanaged[Cdecl]<nint, float>) NativeLibrary.GetExport(handle, "VoiceChannel_GetMaxDistance"); Blip_GetPosition = (delegate* unmanaged[Cdecl]<nint, Position*, void>) NativeLibrary.GetExport(handle, "Blip_GetPosition"); Blip_SetPosition = (delegate* unmanaged[Cdecl]<nint, Position, void>) NativeLibrary.GetExport(handle, "Blip_SetPosition"); Blip_GetDimension = (delegate* unmanaged[Cdecl]<nint, int>) NativeLibrary.GetExport(handle, "Blip_GetDimension"); Blip_SetDimension = (delegate* unmanaged[Cdecl]<nint, int, void>) NativeLibrary.GetExport(handle, "Blip_SetDimension"); Blip_GetMetaData = (delegate* unmanaged[Cdecl]<nint, nint, nint>) NativeLibrary.GetExport(handle, "Blip_GetMetaData"); Blip_SetMetaData = (delegate* unmanaged[Cdecl]<nint, nint, nint, void>) NativeLibrary.GetExport(handle, "Blip_SetMetaData"); Blip_HasMetaData = (delegate* unmanaged[Cdecl]<nint, nint, byte>) NativeLibrary.GetExport(handle, "Blip_HasMetaData"); Blip_DeleteMetaData = (delegate* unmanaged[Cdecl]<nint, nint, void>) NativeLibrary.GetExport(handle, "Blip_DeleteMetaData"); Blip_AddRef = (delegate* unmanaged[Cdecl]<nint, void>) NativeLibrary.GetExport(handle, "Blip_AddRef"); Blip_RemoveRef = (delegate* unmanaged[Cdecl]<nint, void>) NativeLibrary.GetExport(handle, "Blip_RemoveRef"); Blip_IsGlobal = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Blip_IsGlobal"); Blip_IsAttached = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Blip_IsAttached"); Blip_AttachedTo = (delegate* unmanaged[Cdecl]<nint, BaseObjectType*, nint>) NativeLibrary.GetExport(handle, "Blip_AttachedTo"); Blip_GetType = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Blip_GetType"); Blip_GetScaleXY = (delegate* unmanaged[Cdecl]<nint, Vector2*, void>) NativeLibrary.GetExport(handle, "Blip_GetScaleXY"); Blip_SetScaleXY = (delegate* unmanaged[Cdecl]<nint, Vector2, void>) NativeLibrary.GetExport(handle, "Blip_SetScaleXY"); Blip_GetDisplay = (delegate* unmanaged[Cdecl]<nint, short>) NativeLibrary.GetExport(handle, "Blip_GetDisplay"); Blip_SetDisplay = (delegate* unmanaged[Cdecl]<nint, short, void>) NativeLibrary.GetExport(handle, "Blip_SetDisplay"); Blip_GetSprite = (delegate* unmanaged[Cdecl]<nint, ushort>) NativeLibrary.GetExport(handle, "Blip_GetSprite"); Blip_SetSprite = (delegate* unmanaged[Cdecl]<nint, ushort, void>) NativeLibrary.GetExport(handle, "Blip_SetSprite"); Blip_GetColor = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Blip_GetColor"); Blip_SetColor = (delegate* unmanaged[Cdecl]<nint, byte, void>) NativeLibrary.GetExport(handle, "Blip_SetColor"); Blip_GetSecondaryColor = (delegate* unmanaged[Cdecl]<nint, Rgba*, void>) NativeLibrary.GetExport(handle, "Blip_GetSecondaryColor"); Blip_SetSecondaryColor = (delegate* unmanaged[Cdecl]<nint, Rgba, void>) NativeLibrary.GetExport(handle, "Blip_SetSecondaryColor"); Blip_GetAlpha = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Blip_GetAlpha"); Blip_SetAlpha = (delegate* unmanaged[Cdecl]<nint, byte, void>) NativeLibrary.GetExport(handle, "Blip_SetAlpha"); Blip_GetFlashTimer = (delegate* unmanaged[Cdecl]<nint, ushort>) NativeLibrary.GetExport(handle, "Blip_GetFlashTimer"); Blip_SetFlashTimer = (delegate* unmanaged[Cdecl]<nint, ushort, void>) NativeLibrary.GetExport(handle, "Blip_SetFlashTimer"); Blip_GetFlashInterval = (delegate* unmanaged[Cdecl]<nint, ushort>) NativeLibrary.GetExport(handle, "Blip_GetFlashInterval"); Blip_SetFlashInterval = (delegate* unmanaged[Cdecl]<nint, ushort, void>) NativeLibrary.GetExport(handle, "Blip_SetFlashInterval"); Blip_GetAsFriendly = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Blip_GetAsFriendly"); Blip_SetAsFriendly = (delegate* unmanaged[Cdecl]<nint, byte, void>) NativeLibrary.GetExport(handle, "Blip_SetAsFriendly"); Blip_GetRoute = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Blip_GetRoute"); Blip_SetRoute = (delegate* unmanaged[Cdecl]<nint, byte, void>) NativeLibrary.GetExport(handle, "Blip_SetRoute"); Blip_GetBright = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Blip_GetBright"); Blip_SetBright = (delegate* unmanaged[Cdecl]<nint, byte, void>) NativeLibrary.GetExport(handle, "Blip_SetBright"); Blip_GetNumber = (delegate* unmanaged[Cdecl]<nint, ushort>) NativeLibrary.GetExport(handle, "Blip_GetNumber"); Blip_SetNumber = (delegate* unmanaged[Cdecl]<nint, ushort, void>) NativeLibrary.GetExport(handle, "Blip_SetNumber"); Blip_GetShowCone = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Blip_GetShowCone"); Blip_SetShowCone = (delegate* unmanaged[Cdecl]<nint, byte, void>) NativeLibrary.GetExport(handle, "Blip_SetShowCone"); Blip_GetFlashes = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Blip_GetFlashes"); Blip_SetFlashes = (delegate* unmanaged[Cdecl]<nint, byte, void>) NativeLibrary.GetExport(handle, "Blip_SetFlashes"); Blip_GetFlashesAlternate = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Blip_GetFlashesAlternate"); Blip_SetFlashesAlternate = (delegate* unmanaged[Cdecl]<nint, byte, void>) NativeLibrary.GetExport(handle, "Blip_SetFlashesAlternate"); Blip_GetAsShortRange = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Blip_GetAsShortRange"); Blip_SetAsShortRange = (delegate* unmanaged[Cdecl]<nint, byte, void>) NativeLibrary.GetExport(handle, "Blip_SetAsShortRange"); Blip_GetPriority = (delegate* unmanaged[Cdecl]<nint, ushort>) NativeLibrary.GetExport(handle, "Blip_GetPriority"); Blip_SetPriority = (delegate* unmanaged[Cdecl]<nint, ushort, void>) NativeLibrary.GetExport(handle, "Blip_SetPriority"); Blip_GetRotation = (delegate* unmanaged[Cdecl]<nint, float>) NativeLibrary.GetExport(handle, "Blip_GetRotation"); Blip_SetRotation = (delegate* unmanaged[Cdecl]<nint, float, void>) NativeLibrary.GetExport(handle, "Blip_SetRotation"); Blip_GetGxtName = (delegate* unmanaged[Cdecl]<nint, nint*, void>) NativeLibrary.GetExport(handle, "Blip_GetGxtName"); Blip_SetGxtName = (delegate* unmanaged[Cdecl]<nint, nint, void>) NativeLibrary.GetExport(handle, "Blip_SetGxtName"); Blip_GetName = (delegate* unmanaged[Cdecl]<nint, nint*, void>) NativeLibrary.GetExport(handle, "Blip_GetName"); Blip_SetName = (delegate* unmanaged[Cdecl]<nint, nint, void>) NativeLibrary.GetExport(handle, "Blip_SetName"); Blip_GetRouteColor = (delegate* unmanaged[Cdecl]<nint, Rgba*, void>) NativeLibrary.GetExport(handle, "Blip_GetRouteColor"); Blip_SetRouteColor = (delegate* unmanaged[Cdecl]<nint, Rgba, void>) NativeLibrary.GetExport(handle, "Blip_SetRouteColor"); Blip_GetPulse = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Blip_GetPulse"); Blip_SetPulse = (delegate* unmanaged[Cdecl]<nint, byte, void>) NativeLibrary.GetExport(handle, "Blip_SetPulse"); Blip_GetAsMissionCreator = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Blip_GetAsMissionCreator"); Blip_SetAsMissionCreator = (delegate* unmanaged[Cdecl]<nint, byte, void>) NativeLibrary.GetExport(handle, "Blip_SetAsMissionCreator"); Blip_GetTickVisible = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Blip_GetTickVisible"); Blip_SetTickVisible = (delegate* unmanaged[Cdecl]<nint, byte, void>) NativeLibrary.GetExport(handle, "Blip_SetTickVisible"); Blip_GetHeadingIndicatorVisible = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Blip_GetHeadingIndicatorVisible"); Blip_SetHeadingIndicatorVisible = (delegate* unmanaged[Cdecl]<nint, byte, void>) NativeLibrary.GetExport(handle, "Blip_SetHeadingIndicatorVisible"); Blip_GetOutlineIndicatorVisible = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Blip_GetOutlineIndicatorVisible"); Blip_SetOutlineIndicatorVisible = (delegate* unmanaged[Cdecl]<nint, byte, void>) NativeLibrary.GetExport(handle, "Blip_SetOutlineIndicatorVisible"); Blip_GetFriendIndicatorVisible = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Blip_GetFriendIndicatorVisible"); Blip_SetFriendIndicatorVisible = (delegate* unmanaged[Cdecl]<nint, byte, void>) NativeLibrary.GetExport(handle, "Blip_SetFriendIndicatorVisible"); Blip_GetCrewIndicatorVisible = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Blip_GetCrewIndicatorVisible"); Blip_SetCrewIndicatorVisible = (delegate* unmanaged[Cdecl]<nint, byte, void>) NativeLibrary.GetExport(handle, "Blip_SetCrewIndicatorVisible"); Blip_GetCategory = (delegate* unmanaged[Cdecl]<nint, ushort>) NativeLibrary.GetExport(handle, "Blip_GetCategory"); Blip_SetCategory = (delegate* unmanaged[Cdecl]<nint, ushort, void>) NativeLibrary.GetExport(handle, "Blip_SetCategory"); Blip_GetAsHighDetail = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Blip_GetAsHighDetail"); Blip_SetAsHighDetail = (delegate* unmanaged[Cdecl]<nint, byte, void>) NativeLibrary.GetExport(handle, "Blip_SetAsHighDetail"); Blip_GetShrinked = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Blip_GetShrinked"); Blip_SetShrinked = (delegate* unmanaged[Cdecl]<nint, byte, void>) NativeLibrary.GetExport(handle, "Blip_SetShrinked"); Blip_Fade = (delegate* unmanaged[Cdecl]<nint, uint, uint, void>) NativeLibrary.GetExport(handle, "Blip_Fade"); Resource_GetExportsCount = (delegate* unmanaged[Cdecl]<nint, ulong>) NativeLibrary.GetExport(handle, "Resource_GetExportsCount"); Resource_GetExports = (delegate* unmanaged[Cdecl]<nint, nint[], nint[], void>) NativeLibrary.GetExport(handle, "Resource_GetExports"); Resource_GetExport = (delegate* unmanaged[Cdecl]<nint, nint, nint>) NativeLibrary.GetExport(handle, "Resource_GetExport"); Resource_GetDependenciesSize = (delegate* unmanaged[Cdecl]<nint, int>) NativeLibrary.GetExport(handle, "Resource_GetDependenciesSize"); Resource_GetDependencies = (delegate* unmanaged[Cdecl]<nint, nint[], int, void>) NativeLibrary.GetExport(handle, "Resource_GetDependencies"); Resource_GetDependantsSize = (delegate* unmanaged[Cdecl]<nint, int>) NativeLibrary.GetExport(handle, "Resource_GetDependantsSize"); Resource_GetDependants = (delegate* unmanaged[Cdecl]<nint, nint[], int, void>) NativeLibrary.GetExport(handle, "Resource_GetDependants"); Resource_SetExport = (delegate* unmanaged[Cdecl]<nint, nint, nint, nint, void>) NativeLibrary.GetExport(handle, "Resource_SetExport"); Resource_SetExports = (delegate* unmanaged[Cdecl]<nint, nint, nint[], nint[], int, void>) NativeLibrary.GetExport(handle, "Resource_SetExports"); Resource_GetPath = (delegate* unmanaged[Cdecl]<nint, nint*, void>) NativeLibrary.GetExport(handle, "Resource_GetPath"); Resource_GetName = (delegate* unmanaged[Cdecl]<nint, nint*, void>) NativeLibrary.GetExport(handle, "Resource_GetName"); Resource_GetMain = (delegate* unmanaged[Cdecl]<nint, nint*, void>) NativeLibrary.GetExport(handle, "Resource_GetMain"); Resource_GetType = (delegate* unmanaged[Cdecl]<nint, nint*, void>) NativeLibrary.GetExport(handle, "Resource_GetType"); Resource_IsStarted = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Resource_IsStarted"); Resource_Start = (delegate* unmanaged[Cdecl]<nint, void>) NativeLibrary.GetExport(handle, "Resource_Start"); Resource_Stop = (delegate* unmanaged[Cdecl]<nint, void>) NativeLibrary.GetExport(handle, "Resource_Stop"); Resource_GetImpl = (delegate* unmanaged[Cdecl]<nint, nint>) NativeLibrary.GetExport(handle, "Resource_GetImpl"); Resource_GetCSharpImpl = (delegate* unmanaged[Cdecl]<nint, nint>) NativeLibrary.GetExport(handle, "Resource_GetCSharpImpl"); Invoker_Create = (delegate* unmanaged[Cdecl]<nint, MValueFunctionCallback, nint>) NativeLibrary.GetExport(handle, "Invoker_Create"); Invoker_Destroy = (delegate* unmanaged[Cdecl]<nint, nint, void>) NativeLibrary.GetExport(handle, "Invoker_Destroy"); MValueConst_GetBool = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "MValueConst_GetBool"); MValueConst_GetInt = (delegate* unmanaged[Cdecl]<nint, long>) NativeLibrary.GetExport(handle, "MValueConst_GetInt"); MValueConst_GetUInt = (delegate* unmanaged[Cdecl]<nint, ulong>) NativeLibrary.GetExport(handle, "MValueConst_GetUInt"); MValueConst_GetDouble = (delegate* unmanaged[Cdecl]<nint, double>) NativeLibrary.GetExport(handle, "MValueConst_GetDouble"); MValueConst_GetString = (delegate* unmanaged[Cdecl]<nint, nint*, ulong*, byte>) NativeLibrary.GetExport(handle, "MValueConst_GetString"); MValueConst_GetListSize = (delegate* unmanaged[Cdecl]<nint, ulong>) NativeLibrary.GetExport(handle, "MValueConst_GetListSize"); MValueConst_GetList = (delegate* unmanaged[Cdecl]<nint, nint[], byte>) NativeLibrary.GetExport(handle, "MValueConst_GetList"); MValueConst_GetDictSize = (delegate* unmanaged[Cdecl]<nint, ulong>) NativeLibrary.GetExport(handle, "MValueConst_GetDictSize"); MValueConst_GetDict = (delegate* unmanaged[Cdecl]<nint, nint[], nint[], byte>) NativeLibrary.GetExport(handle, "MValueConst_GetDict"); MValueConst_GetEntity = (delegate* unmanaged[Cdecl]<nint, BaseObjectType*, nint>) NativeLibrary.GetExport(handle, "MValueConst_GetEntity"); MValueConst_CallFunction = (delegate* unmanaged[Cdecl]<nint, nint, nint[], ulong, nint>) NativeLibrary.GetExport(handle, "MValueConst_CallFunction"); MValueConst_GetVector3 = (delegate* unmanaged[Cdecl]<nint, Position*, void>) NativeLibrary.GetExport(handle, "MValueConst_GetVector3"); MValueConst_GetRGBA = (delegate* unmanaged[Cdecl]<nint, Rgba*, void>) NativeLibrary.GetExport(handle, "MValueConst_GetRGBA"); MValueConst_GetByteArray = (delegate* unmanaged[Cdecl]<nint, ulong, nint, void>) NativeLibrary.GetExport(handle, "MValueConst_GetByteArray"); MValueConst_GetByteArraySize = (delegate* unmanaged[Cdecl]<nint, ulong>) NativeLibrary.GetExport(handle, "MValueConst_GetByteArraySize"); MValueConst_AddRef = (delegate* unmanaged[Cdecl]<nint, void>) NativeLibrary.GetExport(handle, "MValueConst_AddRef"); MValueConst_RemoveRef = (delegate* unmanaged[Cdecl]<nint, void>) NativeLibrary.GetExport(handle, "MValueConst_RemoveRef"); MValueConst_Delete = (delegate* unmanaged[Cdecl]<nint, void>) NativeLibrary.GetExport(handle, "MValueConst_Delete"); MValueConst_GetType = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "MValueConst_GetType"); Server_LogInfo = (delegate* unmanaged[Cdecl]<nint, nint, void>) NativeLibrary.GetExport(handle, "Server_LogInfo"); Server_LogDebug = (delegate* unmanaged[Cdecl]<nint, nint, void>) NativeLibrary.GetExport(handle, "Server_LogDebug"); Server_LogWarning = (delegate* unmanaged[Cdecl]<nint, nint, void>) NativeLibrary.GetExport(handle, "Server_LogWarning"); Server_LogError = (delegate* unmanaged[Cdecl]<nint, nint, void>) NativeLibrary.GetExport(handle, "Server_LogError"); Server_LogColored = (delegate* unmanaged[Cdecl]<nint, nint, void>) NativeLibrary.GetExport(handle, "Server_LogColored"); Server_SubscribeEvent = (delegate* unmanaged[Cdecl]<nint, ushort, AltV.Net.Server.EventCallback, void>) NativeLibrary.GetExport(handle, "Server_SubscribeEvent"); Server_SubscribeTick = (delegate* unmanaged[Cdecl]<nint, AltV.Net.Server.TickCallback, void>) NativeLibrary.GetExport(handle, "Server_SubscribeTick"); Server_SubscribeCommand = (delegate* unmanaged[Cdecl]<nint, nint, AltV.Net.Server.CommandCallback, byte>) NativeLibrary.GetExport(handle, "Server_SubscribeCommand"); Server_FileExists = (delegate* unmanaged[Cdecl]<nint, nint, byte>) NativeLibrary.GetExport(handle, "Server_FileExists"); Server_FileRead = (delegate* unmanaged[Cdecl]<nint, nint, nint*, void>) NativeLibrary.GetExport(handle, "Server_FileRead"); Server_TriggerServerEvent = (delegate* unmanaged[Cdecl]<nint, nint, nint[], int, void>) NativeLibrary.GetExport(handle, "Server_TriggerServerEvent"); Server_TriggerClientEvent = (delegate* unmanaged[Cdecl]<nint, nint, nint, nint[], int, void>) NativeLibrary.GetExport(handle, "Server_TriggerClientEvent"); Server_TriggerClientEventForAll = (delegate* unmanaged[Cdecl]<nint, nint, nint[], int, void>) NativeLibrary.GetExport(handle, "Server_TriggerClientEventForAll"); Server_TriggerClientEventForSome = (delegate* unmanaged[Cdecl]<nint, nint[], int, nint, nint[], int, void>) NativeLibrary.GetExport(handle, "Server_TriggerClientEventForSome"); Server_CreateVehicle = (delegate* unmanaged[Cdecl]<nint, uint, Position, Rotation, ushort*, nint>) NativeLibrary.GetExport(handle, "Server_CreateVehicle"); Server_CreateCheckpoint = (delegate* unmanaged[Cdecl]<nint, byte, Position, float, float, Rgba, nint>) NativeLibrary.GetExport(handle, "Server_CreateCheckpoint"); Server_CreateBlip = (delegate* unmanaged[Cdecl]<nint, nint, byte, Position, nint>) NativeLibrary.GetExport(handle, "Server_CreateBlip"); Server_CreateBlipAttached = (delegate* unmanaged[Cdecl]<nint, nint, byte, nint, nint>) NativeLibrary.GetExport(handle, "Server_CreateBlipAttached"); Server_GetResource = (delegate* unmanaged[Cdecl]<nint, nint, nint>) NativeLibrary.GetExport(handle, "Server_GetResource"); Server_CreateVoiceChannel = (delegate* unmanaged[Cdecl]<nint, byte, float, nint>) NativeLibrary.GetExport(handle, "Server_CreateVoiceChannel"); Server_CreateColShapeCylinder = (delegate* unmanaged[Cdecl]<nint, Position, float, float, nint>) NativeLibrary.GetExport(handle, "Server_CreateColShapeCylinder"); Server_CreateColShapeSphere = (delegate* unmanaged[Cdecl]<nint, Position, float, nint>) NativeLibrary.GetExport(handle, "Server_CreateColShapeSphere"); Server_CreateColShapeCircle = (delegate* unmanaged[Cdecl]<nint, Position, float, nint>) NativeLibrary.GetExport(handle, "Server_CreateColShapeCircle"); Server_CreateColShapeCube = (delegate* unmanaged[Cdecl]<nint, Position, Position, nint>) NativeLibrary.GetExport(handle, "Server_CreateColShapeCube"); Server_CreateColShapeRectangle = (delegate* unmanaged[Cdecl]<nint, float, float, float, float, float, nint>) NativeLibrary.GetExport(handle, "Server_CreateColShapeRectangle"); Server_DestroyVehicle = (delegate* unmanaged[Cdecl]<nint, nint, void>) NativeLibrary.GetExport(handle, "Server_DestroyVehicle"); Server_DestroyBlip = (delegate* unmanaged[Cdecl]<nint, nint, void>) NativeLibrary.GetExport(handle, "Server_DestroyBlip"); Server_DestroyCheckpoint = (delegate* unmanaged[Cdecl]<nint, nint, void>) NativeLibrary.GetExport(handle, "Server_DestroyCheckpoint"); Server_DestroyVoiceChannel = (delegate* unmanaged[Cdecl]<nint, nint, void>) NativeLibrary.GetExport(handle, "Server_DestroyVoiceChannel"); Server_DestroyColShape = (delegate* unmanaged[Cdecl]<nint, nint, void>) NativeLibrary.GetExport(handle, "Server_DestroyColShape"); Server_GetNetTime = (delegate* unmanaged[Cdecl]<nint, int>) NativeLibrary.GetExport(handle, "Server_GetNetTime"); Server_GetRootDirectory = (delegate* unmanaged[Cdecl]<nint, nint*, void>) NativeLibrary.GetExport(handle, "Server_GetRootDirectory"); Server_GetPlayerCount = (delegate* unmanaged[Cdecl]<nint, ulong>) NativeLibrary.GetExport(handle, "Server_GetPlayerCount"); Server_GetPlayers = (delegate* unmanaged[Cdecl]<nint, nint[], ulong, void>) NativeLibrary.GetExport(handle, "Server_GetPlayers"); Server_GetVehicleCount = (delegate* unmanaged[Cdecl]<nint, ulong>) NativeLibrary.GetExport(handle, "Server_GetVehicleCount"); Server_GetVehicles = (delegate* unmanaged[Cdecl]<nint, nint[], ulong, void>) NativeLibrary.GetExport(handle, "Server_GetVehicles"); Server_GetEntityById = (delegate* unmanaged[Cdecl]<nint, ushort, byte*, nint>) NativeLibrary.GetExport(handle, "Server_GetEntityById"); Server_StartResource = (delegate* unmanaged[Cdecl]<nint, nint, void>) NativeLibrary.GetExport(handle, "Server_StartResource"); Server_StopResource = (delegate* unmanaged[Cdecl]<nint, nint, void>) NativeLibrary.GetExport(handle, "Server_StopResource"); Server_RestartResource = (delegate* unmanaged[Cdecl]<nint, nint, void>) NativeLibrary.GetExport(handle, "Server_RestartResource"); Server_GetMetaData = (delegate* unmanaged[Cdecl]<nint, nint, nint>) NativeLibrary.GetExport(handle, "Server_GetMetaData"); Server_SetMetaData = (delegate* unmanaged[Cdecl]<nint, nint, nint, void>) NativeLibrary.GetExport(handle, "Server_SetMetaData"); Server_HasMetaData = (delegate* unmanaged[Cdecl]<nint, nint, byte>) NativeLibrary.GetExport(handle, "Server_HasMetaData"); Server_DeleteMetaData = (delegate* unmanaged[Cdecl]<nint, nint, void>) NativeLibrary.GetExport(handle, "Server_DeleteMetaData"); Server_GetSyncedMetaData = (delegate* unmanaged[Cdecl]<nint, nint, nint>) NativeLibrary.GetExport(handle, "Server_GetSyncedMetaData"); Server_SetSyncedMetaData = (delegate* unmanaged[Cdecl]<nint, nint, nint, void>) NativeLibrary.GetExport(handle, "Server_SetSyncedMetaData"); Server_HasSyncedMetaData = (delegate* unmanaged[Cdecl]<nint, nint, byte>) NativeLibrary.GetExport(handle, "Server_HasSyncedMetaData"); Server_DeleteSyncedMetaData = (delegate* unmanaged[Cdecl]<nint, nint, void>) NativeLibrary.GetExport(handle, "Server_DeleteSyncedMetaData"); Core_CreateMValueNil = (delegate* unmanaged[Cdecl]<nint, nint>) NativeLibrary.GetExport(handle, "Core_CreateMValueNil"); Core_CreateMValueBool = (delegate* unmanaged[Cdecl]<nint, byte, nint>) NativeLibrary.GetExport(handle, "Core_CreateMValueBool"); Core_CreateMValueInt = (delegate* unmanaged[Cdecl]<nint, long, nint>) NativeLibrary.GetExport(handle, "Core_CreateMValueInt"); Core_CreateMValueUInt = (delegate* unmanaged[Cdecl]<nint, ulong, nint>) NativeLibrary.GetExport(handle, "Core_CreateMValueUInt"); Core_CreateMValueDouble = (delegate* unmanaged[Cdecl]<nint, double, nint>) NativeLibrary.GetExport(handle, "Core_CreateMValueDouble"); Core_CreateMValueString = (delegate* unmanaged[Cdecl]<nint, nint, nint>) NativeLibrary.GetExport(handle, "Core_CreateMValueString"); Core_CreateMValueList = (delegate* unmanaged[Cdecl]<nint, nint[], ulong, nint>) NativeLibrary.GetExport(handle, "Core_CreateMValueList"); Core_CreateMValueDict = (delegate* unmanaged[Cdecl]<nint, nint[], nint[], ulong, nint>) NativeLibrary.GetExport(handle, "Core_CreateMValueDict"); Core_CreateMValueCheckpoint = (delegate* unmanaged[Cdecl]<nint, nint, nint>) NativeLibrary.GetExport(handle, "Core_CreateMValueCheckpoint"); Core_CreateMValueBlip = (delegate* unmanaged[Cdecl]<nint, nint, nint>) NativeLibrary.GetExport(handle, "Core_CreateMValueBlip"); Core_CreateMValueVoiceChannel = (delegate* unmanaged[Cdecl]<nint, nint, nint>) NativeLibrary.GetExport(handle, "Core_CreateMValueVoiceChannel"); Core_CreateMValuePlayer = (delegate* unmanaged[Cdecl]<nint, nint, nint>) NativeLibrary.GetExport(handle, "Core_CreateMValuePlayer"); Core_CreateMValueVehicle = (delegate* unmanaged[Cdecl]<nint, nint, nint>) NativeLibrary.GetExport(handle, "Core_CreateMValueVehicle"); Core_CreateMValueFunction = (delegate* unmanaged[Cdecl]<nint, nint, nint>) NativeLibrary.GetExport(handle, "Core_CreateMValueFunction"); Core_CreateMValueVector3 = (delegate* unmanaged[Cdecl]<nint, Position, nint>) NativeLibrary.GetExport(handle, "Core_CreateMValueVector3"); Core_CreateMValueRgba = (delegate* unmanaged[Cdecl]<nint, Rgba, nint>) NativeLibrary.GetExport(handle, "Core_CreateMValueRgba"); Core_CreateMValueByteArray = (delegate* unmanaged[Cdecl]<nint, ulong, nint, nint>) NativeLibrary.GetExport(handle, "Core_CreateMValueByteArray"); Core_IsDebug = (delegate* unmanaged[Cdecl]<nint, byte>) NativeLibrary.GetExport(handle, "Core_IsDebug"); Core_GetVersion = (delegate* unmanaged[Cdecl]<nint, nint*, ulong*, void>) NativeLibrary.GetExport(handle, "Core_GetVersion"); Core_GetBranch = (delegate* unmanaged[Cdecl]<nint, nint*, ulong*, void>) NativeLibrary.GetExport(handle, "Core_GetBranch"); Core_SetPassword = (delegate* unmanaged[Cdecl]<nint, nint, void>) NativeLibrary.GetExport(handle, "Core_SetPassword"); FreeUIntArray = (delegate* unmanaged[Cdecl]<UIntArray*, void>) NativeLibrary.GetExport(handle, "FreeUIntArray"); FreeCharArray = (delegate* unmanaged[Cdecl]<nint, void>) NativeLibrary.GetExport(handle, "FreeCharArray"); } } }
107.155513
204
0.717874
[ "MIT" ]
FabianTerhorst/coreclr-module
api/AltV.Net/Native/Library.cs
168,127
C#
using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using WebApplication1.Models; namespace WebApplication1 { public class Startup { public Startup(IConfiguration configuration) { Configuration = configuration; } public IConfiguration Configuration { get; } // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { string connection = Configuration.GetConnectionString("DefaultConnection"); services.AddDbContext<UserContext>(options => options.UseSqlServer(connection)); services.AddMvc(); } // 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.UseMvc(); } } }
31.230769
106
0.666667
[ "MIT" ]
shimanov/CRUDApi
WebApplication1/Startup.cs
1,220
C#
// ---------------------------------------------------------------------------------- // // Copyright Microsoft Corporation // 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. // ---------------------------------------------------------------------------------- using Microsoft.Azure.Commands.Common.Authentication; using Microsoft.Azure.Management.Monitor; using Microsoft.Azure.Management.Monitor.Management; using Microsoft.Azure.Test.HttpRecorder; using Microsoft.WindowsAzure.Commands.ScenarioTest; using Microsoft.WindowsAzure.Commands.Test.Utilities.Common; using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using RestTestFramework = Microsoft.Rest.ClientRuntime.Azure.TestFramework; namespace Microsoft.Azure.Commands.Insights.Test.ScenarioTests { public sealed class TestsController : RMTestBase { private readonly EnvironmentSetupHelper _helper; public IMonitorClient MonitorClient { get; private set; } public IMonitorManagementClient MonitorManagementClient { get; private set; } public static TestsController NewInstance => new TestsController(); public TestsController() { _helper = new EnvironmentSetupHelper(); } public void RunPsTest(ServiceManagemenet.Common.Models.XunitTracingInterceptor logger, params string[] scripts) { var sf = new StackTrace().GetFrame(1); var callingClassType = sf.GetMethod().ReflectedType?.ToString(); var mockName = sf.GetMethod().Name; _helper.TracingInterceptor = logger; RunPsTestWorkflow( () => scripts, // no custom cleanup null, callingClassType, mockName); } public void RunPsTest(params string[] scripts) { var sf = new StackTrace().GetFrame(1); var callingClassType = sf.GetMethod().ReflectedType?.ToString(); var mockName = sf.GetMethod().Name; RunPsTestWorkflow( () => scripts, // no custom cleanup null, callingClassType, mockName); } public void RunPsTestWorkflow( Func<string[]> scriptBuilder, Action cleanup, string callingClassType, string mockName) { var providers = new Dictionary<string, string>() { { "Microsoft.Insights", null } }; var providersToIgnore = new Dictionary<string, string>(); providersToIgnore.Add("Microsoft.Azure.Management.Resources.ResourceManagementClient", "2016-02-01"); HttpMockServer.Matcher = new PermissiveRecordMatcherWithApiExclusion(ignoreResourcesClient: true, providers: providers, userAgents: providersToIgnore); HttpMockServer.RecordsDirectory = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "SessionRecords"); using (RestTestFramework.MockContext context = RestTestFramework.MockContext.Start(callingClassType, mockName)) { SetupManagementClients(context); _helper.SetupEnvironment(AzureModule.AzureResourceManager); var callingClassName = callingClassType .Split(new[] { "." }, StringSplitOptions.RemoveEmptyEntries) .Last(); _helper.SetupModules(AzureModule.AzureResourceManager, _helper.RMProfileModule, _helper.GetRMModulePath("AzureRM.Insights.psd1"), "ScenarioTests\\Common.ps1", "ScenarioTests\\" + callingClassName + ".ps1"); try { if (scriptBuilder != null) { var psScripts = scriptBuilder(); if (psScripts != null) { _helper.RunPowerShellTest(psScripts); } } } finally { cleanup?.Invoke(); } } } private void SetupManagementClients(RestTestFramework.MockContext context) { if (HttpMockServer.Mode == HttpRecorderMode.Record) { // This allows the use of a particular subscription if the user is associated to several // "TEST_CSM_ORGID_AUTHENTICATION=SubscriptionId=<subscription-id>" string subId = Environment.GetEnvironmentVariable("TEST_CSM_ORGID_AUTHENTICATION"); RestTestFramework.TestEnvironment environment = new RestTestFramework.TestEnvironment(connectionString: subId); this.MonitorClient = this.GetMonitorClient(context: context, env: environment); this.MonitorManagementClient = this.GetInsightsManagementClient(context: context, env: environment); } else if (HttpMockServer.Mode == HttpRecorderMode.Playback) { this.MonitorClient = this.GetMonitorClient(context: context, env: null); this.MonitorManagementClient = this.GetInsightsManagementClient(context: context, env: null); } _helper.SetupManagementClients( this.MonitorClient, this.MonitorManagementClient); } private IMonitorClient GetMonitorClient(RestTestFramework.MockContext context, RestTestFramework.TestEnvironment env) { // currentEnvironment: RestTestFramework.TestEnvironmentFactory.GetTestEnvironment()); return env != null ? context.GetServiceClient<MonitorClient>(currentEnvironment: env) : context.GetServiceClient<MonitorClient>(); } private IMonitorManagementClient GetInsightsManagementClient(RestTestFramework.MockContext context, RestTestFramework.TestEnvironment env) { return env != null ? context.GetServiceClient<MonitorManagementClient>(currentEnvironment: env) : context.GetServiceClient<MonitorManagementClient>(); } } }
43.32716
164
0.591395
[ "MIT" ]
Philippe-Morin/azure-powershell
src/ResourceManager/Insights/Commands.Insights.Test/ScenarioTests/TestsController.cs
6,860
C#
using System.Linq; using Microsoft.AspNetCore.Identity; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Options; using Abp.Authorization; using Abp.Authorization.Roles; using Abp.Authorization.Users; using Abp.MultiTenancy; using Test.Authorization; using Test.Authorization.Roles; using Test.Authorization.Users; namespace Test.EntityFrameworkCore.Seed.Tenants { public class TenantRoleAndUserBuilder { private readonly TestDbContext _context; private readonly int _tenantId; public TenantRoleAndUserBuilder(TestDbContext context, int tenantId) { _context = context; _tenantId = tenantId; } public void Create() { CreateRolesAndUsers(); } private void CreateRolesAndUsers() { // Admin role var adminRole = _context.Roles.IgnoreQueryFilters().FirstOrDefault(r => r.TenantId == _tenantId && r.Name == StaticRoleNames.Tenants.Admin); if (adminRole == null) { adminRole = _context.Roles.Add(new Role(_tenantId, StaticRoleNames.Tenants.Admin, StaticRoleNames.Tenants.Admin) { IsStatic = true }).Entity; _context.SaveChanges(); } // Grant all permissions to admin role var grantedPermissions = _context.Permissions.IgnoreQueryFilters() .OfType<RolePermissionSetting>() .Where(p => p.TenantId == _tenantId && p.RoleId == adminRole.Id) .Select(p => p.Name) .ToList(); var permissions = PermissionFinder .GetAllPermissions(new TestAuthorizationProvider()) .Where(p => p.MultiTenancySides.HasFlag(MultiTenancySides.Tenant) && !grantedPermissions.Contains(p.Name)) .ToList(); if (permissions.Any()) { _context.Permissions.AddRange( permissions.Select(permission => new RolePermissionSetting { TenantId = _tenantId, Name = permission.Name, IsGranted = true, RoleId = adminRole.Id }) ); _context.SaveChanges(); } // Admin user var adminUser = _context.Users.IgnoreQueryFilters().FirstOrDefault(u => u.TenantId == _tenantId && u.UserName == AbpUserBase.AdminUserName); if (adminUser == null) { adminUser = User.CreateTenantAdminUser(_tenantId, "admin@defaulttenant.com"); adminUser.Password = new PasswordHasher<User>(new OptionsWrapper<PasswordHasherOptions>(new PasswordHasherOptions())).HashPassword(adminUser, "123qwe"); adminUser.IsEmailConfirmed = true; adminUser.IsActive = true; _context.Users.Add(adminUser); _context.SaveChanges(); // Assign Admin role to admin user _context.UserRoles.Add(new UserRole(_tenantId, adminUser.Id, adminRole.Id)); _context.SaveChanges(); } } } }
36.122222
168
0.580437
[ "MIT" ]
Tenglingfeng/ABPMPACore.PhoneBook
aspnet-core/src/Test.EntityFrameworkCore/EntityFrameworkCore/Seed/Tenants/TenantRoleAndUserBuilder.cs
3,253
C#
using System.Collections.Generic; namespace DashReportViewer.Shared.ReportContent { public class TableContent : BaseReportContent { public IEnumerable<object> Content { get; set; } public List<string> Columns { get; set; } } }
25.6
56
0.695313
[ "MIT" ]
ZuechB/DashReportViewer
DashReportViewer.Shared/ReportContent/TableContent.cs
258
C#
using System.Reactive.Linq; using System.Threading.Tasks; using CoreGraphics; using Toggl.Daneel.Cells; using Toggl.Daneel.Presentation.Attributes; using Toggl.Daneel.ViewSources; using Toggl.Foundation.MvvmCross.ViewModels; using UIKit; namespace Toggl.Daneel.ViewControllers { [ModalDialogPresentation] public sealed partial class SelectDefaultWorkspaceViewController : ReactiveViewController<SelectDefaultWorkspaceViewModel> { private const int heightAboveTableView = 127; private const int width = 288; private readonly int maxHeight = UIScreen.MainScreen.Bounds.Width > 320 ? 627 : 528; public SelectDefaultWorkspaceViewController() : base(nameof(SelectDefaultWorkspaceViewController)) { } public override void ViewDidLoad() { base.ViewDidLoad(); View.ClipsToBounds = true; WorkspacesTableView.RegisterNibForCellReuse(SelectDefaultWorkspaceTableViewCell.Nib, SelectDefaultWorkspaceTableViewCell.Identifier); var tableViewSource = new ListTableViewSource<SelectableWorkspaceViewModel, SelectDefaultWorkspaceTableViewCell>( ViewModel.Workspaces, SelectDefaultWorkspaceTableViewCell.Identifier ); tableViewSource.OnItemTapped = onWorkspaceTapped; WorkspacesTableView.Source = tableViewSource; WorkspacesTableView.TableFooterView = new UIKit.UIView(new CoreGraphics.CGRect(0, 0, UIKit.UIScreen.MainScreen.Bounds.Width, 24)); } public override void ViewDidLayoutSubviews() { base.ViewDidLayoutSubviews(); setDialogSize(); } private async Task onWorkspaceTapped(SelectableWorkspaceViewModel workspace) { await ViewModel.SelectWorkspace.Execute(workspace); } private void setDialogSize() { var targetHeight = calculateTargetHeight(); PreferredContentSize = new CGSize( width, targetHeight > maxHeight ? maxHeight : targetHeight ); //Implementation in ModalPresentationController View.Frame = PresentationController.FrameOfPresentedViewInContainerView; WorkspacesTableView.ScrollEnabled = targetHeight > maxHeight; } private int calculateTargetHeight() => heightAboveTableView + (int)WorkspacesTableView.ContentSize.Height; } }
36.028986
145
0.689059
[ "BSD-3-Clause" ]
AzureMentor/mobileapp
Toggl.Daneel/ViewControllers/SelectDefaultWorkspaceViewController.cs
2,488
C#
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Collections.Generic; using System.Text.Json.Serialization; using System.Text.Json.Serialization.Metadata; namespace System.Text.Json.SourceGeneration.Tests { public interface ITestContext { public JsonSourceGenerationMode JsonSourceGenerationMode { get; } public bool IsIncludeFieldsEnabled { get; } public JsonTypeInfo<Location> Location { get; } public JsonTypeInfo<NumberTypes> NumberTypes { get; } public JsonTypeInfo<RepeatedTypes.Location> RepeatedLocation { get; } public JsonTypeInfo<ActiveOrUpcomingEvent> ActiveOrUpcomingEvent { get; } public JsonTypeInfo<CampaignSummaryViewModel> CampaignSummaryViewModel { get; } public JsonTypeInfo<IndexViewModel> IndexViewModel { get; } public JsonTypeInfo<WeatherForecastWithPOCOs> WeatherForecastWithPOCOs { get; } public JsonTypeInfo<EmptyPoco> EmptyPoco { get; } public JsonTypeInfo<HighLowTemps> HighLowTemps { get; } public JsonTypeInfo<MyType> MyType { get; } public JsonTypeInfo<MyType2> MyType2 { get; } public JsonTypeInfo<MyTypeWithCallbacks> MyTypeWithCallbacks { get; } public JsonTypeInfo<MyTypeWithPropertyOrdering> MyTypeWithPropertyOrdering { get; } public JsonTypeInfo<MyIntermediateType> MyIntermediateType { get; } public JsonTypeInfo<HighLowTempsImmutable> HighLowTempsImmutable { get; } public JsonTypeInfo<HighLowTempsRecord> HighLowTempsRecord { get; } public JsonTypeInfo<RealWorldContextTests.MyNestedClass> MyNestedClass { get; } public JsonTypeInfo<RealWorldContextTests.MyNestedClass.MyNestedNestedClass> MyNestedNestedClass { get; } public JsonTypeInfo<object[]> ObjectArray { get; } public JsonTypeInfo<byte[]> ByteArray { get; } public JsonTypeInfo<string> String { get; } public JsonTypeInfo<(string Label1, int Label2, bool)> ValueTupleStringInt32Boolean { get; } public JsonTypeInfo<JsonDocument> JsonDocument { get; } public JsonTypeInfo<JsonElement> JsonElement { get; } public JsonTypeInfo<RealWorldContextTests.ClassWithEnumAndNullable> ClassWithEnumAndNullable { get; } public JsonTypeInfo<RealWorldContextTests.ClassWithNullableProperties> ClassWithNullableProperties { get; } public JsonTypeInfo<ClassWithCustomConverter> ClassWithCustomConverter { get; } public JsonTypeInfo<StructWithCustomConverter> StructWithCustomConverter { get; } public JsonTypeInfo<ClassWithCustomConverterFactory> ClassWithCustomConverterFactory { get; } public JsonTypeInfo<StructWithCustomConverterFactory> StructWithCustomConverterFactory { get; } public JsonTypeInfo<ClassWithCustomConverterProperty> ClassWithCustomConverterProperty { get; } public JsonTypeInfo<StructWithCustomConverterProperty> StructWithCustomConverterProperty { get; } public JsonTypeInfo<ClassWithCustomConverterFactoryProperty> ClassWithCustomConverterFactoryProperty { get; } public JsonTypeInfo<StructWithCustomConverterFactoryProperty> StructWithCustomConverterFactoryProperty { get; } public JsonTypeInfo<ClassWithBadCustomConverter> ClassWithBadCustomConverter { get; } public JsonTypeInfo<StructWithBadCustomConverter> StructWithBadCustomConverter { get; } public JsonTypeInfo<PersonStruct?> NullablePersonStruct { get; } public JsonTypeInfo<TypeWithValidationAttributes> TypeWithValidationAttributes { get; } public JsonTypeInfo<TypeWithDerivedAttribute> TypeWithDerivedAttribute { get; } public JsonTypeInfo<PolymorphicClass> PolymorphicClass { get; } } internal partial class JsonContext : JsonSerializerContext { private static JsonSerializerOptions s_defaultOptions { get; } = new JsonSerializerOptions() { DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingDefault, PropertyNamingPolicy = JsonNamingPolicy.CamelCase }; private static JsonContext s_defaultContext; public static JsonContext Default => s_defaultContext ??= new JsonContext(new JsonSerializerOptions(s_defaultOptions)); public JsonContext() : base(null) { } public JsonContext(JsonSerializerOptions options) : base(options) { } protected override JsonSerializerOptions? GeneratedSerializerOptions => s_defaultOptions; public override JsonTypeInfo GetTypeInfo(global::System.Type type) { if (type == typeof(JsonMessage)) { return JsonMessage; } return null!; } private JsonTypeInfo<JsonMessage> _JsonMessage; public JsonTypeInfo<JsonMessage> JsonMessage { get { if (_JsonMessage == null) { JsonObjectInfoValues<JsonMessage> objectInfo = new() { ObjectCreator = static () => new JsonMessage(), SerializeHandler = JsonMessageSerialize }; _JsonMessage = JsonMetadataServices.CreateObjectInfo<JsonMessage>(Options, objectInfo); } return _JsonMessage; } } private static void JsonMessageSerialize(Utf8JsonWriter writer, JsonMessage value) => throw new NotImplementedException(); } [JsonSerializable(typeof(Dictionary<string, string>))] [JsonSerializable(typeof(Dictionary<int, string>))] [JsonSerializable(typeof(Dictionary<string, JsonMessage>))] internal partial class DictionaryTypeContext : JsonSerializerContext { } [JsonSerializable(typeof(JsonMessage))] public partial class PublicContext : JsonSerializerContext { } }
50.201681
130
0.711751
[ "MIT" ]
Ali-YousefiTelori/runtime
src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/ContextClasses.cs
5,976
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 application-autoscaling-2016-02-06.normal.json service model. */ using System; using System.Collections.Generic; using System.Xml.Serialization; using System.Text; using System.IO; using System.Net; using Amazon.Runtime; using Amazon.Runtime.Internal; namespace Amazon.ApplicationAutoScaling.Model { /// <summary> /// Container for the parameters to the DescribeScalingActivities operation. /// Provides descriptive information about the scaling activities in the specified namespace /// from the previous six weeks. /// /// /// <para> /// You can filter the results using <code>ResourceId</code> and <code>ScalableDimension</code>. /// </para> /// </summary> public partial class DescribeScalingActivitiesRequest : AmazonApplicationAutoScalingRequest { private int? _maxResults; private string _nextToken; private string _resourceId; private ScalableDimension _scalableDimension; private ServiceNamespace _serviceNamespace; /// <summary> /// Gets and sets the property MaxResults. /// <para> /// The maximum number of scalable targets. This value can be between 1 and 50. The default /// value is 50. /// </para> /// /// <para> /// If this parameter is used, the operation returns up to <code>MaxResults</code> results /// at a time, along with a <code>NextToken</code> value. To get the next set of results, /// include the <code>NextToken</code> value in a subsequent call. If this parameter is /// not used, the operation returns up to 50 results and a <code>NextToken</code> value, /// if applicable. /// </para> /// </summary> public int MaxResults { get { return this._maxResults.GetValueOrDefault(); } set { this._maxResults = value; } } // Check to see if MaxResults property is set internal bool IsSetMaxResults() { return this._maxResults.HasValue; } /// <summary> /// Gets and sets the property NextToken. /// <para> /// The token for the next set of results. /// </para> /// </summary> public string NextToken { get { return this._nextToken; } set { this._nextToken = value; } } // Check to see if NextToken property is set internal bool IsSetNextToken() { return this._nextToken != null; } /// <summary> /// Gets and sets the property ResourceId. /// <para> /// The identifier of the resource associated with the scaling activity. This string consists /// of the resource type and unique identifier. If you specify a scalable dimension, you /// must also specify a resource ID. /// </para> /// <ul> <li> /// <para> /// ECS service - The resource type is <code>service</code> and the unique identifier /// is the cluster name and service name. Example: <code>service/default/sample-webapp</code>. /// </para> /// </li> <li> /// <para> /// Spot Fleet request - The resource type is <code>spot-fleet-request</code> and the /// unique identifier is the Spot Fleet request ID. Example: <code>spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE</code>. /// </para> /// </li> <li> /// <para> /// EMR cluster - The resource type is <code>instancegroup</code> and the unique identifier /// is the cluster ID and instance group ID. Example: <code>instancegroup/j-2EEZNYKUA1NTV/ig-1791Y4E1L8YI0</code>. /// </para> /// </li> <li> /// <para> /// AppStream 2.0 fleet - The resource type is <code>fleet</code> and the unique identifier /// is the fleet name. Example: <code>fleet/sample-fleet</code>. /// </para> /// </li> <li> /// <para> /// DynamoDB table - The resource type is <code>table</code> and the unique identifier /// is the table name. Example: <code>table/my-table</code>. /// </para> /// </li> <li> /// <para> /// DynamoDB global secondary index - The resource type is <code>index</code> and the /// unique identifier is the index name. Example: <code>table/my-table/index/my-table-index</code>. /// </para> /// </li> <li> /// <para> /// Aurora DB cluster - The resource type is <code>cluster</code> and the unique identifier /// is the cluster name. Example: <code>cluster:my-db-cluster</code>. /// </para> /// </li> <li> /// <para> /// Amazon SageMaker endpoint variant - The resource type is <code>variant</code> and /// the unique identifier is the resource ID. Example: <code>endpoint/my-end-point/variant/KMeansClustering</code>. /// </para> /// </li> <li> /// <para> /// Custom resources are not supported with a resource type. This parameter must specify /// the <code>OutputValue</code> from the CloudFormation template stack used to access /// the resources. The unique identifier is defined by the service provider. More information /// is available in our <a href="https://github.com/aws/aws-auto-scaling-custom-resource">GitHub /// repository</a>. /// </para> /// </li> <li> /// <para> /// Amazon Comprehend document classification endpoint - The resource type and unique /// identifier are specified using the endpoint ARN. Example: <code>arn:aws:comprehend:us-west-2:123456789012:document-classifier-endpoint/EXAMPLE</code>. /// </para> /// </li> <li> /// <para> /// Lambda provisioned concurrency - The resource type is <code>function</code> and the /// unique identifier is the function name with a function version or alias name suffix /// that is not <code>$LATEST</code>. Example: <code>function:my-function:prod</code> /// or <code>function:my-function:1</code>. /// </para> /// </li> <li> /// <para> /// Amazon Keyspaces table - The resource type is <code>table</code> and the unique identifier /// is the table name. Example: <code>keyspace/mykeyspace/table/mytable</code>. /// </para> /// </li> </ul> /// </summary> [AWSProperty(Min=1, Max=1600)] public string ResourceId { get { return this._resourceId; } set { this._resourceId = value; } } // Check to see if ResourceId property is set internal bool IsSetResourceId() { return this._resourceId != null; } /// <summary> /// Gets and sets the property ScalableDimension. /// <para> /// The scalable dimension. This string consists of the service namespace, resource type, /// and scaling property. If you specify a scalable dimension, you must also specify a /// resource ID. /// </para> /// <ul> <li> /// <para> /// <code>ecs:service:DesiredCount</code> - The desired task count of an ECS service. /// </para> /// </li> <li> /// <para> /// <code>ec2:spot-fleet-request:TargetCapacity</code> - The target capacity of a Spot /// Fleet request. /// </para> /// </li> <li> /// <para> /// <code>elasticmapreduce:instancegroup:InstanceCount</code> - The instance count of /// an EMR Instance Group. /// </para> /// </li> <li> /// <para> /// <code>appstream:fleet:DesiredCapacity</code> - The desired capacity of an AppStream /// 2.0 fleet. /// </para> /// </li> <li> /// <para> /// <code>dynamodb:table:ReadCapacityUnits</code> - The provisioned read capacity for /// a DynamoDB table. /// </para> /// </li> <li> /// <para> /// <code>dynamodb:table:WriteCapacityUnits</code> - The provisioned write capacity for /// a DynamoDB table. /// </para> /// </li> <li> /// <para> /// <code>dynamodb:index:ReadCapacityUnits</code> - The provisioned read capacity for /// a DynamoDB global secondary index. /// </para> /// </li> <li> /// <para> /// <code>dynamodb:index:WriteCapacityUnits</code> - The provisioned write capacity for /// a DynamoDB global secondary index. /// </para> /// </li> <li> /// <para> /// <code>rds:cluster:ReadReplicaCount</code> - The count of Aurora Replicas in an Aurora /// DB cluster. Available for Aurora MySQL-compatible edition and Aurora PostgreSQL-compatible /// edition. /// </para> /// </li> <li> /// <para> /// <code>sagemaker:variant:DesiredInstanceCount</code> - The number of EC2 instances /// for an Amazon SageMaker model endpoint variant. /// </para> /// </li> <li> /// <para> /// <code>custom-resource:ResourceType:Property</code> - The scalable dimension for a /// custom resource provided by your own application or service. /// </para> /// </li> <li> /// <para> /// <code>comprehend:document-classifier-endpoint:DesiredInferenceUnits</code> - The /// number of inference units for an Amazon Comprehend document classification endpoint. /// </para> /// </li> <li> /// <para> /// <code>lambda:function:ProvisionedConcurrency</code> - The provisioned concurrency /// for a Lambda function. /// </para> /// </li> <li> /// <para> /// <code>cassandra:table:ReadCapacityUnits</code> - The provisioned read capacity for /// an Amazon Keyspaces table. /// </para> /// </li> <li> /// <para> /// <code>cassandra:table:WriteCapacityUnits</code> - The provisioned write capacity /// for an Amazon Keyspaces table. /// </para> /// </li> </ul> /// </summary> public ScalableDimension ScalableDimension { get { return this._scalableDimension; } set { this._scalableDimension = value; } } // Check to see if ScalableDimension property is set internal bool IsSetScalableDimension() { return this._scalableDimension != null; } /// <summary> /// Gets and sets the property ServiceNamespace. /// <para> /// The namespace of the AWS service that provides the resource. For a resource provided /// by your own application or service, use <code>custom-resource</code> instead. /// </para> /// </summary> [AWSProperty(Required=true)] public ServiceNamespace ServiceNamespace { get { return this._serviceNamespace; } set { this._serviceNamespace = value; } } // Check to see if ServiceNamespace property is set internal bool IsSetServiceNamespace() { return this._serviceNamespace != null; } } }
40.587248
162
0.577594
[ "Apache-2.0" ]
atpyatt/aws-sdk-net
sdk/src/Services/ApplicationAutoScaling/Generated/Model/DescribeScalingActivitiesRequest.cs
12,095
C#
namespace Cik.MagazineWeb.WebApp.Controllers { using System.Threading.Tasks; using System.Web; using System.Web.Mvc; using Cik.MagazineWeb.WebApp.Models; using Microsoft.AspNet.Identity; using Microsoft.AspNet.Identity.EntityFramework; using Microsoft.Owin.Security; [Authorize] public class AccountController : Controller { public AccountController() : this(new UserManager<ApplicationUser>(new UserStore<ApplicationUser>(new ApplicationDbContext()))) { } public AccountController(UserManager<ApplicationUser> userManager) { this.UserManager = userManager; } public UserManager<ApplicationUser> UserManager { get; private set; } // // GET: /Account/Login [AllowAnonymous] public ActionResult Login(string returnUrl) { this.ViewBag.ReturnUrl = returnUrl; return this.View(); } // // POST: /Account/Login [HttpPost] [AllowAnonymous] [ValidateAntiForgeryToken] public async Task<ActionResult> Login(LoginViewModel model, string returnUrl) { if (this.ModelState.IsValid) { var user = await this.UserManager.FindAsync(model.UserName, model.Password); if (user != null) { await this.SignInAsync(user, model.RememberMe); return this.RedirectToLocal(returnUrl); } else { this.ModelState.AddModelError("", "Invalid username or password."); } } // If we got this far, something failed, redisplay form return this.View(model); } // // GET: /Account/Register [AllowAnonymous] public ActionResult Register() { return this.View(); } // // POST: /Account/Register [HttpPost] [AllowAnonymous] [ValidateAntiForgeryToken] public async Task<ActionResult> Register(RegisterViewModel model) { if (this.ModelState.IsValid) { var user = new ApplicationUser() { UserName = model.UserName }; var result = await this.UserManager.CreateAsync(user, model.Password); if (result.Succeeded) { await this.SignInAsync(user, isPersistent: false); return this.RedirectToAction("Index", "Home"); } else { this.AddErrors(result); } } // If we got this far, something failed, redisplay form return this.View(model); } // // POST: /Account/Disassociate [HttpPost] [ValidateAntiForgeryToken] public async Task<ActionResult> Disassociate(string loginProvider, string providerKey) { ManageMessageId? message = null; IdentityResult result = await this.UserManager.RemoveLoginAsync(this.User.Identity.GetUserId(), new UserLoginInfo(loginProvider, providerKey)); if (result.Succeeded) { message = ManageMessageId.RemoveLoginSuccess; } else { message = ManageMessageId.Error; } return this.RedirectToAction("Manage", new { Message = message }); } // // GET: /Account/Manage public ActionResult Manage(ManageMessageId? message) { this.ViewBag.StatusMessage = message == ManageMessageId.ChangePasswordSuccess ? "Your password has been changed." : message == ManageMessageId.SetPasswordSuccess ? "Your password has been set." : message == ManageMessageId.RemoveLoginSuccess ? "The external login was removed." : message == ManageMessageId.Error ? "An error has occurred." : ""; this.ViewBag.HasLocalPassword = this.HasPassword(); this.ViewBag.ReturnUrl = this.Url.Action("Manage"); return this.View(); } // // POST: /Account/Manage [HttpPost] [ValidateAntiForgeryToken] public async Task<ActionResult> Manage(ManageUserViewModel model) { bool hasPassword = this.HasPassword(); this.ViewBag.HasLocalPassword = hasPassword; this.ViewBag.ReturnUrl = this.Url.Action("Manage"); if (hasPassword) { if (this.ModelState.IsValid) { IdentityResult result = await this.UserManager.ChangePasswordAsync(this.User.Identity.GetUserId(), model.OldPassword, model.NewPassword); if (result.Succeeded) { return this.RedirectToAction("Manage", new { Message = ManageMessageId.ChangePasswordSuccess }); } else { this.AddErrors(result); } } } else { // User does not have a password so remove any validation errors caused by a missing OldPassword field ModelState state = this.ModelState["OldPassword"]; if (state != null) { state.Errors.Clear(); } if (this.ModelState.IsValid) { IdentityResult result = await this.UserManager.AddPasswordAsync(this.User.Identity.GetUserId(), model.NewPassword); if (result.Succeeded) { return this.RedirectToAction("Manage", new { Message = ManageMessageId.SetPasswordSuccess }); } else { this.AddErrors(result); } } } // If we got this far, something failed, redisplay form return this.View(model); } // // POST: /Account/ExternalLogin [HttpPost] [AllowAnonymous] [ValidateAntiForgeryToken] public ActionResult ExternalLogin(string provider, string returnUrl) { // Request a redirect to the external login provider return new ChallengeResult(provider, this.Url.Action("ExternalLoginCallback", "Account", new { ReturnUrl = returnUrl })); } // // GET: /Account/ExternalLoginCallback [AllowAnonymous] public async Task<ActionResult> ExternalLoginCallback(string returnUrl) { var loginInfo = await this.AuthenticationManager.GetExternalLoginInfoAsync(); if (loginInfo == null) { return this.RedirectToAction("Login"); } // Sign in the user with this external login provider if the user already has a login var user = await this.UserManager.FindAsync(loginInfo.Login); if (user != null) { await this.SignInAsync(user, isPersistent: false); return this.RedirectToLocal(returnUrl); } else { // If the user does not have an account, then prompt the user to create an account this.ViewBag.ReturnUrl = returnUrl; this.ViewBag.LoginProvider = loginInfo.Login.LoginProvider; return this.View("ExternalLoginConfirmation", new ExternalLoginConfirmationViewModel { UserName = loginInfo.DefaultUserName }); } } // // POST: /Account/LinkLogin [HttpPost] [ValidateAntiForgeryToken] public ActionResult LinkLogin(string provider) { // Request a redirect to the external login provider to link a login for the current user return new ChallengeResult(provider, this.Url.Action("LinkLoginCallback", "Account"), this.User.Identity.GetUserId()); } // // GET: /Account/LinkLoginCallback public async Task<ActionResult> LinkLoginCallback() { var loginInfo = await this.AuthenticationManager.GetExternalLoginInfoAsync(XsrfKey, this.User.Identity.GetUserId()); if (loginInfo == null) { return this.RedirectToAction("Manage", new { Message = ManageMessageId.Error }); } var result = await this.UserManager.AddLoginAsync(this.User.Identity.GetUserId(), loginInfo.Login); if (result.Succeeded) { return this.RedirectToAction("Manage"); } return this.RedirectToAction("Manage", new { Message = ManageMessageId.Error }); } // // POST: /Account/ExternalLoginConfirmation [HttpPost] [AllowAnonymous] [ValidateAntiForgeryToken] public async Task<ActionResult> ExternalLoginConfirmation(ExternalLoginConfirmationViewModel model, string returnUrl) { if (this.User.Identity.IsAuthenticated) { return this.RedirectToAction("Manage"); } if (this.ModelState.IsValid) { // Get the information about the user from the external login provider var info = await this.AuthenticationManager.GetExternalLoginInfoAsync(); if (info == null) { return this.View("ExternalLoginFailure"); } var user = new ApplicationUser() { UserName = model.UserName }; var result = await this.UserManager.CreateAsync(user); if (result.Succeeded) { result = await this.UserManager.AddLoginAsync(user.Id, info.Login); if (result.Succeeded) { await this.SignInAsync(user, isPersistent: false); return this.RedirectToLocal(returnUrl); } } this.AddErrors(result); } this.ViewBag.ReturnUrl = returnUrl; return this.View(model); } // // POST: /Account/LogOff [HttpPost] [ValidateAntiForgeryToken] public ActionResult LogOff() { this.AuthenticationManager.SignOut(); return this.RedirectToAction("Index", "Home"); } // // GET: /Account/ExternalLoginFailure [AllowAnonymous] public ActionResult ExternalLoginFailure() { return this.View(); } [ChildActionOnly] public ActionResult RemoveAccountList() { var linkedAccounts = this.UserManager.GetLogins(this.User.Identity.GetUserId()); this.ViewBag.ShowRemoveButton = this.HasPassword() || linkedAccounts.Count > 1; return (ActionResult)this.PartialView("_RemoveAccountPartial", linkedAccounts); } protected override void Dispose(bool disposing) { if (disposing && this.UserManager != null) { this.UserManager.Dispose(); this.UserManager = null; } base.Dispose(disposing); } #region Helpers // Used for XSRF protection when adding external logins private const string XsrfKey = "XsrfId"; private IAuthenticationManager AuthenticationManager { get { return this.HttpContext.GetOwinContext().Authentication; } } private async Task SignInAsync(ApplicationUser user, bool isPersistent) { this.AuthenticationManager.SignOut(DefaultAuthenticationTypes.ExternalCookie); var identity = await this.UserManager.CreateIdentityAsync(user, DefaultAuthenticationTypes.ApplicationCookie); this.AuthenticationManager.SignIn(new AuthenticationProperties() { IsPersistent = isPersistent }, identity); } private void AddErrors(IdentityResult result) { foreach (var error in result.Errors) { this.ModelState.AddModelError("", error); } } private bool HasPassword() { var user = this.UserManager.FindById(this.User.Identity.GetUserId()); if (user != null) { return user.PasswordHash != null; } return false; } public enum ManageMessageId { ChangePasswordSuccess, SetPasswordSuccess, RemoveLoginSuccess, Error } private ActionResult RedirectToLocal(string returnUrl) { if (this.Url.IsLocalUrl(returnUrl)) { return this.Redirect(returnUrl); } else { return this.RedirectToAction("Index", "Home"); } } private class ChallengeResult : HttpUnauthorizedResult { public ChallengeResult(string provider, string redirectUri) : this(provider, redirectUri, null) { } public ChallengeResult(string provider, string redirectUri, string userId) { this.LoginProvider = provider; this.RedirectUri = redirectUri; this.UserId = userId; } public string LoginProvider { get; set; } public string RedirectUri { get; set; } public string UserId { get; set; } public override void ExecuteResult(ControllerContext context) { var properties = new AuthenticationProperties() { RedirectUri = this.RedirectUri }; if (this.UserId != null) { properties.Dictionary[XsrfKey] = this.UserId; } context.HttpContext.GetOwinContext().Authentication.Challenge(properties, this.LoginProvider); } } #endregion } }
35.561576
157
0.547029
[ "MIT" ]
saurabhagrawal1/magazine-website-mvc-5
Cik.MagazineWeb.WebApp/Controllers/AccountController.cs
14,440
C#
// // async.cs: Asynchronous functions // // Author: // Marek Safar (marek.safar@gmail.com) // // Dual licensed under the terms of the MIT X11 or GNU GPL // // Copyright 2011 Novell, Inc. // Copyright 2011 Xamarin Inc. // using System; using System.Collections.Generic; using System.Linq; using System.Collections; #if STATIC using IKVM.Reflection.Emit; #else using System.Reflection.Emit; #endif namespace Mono.CSharp { class Await : ExpressionStatement { Expression expr; AwaitStatement stmt; public Await (Expression expr, Location loc) { this.expr = expr; this.loc = loc; } protected override void CloneTo (CloneContext clonectx, Expression target) { var t = (Await) target; t.expr = expr.Clone (clonectx); } public override Expression CreateExpressionTree (ResolveContext ec) { throw new NotImplementedException ("ET"); } public override bool ContainsEmitWithAwait () { return true; } protected override Expression DoResolve (ResolveContext rc) { if (rc.HasSet (ResolveContext.Options.LockScope)) { rc.Report.Error (1996, loc, "The `await' operator cannot be used in the body of a lock statement"); } if (rc.HasSet (ResolveContext.Options.ExpressionTreeConversion)) { rc.Report.Error (1989, loc, "An expression tree cannot contain an await operator"); return null; } if (rc.IsUnsafe) { rc.Report.Error (4004, loc, "The `await' operator cannot be used in an unsafe context"); } var bc = (BlockContext) rc; if (!bc.CurrentBlock.ParametersBlock.IsAsync) { // TODO: Should check for existence of await type but // what to do with it } stmt = new AwaitStatement (expr, loc); if (!stmt.Resolve (bc)) return null; type = stmt.ResultType; eclass = ExprClass.Variable; return this; } public override void Emit (EmitContext ec) { stmt.EmitPrologue (ec); stmt.Emit (ec); } public override Expression EmitToField (EmitContext ec) { stmt.EmitPrologue (ec); return stmt.GetResultExpression (ec); } public void EmitAssign (EmitContext ec, FieldExpr field) { stmt.EmitPrologue (ec); field.InstanceExpression.Emit (ec); stmt.Emit (ec); } public override void EmitStatement (EmitContext ec) { stmt.EmitStatement (ec); } } class AwaitStatement : YieldStatement<AsyncInitializer> { sealed class AwaitableMemberAccess : MemberAccess { public AwaitableMemberAccess (Expression expr) : base (expr, "GetAwaiter") { } protected override void Error_TypeDoesNotContainDefinition (ResolveContext rc, TypeSpec type, string name) { Error_OperatorCannotBeApplied (rc, type); } protected override void Error_OperatorCannotBeApplied (ResolveContext rc, TypeSpec type) { rc.Report.Error (4001, loc, "Cannot await `{0}' expression", type.GetSignatureForError ()); } } sealed class GetResultInvocation : Invocation { public GetResultInvocation (MethodGroupExpr mge, Arguments arguments) : base (null, arguments) { mg = mge; type = mg.BestCandidateReturnType; } public override Expression EmitToField (EmitContext ec) { return this; } } Field awaiter; PropertySpec is_completed; MethodSpec on_completed; MethodSpec get_result; TypeSpec type; TypeSpec result_type; public AwaitStatement (Expression expr, Location loc) : base (expr, loc) { } #region Properties bool IsDynamic { get { return is_completed == null; } } public TypeSpec Type { get { return type; } } public TypeSpec ResultType { get { return result_type; } } #endregion protected override void DoEmit (EmitContext ec) { GetResultExpression (ec).Emit (ec); } public Expression GetResultExpression (EmitContext ec) { var fe_awaiter = new FieldExpr (awaiter, loc); fe_awaiter.InstanceExpression = new CompilerGeneratedThis (ec.CurrentType, loc); // // result = awaiter.GetResult (); // if (IsDynamic) { var rc = new ResolveContext (ec.MemberContext); return new Invocation (new MemberAccess (fe_awaiter, "GetResult"), new Arguments (0)).Resolve (rc); } else { var mg_result = MethodGroupExpr.CreatePredefined (get_result, fe_awaiter.Type, loc); mg_result.InstanceExpression = fe_awaiter; return new GetResultInvocation (mg_result, new Arguments (0)); } } public void EmitPrologue (EmitContext ec) { var fe_awaiter = new FieldExpr (awaiter, loc); fe_awaiter.InstanceExpression = new CompilerGeneratedThis (ec.CurrentType, loc); // // awaiter = expr.GetAwaiter (); // fe_awaiter.EmitAssign (ec, expr, false, false); Label skip_continuation = ec.DefineLabel (); Expression completed_expr; if (IsDynamic) { var rc = new ResolveContext (ec.MemberContext); Arguments dargs = new Arguments (1); dargs.Add (new Argument (fe_awaiter)); completed_expr = new DynamicMemberBinder ("IsCompleted", dargs, loc).Resolve (rc); } else { var pe = PropertyExpr.CreatePredefined (is_completed, loc); pe.InstanceExpression = fe_awaiter; completed_expr = pe; } completed_expr.EmitBranchable (ec, skip_continuation, true); base.DoEmit (ec); // // The stack has to be empty before calling await continuation. We handle this // by lifting values which would be left on stack into class fields. The process // is quite complicated and quite hard to test because any expression can possibly // leave a value on the stack. // // Following assert fails when some of expression called before is missing EmitToField // or parent expression fails to find await in children expressions // ec.AssertEmptyStack (); var args = new Arguments (1); var storey = (AsyncTaskStorey) machine_initializer.Storey; var fe_cont = new FieldExpr (storey.Continuation, loc); fe_cont.InstanceExpression = new CompilerGeneratedThis (ec.CurrentType, loc); args.Add (new Argument (fe_cont)); if (IsDynamic) { var rc = new ResolveContext (ec.MemberContext); var mg_expr = new Invocation (new MemberAccess (fe_awaiter, "OnCompleted"), args).Resolve (rc); ExpressionStatement es = (ExpressionStatement) mg_expr; es.EmitStatement (ec); } else { var mg_completed = MethodGroupExpr.CreatePredefined (on_completed, fe_awaiter.Type, loc); mg_completed.InstanceExpression = fe_awaiter; // // awaiter.OnCompleted (continuation); // mg_completed.EmitCall (ec, args); } // Return ok machine_initializer.EmitLeave (ec, unwind_protect); ec.MarkLabel (resume_point); ec.MarkLabel (skip_continuation); } public void EmitStatement (EmitContext ec) { EmitPrologue (ec); Emit (ec); if (ResultType.Kind != MemberKind.Void) { var storey = (AsyncTaskStorey) machine_initializer.Storey; if (storey.HoistedReturn != null) storey.HoistedReturn.EmitAssign (ec); else ec.Emit (OpCodes.Pop); } } void Error_WrongAwaiterPattern (ResolveContext rc, TypeSpec awaiter) { rc.Report.Error (4011, loc, "The awaiter type `{0}' must have suitable IsCompleted, OnCompleted, and GetResult members", awaiter.GetSignatureForError ()); } public override bool Resolve (BlockContext bc) { if (!base.Resolve (bc)) return false; Arguments args = new Arguments (0); type = expr.Type; // // The await expression is of dynamic type // if (type.BuiltinType == BuiltinTypeSpec.Type.Dynamic) { result_type = type; awaiter = ((AsyncTaskStorey) machine_initializer.Storey).AddAwaiter (type, loc); expr = new Invocation (new MemberAccess (expr, "GetAwaiter"), args).Resolve (bc); return true; } // // Check whether the expression is awaitable // Expression ama = new AwaitableMemberAccess (expr).Resolve (bc); if (ama == null) return false; var errors_printer = new SessionReportPrinter (); var old = bc.Report.SetPrinter (errors_printer); ama = new Invocation (ama, args).Resolve (bc); bc.Report.SetPrinter (old); if (errors_printer.ErrorsCount > 0 || !MemberAccess.IsValidDotExpression (ama.Type)) { bc.Report.Error (1986, expr.Location, "The `await' operand type `{0}' must have suitable GetAwaiter method", expr.Type.GetSignatureForError ()); return false; } var awaiter_type = ama.Type; awaiter = ((AsyncTaskStorey) machine_initializer.Storey).AddAwaiter (awaiter_type, loc); expr = ama; // // Predefined: bool IsCompleted { get; } // is_completed = MemberCache.FindMember (awaiter_type, MemberFilter.Property ("IsCompleted", bc.Module.Compiler.BuiltinTypes.Bool), BindingRestriction.InstanceOnly) as PropertySpec; if (is_completed == null || !is_completed.HasGet) { Error_WrongAwaiterPattern (bc, awaiter_type); return false; } // // Predefined: OnCompleted (Action) // if (bc.Module.PredefinedTypes.Action.Define ()) { on_completed = MemberCache.FindMember (awaiter_type, MemberFilter.Method ("OnCompleted", 0, ParametersCompiled.CreateFullyResolved (bc.Module.PredefinedTypes.Action.TypeSpec), bc.Module.Compiler.BuiltinTypes.Void), BindingRestriction.InstanceOnly) as MethodSpec; if (on_completed == null) { Error_WrongAwaiterPattern (bc, awaiter_type); return false; } } // // Predefined: GetResult () // // The method return type is also result type of await expression // get_result = MemberCache.FindMember (awaiter_type, MemberFilter.Method ("GetResult", 0, ParametersCompiled.EmptyReadOnlyParameters, null), BindingRestriction.InstanceOnly) as MethodSpec; if (get_result == null) { Error_WrongAwaiterPattern (bc, awaiter_type); return false; } result_type = get_result.ReturnType; return true; } } public class AsyncInitializer : StateMachineInitializer { TypeInferenceContext return_inference; public AsyncInitializer (ParametersBlock block, TypeContainer host, TypeSpec returnType) : base (block, host, returnType) { } #region Properties public override string ContainerType { get { return "async state machine block"; } } public override bool IsIterator { get { return false; } } public Block OriginalBlock { get { return block.Parent; } } public TypeInferenceContext ReturnTypeInference { get { return return_inference; } } #endregion public static void Create (IMemberContext context, ParametersBlock block, ParametersCompiled parameters, TypeContainer host, TypeSpec returnType, Location loc) { for (int i = 0; i < parameters.Count; i++) { Parameter p = parameters[i]; Parameter.Modifier mod = p.ModFlags; if ((mod & Parameter.Modifier.ISBYREF) != 0) { host.Compiler.Report.Error (1988, p.Location, "Async methods cannot have ref or out parameters"); return; } if (p is ArglistParameter) { host.Compiler.Report.Error (4006, p.Location, "__arglist is not allowed in parameter list of async methods"); return; } if (parameters.Types[i].IsPointer) { host.Compiler.Report.Error (4005, p.Location, "Async methods cannot have unsafe parameters"); return; } } if (!block.IsAsync) { host.Compiler.Report.Warning (1998, 1, loc, "Async block lacks `await' operator and will run synchronously"); } block.WrapIntoAsyncTask (context, host, returnType); } protected override BlockContext CreateBlockContext (ResolveContext rc) { var ctx = base.CreateBlockContext (rc); var lambda = rc.CurrentAnonymousMethod as LambdaMethod; if (lambda != null) return_inference = lambda.ReturnTypeInference; ctx.StartFlowBranching (this, rc.CurrentBranching); return ctx; } public override Expression CreateExpressionTree (ResolveContext ec) { return base.CreateExpressionTree (ec); } public override void Emit (EmitContext ec) { throw new NotImplementedException (); } protected override void EmitMoveNextEpilogue (EmitContext ec) { var storey = (AsyncTaskStorey) Storey; storey.EmitSetResult (ec); } public override void EmitStatement (EmitContext ec) { var storey = (AsyncTaskStorey) Storey; storey.Instance.Emit (ec); var move_next_entry = storey.StateMachineMethod.Spec; if (storey.MemberName.Arity > 0) { move_next_entry = MemberCache.GetMember (storey.Instance.Type, move_next_entry); } ec.Emit (OpCodes.Call, move_next_entry); // // Emits return <async-storey-instance>.$builder.Task; // if (storey.Task != null) { var builder_field = storey.Builder.Spec; var task_get = storey.Task.Get; if (storey.MemberName.Arity > 0) { builder_field = MemberCache.GetMember (storey.Instance.Type, builder_field); task_get = MemberCache.GetMember (builder_field.MemberType, task_get); } var pe_task = new PropertyExpr (storey.Task, loc) { InstanceExpression = new FieldExpr (builder_field, loc) { InstanceExpression = storey.Instance }, Getter = task_get }; pe_task.Emit (ec); } ec.Emit (OpCodes.Ret); } } class AsyncTaskStorey : StateMachine { int awaiters; Field builder, continuation; readonly TypeSpec return_type; MethodSpec set_result; MethodSpec set_exception; PropertySpec task; LocalVariable hoisted_return; int locals_captured; public AsyncTaskStorey (IMemberContext context, AsyncInitializer initializer, TypeSpec type) : base (initializer.OriginalBlock, initializer.Host,context.CurrentMemberDefinition as MemberBase, context.CurrentTypeParameters, "async") { return_type = type; } #region Properties public Field Builder { get { return builder; } } public Field Continuation { get { return continuation; } } public LocalVariable HoistedReturn { get { return hoisted_return; } } public TypeSpec ReturnType { get { return return_type; } } public PropertySpec Task { get { return task; } } #endregion public Field AddAwaiter (TypeSpec type, Location loc) { return AddCapturedVariable ("$awaiter" + awaiters++.ToString ("X"), type); } public Field AddCapturedLocalVariable (TypeSpec type) { if (mutator != null) type = mutator.Mutate (type); var field = AddCompilerGeneratedField ("<s>$" + locals_captured++.ToString ("X"), new TypeExpression (type, Location), true); field.Define (); return field; } protected override bool DoDefineMembers () { var action = Module.PredefinedTypes.Action.Resolve (); if (action != null) { continuation = AddCompilerGeneratedField ("$continuation", new TypeExpression (action, Location), true); continuation.ModFlags |= Modifiers.READONLY; } PredefinedType builder_type; PredefinedMember<MethodSpec> bf; PredefinedMember<MethodSpec> sr; PredefinedMember<MethodSpec> se; bool has_task_return_type = false; var pred_members = Module.PredefinedMembers; if (return_type.Kind == MemberKind.Void) { builder_type = Module.PredefinedTypes.AsyncVoidMethodBuilder; bf = pred_members.AsyncVoidMethodBuilderCreate; sr = pred_members.AsyncVoidMethodBuilderSetResult; se = pred_members.AsyncVoidMethodBuilderSetException; } else if (return_type == Module.PredefinedTypes.Task.TypeSpec) { builder_type = Module.PredefinedTypes.AsyncTaskMethodBuilder; bf = pred_members.AsyncTaskMethodBuilderCreate; sr = pred_members.AsyncTaskMethodBuilderSetResult; se = pred_members.AsyncTaskMethodBuilderSetException; task = pred_members.AsyncTaskMethodBuilderTask.Get (); } else { builder_type = Module.PredefinedTypes.AsyncTaskMethodBuilderGeneric; bf = pred_members.AsyncTaskMethodBuilderGenericCreate; sr = pred_members.AsyncTaskMethodBuilderGenericSetResult; se = pred_members.AsyncTaskMethodBuilderGenericSetException; task = pred_members.AsyncTaskMethodBuilderGenericTask.Get (); has_task_return_type = true; } set_result = sr.Get (); set_exception = se.Get (); var builder_factory = bf.Get (); if (!builder_type.Define () || set_result == null || builder_factory == null || set_exception == null) { Report.Error (1993, Location, "Cannot find compiler required types for asynchronous functions support. Are you targeting the wrong framework version?"); return base.DoDefineMembers (); } var bt = builder_type.TypeSpec; // // Inflate generic Task types // if (has_task_return_type) { var task_return_type = return_type.TypeArguments; if (mutator != null) task_return_type = mutator.Mutate (task_return_type); bt = bt.MakeGenericType (Module, task_return_type); builder_factory = MemberCache.GetMember<MethodSpec> (bt, builder_factory); set_result = MemberCache.GetMember<MethodSpec> (bt, set_result); set_exception = MemberCache.GetMember<MethodSpec> (bt, set_exception); if (task != null) task = MemberCache.GetMember<PropertySpec> (bt, task); } builder = AddCompilerGeneratedField ("$builder", new TypeExpression (bt, Location)); builder.ModFlags |= Modifiers.READONLY; if (!base.DoDefineMembers ()) return false; MethodGroupExpr mg; var block = instance_constructors[0].Block; // // Initialize continuation with state machine method // if (continuation != null) { var args = new Arguments (1); mg = MethodGroupExpr.CreatePredefined (StateMachineMethod.Spec, spec, Location); args.Add (new Argument (mg)); block.AddStatement ( new StatementExpression (new SimpleAssign ( new FieldExpr (continuation, Location), new NewDelegate (action, args, Location), Location ))); } mg = MethodGroupExpr.CreatePredefined (builder_factory, bt, Location); block.AddStatement ( new StatementExpression (new SimpleAssign ( new FieldExpr (builder, Location), new Invocation (mg, new Arguments (0)), Location))); if (has_task_return_type) { hoisted_return = LocalVariable.CreateCompilerGenerated (bt.TypeArguments[0], block, Location); } return true; } public void EmitSetException (EmitContext ec, LocalVariableReference exceptionVariable) { // // $builder.SetException (Exception) // var mg = MethodGroupExpr.CreatePredefined (set_exception, set_exception.DeclaringType, Location); mg.InstanceExpression = new FieldExpr (Builder, Location) { InstanceExpression = new CompilerGeneratedThis (ec.CurrentType, Location) }; Arguments args = new Arguments (1); args.Add (new Argument (exceptionVariable)); mg.EmitCall (ec, args); } public void EmitSetResult (EmitContext ec) { // // $builder.SetResult (); // $builder.SetResult<return-type> (value); // var mg = MethodGroupExpr.CreatePredefined (set_result, set_result.DeclaringType, Location); mg.InstanceExpression = new FieldExpr (Builder, Location) { InstanceExpression = new CompilerGeneratedThis (ec.CurrentType, Location) }; Arguments args; if (hoisted_return == null) { args = new Arguments (0); } else { args = new Arguments (1); args.Add (new Argument (new LocalVariableReference (hoisted_return, Location))); } mg.EmitCall (ec, args); } } }
26.61454
161
0.699206
[ "Apache-2.0" ]
iamwind/mono
mcs/mcs/async.cs
19,402
C#
using Commons.Enums; using System; using System.Collections.Generic; using System.Text; namespace CommonMessages.MqEvents { public class MoneyChangedMqEvent { public MoneyChangedMqEvent(long coinsChangeCount, long diamondsChangeCount, AddReason reason) { CoinsChangeCount = coinsChangeCount; DiamondsChangeCount = diamondsChangeCount; Reason = reason; } public MoneyChangedMqEvent(long id, long curCoins, long curDiamonds, long maxCoins, long maxDiamonds, long coinsChangeCount, long diamondsChangeCount, AddReason reason) { Id = id; CurCoins = curCoins; CurDiamonds = curDiamonds; MaxCoins = maxCoins; MaxDiamonds = maxDiamonds; CoinsChangeCount = coinsChangeCount; DiamondsChangeCount = diamondsChangeCount; Reason = reason; } public long Id { get; set; } public long CurCoins { get; set; } public long CurDiamonds { get; set; } public long MaxCoins { get; set; } public long MaxDiamonds { get; set; } /// <summary> /// 变化的金币数量 /// </summary> public long CoinsChangeCount { get; set; } /// <summary> /// 变化的砖石数量 /// </summary> public long DiamondsChangeCount { get; set; } public AddReason Reason { get; set; } } }
29.836735
101
0.587551
[ "MIT" ]
swpuzhang/CleanGameArchitecture
Messages/CommonMessages/MqEvents/MoneyChangedMqEvent.cs
1,492
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 greengrassv2-2020-11-30.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text; using System.Xml.Serialization; using Amazon.GreengrassV2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.GreengrassV2.Model.Internal.MarshallTransformations { /// <summary> /// ComponentDependencyRequirement Marshaller /// </summary> public class ComponentDependencyRequirementMarshaller : IRequestMarshaller<ComponentDependencyRequirement, JsonMarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="requestObject"></param> /// <param name="context"></param> /// <returns></returns> public void Marshall(ComponentDependencyRequirement requestObject, JsonMarshallerContext context) { if(requestObject.IsSetDependencyType()) { context.Writer.WritePropertyName("dependencyType"); context.Writer.Write(requestObject.DependencyType); } if(requestObject.IsSetVersionRequirement()) { context.Writer.WritePropertyName("versionRequirement"); context.Writer.Write(requestObject.VersionRequirement); } } /// <summary> /// Singleton Marshaller. /// </summary> public readonly static ComponentDependencyRequirementMarshaller Instance = new ComponentDependencyRequirementMarshaller(); } }
36.058824
135
0.672512
[ "Apache-2.0" ]
philasmar/aws-sdk-net
sdk/src/Services/GreengrassV2/Generated/Model/Internal/MarshallTransformations/ComponentDependencyRequirementMarshaller.cs
2,452
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("NMEA Simulator")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("NMEA Simulator")] [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("459dfed7-67fb-4ee9-9e10-df389f1699b2")] // 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.864865
84
0.744468
[ "MIT" ]
jholovacs/nmea0183
NMEA Simulator/Properties/AssemblyInfo.cs
1,404
C#
namespace Core.Services.Interfaces { interface IFoodService { void OnBoard(); void Spawn(); } }
13.888889
35
0.576
[ "MIT" ]
INIage/Snake
src/Core/Services/Interfaces/IFoodService.cs
127
C#
using System.IO; using CP77.CR2W.Reflection; using FastMember; using static CP77.CR2W.Types.Enums; namespace CP77.CR2W.Types { [REDMeta] public class BrightnessSettingsGameController : gameuiMenuGameController { [Ordinal(0)] [RED("SettingsElements")] public CArray<wCHandle<inkSettingsSelectorController>> SettingsElements { get; set; } [Ordinal(1)] [RED("isPreGame")] public CBool IsPreGame { get; set; } [Ordinal(2)] [RED("menuEventDispatcher")] public wCHandle<inkMenuEventDispatcher> MenuEventDispatcher { get; set; } [Ordinal(3)] [RED("s_brightnessGroup")] public CName S_brightnessGroup { get; set; } [Ordinal(4)] [RED("settings")] public CHandle<userSettingsUserSettings> Settings { get; set; } [Ordinal(5)] [RED("settingsListener")] public CHandle<BrightnessSettingsVarListener> SettingsListener { get; set; } [Ordinal(6)] [RED("settingsOptionsList")] public inkCompoundWidgetReference SettingsOptionsList { get; set; } public BrightnessSettingsGameController(CR2WFile cr2w, CVariable parent, string name) : base(cr2w, parent, name) { } } }
49.954545
128
0.740673
[ "MIT" ]
Eingin/CP77Tools
CP77.CR2W/Types/cp77/BrightnessSettingsGameController.cs
1,078
C#
namespace CarrierLink.Controller.Yate { using System; using System.Collections.Generic; /// <summary> /// This class provides encoding/decoding of Yate messages /// </summary> public static class CharacterCoding { #region Properties /// <summary> /// Conversion table /// </summary> private static List<Tuple<char, string>> conversions; /// <summary> /// Decoding Yate to Core /// </summary> private static Dictionary<string, char> yateToCore; /// <summary> /// Encoding Core to Yate /// </summary> private static Dictionary<char, string> coreToYate; #endregion Properties #region Constructor /// <summary> /// Initializes the class /// </summary> static CharacterCoding() { conversions = new List<Tuple<char, string>>(); //AsEncoded.Add(new Tuple<char, string>('!', "%a")); // 33 //AsEncoded.Add(new Tuple<char, string>('"', "%b")); // 34 //AsEncoded.Add(new Tuple<char, string>('#', "%c")); // 35 //AsEncoded.Add(new Tuple<char, string>('$', "%d")); // 36 //AsEncoded.Add(new Tuple<char, string>('&', "%f")); // 38 //AsEncoded.Add(new Tuple<char, string>(' ', "%`")); // 39 //AsEncoded.Add(new Tuple<char, string>('(', "%h")); // 40 //AsEncoded.Add(new Tuple<char, string>(')', "%i")); // 41 //AsEncoded.Add(new Tuple<char, string>('*', "%j")); // 42 //AsEncoded.Add(new Tuple<char, string>('+', "%k")); // 43 //AsEncoded.Add(new Tuple<char, string>(',', "%l")); // 44 //AsEncoded.Add(new Tuple<char, string>('-', "%m")); // 45 //AsEncoded.Add(new Tuple<char, string>('.', "%n")); // 46 //AsEncoded.Add(new Tuple<char, string>('/', "%o")); // 47 conversions.Add(new Tuple<char, string>(':', "%z")); // 58 (important) //AsEncoded.Add(new Tuple<char, string>(';', "%{")); // 59 (important) //AsEncoded.Add(new Tuple<char, string>('<', "%|")); // 60 //AsEncoded.Add(new Tuple<char, string>('=', "%}")); // 61 //AsEncoded.Add(new Tuple<char, string>('>', "%~")); // 62 // MUST conversions.Add(new Tuple<char, string>('%', "%%")); yateToCore = new Dictionary<string, char>(); coreToYate = new Dictionary<char, string>(); foreach (var conversion in conversions) { yateToCore.Add(conversion.Item2, conversion.Item1); coreToYate.Add(conversion.Item1, conversion.Item2); } } #endregion #region Functions /// <summary> /// Encodes strings for yate /// </summary> /// <param name="value">String that needs to be encoded</param> /// <returns>Encoded string</returns> public static string Encode(string value) { int length = value.Length; for (int i = 0; i < length; i++) { if (coreToYate.TryGetValue(value[i], out string encoded)) { // Check if last character if (i == length - 1) { value = string.Concat(value.Substring(0, i), encoded); break; } else { value = string.Concat(value.Substring(0, i), encoded, value.Substring(i + 1)); length++; } } } return value; } /// <summary> /// Decodes yate-encoded strings /// </summary> /// <param name="values"></param> /// <returns></returns> public static string Decode(string value) { int length = value.Length; for (int i = 0; i < length; i++) { if (value[i] == '%') { if (yateToCore.TryGetValue(string.Concat(value[i], value[i + 1]), out char decoded)) { // Check if penultimate character if (i == length - 2) { value = string.Concat(value.Substring(0, i), decoded); break; } else { value = string.Concat(value.Substring(0, i), decoded, value.Substring(i + 2)); length--; } } } } return value; } #endregion Functions } }
36.724638
107
0.430347
[ "MIT" ]
asymetrixs/CarrierLink
Yate/CharacterCoding.cs
5,070
C#
// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; #pragma warning disable SA1649 // File name must match first type name namespace BuildXL.Storage.ChangeTracking { /// <summary> /// Types of detected change to a path. A path may have multiple changes reported at once (multiple flags set). /// </summary> [Flags] public enum PathChanges { /// <nodoc /> None, /// <summary> /// Data or metadata has possibly changed for this path (which was previously existent and tracked). /// </summary> DataOrMetadataChanged = 1, /// <summary> /// The path possibly no longer exists (or the file at the path has been replaced with different one). /// </summary> Removed = 2, /// <summary> /// The path had previously been tracked as non-existent. Now, it may exist. /// </summary> NewlyPresent = 4, /// <summary> /// The direct membership of a directory (which had been the target of a tracked enumeration) has possibly changed. /// </summary> MembershipChanged = 8, /// <summary> /// Refinement of <see cref="NewlyPresent"/> in which the path now exists as a file. /// </summary> NewlyPresentAsFile = 16, /// <summary> /// Refinement of <see cref="NewlyPresent"/> in which the path now exists as a directory. /// </summary> NewlyPresentAsDirectory = 32, } /// <summary> /// Extensions for <see cref="PathChanges"/>. /// </summary> public static class PathChangesExtensions { /// <summary> /// Checks if path changes include newly present. /// </summary> public static bool ContainsNewlyPresent(this PathChanges pathChanges) { return (pathChanges & (PathChanges.NewlyPresent | PathChanges.NewlyPresentAsDirectory | PathChanges.NewlyPresentAsFile)) != 0; } /// <summary> /// Checks if path changes are excatly newly present. /// </summary> public static bool IsNewlyPresent(this PathChanges pathChanges) { return pathChanges == PathChanges.NewlyPresentAsFile || pathChanges == PathChanges.NewlyPresentAsDirectory || pathChanges == PathChanges.NewlyPresent; } } }
35.083333
164
0.599367
[ "MIT" ]
AzureMentor/BuildXL
Public/Src/Utilities/Storage/ChangeTracking/PathChanges.cs
2,526
C#
//------------------------------------------------------------------------------ // // System.Environment.cs // // Copyright (C) 2001 Moonlight Enterprises, All Rights Reserved // // Author: Jim Richardson, develop@wtfo-guru.com // Dan Lewis (dihlewis@yahoo.co.uk) // Created: Saturday, August 11, 2001 // //------------------------------------------------------------------------------ // // Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com) // // 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. // using System.IO; using System.Collections; using System.Runtime.CompilerServices; using System.Security; using System.Security.Permissions; using System.Text; using System.Runtime.InteropServices; using System.Threading; namespace System { [ComVisible (true)] public static class Environment { /* * This is the version number of the corlib-runtime interface. When * making changes to this interface (by changing the layout * of classes the runtime knows about, changing icall signature or * semantics etc), increment this variable. Also increment the * pair of this variable in the runtime in metadata/appdomain.c. * Changes which are already detected at runtime, like the addition * of icalls, do not require an increment. */ #pragma warning disable 169 private const int mono_corlib_version = 104; #pragma warning restore 169 [ComVisible (true)] public enum SpecialFolder { MyDocuments = 0x05, Desktop = 0x00, MyComputer = 0x11, Programs = 0x02, Personal = 0x05, Favorites = 0x06, Startup = 0x07, Recent = 0x08, SendTo = 0x09, StartMenu = 0x0b, MyMusic = 0x0d, DesktopDirectory = 0x10, Templates = 0x15, ApplicationData = 0x1a, LocalApplicationData = 0x1c, InternetCache = 0x20, Cookies = 0x21, History = 0x22, CommonApplicationData = 0x23, System = 0x25, ProgramFiles = 0x26, MyPictures = 0x27, CommonProgramFiles = 0x2b, #if NET_4_0 || MOONLIGHT || MOBILE MyVideos = 0x0e, #endif #if NET_4_0 NetworkShortcuts = 0x13, Fonts = 0x14, CommonStartMenu = 0x16, CommonPrograms = 0x17, CommonStartup = 0x18, CommonDesktopDirectory = 0x19, PrinterShortcuts = 0x1b, Windows = 0x24, UserProfile = 0x28, SystemX86 = 0x29, ProgramFilesX86 = 0x2a, CommonProgramFilesX86 = 0x2c, CommonTemplates = 0x2d, CommonDocuments = 0x2e, CommonAdminTools = 0x2f, AdminTools = 0x30, CommonMusic = 0x35, CommonPictures = 0x36, CommonVideos = 0x37, Resources = 0x38, LocalizedResources = 0x39, CommonOemLinks = 0x3a, CDBurning = 0x3b, #endif } #if NET_4_0 public #else internal #endif enum SpecialFolderOption { None = 0, DoNotVerify = 0x4000, Create = 0x8000 } /// <summary> /// Gets the command line for this process /// </summary> public static string CommandLine { // note: security demand inherited from calling GetCommandLineArgs get { StringBuilder sb = new StringBuilder (); foreach (string str in GetCommandLineArgs ()) { bool escape = false; string quote = ""; string s = str; for (int i = 0; i < s.Length; i++) { if (quote.Length == 0 && Char.IsWhiteSpace (s [i])) { quote = "\""; } else if (s [i] == '"') { escape = true; } } if (escape && quote.Length != 0) { s = s.Replace ("\"", "\\\""); } sb.AppendFormat ("{0}{1}{0} ", quote, s); } if (sb.Length > 0) sb.Length--; return sb.ToString (); } } /// <summary> /// Gets or sets the current directory. Actually this is supposed to get /// and/or set the process start directory acording to the documentation /// but actually test revealed at beta2 it is just Getting/Setting the CurrentDirectory /// </summary> public static string CurrentDirectory { get { return Directory.GetCurrentDirectory (); } set { Directory.SetCurrentDirectory (value); } } #if NET_4_5 public static int CurrentManagedThreadId { get { return Thread.CurrentThread.ManagedThreadId; } } #endif /// <summary> /// Gets or sets the exit code of this process /// </summary> public extern static int ExitCode { [MethodImplAttribute (MethodImplOptions.InternalCall)] get; [MethodImplAttribute (MethodImplOptions.InternalCall)] set; } static public extern bool HasShutdownStarted { [MethodImplAttribute (MethodImplOptions.InternalCall)] get; } /// <summary> /// Gets the name of the local computer /// </summary> public extern static string MachineName { [MethodImplAttribute (MethodImplOptions.InternalCall)] [EnvironmentPermission (SecurityAction.Demand, Read="COMPUTERNAME")] [SecurityPermission (SecurityAction.Demand, UnmanagedCode=true)] get; } [MethodImplAttribute (MethodImplOptions.InternalCall)] extern static string GetNewLine (); static string nl; /// <summary> /// Gets the standard new line value /// </summary> public static string NewLine { get { if (nl != null) return nl; nl = GetNewLine (); return nl; } } // // Support methods and fields for OSVersion property // static OperatingSystem os; static extern PlatformID Platform { [MethodImplAttribute (MethodImplOptions.InternalCall)] get; } [MethodImplAttribute (MethodImplOptions.InternalCall)] internal static extern string GetOSVersionString (); /// <summary> /// Gets the current OS version information /// </summary> public static OperatingSystem OSVersion { get { if (os == null) { Version v = Version.CreateFromString (GetOSVersionString ()); PlatformID p = Platform; if (p == PlatformID.MacOSX) p = PlatformID.Unix; os = new OperatingSystem (p, v); } return os; } } /// <summary> /// Get StackTrace /// </summary> public static string StackTrace { [EnvironmentPermission (SecurityAction.Demand, Unrestricted=true)] get { System.Diagnostics.StackTrace trace = new System.Diagnostics.StackTrace (0, true); return trace.ToString (); } } #if !NET_2_1 /// <summary> /// Get a fully qualified path to the system directory /// </summary> public static string SystemDirectory { get { return GetFolderPath (SpecialFolder.System); } } #endif /// <summary> /// Get the number of milliseconds that have elapsed since the system was booted /// </summary> public extern static int TickCount { [MethodImplAttribute (MethodImplOptions.InternalCall)] get; } /// <summary> /// Get UserDomainName /// </summary> public static string UserDomainName { // FIXME: this variable doesn't exist (at least not on WinXP) - reported to MS as FDBK20562 [EnvironmentPermission (SecurityAction.Demand, Read="USERDOMAINNAME")] get { return MachineName; } } /// <summary> /// Gets a flag indicating whether the process is in interactive mode /// </summary> [MonoTODO ("Currently always returns false, regardless of interactive state")] public static bool UserInteractive { get { return false; } } /// <summary> /// Get the user name of current process is running under /// </summary> public extern static string UserName { [MethodImplAttribute (MethodImplOptions.InternalCall)] [EnvironmentPermission (SecurityAction.Demand, Read="USERNAME;USER")] get; } /// <summary> /// Get the version of the common language runtime /// </summary> public static Version Version { get { return new Version (Consts.FxFileVersion); } } /// <summary> /// Get the amount of physical memory mapped to process /// </summary> [MonoTODO ("Currently always returns zero")] public static long WorkingSet { [EnvironmentPermission (SecurityAction.Demand, Unrestricted=true)] get { return 0; } } [MethodImplAttribute (MethodImplOptions.InternalCall)] [SecurityPermission (SecurityAction.Demand, UnmanagedCode=true)] public extern static void Exit (int exitCode); /// <summary> /// Substitute environment variables in the argument "name" /// </summary> public static string ExpandEnvironmentVariables (string name) { if (name == null) throw new ArgumentNullException ("name"); int off1 = name.IndexOf ('%'); if (off1 == -1) return name; int len = name.Length; int off2 = 0; if (off1 == len - 1 || (off2 = name.IndexOf ('%', off1 + 1)) == -1) return name; StringBuilder result = new StringBuilder (); result.Append (name, 0, off1); Hashtable tbl = null; do { string var = name.Substring (off1 + 1, off2 - off1 - 1); string value = GetEnvironmentVariable (var); if (value == null && Environment.IsRunningOnWindows) { // On windows, env. vars. are case insensitive if (tbl == null) tbl = GetEnvironmentVariablesNoCase (); value = tbl [var] as string; } // If value not found, add %FOO to stream, // and use the closing % for the next iteration. // If value found, expand it in place of %FOO% int realOldOff2 = off2; if (value == null) { result.Append ('%'); result.Append (var); off2--; } else { result.Append (value); } int oldOff2 = off2; off1 = name.IndexOf ('%', off2 + 1); // If no % found for off1, don't look for one for off2 off2 = (off1 == -1 || off2 > len-1)? -1 :name.IndexOf ('%', off1 + 1); // textLen is the length of text between the closing % of current iteration // and the starting % of the next iteration if any. This text is added to output int textLen; // If no new % found, use all the remaining text if (off1 == -1 || off2 == -1) textLen = len - oldOff2 - 1; // If value found in current iteration, use text after current closing % and next % else if(value != null) textLen = off1 - oldOff2 - 1; // If value not found in current iteration, but a % was found for next iteration, // use text from current closing % to the next %. else textLen = off1 - realOldOff2; if(off1 >= oldOff2 || off1 == -1) result.Append (name, oldOff2+1, textLen); } while (off2 > -1 && off2 < len); return result.ToString (); } /// <summary> /// Return an array of the command line arguments of the current process /// </summary> [MethodImplAttribute (MethodImplOptions.InternalCall)] [EnvironmentPermissionAttribute (SecurityAction.Demand, Read = "PATH")] public extern static string[] GetCommandLineArgs (); [MethodImplAttribute (MethodImplOptions.InternalCall)] internal extern static string internalGetEnvironmentVariable (string variable); /// <summary> /// Return a string containing the value of the environment /// variable identifed by parameter "variable" /// </summary> public static string GetEnvironmentVariable (string variable) { #if !NET_2_1 if (SecurityManager.SecurityEnabled) { new EnvironmentPermission (EnvironmentPermissionAccess.Read, variable).Demand (); } #endif return internalGetEnvironmentVariable (variable); } static Hashtable GetEnvironmentVariablesNoCase () { Hashtable vars = new Hashtable (CaseInsensitiveHashCodeProvider.Default, CaseInsensitiveComparer.Default); foreach (string name in GetEnvironmentVariableNames ()) { vars [name] = internalGetEnvironmentVariable (name); } return vars; } /// <summary> /// Return a set of all environment variables and their values /// </summary> #if !NET_2_1 public static IDictionary GetEnvironmentVariables () { StringBuilder sb = null; if (SecurityManager.SecurityEnabled) { // we must have access to each variable to get the lot sb = new StringBuilder (); // but (performance-wise) we do not want a stack-walk // for each of them so we concatenate them } Hashtable vars = new Hashtable (); foreach (string name in GetEnvironmentVariableNames ()) { vars [name] = internalGetEnvironmentVariable (name); if (sb != null) { sb.Append (name); sb.Append (";"); } } if (sb != null) { new EnvironmentPermission (EnvironmentPermissionAccess.Read, sb.ToString ()).Demand (); } return vars; } #else [EnvironmentPermission (SecurityAction.Demand, Unrestricted=true)] public static IDictionary GetEnvironmentVariables () { Hashtable vars = new Hashtable (); foreach (string name in GetEnvironmentVariableNames ()) { vars [name] = internalGetEnvironmentVariable (name); } return vars; } #endif [MethodImplAttribute (MethodImplOptions.InternalCall)] private extern static string GetWindowsFolderPath (int folder); /// <summary> /// Returns the fully qualified path of the /// folder specified by the "folder" parameter /// </summary> public static string GetFolderPath (SpecialFolder folder) { return GetFolderPath (folder, SpecialFolderOption.None); } #if NET_4_0 public #endif static string GetFolderPath(SpecialFolder folder, SpecialFolderOption option) { SecurityManager.EnsureElevatedPermissions (); // this is a no-op outside moonlight string dir = null; if (Environment.IsRunningOnWindows) dir = GetWindowsFolderPath ((int) folder); else dir = UnixGetFolderPath (folder, option); #if !NET_2_1 if ((dir != null) && (dir.Length > 0) && SecurityManager.SecurityEnabled) { new FileIOPermission (FileIOPermissionAccess.PathDiscovery, dir).Demand (); } #endif return dir; } private static string ReadXdgUserDir (string config_dir, string home_dir, string key, string fallback) { string env_path = internalGetEnvironmentVariable (key); if (env_path != null && env_path != String.Empty) { return env_path; } string user_dirs_path = Path.Combine (config_dir, "user-dirs.dirs"); if (!File.Exists (user_dirs_path)) { return Path.Combine (home_dir, fallback); } try { using(StreamReader reader = new StreamReader (user_dirs_path)) { string line; while ((line = reader.ReadLine ()) != null) { line = line.Trim (); int delim_index = line.IndexOf ('='); if(delim_index > 8 && line.Substring (0, delim_index) == key) { string path = line.Substring (delim_index + 1).Trim ('"'); bool relative = false; if (path.StartsWith ("$HOME/")) { relative = true; path = path.Substring (6); } else if (!path.StartsWith ("/")) { relative = true; } return relative ? Path.Combine (home_dir, path) : path; } } } } catch (FileNotFoundException) { } return Path.Combine (home_dir, fallback); } // the security runtime (and maybe other parts of corlib) needs the // information to initialize themselves before permissions can be checked internal static string UnixGetFolderPath (SpecialFolder folder, SpecialFolderOption option) { string home = internalGetHome (); // http://freedesktop.org/Standards/basedir-spec/basedir-spec-0.6.html // note: skip security check for environment variables string data = internalGetEnvironmentVariable ("XDG_DATA_HOME"); if ((data == null) || (data == String.Empty)) { data = Path.Combine (home, ".local"); data = Path.Combine (data, "share"); } // note: skip security check for environment variables string config = internalGetEnvironmentVariable ("XDG_CONFIG_HOME"); if ((config == null) || (config == String.Empty)) { config = Path.Combine (home, ".config"); } switch (folder) { // MyComputer is a virtual directory case SpecialFolder.MyComputer: return String.Empty; // personal == ~ case SpecialFolder.Personal: #if MONOTOUCH return Path.Combine (home, "Documents"); #else return home; #endif // use FDO's CONFIG_HOME. This data will be synced across a network like the windows counterpart. case SpecialFolder.ApplicationData: #if MONOTOUCH { string dir = Path.Combine (Path.Combine (home, "Documents"), ".config"); if (option == SpecialFolderOption.Create){ if (!Directory.Exists (dir)) Directory.CreateDirectory (dir); } return dir; } #else return config; #endif //use FDO's DATA_HOME. This is *NOT* synced case SpecialFolder.LocalApplicationData: #if MONOTOUCH { string dir = Path.Combine (home, "Documents"); if (!Directory.Exists (dir)) Directory.CreateDirectory (dir); return dir; } #else return data; #endif case SpecialFolder.Desktop: case SpecialFolder.DesktopDirectory: return ReadXdgUserDir (config, home, "XDG_DESKTOP_DIR", "Desktop"); case SpecialFolder.MyMusic: if (Platform == PlatformID.MacOSX) return Path.Combine (home, "Music"); else return ReadXdgUserDir (config, home, "XDG_MUSIC_DIR", "Music"); case SpecialFolder.MyPictures: if (Platform == PlatformID.MacOSX) return Path.Combine (home, "Pictures"); else return ReadXdgUserDir (config, home, "XDG_PICTURES_DIR", "Pictures"); case SpecialFolder.Templates: return ReadXdgUserDir (config, home, "XDG_TEMPLATES_DIR", "Templates"); #if NET_4_0 || MOONLIGHT || MOBILE case SpecialFolder.MyVideos: return ReadXdgUserDir (config, home, "XDG_VIDEOS_DIR", "Videos"); #endif #if NET_4_0 case SpecialFolder.CommonTemplates: return "/usr/share/templates"; case SpecialFolder.Fonts: if (Platform == PlatformID.MacOSX) return Path.Combine (home, "Library", "Fonts"); return Path.Combine (home, ".fonts"); #endif // these simply dont exist on Linux // The spec says if a folder doesnt exist, we // should return "" case SpecialFolder.Favorites: if (Platform == PlatformID.MacOSX) return Path.Combine (home, "Library", "Favorites"); else return String.Empty; case SpecialFolder.ProgramFiles: if (Platform == PlatformID.MacOSX) return "/Applications"; else return String.Empty; case SpecialFolder.InternetCache: if (Platform == PlatformID.MacOSX) return Path.Combine (home, "Library", "Caches"); else return String.Empty; #if NET_4_0 // #2873 case SpecialFolder.UserProfile: return home; #endif case SpecialFolder.Programs: case SpecialFolder.SendTo: case SpecialFolder.StartMenu: case SpecialFolder.Startup: case SpecialFolder.Cookies: case SpecialFolder.History: case SpecialFolder.Recent: case SpecialFolder.CommonProgramFiles: case SpecialFolder.System: #if NET_4_0 case SpecialFolder.NetworkShortcuts: case SpecialFolder.CommonStartMenu: case SpecialFolder.CommonPrograms: case SpecialFolder.CommonStartup: case SpecialFolder.CommonDesktopDirectory: case SpecialFolder.PrinterShortcuts: case SpecialFolder.Windows: case SpecialFolder.SystemX86: case SpecialFolder.ProgramFilesX86: case SpecialFolder.CommonProgramFilesX86: case SpecialFolder.CommonDocuments: case SpecialFolder.CommonAdminTools: case SpecialFolder.AdminTools: case SpecialFolder.CommonMusic: case SpecialFolder.CommonPictures: case SpecialFolder.CommonVideos: case SpecialFolder.Resources: case SpecialFolder.LocalizedResources: case SpecialFolder.CommonOemLinks: case SpecialFolder.CDBurning: #endif return String.Empty; // This is where data common to all users goes case SpecialFolder.CommonApplicationData: return "/usr/share"; default: throw new ArgumentException ("Invalid SpecialFolder"); } } [EnvironmentPermission (SecurityAction.Demand, Unrestricted=true)] public static string[] GetLogicalDrives () { return GetLogicalDrivesInternal (); } #if !NET_2_1 [MethodImplAttribute (MethodImplOptions.InternalCall)] private static extern void internalBroadcastSettingChange (); public static string GetEnvironmentVariable (string variable, EnvironmentVariableTarget target) { switch (target) { case EnvironmentVariableTarget.Process: return GetEnvironmentVariable (variable); case EnvironmentVariableTarget.Machine: new EnvironmentPermission (PermissionState.Unrestricted).Demand (); if (!IsRunningOnWindows) return null; using (Microsoft.Win32.RegistryKey env = Microsoft.Win32.Registry.LocalMachine.OpenSubKey (@"SYSTEM\CurrentControlSet\Control\Session Manager\Environment")) { object regvalue = env.GetValue (variable); return (regvalue == null) ? null : regvalue.ToString (); } case EnvironmentVariableTarget.User: new EnvironmentPermission (PermissionState.Unrestricted).Demand (); if (!IsRunningOnWindows) return null; using (Microsoft.Win32.RegistryKey env = Microsoft.Win32.Registry.CurrentUser.OpenSubKey ("Environment", false)) { object regvalue = env.GetValue (variable); return (regvalue == null) ? null : regvalue.ToString (); } default: throw new ArgumentException ("target"); } } public static IDictionary GetEnvironmentVariables (EnvironmentVariableTarget target) { IDictionary variables = (IDictionary)new Hashtable (); switch (target) { case EnvironmentVariableTarget.Process: variables = GetEnvironmentVariables (); break; case EnvironmentVariableTarget.Machine: new EnvironmentPermission (PermissionState.Unrestricted).Demand (); if (IsRunningOnWindows) { using (Microsoft.Win32.RegistryKey env = Microsoft.Win32.Registry.LocalMachine.OpenSubKey (@"SYSTEM\CurrentControlSet\Control\Session Manager\Environment")) { string[] value_names = env.GetValueNames (); foreach (string value_name in value_names) variables.Add (value_name, env.GetValue (value_name)); } } break; case EnvironmentVariableTarget.User: new EnvironmentPermission (PermissionState.Unrestricted).Demand (); if (IsRunningOnWindows) { using (Microsoft.Win32.RegistryKey env = Microsoft.Win32.Registry.CurrentUser.OpenSubKey ("Environment")) { string[] value_names = env.GetValueNames (); foreach (string value_name in value_names) variables.Add (value_name, env.GetValue (value_name)); } } break; default: throw new ArgumentException ("target"); } return variables; } [EnvironmentPermission (SecurityAction.Demand, Unrestricted=true)] public static void SetEnvironmentVariable (string variable, string value) { SetEnvironmentVariable (variable, value, EnvironmentVariableTarget.Process); } [EnvironmentPermission (SecurityAction.Demand, Unrestricted = true)] public static void SetEnvironmentVariable (string variable, string value, EnvironmentVariableTarget target) { if (variable == null) throw new ArgumentNullException ("variable"); if (variable == String.Empty) throw new ArgumentException ("String cannot be of zero length.", "variable"); if (variable.IndexOf ('=') != -1) throw new ArgumentException ("Environment variable name cannot contain an equal character.", "variable"); if (variable[0] == '\0') throw new ArgumentException ("The first char in the string is the null character.", "variable"); switch (target) { case EnvironmentVariableTarget.Process: InternalSetEnvironmentVariable (variable, value); break; case EnvironmentVariableTarget.Machine: if (!IsRunningOnWindows) return; using (Microsoft.Win32.RegistryKey env = Microsoft.Win32.Registry.LocalMachine.OpenSubKey (@"SYSTEM\CurrentControlSet\Control\Session Manager\Environment", true)) { if (String.IsNullOrEmpty (value)) env.DeleteValue (variable, false); else env.SetValue (variable, value); internalBroadcastSettingChange (); } break; case EnvironmentVariableTarget.User: if (!IsRunningOnWindows) return; using (Microsoft.Win32.RegistryKey env = Microsoft.Win32.Registry.CurrentUser.OpenSubKey ("Environment", true)) { if (String.IsNullOrEmpty (value)) env.DeleteValue (variable, false); else env.SetValue (variable, value); internalBroadcastSettingChange (); } break; default: throw new ArgumentException ("target"); } } [MethodImplAttribute (MethodImplOptions.InternalCall)] internal static extern void InternalSetEnvironmentVariable (string variable, string value); #endif [SecurityPermission (SecurityAction.LinkDemand, UnmanagedCode=true)] public static void FailFast (string message) { throw new NotImplementedException (); } #if NET_4_0 || MOONLIGHT || MOBILE [SecurityCritical] public static void FailFast (string message, Exception exception) { throw new NotImplementedException (); } #endif #if NET_4_0 public static bool Is64BitOperatingSystem { get { return IntPtr.Size == 8; } // FIXME: is this good enough? } public static bool Is64BitProcess { get { return Is64BitOperatingSystem; } } public static int SystemPageSize { get { return GetPageSize (); } } #endif public static extern int ProcessorCount { [EnvironmentPermission (SecurityAction.Demand, Read="NUMBER_OF_PROCESSORS")] [MethodImplAttribute (MethodImplOptions.InternalCall)] get; } // private methods internal static bool IsRunningOnWindows { get { return ((int) Platform < 4); } } #if !NET_2_1 // // Used by gacutil.exe // #pragma warning disable 169 private static string GacPath { get { if (Environment.IsRunningOnWindows) { /* On windows, we don't know the path where mscorlib.dll will be installed */ string corlibDir = new DirectoryInfo (Path.GetDirectoryName (typeof (int).Assembly.Location)).Parent.Parent.FullName; return Path.Combine (Path.Combine (corlibDir, "mono"), "gac"); } return Path.Combine (Path.Combine (internalGetGacPath (), "mono"), "gac"); } } #pragma warning restore 169 [MethodImplAttribute (MethodImplOptions.InternalCall)] internal extern static string internalGetGacPath (); #endif [MethodImplAttribute (MethodImplOptions.InternalCall)] private extern static string [] GetLogicalDrivesInternal (); [MethodImplAttribute (MethodImplOptions.InternalCall)] private extern static string [] GetEnvironmentVariableNames (); [MethodImplAttribute (MethodImplOptions.InternalCall)] internal extern static string GetMachineConfigPath (); [MethodImplAttribute (MethodImplOptions.InternalCall)] internal extern static string internalGetHome (); [MethodImplAttribute (MethodImplOptions.InternalCall)] internal extern static int GetPageSize (); static internal bool IsUnix { get { int platform = (int) Environment.Platform; return (platform == 4 || platform == 128 || platform == 6); } } static internal bool IsMacOS { get { return Environment.Platform == PlatformID.MacOSX; } } } }
30.209328
168
0.688113
[ "Apache-2.0" ]
basarat/mono
mcs/class/corlib/System/Environment.cs
27,853
C#
using Bucket.Values; using System.Threading.Tasks; namespace Bucket.Listener.Abstractions { public interface IPublishCommand { /// <summary> /// 推送命令 /// </summary> /// <param name="applicationCode"></param> /// <param name="command"></param> /// <returns></returns> Task PublishCommandMessage(string applicationCode, NetworkCommand command); } }
24.529412
83
0.613909
[ "MIT" ]
q315523275/.net-core-
src/Listener/Bucket.Listener/Abstractions/IPublishCommand.cs
427
C#
// 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. namespace Fixtures.Azure.AcceptanceTestsAzureSpecials { using Fixtures.Azure; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; using System.Threading; using System.Threading.Tasks; /// <summary> /// Extension methods for HeaderOperations. /// </summary> public static partial class HeaderOperationsExtensions { /// <summary> /// Send foo-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the /// header of the request /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='fooClientRequestId'> /// The fooRequestId /// </param> public static HeaderCustomNamedRequestIdHeaders CustomNamedRequestId(this IHeaderOperations operations, string fooClientRequestId) { return operations.CustomNamedRequestIdAsync(fooClientRequestId).GetAwaiter().GetResult(); } /// <summary> /// Send foo-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the /// header of the request /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='fooClientRequestId'> /// The fooRequestId /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task<HeaderCustomNamedRequestIdHeaders> CustomNamedRequestIdAsync(this IHeaderOperations operations, string fooClientRequestId, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CustomNamedRequestIdWithHttpMessagesAsync(fooClientRequestId, null, cancellationToken).ConfigureAwait(false)) { return _result.Headers; } } /// <summary> /// Send foo-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the /// header of the request, via a parameter group /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='headerCustomNamedRequestIdParamGroupingParameters'> /// Additional parameters for the operation /// </param> public static HeaderCustomNamedRequestIdParamGroupingHeaders CustomNamedRequestIdParamGrouping(this IHeaderOperations operations, HeaderCustomNamedRequestIdParamGroupingParameters headerCustomNamedRequestIdParamGroupingParameters) { return operations.CustomNamedRequestIdParamGroupingAsync(headerCustomNamedRequestIdParamGroupingParameters).GetAwaiter().GetResult(); } /// <summary> /// Send foo-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the /// header of the request, via a parameter group /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='headerCustomNamedRequestIdParamGroupingParameters'> /// Additional parameters for the operation /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task<HeaderCustomNamedRequestIdParamGroupingHeaders> CustomNamedRequestIdParamGroupingAsync(this IHeaderOperations operations, HeaderCustomNamedRequestIdParamGroupingParameters headerCustomNamedRequestIdParamGroupingParameters, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CustomNamedRequestIdParamGroupingWithHttpMessagesAsync(headerCustomNamedRequestIdParamGroupingParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Headers; } } /// <summary> /// Send foo-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the /// header of the request /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='fooClientRequestId'> /// The fooRequestId /// </param> public static bool CustomNamedRequestIdHead(this IHeaderOperations operations, string fooClientRequestId) { return operations.CustomNamedRequestIdHeadAsync(fooClientRequestId).GetAwaiter().GetResult(); } /// <summary> /// Send foo-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the /// header of the request /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='fooClientRequestId'> /// The fooRequestId /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task<bool> CustomNamedRequestIdHeadAsync(this IHeaderOperations operations, string fooClientRequestId, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CustomNamedRequestIdHeadWithHttpMessagesAsync(fooClientRequestId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } } }
46.835821
325
0.615519
[ "MIT" ]
brywang-msft/autorest
src/generator/AutoRest.CSharp.Azure.Tests/Expected/AcceptanceTests/AzureSpecials/HeaderOperationsExtensions.cs
6,276
C#