Ejemplo n.º 1
0
        /// <summary>
        /// Compares two Case and annotates the differences on the first one
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="other"></param>
        public static void compareCase(Generated.Case obj, Generated.Case other, VersionDiff diff)
        {
            if ( other == null )
            {
                diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aAdd, "", "", obj.Name ) );
                return;
            }

            compareNamable (obj, other, diff);

            if ( obj.allPreConditions() != null )
            {
                if ( other.allPreConditions() != null )
                {
                    int i = 0;
                    while ( i < obj.countPreConditions() && i < other.countPreConditions() )
                    {
                        Generated.PreCondition element = obj.getPreConditions( i );
                        Generated.PreCondition otherElement = other.getPreConditions( i );
                        comparePreCondition ( element, otherElement, diff );
                        i += 1;
                    }
                    while ( i < obj.countPreConditions() )
                    {
                        diff.appendChanges ( new Diff(obj.getPreConditions(i), HistoricalData.Generated.acceptor.ChangeOperationEnum.aAdd, "PreConditions", "", obj.getPreConditions( i ).Name ) );
                        i += 1;
                    }
                    while ( i < other.countPreConditions() )
                    {
                        diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aRemove, "PreConditions", other.getPreConditions( i ).Name) );
                        i += 1;
                    }
                }
                else
                {
                    foreach ( Generated.PreCondition subElement in obj.allPreConditions() )
                    {
                        diff.appendChanges ( new Diff(subElement, HistoricalData.Generated.acceptor.ChangeOperationEnum.aAdd, "PreConditions", "", subElement.Name ) );
                    }
                }
            }
            else
            {
                if ( other.allPreConditions() != null )
                {
                    foreach ( Generated.PreCondition otherElement in other.allPreConditions() )
                    {
                        diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aRemove , "PreConditions", otherElement.Name) );
                    }
                }
            }
            if ( !CompareUtil.canonicalStringEquality(obj.getExpression(), other.getExpression()) )
            {
                diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aChange, "Expression", other.getExpression(), obj.getExpression()) );
            }
            if ( !CompareUtil.canonicalStringEquality(obj.getComment(), other.getComment()) )
            {
                diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aChange, "Comment", other.getComment(), obj.getComment()) );
            }
        }
Ejemplo n.º 2
0
        protected override void Initialize()
        {
            timers = new TimerManager();

            js = new Jurassic.ScriptEngine();
            js.SetGlobalFunction("setTimeout", new Action <Jurassic.Library.FunctionInstance, int>(setTimeout));
            js.SetGlobalFunction("setInterval", new Action <Jurassic.Library.FunctionInstance, int>(setInterval));
            js.SetGlobalFunction("clearTimeout", new Action <int>(clearTimeout));
            js.SetGlobalFunction("clearInterval", new Action <int>(clearInterval));

            js.SetGlobalValue("window", js.Global);
            js.SetGlobalValue("console", new JSConsole(js));
            js.SetGlobalValue("Canvas", new JSCanvasConstructor(js));
            js.SetGlobalValue("Image", new JSImageConstructor(js));

#if !XBOX
            if (GenerateAndExit != null)
            {
                GenerateAssemblyAndExit(GenerateAndExit);
                return;
            }
#endif

#if XBOX || RELEASE
            // On the XBOX or RELEASE config, run the compiled JavaScript from the Assembly
            js.LoadFromAssembly("ImpactGame");
            Generated.Main(js, js.CreateGlobalScope(), js.Global);
#else
            // In Windows/DEBUG, run JavaScript directly from source
            js.EnableDebugging = true;
            js.Evaluate(new Jurassic.FileScriptSource("Game/index.js"));
#endif
            base.Initialize();
        }
 private static RepresentationCollection<Representation> GetRepresentations(Generated.RepresentationSystem representationSystem)
 {
     var numericRepresentations = representationSystem.Representations.NumericRepresentation.Select(v => new NumericRepresentation(v));
     var enumeratedRepresentations = representationSystem.Representations.EnumeratedRepresentation.Select(d => new EnumeratedRepresentation(d));
     var allRepresentations = numericRepresentations.Union<Representation>(enumeratedRepresentations);
     return new RepresentationCollection<Representation>(allRepresentations);
 } 
