Пример #1
0
        public void CopyFV()
        {
            conf Config = new conf();

            try
            {
                File.Copy(pdfName, Config.outPath + "Rok_20" + year + "\\FV\\" + docName + ".pdf");
                StreamWriter FV;
                FV = File.AppendText(fileLog);
                FV.WriteLine(Config.outPath + "Rok_20" + year + "\\FV\\" + docName + ".pdf");
                FV.Close();
            }
            catch (IOException)
            {
                FileInfo infoFirst  = new FileInfo(Config.outPath + "Rok_20" + year + "\\FV\\" + docName + ".pdf");
                long     byteFirst  = infoFirst.Length;
                FileInfo infoSecond = new FileInfo(pdfName);
                long     byteSecond = infoSecond.Length;
                if (byteFirst != byteSecond)
                {
                    File.Copy(pdfName, Config.outPath + "Rok_20" + year + "\\duplikaty\\" + docName + ".pdf");
                    StreamWriter FV2;
                    FV2 = File.AppendText(fileLog);
                    FV2.WriteLine("!! DUPLIKAT !!    " + Config.outPath + "Rok_20" + year + "\\duplikaty\\" + docName + ".pdf" + "    !! DUPLIKAT !!");
                    FV2.Close();
                }
                else
                {
                    StreamWriter FV3;
                    FV3 = File.AppendText(fileLog);
                    FV3.WriteLine("!! Identyczny plik istnieje !!    " + Config.outPath + "Rok_20" + year + "\\FV\\" + docName + "_.pdf" + "    !! Identyczny plik istnieje !!");
                    FV3.Close();
                }
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Request.QueryString["epid"] == null && !Page.IsPostBack)
     {
         FV.ChangeMode(FormViewMode.Insert);
     }
 }
Пример #3
0
    public void OnPointerClick(PointerEventData eventData)
    {
        if (transform.childCount > 0 && CommandFactory.chosenCommand != CommandType.Null)
        {
            Destroy(transform.GetChild(0).gameObject);
        }
        Command element;

        switch (CommandFactory.chosenCommand)
        {
        case CommandType.GoForward:
            element = new GoForwardCmd(Id);
            break;

        case CommandType.TurnRight:
            element = new TurnRightCmd(Id);
            break;

        case CommandType.TurnLeft:
            element = new TurnLeftCmd(Id);
            break;

        case CommandType.Activate:
            element = new ActivateCmd(Id);
            break;

        case CommandType.FV1:
            element = new FV(Id, 1);
            break;

        case CommandType.FV2:
            element = new FV(Id, 2);
            break;

        default:
            return;
        }

        GameObject commandObj = Instantiate(cmdpanelcmd);

        commandObj.transform.SetParent(transform);
        commandObj.GetComponent <Image>().sprite = element.Img;
        commandObj.transform.position            = commandObj.transform.parent.position;
        CommandData cmd = commandObj.GetComponent <CommandData>();

        cmd.Command = element;

        cmdpanelmanager.AddCommand(Id, element);

        RectTransform rt     = commandObj.GetComponent <RectTransform>();
        RectTransform slotRt = GetComponent <RectTransform>();

        rt.sizeDelta  = slotRt.sizeDelta * commandScaleValue;
        rt.localScale = new Vector3(1, 1, 1);
    }
Пример #4
0
    public void Launch()
    {
        F.text = FV.ToString(); x.text = xV.ToString();
        float deltaX = scale.y - paddle.transform.localScale.y;

        paddle.transform.localScale = scale;
        float energiaP = kV * Mathf.Pow(deltaX, 2);

        ballRigi.AddForce(energiaP * Vector3.up * ForceMultiplier);
        eP.text = energiaP.ToString();
        FV      = xV = 0;
    }
