Пример #1
0
        public void TrackEvent(
            EventData eventData,
            List <CustomDimension> customDimensions,
            List <CustomMetric> customMetrics
            )
        {
            var builder = DictionaryBuilder.CreateEvent(
                eventData.EventCategory,
                eventData.EventAction,
                !string.IsNullOrWhiteSpace(eventData.EventLabel) ? eventData.EventLabel : string.Empty,
                new NSNumber(eventData.Id)
                );

            if (customDimensions?.Count > 0)
            {
                foreach (var customDimension in customDimensions)
                {
                    builder.Set(customDimension.DimensionValue, Fields.CustomDimension((nuint)customDimension.DimensionIndex));
                }
            }

            if (customMetrics?.Count > 0)
            {
                foreach (var customMetric in customMetrics)
                {
                    builder.Set(Convert.ToString(customMetric.MetricValue), Fields.CustomMetric((nuint)customMetric.MetricIndex));
                }
            }


            analyticsTracker.Send(builder.Build());
        }
            public Configuration(CommandLineOptions options)
            {
                this.Main = (args) => DictionaryBuilder.Main(args);

                this.Name             = "kuromoji-build-dictionary";
                this.Description      = FromResource("Description");
                this.ExtendedHelpText = FromResource("ExtendedHelpText");

                this.Format = this.Argument(
                    "<FORMAT>",
                    FromResource("FormatDescription"));
                this.InputDirectory = this.Argument(
                    "<INPUT_DIRECTORY>",
                    FromResource("InputDirectoryDescription"));
                this.OutputDirectory = this.Argument(
                    "<OUTPUT_DIRECTORY>",
                    FromResource("OutputDirectoryDescription"));
                this.InputDirectoryEncoding = this.Option(
                    "-e|--encoding <ENCODING>",
                    FromResource("InputDirectoryEncodingDescription"),
                    CommandOptionType.SingleValue);
                this.Normalize = this.Option(
                    "-n|--normalize",
                    FromResource("NormalizeDescription"),
                    CommandOptionType.NoValue);

                this.OnExecute(() => new AnalysisKuromojiBuildDictionaryCommand().Run(this));
            }
        public async Task <IClientCredentialAuthenticationResult> Validate(
            AuthenticationGrantTypeGoogle authenticationGrantTypeGoogle,
            ValidateClientCredentialAdto validateClientCredentialAdto)
        {
            try
            {
                GoogleAccessTokenResponse appAccessTokenResponse = await _httpJson.PostAsync <GoogleAccessTokenResponse>(
                    new Uri(authenticationGrantTypeGoogle.GrantAccessTokenUrl.Format(
                                DictionaryBuilder <string, object> .Create()
                                .Add("clientId", authenticationGrantTypeGoogle.ClientId)
                                .Add("clientSecret", authenticationGrantTypeGoogle.ClientSecret)
                                .Add("redirectUri", validateClientCredentialAdto.RedirectUri)
                                .Add("code", validateClientCredentialAdto.Token)
                                .Build()
                                )), _jsonSerializerSettings
                    );

                ValidateAccessTokenResponse validateAccessTokenResponse = await _httpJson.GetAsync <ValidateAccessTokenResponse>(new Uri(
                                                                                                                                     authenticationGrantTypeGoogle.ValidateAccessTokenUrl.Format(
                                                                                                                                         DictionaryBuilder <string, object> .Create()
                                                                                                                                         .Add("accessToken", appAccessTokenResponse.AccessToken)
                                                                                                                                         .Build()
                                                                                                                                         )), _jsonSerializerSettings);

                return(ClientCredentialAuthenticationResult.Succeed(validateAccessTokenResponse.Id));
            }
            catch (BadRequestException)
            {
                return(ClientCredentialAuthenticationResult.Fail);
            }
            catch (ServiceUnavailableExcpetion)
            {
                return(ClientCredentialAuthenticationResult.Fail);
            }
        }
        public void TrackEvent(string category, string eventName, string label = null)
        {
            var dict = DictionaryBuilder.CreateEvent(category, eventName, label, null).Build();

            _tracker.Send(dict);
            Gai.SharedInstance.Dispatch();
        }
        private bool CheckIfCommPossibleWithPCS(string ipaddress)
        {
            MW.Communication          = new CommunicationUDP(this, checkboxEoeRw);
            MW.SelectedDevice         = 0;
            MW.ChooseComm.DataContext = MW.Communication;
            MW.Communication.AsyncRead(1, 0x1018, 0x01);

            Stopwatch sw = new Stopwatch();

            sw.Start();
            while (MW.ObjectDictionary.dictOfCoE[DictionaryBuilder.MakeKey(0x1018, 0x01)].Value == null)
            {
                if (sw.ElapsedMilliseconds > 5000)
                {
                    throw new TimeoutException("A timeout occured. No UDP connection was achieved.");
                }
            }

            if ((uint)MW.ObjectDictionary.GetItem(0x1018, 0x01).Value == 0x29)    /* Intec Motor */
            {
                dataGridDevices.ItemsSource   = MW.Communication.Devices;
                dataGridDevices.SelectedIndex = 0;

                MW.MyTimer1.Start();

                return(true);
            }

            return(false);
        }
        public async Task <IDictionary <Type, Guid> > WhoAmIAsync()
        {
            using (ITransaction transaction = _transactionManager.Create())
            {
                if (!_currentIdentityProvider.IsAuthenticated)
                {
                    return(new Dictionary <Type, Guid>());
                }

                Identity identity = await _identityQueryRepository.GetByIdAsync(_currentIdentityProvider.Id);

                if (identity == null || identity.Session.IsRevoked)
                {
                    throw new BusinessApplicationException(ExceptionType.Unauthorized, "Current identity token is not valid");
                }

                DictionaryBuilder <Type, Guid> whoAmI = DictionaryBuilder <Type, Guid> .Create();

                whoAmI.Add(typeof(Identity), identity.Id);

                if (_currentUserProvider.Id.HasValue)
                {
                    User user = await _userQueryRepository.GetByIdAsync(_currentUserProvider.Id.Value);

                    if (user != null)
                    {
                        whoAmI.Add(typeof(User), user.Id);
                    }
                }

                transaction.Commit();

                return(whoAmI.Build());
            }
        }