Ejemplo n.º 4
0
        /// <summary>
        ///     Initializes the Historical data package
        /// </summary>
        /// <param name="filePath">The path to the file to load</param>
        /// <param name="factory">THe factory used to create instances of the loaded file</param>
        public static History Load(string filePath, Generated.Factory factory)
        {
            History retVal = null;

            acceptor.setFactory(factory);
            if (File.Exists(filePath))
            {
                // Do not rely on XmlBFileContext since it does not care about encoding.
                // File encoding is UTF-8
                XmlBStringContext ctxt;
                using (StreamReader file = new StreamReader(filePath))
                {
                    ctxt = new XmlBStringContext(file.ReadToEnd());
                    file.Close();
                }

                try
                {
                    retVal = acceptor.accept(ctxt) as History;
                }
                catch (XmlBException excp)
                {
                    Log.Error(ctxt.errorMessage());
                }
            }

            return retVal;
        }
Ejemplo n.º 5
0
 void Add(Position p)
 {
     if (!Generated.Contains(p))
     {
         NextPosition.Add(p);
     }
 }
Ejemplo n.º 6
0
        public void TestMultipleType()
        {
            var DateTestCases = DS.List(
                Tuple.Create(A_STRING, o(A_STRING), ""),
                Tuple.Create("12/11/1964", o(new DateTime(1964, 12, 11)), "MM/dd/yyyy"),
                Tuple.Create("12 12 Dec December", o(new DateTime(1964, 12, 11)), "M MM MMM MMMM"),
                Tuple.Create("001.10", o(1.1f), "000.00"),
                Tuple.Create("001.10", o(1.1M), "000.00"),
                Tuple.Create("001.100", o(1.1), "000.000"),
                Tuple.Create("001", _byte(1), "000"),
                Tuple.Create("001", _sbyte(1), "000"),
                Tuple.Create("001", _short(1), "000"),
                Tuple.Create("001", _single(1), "000"),
                Tuple.Create("001", _int(1), "000"),
                Tuple.Create("001", _long(1), "000"),
                Tuple.Create("001", _ulong(1), "000"),
                Tuple.Create("001", _UInt64(1), "000"),
                Tuple.Create("001", _Int64(1), "000")
                );

            foreach (var t in DateTestCases)
            {
                Assert.AreEqual(t.Item1, Generated.FormatValueBasedOnType(t.Item2, t.Item3));
            }
        }
Ejemplo n.º 7
0
 internal Word(Generated <Sound> Generated, Random Random, List <PrintRule <Sound> > PrintRules)
 {
     foreach (Sound S in Generated)
     {
         _Sounds.Add(S);
     }
 }
Ejemplo n.º 8
0
        public IProcedural Generate()
        {
            GenerateCubeFaces();

            Generated.Invoke(this, new EventArgs());

            return(this);
        }
