Giter Club home page Giter Club logo

Comments (8)

force-net avatar force-net commented on July 19, 2024 3

Not implemented yet. Sorry, I have no time to do this in nearest time. It not simple because code tries to clone object itself in one step (if possible), for this case I need some more analyzing to find best way to copy and test it. Also, before implementing I should check, whereas real problem exists.
I'll to to implement this asap, but cannot give any estimations about time.
Sorry

from deepcloner.

force-net avatar force-net commented on July 19, 2024

Currently, there is no such ability. I've received another similar issues and will try to implement related feature.

from deepcloner.

FutureTD avatar FutureTD commented on July 19, 2024

Has this been implemented yet? This is a great library but this causes problems if a object implements INotifyPropertyChanged.

Maybe you can hard code it to not clone that property for the time being.

from deepcloner.

luislhg avatar luislhg commented on July 19, 2024

Same issue here... When using INotifyPropertyChanged it becomes a problem that it copies the events. I was using MemberwiseClone before and had the same issue... Hoping for this to be configurable anytime soon. Thanks!

from deepcloner.

maskalek avatar maskalek commented on July 19, 2024

Any hacks? How to override behavior?

from deepcloner.

force-net avatar force-net commented on July 19, 2024

I have ideas, but do not have enough time to fix it. You can try to do something like

var assembly = Assembly.GetAssembly(typeof(DeepClonerExtensions));
var deepClonerSafeTypes = assembly.GetType("Force.DeepCloner.Helpers.DeepClonerSafeTypes");
var knownTypesField = deepClonerSafeTypes.GetField("KnownTypes", BindingFlags.Static | BindingFlags.NonPublic);
var knownTypes = (ConcurrentDictionary<Type, bool>)knownTypesField.GetValue(null);
knownTypes.TryAdd(typeof(type_to_ignore), true);

It's dirty hack, and it will not work in future versions, but I'll try to do something with this feature in future versions :)

from deepcloner.

GF-Huang avatar GF-Huang commented on July 19, 2024

Any progress?

from deepcloner.

sgf avatar sgf commented on July 19, 2024

A feasible method may be to add a generic overload to DeepClone DeepClone(params Expression<T,TFieldName>[] ignoreExps)
or
DeepClone(params string[] ignoreExps)
Get the field names, attribute names, etc. that need to be ignored through ignoreExp.

from deepcloner.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.