Beispiel #1
0
        public static StateObject CreateMissingStateObject(this ParserObject baseObject)
        {
            var result = new StateObject();

            result.Parent      = baseObject;
            result.ObjectClass = ObjectClass.Missing;
            result.State       = State.Missing;
            result.Color       = ColorTranslator.ToHtml(Color.White);
            return(result);
        }
Beispiel #2
0
        public static StateObject CreateBlankStateObject(this ParserObject baseObject)
        {
            var result = new StateObject();

            result.Parent      = baseObject;
            result.ObjectClass = ObjectClass.Blank;
            result.State       = State.Blank;
            result.Color       = ColorTranslator.ToHtml(Color.White);
            result.Description = string.Empty;
            return(result);
        }
Beispiel #3
0
        public static ParserObject CreateObjectClone(this ParserObject original)
        {
            var result = new ParserObject();

            result.ObjectClass = original.ObjectClass;


            result.DynObjectDictionary = new Dictionary <string, object>(original.DynObjectDictionary);
            result.ObjectClass         = original.ObjectClass;
            result.BaseColor           = original.BaseColor;
            return(result);
        }
Beispiel #4
0
        public static StateObject CreateStateObject(this ParserObject baseObject, State state, Shape shape, int lineNumber, string line, string filterKey)
        {
            var result = new StateObject();

            result.Parent   = baseObject;
            result.LineNum  = lineNumber;
            result.LogEntry = line;
            result.State    = state;
            result.Shape    = shape;
            //result.Color = baseObject.BaseColor;
            result.FilterKey   = filterKey;
            result.ObjectClass = baseObject.ObjectClass;
            return(result);
        }
Beispiel #5
0
        public static StateObject CreateArrowStateObject(this ParserObject baseObject, ParserObject referenceObject = null, RefDirection refDirection = RefDirection.None)
        {
            var result = new StateObject();

            result.Parent             = baseObject;
            result.ObjectClass        = ObjectClass.ViewArrow;
            result.State              = State.ViewArrow;
            result.ReferenceObj       = referenceObject;
            result.ReferenceDirection = refDirection;
            result.Color              = ColorTranslator.ToHtml(Color.White);
            result.Description        = null;
            if (referenceObject != null)
            {
                result.ReferenceStateObj = referenceObject.StateCollection.LastOrDefault(x => x.ObjectClass != ObjectClass.ViewArrow && x.ObjectClass != ObjectClass.Blank);
            }

            return(result);
        }
Beispiel #6
0
 public static string GetParent(this ParserObject item)
 {
     return(item != null ? (string)item.GetDynPropertyValue("Parent") : null);
 }