Ejemplo n.º 9
0
        private static UserDao CreateUserDao()
        {
            Generated.ResetUserId();
            var dao = new MemoryUserDao();

            dao.Clear();

            return(dao);
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Cleans all text fields in this element
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="visitSubNodes"></param>
        public override void visit(Generated.Namable obj, bool visitSubNodes)
        {
            if ( obj.getName() != null )
              {
            obj.setName(obj.getName().Trim());
              }

              base.visit(obj, visitSubNodes);
        }
Ejemplo n.º 11
0
        /// <summary>
        /// Perform generation of new BonusLife.
        /// </summary>
        protected virtual void Generate()
        {
            GeneratedLife = new BonusLife(TimeSpan.FromSeconds(10));
            var pos = _coinsPositions[_random.Next(0, _coinsPositions.Count)];

            GeneratedLife.X = pos.Item1;
            GeneratedLife.Y = pos.Item2;
            Generated?.Invoke(this, EventArgs.Empty);
        }
 public void ShouldGenerateConsequtiveIdsForBooks()
 {
     Generated.ResetBookId();
     Assert.AreEqual(1, Generated.BookId());
     Assert.AreEqual(2, Generated.BookId());
     Assert.AreEqual(3, Generated.BookId());
     Assert.AreEqual(4, Generated.BookId());
     Assert.AreEqual(5, Generated.BookId());
 }
Ejemplo n.º 13
0
        /// <summary>
        /// Cleans all text fields in this element
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="visitSubNodes"></param>
        public override void visit(Generated.ReferencesParagraph obj, bool visitSubNodes)
        {
            if ( obj.getComment() != null )
              {
            obj.setComment(obj.getComment().Trim());
              }

              base.visit(obj, visitSubNodes);
        }
Ejemplo n.º 14
0
        private static MemoryBooksDao CreateBooksDao()
        {
            Generated.ResetBookId();
            var dao = new MemoryBooksDao();

            dao.Clear();

            return(dao);
        }
Ejemplo n.º 15
0
        private BorrowingDao CreateBorrowingDao()
        {
            Generated.ResetBorrowingId();
            var dao = new MemoryBorrowingDao();

            dao.Clear();

            return(dao);
        }
        private void GenetateData()
        {
            var generatedData = _generator();
            var json          = JsonConvert.SerializeObject(generatedData);

            Logger.Info($"Generate object with type: [{generatedData.GetType()}], object: [{json}]");

            Generated?.Invoke(generatedData);
        }
Ejemplo n.º 17
0
        private string GenerateTsEnum(string enumName, EnumDeclarationSyntax syntax)
        {
            var    enumGen       = new TypeScriptEnumGen(syntax);
            string generatedEnum = enumGen.Generate();

            Generated.Add(enumName);

            return(generatedEnum);
        }
Ejemplo n.º 18
0
 protected bool Equals(ChangeManifest other)
 {
     return(Equals(ChangeDetails, other.ChangeDetails) &&
            Equals(IssueDetails, other.IssueDetails) &&
            Generated.Equals(other.Generated) &&
            string.Equals(FromVersion, other.FromVersion) &&
            string.Equals(ToVersion, other.ToVersion) &&
            string.Equals(ReferenceBuildConfiguration, other.ReferenceBuildConfiguration) &&
            string.Equals(BuildConfiguration, other.BuildConfiguration));
 }
            public override void visit(Generated.Paragraph obj, bool visitSubNodes)
            {
                Paragraph paragraph = (Paragraph) obj;

                while (paragraph.RequirementSetReferences.Count > 0)
                {
                    RequirementSetReference reference = (RequirementSetReference) paragraph.RequirementSetReferences[0];
                    reference.Delete();
                }

                base.visit(obj, visitSubNodes);
            }
Ejemplo n.º 20
0
        private string GenerateTsClass(ClassDeclarationSyntax classSyntax)
        {
            var    tsClassGen     = new TypeScriptClassGen(classSyntax);
            string generatedClass = tsClassGen.Generate();

            Generated.Add(tsClassGen.ClassName);
            RefBasedClasses.AddRange(tsClassGen.ReferencedBaseClasses);
            RefClasses.AddRange(tsClassGen.ReferencedClasses);
            RefEnums.AddRange(tsClassGen.ReferencedEnums);

            return(generatedClass);
        }
Ejemplo n.º 21
0
        public override string ToString()
        {
            var message = FormatLog();

            return(string.IsNullOrWhiteSpace(message) ? null : $"{FormatGenerated()},{FormatLevel()},{message}");

            string FormatLevel()
            {
                switch ((WadLogLevel)Level)
                {
                case WadLogLevel.Critical:
                    return("Critical");

                case WadLogLevel.Error:
                    return("Error");

                case WadLogLevel.Information:
                    return("Information");

                case WadLogLevel.Warning:
                    return("Warning");

                case WadLogLevel.Verbose:
                    return("Verbose");

                default:
                    return("Undefined");
                }
            }

            string FormatLog()
            {
                var isMessageEvent = IsMessageEvent();
                var isDirectWrite  = IsDirectWrite();

                if (isMessageEvent)
                {
                    return(FormatMessage(MessageEventLengthBeforeMessage, MessageEventLengthAfterMessage));
                }

                if (isDirectWrite)
                {
                    return(FormatMessage(DirectWriteLengthBeforeMessage, DirectWriteLengthAfterMessage));
                }

                return(null);
            }

            string FormatGenerated()
            {
                return(Generated.ToString("yyyy-MM-ddTHH:mm:ss.fffT"));
            }
        }
Ejemplo n.º 22
0
        /// <summary>
        /// Cleans all text fields in this element
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="visitSubNodes"></param>
        public override void visit(Generated.Dictionary obj, bool visitSubNodes)
        {
            if ( obj.getXsi() != null )
              {
            obj.setXsi(obj.getXsi().Trim());
              }
              if ( obj.getXsiLocation() != null )
              {
            obj.setXsiLocation(obj.getXsiLocation().Trim());
              }

              base.visit(obj, visitSubNodes);
        }
Ejemplo n.º 23
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (Name != null ? Name.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ ColumnOrdinal;
         hashCode = (hashCode * 397) ^ (DataTypeName != null ? DataTypeName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ PrimaryKey.GetHashCode();
         hashCode = (hashCode * 397) ^ Generated.GetHashCode();
         hashCode = (hashCode * 397) ^ CaseSensitive.GetHashCode();
         return(hashCode);
     }
 }
Ejemplo n.º 24
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = (ChangeDetails != null ? ChangeDetails.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (IssueDetails != null ? IssueDetails.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ Generated.GetHashCode();
         hashCode = (hashCode * 397) ^ (FromVersion != null ? FromVersion.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ToVersion != null ? ToVersion.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ReferenceBuildConfiguration != null ? ReferenceBuildConfiguration.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (BuildConfiguration != null ? BuildConfiguration.GetHashCode() : 0);
         return(hashCode);
     }
 }
Ejemplo n.º 25
0
        internal virtual void OnShowHexValuesChanged(ModelPropertyChangedEventArgs e)
        {
            foreach (var trigger in Triggers)
            {
                foreach (var group in trigger.Groups)
                {
                    group.OnShowHexValuesChanged(e);
                }
            }

            Generated.OnShowHexValuesChanged(e);
            Local.OnShowHexValuesChanged(e);
            Published.OnShowHexValuesChanged(e);
        }
Ejemplo n.º 26
0
        internal override void OnShowHexValuesChanged(ModelPropertyChangedEventArgs e)
        {
            foreach (var group in RequirementGroups)
            {
                group.OnShowHexValuesChanged(e);
            }

            Generated.OnShowHexValuesChanged(e);
            Local.OnShowHexValuesChanged(e);
            Unofficial.OnShowHexValuesChanged(e);
            Core.OnShowHexValuesChanged(e);

            base.OnShowHexValuesChanged(e);
        }
Ejemplo n.º 27
0
        public override void visit(Generated.Action obj, bool visitSubNodes)
        {
            Rules.Action action = (Rules.Action)obj;

            if (Rebuild)
            {
                action.Statement = null;
            }

            // Side effect : compiles or recompiles the statement
            DataDictionary.Interpreter.Statement.Statement statement = action.Statement;

            base.visit(obj, visitSubNodes);
        }
        public Transaction(KeyPair sourceAccount, long sequenceNumber, Operation[] operations, Generated.Memo memo)
        {
            SourceAccount = CheckNotNull(sourceAccount, "sourceAccount cannot be null");
            SequenceNumber = CheckNotNull(sequenceNumber, "sequenceNumber cannot be null");
            mOperations = CheckNotNull(operations, "operations cannot be null");

            if (operations.Length <= 0)
            {
                throw new ArgumentException("At least one operation required");
            }

            mFee = operations.Length * BASE_FEE;
            mSignatures = new List<Generated.DecoratedSignature>();
            Memo = memo != null ? memo : Stellar.Memo.None();
        }
Ejemplo n.º 29
0
        /// <summary>
        /// Compares two Action and annotates the differences on the first one
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="other"></param>
        public static void compareAction(Generated.Action obj, Generated.Action other, VersionDiff diff)
        {
            if ( other == null )
            {
                diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aAdd, "", "", obj.Name ) );
                return;
            }

            if ( !CompareUtil.canonicalStringEquality(obj.getExpression(), other.getExpression()) )
            {
                diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aChange, "Expression", other.getExpression(), obj.getExpression()) );
            }
            if ( !CompareUtil.canonicalStringEquality(obj.getComment(), other.getComment()) )
            {
                diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aChange, "Comment", other.getComment(), obj.getComment()) );
            }
        }
