示例#1
0
 private void SetModel(IDsmModel model)
 {
     _model = model;
     _matrixControl.MatrixModel = _model;
     _matrixControl.Enabled     = true;
     toolStrip.Enabled          = true;
 }
示例#2
0
 public AlphabeticalSortAlgorithm(object[] args)
 {
     Debug.Assert(args.Length == 2);
     _model = args[0] as IDsmModel;
     Debug.Assert(_model != null);
     _element = args[1] as IDsmElement;
     Debug.Assert(_element != null);
 }
示例#3
0
 public DsmResolvedRelation(IDsmModel model, IDsmRelation relation)
 {
     Id = relation.Id;
     ConsumerElement = model.GetElementById(relation.ConsumerId);
     ProviderElement = model.GetElementById(relation.ProviderId);
     Type            = relation.Type;
     Weight          = relation.Weight;
 }
示例#4
0
        public ActionStore(IDsmModel model, IActionManager actionManager)
        {
            _model         = model;
            _actionManager = actionManager;
            _types         = new Dictionary <string, Type>();

            RegisterActionTypes();
        }
示例#5
0
 public DsmBuilder(IDsiModel dsiModel, IDsmModel dsmModel, IImportPolicy importPolicy, bool autoPartition)
 {
     _dsiModel        = dsiModel;
     _dsmModel        = dsmModel;
     _importPolicy    = importPolicy;
     _autoPartition   = autoPartition;
     _dsiToDsmMapping = new Dictionary <int, int>();
 }
示例#6
0
        public ElementMoveDownAction(IDsmModel model, IDsmElement element)
        {
            _model = model;
            Debug.Assert(_model != null);

            _element = element;
            Debug.Assert(_element != null);
        }
示例#7
0
        public ElementCreateAction(IDsmModel model, string name, string type, IDsmElement parent)
        {
            _model = model;
            Debug.Assert(_model != null);

            _name   = name;
            _type   = type;
            _parent = parent;
        }
示例#8
0
        public UpdateExistingModelPolicy(IDsmModel dsmmodel, string dsmFilename, IActionManager actionManager, IProgress <ProgressInfo> progress)
        {
            _dsmModel    = dsmmodel;
            _dsmFilename = dsmFilename;
            _dsmModel.LoadModel(_dsmFilename, progress);
            _actionManager = actionManager;

            _notFoundElements  = _dsmModel.GetElements().ToDictionary(x => x.Id, x => x);
            _notFoundRelations = _dsmModel.GetRelations().ToDictionary(x => x.Id, x => x);
        }
示例#9
0
 protected CommandOpen(IDsmModel model, FileInfo file, DirectoryInfo startDirectory)
 {
     if (model == null)
     {
         throw new ArgumentNullException(nameof(model));
     }
     _model     = model;
     _file      = file;
     _directory = startDirectory;
 }
示例#10
0
        public ElementChangeNameAction(IDsmModel model, IDsmElement element, string name)
        {
            _model = model;
            Debug.Assert(_model != null);

            _element = element;
            Debug.Assert(_element != null);

            _old = _element.Name;
            _new = name;
        }
示例#11
0
        public ElementSortAction(IDsmModel model, IDsmElement element, string algorithm)
        {
            _model = model;
            Debug.Assert(_model != null);

            _element = element;
            Debug.Assert(_element != null);

            _algorithm = algorithm;
            _order     = "";
        }
示例#12
0
        public ElementChangeTypeAction(IDsmModel model, IDsmElement element, string type)
        {
            _model = model;
            Debug.Assert(_model != null);

            _element = element;
            Debug.Assert(_element != null);

            _old = _element.Type;
            _new = type;
        }
示例#13
0
        public DsmApplication(IDsmModel dsmModel)
        {
            _dsmModel = dsmModel;

            _actionManager = new ActionManager();
            _actionManager.ActionPerformed += OnActionPerformed;

            _actionStore = new ActionStore(_dsmModel, _actionManager);

            _queries = new DsmQueries(dsmModel);

            _metrics = new DsmMetrics(dsmModel);
        }
