Beispiel #1
0
        public void IterateThrough_fromRoot(
            string iteration_in,
            dIteration_found iteration_found_in
            )
        {
//// ToDos: now!
//#if DEBUG
//Console.WriteLine("IterateThrough_fromRoot({0}, ...)", iteration_in);
//#endif

            #region Exception IterateThrough_fromRoot_Exception = new Exception("...");
            Exception IterateThrough_fromRoot_Exception = new Exception(
                string.Format(
                    "{0}.{1}.IterateThrough_fromRoot(): - something wrong with iteration: '{2}'",
                    this.GetType().Namespace,
                    this.GetType().Name,
                    iteration_in
                    )
                );
            #endregion
            runthrough_found_ = iteration_found_in;

            int _dot = iteration_in.IndexOf(".");
            root().IterateThrough_fromHere(
                (_dot < 0)
                                        ? iteration_in
                                        : iteration_in.Substring(_dot + 1)
                ,
                "ROOT:" + root4xml,
                runthrough_found_
                );
        }
Beispiel #2
0
		public void IterateThrough_fromRoot(
			string iteration_in, 
			dIteration_found iteration_found_in
		) {

//// ToDos: now!
//#if DEBUG
//Console.WriteLine("IterateThrough_fromRoot({0}, ...)", iteration_in);
//#endif

			#region Exception IterateThrough_fromRoot_Exception = new Exception("...");
			Exception IterateThrough_fromRoot_Exception = new Exception(
				string.Format(
					"{0}.{1}.IterateThrough_fromRoot(): - something wrong with iteration: '{2}'", 
					this.GetType().Namespace, 
					this.GetType().Name, 
					iteration_in
				)
			);
			#endregion
			runthrough_found_ = iteration_found_in;

			int _dot = iteration_in.IndexOf(".");
			root().IterateThrough_fromHere(
				(_dot < 0) 
					? iteration_in
					: iteration_in.Substring(_dot + 1)
				, 
				"ROOT:" + root4xml, 
				runthrough_found_
			);
		}
Beispiel #3
0
        public void IterateThrough_fromHere(
            string iteration_in,
            string path_in,
            dIteration_found iteration_found_in
            )
        {
            path_ = path_in;

//Console.WriteLine(
//	"ENTRADA : {0}*{1} : {2}",
//	Path,
//	iteration_in,
//	test_in
//);


            if (iteration_in == "ROOT:" + root4xml)
            {
                if (iteration_found_in != null)
                {
                    iteration_found_in(iteration_in);
                }
                return;
            }


            string[] _iteration = iteration_in.Split('.');
            string   _iteration_name;
            bool     _iteration_hasIndex;

            #region string _iteration_next = ...;
            int    _dot            = iteration_in.IndexOf(".");
            string _iteration_next = (_dot >= 0)
                                ? iteration_in.Substring(_dot + 1)
                                : string.Empty;
            #endregion

            Match match = aggregate_collection_regex.Match(_iteration[0]);
            if (match.Success)
            {
                _iteration_name     = match.Groups["name"].Value;
                _iteration_hasIndex = true;                 // int.Parse(match.Groups["index"].Value);
            }
            else
            {
                _iteration_name     = _iteration[0];
                _iteration_hasIndex = false;
            }

            int _property_index = PropertyIndex_find(_iteration_name);
            if (_property_index != -1)
            {
                switch (Attributes[_property_index].Type)
                {
                case ClaSSPropertyAttribute.eType.aggregate: {
                    if (_iteration_hasIndex)
                    {
                        throw IterateThrough_fromHere_Exception(iteration_in);
                    }

                    if (_iteration_next != string.Empty)
                    {
                        ((iClaSSe)
                         Properties[_property_index].GetValue(this, null)
                        ).IterateThrough_fromHere(
                            _iteration_next,
                            Path + "." + _iteration_name,
                            iteration_found_in
                            );
                    }
                    else
                    {
// ToDos: here!
                    }

                    break;
                }

                case ClaSSPropertyAttribute.eType.aggregate_collection: {
                    if (!_iteration_hasIndex)
                    {
                        throw IterateThrough_fromHere_Exception(iteration_in);
                    }

                    ArrayList _aggregate_collection
                        = (ArrayList)Properties[_property_index].GetValue(this, null);
                    for (int a = 0; a < _aggregate_collection.Count; a++)
                    {
                        if (_iteration_next != string.Empty)
                        {
                            ((iClaSSe)
                             _aggregate_collection[a]
                            ).IterateThrough_fromHere(
                                _iteration_next,
                                Path + "." + _iteration_name + "[" + a + "]",
                                iteration_found_in
                                );
                        }
                        else
                        {
// ToDos: here!
                            string _doit = string.Format(
                                "{0}.{1}[{2}]",
                                Path,
                                _iteration_name,
                                a
                                );
                            if (iteration_found_in != null)
                            {
                                iteration_found_in(_doit);
                            }
//Console.WriteLine(
//	"DOIT: {0}",
//	_doit
//);
                        }
                    }

                    break;
                }

                case ClaSSPropertyAttribute.eType.standard:
                default: {
                    throw IterateThrough_fromHere_Exception(iteration_in);
                }
                }
            }
            else
            {
                throw IterateThrough_fromHere_Exception(iteration_in);
            }
        }
