Esempio n. 1
0
 private void SetModel(IDsmModel model)
 {
     _model = model;
     _matrixControl.MatrixModel = _model;
     _matrixControl.Enabled     = true;
     toolStrip.Enabled          = true;
 }
Esempio n. 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);
 }
Esempio n. 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;
 }
Esempio n. 4
0
        public ActionStore(IDsmModel model, IActionManager actionManager)
        {
            _model         = model;
            _actionManager = actionManager;
            _types         = new Dictionary <string, Type>();

            RegisterActionTypes();
        }
Esempio n. 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>();
 }
Esempio n. 6
0
        public ElementMoveDownAction(IDsmModel model, IDsmElement element)
        {
            _model = model;
            Debug.Assert(_model != null);

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

            _name   = name;
            _type   = type;
            _parent = parent;
        }
Esempio n. 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);
        }
Esempio n. 9
0
 protected CommandOpen(IDsmModel model, FileInfo file, DirectoryInfo startDirectory)
 {
     if (model == null)
     {
         throw new ArgumentNullException(nameof(model));
     }
     _model     = model;
     _file      = file;
     _directory = startDirectory;
 }
Esempio n. 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;
        }
Esempio n. 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     = "";
        }
Esempio n. 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;
        }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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;
        }
Esempio n. 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);
        }
Esempio n. 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));
        }
Esempio n. 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;
        }
Esempio n. 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;
        }
Esempio n. 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);
        }
Esempio n. 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);
            }
        }
Esempio n. 24
0
 public CellConsumersReport(IDsmModel model) : base(model)
 {
 }
Esempio n. 25
0
 public DsmQueries(IDsmModel model)
 {
     _model = model;
 }
Esempio n. 26
0
 protected BaseReport(IDsmModel model)
 {
     _model = model;
 }
Esempio n. 27
0
 public OverviewReport(IDsmModel model) : base(model)
 {
 }
Esempio n. 28
0
 public CellProvidersReport(IDsmModel model, IElement provider, IElement consumer) :
     base(model)
 {
     _provider = provider;
     _consumer = consumer;
 }
Esempio n. 29
0
 public DsmMetrics(IDsmModel model)
 {
     _model = model;
 }
Esempio n. 30
0
 public ElementProvidedInterfacesReport(IDsmModel model, IElement element) :
     base(model)
 {
     _element = element;
 }