8000 [StyleCleanUp] Address IDE warnings Part 1 by harshit7962 · Pull Request #10154 · dotnet/wpf · GitHub
[go: up one dir, main page]

Skip to content

[StyleCleanUp] Address IDE warnings Part 1 #10154

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
3 changes: 0 additions & 3 deletions src/Microsoft.DotNet.Wpf/src/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,6 @@ dotnet_diagnostic.CSIsNull002.severity = suggestion
# IDE0005: Using directive is unnecessary.
dotnet_diagnostic.IDE0005.severity = suggestion

# IDE0017: Simplify object initialization
dotnet_diagnostic.IDE0017.severity = suggestion

# IDE0019: Use pattern matching to avoid as followed by a null check
dotnet_diagnostic.IDE0019.severity = suggestion

Expand Down
1,574 changes: 787 additions & 787 deletions src/Microsoft.DotNet.Wpf/src/Common/Graphics/Generated/wgx_commands.cs

Large diffs are not rendered by default.

92 changes: 46 additions & 46 deletions src/Microsoft.DotNet.Wpf/src/Common/Graphics/exports.cs
10000
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
// Licensed to the .NET Foundation under one or more agreements.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

//
// Description:
// Managed exports from MIL core.

using System.Windows.Media.Imaging;
using System.Runtime.InteropServices;
using System.Windows.Media.Imaging;
using MS.Internal;
using MS.Internal.Interop;
using MS.Utility;
using MS.Win32;

using UnsafeNativeMethods = MS.Win32.PresentationCore.UnsafeNativeMethods;
using HRESULT = MS.Internal.HRESULT;
using UnsafeNativeMethods = MS.Win32.PresentationCore.UnsafeNativeMethods;

/*
*
Expand Down Expand Up @@ -150,41 +149,41 @@ internal static extern int WgxConnection_SameThreadPresent(
[DllImport(DllImport.MilCore, EntryPoint = "MilChannel_GetMarshalType")]
internal static extern int MilChannel_GetMarshalType(IntPtr channelHandle, out ChannelMarshalType marshalType);

[DllImport (DllImport.MilCore, EntryPoint = "MilResource_SendCommand")]//CASRemoval:
[DllImport(DllImport.MilCore, EntryPoint = "MilResource_SendCommand")]//CASRemoval:
unsafe internal static extern int MilResource_SendCommand(
byte *pbData,
byte* pbData,
uint cbSize,
bool sendInSeparateBatch,
IntPtr pChannel);

[DllImport (DllImport.MilCore, EntryPoint = "MilChannel_BeginCommand")]//CASRemoval:
[DllImport(DllImport.MilCore, EntryPoint = "MilChannel_BeginCommand")]//CASRemoval:
unsafe internal static extern int MilChannel_BeginCommand(
IntPtr pChannel,
byte *pbData,
byte* pbData,
uint cbSize,
uint cbExtra
);

[DllImport (DllImport.MilCore, EntryPoint = "MilChannel_AppendCommandData")]//CASRemoval:
[DllImport(DllImport.MilCore, EntryPoint = "MilChannel_AppendCommandData")]//CASRemoval:
unsafe internal static extern int MilChannel_AppendCommandData(
IntPtr pChannel,
byte *pbData,
byte* pbData,
uint cbSize
);

[DllImport (DllImport.MilCore, EntryPoint = "MilChannel_EndCommand")]//CASRemoval:
[DllImport(DllImport.MilCore, EntryPoint = "MilChannel_EndCommand")]//CASRemoval:
unsafe internal static extern int MilChannel_EndCommand(
IntPtr pChannel);

[DllImport (DllImport.MilCore, EntryPoint = "MilResource_SendCommandMedia")]//CASRemoval:
[DllImport(DllImport.MilCore, EntryPoint = "MilResource_SendCommandMedia")]//CASRemoval:
unsafe internal static extern int MilResource_SendCommandMedia(
ResourceHandle handle,
SafeMediaHandle pMedia,
IntPtr pChannel,
bool notifyUceDirect
bool notifyUceDirect
);

[DllImport (DllImport.MilCore, EntryPoint = "MilResource_SendCommandBitmapSource")]//CASRemoval:
[DllImport(DllImport.MilCore, EntryPoint = "MilResource_SendCommandBitmapSource")]//CASRemoval:
unsafe internal static extern int MilResource_SendCommandBitmapSource(
ResourceHandle handle,
BitmapSourceSafeMILHandle /* IWICBitmapSource */ pBitmapSource,
Expand Down Expand Up @@ -242,16 +241,16 @@ internal static class MilMessage
/// </summary>
internal enum Type
{
Invalid = 0x00,
Invalid = 0x00,

SyncFlushReply = 0x01,
Caps = 0x04,
PartitionIsZombie = 0x06,
SyncModeStatus = 0x09,
Presented = 0x0A,
BadPixelShader = 0x10,
SyncFlushReply = 0x01,
Caps = 0x04,
PartitionIsZombie = 0x06,
SyncModeStatus = 0x09,
Presented = 0x0A,
BadPixelShader = 0x10,

ForceDWORD = unchecked((int)0xffffffff)
ForceDWORD = unchecked((int)0xffffffff)
};

