예제 #1
0
		/// <summary>
		/// Initializes a new instance of the <see cref="Header"/> class.
		/// </summary>
		/// <param name="document">The document.</param>
		/// <param name="heading">The heading.</param>
		public Header(IDocument document, Headings heading)
		{
			this.Document		= document;
			this.NewXmlNode();
			this.StyleName		= this.GetHeading(heading);
			this.InitStandards();
		}
예제 #2
0
            public void GetsDeeperLevels()
            {
                // Given
                string    input    = @"<html>
                        <head>
                            <title>Foobar</title>
                        </head>
                        <body>
                            <h1>Foo</h1>
                            <h2>Baz</h2>
                            <h1>Bar</h1>
                        </body>
                    </html>";
                IDocument document = new TestDocument
                {
                    Content = input
                };
                IExecutionContext context  = new TestExecutionContext();
                Headings          headings = new Headings(3);

                // When
                List <IDocument> results = headings.Execute(new[] { document }, context).ToList();  // Make sure to materialize the result list

                // Then
                CollectionAssert.AreEqual(
                    new[] { "Foo", "Baz", "Bar" },
                    results[0].DocumentList(HtmlKeys.Headings).Select(x => x.Content).ToArray());
            }
예제 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Header"/> class.
 /// </summary>
 /// <param name="document">The document.</param>
 /// <param name="heading">The heading.</param>
 public Header(IDocument document, Headings heading)
 {
     this.Document = document;
     this.NewXmlNode();
     this.StyleName = this.GetHeading(heading);
     this.InitStandards();
 }
        public void Write()
        {
            var workSheet = Excel.Workbook.Worksheets.Add("Sheet1");

            workSheet.Row(1).Style.HorizontalAlignment = ExcelHorizontalAlignment.Center;
            workSheet.Row(1).Style.Font.Bold           = true;

            for (int i = 1; i <= Headings.Count; i++)
            {
                workSheet.Cells[1, i].Value = Headings.ElementAt(i - 1);
                workSheet.Column(i).AutoFit();
            }

            for (int i = 2; i <= Entities.Count + 1; i++)
            {
                workSheet.Cells[i, 1].Value = Entities.ElementAt(i - 2).EntityName;
                workSheet.Cells[i, 2].Value = Entities.ElementAt(i - 2).EntityRefernce;
                workSheet.Cells[i, 3].Value = Entities.ElementAt(i - 2).LocationName;
                workSheet.Cells[i, 4].Value = Entities.ElementAt(i - 2).LocationReference;
            }

            if (!Directory.Exists(Path))
            {
                Directory.CreateDirectory(Path);
            }

            using (var stream = File.Create($"{Path}/{Filename}.xlsx"))
            {
                Excel.SaveAs(stream);
            }
        }
예제 #5
0
    public void StartCurve(bool direction, Headings where)
    {
        _timeMultiplier = 1;
        switch (where)
        {
        case Headings.jumpUp:     // Jumping up
            _chosenXCurve   = leapXCurve;
            _chosenYCurve   = leapYCurve;
            _xMultiplier    = 3;
            _yMultiplier    = 7;
            _timeMultiplier = 2;
            break;

        case Headings.jumpDown:     // Jumping down
            _chosenXCurve   = leapXCurve;
            _chosenYCurve   = leapDownYCurve;
            _xMultiplier    = 3;
            _yMultiplier    = 7;
            _timeMultiplier = 2;
            break;

        case Headings.leapOver:     // Leaping over
            _chosenXCurve = xCurve;
            _chosenYCurve = yCurve;
            _xMultiplier  = 16;
            _yMultiplier  = 2;
            break;

        default:
            Debug.LogError("FollowCurve default startcurve error message");
            break;
        }
        JumpDirectionRight = direction;
        started            = true;
    }
        private void SetHeadings()
        {
            try
            {
                Headings.Clear();

                LASSectionModel lasSectionModel = Sections[SelectedCurveSectionIndex];

                lasSectionModel.Content.ForEach(content =>
                {
                    LASInformationModel lasInformationModel = new LASInformationModel();

                    string[] splitContent = content.SplitOnWhitespace();

                    lasInformationModel.Name            = splitContent[0];
                    lasInformationModel.MeasurementUnit = splitContent[1];

                    Headings.Add(lasInformationModel);
                });
            }
            catch
            {
                // ignored
            }
        }