Ejemplo n.º 30
0
        private void threadStart()
        {
            VectorGenerator vectorGenerator = new VectorGenerator(paths);

            while (!stop)
            {
                if (vectorGenerator.Step(TimeSpan.FromSeconds(0.1)))
                {
                    VectorPath   = vectorGenerator.Generate(VectorPower, VectorSpeed);
                    GCodeProgram = GCodeGenerator.Generate(VectorPath, 1000.0, maxFeed);

                    Generated?.Invoke(this, null);
                }
            }

            thread = null;
        }
Ejemplo n.º 31
0
        public IProcedural Generate()
        {
            int i = 0;

            for (int x = 0; x < Bounds.X; x++)
            {
                int y = 0;
                int z = 0;
                //System.Diagnostics.Debug.WriteLine($"V:{x},{y},{z} | {VoxelSize}");
                for (y = 0; y < Bounds.Y; y++)
                {
                    for (z = 0; z < Bounds.Z; z++)
                    {
                        Vector3 coords = new Vector3(x, y, z) * VoxelSize;
                        var     n      = NoiseModule2D.GetValue(x, z);
                        Dictionary <ECubeFace, float> noisyNeighbors = new Dictionary <ECubeFace, float>();
                        noisyNeighbors.Add(ECubeFace.Top, NoiseModule.GetValue(x, y + 1, z));
                        noisyNeighbors.Add(ECubeFace.Bottom, NoiseModule.GetValue(x, y - 1, z));
                        noisyNeighbors.Add(ECubeFace.Left, NoiseModule.GetValue(x - 1, y, z));
                        noisyNeighbors.Add(ECubeFace.Right, NoiseModule.GetValue(x + 1, y, z));
                        noisyNeighbors.Add(ECubeFace.Front, NoiseModule.GetValue(x, y, z - 1));
                        noisyNeighbors.Add(ECubeFace.Back, NoiseModule.GetValue(x, y, z + 1));
                        IVoxel voxel = new Voxel
                        {
                            Id                  = Guid.NewGuid(),
                            Bounds              = VoxelSize,
                            Coordinates         = coords,
                            Noise               = n,
                            NeighborNoiseValues = noisyNeighbors,
                            Material            = new Material(n)
                        };
                        voxel.Generated += OnVoxelInitialized;
                        Debug.WriteLine($"Voxel: {i}");
                        voxel.Generate();
                    }
                }
            }

            if (Voxels.Count == Bounds.X * Bounds.Y * Bounds.Z)
            {
                Generated.Invoke(this, new EventArgs());
            }

            return(this);
        }
 public override void CaseTIdentifier(Generated.node.TIdentifier node)
 {
     StringBuilder name = new StringBuilder("");
     foreach (char c in node.Text)
     {
         if (c > 0xFF)
         {
             byte[] utf8Bytes = Encoding.UTF8.GetBytes(c.ToString());
             foreach (byte b in utf8Bytes)
             {
                 name.Append("U");
                 name.AppendFormat("{0:x2}", b);
             }
         }
         else
             name.Append(c);
     }
     node.Text = name.ToString();
 }
        public void Add(Generated generated)
        {
            var line = Line;

            line.Add <Generated>();
            if (generated.Argument == null && !generated.IsPartial)
            {
                return;
            }
            SourceGenerator arguments = new SourceGenerator();

            Require(arguments);
            arguments.Line.Add("argument: typeof(").Add(generated.Argument).Add(")");
            if (generated.IsPartial)
            {
                arguments.Add("isPartial: true");
            }
            line.Add($"({string.Join(",", arguments.GetSourceLines())})");
        }
 public static Operation FromXdr(Generated.Operation xdr)
 {
     var body = xdr.Body;
     Operation operation = null;
     switch (body.Discriminant.InnerValue)
     {
         case Generated.OperationType.OperationTypeEnum.CREATE_ACCOUNT:
             //operation = new CreateAccountOperation.Builder(body.CreateAccountOp).Build();
             break;
         case Generated.OperationType.OperationTypeEnum.PAYMENT:
             operation = new PaymentOperation.Builder(body.PaymentOp).Build();
             break;
         case Generated.OperationType.OperationTypeEnum.PATH_PAYMENT:
             //operation = new PathPaymentOperation.Builder(body.getPathPaymentOp()).build();
             break;
         case Generated.OperationType.OperationTypeEnum.MANAGE_OFFER:
             //operation = new ManagerOfferOperation.Builder(body.getManageOfferOp()).build();
             break;
         case Generated.OperationType.OperationTypeEnum.CREATE_PASSIVE_OFFER:
             //operation = new CreatePassiveOfferOperation.Builder(body.getCreatePassiveOfferOp()).build();
             break;
         case Generated.OperationType.OperationTypeEnum.SET_OPTIONS:
             //operation = new SetOptionsOperation.Builder(body.getSetOptionsOp()).build();
             break;
         case Generated.OperationType.OperationTypeEnum.CHANGE_TRUST:
             operation = new ChangeTrustOperation.Builder(body.ChangeTrustOp).Build();
             break;
         case Generated.OperationType.OperationTypeEnum.ALLOW_TRUST:
             //operation = new AllowTrustOperation.Builder(body.getAllowTrustOp()).build();
             break;
         case Generated.OperationType.OperationTypeEnum.ACCOUNT_MERGE:
             //operation = new AccountMergeOperation.Builder(body).build();
             break;
         default:
             throw new Exception("Unknown operation body " + body.Discriminant.InnerValue);
     }
     if (xdr.SourceAccount != null)
     {
         operation.SourceAccount = KeyPair.FromXdrPublicKey(xdr.SourceAccount.InnerValue);
     }
     return operation;
 }
