public DesignItem RegisterComponentForDesigner(object component, Type basetype = null) { if (component == null) { component = new NullExtension(); } else if (component is Type) { component = new TypeExtension((Type)component); } object baseobject = basetype != null && component.GetType() != basetype?CustomInstanceFactory.CreateObjectInstance(basetype, null) : null; XamlObject xamlobj = _context.Document.CreateObject(component, baseobject); XamlDesignItem item = new XamlDesignItem(xamlobj, _context); if (!(component is string)) { _sites.Add(component, item); } if (ComponentRegistered != null) { ComponentRegistered(this, new DesignItemEventArgs(item)); } return(item); }
public void TestCustomInstanceByType() { var factory = new CustomInstanceFactory(); var codec = factory.GetCodec("Lucene46"); assertNotNull(codec); assertEquals(typeof(CustomNamedCodec), codec.GetType()); }
public void TestCustomInstanceByName() { var factory = new CustomInstanceFactory(); var codec = factory.GetCodec("ThisIsATest"); assertNotNull(codec); assertEquals(typeof(NotIgnoredCodec), codec.GetType()); }
public void TestCustomInstanceByType() { var factory = new CustomInstanceFactory(); var DocValuesFormat = factory.GetDocValuesFormat("Lucene45"); assertNotNull(DocValuesFormat); assertEquals(typeof(CustomNamedDocValuesFormat), DocValuesFormat.GetType()); }
public void TestCustomInstanceByName() { var factory = new CustomInstanceFactory(); var DocValuesFormat = factory.GetDocValuesFormat("ThisIsATest"); assertNotNull(DocValuesFormat); assertEquals(typeof(NotIgnoredDocValuesFormat), DocValuesFormat.GetType()); }
public void TestCustomInstanceByType() { var factory = new CustomInstanceFactory(); var PostingsFormat = factory.GetPostingsFormat("Lucene40"); assertNotNull(PostingsFormat); assertEquals(typeof(CustomNamedPostingsFormat), PostingsFormat.GetType()); }
public void TestCustomInstanceByName() { var factory = new CustomInstanceFactory(); var PostingsFormat = factory.GetPostingsFormat("ThisIsATest"); assertNotNull(PostingsFormat); assertEquals(typeof(NotIgnoredPostingsFormat), PostingsFormat.GetType()); }