示例#14
0
        public static ISortAlgorithm CreateAlgorithm(IDsmModel model, IDsmElement element, string algorithName)
        {
            ISortAlgorithm algoritm = null;

            if (Algorithms.ContainsKey(algorithName))
            {
                Type     type         = Algorithms[algorithName];
                object[] args         = { model, element };
                object   argumentList = args;
                algoritm = Activator.CreateInstance(type, argumentList) as ISortAlgorithm;
            }
            return(algoritm);
        }
示例#15
0
        public ElementMoveDownAction(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);
        }
示例#16
0
        public ElementChangeParentAction(IDsmModel model, IDsmElement element, IDsmElement newParent)
        {
            _model = model;
            Debug.Assert(_model != null);

            _element = element;
            Debug.Assert(_element != null);

            _old = element.Parent;
            Debug.Assert(_old != null);

            _new = newParent;
            Debug.Assert(_new != null);
        }
示例#17
0
        public RelationCreateAction(IDsmModel model, int consumerId, int providerId, string type, int weight)
        {
            _model = model;
            Debug.Assert(_model != null);

            _consumer = model.GetElementById(consumerId);
            Debug.Assert(_consumer != null);

            _provider = model.GetElementById(providerId);
            Debug.Assert(_provider != null);

            _type   = type;
            _weight = weight;
        }
示例#18
0
        public RelationDeleteAction(IDsmModel model, IDsmRelation relation)
        {
            _model = model;
            Debug.Assert(_model != null);

            _relation = relation;
            Debug.Assert(_relation != null);

            _consumer = model.GetElementById(_relation.ConsumerId);
            Debug.Assert(_consumer != null);

            _provider = model.GetElementById(_relation.ProviderId);
            Debug.Assert(_provider != null);
        }
示例#19
0
        public MakeSnapshotAction(object[] args)
        {
            Debug.Assert(args.Length == 2);
            IDsmModel 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);

            _name = attributes.GetString(nameof(_name));
        }
示例#20
0
        public RelationChangeTypeAction(IDsmModel model, IDsmRelation relation, string type)
        {
            _model = model;
            Debug.Assert(_model != null);

            _relation = relation;
            Debug.Assert(_relation != null);

            _consumer = model.GetElementById(_relation.ConsumerId);
            Debug.Assert(_consumer != null);

            _provider = model.GetElementById(_relation.ProviderId);
            Debug.Assert(_provider != null);

            _old = relation.Type;
            _new = type;
        }
示例#21
0
        public RelationChangeWeightAction(IDsmModel model, IDsmRelation relation, int weight)
        {
            _model = model;
            Debug.Assert(_model != null);

            _relation = relation;
            Debug.Assert(_relation != null);

            _consumer = model.GetElementById(_relation.ConsumerId);
            Debug.Assert(_consumer != null);

            _provider = model.GetElementById(_relation.ProviderId);
            Debug.Assert(_provider != null);

            _old = relation.Weight;
            _new = weight;
        }
示例#22
0
        public RelationDeleteAction(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);

            _relation = attributes.GetRelation(nameof(_relation));
            Debug.Assert(_relation != null);

            _consumer = attributes.GetRelationConsumer(nameof(_relation));
            Debug.Assert(_consumer != null);

            _provider = attributes.GetRelationProvider(nameof(_relation));
            Debug.Assert(_provider != null);
        }
示例#23
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);
            }
        }
示例#24
0
 public CellConsumersReport(IDsmModel model) : base(model)
 {
 }
示例#25
0
 public DsmQueries(IDsmModel model)
 {
     _model = model;
 }
示例#26
0
 protected BaseReport(IDsmModel model)
 {
     _model = model;
 }
示例#27
0
 public OverviewReport(IDsmModel model) : base(model)
 {
 }
示例#28
0
 public CellProvidersReport(IDsmModel model, IElement provider, IElement consumer) :
     base(model)
 {
     _provider = provider;
     _consumer = consumer;
 }
示例#29
0
 public DsmMetrics(IDsmModel model)
 {
     _model = model;
 }
示例#30
0
 public ElementProvidedInterfacesReport(IDsmModel model, IElement element) :
     base(model)
 {
     _element = element;
 }