Ejemplo n.º 35
0
        public override void visit(Generated.Frame obj, bool visitSubNodes)
        {
            Tests.Frame frame = (Tests.Frame)obj;

            if (frame != null)
            {
                checkExpression(frame, frame.getCycleDuration());

                Types.Type type = frame.CycleDuration.GetExpressionType();
                if (type != null)
                {
                    if (!frame.EFSSystem.DoubleType.Match(type))
                    {
                        frame.AddError("Cycle duration should be compatible with the Time type");
                    }
                }
            }

            base.visit(obj, visitSubNodes);
        }
Ejemplo n.º 36
0
        protected void CommitGeneratedChange(Generated record)
        {
            var subjectRoots = record.Subject.ResolveRoots();
            var subjectNodes = new List <Node>();

            foreach (var r in subjectRoots)
            {
                subjectNodes.Add(this.metadataIndexed.AllocateNode(r.CurrentPath));
            }
            if (record.From != null)
            {
                NodeRelation[] relations = new NodeRelation[subjectNodes.Count];
                var            fromNode  = this.metadataIndexed.AllocateNode(record.From.ResolveRoot().CurrentPath);
                for (var i = 0; i < subjectNodes.Count; i++)
                {
                    relations[i] = new NodeRelation(RelationKind.GeneratedFrom, subjectNodes[i], fromNode);
                }

                var nodeRecord = new NodeRecord(record.BatchIndex, record.StageName, record.PluginId, record.PluginMetadata, record.Tags, ChangeKind.Created, relations);
                foreach (var n in subjectNodes)
                {
                    n.AddRecord(nodeRecord);
                }

                foreach (var link in relations)
                {
                    fromNode.AddRelation(link);
                }
            }
            else
            {
                var nodeRecord = new NodeRecord(record.BatchIndex, record.StageName, record.PluginId, record.PluginMetadata, record.Tags, ChangeKind.Created, null);
                foreach (var n in subjectNodes)
                {
                    n.AddRecord(nodeRecord);
                }
            }
        }
