Inheritance: MonoBehaviour
Exemple #1
0
        public void ManageSubChannelsUsingClassesAndInterfacesUpdateOnUnsubscribeAll()
        {
            var es  = new EventStream(false);
            var tm1 = new CC();
            var tm2 = new CCATBT();
            var a1  = CreateTestProbe();
            var a2  = CreateTestProbe();
            var a3  = CreateTestProbe();
            var a4  = CreateTestProbe();

            es.Subscribe(a1.Ref, typeof(AT)).ShouldBeTrue();
            es.Subscribe(a2.Ref, typeof(BT)).ShouldBeTrue();
            es.Subscribe(a3.Ref, typeof(CC)).ShouldBeTrue();
            es.Subscribe(a4.Ref, typeof(CCATBT)).ShouldBeTrue();
            es.Unsubscribe(a3.Ref).ShouldBeTrue();
            es.Publish(tm1);
            es.Publish(tm2);
            a1.ExpectMsg((object)tm2);
            a2.ExpectMsg((object)tm2);
            a3.ExpectNoMsg(TimeSpan.FromSeconds(1));
            a4.ExpectMsg((object)tm2);
            es.Unsubscribe(a1.Ref, typeof(AT)).ShouldBeTrue();
            es.Unsubscribe(a2.Ref, typeof(BT)).ShouldBeTrue();
            es.Unsubscribe(a3.Ref, typeof(CC)).ShouldBeFalse();
            es.Unsubscribe(a4.Ref, typeof(CCATBT)).ShouldBeTrue();
        }
Exemple #2
0
        static void Main(string[] args)
        {
            ClientClass CC;
            string      data = "";

            if (args.Length == 0)
            {
                CC = new ClientClass();
            }
            else
            {
                CC = new ClientClass(args[0]);
            }

            System.Console.WriteLine("----------------------------------------------------------------------");
            System.Console.WriteLine("----------------------------------------------------------------------");
            System.Console.WriteLine("FORMAT: <Enter AccountNumber (0-9)><Enter Amount (-x to withdraw, +x to deposit)>");
            System.Console.WriteLine("Example: 2+100 => will deposit 100 to account #2.");
            System.Console.WriteLine("Example: 2-50 => will withdraw 50 from account #2");
            System.Console.WriteLine("\nType exit to shutdown");
            System.Console.WriteLine("----------------------------------------------------------------------");
            System.Console.WriteLine("----------------------------------------------------------------------");

            while (true)
            {
                System.Console.WriteLine("Enter command:");
                data = data = Console.ReadLine();
                if (data == "exit")
                {
                    break;
                }
                CC.StartClient(data);
                System.Console.WriteLine("************************************");
            }
        }
Exemple #3
0
        public void ContectedCompoentTest()
        {
            using (StreamReader sr = new StreamReader(@"E:\Study\ALG2017\ALGRKC\dataSelf\tinyG.txt"))
            {
                Graph g = new Graph(sr);

                CC c = new CC(g);

                int           count   = c.Count();
                Queue <int>[] ccQueue = new Queue <int> [count];
                for (int i = 0; i < count; i++)
                {
                    ccQueue[i] = new Queue <int>();
                }

                for (int i = 0; i < g.V(); i++)
                {
                    ccQueue[c.id(i)].Enqueue(i);
                }

                int current;
                for (int i = 0; i < count; i++)
                {
                    Console.Write("CC " + i + " : ");
                    while (ccQueue[i].Count > 1)
                    {
                        current = ccQueue[i].Dequeue();
                        Console.Write(current + ", ");
                    }
                    current = ccQueue[i].Dequeue();
                    Console.WriteLine(current); // wrtie the last one in the current set
                }
            }
        }
Exemple #4
0
        public void SendMail()
        {
            var recipients = new List <MapiRecipDesc>();

            To.ForEach(email => recipients.Add(new MapiRecipDesc {
                recipClass = RecipClass.To, name = email
            }));
            CC.ForEach(email => recipients.Add(new MapiRecipDesc {
                recipClass = RecipClass.CC, name = email
            }));
            BCC.ForEach(email => recipients.Add(new MapiRecipDesc {
                recipClass = RecipClass.BCC, name = email
            }));

            var msg = new MapiMessage {
                subject = Subject, noteText = Body,
                recips  = GetRecipientsData(recipients), recipCount = recipients.Count,
                files   = GetAttachmentsData(Attachments), fileCount = Attachments.Count,
            };

            int result = MAPISendMail(IntPtr.Zero, IntPtr.Zero, msg, MAPI_LOGON_UI | MAPI_DIALOG, 0);

            if (result > 1)
            {
                throw new Exception("Failed to send mail: {0}.".Fmt(GetErrorMessage(result)));
            }
            Cleanup(msg);
        }
