예제 #1
0
        public static int?AddTerm(this IDivision division, IModelContext modelContext)
        {
            // TODO: Get vocabulary name from config
            var vocabularyName = "University_Structure";
            var vocabulary     = new VocabularyController().GetVocabularies().FirstOrDefault(v => v.Name == vocabularyName);

            if (vocabulary != null)
            {
                var termName = GetSafeTermName(division.ShortTitle, division.Title);
                try {
                    var term           = new Term(termName, string.Empty, vocabulary.VocabularyId);
                    var parentDivision = division.GetParentDivision(modelContext);
                    if (parentDivision != null)
                    {
                        term.ParentTermId = parentDivision.DivisionTermID;
                    }
                    return(new TermController().AddTerm(term));
                }
                catch (Exception ex) {
                    Exceptions.LogException(new Exception($"Error adding {termName} term to {vocabularyName} vocabulary.", ex));
                }
            }
            else
            {
                Exceptions.LogException(new Exception($"Could not find vocabulary with name {vocabularyName}."));
            }

            return(null);
        }
예제 #2
0
        public DivisionViewModel(IDivision division, ViewModelContext <DivisionSettings> context)
        {
            Division = division;
            Context  = context;

            _subDivisionViewModels = Division.SubDivisions.Select(d => new DivisionViewModel(d, Context)).ToList();
        }
예제 #3
0
        public static void UpdateTerm(this IDivision division, IModelContext modelContext)
        {
            var termName = GetSafeTermName(division.ShortTitle, division.Title);

            try {
                var parentDivision = division.GetParentDivision(modelContext);
                if (division.DivisionTermID != null)
                {
                    var termCtrl = new TermController();
                    var term     = termCtrl.GetTerm(division.DivisionTermID.Value);
                    if (term != null)
                    {
                        term.Name = termName;
                        if (parentDivision != null)
                        {
                            term.ParentTermId = parentDivision.DivisionTermID;
                        }
                        termCtrl.UpdateTerm(term);
                    }
                }
            }
            catch (Exception ex) {
                Exceptions.LogException(new Exception($"Error updating {termName} term.", ex));
            }
        }
 public override void Visit(IDivision division)
 {
     if (Process(division))
     {
         visitor.Visit(division);
     }
     base.Visit(division);
 }
예제 #5
0
        public Category(IDivision d, string n, string des)
        {
            this.Div         = d;
            this.Name        = n;
            this.Description = des;

            d.AddCategory(this);
        }
예제 #6
0
        private bool IsDivisionChampion(ITeam team)
        {
            IDivision div = GetConference(team).Divisions.Where(d => d.Teams.Contains(team)).FirstOrDefault();

            ITeam[] teams = div.Teams.ToArray();
            Array.Sort(teams, new DivisionCompare(league));
            return(teams[3] == team);
        }
예제 #7
0
 private static Dictionary <string, object> DivisionToAttributes(IDivision division)
 {
     return(new Dictionary <string, object>()
     {
         { "Division_ID", division.ID.ToString() },
         { "Name", division.Name },
     });
 }
예제 #8
0
        public static VCard GetVCard(this IDivision division)
        {
            var vcard = new VCard();

            // org. name
            if (!string.IsNullOrWhiteSpace(division.Title))
            {
                vcard.OrganizationName = division.Title;
            }

            // email
            if (!string.IsNullOrWhiteSpace(division.Email))
            {
                vcard.Emails.Add(division.Email);
            }

            // secondary email
            if (!string.IsNullOrWhiteSpace(division.SecondaryEmail))
            {
                vcard.Emails.Add(division.SecondaryEmail);
            }

            // phone
            if (!string.IsNullOrWhiteSpace(division.Phone))
            {
                vcard.Phones.Add(new VCardPhone()
                {
                    Number = division.Phone, Type = VCardPhoneType.Work
                });
            }

            // fax
            if (!string.IsNullOrWhiteSpace(division.Fax))
            {
                vcard.Phones.Add(new VCardPhone()
                {
                    Number = division.Fax, Type = VCardPhoneType.Fax
                });
            }

            // website
            if (!string.IsNullOrWhiteSpace(division.WebSite))
            {
                vcard.Url = division.WebSite;
            }

            // location
            if (!string.IsNullOrWhiteSpace(division.Location))
            {
                // TODO: Add organization address
                vcard.DeliveryAddress = division.Location;
            }

            // revision
            vcard.LastRevision = division.LastModifiedOnDate;

            return(vcard);
        }