Ejemplo n.º 37
0
        /// <summary>
        /// Cleans all text fields in this element
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="visitSubNodes"></param>
        public override void visit(Generated.Specification obj, bool visitSubNodes)
        {
            if ( obj.getVersion() != null )
              {
            obj.setVersion(obj.getVersion().Trim());
              }

              base.visit(obj, visitSubNodes);
        }
Ejemplo n.º 38
0
 /// <summary>
 /// Cleans all text fields in this element
 /// </summary>
 /// <param name="obj"></param>
 /// <param name="visitSubNodes"></param>
 public override void visit(Generated.RequirementSet obj, bool visitSubNodes)
 {
     base.visit(obj, visitSubNodes);
 }
Ejemplo n.º 39
0
 /// <summary>
 /// Cleans all text fields in this element
 /// </summary>
 /// <param name="obj"></param>
 /// <param name="visitSubNodes"></param>
 public override void visit(Generated.ShortcutFolder obj, bool visitSubNodes)
 {
     base.visit(obj, visitSubNodes);
 }
Ejemplo n.º 40
0
 /// <summary>
 /// Cleans all text fields in this element
 /// </summary>
 /// <param name="obj"></param>
 /// <param name="visitSubNodes"></param>
 public override void visit(Generated.ShortcutDictionary obj, bool visitSubNodes)
 {
     base.visit(obj, visitSubNodes);
 }
Ejemplo n.º 41
0
 /// <summary>
 /// Cleans all text fields in this element
 /// </summary>
 /// <param name="obj"></param>
 /// <param name="visitSubNodes"></param>
 public override void visit(Generated.SourceTextComment obj, bool visitSubNodes)
 {
     base.visit(obj, visitSubNodes);
 }
Ejemplo n.º 42
0
 public void Null()
 {
     Assert.AreEqual(null, Generated.FormatValueBasedOnType(null, null));
 }
Ejemplo n.º 43
0
 private UnitCollection<UnitDimension> GetUnitDimensions(Generated.UnitSystem unitSystem)
 {
     var unitDimensions = unitSystem.UnitDimensions.Select(u => new UnitDimension(u));
     return new UnitCollection<UnitDimension>(unitDimensions);
 }
Ejemplo n.º 44
0
 public void String()
 {
     Assert.AreEqual(A_STRING, Generated.FormatValueBasedOnType(A_STRING, null));
 }
Ejemplo n.º 45
0
        /// <summary>
        /// Cleans all text fields in this element
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="visitSubNodes"></param>
        public override void visit(Generated.ParagraphRevision obj, bool visitSubNodes)
        {
            if ( obj.getText() != null )
              {
            obj.setText(obj.getText().Trim());
              }
              if ( obj.getVersion() != null )
              {
            obj.setVersion(obj.getVersion().Trim());
              }

              base.visit(obj, visitSubNodes);
        }