Пример #7
0
        /// <summary>
        /// 返回指定类型的对象,其值等效于指定字符串对象。
        /// </summary>
        /// <param name="context"> </param>
        /// <param name="input"> 需要转换类型的字符串对象 </param>
        /// <param name="outputType"> 换转后的类型 </param>
        /// <param name="success"> 是否成功 </param>
        protected override IDictionary <K, V> ChangeType(ConvertContext context, string input, Type outputType,
                                                         out bool success)
        {
            input = input?.Trim() ?? "";
            if (input.Length == 0)
            {
                var keyConvertor   = context.Get <K>();
                var valueConvertor = context.Get <V>();

                var builder = new DictionaryBuilder(context, outputType, keyConvertor, valueConvertor);
                // ReSharper disable once AssignmentInConditionalExpression
                return((success = builder.TryCreateInstance()) ? builder.Instance : null);
            }
            if (input?.Length > 2)
            {
                if ((input[0] == '{') && (input[input.Length - 1] == '}'))
                {
                    try
                    {
                        var result = ComponentServices.ToJsonObject(outputType, input);
                        success = true;
                        return((IDictionary <K, V>)result);
                    }
                    catch (Exception ex)
                    {
                        context.AddException(ex);
                    }
                }
            }
            success = false;
            return(null);
        }
        public void BuildDictionaryTest()
        {
            var reference = new Dictionary <string, long>()
            {
                { "w3", 3 },
                { "w2", 2 },
                { "w1", 1 },
            };

            var mockReader = new Mock <IInputReader>();
            var mockWriter = new Mock <IOutputWriter>();

            mockReader.Setup(r => r.ReadSource(null)).Returns(() => new List <string>()
            {
                "W1", "w2", "W2", "W3", "w3", "W3"
            });
            var builder = new DictionaryBuilder(mockReader.Object, mockWriter.Object);
            var data    = builder.BuildDictionary(null);

            Assert.IsTrue(reference.Count == data.Count);
            var refKeys    = reference.Keys.ToArray();
            var refValues  = reference.Values.ToArray();
            var dataKeys   = data.Keys.ToArray();
            var dataValues = data.Values.ToArray();

            for (int i = 0; i < reference.Count; i++)
            {
                Assert.IsTrue(string.Equals(dataKeys[i], refKeys[i]));
                Assert.IsTrue(dataValues[i] == refValues[i]);
            }
        }
