Inheritance: MonoBehaviour
Exemplo n.º 1
0
 private void efwSimpleButton5_Click(object sender, EventArgs e)
 {
     base.NewMode();
     Eraser.Clear(this, "CLR3");
     rbShowType.EditValue   = "Y";
     txtShow_Turn.EditValue = "0";
 }
Exemplo n.º 2
0
        ////////////////////////////////////////////////////////////////////////////

        private VCExpr AssembleOpExpression(OpTypesPair opTypes, IEnumerable <VCExpr /*!*/> /*!*/ oldArgs, VariableBindings bindings)
        {
            Contract.Requires(bindings != null);
            Contract.Requires(cce.NonNullElements(oldArgs));
            Contract.Ensures(Contract.Result <VCExpr>() != null);
            // UGLY: the code for tracking polarities should be factored out
            int oldPolarity = Eraser.Polarity;

            Eraser.Polarity = 0;

            List <VCExpr /*!*/> /*!*/ newArgs = new List <VCExpr /*!*/> ();

            // explicit type parameters
            foreach (Type /*!*/ t in opTypes.Types)
            {
                Contract.Assert(newArgs != null);
                newArgs.Add(AxBuilder.Type2Term(t, bindings.TypeVariableBindings));
            }

            // and the actual value parameters
            Function /*!*/ newFun = ((VCExprBoogieFunctionOp)opTypes.Op).Func;
            // ^ we only allow this operator at this point
            int i = opTypes.Types.Count;

            foreach (VCExpr /*!*/ arg in oldArgs)
            {
                Contract.Assert(arg != null);
                newArgs.Add(AxBuilder.Cast(Eraser.Mutate(arg, bindings),
                                           cce.NonNull(newFun.InParams[i]).TypedIdent.Type));
                i = i + 1;
            }

            Eraser.Polarity = oldPolarity;
            return(Gen.Function(opTypes.Op, newArgs));
        }
Exemplo n.º 3
0
        public void Save(AsymmetricCipherKeyPair keypair)
        {
            //create the notebook's directory if it doesn't exist
            Directory.CreateDirectory(NotebookDirectory);

            //create the metadata
            StringWriter wtr    = new StringWriter();
            XmlWriter    xmlWtr = XmlWriter.Create(wtr);

            xmlWtr.WriteStartDocument();
            xmlWtr.WriteStartElement("notebook");
            xmlWtr.WriteElementString("title", m_title);
            foreach (Section sec in m_sections)
            {
                xmlWtr.WriteElementString("section", sec.ID);
                //also save the section
                sec.Save(keypair);
            }
            xmlWtr.WriteEndElement();
            xmlWtr.WriteEndDocument();
            xmlWtr.Close();

            //encrypt the metadata
            byte[] rawMetadata = Encoding.UTF8.GetBytes(wtr.GetStringBuilder().ToString());
            byte[] encMetadata = Crypto.AsymmetricEncrypt(rawMetadata, ref keypair);
            Eraser.SecureErase(rawMetadata);

            //write the encrypted metadata to a file
            string absPathMetadata = Path.Combine(NotebookDirectory, (string)Application.Current.Resources["MetadataFile"]);

            File.WriteAllBytes(absPathMetadata, encMetadata);
        }
Exemplo n.º 4
0
        public override void NewMode()
        {
            base.NewMode();

            Eraser.Clear(this, "CLR1");
            txtRank.EditValue = "0";
        }
Exemplo n.º 5
0
 public MainWindow()
 {
     InitializeComponent();
     _squareMaker = new SquareMaker(_canvas);
     _eraser      = new Eraser(_canvas);
     _tool        = _squareMaker;
 }
Exemplo n.º 6
0
 public Pencil(int?pencilDurability = null, int?eraserDurability = null, int?pencilLength = null)
 {
     PencilDurability  = pencilDurability;
     OriginalSharpness = pencilDurability;
     Eraser            = new Eraser(eraserDurability);
     PencilLength      = pencilLength;
 }
