diff --git a/Trunk/Components/CzokoŚmieciarka.AI_Naive/CzokoŚmieciarka.AI_Naive.csproj b/Trunk/Components/CzokoŚmieciarka.AI_Naive/CzokoŚmieciarka.AI_Naive.csproj new file mode 100644 index 0000000..756d35c --- /dev/null +++ b/Trunk/Components/CzokoŚmieciarka.AI_Naive/CzokoŚmieciarka.AI_Naive.csproj @@ -0,0 +1,54 @@ + + + + + Debug + AnyCPU + {10E77BBE-55E1-483D-A456-0E94EAC9B24A} + Library + Properties + CzokoŚmieciarka.AI_Naive + CzokoŚmieciarka.AI_Naive + v4.6.1 + 512 + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + {f2e11fee-c5ac-47d2-ba9c-819909b6dff7} + CzokoŚmieciarka.DataModels + + + + \ No newline at end of file diff --git a/Trunk/Components/CzokoŚmieciarka.AI_Naive/Properties/AssemblyInfo.cs b/Trunk/Components/CzokoŚmieciarka.AI_Naive/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..ab913b4 --- /dev/null +++ b/Trunk/Components/CzokoŚmieciarka.AI_Naive/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("CzokoŚmieciarka.AI_Naive")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("CzokoŚmieciarka.AI_Naive")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("10e77bbe-55e1-483d-a456-0e94eac9b24a")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Trunk/Czoko_Smieciarka.AI_Naive/RoutePlanningEngine.cs b/Trunk/Components/CzokoŚmieciarka.AI_Naive/RoutePlanningEngine.cs similarity index 94% rename from Trunk/Czoko_Smieciarka.AI_Naive/RoutePlanningEngine.cs rename to Trunk/Components/CzokoŚmieciarka.AI_Naive/RoutePlanningEngine.cs index 36f7d16..b0fb894 100644 --- a/Trunk/Czoko_Smieciarka.AI_Naive/RoutePlanningEngine.cs +++ b/Trunk/Components/CzokoŚmieciarka.AI_Naive/RoutePlanningEngine.cs @@ -1,117 +1,120 @@ -using CzokoŚmieciarka.DataModels.Enums; -using CzokoŚmieciarka.DataModels.Interfaces; -using CzokoŚmieciarka.DataModels.Interfaces.RoutePlanningEngine; -using CzokoŚmieciarka.DataModels.Interfaces.TrashCans; -using CzokoŚmieciarka.DataModels.Models; -using CzokoŚmieciarka.DataModels.Models.Steps; -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Czoko_Smieciarka.AI_Naive -{ - public class RoutePlanningEngine : IRoutePlanningEngine - { - public IGarbageCollector Collector { get; } - public IEnumerable Cans { get; } - public IEnumerable Dumps { get; } - - enum State { TravelToDump, TravelToCan, Wait, Finish } - public Coords Destination { get; set; } - public object DestinationObject { get; set; } - private State CurrentState { get; set; } - - public IEnumerable CalculateStep() - { - return PerformMove(); - } - - public RoutePlanningEngine(IGarbageCollector collector, IEnumerable cans, IEnumerable dumps) - { - this.Collector = collector.Clone() as IGarbageCollector; - this.Cans = cans; - this.Dumps = dumps; - this.CurrentState = State.Wait; - } - - - private IEnumerable PerformMove() - { - - switch (CurrentState) - { - case State.TravelToDump: - if (Destination == Collector.Position) - { - var dump = (DestinationObject as ADump); - var step = new SpillStep(Collector, dump, dump.TypeOfGarbage); - step.Invoke(); - yield return step; - this.CurrentState = State.Wait; - } else - { - var dif = Destination - Collector.Position; - Direction nextDirection = (dif.X == 0) ? - ((dif.Y > 0) ? Direction.Up : Direction.Down) : - ((dif.X > 0) ? Direction.Right : Direction.Left); - - var step = new MoveStep(nextDirection, Collector); - step.Invoke(); - yield return step; - } - break; - case State.TravelToCan: - if (Destination == Collector.Position) - { - var garbage = (DestinationObject as IGarbageLocalization); - foreach (var item in garbage.TrashCans) - { - var step = new CollectStep(Collector, garbage, item.TypeOfGarbage); - step.Invoke(); - yield return step; - } - - this.CurrentState = State.Wait; - } - else - { - var dif = Destination - Collector.Position; - Direction nextDirection = (dif.X == 0) ? - ((dif.Y > 0) ? Direction.Up : Direction.Down) : - ((dif.X > 0) ? Direction.Right : Direction.Left); - - var step = new MoveStep(nextDirection, Collector); - step.Invoke(); - yield return step; - } - break; - case State.Wait: - var notEmpty = Collector.TrashContainers.Where(i => i.FillPercent > 0); - if (notEmpty.Any()) - { - var destDump = Dumps.First(i => i.TypeOfGarbage == notEmpty.First().TypeOfGarbage); - this.Destination = destDump.Localization; - this.CurrentState = State.TravelToDump; - } else - { - var notEmptyCans = Cans.Where(i => i.TrashCans.Any(j => j.FillPercent > 0)); - if (notEmptyCans.Any()) - { - this.Destination = notEmptyCans.First().Coords; - this.CurrentState = State.TravelToCan; - } else - { - this.CurrentState = State.Finish; - } - } - break; - case State.Finish: - yield break; - } - foreach (var item in PerformMove()) - { - yield return item; - } - } - } -} +using CzokoŚmieciarka.DataModels.Enums; +using CzokoŚmieciarka.DataModels.Interfaces; +using CzokoŚmieciarka.DataModels.Interfaces.RoutePlanningEngine; +using CzokoŚmieciarka.DataModels.Interfaces.TrashCans; +using CzokoŚmieciarka.DataModels.Models; +using CzokoŚmieciarka.DataModels.Models.Steps; +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Czoko_Smieciarka.AI_Naive +{ + public class RoutePlanningEngine : IRoutePlanningEngine + { + public IGarbageCollector Collector { get; } + public IEnumerable Cans { get; } + public IEnumerable Dumps { get; } + + enum State { TravelToDump, TravelToCan, Wait, Finish } + public Coords Destination { get; set; } + public object DestinationObject { get; set; } + private State CurrentState { get; set; } + + public IEnumerable CalculateStep() + { + return PerformMove(); + } + + public RoutePlanningEngine(IGarbageCollector collector, IEnumerable cans, IEnumerable dumps) + { + this.Collector = collector.Clone() as IGarbageCollector; + this.Cans = cans; + this.Dumps = dumps; + this.CurrentState = State.Wait; + } + + + private IEnumerable PerformMove() + { + + switch (CurrentState) + { + case State.TravelToDump: + if (Destination == Collector.Position) + { + var dump = (DestinationObject as ADump); + var step = new SpillStep(Collector, dump, dump.TypeOfGarbage); + step.Invoke(); + yield return step; + this.CurrentState = State.Wait; + } + else + { + var dif = Destination - Collector.Position; + Direction nextDirection = (dif.X == 0) ? + ((dif.Y > 0) ? Direction.Up : Direction.Down) : + ((dif.X > 0) ? Direction.Right : Direction.Left); + + var step = new MoveStep(nextDirection, Collector); + step.Invoke(); + yield return step; + } + break; + case State.TravelToCan: + if (Destination == Collector.Position) + { + var garbage = (DestinationObject as IGarbageLocalization); + foreach (var item in garbage.TrashCans) + { + var step = new CollectStep(Collector, garbage, item.TypeOfGarbage); + step.Invoke(); + yield return step; + } + + this.CurrentState = State.Wait; + } + else + { + var dif = Destination - Collector.Position; + Direction nextDirection = (dif.X == 0) ? + ((dif.Y > 0) ? Direction.Up : Direction.Down) : + ((dif.X > 0) ? Direction.Right : Direction.Left); + + var step = new MoveStep(nextDirection, Collector); + step.Invoke(); + yield return step; + } + break; + case State.Wait: + var notEmpty = Collector.TrashContainers.Where(i => i.FillPercent > 0); + if (notEmpty.Any()) + { + var destDump = Dumps.First(i => i.TypeOfGarbage == notEmpty.First().TypeOfGarbage); + this.Destination = destDump.Localization; + this.CurrentState = State.TravelToDump; + } + else + { + var notEmptyCans = Cans.Where(i => i.TrashCans.Any(j => j.FillPercent > 0)); + if (notEmptyCans.Any()) + { + this.Destination = notEmptyCans.First().Coords; + this.CurrentState = State.TravelToCan; + } + else + { + this.CurrentState = State.Finish; + } + } + break; + case State.Finish: + yield break; + } + foreach (var item in PerformMove()) + { + yield return item; + } + } + } +} diff --git a/Trunk/Czoko_Smieciarka.AI_Naive/Czoko_Smieciarka.AI_Naive.csproj b/Trunk/Czoko_Smieciarka.AI_Naive/Czoko_Smieciarka.AI_Naive.csproj deleted file mode 100644 index 3d9ad2d..0000000 --- a/Trunk/Czoko_Smieciarka.AI_Naive/Czoko_Smieciarka.AI_Naive.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - netcoreapp2.1 - - - - - - - diff --git a/Trunk/CzokoŚmieciarka.sln b/Trunk/CzokoŚmieciarka.sln index 6ca794f..44717df 100644 --- a/Trunk/CzokoŚmieciarka.sln +++ b/Trunk/CzokoŚmieciarka.sln @@ -7,12 +7,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CzokoŚmieciarka.DataModels EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CzokoŚmieciarka.DataModels.GeneralModels", "Components\CzokoŚmieciarka.DataModels.GeneralModels\CzokoŚmieciarka.DataModels.GeneralModels.csproj", "{A3D5DA96-69D7-463F-B1EE-6FC70716E3B2}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CzokoŚmieciarka.WPF", "Interface\CzokoŚmieciarka.WPF\CzokoŚmieciarka.WPF.csproj", "{06937DFB-242D-46BD-9A4B-486D156B62A9}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Czoko_Smieciarka.AI_Naive", "Czoko_Smieciarka.AI_Naive\Czoko_Smieciarka.AI_Naive.csproj", "{A1F1D99A-4E5B-4389-B776-321D8A5976EE}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CzokoŚmieciarka.WPFv2", "Interface\CzokoŚmieciarka.WPFv2\CzokoŚmieciarka.WPFv2.csproj", "{2BADDDA9-A77C-4FB2-9F28-4DAE712E8947}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CzokoŚmieciarka.AI_Naive", "Components\CzokoŚmieciarka.AI_Naive\CzokoŚmieciarka.AI_Naive.csproj", "{10E77BBE-55E1-483D-A456-0E94EAC9B24A}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -27,18 +25,14 @@ Global {A3D5DA96-69D7-463F-B1EE-6FC70716E3B2}.Debug|Any CPU.Build.0 = Debug|Any CPU {A3D5DA96-69D7-463F-B1EE-6FC70716E3B2}.Release|Any CPU.ActiveCfg = Release|Any CPU {A3D5DA96-69D7-463F-B1EE-6FC70716E3B2}.Release|Any CPU.Build.0 = Release|Any CPU - {06937DFB-242D-46BD-9A4B-486D156B62A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {06937DFB-242D-46BD-9A4B-486D156B62A9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {06937DFB-242D-46BD-9A4B-486D156B62A9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {06937DFB-242D-46BD-9A4B-486D156B62A9}.Release|Any CPU.Build.0 = Release|Any CPU - {A1F1D99A-4E5B-4389-B776-321D8A5976EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A1F1D99A-4E5B-4389-B776-321D8A5976EE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A1F1D99A-4E5B-4389-B776-321D8A5976EE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A1F1D99A-4E5B-4389-B776-321D8A5976EE}.Release|Any CPU.Build.0 = Release|Any CPU {2BADDDA9-A77C-4FB2-9F28-4DAE712E8947}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {2BADDDA9-A77C-4FB2-9F28-4DAE712E8947}.Debug|Any CPU.Build.0 = Debug|Any CPU {2BADDDA9-A77C-4FB2-9F28-4DAE712E8947}.Release|Any CPU.ActiveCfg = Release|Any CPU {2BADDDA9-A77C-4FB2-9F28-4DAE712E8947}.Release|Any CPU.Build.0 = Release|Any CPU + {10E77BBE-55E1-483D-A456-0E94EAC9B24A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {10E77BBE-55E1-483D-A456-0E94EAC9B24A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {10E77BBE-55E1-483D-A456-0E94EAC9B24A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {10E77BBE-55E1-483D-A456-0E94EAC9B24A}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Trunk/Interface/CzokoŚmieciarka.WPF/App.config b/Trunk/Interface/CzokoŚmieciarka.WPF/App.config deleted file mode 100644 index 731f6de..0000000 --- a/Trunk/Interface/CzokoŚmieciarka.WPF/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/Trunk/Interface/CzokoŚmieciarka.WPF/App.xaml b/Trunk/Interface/CzokoŚmieciarka.WPF/App.xaml deleted file mode 100644 index 321ffef..0000000 --- a/Trunk/Interface/CzokoŚmieciarka.WPF/App.xaml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - diff --git a/Trunk/Interface/CzokoŚmieciarka.WPF/App.xaml.cs b/Trunk/Interface/CzokoŚmieciarka.WPF/App.xaml.cs deleted file mode 100644 index 4942873..0000000 --- a/Trunk/Interface/CzokoŚmieciarka.WPF/App.xaml.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Configuration; -using System.Data; -using System.Linq; -using System.Threading.Tasks; -using System.Windows; - -namespace CzokoŚmieciarka.WPF -{ - /// - /// Interaction logic for App.xaml - /// - public partial class App : Application - { - - } -} diff --git a/Trunk/Interface/CzokoŚmieciarka.WPF/CzokoŚmieciarka.WPF.csproj b/Trunk/Interface/CzokoŚmieciarka.WPF/CzokoŚmieciarka.WPF.csproj deleted file mode 100644 index 57bd972..0000000 --- a/Trunk/Interface/CzokoŚmieciarka.WPF/CzokoŚmieciarka.WPF.csproj +++ /dev/null @@ -1,119 +0,0 @@ - - - - - Debug - AnyCPU - {06937DFB-242D-46BD-9A4B-486D156B62A9} - WinExe - CzokoŚmieciarka.WPF - CzokoŚmieciarka.WPF - v4.6.1 - 512 - {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 4 - true - true - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - 4.0 - - - - - - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - App.xaml - Code - - - - MainWindow.xaml - Code - - - - - - - - - - - - - - Code - - - True - True - Resources.resx - - - True - Settings.settings - True - - - ResXFileCodeGenerator - Resources.Designer.cs - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - - - - - - {a3d5da96-69d7-463f-b1ee-6fc70716e3b2} - CzokoŚmieciarka.DataModels.GeneralModels - - - {f2e11fee-c5ac-47d2-ba9c-819909b6dff7} - CzokoŚmieciarka.DataModels - - - - \ No newline at end of file diff --git a/Trunk/Interface/CzokoŚmieciarka.WPF/Images/Dumps/glass.png b/Trunk/Interface/CzokoŚmieciarka.WPF/Images/Dumps/glass.png deleted file mode 100644 index 60a475e..0000000 Binary files a/Trunk/Interface/CzokoŚmieciarka.WPF/Images/Dumps/glass.png and /dev/null differ diff --git a/Trunk/Interface/CzokoŚmieciarka.WPF/Images/Dumps/organic.png b/Trunk/Interface/CzokoŚmieciarka.WPF/Images/Dumps/organic.png deleted file mode 100644 index fec2e9e..0000000 Binary files a/Trunk/Interface/CzokoŚmieciarka.WPF/Images/Dumps/organic.png and /dev/null differ diff --git a/Trunk/Interface/CzokoŚmieciarka.WPF/Images/Dumps/paper.png b/Trunk/Interface/CzokoŚmieciarka.WPF/Images/Dumps/paper.png deleted file mode 100644 index 548493e..0000000 Binary files a/Trunk/Interface/CzokoŚmieciarka.WPF/Images/Dumps/paper.png and /dev/null differ diff --git a/Trunk/Interface/CzokoŚmieciarka.WPF/Images/Dumps/plasticmetal.png b/Trunk/Interface/CzokoŚmieciarka.WPF/Images/Dumps/plasticmetal.png deleted file mode 100644 index cbf47a7..0000000 Binary files a/Trunk/Interface/CzokoŚmieciarka.WPF/Images/Dumps/plasticmetal.png and /dev/null differ diff --git a/Trunk/Interface/CzokoŚmieciarka.WPF/Images/garbageCollector.png b/Trunk/Interface/CzokoŚmieciarka.WPF/Images/garbageCollector.png deleted file mode 100644 index 3283e83..0000000 Binary files a/Trunk/Interface/CzokoŚmieciarka.WPF/Images/garbageCollector.png and /dev/null differ diff --git a/Trunk/Interface/CzokoŚmieciarka.WPF/Images/house.png b/Trunk/Interface/CzokoŚmieciarka.WPF/Images/house.png deleted file mode 100644 index c69da1e..0000000 Binary files a/Trunk/Interface/CzokoŚmieciarka.WPF/Images/house.png and /dev/null differ diff --git a/Trunk/Interface/CzokoŚmieciarka.WPF/Images/intersection.png b/Trunk/Interface/CzokoŚmieciarka.WPF/Images/intersection.png deleted file mode 100644 index c57ed66..0000000 Binary files a/Trunk/Interface/CzokoŚmieciarka.WPF/Images/intersection.png and /dev/null differ diff --git a/Trunk/Interface/CzokoŚmieciarka.WPF/Interfaces/AObject.cs b/Trunk/Interface/CzokoŚmieciarka.WPF/Interfaces/AObject.cs deleted file mode 100644 index ba5e2f2..0000000 --- a/Trunk/Interface/CzokoŚmieciarka.WPF/Interfaces/AObject.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using CzokoŚmieciarka.DataModels.Models; -using CzokoŚmieciarka.WPF.Models; - -namespace CzokoŚmieciarka.WPF.Interfaces -{ - public abstract class AObject : IObject - { - public Coords Location { get; set; } - public string ImagePath { get; set; } - public string Data { get; set; } - public ImageBrush Image { get; set; } - - public void RefreshImage() - { - Image = new ImageBrush(new BitmapImage(new Uri(ImagePath))); - } - } -} diff --git a/Trunk/Interface/CzokoŚmieciarka.WPF/Interfaces/IObject.cs b/Trunk/Interface/CzokoŚmieciarka.WPF/Interfaces/IObject.cs deleted file mode 100644 index 937f198..0000000 --- a/Trunk/Interface/CzokoŚmieciarka.WPF/Interfaces/IObject.cs +++ /dev/null @@ -1,17 +0,0 @@ -using CzokoŚmieciarka.DataModels.Models; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Media; - -namespace CzokoŚmieciarka.WPF.Models -{ - public interface IObject - { - string ImagePath { get; set; } - string Data { get; set; } - ImageBrush Image { get; set; } - } -} diff --git a/Trunk/Interface/CzokoŚmieciarka.WPF/MainWindow.xaml b/Trunk/Interface/CzokoŚmieciarka.WPF/MainWindow.xaml deleted file mode 100644 index afd7bf9..0000000 --- a/Trunk/Interface/CzokoŚmieciarka.WPF/MainWindow.xaml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/Trunk/Interface/CzokoŚmieciarka.WPF/MainWindow.xaml.cs b/Trunk/Interface/CzokoŚmieciarka.WPF/MainWindow.xaml.cs deleted file mode 100644 index 0e867bc..0000000 --- a/Trunk/Interface/CzokoŚmieciarka.WPF/MainWindow.xaml.cs +++ /dev/null @@ -1,107 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Controls.Primitives; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; -using CzokoŚmieciarka.DataModels.Enums; -using CzokoŚmieciarka.DataModels.GeneralModels.Models; -using CzokoŚmieciarka.DataModels.Interfaces; -using CzokoŚmieciarka.DataModels.Interfaces.TrashCans; -using CzokoŚmieciarka.DataModels.Models; -using CzokoŚmieciarka.WPF.Interfaces; -using CzokoŚmieciarka.WPF.Models; - -namespace CzokoŚmieciarka.WPF -{ - /// - /// Interaction logic for MainWindow.xaml - /// - public partial class MainWindow : Window - { - //public Board board; - private static int rows = 9; - private static int columns = 9; - private GarbageCollectorWPF garbageCollector = new GarbageCollectorWPF(columns, new Coords(0, 0), AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\garbageCollector.png", new List()); - private List Objects = new List(); - public MainWindow() - { - - InitializeComponent(); - - for (int y = 0; y < rows; y++) - { - for (int x = 0; x < columns; x++) - { - Road road = new Road(columns, new Coords(x, y), AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\intersection.png"); - Objects.Add(road); - } - } - - List trashes = new List(); - Trash glass = new Trash(GarbageType.Glass, 100); - Trash plasticMetal = new Trash(GarbageType.PlasticMetal, 100); - Trash organic = new Trash(GarbageType.Organic, 100); - Trash paper = new Trash(GarbageType.Paper, 100); - - trashes.Add(glass); - trashes.Add(plasticMetal); - trashes.Add(organic); - trashes.Add(paper); - House house = new House(columns, new Coords(0, 0), trashes); - Objects[house.Location.X + house.Location.Y] = house; - house = new House(columns, new Coords(1, 0), trashes); - Objects[house.Location.X + house.Location.Y] = house; - house = new House(columns, new Coords(2, 0), trashes); - Objects[house.Location.X + house.Location.Y] = house; - DumpWPF dump = new DumpWPF(columns, new Coords(2, 4), glass); - Objects[dump.Location.X + dump.Location.Y] = dump; - dump = new DumpWPF(columns, new Coords(2, 5), paper); - Objects[dump.Location.X + dump.Location.Y] = dump; - dump = new DumpWPF(columns, new Coords(3, 4), organic); - Objects[dump.Location.X + dump.Location.Y] = dump; - dump = new DumpWPF(columns, new Coords(3, 5), plasticMetal); - Objects[dump.Location.X + dump.Location.Y] = dump; - - - Board board = new Board(Objects, garbageCollector); - this.DataContext = board; - } - - private void MainWindow_OnKeyDown(object sender, KeyEventArgs e) - { - - if (e.Key == Key.Up) - { - garbageCollector.Move(columns, Direction.Up); - } - - if (e.Key == Key.Down) - { - garbageCollector.Move(columns, Direction.Down); - } - if (e.Key == Key.Left) - { - garbageCollector.Move(columns, Direction.Left); - } - - if (e.Key == Key.Right) - { - garbageCollector.Move(columns, Direction.Right); - } - Board board = new Board(Objects, garbageCollector); - board.BoardRefresh(Objects, garbageCollector); - this.DataContext = board; - } - } -} \ No newline at end of file diff --git a/Trunk/Interface/CzokoŚmieciarka.WPF/Models/Board.cs b/Trunk/Interface/CzokoŚmieciarka.WPF/Models/Board.cs deleted file mode 100644 index e5923a7..0000000 --- a/Trunk/Interface/CzokoŚmieciarka.WPF/Models/Board.cs +++ /dev/null @@ -1,87 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Drawing; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using CzokoŚmieciarka.DataModels.GeneralModels.Models; -using CzokoŚmieciarka.DataModels.Models; -using CzokoŚmieciarka.WPF.Interfaces; - -namespace CzokoŚmieciarka.WPF.Models -{ - public class Board - { - static int _rows = 9; - static int _columns = 9; - List _tiles = new List(); - - public Board(List objects, GarbageCollectorWPF garbageCollector) - { - foreach (var item in objects) - { - Tile tile = new Tile() - { - Data = item.Data, - Object = item - }; - _tiles.Add(tile); - } - _tiles[garbageCollector.Location.X + garbageCollector.Location.Y].Object.Image = MergedBitmaps( - new Bitmap(_tiles[garbageCollector.Location.X + garbageCollector.Location.Y].Object.ImagePath), - new Bitmap(garbageCollector.ImagePath)); - } - - public void BoardRefresh(List objects, GarbageCollectorWPF garbageCollector) - { - foreach (var item in objects) - { - _tiles[item.Location.X + item.Location.Y].Object = item; - _tiles[item.Location.X + item.Location.Y].Object.RefreshImage(); - - } - - _tiles[garbageCollector.Location.X + garbageCollector.Location.Y].Object.Image = MergedBitmaps( - new Bitmap(_tiles[garbageCollector.Location.X + garbageCollector.Location.Y].Object.ImagePath), - new Bitmap(garbageCollector.ImagePath)); - } - - public int Rows - { - get { return _rows; } - set { _rows = value; } - } - - public int Columns - { - get { return _columns; } - set { _columns = value; } - } - - public List Tiles - { - get { return _tiles; } - set { _tiles = value; } - } - - private ImageBrush MergedBitmaps(Bitmap bmp1, Bitmap bmp2) - { - using (Graphics g = Graphics.FromImage(bmp1)) - { - g.DrawImage(bmp2, new Point(0, 0)); - } - MemoryStream ms = new MemoryStream(); - ((System.Drawing.Bitmap)bmp1).Save(ms, System.Drawing.Imaging.ImageFormat.Bmp); - BitmapImage image = new BitmapImage(); - image.BeginInit(); - ms.Seek(0, SeekOrigin.Begin); - image.StreamSource = ms; - image.EndInit(); - ImageBrush result = new ImageBrush(image); - return result; - } - } -} \ No newline at end of file diff --git a/Trunk/Interface/CzokoŚmieciarka.WPF/Models/DumpWPF.cs b/Trunk/Interface/CzokoŚmieciarka.WPF/Models/DumpWPF.cs deleted file mode 100644 index 25de71b..0000000 --- a/Trunk/Interface/CzokoŚmieciarka.WPF/Models/DumpWPF.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using CzokoŚmieciarka.DataModels.Enums; -using CzokoŚmieciarka.DataModels.Interfaces; -using CzokoŚmieciarka.DataModels.Models; -using CzokoŚmieciarka.WPF.Interfaces; - -namespace CzokoŚmieciarka.WPF.Models -{ - class DumpWPF : AObject, INotifyPropertyChanged - { - public event PropertyChangedEventHandler PropertyChanged; - public Trash Trash; - public DumpWPF(int columns, Coords location, Trash trash) - { - Location = new Coords(location.X, location.Y * columns); - Trash = trash; - switch (Trash.Type) - { - case GarbageType.Glass: - ImagePath = AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\Dumps\glass.png"; - Image = new ImageBrush(new BitmapImage(new Uri(ImagePath))); - Data = String.Format("House\n{0}: {1}", Trash.Type.ToString(), Trash.Weight); - break; - case GarbageType.PlasticMetal: - ImagePath = AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\Dumps\plasticmetal.png"; - Image = new ImageBrush(new BitmapImage(new Uri(ImagePath))); - Data = String.Format("House\n{0}: {1}", Trash.Type.ToString(), Trash.Weight); - break; - case GarbageType.Organic: - ImagePath = AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\Dumps\organic.png"; - Image = new ImageBrush(new BitmapImage(new Uri(ImagePath))); - Data = String.Format("House\n{0}: {1}", Trash.Type.ToString(), Trash.Weight); - break; - case GarbageType.Paper: - ImagePath = AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\Dumps\paper.png"; - Image = new ImageBrush(new BitmapImage(new Uri(ImagePath))); - Data = String.Format("House\n{0}: {1}", Trash.Type.ToString(), Trash.Weight); - break; - } - } - } -} diff --git a/Trunk/Interface/CzokoŚmieciarka.WPF/Models/GarbageCollectorWPF.cs b/Trunk/Interface/CzokoŚmieciarka.WPF/Models/GarbageCollectorWPF.cs deleted file mode 100644 index 3e92782..0000000 --- a/Trunk/Interface/CzokoŚmieciarka.WPF/Models/GarbageCollectorWPF.cs +++ /dev/null @@ -1,69 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Runtime.CompilerServices; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using CzokoŚmieciarka.DataModels.Enums; -using CzokoŚmieciarka.DataModels.GeneralModels.Models; -using CzokoŚmieciarka.DataModels.Interfaces.GarbageCollector; -using CzokoŚmieciarka.DataModels.Interfaces.TrashCans; -using CzokoŚmieciarka.DataModels.Models; -using CzokoŚmieciarka.WPF.Annotations; -using CzokoŚmieciarka.WPF.Interfaces; - -namespace CzokoŚmieciarka.WPF.Models -{ - public class GarbageCollectorWPF : AGarbageCollector, IObject, INotifyPropertyChanged - { - public Coords Location { get; set; } - public string ImagePath { get; set; } - public string Data { get; set; } - public ImageBrush Image { get; set; } - public void Move(int columns, Direction direction) - { - switch (direction) - { - case (Direction.Up): - Location.Y = Location.Y + (-1 * columns); - Position = this.MoveUp(); - break; - case (Direction.Down): - Location.Y = Location.Y + (1 * columns); - Position = this.MoveDown(); - break; - case (Direction.Left): - Location.X = Location.X + (-1); - Position = this.MoveLeft(); - break; - case (Direction.Right): - Location.X = Location.X + (1); - Position = this.MoveRight(); - - break; - } - } - - - public GarbageCollectorWPF(int columns, Coords location, string imagePath, IEnumerable trashContainers) : base(location, trashContainers) - { - Location = new Coords(location.X, location.Y * columns); - ImagePath = imagePath; - Image = new ImageBrush(new BitmapImage(new Uri(ImagePath))); - } - - public event PropertyChangedEventHandler PropertyChanged; - - [NotifyPropertyChangedInvocator] - protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) - { - PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); - } - - - } -} - diff --git a/Trunk/Interface/CzokoŚmieciarka.WPF/Models/House.cs b/Trunk/Interface/CzokoŚmieciarka.WPF/Models/House.cs deleted file mode 100644 index 92a5a29..0000000 --- a/Trunk/Interface/CzokoŚmieciarka.WPF/Models/House.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using CzokoŚmieciarka.DataModels.Models; -using CzokoŚmieciarka.WPF.Interfaces; - -namespace CzokoŚmieciarka.WPF.Models -{ - public class House : AObject - { - public List Trashes = new List(); - public House(int columns, Coords location, List trashes) - { - Trashes = trashes; - ImagePath = AppDomain.CurrentDomain.BaseDirectory + @"..\..\Images\house.png"; - Image = new ImageBrush(new BitmapImage(new Uri(ImagePath))); - Location = new Coords(location.X, location.Y*columns); - Data = String.Format("House\n{0}: {1}\n{2}: {3}\n{4}: {5}\n{6}: {7}", Trashes[0].Type.ToString(), Trashes[0].Weight, Trashes[1].Type.ToString(), Trashes[1].Weight, Trashes[2].Type.ToString(), Trashes[2].Weight, Trashes[3].Type.ToString(), Trashes[3].Weight); - } - } -} diff --git a/Trunk/Interface/CzokoŚmieciarka.WPF/Models/Road.cs b/Trunk/Interface/CzokoŚmieciarka.WPF/Models/Road.cs deleted file mode 100644 index 5f9de27..0000000 --- a/Trunk/Interface/CzokoŚmieciarka.WPF/Models/Road.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using CzokoŚmieciarka.DataModels.Models; -using CzokoŚmieciarka.WPF.Interfaces; - -namespace CzokoŚmieciarka.WPF.Models -{ - public class Road: AObject - { - public Road(int columns, Coords location, string imagePath) - { - Location = new Coords(location.X, location.Y * columns); - ImagePath = imagePath; - Image = new ImageBrush(new BitmapImage(new Uri(ImagePath))); - } - } -} diff --git a/Trunk/Interface/CzokoŚmieciarka.WPF/Models/Tile.cs b/Trunk/Interface/CzokoŚmieciarka.WPF/Models/Tile.cs deleted file mode 100644 index 4b67709..0000000 --- a/Trunk/Interface/CzokoŚmieciarka.WPF/Models/Tile.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Media; -using CzokoŚmieciarka.WPF.Interfaces; - -namespace CzokoŚmieciarka.WPF.Models -{ - public class Tile - { - public string Data { get; set; } - public AObject Object { get; set; } - } -} diff --git a/Trunk/Interface/CzokoŚmieciarka.WPF/Models/Trash.cs b/Trunk/Interface/CzokoŚmieciarka.WPF/Models/Trash.cs deleted file mode 100644 index ad59a69..0000000 --- a/Trunk/Interface/CzokoŚmieciarka.WPF/Models/Trash.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using CzokoŚmieciarka.DataModels.Enums; - -namespace CzokoŚmieciarka.WPF.Models -{ - public class Trash - { - public GarbageType Type { get; set; } - public int Weight { get; set; } - - public Trash(GarbageType type, int weight) - { - Type = type; - Weight = weight; - } - } -} diff --git a/Trunk/Interface/CzokoŚmieciarka.WPF/Properties/Annotations.cs b/Trunk/Interface/CzokoŚmieciarka.WPF/Properties/Annotations.cs deleted file mode 100644 index 8d61b79..0000000 --- a/Trunk/Interface/CzokoŚmieciarka.WPF/Properties/Annotations.cs +++ /dev/null @@ -1,1065 +0,0 @@ -/* MIT License - -Copyright (c) 2016 JetBrains http://www.jetbrains.com - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. */ - -using System; - -#pragma warning disable 1591 -// ReSharper disable UnusedMember.Global -// ReSharper disable MemberCanBePrivate.Global -// ReSharper disable UnusedAutoPropertyAccessor.Global -// ReSharper disable IntroduceOptionalParameters.Global -// ReSharper disable MemberCanBeProtected.Global -// ReSharper disable InconsistentNaming - -namespace CzokoŚmieciarka.WPF.Annotations -{ - /// - /// Indicates that the value of the marked element could be null sometimes, - /// so the check for null is necessary before its usage. - /// - /// - /// [CanBeNull] object Test() => null; - /// - /// void UseTest() { - /// var p = Test(); - /// var s = p.ToString(); // Warning: Possible 'System.NullReferenceException' - /// } - /// - [AttributeUsage( - AttributeTargets.Method | AttributeTargets.Parameter | AttributeTargets.Property | - AttributeTargets.Delegate | AttributeTargets.Field | AttributeTargets.Event | - AttributeTargets.Class | AttributeTargets.Interface | AttributeTargets.GenericParameter)] - public sealed class CanBeNullAttribute : Attribute { } - - /// - /// Indicates that the value of the marked element could never be null. - /// - /// - /// [NotNull] object Foo() { - /// return null; // Warning: Possible 'null' assignment - /// } - /// - [AttributeUsage( - AttributeTargets.Method | AttributeTargets.Parameter | AttributeTargets.Property | - AttributeTargets.Delegate | AttributeTargets.Field | AttributeTargets.Event | - AttributeTargets.Class | AttributeTargets.Interface | AttributeTargets.GenericParameter)] - public sealed class NotNullAttribute : Attribute { } - - /// - /// Can be appplied to symbols of types derived from IEnumerable as well as to symbols of Task - /// and Lazy classes to indicate that the value of a collection item, of the Task.Result property - /// or of the Lazy.Value property can never be null. - /// - [AttributeUsage( - AttributeTargets.Method | AttributeTargets.Parameter | AttributeTargets.Property | - AttributeTargets.Delegate | AttributeTargets.Field)] - public sealed class ItemNotNullAttribute : Attribute { } - - /// - /// Can be appplied to symbols of types derived from IEnumerable as well as to symbols of Task - /// and Lazy classes to indicate that the value of a collection item, of the Task.Result property - /// or of the Lazy.Value property can be null. - /// - [AttributeUsage( - AttributeTargets.Method | AttributeTargets.Parameter | AttributeTargets.Property | - AttributeTargets.Delegate | AttributeTargets.Field)] - public sealed class ItemCanBeNullAttribute : Attribute { } - - /// - /// Indicates that the marked method builds string by format pattern and (optional) arguments. - /// Parameter, which contains format string, should be given in constructor. The format string - /// should be in -like form. - /// - /// - /// [StringFormatMethod("message")] - /// void ShowError(string message, params object[] args) { /* do something */ } - /// - /// void Foo() { - /// ShowError("Failed: {0}"); // Warning: Non-existing argument in format string - /// } - /// - [AttributeUsage( - AttributeTargets.Constructor | AttributeTargets.Method | - AttributeTargets.Property | AttributeTargets.Delegate)] - public sealed class StringFormatMethodAttribute : Attribute - { - /// - /// Specifies which parameter of an annotated method should be treated as format-string - /// - public StringFormatMethodAttribute([NotNull] string formatParameterName) - { - FormatParameterName = formatParameterName; - } - - [NotNull] public string FormatParameterName { get; private set; } - } - - /// - /// For a parameter that is expected to be one of the limited set of values. - /// Specify fields of which type should be used as values for this parameter. - /// - [AttributeUsage( - AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.Field, - AllowMultiple = true)] - public sealed class ValueProviderAttribute : Attribute - { - public ValueProviderAttribute([NotNull] string name) - { - Name = name; - } - - [NotNull] public string Name { get; private set; } - } - - /// - /// Indicates that the function argument should be string literal and match one - /// of the parameters of the caller function. For example, ReSharper annotates - /// the parameter of . - /// - /// - /// void Foo(string param) { - /// if (param == null) - /// throw new ArgumentNullException("par"); // Warning: Cannot resolve symbol - /// } - /// - [AttributeUsage(AttributeTargets.Parameter)] - public sealed class InvokerParameterNameAttribute : Attribute { } - - /// - /// Indicates that the method is contained in a type that implements - /// System.ComponentModel.INotifyPropertyChanged interface and this method - /// is used to notify that some property value changed. - /// - /// - /// The method should be non-static and conform to one of the supported signatures: - /// - /// NotifyChanged(string) - /// NotifyChanged(params string[]) - /// NotifyChanged{T}(Expression{Func{T}}) - /// NotifyChanged{T,U}(Expression{Func{T,U}}) - /// SetProperty{T}(ref T, T, string) - /// - /// - /// - /// public class Foo : INotifyPropertyChanged { - /// public event PropertyChangedEventHandler PropertyChanged; - /// - /// [NotifyPropertyChangedInvocator] - /// protected virtual void NotifyChanged(string propertyName) { ... } - /// - /// string _name; - /// - /// public string Name { - /// get { return _name; } - /// set { _name = value; NotifyChanged("LastName"); /* Warning */ } - /// } - /// } - /// - /// Examples of generated notifications: - /// - /// NotifyChanged("Property") - /// NotifyChanged(() => Property) - /// NotifyChanged((VM x) => x.Property) - /// SetProperty(ref myField, value, "Property") - /// - /// - [AttributeUsage(AttributeTargets.Method)] - public sealed class NotifyPropertyChangedInvocatorAttribute : Attribute - { - public NotifyPropertyChangedInvocatorAttribute() { } - public NotifyPropertyChangedInvocatorAttribute([NotNull] string parameterName) - { - ParameterName = parameterName; - } - - [CanBeNull] public string ParameterName { get; private set; } - } - - /// - /// Describes dependency between method input and output. - /// - /// - ///

Function Definition Table syntax:

- /// - /// FDT ::= FDTRow [;FDTRow]* - /// FDTRow ::= Input => Output | Output <= Input - /// Input ::= ParameterName: Value [, Input]* - /// Output ::= [ParameterName: Value]* {halt|stop|void|nothing|Value} - /// Value ::= true | false | null | notnull | canbenull - /// - /// If method has single input parameter, it's name could be omitted.
- /// Using halt (or void/nothing, which is the same) for method output - /// means that the methos doesn't return normally (throws or terminates the process).
- /// Value canbenull is only applicable for output parameters.
- /// You can use multiple [ContractAnnotation] for each FDT row, or use single attribute - /// with rows separated by semicolon. There is no notion of order rows, all rows are checked - /// for applicability and applied per each program state tracked by R# analysis.
- ///
- /// - /// - /// [ContractAnnotation("=> halt")] - /// public void TerminationMethod() - /// - /// - /// [ContractAnnotation("halt <= condition: false")] - /// public void Assert(bool condition, string text) // regular assertion method - /// - /// - /// [ContractAnnotation("s:null => true")] - /// public bool IsNullOrEmpty(string s) // string.IsNullOrEmpty() - /// - /// - /// // A method that returns null if the parameter is null, - /// // and not null if the parameter is not null - /// [ContractAnnotation("null => null; notnull => notnull")] - /// public object Transform(object data) - /// - /// - /// [ContractAnnotation("=> true, result: notnull; => false, result: null")] - /// public bool TryParse(string s, out Person result) - /// - /// - [AttributeUsage(AttributeTargets.Method, AllowMultiple = true)] - public sealed class ContractAnnotationAttribute : Attribute - { - public ContractAnnotationAttribute([NotNull] string contract) - : this(contract, false) { } - - public ContractAnnotationAttribute([NotNull] string contract, bool forceFullStates) - { - Contract = contract; - ForceFullStates = forceFullStates; - } - - [NotNull] public string Contract { get; private set; } - - public bool ForceFullStates { get; private set; } - } - - /// - /// Indicates that marked element should be localized or not. - /// - /// - /// [LocalizationRequiredAttribute(true)] - /// class Foo { - /// string str = "my string"; // Warning: Localizable string - /// } - /// - [AttributeUsage(AttributeTargets.All)] - public sealed class LocalizationRequiredAttribute : Attribute - { - public LocalizationRequiredAttribute() : this(true) { } - - public LocalizationRequiredAttribute(bool required) - { - Required = required; - } - - public bool Required { get; private set; } - } - - /// - /// Indicates that the value of the marked type (or its derivatives) - /// cannot be compared using '==' or '!=' operators and Equals() - /// should be used instead. However, using '==' or '!=' for comparison - /// with null is always permitted. - /// - /// - /// [CannotApplyEqualityOperator] - /// class NoEquality { } - /// - /// class UsesNoEquality { - /// void Test() { - /// var ca1 = new NoEquality(); - /// var ca2 = new NoEquality(); - /// if (ca1 != null) { // OK - /// bool condition = ca1 == ca2; // Warning - /// } - /// } - /// } - /// - [AttributeUsage(AttributeTargets.Interface | AttributeTargets.Class | AttributeTargets.Struct)] - public sealed class CannotApplyEqualityOperatorAttribute : Attribute { } - - /// - /// When applied to a target attribute, specifies a requirement for any type marked - /// with the target attribute to implement or inherit specific type or types. - /// - /// - /// [BaseTypeRequired(typeof(IComponent)] // Specify requirement - /// class ComponentAttribute : Attribute { } - /// - /// [Component] // ComponentAttribute requires implementing IComponent interface - /// class MyComponent : IComponent { } - /// - [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)] - [BaseTypeRequired(typeof(Attribute))] - public sealed class BaseTypeRequiredAttribute : Attribute - { - public BaseTypeRequiredAttribute([NotNull] Type baseType) - { - BaseType = baseType; - } - - [NotNull] public Type BaseType { get; private set; } - } - - /// - /// Indicates that the marked symbol is used implicitly (e.g. via reflection, in external library), - /// so this symbol will not be marked as unused (as well as by other usage inspections). - /// - [AttributeUsage(AttributeTargets.All)] - public sealed class UsedImplicitlyAttribute : Attribute - { - public UsedImplicitlyAttribute() - : this(ImplicitUseKindFlags.Default, ImplicitUseTargetFlags.Default) { } - - public UsedImplicitlyAttribute(ImplicitUseKindFlags useKindFlags) - : this(useKindFlags, ImplicitUseTargetFlags.Default) { } - - public UsedImplicitlyAttribute(ImplicitUseTargetFlags targetFlags) - : this(ImplicitUseKindFlags.Default, targetFlags) { } - - public UsedImplicitlyAttribute(ImplicitUseKindFlags useKindFlags, ImplicitUseTargetFlags targetFlags) - { - UseKindFlags = useKindFlags; - TargetFlags = targetFlags; - } - - public ImplicitUseKindFlags UseKindFlags { get; private set; } - - public ImplicitUseTargetFlags TargetFlags { get; private set; } - } - - /// - /// Should be used on attributes and causes ReSharper to not mark symbols marked with such attributes - /// as unused (as well as by other usage inspections) - /// - [AttributeUsage(AttributeTargets.Class | AttributeTargets.GenericParameter)] - public sealed class MeansImplicitUseAttribute : Attribute - { - public MeansImplicitUseAttribute() - : this(ImplicitUseKindFlags.Default, ImplicitUseTargetFlags.Default) { } - - public MeansImplicitUseAttribute(ImplicitUseKindFlags useKindFlags) - : this(useKindFlags, ImplicitUseTargetFlags.Default) { } - - public MeansImplicitUseAttribute(ImplicitUseTargetFlags targetFlags) - : this(ImplicitUseKindFlags.Default, targetFlags) { } - - public MeansImplicitUseAttribute(ImplicitUseKindFlags useKindFlags, ImplicitUseTargetFlags targetFlags) - { - UseKindFlags = useKindFlags; - TargetFlags = targetFlags; - } - - [UsedImplicitly] public ImplicitUseKindFlags UseKindFlags { get; private set; } - - [UsedImplicitly] public ImplicitUseTargetFlags TargetFlags { get; private set; } - } - - [Flags] - public enum ImplicitUseKindFlags - { - Default = Access | Assign | InstantiatedWithFixedConstructorSignature, - /// Only entity marked with attribute considered used. - Access = 1, - /// Indicates implicit assignment to a member. - Assign = 2, - /// - /// Indicates implicit instantiation of a type with fixed constructor signature. - /// That means any unused constructor parameters won't be reported as such. - /// - InstantiatedWithFixedConstructorSignature = 4, - /// Indicates implicit instantiation of a type. - InstantiatedNoFixedConstructorSignature = 8, - } - - /// - /// Specify what is considered used implicitly when marked - /// with or . - /// - [Flags] - public enum ImplicitUseTargetFlags - { - Default = Itself, - Itself = 1, - /// Members of entity marked with attribute are considered used. - Members = 2, - /// Entity marked with attribute and all its members considered used. - WithMembers = Itself | Members - } - - /// - /// This attribute is intended to mark publicly available API - /// which should not be removed and so is treated as used. - /// - [MeansImplicitUse(ImplicitUseTargetFlags.WithMembers)] - public sealed class PublicAPIAttribute : Attribute - { - public PublicAPIAttribute() { } - - public PublicAPIAttribute([NotNull] string comment) - { - Comment = comment; - } - - [CanBeNull] public string Comment { get; private set; } - } - - /// - /// Tells code analysis engine if the parameter is completely handled when the invoked method is on stack. - /// If the parameter is a delegate, indicates that delegate is executed while the method is executed. - /// If the parameter is an enumerable, indicates that it is enumerated while the method is executed. - /// - [AttributeUsage(AttributeTargets.Parameter)] - public sealed class InstantHandleAttribute : Attribute { } - - /// - /// Indicates that a method does not make any observable state changes. - /// The same as System.Diagnostics.Contracts.PureAttribute. - /// - /// - /// [Pure] int Multiply(int x, int y) => x * y; - /// - /// void M() { - /// Multiply(123, 42); // Waring: Return value of pure method is not used - /// } - /// - [AttributeUsage(AttributeTargets.Method)] - public sealed class PureAttribute : Attribute { } - - /// - /// Indicates that the return value of method invocation must be used. - /// - [AttributeUsage(AttributeTargets.Method)] - public sealed class MustUseReturnValueAttribute : Attribute - { - public MustUseReturnValueAttribute() { } - - public MustUseReturnValueAttribute([NotNull] string justification) - { - Justification = justification; - } - - [CanBeNull] public string Justification { get; private set; } - } - - /// - /// Indicates the type member or parameter of some type, that should be used instead of all other ways - /// to get the value that type. This annotation is useful when you have some "context" value evaluated - /// and stored somewhere, meaning that all other ways to get this value must be consolidated with existing one. - /// - /// - /// class Foo { - /// [ProvidesContext] IBarService _barService = ...; - /// - /// void ProcessNode(INode node) { - /// DoSomething(node, node.GetGlobalServices().Bar); - /// // ^ Warning: use value of '_barService' field - /// } - /// } - /// - [AttributeUsage( - AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Parameter | AttributeTargets.Method | - AttributeTargets.Class | AttributeTargets.Interface | AttributeTargets.Struct | AttributeTargets.GenericParameter)] - public sealed class ProvidesContextAttribute : Attribute { } - - /// - /// Indicates that a parameter is a path to a file or a folder within a web project. - /// Path can be relative or absolute, starting from web root (~). - /// - [AttributeUsage(AttributeTargets.Parameter)] - public sealed class PathReferenceAttribute : Attribute - { - public PathReferenceAttribute() { } - - public PathReferenceAttribute([NotNull, PathReference] string basePath) - { - BasePath = basePath; - } - - [CanBeNull] public string BasePath { get; private set; } - } - - /// - /// An extension method marked with this attribute is processed by ReSharper code completion - /// as a 'Source Template'. When extension method is completed over some expression, it's source code - /// is automatically expanded like a template at call site. - /// - /// - /// Template method body can contain valid source code and/or special comments starting with '$'. - /// Text inside these comments is added as source code when the template is applied. Template parameters - /// can be used either as additional method parameters or as identifiers wrapped in two '$' signs. - /// Use the attribute to specify macros for parameters. - /// - /// - /// In this example, the 'forEach' method is a source template available over all values - /// of enumerable types, producing ordinary C# 'foreach' statement and placing caret inside block: - /// - /// [SourceTemplate] - /// public static void forEach<T>(this IEnumerable<T> xs) { - /// foreach (var x in xs) { - /// //$ $END$ - /// } - /// } - /// - /// - [AttributeUsage(AttributeTargets.Method)] - public sealed class SourceTemplateAttribute : Attribute { } - - /// - /// Allows specifying a macro for a parameter of a source template. - /// - /// - /// You can apply the attribute on the whole method or on any of its additional parameters. The macro expression - /// is defined in the property. When applied on a method, the target - /// template parameter is defined in the property. To apply the macro silently - /// for the parameter, set the property value = -1. - /// - /// - /// Applying the attribute on a source template method: - /// - /// [SourceTemplate, Macro(Target = "item", Expression = "suggestVariableName()")] - /// public static void forEach<T>(this IEnumerable<T> collection) { - /// foreach (var item in collection) { - /// //$ $END$ - /// } - /// } - /// - /// Applying the attribute on a template method parameter: - /// - /// [SourceTemplate] - /// public static void something(this Entity x, [Macro(Expression = "guid()", Editable = -1)] string newguid) { - /// /*$ var $x$Id = "$newguid$" + x.ToString(); - /// x.DoSomething($x$Id); */ - /// } - /// - /// - [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method, AllowMultiple = true)] - public sealed class MacroAttribute : Attribute - { - /// - /// Allows specifying a macro that will be executed for a source template - /// parameter when the template is expanded. - /// - [CanBeNull] public string Expression { get; set; } - - /// - /// Allows specifying which occurrence of the target parameter becomes editable when the template is deployed. - /// - /// - /// If the target parameter is used several times in the template, only one occurrence becomes editable; - /// other occurrences are changed synchronously. To specify the zero-based index of the editable occurrence, - /// use values >= 0. To make the parameter non-editable when the template is expanded, use -1. - /// > - public int Editable { get; set; } - - /// - /// Identifies the target parameter of a source template if the - /// is applied on a template method. - /// - [CanBeNull] public string Target { get; set; } - } - - [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = true)] - public sealed class AspMvcAreaMasterLocationFormatAttribute : Attribute - { - public AspMvcAreaMasterLocationFormatAttribute([NotNull] string format) - { - Format = format; - } - - [NotNull] public string Format { get; private set; } - } - - [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = true)] - public sealed class AspMvcAreaPartialViewLocationFormatAttribute : Attribute - { - public AspMvcAreaPartialViewLocationFormatAttribute([NotNull] string format) - { - Format = format; - } - - [NotNull] public string Format { get; private set; } - } - - [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = true)] - public sealed class AspMvcAreaViewLocationFormatAttribute : Attribute - { - public AspMvcAreaViewLocationFormatAttribute([NotNull] string format) - { - Format = format; - } - - [NotNull] public string Format { get; private set; } - } - - [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = true)] - public sealed class AspMvcMasterLocationFormatAttribute : Attribute - { - public AspMvcMasterLocationFormatAttribute([NotNull] string format) - { - Format = format; - } - - [NotNull] public string Format { get; private set; } - } - - [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = true)] - public sealed class AspMvcPartialViewLocationFormatAttribute : Attribute - { - public AspMvcPartialViewLocationFormatAttribute([NotNull] string format) - { - Format = format; - } - - [NotNull] public string Format { get; private set; } - } - - [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = true)] - public sealed class AspMvcViewLocationFormatAttribute : Attribute - { - public AspMvcViewLocationFormatAttribute([NotNull] string format) - { - Format = format; - } - - [NotNull] public string Format { get; private set; } - } - - /// - /// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter - /// is an MVC action. If applied to a method, the MVC action name is calculated - /// implicitly from the context. Use this attribute for custom wrappers similar to - /// System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper, String). - /// - [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)] - public sealed class AspMvcActionAttribute : Attribute - { - public AspMvcActionAttribute() { } - - public AspMvcActionAttribute([NotNull] string anonymousProperty) - { - AnonymousProperty = anonymousProperty; - } - - [CanBeNull] public string AnonymousProperty { get; private set; } - } - - /// - /// ASP.NET MVC attribute. Indicates that a parameter is an MVC area. - /// Use this attribute for custom wrappers similar to - /// System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper, String). - /// - [AttributeUsage(AttributeTargets.Parameter)] - public sealed class AspMvcAreaAttribute : Attribute - { - public AspMvcAreaAttribute() { } - - public AspMvcAreaAttribute([NotNull] string anonymousProperty) - { - AnonymousProperty = anonymousProperty; - } - - [CanBeNull] public string AnonymousProperty { get; private set; } - } - - /// - /// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter is - /// an MVC controller. If applied to a method, the MVC controller name is calculated - /// implicitly from the context. Use this attribute for custom wrappers similar to - /// System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper, String, String). - /// - [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)] - public sealed class AspMvcControllerAttribute : Attribute - { - public AspMvcControllerAttribute() { } - - public AspMvcControllerAttribute([NotNull] string anonymousProperty) - { - AnonymousProperty = anonymousProperty; - } - - [CanBeNull] public string AnonymousProperty { get; private set; } - } - - /// - /// ASP.NET MVC attribute. Indicates that a parameter is an MVC Master. Use this attribute - /// for custom wrappers similar to System.Web.Mvc.Controller.View(String, String). - /// - [AttributeUsage(AttributeTargets.Parameter)] - public sealed class AspMvcMasterAttribute : Attribute { } - - /// - /// ASP.NET MVC attribute. Indicates that a parameter is an MVC model type. Use this attribute - /// for custom wrappers similar to System.Web.Mvc.Controller.View(String, Object). - /// - [AttributeUsage(AttributeTargets.Parameter)] - public sealed class AspMvcModelTypeAttribute : Attribute { } - - /// - /// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter is an MVC - /// partial view. If applied to a method, the MVC partial view name is calculated implicitly - /// from the context. Use this attribute for custom wrappers similar to - /// System.Web.Mvc.Html.RenderPartialExtensions.RenderPartial(HtmlHelper, String). - /// - [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)] - public sealed class AspMvcPartialViewAttribute : Attribute { } - - /// - /// ASP.NET MVC attribute. Allows disabling inspections for MVC views within a class or a method. - /// - [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)] - public sealed class AspMvcSuppressViewErrorAttribute : Attribute { } - - /// - /// ASP.NET MVC attribute. Indicates that a parameter is an MVC display template. - /// Use this attribute for custom wrappers similar to - /// System.Web.Mvc.Html.DisplayExtensions.DisplayForModel(HtmlHelper, String). - /// - [AttributeUsage(AttributeTargets.Parameter)] - public sealed class AspMvcDisplayTemplateAttribute : Attribute { } - - /// - /// ASP.NET MVC attribute. Indicates that a parameter is an MVC editor template. - /// Use this attribute for custom wrappers similar to - /// System.Web.Mvc.Html.EditorExtensions.EditorForModel(HtmlHelper, String). - /// - [AttributeUsage(AttributeTargets.Parameter)] - public sealed class AspMvcEditorTemplateAttribute : Attribute { } - - /// - /// ASP.NET MVC attribute. Indicates that a parameter is an MVC template. - /// Use this attribute for custom wrappers similar to - /// System.ComponentModel.DataAnnotations.UIHintAttribute(System.String). - /// - [AttributeUsage(AttributeTargets.Parameter)] - public sealed class AspMvcTemplateAttribute : Attribute { } - - /// - /// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter - /// is an MVC view component. If applied to a method, the MVC view name is calculated implicitly - /// from the context. Use this attribute for custom wrappers similar to - /// System.Web.Mvc.Controller.View(Object). - /// - [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)] - public sealed class AspMvcViewAttribute : Attribute { } - - /// - /// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter - /// is an MVC view component name. - /// - [AttributeUsage(AttributeTargets.Parameter)] - public sealed class AspMvcViewComponentAttribute : Attribute { } - - /// - /// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter - /// is an MVC view component view. If applied to a method, the MVC view component view name is default. - /// - [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)] - public sealed class AspMvcViewComponentViewAttribute : Attribute { } - - /// - /// ASP.NET MVC attribute. When applied to a parameter of an attribute, - /// indicates that this parameter is an MVC action name. - /// - /// - /// [ActionName("Foo")] - /// public ActionResult Login(string returnUrl) { - /// ViewBag.ReturnUrl = Url.Action("Foo"); // OK - /// return RedirectToAction("Bar"); // Error: Cannot resolve action - /// } - /// - [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Property)] - public sealed class AspMvcActionSelectorAttribute : Attribute { } - - [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.Field)] - public sealed class HtmlElementAttributesAttribute : Attribute - { - public HtmlElementAttributesAttribute() { } - - public HtmlElementAttributesAttribute([NotNull] string name) - { - Name = name; - } - - [CanBeNull] public string Name { get; private set; } - } - - [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Field | AttributeTargets.Property)] - public sealed class HtmlAttributeValueAttribute : Attribute - { - public HtmlAttributeValueAttribute([NotNull] string name) - { - Name = name; - } - - [NotNull] public string Name { get; private set; } - } - - /// - /// Razor attribute. Indicates that a parameter or a method is a Razor section. - /// Use this attribute for custom wrappers similar to - /// System.Web.WebPages.WebPageBase.RenderSection(String). - /// - [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)] - public sealed class RazorSectionAttribute : Attribute { } - - /// - /// Indicates how method, constructor invocation or property access - /// over collection type affects content of the collection. - /// - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property)] - public sealed class CollectionAccessAttribute : Attribute - { - public CollectionAccessAttribute(CollectionAccessType collectionAccessType) - { - CollectionAccessType = collectionAccessType; - } - - public CollectionAccessType CollectionAccessType { get; private set; } - } - - [Flags] - public enum CollectionAccessType - { - /// Method does not use or modify content of the collection. - None = 0, - /// Method only reads content of the collection but does not modify it. - Read = 1, - /// Method can change content of the collection but does not add new elements. - ModifyExistingContent = 2, - /// Method can add new elements to the collection. - UpdatedContent = ModifyExistingContent | 4 - } - - /// - /// Indicates that the marked method is assertion method, i.e. it halts control flow if - /// one of the conditions is satisfied. To set the condition, mark one of the parameters with - /// attribute. - /// - [AttributeUsage(AttributeTargets.Method)] - public sealed class AssertionMethodAttribute : Attribute { } - - /// - /// Indicates the condition parameter of the assertion method. The method itself should be - /// marked by attribute. The mandatory argument of - /// the attribute is the assertion type. - /// - [AttributeUsage(AttributeTargets.Parameter)] - public sealed class AssertionConditionAttribute : Attribute - { - public AssertionConditionAttribute(AssertionConditionType conditionType) - { - ConditionType = conditionType; - } - - public AssertionConditionType ConditionType { get; private set; } - } - - /// - /// Specifies assertion type. If the assertion method argument satisfies the condition, - /// then the execution continues. Otherwise, execution is assumed to be halted. - /// - public enum AssertionConditionType - { - /// Marked parameter should be evaluated to true. - IS_TRUE = 0, - /// Marked parameter should be evaluated to false. - IS_FALSE = 1, - /// Marked parameter should be evaluated to null value. - IS_NULL = 2, - /// Marked parameter should be evaluated to not null value. - IS_NOT_NULL = 3, - } - - /// - /// Indicates that the marked method unconditionally terminates control flow execution. - /// For example, it could unconditionally throw exception. - /// - [Obsolete("Use [ContractAnnotation('=> halt')] instead")] - [AttributeUsage(AttributeTargets.Method)] - public sealed class TerminatesProgramAttribute : Attribute { } - - /// - /// Indicates that method is pure LINQ method, with postponed enumeration (like Enumerable.Select, - /// .Where). This annotation allows inference of [InstantHandle] annotation for parameters - /// of delegate type by analyzing LINQ method chains. - /// - [AttributeUsage(AttributeTargets.Method)] - public sealed class LinqTunnelAttribute : Attribute { } - - /// - /// Indicates that IEnumerable, passed as parameter, is not enumerated. - /// - [AttributeUsage(AttributeTargets.Parameter)] - public sealed class NoEnumerationAttribute : Attribute { } - - /// - /// Indicates that parameter is regular expression pattern. - /// - [AttributeUsage(AttributeTargets.Parameter)] - public sealed class RegexPatternAttribute : Attribute { } - - /// - /// Prevents the Member Reordering feature from tossing members of the marked class. - /// - /// - /// The attribute must be mentioned in your member reordering patterns - /// - [AttributeUsage( - AttributeTargets.Class | AttributeTargets.Interface | AttributeTargets.Struct | AttributeTargets.Enum)] - public sealed class NoReorderAttribute : Attribute { } - - /// - /// XAML attribute. Indicates the type that has ItemsSource property and should be treated - /// as ItemsControl-derived type, to enable inner items DataContext type resolve. - /// - [AttributeUsage(AttributeTargets.Class)] - public sealed class XamlItemsControlAttribute : Attribute { } - - /// - /// XAML attribute. Indicates the property of some BindingBase-derived type, that - /// is used to bind some item of ItemsControl-derived type. This annotation will - /// enable the DataContext type resolve for XAML bindings for such properties. - /// - /// - /// Property should have the tree ancestor of the ItemsControl type or - /// marked with the attribute. - /// - [AttributeUsage(AttributeTargets.Property)] - public sealed class XamlItemBindingOfItemsControlAttribute : Attribute { } - - [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)] - public sealed class AspChildControlTypeAttribute : Attribute - { - public AspChildControlTypeAttribute([NotNull] string tagName, [NotNull] Type controlType) - { - TagName = tagName; - ControlType = controlType; - } - - [NotNull] public string TagName { get; private set; } - - [NotNull] public Type ControlType { get; private set; } - } - - [AttributeUsage(AttributeTargets.Property | AttributeTargets.Method)] - public sealed class AspDataFieldAttribute : Attribute { } - - [AttributeUsage(AttributeTargets.Property | AttributeTargets.Method)] - public sealed class AspDataFieldsAttribute : Attribute { } - - [AttributeUsage(AttributeTargets.Property)] - public sealed class AspMethodPropertyAttribute : Attribute { } - - [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)] - public sealed class AspRequiredAttributeAttribute : Attribute - { - public AspRequiredAttributeAttribute([NotNull] string attribute) - { - Attribute = attribute; - } - - [NotNull] public string Attribute { get; private set; } - } - - [AttributeUsage(AttributeTargets.Property)] - public sealed class AspTypePropertyAttribute : Attribute - { - public bool CreateConstructorReferences { get; private set; } - - public AspTypePropertyAttribute(bool createConstructorReferences) - { - CreateConstructorReferences = createConstructorReferences; - } - } - - [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] - public sealed class RazorImportNamespaceAttribute : Attribute - { - public RazorImportNamespaceAttribute([NotNull] string name) - { - Name = name; - } - - [NotNull] public string Name { get; private set; } - } - - [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] - public sealed class RazorInjectionAttribute : Attribute - { - public RazorInjectionAttribute([NotNull] string type, [NotNull] string fieldName) - { - Type = type; - FieldName = fieldName; - } - - [NotNull] public string Type { get; private set; } - - [NotNull] public string FieldName { get; private set; } - } - - [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] - public sealed class RazorDirectiveAttribute : Attribute - { - public RazorDirectiveAttribute([NotNull] string directive) - { - Directive = directive; - } - - [NotNull] public string Directive { get; private set; } - } - - [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] - public sealed class RazorPageBaseTypeAttribute : Attribute - { - public RazorPageBaseTypeAttribute([NotNull] string baseType) - { - BaseType = baseType; - } - public RazorPageBaseTypeAttribute([NotNull] string baseType, string pageName) - { - BaseType = baseType; - PageName = pageName; - } - - [NotNull] public string BaseType { get; private set; } - [CanBeNull] public string PageName { get; private set; } - } - - [AttributeUsage(AttributeTargets.Method)] - public sealed class RazorHelperCommonAttribute : Attribute { } - - [AttributeUsage(AttributeTargets.Property)] - public sealed class RazorLayoutAttribute : Attribute { } - - [AttributeUsage(AttributeTargets.Method)] - public sealed class RazorWriteLiteralMethodAttribute : Attribute { } - - [AttributeUsage(AttributeTargets.Method)] - public sealed class RazorWriteMethodAttribute : Attribute { } - - [AttributeUsage(AttributeTargets.Parameter)] - public sealed class RazorWriteMethodParameterAttribute : Attribute { } -} \ No newline at end of file diff --git a/Trunk/Interface/CzokoŚmieciarka.WPF/Properties/AssemblyInfo.cs b/Trunk/Interface/CzokoŚmieciarka.WPF/Properties/AssemblyInfo.cs deleted file mode 100644 index d80f65d..0000000 --- a/Trunk/Interface/CzokoŚmieciarka.WPF/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.Reflection; -using System.Resources; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Windows; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("CzokoŚmieciarka.WPF")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("CzokoŚmieciarka.WPF")] -[assembly: AssemblyCopyright("Copyright © 2019")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -//In order to begin building localizable applications, set -//CultureYouAreCodingWith in your .csproj file -//inside a . For example, if you are using US english -//in your source files, set the to en-US. Then uncomment -//the NeutralResourceLanguage attribute below. Update the "en-US" in -//the line below to match the UICulture setting in the project file. - -//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] - - -[assembly: ThemeInfo( - ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located - //(used if a resource is not found in the page, - // or application resource dictionaries) - ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located - //(used if a resource is not found in the page, - // app, or any theme specific resource dictionaries) -)] - - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Trunk/Interface/CzokoŚmieciarka.WPF/Properties/Resources.Designer.cs b/Trunk/Interface/CzokoŚmieciarka.WPF/Properties/Resources.Designer.cs deleted file mode 100644 index bc2fe6a..0000000 --- a/Trunk/Interface/CzokoŚmieciarka.WPF/Properties/Resources.Designer.cs +++ /dev/null @@ -1,71 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace CzokoŚmieciarka.WPF.Properties -{ - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources - { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() - { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager - { - get - { - if ((resourceMan == null)) - { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CzokoŚmieciarka.WPF.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture - { - get - { - return resourceCulture; - } - set - { - resourceCulture = value; - } - } - } -} diff --git a/Trunk/Interface/CzokoŚmieciarka.WPF/Properties/Resources.resx b/Trunk/Interface/CzokoŚmieciarka.WPF/Properties/Resources.resx deleted file mode 100644 index af7dbeb..0000000 --- a/Trunk/Interface/CzokoŚmieciarka.WPF/Properties/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/Trunk/Interface/CzokoŚmieciarka.WPF/Properties/Settings.Designer.cs b/Trunk/Interface/CzokoŚmieciarka.WPF/Properties/Settings.Designer.cs deleted file mode 100644 index c7d73f4..0000000 --- a/Trunk/Interface/CzokoŚmieciarka.WPF/Properties/Settings.Designer.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace CzokoŚmieciarka.WPF.Properties -{ - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase - { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default - { - get - { - return defaultInstance; - } - } - } -} diff --git a/Trunk/Interface/CzokoŚmieciarka.WPF/Properties/Settings.settings b/Trunk/Interface/CzokoŚmieciarka.WPF/Properties/Settings.settings deleted file mode 100644 index 033d7a5..0000000 --- a/Trunk/Interface/CzokoŚmieciarka.WPF/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/Trunk/Interface/CzokoŚmieciarka.WPFv2/CzokoŚmieciarka.WPFv2.csproj b/Trunk/Interface/CzokoŚmieciarka.WPFv2/CzokoŚmieciarka.WPFv2.csproj index b1f8a31..b65d929 100644 --- a/Trunk/Interface/CzokoŚmieciarka.WPFv2/CzokoŚmieciarka.WPFv2.csproj +++ b/Trunk/Interface/CzokoŚmieciarka.WPFv2/CzokoŚmieciarka.WPFv2.csproj @@ -101,6 +101,10 @@ + + {10e77bbe-55e1-483d-a456-0e94eac9b24a} + CzokoŚmieciarka.AI_Naive + {a3d5da96-69d7-463f-b1ee-6fc70716e3b2} CzokoŚmieciarka.DataModels.GeneralModels