Exemplo n.º 1
0
        //copy all field values, loop items and copy all field values
        //http://www.codeproject.com/csharp/cloneimpl_class.asp
        public DfsUtilities Clone()
        {
            DfsUtilities dolly = new DfsUtilities();

            dolly.compressed               = compressed;
            dolly.DataType                 = DataType;
            dolly.delVal                   = delVal;
            dolly.dfsFileType              = dfsFileType;
            dolly.FileTitle                = FileTitle;
            dolly.Latitude                 = Latitude;
            dolly.Longitude                = Longitude;
            dolly.Orientation              = Orientation;
            dolly.pFile                    = pFile;
            dolly.pHeader                  = pHeader;
            dolly.Projection               = Projection;
            dolly.Projection_type          = Projection_type;
            dolly.statType                 = statType;
            dolly.tAxis_dTStart            = tAxis_dTStart;
            dolly.tAxis_dTStep             = tAxis_dTStep;
            dolly.tAxis_EUMUnit            = tAxis_EUMUnit;
            dolly.tAxis_EUMUnitStr         = tAxis_EUMUnitStr;
            dolly.tAxis_indexTStart        = tAxis_indexTStart;
            dolly.tAxis_nTSteps            = tAxis_nTSteps;
            dolly.tAxis_StartDateStr       = tAxis_StartDateStr;
            dolly.tAxis_StartTimeStr       = tAxis_StartTimeStr;
            dolly.tAxisType                = tAxisType;
            dolly.CustomBlockName          = CustomBlockName;
            dolly.m21CustBlock.ori         = m21CustBlock.ori;
            dolly.m21CustBlock.f1          = m21CustBlock.f1;
            dolly.m21CustBlock.f2          = m21CustBlock.f2;
            dolly.m21CustBlock.f3          = m21CustBlock.f3;
            dolly.m21CustBlock.f4          = m21CustBlock.f4;
            dolly.m21CustBlock.f5          = m21CustBlock.f5;
            dolly.m21CustBlock.f6          = m21CustBlock.f6;
            dolly.dfsuCustBlock.Dim        = dfsuCustBlock.Dim;
            dolly.dfsuCustBlock.NoElemTot  = dfsuCustBlock.NoElemTot;
            dolly.dfsuCustBlock.NoLayers   = dfsuCustBlock.NoLayers;
            dolly.dfsuCustBlock.NoNodesTot = dfsuCustBlock.NoNodesTot;
            dolly.encodeKeySize            = encodeKeySize;
            if (compressed)
            {
                dolly.compress_XKey = compress_XKey;
                dolly.compress_YKey = compress_YKey;
                dolly.compress_ZKey = compress_ZKey;
            }
            if (custBlockDataFloat != null)
            {
                dolly.custBlockDataFloat = new float[custBlockDataFloat.Length]; System.Array.Copy(custBlockDataFloat, dolly.custBlockDataFloat, custBlockDataFloat.Length);
            }
            if (custBlockDataInt != null)
            {
                dolly.custBlockDataInt = new int[custBlockDataInt.Length]; System.Array.Copy(custBlockDataInt, dolly.custBlockDataInt, custBlockDataInt.Length);
            }

            dolly.readStaticDataOnRead   = readStaticDataOnRead;
            dolly.writeStaticDataOnWrite = writeStaticDataOnWrite;
            dolly.staticItems            = new DfsItemInfo[staticItems.Length];
            for (int i = 0; i < staticItems.Length; i++)
            {
                dolly.staticItems[i] = staticItems[i].Clone();
            }

            dolly.Items = new DfsItemInfo[Items.Length];
            for (int i = 0; i < Items.Length; i++)
            {
                dolly.Items[i] = Items[i].Clone();
            }

            return(dolly);
        }