partial void OperationClick(AppKit.NSButton sender)
 {
     first             = Convert.ToDouble(wText.StringValue);
     wText.StringValue = "0";
     op = sender.Title;
 }
Exemple #2
0
 partial void ButtonNextClicked(AppKit.NSButton sender)
 {
     ViewModel.MoveForward();
     UpdateControls();
 }
Exemple #3
0
 partial void ClickedTestLoanButton(AppKit.NSButton sender)
 {
     this._TestLoan();
 }
Exemple #4
0
 partial void ButtonCancelClicked(AppKit.NSButton sender)
 {
     View.Window?.Close();
 }
Exemple #5
0
 partial void ButtonCopyDefinitionsClicked(AppKit.NSButton sender)
 {
     Clipboard.SetText(LabelDefinitions.StringValue);
 }
Exemple #6
0
 partial void ButtonCopyEndingsClicked(AppKit.NSButton sender)
 {
     Clipboard.SetText(LabelEndings.StringValue);
 }
Exemple #7
0
        private void updateTree(AppKit.NSButton sender)
        {
            string treeString = @"
{
  ""id"": 1,
  ""name"": ""root"",
  ""description"": ""description"",
  ""children"": [
    {
      ""id"": 2,
      ""name"": ""level1"",
      ""description"": ""description"",
      ""children"": [
        {
          ""id"": 4,
          ""name"": ""level22222"",
          ""description"": ""This is level2""
        },
        {
          ""id"": 5,
          ""name"": ""level222"",
          ""description"": ""This is level2"",
          ""children"": [
            {
              ""id"": 10,
              ""name"": ""level333"",
              ""description"": ""Here are a few key resources to get you started with building mobile apps quickly"",
              ""children"": [
                {
                  ""id"": 11,
                  ""name"": ""level444444"",
                  ""description"": ""Introduces Android development. Covers the tool chain, Xamarin.Android projects, and Android fundamentals.""
                },
                {
                  ""id"": 12,
                  ""name"": ""level 4444"",
                  ""description"": ""This guide walks through the installation steps and configuration details required to install Xamarin.Android on Windows.""
                }
              ]
            }
          ]
        }
      ]
    },
    {
      ""id"": 3,
      ""name"": ""level1111"",
      ""description"": ""description"",
      ""children"": [
        {
          ""id"": 6,
          ""name"": ""level2222222"",
          ""description"": ""Never know this level: level2, 233333""
        }
      ]
    },
    {
      ""id"": 3,
      ""name"": ""level111111111"",
      ""description"": ""description"",
      ""children"": [
        {
          ""id"": 7,
          ""name"": ""level22222222222"",
          ""description"": ""blahblahblah""
        },
        {
          ""id"": 8,
          ""name"": ""level222"",
          ""description"": ""The AppDelegate.cs file contains our AppDelegate class""
        },
        {
          ""id"": 9,
          ""name"": ""level two"",
          ""description"": ""which is responsible for creating our window and listening to OS events""
        }
      ]
    }
  ]
}";

            tree.TreeString = treeString;
        }
Exemple #8
0
 async partial void ButtonSearchClicked(AppKit.NSButton sender)
 {
     await LookUpWordAsync();
 }
 partial void ButtonClick(AppKit.NSButton sender) => ShowMouseState();