Пример #9
0
 public void TrackException(
     string ExceptionMessage,
     bool isFatalException
     )
 {
     analyticsTracker.Send(DictionaryBuilder.CreateException(ExceptionMessage, isFatalException).Build());
 }
Пример #10
0
        public void Contains_returns()
        {
            var sut = DictionaryBuilder <int, string> .Create(Setup());

            Assert.True(sut.Contains(new KeyValuePair <int, string>(4, "D")));
            Assert.False(sut.Contains(new KeyValuePair <int, string>(5, "D")));
        }
Пример #11
0
        public void TrackEvent(string category, string eventName, Boolean online)
        {
            string action = (online ? "" : OFFLINE) + " - " + eventName;

            Gai.SharedInstance.DefaultTracker.Set(GaiConstants.Event, action);
            Gai.SharedInstance.DefaultTracker.Send(DictionaryBuilder.CreateEvent(category, action, null, null).Build());
        }
Пример #12
0
        public override void ViewDidAppear(bool animated)
        {
            base.ViewDidAppear(animated);

            // This screen name value will remain set on the tracker and sent with
            // hits until it is set to a new value or to null.
            Gai.SharedInstance.DefaultTracker.Set(GaiConstants.ScreenName, "View Controller");

            Gai.SharedInstance.DefaultTracker.Send(DictionaryBuilder.CreateAppView().Build());

            var bundle = Foundation.NSBundle.MainBundle;
            //var resource = bundle.PathForResource("splashipad", "mp4");


            //May need to comment... experimenting with performance cost of loading video
            var fileName = (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad)? "globalairphone" : "globalairtablet";

            var resource = bundle.PathForResource(fileName, "mov");

//// set the video
            VideoUrl = new Foundation.NSUrl(resource, false);

            FillMode = ScalingMode.ResizeAspectFill;


            this.PerformSegue("loginSegue", this);
        }
Пример #13
0
        public void ContainsKey_returns()
        {
            var sut = DictionaryBuilder <int, string> .Create(Setup());

            Assert.True(sut.ContainsKey(4));
            Assert.False(sut.ContainsKey(6));
        }
        public void TrackPage(string pageName)
        {
            _tracker.Set(GaiConstants.ScreenName, pageName);
            var dict = DictionaryBuilder.CreateScreenView().Build();

            _tracker.Send(dict);
        }
Пример #15
0
        public void TrackException(string message, bool fatal)
        {
            SetUserId();
            var dict = DictionaryBuilder.CreateException(message, fatal).Build();

            _tracker.Send(dict);
        }
        public override void ViewDidAppear(bool animated)
        {
            base.ViewDidAppear(animated);

            View.AddGestureRecognizer(HideKeyboardGesture);

// This screen name value will remain set on the tracker and sent with
// hits until it is set to a new value or to null.
            Gai.SharedInstance.DefaultTracker.Set(GaiConstants.ScreenName, "EmailEnquiry View");

            Gai.SharedInstance.DefaultTracker.Send(DictionaryBuilder.CreateScreenView().Build());

            CloseButton.TouchUpInside          += CloseButton_TouchUpInside;
            EmailAddressTextField.ShouldReturn += EmailAddressTextField_ShouldReturn;
            //CommentsTextView.shouldr += EmailAddressTextField_ShouldReturn;
            SubmitButton.TouchUpInside += SubmitButton_TouchUpInside;
            CheckButton.TouchUpInside  += CheckButton_TouchUpInside;

            //keyboard observers
            // Keyboard popup
            NSNotificationCenter.DefaultCenter.AddObserver
                (UIKeyboard.DidShowNotification, KeyBoardUpNotification);

            // Keyboard Down
            NSNotificationCenter.DefaultCenter.AddObserver
                (UIKeyboard.WillHideNotification, KeyBoardDownNotification);

            View.AddGestureRecognizer(HideKeyboardGesture);
        }
