public bool Matches(Type type, ConverterLibrary converter)
        {
            if (type.IsArray && converter.CanBeParsed(type.GetElementType())) return true;


            return (type.IsGenericEnumerable() && converter.CanBeParsed(type.GetGenericArguments()[0]));
        }
예제 #2
0
        public void SetUp()
        {
            var locator = new InMemoryServiceLocator();

            locator.Add <WidgetFinderService>(new WidgetFinderService());

            var library = new ConverterLibrary(new IObjectConverterFamily[] { new WidgetFinderStrategy2() });

            finder = new ObjectConverter(locator, library);
        }
예제 #3
0
        public BindingRegistry(ConverterLibrary converters, IEnumerable <IModelBinder> binders, IEnumerable <IPropertyBinder> propertyBinders, IEnumerable <IConverterFamily> converterFamilies)
        {
            configureModelBinders(binders);
            configurePropertyBinders(propertyBinders);

            _families.AddRange(converterFamilies);

            Converters = converters;
            _defaultFamilies.Add(new BasicConverterFamily(Converters));
        }
예제 #4
0
        public void TestMethod1()
        {
            //Arrange
            var calc = new ConverterLibrary();
            // Act
            var result = calc.GetInt("42");

            //Assert
            Assert.AreEqual(42, result);
        }
예제 #5
0
        public BindingRegistry(ConverterLibrary converters, IEnumerable<IModelBinder> binders, IEnumerable<IPropertyBinder> propertyBinders, IEnumerable<IConverterFamily> converterFamilies)
        {
            configureModelBinders(binders);
            configurePropertyBinders(propertyBinders);

            _families.AddRange(converterFamilies);

            Converters = converters;
            _defaultFamilies.Add(new BasicConverterFamily(Converters));
        }
예제 #6
0
        public void SetUp()
        {
            var locator = new StubServiceLocator();

            locator.Services[typeof(WidgetFinderService)] = new WidgetFinderService();

            var library = new ConverterLibrary(new IObjectConverterFamily[] { new WidgetFinderStrategy() });

            finder = new ObjectConverter(locator, library);
        }
예제 #7
0
        public void TestGetInt(string target, int expected)
        {
            //Arrange
            ConverterLibrary lib = new ConverterLibrary();

            //Act
            var tmp = lib.GetInt(target);

            //Assert
            Assert.AreEqual(expected, tmp);
        }
 public bool Matches(Type type, ConverterLibrary converter)
 {
     try
     {
         return TypeDescriptor.GetConverter(type).CanConvertFrom(typeof (string));
     }
     catch (Exception)
     {
         return false;
     }
 }
        public ValueConverterRegistry(IEnumerable <IConverterFamily> families, ConverterLibrary library)
        {
            if (library == null)
            {
                throw new ArgumentNullException("library");
            }

            _families.AddRange(families);

            addPolicies();

            _families.Add(new BasicConverterFamily(library));
        }
예제 #10
0
        public void SetUp()
        {
            theLibrary = new ConverterLibrary();
            _registry = new ValueConverterRegistry(new IConverterFamily[0], theLibrary);
            _property = typeof (PropertyHolder).GetProperty("Property");
            _basicConverterFamily = _registry.Families.SingleOrDefault(cf =>
                                                                       cf.Matches(_property)) as BasicConverterFamily;
            _basicConverterFamily.ShouldNotBeNull();

            _context = MockRepository.GenerateMock<IPropertyContext>();
            _context.Stub(x => x.Property).Return(_property);
            _propertyValue = "some value";
            _context.Expect(c => c.PropertyValue).Return(_propertyValue).Repeat.Times(3);
        }
예제 #11
0
        public void can_register_and_use_a_service_for_the_conversion()
        {
            var locator = new StubServiceLocator();

            locator.Services[typeof(WidgetFinderService)] = new WidgetFinderService();

            var library = new ConverterLibrary();

            finder = new ObjectConverter(locator, library);

            library.RegisterConverter <Widget, WidgetFinderService>((service, text) => service.Build(text));

            finder.FromString <Widget>("red").ShouldBeOfType <Widget>().Color.ShouldEqual("red");
        }