Exemple #10
0
 partial void OnGrabScreen(AppKit.NSButton sender)
 {
 }
        partial void AddButtonPushed(AppKit.NSButton sender)
        {
            // store values
            string   address            = this.AddressBox.StringValue;
            string   town               = this.TownBox.StringValue;
            string   county             = this.CountyBox.StringValue;
            string   state              = this.StateBox.StringValue;
            int      titleHolderID      = clsEntity.EntityID(this.TitleHolderPopUp.TitleOfSelectedItem);
            int      coID               = clsEntity.EntityID(this.CoBorrowerPopUp.TitleOfSelectedItem);
            int      lenderID           = clsEntity.EntityID(this.LenderPopUp.TitleOfSelectedItem);
            int      titleID            = clsEntity.EntityID(this.TitlePopUp.TitleOfSelectedItem);
            DateTime acquisitionDate    = (DateTime)this.PurchaseDatePicker.DateValue;
            double   price              = this.PurchasePriceBox.DoubleValue;
            double   bpo                = this.BPOBox.DoubleValue;
            double   rehabCost          = this.RehabCostBox.DoubleValue;
            double   pnl                = this.PnLBox.DoubleValue;
            double   months             = this.MonthsToCompletionBox.DoubleValue;
            double   loanRate           = this.LoanRateBox.DoubleValue;
            double   penaltyRate        = this.DefaultRateBox.DoubleValue;
            double   points             = this.PointsBox.DoubleValue;
            double   profitSplit        = this.ProfitSplitBox.DoubleValue;
            bool     acqOnly            = (this.AcquisitionOnlyCheckBox.State == NSCellStateValue.On);
            bool     bfullAcqCostFunded = (this.FullAcquisitionCostCheckBox.State == NSCellStateValue.On);
            double   initialFundingMult = this.InitialLoanPercentBox.DoubleValue;

            // acquisition cost estimates
            CostEstimate costEstimateForState;
            double       initialDraw          = -4500D;
            double       programFee           = -2000D;
            double       otherBudgetedCosts   = initialDraw - programFee; // accounting, travel, utilities, inspections, etc.
            double       concessionPercentage = 0.02;
            double       commissionPercentage = 0.06;
            double       totalBackEndCosts;

            // other stuff
            double dispostion;
            double totalCommitment;
            double upfrontCommitment;
            double hardInterestGuess;
            double pnlGuess;

            int    streetNumber;
            string streetName;

            this.UpdateMessage.StringValue = "";

            // check State.length == 2
            if (state.Length != 2)
            {
                this.UpdateMessage.StringValue = "Invalid State ID (Length must be 2)";
            }
            // check date > today
            else if (acquisitionDate < System.DateTime.Today)
            {
                this.UpdateMessage.StringValue = "Acquisition Date can not be in the past.";
            }
            // check no duplicates in entities
            else if ((titleHolderID == lenderID) || (titleHolderID == titleID) ||
                     (coID == lenderID) || (coID == titleID) || (lenderID == titleID))
            {
                this.UpdateMessage.StringValue = "Duplicate Entities - please check TitleHolder, CoBorrower, Lender and Title Company";
            }
            // check address has numbers and letters
            else if ((!Int32.TryParse(System.Text.RegularExpressions.Regex.Match(address, @"\d+").Value, out streetNumber)) ||
                     (streetName = System.Text.RegularExpressions.Regex.Replace(address, streetNumber.ToString(), "").Trim()) == "")
            {
                this.UpdateMessage.StringValue = "Invalid Street Address, must be {streetnumber} {streetname}";
            }
            // check all values are positive
            else if (price * months * bpo < 0.001)
            {
                this.UpdateMessage.StringValue = "Missing Values in price, BPO, or Months";
            }
            else if ((rehabCost <= 0) && (!acqOnly))
            {
                this.UpdateMessage.StringValue = "Rehab cost missing for non-acquisition-only loan";
            }
            else if ((pnl <= 0) && (profitSplit > 0))
            {
                this.UpdateMessage.StringValue = "Esimtated PnL Missing or Negative for loan with profit split";
            }
            // check things like lender elgible, borrower eligible, title company state eligible
            // Check valid address??
            // Check county??
            else
            {
                // Create new Property, Loan and Documents in tables
                if (coID == -1)
                {
                    coID = titleHolderID;
                }
                clsProperty newProperty = new clsProperty(address, town, county, state, bpo, streetName);
                newProperty.Save();
                clsLoan newLoan = new clsLoan(newProperty.ID(), titleHolderID, coID, titleID, lenderID, acquisitionDate,
                                              acquisitionDate.AddMonths(9), loanRate, penaltyRate, points, profitSplit, acqOnly);
                int newLoanID = newLoan.ID();
                for (int i = 0; i < Enum.GetValues(typeof(clsDocument.Type)).Length; i++)
                {
                    clsDocument newDoc = new clsDocument(((clsDocument.Type)i).ToString(), newProperty.ID(), (clsDocument.Type)i);
                    newDoc.Save();
                }

                #region Create Cashflows, contingent on Loan Parameters

                costEstimateForState = new CostEstimate(state, price, bpo, months);

                if (bfullAcqCostFunded)
                {
                    totalCommitment   = (price + rehabCost - initialDraw - costEstimateForState.AcquisitionClosingCosts) / (1D - points * 0.01);
                    upfrontCommitment = (totalCommitment - rehabCost / (1D - points * 0.01));
                    newLoan.AddCashflow(new clsCashflow(acquisitionDate, System.DateTime.Today, System.DateTime.MaxValue, newLoanID,
                                                        -price, false, clsCashflow.Type.AcquisitionPrice));
                    newLoan.AddCashflow(new clsCashflow(acquisitionDate, System.DateTime.Today, System.DateTime.MaxValue, newLoanID,
                                                        0D, false, clsCashflow.Type.AcquisitionConcession));
                    newLoan.AddCashflow(new clsCashflow(acquisitionDate, System.DateTime.Today, System.DateTime.MaxValue, newLoanID,
                                                        costEstimateForState.ProcessingCost, false, clsCashflow.Type.AcquisitionProcessing));
                    newLoan.AddCashflow(new clsCashflow(acquisitionDate, System.DateTime.Today, System.DateTime.MaxValue, newLoanID,
                                                        costEstimateForState.RecordingCost, false, clsCashflow.Type.AcquisitionRecording));
                    newLoan.AddCashflow(new clsCashflow(acquisitionDate, System.DateTime.Today, System.DateTime.MaxValue, newLoanID,
                                                        costEstimateForState.AcquisitionTaxes, false, clsCashflow.Type.AcquisitionTaxes));
                    newLoan.AddCashflow(new clsCashflow(acquisitionDate, System.DateTime.Today, System.DateTime.MaxValue, newLoanID,
                                                        costEstimateForState.HOICost, false, clsCashflow.Type.HomeownersInsurance));
                    newLoan.AddCashflow(new clsCashflow(acquisitionDate, System.DateTime.Today, System.DateTime.MaxValue, newLoanID,
                                                        initialDraw, false, clsCashflow.Type.InitialExpenseDraw));
                    newLoan.AddCashflow(new clsCashflow(acquisitionDate, System.DateTime.Today, System.DateTime.MaxValue, newLoanID,
                                                        costEstimateForState.TitlePolicyCost, false, clsCashflow.Type.TitlePolicy));
                    if (points > 0)
                    {
                        // upfront points
                        newLoan.AddCashflow(new clsCashflow(acquisitionDate, System.DateTime.Today, System.DateTime.MaxValue, newLoanID,
                                                            0.01 * points * upfrontCommitment, false, clsCashflow.Type.Points));
                        newLoan.AddCashflow(new clsCashflow(acquisitionDate, System.DateTime.Today, System.DateTime.MaxValue, newLoanID,
                                                            -0.01 * points * upfrontCommitment, false, clsCashflow.Type.Points));
                    }
                    if (!acqOnly)
                    {
                        // assume entire rehab draw comes halfway through the rehab process, and that there is a two month lag from rehab completion to sale closing
                        newLoan.AddCashflow(new clsCashflow(acquisitionDate.AddMonths((int)(0.5 * (months - 2D))), System.DateTime.Today,
                                                            System.DateTime.MaxValue, newLoanID, -rehabCost, false, clsCashflow.Type.RehabDraw));
                        if (points > 0)
                        {
                            // points on construction draws
                            newLoan.AddCashflow(new clsCashflow(acquisitionDate.AddMonths((int)(0.5 * (months - 2D))), System.DateTime.Today,
                                                                System.DateTime.MaxValue, newLoanID,
                                                                0.01 * points * rehabCost / (1D - points * 0.01),
                                                                false, clsCashflow.Type.Points));
                            newLoan.AddCashflow(new clsCashflow(acquisitionDate.AddMonths((int)(0.5 * (months - 2D))), System.DateTime.Today,
                                                                System.DateTime.MaxValue, newLoanID,
                                                                -0.01 * points * rehabCost / (1D - points * 0.01),
                                                                false, clsCashflow.Type.Points));
                        }
                    }
                }
                else
                {
                    totalCommitment = price * initialFundingMult;
                    newLoan.AddCashflow(new clsCashflow(acquisitionDate, DateTime.Today, DateTime.MaxValue, newLoanID,
                                                        -price, false, clsCashflow.Type.AcquisitionPrice));
                    newLoan.AddCashflow(new clsCashflow(acquisitionDate, DateTime.Today, DateTime.MaxValue, newLoanID,
                                                        -price * (initialFundingMult - 1D), false, clsCashflow.Type.InitialExpenseDraw));
                    if (points > 0)
                    {
                        newLoan.AddCashflow(new clsCashflow(acquisitionDate, System.DateTime.Today, System.DateTime.MaxValue, newLoanID,
                                                            0.01 * points * totalCommitment, false, clsCashflow.Type.Points));
                    }
                }

                // disposition cashflow
                hardInterestGuess = (totalCommitment - 0.5 * rehabCost) * (months / 12D) * loanRate;
                if (profitSplit > 0)
                {
                    totalBackEndCosts = costEstimateForState.SaleTaxes + hardInterestGuess + bpo * (concessionPercentage + commissionPercentage);
                    pnlGuess          = bpo - (totalCommitment + totalBackEndCosts);
                    if (!bfullAcqCostFunded)
                    {
                        pnlGuess += -totalCommitment * points * 0.01;
                    }                                                                          // if points were payed upfront, subtract from PnL
                    UpdateMessage.StringValue += "\n Estimated vs Quoted PnL: \t";
                    UpdateMessage.StringValue += pnlGuess.ToString("000,000.00") + " vs " + pnl.ToString("000,000.00");
                }
                else
                {
                    pnlGuess = 0D;
                }
                dispostion = totalCommitment + hardInterestGuess + profitSplit * pnl;  // user-given pnl rather than system estimate
                newLoan.AddCashflow(new clsCashflow(acquisitionDate.AddMonths((int)months), System.DateTime.Today, System.DateTime.MaxValue,
                                                    newLoanID, dispostion, false, clsCashflow.Type.NetDispositionProj));
                #endregion

                newLoan.SetNewOriginationDate(acquisitionDate);
                newLoan.Save();

                // write summary to text label (this.UpdateMessage.StringValue)
                this.UpdateMessage.StringValue += String.Format("\n\nCompleted adding new loan ({0}), new cashflows, new property ({1}), and new docs ",
                                                                newLoan.ID().ToString(),
                                                                newProperty.ID().ToString());
            }
        }
Exemple #12
0
 partial void didPostEvent(AppKit.NSButton sender)
 {
     MessageBus.Default.Post(new CustomMessageBusEvent());
 }
Exemple #13
0
 partial void ButtonPreviousClicked(AppKit.NSButton sender)
 {
     ViewModel.MoveBack();
     UpdateControls();
 }
Exemple #14
0
 async partial void ButtonPlaySoundClicked(AppKit.NSButton sender)
 {
     await AudioManager.PlaySoundAsync(_wordViewModel.Sound);
 }