Exemple #5
0
        public void ManageSubChannelsUsingClassesAndInterfacesUpdateOnUnsubscribeAll()
        {
            var es  = new EventStream(false);
            var tm1 = new CC();
            var tm2 = new CCATBT();
            var a1  = TestProbe();
            var a2  = TestProbe();
            var a3  = TestProbe();
            var a4  = TestProbe();

            es.Subscribe(a1.Ref, typeof(AT)).Then(Assert.IsTrue);
            es.Subscribe(a2.Ref, typeof(BT)).Then(Assert.IsTrue);
            es.Subscribe(a3.Ref, typeof(CC)).Then(Assert.IsTrue);
            es.Subscribe(a4.Ref, typeof(CCATBT)).Then(Assert.IsTrue);
            es.Unsubscribe(a3.Ref).Then(Assert.IsTrue);
            es.Publish(tm1);
            es.Publish(tm2);
            a1.expectMsg(tm2);
            a2.expectMsg(tm2);
            a3.expectNoMsg(TimeSpan.FromSeconds(1));
            a4.expectMsg(tm2);
            es.Unsubscribe(a1.Ref, typeof(AT)).Then(Assert.IsTrue);
            es.Unsubscribe(a2.Ref, typeof(BT)).Then(Assert.IsTrue);
            es.Unsubscribe(a3.Ref, typeof(CC)).Then(Assert.IsFalse);
            es.Unsubscribe(a4.Ref, typeof(CCATBT)).Then(Assert.IsTrue);
        }
    /**/ public static void main(string[] strarr)
    {
        In    i     = new In(strarr[0]);
        Graph graph = new Graph(i);
        CC    cC    = new CC(graph);
        int   num   = cC.count();

        StdOut.println(new StringBuilder().append(num).append(" components").toString());
        Queue[] array = (Queue[])new Queue[num];
        for (int j = 0; j < num; j++)
        {
            array[j] = new Queue();
        }
        for (int j = 0; j < graph.V(); j++)
        {
            array[cC.id(j)].enqueue(Integer.valueOf(j));
        }
        for (int j = 0; j < num; j++)
        {
            Iterator iterator = array[j].iterator();
            while (iterator.hasNext())
            {
                int i2 = ((Integer)iterator.next()).intValue();
                StdOut.print(new StringBuilder().append(i2).append(" ").toString());
            }
            StdOut.println();
        }
    }
Exemple #7
0
 public void SetUserReadStatus(User user, bool read)
 {
     if (Receivers.Contains(user) || BCC.Contains(user) || CC.Contains(user))
     {
         IsRead[user.Email] = read;
     }
 }
Exemple #8
0
    public static int Main(string[] arg)
    {
        Console.WriteLine("Before allocation: {0}", TestMark.GetCommitted());

        CC cc = new CC(500000);

        cc.array[1024].t1   = new A();
        cc.array[1024].t1.a = 3;
        cc.array[1024].t2   = new B();
        cc.array[1024].t2.b = 4;

        long a = TestMark.GetCommitted();

        Console.WriteLine("After allocation: {0}", a);
        Console.WriteLine();
        Console.WriteLine("Collecting...");
        for (int i = 0; i < 100; i++)
        {
            GC.Collect();
        }

        long b = TestMark.GetCommitted();

        Console.WriteLine("After 100 Collections: {0}", b);
        GC.KeepAlive(cc);

        if (Math.Abs(b - a) > (a / 2))
        {
            Console.WriteLine("failed");
            return(0);
        }

        Console.WriteLine("passed");
        return(100);
    }
Exemple #9
0
    void Update()
    {
        switch (State)
        {
        case 1:
        {
            Charge();
            break;
        }

        case 2:
        {
            if (Unstuntime < Time.time)
            {
                ReadyForCharge();
                HorizontalSpeed = MaxSpeed;
            }
            break;
        }
        }
        Vector3 movement = transform.forward * HorizontalSpeed;

        movement += new Vector3(0, Gravity, 0);
        CC.Move(movement * Time.deltaTime);
    }
