예제 #1
0
        public ElementChangeParentAction(object[] args)
        {
            Debug.Assert(args.Length == 2);
            _model = args[0] as IDsmModel;
            Debug.Assert(_model != null);
            IReadOnlyDictionary <string, string> data = args[1] as IReadOnlyDictionary <string, string>;

            Debug.Assert(data != null);

            ActionReadOnlyAttributes attributes = new ActionReadOnlyAttributes(_model, data);

            _element = attributes.GetElement(nameof(_element));
            Debug.Assert(_element != null);

            _old = attributes.GetElement(nameof(_old));
            Debug.Assert(_old != null);

            _new = attributes.GetElement(nameof(_new));
            Debug.Assert(_new != null);
        }
예제 #2
0
        public ElementSortAction(object[] args)
        {
            Debug.Assert(args.Length == 2);
            _model = args[0] as IDsmModel;
            Debug.Assert(_model != null);
            IReadOnlyDictionary <string, string> data = args[1] as IReadOnlyDictionary <string, string>;

            Debug.Assert(data != null);

            ActionReadOnlyAttributes attributes = new ActionReadOnlyAttributes(_model, data);

            _element = attributes.GetElement(nameof(_element));
            Debug.Assert(_element != null);

            _algorithm = attributes.GetString(nameof(_algorithm));
            _order     = attributes.GetString(nameof(_order));
        }
예제 #3
0
        public ElementCreateAction(object[] args)
        {
            Debug.Assert(args.Length == 2);
            _model = args[0] as IDsmModel;
            Debug.Assert(_model != null);
            IReadOnlyDictionary <string, string> data = args[1] as IReadOnlyDictionary <string, string>;

            Debug.Assert(data != null);

            ActionReadOnlyAttributes attributes = new ActionReadOnlyAttributes(_model, data);

            _element = attributes.GetElement(nameof(_element));
            Debug.Assert(_element != null);

            _name = attributes.GetString(nameof(_name));
            _type = attributes.GetString(nameof(_type));

            int?parentId = attributes.GetNullableInt(nameof(_parent));

            if (parentId.HasValue)
            {
                _parent = _model.GetElementById(parentId.Value);
            }
        }