Exemple #15
0
 partial void UpdateButtonPushed(AppKit.NSButton sender)
 {
     this.SummaryMessageField.StringValue = "";
     if (this.loanToUpdate == null)
     {
         this.SummaryMessageField.StringValue = "No loan selected.  No updates made.";
     }
     else if (this.loanToUpdate.Status() != clsLoan.State.Cancelled)
     {
         // only validaton is:  are any cashflows ACTUAL
         bool   bAnyActuals = false;
         double oldAcqCost  = this.loanToUpdate.AcquisitionCost(false);
         foreach (clsCashflow cf in this.loanToUpdate.Cashflows())
         {
             if (cf.Actual())
             {
                 bAnyActuals = true;
             }
         }
         if (bAnyActuals)
         {
             this.SummaryMessageField.StringValue = "Can't update - some cashflows are marked Actual";
         }
         else
         {
             int delayDays = ((DateTime)this.ClosingDatePicker.DateValue - this.loanToUpdate.OriginationDate()).Days;
             List <clsCashflow> newCashflows = new List <clsCashflow>();
             // delete all existing scheduled cashflows
             foreach (clsCashflow cf in this.loanToUpdate.Cashflows())
             {
                 if (cf.DeleteDate() > System.DateTime.Today.AddYears(50))
                 {
                     if ((cf.TypeID() == clsCashflow.Type.NetDispositionProj) ||
                         (cf.TypeID() == clsCashflow.Type.RehabDraw))
                     {
                         newCashflows.Add(new clsCashflow(cf.PayDate().AddDays(delayDays),
                                                          System.DateTime.Today, System.DateTime.MaxValue,
                                                          this.loanToUpdate.ID(), cf.Amount(), false, cf.TypeID()));
                     }
                     cf.Delete(System.DateTime.Today);
                 }
             }
             // create all the new cashflows
             this.loanToUpdate.AddCashflow(new clsCashflow((DateTime)this.ClosingDatePicker.DateValue,
                                                           System.DateTime.Now, System.DateTime.MaxValue,
                                                           this.loanToUpdate.ID(), -this.PriceField.DoubleValue,
                                                           false, clsCashflow.Type.AcquisitionPrice));
             if (this.ConcessionField.DoubleValue > 0)
             {
                 this.loanToUpdate.AddCashflow(new clsCashflow((DateTime)this.ClosingDatePicker.DateValue,
                                                               System.DateTime.Now, System.DateTime.MaxValue,
                                                               this.loanToUpdate.ID(), this.ConcessionField.DoubleValue,
                                                               false, clsCashflow.Type.AcquisitionConcession));
             }
             if (this.HOIField.DoubleValue > 0)
             {
                 this.loanToUpdate.AddCashflow(new clsCashflow((DateTime)this.ClosingDatePicker.DateValue,
                                                               System.DateTime.Now, System.DateTime.MaxValue,
                                                               this.loanToUpdate.ID(), -this.HOIField.DoubleValue,
                                                               false, clsCashflow.Type.HomeownersInsurance));
             }
             if (this.AcqTaxField.DoubleValue > 0)
             {
                 this.loanToUpdate.AddCashflow(new clsCashflow((DateTime)this.ClosingDatePicker.DateValue,
                                                               System.DateTime.Now, System.DateTime.MaxValue,
                                                               this.loanToUpdate.ID(), -this.AcqTaxField.DoubleValue,
                                                               false, clsCashflow.Type.AcquisitionTaxes));
             }
             if (this.RecordingField.DoubleValue > 0)
             {
                 this.loanToUpdate.AddCashflow(new clsCashflow((DateTime)this.ClosingDatePicker.DateValue,
                                                               System.DateTime.Now, System.DateTime.MaxValue,
                                                               this.loanToUpdate.ID(), -this.RecordingField.DoubleValue,
                                                               false, clsCashflow.Type.AcquisitionRecording));
             }
             if (this.ProcessingField.DoubleValue > 0)
             {
                 this.loanToUpdate.AddCashflow(new clsCashflow((DateTime)this.ClosingDatePicker.DateValue,
                                                               System.DateTime.Now, System.DateTime.MaxValue,
                                                               this.loanToUpdate.ID(), -this.ProcessingField.DoubleValue,
                                                               false, clsCashflow.Type.AcquisitionProcessing));
             }
             if (this.TitlePolicyField.DoubleValue > 0)
             {
                 this.loanToUpdate.AddCashflow(new clsCashflow((DateTime)this.ClosingDatePicker.DateValue,
                                                               System.DateTime.Now, System.DateTime.MaxValue,
                                                               this.loanToUpdate.ID(), -this.TitlePolicyField.DoubleValue,
                                                               false, clsCashflow.Type.TitlePolicy));
             }
             if (this.InitialDrawField.DoubleValue > 0)
             {
                 this.loanToUpdate.AddCashflow(new clsCashflow((DateTime)this.ClosingDatePicker.DateValue,
                                                               System.DateTime.Now, System.DateTime.MaxValue,
                                                               this.loanToUpdate.ID(), -this.InitialDrawField.DoubleValue,
                                                               false, clsCashflow.Type.InitialExpenseDraw));
             }
             if (this.PropertyTaxField.DoubleValue > 0)
             {
                 this.loanToUpdate.AddCashflow(new clsCashflow((DateTime)this.ClosingDatePicker.DateValue,
                                                               System.DateTime.Now, System.DateTime.MaxValue,
                                                               this.loanToUpdate.ID(), -this.PropertyTaxField.DoubleValue,
                                                               false, clsCashflow.Type.PropertyTax));
             }
             if (loanToUpdate.Points() > 0)
             {
                 if (this.loanToUpdate.PointsCapitalized()) // if points were capitalized, capitalize them on update
                 {
                     this.loanToUpdate.AddCashflow(new clsCashflow((DateTime)this.ClosingDatePicker.DateValue,
                                                                   DateTime.Now, DateTime.MaxValue,
                                                                   this.loanToUpdate.ID(), -this.UpdatedPointsLabel.DoubleValue,
                                                                   false, clsCashflow.Type.Points));
                 }
                 // either way, add points paid at closing (to lender)
                 this.loanToUpdate.AddCashflow(new clsCashflow((DateTime)this.ClosingDatePicker.DateValue,
                                                               DateTime.Now, DateTime.MaxValue,
                                                               this.loanToUpdate.ID(), this.UpdatedPointsLabel.DoubleValue,
                                                               false, clsCashflow.Type.Points));
             }
             foreach (clsCashflow cf in newCashflows)
             {
                 if (cf.TypeID() == clsCashflow.Type.NetDispositionProj)
                 {
                     DateTime newDate = (DateTime)this.ClosingDatePicker.DateValue;
                     clsLoan  l       = loanToUpdate.LoanAsOf(newDate.AddDays(1), true);
                     this.loanToUpdate.AddCashflow(new clsCashflow(cf.PayDate(), cf.RecordDate(), cf.DeleteDate(), cf.LoanID(),
                                                                   cf.Amount() + loanToUpdate.LoanAsOf(newDate.AddDays(1), true).Balance(newDate.AddDays(1)) - oldAcqCost,
                                                                   false, clsCashflow.Type.NetDispositionProj));
                     //                                cf.Amount() + loanToUpdate.AcquisitionCost(false) - oldAcqCost, false, clsCashflow.Type.NetDispositionProj));
                 }
                 else
                 {
                     this.loanToUpdate.AddCashflow(cf);
                 }
             }
             // Update origination Date and Save
             this.loanToUpdate.SetNewOriginationDate((DateTime)this.ClosingDatePicker.DateValue);
             this.loanToUpdate.LenderID   = clsEntity.EntityID((String)(NSString)this.LenderComboBox.SelectedValue);
             this.loanToUpdate.BorrowerID = clsEntity.EntityID((String)(NSString)this.BorrowerComboBox.SelectedValue);
             if (this.loanToUpdate.Save())
             {
                 this.SummaryMessageField.StringValue += "\nSave successful.  " + this.loanToUpdate.Property().Address();
                 this.SummaryMessageField.StringValue += "\nOld / New Acquisition Cost = ";
                 this.SummaryMessageField.StringValue += oldAcqCost.ToString("#,##0.00") + " / ";
                 this.SummaryMessageField.StringValue += this.loanToUpdate.AcquisitionCost(false).ToString("#,##0.00");
                 this.UpdateTotalCostLabel();
             }
             else
             {
                 this.SummaryMessageField.StringValue += "\nSave Failed.";
             }
         }
     }
     else
     {
         this.SummaryMessageField.StringValue = "Update failed.  Loan has already been cancelled.  " + this.loanToUpdate.Property().Address();
     }
 }
Exemple #16
0
 async partial void ButtonSaveSoundClicked(AppKit.NSButton sender)
 {
     await AudioManager.SaveSoundFileAsync(_wordViewModel.Sound, _wordViewModel.Word);
 }
Exemple #17
0
 partial void button1_click(AppKit.NSButton sender)
 {
     Lable1.StringValue = "hello I am a CS student.";
 }