예제 #9
0
        public static int?AddOrUpdateTerm(this IDivision division, IModelContext modelContext)
        {
            var vocabularyName = UniversityConfig.Instance.Vocabularies.OrgStructure;
            var vocabulary     = new VocabularyController().GetVocabularies().FirstOrDefault(v => v.Name == vocabularyName);

            if (vocabulary == null)
            {
                Exceptions.LogException(new Exception($"Could not find the {vocabularyName} vocabulary."));
                return(null);
            }

            var termName = GetSafeTermName(division.ShortTitle, division.Title);
            var termCtrl = new TermController();
            var term     = default(Term);

            if (division.DivisionTermID == null)
            {
                term = termCtrl.GetTermsByVocabulary(vocabulary.VocabularyId).FirstOrDefault(t => t.Name == termName);
                if (term != null)
                {
                    Exceptions.LogException(new Exception($"Could not create term {termName} in the {vocabularyName} vocabulary as it already exists."));
                    return(null);
                }

                term = new Term(termName, string.Empty, vocabulary.VocabularyId);
            }
            else
            {
                term      = termCtrl.GetTerm(division.DivisionTermID.Value);
                term.Name = termName;
            }

            var parentDivision = division.GetParentDivision(modelContext);

            if (parentDivision != null)
            {
                term.ParentTermId = parentDivision.DivisionTermID;
            }
            else
            {
                term.ParentTermId = null;
            }

            try {
                if (division.DivisionTermID == null)
                {
                    return(termCtrl.AddTerm(term));
                }

                termCtrl.UpdateTerm(term);
                return(term.TermId);
            }
            catch (Exception ex) {
                Exceptions.LogException(new Exception($"Error creating/updating {termName} term in the vocabulary {vocabularyName}.", ex));
            }

            return(null);
        }
예제 #10
0
        IDivision IDivision.Divide(IDivision divisor, out IDivision reminder)
        {
            ComplexPolynom pd = divisor as ComplexPolynom;

            ComplexPolynom[] cp = Divide(pd);
            cp[1].Reduce();
            reminder = cp[1];
            return(cp[0]);
        }
예제 #11
0
        public static IDivision GetParentDivision(this IDivision division, IModelContext modelContext)
        {
            if (division.ParentDivisionID != null)
            {
                return(modelContext.Get <DivisionInfo> (division.ParentDivisionID.Value));
            }

            return(null);
        }
예제 #12
0
        private HLLocation ProcessDivisionExpression(IDivision pExpression)
        {
            HLLocation locationLeftOperand  = ProcessExpression(pExpression.LeftOperand);
            HLLocation locationRightOperand = ProcessExpression(pExpression.RightOperand);
            HLLocation locationTemporary    = HLTemporaryLocation.Create(CreateTemporary(HLDomain.GetOrCreateType(pExpression.Type)));

            mCurrentBlock.EmitDivide(locationTemporary, locationLeftOperand, locationRightOperand);
            return(pExpression.ResultIsUnmodifiedLeftOperand ? locationLeftOperand : locationTemporary);
        }
        public static IDivision GetParentDivision(this IDivision division, IModelContext modelContext)
        {
            Contract.Ensures(Contract.Result <IDivision> () != null);
            if (division.ParentDivisionID != null)
            {
                return(modelContext.Get <DivisionInfo, int> (division.ParentDivisionID.Value));
            }

            return(null);
        }
        public static string GetSearchUrl(this IDivision division, ModuleInfo module, PortalSettings portalSettings)
        {
            if (!string.IsNullOrEmpty(division.HomePage))
            {
                return(Globals.NavigateURL(int.Parse(division.HomePage), false, portalSettings, "",
                                           portalSettings.PortalAlias.CultureCode));
            }

            return(Globals.NavigateURL(module.TabID, false, portalSettings, "",
                                       portalSettings.PortalAlias.CultureCode, "", "mid", module.ModuleID.ToString()));
        }
        /// <summary>
        /// Calculates greatest common divisor
        /// </summary>
        /// <param name="el1">First element</param>
        /// <param name="el2">Second element</param>
        /// <returns>The greatest common divisor</returns>
        static private IDivision greatestCommonDivisor(IDivision el1, IDivision el2)
        {
            if (el2.IsZero)
            {
                return(el1);
            }
            IDivision rem;
            IDivision el = el1.Divide(el2, out rem);

            return(greatestCommonDivisor(el2, rem));
        }
 public static string SearchText(this IDivision division)
 {
     return(FormatHelper.JoinNotNullOrEmpty(
                ", ",
                division.Title,
                UniversityModelHelper.HasUniqueShortTitle(division.ShortTitle, division.Title) ? division.ShortTitle : null,
                division.Phone,
                division.Fax,
                division.Email,
                division.SecondaryEmail,
                division.WebSite,
                division.Location,
                division.WorkingHours
                ));
 }