Ejemplo n.º 46
0
        /// <summary>
        /// Cleans all text fields in this element
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="visitSubNodes"></param>
        public override void visit(Generated.Paragraph obj, bool visitSubNodes)
        {
            if ( obj.getId() != null )
              {
            obj.setId(obj.getId().Trim());
              }
              if ( obj.getBl() != null )
              {
            obj.setBl(obj.getBl().Trim());
              }
              if ( obj.getText() != null )
              {
            obj.setText(obj.getText().Trim());
              }
              if ( obj.getVersion() != null )
              {
            obj.setVersion(obj.getVersion().Trim());
              }
              if ( obj.getObsoleteFunctionalBlockName() != null )
              {
            obj.setObsoleteFunctionalBlockName(obj.getObsoleteFunctionalBlockName().Trim());
              }
              if ( obj.getObsoleteGuid() != null )
              {
            obj.setObsoleteGuid(obj.getObsoleteGuid().Trim());
              }

              base.visit(obj, visitSubNodes);
        }
Ejemplo n.º 47
0
 /// <summary>
 /// Cleans all text fields in this element
 /// </summary>
 /// <param name="obj"></param>
 /// <param name="visitSubNodes"></param>
 public override void visit(Generated.ChapterRef obj, bool visitSubNodes)
 {
     base.visit(obj, visitSubNodes);
 }
Ejemplo n.º 48
0
 /// <summary>
 /// Called after the map is generated.
 /// </summary>
 public static void OnGenerated() => Generated.InvokeSafely();
Ejemplo n.º 49
0
 public Light(string name, Generated generated) : base(name, generated)
 {
 }
Ejemplo n.º 50
0
        public string Generate()
        {
            var sb = new StringBuilder();

            foreach (GenProject genProject in _genProjects)
            {
                foreach (string identifier in genProject.GenProjSetting.Identifiers)
                {
                    if (DeclarationManager.Instance.TryGetClass(identifier, out var syntax) &&
                        !Generated.Contains(identifier))
                    {
                        sb.AppendLine(GenerateTsClass(syntax));
                        sb.AppendLine();
                    }
                }
            }

            while (true)
            {
                var refBaseClassToGenerate = RefBasedClasses.Except(Generated).ToArray();
                if (refBaseClassToGenerate.Length == 0)
                {
                    break;
                }

                foreach (string abstractClassName in refBaseClassToGenerate)
                {
                    DeclarationManager.Instance.TryGetAbstractClass(abstractClassName, out var syntax);
                    if (!Generated.Contains(abstractClassName))
                    {
                        sb.AppendLine(GenerateTsClass(syntax));
                        sb.AppendLine();
                    }
                }
            }

            while (true)
            {
                var refClassToGenerate = RefClasses.Except(Generated).ToArray();
                if (refClassToGenerate.Length == 0)
                {
                    break;
                }

                foreach (string className in refClassToGenerate)
                {
                    DeclarationManager.Instance.TryGetClass(className, out var syntax);
                    if (!Generated.Contains(className))
                    {
                        sb.AppendLine(GenerateTsClass(syntax));
                        sb.AppendLine();
                    }
                }
            }

            sb.AppendLine(
                @"export interface IEnumDefinition {
  value: number;
  display: string;
  color: string;
}
");
            sb.AppendLine("export class Enums {");

            foreach (string refEnum in RefEnums)
            {
                DeclarationManager.Instance.TryGetEnum(refEnum, out var syntax);
                if (!Generated.Contains(refEnum))
                {
                    sb.AppendLine(GenerateTsEnum(refEnum, syntax));
                }
            }

            sb.AppendLine("}"); // end of class
            // TODO: Generate enums with colors for SASS

            return(sb.ToString());
        }
Ejemplo n.º 51
0
        /// <summary>
        /// Cleans all text fields in this element
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="visitSubNodes"></param>
        public override void visit(Generated.Chapter obj, bool visitSubNodes)
        {
            if ( obj.getId() != null )
              {
            obj.setId(obj.getId().Trim());
              }

              base.visit(obj, visitSubNodes);
        }
Ejemplo n.º 52
0
        /// <summary>
        /// Cleans all text fields in this element
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="visitSubNodes"></param>
        public override void visit(Generated.DBField obj, bool visitSubNodes)
        {
            if ( obj.getVariable() != null )
              {
            obj.setVariable(obj.getVariable().Trim());
              }
              if ( obj.getValue() != null )
              {
            obj.setValue(obj.getValue().Trim());
              }

              base.visit(obj, visitSubNodes);
        }