Exemple #18
0
 partial void ButtonCopyWordClicked(AppKit.NSButton sender)
 {
     Clipboard.SetText(LabelWord.StringValue);
 }
        private void InitializeComponent()
        {
            this.Title      = "Update Figma Package";
            this.StyleMask |= NSWindowStyle.Closable;
            this.StandardWindowButton(NSWindowButton.ZoomButton).Enabled = false;

            var frame = Frame;

            frame.Size = new CoreGraphics.CGSize(455f, 202f);
            this.SetFrame(frame, true);
            this.ContentMinSize = this.ContentView.Frame.Size;

            // View:     updateButton
            // NodeName: "updateButton"
            // NodeType: INSTANCE
            // NodeId:   38:685
            updateButton               = new AppKit.NSButton();
            updateButton.WantsLayer    = true;
            updateButton.BezelStyle    = NSBezelStyle.Rounded;
            updateButton.ControlSize   = NSControlSize.Regular;
            updateButton.Font          = AppKit.NSFont.SystemFontOfSize(AppKit.NSFont.SystemFontSize);;
            updateButton.Title         = "Update";
            updateButton.KeyEquivalent = "\r";

            this.ContentView.AddSubview(updateButton);
            updateButton.Frame = updateButton.GetFrameForAlignmentRect(new CoreGraphics.CGRect(352f, 20f, 84f, 21f));;

            // View:     cancelButton
            // NodeName: "cancelButton"
            // NodeType: INSTANCE
            // NodeId:   38:686
            cancelButton             = new AppKit.NSButton();
            cancelButton.WantsLayer  = true;
            cancelButton.BezelStyle  = NSBezelStyle.Rounded;
            cancelButton.ControlSize = NSControlSize.Regular;
            cancelButton.Font        = AppKit.NSFont.SystemFontOfSize(AppKit.NSFont.SystemFontSize);;
            cancelButton.Title       = "Cancel";

            this.ContentView.AddSubview(cancelButton);
            cancelButton.Frame = cancelButton.GetFrameForAlignmentRect(new CoreGraphics.CGRect(257f, 20f, 84f, 21f));;

            // View:     versionSpinner
            // NodeName: "versionSpinner"
            // NodeType: INSTANCE
            // NodeId:   38:687
            versionSpinner             = new AppKit.NSProgressIndicator();
            versionSpinner.WantsLayer  = true;
            versionSpinner.Style       = NSProgressIndicatorStyle.Spinning;
            versionSpinner.Hidden      = true;
            versionSpinner.ControlSize = NSControlSize.Small;

            this.ContentView.AddSubview(versionSpinner);
            versionSpinner.Frame = versionSpinner.GetFrameForAlignmentRect(new CoreGraphics.CGRect(383f, 95f, 18f, 18f));;

            // View:     labelView
            // NodeName: Generate:
            // NodeType: INSTANCE
            // NodeId:   38:688
            var labelView = new AppKit.NSTextField();

            labelView.Editable        = false;
            labelView.Bordered        = false;
            labelView.Bezeled         = false;
            labelView.DrawsBackground = false;
            labelView.StringValue     = "Figma Package:";
            labelView.Font            = AppKit.NSFont.SystemFontOfSize(AppKit.NSFont.SystemFontSize);;
            labelView.WantsLayer      = true;
            labelView.Alignment       = NSTextAlignment.Right;

            this.ContentView.AddSubview(labelView);
            labelView.Frame = labelView.GetFrameForAlignmentRect(new CoreGraphics.CGRect(8f, 127f, 142f, 20f));;

            // View:     labelView1
            // NodeName: Generate:
            // NodeType: INSTANCE
            // NodeId:   38:689
            var labelView1 = new AppKit.NSTextField();

            labelView1.Editable        = false;
            labelView1.Bordered        = false;
            labelView1.Bezeled         = false;
            labelView1.DrawsBackground = false;
            labelView1.StringValue     = "Update to:";
            labelView1.Font            = AppKit.NSFont.SystemFontOfSize(AppKit.NSFont.SystemFontSize);;
            labelView1.WantsLayer      = true;
            labelView1.Alignment       = NSTextAlignment.Right;

            this.ContentView.AddSubview(labelView1);
            labelView1.Frame = labelView1.GetFrameForAlignmentRect(new CoreGraphics.CGRect(8f, 94f, 142f, 20f));;

            // View:     bundlePopUp
            // NodeName: "bundlePopUp"
            // NodeType: INSTANCE
            // NodeId:   38:690
            bundlePopUp             = new AppKit.NSPopUpButton();
            bundlePopUp.WantsLayer  = true;
            bundlePopUp.BezelStyle  = NSBezelStyle.Rounded;
            bundlePopUp.ControlSize = NSControlSize.Regular;
            bundlePopUp.AddItem("Breakpoints Dialog");

            this.ContentView.AddSubview(bundlePopUp);
            bundlePopUp.Frame = bundlePopUp.GetFrameForAlignmentRect(new CoreGraphics.CGRect(154f, 126f, 223f, 21f));;

            // View:     versionPopUp
            // NodeName: "versionPopUp"
            // NodeType: INSTANCE
            // NodeId:   38:691
            versionPopUp             = new AppKit.NSPopUpButton();
            versionPopUp.WantsLayer  = true;
            versionPopUp.BezelStyle  = NSBezelStyle.Rounded;
            versionPopUp.ControlSize = NSControlSize.Regular;
            versionPopUp.AddItem("Current – 8.6");

            this.ContentView.AddSubview(versionPopUp);
            versionPopUp.Frame = versionPopUp.GetFrameForAlignmentRect(new CoreGraphics.CGRect(154f, 93f, 223f, 21f));;

            // View:     translationsCheckbox
            // NodeName: "translationsCheckbox"
            // NodeType: INSTANCE
            // NodeId:   38:692
            translationsCheckbox            = new AppKit.NSButton();
            translationsCheckbox.WantsLayer = true;
            translationsCheckbox.BezelStyle = NSBezelStyle.Rounded;
            translationsCheckbox.SetButtonType(NSButtonType.Switch);
            translationsCheckbox.ControlSize = NSControlSize.Regular;
            translationsCheckbox.Font        = AppKit.NSFont.SystemFontOfSize(AppKit.NSFont.SystemFontSize);;
            translationsCheckbox.Title       = "Make strings translatable";
            translationsCheckbox.State       = NSCellStateValue.Off;

            this.ContentView.AddSubview(translationsCheckbox);
            translationsCheckbox.Frame = translationsCheckbox.GetFrameForAlignmentRect(new CoreGraphics.CGRect(154f, 61f, 223f, 14f));;
        }
Exemple #20
0
 partial void ButtonCopyPronunciationClicked(AppKit.NSButton sender)
 {
     Clipboard.SetText(LabelPronunciation.StringValue);
 }