예제 #7
0
 void Start()
 {
     outlineHighlight = FindObjectOfType <Camera>().GetComponent <HighlightsFX>();
     rend             = this.GetComponentInChildren <Renderer>();
     outlineColor     = new Color(1f, 1f, 1f, 1f);
     nextHeading      = currentHeading;
 }
예제 #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Header"/> class.
 /// </summary>
 /// <param name="document">The document.</param>
 /// <param name="heading">The heading.</param>
 public Header(IDocument document, Headings heading)
 {
     Document  = document;
     Node      = new XElement(Ns.Text + "h");
     StyleName = GetHeading(heading);
     InitStandards();
 }
예제 #9
0
            public void DoesNotSetHeadingMetadataIfNull()
            {
                // Given
                string    input    = @"<html>
                        <head>
                            <title>Foobar</title>
                        </head>
                        <body>
                            <h1>Foo</h1>
                            <h1>Bar</h1>
                        </body>
                    </html>";
                IDocument document = new TestDocument
                {
                    Content = input
                };
                IExecutionContext context  = new TestExecutionContext();
                Headings          headings = new Headings();

                // When
                List <IDocument> results = headings.Execute(new[] { document }, context).ToList();  // Make sure to materialize the result list

                // Then

                CollectionAssert.AreEqual(
                    new string[] { null, null },
                    results[0].DocumentList(HtmlKeys.Headings).Select(x => x.String("HContent")).ToArray());
            }
예제 #10
0
            public void SetsHeadingIdAttribute()
            {
                // Given
                const string input    = @"<html>
                        <head>
                            <title>Foobar</title>
                        </head>
                        <body>
                            <h1>Foo</h1>
                            <h1 id=""bar"">Bar</h1>
                        </body>
                    </html>";
                IDocument    document = new TestDocument
                {
                    Content = input
                };
                IExecutionContext context  = new TestExecutionContext();
                Headings          headings = new Headings();

                // When
                List <IDocument> results = headings.Execute(new[] { document }, context).ToList();  // Make sure to materialize the result list

                // Then
                CollectionAssert.AreEqual(
                    new[] { null, "bar" },
                    results[0].DocumentList(HtmlKeys.Headings).Select(x => x.String(HtmlKeys.Id)).ToArray());
            }
예제 #11
0
 private void SetCurrentHeading(Headings newHeading)
 {
     currentHeading = newHeading;
     if (!transform.tag.Equals("Airstacles"))
     {
         SetActiveSignalLight();
     }
 }
예제 #12
0
 public Cart(int x, int y, char path, Headings heading, char[,] map)
 {
     _map               = map;
     X                  = x;
     Y                  = y;
     Path               = path;
     Heading            = heading;
     _nextDecisionIndex = 0;
 }
예제 #13
0
            private void HandleIntersection()
            {
                switch (_decisions[_nextDecisionIndex])
                {
                case Decisions.GoLeft:
                    switch (Heading)
                    {
                    case Headings.Left:
                        Heading = Headings.Down;
                        break;

                    case Headings.Up:
                        Heading = Headings.Left;
                        break;

                    case Headings.Right:
                        Heading = Headings.Up;
                        break;

                    case Headings.Down:
                        Heading = Headings.Right;
                        break;
                    }

                    break;

                case Decisions.GoStraight:
                    break;

                case Decisions.GoRight:
                    switch (Heading)
                    {
                    case Headings.Left:
                        Heading = Headings.Up;
                        break;

                    case Headings.Up:
                        Heading = Headings.Right;
                        break;

                    case Headings.Right:
                        Heading = Headings.Down;
                        break;

                    case Headings.Down:
                        Heading = Headings.Left;
                        break;
                    }

                    break;
                }

                _nextDecisionIndex++;
                _nextDecisionIndex = _nextDecisionIndex % _decisions.Length;
            }
예제 #14
0
        /// <summary>
        /// Merges the parameter into the current DatSet object, the parameter takes precedence
        /// </summary>
        /// <param name="data">A DataSet to merge</param>
        public void Merge(Worksheet data)
        {
            // Merge headings
            if (Headings == null || !Headings.Any())
            {
                Headings = data.Headings;
            }

            // Merge rows
            data.Rows = MergeRows(data.Rows);
        }
예제 #15
0
 /// <summary>
 /// Gets the heading.
 /// </summary>
 /// <param name="heading">The heading.</param>
 /// <returns>The heading stylename</returns>
 private string GetHeading(Headings heading)
 {
     if (heading == Headings.Heading)
     {
         return("Heading");
     }
     else if (heading == Headings.Heading_20_1)
     {
         return("Heading_20_1");
     }
     else if (heading == Headings.Heading_20_2)
     {
         return("Heading_20_2");
     }
     else if (heading == Headings.Heading_20_3)
     {
         return("Heading_20_3");
     }
     else if (heading == Headings.Heading_20_4)
     {
         return("Heading_20_4");
     }
     else if (heading == Headings.Heading_20_5)
     {
         return("Heading_20_5");
     }
     else if (heading == Headings.Heading_20_6)
     {
         return("Heading_20_6");
     }
     else if (heading == Headings.Heading_20_7)
     {
         return("Heading_20_7");
     }
     else if (heading == Headings.Heading_20_8)
     {
         return("Heading_20_8");
     }
     else if (heading == Headings.Heading_20_9)
     {
         return("Heading_20_9");
     }
     else if (heading == Headings.Heading_20_10)
     {
         return("Heading_20_10");
     }
     else
     {
         return("Heading");
     }
 }
예제 #16
0
        /// <summary>
        /// Gets connected node of specified heading
        /// </summary>
        /// <param name="heading">Heading</param>
        /// <returns>Returns connected node of specified heading if exists</returns>
        public GridNode this[Headings heading]
        {
            get
            {
                if (this.nodesDictionary.ContainsKey(heading))
                {
                    int index = this.nodesDictionary[heading];

                    return(this.ConnectedNodes[index]);
                }

                return(null);
            }
        }
예제 #17
0
        public override string ToString()
        {
            int    totalLength = _longest.Values.Sum() + _longest.Values.Count * 3 + 2;
            string ret         = ".".PadRight(totalLength - 2, '-') + ".\n";

            // Printing title if there is one
            if (!Title.IsNullOrEmpty())
            {
                ret += $"| {Title.Center(totalLength - 5)} |\n" +
                       "|".PadRight(totalLength - 2, '-') + "|\n";
            }

            // Printing headers if has some
            Headings.ForEachWithIndex((i, h) =>
            {
                ret += $"| {h.Center(_longest[i])} ";

                if (Headings.Length - 1 == i)
                {
                    ret += "|\n" +
                           "|".PadRight(totalLength - 2, '-') + "|\n";
                }
            });

            // Printing rows
            Rows.ForEachWithIndex((i, r) =>
            {
                // Printing columns
                r.Columns.ForEachWithIndex((j, c) =>
                {
                    // Printing data
                    if (c.Align == Column.Alignment.Left)
                    {
                        ret += $"| {c.Text.PadRight(_longest[j])} ";
                    }
                    else
                    {
                        ret += $"| {c.Text.PadLeft(_longest[j])} ";
                    }
                });

                ret += "|\n";
            });

            // Closing table

            ret += "'".PadRight(totalLength - 2, '-') + "'";
            return(ret);
        }
        protected override bool CanReadLASFileAction()
        {
            try
            {
                if (Headings.Any() && Headings[SelectedXHeadingIndex] != null && Headings[SelectedYHeadingIndex] != null && Headings[SelectedZHeadingIndex] != null && Headings[SelectedStageHeadingIndex] != null)
                {
                    return(true);
                }
            }
            catch
            {
                // ignored
            }

            return(false);
        }
예제 #19
0
        public async void SendMessage(Object sender, EventArgs e)
        {
            if (!String.IsNullOrEmpty(chatEntry.Text))
            {
                List <string> id = new List <string>
                {
                    "976bab2a-d650-4139-bf9a-417f92c1633c"
                };

                Headings heading = new Headings
                {
                    en = "Testing"
                };

                Contents content = new Contents
                {
                    en = chatEntry.Text
                };

                ChatRoomObject chat = new ChatRoomObject
                {
                    include_player_ids = id,
                    app_id             = "804c5448-99ec-4e95-829f-c98c0ea6acd9",
                    headings           = heading,
                    contents           = content
                };

                var webservice_content = await CommonFunction.CallWebService(1, chat, "https://onesignal.com/api/v1/notifications", "", this);

                var testing = JObject.Parse(webservice_content);
                int result  = Convert.ToInt32(testing["recipients"].ToString());

                /*ChatRecord sentChat = new ChatRecord
                 * {
                 *  Content = chatEntry.Text,
                 *  Sender = "Self",
                 *  updatedDate = DateTime.Now,
                 *  BackgroundColor = "#FFB6C1"
                 * };
                 *
                 * App.Database.SaveChat(sentChat);*/

                LoadChat();
            }
        }
예제 #20
0
 public string this[string headingName]
 {
     get
     {
         if (!HasHeadings)
         {
             throw new Exception("CSV file has no headings.");
         }
         else if (!Headings.Contains(headingName))
         {
             throw new Exception(String.Format("CSV file doesn't have a heading named '{0}'.", headingName));
         }
         else
         {
             return(this[Headings.IndexOf(headingName)]);
         }
     }
 }
예제 #21
0
    float GetTargetRotation(Headings heading)
    {
        switch (heading)
        {
        case Headings.Up:
            return(270);

        case Headings.Right:
            return(0);

        case Headings.Down:
            return(90);

        case Headings.Left:
            return(180);

        default:
            return(0);
        }
    }
예제 #22
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.layer.Equals(11))
        {
            if (!transform.tag.Equals("Airstacles"))
            {
                gameObject.transform.parent.gameObject.GetComponent <SpawnManager>().KillMe(this);
                GameObject newObject = (GameObject)Instantiate(explosion, this.transform.position, this.transform.rotation);
                Destroy(newObject, 3f);
                FindObjectOfType <TheGameManager>().GameOver();
            }

            Destroy(this.gameObject);
        }
        else if (other.gameObject.layer.Equals(9) && other.gameObject.GetComponent <Collector>().side != finalDestination)
        {
            if (justSpawned)
            {
                return;
            }

            switch (currentHeading)
            {
            case Headings.Up:
                nextHeading = Headings.Down;
                break;

            case Headings.Right:
                nextHeading = Headings.Left;
                break;

            case Headings.Down:
                nextHeading = Headings.Up;
                break;

            case Headings.Left:
                nextHeading = Headings.Right;
                break;
            }
        }
    }
예제 #23
0
        /// <summary>
        /// Try connect nodes
        /// </summary>
        /// <param name="gridNode">Grid node to connect</param>
        public void TryConnect(GridNode gridNode)
        {
            Headings headingThis = this.GetHeadingTo(gridNode);

            if (headingThis != Headings.None)
            {
                Headings headingOther = GetOpposite(headingThis);

                if (!this.nodesDictionary.ContainsKey(headingThis))
                {
                    this.ConnectedNodes.Add(gridNode);
                    this.nodesDictionary.Add(headingThis, this.ConnectedNodes.Count - 1);
                }

                if (!gridNode.nodesDictionary.ContainsKey(headingOther))
                {
                    gridNode.ConnectedNodes.Add(this);
                    gridNode.nodesDictionary.Add(headingOther, gridNode.ConnectedNodes.Count - 1);
                }
            }
        }
예제 #24
0
        /// <summary>
        /// Gets opposite of heading
        /// </summary>
        /// <param name="heading">Heading</param>
        /// <returns>Returns opposite of heading</returns>
        public static Headings GetOpposite(Headings heading)
        {
            if (heading == Headings.North)
            {
                return(Headings.South);
            }
            else if (heading == Headings.South)
            {
                return(Headings.North);
            }
            else if (heading == Headings.East)
            {
                return(Headings.West);
            }
            else if (heading == Headings.West)
            {
                return(Headings.East);
            }

            else if (heading == Headings.NorthWest)
            {
                return(Headings.SouthEast);
            }
            else if (heading == Headings.NorthEast)
            {
                return(Headings.SouthWest);
            }
            else if (heading == Headings.SouthWest)
            {
                return(Headings.NorthEast);
            }
            else if (heading == Headings.SouthEast)
            {
                return(Headings.NorthWest);
            }

            return(Headings.None);
        }
예제 #25
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.layer.Equals(11))
        {
            GameObject newObject = (GameObject)Instantiate(explosion, this.transform.position, this.transform.rotation);
            Destroy(newObject, 3f);
            Destroy(this.gameObject);
            FindObjectOfType <TheGameManager>().GameOver();
        }
        //else if(other.gameObject.layer.Equals(9)) {
        // if it is correct collector tell game manager of success and destroy aircraft
        //if(other.gameObject.GetComponent<Collector>().side == finalDestination) {
        //  TheGameManager.Instance.planesCollected++;
        //  Destroy(gameObject);
        //}
        else
        {
            switch (currentHeading)
            {
            case Headings.Up:
                nextHeading = Headings.Down;
                break;

            case Headings.Right:
                nextHeading = Headings.Left;
                break;

            case Headings.Down:
                nextHeading = Headings.Up;
                break;

            case Headings.Left:
                nextHeading = Headings.Right;
                break;
            }
        }
    }
