Наследование: ImageTransition
Пример #1
0
        public static void V_Test_PFX_MakeFile()
        {
            Console.WriteLine("Testing PFX_MakeFile ...");
            string        strOutputFile = null;
            string        strCertFile   = null;
            string        strKeyFile    = null;
            StringBuilder sbPassword    = null;
            int           nRet          = 0;
            bool          isOK          = false;

            strOutputFile = "myuser.pfx";
            strCertFile   = "myuser.cer";
            strKeyFile    = "myuser.epk";
            sbPassword    = new StringBuilder("password");

            // Given Bob's certificate and encrypted private key file (with password "password"),
            // create a PKCS-12 (pfx/p12) file.
            nRet = Pfx.MakeFile(strOutputFile, strCertFile, strKeyFile, sbPassword.ToString(), "CA's ID", Pfx.Options.Default);
            Console.WriteLine("Pfx.MakeFile returns " + nRet);

            // Now verify that the signature is OK
            isOK = Pfx.SignatureIsValid(strOutputFile, sbPassword.ToString());
            Console.WriteLine("Pfx.SignatureIsValid returns " + isOK);

            // Clean up
            Wipe.String(sbPassword);
        }
Пример #2
0
        private void wipe_btn_Click(object sender, EventArgs e)
        {
            if (String.IsNullOrEmpty(this.file_tb.Text))
            {
                MessageBox.Show("삭제할 파일을 선택하세요.", "알림", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.file_btn.Focus();
                return;
            }
            if (file_lv.Items.Count != 0) // 리스트가 비어있지 않으면 완전삭제 알고리즘 수행
            {
                if (MessageBox.Show("정말로 모두 완전삭제 할까요?", "알림", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    if (file_count == 0)                  // 최초 1회만 수행하도록 함
                    {
                        file_count = file_lv.Items.Count; // 삭제대상 파일의 숫자를 변수에 넣음
                    }
                    foreach (ListViewItem item in file_lv.Items)
                    {
                        string file_path = item.SubItems[1].Text + @"\" + item.SubItems[0].Text; // 파일경로와 파일명을 더해 완전한 경로를 만든다.
                        folder_list.Add(item.SubItems[1].Text);                                  // 삭제할 폴더리스트를 만듭니다.

                        wipe         = new Wipe(file_path);
                        wipe.runPer += new Wipe.ProcessEventHandler(WipeStatus);
                        wipe.British_HMG_IS5_Enhanced(file_path);

                        file_lv.Items.Remove(file_lv.Items[0]); // 완전삭제를 진행한 아이템은 리스트에서 제거합니다.
                        file_tb.Text = "";
                    }
                }
            }
        }
Пример #3
0
    public void FireMainGun()
    {
        if (Input.GetButtonDown("Fire1"))
        {
            UpSound.Invoke();
        }

        if (Input.GetButton("Fire1"))
        {
            StaffANIM.SetBool("TranGrowO", true);
            StaffANIM.SetBool("IsGrowingOBJ", true);

            if (TranGO == true)
            {
                if (mass > 0f)
                {
                    ShootGrow();
                }
                if (mass <= 0f)
                {
                    Debug.Log("NoMass");
                    StaffANIM.SetBool("IsGrowingOBJ", false);
                }
            }
        }
        if (Input.GetButtonUp("Fire1"))
        {
            StaffANIM.SetBool("IsGrowingOBJ", false);
            StaffANIM.SetBool("TranGrowO", false);
            Wipe.Invoke();
            isShooting = false;
            OBJLOC     = StaffPoint.transform.localPosition;
        }
        if (Input.GetButtonDown("Fire2"))
        {
            DownSound.Invoke();
        }

        if (Input.GetButton("Fire2"))
        {
            StaffANIM.SetBool("TranShrinkO", true);
            StaffANIM.SetBool("IsShrinkingOBJ", true);
            if (TranSO == true)
            {
                ShootShrink();
            }
        }
        if (Input.GetButtonUp("Fire2"))
        {
            StaffANIM.SetBool("IsShrinkingOBJ", false);
            StaffANIM.SetBool("TranShrinkO", false);
            EShrinking = false;

            Wipe.Invoke();
            isShooting = false;
            OBJLOC     = new Vector3(0f, 0f, 0f);
        }
    }
Пример #4
0
        protected override IEnumerator ProcessPayload(VisualPayload payload)
        {
            payload.VisualData.Bound.name = "Line Graph Bound";

            var lineGraph = VisualizerFactory.InstantiateLineGraph();

            lineGraph.Initialize(this, payload);

            AssignStates(lineGraph);

            var entries = EntryField.GetLastKeyValue(payload.Data) as IEnumerable <MutableObject>;

            if (entries == null)
            {
                throw new Exception("Illegal mutable field here!  " + EntryField.AbsoluteKey + " is not an enumerable of mutables!");
            }

            if (!entries.Any())
            {
                yield return(null);

                yield break;
            }

            foreach (var entry in entries)
            {
                Vector3 entryPosition =
                    new Vector3(
                        XAxis.GetLastKeyValue(entry),
                        YAxis.GetLastKeyValue(entry),
                        ZAxis.GetLastKeyValue(entry)
                        );

                Color pointColor = PointColor.GetLastKeyValue(entry);

                lineGraph.AddPoint(entryPosition, pointColor);

                yield return(null);
            }

            yield return(null);

            lineGraph.SetLineData(MainColor.GetLastKeyValue(payload.Data),
                                  LineWidth.GetLastKeyValue(payload.Data),
                                  ZDepthOffset.GetLastKeyValue(payload.Data),
                                  EdgeColor.GetLastKeyValue(payload.Data),
                                  EdgeWidth.GetLastKeyValue(payload.Data),
                                  PointWidth.GetLastKeyValue(payload.Data),
                                  PulseLine.GetLastKeyValue(payload.Data),
                                  PulseWidth.GetLastKeyValue(payload.Data),
                                  Wipe.GetLastKeyValue(payload.Data),
                                  StartTime.GetLastKeyValue(payload.Data),
                                  WipeDuration.GetLastKeyValue(payload.Data)
                                  );

            lineGraph.ApplyPoints();
        }
Пример #5
0
        public override void LayoutSymbol(SymbolLayout Sym)
        {
            base.LayoutSymbol(Sym);

            Sym.AddWire(Anode, new Coord(0, 16));
            Sym.AddWire(Cathode, new Coord(0, -16));
            Sym.InBounds(new Coord(-10, 0), new Coord(10, 0));

            Resistor.Draw(Sym, 0, -16, 16, 7);

            Sym.DrawArrow(EdgeType.Black, new Coord(-6, -15), new Coord(6, 15), 0.1);

            Sym.DrawText(() => Resistance.ToString(), new Coord(-7, 0), Alignment.Far, Alignment.Center);
            Sym.DrawText(() => Wipe.ToString("G3"), new Coord(9, 3), Alignment.Near, Alignment.Near);
            Sym.DrawText(() => Name, new Coord(9, -3), Alignment.Near, Alignment.Far);
        }
Пример #6
0
        public override object ToUFEEffect()
        {
            var eff = new Wipe();

            switch (Direction)
            {
            case SlideDirection.Down: eff.Direction = EffectDirectionType.DOWN; break;

            case SlideDirection.Left: eff.Direction = EffectDirectionType.LEFT; break;

            case SlideDirection.Right: eff.Direction = EffectDirectionType.RIGHT; break;

            case SlideDirection.Up: eff.Direction = EffectDirectionType.UP; break;
            }
            return(eff);
        }
Пример #7
0
        public static void V_Test_RSA_PublicKeyFromPrivate()
        {
            Console.WriteLine("Testing RSA_PublicKeyFromPrivate ...");
            string        strPriKeyFile = null;
            StringBuilder sbPrivateKey  = null;
            string        strPublicKey  = null;
            int           nCode         = 0;
            int           nRet          = 0;

            // Read private key from encrypted private key file into internal string form
            strPriKeyFile = "myuser.epk";
            sbPrivateKey  = Rsa.ReadEncPrivateKey(strPriKeyFile, "password");
            if (sbPrivateKey.Length == 0)
            {
                return;
            }

            //Catch error here
            // Display some info about it
            Console.WriteLine("Private key length = {0} bits", Rsa.KeyBits(sbPrivateKey.ToString()));
            nCode = Rsa.KeyHashCode(sbPrivateKey.ToString());
            Console.WriteLine("KeyHashCode={0,8:X}", nCode);
            nRet = Rsa.CheckKey(sbPrivateKey);
            Console.WriteLine("Rsa.CheckKey returns " + nRet + ": (PKI_VALID_PRIVATEKEY=" + 0 + ")");

            // Convert to public key string
            strPublicKey = Rsa.PublicKeyFromPrivate(sbPrivateKey).ToString();
            if (strPublicKey.Length == 0)
            {
                return;
            }

            // Catch error here
            // Display some info about it
            Console.WriteLine("Public key length = " + Rsa.KeyBits(strPublicKey) + " bits");
            nCode = Rsa.KeyHashCode(strPublicKey);
            Console.WriteLine("KeyHashCode={0,8:X}", nCode);
            nRet = Rsa.CheckKey(strPublicKey);
            Console.WriteLine("Rsa.CheckKey returns " + nRet + ": (PKI_VALID_PUBLICKEY=" + 1 + ")");

            // Clean up
            Wipe.String(sbPrivateKey);
        }
Пример #8
0
        public override sealed void LayoutSymbol(SymbolLayout Sym)
        {
            Sym.InBounds(new Coord(-20, -20), new Coord(10, 20));

            Sym.AddTerminal(Anode, new Coord(-10, 20), new Coord(-10, 16));
            Sym.DrawPositive(EdgeType.Black, new Coord(-16, 16));

            Sym.AddTerminal(Cathode, new Coord(-10, -20), new Coord(-10, -16));
            Sym.DrawNegative(EdgeType.Black, new Coord(-16, -16));

            Sym.AddTerminal(Wiper, new Coord(10, 0));
            Sym.DrawArrow(EdgeType.Black, new Coord(10, 0), new Coord(-6, 0), 0.2);

            Resistor.Draw(Sym, -10, -16, 16, 7);

            Sym.DrawText(() => Resistance.ToString(), new Coord(-17, 0), Alignment.Far, Alignment.Center);
            Sym.DrawText(() => Wipe.ToString("G3"), new Coord(-4, 4), Alignment.Near, Alignment.Near);
            Sym.DrawText(() => Name, new Coord(-4, -4), Alignment.Near, Alignment.Far);
        }
Пример #9
0
        private async static void WipeFile(string fileName)
        {
            var progressDialog = Dialogs.ProgressDialog(Resources.Program_WipingTitle, fileName);

            try
            {
                var tokenSource = new CancellationTokenSource();
                progressDialog.FormClosing += (sender, e) =>
                                              tokenSource.Cancel();
                Action <WipeProgress> progressChangedCallback = (x) =>
                                                                progressDialog.UpdateProgress(x.PercentProgress);
                progressDialog.Show();

                await Task.Run(() => Wipe.WipeFile(new FileInfo(fileName), 1, progressChangedCallback, tokenSource.Token));

                Dialogs.Info(Resources.Program_OperationCompleted, Resources.Program_OperationCompletedVerbose);
            }
            catch (UnauthorizedAccessException)
            {
                if (!HasAdminPrivelegies)
                {
                    RestartAsAdmin($"\"{fileName}\"");
                }
                else
                {
                    Dialogs.Error(Resources.Program_AccessError);
                }
            }
            catch (OperationCanceledException)
            {
                Dialogs.Info(Resources.Program_OperationCancelled, Resources.Program_OperationCancelledVerbose);
            }
            catch (Exception e)
            {
                Dialogs.Error(e);
            }
            finally
            {
                progressDialog.Close();

                Application.Exit();
            }
        }
Пример #10
0
 public Task PushAsync(Wipe wipe)
 {
     return(Task.Run(() => Push(wipe)));
 }
Пример #11
0
 public void Push(Wipe wipe)
 {
     _redoStack.Clear();
     _undoStack.Push(wipe);
 }
Пример #12
0
 private void Awake()
 {
     rightEye = GetComponent <Wipe>();
     leftEye  = GetComponent <Wipe2>();
     textDisplay.GetComponent <TextMeshProUGUI>().text = minsLeft + ":" + secondsLeft;
 }
Пример #13
0
        public async Task <IActionResult> WipeAsync(string subscriberId, [FromBody] Wipe wipe)
        {
            await _whiteboardService.WipeAsync(subscriberId, wipe);

            return(Ok());
        }
Пример #14
0
        private void StartShredding()
        {
            btnShreddingEnable = false;
            Wipe wiper = new Wipe();

            wiper.WipeErrorEvent  += Wiper_WipeErrorEvent;
            wiper.PassInfoEvent   += Wiper_PassInfoEvent;
            wiper.SectorInfoEvent += Wiper_SectorInfoEvent;
            wiper.WipeDoneEvent   += Wiper_WipeDoneEvent;
            bool isWhiteListed = false;

            foreach (Model_Shred MdlShared in ShredFilesCollection)
            {
                FileAttributes attr = File.GetAttributes(MdlShared.FilePath);
                if (attr.HasFlag(FileAttributes.Directory))
                {
                    foreach (
                        string file in
                        Directory.EnumerateFiles(MdlShared.FilePath, "*.*", SearchOption.AllDirectories))
                    {
                        if (CommandLogic_Delete.I.IsWhitelisted(file))
                        {
                            isWhiteListed = true;
                            break;
                        }
                    }
                    if (isWhiteListed)
                    {
                        break;
                    }
                }
                else
                {
                    if (CommandLogic_Delete.I.IsWhitelisted(MdlShared.FilePath))
                    {
                        isWhiteListed = true;
                        break;
                    }
                }
            }
            if (isWhiteListed)
            {
                MessageBox.Show("Items on Whitelist will not be removed.", "mCleaner", MessageBoxButtons.OK);
            }

            foreach (Model_Shred MdlShared in ShredFilesCollection)
            {
                if (MdlShared.FilePath != "Recycle Bin")
                {
                    FileAttributes attr = File.GetAttributes(MdlShared.FilePath);
                    if (attr.HasFlag(FileAttributes.Directory))
                    {
                        this.ProgressText = "Started to Shred Folder" + MdlShared.FilePath + " Please Wait.";
                        bool blndeleteFolder = true;
                        foreach (string file in Directory.EnumerateFiles(MdlShared.FilePath, "*.*", SearchOption.AllDirectories))
                        {
                            this.ProgressText = "Started to Shred File " + file + " inside folder " + MdlShared.FilePath +
                                                " Please Wait.";
                            if (!CommandLogic_Delete.I.IsWhitelisted(file))
                            {
                                wiper.WipeFile(file, 2);
                            }
                            else
                            {
                                blndeleteFolder = false;
                            }
                        }
                        if (blndeleteFolder)
                        {
                            Directory.Delete(MdlShared.FilePath, true);
                        }
                    }
                    else
                    {
                        this.ProgressText = "Started to Shred File " + MdlShared.FilePath + " Please Wait.";
                        if (!CommandLogic_Delete.I.IsWhitelisted(MdlShared.FilePath))
                        {
                            wiper.WipeFile(MdlShared.FilePath, 2);
                        }
                    }
                }

                this.ProgressIndex++;
            }
            if (btnShredRecycleBinEnable)
            {
                this.ProgressText = "Started to Shreding recyclebin please Wait.";

                Thread.Sleep(2000);
                foreach (string file in Directory.EnumerateFiles("C:\\$RECYCLE.BIN", "*.*", SearchOption.AllDirectories))
                {
                    this.ProgressText = "Started to Shred File " + file + " please Wait.";
                    wiper.WipeFile(file, 2);
                }
            }


            btnShreddingEnable = false;
            this.ProgressText  = "Shredding is done.";
        }
Пример #15
0
 public async Task WipeAsync(Wipe wipe)
 {
     await WipeAsync(wipe, wipe.Style);
 }
Пример #16
0
 public async Task WipeAsync(Wipe wipe, WipeStyle style)
 {
     await SetWipeStyleAsync(style);
     await LineAsync(wipe.StylusPoints);
 }
Пример #17
0
 protected Task WipeAsync(Wipe wipe)
 {
     return(Whiteboard.WipeAsync(wipe));
 }
Пример #18
0
 protected override void LoadContent()
 {
     shader = new PrimitiveShader( GraphicsDevice );
     batch = new SpriteBatch( GraphicsDevice );
     font = Game.Content.Load<SpriteFont>( "Normal" );
     wipe = new Wipe( Game, 1 );
     Game.Components.Add( wipe );
     base.LoadContent();
 }
Пример #19
0
    public void ScaleShrinkGrow()
    {
        if (Input.GetButton("Fire1"))
        {
            StaffANIM.SetBool("TranGrowP", true);
            StaffANIM.SetBool("IsGrowingP", true);
            if (TranGP == true)
            {
                if (InVol == false)
                {
                    if (mass > 0f)
                    {
                        Player.transform.localScale = Vector3.Lerp(Player.transform.localScale, new Vector3(PSgrow, PSgrow, PSgrow), Time.deltaTime * PSgrowtime);

                        if (CurrentSize.magnitude <= maxSize.magnitude)
                        {
                            gameManager.GetComponent <GameManager>().MassAvailable -= (GrowTime * Time.deltaTime);
                        }
                        if (CurrentSize.magnitude >= maxSize.magnitude)
                        {
                            Debug.Log("TooLorge");
                        }
                    }
                    if (mass <= 0f)
                    {
                        Debug.Log("NoMass");
                    }
                }
            }
        }

        if (Input.GetButtonDown("Fire1"))
        {
            PlayerUP.Invoke();
            if (TooLorge == true)
            {
                Debug.Log("DeadByLorge");
                Dead.Invoke();
                StartCoroutine(DiedDead(.5f));
            }
        }
        if (Input.GetButtonUp("Fire1"))
        {
            StaffANIM.SetBool("IsGrowingP", false);
            StaffANIM.SetBool("TranGrowP", false);
            Wipe.Invoke();
        }


        if (Input.GetButton("Fire2"))
        {
            StaffANIM.SetBool("TranShrinkP", true);
            StaffANIM.SetBool("IsShrinkingP", true);
            if (InVol == false && TranSP == true)
            {
                Player.transform.localScale = Vector3.Lerp(Player.transform.localScale, new Vector3(PSshrink, PSshrink, PSshrink), Time.deltaTime * PSshrinktime);
                if (CurrentSize.magnitude < avgSize.magnitude)
                {
                    if (CurrentSize.magnitude >= PminSize.magnitude)
                    {
                        gameManager.GetComponent <GameManager>().MassAvailable += (GrowTime * Time.deltaTime) * 1.25f;
                    }
                    if (CurrentSize.magnitude <= PminSize.magnitude)
                    {
                        Debug.Log("smol");
                    }
                }
            }
        }


        if (Input.GetButtonDown("Fire2"))
        {
            PlayerDown.Invoke();
            if (TooSmol == true)
            {
                Debug.Log("DeadBySmol");
                Dead.Invoke();
                StartCoroutine(DiedDead(.5f));
            }
        }
        if (Input.GetButtonUp("Fire2"))
        {
            Wipe.Invoke();
            StaffANIM.SetBool("TranShrinkP", false);
            StaffANIM.SetBool("IsShrinkingP", false);
        }
    }
Пример #20
0
 public Task WipeAsync(string subscriberId, Wipe wipe)
 {
     return(_broadcastService.BroadcastAsync(subscriberId, wipe));
 }