Exemple #21
0
        private void InitializeComponent()
        {
            this.Title      = "Add Figma Package";
            this.StyleMask |= NSWindowStyle.Resizable;
            this.StyleMask |= NSWindowStyle.Closable;
            this.StandardWindowButton(NSWindowButton.ZoomButton).Enabled = false;

            var frame = Frame;

            frame.Size = new CoreGraphics.CGSize(481f, 380f);
            this.SetFrame(frame, true);
            this.ContentMinSize = this.ContentView.Frame.Size;

            // View:     bundleButton
            // NodeName: "bundleButton"
            // NodeType: INSTANCE
            // NodeId:   38:696
            bundleButton                    = new AppKit.NSButton();
            bundleButton.WantsLayer         = true;
            bundleButton.BezelStyle         = NSBezelStyle.Rounded;
            bundleButton.ControlSize        = NSControlSize.Regular;
            bundleButton.Font               = AppKit.NSFont.SystemFontOfSize(AppKit.NSFont.SystemFontSize);;
            bundleButton.Title              = "Add Package";
            bundleButton.KeyEquivalent      = "\r";
            bundleButton.AccessibilityTitle = "Bundle";
            bundleButton.AccessibilityHelp  = "Starts bundling the document";


            this.ContentView.AddSubview(bundleButton);
            bundleButton.Frame = bundleButton.GetFrameForAlignmentRect(new CoreGraphics.CGRect(354f, 20f, 108f, 21f));;

            // View:     cancelButton
            // NodeName: "cancelButton"
            // NodeType: INSTANCE
            // NodeId:   38:697
            cancelButton                    = new AppKit.NSButton();
            cancelButton.WantsLayer         = true;
            cancelButton.BezelStyle         = NSBezelStyle.Rounded;
            cancelButton.ControlSize        = NSControlSize.Regular;
            cancelButton.Font               = AppKit.NSFont.SystemFontOfSize(AppKit.NSFont.SystemFontSize);;
            cancelButton.Title              = "Cancel";
            cancelButton.AccessibilityTitle = "Cancel";
            cancelButton.AccessibilityHelp  = "Cancel bundling";


            this.ContentView.AddSubview(cancelButton);
            cancelButton.Frame = cancelButton.GetFrameForAlignmentRect(new CoreGraphics.CGRect(19f, 20f, 84f, 21f));;

            // View:     lineView
            // NodeName: sep
            // NodeType: VECTOR
            // NodeId:   38:698
            var lineView = new AppKit.NSBox();

            lineView.WantsLayer = true;
            lineView.BoxType    = NSBoxType.NSBoxSeparator;

            this.ContentView.AddSubview(lineView);
            lineView.Frame = lineView.GetFrameForAlignmentRect(new CoreGraphics.CGRect(0f, 59.5f, 481f, 0f));;

            // View:     translationsCheckbox
            // NodeName: "translationsCheckbox"
            // NodeType: INSTANCE
            // NodeId:   38:699
            translationsCheckbox            = new AppKit.NSButton();
            translationsCheckbox.WantsLayer = true;
            translationsCheckbox.BezelStyle = NSBezelStyle.Rounded;
            translationsCheckbox.SetButtonType(NSButtonType.Switch);
            translationsCheckbox.ControlSize = NSControlSize.Regular;
            translationsCheckbox.Font        = AppKit.NSFont.SystemFontOfSize(AppKit.NSFont.SystemFontSize);;
            translationsCheckbox.Title       = "Make strings translatable";
            translationsCheckbox.State       = NSCellStateValue.Off;

            this.ContentView.AddSubview(translationsCheckbox);
            translationsCheckbox.Frame = translationsCheckbox.GetFrameForAlignmentRect(new CoreGraphics.CGRect(169f, 104f, 238f, 14f));;

            // View:     includeOriginalCheckbox
            // NodeName: "includeOriginalCheckbox"
            // NodeType: INSTANCE
            // NodeId:   38:700
            includeOriginalCheckbox            = new AppKit.NSButton();
            includeOriginalCheckbox.WantsLayer = true;
            includeOriginalCheckbox.BezelStyle = NSBezelStyle.Rounded;
            includeOriginalCheckbox.SetButtonType(NSButtonType.Switch);
            includeOriginalCheckbox.ControlSize = NSControlSize.Regular;
            includeOriginalCheckbox.Font        = AppKit.NSFont.SystemFontOfSize(AppKit.NSFont.SystemFontSize);;
            includeOriginalCheckbox.Title       = "Include original Figma document";
            includeOriginalCheckbox.State       = NSCellStateValue.On;

            this.ContentView.AddSubview(includeOriginalCheckbox);
            includeOriginalCheckbox.Frame = includeOriginalCheckbox.GetFrameForAlignmentRect(new CoreGraphics.CGRect(169f, 82f, 238f, 14f));;

            // View:     generateRadios
            // NodeName: "generateRadios"
            // NodeType: FRAME
            // NodeId:   38:701
            generateRadios            = new AppKit.NSView();
            generateRadios.WantsLayer = true;

            this.ContentView.AddSubview(generateRadios);
            generateRadios.Frame = generateRadios.GetFrameForAlignmentRect(new CoreGraphics.CGRect(169f, 135f, 220f, 60f));;

            // View:     nothingRadio
            // NodeName: radio "nothingRadio"
            // NodeType: INSTANCE
            // NodeId:   38:702
            nothingRadio            = new AppKit.NSButton();
            nothingRadio.WantsLayer = true;
            nothingRadio.BezelStyle = NSBezelStyle.Rounded;
            nothingRadio.SetButtonType(NSButtonType.Radio);
            nothingRadio.ControlSize        = NSControlSize.Regular;
            nothingRadio.Font               = AppKit.NSFont.SystemFontOfSize(AppKit.NSFont.SystemFontSize);;
            nothingRadio.Title              = "Nothing";
            nothingRadio.AccessibilityTitle = "Nothing";
            nothingRadio.AccessibilityHelp  = "Select to not output anything";


            generateRadios.AddSubview(nothingRadio);
            nothingRadio.Frame = nothingRadio.GetFrameForAlignmentRect(new CoreGraphics.CGRect(0f, 0f, 89f, 16f));;

            // View:     templateRadio
            // NodeName: radio "templateRadio"
            // NodeType: INSTANCE
            // NodeId:   38:703
            templateRadio            = new AppKit.NSButton();
            templateRadio.WantsLayer = true;
            templateRadio.BezelStyle = NSBezelStyle.Rounded;
            templateRadio.SetButtonType(NSButtonType.Radio);
            templateRadio.ControlSize        = NSControlSize.Regular;
            templateRadio.Font               = AppKit.NSFont.SystemFontOfSize(AppKit.NSFont.SystemFontSize);;
            templateRadio.Title              = "Template";
            templateRadio.AccessibilityTitle = "Template";
            templateRadio.AccessibilityHelp  = "Select to output a template";


            generateRadios.AddSubview(templateRadio);
            templateRadio.Frame = templateRadio.GetFrameForAlignmentRect(new CoreGraphics.CGRect(0f, 22f, 89f, 16f));;

            // View:     codeRadio
            // NodeName: radio "codeRadio"
            // NodeType: INSTANCE
            // NodeId:   38:704
            codeRadio            = new AppKit.NSButton();
            codeRadio.WantsLayer = true;
            codeRadio.BezelStyle = NSBezelStyle.Rounded;
            codeRadio.SetButtonType(NSButtonType.Radio);
            codeRadio.ControlSize = NSControlSize.Regular;
            codeRadio.Font        = AppKit.NSFont.SystemFontOfSize(AppKit.NSFont.SystemFontSize);;
            codeRadio.Title       = "Code";
            codeRadio.State       = NSCellStateValue.On;

            generateRadios.AddSubview(codeRadio);
            codeRadio.Frame = codeRadio.GetFrameForAlignmentRect(new CoreGraphics.CGRect(0f, 44f, 54f, 16f));;

            // View:     labelView
            // NodeName: Generate:
            // NodeType: INSTANCE
            // NodeId:   38:705
            var labelView = new AppKit.NSTextField();

            labelView.Editable        = false;
            labelView.Bordered        = false;
            labelView.Bezeled         = false;
            labelView.DrawsBackground = false;
            labelView.StringValue     = "Generate:";
            labelView.Font            = AppKit.NSFont.SystemFontOfSize(AppKit.NSFont.SystemFontSize);;
            labelView.WantsLayer      = true;
            labelView.Alignment       = NSTextAlignment.Right;

            this.ContentView.AddSubview(labelView);
            labelView.Frame = labelView.GetFrameForAlignmentRect(new CoreGraphics.CGRect(21f, 177f, 142f, 20f));;

            // View:     namespacePopUp
            // NodeName: "namespacePopUp"
            // NodeType: INSTANCE
            // NodeId:   38:706
            namespacePopUp            = new AppKit.NSComboBox();
            namespacePopUp.WantsLayer = true;
            namespacePopUp.Font       = AppKit.NSFont.SystemFontOfSize(AppKit.NSFont.SystemFontSize);;
            namespacePopUp.Add(new Foundation.NSString("MyApp"));
            namespacePopUp.AccessibilityTitle = "Namespace";
            namespacePopUp.AccessibilityHelp  = "The namespace to generate code in";


            this.ContentView.AddSubview(namespacePopUp);
            namespacePopUp.Frame = namespacePopUp.GetFrameForAlignmentRect(new CoreGraphics.CGRect(169f, 210f, 220f, 20f));;

            // View:     labelView1
            // NodeName: Namespace:
            // NodeType: INSTANCE
            // NodeId:   38:707
            var labelView1 = new AppKit.NSTextField();

            labelView1.Editable        = false;
            labelView1.Bordered        = false;
            labelView1.Bezeled         = false;
            labelView1.DrawsBackground = false;
            labelView1.StringValue     = "Namespace:";
            labelView1.Font            = AppKit.NSFont.SystemFontOfSize(AppKit.NSFont.SystemFontSize);;
            labelView1.WantsLayer      = true;
            labelView1.Alignment       = NSTextAlignment.Right;

            this.ContentView.AddSubview(labelView1);
            labelView1.Frame = labelView1.GetFrameForAlignmentRect(new CoreGraphics.CGRect(21f, 211f, 142f, 20f));;

            // View:     lineView1
            // NodeName: sep
            // NodeType: VECTOR
            // NodeId:   38:708
            var lineView1 = new AppKit.NSBox();

            lineView1.WantsLayer = true;
            lineView1.BoxType    = NSBoxType.NSBoxSeparator;

            this.ContentView.AddSubview(lineView1);
            lineView1.Frame = lineView1.GetFrameForAlignmentRect(new CoreGraphics.CGRect(0f, 255.5f, 481f, 0f));;

            // View:     versionSpinner
            // NodeName: "versionSpinner"
            // NodeType: INSTANCE
            // NodeId:   38:709
            versionSpinner             = new AppKit.NSProgressIndicator();
            versionSpinner.WantsLayer  = true;
            versionSpinner.Style       = NSProgressIndicatorStyle.Spinning;
            versionSpinner.Hidden      = true;
            versionSpinner.ControlSize = NSControlSize.Small;

            this.ContentView.AddSubview(versionSpinner);
            versionSpinner.Frame = versionSpinner.GetFrameForAlignmentRect(new CoreGraphics.CGRect(396f, 281f, 18f, 18f));;

            // View:     versionPopUp
            // NodeName: "versionPopUp"
            // NodeType: INSTANCE
            // NodeId:   38:710
            versionPopUp             = new AppKit.NSPopUpButton();
            versionPopUp.WantsLayer  = true;
            versionPopUp.BezelStyle  = NSBezelStyle.Rounded;
            versionPopUp.ControlSize = NSControlSize.Regular;
            versionPopUp.AddItem("Current");

            this.ContentView.AddSubview(versionPopUp);
            versionPopUp.Frame = versionPopUp.GetFrameForAlignmentRect(new CoreGraphics.CGRect(167f, 279f, 223f, 21f));;

            // View:     labelView2
            // NodeName: Version:
            // NodeType: INSTANCE
            // NodeId:   38:711
            var labelView2 = new AppKit.NSTextField();

            labelView2.Editable        = false;
            labelView2.Bordered        = false;
            labelView2.Bezeled         = false;
            labelView2.DrawsBackground = false;
            labelView2.StringValue     = "Version:";
            labelView2.Font            = AppKit.NSFont.SystemFontOfSize(AppKit.NSFont.SystemFontSize);;
            labelView2.WantsLayer      = true;
            labelView2.Alignment       = NSTextAlignment.Right;

            this.ContentView.AddSubview(labelView2);
            labelView2.Frame = labelView2.GetFrameForAlignmentRect(new CoreGraphics.CGRect(21f, 280f, 142f, 20f));;

            // View:     figmaUrlTextField
            // NodeName: "figmaUrlTextField"
            // NodeType: INSTANCE
            // NodeId:   38:712
            figmaUrlTextField                   = new AppKit.NSTextField();
            figmaUrlTextField.WantsLayer        = true;
            figmaUrlTextField.PlaceholderString = "https://www.figma.com/file/";

            this.ContentView.AddSubview(figmaUrlTextField);
            figmaUrlTextField.Frame = figmaUrlTextField.GetFrameForAlignmentRect(new CoreGraphics.CGRect(168f, 311f, 221f, 21f));;

            // View:     labelView3
            // NodeName: Figma URL:
            // NodeType: INSTANCE
            // NodeId:   38:713
            var labelView3 = new AppKit.NSTextField();

            labelView3.Editable        = false;
            labelView3.Bordered        = false;
            labelView3.Bezeled         = false;
            labelView3.DrawsBackground = false;
            labelView3.StringValue     = "Figma URL:";
            labelView3.Font            = AppKit.NSFont.SystemFontOfSize(AppKit.NSFont.SystemFontSize);;
            labelView3.WantsLayer      = true;
            labelView3.Alignment       = NSTextAlignment.Right;

            this.ContentView.AddSubview(labelView3);
            labelView3.Frame = labelView3.GetFrameForAlignmentRect(new CoreGraphics.CGRect(21f, 311f, 142f, 20f));;
        }