예제 #17
0
 public static string FormatEduProgramDivisionLink(IDivision division, string role = null, bool isPublished = true)
 {
     if (division != null)
     {
         var classAttr = isPublished ? string.Empty : " class=\"u8y-not-published-element\"";
         var roleLabel = !string.IsNullOrEmpty(role) ? role + ": " : string.Empty;
         if (!string.IsNullOrWhiteSpace(division.HomePage))
         {
             var url = Globals.NavigateURL(int.Parse(division.HomePage));
             return($"<span{classAttr}>{roleLabel}<a href=\"{url}\" target=\"_blank\">{division.Title}</a></span>");
         }
         return($"<span{classAttr}>{roleLabel}{division.Title}</span>");
     }
     return(string.Empty);
 }
        /// <summary>
        /// Calculates greatest common divisor
        /// </summary>
        /// <param name="el1">First element</param>
        /// <param name="el2">Second element</param>
        /// <returns>The greatest common divisor</returns>
        static public IDivision GreatestCommonDivisor(IDivision el1, IDivision el2)
        {
            IDivision c, d;

            if (el1.Norm > el2.Norm)
            {
                c = el1;
                d = el2;
            }
            else
            {
                c = el2;
                d = el1;
            }
            return(greatestCommonDivisor(c, d));
        }
예제 #19
0
      public override void Visit(IDivision division) {
        this.Visit(division.LeftOperand);
        this.Visit(division.RightOperand);
        Bpl.Expr rexp = TranslatedExpressions.Pop();
        Bpl.Expr lexp = TranslatedExpressions.Pop();

        var tok = division.Token();

        var loc = this.sink.CreateFreshLocal(division.RightOperand.Type);
        var locExpr = Bpl.Expr.Ident(loc);
        var storeLocal = Bpl.Cmd.SimpleAssign(tok, locExpr, rexp);
        this.StmtTraverser.StmtBuilder.Add(storeLocal);

        var a = new Bpl.AssertCmd(tok, Bpl.Expr.Binary(Bpl.BinaryOperator.Opcode.Neq, locExpr, Bpl.Expr.Literal(0)));
        this.StmtTraverser.StmtBuilder.Add(a);

        TranslatedExpressions.Push(Bpl.Expr.Binary(Bpl.BinaryOperator.Opcode.Div, lexp, locExpr));
      }
예제 #20
0
        public static void InsertDivision(IDivision division)
        {
            CheckWorkBook();
            var attributes = DivisionToAttributes(division);

            var id = new KeyValuePair <string, object>("Division_ID", attributes["Division_ID"]);

            if (Excel.IO.ExcelIOAPIs.IsIDOfWorksheet(FilePath, worksheets[2], id))
            {
                var idColumn = new Dictionary <string, object>()
                {
                    { id.Key, id.Value }
                };
                RowUpdate.Update(FilePath, worksheets[2], idColumn, attributes);
                return;
            }

            RowInsert.Insert(FilePath, worksheets[2], attributes);
        }
예제 #21
0
        /// <summary>
        /// Finds all roots of polynom
        /// </summary>
        /// <param name="accuracy">Accuracy</param>
        /// <returns>Array of roots</returns>
        public Complex[] Roots(double accuracy)
        {
            if (Deg == 1)
            {
                return(new Complex[] { (-coeff[0] / coeff[1]) });
            }
            if (Deg == 2)
            {
                return(SquareRoots);
            }
            ComplexPolynom polynom = this;
            ComplexPolynom p       = this;
            ComplexPolynom deri    = Derivation;
            IDivision      div     = this;
            ComplexPolynom comd    = StaticExtensionClassicalAlgebra.GreatestCommonDivisor(this, deri) as ComplexPolynom;

            if (comd.Deg > 0)
            {
                List <Complex> r         = new List <Complex>();
                ComplexPolynom divcomdeg = Divide(comd)[0];
                Complex[]      r1        = comd.Roots(accuracy);
                Complex[]      r2        = divcomdeg.Roots(accuracy);
                r.AddRange(r1);
                r.AddRange(r2);
                return(r.ToArray());
            }
            Complex[] roots = new Complex[p.Deg];
            for (int i = 0; i < roots.Length; i++)
            {
                if (p.Deg == 1)
                {
                    roots[i] = (-p.coeff[0]) / p.coeff[1];
                    break;
                }
                Complex x = p.Root(accuracy);
                roots[i] = x;
                ComplexPolynom pol = new ComplexPolynom(new Complex[] { -x, 1 });
                p = p.Divide(pol)[0];
            }
            return(roots);
        }