예제 #12
0
        public void SetUp()
        {
            theLibrary            = new ConverterLibrary();
            _registry             = new ValueConverterRegistry(new IConverterFamily[0], theLibrary);
            _property             = typeof(PropertyHolder).GetProperty("Property");
            _basicConverterFamily = _registry.Families.SingleOrDefault(cf =>
                                                                       cf.Matches(_property)) as BasicConverterFamily;
            _basicConverterFamily.ShouldNotBeNull();

            _context = MockRepository.GenerateMock <IPropertyContext>();
            _context.Stub(x => x.Property).Return(_property);
            _propertyValue = "some value";
            _context.Expect(c => c.PropertyValue).Return(_propertyValue).Repeat.Times(3);
        }
        public static string PathPreConvertEvents(ConverterLibrary lib, string htmlPath, string cssPath, string jsPath, string outPath, string fileName)
        {
            if (string.IsNullOrWhiteSpace(htmlPath))
            {
                return("");
            }


            string html = "";
            string css  = "";
            string js   = "";

            using (StreamReader reader = new StreamReader(htmlPath))
            {
                String line = String.Empty;
                while ((line = reader.ReadLine()) != null)
                {
                    html += line;
                }
                reader.Close();
            }

            if (!string.IsNullOrWhiteSpace(cssPath))
            {
                using (StreamReader reader = new StreamReader(cssPath))
                {
                    String line = String.Empty;
                    while ((line = reader.ReadLine()) != null)
                    {
                        css += line;
                    }
                    reader.Close();
                }
            }

            if (!string.IsNullOrWhiteSpace(jsPath))
            {
                using (StreamReader reader = new StreamReader(jsPath))
                {
                    String line = String.Empty;
                    while ((line = reader.ReadLine()) != null)
                    {
                        js += line;
                    }
                }
            }

            return(HtmlCssToPdfConvert(lib, html, css: css, js: js, outPath: outPath, fileName: fileName));
        }
예제 #14
0
        public void SetUp()
        {
            theOriginalCulture = Thread.CurrentThread.CurrentCulture;

            Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");

            theLibrary = new ConverterLibrary();

            finder = new ObjectConverter(new StubServiceLocator(), theLibrary);

            // Determines which time zone id to use for the time_zone_info test, since
            // the value can differ based on platform the test is running on
            ReadOnlyCollection <TimeZoneInfo> timeZones = TimeZoneInfo.GetSystemTimeZones();

            timeZoneId = timeZones.Where(timeZone => timeZone.Id.Equals("Eastern Standard Time") || timeZone.Id.Equals("US/Eastern")).Single().Id;
        }
        public static string HtmlCssToPdfConvert(ConverterLibrary lib, string html, string css = "", string js = "", string outPath = "", string fileName = "")
        {
            string pdfLocation = getFullPath(outPath, fileName);

            if (string.IsNullOrWhiteSpace(html))
            {
                return("");
            }


            if (lib == ConverterLibrary.ITextSharp)
            {
                Convert cn = new Convert();

                if (string.IsNullOrWhiteSpace(css))
                {
                    cn.HtmlAndInlineLinkedCssToPdfConvert(html, pdfLocation);
                }

                cn.HtmlCssInDifferentDocToPdfConvert(html, css, pdfLocation);
            }
            else if (lib == ConverterLibrary.IronPDF)
            {
                if (!string.IsNullOrWhiteSpace(css))
                {
                    css   = (css.Contains("<style>")) ? (css) : ("<style>" + css + "</style>");
                    html += css;
                }

                if (!string.IsNullOrWhiteSpace(js))
                {
                    js    = (js.Contains("<script>")) ? (js) : ("<script>" + js + "</script>");
                    html += js;
                }

                ConvertWithIronPdf cipdf = new ConvertWithIronPdf();
                cipdf.ConvertPdf(html, pdfLocation);
            }
            else
            {
                return("Can't find library");
            }


            return(pdfLocation);
        }