Exemple #22
0
 partial void ClickedButton(AppKit.NSButton sender)
 {
     this._TestProperty();
 }
Exemple #23
0
        partial void AddButtonPushed(AppKit.NSButton sender)
        {
            // store values
            string   address         = this.AddressBox.StringValue;
            string   town            = this.TownBox.StringValue;
            string   county          = this.CountyBox.StringValue;
            string   state           = this.StateBox.StringValue;
            int      titleHolderID   = (int)this.TitleHolderPopUp.IndexOfSelectedItem - 3;
            int      coID            = (int)this.CoBorrowerPopUp.IndexOfSelectedItem - 3;
            int      lenderID        = (int)this.LenderPopUp.IndexOfSelectedItem - 3;
            int      titleID         = (int)this.TitlePopUp.IndexOfSelectedItem - 3;
            DateTime acquisitionDate = (DateTime)this.PurchaseDatePicker.DateValue;
            double   price           = this.PurchasePriceBox.DoubleValue;
            double   bpo             = this.BPOBox.DoubleValue;
            double   rehabCost       = this.RehabCostBox.DoubleValue;
            double   pnl             = this.PnLBox.DoubleValue;
            double   months          = this.MonthsToCompletionBox.DoubleValue;
            double   loanRate        = 0.09;
            double   penaltyRate     = 0.05;

            // acquisition cost estimates
            double processingCost;
            double recordingCost;
            double acquisitionTaxes;
            double titlePolicyCost;
            double HOICost;
            double propertyTaxes;
            double initialDraw = -4500D;

            double programFee = -2000D;
            double commissions;
            double transferTax;
            double proRatedPropertyTax;
            double otherBudgetedCosts = initialDraw - programFee;  // accounting, travel, utilities, inspections, etc.

            double concessionPercentage = 0.02;
            double commissionPercentage = 0.06;
            double totalBackEndCosts;

            // other stuff
            double dispostion;
            double totalCommitment;
            double hardInterestGuess;
            double pnlGuess;

            int    streetNumber;
            string streetName;

            this.UpdateMessage.StringValue = "";

            // check State.length == 2
            if (state.Length != 2)
            {
                this.UpdateMessage.StringValue = "Invalid State ID (Length must be 2)";
            }
            // check date > today
            else if (acquisitionDate < System.DateTime.Today)
            {
                this.UpdateMessage.StringValue = "Acquisition Date can not be in the past.";
            }
            // check no duplicates in entities
            else if ((titleHolderID == coID) || (titleHolderID == lenderID) || (titleHolderID == titleID) ||
                     (coID == lenderID) || (coID == titleID) || (lenderID == titleID))
            {
                this.UpdateMessage.StringValue = "Duplicate Entities - please check TitleHolder, CoBorrower, Lender and Title Company";
            }
            // check address has numbers and letters
            else if ((!Int32.TryParse(System.Text.RegularExpressions.Regex.Match(address, @"\d+").Value, out streetNumber)) ||
                     (streetName = System.Text.RegularExpressions.Regex.Replace(address, streetNumber.ToString(), "").Trim()) == "")
            {
                this.UpdateMessage.StringValue = "Invalid Street Address, must be {streetnumber} {streetname}";
            }
            // check all values are positive
            else if (price * rehabCost * months * pnl * bpo < 0.001)
            {
                this.UpdateMessage.StringValue = "Missing Values in price, rehab, PnL, BPO, or Months";
            }
            // check things like lender elgible, borrower eligible, title company state eligible
            // Check valid address??
            // Check county??
            else
            {
                // calculate estimated acquisition costs
                switch (state)
                {
                case "NJ":

                    processingCost      = -1150D;
                    recordingCost       = -415D;
                    acquisitionTaxes    = 0D;
                    titlePolicyCost     = -620 - 0.0044 * price;
                    HOICost             = -450 - 0.0054 * price;
                    propertyTaxes       = -0.015 * price;
                    proRatedPropertyTax = bpo * 0.002 * months;      // roughly 2.4% per year in NJ
                    transferTax         = bpo * 0.01;
                    break;

                case "MD":

                    processingCost      = -875D;
                    recordingCost       = -1090D - 0.0025 * price;
                    acquisitionTaxes    = -190D - 0.0066 * price;
                    titlePolicyCost     = -463D - 0.0042 * price;
                    HOICost             = -1017D - 0.0025 * price;
                    propertyTaxes       = -0.009 * price;
                    proRatedPropertyTax = bpo * 0.0009 * months;      // roughly 1.1% per year in MD
                    transferTax         = bpo * 0.01;
                    break;

                case "PA":

                    processingCost      = -250D;
                    recordingCost       = -425D - 0.0025 * price;
                    acquisitionTaxes    = -450D - 0.02 * price;
                    titlePolicyCost     = -1330D - 0.005 * price;
                    HOICost             = -417D - 0.0144 * price;
                    propertyTaxes       = -0.017 * price;
                    proRatedPropertyTax = bpo * 0.00125 * months;      // roughly 1.5% per year in PA
                    transferTax         = bpo * 0.01;
                    break;

                default:

                    processingCost      = -250D;
                    recordingCost       = -425D - 0.0025 * price;
                    acquisitionTaxes    = -450D - 0.02 * price;
                    titlePolicyCost     = -1330D - 0.005 * price;
                    HOICost             = -417D - 0.0144 * price;
                    propertyTaxes       = -0.017 * price;
                    proRatedPropertyTax = bpo * 0.00125 * months;      // roughly 1.5% per year in PA
                    transferTax         = bpo * 0.01;
                    break;
                }

                // calculate rough estimated other costs

                totalCommitment = price + rehabCost -
                                  (initialDraw + processingCost + recordingCost + acquisitionTaxes + titlePolicyCost + HOICost + propertyTaxes);
                commissions = bpo * commissionPercentage;
                // total back end costs are Accrued Property Tax, Sale Transfer Tax (typically split with buyer), Sale Commissons,
                //   seller concession / assistance, and Hard Interest
                hardInterestGuess = (totalCommitment - 0.5 * rehabCost) * (months / 12D) * loanRate;
                totalBackEndCosts = proRatedPropertyTax + transferTax + commissions + hardInterestGuess + bpo * concessionPercentage;
                pnlGuess          = bpo - (totalCommitment + totalBackEndCosts);

                // Check estimated PnL based on State, Purchase, Rehab - Message Box variance, reject if outside $X
                UpdateMessage.StringValue += "\n Estimated vs Quoted PnL: \t";
                UpdateMessage.StringValue += pnlGuess.ToString("000,000.00") + " vs " + pnl.ToString("000,000.00");

                dispostion = totalCommitment + hardInterestGuess + 0.5 * pnlGuess;

                // if valid, then create new property, new loan, new cashflows, new documents
                clsProperty newProperty = new clsProperty(address, town, county, state, bpo, streetName);
                newProperty.Save();

                clsLoan newLoan = new clsLoan(newProperty.ID(), titleHolderID, coID, titleID, lenderID,
                                              acquisitionDate, acquisitionDate.AddMonths(9), loanRate, penaltyRate);
                int newLoanID = newLoan.ID();
                newLoan.AddCashflow(new clsCashflow(acquisitionDate, System.DateTime.Today, System.DateTime.MaxValue, newLoanID,
                                                    -price, false, clsCashflow.Type.AcquisitionPrice));
                newLoan.AddCashflow(new clsCashflow(acquisitionDate, System.DateTime.Today, System.DateTime.MaxValue, newLoanID,
                                                    0D, false, clsCashflow.Type.AcquisitionConcession));
                newLoan.AddCashflow(new clsCashflow(acquisitionDate, System.DateTime.Today, System.DateTime.MaxValue, newLoanID,
                                                    processingCost, false, clsCashflow.Type.AcquisitionProcessing));
                newLoan.AddCashflow(new clsCashflow(acquisitionDate, System.DateTime.Today, System.DateTime.MaxValue, newLoanID,
                                                    recordingCost, false, clsCashflow.Type.AcquisitionRecording));
                newLoan.AddCashflow(new clsCashflow(acquisitionDate, System.DateTime.Today, System.DateTime.MaxValue, newLoanID,
                                                    acquisitionTaxes, false, clsCashflow.Type.AcquisitionTaxes));
                newLoan.AddCashflow(new clsCashflow(acquisitionDate, System.DateTime.Today, System.DateTime.MaxValue, newLoanID,
                                                    HOICost, false, clsCashflow.Type.HomeownersInsurance));
                newLoan.AddCashflow(new clsCashflow(acquisitionDate, System.DateTime.Today, System.DateTime.MaxValue, newLoanID,
                                                    initialDraw, false, clsCashflow.Type.InitialExpenseDraw));
                newLoan.AddCashflow(new clsCashflow(acquisitionDate, System.DateTime.Today, System.DateTime.MaxValue, newLoanID,
                                                    titlePolicyCost, false, clsCashflow.Type.TitlePolicy));
                // assume entire rehab draw comes halfway through the rehab process, and that there is a two month lag from rehab completion to sale closing
                newLoan.AddCashflow(new clsCashflow(acquisitionDate.AddMonths((int)(0.5 * (months - 2D))), System.DateTime.Today,
                                                    System.DateTime.MaxValue, newLoanID, -rehabCost, false, clsCashflow.Type.RehabDraw));
                // disposition cashflow
                newLoan.AddCashflow(new clsCashflow(acquisitionDate.AddMonths((int)months), System.DateTime.Today, System.DateTime.MaxValue,
                                                    newLoanID, dispostion, false, clsCashflow.Type.NetDispositionProj));
                newLoan.SetNewOriginationDate(acquisitionDate);
                newLoan.Save();

                // Create Documents
                for (int i = 0; i < Enum.GetValues(typeof(clsDocument.Type)).Length; i++)
                {
                    clsDocument newDoc = new clsDocument(((clsDocument.Type)i).ToString(), newProperty.ID(), (clsDocument.Type)i);
                    newDoc.Save();
                }

                // write summary to text label (this.UpdateMessage.StringValue)
                this.UpdateMessage.StringValue += String.Format("\n\nCompleted adding new loan ({0}), new cashflows, new property ({1}), and new docs ",
                                                                newLoan.ID().ToString(),
                                                                newProperty.ID().ToString());
            }
        }
 partial void UpdateButtonPushed(AppKit.NSButton sender)
 {
     this.SummaryMessageField.StringValue = "";
     if (this.loanToUpdate == null)
     {
         this.SummaryMessageField.StringValue = "No loan selected.  No updates made.";
     }
     else
     {
         // only validaton is:  are any cashflows ACTUAL
         bool   bAnyActuals = false;
         double oldAcqCost  = this.loanToUpdate.AcquisitionCost(false);
         foreach (clsCashflow cf in this.loanToUpdate.Cashflows())
         {
             if (cf.Actual())
             {
                 bAnyActuals = true;
             }
         }
         if (bAnyActuals)
         {
             this.SummaryMessageField.StringValue = "Can't update - some cashflows are marked Actual";
         }
         else
         {
             int delayDays = ((DateTime)this.ClosingDatePicker.DateValue - this.loanToUpdate.OriginationDate()).Days;
             List <clsCashflow> newCashflows = new List <clsCashflow>();
             // delete all existing scheduled cashflows
             foreach (clsCashflow cf in this.loanToUpdate.Cashflows())
             {
                 if (cf.DeleteDate() > System.DateTime.Today.AddYears(50))
                 {
                     if ((cf.TypeID() == clsCashflow.Type.NetDispositionProj) ||
                         (cf.TypeID() == clsCashflow.Type.RehabDraw))
                     {
                         newCashflows.Add(new clsCashflow(cf.PayDate().AddDays(delayDays),
                                                          System.DateTime.Today, System.DateTime.MaxValue,
                                                          this.loanToUpdate.ID(), cf.Amount(), false, cf.TypeID()));
                     }
                     cf.Delete(System.DateTime.Today);
                 }
             }
             // create all the new cashflows
             this.loanToUpdate.AddCashflow(new clsCashflow((DateTime)this.ClosingDatePicker.DateValue,
                                                           System.DateTime.Now, System.DateTime.MaxValue,
                                                           this.loanToUpdate.ID(), -this.PriceField.DoubleValue,
                                                           false, clsCashflow.Type.AcquisitionPrice));
             this.loanToUpdate.AddCashflow(new clsCashflow((DateTime)this.ClosingDatePicker.DateValue,
                                                           System.DateTime.Now, System.DateTime.MaxValue,
                                                           this.loanToUpdate.ID(), this.ConcessionField.DoubleValue,
                                                           false, clsCashflow.Type.AcquisitionConcession));
             this.loanToUpdate.AddCashflow(new clsCashflow((DateTime)this.ClosingDatePicker.DateValue,
                                                           System.DateTime.Now, System.DateTime.MaxValue,
                                                           this.loanToUpdate.ID(), -this.HOIField.DoubleValue,
                                                           false, clsCashflow.Type.HomeownersInsurance));
             this.loanToUpdate.AddCashflow(new clsCashflow((DateTime)this.ClosingDatePicker.DateValue,
                                                           System.DateTime.Now, System.DateTime.MaxValue,
                                                           this.loanToUpdate.ID(), -this.AcqTaxField.DoubleValue,
                                                           false, clsCashflow.Type.AcquisitionTaxes));
             this.loanToUpdate.AddCashflow(new clsCashflow((DateTime)this.ClosingDatePicker.DateValue,
                                                           System.DateTime.Now, System.DateTime.MaxValue,
                                                           this.loanToUpdate.ID(), -this.RecordingField.DoubleValue,
                                                           false, clsCashflow.Type.AcquisitionRecording));
             this.loanToUpdate.AddCashflow(new clsCashflow((DateTime)this.ClosingDatePicker.DateValue,
                                                           System.DateTime.Now, System.DateTime.MaxValue,
                                                           this.loanToUpdate.ID(), -this.ProcessingField.DoubleValue,
                                                           false, clsCashflow.Type.AcquisitionProcessing));
             this.loanToUpdate.AddCashflow(new clsCashflow((DateTime)this.ClosingDatePicker.DateValue,
                                                           System.DateTime.Now, System.DateTime.MaxValue,
                                                           this.loanToUpdate.ID(), -this.TitlePolicyField.DoubleValue,
                                                           false, clsCashflow.Type.TitlePolicy));
             this.loanToUpdate.AddCashflow(new clsCashflow((DateTime)this.ClosingDatePicker.DateValue,
                                                           System.DateTime.Now, System.DateTime.MaxValue,
                                                           this.loanToUpdate.ID(), -this.InitialDrawField.DoubleValue,
                                                           false, clsCashflow.Type.InitialExpenseDraw));
             this.loanToUpdate.AddCashflow(new clsCashflow((DateTime)this.ClosingDatePicker.DateValue,
                                                           System.DateTime.Now, System.DateTime.MaxValue,
                                                           this.loanToUpdate.ID(), -this.PropertyTaxField.DoubleValue,
                                                           false, clsCashflow.Type.PropertyTax));
             foreach (clsCashflow cf in newCashflows)
             {
                 this.loanToUpdate.AddCashflow(cf);
             }
             // Update origination Date and Save
             this.loanToUpdate.SetNewOriginationDate((DateTime)this.ClosingDatePicker.DateValue);
             if (this.loanToUpdate.Save())
             {
                 this.SummaryMessageField.StringValue += "\nSave successful.  Old / New Acquisition Cost = ";
                 this.SummaryMessageField.StringValue += oldAcqCost.ToString("#,##0.00") + " / ";
                 this.SummaryMessageField.StringValue += this.loanToUpdate.AcquisitionCost(false).ToString("#,##0.00");
             }
             else
             {
                 this.SummaryMessageField.StringValue += "\nSave Failed.";
             }
         }
     }
 }
 partial void ShowExpiredCheckBoxPressed(AppKit.NSButton sender)
 {
     this.showExpired = !this.showExpired;
     this.RedrawTable();
 }