Beispiel #4
0
		public void IterateThrough_fromHere(
			string iteration_in, 
			string path_in, 
			dIteration_found iteration_found_in
		) {
			path_ = path_in;

//Console.WriteLine(
//	"ENTRADA : {0}*{1} : {2}", 
//	Path, 
//	iteration_in, 
//	test_in
//);


if (iteration_in == "ROOT:" + root4xml) {
	if (iteration_found_in != null) iteration_found_in(iteration_in);
	return;
}


			string[] _iteration = iteration_in.Split('.');
			string _iteration_name;
			bool _iteration_hasIndex;
			#region string _iteration_next = ...;
			int _dot = iteration_in.IndexOf(".");
			string _iteration_next = (_dot >= 0) 
				? iteration_in.Substring(_dot + 1) 
				: string.Empty;
			#endregion

			Match match = aggregate_collection_regex.Match(_iteration[0]);
			if (match.Success) {
				_iteration_name = match.Groups["name"].Value;
				_iteration_hasIndex = true; // int.Parse(match.Groups["index"].Value);
			} else {
				_iteration_name = _iteration[0];
				_iteration_hasIndex = false;
			}

			int _property_index = PropertyIndex_find(_iteration_name);
			if (_property_index != -1) {
				switch (Attributes[_property_index].Type) {
					case ClaSSPropertyAttribute.eType.aggregate: {
						if (_iteration_hasIndex) throw IterateThrough_fromHere_Exception(iteration_in);

						if (_iteration_next != string.Empty) {
							((iClaSSe)
								Properties[_property_index].GetValue(this, null)
							).IterateThrough_fromHere(
								_iteration_next, 
								Path + "." + _iteration_name, 
								iteration_found_in
							);
						} else {

// ToDos: here!

						}

						break;
					}
					case ClaSSPropertyAttribute.eType.aggregate_collection: {
						if (!_iteration_hasIndex) throw IterateThrough_fromHere_Exception(iteration_in);

						ArrayList _aggregate_collection 
							= (ArrayList)Properties[_property_index].GetValue(this, null);
						for (int a = 0; a < _aggregate_collection.Count; a++) {
							if (_iteration_next != string.Empty) {
								((iClaSSe)
									_aggregate_collection[a]
								).IterateThrough_fromHere(
									_iteration_next, 
									Path + "." + _iteration_name + "[" + a + "]", 
									iteration_found_in
								);
							} else {

// ToDos: here!
string _doit = string.Format(
	"{0}.{1}[{2}]", 
	Path, 
	_iteration_name, 
	a
);
if (iteration_found_in != null) iteration_found_in(_doit);
//Console.WriteLine(
//	"DOIT: {0}", 
//	_doit
//);


							}
						}

						break;
					}
					case ClaSSPropertyAttribute.eType.standard:
					default: {
						throw IterateThrough_fromHere_Exception(iteration_in);
					}
				}
			} else {
				throw IterateThrough_fromHere_Exception(iteration_in);
			}
		}