Пример #5
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKey(KeyCode.Space) && paddle.transform.localScale.y > 0.1)
     {
         FV    += Time.deltaTime;
         F.text = FV.ToString();
         paddle.transform.localScale = new Vector3(paddle.transform.localScale.x, paddle.transform.localScale.y - Time.deltaTime, paddle.transform.localScale.z);
         xV     = scale.y - paddle.transform.localScale.y;
         x.text = xV.ToString();
     }
     if (Input.GetKeyUp(KeyCode.Space))
     {
         Launch();
     }
 }
        private void DoFlicker()
        {
            MatrixElementType I = GetEffectValue(0);

            int V = CurrentValue.Limit(0, 255);

            if (V > 0)
            {
                if (!Active)
                {
                    Table.Pinball.Alarms.RegisterIntervalAlarm(RefreshIntervalMs, DoFlicker);
                    Active = true;
                }

                //Effect is active (V>0)
                if (V > 0 && FadeMode == FadeModeEnum.OnOff)
                {
                    V = 255;
                }

                int NumberOfLeds = AreaWidth * AreaHeight;
                int FlickerLeds  = ((int)((double)NumberOfLeds / 100 * Density)).Limit(1, NumberOfLeds);


                int Min = MinFlickerDurationMs;
                int Max = MaxFlickerDurationMs;
                if (Max < Min)
                {
                    int Tmp = Min; Min = Max; Max = Tmp;
                }

                //if (Min != Max && ActiveFlickerObjects.Count.IsBetween(0,FlickerLeds-1))
                //{
                //    int Avg = (Min + Max / 2) - Min;
                //    int NewObjectsAvg = ((FlickerLeds * Avg) - ActiveFlickerObjects.Sum(FO => FO.DurationMs)) / (FlickerLeds - ActiveFlickerObjects.Count);
                //    int NewObjectsAvgChange = Avg - NewObjectsAvg;

                //    if (NewObjectsAvgChange < 0)
                //    {
                //        //Increase min
                //        Min = (Min + Math.Abs(NewObjectsAvgChange) * 2).Limit(Min, Max);

                //    }
                //    else
                //    {
                //        //Decrease max
                //        Max = (Max - NewObjectsAvgChange * 2).Limit(Min, Max);
                //    }
                //}


                while (ActiveFlickerObjects.Count < FlickerLeds && InactiveFlickerObjects.Count > 0)
                {
                    FlickerObject FO = InactiveFlickerObjects[R.Next(InactiveFlickerObjects.Count)];
                    InactiveFlickerObjects.Remove(FO);

                    FO.StartTimestamp = DateTime.Now;
                    FO.DurationMs     = R.Next(Min, Max) + FlickerFadeDownDurationMs;
                    ActiveFlickerObjects.Add(FO);
                }

                DateTime CurrentTimestamp = DateTime.Now;

                for (int i = ActiveFlickerObjects.Count - 1; i >= 0; i--)
                {
                    FlickerObject FO = ActiveFlickerObjects[i];

                    int FV;
                    int AgeMs = (int)(DateTime.Now - FO.StartTimestamp).TotalMilliseconds;
                    if (AgeMs > FO.DurationMs + FlickerFadeDownDurationMs)
                    {
                        if (AgeMs > (FO.DurationMs + FlickerFadeDownDurationMs) * 2 || R.NextDouble() > .5)
                        {
                            //Remove element
                            ActiveFlickerObjects.Remove(FO);
                            InactiveFlickerObjects.Add(FO);
                        }
                        FV = 0;
                    }
                    else if (FlickerFadeUpDurationMs > 0 && AgeMs < FlickerFadeUpDurationMs && AgeMs < FO.DurationMs)
                    {
                        //Fade up
                        FV = (int)((double)V / FlickerFadeUpDurationMs * AgeMs);
                        //Log.Write("U: " + FV.ToString());
                    }
                    else if (AgeMs > FO.DurationMs && FlickerFadeDownDurationMs > 0)
                    {
                        //Fade down
                        if (FO.DurationMs < FlickerFadeUpDurationMs)
                        {
                            FV = (int)((double)V / FlickerFadeUpDurationMs * FO.DurationMs);
                        }
                        else
                        {
                            FV = V;
                        }
                        FV = FV - (int)((double)FV / FlickerFadeDownDurationMs * (AgeMs - FO.DurationMs));
                        //Log.Write("D: " + FV.ToString());
                    }
                    else
                    {
                        //Full on
                        FV = V;

                        //Log.Write("F: " + FV.ToString());
                    }
                    FV = FV.Limit(0, 255);

                    MatrixLayer[FO.X, FO.Y] = GetEffectValue(FV);
                }
            }
            else
            {
                foreach (FlickerObject FO in ActiveFlickerObjects)
                {
                    MatrixLayer[FO.X, FO.Y] = I;
                }
                InactiveFlickerObjects.AddRange(ActiveFlickerObjects);
                ActiveFlickerObjects.Clear();
                Table.Pinball.Alarms.UnregisterIntervalAlarm(DoFlicker);
                Active = false;
            }
        }