Exemple #26
0
 // This will only reset colors to red
 partial void ResetAction(AppKit.NSButton sender)
 {
     DeliveredColorWell.Color = NSColor.Red;
     TouchedColorWell.Color   = NSColor.Red;
 }
Exemple #27
0
 partial void OnClickedAuthorise(AppKit.NSButton sender)
 {
     mAuthenticator.Authenticate();
 }
        private void InitializeComponent()
        {
            this.Title      = "Update Figma Package";
            this.StyleMask |= NSWindowStyle.Resizable;
            this.StyleMask |= NSWindowStyle.Closable;
            this.StandardWindowButton(NSWindowButton.ZoomButton).Enabled = false;

            var frame = Frame;

            frame.Size = new CoreGraphics.CGSize(481f, 379f);
            this.SetFrame(frame, true);
            this.ContentMinSize = this.ContentView.Frame.Size;

            // View:     bundleButton
            // NodeName: "bundleButton"
            // NodeType: INSTANCE
            // NodeId:   38:717
            bundleButton               = new AppKit.NSButton();
            bundleButton.WantsLayer    = true;
            bundleButton.BezelStyle    = NSBezelStyle.Rounded;
            bundleButton.ControlSize   = NSControlSize.Regular;
            bundleButton.Font          = AppKit.NSFont.SystemFontOfSize(AppKit.NSFont.SystemFontSize);;
            bundleButton.Title         = "Update";
            bundleButton.KeyEquivalent = "\r";

            this.ContentView.AddSubview(bundleButton);
            bundleButton.Frame = bundleButton.GetFrameForAlignmentRect(new CoreGraphics.CGRect(373f, 20f, 89f, 21f));;

            // View:     cancelButton
            // NodeName: "cancelButton"
            // NodeType: INSTANCE
            // NodeId:   38:718
            cancelButton             = new AppKit.NSButton();
            cancelButton.WantsLayer  = true;
            cancelButton.BezelStyle  = NSBezelStyle.Rounded;
            cancelButton.ControlSize = NSControlSize.Regular;
            cancelButton.Font        = AppKit.NSFont.SystemFontOfSize(AppKit.NSFont.SystemFontSize);;
            cancelButton.Title       = "Cancel";

            this.ContentView.AddSubview(cancelButton);
            cancelButton.Frame = cancelButton.GetFrameForAlignmentRect(new CoreGraphics.CGRect(19f, 20f, 84f, 21f));;

            // View:     tableScrollView
            // NodeName: customview "tableScrollView" type:"AppKit.NSScrollView"
            // NodeType: FRAME
            // NodeId:   38:719
            tableScrollView = new AppKit.NSScrollView();

            this.ContentView.AddSubview(tableScrollView);
            tableScrollView.Frame = tableScrollView.GetFrameForAlignmentRect(new CoreGraphics.CGRect(20f, 57f, 441f, 250f));;

            // View:     versionLabel
            // NodeName: "versionLabel"
            // NodeType: INSTANCE
            // NodeId:   38:726
            versionLabel                 = new AppKit.NSTextField();
            versionLabel.Editable        = false;
            versionLabel.Bordered        = false;
            versionLabel.Bezeled         = false;
            versionLabel.DrawsBackground = false;
            versionLabel.StringValue     = "Current - 8.6";
            versionLabel.Font            = AppKit.NSFont.SystemFontOfSize(AppKit.NSFont.SystemFontSize);;
            versionLabel.WantsLayer      = true;

            this.ContentView.AddSubview(versionLabel);
            versionLabel.Frame = versionLabel.GetFrameForAlignmentRect(new CoreGraphics.CGRect(93f, 321f, 162f, 20f));;

            // View:     labelView
            // NodeName: Generate:
            // NodeType: INSTANCE
            // NodeId:   44:0
            var labelView = new AppKit.NSTextField();

            labelView.Editable        = false;
            labelView.Bordered        = false;
            labelView.Bezeled         = false;
            labelView.DrawsBackground = false;
            labelView.StringValue     = "Update to:";
            labelView.Font            = AppKit.NSFont.SystemFontOfSize(AppKit.NSFont.SystemFontSize);;
            labelView.WantsLayer      = true;

            this.ContentView.AddSubview(labelView);
            labelView.Frame = labelView.GetFrameForAlignmentRect(new CoreGraphics.CGRect(21f, 321f, 68f, 20f));;

            // View:     translationsCheckbox
            // NodeName: "translationsCheckbox"
            // NodeType: INSTANCE
            // NodeId:   38:729
            translationsCheckbox            = new AppKit.NSButton();
            translationsCheckbox.WantsLayer = true;
            translationsCheckbox.BezelStyle = NSBezelStyle.Rounded;
            translationsCheckbox.SetButtonType(NSButtonType.Switch);
            translationsCheckbox.ControlSize = NSControlSize.Regular;
            translationsCheckbox.Font        = AppKit.NSFont.SystemFontOfSize(AppKit.NSFont.SystemFontSize);;
            translationsCheckbox.Title       = "Make strings translatable";
            translationsCheckbox.State       = NSCellStateValue.Off;

            this.ContentView.AddSubview(translationsCheckbox);
            translationsCheckbox.Frame = translationsCheckbox.GetFrameForAlignmentRect(new CoreGraphics.CGRect(277f, 324f, 187f, 14f));;
        }
Exemple #29
0
 partial void onClickClear(AppKit.NSButton sender)
 {
     _stringBuilder.Clear();
     textView.Value = string.Empty;
 }