Ejemplo n.º 1
0
        /// <summary>
        /// 构造
        /// </summary>
        /// <param name="ic"></param>
        public CVRInfoExTask(Infocenter ic)
        {
            _ic           = ic;
            _ic.Notified += _ic_Notified;
            _ieo          = OpFactory <InfoExOp> .Create(_ic);

            Status = CVRInfoExStatus.Unknown;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 构造
        /// </summary>
        /// <param name="ic"></param>
        public CVRTableTask(Infocenter ic)
        {
            _timer.Elapsed += _timer_Elapsed;

            _ic           = ic;
            _ic.Notified += _ic_Notified;
            _to           = OpFactory <TableOp> .Create(_ic);
        }
Ejemplo n.º 3
0
 private void Bye()
 {
     try
     {
         OpFactory <ByeOp> .Create(_instance).Say(Id, "shutdown itself");
     }
     catch
     {
     }
 }
Ejemplo n.º 4
0
        public CVResDownloadTask(Infocenter ic, Datacenter dc)
        {
            _ic           = ic;
            _ic.Notified += _ic_Notified;

            _dc          = dc;
            _dc.Began   += _dc_Began;
            _dc.Stepped += _dc_Stepped;
            _dc.Ended   += _dc_Ended;

            _to = OpFactory <TableOp> .Create(_ic);

            _to.Format = ResultFormat.Xml;

            UseMemory = false;
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 启动
        /// </summary>
        public void Start()
        {
            if (_client == null)
            {
                //复位RC4输入输出增量值
                CustomRC4Key.CreateCustomRC4Key().BuildKey();
                _instance.Connect();

                Thread thread = new Thread(ParseMinaQueueThread);
                thread.IsBackground = true;
                thread.Start();

                //登录
                OpFactory <UserOp> .Create(_instance).Get(_user, _pwd, Id, "self-connecting logon");
            }
            else
            {
                _instance.Notified?.Invoke(CVResult.InfocenterAlreadyStarted, _instance);
            }
        }
Ejemplo n.º 6
0
        private void ConnectCallback(IAsyncResult ar)
        {
            try
            {
                Socket client = (Socket)ar.AsyncState;
                client.EndConnect(ar);

                //连接成功,创建剖析器
                _parser           = new InfocenterParser(this);
                _parser.Notified += _parser_Info;

                //创建日志读写操作
                _logTableOp = OpFactory <TableOp> .Create(_instance);

                while (true)
                {
                    if (_client != null)
                    {
                        byte[] buff      = new byte[_bufferSize];
                        int    bytesRead = _client.Receive(buff);
                        _minaQueue.Enqueue(buff, bytesRead);
                    }
                    else
                    {
                        break;
                    }
                    Thread.Sleep(10);
                }
            }
            catch (SocketException ex)
            {
                Reset();

                Notified?.Invoke(ex.SocketErrorCode == SocketError.TimedOut
                    ? CVResult.ServerConnectTimeouted : CVResult.ConnectFailed, ex);
            }
        }
Ejemplo n.º 7
0
        private void _dc_Ended(IDataOpItem item)
        {
            if (item is UploadDataItem)
            {
                UploadDataItem udi = item as UploadDataItem;

                if (udi.Success)
                {
                    string source = udi.Tag as string;
                    string crc    = FileMD5.Create(udi.Source);
                    string name   = Kits.GetFilename(source);

                    string pathname = _dc.GetPathfileByRemotePathfile(udi.Target);

                    ResourceOp rop = OpFactory <ResourceOp> .Create(_ic);

                    rop.Add(pathname, name, udi.Group, 0, udi.Version, Kits.GetLastWriteTime(source), udi.Remark, "cvraddresource", crc);
                }
                else
                {
                    Notified?.Invoke(CVReSubmitResult.UploadFailed, udi.Message);
                }
            }
        }
Ejemplo n.º 8
0
 internal DatetimeMethodEnumMetaData(string nameCamel, OpFactory opFactory, DotMethodFP[] footprints)
 {
     NameCamel  = nameCamel;
     OpFactory  = opFactory;
     Footprints = footprints;
 }
Ejemplo n.º 9
0
        /// <summary>
        /// 下载,todo测试
        /// </summary>
        /// <param name="id"></param>
        /// <param name="folder"></param>
        /// <param name="version"></param>
        /// <param name="versionname"></param>
        public void Download(string id, int folder, int version, string versionname)
        {
            ResourceOp rop = OpFactory <ResourceOp> .Create(_ic);

            rop.Get(id);
        }
Ejemplo n.º 10
0
        /// <summary>
        /// 下载
        /// </summary>
        /// <param name="id"></param>
        public void Download(string id)
        {
            ResourceOp rop = OpFactory <ResourceOp> .Create(_ic);

            rop.Get(id);
        }
 public BinaryExpressionOperation(dynamic expression)
 {
     _left      = OpFactory.Factory(expression.Left);
     _rigth     = OpFactory.Factory(expression.Right);
     _operation = expression.Operator;
 }