예제 #22
0
        public void Division_Constructor()
        {
            IDivision nfcNorth = this.NFL.GetDivision("NFC", "North");
            IDivision nfcSouth = this.NFL.GetDivision("NFC", "South");
            IDivision nfcEast  = this.NFL.GetDivision("NFC", "East");
            IDivision nfcWest  = this.NFL.GetDivision("NFC", "West");
            IDivision afcNorth = this.NFL.GetDivision("AFC", "North");
            IDivision afcSouth = this.NFL.GetDivision("AFC", "South");
            IDivision afcEast  = this.NFL.GetDivision("AFC", "East");
            IDivision afcWest  = this.NFL.GetDivision("AFC", "West");

            switch (this.LeagueDataFile.StripPath())
            {
            case "NFL_2016.xml":
            case "NFL_2017.xml":
                Assert.AreEqual("North", nfcNorth.Name);
                Assert.AreEqual("South", nfcSouth.Name);
                Assert.AreEqual("East", nfcEast.Name);
                Assert.AreEqual("West", nfcWest.Name);
                Assert.AreEqual("North", afcNorth.Name);
                Assert.AreEqual("South", afcSouth.Name);
                Assert.AreEqual("East", afcEast.Name);
                Assert.AreEqual("West", afcWest.Name);

                Assert.AreEqual(4, nfcNorth.Teams.Count());
                Assert.AreEqual(4, nfcSouth.Teams.Count());
                Assert.AreEqual(4, nfcEast.Teams.Count());
                Assert.AreEqual(4, nfcWest.Teams.Count());
                Assert.AreEqual(4, afcNorth.Teams.Count());
                Assert.AreEqual(4, afcSouth.Teams.Count());
                Assert.AreEqual(4, afcEast.Teams.Count());
                Assert.AreEqual(4, afcWest.Teams.Count());
                break;

            default:
                break;
            }
        }
예제 #23
0
        public void Division_WinPercentage()
        {
            IDivision nfcSouth = this.NFL.GetDivision("NFC", "South");
            ITeam     saints   = this.NFL.GetTeam("NO");

            IDivision nfcWest  = this.NFL.GetDivision("NFC", "West");
            ITeam     seahawks = this.NFL.GetTeam("SEA");

            switch (this.StatsDataFile.StripPath())
            {
            case "NFLStats_2016.xml":
                Assert.AreEqual((2.0 / 6.0), nfcSouth.WinPercentage(saints));
                Assert.AreEqual(((3.0 + (1.0 * 0.5)) / 6.0), nfcWest.WinPercentage(seahawks));
                break;

            case "NFLStats_2017.xml":
                Assert.AreEqual((4.0 / 6.0), nfcSouth.WinPercentage(saints));
                break;

            default:
                break;
            }
        }
예제 #24
0
    /// <summary>
    /// Returns a deep copy of the given division expression.
    /// </summary>
    /// <param name="division"></param>
    public Division Copy(IDivision division) {
      Contract.Requires(division != null);
      Contract.Ensures(Contract.Result<Division>() != null);

      var mutableCopy = this.shallowCopier.Copy(division);
      this.CopyChildren((BinaryOperation)mutableCopy);
      return mutableCopy;
    }
예제 #25
0
 /// <summary>
 /// Traverses the children of the division expression.
 /// </summary>
 public virtual void TraverseChildren(IDivision division)
 {
     Contract.Requires(division != null);
       this.TraverseChildren((IBinaryOperation)division);
 }
예제 #26
0
 /// <summary>
 /// Performs some computation with the given division expression.
 /// </summary>
 /// <param name="division"></param>
 public virtual void Visit(IDivision division)
 {
 }
 public EmployeeListViewModel (IEnumerable<IEmployee> employees, IDivision division)
 {
     Employees = employees;
     Division = division;
 }
예제 #28
0
 public override void Visit(IDivision operation)
 {
     ProcessOperation(operation);
 }
예제 #29
0
 public virtual void onASTElement(IDivision division)
 {
 }
