예제 #1
0
        public void Initialize(bool beforeFieldInit)
        {
            if (_initialized)
            {
                return;
            }
            _initialized = true;

            if (String.IsNullOrEmpty(Name))
            {
                ChoProfile.WriteLine("Missing Name");
                return;
            }

            using (ChoBufferProfile profile = ChoBufferProfile.DelayedAutoStart(new ChoBufferProfile(true, Name, "Loading property handler...")))
            {
                try
                {
                    _customPropertyReplaceHandler = new ChoCallbackObj(Type, Method).CreateDelegate <ChoCustomPropertyReplaceHandler>() as ChoCustomPropertyReplaceHandler;
                }
                catch (Exception ex)
                {
                    profile.AppendLine(String.Format("{0}: {1}", Name, ex.ToString()));
                }
            }
        }
예제 #2
0
        public ChoCustomPropertyReplacer(string name, ChoCustomPropertyReplaceHandler customPropertyReplaceHandler)
        {
            ChoGuard.ArgumentNotNull(name, "name");
            ChoGuard.ArgumentNotNull(customPropertyReplaceHandler, "CustomPropertyReplaceHandler");

            _name = name;
            _customPropertyReplaceHandler = customPropertyReplaceHandler;
        }
예제 #3
0
        public ChoCustomPropertyHandlerReplacer(string name, int priority, ChoCustomPropertyReplaceHandler customPropertyReplaceHandler)
        {
            ChoGuard.ArgumentNotNull(name, "name");
            ChoGuard.ArgumentNotNull(customPropertyReplaceHandler, "CustomPropertyReplaceHandler");

            Name     = name;
            Priority = priority;
            _customPropertyReplaceHandler = customPropertyReplaceHandler;
        }
예제 #4
0
 internal ChoCustomPropertyHandlerReplacer(ChoCustomPropertyReplaceHandler customPropertyReplaceHandler)
 {
     Name     = String.Format("CustomPropertyHandlerReplacer_{0}", ChoRandom.NextRandom().ToString());
     Priority = 0;
     _customPropertyReplaceHandler = customPropertyReplaceHandler;
 }
예제 #5
0
 public ChoCustomPropertyReplacer(ChoCustomPropertyReplaceHandler customPropertyReplaceHandler)
     : this(String.Format("CustomPropertyReplacer_{0}", ChoRandom.NextRandom().ToString()), customPropertyReplaceHandler)
 {
 }