예제 #1
0
        void ESRI.ArcGIS.esriSystem.IClone.Assign(ESRI.ArcGIS.esriSystem.IClone src)
        {
            GIS.IGasPressureSymbol srcLogoSym = null;
            ESRI.ArcGIS.Display.IMarkerSymbol srcMarkerSym = null;
            ESRI.ArcGIS.Display.IMarkerSymbol recMarkerSym = null;
            ESRI.ArcGIS.Display.ISymbol srcSym = null;
            ESRI.ArcGIS.Display.ISymbol recSym = null;
            ESRI.ArcGIS.Display.ISymbolRotation srcRotSym = null;
            ESRI.ArcGIS.Display.ISymbolRotation recRotSym = null;
            ESRI.ArcGIS.Display.IMapLevel srcMapLev = null;
            ESRI.ArcGIS.Display.IMapLevel recMapLev = null;
            if (src != null)
            {
                if (src is GIS.IGasPressureSymbol)
                {
                    //  Assign custom interface properties of Source to Reciever.
                    //  Color objects are returned from these properties by value.
                    srcLogoSym = src as IGasPressureSymbol;
                    m_colorBorder = srcLogoSym.ColorBorder;
                    m_colorLeft = srcLogoSym.ColorLeft;
                    m_colorRight = srcLogoSym.ColorRight;
                    m_colorTop = srcLogoSym.ColorTop;

                    //  Assign IMarkerSymbol interface properties of Source to Reciever, but
                    //  dont need to set Color because this is set in ColorTop.
                    //  We know that a Logo markerSymbol implements IMarkerSymbol.
                    srcMarkerSym = src as IMarkerSymbol;
                    recMarkerSym = this;
                    recMarkerSym.Angle = srcMarkerSym.Angle;
                    recMarkerSym.Size = srcMarkerSym.Size;
                    recMarkerSym.XOffset = srcMarkerSym.XOffset;
                    recMarkerSym.YOffset = srcMarkerSym.YOffset;

                    //  Assign ISymbol interface properties of Source to Reciever.
                    //  We know that a Logo markerSymbol implements ISymbol.
                    srcSym = src as ISymbol;
                    recSym = this;
                    recSym.ROP2 = srcSym.ROP2;

                    //  Assign ISymbolRotation interface properties of Source to Reciever.
                    //  We know that a Logo markerSymbol implements ISymbolRotation.
                    srcRotSym = src as ISymbolRotation;
                    recRotSym = this;
                    recRotSym.RotateWithTransform = srcRotSym.RotateWithTransform;

                    //  Assign IMapLevel interface properties of Source to Reciever.
                    //  We know that a Logo markerSymbol implements IMapLevel.
                    srcMapLev = src as IMapLevel;
                    recMapLev = this;
                    recMapLev.MapLevel = srcMapLev.MapLevel;

                    //  Also implements IMarkerMask, but this interface has no properties, only
                    //  a method, and therefore we dont have to assign anything for IMarkerMask.
                    //  Also implements IDiplayName, but this interface only has one property,
                    //  which is read-only, so we dont set anything for IDisplayName either.
                }
            }
        }