Exemplo n.º 7
0
        static void Main(string[] args)
        {
            String CommandFolder       = BasePath + Path.DirectorySeparatorChar + TAG_COMMAND;
            String EchoerLogsFolder    = BasePath + Path.DirectorySeparatorChar + TAG_LOGS + Path.DirectorySeparatorChar + TAG_ECHOER;
            String ShowCoinsLogsFolder = BasePath + Path.DirectorySeparatorChar + TAG_LOGS + Path.DirectorySeparatorChar + Config.TAG_SHOWCOINS;

            Console.WriteLine(CommandFolder);
            Console.WriteLine(EchoerLogsFolder);

            Directory.CreateDirectory(CommandFolder);
            Directory.CreateDirectory(EchoerLogsFolder);

            FolderManager.FolderManager.CreateDirectories();

            //Console.Write("Created Directories. Press enter to exit");
            // Echoer echoer = new Echoer(CommandFolder);
            //echoer.
            //ShowCoins showCoins = new ShowCoins(CommandFolder);
            //Backupper backupper = new Backupper(CommandFolder);
            //Grader grader = new Grader(FolderManager.FolderManager.RootPath);
            //CloudCoinUnpacker.Unpacker unpacker = new CloudCoinUnpacker.Unpacker(FolderManager.FolderManager.RootPath);
            Eraser eraser = new Eraser(CommandFolder);

            Process.Start(FolderManager.FolderManager.RootPath);

            Authenticator authenticator = new Authenticator(CommandFolder);
            Vaulter       vaulter       = new Vaulter(CommandFolder);

            //showCoins.showCoins();
            //Console.WriteLine("Watching folder " + CommandFolder + ".\nLogs folder- "+ FolderManager.FolderManager.ShowCoinsLogsFolder + "\n.Bank Folder location- "+ FolderManager.FolderManager.BankFolder);

            Translator translator = new Translator("C:\\CloudCoinServer");

            Console.ReadLine();
        }
Exemplo n.º 8
0
 private void efwSimpleButton3_Click(object sender, EventArgs e)
 {
     Eraser.Clear(this, "CLR2");
     cmbO_Sub_Company.EditValue    = "0";
     dtevent_end_date.EditValue    = DateTime.Now;
     rbp_bunch_delivery1.EditValue = "N";
 }
Exemplo n.º 9
0
 private void from_new()
 {
     base.NewMode();
     Eraser.Clear(this, "CLR1");
     dtO_Date.EditValue         = DateTime.Now;
     cmbO_Sub_Company.EditValue = "0";
 }
Exemplo n.º 10
0
 private void New()
 {
     Eraser.Clear(this, "CLR1");
     cmbQ1.EditValue = "0";
     cmbQ3.EditValue = "%";
     txtSearch.Focus();
 }
Exemplo n.º 11
0
        /// <summary>
        /// Get info about new vertex
        /// </summary>
        /// <param name="e"></param>
        /// <returns></returns>
        private Vertex2D GetNewVertex(MouseEventArgs e)
        {
            Color    color       = e.Button == MouseButtons.Left ? this.colorsControl.MainColor.ColorEditor : this.colorsControl.ExtendColor.ColorEditor;
            Vertex2D visualPoint = null;
            float    oXCoord     = ((float)e.X - openGLControl.Width / 2) / (openGLControl.Width / 2);
            float    oYCoord     = -((float)e.Y - openGLControl.Height / 2) / (openGLControl.Height / 2);

            switch (paintStyle.Value)
            {
            case PaintStyle.Eraser:
                visualPoint = new Eraser(baseColor, oXCoord, oYCoord);
                break;

            case PaintStyle.Brush:
                visualPoint = new OpenGlElements.Brush(color, oXCoord, oYCoord);
                break;

            case PaintStyle.Pencil:
                visualPoint = new Vertex2D(color, oXCoord, oYCoord);
                break;

            case PaintStyle.Image:
                visualPoint = new OpenGlElements.Image(Properties.Resources.fox, openGLControl.OpenGL, oXCoord, oYCoord);
                break;

            case PaintStyle.Sign:
                visualPoint = new OpenGlElements.Image(Properties.Resources.sign, openGLControl.OpenGL, oXCoord, oYCoord);
                break;

            case PaintStyle.Spline:
                visualPoint = new Spline(color, oXCoord, oYCoord);
                break;
            }
            return(visualPoint);
        }
Exemplo n.º 12
0
 public override void NewMode()
 {
     base.NewMode();
     dtReg_date.EditValue = DateTime.Now;
     Eraser.Clear(this, "CLR1");
     txtStory_id.EditValue = 0;
 }
Exemplo n.º 13
0
        public override void NewMode()
        {
            base.NewMode();

            Eraser.Clear(this, "CLR1");

            Clear();
        }
Exemplo n.º 14
0
    private void Awake()
    {
        instance = this;

        OriginalSortOrder = GetComponent <SpriteRenderer>().sortingOrder;
        OriginalZ         = gameObject.transform.localPosition.z;
        OriginPosition    = gameObject.transform.position;
    }