Пример #7
0
        void continueLoading()
        {
            HttpWebRequest  request    = (HttpWebRequest)WebRequest.Create("http://healzer.com/YTR/REG/updater.txt");
            HttpWebResponse response   = (HttpWebResponse)request.GetResponse();
            Stream          stream     = response.GetResponseStream();
            StreamReader    streamRead = new StreamReader(stream);
            string          RS         = streamRead.ReadToEnd();

            if (RS.Contains("false"))
            {
                SetMessage("Please try again later.", Color.Red);
                MessageBox.Show("Performing security updates, try again later");
                close();
            }

            string FV;

            if (File.Exists(@".\updater.exe"))
            {
                FV = FileVersionInfo.GetVersionInfo(@".\updater.exe").FileVersion;
                RS = RS.Replace(".", "");
                FV = FV.Replace(".", "");

                if (int.Parse(RS) > int.Parse(FV))
                {
                    SetMessage("Updating. Please wait...", Color.Black);
                    try
                    {
                        foreach (Process proc in Process.GetProcessesByName("updater"))
                        {
                            proc.Kill();
                        }
                    }
                    catch { }

                    try
                    {
                        WebClient dl = new WebClient();
                        dl.DownloadFile("http://healzer.com/YTR/REG/updater.exe", @".\new_updater.exe");

                        File.Delete(@".\updater.exe");
                        File.Copy(@".\new_updater.exe", @".\updater.exe", true);
                        File.Delete(@".\new_updater.exe");
                    }
                    catch { }
                }
            }
            else
            {
                try
                {
                    SetMessage("Updating. Please wait...", Color.Red);

                    WebClient dl = new WebClient();
                    dl.DownloadFile("http://healzer.com/YTR/REG/updater.exe", @".\updater.exe");
                }
                catch { }
            }


            request    = (HttpWebRequest)WebRequest.Create("http://healzer.com/YTR/REG/YTR.txt");
            response   = (HttpWebResponse)request.GetResponse();
            stream     = response.GetResponseStream();
            streamRead = new StreamReader(stream);
            RS         = streamRead.ReadToEnd();

            if (RS.Contains("false"))
            {
                SetMessage("Please try again later.", Color.Red);
                MessageBox.Show("Performing security updates, try again later");
                close();
            }

            Console.WriteLine(Application.ProductVersion.ToString());
            FV = FileVersionInfo.GetVersionInfo(@".\YTR.exe").FileVersion;
            RS = RS.Replace(".", "");
            FV = FV.Replace(".", "");

            if (int.Parse(RS) > int.Parse(FV))
            {
                SetMessage("New version available!", Color.Red);
                if (MessageBox.Show("There is a newer version available, run updater?", "Newer version", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    Process.Start(@".\" + "updater.exe");
                    close();
                }
                else
                {
                    SetMessage("Canceled", Color.Red);
                    close(5);
                }
            }
        }
    protected void FV_DataBound(object sender, EventArgs e)
    {
        Literal ltr = (Literal)FV.FindControl("LtrUrunAdi");

        txtUrunAdi.Text = ltr.Text;
    }