mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
Editorconfig, fixing mistakes from Xamarin and VS
This commit is contained in:
committed by
ComicIronic
parent
a9f51fb3d7
commit
0dea46d970
12
.editorconfig
Normal file
12
.editorconfig
Normal file
@@ -0,0 +1,12 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
trim_trailing_whitespace = true
|
||||
charset = utf-8
|
||||
|
||||
[*.{csproj, xml}]
|
||||
indent_size = 2
|
||||
@@ -501,4 +501,4 @@
|
||||
<PostBuildEvent>
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
|
||||
@@ -1,115 +0,0 @@
|
||||
#if !__MonoCS__ && VS_DEBUGGERVISUALIZERS_EXISTS
|
||||
|
||||
using Microsoft.VisualStudio.DebuggerVisualizers;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
|
||||
[assembly: DebuggerVisualizer(
|
||||
typeof(SS14.Client.Debug.TextureVisualizer),
|
||||
typeof(SS14.Client.Debug.TextureVisualizerObjectSource),
|
||||
Target = typeof(SFML.Graphics.Texture),
|
||||
Description = "Texture Visualizer")]
|
||||
|
||||
[assembly: DebuggerVisualizer(
|
||||
typeof(SS14.Client.Debug.TextureVisualizer),
|
||||
typeof(SS14.Client.Debug.RenderTextureVisualizerObjectSource),
|
||||
Target = typeof(SFML.Graphics.RenderTexture),
|
||||
Description = "RenderTexture Visualizer")]
|
||||
|
||||
namespace SS14.Client.Debug
|
||||
{
|
||||
public class TextureVisualizerObjectSource : VisualizerObjectSource
|
||||
{
|
||||
public override void GetData(object target, Stream outgoingData)
|
||||
{
|
||||
var tex = (SFML.Graphics.Texture)target;
|
||||
using (var img = tex.CopyToImage())
|
||||
{
|
||||
var writer = new BinaryWriter(outgoingData);
|
||||
var pixels = img.Pixels;
|
||||
writer.Write(img.Size.X);
|
||||
writer.Write(img.Size.Y);
|
||||
writer.Write(pixels.Length);
|
||||
writer.Write(pixels, 0, pixels.Length);
|
||||
outgoingData.Flush();
|
||||
}
|
||||
}
|
||||
}
|
||||
public class RenderTextureVisualizerObjectSource : VisualizerObjectSource
|
||||
{
|
||||
public override void GetData(object target, Stream outgoingData)
|
||||
{
|
||||
var rt = (SFML.Graphics.RenderTexture)target;
|
||||
new TextureVisualizerObjectSource().GetData(rt.Texture, outgoingData);
|
||||
}
|
||||
}
|
||||
|
||||
public class TextureVisualizer : DialogDebuggerVisualizer
|
||||
{
|
||||
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
|
||||
{
|
||||
if (windowService == null)
|
||||
throw new ArgumentNullException("windowService");
|
||||
if (objectProvider == null)
|
||||
throw new ArgumentNullException("objectProvider");
|
||||
|
||||
var reader = new BinaryReader(objectProvider.GetData());
|
||||
var width = reader.ReadInt32(); // unchecked uint to int conversion
|
||||
var height = reader.ReadInt32(); // unchecked uint to int conversion
|
||||
var src = reader.ReadBytes(reader.ReadInt32());
|
||||
|
||||
using (var form = new Form())
|
||||
using (var pb = new PictureBox())
|
||||
{
|
||||
var bmp = new Bitmap(width, height);
|
||||
var data = bmp.LockBits(new Rectangle(0, 0, width, height), ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);
|
||||
var length = height * data.Stride;
|
||||
var pixels = new byte[length];
|
||||
for (int i = 0; i < length; i += 4)
|
||||
{
|
||||
pixels[i + 0] = src[i + 2];
|
||||
pixels[i + 1] = src[i + 1];
|
||||
pixels[i + 2] = src[i + 0];
|
||||
pixels[i + 3] = src[i + 3];
|
||||
}
|
||||
System.Runtime.InteropServices.Marshal.Copy(pixels, 0, data.Scan0, length);
|
||||
bmp.UnlockBits(data);
|
||||
|
||||
var transGrid = new Bitmap(16, 16); // Checkerboard pattern for transparent images.
|
||||
using (var g = System.Drawing.Graphics.FromImage(transGrid))
|
||||
{
|
||||
g.Clear(Color.FromArgb(102, 102, 102));
|
||||
var brush = new SolidBrush(Color.FromArgb(153, 153, 153));
|
||||
g.FillRectangle(brush, 0, 0, 8, 8);
|
||||
g.FillRectangle(brush, 8, 8, 8, 8);
|
||||
}
|
||||
|
||||
form.Controls.Add(pb);
|
||||
form.ClientSize = bmp.Size;
|
||||
form.Width = Math.Max(form.Width, 200);
|
||||
form.Text = string.Format("Texture Visualizer ({0:#,##0} x {1:#,##0})", width, height);
|
||||
form.BackgroundImage = transGrid;
|
||||
form.BackgroundImageLayout = ImageLayout.Tile;
|
||||
pb.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Right | AnchorStyles.Left;
|
||||
pb.Bounds = form.ClientRectangle;
|
||||
pb.SizeMode = PictureBoxSizeMode.Zoom;
|
||||
pb.Image = bmp;
|
||||
pb.BackColor = Color.Transparent;
|
||||
|
||||
windowService.ShowDialog(form);
|
||||
}
|
||||
}
|
||||
|
||||
//public static void TestShowVisualizer(object objectToVisualize)
|
||||
//{
|
||||
// VisualizerDevelopmentHost visualizerHost = new VisualizerDevelopmentHost(objectToVisualize, typeof(TextureVisualizer));
|
||||
// visualizerHost.ShowVisualizer();
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -210,4 +210,194 @@ Global
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(MonoDevelopProperties) = preSolution
|
||||
Policies = $0
|
||||
$0.DotNetNamingPolicy = $1
|
||||
$1.DirectoryNamespaceAssociation = None
|
||||
$1.ResourceNamePolicy = FileFormatDefault
|
||||
$0.TextStylePolicy = $2
|
||||
$2.FileWidth = 120
|
||||
$2.EolMarker = Unix
|
||||
$2.inheritsSet = VisualStudio
|
||||
$2.inheritsScope = text/plain
|
||||
$2.scope = text/x-csharp
|
||||
$0.CSharpFormattingPolicy = $3
|
||||
$3.IndentSwitchSection = True
|
||||
$3.NewLinesForBracesInProperties = True
|
||||
$3.NewLinesForBracesInAccessors = True
|
||||
$3.NewLinesForBracesInAnonymousMethods = True
|
||||
$3.NewLinesForBracesInControlBlocks = True
|
||||
$3.NewLinesForBracesInAnonymousTypes = True
|
||||
$3.NewLinesForBracesInObjectCollectionArrayInitializers = True
|
||||
$3.NewLinesForBracesInLambdaExpressionBody = True
|
||||
$3.NewLineForElse = True
|
||||
$3.NewLineForCatch = True
|
||||
$3.NewLineForFinally = True
|
||||
$3.NewLineForMembersInObjectInit = True
|
||||
$3.NewLineForMembersInAnonymousTypes = True
|
||||
$3.NewLineForClausesInQuery = True
|
||||
$3.SpacingAfterMethodDeclarationName = False
|
||||
$3.SpaceAfterMethodCallName = False
|
||||
$3.SpaceBeforeOpenSquareBracket = False
|
||||
$3.inheritsSet = Mono
|
||||
$3.inheritsScope = text/x-csharp
|
||||
$3.scope = text/x-csharp
|
||||
$0.TextStylePolicy = $4
|
||||
$4.FileWidth = 120
|
||||
$4.EolMarker = Unix
|
||||
$4.inheritsSet = VisualStudio
|
||||
$4.inheritsScope = text/plain
|
||||
$4.scope = text/plain
|
||||
$0.TextStylePolicy = $5
|
||||
$5.inheritsSet = null
|
||||
$5.scope = application/config+xml
|
||||
$0.XmlFormattingPolicy = $6
|
||||
$6.inheritsSet = null
|
||||
$6.scope = application/config+xml
|
||||
$0.TextStylePolicy = $7
|
||||
$7.inheritsSet = VisualStudio
|
||||
$7.scope = application/xml
|
||||
$7.FileWidth = 120
|
||||
$7.TabWidth = 2
|
||||
$7.IndentWidth = 2
|
||||
$7.EolMarker = Unix
|
||||
$7.inheritsScope = text/plain
|
||||
$0.XmlFormattingPolicy = $8
|
||||
$8.inheritsSet = Mono
|
||||
$8.inheritsScope = application/xml
|
||||
$8.scope = application/xml
|
||||
$0.TextStylePolicy = $9
|
||||
$9.inheritsSet = null
|
||||
$9.scope = text/microsoft-resx
|
||||
$0.XmlFormattingPolicy = $10
|
||||
$10.inheritsSet = null
|
||||
$10.scope = text/microsoft-resx
|
||||
$0.StandardHeader = $11
|
||||
$11.Text =
|
||||
$11.IncludeInNewFiles = True
|
||||
$0.NameConventionPolicy = $12
|
||||
$12.Rules = $13
|
||||
$13.NamingRule = $14
|
||||
$14.Name = Namespaces
|
||||
$14.AffectedEntity = Namespace
|
||||
$14.VisibilityMask = VisibilityMask
|
||||
$14.NamingStyle = PascalCase
|
||||
$14.IncludeInstanceMembers = True
|
||||
$14.IncludeStaticEntities = True
|
||||
$13.NamingRule = $15
|
||||
$15.Name = Types
|
||||
$15.AffectedEntity = Class, Struct, Enum, Delegate
|
||||
$15.VisibilityMask = Public
|
||||
$15.NamingStyle = PascalCase
|
||||
$15.IncludeInstanceMembers = True
|
||||
$15.IncludeStaticEntities = True
|
||||
$13.NamingRule = $16
|
||||
$16.Name = Interfaces
|
||||
$16.RequiredPrefixes = $17
|
||||
$17.String = I
|
||||
$16.AffectedEntity = Interface
|
||||
$16.VisibilityMask = Public
|
||||
$16.NamingStyle = PascalCase
|
||||
$16.IncludeInstanceMembers = True
|
||||
$16.IncludeStaticEntities = True
|
||||
$13.NamingRule = $18
|
||||
$18.Name = Attributes
|
||||
$18.RequiredSuffixes = $19
|
||||
$19.String = Attribute
|
||||
$18.AffectedEntity = CustomAttributes
|
||||
$18.VisibilityMask = Public
|
||||
$18.NamingStyle = PascalCase
|
||||
$18.IncludeInstanceMembers = True
|
||||
$18.IncludeStaticEntities = True
|
||||
$13.NamingRule = $20
|
||||
$20.Name = Event Arguments
|
||||
$20.RequiredSuffixes = $21
|
||||
$21.String = EventArgs
|
||||
$20.AffectedEntity = CustomEventArgs
|
||||
$20.VisibilityMask = Public
|
||||
$20.NamingStyle = PascalCase
|
||||
$20.IncludeInstanceMembers = True
|
||||
$20.IncludeStaticEntities = True
|
||||
$13.NamingRule = $22
|
||||
$22.Name = Exceptions
|
||||
$22.RequiredSuffixes = $23
|
||||
$23.String = Exception
|
||||
$22.AffectedEntity = CustomExceptions
|
||||
$22.VisibilityMask = VisibilityMask
|
||||
$22.NamingStyle = PascalCase
|
||||
$22.IncludeInstanceMembers = True
|
||||
$22.IncludeStaticEntities = True
|
||||
$13.NamingRule = $24
|
||||
$24.Name = Methods
|
||||
$24.AffectedEntity = Methods
|
||||
$24.VisibilityMask = Protected, Public
|
||||
$24.NamingStyle = PascalCase
|
||||
$24.IncludeInstanceMembers = True
|
||||
$24.IncludeStaticEntities = True
|
||||
$13.NamingRule = $25
|
||||
$25.Name = Static Readonly Fields
|
||||
$25.AffectedEntity = ReadonlyField
|
||||
$25.VisibilityMask = Protected, Public
|
||||
$25.NamingStyle = PascalCase
|
||||
$25.IncludeInstanceMembers = False
|
||||
$25.IncludeStaticEntities = True
|
||||
$13.NamingRule = $26
|
||||
$26.Name = Fields
|
||||
$26.AffectedEntity = Field
|
||||
$26.VisibilityMask = Protected, Public
|
||||
$26.NamingStyle = PascalCase
|
||||
$26.IncludeInstanceMembers = True
|
||||
$26.IncludeStaticEntities = True
|
||||
$13.NamingRule = $27
|
||||
$27.Name = ReadOnly Fields
|
||||
$27.AffectedEntity = ReadonlyField
|
||||
$27.VisibilityMask = Protected, Public
|
||||
$27.NamingStyle = PascalCase
|
||||
$27.IncludeInstanceMembers = True
|
||||
$27.IncludeStaticEntities = False
|
||||
$13.NamingRule = $28
|
||||
$28.Name = Constant Fields
|
||||
$28.AffectedEntity = ConstantField
|
||||
$28.VisibilityMask = Protected, Public
|
||||
$28.NamingStyle = PascalCase
|
||||
$28.IncludeInstanceMembers = True
|
||||
$28.IncludeStaticEntities = True
|
||||
$13.NamingRule = $29
|
||||
$29.Name = Properties
|
||||
$29.AffectedEntity = Property
|
||||
$29.VisibilityMask = Protected, Public
|
||||
$29.NamingStyle = PascalCase
|
||||
$29.IncludeInstanceMembers = True
|
||||
$29.IncludeStaticEntities = True
|
||||
$13.NamingRule = $30
|
||||
$30.Name = Events
|
||||
$30.AffectedEntity = Event
|
||||
$30.VisibilityMask = Protected, Public
|
||||
$30.NamingStyle = PascalCase
|
||||
$30.IncludeInstanceMembers = True
|
||||
$30.IncludeStaticEntities = True
|
||||
$13.NamingRule = $31
|
||||
$31.Name = Enum Members
|
||||
$31.AffectedEntity = EnumMember
|
||||
$31.VisibilityMask = VisibilityMask
|
||||
$31.NamingStyle = PascalCase
|
||||
$31.IncludeInstanceMembers = True
|
||||
$31.IncludeStaticEntities = True
|
||||
$13.NamingRule = $32
|
||||
$32.Name = Parameters
|
||||
$32.AffectedEntity = Parameter
|
||||
$32.VisibilityMask = VisibilityMask
|
||||
$32.NamingStyle = CamelCase
|
||||
$32.IncludeInstanceMembers = True
|
||||
$32.IncludeStaticEntities = True
|
||||
$13.NamingRule = $33
|
||||
$33.Name = Type Parameters
|
||||
$33.RequiredPrefixes = $34
|
||||
$34.String = T
|
||||
$33.AffectedEntity = TypeParameter
|
||||
$33.VisibilityMask = VisibilityMask
|
||||
$33.NamingStyle = PascalCase
|
||||
$33.IncludeInstanceMembers = True
|
||||
$33.IncludeStaticEntities = True
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
||||
Reference in New Issue
Block a user