Commit c9e8004b authored by HankG's avatar HankG

Code cleanup to get rid of compile time warnings

parent fd337a3d
Pipeline #102003074 failed with stage
in 60 minutes and 1 second
using System;
using System.Diagnostics.CodeAnalysis;
using Avalonia;
using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Markup.Xaml;
......@@ -7,6 +8,7 @@ using MySocialPortalDesktop.Views;
namespace MySocialPortalDesktop
{
[SuppressMessage("ReSharper", "CA1303")]
public class App : Application
{
public override void Initialize()
......
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using Avalonia.Media.Imaging;
using MySocialPortalDesktop.Factory;
......@@ -9,15 +10,15 @@ using MySocialPortalLib.Service;
namespace MySocialPortalDesktop.Services
{
[SuppressMessage("ReSharper", "CA1031")]
public static class DefaultValueService
{
private const string DefaultProfileImageName = "default_profile_icon.png";
public const string FavoriteListName = "Favorites";
private static readonly Lazy<Bitmap> DefaultProfileImageLazy = new Lazy<Bitmap>(BuildDefaultProfileImage);
public static Bitmap DefaultProfileImage => DefaultProfileImageLazy.Value;
public static string FavoriteListName = "Favorites";
private static Bitmap BuildDefaultProfileImage()
{
......
using System;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
using System.Threading;
......@@ -12,6 +13,7 @@ using MySocialPortalLib.Service;
namespace MySocialPortalDesktop.Util
{
[SuppressMessage("ReSharper", "CA1031")]
public static class PersonDataGenerator
{
public static async Task<string> GetDefaultUserName(Person person)
......
......@@ -12,7 +12,6 @@ namespace MySocialPortalDesktop.ViewModels
{
private const int DefaultMaxHeight = 150;
private const int DefaultMaxWidth = 250;
private const int MaxDescriptionLenth = 240;
private bool _disposed = false;
......
......@@ -22,6 +22,8 @@ using ReactiveUI;
namespace MySocialPortalDesktop.ViewModels
{
[SuppressMessage("ReSharper", "CA1822")]
[SuppressMessage("ReSharper", "CA1303")]
[SuppressMessage("ReSharper", "CA1031")]
public class MainWindowViewModel : ViewModelBase
{
private const int DefaultMaxPosts = 50;
......
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using DynamicData;
using MySocialPortalDesktop.Factory;
......@@ -10,6 +11,8 @@ using MySocialPortalLib.Util;
namespace MySocialPortalDesktop.ViewModels
{
[SuppressMessage("ReSharper", "CA1303")]
[SuppressMessage("ReSharper", "CA1031")]
public class PostTimelineViewModel : ViewModelBase
{
private const int MaxPostsQuery = 20;
......
......@@ -5,6 +5,7 @@ using MySocialPortalLib.Model;
using MySocialPortalLib.Service;
using ReactiveUI;
using System.Collections.ObjectModel;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
using LinqToTwitter.Net;
......@@ -13,6 +14,7 @@ using MySocialPortalDesktop.Util;
namespace MySocialPortalDesktop.ViewModels
{
[SuppressMessage("ReSharper", "CA1031")]
public class PostViewModel : ViewModelBase
{
private string _body;
......@@ -60,6 +62,10 @@ namespace MySocialPortalDesktop.ViewModels
public PostViewModel(Post post)
{
if (post == null)
{
throw new ArgumentNullException(nameof(post));
}
Links = new ObservableCollection<ExternalLinkViewModel>();
Post = post;
Title = "Unknown Author";
......
......@@ -34,7 +34,7 @@ namespace MySocialPortalDesktop.Views
RepositoryFactory.Instance.Dispose();
}
private async void RefreshSelectedUserList(object sender, SelectionChangedEventArgs args)
private void RefreshSelectedUserList(object sender, SelectionChangedEventArgs args)
{
if (args.AddedItems.Count == 0)
{
......
namespace MySocialPortalLib
{
public class PollOption
{
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment