-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1,619 changed files
with
251,608 additions
and
24,471 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
using System; | ||
|
||
namespace CCore | ||
{ | ||
public class Class1 | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); } | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
Oops, something went wrong.