wasabii / olinq Goto Github PK
View Code? Open in Web Editor NEWObservable Linq query implementation.
License: Other
Observable Linq query implementation.
License: Other
OLinq currently implements IDisposable from the View and Buffer down through the operation graph into any underlying sources to handle event unsubscriptions. This works if the lifetime of the View or Buffer is carefully managed. However, in most WPF applications, the lifetime of objects exposed from the ViewModel is not carefully managed. The window is just closed.
Consequently if event subscriptions are held to objects that are not scoped to the Window, these references will end up preventing the GC from disposing entire sets of instances and UI resources.
is there anything in OLinq like the ReactiveValue I've made up below?
class Obj : INotifyPropertyChanged
{
public Obj()
{
FullName = new ReactiveValue(this, () => this.FirstName + this.LastName); //watch these properties
}
public event PropertyChangedEventHandler PropertyChanged;
public string FirstName{...} //Notifies changes
public string LastName {...}//Notifies changes
public string FullName {get; private set;}
}
cheers!
I'm trying to get a collection that has items from list A that are not in list B. I tried a simple where/!contains, but it says ! is not supported.
Is there any way to do what I'm trying to do?
Good project but missing some linq methods and seems not updated anymore, Any alternatives to this project? All similar projects seems dead :(
Hello, does OLinq offer continuous aggregation like CLINQ?
I wrote a short script to see if it did, out but I was finding that re-executing queries re-enumerated the source, indicating that the results are not cached, so it looks to me like it doesn't, but it may have been a mistake on my part.
I'd love to use OLinq in my PCL project, is it possible to compile it as portable?
A LambdaContainer is effectively a Dictionary
, keyed by the source elements:
IEnumerable<TSource> source;
Dictionary<TSource, LambdaOperation<TResult>> lambdas =
new Dictionary<TSource, LambdaOperation<TResult>>();
When the source contains duplicate elements, they get merged into a single LambdaOperation, which has some undesireable consequences:
At the first glance it looks like simple reference counting would suffice, but I've discovered this issue while trying to make GroupBy notifications respect the ordering. That alone, in turn, requires knowing all of the source item indices, therefore a MultiMap-like solution would fit better.
If my vision of the situation is correct, I'll try fixing it as well :)
Hi,
it's been a while and now I'm finally stuck into absense of joins, and going to implement it. After having analysed revision history, it looks like ��it would be sufficient to:
Is it all?
I'm just starting to look at your library, but it seems really cool so far. Thank you!
Under .NET 4.0+ you don't seem to need the Rx-Interfaces reference at all (the IObservable / IObserver is part of the base framework). Would it be possible to remove it from the package dependencies when installing the OLinq NuGet package (and remove the reference from the main project?)
Hi I'm thinking about taking a fork to add INotifyPropertyChanged handling. Am I right in thinking basic support could be added by removing, then re-adding an item when one of it's properties change?
i tried from nuget and compile from latest source,
var collection = new ObservableCollection(){ 1, 2, 3 }; //an object implementing INo
var observableView = collection.AsObservableQuery().Where(i => i > 2).ToObservableView();
var observableBuffer = observableView.ToBuffer(); //an ObservableBuffer caches the result
AsObservableQuery() is just empty class, and if i use linq i get i cannot use ToObservableView()
When I try to remove item from original collection I'm getting exception:
"Collection Remove event must specify item position."
private ObservableCollection<int> oc = new ObservableCollection<int>();
private ObservableView<int> ov;
oc.Add(10);
oc.Add(20);
oc.Add(30);
ov = oc.AsObservableQuery().Where(i => i < 30).AsObservableQuery().ToObservableView();
oc.Remove(20);
Managed to get around with new methods:
public static void RaiseRemoveEvent<T>(Action<NotifyCollectionChangedEventArgs> raise, IEnumerable<T> oldItems, int oldIdx)
{
#if !SILVERLIGHT && !PCL
raise(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, oldItems.ToList(), oldIdx));
#else
foreach (var item in oldItems)
raise(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, item, oldIdx));
#endif
}
public static void RaiseRemoveEvent<T>(Action<NotifyCollectionChangedEventArgs> raise, T oldItem, int oldIdx)
{
#if !SILVERLIGHT && !PCL
raise(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, oldItem, oldIdx));
#else
raise(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, oldItem, oldIdx));
#endif
}
And in WhereOperation calling
NotifyCollectionChangedUtil.RaiseRemoveEvent(OnCollectionChanged, oldItems**, args.OldStartingIndex**);
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.