예제 #16
0
        private void btnConvertFile_Click(object sender, EventArgs e)
        {
            string htmlPath = tbHtmlFile.Text;
            string cssPath  = tbCssFile.Text;
            string js       = tbJsFile.Text;

            string outPath  = tbOutPathFile.Text;
            string fileName = tbFileNameFile.Text;

            ConverterLibrary lib = (ConverterLibrary)Enum.Parse(typeof(ConverterLibrary), cbLibrary.Text, true);

            lbOut1.Text    = ConvertSelector.PathPreConvertEvents(lib, htmlPath, cssPath, js, outPath, fileName);
            lbOut1.Visible = true;

            bool download = cbOpen1.Checked;

            if (download)
            {
                Process.Start(lbOut1.Text);
            }
        }
예제 #17
0
        private void btnConvert_Click(object sender, EventArgs e)
        {
            string html = rtbHtml.Text;
            string css  = rtbCss.Text;
            string js   = rtbJs.Text;

            string outPath  = tbOutPath.Text;
            string fileName = tbFileName.Text;

            ConverterLibrary lib = (ConverterLibrary)Enum.Parse(typeof(ConverterLibrary), cbLibrary2.Text, true);

            lbOut2.Text    = ConvertSelector.HtmlCssToPdfConvert(lib, html, css, js, outPath, fileName);
            lbOut2.Visible = true;

            bool download = cbOpen2.Checked;

            if (download)
            {
                Process.Start(lbOut2.Text);
            }
        }
예제 #18
0
        public void SetUp()
        {
            inMemoryServiceLocator = new InMemoryServiceLocator();

            _binder = new EditEntityModelBinder(new NulloEntityDefaults());

            theGuid = Guid.NewGuid();

            theData            = new InMemoryRequestData();
            theData["BobName"] = "Ryan";
            theData["Flavor"]  = "choco";
            theData["Id"]      = theGuid.ToString();

            cl = new ConverterLibrary();

            oc = new ObjectConverter(inMemoryServiceLocator, cl);

            inMemoryServiceLocator.Add <IObjectConverter>(oc);

            inMemoryServiceLocator.Add <IObjectResolver>(ObjectResolver.Basic());
        }
        public void SetUp()
        {
            inMemoryServiceLocator = new InMemoryServiceLocator();

            _binder = new EditEntityModelBinder(new NulloEntityDefaults());

            theGuid = Guid.NewGuid();

            theData = new InMemoryRequestData();
            theData["BobName"] = "Ryan";
            theData["Flavor"] = "choco";
            theData["Id"] = theGuid.ToString();

            cl = new ConverterLibrary();

            oc = new ObjectConverter(inMemoryServiceLocator, cl);

            inMemoryServiceLocator.Add<IObjectConverter>(oc);

            inMemoryServiceLocator.Add<IObjectResolver>(ObjectResolver.Basic());
        }
예제 #20
0
        public void register_and_retrieve_a_new_type_of_complex_object()
        {
            var library = new ConverterLibrary();

            library.RegisterConverter <Contact>(text =>
            {
                var parts = text.Split(' ');
                return(new Contact()
                {
                    FirstName = parts[0],
                    LastName = parts[1]
                });
            });



            var finder = new ObjectConverter(null, library);

            var c = finder.FromString <Contact>("Jeremy Miller");

            c.FirstName.ShouldEqual("Jeremy");
            c.LastName.ShouldEqual("Miller");
        }
예제 #21
0
        public void how_about_getting_an_array_of_those_complex_objects()
        {
            // Same converter as before
            var library = new ConverterLibrary();
            var finder  = new ObjectConverter(null, library);

            library.RegisterConverter <Contact>(text =>
            {
                var parts = text.Split(' ');
                return(new Contact()
                {
                    FirstName = parts[0],
                    LastName = parts[1]
                });
            });

            // Now, let's pull an array of Contact's
            var contacts =
                finder.FromString <Contact[]>("Jeremy Miller, Rod Paddock, Chad Myers");

            contacts.Select(x => x.LastName)
            .ShouldHaveTheSameElementsAs("Miller", "Paddock", "Myers");
        }
