Ejemplo n.º 1
0
        public Delta CreateNMSDelta(ConcreteModel concreteModel)
        {
            if (concreteModel == null || concreteModel.ModelMap == null)
            {
                return(null);
            }

            Delta delta = new Delta();

            foreach (DMSType type in ModelResourcesDesc.TypeIdsInInsertOrder)
            {
                SortedDictionary <string, object> cimObjects = concreteModel.GetAllObjectsOfType("FTN." + ModelCodeHelper.DMSTypeToName(type));

                if (cimObjects == null)
                {
                    continue;
                }

                foreach (KeyValuePair <string, object> cimObjectPair in cimObjects)
                {
                    IDClass             idc = cimObjectPair.Value as IDClass;
                    long                gid = ModelCodeHelper.CreateGID(0, type, --counters[type]);
                    ResourceDescription rd  = new ResourceDescription(gid);
                    idMapping[idc.ID] = gid;
                    PopulateProperties(idc, rd);
                    delta.InsertOperations.Add(rd);
                }
            }

            return(delta);
        }