예제 #30
0
 public void Visit(IDivision division)
 {
     throw new NotImplementedException();
 }
예제 #31
0
 /// <summary>
 /// Performs some computation with the given division expression.
 /// </summary>
 /// <param name="division"></param>
 public virtual void Visit(IDivision division)
 {
     this.Visit((IBinaryOperation)division);
 }
 /// <summary>
 /// Rewrites the given division expression.
 /// </summary>
 /// <param name="division"></param>
 public virtual IExpression Rewrite(IDivision division)
 {
     return division;
 }
예제 #33
0
    /// <summary>
    /// Returns a shallow copy of the given division expression.
    /// </summary>
    /// <param name="division"></param>
    public Division Copy(IDivision division) {
      Contract.Requires(division != null);
      Contract.Ensures(Contract.Result<Division>() != null);

      return new Division(division);
    }
예제 #34
0
파일: Visitor.cs 프로젝트: riverar/devtools
 /// <summary>
 /// Generates IL for the specified division.
 /// </summary>
 /// <param name="division">The division.</param>
 public override void TraverseChildren(IDivision division)
 {
     this.Traverse(division.LeftOperand);
       this.Traverse(division.RightOperand);
       if (division.TreatOperandsAsUnsignedIntegers)
     this.generator.Emit(OperationCode.Div_Un);
       else
     this.generator.Emit(OperationCode.Div);
       this.StackSize--;
 }
 public override void Visit(IDivision division)
 {
     if(Process(division)){visitor.Visit(division);}
     base.Visit(division);
 }
예제 #36
0
 public override void Visit(IDivision binary)
 {
     _formattedValue = Format(binary.LeftOperand) + " / " + Format(binary.RightOperand);
 }
예제 #37
0
 private HLLocation ProcessDivisionExpression(IDivision pExpression)
 {
     HLLocation locationLeftOperand = ProcessExpression(pExpression.LeftOperand);
     HLLocation locationRightOperand = ProcessExpression(pExpression.RightOperand);
     HLLocation locationTemporary = HLTemporaryLocation.Create(CreateTemporary(HLDomain.GetOrCreateType(pExpression.Type)));
     mCurrentBlock.EmitDivide(locationTemporary, locationLeftOperand, locationRightOperand);
     return pExpression.ResultIsUnmodifiedLeftOperand ? locationLeftOperand : locationTemporary;
 }
예제 #38
0
 public virtual void onASTElement(IDivision division) { }
예제 #39
0
 public override IExpression Rewrite(IDivision operation)
 {
     return(ReplaceOperation(operation));
 }
예제 #40
0
파일: Mutator.cs 프로젝트: riverar/devtools
 public void Visit(IDivision division)
 {
     this.result = this.rewriter.Rewrite(division);
 }
예제 #41
0
        public override void TraverseChildren(IDivision division)
{ MethodEnter(division);
            base.TraverseChildren(division);
     MethodExit();   }
예제 #42
0
 public EmployeeListViewModel(IEnumerable <IEmployee> employees, IDivision division)
 {
     Employees = employees;
     Division  = division;
 }
예제 #43
0
 //^ ensures this.path.Count == old(this.path.Count);
 /// <summary>
 /// Traverses the given division expression.
 /// </summary>
 /// <param name="division"></param>
 public virtual void Visit(IDivision division)
 {
     if (this.stopTraversal) return;
       //^ int oldCount = this.path.Count;
       this.path.Push(division);
       this.Visit(division.LeftOperand);
       this.Visit(division.RightOperand);
       //^ assume this.path.Count == oldCount+1; //True because all of the virtual methods of this class promise not to decrease this.path.Count.
       this.path.Pop();
 }
예제 #44
0
파일: Expressions.cs 프로젝트: xornand/cci
 /// <summary>
 /// 
 /// </summary>
 /// <param name="division"></param>
 public Division(IDivision division)
   : base(division) {
     this.TreatOperandsAsUnsignedIntegers = division.TreatOperandsAsUnsignedIntegers;
 }
예제 #45
0
 /// <summary>
 /// Traverses the division expression.
 /// </summary>
 public void Traverse(IDivision division)
 {
     Contract.Requires(division != null);
       if (this.preorderVisitor != null) this.preorderVisitor.Visit(division);
       if (this.StopTraversal) return;
       this.TraverseChildren(division);
       if (this.StopTraversal) return;
       if (this.postorderVisitor != null) this.postorderVisitor.Visit(division);
 }