예제 #22
0
        public void can_register_and_use_a_service_for_the_conversion()
        {
            var locator = new StubServiceLocator();
            locator.Services[typeof(WidgetFinderService)] = new WidgetFinderService();

            var library = new ConverterLibrary();

            finder = new ObjectConverter(locator, library);

            library.RegisterConverter<Widget, WidgetFinderService>((service, text) => service.Build(text));

            finder.FromString<Widget>("red").ShouldBeOfType<Widget>().Color.ShouldEqual("red");
        }
예제 #23
0
        public void SetUp()
        {
            theOriginalCulture = Thread.CurrentThread.CurrentCulture;

            Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");

            theLibrary = new ConverterLibrary();

            finder = new ObjectConverter(new StubServiceLocator(), theLibrary);

            // Determines which time zone id to use for the time_zone_info test, since
            // the value can differ based on platform the test is running on
            ReadOnlyCollection<TimeZoneInfo> timeZones = TimeZoneInfo.GetSystemTimeZones();
            timeZoneId = timeZones.Where(timeZone => timeZone.Id.Equals("Eastern Standard Time") || timeZone.Id.Equals("US/Eastern")).Single().Id;
        }
예제 #24
0
        public void register_and_retrieve_a_new_type_of_complex_object()
        {
            var library = new ConverterLibrary();
            library.RegisterConverter<Contact>(text =>
            {
                var parts = text.Split(' ');
                return new Contact(){
                    FirstName = parts[0],
                    LastName = parts[1]
                };
            });

            var finder = new ObjectConverter(null, library);

            var c = finder.FromString<Contact>("Jeremy Miller");

            c.FirstName.ShouldEqual("Jeremy");
            c.LastName.ShouldEqual("Miller");
        }
예제 #25
0
 public bool Matches(Type type, ConverterLibrary converter)
 {
     return AwesomeConfiguration.AwesomeEntities(type);
 }
 public bool Matches(Type type, ConverterLibrary converter)
 {
     return type.IsNullable();
 }
예제 #27
0
        public void SetUp()
        {
            theFubuRequest = new InMemoryFubuRequest();
            theData = new InMemoryRequestData();

            theConverterLibrary = new ConverterLibrary();
            objectConverter = new ObjectConverter(null, theConverterLibrary);
            theRequest = new FubuSmartRequest(theData, objectConverter, theFubuRequest);
        }
예제 #28
0
 public abstract bool Matches(Type type, ConverterLibrary converter);