Exemplo n.º 15
0
        public override void NewMode()
        {
            base.NewMode();

            Eraser.Clear(this, "CLR1");
            cmbTAREA1.EditValue = "00";
            cmbSAREA1.EditValue = "00";
        }
Exemplo n.º 16
0
        public override void NewMode()
        {
            base.NewMode();

            Eraser.Clear(this, "CLR1");
            chkUSEYN.Checked = true;
            txtDEPTCODE.Focus();
        }
Exemplo n.º 17
0
        public override void NewMode()
        {
            base.NewMode();

            Eraser.Clear(this, "CLR1");
            cmbRegion.EditValue      = "00";
            cmbRegion_Area.EditValue = "00";
        }
Exemplo n.º 18
0
 private void efwSimpleButton3_Click(object sender, EventArgs e)
 {
     dtS_DATE.EditValue = DateTime.Now;
     dtE_DATE.EditValue = DateTime.Now;
     Eraser.Clear(this, "CLR2");
     picBest_Pic1.LoadAsync("http://media.domalife.net:8080/files/product/donutbiz/mori_00000009/2019101884241596.jpg");
     picBest_Pic2.LoadAsync("http://media.domalife.net:8080/files/product/donutbiz/mori_00000009/2019101884241596.jpg");
 }
Exemplo n.º 19
0
        private void EfwGridControl1_Click(object sender, EventArgs e)
        {
            DataRow dr = this.efwGridControl1.GetSelectedRow(0);

            Open2(dr["BIZCD"].ToString(), dr["DEPTCODE"].ToString());

            Eraser.Clear(this, "CLR1");
        }