Exemple #10
0
    // 중력 적용
    // 이동 방향 벡터 y값에 중력값을 계속 더해준다
    void SetGravity()
    {
        // 중력 적용
        Vector3 yDirection = new Vector3(0, -gravity * Time.deltaTime, 0);

        CC.Move(yDirection * 10 * Time.deltaTime);
    }
        public void Manage_sub_channels_using_classes_and_interfaces_update_on_unsubscribe()
        {
            var es  = new EventStream(false);
            var tm1 = new CC();
            var tm2 = new CCATBT();
            var a1  = CreateTestProbe();
            var a2  = CreateTestProbe();
            var a3  = CreateTestProbe();
            var a4  = CreateTestProbe();

            es.Subscribe(a1.Ref, typeof(AT));
            es.Subscribe(a2.Ref, typeof(BT));
            es.Subscribe(a3.Ref, typeof(CC));
            es.Subscribe(a4.Ref, typeof(CCATBT));
            es.Unsubscribe(a3.Ref, typeof(CC));
            es.Publish(tm1);
            es.Publish(tm2);
            a1.ExpectMsg((object)tm2);
            a2.ExpectMsg((object)tm2);
            a3.ExpectNoMsg(TimeSpan.FromSeconds(1));
            a4.ExpectMsg((object)tm2);
            es.Unsubscribe(a1.Ref, typeof(AT)).ShouldBeTrue();
            es.Unsubscribe(a2.Ref, typeof(BT)).ShouldBeTrue();
            es.Unsubscribe(a3.Ref, typeof(CC)).ShouldBeFalse();
            es.Unsubscribe(a4.Ref, typeof(CCATBT)).ShouldBeTrue();
        }
Exemple #12
0
 // Start is called before the first frame update
 void Start()
 {
     Aku = gameObject.GetComponent <PrangsangHeal>();
     SliderGobj.SetActive(false);
     Invoke("onStartGame", 2);
     CC = gameObject.GetComponent <CC>();
 }