예제 #2
0
        bool ESRI.ArcGIS.esriSystem.IClone.IsEqual(ESRI.ArcGIS.esriSystem.IClone other)
        {
            bool tempIClone_IsEqual = false;
            GIS.IGasPressureSymbol srcLogoSym = null;
            GIS.IGasPressureSymbol pRecLogoSym = null;
            ESRI.ArcGIS.Display.IMarkerSymbol srcMarkerSym = null;
            ESRI.ArcGIS.Display.IMarkerSymbol recMarkerSym = null;
            ESRI.ArcGIS.Display.ISymbol srcSym = null;
            ESRI.ArcGIS.Display.ISymbol recSym = null;
            ESRI.ArcGIS.Display.IDisplayName srcDispName = null;
            ESRI.ArcGIS.Display.IDisplayName recDispName = null;
            ESRI.ArcGIS.Display.ISymbolRotation srcSymRot = null;
            ESRI.ArcGIS.Display.ISymbolRotation recSymRot = null;
            ESRI.ArcGIS.Display.IMapLevel srcMapLev = null;
            ESRI.ArcGIS.Display.IMapLevel recMapLev = null;
            if (other != null)
            {
                if (other is GIS.IGasPressureSymbol)
                {

                    // Check for equality on default interface.
                    srcLogoSym = other as IGasPressureSymbol;
                    pRecLogoSym = this;
                    tempIClone_IsEqual = tempIClone_IsEqual & (System.Drawing.ColorTranslator.FromOle(System.Convert.ToInt32(pRecLogoSym.ColorBorder.RGB)).Equals(System.Drawing.ColorTranslator.FromOle(System.Convert.ToInt32(srcLogoSym.ColorBorder.RGB))));
                    tempIClone_IsEqual = tempIClone_IsEqual & (System.Drawing.ColorTranslator.FromOle(System.Convert.ToInt32(pRecLogoSym.ColorLeft.RGB)).Equals(System.Drawing.ColorTranslator.FromOle(System.Convert.ToInt32(srcLogoSym.ColorLeft.RGB))));
                    tempIClone_IsEqual = tempIClone_IsEqual & (System.Drawing.ColorTranslator.FromOle(System.Convert.ToInt32(pRecLogoSym.ColorRight.RGB)).Equals(System.Drawing.ColorTranslator.FromOle(System.Convert.ToInt32(srcLogoSym.ColorRight.RGB))));
                    tempIClone_IsEqual = tempIClone_IsEqual & (System.Drawing.ColorTranslator.FromOle(System.Convert.ToInt32(pRecLogoSym.ColorTop.RGB)).Equals(System.Drawing.ColorTranslator.FromOle(System.Convert.ToInt32(srcLogoSym.ColorTop.RGB))));

                    //  Check for equality on IMarkerSymbol interface.
                    //  We know that a LogoMarkerSymbol implements IMarkerSymbol.
                    srcMarkerSym = other as IMarkerSymbol;
                    recMarkerSym = this;
                    tempIClone_IsEqual = tempIClone_IsEqual & (recMarkerSym.Angle == srcMarkerSym.Angle);
                    tempIClone_IsEqual = tempIClone_IsEqual & (System.Drawing.ColorTranslator.FromOle(System.Convert.ToInt32(recMarkerSym.Color.RGB)).Equals(System.Drawing.ColorTranslator.FromOle(System.Convert.ToInt32(srcMarkerSym.Color.RGB))));
                    tempIClone_IsEqual = tempIClone_IsEqual & (recMarkerSym.Size == srcMarkerSym.Size);
                    tempIClone_IsEqual = tempIClone_IsEqual & (recMarkerSym.XOffset == srcMarkerSym.XOffset);
                    tempIClone_IsEqual = tempIClone_IsEqual & (recMarkerSym.YOffset == srcMarkerSym.YOffset);

                    //  Check for equality on ISymbol interface.
                    //  We know that a Logo markerSymbol implements ISymbol.
                    srcSym = other as ISymbol;
                    recSym = this;
                    tempIClone_IsEqual = tempIClone_IsEqual & (recSym.ROP2 == srcSym.ROP2);

                    //  Check for equality on IDisplayName interface.
                    //  We know that a Logo markerSymbol implements IDisplayName.
                    srcDispName = other as IDisplayName;
                    recDispName = this;
                    tempIClone_IsEqual = tempIClone_IsEqual & (recDispName.NameString == srcDispName.NameString);

                    //  Check for equality on ISymbolRotation
                    //  We know that a Logo markerSymbol implements IDisplayName.
                    srcSymRot = other as ISymbolRotation;
                    recSymRot = this;
                    tempIClone_IsEqual = tempIClone_IsEqual & (recSymRot.RotateWithTransform == srcSymRot.RotateWithTransform);

                    //  Check for equality on IMapLevel
                    //  We know that a Logo markerSymbol implements IMapLevel.
                    srcMapLev = other as IMapLevel;
                    recMapLev = this;
                    tempIClone_IsEqual = tempIClone_IsEqual & (recMapLev.MapLevel == srcMapLev.MapLevel);

                    //  Also implements IMarkerMask, but IMarkerMask has no properties to check.
                }
            }
            return tempIClone_IsEqual;
        }