[StructLayout(LayoutKind.Explicit, Pack = 1)]
Expand Down Expand Up @@ -354,7 +353,7 @@ public Channel(Channel referenceChannel, bool isOutOfBandChannel, IntPtr pConnec
_pConnection,
referenceChannelHandle,
out _hChannel));
}
}


/// <summary>
Expand Down Expand Up @@ -418,7 +417,7 @@ internal void SyncFlush()
}

HRESULT.Check(MilCoreApi.MilComposition_SyncFlush(_hChannel));
}
}

/// <summary>
/// Commits the channel and then closes it.
Expand Down Expand Up @@ -471,7 +470,7 @@ ref handle

if (EventTrace.IsEnabled(EventTrace.Keyword.KeywordGraphics | EventTrace.Keyword.KeywordPerf, EventTrace.Level.PERF_LOW))
{
EventTrace.EventProvider.TraceEvent(EventTrace.Event.CreateOrAddResourceOnChannel, EventTrace.Keyword.KeywordGraphics | EventTrace.Keyword.KeywordPerf, EventTrace.Level.PERF_LOW, PerfService.GetPerfElementID(instance), _hChannel, (uint) handle, (uint) resourceType);
EventTrace.EventProvider.TraceEvent(EventTrace.Event.CreateOrAddResourceOnChannel, EventTrace.Keyword.KeywordGraphics | EventTrace.Keyword.KeywordPerf, EventTrace.Level.PERF_LOW, PerfService.GetPerfElementID(instance), _hChannel, (uint)handle, (uint)resourceType);
}

return handleNeedsCreation;
Expand Down Expand Up @@ -535,7 +534,7 @@ out releasedOnChannel

if ((releasedOnChannel != 0) && EventTrace.IsEnabled(EventTrace.Keyword.KeywordGraphics | EventTrace.Keyword.KeywordPerf, EventTrace.Level.PERF_LOW))
{
EventTrace.EventProvider.TraceEvent(EventTrace.Event.ReleaseOnChannel, EventTrace.Keyword.KeywordGraphics | EventTrace.Keyword.KeywordPerf, EventTrace.Level.PERF_LOW, _hChannel, (uint) handle);
EventTrace.EventProvider.TraceEvent(EventTrace.Event.ReleaseOnChannel, EventTrace.Keyword.KeywordGraphics | EventTrace.Keyword.KeywordPerf, EventTrace.Level.PERF_LOW, _hChannel, (uint)handle);
}

