コード例 #1
0
        public TechObject Clone(GetN getLocalNum, int newNumber,
                                int oldGlobalNum, int newGlobalNum)
        {
            TechObject clone = (TechObject)MemberwiseClone();

            clone.techNumber      = new TechObjectN(clone, newNumber);
            clone.techType        = new ObjectProperty("Тип", TechType);
            clone.nameBC          = new ObjectProperty("Имя объекта Monitor", NameBC);
            clone.nameEplan       = new NameInEplan(NameEplan, clone);
            clone.attachedObjects = new AttachedToObjects(AttachedObjects.Value,
                                                          clone);

            clone.getLocalNum = getLocalNum;

            if (baseTechObject != null)
            {
                clone.baseTechObject = baseTechObject.Clone(clone);
            }

            clone.paramsManager = paramsManager.Clone();

            clone.modes = modes.Clone(clone);
            clone.modes.ModifyDevNames(TechNumber);
            clone.modes.ModifyRestrictObj(oldGlobalNum, newGlobalNum);

            clone.equipment = equipment.Clone(clone);
            clone.equipment.ModifyDevNames();

            clone.SetItems();
            return(clone);
        }
コード例 #2
0
ファイル: TechObject.cs プロジェクト: radtek/EasyEPLANner
        public TechObject Clone(GetN getN, int newNumber, int oldObjN,
                                int newObjN)
        {
            TechObject clone = (TechObject)MemberwiseClone();

            clone.techNumber = new TechObjectN(clone, newNumber);
            clone.techType   = new Editor.ObjectProperty("Тип", TechType);
            clone.nameBC     = new Editor.ObjectProperty("Имя объекта Monitor",
                                                         NameBC);
            clone.nameEplan       = new NameInEplan(NameEplan, clone);
            clone.s88Level        = new ObjS88Level(S88Level, clone);
            clone.attachedObjects = new AttachedToObjects(AttachedObjects.Value,
                                                          clone);

            clone.getN = getN;

            clone.baseTechObject = baseTechObject.Clone(clone);

            clone.parameters = parameters.Clone();

            clone.modes.ChngeOwner(clone);
            clone.modes = modes.Clone(clone);
            clone.modes.ModifyDevNames(TechNumber);
            clone.modes.ModifyRestrictObj(oldObjN, newObjN);

            clone.equipment = equipment.Clone(clone);
            clone.equipment.ModifyDevNames();

            clone.SetItems();
            return(clone);
        }