Exemplo n.º 20
0
        private void HandleTabletReport(TabletReference tablet, PenSpecifications pen, ITabletReport report)
        {
            float pressurePercent = (float)report.Pressure / (float)pen.MaxPressure * 100f;

            if (report is IEraserReport eraserReport && eraserReport.Eraser)
            {
                Eraser?.Invoke(tablet, report, pressurePercent);
            }
        /// <summary>
        ///     Erases the types in <paramref name="vc" /> (if program is polymorphic) and sort let binding.
        ///     Note that this has a side-effect on <paramref name="vc" />..
        /// </summary>
        public VCExpr EraseAndSortLet(VCExpr vc, int polarity = -1)
        {
            var exprWithoutTypes = ProgramIsPolymorphic ? Eraser.Erase(vc, polarity) : vc;
            var letSorter        = new LetBindingSorter(_vcExprGen);

            Contract.Assert(letSorter != null);
            return(letSorter.Mutate(exprWithoutTypes, true));
        }
Exemplo n.º 22
0
        private void Clear()
        {
            Eraser.Clear(this, "ER1");

            chk_is_use.Checked     = true;
            chk_is_notice.Checked  = false;
            chk_is_file.Checked    = false;
            chk_is_comment.Checked = false;
        }
Exemplo n.º 23
0
        public override void NewMode()
        {
            base.NewMode();

            Eraser.Clear(this, "CLR1");

            fValueSet();
            Open1();
        }
Exemplo n.º 24
0
        public void WhenFinderMethodCalledReturnsLastIndexOfParameterString()
        {
            Pencil pencil = new Pencil(20, 20);
            Paper  paper  = new Paper();
            Eraser eraser = new Eraser(20);

            pencil.Write("Hello World!", paper);

            Assert.AreEqual(6, eraser.Finder("World", paper));
        }
Exemplo n.º 25
0
        public void ErasePhraseSuccessfull()
        {
            var eraser = new Eraser(1000);
            var pencil = new Pencil(100);
            var paper  = new Paper();

            paper.Write(pencil, "Jacob");
            paper.Erase(eraser, "Jacob");
            Assert.Equal("     ", paper.ReadAll());
        }
Exemplo n.º 26
0
        public override void NewMode()
        {
            base.NewMode();

            Eraser.Clear(this, "CLR1");
            cmbS_TAX_TYPE.EditValue = "1";
            cmbS_BANK.EditValue     = "0";
            cmbS_STATUS.EditValue   = "Y";
            cmbS_DIVISION.EditValue = "C";
        }
Exemplo n.º 27
0
        public void EraseEmptyString()
        {
            var eraser = new Eraser(2);
            var pencil = new Pencil(100);
            var paper  = new Paper();

            paper.Write(pencil, "Jacob");
            paper.Erase(eraser, string.Empty);
            Assert.Equal("Jacob", paper.ReadAll());
        }
Exemplo n.º 28
0
        public void EraseNonExistantWord()
        {
            var eraser = new Eraser(2);
            var pencil = new Pencil(100);
            var paper  = new Paper();

            paper.Write(pencil, "Jacob");
            paper.Erase(eraser, "Bacon");
            Assert.Equal("Jacob", paper.ReadAll());
        }
Exemplo n.º 29
0
        public void ErasePartialPhraseStartingFromTheBackOfTheWord()
        {
            var eraser = new Eraser(2);
            var pencil = new Pencil(100);
            var paper  = new Paper();

            paper.Write(pencil, "Jacob");
            paper.Erase(eraser, "Jacob");
            Assert.Equal("Jac  ", paper.ReadAll());
        }
Exemplo n.º 30
0
        public void WhenEraserFinderMethodCalledLastEditPropertySetToStartIndex()
        {
            Pencil pencil = new Pencil(500, 5);
            Paper  paper  = new Paper();
            Eraser eraser = new Eraser(20);

            pencil.Write("Hello World", paper);
            eraser.Finder("World", paper);

            Assert.AreEqual(6, paper.LastEditIndex);
        }
Exemplo n.º 31
0
 public static IList<DownloadInfo> GetDownloads(Eraser.Util.ProgressChangedEventHandler handler)
 {
     WebRequest.DefaultCachePolicy = new HttpRequestCachePolicy(
     HttpRequestCacheLevel.Revalidate);
        HttpWebRequest request = (HttpWebRequest)WebRequest.Create(
     new Uri("http://eraser.heidi.ie/scripts/updates?action=listupdates&version=6.1.0.0" ));
        using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
        using (Stream responseStream = response.GetResponseStream())
        using (MemoryStream memoryStream = new MemoryStream())
        {
     Util.ProgressManager progress = new Util.ProgressManager();
     progress.Total = response.ContentLength;
     int lastRead = 0;
     byte[] buffer = new byte[16384];
     while ((lastRead = responseStream.Read(buffer, 0, buffer.Length)) != 0)
     {
      memoryStream.Write(buffer, 0, lastRead);
      progress.Completed = memoryStream.Position;
      if (handler != null)
       handler(null, new Eraser.Util.ProgressChangedEventArgs(progress,
        S._("{0} of {1} downloaded", FileSize.ToString(progress.Completed),
     FileSize.ToString(progress.Total))));
     }
     memoryStream.Position = 0;
     return ParseDownloadList(memoryStream).AsReadOnly();
        }
 }
Exemplo n.º 32
0
 public void Download(Eraser.Util.ProgressChangedEventHandler handler)
 {
     if (DownloadedFile != null && DownloadedFile.Length > 0)
     throw new InvalidOperationException("The Download method cannot be called " +
      "before the Download method has been called.");
        lock (TempPathLock)
        {
     if (TempPath == null)
     {
      TempPath = new DirectoryInfo(Path.GetTempPath());
      TempPath = TempPath.CreateSubdirectory("eraser" + Environment.TickCount.ToString(
       CultureInfo.InvariantCulture));
     }
        }
        ProgressManager progress = new ProgressManager();
        try
        {
     HttpWebRequest request = (HttpWebRequest)WebRequest.Create(Link);
     using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
     {
      progress.Total = response.ContentLength;
      ContentDisposition contentDisposition = null;
      foreach (string header in response.Headers.AllKeys)
       if (header.ToUpperInvariant() == "CONTENT-DISPOSITION")
        contentDisposition = new ContentDisposition(response.Headers[header]);
      DownloadedFile = new FileInfo(Path.Combine(
       TempPath.FullName, string.Format(CultureInfo.InvariantCulture,
        "{0:00}-{1}", ++DownloadFileIndex, contentDisposition == null ?
     Path.GetFileName(Link.GetComponents(UriComponents.Path, UriFormat.Unescaped)) :
     contentDisposition.FileName)));
      using (Stream responseStream = response.GetResponseStream())
      using (FileStream fileStream = DownloadedFile.OpenWrite())
      {
       int lastRead = 0;
       byte[] buffer = new byte[16384];
       while ((lastRead = responseStream.Read(buffer, 0, buffer.Length)) != 0)
       {
        fileStream.Write(buffer, 0, lastRead);
        progress.Completed = fileStream.Position;
        if (handler != null)
     handler(this, new ProgressChangedEventArgs(progress, null));
       }
      }
      progress.MarkComplete();
      if (handler != null)
       handler(this, new ProgressChangedEventArgs(progress, null));
     }
        }
        catch (Exception e)
        {
     if (handler != null)
      handler(this, new ProgressChangedEventArgs(progress, e));
        }
 }