Ejemplo n.º 1
0
        /// <summary>
        ///     Add a section to the geo polyline
        /// </summary>
        /// <param name="section"></param>
        public void Add(GeoBase section)
        {
            // if the section is the right type and
            // is connected to the other sections
            switch (section.GeometryEntityType)
            {
            case GeometryEntityTypes.Vertex:
                throw new ArgumentException("The Argument Provided should be either a " +
                                            $"{typeof(GeoLine)} or a {typeof(GeoArc)} not " +
                                            $"a {typeof(Vertex)}");

            case GeometryEntityTypes.GeoLine:
                // Todo: Add Exception Throw if section is out of range
                SectionList.Add(section);
                IsCounterClockWise = IsCounterClockWiseCalc();
                Length            += ((GeoLine)section).Length;
                Area += ((GeoLine)section).Area;
                break;

            case GeometryEntityTypes.GeoArc:
                // Todo: Add Exception Throw if section is out of range
                SectionList.Add(section);
                IsCounterClockWise = IsCounterClockWiseCalc();
                Length            += ((GeoArc)section).Length;
                Area += CalcAreaGeoArc((GeoArc)section);
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Ejemplo n.º 2
0
    private bool CheckOnLevel()
    {
        scene       = SceneManager.GetActiveScene();
        sectionList = (SectionList)AssetDatabase.LoadAssetAtPath("Assets/StackyDash/Scripts/ScriptableObjects/" + scene.name + ".asset", typeof(SectionList));

        if (sectionList == null)

        {
            GUILayout.BeginHorizontal();
            GUILayout.Space(30);
            GUILayout.Label("Opps.. There is no asset on " + scene.name + " Click New Level Button", EditorStyles.boldLabel);
            GUILayout.EndHorizontal();

            if (GUILayout.Button("New Level"))
            {
                EditorUtility.FocusProjectWindow();
                Selection.activeObject = sectionList;
                CreateSectionList();
            }

            return(false);
        }
        else
        {
            return(true);
        }
    }
Ejemplo n.º 3
0
 public CourseComponentsModel(List <Section> s)
 {
     foreach (var x in s)
     {
         SectionList.Add(new SectionModel(x));
     }
 }
Ejemplo n.º 4
0
            private static string ParseDeclarations(SectionList list, string page)
            {
                StringBuilder result = new StringBuilder();
                Regex         reg1   = new Regex("<script[^>]*runat[\\s]*=[\\s]*\"?server\"?[^>]*>", RegexOptions.IgnoreCase);
                Regex         reg2   = new Regex("</\\s*script\\s*>", RegexOptions.IgnoreCase);

                int index = 0;

                while (index < page.Length)
                {
                    // try find start of block
                    Match m1 = reg1.Match(page, index);
                    if (!m1.Success)
                    {
                        break;              // exit loop here
                    }
                    //start <script> found, now find end.
                    Match m2 = reg2.Match(page, m1.Index + m1.Length);
                    if (!m2.Success)
                    {
                        break;              // exit loop here
                    }
                    result.Append(page.Substring(index, m1.Index - index));

                    string  block = page.Substring(m1.Index + m1.Length, m2.Index - (m1.Index + m1.Length));
                    Section s     = new Section(list.Count, block, SectionType.Declaration);
                    list.Add(s);
                    index = m2.Index + m2.Length;
                }
                result.Append(page.Substring(index));
                return(result.ToString());
            }
Ejemplo n.º 5
0
 private ConfigEntryUtill(string section, T defaultValue) : base()
 {
     //MyLog.LogDebug("ConfigEntryUtill.ctor", section);
     this.section      = section;
     this.defaultValue = defaultValue;
     SectionList.Add(section, this);
 }
Ejemplo n.º 6
0
 private ConfigEntryUtill(string section, params string[] keys) : base()
 {
     //MyLog.LogDebug("ConfigEntryUtill.ctor", section, keys.Length);
     this.section = section;
     SectionList.Add(section, this);
     Add(keys.ToList());
 }
Ejemplo n.º 7
0
        /// <summary>
        /// Iniファイルのテキストからセクション読み込み
        /// </summary>
        /// <param name="text"></param>
        public void ReadIniSection(string text)
        {
            using (var sr = new StringReader(text))
            {
                Section section = null;

                Regex reg_section = new Regex(@"(?<=\s*\[).+(?=\])");

                string readLine = "";
                while ((readLine = sr.ReadLine()) != null)
                {
                    if (reg_section.IsMatch(readLine))
                    {
                        section = new Section(reg_section.Match(readLine).Value);
                        SectionList.Add(section);
                        continue;
                    }
                    else if (readLine.Contains("="))
                    {
                        if (section == null)
                        {
                            section = new Section();
                            SectionList.Add(section);
                        }
                        section.SetEntryWithoutCheckEqual(readLine);
                    }
                }
            }
        }
Ejemplo n.º 8
0
        private void SaveSection()
        {
            SectionModel sec = new SectionModel();

            sec = CurrentSection;
            SectionList.Add(sec);
        }
Ejemplo n.º 9
0
        private void LoadFromFile(string file)
        {
            var contract = Serializer <Contract> .Deserialize(File.ReadAllText(file));

            if (contract != null)
            {
                MyModel      = contract;
                MyModuleType = contract.ModuleType;
            }

            // get list of sections

            // reset
            SectionList.Clear();

            // update
            _dataFactory.DbSource = DbSource;

            // populate SectionList name of Sections

            var dataEntryContract = _dataFactory.GetMetaQueryable <DataEntryContract>().FirstOrDefault(d => d.ModuleType == MyModuleType);

            if (dataEntryContract != null)
            {
                dataEntryContract.Sections.ForEach(s => SectionList.Add(s.Name));
            }

            sectionList.ItemsSource = SectionList;
        }
Ejemplo n.º 10
0
        public SectionList Clone()
        {
            SectionList lRet = new SectionList();

            lRet.mList = Items;
            return(lRet);
        }
Ejemplo n.º 11
0
 public EditSchedule()
 {
     InitializeComponent();
     schedules = new ScheduleList();
     locations = new LocationList();
     sections  = new SectionList();
 }
Ejemplo n.º 12
0
 private void DeleteSection_Load(object sender, EventArgs e)
 {
     sectionList = new SectionList();
     sectionStudentList = new SectionStudentList();
     scheduleList = new ScheduleList();
     PopulateSections();
 }
Ejemplo n.º 13
0
            private static void ParseText(SectionList list, string page)
            {
                if (page.Length <= 0)
                {
                    return;
                }

                int index = 0;

                while (index < page.Length)
                {
                    int k = page.IndexOf("<%", index);
                    if (k < 0)
                    {
                        break;        // no code blocks found, exit
                    }
                    if (k > 0)
                    {
                        list.Add(new Section(list.Count, page.Substring(index, k - index), SectionType.Text));
                    }
                    index = k;

                    int j = page.IndexOf("%>", index);
                    if (j <= index)
                    {
                        break;             // no matching closing brackets found
                    }
                    list.Add(new Section(list.Count, page.Substring(index + 2, j - (index + 2)), SectionType.Code));
                    index = j + 2;
                }
                list.Add(new Section(list.Count, page.Substring(index), SectionType.Text));
            }
Ejemplo n.º 14
0
        public HttpResponseMessage SaveUpdateSections(SectionList section)
        {
            var response = Request.CreateResponse();

            if (section != null)
            {
                List <SectionList> sections = new List <SectionList>();
                sections.Add(section);
                try
                {
                    objApr.SaveUpdateSections(sections);

                    objResponse.Status  = "Success";
                    objResponse.Message = "Data Saved...";
                    objResponse.Data    = "";
                }
                catch (Exception ex)
                {
                    objResponse.Status  = "Error";
                    objResponse.Message = "Failed to save data. Please contact support /administrator";
                    log.Error("Error occured saving data : SaveUpdateSections() ", ex);
                }
                finally
                {
                    //set headers on the "response"
                    response.Content = new ObjectContent(typeof(HRMSResponse), objResponse, new JsonMediaTypeFormatter());
                }
            }
            return(response);
        }
Ejemplo n.º 15
0
 public DeleteTaughtCourse()
 {
     InitializeComponent();
     taughtCourses      = new TaughtCourseList();
     scheduleList       = new ScheduleList();
     sectionStudentList = new SectionStudentList();
     sectionList        = new SectionList();
 }
Ejemplo n.º 16
0
        public SectionList getAllSection()
        {
            var query  = this._SectionRepository.Table;
            var result = new SectionList();

            result.SectionLists = query.ToList();
            return(result);
        }
		public SectionList Load()
		{
			var sectionList = new SectionList();
			var globalSection = new Section("Global");
			Item settingsRoot = _database.GetItem(_settingsRoot);
			sectionList.Add(GetSettings(settingsRoot, globalSection, settingsRoot.Name));
			return sectionList;
		}
Ejemplo n.º 18
0
 //Populate the combo box of the instructor IDs and instantiantes objects to use
 private void DeleteInstructor_Load(object sender, EventArgs e)
 {
     instructorList     = new InstructorList();
     scheduleList       = new ScheduleList();
     sectionStudentList = new SectionStudentList();
     sectionList        = new SectionList();
     PopulateInstructors();
 }
        public SectionList Load()
        {
            var  sectionList   = new SectionList();
            var  globalSection = new Section("Global");
            Item settingsRoot  = _database.GetItem(_settingsRoot);

            sectionList.Add(GetSettings(settingsRoot, globalSection, settingsRoot.Name));
            return(sectionList);
        }
Ejemplo n.º 20
0
 public AverageGrade()
 {
     //instantiating the variables
     InitializeComponent();
     sections = new SectionList();
     students = new StudentList();
     courses  = new CourseList();
     secStuds = new SectionStudentList();
 }
Ejemplo n.º 21
0
 private void PopulateSectionList()
 {
     SectionList.DataSource     = GetHelpSectionsNames().DefaultView;
     SectionList.DataTextField  = "HelpSectionName";
     SectionList.DataValueField = "HelpSectionId";
     SectionList.DataBind();
     SectionList.Items.Insert(0, new ListItem("-- New Help Section", "-1"));
     SectionList.Items.Insert(0, new ListItem("", "-99"));
 }
Ejemplo n.º 22
0
    public static SectionList Create()
    {
        SectionList asset = ScriptableObject.CreateInstance <SectionList>();

        AssetDatabase.CreateAsset(asset, $"Assets/StackyDash/Scripts/ScriptableObjects/" + SceneManager.GetActiveScene().name + ".asset");
        AssetDatabase.SaveAssets();
        IncrementDesignCount();
        return(asset);
    }
Ejemplo n.º 23
0
        public static EnumContentModel GetContentModel(Element element)
        {
            if (element.tagName == "html")
            {
                return(EnumContentModel.root);
            }
            else if (element.tagName == "body")
            {
                return(EnumContentModel.body);
            }
            else if (ContentModel.MetaList.Contains(element.tagName))
            {
                return(EnumContentModel.metadata);
            }
            else if (SectionList.Contains(element.tagName))
            {
                return(EnumContentModel.section);
            }
            else if (element.tagName == "div" && (element.hasAttribute("class") || element.hasAttribute("id")))
            {
                // when a div has a class or id, it upgraded to a section element.
                return(EnumContentModel.section);
            }
            else if (GroupingList.Contains(element.tagName))
            {
                return(EnumContentModel.grouping);
            }
            else if (TextList.Contains(element.tagName))
            {
                return(EnumContentModel.text);
            }
            else if (EmbeddedList.Contains(element.tagName))
            {
                return(EnumContentModel.embedded);
            }
            else if (TableList.Contains(element.tagName))
            {
                return(EnumContentModel.table);
            }

            else if (FormList.Contains(element.tagName))
            {
                return(EnumContentModel.form);
            }
            else if (Interactive.Contains(element.tagName))
            {
                return(EnumContentModel.interactive);
            }
            else if (Edit.Contains(element.tagName))
            {
                return(EnumContentModel.edit);
            }
            else
            {
                return(EnumContentModel.unknown);
            }
        }
Ejemplo n.º 24
0
        private string GetDate()
        {
            var desc = new List <string>();

            SectionList.Where(section => section.Item2.SectionType == CronSectionType.Date)
            .ToList()
            .ForEach(section => AddDescription(section.Item2, desc));

            return(string.Join(", ", desc));
        }
Ejemplo n.º 25
0
        protected void btnViewClasses_Click(object sender, EventArgs e)
        {
            SectionList sList = new SectionList();

            sList = sList.GetAll(); // Get all sections

            ddlSections.DataSource = sList.List;
            ddlSections.DataBind();
            ddlSections.Items.Add("Choose Class Time");
            ddlSections.SelectedValue = "Choose Class Time";
            ddlSections.Visible       = true;
        }
Ejemplo n.º 26
0
        protected override SectionList getSectionList()
        {
            SectionList list   = SectionListBuilder.getArrlSections();
            var         worked = (from Qso qso in service.GetLog()
                                  where qso.AdifId == 291
                                  select qso.Multiplier).Distinct().ToArray();

            foreach (Section section in list)
            {
                section.Worked = worked.Contains(section.Abbr);
            }
            return(list);
        }
        private SectionList GetActiveSections()
        {
            SectionList activeSections = new SectionList();

            foreach (Section section in _sections)
            {
                if (section.IsActive(_context))
                {
                    activeSections.Add(section);
                }
            }
            return(activeSections);
        }
Ejemplo n.º 28
0
        /// <summary>
        ///     The Main GeoPolyLine Constructor
        /// </summary>
        /// <param name="xValues">X Coordinates</param>
        /// <param name="yValues">Y Coordinates</param>
        /// <param name="bulgeList">A List of Bulges</param>
        /// <param name="polylineFlag">The isClosed Property of a polyline</param>
        public GeoPolyline(List <double> xValues,
                           IReadOnlyList <double> yValues, IReadOnlyList <double> bulgeList,
                           bool polylineFlag)
        {
            // Throw Exception if the number of vertices does not match the
            if (xValues.Count != yValues.Count)
            {
                throw new EntityException("There must be a matching number of vertices");
            }

            // Initialize and preallocate the vertex list
            Vertices = new List <Vertex>(xValues.Capacity);

            // Initializing a pre-allocating the section list
            SectionList = polylineFlag
                ? new List <GeoBase>(Vertices.Capacity)
                : new List <GeoBase>(Vertices.Capacity - 1);

            // Place x and y into the vertices list
            Vertices.AddRange(xValues.Select((t, vertexIndex)
                                             => new Vertex(t, yValues[vertexIndex])));

            // Iterate through all of the vertices and build either GeoArcs or GeoLines
            for (var vertexIndex = 0; vertexIndex < Vertices.Count; ++vertexIndex)
            {
                var currentVertex = Vertices[vertexIndex];
                var nextVertex
                    = vertexIndex == Vertices.Count - 1 ? Vertices[0] : Vertices[vertexIndex + 1];

                if (Math.Abs(bulgeList[vertexIndex] - Bulge.BulgeNull) > GeoMath.Tolerance)
                {
                    var geoArc = new GeoArc(currentVertex, nextVertex, bulgeList[vertexIndex]);
                    geoArc.PropertyChanged += GeoArcOnPropertyChanged;
                    SectionList.Add(geoArc);
                }
                else
                {
                    var geoLine = new GeoLine(currentVertex, nextVertex);
                    geoLine.PropertyChanged += GeoLineOnPropertyChanged;
                    SectionList.Add(new GeoLine(currentVertex, nextVertex));
                }


                if (!polylineFlag)
                {
                    SectionList.RemoveAt(SectionList.Count - 1);
                }
            }

            UpdateGeometry(string.Empty);
        }
 public SplitsComponent(LiveSplitState state)
 {
     CurrentState                 = state;
     Settings                     = new SplitsSettings(state);
     InternalComponent            = new ComponentRendererComponent();
     ShadowImages                 = new Dictionary <Image, Image>();
     visualSplitCount             = Settings.VisualSplitCount;
     Settings.SplitLayoutChanged += Settings_SplitLayoutChanged;
     ScrollOffset                 = 0;
     RebuildVisualSplits();
     sectionList = new SectionList();
     previousRun = state.Run;
     sectionList.UpdateSplits(state.Run);
 }
Ejemplo n.º 30
0
        public void LoadString(string str)
        {
            if (string.IsNullOrEmpty(str))
            {
                return;
            }
            ConfigSection section = GetFirstSection(ref str);

            while (section != null)
            {
                SectionList.Add(section);
                section = GetFirstSection(ref str);
            }
        }
Ejemplo n.º 31
0
        protected void btnSetupClass_Click(object sender, EventArgs e)
        {
            Instructor instructor = (Instructor)Session["Instructor"]; //Initialize BusinessObjects

            SectionList sList = new SectionList();

            sList = sList.GetAll(); // Get all sections

            ddlSections.DataSource = sList.List;
            ddlSections.DataBind();
            ddlSections.Items.Add("Choose Class Time");
            ddlSections.SelectedValue = "Choose Class Time";
            ddlSections.Visible       = true;
        }
Ejemplo n.º 32
0
 public SplitsComponent(LiveSplitState state)
 {
     Settings = new SplitsSettings()
     {
         CurrentState = state
     };
     InternalComponent = new ComponentRendererComponent();
     ShadowImages = new Dictionary<Image, Image>();
     visualSplitCount = Settings.VisualSplitCount;
     settingsSplitCount = Settings.VisualSplitCount;
     Settings.SplitLayoutChanged += Settings_SplitLayoutChanged;
     ScrollOffset = 0;
     RebuildVisualSplits();
     sectionList = new SectionList();
     previousRun = state.Run;
     sectionList.UpdateSplits(state.Run);
 }
Ejemplo n.º 33
0
		Control MainContent ()
		{
			var splitter = new Splitter {
				Position = 200,
				FixedPanel = SplitterFixedPanel.Panel1
			};

			var sectionList = new SectionList (this.ContentContainer);
			// set focus when the form is shown
			this.Shown += delegate {
				sectionList.Focus ();
			};

			splitter.Panel1 = sectionList;
			splitter.Panel2 = RightPane ();

			return splitter;
		}
Ejemplo n.º 34
0
 public virtual void init()
 {
     sectionList = new SectionList(sections);
     startPosition = transform.position;
     startRotation = transform.rotation;
 }
 private SectionList GetActiveSections ()
 {
     SectionList activeSections = new SectionList ();
     foreach (Section section in _sections)
     {
         if (section.IsActive (_context))
             activeSections.Add (section);
     }
     return activeSections;
 }