Пример #17
0
 GetCommands()
 {
     return(DictionaryBuilder
            .Create <string, ICommand>()
            .Add("login", new Command(nameof(Login), Login))
            .Dictionary);
 }
Пример #18
0
        protected override void StartNewSession()
        {
            var builder = DictionaryBuilder.CreateScreenView();

            builder.Set("start", GaiConstants.SessionControl);
            SendHit(builder);
        }
Пример #19
0
        public Query(Action <IDictionaryBuilder <string, string> > action = default)
        {
            Parameters = new Dictionary <string, string>();
            var dictionaryBuilder = new DictionaryBuilder <string, string>(Parameters);

            action?.Invoke(dictionaryBuilder);
        }
Пример #20
0
        public virtual async Task TrackDependencyAsync(string dependencyType, string dependencyName, DateTimeOffset startTime, TimeSpan duration, bool success, int resultCode = 0, Exception exception = null)
        {
            try
            {
                var dependencyToTrack = DictionaryBuilder.CreateTiming(dependencyType, duration.Milliseconds, dependencyName, success.ToString()).Build();

                dependencyToTrack.Add((NSString)"ResultCode", (NSString)resultCode.ToString());

                if (exception != null)
                {
                    dependencyToTrack.Add(NSObject.FromObject("Exception message"), NSObject.FromObject(exception.Message));
                    dependencyToTrack.Add(NSObject.FromObject("StackTrace"), NSObject.FromObject(exception.StackTrace));

                    if (exception.InnerException != null)
                    {
                        dependencyToTrack.Add(NSObject.FromObject("Inner exception message"), NSObject.FromObject(exception.InnerException.Message));
                        dependencyToTrack.Add(NSObject.FromObject("Inner exception stackTrace"), NSObject.FromObject(exception.InnerException.StackTrace));
                    }
                }

                Tracker.Send(dependencyToTrack);
            }
            catch (Exception ex)
            {
                _ = TinyInsights.TrackErrorAsync(ex);
            }
        }
Пример #21
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();



            if (!string.IsNullOrEmpty(this.titleString))
            {
                this.NavigationController.NavigationBar.TitleTextAttributes = new UIStringAttributes()
                {
                    ForegroundColor = UIColor.White
                };

                this.Title = this.titleString;
            }
            else
            {
                UIImage     logo      = UIImage.FromBundle("adecco-logo-white");
                UIImageView imageView = new UIImageView(new System.Drawing.Rectangle(0, 0, 80, 20));                 //244 × 60
                imageView.Image = logo;
                this.NavigationItem.TitleView = imageView;
            }



            CustomWebViewDelegate _delegate = new CustomWebViewDelegate(activityIndicator);

            webView.Delegate = _delegate;

            if (isAboutUs)
            {
                this.aboutUs();
            }
            else
            {
                var uri   = new Uri(urlString.Trim());
                var nsurl = new NSUrl(uri.GetComponents(UriComponents.HttpRequestUrl, UriFormat.UriEscaped));

                if (nsurl == null)
                {
                    webView.LoadHtmlString(string.Format("<html><center><font size=+5 color='red'>An error occurred:<br></font></center></html>"), null);
                    return;
                }
                webView.LoadRequest(new NSUrlRequest(nsurl));
                webView.ScalesPageToFit = true;
                webView.BackgroundColor = UIColor.White;

                activityIndicator.HidesWhenStopped = true;

                activityIndicator.StartAnimating();
            }

            //var userAgent = webView.EvaluateJavascript("navigator.userAgent");
            if (this.isJobApply)
            {
                Gai.SharedInstance.DefaultTracker.Set(GaiConstants.ScreenName, "Apply Job");
                Gai.SharedInstance.DefaultTracker.Send(DictionaryBuilder.CreateScreenView().Build());
            }
        }
Пример #22
0
 public void TrackSocial(
     string socialNetworkName,
     string socialAction,
     string socialTarget
     )
 {
     analyticsTracker.Send(DictionaryBuilder.CreateSocial(socialNetworkName, socialAction, socialTarget).Build());
 }