return (releasedOnChannel != 0);
Expand Down Expand Up @@ -621,7 +620,7 @@ internal bool IsOutOfBandChannel
/// SendCommand sends a command struct through the composition thread.
/// </summary>
unsafe internal void SendCommand(
byte *pCommandData,
byte* pCommandData,
int cSize)
{
SendCommand(pCommandData, cSize, false);
Expand All @@ -634,7 +633,7 @@ unsafe internal void SendCommand(
/// which is then immediately closed, leaving the current batch untouched.
/// </summary>
unsafe internal void SendCommand(
byte *pCommandData,
byte* pCommandData,
int cSize,
bool sendInSeparateBatch)
{
Expand Down Expand Up @@ -670,7 +669,7 @@ unsafe internal void SendCommand(
/// BeginCommand opens a command on a channel
/// </summary>
unsafe internal void BeginCommand(
byte *pbCommandData,
byte* pbCommandData,
int cbSize,
int cbExtra)
{
Expand Down Expand Up @@ -707,7 +706,7 @@ unsafe internal void BeginCommand(
/// AppendCommandData appends data to an open command on a channel
/// </summary>
unsafe internal void AppendCommandData(
byte *pbCommandData,
byte* pbCommandData,
int cbSize)
{
checked
Expand Down Expand Up @@ -1125,7 +1124,7 @@ public bool Remove(object key)
if (_others != null)
{
Debug.Assert(_others.Count > 0);
int j = _others.Count-1;
int j = _others.Count - 1;
_first = _others[j];
if (j == 0) // Only one entry in the array.
{
Expand All @@ -1138,8 +1137,8 @@ public bool Remove(object key)
}
else
{
_first = new Entry();
}
_first = new Entry();
}

return true;
}
Expand Down Expand Up @@ -1228,7 +1227,7 @@ public object Get(int index)

return _others[index - 1]._key;
}
}
}

/// <summary>
/// This is a generic map that maps a key to a value. It is heavily optimized
Expand Down Expand Up @@ -1332,17 +1331,18 @@ public void Set(object key, DUCE.ResourceHandle value)
if (!_head._value.IsNull)
{
// There's 1 entry - allocate a list...
List<Entry> others = new List<Entry>(2); // by default we have two entries in the extra storage.

// ...move the old single entry into the List...
others.Add(_head);
// ...add the new entry...
others.Add(new Entry(key, value));
List<Entry> others =
[
// ...move the old single entry into the List...
_head,
// ...add the new entry...
new Entry(key, value),
]; // by default we have two entries in the extra storage.

// ... and replace the single entry
_head._key = others;
_head._value = DUCE.ResourceHandle.Null;
}
}
else
{
// There's already a List - simply add the new entry to the list.
Expand Down Expand Up @@ -1467,7 +1467,7 @@ public object Get(int index)

return ((List<Entry>)_head._key)[index]._key;
}
}
}

/// <summary>
/// ShareableDUCEMultiChannelResource class - this class simply wraps a MultiChannelResource,
Expand Down Expand Up @@ -1798,7 +1798,7 @@ internal static void SetScrollableAreaClip(

command.Type = MILCMD.MilCmdVisualSetScrollableAreaClip;
command.Handle = hCompositionNode;
command.IsEnabled = (uint) (clip.HasValue ? 1 : 0);
command.IsEnabled = (uint)(clip.HasValue ? 1 : 0);

if (clip.HasValue)
{
Expand Down Expand Up @@ -1856,7 +1856,7 @@ internal static void SetRenderOptions(
sizeof(DUCE.MILCMD_VISUAL_SETRENDEROPTIONS)
);
}
}
}

internal static void RemoveChild(
DUCE.ResourceHandle hCompositionNode,
Expand Down Expand Up @@ -2231,7 +2231,7 @@ Channel channel

if (!enableMultiMonitorDisplayClipping.Value)
{
command.flags |= (UInt32) MILRTInitializationFlags.MIL_RT_DISABLE_MULTIMON_DISPLAY_CLIPPING;
command.flags |= (UInt32)MILRTInitializationFlags.MIL_RT_DISABLE_MULTIMON_DISPLAY_CLIPPING;
}
}

Expand Down Expand Up @@ -2400,7 +2400,7 @@ Channel channel
command.Handle = hCompositionTarget;

command.renderingEnabled = (uint)(renderingEnabled ? 1 : 0);
command.disableCookie = (uint) disableCookie;
command.disableCookie = (uint)disableCookie;

command.windowRect = windowRect;

Expand Down
33 changes: 17 additions & 16 deletions src/Microsoft.DotNet.Wpf/src/Common/Graphics/wgx_av_types.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Licensed to the .NET Foundation under one or more agreements.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

Expand All @@ -7,20 +7,21 @@ namespace System.Windows.Media
//
// AV Events
//
internal enum AVEvent {
AVMediaNone = 0,
AVMediaOpened = 1,
AVMediaClosed = 2,
AVMediaStarted = 3,
AVMediaStopped = 4,
AVMediaPaused = 5,
AVMediaRateChanged = 6,
AVMediaEnded = 7,
AVMediaFailed = 8,
AVMediaBufferingStarted = 9,
AVMediaBufferingEnded = 10,
AVMediaPrerolled = 11,
AVMediaScriptCommand = 12,
AVMediaNewFrame = 13,
internal enum AVEvent
{
AVMediaNone = 0,
AVMediaOpened = 1,
AVMediaClosed = 2,
AVMediaStarted = 3,
AVMediaStopped = 4,
AVMediaPaused = 5,
AVMediaRateChanged = 6,
AVMediaEnded = 7,
AVMediaFailed = 8,
AVMediaBufferingStarted = 9,
AVMediaBufferingEnded = 10,
AVMediaPrerolled = 11,
AVMediaScriptCommand = 12,
AVMediaNewFrame = 13,
};
}
Loading
Loading
0