예제 #29
0
    public void SetSliders()
    {
        if (DisplayUI)
        {
                        #if UNITY_EDITOR
            Selection.activeGameObject = null;
            Selection.activeObject     = null;
                        #endif

            umaData = null;
            umaDna  = null;
            tempUMA = null;
            if (UI == null)
            {
                UI = GameObject.Find("UMA UI");
                if (UI == null)
                {
                    UI = new GameObject();
                    GameObject DKUMACustomization = GameObject.Find("DKUMACustomization");
                    UI.transform.parent = DKUMACustomization.transform;
                    UI.name             = "UMA UI";
                }
            }
            if (Editor_Global.VersionW >= 1 && Editor_Global.VersionX >= 1 && Editor_Global.VersionY >= 0 && Editor_Global.VersionZ >= 0)
            {
                //Changed slider order
                GameObject       DNALibraries     = GameObject.Find("DNALibraries");
                ConverterLibrary ConverterLibrary = DNALibraries.GetComponent <ConverterLibrary>();

                // Face
                int Lines = 0;
                if (Type != null)
                {
                    for (int i = 0; i < ConverterLibrary.ConverterList.Count; i++)
                    {
                        if (i == 0)
                        {
                            _Index = 0;
                            Lines  = 1;
                        }
                        if (_Index >= 2 && Lines == 1)
                        {
                            _Index = 0;
                            Lines  = 2;
                        }
                        if (_Index >= 2 && Lines == 2)
                        {
                            _Index = 0;
                            Lines  = 3;
                        }
                        if (_Index >= 2 && Lines == 3)
                        {
                            _Index = 0;
                            Lines  = 4;
                        }
                        if (_Index >= 2 && Lines == 4)
                        {
                            _Index = 0;
                            Lines  = 5;
                        }
                        if (_Index >= 2 && Lines == 5)
                        {
                            _Index = 0;
                            Lines  = 6;
                        }
                        if (_Index >= 2 && Lines == 6)
                        {
                            _Index = 0;
                            Lines  = 7;
                        }
                        if (_Index >= 2 && Lines == 7)
                        {
                            _Index = 0;
                            Lines  = 8;
                        }
                        if (_Index >= 2 && Lines == 8)
                        {
                            _Index = 0;
                            Lines  = 9;
                        }
                        if (_Index >= 2 && Lines == 9)
                        {
                            _Index = 0;
                            Lines  = 10;
                        }
                        if (ConverterLibrary.ConverterList[i].Part == Type)
                        {
                            //	Debug.Log ( _Index.ToString()+" "+ ConverterLibrary.ConverterList[i].Name);
                            _Index = _Index + 1;
                            try{
                                if (Lines == 1)
                                {
                                    sliderList.Add(InstantiateSlider2(ConverterLibrary.ConverterList[i].Name, _Index, 0, ConverterLibrary.ConverterList[i].Part));
                                }
                                if (Lines == 2)
                                {
                                    sliderList.Add(InstantiateSlider2(ConverterLibrary.ConverterList[i].Name, _Index, 1, ConverterLibrary.ConverterList[i].Part));
                                }
                                if (Lines == 3)
                                {
                                    sliderList.Add(InstantiateSlider2(ConverterLibrary.ConverterList[i].Name, _Index, 2, ConverterLibrary.ConverterList[i].Part));
                                }
                                if (Lines == 4)
                                {
                                    sliderList.Add(InstantiateSlider2(ConverterLibrary.ConverterList[i].Name, _Index, 3, ConverterLibrary.ConverterList[i].Part));
                                }
                                if (Lines == 5)
                                {
                                    sliderList.Add(InstantiateSlider2(ConverterLibrary.ConverterList[i].Name, _Index, 4, ConverterLibrary.ConverterList[i].Part));
                                }
                                if (Lines == 6)
                                {
                                    sliderList.Add(InstantiateSlider2(ConverterLibrary.ConverterList[i].Name, _Index, 5, ConverterLibrary.ConverterList[i].Part));
                                }
                                if (Lines == 7)
                                {
                                    sliderList.Add(InstantiateSlider2(ConverterLibrary.ConverterList[i].Name, _Index, 6, ConverterLibrary.ConverterList[i].Part));
                                }
                                if (Lines == 8)
                                {
                                    sliderList.Add(InstantiateSlider2(ConverterLibrary.ConverterList[i].Name, _Index, 7, ConverterLibrary.ConverterList[i].Part));
                                }
                                if (Lines == 9)
                                {
                                    sliderList.Add(InstantiateSlider2(ConverterLibrary.ConverterList[i].Name, _Index, 8, ConverterLibrary.ConverterList[i].Part));
                                }
                                if (Lines == 10)
                                {
                                    sliderList.Add(InstantiateSlider2(ConverterLibrary.ConverterList[i].Name, _Index, 9, ConverterLibrary.ConverterList[i].Part));
                                }
                                //	sliderList.Add(InstantiateSlider2(ConverterLibrary.ConverterList[i].Name,_Index,2,ConverterLibrary.ConverterList[i].Part));
                            }catch (NullReferenceException) {}
                        }
                    }
                }
                else
                {
                    // General
                    for (int i = 0; i < ConverterLibrary.ConverterList.Count; i++)
                    {
                        if (i == 0)
                        {
                            _Index = 0;
                        }
                        if (ConverterLibrary.ConverterList[i].Part == "")
                        {
                            //	Debug.Log ( _Index.ToString()+" "+ ConverterLibrary.ConverterList[i].Name);
                            _Index = _Index + 1;
                            try{
                                sliderList.Add(InstantiateSlider2(ConverterLibrary.ConverterList[i].Name, _Index, 0, ConverterLibrary.ConverterList[i].Part));
                                //	this.sliderList.Add(InstantiateSlider2(ConverterLibrary.ConverterList[i].Name,_Index,0,ConverterLibrary.ConverterList[i].Part));
                            }catch (NullReferenceException) {}
                        }
                    }

                    // Head
                    for (int i = 0; i < ConverterLibrary.ConverterList.Count; i++)
                    {
                        if (i == 0)
                        {
                            _Index = 0;
                        }
                        if (ConverterLibrary.ConverterList[i].Part == "Head")
                        {
                            //	Debug.Log ( _Index.ToString()+" "+ ConverterLibrary.ConverterList[i].Name);
                            _Index = _Index + 1;
                            try{
                                sliderList.Add(InstantiateSlider2(ConverterLibrary.ConverterList[i].Name, _Index, 1, ConverterLibrary.ConverterList[i].Part));
                                //	sliderList.Add(InstantiateSlider2(ConverterLibrary.ConverterList[i].Name,_Index,1,ConverterLibrary.ConverterList[i].Part));
                            }catch (NullReferenceException) {}
                        }
                    }
                    // Face
                    int Lines2 = 0;
                    for (int i = 0; i < ConverterLibrary.ConverterList.Count; i++)
                    {
                        if (i == 0)
                        {
                            _Index = 0;
                            Lines2 = 1;
                        }
                        if (_Index >= 7 && Lines2 == 1)
                        {
                            _Index = 0;
                            Lines2 = 2;
                        }
                        if (_Index >= 7 && Lines == 2)
                        {
                            _Index = 0;
                            Lines2 = 3;
                        }
                        if (_Index >= 7 && Lines == 3)
                        {
                            _Index = 0;
                            Lines2 = 4;
                        }
                        if (ConverterLibrary.ConverterList[i].Part == "Face")
                        {
                            //	Debug.Log ( _Index.ToString()+" "+ ConverterLibrary.ConverterList[i].Name);
                            _Index = _Index + 1;
                            try{
                                if (Lines2 == 1)
                                {
                                    sliderList.Add(InstantiateSlider2(ConverterLibrary.ConverterList[i].Name, _Index, 2, ConverterLibrary.ConverterList[i].Part));
                                }
                                if (Lines2 == 2)
                                {
                                    sliderList.Add(InstantiateSlider2(ConverterLibrary.ConverterList[i].Name, _Index, 3, ConverterLibrary.ConverterList[i].Part));
                                }

                                //	sliderList.Add(InstantiateSlider2(ConverterLibrary.ConverterList[i].Name,_Index,2,ConverterLibrary.ConverterList[i].Part));
                            }catch (NullReferenceException) {}
                        }
                    }
                    // Arms
                    for (int i = 0; i < ConverterLibrary.ConverterList.Count; i++)
                    {
                        if (i == 0)
                        {
                            _Index = 0;
                        }
                        if (ConverterLibrary.ConverterList[i].Part == "Arms")
                        {
                            //	Debug.Log ( _Index.ToString()+" "+ ConverterLibrary.ConverterList[i].Name);
                            _Index = _Index + 1;
                            try{
                                sliderList.Add(InstantiateSlider2(ConverterLibrary.ConverterList[i].Name, _Index, 4, ConverterLibrary.ConverterList[i].Part));
                                //	sliderList.Add(InstantiateSlider2(ConverterLibrary.ConverterList[i].Name,_Index,3,ConverterLibrary.ConverterList[i].Part));
                            }catch (NullReferenceException) {}
                        }
                    }
                    // Torso
                    for (int i = 0; i < ConverterLibrary.ConverterList.Count; i++)
                    {
                        if (i == 0)
                        {
                            _Index = 0;
                        }
                        if (ConverterLibrary.ConverterList[i].Part == "Torso")
                        {
                            //	Debug.Log ( _Index.ToString()+" "+ ConverterLibrary.ConverterList[i].Name);
                            _Index = _Index + 1;
                            try{
                                sliderList.Add(InstantiateSlider2(ConverterLibrary.ConverterList[i].Name, _Index, 5, ConverterLibrary.ConverterList[i].Part));
                                //	sliderList.Add(InstantiateSlider2(ConverterLibrary.ConverterList[i].Name,_Index,4,ConverterLibrary.ConverterList[i].Part));
                            }catch (NullReferenceException) {}
                        }
                    }
                    // Legs
                    for (int i = 0; i < ConverterLibrary.ConverterList.Count; i++)
                    {
                        if (i == 0)
                        {
                            _Index = 0;
                        }
                        if (ConverterLibrary.ConverterList[i].Part == "Legs")
                        {
                            //	Debug.Log ( _Index.ToString()+" "+ ConverterLibrary.ConverterList[i].Name);
                            _Index = _Index + 1;
                            try{
                                sliderList.Add(InstantiateSlider2(ConverterLibrary.ConverterList[i].Name, _Index, 6, ConverterLibrary.ConverterList[i].Part));
                                //	sliderList.Add(InstantiateSlider2(ConverterLibrary.ConverterList[i].Name,_Index,5,ConverterLibrary.ConverterList[i].Part));
                            }catch (NullReferenceException) {}
                        }
                    }
                }
            }
            else
            {
                sliderControlList = new SliderControl[46];
                //Changed slider order

                sliderControlList[0]  = InstantiateSlider("height", 0, 0);
                sliderControlList[1]  = InstantiateSlider("headSize", 1, 0);
                sliderControlList[43] = InstantiateSlider("headWidth", 2, 0);
                sliderControlList[32] = InstantiateSlider("forehead size", 3, 0);
                sliderControlList[33] = InstantiateSlider("forehead position", 4, 0);

                sliderControlList[12] = InstantiateSlider("ears size", 0, 1);
                sliderControlList[13] = InstantiateSlider("ears position", 1, 1);
                sliderControlList[14] = InstantiateSlider("ears rotation", 2, 1);

                sliderControlList[28] = InstantiateSlider("cheek size", 0, 2);
                sliderControlList[29] = InstantiateSlider("cheek position", 1, 2);
                sliderControlList[30] = InstantiateSlider("lowCheek pronounced", 2, 2);
                sliderControlList[31] = InstantiateSlider("lowCheek position", 3, 2);

                sliderControlList[15] = InstantiateSlider("nose size", 0, 3);
                sliderControlList[16] = InstantiateSlider("nose curve", 1, 3);
                sliderControlList[17] = InstantiateSlider("nose width", 2, 3);

                sliderControlList[18] = InstantiateSlider("nose inclination", 0, 4);
                sliderControlList[19] = InstantiateSlider("nose position", 1, 4);
                sliderControlList[20] = InstantiateSlider("nose pronounced", 2, 4);
                sliderControlList[21] = InstantiateSlider("nose flatten", 3, 4);

                sliderControlList[44] = InstantiateSlider("eye Size", 0, 5);
                sliderControlList[45] = InstantiateSlider("eye Rotation", 1, 5);
                sliderControlList[34] = InstantiateSlider("lips size", 2, 5);
                sliderControlList[35] = InstantiateSlider("mouth size", 3, 5);
                sliderControlList[25] = InstantiateSlider("mandible size", 4, 5);

                sliderControlList[26] = InstantiateSlider("jaw Size", 0, 6);
                sliderControlList[27] = InstantiateSlider("jaw Position", 1, 6);
                sliderControlList[2]  = InstantiateSlider("neck", 2, 6);

                sliderControlList[22] = InstantiateSlider("chinSize", 0, 7);
                sliderControlList[23] = InstantiateSlider("chinPronounced", 1, 7);
                sliderControlList[24] = InstantiateSlider("chinPosition", 2, 7);

                sliderControlList[7]  = InstantiateSlider("upper muscle", 0, 8);
                sliderControlList[8]  = InstantiateSlider("lower muscle", 1, 8);
                sliderControlList[9]  = InstantiateSlider("upper weight", 2, 8);
                sliderControlList[10] = InstantiateSlider("lower weight", 3, 8);

                sliderControlList[3]  = InstantiateSlider("arm Length", 0, 9);
                sliderControlList[38] = InstantiateSlider("arm Width", 1, 9);
                sliderControlList[39] = InstantiateSlider("forearm Length", 2, 9);
                sliderControlList[40] = InstantiateSlider("forearm Width", 3, 9);
                sliderControlList[4]  = InstantiateSlider("hands Size", 4, 9);

                sliderControlList[5]  = InstantiateSlider("feet Size", 0, 10);
                sliderControlList[6]  = InstantiateSlider("leg Separation", 1, 10);
                sliderControlList[11] = InstantiateSlider("legsSize", 2, 10);
                sliderControlList[37] = InstantiateSlider("Gluteus Size", 3, 10);

                sliderControlList[36] = InstantiateSlider("breatsSize", 0, 11);
                sliderControlList[41] = InstantiateSlider("belly", 1, 11);
                sliderControlList[42] = InstantiateSlider("waist", 2, 11);
            }
        }
    }
 public bool Matches(Type type, ConverterLibrary converter)
 {
     return type.IsEnum;
 }
 // Matches any type deriving from DomainEntity
 // CanBeCastTo<> is an extension method in FubuCore as well
 public bool Matches(Type type, ConverterLibrary converter)
 {
     return type.CanBeCastTo<DomainEntity>() && !type.HasAttribute<IgnoreEntityInBindingAttribute>();
 }