Пример #23
0
 public IndexRazor()
 {
     ComponentDictionary = DictionaryBuilder
                           .Create <string, IDictionary <string, object> >()
                           .Add("CounterComponent", DictionaryBuilder.Create <string, object>().ToDictionary())
                           .Add("CustomerComponent", DictionaryBuilder.Create <string, object>(builder => { builder.Add("CustomerId", 3); }).ToDictionary())
                           .ToDictionary();
 }
Пример #24
0
 public override void ViewDidAppear(bool animated)
 {
     base.ViewDidAppear(animated);
     // This screen name value will remain set on the tracker and sent with
     // hits until it is set to a new value or to null.
     Gai.SharedInstance.DefaultTracker.Set(GaiConstants.ScreenName, "Home");
     Gai.SharedInstance.DefaultTracker.Send(DictionaryBuilder.CreateScreenView().Build());
 }
Пример #25
0
 public void SendEvent(string category, string action, string label, long?value)
 {
     Gai.SharedInstance.DefaultTracker.Send(
         DictionaryBuilder.CreateEvent(category,
                                       action,
                                       label,
                                       value.HasValue ? NSNumber.FromLong((nint)value) : null).Build());
 }
 public void TrackECommerce(decimal fullPrice, string orderId, string currency)
 {
     Tracker?.Send(DictionaryBuilder.CreateTransaction(
                       orderId,
                       string.Empty,
                       new NSNumber(Convert.ToInt64(fullPrice)),
                       tax: 0, shipping: 0, currencyCode: currency).Build());
 }
 GetCommands()
 {
     return(DictionaryBuilder
            .Create <string, ICommand>()
            .Add("echo", new Command(nameof(Echo), Echo))
            .Add("quit", new Command(nameof(Quit), Quit))
            .Dictionary);
 }
        /// <summary>
        /// Definition of the AsyncRead funcion for the SOEM functionality.
        /// It takes the slave number to communicate to, the index, and subindex of an object
        /// and it will call the respective needed low level SDO function to read the value of the object.
        /// The return value will be set on the value of the object dictionary
        /// </summary>
        /// <param name="slave_number">number of position of the slave to address</param>
        /// <param name="index">index of the object to read</param>
        /// <param name="subindex">subindex of the object to read</param>
        public override void AsyncRead(int slave_number, ushort index, byte subindex)
        {
            try
            {
                DictItem item = MW.ObjectDictionary.GetItem(index, subindex);

                switch (item.Type)
                {
                case "SINT":
                    lock (comm_locker)
                        item.Value = SdoReadInt8(slave_number, index, subindex);
                    break;

                case "BOOL":
                case "USINT":
                    lock (comm_locker)
                        item.Value = SdoReadUInt8(slave_number, index, subindex);
                    break;

                case "INT":
                    lock (comm_locker)
                        item.Value = SdoReadInt16(slave_number, index, subindex);
                    break;

                case "UINT":
                    lock (comm_locker)
                        item.Value = SdoReadUInt16(slave_number, index, subindex);
                    break;

                case "DINT":
                    lock (comm_locker)
                        item.Value = SdoReadInt32(slave_number, index, subindex);
                    break;

                case "UDINT":
                    lock (comm_locker)
                        item.Value = SdoReadUInt32(slave_number, index, subindex);
                    break;

                case "STRING":
                    byte[] buf = new byte[item.Length];
                    lock (comm_locker)
                        SdoReadString(slave_number, index, subindex, buf, item.Length);
                    item.Value = buf;
                    break;

                default:
                    throw new NotImplementedException();
                }
                DictionaryBuilder.FormatDisplayString(item); /* formats the display string of the value (dec, bin, hex) */
                item.TimeStamp = Convert.ToUInt32(stopwatch.ElapsedMilliseconds);
            }
            catch (Exception err)
            {
                MessageBox.Show(err.ToString());
            }
        }
Пример #29
0
 public void TrackUserId(string userid)
 {
     if (!string.IsNullOrWhiteSpace(userid))
     {
         analyticsTracker.Set(GaiConstants.UserId.ToString(), userid);
         var builder = DictionaryBuilder.CreateEvent("TrackUserId", "TrackUserId", "", new NSNumber(0));
         analyticsTracker.Send(builder.Build());
     }
 }