예제 #46
0
 public static IEnumerable <IOccupiedPosition> GetHeadEmployeePositions(this IDivision division)
 {
     return(division.OccupiedPositions.Where(op => op.PositionID == division.HeadPositionID));
 }
예제 #47
0
 public void Visit(IDivision division)
 {
     this.traverser.Traverse(division);
 }
예제 #48
0
 public override void TraverseChildren(IDivision division) {
   base.TraverseChildren(division);
   ((Division)division).Type = this.GetBinaryNumericOperationType(division, division.TreatOperandsAsUnsignedIntegers);
 }
예제 #49
0
 public void Visit(IDivision division)
 {
     Contract.Requires(division != null);
       throw new NotImplementedException();
 }
예제 #50
0
파일: Copier.cs 프로젝트: riverar/devtools
 /// <summary>
 /// Visits the specified division.
 /// </summary>
 /// <param name="division">The division.</param>
 public override void Visit(IDivision division)
 {
     Division mutableDivision = new Division(division);
     this.resultExpression = this.myCodeCopier.DeepCopy(mutableDivision);
 }
예제 #51
0
 public override void Visit(IDivision division) {
   base.Visit(division);
   Bpl.Expr rexp = TranslatedExpressions.Pop();
   Bpl.Expr lexp = TranslatedExpressions.Pop();
   TranslatedExpressions.Push(Bpl.Expr.Binary(Bpl.BinaryOperator.Opcode.Div, lexp, rexp));
 }
예제 #52
0
파일: Copier.cs 프로젝트: riverar/devtools
 /// <summary>
 /// Returns a deep copy of the given division expression.
 /// </summary>
 /// <param name="division"></param>
 public Division Copy(IDivision division)
 {
     var mutableCopy = this.shallowCopier.Copy(division);
       this.CopyChildren((BinaryOperation)mutableCopy);
       return mutableCopy;
 }
예제 #53
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="division"></param>
 public Division(IDivision division)
     : base(division)
 {
 }
예제 #54
0
파일: Copier.cs 프로젝트: riverar/devtools
 /// <summary>
 /// Returns a shallow copy of the given division expression.
 /// </summary>
 /// <param name="division"></param>
 public Division Copy(IDivision division)
 {
     return new Division(division);
 }
예제 #55
0
파일: Copier.cs 프로젝트: riverar/devtools
 public void Visit(IDivision division)
 {
     this.result = this.copier.Copy(division);
 }
예제 #56
0
 public void Factory()
 {
     collections = new RomanNumberCollection();
     division    = new Division();
 }
    public override void TraverseChildren(IDivision division) {

      var needsParen = LowerPrecedenceThanParentExpression(division);
      var savedCurrentPrecedence = this.currentPrecedence;
      this.currentPrecedence = this.Precedence(division);

      if (needsParen) this.sourceEmitterOutput.Write("(");
      this.Traverse(division.LeftOperand);
      if (division.LeftOperand is ITargetExpression)
        this.sourceEmitterOutput.Write(" /= ");
      else
        this.sourceEmitterOutput.Write(" / ");
      this.Traverse(division.RightOperand);
      if (needsParen) this.sourceEmitterOutput.Write(")");

      this.currentPrecedence = savedCurrentPrecedence;
    }
 public override void TraverseChildren(IDivision division)
 {
   var targetExpression = division.LeftOperand as ITargetExpression;
   if (targetExpression != null) { // x /= e
     bool statement = this.currentExpressionIsOpAssignStatement;
     this.currentExpressionIsOpAssignStatement = false;
     this.VisitAssignment(targetExpression, division, (IExpression e) => this.TraverseDivisionRightOperandAndDoOperation(e),
       treatAsStatement: statement, pushTargetRValue: true, resultIsInitialTargetRValue: division.ResultIsUnmodifiedLeftOperand);
   } else { // x / e
     this.Traverse(division.LeftOperand);
     this.TraverseDivisionRightOperandAndDoOperation(division);
   }
 }
예제 #59
0
 public override void TraverseChildren(IDivision division)
 {
     MethodEnter(division);
     base.TraverseChildren(division);
     MethodExit();
 }
예제 #60
0
파일: Mutator.cs 프로젝트: riverar/devtools
 /// <summary>
 /// Rewrites the given division expression.
 /// </summary>
 /// <param name="division"></param>
 public virtual IExpression Rewrite(IDivision division)
 {
     var mutableDivision = division as Division;
       if (mutableDivision == null) return division;
       this.RewriteChildren(mutableDivision);
       return mutableDivision;
 }