예제 #1
0
        // ----------------------------------------------------------------------------------------
        /// <!-- BuildSegment -->
        /// <summary>
        ///      Converts a formatted endeme item string into an endeme item with a string value
        /// </summary>
        /// <param name="enItemFormatted"></param>
        /// <param name="enRef"></param>
        /// <returns></returns>
        public static EndemeItem BuildSegment(string enItemFormatted, EndemeReference enRef)
        {
            // --------------------------------------------------------------------------
            //  Resolve endeme set
            // --------------------------------------------------------------------------
            string    label = Endeme.Part(0, enItemFormatted);
            EndemeSet enSet = null;

            if (enRef != null)
            {
                enSet = enRef[label];
            }
            if (enSet == null || string.IsNullOrEmpty(enSet.Label))
            {
                enSet = new EndemeSet(label);
            }


            // --------------------------------------------------------------------------
            //  Build endeme item
            // --------------------------------------------------------------------------
            EndemeItem enItem = new EndemeItem(new Endeme(enSet, Endeme.Part(1, enItemFormatted)), "");

            enItem.Item = Endeme.Part(2, enItemFormatted);
            return(enItem);
        }
예제 #2
0
 // ----------------------------------------------------------------------------------------
 /// <!-- FillSegments -->
 /// <summary>
 ///
 /// </summary>
 /// <param name="path"></param>
 /// <param name="enRef"></param>
 private void FillSegments(string path, EndemeReference enRef)
 {
     string[] seq = path.Split("|!*+^".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
     for (int i = 0; i < seq.Length; ++i)
     {
         Segment.Add(BuildSegment(seq[i], enRef));
     }
 }
 // ----------------------------------------------------------------------------------------
 /// <!-- Add -->
 /// <summary>
 ///      Adds an element to the EndemeArray
 /// </summary>
 /// <param name="guid"></param>
 /// <param name="element"></param>
 /// <returns>
 ///      Probably ought to return the element not just the Guid since the Element contains the Guid
 /// </returns>
 /// <remarks>beta code - nearly production ready</remarks>
 public Guid Add(Guid guid, EndemeObject element) // <------------------------------------+
 {                                                // |
     element.ItemKey = guid;                      // |
     _list.Add(guid, element);                    // |
     _order.Add(guid);                            // |
     if (_enRef == null && element.EnRef != null)
     {
         _enRef = element.EnRef;                                                       // |  warning: side effect
     }
     return(guid);                                                                     // |
 }                                                                                     // |
예제 #4
0
        public EndemeList(string label, EndemeReference enRef, double equalThreshold)
        {
            Init(label, null);
            if (enRef == null)
            {
                throw new Exception("boom");                // EnRef = new EndemeReference();
            }
            else
            {
                this.EnRef = enRef;
            }
            this.EqualityThreshold = equalThreshold;

            this._enSet = enRef.SetRef.FirstOrDefault(x => x.Key != "").Value;
        }
예제 #5
0
 public EndemeProfile(string profile, EndemeReference enRef)
 {
     Init(); FillSegments(profile, enRef); FillOperators(profile);
 }
예제 #6
0
 // --------------------------------------------------------------------------------------
 //  Constructors
 // --------------------------------------------------------------------------------------
 public EndemeObject(string profile, EndemeReference enRef, EndemeValue value)
 {
     Init("", new EndemeProfile(profile, enRef), value);
 }
예제 #7
0
 // ----------------------------------------------------------------------------------------
 //  Constructors
 // ----------------------------------------------------------------------------------------
 public EndemeField(string label, EndemeReference enRef, double equalThreshold)
 {
     Label     = label;
     _field    = new EndemeList(label, enRef, equalThreshold);
     _register = new EndemeDefinition(label, enRef);
 }
 public EndemeDefinition(string label, EndemeReference enRef)
 {
     Init(label); _enRef = enRef;
 }