Ejemplo n.º 53
0
        /// <summary>
        /// Cleans all text fields in this element
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="visitSubNodes"></param>
        public override void visit(Generated.RequirementSetReference obj, bool visitSubNodes)
        {
            if ( obj.getTarget() != null )
              {
            obj.setTarget(obj.getTarget().Trim());
              }

              base.visit(obj, visitSubNodes);
        }
Ejemplo n.º 54
0
 /// <summary>
 /// Cleans all text fields in this element
 /// </summary>
 /// <param name="obj"></param>
 /// <param name="visitSubNodes"></param>
 public override void visit(Generated.TranslationDictionary obj, bool visitSubNodes)
 {
     base.visit(obj, visitSubNodes);
 }
Ejemplo n.º 55
0
        /// <summary>
        /// Cleans all text fields in this element
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="visitSubNodes"></param>
        public override void visit(Generated.RuleDisabling obj, bool visitSubNodes)
        {
            if ( obj.getRule() != null )
              {
            obj.setRule(obj.getRule().Trim());
              }

              base.visit(obj, visitSubNodes);
        }
Ejemplo n.º 56
0
        /// <summary>
        /// Cleans all text fields in this element
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="visitSubNodes"></param>
        public override void visit(Generated.Translation obj, bool visitSubNodes)
        {
            if ( obj.getObsoleteComment() != null )
              {
            obj.setObsoleteComment(obj.getObsoleteComment().Trim());
              }

              base.visit(obj, visitSubNodes);
        }
Ejemplo n.º 57
0
 private UnitOfMeasureSystemCollection GetUnitOfMeasureSystems(Generated.UnitSystem unitSystem)
 {
     var unitOfMeasureSystems = unitSystem.UnitOfMeasureSystems.Select(u => new UnitOfMeasureSystem(u, this));
     return new UnitOfMeasureSystemCollection(unitOfMeasureSystems);
 }
Ejemplo n.º 58
0
 /// <summary>
 /// Cleans all text fields in this element
 /// </summary>
 /// <param name="obj"></param>
 /// <param name="visitSubNodes"></param>
 public override void visit(Generated.ReqRelated obj, bool visitSubNodes)
 {
     base.visit(obj, visitSubNodes);
 }
Ejemplo n.º 59
0
 public bool Equals(Generated other)
 {
     return(Equals(other.value, value));
 }
Ejemplo n.º 60
0
        public override void XmlAppend(XmlNode node)
        {
            try
            {
                var oDoc = node.OwnerDocument;

                XmlHelper.AddAttribute(node, "key", this.Key);

                XmlHelper.AddAttribute((XmlElement)node, "generated", Generated.ToString());

                XmlHelper.AddAttribute(node, "name", this.Name);

                if (this.CodeFacade != _def_codefacade)
                {
                    XmlHelper.AddAttribute(node, "codeFacade", this.CodeFacade);
                }

                if (this.Description != _def_description)
                {
                    XmlHelper.AddAttribute(node, "description", this.Description);
                }

                if (this.FriendlyName != _def_friendlyName)
                {
                    XmlHelper.AddAttribute(node, "dataFieldFriendlyName", this.FriendlyName);
                }

                if (this.UIVisible != _def_UIVisible)
                {
                    XmlHelper.AddAttribute(node, "dataFieldVisibility", this.UIVisible);
                }

                if (this.SortOrder != _def_sortOrder)
                {
                    XmlHelper.AddAttribute(node, "dataFieldSortOrder", this.SortOrder);
                }

                if (RelationshipRef != null)
                {
                    var relationshipRefNode = oDoc.CreateElement("relationshipRef");
                    RelationshipRef.XmlAppend(relationshipRefNode);
                    node.AppendChild(relationshipRefNode);
                }

                if (this.Default != _def_default)
                {
                    XmlHelper.AddAttribute(node, "default", this.Default);
                }

                if (this.Length != _def_length)
                {
                    XmlHelper.AddAttribute(node, "length", this.Length);
                }

                XmlHelper.AddAttribute(node, "id", this.Id);

                if (this.SortOrder != _def_sortOrder)
                {
                    XmlHelper.AddAttribute(node, "sortOrder", this.SortOrder);
                }

                var parentViewRefNode = oDoc.CreateElement("parentTableRef");
                ParentViewRef.XmlAppend(parentViewRefNode);
                node.AppendChild(parentViewRefNode);

                XmlHelper.AddAttribute(node, "type", (int)this.DataType);

                if (this.AllowNull != _def_allowNull)
                {
                    XmlHelper.AddAttribute(node, "allowNull", this.AllowNull);
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }