Skip to content

Commit

Permalink
Release 2.1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
pluskal committed Oct 18, 2019
1 parent bc70142 commit 1fba7c4
Show file tree
Hide file tree
Showing 1,619 changed files with 251,608 additions and 24,471 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -267,3 +267,8 @@ __pycache__/

# Cake - Uncomment if you are using it
# tools/
/Web/Netfox.Web/temp
/Web/Netfox.Web/Investigations
/Web/Netfox.Web.App/Investigations
/Web/Netfox.Web.App/tmp
/Web/Netfox.Web.App/Temp/returnedFiles
12 changes: 9 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
[submodule "lib"]
path = lib
url = http://nessc.fit.vutbr.cz:8080/tfs/Netfox/NetFox/_git/lib
url = https://nessc.fit.vutbr.cz/tfs/Netfox/NetFox/_git/lib
[submodule "private"]
path = private
url = http://nessc.fit.vutbr.cz:8080/tfs/Netfox/NetFox/_git/private
url = https://nessc.fit.vutbr.cz/tfs/Netfox/NetFox/_git/private
[submodule "TestingData"]
path = TestingData
url = http://nessc.fit.vutbr.cz:8080/tfs/Netfox/NetFox/_git/TestingData
url = https://nessc.fit.vutbr.cz/tfs/Netfox/NetFox/_git/TestingData
[submodule "Misc/VirtualizingObservableCollection"]
path = Misc/VirtualizingObservableCollection
url = https://github.com/pluskal/VirtualizingObservableCollection.git
[submodule "Misc/UnitOfWork"]
path = Misc/UnitOfWork
url = https://github.com/nesfit/UnitOfWork
Binary file removed .nuget/NuGet.exe
Binary file not shown.
Binary file added .nuget/nuget.exe
Binary file not shown.
21 changes: 21 additions & 0 deletions Common/CCore/Attributes/QueryableProperty.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Copyright (c) 2017 Jan Pluskal
//
//Licensed under the Apache License, Version 2.0 (the "License");
//you may not use this file except in compliance with the License.
//You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
//Unless required by applicable law or agreed to in writing, software
//distributed under the License is distributed on an "AS IS" BASIS,
//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//See the License for the specific language governing permissions and
//limitations under the License.

using System;
using Netfox.Core.Interfaces;

namespace Netfox.Core.Attributes
{
public class QueryableProperty : Attribute, IQueryableProperty {}
}
27 changes: 27 additions & 0 deletions Common/CCore/CCore.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<RootNamespace>Netfox.Core</RootNamespace>
</PropertyGroup>

<ItemGroup>
<Folder Include="Enums\" />
<Folder Include="Interfaces\" />
<Folder Include="Interfaces\Model\" />
<Folder Include="Interfaces\Model\Exports\" />
<Folder Include="Collections\" />
<Folder Include="Models\" />
<Folder Include="Models\Exports\" />
<Folder Include="Attributes\" />
<Folder Include="Helpers\" />
<Folder Include="Interfaces\ViewModels\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Castle.Windsor" Version="4.1.0" />
<PackageReference Include="System.Reactive" Version="3.1.1" />
</ItemGroup>
<ItemGroup>
<Compile Remove="Class1.cs" />
</ItemGroup>
</Project>
8 changes: 8 additions & 0 deletions Common/CCore/Class1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
using System;

namespace CCore
{
public class Class1
{
}
}
54 changes: 54 additions & 0 deletions Common/CCore/Collections/BlockingCollectionEx.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// Copyright (c) 2017 Jan Pluskal
//
//Licensed under the Apache License, Version 2.0 (the "License");
//you may not use this file except in compliance with the License.
//You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
//Unless required by applicable law or agreed to in writing, software
//distributed under the License is distributed on an "AS IS" BASIS,
//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//See the License for the specific language governing permissions and
//limitations under the License.

using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;

namespace Netfox.Core.Collections
{
public static class BlockingCollectionEx
{
public static Partitioner<T> GetConsumingPartitioner<T>(this BlockingCollection<T> collection) { return new BlockingCollectionPartitioner<T>(collection); }

private class BlockingCollectionPartitioner<T> : Partitioner<T>

{
private readonly BlockingCollection<T> _collection;

internal BlockingCollectionPartitioner(BlockingCollection<T> collection)

{
if(collection == null) { throw new ArgumentNullException("collection"); }

this._collection = collection;
}

public override bool SupportsDynamicPartitions => true;

public override IList<IEnumerator<T>> GetPartitions(int partitionCount)

{
if(partitionCount < 1) { throw new ArgumentOutOfRangeException("partitionCount"); }

var dynamicPartitioner = this.GetDynamicPartitions();

return Enumerable.Range(0, partitionCount).Select(_ => dynamicPartitioner.GetEnumerator()).ToArray();
}

public override IEnumerable<T> GetDynamicPartitions() { return this._collection.GetConsumingEnumerable(); }
}
}
}
161 changes: 161 additions & 0 deletions Common/CCore/Collections/ConcurrentHashSet.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
// Copyright (c) 2017 Jan Pluskal
//
//Licensed under the Apache License, Version 2.0 (the "License");
//you may not use this file except in compliance with the License.
//You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
//Unless required by applicable law or agreed to in writing, software
//distributed under the License is distributed on an "AS IS" BASIS,
//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//See the License for the specific language governing permissions and
//limitations under the License.

using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Threading;

namespace Netfox.Core.Collections
{

public class ConcurrentHashSet<T> : IEnumerable<T>, ICollection<T>
{
private readonly HashSet<T> _hashSet = new HashSet<T>();
private readonly object _lock = new object();

/// <summary>
/// Initializes a new instance of the <see cref="T:System.Object" /> class.
/// </summary>
public ConcurrentHashSet() { }

public ConcurrentHashSet(IEnumerable<T> initCollection)
{
this.AddRange(initCollection);
}

public void AddRange(IEnumerable<T> initCollection)
{
foreach (var item in initCollection) { this.Add(item); }
}

public class ConcurrentHashSetEnumerator<TT> : IEnumerator<TT>
{
private TT[] _array;
private IEnumerator _enumerator;

public ConcurrentHashSetEnumerator(TT[] array)
{
this._array = array;
this._enumerator = array.GetEnumerator();
}

#region Implementation of IDisposable
/// <summary>
/// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
/// </summary>
public void Dispose() {
this._array = null;
this._enumerator = null;
}
#endregion

#region Implementation of IEnumerator
/// <summary>
/// Advances the enumerator to the next element of the collection.
/// </summary>
/// <returns>
/// true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of
/// the collection.
/// </returns>
/// <exception cref="T:System.InvalidOperationException">The collection was modified after the enumerator was created. </exception>
public bool MoveNext() => this._enumerator.MoveNext();

/// <summary>
/// Sets the enumerator to its initial position, which is before the first element in the collection.
/// </summary>
/// <exception cref="T:System.InvalidOperationException">The collection was modified after the enumerator was created. </exception>
public void Reset() => this._enumerator.Reset();

/// <summary>
/// Gets the element in the collection at the current position of the enumerator.
/// </summary>
/// <returns>
/// The element in the collection at the current position of the enumerator.
/// </returns>
public TT Current => (TT) this._enumerator.Current;

/// <summary>
/// Gets the current element in the collection.
/// </summary>
/// <returns>
/// The current element in the collection.
/// </returns>
object IEnumerator.Current => this._enumerator.Current;
#endregion
}

#region Implementation of ICollection<T> ...ish
public bool Add(T item)
{
lock(this._lock)
{
var inserted = this._hashSet.Add(item);
return inserted;
}
}

public void Clear()
{
lock(this._lock) { this._hashSet.Clear(); }
}

public bool Contains(T item) { lock(this._lock) { return this._hashSet.Contains(item); } }

public bool Remove(T item) {
lock(this._lock)
{
var ret = this._hashSet.Remove(item);
return ret;
} }

public int Count
{
get { lock(this._lock) { return this._hashSet.Count; } }
}
#endregion

#region Implementation of IEnumerable
/// <summary>
/// Returns an enumerator that iterates through the collection.
/// </summary>
/// <returns>
/// A <see cref="T:System.Collections.Generic.IEnumerator`1" /> that can be used to iterate through the collection.
/// </returns>
public IEnumerator<T> GetEnumerator()
{
T[] arr;
lock(this._lock) { arr = this._hashSet.ToArray(); }
return new ConcurrentHashSetEnumerator<T>(arr);
}

/// <summary>
/// Returns an enumerator that iterates through a collection.
/// </summary>
/// <returns>
/// An <see cref="T:System.Collections.IEnumerator" /> object that can be used to iterate through the collection.
/// </returns>
IEnumerator IEnumerable.GetEnumerator() { return this.GetEnumerator(); }
#endregion


#region Implementation of ICollection<T>
void ICollection<T>.Add(T item) { this.Add(item); }
public void CopyTo(T[] array, int arrayIndex) { throw new NotImplementedException(); }
public bool IsReadOnly { get; } = false;
#endregion
}
}
Loading

0 comments on commit 1fba7c4

Please sign in to comment.