Пример #30
0
        public void Create_with_KeyValuePair_parameter_includes_existing_entries()
        {
            var sut = DictionaryBuilder <int, string> .Create(Setup());

            Assert.Contains(1, sut.ToDictionary());
            Assert.Contains(2, sut.ToDictionary());
            Assert.Contains(3, sut.ToDictionary());
            Assert.Contains(4, sut.ToDictionary());
        }
Пример #31
0
        private void SendHit (DictionaryBuilder builder)
        {
            // Inject custom dimensions, if any have been set:
            foreach (var kvp in customDimensions) {
                builder.Set (kvp.Value, Fields.CustomDimension ((uint)kvp.Key));
            }
            customDimensions.Clear ();

            Gai.SharedInstance.DefaultTracker.Send (builder.Build ());
        }
        /// <summary>
        /// Creates a BaseBuilder-derived object from a name
        /// </summary>
        /// <param name="parentBuilder">Parent builder</param>
        /// <param name="parameters">Load parameters</param>
        /// <param name="errors">Error collection</param>
        /// <param name="reader">XML reader</param>
        /// <returns>Returns the new builder, or null if there as an error</returns>
        public static BaseBuilder CreateBuilderFromReader( BaseBuilder parentBuilder, ComponentLoadParameters parameters, ErrorCollection errors, XmlReader reader )
        {
            BaseBuilder result = null;
            try
            {
                switch ( reader.Name )
                {
                    case "null"		: result = new ValueBuilder( parameters, errors, reader, parentBuilder, null );		break;
                    case "rb"       : result = new RootBuilder( parameters, errors, reader );							break;
                    case "object"   : result = new ObjectBuilder( parameters, errors, reader, parentBuilder );			break;
                    case "ref"      : result = new ReferenceBuilder( parameters, errors, reader, parentBuilder );		break;
                    case "asset"	: result = new AssetBuilder( parameters, errors, reader, parentBuilder );			break;
                    case "instance" : result = new InstanceBuilder( parameters, errors, reader, parentBuilder );		break;
                    case "method"	: result = new MethodBuilder( parameters, errors, reader, parentBuilder );			break;
                    case "list"     : result = new ListBuilder( parameters, errors, reader, parentBuilder );			break;
                    case "table"	: result = new DictionaryBuilder( parameters, errors, reader, parentBuilder );		break;
                    case "type"     : result = new TypeBuilder( parameters, errors, reader, parentBuilder );			break;
                    case "template"	: result = new TemplateBuilder( parameters, errors, reader, parentBuilder );		break;
                    case "location" :
                        string loc = reader.GetAttribute( "value" );
                        result = new ValueBuilder( parameters, errors,reader, parentBuilder, Locations.NewLocation( loc ) );
                        break;
                    case "dictionaryEntry"	:
                        result = new DictionaryEntryBuilder( parameters, errors, reader, parentBuilder );
                        break;
                    case "dynProperty"	:
                        object dynPropertyValue = parameters.Properties[ reader.GetAttribute( "value" ) ];
                        result = new ValueBuilder( parameters, errors, reader, parentBuilder, dynPropertyValue );
                        break;
                    case "colour"		:
                        result = new ValueBuilder( parameters, errors, reader, parentBuilder, MakeColour( reader ) );
                        break;
                    case "string"		:
                        result = new ValueBuilder( parameters, errors, reader, parentBuilder, reader.GetAttribute( "value" ) );
                        break;
                    case "guid"			:
                        result = new ValueBuilder( parameters, errors, reader, parentBuilder, new Guid( reader.GetAttribute( "value" ) ) );
                        break;
                    case "bool"			:
                        result = new ValueBuilder( parameters, errors, reader, parentBuilder, bool.Parse( reader.GetAttribute( "value" ) ) );
                        break;
                    case "char"			:
                        result = new ValueBuilder( parameters, errors, reader, parentBuilder, char.Parse( reader.GetAttribute( "value" ) ) );
                        break;
                    case "byte"			:
                        result = new ValueBuilder( parameters, errors, reader, parentBuilder, byte.Parse( reader.GetAttribute( "value" ) ) );
                        break;
                    case "sbyte"		:
                        result = new ValueBuilder( parameters, errors, reader, parentBuilder, sbyte.Parse( reader.GetAttribute( "value" ) ) );
                        break;
                    case "short"		:
                        result = new ValueBuilder( parameters, errors, reader, parentBuilder, short.Parse( reader.GetAttribute( "value" ) ) );
                        break;
                    case "ushort"		:
                        result = new ValueBuilder( parameters, errors, reader, parentBuilder, ushort.Parse( reader.GetAttribute( "value" ) ) );
                        break;
                    case "int"			:
                        result = new ValueBuilder( parameters, errors, reader, parentBuilder, int.Parse( reader.GetAttribute( "value" ) ) );
                        break;
                    case "uint"			:
                        result = new ValueBuilder( parameters, errors, reader, parentBuilder, uint.Parse( reader.GetAttribute( "value" ) ) );
                        break;
                    case "long"			:
                        result = new ValueBuilder( parameters, errors, reader, parentBuilder, long.Parse( reader.GetAttribute( "value" ) ) );
                        break;
                    case "ulong"		:
                        result = new ValueBuilder( parameters, errors, reader, parentBuilder, ulong.Parse( reader.GetAttribute( "value" ) ) );
                        break;
                    case "float"		:
                        result = new ValueBuilder( parameters, errors, reader, parentBuilder, float.Parse( reader.GetAttribute( "value" ) ) );
                        break;
                    case "double"		:
                        result = new ValueBuilder( parameters, errors, reader, parentBuilder, double.Parse( reader.GetAttribute( "value" ) ) );
                        break;
                    case "timeSpan"		:
                        result = new ValueBuilder( parameters, errors, reader, parentBuilder, MakeTimeSpan( reader ) );
                        break;
                    case "point3"		:
                        {
                            float x = float.Parse( reader.GetAttribute( "x" ) );
                            float y = float.Parse( reader.GetAttribute( "y" ) );
                            float z = float.Parse( reader.GetAttribute( "z" ) );
                            result = new ValueBuilder( parameters, errors, reader, parentBuilder, new Point3( x, y, z ) );
                            break;
                        }
                    case "bigPoint3"	:
                        {
                            long x = long.Parse( reader.GetAttribute( "x" ) );
                            long y = long.Parse( reader.GetAttribute( "y" ) );
                            long z = long.Parse( reader.GetAttribute( "z" ) );
                            result = new ValueBuilder( parameters, errors, reader, parentBuilder, new BigPoint3( x, y, z ) );
                            break;
                        }
                    case "vector2"		:
                        {
                            float x = float.Parse( reader.GetAttribute( "x" ) );
                            float y = float.Parse( reader.GetAttribute( "y" ) );
                            result = new ValueBuilder( parameters, errors, reader, parentBuilder, new Vector2( x, y ) );
                            break;
                        }
                    case "vector3"		:
                        {
                            float x = float.Parse( reader.GetAttribute( "x" ) );
                            float y = float.Parse( reader.GetAttribute( "y" ) );
                            float z = float.Parse( reader.GetAttribute( "z" ) );
                            result = new ValueBuilder( parameters, errors, reader, parentBuilder, new Vector3( x, y, z ) );
                            break;
                        }
                    case "point2"   	:
                    case "quat"     	:
                        {
                            errors.Add( reader, "Element is not yet supported", reader.Name );
                            reader.Skip( );
                            break;
                        }
                    default	:
                        {
                            //	Interpret name as object type
                            string typeName = reader.Name;
                            result = new ObjectBuilder( parameters, errors, reader, parentBuilder, typeName );
                            break;
                        }
                }
            }
            catch ( Exception ex )
            {
                errors.Add( reader, ex, "Builder created from element \"{0}\" threw an exception", reader.Name );
                reader.Skip( );
            }

            if ( result != null )
            {
                string name = reader.Name;
                try
                {
                    result.ReadChildBuilders( reader );
                }
                catch ( Exception ex )
                {
                    errors.Add( reader, ex, "Exception thrown while reading children from builder \"{0}\"", name );
                }
            }

            return result;
        }