예제 #26
0
        /// <summary>
        /// Gets a paragraph in ODF format.
        /// </summary>
        /// <param name="doc">The ODF Textdocument that is being created</param>
        /// <returns>List of paragraphs in ODF format.</returns>
        public override List <IContent> GetODFParagraph(AODL.Document.TextDocuments.TextDocument doc)
        {
            //Get the headings enum
            Headings headingEnum   = Headings.Heading;
            string   headingString = string.Format("Heading{0}{1}", _paragraphLevel > 0 ? "_20" : string.Empty, _paragraphLevel > 0 ? "_" + (_paragraphLevel).ToString() : string.Empty);

            if (Enum.IsDefined(typeof(Headings), headingString))
            {
                headingEnum = (Headings)Enum.Parse(typeof(Headings), headingString);
            }

            //Create the header
            AODL.Document.Content.Text.Header header = new AODL.Document.Content.Text.Header(doc, headingEnum);
            //Add the formated text
            foreach (var formatedText in CommonDocumentFunctions.ParseParagraphForODF(doc, _text))
            {
                header.TextContent.Add(formatedText);
            }
            //Add the header properties
            return(new List <IContent>()
            {
                header
            });
        }
예제 #27
0
    public bool TurnAircraft(float direction)
    {
        if (currentHeading != nextHeading)
        {
            return(false);
        }

        float currentRotation = GetTargetRotation(nextHeading);

        if ((Mathf.DeltaAngle(currentRotation, direction) > 90) || (Mathf.DeltaAngle(currentRotation, direction) == 0))
        {
            return(false);
        }

        AudioManager.Instance.PlayTurnSound();

        if (direction == 0)
        {
            nextHeading = Headings.Right;
        }
        else if (direction == 90)
        {
            nextHeading = Headings.Down;
        }
        else if (direction == 180)
        {
            nextHeading = Headings.Left;
        }
        else
        {
            nextHeading = Headings.Up;
        }
        // update curretntHeading

        return(true);
    }
예제 #28
0
 public NavigationProcessor(Headings mainHeading)
 {
     this.mainHeading = mainHeading;
 }
예제 #29
0
 public void Heading(Headings heading)
 {
     doc.execCommand("formatBlock", false, $"<{heading}>");
 }
예제 #30
0
 public NavigationProcessor(Headings mainHeading)
 {
     this.mainHeading = mainHeading;
 }
예제 #31
0
            private void UpdateHeading()
            {
                switch (Path)
                {
                case '-':
                    break;

                case '|':
                    break;

                case '/':
                    switch (Heading)
                    {
                    case Headings.Left:
                        Heading = Headings.Down;
                        break;

                    case Headings.Up:
                        Heading = Headings.Right;
                        break;

                    case Headings.Right:
                        Heading = Headings.Up;
                        break;

                    case Headings.Down:
                        Heading = Headings.Left;
                        break;
                    }

                    break;

                case '\\':
                    switch (Heading)
                    {
                    case Headings.Left:
                        Heading = Headings.Up;
                        break;

                    case Headings.Up:
                        Heading = Headings.Left;
                        break;

                    case Headings.Right:
                        Heading = Headings.Down;
                        break;

                    case Headings.Down:
                        Heading = Headings.Right;
                        break;
                    }

                    break;

                case '+':
                    HandleIntersection();
                    break;

                default:
                    throw new Exception("Invalid path! : " + Path);
                }
            }
예제 #32
0
		/// <summary>
		/// Gets the heading.
		/// </summary>
		/// <param name="heading">The heading.</param>
		/// <returns>The heading stylename</returns>
		private string GetHeading(Headings heading)
		{
			if (heading == Headings.Heading)
				return "Heading";
			else if (heading == Headings.Heading_20_1)
				return "Heading_20_1";
			else if (heading == Headings.Heading_20_2)
				return "Heading_20_2";
			else if (heading == Headings.Heading_20_3)
				return "Heading_20_3";
			else if (heading == Headings.Heading_20_4)
				return "Heading_20_4";
			else if (heading == Headings.Heading_20_5)
				return "Heading_20_5";
			else if (heading == Headings.Heading_20_6)
				return "Heading_20_6";
			else if (heading == Headings.Heading_20_7)
				return "Heading_20_7";
			else if (heading == Headings.Heading_20_8)
				return "Heading_20_8";
			else if (heading == Headings.Heading_20_9)
				return "Heading_20_9";
			else if (heading == Headings.Heading_20_10)
				return "Heading_20_10";
			else
				return "Heading";
		}
예제 #33
0
 private void SetCurrentHeading(Headings newHeading)
 {
     currentHeading = newHeading;
 }