conflict_resolution
stringlengths
27
16k
<<<<<<< public RiakBucketProperties SetReplicationMode(RiakConstants.RiakEnterprise.ReplicationMode replicationMode) { ReplicationMode = replicationMode; return this; } ======= public RiakBucketProperties SetBigVclock(uint? bigVclock) { BigVclock = bigVclock; return this; } public RiakBucketProperties SetSmallVclock(uint? smallVclock) { SmallVclock = smallVclock; return this; } >>>>>>> public RiakBucketProperties SetReplicationMode(RiakConstants.RiakEnterprise.ReplicationMode replicationMode) { ReplicationMode = replicationMode; return this; } public RiakBucketProperties SetBigVclock(uint? bigVclock) { BigVclock = bigVclock; return this; } public RiakBucketProperties SetSmallVclock(uint? smallVclock) { SmallVclock = smallVclock; return this; }
<<<<<<< ======= private readonly bool _reuseHeaderValues; private readonly bool _useLatin1; >>>>>>> private readonly bool _useLatin1; <<<<<<< ReuseHeaderValues = reuseHeaderValues; ======= _reuseHeaderValues = reuseHeaderValues; _useLatin1 = useLatin1; >>>>>>> ReuseHeaderValues = reuseHeaderValues; _useLatin1 = useLatin1;
<<<<<<< #if WINRT #elif PSS _graphics.DrawArrays(PSSHelper.ToDrawMode(primitiveType), vertexStart, GetElementCountArray(primitiveType, primitiveCount)); ======= >>>>>>>
<<<<<<< static public T Create(string launchParameters, PhoneApplicationPage page, UIElement drawingSurface = null) ======= /// static public T Create(string launchParameters, PhoneApplicationPage page) >>>>>>> /// static public T Create(string launchParameters, PhoneApplicationPage page, UIElement drawingSurface = null) <<<<<<< if (drawingSurface == null) drawingSurface = page.Content; if (!(drawingSurface is DrawingSurfaceBackgroundGrid) && !(drawingSurface is DrawingSurface)) throw new NullReferenceException("The drawing surface could not be found!"); ======= MediaElement mediaElement = null; for (int i = 0; i < VisualTreeHelper.GetChildrenCount(page.Content); i++) { var child = VisualTreeHelper.GetChild(page.Content, i); if (child.GetType() == typeof(MediaElement)) mediaElement = (MediaElement)child; } if (mediaElement == null) throw new NullReferenceException("The media element could not be found! Add it to the GamePage."); Microsoft.Xna.Framework.Media.MediaPlayer._mediaElement = mediaElement; >>>>>>> if (drawingSurface == null) drawingSurface = page.Content; if (!(drawingSurface is DrawingSurfaceBackgroundGrid) && !(drawingSurface is DrawingSurface)) throw new NullReferenceException("The drawing surface could not be found!"); MediaElement mediaElement = null; for (int i = 0; i < VisualTreeHelper.GetChildrenCount(page.Content); i++) { var child = VisualTreeHelper.GetChild(page.Content, i); if (child.GetType() == typeof(MediaElement)) mediaElement = (MediaElement)child; } if (mediaElement == null) throw new NullReferenceException("The media element could not be found! Add it to the GamePage."); Microsoft.Xna.Framework.Media.MediaPlayer._mediaElement = mediaElement;
<<<<<<< #if !DIRECTX ======= #endif #if !WINRT >>>>>>> #endif #if !DIRECTX <<<<<<< #elif DIRECTX ======= #elif PSS throw new NotImplementedException(); #elif WINRT >>>>>>> #elif PSS throw new NotImplementedException(); #elif DIRECTX <<<<<<< #elif DIRECTX throw new NotImplementedException(); ======= #elif WINRT return null; #elif PSS return new Texture2D(graphicsDevice, stream); >>>>>>> #elif DIRECTX throw new NotImplementedException(); #elif PSS return new Texture2D(graphicsDevice, stream);
<<<<<<< #if WINDOWS_MEDIA_ENGINE || WINDOWS_MEDIA_SESSION ======= #if WINDOWS_MEDIA_ENGINE || WINDOWS_MEDIA_SESSION using SharpDX; >>>>>>> #if WINDOWS_MEDIA_ENGINE || WINDOWS_MEDIA_SESSION using SharpDX; <<<<<<< #elif WINDOWS_PHONE internal static MediaElement _mediaElement; ======= private static SimpleAudioVolume _volumeController; private static PresentationClock _clock; // HACK: Need SharpDX to fix this. private static readonly Guid MRPolicyVolumeService = Guid.Parse("1abaa2ac-9d3b-47c6-ab48-c59506de784d"); private static readonly Guid SimpleAudioVolumeGuid = Guid.Parse("089EDF13-CF71-4338-8D13-9E569DBDC319"); >>>>>>> private static SimpleAudioVolume _volumeController; private static PresentationClock _clock; // HACK: Need SharpDX to fix this. private static readonly Guid MRPolicyVolumeService = Guid.Parse("1abaa2ac-9d3b-47c6-ab48-c59506de784d"); private static readonly Guid SimpleAudioVolumeGuid = Guid.Parse("089EDF13-CF71-4338-8D13-9E569DBDC319"); #elif WINDOWS_PHONE internal static MediaElement _mediaElement; <<<<<<< // FIX ME! #elif WINDOWS_PHONE _mediaElement.IsMuted = value; ======= if (_volumeController != null) _volumeController.Mute = _isMuted; >>>>>>> if (_volumeController != null) _volumeController.Mute = _isMuted; #elif WINDOWS_PHONE _mediaElement.IsMuted = value; <<<<<<< #elif WINDOWS_MEDIA_SESSION // TODO! #elif WINDOWS_PHONE // TODO: No such property present in MediaElement ======= >>>>>>> #elif WINDOWS_MEDIA_SESSION // TODO! #elif WINDOWS_PHONE // TODO: No such property present in MediaElement <<<<<<< { #if WINDOWS_MEDIA_ENGINE return TimeSpan.FromSeconds(_mediaEngineEx.CurrentTime); #elif WINDOWS_PHONE return _mediaElement.Position; #else ======= { #if WINDOWS_MEDIA_ENGINE return TimeSpan.Zero; #elif WINDOWS_MEDIA_SESSION return _clock != null ? TimeSpan.FromTicks(_clock.Time) : TimeSpan.Zero; #else >>>>>>> { #if WINDOWS_MEDIA_ENGINE return TimeSpan.FromSeconds(_mediaEngineEx.CurrentTime); #elif WINDOWS_MEDIA_SESSION return _clock != null ? TimeSpan.FromTicks(_clock.Time) : TimeSpan.Zero; #elif WINDOWS_PHONE return _mediaElement.Position; #else <<<<<<< // TODO! #elif WINDOWS_PHONE _mediaElement.Volume = value; ======= if (_volumeController != null) _volumeController.MasterVolume = _volume; >>>>>>> if (_volumeController != null) _volumeController.MasterVolume = _volume; #elif WINDOWS_PHONE _mediaElement.Volume = value; <<<<<<< { ======= { if (State != MediaState.Paused) return; >>>>>>> { if (State != MediaState.Paused) return; <<<<<<< ======= if (State == MediaState.Stopped) return; >>>>>>> if (State == MediaState.Stopped) return; <<<<<<< #elif WINDOWS_PHONE Deployment.Current.Dispatcher.BeginInvoke(() => { _mediaElement.Stop(); }); #else if (_queue.ActiveSong == null) return; ======= _volumeController.Dispose(); _volumeController = null; _clock.Dispose(); _clock = null; #else >>>>>>> _volumeController.Dispose(); _volumeController = null; _clock.Dispose(); _clock = null; #elif WINDOWS_PHONE Deployment.Current.Dispatcher.BeginInvoke(() => { _mediaElement.Stop(); }); #else
<<<<<<< GL.ClearColor(color.X, color.Y, color.Z, color.W); ======= // GL.Clear() obeys the scissor rectangle where as in XNA/DirectX // it does not. So make sure scissor rect is set to the viewport // bounds before we do the clear. var prevScissorRect = ScissorRectangle; ScissorRectangle = _viewport.Bounds; GL.ClearColor (color.X, color.Y, color.Z, color.W); >>>>>>> // GL.Clear() obeys the scissor rectangle where as in XNA/DirectX // it does not. So make sure scissor rect is set to the viewport // bounds before we do the clear. var prevScissorRect = ScissorRectangle; ScissorRectangle = _viewport.Bounds; GL.ClearColor (color.X, color.Y, color.Z, color.W); <<<<<<< // Restore the color write flag. // Restore the depth write flag. if ( options.HasFlag(ClearOptions.DepthBuffer) && !_depthStencilStateDirty) GL.DepthMask(_depthStencilState.DepthBufferWriteEnable); #endif // OPENGL } public void Clear(ClearOptions options, Color color, float depth, int stencil, Rectangle[] regions) { throw new NotImplementedException(); } public void Clear(ClearOptions options, Vector4 color, float depth, int stencil, Rectangle[] regions) { throw new NotImplementedException(); } ======= >>>>>>> // Restore the color write flag. // Restore the depth write flag. if ( options.HasFlag(ClearOptions.DepthBuffer) && !_depthStencilStateDirty) GL.DepthMask(_depthStencilState.DepthBufferWriteEnable);
<<<<<<< if (!reader.GraphicsDevice.GraphicsCapabilities.SupportsS3tc && convertedFormat == SurfaceFormat.Color) ======= case SurfaceFormat.Dxt3SRgb: if (!reader.GraphicsDevice.GraphicsCapabilities.SupportsS3tc) >>>>>>> case SurfaceFormat.Dxt3SRgb: if (!reader.GraphicsDevice.GraphicsCapabilities.SupportsS3tc) if (!reader.GraphicsDevice.GraphicsCapabilities.SupportsS3tc && convertedFormat == SurfaceFormat.Color) <<<<<<< if (!reader.GraphicsDevice.GraphicsCapabilities.SupportsS3tc && convertedFormat == SurfaceFormat.Color) ======= case SurfaceFormat.Dxt5SRgb: if (!reader.GraphicsDevice.GraphicsCapabilities.SupportsS3tc) >>>>>>> case SurfaceFormat.Dxt5SRgb: if (!reader.GraphicsDevice.GraphicsCapabilities.SupportsS3tc) if (!reader.GraphicsDevice.GraphicsCapabilities.SupportsS3tc && convertedFormat == SurfaceFormat.Color)
<<<<<<< var shaderList = new List<Shader>(); ======= _shaderList = new List<DXShader>(); >>>>>>> _shaderList = new List<Shader>(); <<<<<<< var shader = new MGFXShader(graphicsDevice, reader); shaderList.Add(shader); ======= var shader = new DXShader(graphicsDevice, reader); _shaderList.Add(shader); >>>>>>> var shader = new MGFXShader(graphicsDevice, reader); _shaderList.Add(shader);
<<<<<<< case 0: case 5: TouchPanel.AddEvent(new TouchLocation(id, TouchLocationState.Pressed, position)); ======= case MotionEventActions.Down: case MotionEventActions.PointerDown: index = collection.FindIndexById(id, out tlocation); if (index < 0) { tlocation = new TouchLocation(id, TouchLocationState.Pressed, position); collection.Add(tlocation); } >>>>>>> case MotionEventActions.Down: case MotionEventActions.PointerDown: TouchPanel.AddEvent(new TouchLocation(id, TouchLocationState.Pressed, position)); <<<<<<< case 1: case 6: TouchPanel.AddEvent(new TouchLocation(id, TouchLocationState.Released, position)); ======= case MotionEventActions.Up: case MotionEventActions.PointerUp: index = collection.FindIndexById(id, out tlocation); if (index >= 0) { tlocation.State = TouchLocationState.Released; collection[index] = tlocation; } >>>>>>> case MotionEventActions.Up: case MotionEventActions.PointerUp: TouchPanel.AddEvent(new TouchLocation(id, TouchLocationState.Released, position)); <<<<<<< case 3: case 4: TouchPanel.AddEvent(new TouchLocation(id, TouchLocationState.Released, position)); ======= case MotionEventActions.Cancel: case MotionEventActions.Outside: index = collection.FindIndexById(id, out tlocation); if (index >= 0) { tlocation.State = TouchLocationState.Invalid; collection[index] = tlocation; } >>>>>>> case MotionEventActions.Cancel: case MotionEventActions.Outside: TouchPanel.AddEvent(new TouchLocation(id, TouchLocationState.Released, position));
<<<<<<< static class FontHelper { [StructLayout(LayoutKind.Sequential)] public struct ABC { public int abcA; public uint abcB; public int abcC; } [DllImport("gdi32.dll", ExactSpelling = true)] public static extern IntPtr SelectObject(IntPtr hDC, IntPtr hObj); [DllImport("gdi32.dll", ExactSpelling = true, SetLastError = true)] public static extern int DeleteObject(IntPtr hObj); [DllImport("gdi32.dll", ExactSpelling = true, CharSet = CharSet.Unicode, SetLastError = true)] public static extern bool GetCharABCWidthsW(IntPtr hdc, uint uFirstChar, uint uLastChar, [Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPStruct, SizeConst = 1)] ABC[] lpabc); #if MACOS static CTFont nativeFont; public static ABC GetCharWidthABC(char ch, Font font, System.Drawing.Graphics gr) { ABC[] _temp = new ABC[1]; var nativFont = CreateFont (font.Name, font.Size, font.Style, font.GdiCharSet, font.GdiVerticalFont); var atts = buildAttributedString(ch.ToString(), nativFont); // for now just a line not sure if this is going to work CTLine line = new CTLine(atts); float ascent; float descent; float leading; _temp[0].abcB = (uint)line.GetTypographicBounds(out ascent, out descent, out leading); return _temp[0]; } const byte DefaultCharSet = 1; static bool underLine = false; static bool strikeThrough = false; static float dpiScale = 96f / 72f; static internal CTFont CreateFont (string familyName, float emSize) { return CreateFont (familyName, emSize, FontStyle.Regular, DefaultCharSet, false); } static internal CTFont CreateFont (string familyName, float emSize, FontStyle style) { return CreateFont (familyName, emSize, style, DefaultCharSet, false); } static internal CTFont CreateFont (string familyName, float emSize, FontStyle style, byte gdiCharSet) { return CreateFont (familyName, emSize, style, gdiCharSet, false); } static internal CTFont CreateFont (string familyName, float emSize, FontStyle style, byte gdiCharSet, bool gdiVerticalFont ) { if (emSize <= 0) throw new ArgumentException("emSize is less than or equal to 0, evaluates to infinity, or is not a valid number.","emSize"); CTFont nativeFont; // convert to 96 Dpi to be consistent with Windows var dpiSize = emSize * dpiScale; try { nativeFont = new CTFont(familyName,dpiSize); } catch { nativeFont = new CTFont("Helvetica",dpiSize); } CTFontSymbolicTraits tMask = CTFontSymbolicTraits.None; if ((style & FontStyle.Bold) == FontStyle.Bold) tMask |= CTFontSymbolicTraits.Bold; if ((style & FontStyle.Italic) == FontStyle.Italic) tMask |= CTFontSymbolicTraits.Italic; strikeThrough = (style & FontStyle.Strikeout) == FontStyle.Strikeout; underLine = (style & FontStyle.Underline) == FontStyle.Underline; var nativeFont2 = nativeFont.WithSymbolicTraits(dpiSize,tMask,tMask); if (nativeFont2 != null) nativeFont = nativeFont2; return nativeFont; } static NSString FontAttributedName = (NSString)"NSFont"; static NSString ForegroundColorAttributedName = (NSString)"NSColor"; static NSString UnderlineStyleAttributeName = (NSString)"NSUnderline"; static NSString ParagraphStyleAttributeName = (NSString)"NSParagraphStyle"; //NSAttributedString.ParagraphStyleAttributeName static NSString StrikethroughStyleAttributeName = (NSString)"NSStrikethrough"; private static NSMutableAttributedString buildAttributedString(string text, CTFont font, Color? fontColor=null) { // Create a new attributed string from text NSMutableAttributedString atts = new NSMutableAttributedString(text); var attRange = new NSRange(0, atts.Length); var attsDic = new NSMutableDictionary(); // Font attribute NSObject fontObject = new NSObject(font.Handle); attsDic.Add(FontAttributedName, fontObject); // -- end font if (fontColor.HasValue) { // Font color var fc = fontColor.Value; NSColor color = NSColor.FromDeviceRgba(fc.R / 255f, fc.G / 255f, fc.B / 255f, fc.A / 255f); NSObject colorObject = new NSObject(color.Handle); attsDic.Add(ForegroundColorAttributedName, colorObject); // -- end font Color } if (underLine) { // Underline int single = (int)MonoMac.AppKit.NSUnderlineStyle.Single; int solid = (int)MonoMac.AppKit.NSUnderlinePattern.Solid; var attss = single | solid; var underlineObject = NSNumber.FromInt32(attss); //var under = NSAttributedString.UnderlineStyleAttributeName.ToString(); attsDic.Add(UnderlineStyleAttributeName, underlineObject); // --- end underline } if (strikeThrough) { // StrikeThrough // NSColor bcolor = NSColor.Blue; // NSObject bcolorObject = new NSObject(bcolor.Handle); // attsDic.Add(NSAttributedString.StrikethroughColorAttributeName, bcolorObject); int stsingle = (int)MonoMac.AppKit.NSUnderlineStyle.Single; int stsolid = (int)MonoMac.AppKit.NSUnderlinePattern.Solid; var stattss = stsingle | stsolid; var stunderlineObject = NSNumber.FromInt32(stattss); attsDic.Add(StrikethroughStyleAttributeName, stunderlineObject); // --- end underline } // Text alignment var alignment = CTTextAlignment.Left; var alignmentSettings = new CTParagraphStyleSettings(); alignmentSettings.Alignment = alignment; var paragraphStyle = new CTParagraphStyle(alignmentSettings); NSObject psObject = new NSObject(paragraphStyle.Handle); // end text alignment attsDic.Add(ParagraphStyleAttributeName, psObject); atts.SetAttributes(attsDic, attRange); return atts; } #else public static ABC GetCharWidthABC(char ch, Font font, System.Drawing.Graphics gr) { ABC[] _temp = new ABC[1]; IntPtr hDC = gr.GetHdc(); Font ft = (Font)font.Clone(); IntPtr hFt = ft.ToHfont(); SelectObject(hDC, hFt); GetCharABCWidthsW(hDC, ch, ch, _temp); DeleteObject(hFt); gr.ReleaseHdc(); return _temp[0]; } #endif } ======= #if WINDOWS static class FontHelper { [StructLayout(LayoutKind.Sequential)] public struct ABC { public int abcA; public uint abcB; public int abcC; } [DllImport("gdi32.dll", ExactSpelling = true)] public static extern IntPtr SelectObject(IntPtr hDC, IntPtr hObj); [DllImport("gdi32.dll", ExactSpelling = true, SetLastError = true)] public static extern int DeleteObject(IntPtr hObj); [DllImport("gdi32.dll", ExactSpelling = true, CharSet = CharSet.Unicode, SetLastError = true)] public static extern bool GetCharABCWidthsW(IntPtr hdc, uint uFirstChar, uint uLastChar, [Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPStruct, SizeConst = 1)] ABC[] lpabc); public static ABC GetCharWidthABC(char ch, Font font, System.Drawing.Graphics gr) { ABC[] _temp = new ABC[1]; IntPtr hDC = gr.GetHdc(); Font ft = (Font)font.Clone(); IntPtr hFt = ft.ToHfont(); SelectObject(hDC, hFt); GetCharABCWidthsW(hDC, ch, ch, _temp); DeleteObject(hFt); gr.ReleaseHdc(); return _temp[0]; } } #endif #if LINUX static class FontHelper { [StructLayout(LayoutKind.Sequential)] public struct ABC { public int abcA; public uint abcB; public int abcC; } public static ABC GetCharWidthABC(char ch, Font font, System.Drawing.Graphics gr) { var sf = StringFormat.GenericTypographic; sf.Trimming = StringTrimming.None; sf.FormatFlags = StringFormatFlags.MeasureTrailingSpaces; return new ABC { abcA = 0, abcB = (uint)gr.MeasureString(ch.ToString(), font, new PointF(0, 0), sf).Width, abcC = 0 }; } } #endif >>>>>>> #if WINDOWS static class FontHelper { [StructLayout(LayoutKind.Sequential)] public struct ABC { public int abcA; public uint abcB; public int abcC; } [DllImport("gdi32.dll", ExactSpelling = true)] public static extern IntPtr SelectObject(IntPtr hDC, IntPtr hObj); [DllImport("gdi32.dll", ExactSpelling = true, SetLastError = true)] public static extern int DeleteObject(IntPtr hObj); [DllImport("gdi32.dll", ExactSpelling = true, CharSet = CharSet.Unicode, SetLastError = true)] public static extern bool GetCharABCWidthsW(IntPtr hdc, uint uFirstChar, uint uLastChar, [Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPStruct, SizeConst = 1)] ABC[] lpabc); #if MACOS static CTFont nativeFont; public static ABC GetCharWidthABC(char ch, Font font, System.Drawing.Graphics gr) { ABC[] _temp = new ABC[1]; var nativFont = CreateFont (font.Name, font.Size, font.Style, font.GdiCharSet, font.GdiVerticalFont); var atts = buildAttributedString(ch.ToString(), nativFont); // for now just a line not sure if this is going to work CTLine line = new CTLine(atts); float ascent; float descent; float leading; _temp[0].abcB = (uint)line.GetTypographicBounds(out ascent, out descent, out leading); return _temp[0]; } const byte DefaultCharSet = 1; static bool underLine = false; static bool strikeThrough = false; static float dpiScale = 96f / 72f; static internal CTFont CreateFont (string familyName, float emSize) { return CreateFont (familyName, emSize, FontStyle.Regular, DefaultCharSet, false); } static internal CTFont CreateFont (string familyName, float emSize, FontStyle style) { return CreateFont (familyName, emSize, style, DefaultCharSet, false); } static internal CTFont CreateFont (string familyName, float emSize, FontStyle style, byte gdiCharSet) { return CreateFont (familyName, emSize, style, gdiCharSet, false); } static internal CTFont CreateFont (string familyName, float emSize, FontStyle style, byte gdiCharSet, bool gdiVerticalFont ) { if (emSize <= 0) throw new ArgumentException("emSize is less than or equal to 0, evaluates to infinity, or is not a valid number.","emSize"); CTFont nativeFont; // convert to 96 Dpi to be consistent with Windows var dpiSize = emSize * dpiScale; try { nativeFont = new CTFont(familyName,dpiSize); } catch { nativeFont = new CTFont("Helvetica",dpiSize); } CTFontSymbolicTraits tMask = CTFontSymbolicTraits.None; if ((style & FontStyle.Bold) == FontStyle.Bold) tMask |= CTFontSymbolicTraits.Bold; if ((style & FontStyle.Italic) == FontStyle.Italic) tMask |= CTFontSymbolicTraits.Italic; strikeThrough = (style & FontStyle.Strikeout) == FontStyle.Strikeout; underLine = (style & FontStyle.Underline) == FontStyle.Underline; var nativeFont2 = nativeFont.WithSymbolicTraits(dpiSize,tMask,tMask); if (nativeFont2 != null) nativeFont = nativeFont2; return nativeFont; } static NSString FontAttributedName = (NSString)"NSFont"; static NSString ForegroundColorAttributedName = (NSString)"NSColor"; static NSString UnderlineStyleAttributeName = (NSString)"NSUnderline"; static NSString ParagraphStyleAttributeName = (NSString)"NSParagraphStyle"; //NSAttributedString.ParagraphStyleAttributeName static NSString StrikethroughStyleAttributeName = (NSString)"NSStrikethrough"; private static NSMutableAttributedString buildAttributedString(string text, CTFont font, Color? fontColor=null) { // Create a new attributed string from text NSMutableAttributedString atts = new NSMutableAttributedString(text); var attRange = new NSRange(0, atts.Length); var attsDic = new NSMutableDictionary(); // Font attribute NSObject fontObject = new NSObject(font.Handle); attsDic.Add(FontAttributedName, fontObject); // -- end font if (fontColor.HasValue) { // Font color var fc = fontColor.Value; NSColor color = NSColor.FromDeviceRgba(fc.R / 255f, fc.G / 255f, fc.B / 255f, fc.A / 255f); NSObject colorObject = new NSObject(color.Handle); attsDic.Add(ForegroundColorAttributedName, colorObject); // -- end font Color } if (underLine) { // Underline int single = (int)MonoMac.AppKit.NSUnderlineStyle.Single; int solid = (int)MonoMac.AppKit.NSUnderlinePattern.Solid; var attss = single | solid; var underlineObject = NSNumber.FromInt32(attss); //var under = NSAttributedString.UnderlineStyleAttributeName.ToString(); attsDic.Add(UnderlineStyleAttributeName, underlineObject); // --- end underline } if (strikeThrough) { // StrikeThrough // NSColor bcolor = NSColor.Blue; // NSObject bcolorObject = new NSObject(bcolor.Handle); // attsDic.Add(NSAttributedString.StrikethroughColorAttributeName, bcolorObject); int stsingle = (int)MonoMac.AppKit.NSUnderlineStyle.Single; int stsolid = (int)MonoMac.AppKit.NSUnderlinePattern.Solid; var stattss = stsingle | stsolid; var stunderlineObject = NSNumber.FromInt32(stattss); attsDic.Add(StrikethroughStyleAttributeName, stunderlineObject); // --- end underline } // Text alignment var alignment = CTTextAlignment.Left; var alignmentSettings = new CTParagraphStyleSettings(); alignmentSettings.Alignment = alignment; var paragraphStyle = new CTParagraphStyle(alignmentSettings); NSObject psObject = new NSObject(paragraphStyle.Handle); // end text alignment attsDic.Add(ParagraphStyleAttributeName, psObject); atts.SetAttributes(attsDic, attRange); return atts; } #else public static ABC GetCharWidthABC(char ch, Font font, System.Drawing.Graphics gr) { ABC[] _temp = new ABC[1]; IntPtr hDC = gr.GetHdc(); Font ft = (Font)font.Clone(); IntPtr hFt = ft.ToHfont(); SelectObject(hDC, hFt); GetCharABCWidthsW(hDC, ch, ch, _temp); DeleteObject(hFt); gr.ReleaseHdc(); return _temp[0]; } #endif } #endif #if LINUX static class FontHelper { [StructLayout(LayoutKind.Sequential)] public struct ABC { public int abcA; public uint abcB; public int abcC; } public static ABC GetCharWidthABC(char ch, Font font, System.Drawing.Graphics gr) { var sf = StringFormat.GenericTypographic; sf.Trimming = StringTrimming.None; sf.FormatFlags = StringFormatFlags.MeasureTrailingSpaces; return new ABC { abcA = 0, abcB = (uint)gr.MeasureString(ch.ToString(), font, new PointF(0, 0), sf).Width, abcC = 0 }; } } #endif
<<<<<<< case SurfaceFormat.RgbaATCExplicitAlpha: glInternalFormat = (PixelInternalFormat)All.AtcRgbaExplicitAlphaAmd; glFormat = (PixelFormat)All.CompressedTextureFormats; break; case SurfaceFormat.RgbaATCInterpolatedAlpha: glInternalFormat = (PixelInternalFormat)All.AtcRgbaInterpolatedAlphaAmd; glFormat = (PixelFormat)All.CompressedTextureFormats; break; ======= case SurfaceFormat.Dxt5SRgb: if (!supportsSRgb) goto case SurfaceFormat.Dxt5; glInternalFormat = (PixelInternalFormat)0x8C4F; glFormat = (PixelFormat)All.CompressedTextureFormats; break; >>>>>>> case SurfaceFormat.Dxt5SRgb: if (!supportsSRgb) goto case SurfaceFormat.Dxt5; glInternalFormat = (PixelInternalFormat)0x8C4F; glFormat = (PixelFormat)All.CompressedTextureFormats; break; case SurfaceFormat.RgbaATCExplicitAlpha: glInternalFormat = (PixelInternalFormat)All.AtcRgbaExplicitAlphaAmd; glFormat = (PixelFormat)All.CompressedTextureFormats; break; case SurfaceFormat.RgbaATCInterpolatedAlpha: glInternalFormat = (PixelInternalFormat)All.AtcRgbaInterpolatedAlphaAmd; glFormat = (PixelFormat)All.CompressedTextureFormats; break;
<<<<<<< Dictionary<long, NetConnection> connectedGamers = new Dictionary<long, NetConnection>(); bool online = false; private static int port = 3074; private static IPEndPoint m_masterServer; private static int masterserverport = 6000; private static string masterServer = "86.19.223.140"; ======= //Dictionary<long, NetConnection> connectedGamers = new Dictionary<long, NetConnection>(); >>>>>>> //Dictionary<long, NetConnection> connectedGamers = new Dictionary<long, NetConnection>(); bool online = false; private static int port = 3074; private static IPEndPoint m_masterServer; private static int masterserverport = 6000; private static string masterServer = "86.19.223.140"; <<<<<<< } ======= CommandGamerLeft cgj = new CommandGamerLeft(msg.SenderConnection.RemoteUniqueIdentifier); CommandEvent cmde = new CommandEvent(cgj); session.commandQueue.Enqueue(cmde); } >>>>>>> CommandGamerLeft cgj = new CommandGamerLeft(msg.SenderConnection.RemoteUniqueIdentifier); CommandEvent cmde = new CommandEvent(cgj); session.commandQueue.Enqueue(cmde); } <<<<<<< GamerStates gamerstate = (GamerStates)msg.ReadInt32(); gamerstate &= ~GamerStates.Local; Console.WriteLine("State Change from: " + msg.SenderEndpoint + " new State: " + gamerstate); ======= GamerStates state = (GamerStates)msg.ReadInt32(); state &= ~GamerStates.Local; >>>>>>> GamerStates gamerstate = (GamerStates)msg.ReadInt32(); gamerstate &= ~GamerStates.Local; Console.WriteLine("State Change from: " + msg.SenderEndpoint + " new State: " + gamerstate);
<<<<<<< { AssertNotDisposed(); ======= { _platform.BeforeInitialize(); >>>>>>> { AssertNotDisposed(); _platform.BeforeInitialize();
<<<<<<< // Initialize GameTime _updateGameTime = new GameTime(); _drawGameTime = new GameTime(); gesture = new GestureDetector(new GestureListener((AndroidGameActivity)this.Context)); ======= gesture = new GestureDetector(new GestureListener((AndroidGameActivity)this.Context)); >>>>>>> // Initialize GameTime _updateGameTime = new GameTime(); _drawGameTime = new GameTime(); gesture = new GestureDetector(new GestureListener((AndroidGameActivity)this.Context)); <<<<<<< resetUpdateElapsedTime = true; resetRenderElapsedTime = true; ======= >>>>>>> resetUpdateElapsedTime = true; resetRenderElapsedTime = true; <<<<<<< { // Allow threaded resource loading OpenTK.Graphics.GraphicsContext.ShareContexts = true; #if true try ======= { switch (AndroidCompatibility.ESVersion) { case AndroidCompatibility.ESVersions.v1_1: StartES1_1(); break; case AndroidCompatibility.ESVersions.v2_0: StartES2_0(); break; default: throw new NotImplementedException(); } _game.GraphicsDevice.Initialize(_game.Platform); } private void StartES2_0() { try >>>>>>> { // Allow threaded resource loading OpenTK.Graphics.GraphicsContext.ShareContexts = true; #if true try <<<<<<< base.CreateFrameBuffer(); } catch (Exception) #endif { #if ES11 //device doesn't support OpenGLES 2.0; retry with 1.1: GLContextVersion = GLContextVersion.Gles1_1; base.CreateFrameBuffer(); #else throw new NotSupportedException("Could not create OpenGLES 2.0 frame buffer"); #endif } if (_game.GraphicsDevice != null) { _game.GraphicsDevice.Initialize(); } if (!GraphicsContext.IsCurrent) MakeCurrent(); // Create a context for the background loading GraphicsContextFlags flags = GraphicsContextFlags.Default; #if DEBUG //flags |= GraphicsContextFlags.Debug; #endif GraphicsMode mode = new GraphicsMode(); BackgroundContext = new GraphicsContext(mode, WindowInfo, 2, 0, flags); Threading.BackgroundContext = BackgroundContext; Threading.WindowInfo = WindowInfo; } protected override void OnLoad(EventArgs e) { // FIXME: Uncomment this line when moving to Mono for Android 4.0.5 //MakeCurrent(); // Make sure an Update is called before a Draw updateFrameElapsed = _game.TargetElapsedTime.TotalSeconds; base.OnLoad(e); } ======= GraphicsDevice.OpenGLESVersion = GLContextVersion; base.CreateFrameBuffer(); } catch (Exception) { //device doesn't support OpenGLES 2.0; retry with 1.1: StartES1_1(); } } private void StartES1_1() { GLContextVersion = GLContextVersion.Gles1_1; GraphicsDevice.OpenGLESVersion = GLContextVersion; base.CreateFrameBuffer(); } >>>>>>> base.CreateFrameBuffer(); } catch (Exception) #endif { #if ES11 //device doesn't support OpenGLES 2.0; retry with 1.1: GLContextVersion = GLContextVersion.Gles1_1; base.CreateFrameBuffer(); #else throw new NotSupportedException("Could not create OpenGLES 2.0 frame buffer"); #endif } if (_game.GraphicsDevice != null) { _game.GraphicsDevice.Initialize(); } if (!GraphicsContext.IsCurrent) MakeCurrent(); // Create a context for the background loading GraphicsContextFlags flags = GraphicsContextFlags.Default; #if DEBUG //flags |= GraphicsContextFlags.Debug; #endif GraphicsMode mode = new GraphicsMode(); BackgroundContext = new GraphicsContext(mode, WindowInfo, 2, 0, flags); Threading.BackgroundContext = BackgroundContext; Threading.WindowInfo = WindowInfo; } protected override void OnLoad(EventArgs e) { // FIXME: Uncomment this line when moving to Mono for Android 4.0.5 //MakeCurrent(); // Make sure an Update is called before a Draw updateFrameElapsed = _game.TargetElapsedTime.TotalSeconds; base.OnLoad(e); } <<<<<<< if (_game != null) { double targetElapsed = _game.TargetElapsedTime.TotalSeconds; renderFrameElapsed += e.Time; if (renderFrameElapsed < (renderFrameLast + targetElapsed)) return; if (resetRenderElapsedTime) { renderFrameElapsed = renderFrameLast + targetElapsed; resetRenderElapsedTime = false; } double delta = renderFrameElapsed - renderFrameLast; _drawGameTime.Update(TimeSpan.FromSeconds(delta)); // If the elapsed time is more than the target elapsed time, the game is running slowly _drawGameTime.IsRunningSlowly = delta > targetElapsed; _game.DoDraw(_drawGameTime); renderFrameLast = renderFrameElapsed; } try ======= if (_game != null ) //Only call draw if an update has occured >>>>>>> if (_game != null) { double targetElapsed = _game.TargetElapsedTime.TotalSeconds; renderFrameElapsed += e.Time; if (renderFrameElapsed < (renderFrameLast + targetElapsed)) return; if (resetRenderElapsedTime) { renderFrameElapsed = renderFrameLast + targetElapsed; resetRenderElapsedTime = false; } double delta = renderFrameElapsed - renderFrameLast; _drawGameTime.Update(TimeSpan.FromSeconds(delta)); // If the elapsed time is more than the target elapsed time, the game is running slowly _drawGameTime.IsRunningSlowly = delta > targetElapsed; _game.DoDraw(_drawGameTime); renderFrameLast = renderFrameElapsed; } try <<<<<<< protected override void OnUpdateFrame(FrameEventArgs e) { base.OnUpdateFrame(e); if (_game != null ) { double targetElapsed = _game.TargetElapsedTime.TotalSeconds; updateFrameElapsed += e.Time; if (updateFrameElapsed < (updateFrameLast + targetElapsed)) return; if (resetUpdateElapsedTime) { updateFrameElapsed = updateFrameLast + targetElapsed; resetUpdateElapsedTime = false; } double delta = updateFrameElapsed - updateFrameLast; if (_game.IsFixedTimeStep) { // If we will be calling Update two or more times, the game is running slowly _updateGameTime.IsRunningSlowly = updateFrameElapsed >= updateFrameLast + (targetElapsed * 2.0); double start = updateFrameLast; while ((delta >= targetElapsed) && ((updateFrameLast - start) < 0.5)) { _updateGameTime.Update(TimeSpan.FromSeconds(targetElapsed)); _game.DoUpdate(_updateGameTime); delta -= targetElapsed; updateFrameLast += targetElapsed; } } else { // No fixed step, so just update once with a potentially large elapsed time _updateGameTime.Update(TimeSpan.FromSeconds(delta)); // If the elapsed time is more than the target elapsed time, the game is running slowly _updateGameTime.IsRunningSlowly = delta > targetElapsed; _game.DoUpdate(_updateGameTime); updateFrameLast = updateFrameElapsed; } } } ======= >>>>>>> protected override void OnUpdateFrame(FrameEventArgs e) { base.OnUpdateFrame(e); if (_game != null ) { double targetElapsed = _game.TargetElapsedTime.TotalSeconds; updateFrameElapsed += e.Time; if (updateFrameElapsed < (updateFrameLast + targetElapsed)) return; if (resetUpdateElapsedTime) { updateFrameElapsed = updateFrameLast + targetElapsed; resetUpdateElapsedTime = false; } double delta = updateFrameElapsed - updateFrameLast; if (_game.IsFixedTimeStep) { // If we will be calling Update two or more times, the game is running slowly _updateGameTime.IsRunningSlowly = updateFrameElapsed >= updateFrameLast + (targetElapsed * 2.0); double start = updateFrameLast; while ((delta >= targetElapsed) && ((updateFrameLast - start) < 0.5)) { _updateGameTime.Update(TimeSpan.FromSeconds(targetElapsed)); _game.DoUpdate(_updateGameTime); delta -= targetElapsed; updateFrameLast += targetElapsed; } } else { // No fixed step, so just update once with a potentially large elapsed time _updateGameTime.Update(TimeSpan.FromSeconds(delta)); // If the elapsed time is more than the target elapsed time, the game is running slowly _updateGameTime.IsRunningSlowly = delta > targetElapsed; _game.DoUpdate(_updateGameTime); updateFrameLast = updateFrameElapsed; } } }
<<<<<<< #if OPENGL Threading.BlockOnUIThread(() => ======= Threading.Begin(); try >>>>>>> Threading.BlockOnUIThread(() => <<<<<<< }); #elif DIRECTX var d3dDevice = device._d3dDevice; if (isVertexShader) { _vertexShader = new VertexShader(d3dDevice, shaderBytecode, null); // We need the bytecode later for allocating the // input layout from the vertex declaration. _shaderBytecode = shaderBytecode; } else _pixelShader = new PixelShader(d3dDevice, shaderBytecode); ======= } finally { Threading.End(); } >>>>>>> });
<<<<<<< return texture; #elif WINDOWS_STOREAPP ======= Texture2D texture = null; Threading.BlockOnUIThread(() => { texture = new Texture2D(graphicsDevice, width, height, false, SurfaceFormat.Color); texture.SetData<int>(pixels); }); return texture; } #elif WINRT >>>>>>> Texture2D texture = null; Threading.BlockOnUIThread(() => { texture = new Texture2D(graphicsDevice, width, height, false, SurfaceFormat.Color); texture.SetData<int>(pixels); }); return texture; } #elif WINDOWS_STOREAPP
<<<<<<< _platform = GamePlatform.Create(this); _platform.Activated += Platform_Activated; _platform.Deactivated += Platform_Deactivated; _services.AddService(typeof(GamePlatform), _platform); // Set the window title. // TODO: Get the title from the WindowsPhoneManifest.xml for WP7 projects. string windowTitle = string.Empty; var assembly = Assembly.GetCallingAssembly(); //Use the Title attribute of the Assembly if possible. var assemblyTitleAtt = ((AssemblyTitleAttribute)AssemblyTitleAttribute.GetCustomAttribute(assembly, typeof(AssemblyTitleAttribute))); if (assemblyTitleAtt != null) windowTitle = assemblyTitleAtt.Title; // Otherwise, fallback to the Name of the assembly. if (string.IsNullOrEmpty(windowTitle)) windowTitle = assembly.GetName().Name; #if !ANDROID && !IPHONE Window.Title = windowTitle; #endif ======= Platform = GamePlatform.Create(this); Platform.Activated += Platform_Activated; Platform.Deactivated += Platform_Deactivated; _services.AddService(typeof(GamePlatform), Platform); >>>>>>> Platform = GamePlatform.Create(this); Platform.Activated += Platform_Activated; Platform.Deactivated += Platform_Deactivated; _services.AddService(typeof(GamePlatform), Platform); // Set the window title. // TODO: Get the title from the WindowsPhoneManifest.xml for WP7 projects. string windowTitle = string.Empty; var assembly = Assembly.GetCallingAssembly(); //Use the Title attribute of the Assembly if possible. var assemblyTitleAtt = ((AssemblyTitleAttribute)AssemblyTitleAttribute.GetCustomAttribute(assembly, typeof(AssemblyTitleAttribute))); if (assemblyTitleAtt != null) windowTitle = assemblyTitleAtt.Title; // Otherwise, fallback to the Name of the assembly. if (string.IsNullOrEmpty(windowTitle)) windowTitle = assembly.GetName().Name; #if !ANDROID && !IPHONE Window.Title = windowTitle; #endif <<<<<<< _platform.Exit(); ======= Platform.Exit(); >>>>>>> Platform.Exit(); <<<<<<< _platform.ResetElapsedTime(); _lastUpdate = DateTime.Now; ======= Platform.ResetElapsedTime(); _gameTime.ResetElapsedTime(); >>>>>>> Platform.ResetElapsedTime(); _lastUpdate = DateTime.Now; _gameTime.ResetElapsedTime(); <<<<<<< DoInitialize(); ======= // In an original XNA game the GraphicsDevice property is null // during initialization but before the Game's Initialize method is // called the property is available so we can only assume that it // should be created somewhere in here. We cannot set the viewport // values correctly based on the Preferred settings which is causing // some problems on some Microsoft samples which we are not handling // correctly. graphicsDeviceManager.CreateDevice(); applyChanges(graphicsDeviceManager); Platform.BeforeInitialize(); Initialize(); >>>>>>> DoInitialize(); <<<<<<< Raise(Exiting, EventArgs.Empty); ======= Raise(Exiting, args); >>>>>>> Raise(Exiting, args); <<<<<<< var viewport = new Viewport(0, 0, GraphicsDevice.PresentationParameters.BackBufferWidth, GraphicsDevice.PresentationParameters.BackBufferHeight); ======= // FIXME: Is this the correct/best way to set the viewport? There // are/were several snippets like this through the project. var viewport = new Viewport(); viewport.X = 0; viewport.Y = 0; #if WINDOWS || LINUX viewport.Width = manager.PreferredBackBufferWidth;// GraphicsDevice.PresentationParameters.BackBufferWidth; viewport.Height = manager.PreferredBackBufferHeight;// GraphicsDevice.PresentationParameters.BackBufferHeight; #else viewport.Width = GraphicsDevice.PresentationParameters.BackBufferWidth; viewport.Height = GraphicsDevice.PresentationParameters.BackBufferHeight; #endif >>>>>>> var viewport = new Viewport(0, 0, GraphicsDevice.PresentationParameters.BackBufferWidth, GraphicsDevice.PresentationParameters.BackBufferHeight); <<<<<<< ((OpenTKGamePlatform)_platform).ResetWindowBounds(changed); ======= ((LinuxGamePlatform)Platform).ResetWindowBounds(changed); >>>>>>> ((OpenTKGamePlatform)_platform).ResetWindowBounds(changed);
<<<<<<< this._folderDeleteMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this._folderRebuildMenuItem = new System.Windows.Forms.ToolStripMenuItem(); ======= this._buildLaunchDebuggerMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this._rebuildLaunchDebuggerMenuItem = new System.Windows.Forms.ToolStripMenuItem(); >>>>>>> this._folderDeleteMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this._folderRebuildMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this._buildLaunchDebuggerMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this._rebuildLaunchDebuggerMenuItem = new System.Windows.Forms.ToolStripMenuItem(); <<<<<<< this._itemContextMenu.Size = new System.Drawing.Size(132, 54); this._itemContextMenu.Opening += new System.ComponentModel.CancelEventHandler(this.MainMenuMenuActivate); ======= this._itemContextMenu.Size = new System.Drawing.Size(132, 54); this._itemContextMenu.Opening += new System.ComponentModel.CancelEventHandler(this._mainMenu_MenuActivate); >>>>>>> this._itemContextMenu.Size = new System.Drawing.Size(132, 54); this._itemContextMenu.Opening += new System.ComponentModel.CancelEventHandler(this.MainMenuMenuActivate); <<<<<<< // _folderDeleteMenuItem // this._folderDeleteMenuItem.Name = "_folderDeleteMenuItem"; this._folderDeleteMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Delete; this._folderDeleteMenuItem.Size = new System.Drawing.Size(132, 22); this._folderDeleteMenuItem.Text = "&Delete"; this._folderDeleteMenuItem.Click += new System.EventHandler(this.DeleteMenuItem_Click); // // _folderRebuildMenuItem // this._folderRebuildMenuItem.Name = "_folderRebuildMenuItem"; this._folderRebuildMenuItem.Size = new System.Drawing.Size(132, 22); this._folderRebuildMenuItem.Text = "Rebuild"; this._folderRebuildMenuItem.Click += new System.EventHandler(this.ItemRebuildMenuItemClick); // ======= // _buildLaunchDebuggerMenuItem // this._buildLaunchDebuggerMenuItem.Name = "_buildLaunchDebuggerMenuItem"; this._buildLaunchDebuggerMenuItem.Size = new System.Drawing.Size(168, 22); this._buildLaunchDebuggerMenuItem.Text = "Launch Debugger"; this._buildLaunchDebuggerMenuItem.Click += new System.EventHandler(this.BuildLaunchDebuggerMenuItemClick); // // _rebuildLaunchDebuggerMenuItem // this._rebuildLaunchDebuggerMenuItem.Name = "_rebuildLaunchDebuggerMenuItem"; this._rebuildLaunchDebuggerMenuItem.Size = new System.Drawing.Size(168, 22); this._rebuildLaunchDebuggerMenuItem.Text = "Launch Debugger"; this._rebuildLaunchDebuggerMenuItem.Click += new System.EventHandler(this.RebuildLaunchDebuggerMenuItemClick); // >>>>>>> // this._folderDeleteMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Delete; // // // <<<<<<< private System.Windows.Forms.ToolStripMenuItem _folderDeleteMenuItem; private System.Windows.Forms.ToolStripMenuItem _folderRebuildMenuItem; ======= private System.Windows.Forms.ToolStripMenuItem _buildLaunchDebuggerMenuItem; private System.Windows.Forms.ToolStripMenuItem _rebuildLaunchDebuggerMenuItem; >>>>>>>
<<<<<<< _viewport.Width = DisplayMode.Width; _viewport.Height = DisplayMode.Height; if (ResourcesLost) { ContentManager.ReloadAllContent(); ResourcesLost = false; ======= if (ResourcesLost) { ContentManager.ReloadAllContent(); ResourcesLost = false; >>>>>>> _viewport.Width = DisplayMode.Width; _viewport.Height = DisplayMode.Height; if (ResourcesLost) { ContentManager.ReloadAllContent(); ResourcesLost = false; <<<<<<< switch (this.PresentationParameters.DisplayOrientation) { case DisplayOrientation.Portrait: { _scissorRectangle.Y = _viewport.Height - _scissorRectangle.Y - _scissorRectangle.Height; break; } case DisplayOrientation.LandscapeLeft: { var x = _scissorRectangle.X; _scissorRectangle.X = _viewport.Width - _scissorRectangle.Height - _scissorRectangle.Y; _scissorRectangle.Y = _viewport.Height - _scissorRectangle.Width - x; // Swap Width and Height var w = _scissorRectangle.Width; _scissorRectangle.Width = _scissorRectangle.Height; _scissorRectangle.Height = w; break; } case DisplayOrientation.LandscapeRight: { // Swap X and Y var x = _scissorRectangle.X; _scissorRectangle.X = _scissorRectangle.Y; _scissorRectangle.Y = x; // Swap Width and Height var w = _scissorRectangle.Width; _scissorRectangle.Width = _scissorRectangle.Height; _scissorRectangle.Height = w; break; } case DisplayOrientation.PortraitUpsideDown: { _scissorRectangle.Y = _viewport.Height - _scissorRectangle.Height - _scissorRectangle.Y; _scissorRectangle.X = _viewport.Width - _scissorRectangle.Width - _scissorRectangle.X; break; } case DisplayOrientation.Default: { _scissorRectangle.Y = _viewport.Height - _scissorRectangle.Y - _scissorRectangle.Height; break; } } GLStateManager.SetScissor(_scissorRectangle); ======= _scissorRectangle.Y = _viewport.Height - _scissorRectangle.Y - _scissorRectangle.Height; >>>>>>> GLStateManager.SetScissor(_scissorRectangle); _scissorRectangle.Y = _viewport.Height - _scissorRectangle.Y - _scissorRectangle.Height;
<<<<<<< internal uint glFramebuffer; #elif PSM internal FrameBuffer _frameBuffer; ======= >>>>>>> #elif PSM internal FrameBuffer _frameBuffer;
<<<<<<< public void Begin () ======= /// <summary> ///Initialize shaders and program on OpenGLES2.0 /// </summary> private void InitGL20() { string vertexShaderSrc = @" uniform mat4 uMVPMatrix; attribute vec4 aPosition; attribute vec2 aTexCoord; attribute vec4 aTint; varying vec2 vTexCoord; varying vec4 vTint; void main() { vTexCoord = aTexCoord; vTint = aTint; gl_Position = uMVPMatrix * aPosition; }"; string fragmentShaderSrc = @"precision mediump float; varying vec2 vTexCoord; varying vec4 vTint; uniform sampler2D sTexture; void main() { vec4 baseColor = texture2D(sTexture, vTexCoord); gl_FragColor = baseColor * vTint; }"; int vertexShader = LoadShader (ALL20.VertexShader, vertexShaderSrc ); int fragmentShader = LoadShader (ALL20.FragmentShader, fragmentShaderSrc ); program = GL20.CreateProgram(); if (program == 0) throw new InvalidOperationException ("Unable to create program"); GL20.AttachShader (program, vertexShader); GL20.AttachShader (program, fragmentShader); //Set position GL20.BindAttribLocation (program, _batcher.attributePosition, "aPosition"); GL20.BindAttribLocation (program, _batcher.attributeTexCoord, "aTexCoord"); GL20.BindAttribLocation (program, _batcher.attributeTint, "aTint"); GL20.LinkProgram (program); int linked = 0; GL20.GetProgram (program, ALL20.LinkStatus, ref linked); if (linked == 0) { // link failed int length = 0; GL20.GetProgram (program, ALL20.InfoLogLength, ref length); if (length > 0) { var log = new StringBuilder (length); GL20.GetProgramInfoLog (program, length, ref length, log); Console.WriteLine ("GL2.0 error: " + log.ToString ()); } GL20.DeleteProgram (program); throw new InvalidOperationException ("Unable to link program"); } #if ANDROID lastDisplayOrientation = DisplayOrientation.Unknown; UpdateWorldMatrixOrientation(); #else lastDisplayOrientation = graphicsDevice.PresentationParameters.DisplayOrientation; matViewScreen = Matrix4.CreateRotationZ((float)Math.PI)* Matrix4.CreateRotationY((float)Math.PI)* Matrix4.CreateTranslation(-this.graphicsDevice.Viewport.Width/2, this.graphicsDevice.Viewport.Height/2, 1); matViewFramebuffer = Matrix4.CreateTranslation(-this.graphicsDevice.Viewport.Width/2, -this.graphicsDevice.Viewport.Height/2, 1); matProjection = Matrix4.CreateOrthographic(this.graphicsDevice.Viewport.Width, this.graphicsDevice.Viewport.Height, -1f,1f); matWVPScreen = matViewScreen * matProjection; matWVPFramebuffer = matViewFramebuffer * matProjection; #endif GetUniformVariables(); } /// <summary> /// Build the shaders /// </summary> private int LoadShader ( ALL20 type, string source ) { int shader = GL20.CreateShader(type); if ( shader == 0 ) throw new InvalidOperationException("Unable to create shader"); // Load the shader source int length = 0; GL20.ShaderSource(shader, 1, new string[] {source}, (int[])null); // Compile the shader GL20.CompileShader( shader ); int compiled = 0; GL20.GetShader (shader, ALL20.CompileStatus, ref compiled); if (compiled == 0) { length = 0; GL20.GetShader (shader, ALL20.InfoLogLength, ref length); if (length > 0) { var log = new StringBuilder (length); GL20.GetShaderInfoLog (shader, length, ref length, log); Console.WriteLine("GL2" + log.ToString ()); } GL20.DeleteShader (shader); throw new InvalidOperationException ("Unable to compile shader of type : " + type.ToString ()); } return shader; } private void GetUniformVariables() >>>>>>> public void Begin () <<<<<<< } #else // Switch on the flags. switch (this.graphicsDevice.PresentationParameters.DisplayOrientation) { case DisplayOrientation.LandscapeLeft: { GL.Rotate (-90, 0, 0, 1); GL.Ortho (0, this.graphicsDevice.Viewport.Height, this.graphicsDevice.Viewport.Width, 0, -1, 1); break; } case DisplayOrientation.LandscapeRight: { GL.Rotate (90, 0, 0, 1); GL.Ortho (0, this.graphicsDevice.Viewport.Height, this.graphicsDevice.Viewport.Width, 0, -1, 1); break; } case DisplayOrientation.PortraitUpsideDown: { GL.Rotate (180, 0, 0, 1); GL.Ortho (0, this.graphicsDevice.Viewport.Width, this.graphicsDevice.Viewport.Height, 0, -1, 1); break; } default: { GL.Ortho (0, this.graphicsDevice.Viewport.Width, this.graphicsDevice.Viewport.Height, 0, -1, 1); break; } } #endif #endif ======= } #else GL11.Ortho(0, this.graphicsDevice.Viewport.Width, this.graphicsDevice.Viewport.Height, 0, -1, 1); #endif >>>>>>> } #else GL.Ortho(0, this.graphicsDevice.Viewport.Width, this.graphicsDevice.Viewport.Height, 0, -1, 1); #endif #endif <<<<<<< ======= GL11.MatrixMode(ALL11.Modelview); GL11.Viewport(0, 0, this.graphicsDevice.Viewport.Width, this.graphicsDevice.Viewport.Height); >>>>>>>
<<<<<<< #elif WINDOWS_STOREAPP ======= #endif #if WINDOWS_MEDIA_ENGINE || WINDOWS_MEDIA_SESSION >>>>>>> #endif #if WINDOWS_MEDIA_ENGINE || WINDOWS_MEDIA_SESSION <<<<<<< #if WINDOWS_STOREAPP private static MediaEngine _mediaEngineEx; ======= #if WINDOWS_MEDIA_ENGINE private static readonly MediaEngine _mediaEngineEx; >>>>>>> #if WINDOWS_MEDIA_ENGINE private static readonly MediaEngine _mediaEngineEx; <<<<<<< #if WINDOWS_STOREAPP ======= #if WINDOWS_MEDIA_ENGINE >>>>>>> #if WINDOWS_MEDIA_ENGINE <<<<<<< #elif WINDOWS_PHONE _mediaElement.IsMuted = value; ======= #elif WINDOWS_MEDIA_SESSION // FIX ME! >>>>>>> #elif WINDOWS_MEDIA_SESSION // FIX ME! #elif WINDOWS_PHONE _mediaElement.IsMuted = value; <<<<<<< #if WINDOWS_STOREAPP ======= #if WINDOWS_MEDIA_ENGINE >>>>>>> #if WINDOWS_MEDIA_ENGINE <<<<<<< ======= >>>>>>> <<<<<<< #if WINDOWS_STOREAPP _mediaEngineEx.Volume = value; #elif WINDOWS_PHONE _mediaElement.Volume = value; ======= #if WINDOWS_MEDIA_ENGINE _mediaEngineEx.Volume = value; #elif WINDOWS_MEDIA_SESSION // TODO! >>>>>>> #if WINDOWS_MEDIA_ENGINE _mediaEngineEx.Volume = value; #elif WINDOWS_MEDIA_SESSION // TODO! #elif WINDOWS_PHONE _mediaElement.Volume = value; <<<<<<< if (State == MediaState.Stopped) ======= if (State != MediaState.Playing || _queue.ActiveSong == null) >>>>>>> if (State == MediaState.Stopped) <<<<<<< #if WINDOWS_STOREAPP ======= #if WINDOWS_MEDIA_ENGINE >>>>>>> #if WINDOWS_MEDIA_ENGINE <<<<<<< #elif WINDOWS_PHONE Deployment.Current.Dispatcher.BeginInvoke(() => { _mediaElement.Pause(); }); ======= #elif WINDOWS_MEDIA_SESSION _session.Pause(); >>>>>>> #elif WINDOWS_MEDIA_SESSION _session.Pause(); #elif WINDOWS_PHONE Deployment.Current.Dispatcher.BeginInvoke(() => { _mediaElement.Pause(); }); <<<<<<< { #if WINDOWS_STOREAPP ======= { #if WINDOWS_MEDIA_ENGINE >>>>>>> { #if WINDOWS_MEDIA_ENGINE <<<<<<< #elif WINDOWS_PHONE Deployment.Current.Dispatcher.BeginInvoke(() => { _mediaElement.Source = new Uri(song.FilePath, UriKind.Relative); _mediaElement.Play(); // Ensure only one subscribe _mediaElement.MediaEnded -= OnSongFinishedPlaying; _mediaElement.MediaEnded += OnSongFinishedPlaying; }); ======= #elif WINDOWS_MEDIA_SESSION // TODO! >>>>>>> #elif WINDOWS_MEDIA_SESSION // TODO! #elif WINDOWS_PHONE Deployment.Current.Dispatcher.BeginInvoke(() => { _mediaElement.Source = new Uri(song.FilePath, UriKind.Relative); _mediaElement.Play(); // Ensure only one subscribe if (this.OnSongFinishedPlaying == null) _mediaElement.MediaEnded += OnSongFinishedPlaying; }); <<<<<<< #if WINDOWS_STOREAPP _mediaEngineEx.Play(); #elif WINDOWS_PHONE Deployment.Current.Dispatcher.BeginInvoke(() => { _mediaElement.Play(); }); ======= #if WINDOWS_MEDIA_ENGINE _mediaEngineEx.Play(); #elif WINDOWS_MEDIA_SESSION _session.Start(null, null); >>>>>>> #if WINDOWS_MEDIA_ENGINE _mediaEngineEx.Play(); #elif WINDOWS_MEDIA_SESSION _session.Start(null, null); #elif WINDOWS_PHONE Deployment.Current.Dispatcher.BeginInvoke(() => { _mediaElement.Play(); }); <<<<<<< #if WINDOWS_STOREAPP ======= #if WINDOWS_MEDIA_ENGINE >>>>>>> #if WINDOWS_MEDIA_ENGINE <<<<<<< #elif WINDOWS_PHONE Deployment.Current.Dispatcher.BeginInvoke(() => { _mediaElement.Stop(); }); ======= #elif WINDOWS_MEDIA_SESSION _session.Stop(); >>>>>>> #elif WINDOWS_MEDIA_SESSION _session.Stop(); #elif WINDOWS_PHONE Deployment.Current.Dispatcher.BeginInvoke(() => { _mediaElement.Stop(); });
<<<<<<< ======= void Flush() { _batcher.DrawBatch (_sortMode, graphicsDevice.SamplerStates[0]); } void CheckValid(Texture2D texture) { if (texture == null) throw new ArgumentNullException("texture"); if (!beginCalled) throw new InvalidOperationException("Draw was called, but Begin has not yet been called. Begin must be called successfully before you can call Draw."); } void CheckValid(SpriteFont spriteFont, string text) { if (spriteFont == null) throw new ArgumentNullException("spriteFont"); if (text == null) throw new ArgumentNullException("text"); if (!beginCalled) throw new InvalidOperationException("DrawString was called, but Begin has not yet been called. Begin must be called successfully before you can call DrawString."); } void CheckValid(SpriteFont spriteFont, StringBuilder text) { if (spriteFont == null) throw new ArgumentNullException("spriteFont"); if (text == null) throw new ArgumentNullException("text"); if (!beginCalled) throw new InvalidOperationException("DrawString was called, but Begin has not yet been called. Begin must be called successfully before you can call DrawString."); } >>>>>>> void Flush() { _batcher.DrawBatch (_sortMode, graphicsDevice.SamplerStates[0]); } void CheckValid(Texture2D texture) { if (texture == null) throw new ArgumentNullException("texture"); if (!beginCalled) throw new InvalidOperationException("Draw was called, but Begin has not yet been called. Begin must be called successfully before you can call Draw."); } void CheckValid(SpriteFont spriteFont, string text) { if (spriteFont == null) throw new ArgumentNullException("spriteFont"); if (text == null) throw new ArgumentNullException("text"); if (!beginCalled) throw new InvalidOperationException("DrawString was called, but Begin has not yet been called. Begin must be called successfully before you can call DrawString."); } void CheckValid(SpriteFont spriteFont, StringBuilder text) { if (spriteFont == null) throw new ArgumentNullException("spriteFont"); if (text == null) throw new ArgumentNullException("text"); if (!beginCalled) throw new InvalidOperationException("DrawString was called, but Begin has not yet been called. Begin must be called successfully before you can call DrawString."); } <<<<<<< if (texture == null) throw new ArgumentException ("texture"); ======= CheckValid(texture); >>>>>>> CheckValid(texture);
<<<<<<< ======= #if DEBUG && !WINDOWS_PHONE var licenseInformation = CurrentAppSimulator.LicenseInformation; #else >>>>>>> <<<<<<< MessageBoxIcon icon); public static Nullable<int> ShowMessageBox(string title, string text, IEnumerable<string> buttons, int focusButton, MessageBoxIcon icon) { int? result = null; IsVisible = true; #if WINRT MessageDialog dialog = new MessageDialog(text, title); foreach (string button in buttons) dialog.Commands.Add(new UICommand(button, null, dialog.Commands.Count)); if (focusButton < 0 || focusButton >= dialog.Commands.Count) throw new ArgumentOutOfRangeException("focusButton", "Specified argument was out of the range of valid values."); dialog.DefaultCommandIndex = (uint)focusButton; // The message box must be popped up on the UI thread. Task<IUICommand> dialogResult = null; _dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { dialogResult = dialog.ShowAsync().AsTask(); }).AsTask().Wait(); dialogResult.Wait(); result = (int)dialogResult.Result.Id; #endif IsVisible = false; return result; } public static IAsyncResult BeginShowMessageBox( PlayerIndex player, string title, string text, IEnumerable<string> buttons, int focusButton, MessageBoxIcon icon, AsyncCallback callback, Object state ) { // TODO: GuideAlreadyVisibleException if (IsVisible) throw new Exception("The function cannot be completed at this time: the Guide UI is already active. Wait until Guide.IsVisible is false before issuing this call."); if (player != PlayerIndex.One) throw new ArgumentOutOfRangeException("player", "Specified argument was out of the range of valid values."); if (title == null) throw new ArgumentNullException("title", "This string cannot be null or empty, and must be less than 256 characters long."); if (text == null) throw new ArgumentNullException("text", "This string cannot be null or empty, and must be less than 256 characters long."); if (buttons == null) throw new ArgumentNullException("buttons", "Value can not be null."); ShowMessageBoxDelegate smb = ShowMessageBox; return smb.BeginInvoke(title, text, buttons, focusButton, icon, callback, smb); } public static IAsyncResult BeginShowMessageBox( string title, string text, IEnumerable<string> buttons, int focusButton, MessageBoxIcon icon, AsyncCallback callback, Object state ) { return BeginShowMessageBox(PlayerIndex.One, title, text, buttons, focusButton, icon, callback, state); } public static Nullable<int> EndShowMessageBox(IAsyncResult result) { return ((ShowMessageBoxDelegate)result.AsyncState).EndInvoke(result); } ======= MessageBoxIcon icon); public static Nullable<int> ShowMessageBox( string title, string text, IEnumerable<string> buttons, int focusButton, MessageBoxIcon icon) { int? result = null; #if WINDOWS_STOREAPP var dialog = new MessageDialog(text, title); var index = 0; foreach (var b in buttons) { var cmd = new UICommand(b, null, index); dialog.Commands.Add(cmd); ++index; } dialog.DefaultCommandIndex = (uint)focusButton; // The message box must be popped up on the UI thread. Task<IUICommand> dialogResult = null; _dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { // We'll get an exception if we try to open a dialog while // one is already up. Catch the exception and ignore it. try { dialogResult = dialog.ShowAsync().AsTask(); } catch (Exception) { } }).AsTask().Wait(); if (dialogResult != null) { dialogResult.Wait(); result = (int)dialogResult.Result.Id; } #endif return result; } public static IAsyncResult BeginShowMessageBox( PlayerIndex player, string title, string text, IEnumerable<string> buttons, int focusButton, MessageBoxIcon icon, AsyncCallback callback, Object state ) { isVisible = true; ShowMessageBoxDelegate smb = ShowMessageBox; return smb.BeginInvoke(title, text, buttons, focusButton, icon, callback, smb); } public static IAsyncResult BeginShowMessageBox ( string title, string text, IEnumerable<string> buttons, int focusButton, MessageBoxIcon icon, AsyncCallback callback, Object state ) { return BeginShowMessageBox(PlayerIndex.One, title, text, buttons, focusButton, icon, callback, state); } public static Nullable<int> EndShowMessageBox (IAsyncResult result) { try { ShowMessageBoxDelegate smbd = (ShowMessageBoxDelegate)result.AsyncState; return smbd.EndInvoke(result); } finally { isVisible = false; } } >>>>>>> MessageBoxIcon icon); public static Nullable<int> ShowMessageBox(string title, string text, IEnumerable<string> buttons, int focusButton, MessageBoxIcon icon) { int? result = null; IsVisible = true; #if WINDOWS_STOREAPP MessageDialog dialog = new MessageDialog(text, title); foreach (string button in buttons) dialog.Commands.Add(new UICommand(button, null, dialog.Commands.Count)); if (focusButton < 0 || focusButton >= dialog.Commands.Count) throw new ArgumentOutOfRangeException("focusButton", "Specified argument was out of the range of valid values."); dialog.DefaultCommandIndex = (uint)focusButton; // The message box must be popped up on the UI thread. Task<IUICommand> dialogResult = null; _dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { dialogResult = dialog.ShowAsync().AsTask(); }).AsTask().Wait(); dialogResult.Wait(); result = (int)dialogResult.Result.Id; #endif IsVisible = false; return result; } public static IAsyncResult BeginShowMessageBox( PlayerIndex player, string title, string text, IEnumerable<string> buttons, int focusButton, MessageBoxIcon icon, AsyncCallback callback, Object state ) { // TODO: GuideAlreadyVisibleException if (IsVisible) throw new Exception("The function cannot be completed at this time: the Guide UI is already active. Wait until Guide.IsVisible is false before issuing this call."); if (player != PlayerIndex.One) throw new ArgumentOutOfRangeException("player", "Specified argument was out of the range of valid values."); if (title == null) throw new ArgumentNullException("title", "This string cannot be null or empty, and must be less than 256 characters long."); if (text == null) throw new ArgumentNullException("text", "This string cannot be null or empty, and must be less than 256 characters long."); if (buttons == null) throw new ArgumentNullException("buttons", "Value can not be null."); ShowMessageBoxDelegate smb = ShowMessageBox; return smb.BeginInvoke(title, text, buttons, focusButton, icon, callback, smb); } public static IAsyncResult BeginShowMessageBox( string title, string text, IEnumerable<string> buttons, int focusButton, MessageBoxIcon icon, AsyncCallback callback, Object state ) { return BeginShowMessageBox(PlayerIndex.One, title, text, buttons, focusButton, icon, callback, state); } public static Nullable<int> EndShowMessageBox(IAsyncResult result) { return ((ShowMessageBoxDelegate)result.AsyncState).EndInvoke(result); }
<<<<<<< #elif GLES ======= using PssVertexBuffer = Sce.Pss.Core.Graphics.VertexBuffer; #elif WINRT //Nothing #else >>>>>>> #elif GLES <<<<<<< #if DIRECTX throw new NotImplementedException(); ======= #if WINRT #elif PSS throw new NotImplementedException(); >>>>>>> #if DIRECTX throw new NotImplementedException(); #elif PSS throw new NotImplementedException(); <<<<<<< ======= #if WINRT //using(var stream = new SharpDX.DataStream(sizeInBytes, false, true)) { var dataHandle = GCHandle.Alloc(data, GCHandleType.Pinned); var startBytes = startIndex * elementSizeInByte; var dataPtr = (IntPtr)(dataHandle.AddrOfPinnedObject().ToInt64() + startBytes); //stream.WriteRange(data, 0, elementCount); //var box = new SharpDX.DataBox(stream.DataPointer, elementSizeInByte, 0); var box = new SharpDX.DataBox(dataPtr, elementSizeInByte, 0); var region = new SharpDX.Direct3D11.ResourceRegion(); region.Top = 0; region.Front = 0; region.Back = 1; region.Bottom = 1; region.Left = offsetInBytes / elementSizeInByte; region.Right = elementCount; // TODO: We need to deal with threaded contexts here! graphicsDevice._d3dContext.UpdateSubresource(box, _buffer, 0, region); dataHandle.Free(); } #elif PSS #warning This is almost 100% certainly wrong _buffer.SetVertices(data, startIndex, offsetInBytes / elementSizeInByte, vertexStride); >>>>>>> #elif PSS #warning This is almost 100% certainly wrong _buffer.SetVertices(data, startIndex, offsetInBytes / elementSizeInByte, vertexStride); <<<<<<< { #if DIRECTX ======= { #if WINRT || PSS >>>>>>> { #if DIRECTX || PSS
<<<<<<< #if PSS #warning We are only setting one hardcoded parameter here. Need to do this properly by iterating _effect.Parameters (Happens in DXShader) float[] data = (float[])_effect.Parameters["WorldViewProj"].Data; Sce.Pss.Core.Matrix4 matrix4 = PSSHelper.ToPssMatrix4(data); _effect._shaderProgram.SetUniformValue(0, ref matrix4); #elif OPENGL ======= Debug.Assert(_vertexShader != null, "Got a null vertex shader!"); Debug.Assert(_pixelShader != null, "Got a null vertex shader!"); #if OPENGL >>>>>>> Debug.Assert(_vertexShader != null, "Got a null vertex shader!"); Debug.Assert(_pixelShader != null, "Got a null vertex shader!"); #if PSS #warning We are only setting one hardcoded parameter here. Need to do this properly by iterating _effect.Parameters (Happens in DXShader) float[] data = (float[])_effect.Parameters["WorldViewProj"].Data; Sce.Pss.Core.Matrix4 matrix4 = PSSHelper.ToPssMatrix4(data); _effect._shaderProgram.SetUniformValue(0, ref matrix4); #elif OPENGL
<<<<<<< void DoAction(string action, string key); ======= bool CanRemove(string[] keys); >>>>>>> bool CanRemove(string[] keys); void DoAction(string action, string key);
<<<<<<< using System.Threading; ======= using System.Runtime.InteropServices; using System.Threading; >>>>>>> using System.Threading; using System.Threading;
<<<<<<< public void TestConcat() { Stream testProgramStream = File.OpenRead(@"CorrectSampleLuaFiles\concat.lua"); List<Token> tokenList = Lexer.Tokenize(testProgramStream); int tokenIndex = 0; Assert.Equal(TokenType.StringConcatOperator, tokenList[tokenIndex++].Type); Assert.Equal(TokenType.EndOfFile, tokenList[tokenIndex++].Type); } [Fact] public void TestLongCommentOnSameLine() { Stream testProgramStream = File.OpenRead(@"CorrectSampleLuaFiles\longcomment.lua"); List<Token> tokenList = Lexer.Tokenize(testProgramStream); int tokenIndex = 0; Assert.Equal(TokenType.Identifier, tokenList[tokenIndex++].Type); Assert.Equal(TokenType.EndOfFile, tokenList[tokenIndex++].Type); } [Fact] public void TestTrivia1() { Stream testProgramStream = File.OpenRead(@"CorrectSampleLuaFiles\trivia1.lua"); List<Token> tokenList = Lexer.Tokenize(testProgramStream); List<Trivia.TriviaType> allTrivia = new List<Trivia.TriviaType>(); foreach (Token token in tokenList) { foreach (Trivia trivia in token.LeadingTrivia) { allTrivia.Add(trivia.Type); } } List<Trivia.TriviaType> compareTrivia = new List<Trivia.TriviaType> { Trivia.TriviaType.Whitespace, Trivia.TriviaType.Newline, Trivia.TriviaType.Newline, Trivia.TriviaType.Whitespace, Trivia.TriviaType.Newline, Trivia.TriviaType.Whitespace, }; Assert.Equal(compareTrivia, allTrivia); } [Fact] public void TestLongCode() ======= public void IdentifyLongCodeTokenTypes() >>>>>>> public void TestConcat() { Stream testProgramStream = File.OpenRead(@"CorrectSampleLuaFiles\concat.lua"); List<Token> tokenList = Lexer.Tokenize(testProgramStream); int tokenIndex = 0; Assert.Equal(TokenType.StringConcatOperator, tokenList[tokenIndex++].Type); Assert.Equal(TokenType.EndOfFile, tokenList[tokenIndex++].Type); } [Fact] public void TestLongCommentOnSameLine() { Stream testProgramStream = File.OpenRead(@"CorrectSampleLuaFiles\longcomment.lua"); List<Token> tokenList = Lexer.Tokenize(testProgramStream); int tokenIndex = 0; Assert.Equal(TokenType.Identifier, tokenList[tokenIndex++].Type); Assert.Equal(TokenType.EndOfFile, tokenList[tokenIndex++].Type); } [Fact] public void TestTrivia1() { Stream testProgramStream = File.OpenRead(@"CorrectSampleLuaFiles\trivia1.lua"); List<Token> tokenList = Lexer.Tokenize(testProgramStream); List<Trivia.TriviaType> allTrivia = new List<Trivia.TriviaType>(); foreach (Token token in tokenList) { foreach (Trivia trivia in token.LeadingTrivia) { allTrivia.Add(trivia.Type); } } List<Trivia.TriviaType> compareTrivia = new List<Trivia.TriviaType> { Trivia.TriviaType.Whitespace, Trivia.TriviaType.Newline, Trivia.TriviaType.Newline, Trivia.TriviaType.Whitespace, Trivia.TriviaType.Newline, Trivia.TriviaType.Whitespace, }; Assert.Equal(compareTrivia, allTrivia); } [Fact] public void IdentifyLongCodeTokenTypes()
<<<<<<< using LanguageService.Shared; using Microsoft.VisualStudio.LanguageServices.Lua.Shared; ======= using Microsoft.VisualStudio.LuaLanguageService.Shared; >>>>>>> using LanguageService.Shared; using Microsoft.VisualStudio.LanguageServices.Lua.Shared; <<<<<<< ======= using Validation; >>>>>>> <<<<<<< namespace Microsoft.VisualStudio.LanguageServices.Lua.Formatting ======= namespace Microsoft.VisualStudio.LuaLanguageService.Formatting >>>>>>> namespace Microsoft.VisualStudio.LanguageServices.Lua.Formatting <<<<<<< private ITextBuffer textBuffer; private ITextView textView; private bool isClosed; private IServiceCore core; private ITextSnapshot prePasteSnapshot; internal Manager(ITextBuffer textBuffer, ITextView textView, IServiceCore core) ======= internal Manager(ITextBuffer textBuffer, ITextView textView, ICore core) >>>>>>> internal Manager(ITextBuffer textBuffer, ITextView textView, IServiceCore core) <<<<<<< public bool PreProcessCommand(Guid guidCmdGroup, uint commandId, IntPtr variantIn) ======= private ITextBuffer textBuffer; private ITextView textView; private bool isClosed; private ICore core; public void PostProcessCommand(Guid guidCmdGroup, uint commandId, IntPtr variantIn, bool wasHandled) >>>>>>> private ITextBuffer textBuffer; private ITextView textView; private bool isClosed; private IServiceCore core; private ITextSnapshot prePasteSnapshot; public bool PreProcessCommand(Guid guidCmdGroup, uint commandId, IntPtr variantIn)
<<<<<<< private Tagger tagger; public Tagger Tagger { get { if (this.tagger == null) { this.tagger = new Tagger(this.standardClassifications.Value, this); } return this.tagger; } } ======= public IServiceProvider ServiceProvider { get { return this.serviceProvider; } } >>>>>>> private Tagger tagger; public Tagger Tagger { get { if (this.tagger == null) { this.tagger = new Tagger(this.standardClassifications.Value, this); } return this.tagger; } } public IServiceProvider ServiceProvider { get { return this.serviceProvider; } }
<<<<<<< * Copyright (c) 2008-2017 Dolittle. All rights reserved. * Licensed under the MIT License. See LICENSE in the project root for license information. *--------------------------------------------------------------------------------------------*/ using System; ======= * Copyright (c) 2008-2017 Dolittle. All rights reserved. * Licensed under the MIT License. See LICENSE in the project root for license information. *--------------------------------------------------------------------------------------------*/ >>>>>>> * Copyright (c) 2008-2017 Dolittle. All rights reserved. * Licensed under the MIT License. See LICENSE in the project root for license information. *--------------------------------------------------------------------------------------------*/ using System; <<<<<<< using Microsoft.Azure.Documents.Client; ======= using Microsoft.Azure.Documents.Client; using Newtonsoft.Json; using System.Runtime.Serialization.Formatters; using System.IO; >>>>>>> using Microsoft.Azure.Documents.Client; using Newtonsoft.Json; <<<<<<< PopulateDocument(document, entity); ======= var result = _connection.Client.CreateDocumentAsync(_collection.DocumentsLink, document).Result; >>>>>>> PopulateDocument(document, entity); <<<<<<< var id = _idProperty.GetValue(entity); Document document = _connection.Client.CreateDocumentQuery<Document>(_collection.DocumentsLink) .Where(r => r.Id == id.ToString()) .AsEnumerable() .SingleOrDefault(); PopulateDocument(document, entity); var result = _connection.Client.ReplaceDocumentAsync(document.SelfLink, document).Result; ======= var properties = typeof(T).GetTypeInfo().GetProperties(); var idProperty = properties.Where(a => a.Name.ToLowerInvariant() == "id").AsEnumerable().FirstOrDefault(); var id = idProperty.GetValue(entity); Document document = _connection.Client.CreateDocumentQuery<Document>(_collection.DocumentsLink) .Where(r => r.Id == id.ToString()) .AsEnumerable() .SingleOrDefault(); properties.ForEach(p => { var value = p.GetValue(entity); if (p.PropertyType.IsConcept()) value = value.GetConceptValue(); if (p.Name.ToLowerInvariant() != "id") document.SetPropertyValue(p.Name, value); }); //var result = _connection.Client.ReplaceDocumentAsync(_collection.DocumentsLink, entity).Result; var result = _connection.Client.ReplaceDocumentAsync(document.SelfLink, document).Result; >>>>>>> var id = _idProperty.GetValue(entity); Document document = _connection.Client.CreateDocumentQuery<Document>(_collection.DocumentsLink) .Where(r => r.Id == id.ToString()) .AsEnumerable() .SingleOrDefault(); PopulateDocument(document, entity); _connection.Client.ReplaceDocumentAsync(document.SelfLink, document).Result; <<<<<<< Update(entity); ======= var result = _connection.Client.ReplaceDocumentAsync(_collection.DocumentsLink, entity).Result; >>>>>>> Update(entity); <<<<<<< return _connection.Client.CreateDocumentQuery<T>(_collection.DocumentsLink, "SELECT * FROM Entities WHERE Entities.id = '" + id + "'", new FeedOptions { MaxItemCount = 1 }) .AsEnumerable() .FirstOrDefault(); ======= Document result = _connection.Client.CreateDocumentQuery<Document>(_collection.DocumentsLink, "SELECT * FROM Entities WHERE Entities.id = '" + id + "'", new FeedOptions { MaxItemCount = 1 }) .AsEnumerable() .FirstOrDefault(); return SerializeDocument(result); >>>>>>> return _connection.Client.CreateDocumentQuery<T>(_collection.DocumentsLink, "SELECT * FROM Entities WHERE Entities.id = '" + id + "'", new FeedOptions { MaxItemCount = 1 }) .AsEnumerable() .FirstOrDefault();
<<<<<<< public object Cover { get; set; } public string Artist { get; set; } public string Title { get; set; } ======= >>>>>>> public object Cover { get; set; } public string Artist { get; set; } public string Title { get; set; }
<<<<<<< /// <summary> /// Setting or getting whether we are in the repeat state /// </summary> RepeatMode Repeat { get; set; } ======= RepeatMode RepeatMode { get; set; } >>>>>>> /// <summary> /// Setting or getting whether we are in the repeat state /// </summary> RepeatMode RepeatMode { get; set; }
<<<<<<< options = options ?? new ElasticsearchSinkOptions(new [] { new Uri("http://localhost:9200") }); var sink = new ElasticsearchSink(options); ======= options = options ?? new ElasticsearchSinkOptions(new [] { new Uri("http://locahost:9200") }); var sink = string.IsNullOrWhiteSpace(options.BufferBaseFilename) ? (ILogEventSink) new ElasticsearchSink(options) : new DurableElasticSearchSink(options); >>>>>>> options = options ?? new ElasticsearchSinkOptions(new [] { new Uri("http://localhost:9200") }); var sink = string.IsNullOrWhiteSpace(options.BufferBaseFilename) ? (ILogEventSink) new ElasticsearchSink(options) : new DurableElasticSearchSink(options);
<<<<<<< using System.Linq; using System.Threading; ======= >>>>>>> using System.Linq; <<<<<<< ======= private const int MaxNuGetExeFileSize = 10 * 1024 * 1024; private static readonly object fileLock = new object(); >>>>>>> private const int MaxNuGetExeFileSize = 10 * 1024 * 1024;
<<<<<<< public const string OwinRoute = "OwinRoute"; public const string Pages = "Pages"; ======= public const string ExternalAuthentication = "ExternalAuthentication"; public const string ExternalAuthenticationCallback = "ExternalAuthenticationCallback"; public const string RemoveCredential = "RemoveCredential"; public const string RemovePassword = "RemovePassword"; public const string ConfirmAccount = "ConfirmAccount"; public const string SubscribeToEmails = "SubscribeToEmails"; public const string UnsubscribeFromEmails = "UnsubscribeFromEmails"; >>>>>>> public const string OwinRoute = "OwinRoute"; public const string Pages = "Pages"; public const string ExternalAuthentication = "ExternalAuthentication"; public const string ExternalAuthenticationCallback = "ExternalAuthenticationCallback"; public const string RemoveCredential = "RemoveCredential"; public const string RemovePassword = "RemovePassword"; public const string ConfirmAccount = "ConfirmAccount"; public const string SubscribeToEmails = "SubscribeToEmails"; public const string UnsubscribeFromEmails = "UnsubscribeFromEmails";
<<<<<<< public DateTime? LastEdited { get; set; } ======= // License Report Information public string LicenseUrl { get; set; } public string LicenseNames { get; set; } public string LicenseReportUrl { get; set; } >>>>>>> public DateTime? LastEdited { get; set; } // License Report Information public string LicenseUrl { get; set; } public string LicenseNames { get; set; } public string LicenseReportUrl { get; set; }
<<<<<<< public Mock<ICuratedFeedByNameQuery> StubCuratedFeedByNameQry { get; private set; } public Mock<ICuratedFeedService> StubCuratedFeedService { get; private set; } public Mock<ISearchService> StubSearchService { get; private set; } ======= public Mock<ICuratedFeedService> StubCuratedFeedService { get; private set; } >>>>>>> public Mock<ICuratedFeedService> StubCuratedFeedService { get; private set; } public Mock<ISearchService> StubSearchService { get; private set; }
<<<<<<< await Task.WhenAll(source, inner); if (!default(EqDefault<K>).Equals(outerKeyMap(source.Result), innerKeyMap(inner.Result))) ======= await Task.WhenAll(source, inner).ConfigureAwait(false); if (!EqualityComparer<K>.Default.Equals(outerKeyMap(source.Result), innerKeyMap(inner.Result))) >>>>>>> await Task.WhenAll(source, inner).ConfigureAwait(false); if (!default(EqDefault<K>).Equals(outerKeyMap(source.Result), innerKeyMap(inner.Result))) <<<<<<< T t = await source; return project(t, inner.Where(u => default(EqDefault<K>).Equals(outerKeyMap(t), innerKeyMap(u)))); ======= T t = await source.ConfigureAwait(false); return project(t, inner.Where(u => EqualityComparer<K>.Default.Equals(outerKeyMap(t), innerKeyMap(u)))); >>>>>>> T t = await source.ConfigureAwait(false); return project(t, inner.Where(u => default(EqDefault<K>).Equals(outerKeyMap(t), innerKeyMap(u)))); <<<<<<< return iter.MoveNext() ? (true, iter.Current) : default; ======= var next = GetNext(); if (!next.Success) return; var a = await next.Task.ConfigureAwait(false); f(a); >>>>>>> return iter.MoveNext() ? (true, iter.Current) : default; <<<<<<< ======= await Task.WhenAll(tasks).ConfigureAwait(false); return unit; >>>>>>>
<<<<<<< addHeader(file); ======= file.WriteLine("// clang-format off"); addGPLheader(file); >>>>>>> file.WriteLine("// clang-format off"); addHeader(file); <<<<<<< addHeader(file); ======= file.WriteLine("// clang-format off"); addGPLheader(file); >>>>>>> file.WriteLine("// clang-format off"); addHeader(file);
<<<<<<< public DeviceInfo() ======= //[EdsExport] @fixme place this in EDS as comment public string LSS_Type = ""; public DeviceInfo(Dictionary<string, string> section) >>>>>>> //[EdsExport] @fixme place this in EDS as comment public string LSS_Type = ""; public DeviceInfo() <<<<<<< if (defaultvalue == null || defaultvalue == "") ======= if (defaultvalue == null || defaultvalue == "" ) >>>>>>> if (defaultvalue == null || defaultvalue == "" ) <<<<<<< if (defaultvalue == null || defaultvalue == "") ======= if (defaultvalue == null || defaultvalue == "" ) >>>>>>> if (defaultvalue == null || defaultvalue == "" ) <<<<<<< if (input == null || input == "") { nodeidpresent = false; return 0; } input = input.ToUpper(); //catch all types of nodeid if (input.Contains("$NODEID")) ======= if(input==null || input=="") { nodeidpresent = false; return 0; } if(input.Contains("$NODEID")) >>>>>>> if (input == null || input == "") { nodeidpresent = false; return 0; } input = input.ToUpper(); //catch all types of nodeid if (input.Contains("$NODEID"))
<<<<<<< //[EdsExport] @fixme place this in EDS as comment public string LSS_Type = "Server"; ======= [EdsExport(true)] //comment only, not supported by eds public string LSS_Type = ""; >>>>>>> [EdsExport(true)] //comment only, not supported by eds public string LSS_Type = "Server";
<<<<<<< this.textBox_compactPDO = new System.Windows.Forms.TextBox(); this.label4 = new System.Windows.Forms.Label(); ======= this.comboBox_lss = new System.Windows.Forms.ComboBox(); >>>>>>> this.textBox_compactPDO = new System.Windows.Forms.TextBox(); this.label4 = new System.Windows.Forms.Label(); this.comboBox_lss = new System.Windows.Forms.ComboBox(); <<<<<<< // this.textBox_concretenodeid.Location = new System.Drawing.Point(501, 254); ======= // this.textBox_concretenodeid.Location = new System.Drawing.Point(502, 246); >>>>>>> // this.textBox_concretenodeid.Location = new System.Drawing.Point(501, 254); <<<<<<< // this.button_update_devfile_info.Location = new System.Drawing.Point(512, 320); ======= // this.button_update_devfile_info.Location = new System.Drawing.Point(513, 312); >>>>>>> // this.button_update_devfile_info.Location = new System.Drawing.Point(512, 320); <<<<<<< // this.groupBox2.Controls.Add(this.textBox_compactPDO); this.groupBox2.Controls.Add(this.label4); ======= // this.groupBox2.Controls.Add(this.comboBox_lss); >>>>>>> // this.groupBox2.Controls.Add(this.comboBox_lss); this.groupBox2.Controls.Add(this.textBox_compactPDO); this.groupBox2.Controls.Add(this.label4); <<<<<<< // // textBox_compactPDO // this.textBox_compactPDO.Location = new System.Drawing.Point(121, 88); this.textBox_compactPDO.Name = "textBox_compactPDO"; this.textBox_compactPDO.ReadOnly = true; this.textBox_compactPDO.Size = new System.Drawing.Size(59, 20); this.textBox_compactPDO.TabIndex = 46; // // label4 // this.label4.AutoSize = true; this.label4.Location = new System.Drawing.Point(6, 95); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(72, 13); this.label4.TabIndex = 45; this.label4.Text = "CompactPDO"; // ======= // // comboBox_lss // this.comboBox_lss.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBox_lss.Enabled = false; this.comboBox_lss.FormattingEnabled = true; this.comboBox_lss.Items.AddRange(new object[] { "Server", "Client"}); this.comboBox_lss.Location = new System.Drawing.Point(110, 136); this.comboBox_lss.Name = "comboBox_lss"; this.comboBox_lss.Size = new System.Drawing.Size(59, 21); this.comboBox_lss.TabIndex = 45; // >>>>>>> // // comboBox_lss // this.comboBox_lss.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBox_lss.Enabled = false; this.comboBox_lss.FormattingEnabled = true; this.comboBox_lss.Items.AddRange(new object[] { "Server", "Client"}); this.comboBox_lss.Location = new System.Drawing.Point(110, 136); this.comboBox_lss.Name = "comboBox_lss"; this.comboBox_lss.Size = new System.Drawing.Size(59, 21); this.comboBox_lss.TabIndex = 45; // // textBox_compactPDO // this.textBox_compactPDO.Location = new System.Drawing.Point(121, 88); this.textBox_compactPDO.Name = "textBox_compactPDO"; this.textBox_compactPDO.ReadOnly = true; this.textBox_compactPDO.Size = new System.Drawing.Size(59, 20); this.textBox_compactPDO.TabIndex = 46; // // label4 // this.label4.AutoSize = true; this.label4.Location = new System.Drawing.Point(6, 95); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(72, 13); this.label4.TabIndex = 45; this.label4.Text = "CompactPDO"; // <<<<<<< // this.textBox_Gran.Location = new System.Drawing.Point(121, 166); ======= // this.textBox_Gran.Location = new System.Drawing.Point(68, 166); >>>>>>> // this.textBox_Gran.Location = new System.Drawing.Point(121, 166); <<<<<<< // ======= // // checkBox_compactPDO // this.checkBox_compactPDO.AutoSize = true; this.checkBox_compactPDO.Location = new System.Drawing.Point(6, 94); this.checkBox_compactPDO.Name = "checkBox_compactPDO"; this.checkBox_compactPDO.Size = new System.Drawing.Size(94, 17); this.checkBox_compactPDO.TabIndex = 38; this.checkBox_compactPDO.Text = "Compact PDO"; this.checkBox_compactPDO.UseVisualStyleBackColor = true; // >>>>>>> // <<<<<<< // this.textBox_devicefilename.Location = new System.Drawing.Point(399, 403); ======= // this.textBox_devicefilename.Location = new System.Drawing.Point(400, 395); >>>>>>> // this.textBox_devicefilename.Location = new System.Drawing.Point(399, 403); <<<<<<< // this.textBox_deviceedsname.Location = new System.Drawing.Point(399, 448); ======= // this.textBox_deviceedsname.Location = new System.Drawing.Point(400, 440); >>>>>>> // this.textBox_deviceedsname.Location = new System.Drawing.Point(399, 448); <<<<<<< // this.textBox_exportfolder.Location = new System.Drawing.Point(399, 491); ======= // this.textBox_exportfolder.Location = new System.Drawing.Point(400, 483); >>>>>>> // this.textBox_exportfolder.Location = new System.Drawing.Point(399, 491); <<<<<<< // // panel1 // this.panel1.Controls.Add(this.groupBox4); this.panel1.Controls.Add(this.label3); this.panel1.Controls.Add(this.groupBox1); this.panel1.Controls.Add(this.textBox_exportfolder); this.panel1.Controls.Add(this.groupBox2); this.panel1.Controls.Add(this.textBox_deviceedsname); this.panel1.Controls.Add(this.groupBox3); this.panel1.Controls.Add(this.label2); this.panel1.Controls.Add(this.groupBox5); this.panel1.Controls.Add(this.textBox_devicefilename); this.panel1.Controls.Add(this.button_update_devfile_info); this.panel1.Controls.Add(this.label1); this.panel1.Controls.Add(this.label32); this.panel1.Controls.Add(this.textBox_concretenodeid); this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; this.panel1.Location = new System.Drawing.Point(0, 0); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(773, 543); this.panel1.TabIndex = 60; // ======= // >>>>>>> // // panel1 // this.panel1.Controls.Add(this.groupBox4); this.panel1.Controls.Add(this.label3); this.panel1.Controls.Add(this.groupBox1); this.panel1.Controls.Add(this.textBox_exportfolder); this.panel1.Controls.Add(this.groupBox2); this.panel1.Controls.Add(this.textBox_deviceedsname); this.panel1.Controls.Add(this.groupBox3); this.panel1.Controls.Add(this.label2); this.panel1.Controls.Add(this.groupBox5); this.panel1.Controls.Add(this.textBox_devicefilename); this.panel1.Controls.Add(this.button_update_devfile_info); this.panel1.Controls.Add(this.label1); this.panel1.Controls.Add(this.label32); this.panel1.Controls.Add(this.textBox_concretenodeid); this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; this.panel1.Location = new System.Drawing.Point(0, 0); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(773, 543); this.panel1.TabIndex = 60; // <<<<<<< private System.Windows.Forms.TextBox textBox_compactPDO; private System.Windows.Forms.Label label4; private System.Windows.Forms.Panel panel1; ======= private System.Windows.Forms.ComboBox comboBox_lss; >>>>>>> private System.Windows.Forms.TextBox textBox_compactPDO; private System.Windows.Forms.Label label4; private System.Windows.Forms.Panel panel1; private System.Windows.Forms.ComboBox comboBox_lss;
<<<<<<< var outputKind = SpanKindInternal.Markup; ======= >>>>>>> <<<<<<< outputKind = SpanKindInternal.Code; ======= >>>>>>> <<<<<<< outputKind = SpanKindInternal.Code; ======= >>>>>>> <<<<<<< outputKind = SpanKindInternal.Code; ======= >>>>>>> <<<<<<< Output(outputKind, AcceptedCharactersInternal.NonWhiteSpace); ======= Output(SpanKind.Code, AcceptedCharacters.NonWhiteSpace); >>>>>>> Output(SpanKindInternal.Code, AcceptedCharactersInternal.NonWhiteSpace);
<<<<<<< outputValues[0] = (long)(outputValues[0] * _linearSensitivityScaleFactor); outputValues[1] = (long)(outputValues[1] * _linearSensitivityScaleFactor); ======= outputValues[0] = (short) (outputValues[0] * _linearSenstitivityScaleFactor); outputValues[1] = (short) (outputValues[1] * _linearSenstitivityScaleFactor); >>>>>>> outputValues[0] = (short) (outputValues[0] * _linearSensitivityScaleFactor); outputValues[1] = (short) (outputValues[1] * _linearSensitivityScaleFactor);
<<<<<<< private FileItem(FileContainer fileContainer, string sourceFilePath, TypeFile typeFile) ======= public static FileItem NewSubtitleFileItem(FileContainer fileContainer) { FileItem fileItem = new FileItem(fileContainer, null, TypeFile.SubtitleText); fileItem.IpfsProcess = new ProcessItem(); return fileItem; } private FileItem(FileContainer fileContainer, string filePath, TypeFile typeFile) >>>>>>> public static FileItem NewSubtitleFileItem(FileContainer fileContainer) { FileItem fileItem = new FileItem(fileContainer, null, TypeFile.SubtitleText); fileItem.IpfsProcess = new ProcessItem(); return fileItem; } private FileItem(FileContainer fileContainer, string sourceFilePath, TypeFile typeFile)
<<<<<<< var browserComposer = new Browser( with => { with.Module<TestModule>(); with.RootPathProvider<StaticPathProvider>(); with.ViewEngines(typeof(SuperSimpleViewEngineWrapper), typeof(RazorViewEngine)); }); ======= var browserComposer = new Browser(with => { with.Module<TestModule>(); with.RootPathProvider<StaticPathProvider>(); with.ViewEngines(typeof(SuperSimpleViewEngineWrapper), typeof(RazorViewEngine)); }); >>>>>>> var browserComposer = new Browser(with => { with.Module<TestModule>(); with.RootPathProvider<StaticPathProvider>(); with.ViewEngines(typeof(SuperSimpleViewEngineWrapper), typeof(RazorViewEngine)); }); <<<<<<< private static Dictionary<int, Dictionary<int, List<Post>>> GroupStuff(IEnumerable<PostHeaderSettings> parsedFiles) ======= private static Dictionary<int, Dictionary<int, List<Post>>> GroupStuff(IEnumerable<Post> parsedFiles) >>>>>>> private static Dictionary<int, Dictionary<int, List<Post>>> GroupStuff( <<<<<<< into g select g).ToDictionary(x => x.Key, x => (from y in x group y by y.Month into p select p).ToDictionary(u => u.Key, u => u.Select(p => p.Post).ToList())); ======= into g select g).ToDictionary(x => x.Key, x => (from y in x group y by y.Month into p select p).ToDictionary(u => u.Key, u => u.ToList())); >>>>>>> into g select g).ToDictionary(x => x.Key, x => (from y in x group y by y.Month into p select p).ToDictionary(u => u.Key, u => u.ToList())); <<<<<<< private static void ProcessStaticFiles(StaticFile staticFile, SnowSettings settings, IList<PostHeaderSettings> parsedFiles, Browser browserComposer) ======= private static void ProcessStaticFiles(StaticFile staticFile, SnowSettings settings, IList<Post> parsedFiles, Browser browserComposer) >>>>>>> private static void ProcessStaticFiles(StaticFile staticFile, SnowSettings settings, IList<Post> parsedFiles, Browser browserComposer) <<<<<<< var outputFolder = Path.Combine(output, urlFormat.Substring(1)); //Outputfolder is incorrect with leading slash on urlFormat ======= var outputFolder = Path.Combine(output, post.Url.Trim('/')); //Outputfolder is incorrect with leading slash on urlFormat >>>>>>> var outputFolder = Path.Combine(output, post.Url.Trim('/')); //Outputfolder is incorrect with leading slash on urlFormat
<<<<<<< ======= TitleViewManager _titleViewManager; >>>>>>> TitleViewManager _titleViewManager; <<<<<<< void UpdateTitleViewPresenter() { if (TitleView == null) { TitleViewVisibility = Visibility.Collapsed; if (_titleViewPresenter != null) _titleViewPresenter.Loaded -= OnTitleViewPresenterLoaded; } else { TitleViewVisibility = Visibility.Visible; if (_titleViewPresenter != null) _titleViewPresenter.Loaded += OnTitleViewPresenterLoaded; } } void UpdateToolbarDynamicOverflowEnabled() { if (_commandBar != null) { _commandBar.IsDynamicOverflowEnabled = ToolbarDynamicOverflowEnabled; } } } ======= } >>>>>>> void UpdateToolbarDynamicOverflowEnabled() { if (_commandBar != null) { _commandBar.IsDynamicOverflowEnabled = ToolbarDynamicOverflowEnabled; } } }
<<<<<<< void IImageElement.OnImageSourceSourceChanged(object sender, EventArgs e) => ImageElement.ImageSourceSourceChanged(this, e); ======= bool IImageController.GetLoadAsAnimation() => false; bool IImageElement.IsLoading => false; bool IImageElement.IsAnimationPlaying => false; void IImageElement.OnImageSourcesSourceChanged(object sender, EventArgs e) => ImageElement.ImageSourcesSourceChanged(this, e); >>>>>>> bool IImageController.GetLoadAsAnimation() => false; bool IImageElement.IsLoading => false; bool IImageElement.IsAnimationPlaying => false; void IImageElement.OnImageSourceSourceChanged(object sender, EventArgs e) => ImageElement.ImageSourceSourceChanged(this, e);
<<<<<<< View _flyoutHeader; int _actionBarHeight; ======= AppBarLayout _appBar; RecyclerView _recycler; ShellFlyoutRecyclerAdapter _adapter; View _flyoutHeader; int _actionBarHeight; >>>>>>> AppBarLayout _appBar; RecyclerView _recycler; ShellFlyoutRecyclerAdapter _adapter; View _flyoutHeader; int _actionBarHeight; <<<<<<< Profile.FramePartition("Find Recycler"); var recycler = coordinator.FindViewById<RecyclerView>(Resource.Id.flyoutcontent_recycler); Profile.FramePartition("Find AppBar"); var appBar = coordinator.FindViewById<AppBarLayout>(Resource.Id.flyoutcontent_appbar); ======= _recycler = coordinator.FindViewById<RecyclerView>(Resource.Id.flyoutcontent_recycler); _appBar = coordinator.FindViewById<AppBarLayout>(Resource.Id.flyoutcontent_appbar); >>>>>>> Profile.FramePartition("Find Recycler"); _recycler = coordinator.FindViewById<RecyclerView>(Resource.Id.flyoutcontent_recycler); Profile.FramePartition("Find AppBar"); _appBar = coordinator.FindViewById<AppBarLayout>(Resource.Id.flyoutcontent_appbar); <<<<<<< Profile.FramePartition("Add Listener"); appBar.AddOnOffsetChangedListener(this); ======= _appBar.AddOnOffsetChangedListener(this); >>>>>>> Profile.FramePartition("Add Listener"); _appBar.AddOnOffsetChangedListener(this); <<<<<<< Profile.FramePartition("Recycler.SetAdapter"); var adapter = new ShellFlyoutRecyclerAdapter(shellContext, OnElementSelected); recycler.SetClipToPadding(false); recycler.SetLayoutManager(new LinearLayoutManager(context, (int)Orientation.Vertical, false)); recycler.SetAdapter(adapter); ======= _adapter = new ShellFlyoutRecyclerAdapter(shellContext, OnElementSelected); _recycler.SetClipToPadding(false); _recycler.SetLayoutManager(new LinearLayoutManager(context, (int)Orientation.Vertical, false)); _recycler.SetAdapter(_adapter); >>>>>>> Profile.FramePartition("Recycler.SetAdapter"); _adapter = new ShellFlyoutRecyclerAdapter(shellContext, OnElementSelected); _recycler.SetClipToPadding(false); _recycler.SetLayoutManager(new LinearLayoutManager(context, (int)Orientation.Vertical, false)); _recycler.SetAdapter(_adapter); <<<<<<< Profile.FramePartition("UpdateFlyoutBackground"); UpdateFlyoutBackground(); Profile.FrameEnd(); } ======= UpdateFlyoutBackground(); } >>>>>>> Profile.FramePartition("UpdateFlyoutBackground"); UpdateFlyoutBackground(); Profile.FrameEnd(); } <<<<<<< _headerView = null; _shellContext = null; _disposed = true; } ======= _headerView = null; _shellContext = null; _appBar = null; _recycler = null; _adapter = null; _defaultBackgroundColor = null; _bgImage = null; } >>>>>>> _headerView = null; _shellContext = null; _appBar = null; _recycler = null; _adapter = null; _defaultBackgroundColor = null; _bgImage = null; } <<<<<<< public HeaderContainer(Context context, IAttributeSet attribs) : base(context, attribs) { Initialize(View); } public HeaderContainer(Context context, IAttributeSet attribs, int defStyleAttr) : base(context, attribs, defStyleAttr) { Initialize(View); } protected HeaderContainer(IntPtr javaReference, JniHandleOwnership transfer) : base(javaReference, transfer) { Initialize(View); } void Initialize(View view) { if (view != null) view.PropertyChanged += OnViewPropertyChanged; } void OnViewPropertyChanged(object sender, PropertyChangedEventArgs e) { if (e.PropertyName == PlatformConfiguration.AndroidSpecific.VisualElement.ElevationProperty.PropertyName) { UpdateElevation(); } } void UpdateElevation() { if (Parent is AView view) ElevationHelper.SetElevation(view, View); } ======= >>>>>>> public HeaderContainer(Context context, IAttributeSet attribs) : base(context, attribs) { Initialize(View); } public HeaderContainer(Context context, IAttributeSet attribs, int defStyleAttr) : base(context, attribs, defStyleAttr) { Initialize(View); } protected HeaderContainer(IntPtr javaReference, JniHandleOwnership transfer) : base(javaReference, transfer) { Initialize(View); } void Initialize(View view) { if (view != null) view.PropertyChanged += OnViewPropertyChanged; } void OnViewPropertyChanged(object sender, PropertyChangedEventArgs e) { if (e.PropertyName == PlatformConfiguration.AndroidSpecific.VisualElement.ElevationProperty.PropertyName) { UpdateElevation(); } } void UpdateElevation() { if (Parent is AView view) ElevationHelper.SetElevation(view, View); }
<<<<<<< _child.Element?.DisposeModalAndChildRenderers(); _child.NativeView.RemoveFromSuperview(); _child.Dispose(); _child = null; ======= if (_child != null) { if (_child.Element.Platform is Platform platform) platform.DisposeModelAndChildrenRenderers(_child.Element); _child.NativeView.RemoveFromSuperview(); _child.Dispose(); _child = null; } _view = null; _icon?.Dispose(); _icon = null; } base.Dispose(disposing); >>>>>>> if (_child != null) { _child.Element?.DisposeModalAndChildRenderers(); _child.NativeView.RemoveFromSuperview(); _child.Dispose(); _child = null; } _view = null; _icon?.Dispose(); _icon = null; } base.Dispose(disposing);
<<<<<<< using Xamarin.Forms.Platform.Android; using AMenuItemCompat = global::Android.Support.V4.View.MenuItemCompat; using AView = Android.Views.View; using FragmentTransaction = AndroidX.Fragment.App.FragmentTransaction; ======= using FragmentTransaction = AndroidX.Fragment.App.FragmentTransaction; using NestedScrollView = global::AndroidX.Core.Widget.NestedScrollView; using AMenuItemCompat = global::AndroidX.Core.View.MenuItemCompat; >>>>>>> using Xamarin.Forms.Platform.Android; using FragmentTransaction = AndroidX.Fragment.App.FragmentTransaction; using NestedScrollView = global::AndroidX.Core.Widget.NestedScrollView; using AMenuItemCompat = global::AndroidX.Core.View.MenuItemCompat;
<<<<<<< var adapter = new ShellFlyoutRecyclerAdapter(shellContext, OnElementSelected); recycler.SetClipToPadding(false); recycler.SetLayoutManager(_layoutManager = new ScrollLayoutManager(context, (int)Orientation.Vertical, false)); recycler.SetAdapter(adapter); ======= _adapter = new ShellFlyoutRecyclerAdapter(shellContext, OnElementSelected); _recycler.SetClipToPadding(false); _recycler.SetLayoutManager(new LinearLayoutManager(context, (int)Orientation.Vertical, false)); _recycler.SetAdapter(_adapter); >>>>>>> _adapter = new ShellFlyoutRecyclerAdapter(shellContext, OnElementSelected); _recycler.SetClipToPadding(false); _recycler.SetLayoutManager(_layoutManager = new ScrollLayoutManager(context, (int)Orientation.Vertical, false)); _recycler.SetLayoutManager(new LinearLayoutManager(context, (int)Orientation.Vertical, false)); _recycler.SetAdapter(_adapter); <<<<<<< _headerView.Dispose(); _rootView.Dispose(); _layoutManager?.Dispose(); _defaultBackgroundColor?.Dispose(); _bgImage?.Dispose(); ======= if (_appBar != null) { _appBar.RemoveOnOffsetChangedListener(this); _appBar.RemoveView(_headerView); >>>>>>> if (_appBar != null) { _appBar.RemoveOnOffsetChangedListener(this); _appBar.RemoveView(_headerView); <<<<<<< _layoutManager = null; _disposed = true; ======= _appBar = null; _recycler = null; _adapter = null; _defaultBackgroundColor = null; _bgImage = null; >>>>>>> _appBar = null; _recycler = null; _adapter = null; _defaultBackgroundColor = null; _layoutManager = null; _bgImage = null;
<<<<<<< UnsubscribeSwipeItemEvents(); _swipeItems.Clear(); ======= _swipeThreshold = 0; _swipeOffset = 0; >>>>>>> UnsubscribeSwipeItemEvents(); _swipeItems.Clear(); _swipeThreshold = 0; _swipeOffset = 0;
<<<<<<< public const string Shell = "Shell"; public const string TabbedPage = "TabbedPage"; ======= public const string Shell = "Shell"; public const string CustomRenderers = "CustomRenderers"; >>>>>>> public const string Shell = "Shell"; public const string TabbedPage = "TabbedPage"; public const string CustomRenderers = "CustomRenderers";
<<<<<<< using Xamarin.Forms.Platform.Android.FastRenderers; ======= using AColor = Android.Graphics.Color; using Xamarin.Forms.PlatformConfiguration.AndroidSpecific; >>>>>>> using AColor = Android.Graphics.Color; using Xamarin.Forms.PlatformConfiguration.AndroidSpecific; using Xamarin.Forms.Platform.Android.FastRenderers; <<<<<<< string _defaultContentDescription; ======= IVisualElementRenderer _visualElementRenderer; >>>>>>> IVisualElementRenderer _visualElementRenderer; string _defaultContentDescription;
<<<<<<< var iconColor = NavigationPage.GetIconColor(Current); if (iconColor.IsDefault) iconColor = barTextColor; NavigationBar.TintColor = iconColor == Color.Default || statusBarColorMode == StatusBarTextColorMode.DoNotAdjust ======= NavigationBar.TintColor = barTextColor == Color.Default || NavPage.OnThisPlatform().GetStatusBarTextColorMode() == StatusBarTextColorMode.DoNotAdjust >>>>>>> var iconColor = NavigationPage.GetIconColor(Current); if (iconColor.IsDefault) iconColor = barTextColor; NavigationBar.TintColor = iconColor == Color.Default || NavPage.OnThisPlatform().GetStatusBarTextColorMode() == StatusBarTextColorMode.DoNotAdjust
<<<<<<< ======= using Microsoft.AspNetCore.Routing.Patterns; >>>>>>> using Microsoft.AspNetCore.Routing.Patterns; <<<<<<< var response = httpContext.Response; response.StatusCode = 200; response.ContentType = "text/plain"; return response.WriteAsync( "Link: " + linkGenerator.GetPathByRouteValues(httpContext, "WithDoubleAsteriskCatchAll", new { })); }, "/WithDoubleAsteriskCatchAll/{**path}", "WithDoubleAsteriskCatchAll", new RouteValuesAddressMetadata(routeName: "WithDoubleAsteriskCatchAll", requiredValues: new RouteValueDictionary())); }); ======= public void Configure(IApplicationBuilder app) { app.UseEndpointRouting(); >>>>>>> var response = httpContext.Response; response.StatusCode = 200; response.ContentType = "text/plain"; return response.WriteAsync( "Link: " + linkGenerator.GetPathByRouteValues(httpContext, "WithDoubleAsteriskCatchAll", new { })); }, "/WithDoubleAsteriskCatchAll/{**path}", "WithDoubleAsteriskCatchAll", new RouteValuesAddressMetadata(routeName: "WithDoubleAsteriskCatchAll", requiredValues: new RouteValueDictionary())); });
<<<<<<< internal const int requestCodeFilePicker = 11001; internal const int requestCodeMediaPicker = 11002; internal const int requestCodeMediaCapture = 11003; internal const int requestCodeStart = 12000; static int requestCode = requestCodeStart; internal static int NextRequestCode() { if (++requestCode >= 12999) requestCode = requestCodeStart; return requestCode; } ======= internal const int requestCodePickContact = 11004; >>>>>>> internal const int requestCodeFilePicker = 11001; internal const int requestCodeMediaPicker = 11002; internal const int requestCodeMediaCapture = 11003; internal const int requestCodePickContact = 11004; internal const int requestCodeStart = 12000; static int requestCode = requestCodeStart; internal static int NextRequestCode() { if (++requestCode >= 12999) requestCode = requestCodeStart; return requestCode; }
<<<<<<< AButton view = View; ======= if (View?.LayoutParameters == null && _hasLayoutOccurred) return false; AppCompatButton view = View; >>>>>>> if (View?.LayoutParameters == null && _hasLayoutOccurred) return false; AButton view = View;
<<<<<<< UpdateItemsUpdatingScrollMode(); ======= UpdateFlowDirection(); >>>>>>> UpdateItemsUpdatingScrollMode(); UpdateFlowDirection();
<<<<<<< ======= using AButton = Android.Widget.Button; using Android.Text.Method; >>>>>>> using Android.Text.Method; <<<<<<< _renderer.View.SetAllCaps(textTransform == TextTransform.Default); ======= // Use defaults only when user hasn't specified alternative TextTransform settings if (textTransform == TextTransform.Default) _renderer.View.TransformationMethod = _defaultTransformationMethod; else _renderer.View.TransformationMethod = null; >>>>>>> // Use defaults only when user hasn't specified alternative TextTransform settings if (textTransform == TextTransform.Default) _renderer.View.TransformationMethod = _defaultTransformationMethod; else _renderer.View.TransformationMethod = null;
<<<<<<< GalleryBuilder.NavButton("Footer Only (String)", () => new FooterOnlyString(), Navigation), ======= GalleryBuilder.NavButton("Header/Footer (Grid Horizontal)", () => new HeaderFooterGridHorizontal(), Navigation), >>>>>>> GalleryBuilder.NavButton("Footer Only (String)", () => new FooterOnlyString(), Navigation), GalleryBuilder.NavButton("Header/Footer (Grid Horizontal)", () => new HeaderFooterGridHorizontal(), Navigation),
<<<<<<< using Xamarin.Forms.Controls.GalleryPages.SwipeViewGalleries; ======= using Xamarin.Forms.Controls.GalleryPages.PlatformTestsGallery; >>>>>>> using Xamarin.Forms.Controls.GalleryPages.SwipeViewGalleries; using Xamarin.Forms.Controls.GalleryPages.PlatformTestsGallery;
<<<<<<< using Android.Support.V4.Content; using Android.Views; ======= using Android.Provider; >>>>>>> using Android.Provider; using Android.Views;
<<<<<<< static bool? s_isiOS13OrNewer; ======= static bool? s_respondsTosetNeedsUpdateOfHomeIndicatorAutoHidden; >>>>>>> static bool? s_isiOS13OrNewer; static bool? s_respondsTosetNeedsUpdateOfHomeIndicatorAutoHidden; <<<<<<< internal static bool IsiOS13OrNewer { get { if (!s_isiOS13OrNewer.HasValue) s_isiOS13OrNewer = UIDevice.CurrentDevice.CheckSystemVersion(13, 0); return s_isiOS13OrNewer.Value; } } ======= internal static bool RespondsToSetNeedsUpdateOfHomeIndicatorAutoHidden { get { if (!s_respondsTosetNeedsUpdateOfHomeIndicatorAutoHidden.HasValue) s_respondsTosetNeedsUpdateOfHomeIndicatorAutoHidden = new UIViewController().RespondsToSelector(new ObjCRuntime.Selector("setNeedsUpdateOfHomeIndicatorAutoHidden")); return s_respondsTosetNeedsUpdateOfHomeIndicatorAutoHidden.Value; } } >>>>>>> internal static bool IsiOS13OrNewer { get { if (!s_isiOS13OrNewer.HasValue) s_isiOS13OrNewer = UIDevice.CurrentDevice.CheckSystemVersion(13, 0); return s_isiOS13OrNewer.Value; } } internal static bool RespondsToSetNeedsUpdateOfHomeIndicatorAutoHidden { get { if (!s_respondsTosetNeedsUpdateOfHomeIndicatorAutoHidden.HasValue) s_respondsTosetNeedsUpdateOfHomeIndicatorAutoHidden = new UIViewController().RespondsToSelector(new ObjCRuntime.Selector("setNeedsUpdateOfHomeIndicatorAutoHidden")); return s_respondsTosetNeedsUpdateOfHomeIndicatorAutoHidden.Value; } }
<<<<<<< CancellationToken cancellationToken, bool immediate = true, ======= >>>>>>> CancellationToken cancellationToken, <<<<<<< default(CancellationToken), immediate: true, ======= >>>>>>> default(CancellationToken), <<<<<<< default(CancellationToken), immediate: true, ======= >>>>>>> default(CancellationToken), <<<<<<< WriteAsync(buffer, CancellationToken.None, immediate, chunk, isSync: true).GetAwaiter().GetResult(); ======= WriteAsync(buffer, chunk, isSync: true).GetAwaiter().GetResult(); >>>>>>> WriteAsync(buffer, CancellationToken.None, chunk, isSync: true).GetAwaiter().GetResult(); <<<<<<< if (cancellationToken.IsCancellationRequested) { _connection.Abort(); _cancelled = true; return TaskUtilities.GetCancelledTask(cancellationToken); } else if (_cancelled) { return TaskUtilities.CompletedTask; } return WriteAsync(buffer, cancellationToken, immediate, chunk); ======= return WriteAsync(buffer, chunk); >>>>>>> if (cancellationToken.IsCancellationRequested) { _connection.Abort(); _cancelled = true; return TaskUtilities.GetCancelledTask(cancellationToken); } else if (_cancelled) { return TaskUtilities.CompletedTask; } return WriteAsync(buffer, cancellationToken, chunk);
<<<<<<< public override void AppRequest(string message, string[] to, string extraData, string dialogTitle, AppRequestSuccess success, AppRequestFailed fail) { FB.AppRequest(message, to, "", null, null, extraData, dialogTitle, (FBResult result) => { if (result.Error != null) { SoomlaUtils.LogError(TAG, "AppRequest[result.Error]: "+result.Error); fail(result.Error); } else { SoomlaUtils.LogDebug(TAG, "AppRequest[result.Text]: "+result.Text); SoomlaUtils.LogDebug(TAG, "AppRequest[result.Texture]: "+result.Texture); JSONObject jsonResponse = new JSONObject(result.Text); List<JSONObject> jsonRecipinets = jsonResponse["to"].list; List<string> recipients = new List<string>(); foreach (JSONObject o in jsonRecipinets) { recipients.Add(o.str); } success(jsonResponse["request"].str, recipients); } }); } ======= public override void Like(string pageName) { Application.OpenURL("https://www.facebook.com/" + pageName); } >>>>>>> public override void AppRequest(string message, string[] to, string extraData, string dialogTitle, AppRequestSuccess success, AppRequestFailed fail) { FB.AppRequest(message, to, "", null, null, extraData, dialogTitle, (FBResult result) => { if (result.Error != null) { SoomlaUtils.LogError(TAG, "AppRequest[result.Error]: "+result.Error); fail(result.Error); } else { SoomlaUtils.LogDebug(TAG, "AppRequest[result.Text]: "+result.Text); SoomlaUtils.LogDebug(TAG, "AppRequest[result.Texture]: "+result.Texture); JSONObject jsonResponse = new JSONObject(result.Text); List<JSONObject> jsonRecipinets = jsonResponse["to"].list; List<string> recipients = new List<string>(); foreach (JSONObject o in jsonRecipinets) { recipients.Add(o.str); } success(jsonResponse["request"].str, recipients); } }); } public override void Like(string pageName) { Application.OpenURL("https://www.facebook.com/" + pageName); }
<<<<<<< public class EventVenues : AutoReversingMigration { public override void Up() { Create.Table("EventVenues") .WithColumn("Id").AsInt32().NotNullable().PrimaryKey().Identity() .WithColumn("Address").AsString().NotNullable().WithDefaultValue(string.Empty) .WithColumn("JapaneseName").AsString(255).NotNullable().WithDefaultValue(string.Empty) .WithColumn("RomajiName").AsString(255).NotNullable().WithDefaultValue(string.Empty) .WithColumn("EnglishName").AsString(255).NotNullable().WithDefaultValue(string.Empty); } } ======= // Migration version format: YYYY_MM_DD_HHmm [Migration(2020_02_08_1800)] public class IPRuleAddressUniqueIndex : AutoReversingMigration { public override void Up() { Create.Index("UX_IPRules_Address").OnTable(TableNames.IPRules).OnColumn("Address").Ascending().WithOptions().Unique(); } } [Migration(2020_02_07_2000)] public class UserCustomTitle : AutoReversingMigration { public override void Up() { Create.Column("CustomTitle").OnTable(TableNames.UserOptions).AsString(200).NotNullable().WithDefaultValue(string.Empty); } } [Migration(2020_02_05_1900)] public class EventDescriptionLength : Migration { public override void Up() { Delete.DefaultConstraint().OnTable(TableNames.AlbumReleaseEvents).OnColumn("Description"); Alter.Column("Description").OnTable(TableNames.AlbumReleaseEvents).AsString(int.MaxValue).NotNullable().WithDefaultValue(string.Empty); Delete.DefaultConstraint().OnTable(TableNames.AlbumReleaseEventSeries).OnColumn("Description"); Alter.Column("Description").OnTable(TableNames.AlbumReleaseEventSeries).AsString(int.MaxValue).NotNullable().WithDefaultValue(string.Empty); } public override void Down() {} } [Migration(2020_01_05_1600)] public class TagRelatedEntries : AutoReversingMigration { public override void Up() { var tableName = "EntryTypeToTagMappings"; Create.Table(tableName) .WithColumn(ColumnNames.Id).AsInt32().NotNullable().PrimaryKey().Identity() .WithColumn("EntryType").AsString(20).NotNullable() .WithColumn("SubType").AsString(30).NotNullable() .WithColumn("Tag").AsInt32().NotNullable().ForeignKey(TableNames.Tags, ColumnNames.Id).OnDelete(Rule.Cascade); Create.Index("UX_EntryTypeToTagMappings_EntryType").OnTable(tableName) .OnColumn("EntryType").Ascending() .OnColumn("SubType").Ascending() .WithOptions().Unique(); Create.Index("UX_EntryTypeToTagMappings_Tag").OnTable(tableName) .OnColumn("Tag").Ascending() .WithOptions().Unique(); } } [Migration(2019_11_17_0100)] public class SongListTags : AutoReversingMigration { public override void Up() { Create.Table("SongListTagUsages") .WithColumn("Id").AsInt64().NotNullable().PrimaryKey().Identity() .WithColumn("Count").AsInt32().NotNullable() .WithColumn("SongList").AsInt32().NotNullable().ForeignKey(TableNames.SongLists, "Id").OnDelete(Rule.Cascade) .WithColumn("Tag").AsInt32().NotNullable().ForeignKey(TableNames.Tags, "Id") .WithColumn("Date").AsDateTime().NotNullable(); Create.Table("SongListTagVotes") .WithColumn("Id").AsInt64().NotNullable().PrimaryKey().Identity() .WithColumn("Usage").AsInt64().NotNullable().ForeignKey("SongListTagUsages", "Id").OnDelete(Rule.Cascade) .WithColumn("[User]").AsInt32().NotNullable().ForeignKey(TableNames.Users, "Id"); Create.Index("UX_SongListTagUsages").OnTable("SongListTagUsages").OnColumn("SongList").Ascending() .OnColumn("Tag").Ascending().WithOptions().Unique(); Create.Index("IX_SongListTagUsages_Tag").OnTable("SongListTagUsages").OnColumn("Tag").Ascending(); } } [Migration(2019_04_14_1300)] public class ArchivedEntryVersionChangedFieldsLength : AutoReversingMigration { public override void Up() { Alter.Column("ChangedFields").OnTable(TableNames.ArchivedAlbumVersions).AsAnsiString(1000).NotNullable().WithDefaultValue(string.Empty); Alter.Column("ChangedFields").OnTable(TableNames.ArchivedArtistVersions).AsAnsiString(1000).NotNullable().WithDefaultValue(string.Empty); Alter.Column("ChangedFields").OnTable(TableNames.ArchivedSongVersions).AsAnsiString(1000).NotNullable().WithDefaultValue(string.Empty); } } [Migration(2019_03_12_2100)] public class SongNameIndex : AutoReversingMigration { public override void Up() { if (!Schema.Table(TableNames.SongNames).Index("IX_SongNames").Exists()) { Create.Index("IX_SongNames").OnTable(TableNames.SongNames).OnColumn("Song").Ascending(); } } } [Migration(2019_01_27_1700)] public class AlbumReviews : AutoReversingMigration { public override void Up() { Create.Table(TableNames.AlbumReviews) .WithColumn("Id").AsInt32().NotNullable().PrimaryKey().Identity() .WithColumn("Album").AsInt32().NotNullable().ForeignKey(TableNames.Albums, "Id").OnDelete(Rule.Cascade) .WithColumn("[Date]").AsDateTime().NotNullable() .WithColumn("LanguageCode").AsString(8).NotNullable() .WithColumn("Text").AsString(4000).NotNullable() .WithColumn("Title").AsString(200).NotNullable() .WithColumn("[User]").AsInt32().NotNullable().ForeignKey(TableNames.Users, "Id").OnDelete(Rule.Cascade); Create.Index("UX_AlbumReviews").OnTable(TableNames.AlbumReviews) .OnColumn("Album").Ascending() .OnColumn("[User]").Ascending() .OnColumn("LanguageCode").Ascending() .WithOptions().Unique(); } } [Migration(2019_01_17_2200)] public class AuditLogEntryEntryLink : AutoReversingMigration { public override void Up() { Create.Column("EntryId").OnTable(TableNames.AuditLogEntries).AsInt32().NotNullable().WithDefaultValue(0); Create.Column("EntryType").OnTable(TableNames.AuditLogEntries).AsString(20).Nullable(); } } [Migration(2018_11_03_2000)] public class EventNameExtend : AutoReversingMigration { public override void Up() { Alter.Column("EnglishName").OnTable(TableNames.AlbumReleaseEvents).AsString(255).NotNullable(); Alter.Column("EnglishName").OnTable(TableNames.AlbumReleaseEventSeries).AsString(255).NotNullable(); } } [Migration(2018_07_19_1900)] public class LyricsUrlExtend : AutoReversingMigration { public override void Up() { Alter.Column("URL").OnTable(TableNames.LyricsForSongs).AsString(500).NotNullable(); } } [Migration(2018_07_18_1900)] public class EntryReportCloseDate : AutoReversingMigration { public override void Up() { Create.Column("ClosedAt").OnTable(TableNames.EntryReports).AsDateTime().Nullable(); } } [Migration(2017_12_10_1900)] public class PublishDateForAllPVs : AutoReversingMigration { public override void Up() { Create.Column("PublishDate").OnTable(TableNames.PVsForAlbums).AsDateTime().Nullable(); Create.Column("PublishDate").OnTable(TableNames.PVsForEvents).AsDateTime().Nullable(); } } [Migration(2017_11_12_2100)] public class TagMappingCreateDate : AutoReversingMigration { public override void Up() { Create.Column("CreateDate").OnTable(TableNames.TagMappings).AsDateTime().NotNullable().WithDefault(SystemMethods.CurrentDateTime); } } [Migration(2017_10_01_1400)] public class UserStandAlone : AutoReversingMigration { public override void Up() { Create.Column("Standalone").OnTable(TableNames.UserOptions).AsBoolean().NotNullable().WithDefaultValue(false); } } [Migration(2017_09_17_2200)] public class SongListDeleted : AutoReversingMigration { public override void Up() { Create.Column("Deleted").OnTable(TableNames.SongLists).AsBoolean().NotNullable().WithDefaultValue(false); } } >>>>>>> // Migration version format: YYYY_MM_DD_HHmm public class EventVenues : AutoReversingMigration { public override void Up() { Create.Table("EventVenues") .WithColumn("Id").AsInt32().NotNullable().PrimaryKey().Identity() .WithColumn("Address").AsString().NotNullable().WithDefaultValue(string.Empty) .WithColumn("JapaneseName").AsString(255).NotNullable().WithDefaultValue(string.Empty) .WithColumn("RomajiName").AsString(255).NotNullable().WithDefaultValue(string.Empty) .WithColumn("EnglishName").AsString(255).NotNullable().WithDefaultValue(string.Empty); } } [Migration(2020_02_08_1800)] public class IPRuleAddressUniqueIndex : AutoReversingMigration { public override void Up() { Create.Index("UX_IPRules_Address").OnTable(TableNames.IPRules).OnColumn("Address").Ascending().WithOptions().Unique(); } } [Migration(2020_02_07_2000)] public class UserCustomTitle : AutoReversingMigration { public override void Up() { Create.Column("CustomTitle").OnTable(TableNames.UserOptions).AsString(200).NotNullable().WithDefaultValue(string.Empty); } } [Migration(2020_02_05_1900)] public class EventDescriptionLength : Migration { public override void Up() { Delete.DefaultConstraint().OnTable(TableNames.AlbumReleaseEvents).OnColumn("Description"); Alter.Column("Description").OnTable(TableNames.AlbumReleaseEvents).AsString(int.MaxValue).NotNullable().WithDefaultValue(string.Empty); Delete.DefaultConstraint().OnTable(TableNames.AlbumReleaseEventSeries).OnColumn("Description"); Alter.Column("Description").OnTable(TableNames.AlbumReleaseEventSeries).AsString(int.MaxValue).NotNullable().WithDefaultValue(string.Empty); } public override void Down() {} } [Migration(2020_01_05_1600)] public class TagRelatedEntries : AutoReversingMigration { public override void Up() { var tableName = "EntryTypeToTagMappings"; Create.Table(tableName) .WithColumn(ColumnNames.Id).AsInt32().NotNullable().PrimaryKey().Identity() .WithColumn("EntryType").AsString(20).NotNullable() .WithColumn("SubType").AsString(30).NotNullable() .WithColumn("Tag").AsInt32().NotNullable().ForeignKey(TableNames.Tags, ColumnNames.Id).OnDelete(Rule.Cascade); Create.Index("UX_EntryTypeToTagMappings_EntryType").OnTable(tableName) .OnColumn("EntryType").Ascending() .OnColumn("SubType").Ascending() .WithOptions().Unique(); Create.Index("UX_EntryTypeToTagMappings_Tag").OnTable(tableName) .OnColumn("Tag").Ascending() .WithOptions().Unique(); } } [Migration(2019_11_17_0100)] public class SongListTags : AutoReversingMigration { public override void Up() { Create.Table("SongListTagUsages") .WithColumn("Id").AsInt64().NotNullable().PrimaryKey().Identity() .WithColumn("Count").AsInt32().NotNullable() .WithColumn("SongList").AsInt32().NotNullable().ForeignKey(TableNames.SongLists, "Id").OnDelete(Rule.Cascade) .WithColumn("Tag").AsInt32().NotNullable().ForeignKey(TableNames.Tags, "Id") .WithColumn("Date").AsDateTime().NotNullable(); Create.Table("SongListTagVotes") .WithColumn("Id").AsInt64().NotNullable().PrimaryKey().Identity() .WithColumn("Usage").AsInt64().NotNullable().ForeignKey("SongListTagUsages", "Id").OnDelete(Rule.Cascade) .WithColumn("[User]").AsInt32().NotNullable().ForeignKey(TableNames.Users, "Id"); Create.Index("UX_SongListTagUsages").OnTable("SongListTagUsages").OnColumn("SongList").Ascending() .OnColumn("Tag").Ascending().WithOptions().Unique(); Create.Index("IX_SongListTagUsages_Tag").OnTable("SongListTagUsages").OnColumn("Tag").Ascending(); } } [Migration(2019_04_14_1300)] public class ArchivedEntryVersionChangedFieldsLength : AutoReversingMigration { public override void Up() { Alter.Column("ChangedFields").OnTable(TableNames.ArchivedAlbumVersions).AsAnsiString(1000).NotNullable().WithDefaultValue(string.Empty); Alter.Column("ChangedFields").OnTable(TableNames.ArchivedArtistVersions).AsAnsiString(1000).NotNullable().WithDefaultValue(string.Empty); Alter.Column("ChangedFields").OnTable(TableNames.ArchivedSongVersions).AsAnsiString(1000).NotNullable().WithDefaultValue(string.Empty); } } [Migration(2019_03_12_2100)] public class SongNameIndex : AutoReversingMigration { public override void Up() { if (!Schema.Table(TableNames.SongNames).Index("IX_SongNames").Exists()) { Create.Index("IX_SongNames").OnTable(TableNames.SongNames).OnColumn("Song").Ascending(); } } } [Migration(2019_01_27_1700)] public class AlbumReviews : AutoReversingMigration { public override void Up() { Create.Table(TableNames.AlbumReviews) .WithColumn("Id").AsInt32().NotNullable().PrimaryKey().Identity() .WithColumn("Album").AsInt32().NotNullable().ForeignKey(TableNames.Albums, "Id").OnDelete(Rule.Cascade) .WithColumn("[Date]").AsDateTime().NotNullable() .WithColumn("LanguageCode").AsString(8).NotNullable() .WithColumn("Text").AsString(4000).NotNullable() .WithColumn("Title").AsString(200).NotNullable() .WithColumn("[User]").AsInt32().NotNullable().ForeignKey(TableNames.Users, "Id").OnDelete(Rule.Cascade); Create.Index("UX_AlbumReviews").OnTable(TableNames.AlbumReviews) .OnColumn("Album").Ascending() .OnColumn("[User]").Ascending() .OnColumn("LanguageCode").Ascending() .WithOptions().Unique(); } } [Migration(2019_01_17_2200)] public class AuditLogEntryEntryLink : AutoReversingMigration { public override void Up() { Create.Column("EntryId").OnTable(TableNames.AuditLogEntries).AsInt32().NotNullable().WithDefaultValue(0); Create.Column("EntryType").OnTable(TableNames.AuditLogEntries).AsString(20).Nullable(); } } [Migration(2018_11_03_2000)] public class EventNameExtend : AutoReversingMigration { public override void Up() { Alter.Column("EnglishName").OnTable(TableNames.AlbumReleaseEvents).AsString(255).NotNullable(); Alter.Column("EnglishName").OnTable(TableNames.AlbumReleaseEventSeries).AsString(255).NotNullable(); } } [Migration(2018_07_19_1900)] public class LyricsUrlExtend : AutoReversingMigration { public override void Up() { Alter.Column("URL").OnTable(TableNames.LyricsForSongs).AsString(500).NotNullable(); } } [Migration(2018_07_18_1900)] public class EntryReportCloseDate : AutoReversingMigration { public override void Up() { Create.Column("ClosedAt").OnTable(TableNames.EntryReports).AsDateTime().Nullable(); } } [Migration(2017_12_10_1900)] public class PublishDateForAllPVs : AutoReversingMigration { public override void Up() { Create.Column("PublishDate").OnTable(TableNames.PVsForAlbums).AsDateTime().Nullable(); Create.Column("PublishDate").OnTable(TableNames.PVsForEvents).AsDateTime().Nullable(); } } [Migration(2017_11_12_2100)] public class TagMappingCreateDate : AutoReversingMigration { public override void Up() { Create.Column("CreateDate").OnTable(TableNames.TagMappings).AsDateTime().NotNullable().WithDefault(SystemMethods.CurrentDateTime); } } [Migration(2017_10_01_1400)] public class UserStandAlone : AutoReversingMigration { public override void Up() { Create.Column("Standalone").OnTable(TableNames.UserOptions).AsBoolean().NotNullable().WithDefaultValue(false); } } [Migration(2017_09_17_2200)] public class SongListDeleted : AutoReversingMigration { public override void Up() { Create.Column("Deleted").OnTable(TableNames.SongLists).AsBoolean().NotNullable().WithDefaultValue(false); } }
<<<<<<< using VocaDb.Model.Domain.Comments; ======= using VocaDb.Model.Domain.ExtLinks; >>>>>>> using VocaDb.Model.Domain.Comments; using VocaDb.Model.Domain.ExtLinks;
<<<<<<< using System; using System.Collections.Generic; using System.Net; using System.Net.Http; using System.Net.Http.Headers; using System.Text; using System.Threading.Tasks; ======= >>>>>>> using System; using System.Collections.Generic; using System.Net; using System.Net.Http; using System.Net.Http.Headers; using System.Text; using System.Threading.Tasks; <<<<<<< requestUriStringBuilder.AppendFormat("&{0}={1}", ServiceConstants.SCOPE, WebUtility.UrlEncode(string.Join(" ", ServiceConstants.Scopes))); requestUriStringBuilder.AppendFormat("&{0}={1}", ServiceConstants.RESPONSE_TYPE, ServiceConstants.CODE); ======= requestUriStringBuilder.AppendFormat("&{0}={1}", Constants.Authentication.ScopeKeyName, string.Join("%20", ServiceConstants.Scopes)); requestUriStringBuilder.AppendFormat("&{0}={1}", Constants.Authentication.ResponseTypeKeyName, Constants.Authentication.CodeKeyName); >>>>>>> requestUriStringBuilder.AppendFormat("&{0}={1}", Constants.Authentication.ScopeKeyName, string.Join("%20", ServiceConstants.Scopes)); requestUriStringBuilder.AppendFormat("&{0}={1}", Constants.Authentication.ResponseTypeKeyName, Constants.Authentication.CodeKeyName);
<<<<<<< using MoneyFox.Domain; ======= using MoneyFox.Presentation.Utilities; >>>>>>> using MoneyFox.Domain; using MoneyFox.Presentation.Utilities;
<<<<<<< unitOfWork.CategoryRepository.Selected = new Category(); ======= >>>>>>> <<<<<<< Assert.IsNull(unitOfWork.CategoryRepository.Selected); ======= >>>>>>>
<<<<<<< [Activity(Label = "MoneyFox", Theme = "@style/MainTheme", ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation, Exported = true, Name = "com.applysolutions.moneyfox.MainActivity")] public class MainActivity : MvxFormsAppCompatActivity { /// <summary> /// Constant for the ClearPayment Service. /// </summary> public const int MESSAGE_SERVICE_CLEAR_PAYMENTS = 1; /// <summary> /// Constant for the recurring payment Service. /// </summary> public const int MESSAGE_SERVICE_RECURRING_PAYMENTS = 2; /// <summary> /// Constant for the sync backup Service. /// </summary> public const int MESSAGE_SERVICE_SYNC_BACKUP = 3; /// <summary> /// Constant for the add expense shortcut /// </summary> const string ACTION_ADD_EXPENSE_VIEW = "com.applysolutions.moneyfox.shortcuts.ADD_EXPENSE"; /// <summary> /// Constant for the add income shortcut /// </summary> const string ACTION_ADD_INCOME_VIEW = "com.applysolutions.moneyfox.shortcuts.ADD_INCOME"; /// <summary> /// Constant for the add income shortcut /// </summary> const string ACTION_ADD_TRANSFER_VIEW = "com.applysolutions.moneyfox.shortcuts.ADD_TRANSFER"; Handler handler; private ClearPaymentsJob clearPaymentsJob; private RecurringPaymentJob recurringPaymentJob; protected override void OnCreate(Bundle bundle) { TabLayoutResource = Resource.Layout.Tabbar; ToolbarResource = Resource.Layout.Toolbar; base.OnCreate(bundle); Popup.Init(this, bundle); // Handler to create jobs. handler = new Handler(msg => { switch (msg.What) { case MESSAGE_SERVICE_CLEAR_PAYMENTS: clearPaymentsJob = (ClearPaymentsJob)msg.Obj; clearPaymentsJob.ScheduleTask(); break; case MESSAGE_SERVICE_RECURRING_PAYMENTS: recurringPaymentJob = (RecurringPaymentJob)msg.Obj; recurringPaymentJob.ScheduleTask(); break; } }); // Start services and provide it a way to communicate with us. var startServiceIntentClearPayment = new Intent(this, typeof(ClearPaymentsJob)); startServiceIntentClearPayment.PutExtra("messenger", new Messenger(handler)); StartService(startServiceIntentClearPayment); var startServiceIntentRecurringPayment = new Intent(this, typeof(RecurringPaymentJob)); startServiceIntentRecurringPayment.PutExtra("messenger", new Messenger(handler)); StartService(startServiceIntentRecurringPayment); if (Mvx.IoCProvider.CanResolve<IBackgroundTaskManager>() && Mvx.IoCProvider.CanResolve<ISettingsManager>()) { Mvx.IoCProvider.Resolve<IBackgroundTaskManager>() .StartBackupSyncTask(Mvx.IoCProvider.Resolve<ISettingsManager>().BackupSyncRecurrence); } // If the user opened the app via one of the shortcuts, // navigate the user to the right page NavigateToShortcuts(); } public override void OnBackPressed() { Popup.SendBackPressed(base.OnBackPressed); } private void NavigateToShortcuts() { switch (Intent.Action) { case ACTION_ADD_EXPENSE_VIEW: { System.Diagnostics.Debug.WriteLine("AddExpense"); Mvx.IoCProvider.Resolve<AccountListViewActionViewModel>().GoToAddExpenseCommand.Execute(null); } break; case ACTION_ADD_INCOME_VIEW: { System.Diagnostics.Debug.WriteLine("AddIncome"); Mvx.IoCProvider.Resolve<AccountListViewActionViewModel>().GoToAddIncomeCommand.Execute(null); } break; case ACTION_ADD_TRANSFER_VIEW: { System.Diagnostics.Debug.WriteLine("AddTransfer"); Mvx.IoCProvider.Resolve<AccountListViewActionViewModel>().GoToAddTransferCommand.Execute(null); } break; } } } ======= [Activity(Label = "MoneyFox", Theme = "@style/MainTheme", ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)] public class MainActivity : MvxFormsAppCompatActivity { /// <summary> /// Constant for the ClearPayment Service. /// </summary> public const int MESSAGE_SERVICE_CLEAR_PAYMENTS = 1; /// <summary> /// Constant for the recurring payment Service. /// </summary> public const int MESSAGE_SERVICE_RECURRING_PAYMENTS = 2; /// <summary> /// Constant for the sync backup Service. /// </summary> public const int MESSAGE_SERVICE_SYNC_BACKUP = 3; Handler handler; private ClearPaymentsJob clearPaymentsJob; private RecurringPaymentJob recurringPaymentJob; protected override void OnCreate(Bundle bundle) { ConfigurationManager.Initialise(PCLAppConfig.FileSystemStream.PortableStream.Current); #if !DEBUG AppCenter.Start("6d9840ff-d832-4c1b-a2ee-bac7f15d89bd", typeof(Analytics), typeof(Crashes)); #endif TabLayoutResource = Resource.Layout.Tabbar; ToolbarResource = Resource.Layout.Toolbar; base.OnCreate(bundle); Popup.Init(this, bundle); // Handler to create jobs. handler = new Handler(msg => { switch (msg.What) { case MESSAGE_SERVICE_CLEAR_PAYMENTS: clearPaymentsJob = (ClearPaymentsJob)msg.Obj; clearPaymentsJob.ScheduleTask(); break; case MESSAGE_SERVICE_RECURRING_PAYMENTS: recurringPaymentJob = (RecurringPaymentJob)msg.Obj; recurringPaymentJob.ScheduleTask(); break; } }); // Start services and provide it a way to communicate with us. var startServiceIntentClearPayment = new Intent(this, typeof(ClearPaymentsJob)); startServiceIntentClearPayment.PutExtra("messenger", new Messenger(handler)); StartService(startServiceIntentClearPayment); var startServiceIntentRecurringPayment = new Intent(this, typeof(RecurringPaymentJob)); startServiceIntentRecurringPayment.PutExtra("messenger", new Messenger(handler)); StartService(startServiceIntentRecurringPayment); if (Mvx.IoCProvider.CanResolve<IBackgroundTaskManager>() && Mvx.IoCProvider.CanResolve<ISettingsManager>()) { Mvx.IoCProvider.Resolve<IBackgroundTaskManager>() .StartBackupSyncTask(Mvx.IoCProvider.Resolve<ISettingsManager>().BackupSyncRecurrence); } } public override void OnBackPressed() { Popup.SendBackPressed(base.OnBackPressed); } } >>>>>>> [Activity(Label = "MoneyFox", Theme = "@style/MainTheme", ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation, Exported = true, Name = "com.applysolutions.moneyfox.MainActivity")] public class MainActivity : MvxFormsAppCompatActivity { /// <summary> /// Constant for the ClearPayment Service. /// </summary> public const int MESSAGE_SERVICE_CLEAR_PAYMENTS = 1; /// <summary> /// Constant for the recurring payment Service. /// </summary> public const int MESSAGE_SERVICE_RECURRING_PAYMENTS = 2; /// <summary> /// Constant for the sync backup Service. /// </summary> public const int MESSAGE_SERVICE_SYNC_BACKUP = 3; /// <summary> /// Constant for the add expense shortcut /// </summary> const string ACTION_ADD_EXPENSE_VIEW = "com.applysolutions.moneyfox.shortcuts.ADD_EXPENSE"; /// <summary> /// Constant for the add income shortcut /// </summary> const string ACTION_ADD_INCOME_VIEW = "com.applysolutions.moneyfox.shortcuts.ADD_INCOME"; /// <summary> /// Constant for the add income shortcut /// </summary> const string ACTION_ADD_TRANSFER_VIEW = "com.applysolutions.moneyfox.shortcuts.ADD_TRANSFER"; Handler handler; private ClearPaymentsJob clearPaymentsJob; private RecurringPaymentJob recurringPaymentJob; protected override void OnCreate(Bundle bundle) { ConfigurationManager.Initialise(PCLAppConfig.FileSystemStream.PortableStream.Current); #if !DEBUG AppCenter.Start("6d9840ff-d832-4c1b-a2ee-bac7f15d89bd", typeof(Analytics), typeof(Crashes)); #endif TabLayoutResource = Resource.Layout.Tabbar; ToolbarResource = Resource.Layout.Toolbar; base.OnCreate(bundle); Popup.Init(this, bundle); // Handler to create jobs. handler = new Handler(msg => { switch (msg.What) { case MESSAGE_SERVICE_CLEAR_PAYMENTS: clearPaymentsJob = (ClearPaymentsJob)msg.Obj; clearPaymentsJob.ScheduleTask(); break; case MESSAGE_SERVICE_RECURRING_PAYMENTS: recurringPaymentJob = (RecurringPaymentJob)msg.Obj; recurringPaymentJob.ScheduleTask(); break; } }); // Start services and provide it a way to communicate with us. var startServiceIntentClearPayment = new Intent(this, typeof(ClearPaymentsJob)); startServiceIntentClearPayment.PutExtra("messenger", new Messenger(handler)); StartService(startServiceIntentClearPayment); var startServiceIntentRecurringPayment = new Intent(this, typeof(RecurringPaymentJob)); startServiceIntentRecurringPayment.PutExtra("messenger", new Messenger(handler)); StartService(startServiceIntentRecurringPayment); if (Mvx.IoCProvider.CanResolve<IBackgroundTaskManager>() && Mvx.IoCProvider.CanResolve<ISettingsManager>()) { Mvx.IoCProvider.Resolve<IBackgroundTaskManager>() .StartBackupSyncTask(Mvx.IoCProvider.Resolve<ISettingsManager>().BackupSyncRecurrence); } // If the user opened the app via one of the shortcuts, // navigate the user to the right page NavigateToShortcuts(); } public override void OnBackPressed() { Popup.SendBackPressed(base.OnBackPressed); } private void NavigateToShortcuts() { switch (Intent.Action) { case ACTION_ADD_EXPENSE_VIEW: { System.Diagnostics.Debug.WriteLine("AddExpense"); Mvx.IoCProvider.Resolve<AccountListViewActionViewModel>().GoToAddExpenseCommand.Execute(null); } break; case ACTION_ADD_INCOME_VIEW: { System.Diagnostics.Debug.WriteLine("AddIncome"); Mvx.IoCProvider.Resolve<AccountListViewActionViewModel>().GoToAddIncomeCommand.Execute(null); } break; case ACTION_ADD_TRANSFER_VIEW: { System.Diagnostics.Debug.WriteLine("AddTransfer"); Mvx.IoCProvider.Resolve<AccountListViewActionViewModel>().GoToAddTransferCommand.Execute(null); } break; } } }
<<<<<<< var track = false; Module module = null; ======= >>>>>>> Module module = null; <<<<<<< if (_filter.UseAssembly(assemblyName)) { if (builder.CanInstrument) { module = builder.BuildModuleModel(); track = true; } } if (_filter.UseTestAssembly(modulePath)) { module = builder.BuildModuleTestModel(module); } _persistance.PersistModule(module); return track; ======= if (!_filter.UseAssembly(assemblyName)) { var module = builder.BuildModuleModel(false); module.SkippedDueTo = SkippedMethod.Filter; _persistance.PersistModule(module); return false; } if (!builder.CanInstrument) { var module = builder.BuildModuleModel(false); module.SkippedDueTo = SkippedMethod.MissingPdb; _persistance.PersistModule(module); return false; } _persistance.PersistModule(builder.BuildModuleModel(true)); return true; >>>>>>> if (!_filter.UseAssembly(assemblyName)) { module = builder.BuildModuleModel(false); module.SkippedDueTo = SkippedMethod.Filter; } else if (!builder.CanInstrument) { module = builder.BuildModuleModel(false); module.SkippedDueTo = SkippedMethod.MissingPdb; } module = module ?? builder.BuildModuleModel(true); if (_filter.UseTestAssembly(modulePath)) { module = builder.BuildModuleTestModel(module, false); } _persistance.PersistModule(module); return !module.ShouldSerializeSkippedDueTo();
<<<<<<< ======= var accounts = AccountStore.Create(Application.Context).FindAccountsForService(ONEDRIVE_KEY).ToList(); if (accounts.Any()) { authenticationResponseValues = accounts.FirstOrDefault()?.Properties; //tcs.SetResult(true); //return tcs.Task; } >>>>>>>
<<<<<<< using MediatR; using MoneyFox.Application.Common.Interfaces; using MoneyFox.Domain; using MoneyFox.Domain.Entities; using System; ======= using System; using System.Collections.Generic; >>>>>>> using MediatR; using MoneyFox.Application.Common.Interfaces; using MoneyFox.Domain; using MoneyFox.Domain.Entities; using System; using System.Collections.Generic;
<<<<<<< ======= using MoneyManager.Windows; >>>>>>> <<<<<<< using MoneyFox.Windows.Shortcut; ======= using PluginLoader = MvvmCross.Plugins.Messenger.PluginLoader; >>>>>>> using PluginLoader = MvvmCross.Plugins.Messenger.PluginLoader;
<<<<<<< using System.Collections.ObjectModel; using System.Diagnostics; ======= >>>>>>> using System.Collections.ObjectModel; <<<<<<< /// <summary> /// ICommandLine /// </summary> ======= private static readonly object Protection = new object(); /// <summary> /// Provides subclasses access to the command line object /// </summary> >>>>>>> private static readonly object Protection = new object(); /// <summary> /// Provides subclasses access to the command line object /// </summary> <<<<<<< private void MarkSkippedMethods() { ======= // static readonly empty collections, saves creation time of new empty ones private static readonly SequencePoint[] EmptySeqPoints = new SequencePoint[0]; private static readonly BranchPoint[] EmptyBranchPoints = new BranchPoint[0]; private static readonly List<BranchPoint> EmptyBranchList = new List<BranchPoint>(0); // Dictionary with stored source files per module private Dictionary<uint, CodeCoverageStringTextSource> _sourceRepository = new Dictionary<uint, CodeCoverageStringTextSource>(); private uint _fileIdCache; private CodeCoverageStringTextSource _textSourceCache; private CodeCoverageStringTextSource GetCodeCoverageStringTextSource (uint fileId) { CodeCoverageStringTextSource source = null; if (fileId != 0) { if (_fileIdCache == fileId) { source = _textSourceCache; } else { _sourceRepository.TryGetValue (fileId, out source); if (source != null) { _fileIdCache = fileId; _textSourceCache = source; } } } return source; } private string GetSequencePointText (SequencePoint sp) { if (sp != null) { CodeCoverageStringTextSource source = GetCodeCoverageStringTextSource (sp.FileId); return source != null ? source.GetText(sp) : ""; } return ""; } private static bool IsSingleCharSequencePoint (SequencePoint sp) { return ((sp != null) && (sp.StartLine == sp.EndLine) && (sp.EndColumn - sp.StartColumn) == 1); } private bool IsLeftBraceSequencePoint (SequencePoint sp) { return IsSingleCharSequencePoint(sp) && GetSequencePointText(sp) == "{"; } private bool IsRightBraceSequencePoint (SequencePoint sp) { return IsSingleCharSequencePoint(sp) && GetSequencePointText(sp) == "}"; } private void PopulateInstrumentedPoints() { if (CoverageSession.Modules == null) return; >>>>>>> private void MarkSkippedMethods() { <<<<<<< foreach (var @class in (module.Classes ?? new Class[0]).Where(x => !x.ShouldSerializeSkippedDueTo())) ======= #region Module FileID/FullPath/TextSource _sourceRepository = new Dictionary<uint, CodeCoverageStringTextSource>(); var filesDictionary = new Dictionary<string,uint>(); foreach (var file in (module.Files ?? new File[0]).Where(file => !String.IsNullOrWhiteSpace(file.FullPath) && !filesDictionary.ContainsKey(file.FullPath))) { var source = CodeCoverageStringTextSource.GetSource(file.FullPath); if (source != null) _sourceRepository.Add (file.UniqueId, source); filesDictionary.Add(file.FullPath, file.UniqueId); } #endregion #region TODO:? Merge Compiler Extracted/Generated Methods (enumerator methods) SP's into method SP's // Store repeated Query var classesQuery = (module.Classes ?? new Class[0]).Where(x => !x.ShouldSerializeSkippedDueTo()); #endregion foreach (var @class in classesQuery) >>>>>>> foreach (var @class in (module.Classes ?? new Class[0]).Where(x => !x.ShouldSerializeSkippedDueTo())) <<<<<<< ======= if (method.SequencePoints == null) method.SequencePoints = EmptySeqPoints; if (method.BranchPoints == null) method.BranchPoints = EmptyBranchPoints; // No sequences in method, but branches present? => remove branches if (method.SequencePoints.Length == 0 && method.BranchPoints.Length != 0) { method.BranchPoints = EmptyBranchPoints; } if (method.SequencePoints.Length != 0) MapFileReferences(method.SequencePoints, filesDictionary); if (method.BranchPoints.Length != 0) MapFileReferences(method.BranchPoints, filesDictionary); #region Merge branch-exits // anything to join, filter, merge? if (method.SequencePoints.Length != 0 && method.BranchPoints.Length != 0) { #region Join Sequences and Branches // Quick match branches to sequence using SP&BP sort order by IL offset // SP & BP are sorted by offset and code below expect both SP & BP to be sorted by offset // ATTN: Sorted again to prevent future bugs if order of SP & BP is changed! method.SequencePoints = method.SequencePoints.OrderBy( sp => sp.Offset ).ToArray(); method.BranchPoints = method.BranchPoints.OrderBy( bp => bp.Offset ).ToArray(); // Use stack because Stack.Pop is constant time var branchStack = new Stack<BranchPoint>(method.BranchPoints); // Join offset matching BranchPoints with SequencePoint "parent" // Exclude all branches where BranchPoint.Offset < first method.SequencePoints.Offset // Reverse() starts loop from highest offset to lowest foreach (SequencePoint spParent in method.SequencePoints.Reverse()) { // create branchPoints "child" list spParent.BranchPoints = new List<BranchPoint>(); // if BranchPoint.Offset is >= SequencePoint.Offset // then move BranchPoint from stack to "child" list (Pop/Add) while (branchStack.Count != 0 && branchStack.Peek().Offset >= spParent.Offset) { spParent.BranchPoints.Add(branchStack.Pop()); } } // clear the stack branchStack.Clear(); #endregion #region Remove Compiler Generated Branches from SequencePoints long startOffset = long.MinValue; long finalOffset = long.MaxValue; CodeCoverageStringTextSource source = GetCodeCoverageStringTextSource(method.FileRef.UniqueId); if (source != null && source.FileType == FileType.CSharp) { var sourceLineOrderedSps = method.SequencePoints.OrderBy(sp=>sp.StartLine).ThenBy(sp=>sp.StartColumn).Where(sp=>sp.FileId == method.FileRef.UniqueId).ToArray(); if (sourceLineOrderedSps.Length >= 3) { // method.sp; leftBrace.sp, rightBrace.sp || leftBrace.sp, any.sp, rightBrace.sp if (IsLeftBraceSequencePoint(sourceLineOrderedSps[1])) { startOffset = sourceLineOrderedSps[1].Offset; } else if (IsLeftBraceSequencePoint(sourceLineOrderedSps[0])) { startOffset = sourceLineOrderedSps[0].Offset; } if (IsRightBraceSequencePoint(sourceLineOrderedSps.Last())) { finalOffset = sourceLineOrderedSps.Last().Offset; } } } if (startOffset != long.MinValue || finalOffset != long.MaxValue) { // doRemoveBranches where .Offset <= startOffset"{" or finalOffset"}" <= .Offset // this will exclude "{" "}" compiler generated branches and ccrewrite Code Contract's foreach (var sp in method.SequencePoints) { if (sp != null && sp.BranchPoints != null && sp.BranchPoints.Count != 0 && sp.FileId == method.FileRef.UniqueId) { if (sp.Offset <= startOffset || finalOffset <= sp.Offset) { sp.BranchPoints = EmptyBranchList; } } } } #endregion #region Merge Branch-Exits for each Sequence // Collection of validBranchPoints (child/connected to parent SequencePoint) var validBranchPoints = new List<BranchPoint>(); var branchExits = new Dictionary<int, BranchPoint>(); foreach (var sp in method.SequencePoints) { // SequencePoint has branches attached? if (sp.BranchPoints != null && sp.BranchPoints.Count != 0) { // Merge sp.BranchPoints using EndOffset as branchExits key branchExits.Clear(); foreach (var branchPoint in sp.BranchPoints) { if (!branchExits.ContainsKey(branchPoint.EndOffset)) { branchExits[branchPoint.EndOffset] = branchPoint; // insert branch } else { branchExits[branchPoint.EndOffset].VisitCount += branchPoint.VisitCount; // update branch } } // Update SequencePoint counters sp.BranchExitsCount = 0; sp.BranchExitsVisit = 0; foreach (var branchPoint in branchExits.Values) { sp.BranchExitsCount += 1; sp.BranchExitsVisit += branchPoint.VisitCount == 0 ? 0 : 1; } // Add to validBranchPoints validBranchPoints.AddRange(sp.BranchPoints); sp.BranchPoints = EmptyBranchList; // clear } } // Replace original method branchPoints with valid (filtered and joined) branches. // Order is Required by FilePersistanceTest because it does not sets .Offset. // (Order by UniqueSequencePoint is equal to order by .Offset when .Offset is set) method.BranchPoints = validBranchPoints.OrderBy(bp => bp.UniqueSequencePoint).ToArray(); validBranchPoints = EmptyBranchList; // clear #endregion } #endregion >>>>>>>
<<<<<<< public virtual bool IsFolderLocked(string path) { var files = GetFileInfos(path, "*.*", SearchOption.AllDirectories); foreach(var fileInfo in files) { if (IsFileLocked(fileInfo)) return true; } return false; } public virtual bool IsFileLocked(FileInfo file) { FileStream stream = null; try { stream = file.Open(FileMode.Open, FileAccess.Read, FileShare.None); } catch (IOException) { return true; } finally { if (stream != null) stream.Close(); } //file is not locked return false; } ======= public virtual bool IsChildOfPath(string child, string parent) { if (Path.GetFullPath(child).StartsWith(Path.GetFullPath(parent))) return true; return false; } >>>>>>> public virtual bool IsFolderLocked(string path) { var files = GetFileInfos(path, "*.*", SearchOption.AllDirectories); foreach(var fileInfo in files) { if (IsFileLocked(fileInfo)) return true; } return false; } public virtual bool IsFileLocked(FileInfo file) { FileStream stream = null; try { stream = file.Open(FileMode.Open, FileAccess.Read, FileShare.None); } catch (IOException) { return true; } finally { if (stream != null) stream.Close(); } //file is not locked return false; } public virtual bool IsChildOfPath(string child, string parent) { if (Path.GetFullPath(child).StartsWith(Path.GetFullPath(parent))) return true; return false; }
<<<<<<< using Ninject; ======= using NzbDrone.Model; >>>>>>> using Ninject; using NzbDrone.Model; <<<<<<< ======= public virtual AuthenticationType AuthenticationType { get { return (AuthenticationType)GetValueInt("AuthenticationType", 0); } set { SetValue("AuthenticationType", (int)value); } } >>>>>>> public virtual AuthenticationType AuthenticationType { get { return (AuthenticationType)GetValueInt("AuthenticationType", 0); } } <<<<<<< private void WriteDefaultConfig() ======= public virtual string GetValue(string key, object defaultValue, string parent = null) >>>>>>> public virtual string GetValue(string key, object defaultValue, string parent = null)
<<<<<<< .WhereAll().Has(s => s.SeriesId = 5) .Build()) .With(c => c.Quality = new Quality(QualityTypes.DVD, false)) .Build(); ======= .Build(); >>>>>>> .WhereAll().Has(s => s.SeriesId = 5) .Build();
<<<<<<< using NzbDrone.Common.Processes; ======= using NzbDrone.Core.Configuration; >>>>>>> using NzbDrone.Common.Processes; using NzbDrone.Core.Configuration;
<<<<<<< [Test] public void SetPostDownloadStatus_Invalid_EpisodeId() { var db = MockLib.GetEmptyDatabase(); var mocker = new AutoMoqer(); mocker.SetConstant(db); var postDownloadStatus = PostDownloadStatusType.Failed; var fakeSeries = Builder<Series>.CreateNew() .With(s => s.SeriesId = 12345) .With(s => s.CleanTitle = "officeus") .Build(); var fakeEpisodes = Builder<Episode>.CreateListOfSize(1) .WhereAll() .Have(c => c.SeriesId = 12345) .Have(c => c.SeasonNumber = 1) .Have(c => c.PostDownloadStatus = PostDownloadStatusType.Unknown) .Build(); db.Insert(fakeSeries); db.InsertMany(fakeEpisodes); mocker.GetMock<SeriesProvider>().Setup(s => s.FindSeries("officeus")).Returns(fakeSeries); //Act mocker.Resolve<EpisodeProvider>().SetPostDownloadStatus(new List<int>{300}, postDownloadStatus); //Assert var result = db.Fetch<Episode>(); result.Where(e => e.PostDownloadStatus == postDownloadStatus).Count().Should().Be(0); } [Test] [ExpectedException(typeof(SqlCeException))] public void SetPostDownloadStatus_No_EpisodeId_In_Database() { var db = MockLib.GetEmptyDatabase(); var mocker = new AutoMoqer(); mocker.SetConstant(db); var postDownloadStatus = PostDownloadStatusType.Failed; var fakeSeries = Builder<Series>.CreateNew() .With(s => s.SeriesId = 12345) .With(s => s.CleanTitle = "officeus") .Build(); var fakeEpisodes = Builder<Episode>.CreateListOfSize(1) .WhereAll() .Have(c => c.SeriesId = 12345) .Have(c => c.SeasonNumber = 1) .Have(c => c.PostDownloadStatus = PostDownloadStatusType.Unknown) .Build(); db.Insert(fakeSeries); db.InsertMany(fakeEpisodes); mocker.GetMock<SeriesProvider>().Setup(s => s.FindSeries("officeus")).Returns(fakeSeries); //Act mocker.Resolve<EpisodeProvider>().SetPostDownloadStatus(new List<int>(), postDownloadStatus); //Assert var result = db.Fetch<Episode>(); result.Where(e => e.PostDownloadStatus == postDownloadStatus).Count().Should().Be(0); } ======= [Test] [ExpectedException(typeof(ArgumentException))] public void SetPostDownloadStatus_should_throw_if_episode_list_is_empty() { var mocker = new AutoMoqer(); mocker.Resolve<EpisodeProvider>().SetPostDownloadStatus(new List<int>(), PostDownloadStatusType.Failed); } >>>>>>> [Test] public void SetPostDownloadStatus_Invalid_EpisodeId() { var db = MockLib.GetEmptyDatabase(); var mocker = new AutoMoqer(); mocker.SetConstant(db); var postDownloadStatus = PostDownloadStatusType.Failed; var fakeSeries = Builder<Series>.CreateNew() .With(s => s.SeriesId = 12345) .With(s => s.CleanTitle = "officeus") .Build(); var fakeEpisodes = Builder<Episode>.CreateListOfSize(1) .WhereAll() .Have(c => c.SeriesId = 12345) .Have(c => c.SeasonNumber = 1) .Have(c => c.PostDownloadStatus = PostDownloadStatusType.Unknown) .Build(); db.Insert(fakeSeries); db.InsertMany(fakeEpisodes); mocker.GetMock<SeriesProvider>().Setup(s => s.FindSeries("officeus")).Returns(fakeSeries); //Act mocker.Resolve<EpisodeProvider>().SetPostDownloadStatus(new List<int>{300}, postDownloadStatus); //Assert var result = db.Fetch<Episode>(); result.Where(e => e.PostDownloadStatus == postDownloadStatus).Count().Should().Be(0); } [Test] [ExpectedException(typeof(SqlCeException))] public void SetPostDownloadStatus_No_EpisodeId_In_Database() { var db = MockLib.GetEmptyDatabase(); var mocker = new AutoMoqer(); mocker.SetConstant(db); var postDownloadStatus = PostDownloadStatusType.Failed; var fakeSeries = Builder<Series>.CreateNew() .With(s => s.SeriesId = 12345) .With(s => s.CleanTitle = "officeus") .Build(); var fakeEpisodes = Builder<Episode>.CreateListOfSize(1) .WhereAll() .Have(c => c.SeriesId = 12345) .Have(c => c.SeasonNumber = 1) .Have(c => c.PostDownloadStatus = PostDownloadStatusType.Unknown) .Build(); db.Insert(fakeSeries); db.InsertMany(fakeEpisodes); mocker.GetMock<SeriesProvider>().Setup(s => s.FindSeries("officeus")).Returns(fakeSeries); //Act mocker.Resolve<EpisodeProvider>().SetPostDownloadStatus(new List<int>(), postDownloadStatus); //Assert var result = db.Fetch<Episode>(); result.Where(e => e.PostDownloadStatus == postDownloadStatus).Count().Should().Be(0); } [ExpectedException(typeof(ArgumentException))] public void SetPostDownloadStatus_should_throw_if_episode_list_is_empty() { var mocker = new AutoMoqer(); mocker.Resolve<EpisodeProvider>().SetPostDownloadStatus(new List<int>(), PostDownloadStatusType.Failed); }
<<<<<<< parseResult.AirDate, parseResult.EpisodeTitle, parseResult.Quality.Quality); ======= parseResult.AirDate, parseResult.Episodes.First().Title, parseResult.Quality.QualityType); >>>>>>> parseResult.AirDate, parseResult.Episodes.First().Title, parseResult.Quality.Quality); <<<<<<< var result = String.Format("{0} - {1} - {2} [{3}]", seriesTitle, epNumberString, parseResult.EpisodeTitle, parseResult.Quality.Quality); ======= if (episodeNames.Distinct().Count() == 1) episodeName = episodeNames.First(); else episodeName = String.Join(" + ", episodeNames.Distinct()); var result = String.Format("{0} - {1} - {2} [{3}]", seriesTitle, epNumberString, episodeName, parseResult.Quality.QualityType); >>>>>>> if (episodeNames.Distinct().Count() == 1) episodeName = episodeNames.First(); else episodeName = String.Join(" + ", episodeNames.Distinct()); var result = String.Format("{0} - {1} - {2} [{3}]", seriesTitle, epNumberString, episodeName, parseResult.Quality.Quality);
<<<<<<< var progressNotification = new ProgressNotification("Settings"); _notificationProvider.Register(progressNotification); ======= >>>>>>> _notificationProvider.Register(progressNotification); <<<<<<< var progressNotification = new ProgressNotification("Settings"); _notificationProvider.Register(progressNotification); ======= >>>>>>> _notificationProvider.Register(progressNotification); <<<<<<< var progressNotification = new ProgressNotification("Settings"); _notificationProvider.Register(progressNotification); ======= >>>>>>> _notificationProvider.Register(progressNotification); <<<<<<< var progressNotification = new ProgressNotification("Settings"); _notificationProvider.Register(progressNotification); ======= >>>>>>> _notificationProvider.Register(progressNotification); <<<<<<< var progressNotification = new ProgressNotification("Settings"); _notificationProvider.Register(progressNotification); ======= >>>>>>> _notificationProvider.Register(progressNotification);
<<<<<<< case Constants.LOGON: LoadLogonTab(); ======= case Constants.Logon: >>>>>>> case Constants.Logon: LoadLogonTab();
<<<<<<< //new client, generate nonce and add to unauth queue if (ConnectedClients.Count >= MaxPlayers) ======= inc.SenderConnection.Deny("Connection error - already joined"); return; } int nonce = CryptoRandom.Instance.Next(); var msg = server.CreateMessage(); msg.Write(nonce); unauthenticatedClients.Add(new UnauthenticatedClient(inc.SenderConnection, nonce)); inc.SenderConnection.Approve(msg); } private void CheckAuthentication(NetIncomingMessage inc) { var unauthenticatedClient = unauthenticatedClients.Find(uc => uc.Connection == inc.SenderConnection); if (unauthenticatedClient != null) { unauthenticatedClients.Remove(unauthenticatedClient); string saltedPw = password; saltedPw = saltedPw + Convert.ToString(unauthenticatedClient.Nonce); saltedPw = Encoding.UTF8.GetString(NetUtility.ComputeSHAHash(Encoding.UTF8.GetBytes(saltedPw))); NetEncryption algo = new NetXtea(server, saltedPw); inc.Decrypt(algo); string rdPw = inc.ReadString(); if (rdPw != saltedPw) >>>>>>> //new client, generate nonce and add to unauth queue if (ConnectedClients.Count >= MaxPlayers) <<<<<<< ======= else if (connectedClients.Any(c => c.name.ToLower() == name.ToLower() && c.Connection != inc.SenderConnection)) { inc.SenderConnection.Disconnect("The name ''" + name + "'' is already in use. Please choose another name."); DebugConsole.NewMessage(name + " couldn't join the server (name already in use)", Color.Red); return; } #endif if (!whitelist.IsWhiteListed(name, inc.SenderConnection.RemoteEndPoint.Address.ToString())) { inc.SenderConnection.Disconnect("You're not in this server's whitelist."); DebugConsole.NewMessage(name + " (" + inc.SenderConnection.RemoteEndPoint.Address.ToString() + ") couldn't join the server (not in whitelist)", Color.Red); return; } >>>>>>>
<<<<<<< if (needsAir) UpdateOxygen(deltaTime); if (DoesBleed) { Health -= bleeding * deltaTime; Bleeding -= BleedingDecreaseSpeed * deltaTime; } if (health <= minHealth) Kill(CauseOfDeath.Bloodloss); if (!IsDead) LockHands = false; ======= //CPR stuff is handled in the UpdateCPR function in HumanoidAnimController >>>>>>> if (needsAir) UpdateOxygen(deltaTime); if (DoesBleed) { Health -= bleeding * deltaTime; Bleeding -= BleedingDecreaseSpeed * deltaTime; } if (health <= minHealth) Kill(CauseOfDeath.Bloodloss); if (!IsDead) LockHands = false; //CPR stuff is handled in the UpdateCPR function in HumanoidAnimController
<<<<<<< ======= Assert.IsType<TestEvent>(actual); Assert.Equal(expected.Id, actual.Id); Assert.Equal(expected.DateTime, actual.DateTime); >>>>>>> Assert.IsType<TestEvent>(actual);
<<<<<<< PlayerSettings.iOS.sdkVersion = iOSSdkVersion.DeviceSDK; BuildPuppetScene(BuildTarget.iOS, "PuppetBuilds/iOSMonoBuild"); ======= BuildPuppetScene(BuildTarget.iOS, "iOSMonoBuild"); >>>>>>> PlayerSettings.iOS.sdkVersion = iOSSdkVersion.DeviceSDK; BuildPuppetScene(BuildTarget.iOS, "iOSMonoBuild"); <<<<<<< PlayerSettings.iOS.sdkVersion = iOSSdkVersion.DeviceSDK; BuildPuppetScene(BuildTarget.iOS, "PuppetBuilds/iOSIL2CPPBuild"); ======= BuildPuppetScene(BuildTarget.iOS, "iOSIL2CPPBuild"); } public static void BuildPuppetSceneWsaNetXaml() { EditorUserBuildSettings.wsaUWPBuildType = WSAUWPBuildType.XAML; PlayerSettings.SetScriptingBackend(BuildTargetGroup.WSA, ScriptingImplementation.WinRTDotNET); BuildPuppetScene(BuildTarget.WSAPlayer, "WSANetBuildXaml"); >>>>>>> PlayerSettings.iOS.sdkVersion = iOSSdkVersion.DeviceSDK; BuildPuppetScene(BuildTarget.iOS, "iOSIL2CPPBuild"); } public static void BuildPuppetSceneWsaNetXaml() { EditorUserBuildSettings.wsaUWPBuildType = WSAUWPBuildType.XAML; PlayerSettings.SetScriptingBackend(BuildTargetGroup.WSA, ScriptingImplementation.WinRTDotNET); BuildPuppetScene(BuildTarget.WSAPlayer, "WSANetBuildXaml"); <<<<<<< options = BuildOptions.None, locationPathName = outputDir, ======= options = BuildOptions.StrictMode, locationPathName = Path.Combine(BuildFolder, outputPath), >>>>>>> options = BuildOptions.None, locationPathName = Path.Combine(BuildFolder, outputPath),
<<<<<<< inGameHUD.Update((float)Timing.Step); ======= >>>>>>> <<<<<<< //AssignJobs(connectedClients); ======= >>>>>>> <<<<<<< ======= >>>>>>> <<<<<<< msg.Write(AllowRespawn); ======= msg.Write(AllowRespawn); msg.Write(Submarine.MainSubs[1] != null); //loadSecondSub >>>>>>> msg.Write(AllowRespawn); msg.Write(Submarine.MainSubs[1] != null); //loadSecondSub <<<<<<< public void AssignJobs(List<Client> unassigned) ======= public void WriteCharacterData(NetOutgoingMessage msg, string name, Character c) { msg.Write(c.Info == null); msg.Write(c.ID); msg.Write(c.TeamID); msg.Write(c.ConfigPath); msg.Write(c.WorldPosition.X); msg.Write(c.WorldPosition.Y); msg.Write(c.Enabled); if (c.Info != null) { Client client = connectedClients.Find(cl => cl.Character == c); if (client != null) { msg.Write(true); msg.Write(client.ID); } else if (myCharacter == c) { msg.Write(true); msg.Write((byte)0); } else { msg.Write(false); } msg.Write(name); msg.Write(c is AICharacter); msg.Write(c.Info.Gender == Gender.Female); msg.Write((byte)c.Info.HeadSpriteId); msg.Write(c.Info.Job == null ? "" : c.Info.Job.Name); Item.Spawner.FillNetworkData(msg, c.SpawnItems); } } public void SendCharacterSpawnMessage(Character character, List<NetConnection> recipients = null) { if (recipients != null && !recipients.Any()) return; NetOutgoingMessage message = server.CreateMessage(); message.Write((byte)PacketTypes.NewCharacter); WriteCharacterData(message, character.Name, character); SendMessage(message, NetDeliveryMethod.ReliableUnordered, recipients); } public void SendItemSpawnMessage(List<Item> items, List<NetConnection> recipients = null) { if (items == null || !items.Any()) return; NetOutgoingMessage message = server.CreateMessage(); message.Write((byte)PacketTypes.NewItem); Item.Spawner.FillNetworkData(message, items); SendMessage(message, NetDeliveryMethod.ReliableOrdered, recipients); } public void SendItemRemoveMessage(List<Item> items, List<NetConnection> recipients = null) { if (items == null || !items.Any()) return; NetOutgoingMessage message = server.CreateMessage(); message.Write((byte)PacketTypes.RemoveItem); Item.Remover.FillNetworkData(message, items); SendMessage(message, NetDeliveryMethod.ReliableOrdered, recipients); } public void AssignJobs(List<Client> unassigned, bool assignHost) >>>>>>> public void AssignJobs(List<Client> unassigned, bool assignHost)
<<<<<<< if (c.FileStreamSender != null) UpdateFileTransfer(c, deltaTime); ======= if (c.FileStreamSender != null) UpdateFileTransfer(c, deltaTime); c.ReliableChannel.Update(deltaTime); //slowly reset spam timers c.ChatSpamTimer = Math.Max(0.0f, c.ChatSpamTimer - deltaTime); c.ChatSpamSpeed = Math.Max(0.0f, c.ChatSpamSpeed - deltaTime); >>>>>>> if (c.FileStreamSender != null) UpdateFileTransfer(c, deltaTime); c.ReliableChannel.Update(deltaTime); //slowly reset spam timers c.ChatSpamTimer = Math.Max(0.0f, c.ChatSpamTimer - deltaTime); c.ChatSpamSpeed = Math.Max(0.0f, c.ChatSpamSpeed - deltaTime); <<<<<<< AddChatMessage(message); ======= //SPAM FILTER if (sender.ChatSpamTimer > 0.0f) { //player has already been spamming, stop again ChatMessage denyMsg = ChatMessage.Create("", "You have been blocked by the spam filter. Try again after 10 seconds.", ChatMessageType.Server, null); sender.ChatSpamTimer = 10.0f; SendChatMessage(denyMsg, sender); return; } float similarity = 0; similarity += sender.ChatSpamSpeed * 0.05f; //the faster messages are being sent, the faster the filter will block for (int i = 0; i < sender.ChatMessages.Count; i++) { float closeFactor = 1.0f / (20.0f - i); int levenshteinDist = ToolBox.LevenshteinDistance(message.Text, sender.ChatMessages[i]); similarity += Math.Max((message.Text.Length - levenshteinDist) / message.Text.Length * closeFactor, 0.0f); } if (similarity > 5.0f) { sender.ChatSpamCount++; if (sender.ChatSpamCount > 3) { //kick for spamming too much KickClient(sender, false); } else { ChatMessage denyMsg = ChatMessage.Create("", "You have been blocked by the spam filter. Try again after 10 seconds.", ChatMessageType.Server, null); sender.ChatSpamTimer = 10.0f; SendChatMessage(denyMsg, sender); } return; } sender.ChatMessages.Add(message.Text); if (sender.ChatMessages.Count > 20) { sender.ChatMessages.RemoveAt(0); } if (sender.inGame || (Screen.Selected == GameMain.NetLobbyScreen)) { AddChatMessage(message); } else { GameServer.Log(message.TextWithSender, message.Color); } sender.ChatSpamSpeed += 5.0f; foreach (Client c in recipients) { ReliableMessage msg = c.ReliableChannel.CreateMessage(); msg.InnerMessage.Write((byte)PacketTypes.Chatmessage); message.WriteNetworkMessage(msg.InnerMessage); c.ReliableChannel.SendMessage(msg, c.Connection); } >>>>>>> //SPAM FILTER if (sender.ChatSpamTimer > 0.0f) { //player has already been spamming, stop again ChatMessage denyMsg = ChatMessage.Create("", "You have been blocked by the spam filter. Try again after 10 seconds.", ChatMessageType.Server, null); sender.ChatSpamTimer = 10.0f; SendChatMessage(denyMsg, sender); return; } float similarity = 0; similarity += sender.ChatSpamSpeed * 0.05f; //the faster messages are being sent, the faster the filter will block for (int i = 0; i < sender.ChatMessages.Count; i++) { float closeFactor = 1.0f / (20.0f - i); int levenshteinDist = ToolBox.LevenshteinDistance(message.Text, sender.ChatMessages[i]); similarity += Math.Max((message.Text.Length - levenshteinDist) / message.Text.Length * closeFactor, 0.0f); } if (similarity > 5.0f) { sender.ChatSpamCount++; if (sender.ChatSpamCount > 3) { //kick for spamming too much KickClient(sender, false); } else { ChatMessage denyMsg = ChatMessage.Create("", "You have been blocked by the spam filter. Try again after 10 seconds.", ChatMessageType.Server, null); sender.ChatSpamTimer = 10.0f; SendChatMessage(denyMsg, sender); } return; } sender.ChatMessages.Add(message.Text); if (sender.ChatMessages.Count > 20) { sender.ChatMessages.RemoveAt(0); } if (sender.inGame || (Screen.Selected == GameMain.NetLobbyScreen)) { AddChatMessage(message); } else { GameServer.Log(message.TextWithSender, message.Color); } sender.ChatSpamSpeed += 5.0f; foreach (Client c in recipients) { ReliableMessage msg = c.ReliableChannel.CreateMessage(); msg.InnerMessage.Write((byte)PacketTypes.Chatmessage); message.WriteNetworkMessage(msg.InnerMessage); c.ReliableChannel.SendMessage(msg, c.Connection); } <<<<<<< ======= ReliableMessage msg = recipient.ReliableChannel.CreateMessage(); msg.InnerMessage.Write((byte)PacketTypes.Chatmessage); chatMessage.WriteNetworkMessage(msg.InnerMessage); recipient.ReliableChannel.SendMessage(msg, recipient.Connection); } public void SendChatMessage(ChatMessage chatMessage, List<Client> recipients) { foreach (Client recipient in recipients) { SendChatMessage(chatMessage, recipient); } >>>>>>> ReliableMessage msg = recipient.ReliableChannel.CreateMessage(); msg.InnerMessage.Write((byte)PacketTypes.Chatmessage); chatMessage.WriteNetworkMessage(msg.InnerMessage); recipient.ReliableChannel.SendMessage(msg, recipient.Connection); } public void SendChatMessage(ChatMessage chatMessage, List<Client> recipients) { <<<<<<< ======= Item.Spawner.FillNetworkData(msg, c.SpawnItems); } >>>>>>> Item.Spawner.FillNetworkData(msg, c.SpawnItems); }
<<<<<<< ======= if (!loading) Item.NewComponentEvent(this, true, true); UpdateSections(); >>>>>>> UpdateSections(); <<<<<<< ======= UpdateSections(); item.NewComponentEvent(this, true, true); >>>>>>> UpdateSections();
<<<<<<< //no need to write steering info if autopilot is controlling msg.Write(targetVelocity.X); msg.Write(targetVelocity.Y); } else { msg.Write(posToMaintain != null); ======= message.Write(posToMaintain != null); if (posToMaintain != null) { message.Write(((Vector2)posToMaintain).X); message.Write(((Vector2)posToMaintain).Y); } else { message.Write(levelStartTickBox.Selected); } >>>>>>> //no need to write steering info if autopilot is controlling msg.Write(targetVelocity.X); msg.Write(targetVelocity.Y); } else { msg.Write(posToMaintain != null); message.Write(posToMaintain != null); if (posToMaintain != null) { message.Write(((Vector2)posToMaintain).X); message.Write(((Vector2)posToMaintain).Y); } else { message.Write(levelStartTickBox.Selected); } <<<<<<< if (!AutoPilot) ======= bool headingToStart = false; try >>>>>>> if (!AutoPilot) <<<<<<< posToMaintain = item.Submarine.WorldPosition; maintainPosTickBox.Selected = true; } else { posToMaintain = null; maintainPosTickBox.Selected = false; ======= bool maintainPos = message.ReadBoolean(); if (maintainPos) { newPosToMaintain = new Vector2( message.ReadFloat(), message.ReadFloat()); } else { headingToStart = message.ReadBoolean(); } >>>>>>> posToMaintain = item.Submarine.WorldPosition; maintainPosTickBox.Selected = true; } else { posToMaintain = null; maintainPosTickBox.Selected = false; bool maintainPos = message.ReadBoolean(); if (maintainPos) { newPosToMaintain = new Vector2( message.ReadFloat(), message.ReadFloat()); } else { headingToStart = message.ReadBoolean(); } <<<<<<< if (!AutoPilot) { targetVelocity = new Vector2(msg.ReadFloat(), msg.ReadFloat()); } else { bool maintainPos = msg.ReadBoolean(); if (maintainPos) { posToMaintain = new Vector2(msg.ReadSingle(), msg.ReadSingle()); maintainPosTickBox.Selected = true; } else { posToMaintain = null; maintainPosTickBox.Selected = false; } } ======= maintainPosTickBox.Selected = newPosToMaintain != null; posToMaintain = newPosToMaintain; if (posToMaintain == null && autoPilot) { levelStartTickBox.Selected = headingToStart; levelEndTickBox.Selected = !headingToStart; UpdatePath(); } else { levelStartTickBox.Selected = false; levelEndTickBox.Selected = false; } >>>>>>> if (!AutoPilot) { targetVelocity = new Vector2(msg.ReadFloat(), msg.ReadFloat()); } else { bool maintainPos = msg.ReadBoolean(); if (maintainPos) { posToMaintain = new Vector2(msg.ReadSingle(), msg.ReadSingle()); maintainPosTickBox.Selected = true; } else { posToMaintain = null; maintainPosTickBox.Selected = false; } } maintainPosTickBox.Selected = newPosToMaintain != null; posToMaintain = newPosToMaintain; if (posToMaintain == null && autoPilot) { levelStartTickBox.Selected = headingToStart; levelEndTickBox.Selected = !headingToStart; UpdatePath(); } else { levelStartTickBox.Selected = false; levelEndTickBox.Selected = false; }
<<<<<<< ======= string selectedPassword = ""; if (hasPassword) { var msgBox = new GUIMessageBox(msg, "", new string[] { "OK", "Cancel" }); var passwordBox = new GUITextBox(new Rectangle(0,40,150,25), Alignment.TopLeft, "", msgBox.children[0]); passwordBox.UserData = "password"; var okButton = msgBox.Buttons[0]; var cancelButton = msgBox.Buttons[1]; while (GUIMessageBox.MessageBoxes.Contains(msgBox)) { okButton.Enabled = !string.IsNullOrWhiteSpace(passwordBox.Text); if (okButton.Selected) { msgBox.Close(null,null); break; } else if (cancelButton.Selected) { msgBox.Close(null, null); yield return CoroutineStatus.Success; } yield return CoroutineStatus.Running; } selectedPassword = passwordBox.Text; } >>>>>>>
<<<<<<< DebugConsole.ThrowError("Failed to start a new round", e); //try again in >5 seconds if (autoRestart) AutoRestartTimer = Math.Max(AutoRestartInterval, 5.0f); GameMain.NetLobbyScreen.StartButton.Enabled = true; GameMain.NetLobbyScreen.LastUpdateID++; couldNotStart = true; ======= teamCount = 2; >>>>>>> teamCount = 2; <<<<<<< Entity.Spawner.AddToSpawnedList(c); Entity.Spawner.AddToSpawnedList(c.SpawnItems); ======= if (sub == null) continue; WayPoint cargoSpawnPos = WayPoint.GetRandom(SpawnType.Cargo, null, sub); if (cargoSpawnPos == null || cargoSpawnPos.CurrentHull == null) { DebugConsole.ThrowError("Couldn't spawn additional cargo (no cargo spawnpoint inside any of the hulls)"); continue; } var cargoRoom = cargoSpawnPos.CurrentHull; Vector2 position = new Vector2( cargoSpawnPos.Position.X + Rand.Range(-20.0f, 20.0f), cargoRoom.Rect.Y - cargoRoom.Rect.Height); foreach (string s in extraCargo.Keys) { ItemPrefab itemPrefab = ItemPrefab.list.Find(ip => ip.Name == s) as ItemPrefab; if (itemPrefab == null) continue; for (int i = 0; i < extraCargo[s]; i++) { Item.Spawner.QueueItem(itemPrefab, position + (Vector2.UnitX * itemPrefab.Size.Y/2), sub, false); } } >>>>>>> Entity.Spawner.AddToSpawnedList(c); Entity.Spawner.AddToSpawnedList(c.SpawnItems); <<<<<<< yield return CoroutineStatus.Running; ======= >>>>>>> yield return CoroutineStatus.Running; <<<<<<< AddChatMessage("Press TAB to chat. Use ''r;'' to talk through the radio.", ChatMessageType.Server); GameMain.NetLobbyScreen.StartButton.Enabled = true; gameStarted = true; ======= GameMain.NetLobbyScreen.StartButton.Enabled = true; gameStarted = true; initiatedStartGame = false; >>>>>>> AddChatMessage("Press TAB to chat. Use ''r;'' to talk through the radio.", ChatMessageType.Server); GameMain.NetLobbyScreen.StartButton.Enabled = true; gameStarted = true; initiatedStartGame = false; <<<<<<< private void UpdateCharacterInfo(NetIncomingMessage message, Client sender) ======= private void ReadChatMessage(NetIncomingMessage inc) { Client sender = connectedClients.Find(x => x.Connection == inc.SenderConnection); ChatMessage message = ChatMessage.ReadNetworkMessage(inc); if (message == null) return; List<Client> recipients = new List<Client>(); foreach (Client c in connectedClients) { if (!sender.inGame && c.inGame) continue; //people in lobby can't talk to people ingame switch (message.Type) { case ChatMessageType.Dead: if (c.Character != null && !c.Character.IsDead) continue; break; case ChatMessageType.Default: if (message.Sender != null && c.Character != null && message.Sender != c.Character) { if (Vector2.Distance(message.Sender.WorldPosition, c.Character.WorldPosition) > ChatMessage.SpeakRange) continue; } break; case ChatMessageType.Radio: if (message.Sender == null) return; if (!CanUseRadio(sender.Character)) message.Type = ChatMessageType.Default; break; } recipients.Add(c); } //SPAM FILTER if (sender.ChatSpamTimer > 0.0f) { //player has already been spamming, stop again ChatMessage denyMsg = ChatMessage.Create("", "You have been blocked by the spam filter. Try again after 10 seconds.", ChatMessageType.Server, null); sender.ChatSpamTimer = 10.0f; SendChatMessage(denyMsg, sender); return; } float similarity = 0; similarity += sender.ChatSpamSpeed * 0.05f; //the faster messages are being sent, the faster the filter will block for (int i = 0; i < sender.ChatMessages.Count; i++) { float closeFactor = 1.0f / (20.0f - i); int levenshteinDist = ToolBox.LevenshteinDistance(message.Text, sender.ChatMessages[i]); similarity += Math.Max((message.Text.Length - levenshteinDist) / message.Text.Length * closeFactor, 0.0f); } if (similarity > 5.0f) { sender.ChatSpamCount++; if (sender.ChatSpamCount > 3) { //kick for spamming too much KickClient(sender, false); } else { ChatMessage denyMsg = ChatMessage.Create("", "You have been blocked by the spam filter. Try again after 10 seconds.", ChatMessageType.Server, null); sender.ChatSpamTimer = 10.0f; SendChatMessage(denyMsg, sender); } return; } sender.ChatMessages.Add(message.Text); if (sender.ChatMessages.Count > 20) { sender.ChatMessages.RemoveAt(0); } if (sender.inGame || (Screen.Selected == GameMain.NetLobbyScreen)) { AddChatMessage(message); } else { GameServer.Log(message.TextWithSender, message.Color); } sender.ChatSpamSpeed += 5.0f; foreach (Client c in recipients) { ReliableMessage msg = c.ReliableChannel.CreateMessage(); msg.InnerMessage.Write((byte)PacketTypes.Chatmessage); message.WriteNetworkMessage(msg.InnerMessage); c.ReliableChannel.SendMessage(msg, c.Connection); } } public override void SendChatMessage(string message, ChatMessageType? type = null) >>>>>>> private void UpdateCharacterInfo(NetIncomingMessage message, Client sender)
<<<<<<< Vector2 namePos = new Vector2(pos.X, pos.Y - 110.0f - (5.0f / cam.Zoom)) - GUI.Font.MeasureString(Info.Name) * 0.5f / cam.Zoom; Vector2 screenSize = new Vector2(GameMain.GraphicsWidth, GameMain.GraphicsHeight); Vector2 viewportSize = new Vector2(cam.WorldView.Width, cam.WorldView.Height); namePos.X -= cam.WorldView.X; namePos.Y += cam.WorldView.Y; namePos *= screenSize / viewportSize; namePos.X = (float)Math.Floor(namePos.X); namePos.Y = (float)Math.Floor(namePos.Y); namePos *= viewportSize / screenSize; namePos.X += cam.WorldView.X; namePos.Y -= cam.WorldView.Y; ======= string name = Info.DisplayName; if (controlled == null && name != Info.Name) name += " (Disguised)"; Vector2 namePos = new Vector2(pos.X, pos.Y - 110.0f - (5.0f / cam.Zoom)) - GUI.Font.MeasureString(name) * 0.5f / cam.Zoom; >>>>>>> string name = Info.DisplayName; if (controlled == null && name != Info.Name) name += " (Disguised)"; Vector2 namePos = new Vector2(pos.X, pos.Y - 110.0f - (5.0f / cam.Zoom)) - GUI.Font.MeasureString(Info.Name) * 0.5f / cam.Zoom; Vector2 screenSize = new Vector2(GameMain.GraphicsWidth, GameMain.GraphicsHeight); Vector2 viewportSize = new Vector2(cam.WorldView.Width, cam.WorldView.Height); namePos.X -= cam.WorldView.X; namePos.Y += cam.WorldView.Y; namePos *= screenSize / viewportSize; namePos.X = (float)Math.Floor(namePos.X); namePos.Y = (float)Math.Floor(namePos.Y); namePos *= viewportSize / screenSize; namePos.X += cam.WorldView.X; namePos.Y -= cam.WorldView.Y;