Exemple #13
0
        public static bool TrySetPosition(double position_mm)
        {
            string errorCode       = "";
            string errorString     = "";
            string controllerState = "";

            ConnexCcLock.DoJobOnSerial((CC, addr) =>
            {
                CC.TS(addr, out errorCode, out controllerState, out errorString);
                return(true);
            });


            if ((controllerState == "32") | (controllerState == "33") | (controllerState == "34"))
            {
                double position = 0.0;

                ConnexCcLock.DoJobOnSerial((CC, addr) =>
                {
                    CC.PA_Set(addr, position_mm, out errorString);
                    CC.TP(addr, out position, out errorString);
                    return(true);
                });

                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemple #14
0
    public void PlayMovementAction(FanaticBattleType actionType)
    {
        float speed = 0;

        switch (actionType)
        {
        case FanaticBattleType.Walk_forward:
            SetMoveType(MoveType.WalkForward);
            LockRotation = false;
            speed        = WalkSpeed;

            break;

        case FanaticBattleType.Walk_left:
            SetMoveType(MoveType.Left);

            m_desiredMoveDirection = transform.right * -1;
            if (!TCP_SendMovement(WalkSpeed))
            {
                CC.Move(m_desiredMoveDirection * WalkSpeed * Time.deltaTime);
            }

            m_isMovementAction = true;
            return;

        case FanaticBattleType.Walk_right:
            SetMoveType(MoveType.Right);

            m_desiredMoveDirection = transform.right;
            if (!TCP_SendMovement(WalkSpeed))
            {
                CC.Move(m_desiredMoveDirection * WalkSpeed * Time.deltaTime);
            }

            m_isMovementAction = true;
            return;

        case FanaticBattleType.Run:
            SetMoveType(MoveType.RunForward);
            LockRotation = false;
            speed        = RunSpeed;

            break;

        case FanaticBattleType.FastRun:
            SetMoveType(MoveType.FastRun);
            LockRotation = false;
            speed        = RunSpeed;

            break;

        default:
            m_isMovementAction = false;
            return;
        }

        SetMoveDirection(speed);
        m_isMovementAction = true;
    }
Exemple #15
0
        public ActionResult DeleteConfirmed(int id)
        {
            CC cC = db.CCs.Find(id);

            db.CCs.Remove(cC);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #16
0
 protected StepMenuControl(UnsMachineLogic logic, string name, ModelType type)
 {
     this.name = name;
     this.type = type;
     this.cc   = new CC {
         logic = logic
     };
 }
Exemple #17
0
 public EmailResult GoiMailLienHe(LienHeModel model)
 {
     To.Add(model.HuongDanSuDung);
     CC.Add("*****@*****.**");
     From    = "*****@*****.**";
     Subject = "Thông tin liên hệ Beautygarden";
     return(Email("GoiMailLienHe", model));
 }
Exemple #18
0
 public EmailResult GoiMailDangKy(KhachHangModel model)
 {
     To.Add(model.Email);
     CC.Add("*****@*****.**");
     From    = "*****@*****.**";
     Subject = "Thông tin đăng ký thành viên tại Beautygarden!";
     return(Email("GoiMailDangKy", model));
 }
Exemple #19
0
 public void PlayAA()
 {
     AA.Play();
     BB.Play();
     CC.Play();
     DD.Play();
     EE.Play();
 }
Exemple #20
0
        public ConnectionSettings Clone()
        {
            ConnectionSettings rc      = new ConnectionSettings(_forum);
            CookieCollection   cookies = CC.GetCookies(_forum);

            rc.CC.Add(cookies);
            return(rc);
        }
Exemple #21
0
 public EmailResult GoiMailThanhToan(CartViewModel.OrderModel model)
 {
     To.Add(model.CartForm.Email);
     CC.Add("*****@*****.**");
     From    = "*****@*****.**";
     Subject = "Đơn đặt hàng tại Beautygarden";
     return(Email("GoiMailThanhToan", model));
 }
Exemple #22
0
        public void CopyFrom(ScreenEffectsSet s)
        {
            cam.farClipPlane              = s.cam.farClipPlane;
            cam.nearClipPlane             = s.cam.nearClipPlane;
            BloomEffect.enabled           = s.BloomEffect.enabled;
            BloomEffect.bloomIntensity    = s.BloomEffect.bloomIntensity;
            BloomEffect.lensDirtIntensity = s.BloomEffect.lensDirtIntensity;
            BloomEffect.lensDirtTexture   = s.BloomEffect.lensDirtTexture;

            Vignette.enabled             = s.Vignette.enabled;
            Vignette.intensity           = s.Vignette.intensity;
            Vignette.blur                = s.Vignette.blur;
            Vignette.chromaticAberration = s.Vignette.chromaticAberration;

            Blur.enabled = s.Blur.enabled;

            ColorGrading.enabled = s.ColorGrading.enabled;

            Overlay.enabled   = s.Overlay.enabled;
            Overlay.intensity = s.Overlay.intensity;
            Overlay.blendMode = s.Overlay.blendMode;
            Overlay.texture   = s.Overlay.texture;

            Hallucination.enabled = s.Hallucination.enabled;

            SunShaftsEffect.enabled              = s.SunShaftsEffect.enabled;
            SunShaftsEffect.resolution           = s.SunShaftsEffect.resolution;
            SunShaftsEffect.screenBlendMode      = s.SunShaftsEffect.screenBlendMode;
            SunShaftsEffect.sunTransform         = s.SunShaftsEffect.sunTransform;
            SunShaftsEffect.radialBlurIterations = s.SunShaftsEffect.radialBlurIterations;
            SunShaftsEffect.sunColor             = s.SunShaftsEffect.sunColor;
            SunShaftsEffect.sunShaftBlurRadius   = s.SunShaftsEffect.sunShaftBlurRadius;
            SunShaftsEffect.sunShaftIntensity    = s.SunShaftsEffect.sunShaftIntensity;
            SunShaftsEffect.useSkyBoxAlpha       = s.SunShaftsEffect.useSkyBoxAlpha;
            SunShaftsEffect.maxRadius            = s.SunShaftsEffect.maxRadius;
            SunShaftsEffect.useDepthTexture      = s.SunShaftsEffect.useDepthTexture;

            SSAO.enabled = s.SSAO.enabled;

            Grain.enabled = s.Grain.enabled;

            CC.enabled           = s.CC.enabled;
            CC.redChannel.keys   = s.CC.redChannel.keys;
            CC.greenChannel.keys = s.CC.greenChannel.keys;
            CC.blueChannel.keys  = s.CC.blueChannel.keys;
            CC.UpdateTextures();

            AA.enabled = s.AA.enabled;

            Fog.enabled        = s.Fog.enabled;
            Fog.bEnableFog     = s.Fog.bEnableFog;
            Fog.fogMode        = s.Fog.fogMode;
            Fog.globalDensity  = s.Fog.globalDensity;
            Fog.globalFogColor = s.Fog.globalFogColor;
            Fog.height         = s.Fog.height;
            Fog.heightScale    = s.Fog.heightScale;
            Fog.startDistance  = s.Fog.startDistance;
        }
Exemple #23
0
 private void CleanCollections()
 {
     To?.RemoveAll(s => s == null);
     CC?.RemoveAll(s => s == null);
     BCC?.RemoveAll(s => s == null);
     ReplyToList?.RemoveAll(s => s == null);
     Headers?.RemoveAll(s => s == null);
     Attachments?.RemoveAll(s => s == null);
 }
Exemple #24
0
            void Handle(Input.AutoSignT Action)
            {
                CC  cc = null;
                CU  cu = null;
                var p  = this.Parent as MasterPage;

                // Iki sekli var.
                // 1.Client/Admin [email protected]
                // 2.Client/User [email protected]/1

                cc = Db.SQL <CC>("select r from CC r where r.Token = ?", Token).FirstOrDefault();
                if (cc == null)
                {
                    cu = Db.SQL <CU>("select r from CU r where r.Token = ?", Token).FirstOrDefault();
                    if (cu != null)
                    {
                        cc        = cu.CC;
                        p.Token   = Token;
                        Email     = cu.Email;
                        OpnDlgTxt = cu.Ad; // "Oturum Kapat";
                        p.CCId    = (long)cc.Id;
                        p.CUId    = (long)cu.Id;

                        p.MorphUrl = $"/mm0/PPs/{cc.Id}";
                        Msj        = "Signed";
                        Hlp.Write2Log($"SignInA {cu.Email}");
                    }
                    else
                    {
                        Token         = "";
                        p.Token       = "";
                        OpnDlgTxt     = "Oturum Aç";
                        p.CurrentPage = null;
                        p.MorphUrl    = "/mm0/AboutPage";
                        Msj           = "";
                        Hlp.Write2Log("SignIn");
                    }
                }
                else
                {
                    p.Token    = Token;
                    Email      = cc.Email;
                    OpnDlgTxt  = "Oturum Kapat";
                    p.CCId     = (long)cc.Id;
                    p.CUId     = 0;
                    p.MorphUrl = $"/mm0/PPs/{cc.Id}";
                    Msj        = "Signed";
                    Hlp.Write2Log($"SignInA {cc.Email}");
                }

                /*
                 * Session.RunTaskForAll((s, id) =>
                 * {
                 *  s.CalculatePatchAndPushOnWebSocket();
                 * });
                 */
            }
    public override void FallingCtrl(float Speed)
    {
        Vector3 moveDirection = Vector3.zero;

        moveDirection  = new Vector3(Input.GetAxis("Horizontal"), 0, Input.GetAxis("Vertical"));
        moveDirection  = transform.TransformDirection(moveDirection);
        moveDirection *= Speed;
        CC.Move(moveDirection * Time.fixedDeltaTime);
    }
Exemple #26
0
        /// <summary>
        /// SMTP邮件Sender的类的封装
        /// </summary>
        /// <param name="smtpServer">smtp服务地址</param>
        /// <param name="port">端口号</param>
        /// <param name="userName">用户名</param>
        /// <param name="password">密码</param>
        /// <param name="enableSSL">是否采用ssl的方式</param>
        public override bool Send(string smtpServer, int port, string userName, string password, bool enableSSL)
        {
            bool isSended = false;

            try
            {
                MailMessage message = new MailMessage();
                To.ForEach(email =>
                {
                    if (email.IsValidEmail())
                    {
                        message.To.Add(email);
                    }
                });
                message.Sender = new MailAddress(userName, userName);
                if (CC != null && CC.Any())
                {
                    CC.ForEach(email =>
                    {
                        if (email.IsValidEmail())
                        {
                            message.CC.Add(email);
                        }
                    });
                }
                message.Subject = Encoding.Default.GetString(Encoding.Default.GetBytes(Subject));

                message.From = DisplayName.IsBlank() ? new MailAddress(From) : new MailAddress(From, Encoding.Default.GetString(Encoding.Default.GetBytes(DisplayName)));

                message.Body                        = Encoding.Default.GetString(Encoding.Default.GetBytes(Body));
                message.BodyEncoding                = Encoding.GetEncoding("GBK");
                message.HeadersEncoding             = Encoding.UTF8;
                message.SubjectEncoding             = Encoding.UTF8;
                message.IsBodyHtml                  = true;
                message.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure;
                message.ReplyToList.Add(new MailAddress(From));

                SmtpClient smtp = new SmtpClient(smtpServer, port)
                {
                    DeliveryMethod        = SmtpDeliveryMethod.Network,
                    UseDefaultCredentials = false,
                    Credentials           = new NetworkCredential(userName, password),
                    Timeout   = 30000,
                    EnableSsl = enableSSL
                };

                smtp.SendCompleted += smtp_SendCompleted;
                smtp.Send(message);
                isSended = true;
            }
            catch (Exception ex)
            {
                Logger.Log("邮件发送失败:", ex);
            }
            return(isSended);
        }
Exemple #27
0
        /// <summary>
        /// Austragen durch anderen Benutzer
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public EmailResult RemoveSubscription(SubscriptionMailModel model)
        {
            InitSenderTopic(MAIL_SECTION_SUBSCRIPTIONS);
            To.Add(model.User.Email);
            CC.Add(model.SenderUser.Email);

            Subject = "Ihre Eintragung in " + model.Summary.Name;

            return(Email("RemoveSubscription", model));
        }
Exemple #28
0
 public ActionResult Edit([Bind(Include = "CCID,CCName,CCDescription")] CC cC)
 {
     if (ModelState.IsValid)
     {
         db.Entry(cC).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(cC));
 }
    public static string GetDBPassword(string DBPassword, string PwdSalt)
    {
        CC.DecryptPassword(ref DBPassword);
        if (!string.IsNullOrEmpty(PwdSalt) && DBPassword.StartsWith(PwdSalt))
        {
            DBPassword = DBPassword.Substring(PwdSalt.Length, DBPassword.Length - PwdSalt.Length);
        }

        return(DBPassword);
    }
    public override void Jump(float jumpSpeed)
    {
        Vector3 moveDirection = Vector3.zero;

        if (CC.isGrounded)
        {
            moveDirection.y += jumpSpeed * Time.fixedDeltaTime;
        }
        CC.Move(moveDirection * Time.fixedDeltaTime);
    }
Exemple #31
0
 public void AddEdge(int from, int to, CC when)
 {
     AddEdge(from, to, when == null ? -2 : -1, when);
 }
		public InnerDashPatternComboBox()
		{
			InitializeComponent();

			var _valueBinding = new Binding();
			_valueBinding.Source = this;
			_valueBinding.Path = new PropertyPath(_nameOfValueProp);
			_valueConverter = new CC(this);
			_valueBinding.Converter = _valueConverter;
			_valueBinding.ValidationRules.Add(new ValidationWithErrorString(_valueConverter.EhValidateText));
			this.SetBinding(ComboBox.TextProperty, _valueBinding);

			_img.Source = GetImage(SelectedDashStyle);
		}
Exemple #33
0
        public void Manage_sub_channels_using_classes_and_interfaces_update_on_unsubscribe()
        {
            var es = new EventStream(false);
            var tm1 = new CC();
            var tm2 = new CCATBT();
            var a1 = CreateTestProbe();
            var a2 = CreateTestProbe();
            var a3 = CreateTestProbe();
            var a4 = CreateTestProbe();

            es.Subscribe(a1.Ref, typeof(AT));
            es.Subscribe(a2.Ref, typeof(BT));
            es.Subscribe(a3.Ref, typeof(CC));
            es.Subscribe(a4.Ref, typeof(CCATBT));
            es.Unsubscribe(a3.Ref, typeof(CC));
            es.Publish(tm1);
            es.Publish(tm2);
            a1.ExpectMsg((object)tm2);
            a2.ExpectMsg((object)tm2);
            a3.ExpectNoMsg(TimeSpan.FromSeconds(1));
            a4.ExpectMsg((object)tm2);
            es.Unsubscribe(a1.Ref, typeof(AT)).ShouldBeTrue();
            es.Unsubscribe(a2.Ref, typeof(BT)).ShouldBeTrue();
            es.Unsubscribe(a3.Ref, typeof(CC)).ShouldBeFalse();
            es.Unsubscribe(a4.Ref, typeof(CCATBT)).ShouldBeTrue();
        }
Exemple #34
0
        public static bool IsInstCCToIBB()
        {
            object o = new CC();

            return (o is IBB);
        }
Exemple #35
0
	void Foo2 (CC cc)
	{
		cc.Spec = "aa";
	}
Exemple #36
0
 public bool CClass(CC x)
 {
     return !(st.pos == end || !x.Accepts(orig[st.pos++]));
 }
		public DashStyleComboBox()
		{
			InitializeComponent();

			foreach (var e in _knownStylesList)
				Items.Add(new ImageComboBoxItem(this, e));

			var _valueBinding = new Binding();
			_valueBinding.Source = this;
			_valueBinding.Path = new PropertyPath(_nameOfValueProp);
			_valueConverter = new CC(this);
			_valueBinding.Converter = _valueConverter;
			_valueBinding.ValidationRules.Add(new ValidationWithErrorString(_valueConverter.EhValidateText));
			this.SetBinding(ComboBox.TextProperty, _valueBinding);

			_img.Source = GetImage(SelectedDashStyle);
		}
        public void ManageSubChannelsUsingClassesAndInterfacesUpdateOnUnsubscribeAll()
        {
            var es = new EventStream(false);
            var tm1 = new CC();
            var tm2 = new CCATBT();
            var a1 = TestProbe();
            var a2 = TestProbe();
            var a3 = TestProbe();
            var a4 = TestProbe();

            es.Subscribe(a1.Ref, typeof(AT)).Then(Assert.True);
            es.Subscribe(a2.Ref, typeof(BT)).Then(Assert.True);
            es.Subscribe(a3.Ref, typeof(CC)).Then(Assert.True);
            es.Subscribe(a4.Ref, typeof(CCATBT)).Then(Assert.True);
            es.Unsubscribe(a3.Ref).Then(Assert.True);
            es.Publish(tm1);
            es.Publish(tm2);
            a1.expectMsg(tm2);
            a2.expectMsg(tm2);
            a3.expectNoMsg(TimeSpan.FromSeconds(1));
            a4.expectMsg(tm2);
            es.Unsubscribe(a1.Ref, typeof(AT)).Then(Assert.True);
            es.Unsubscribe(a2.Ref, typeof(BT)).Then(Assert.True);
            es.Unsubscribe(a3.Ref, typeof(CC)).Then(Assert.False);
            es.Unsubscribe(a4.Ref, typeof(CCATBT)).Then(Assert.True);
        }
Exemple #39
0
    public static int Main(string[] arg)
    {

        Console.WriteLine("Before allocation: {0}", TestMark.GetCommitted());

        CC cc = new CC(500000);
        cc.array[1024].t1 = new A();
        cc.array[1024].t1.a = 3;
        cc.array[1024].t2 = new B();
        cc.array[1024].t2.b = 4;

        long a = TestMark.GetCommitted();
        Console.WriteLine("After allocation: {0}", a);
        Console.WriteLine();
        Console.WriteLine("Collecting...");
        for (int i=0; i<100; i++)
        {
            GC.Collect();
        }

        long b= TestMark.GetCommitted();
        Console.WriteLine("After 100 Collections: {0}", b);
        GC.KeepAlive(cc);

        if (Math.Abs(b- a) > (a/2))
        {
            Console.WriteLine("failed");
            return 0;
        }

        Console.WriteLine("passed");
        return 100;


    }
Exemple #40
0
 public bool ScoreManageInfo_Upd(CC.Model.Score.ScoreManageInfo model)
 {
     return ScoreManageInfoDAL.ScoreManageInfo_Upd(model);
 }
Exemple #41
0
 /// <summary>
 /// 成绩管理列表
 /// 徐卫
 /// 2014年12月31日11:46:42
 /// </summary>
 /// <param name="smi"></param>
 /// <param name="PageIndex">页数</param>
 /// <param name="PageSize">页大小</param>
 /// <returns></returns>
 public List<CC.Model.Score.ScoreManageInfo> ScoreManageInfo_List(CC.Model.Score.ScoreManageInfo smi, int DateID, int PageIndex = 1, int PageSize = 20)
 {
     return ScoreManageInfoDAL.ScoreManageInfo_List(smi, DateID, PageIndex, PageSize);
 }
Exemple #42
0
 public CC.Model.Score.ScoreManageInfo ScoreManageInfo_Add(CC.Model.Score.ScoreManageInfo model)
 {
     return ScoreManageInfoDAL.ScoreManageInfo_Add(model);
 }
Exemple #43
0
 public LADCC(CC cc)
 {
     this.cc = cc;
 }
Exemple #44
0
        public static bool IsInstTest10()
        {
            object o = new CC();

            return (o is IAA);
        }
 public BB(CC cc)
 {
     CC = cc;
 }
Exemple #46
0
        public static bool IsInstTest11()
        {
            object o = new CC();

            return (o is IBB);
        }
Exemple #47
0
    public bool ScanCClass(int min, int max, CC x)
    {
        int i;
        int maxr = end - st.pos;
        if (maxr < max) max = maxr;

        for (i = 0; i < max && x.Accepts(orig[st.pos + i]); i++);
        st.pos += i;
        return (i >= min);
    }
Exemple #48
0
 public void AddEdge(int from, int to, CC when)
 {
     Edge e;
     e.to = to;
     e.when = when;
     nodes_l[from].edges_l.Add(e);
 }
Exemple #49
0
 /// <summary>
 /// 添加或更新测试
 /// </summary>
 /// <param name="Test"></param>
 /// <returns></returns>
 public int Test_Add_Update(CC.Test.Model.Test Test)
 {
     if (Test.TestID == 0)
     {
         return TestDAL.Test_Add(Test);
     }
     else
     {
         return TestDAL.Test_Update(Test);
     }
 }
Exemple #50
0
 public bool BeforeCCs(bool neg, CC[] vec)
 {
     if (end - st.pos < vec.Length) return neg;
     for (int i = 0; i < vec.Length; i++)
         if (!vec[i].Accepts(orig[st.pos + i]))
             return neg;
     return !neg;
 }
Exemple #51
0
        public static bool IsInstCCToIAA()
        {
            object o = new CC();

            return (o is IAA);
        }
        public static bool IsInstTest4()
        {
            object o = new CC();

            return !(o is BB);
        }
Exemple #53
0
 public bool AfterCCs(bool neg, CC[] vec)
 {
     int offs = st.pos;
     for (int i = vec.Length - 1; i >= 0; i--) {
         if (offs == 0)
             return neg;
         int ch = orig[--offs];
         if (((uint)(ch - 0xDC00)) < 0x400u && offs != 0) {
             ch = orig[--offs] * 0x400 + ch +
                (0x10000 - (0xD800 * 0x400 + 0xDC00));
         }
         if (!vec[i].Accepts(ch))
             return neg;
     }
     return !neg;
 }
Exemple #54
0
 /// <summary>
 /// 学生作业详细列表
 /// </summary>
 /// <param name="model"></param>
 /// <param name="SearchKey"></param>
 /// <param name="PageIndex"></param>
 /// <param name="PageSize"></param>
 /// <returns></returns>
 public List<CC.Test.Model.TestUser> TestUser_List(CC.Test.Model.TestUser model, string SearchKey, int PageIndex, int PageSize)
 {
     return TestUserDAL.TestUser_List(model, SearchKey, PageIndex, PageSize);
 }
        public static bool IsInstTest3()
        {
            object o = new CC();

            return !(o is AA);
        }
Exemple #56
0
 public bool BeforeCCs(bool neg, CC[] vec)
 {
     int offs = st.pos;
     int upto = end;
     for (int i = 0; i < vec.Length; i++) {
         if (offs == upto) return neg;
         int ch = orig[offs++];
         if (((uint)(ch - 0xD800)) < 0x400u && offs != upto) {
             ch = orig[offs++] + ch * 0x400 +
                (0x10000 - (0xD800 * 0x400 + 0xDC00));
         }
         if (!vec[i].Accepts(ch))
             return neg;
     }
     return !neg;
 }
Exemple #57
0
 public bool CClass(CC x)
 {
     if (st.pos++ == end) return false;
     int ho = orig[st.pos-1];
     int hs = ho - 0xD800;
     if (((uint)hs) < 0x400u && st.pos != end) {
         st.pos++;
         return x.Accepts(0x10000 - 0xDC00 + orig[st.pos-1] + 0x400 * hs);
     } else {
         return x.Accepts(ho);
     }
 }
Exemple #58
0
    public bool ScanCClass(int min, int max, CC x)
    {
        int i = 0;
        int at = st.pos;
        int upto = end;

        while (i < max && at < upto) {
            int oat = at;
            int ch = orig[at++];
            if (((uint)(ch - 0xD800)) < 0x400u && at != upto) {
                ch = orig[at++] + ch * 0x400 +
                   (0x10000 - (0xD800 * 0x400 + 0xDC00));
            }
            if (x.Accepts(ch)) {
                i++;
            } else {
                at = oat;
                break;
            }
        }

        st.pos = at;

        return (i >= min);
    }
Exemple #59
0
        public void ManageSubChannelsUsingClassesAndInterfacesUpdateOnUnsubscribeAll()
        {
            var es = new EventStream(false);
            var tm1 = new CC();
            var tm2 = new CCATBT();
            var a1 = CreateTestProbe();
            var a2 = CreateTestProbe();
            var a3 = CreateTestProbe();
            var a4 = CreateTestProbe();

            es.Subscribe(a1.Ref, typeof(AT)).ShouldBeTrue();
            es.Subscribe(a2.Ref, typeof(BT)).ShouldBeTrue();
            es.Subscribe(a3.Ref, typeof(CC)).ShouldBeTrue();
            es.Subscribe(a4.Ref, typeof(CCATBT)).ShouldBeTrue();
            es.Unsubscribe(a3.Ref).ShouldBeTrue();
            es.Publish(tm1);
            es.Publish(tm2);
            a1.ExpectMsg((object)tm2);
            a2.ExpectMsg((object)tm2);
            a3.ExpectNoMsg(TimeSpan.FromSeconds(1));
            a4.ExpectMsg((object)tm2);
            es.Unsubscribe(a1.Ref, typeof(AT)).ShouldBeTrue();
            es.Unsubscribe(a2.Ref, typeof(BT)).ShouldBeTrue();
            es.Unsubscribe(a3.Ref, typeof(CC)).ShouldBeFalse();
            es.Unsubscribe(a4.Ref, typeof(CCATBT)).ShouldBeTrue();
        }
Exemple #60
0
 void AddEdge(int from, int to, int when, CC when_cc)
 {
     Edge e;
     fromv.Add(from);
     e.to = to;
     e.when = when;
     e.when_cc = when_cc;
     if (nedges == edges.Length) {
         Array.Resize(ref edges, nedges * 2);
     }
     ++outgoing[from];
     edges[nedges++] = e;
 }