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); }
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)); }
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); } }