Exemplo n.º 1
0
        public Area Dock(Area stBase, Dock cDock)
        {
            if (stBase.nWidth == 0 || stBase.nHeight == 0)
            {
                return(this);
            }
            Area stRetVal = this;

            if (cDock == null && (stRetVal.nLeft != 0 || stRetVal.nTop != 0))
            {
                cDock = new helpers.Dock(stRetVal.nLeft, stRetVal.nTop);
            }
            stRetVal.nLeft = 0;
            stRetVal.nTop  = 0;
            if (null != cDock)
            {
                switch (cDock.eCorner)
                {
                case helpers.Dock.Corner.upper_left:
                    stRetVal.nLeft = 0;
                    stRetVal.nTop  = 0;
                    break;

                case helpers.Dock.Corner.upper_right:
                    stRetVal.nLeft = (short)(stBase.nWidth - nWidth);
                    stRetVal.nTop  = 0;
                    break;

                case helpers.Dock.Corner.bottom_left:
                    stRetVal.nLeft = 0;
                    stRetVal.nTop  = (short)(stBase.nHeight - nHeight);
                    break;

                case helpers.Dock.Corner.bottom_right:
                    stRetVal.nLeft = (short)(stBase.nWidth - nWidth);
                    stRetVal.nTop  = (short)(stBase.nHeight - nHeight);
                    break;

                case helpers.Dock.Corner.center:
                    stRetVal.nLeft = (short)Math.Round((float)(stBase.nWidth - nWidth) / 2);
                    stRetVal.nTop  = (short)Math.Round((float)(stBase.nHeight - nHeight) / 2);
                    break;

                case helpers.Dock.Corner.center_horizontal:
                    stRetVal.nLeft = (short)Math.Round((float)(stBase.nWidth - nWidth) / 2);
                    break;

                case helpers.Dock.Corner.center_vertical:
                    stRetVal.nTop = (short)Math.Round((float)(stBase.nHeight - nHeight) / 2);
                    break;

                case helpers.Dock.Corner.unknown:
                    return(this);
                }
                stRetVal.nLeft += cDock.cOffset.nLeft;
                stRetVal.nTop  += cDock.cOffset.nTop;
            }
            return(stRetVal);
        }
Exemplo n.º 2
0
 public void Create(string sFilename, helpers.Dock cDock, ushort nZ, ulong nFrameStart, ulong nDuration, bool bOpacity, ulong nDelay)
 {
     if (null == OnCreate)
     {
         throw new Exception("shared:video:create: отсутствует привязка к серверу объектов [hc:" + GetHashCode() + "]");
     }
     OnCreate(this, sFilename, cDock, nZ, nFrameStart, nDuration, bOpacity, nDelay);
 }
Exemplo n.º 3
0
 public void Create(helpers.Dock cDock, ushort nZ, bool bStopOnEmpty, bool bOpacity, ulong nDelay)
 {
     (new Logger()).WriteDebug3("shared:playlist:create:in [hc:" + GetHashCode() + "]");
     this.bStopOnEmpty = bStopOnEmpty;
     if (null == OnCreate)
     {
         throw new Exception("shared:playlist:create: отсутствует привязка к серверу объектов [hc:" + GetHashCode() + "]");
     }
     (new Logger()).WriteDebug3("shared:playlist:create: before callback [hc:" + GetHashCode() + "]");
     OnCreate(this, cDock, nZ, bStopOnEmpty, bOpacity, nDelay);
     (new Logger()).WriteDebug3("shared:playlist:create:return [hc:" + GetHashCode() + "]");
 }
Exemplo n.º 4
0
 public void Create(string sFolder, ushort nLoopsQty, bool bKeepAlive, helpers.Dock cDock, ushort nZ, bool bOpacity, ulong nDelay, float nPixelAspectRatio, bool bTurnOffQueue)
 {
     if (null == OnCreate)
     {
         throw new Exception("shared:animation:create: отсутствует привязка к серверу объектов [hc:" + GetHashCode() + "]");
     }
     try
     {
         OnCreate(this, sFolder, nLoopsQty, bKeepAlive, cDock, nZ, bOpacity, nDelay, nPixelAspectRatio, bTurnOffQueue);
     }
     catch (Exception ex)
     {
         (new Logger()).WriteError(ex);
     }
 }