예제 #32
0
 public override bool Matches(Type type, ConverterLibrary converter)
 {
     return(type == typeof(Widget));
 }
예제 #33
0
        public void SetUp()
        {
            var locator = new StubServiceLocator();
            locator.Services[typeof (WidgetFinderService)] = new WidgetFinderService();

            var library = new ConverterLibrary(new IObjectConverterFamily[]{new WidgetFinderStrategy()});

            finder = new ObjectConverter(locator, library);
        }
예제 #34
0
 public override bool Matches(Type type, ConverterLibrary converter)
 {
     return type == typeof (Widget);
 }
예제 #35
0
 public void SetUp()
 {
     theData = new InMemoryRequestData();
     theLibrary = new ConverterLibrary();
     objectConverter = new ObjectConverter(new InMemoryServiceLocator(), theLibrary);
     theRequest = new SmartRequest(theData, objectConverter);
 }
        public void SetUp()
        {
            theLibrary = new ConverterLibrary();

            theDescription = Description.For(theLibrary);
            theFamilyList = theDescription.BulletLists.Single();
        }
예제 #37
0
 // Matches any type deriving from DomainEntity
 // CanBeCastTo<> is an extension method in FubuCore as well
 public bool Matches(Type type, ConverterLibrary converter)
 {
     return(type.CanBeCastTo <DomainEntity>() && !type.HasAttribute <IgnoreEntityInBindingAttribute>());
 }
        public void SetUp()
        {
            theLibrary = new ConverterLibrary();
            var basicConverterFamily = new BasicConverterFamily(theLibrary);

            theDescription = Description.For(basicConverterFamily);

            // Just lifts the Family list right off of ConverterLibrary
            theFamilyList = theDescription.BulletLists.Single();
        }
예제 #39
0
 public bool Matches(Type type, ConverterLibrary converter)
 {
     return(AwesomeConfiguration.AwesomeEntities(type));
 }
예제 #40
0
 public ArrayPropertyBinder(ConverterLibrary library)
 {
     _library = library;
 }
예제 #41
0
        public void how_about_getting_an_array_of_those_complex_objects()
        {
            // Same converter as before
            var library = new ConverterLibrary();
            var finder = new ObjectConverter(null, library);
            library.RegisterConverter<Contact>(text =>
            {
                var parts = text.Split(' ');
                return new Contact()
                {
                    FirstName = parts[0],
                    LastName = parts[1]
                };
            });

            // Now, let's pull an array of Contact's
            var contacts =
                finder.FromString<Contact[]>("Jeremy Miller, Rod Paddock, Chad Myers");

            contacts.Select(x => x.LastName)
                .ShouldHaveTheSameElementsAs("Miller", "Paddock", "Myers");
        }