Inheritance: MonoBehaviour
        public static EmployeeViewModel ConvertToViewModel(this Employee employee, Department department, Employee manager, Salary salary, Title title)
        {
            var employeeViewModel = new EmployeeViewModel
            {
                BirthDate = employee.BirthDate.Value.ToShortDateString(),
                CurrentManager = string.Empty,
                Id = employee.PersistenceId.ToString(),
                FirstName = employee.FirstName,
                Gender = employee.Gender.DisplayName,
                HireDate = employee.HireDate.Value.ToShortDateString(),
                LastName = employee.LastName,
            };

            if (manager != null)
            {
                employeeViewModel.CurrentManager = manager.FirstName + " " + manager.LastName;
            }

            if (department != null)
            {
                employeeViewModel.CurrentDepartment = department.Name;
            }
            if (salary != null)
            {
                employeeViewModel.CurrentSalary = salary.Amount.ToString();
            }
            if (title != null)
            {
                employeeViewModel.CurrentTitle = title.Name;
            }

            return employeeViewModel;
        }
示例#2
0
 protected override void AD2LoadContent()
 {
     //The State starts in the title.
     GameState = State.Title;
     //Load the title.
     T = new Title();
 }
 //--- Constructors ---
 public SiteExportBuilder(Title relToTitle) {
     _uris = new Dictionary<XUri, object>();
     _id = 0;
     _requestDoc = new XDoc("requests");
     _manifestDoc = new XDoc("manifest");
     _relToTitle = relToTitle;
 }
        public IHttpActionResult PutTitle(int id, Title title)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            if (id != title.Id)
            {
                return BadRequest();
            }


            try
            {
                _TitleService.Update(title);
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!TitleExists(id))
                {
                    return NotFound();
                }
                else
                {
                    throw;
                }
            }

            return StatusCode(HttpStatusCode.NoContent);
        }
示例#5
0
        public MainMenu(string titleId)
        {
            InitializeComponent();

            buttonPlay.Click += new RoutedEventHandler(buttonPlay_Click);
            buttonRate.Click += new RoutedEventHandler(buttonRate_Click);
            buttonQueue.Click += new RoutedEventHandler(buttonQueue_Click);

            buttonGoBack.Click += new RoutedEventHandler(buttonGoBack_Click);
            buttonSearch.Click += new RoutedEventHandler(buttonSearch_Click);
            buttonExit.Click += new RoutedEventHandler(buttonExit_Click);

            if (string.IsNullOrWhiteSpace(titleId))
            {
                buttonPlay.Opacity = 0.5;
                buttonPlay.IsEnabled = false;

                buttonQueue.Opacity = 0.5;
                buttonQueue.IsEnabled = false;

                buttonRate.Opacity = 0.5;
                buttonRate.IsEnabled = false;

                buttonGoBack.Focus();
            }
            else
            {
                buttonPlay.Focus();

                currentTitle = QuikPixCore.Current.GetTitle(titleId);
            }
        }
        //int filmno;
        public void CreateTitles()
        {
            Console.WriteLine("Creating titles");
            totalfilms = 100;
            totaltvprograms = 100;
            seriesperprogram = 5;
            episodesperseries = 8;

            // Test to create a title withou type specified
            Title ttt1 = new Title();
            ttt1.Name = "Test without titletype";
            TitleCollectionManager.AddTitle(ttt1);

            Title ttmovies = new Title();
            ttmovies.Name = "Movies";
            ttmovies.TitleType = TitleTypes.Collection | TitleTypes.Root;
            TitleCollectionManager.AddTitle(ttmovies);

            Title tttv = new Title();
            tttv.Name = "TV";
            tttv.TitleType = TitleTypes.TVShow | TitleTypes.Root;
            TitleCollectionManager.AddTitle(tttv);

            for (int i = 0; i < totalfilms; i++)
            {
                CreateFilm(ttmovies.Id, i);
            }

            for (int i = 0; i < totaltvprograms; i++)
            {
                CreateTVProgram(tttv.Id, i);
            }
            Console.WriteLine("Job Done. Press enter");
            Console.ReadKey();
        }
        protected void initHeightPlot()
        {
            if (cmc == null) { cmc = new CommomMethodsClass(PersonInfo); }

            List<Double> hVal = new List<Double>();
            List<DateTime> dts = new List<DateTime>();
            List<Height> heights = cmc.GetValues<Height>(Height.TypeId);
            if (heights != null)
            {
                for (int i = 0; i < heights.Count; i++)
                {
                    hVal.Add(heights[i].Value.DisplayValue.Value);
                    dts.Add(heights[i].When.ToDateTime());
                }
            }

            Title chartTitle1 = new Title();
            chartTitle1.Text = "Height in Inches";
            hgraph.Titles.Add(chartTitle1);

            Series series4 = new Series("Spline1");
            series4.ChartType = SeriesChartType.Spline;
            series4.Points.DataBindXY(dts, hVal);
            series4.IsValueShownAsLabel = true;
            hgraph.Series.Add(series4);

            //hide grid lines
            hgraph.ChartAreas["ChartArea1"].AxisX.MajorGrid.Enabled = false;
            hgraph.ChartAreas["ChartArea1"].AxisY.MajorGrid.Enabled = false;
        }
		private void CreateHistoryFile( Title c )
		{
			string filePath;
			FileInfo titleFile;
			Log( " --" + c.TitleID + " History Cleared" );
			filePath = Path.Combine( m_options.Data.MyDocsDir.FullName, m_options.Mod.Path );
			filePath = Path.Combine( filePath, "history/titles" );
			filePath = Path.Combine( filePath, c.TitleID + ".txt" ).Replace( '\\', '/' );

			titleFile = new FileInfo( filePath );
			StreamWriter writ = new StreamWriter( titleFile.Open( FileMode.Create, FileAccess.Write ),
												  Encoding.GetEncoding( 1252 ) );

			//if ( !c.TitleID.StartsWith( "c_" ) )
			//{													 
			//	writ.WriteLine("1.1.1={");

			//	if( c.TitleID.StartsWith( "d_" ) )
			//		writ.WriteLine( "\tde_jure_liege=k_null_title" );
			//	else
			//		writ.WriteLine( "\tde_jure_liege=0" );

			//	writ.WriteLine("}");
			//}

			writ.Dispose();
		}
        public CollectionItem(Title title, IModelItem owner)
            : base(owner)
        {
            this._titleObj = title;
            //this.InternalMovieItem = new Library.MovieItem(title, null);

            this.ItemType = 0;
            if(OMLEngine.Settings.OMLSettings.ShowUnwatchedIcon)
                this.OverlayContentTemplate = "resx://Library/Library.Resources/V3_Controls_BrowseGalleryItem#UnwatchedOverlay";
            if (this._titleObj.WatchedCount == 0)
                this.isUnwatched = true;

            DateTime releaseDate = Convert.ToDateTime(_titleObj.ReleaseDate.ToString("MMMM dd, yyyy"));// new DateTime(2000, 1, 1);
            //invalid dates
            if (releaseDate.Year != 1 && releaseDate.Year != 1900)
                this.MetadataTop = releaseDate.Year.ToString();
            else
                this.MetadataTop = "";

            this.ItemId = 1;
            string starRating = Convert.ToString(Math.Round((Convert.ToDouble(_titleObj.UserStarRating.HasValue ? _titleObj.UserStarRating.Value : 0) * 0.8), MidpointRounding.AwayFromZero));
            this.StarRating = starRating;
            string extendedMetadata = string.Empty;

            this.SortName = title.SortName;

            //this.Metadata = this.InternalMovieItem.Rating.Replace("PG13", "PG-13").Replace("NC17", "NC-17");
            this.Metadata = _titleObj.ParentalRating;
            if (string.IsNullOrEmpty(_titleObj.ParentalRating))
                this.Metadata = "Not Rated";
            if (_titleObj.Runtime.ToString() != "0")
                this.Metadata += string.Format(", {0} minutes", _titleObj.Runtime.ToString());
            this.Tagline = _titleObj.Synopsis;

            this.Description = title.Name;

            //TODO: not sure how to read this yet...
            //temporarially disabled due to bug in eagerloading
            //this.SimpleVideoFormat = _titleObj.VideoFormat.ToString();

            this.Invoked += delegate(object sender, EventArgs args)
            {
                //stub details for CollectionItem
                CollectionPage page = new CollectionPage(this);
                OMLProperties properties = new OMLProperties();
                properties.Add("Application", OMLApplication.Current);
                //properties.Add("UISettings", new UISettings());
                //properties.Add("Settings", new Settings());
                properties.Add("I18n", I18n.Instance);
                //v3 main gallery
                //Library.Code.V3.GalleryPage gallery = new Library.Code.V3.GalleryPage(new List<OMLEngine.TitleFilter>(), "OML");
                ////description
                //gallery.Description = "OML";
                Command CommandContextPopOverlay = new Command();
                properties.Add("CommandContextPopOverlay", CommandContextPopOverlay);
                properties.Add("Page", page);
                OMLApplication.Current.Session.GoToPage(@"resx://Library/Library.Resources/V3_GalleryPage", properties);
            };
        }
        public Chart CreateChart(string title ,  List<string> xData , Dictionary<string ,List<int>>yData ,int width , int height , string xTitle = "null" , string yTitle = "null" ,int backgroundColor = 0x9fc5e8)
        {
            Chart chart = new Chart();

            if (!Show3DStyle)
            {
                chart.Width = width;
                chart.Height = height;
                chart.RenderType = RenderType.ImageTag;
                chart.Palette = ChartColorPalette.BrightPastel;
                Title t = new Title(title, Docking.Top, new System.Drawing.Font("Trebuchet MS", 14, System.Drawing.FontStyle.Bold), Color.FromArgb(23,33,24));
                chart.Titles.Add(t);
                chart.ChartAreas.Add("Series 1");
                if (xTitle != "null")
                {
                    chart.ChartAreas["Series 1"].AxisX.Title = xTitle;
                }
                if (yTitle != "null")
                {
                    chart.ChartAreas["Series 1"].AxisY.Title = yTitle;
                }
                chart.ChartAreas["Series 1"].BackColor = Color.FromArgb((backgroundColor+0x64000000));
                chart.ChartAreas["Series 1"].AxisX.MajorGrid.LineWidth = 0;
                foreach(var item in yData)
                {
                    string column = item.Key;
                    chart.Series.Add(column);
                    switch (SheetType)
                    {
                        case ChartType.Column:
                            chart.Series[column].ChartType = SeriesChartType.Column;
                            break;
                        case ChartType.Line:
                            chart.Series[column].ChartType = SeriesChartType.Line;
                            break;
                        case ChartType.Pie:
                            chart.Series[column].ChartType = SeriesChartType.Pie;
                            break;
                        default:
                            break;
                    }
                    chart.Series[column].Points.DataBindXY(xData, item.Value);
                    chart.Series[column].Label = "#VAL";
                }
                chart.BorderSkin.SkinStyle = BorderSkinStyle.None;
                //chart.BorderlineWidth = 2;
                //chart.BorderlineColor = System.Drawing.Color.Gray;
                //chart.BorderColor = System.Drawing.Color.Red;
                chart.BorderlineDashStyle = ChartDashStyle.NotSet;
                chart.BorderWidth = 2;
                chart.Legends.Add("Legend1");

                return chart;
            }
            else
            {
                return chart;
            }
        }
示例#11
0
        public MiniTitleDisplayItem(Title title)
        {
            if (title == null)
                throw new ArgumentNullException("title");

            this.BoxArt = title.BoxArtSmall;
            this.Title = title.RegularTitle;
        }
示例#12
0
 public UserOptions(Folding foldingMode, Title titleMode, 
     bool moveToNewForder, string secondDirPath)
 {
     FoldingMode = foldingMode;
     TitleMode = titleMode;
     MoveToNewFolder = moveToNewForder;
     SecondDirPath = secondDirPath;
 }
示例#13
0
 public OpenFlashChart()
 {
     title = new Title("Chart Title");
     Elements = new List<ChartBase>();
     //x_axis = new XAxis();
     //y_axis= new YAxis();
     //y_axis_right = new YAxis();
 }
 public void CreateTVEpisode(int parent, int programno, int seriesno, int episodeno)
 {
     Title tt = new Title();
     tt.Name = "TV P" + programno.ToString() + " S" + seriesno.ToString() + " E" + episodeno.ToString();
     tt.TitleType = TitleTypes.Episode;
     tt.ParentTitleId = parent;
     TitleCollectionManager.AddTitle(tt);
 }
示例#15
0
 //
 // GET: /Title/
 public ActionResult Index(Title title)
 {
     using (TitlesEntities dbContext = new TitlesEntities())
     {
         Title model = dbContext.Titles.Where(t => t.TitleId == title.TitleId).FirstOrDefault();
         return View(model);
     }
 }
 public void CreateFilm(int parent, int no)
 {
     Title tt = new Title();
     tt.Name = "Film " + no.ToString();
     tt.TitleType = TitleTypes.Movie;
     tt.ParentTitleId = parent;
     TitleCollectionManager.AddTitle(tt);
 }
        public void EnumHelper_Parse_ReturnsCorrectEnum(string value, Title title)
        {
            //act
            var result = EnumHelper<Title>.Parse(value);

            //assert
            result.Should().Be(title);
        }
示例#18
0
 public void LoadDisk(Title title, Disk disk)
 {
     _currentDisk = disk;
     _currentTitle = title;
     if (disk == null)
         diskSource.DataSource = typeof(Disk);
     else
         diskSource.DataSource = _currentDisk;
 }
示例#19
0
        public static ChartControl CreatPieChart(SolidColorBrush forecolor, string ChartTitle, List<ChartDataChartCommonData> dtchart)
        {
            mausac = 0;
            ChartControl abc = new ChartControl();
            SimpleDiagram2D dg1 = new SimpleDiagram2D();
            //liabc.Titles.Clear();
            //Tao Tile cho Chart
            Title nt = new Title();
            nt.Content = ChartTitle;
            nt.Foreground = forecolor;
            abc.Titles.Add(nt);
            //Tinh so Series
            List<string> countsr = (from p in dtchart group p by p.Series into g select g.Key).ToList();
            //Creat Diagram
            abc.Diagram = dg1;
            GridControl dtl = new GridControl();
            for (int i = 0; i < countsr.Count; i++)
            {
                PieSeries2D dgs1 = new PieSeries2D();
                dgs1.HoleRadiusPercent = 0;//Thiet lap khoang trong tu tam hinh tron den duong tron
                dgs1.ArgumentScaleType = ScaleType.Auto;
                foreach (ChartDataChartCommonData dr in dtchart)//Tao cac point
                {
                    if (dr.Series == countsr.ElementAt(i))
                    {
                        //Tao Series
                        SeriesPoint sr1 = new SeriesPoint();
                        sr1.Argument = dr.Agrument + ":" + dr.Value.ToString();
                        sr1.Value = dr.Value;
                        sr1.Tag = mausac.ToString();
                        dgs1.Points.Add(sr1);
                        mausac++;
                    }
                }
                dgs1.Label = new SeriesLabel();//Tao Label cho Diagram
                PieSeries.SetLabelPosition(dgs1.Label, PieLabelPosition.TwoColumns);
                dgs1.Label.RenderMode = LabelRenderMode.RectangleConnectedToCenter;
                dgs1.LabelsVisibility = true;//Hien thi Lablel cho tung vung
                PointOptions pn1 = new PointOptions();
                pn1.PointView = PointView.ArgumentAndValues;
                pn1.Pattern = "{A} ({V})";//Tao mau chu thich
                NumericOptions nbm1 = new NumericOptions();//Tao Kieu hien thi
                nbm1.Format = NumericFormat.Percent;
                pn1.ValueNumericOptions = nbm1;
                PieSeries2D.SetPercentOptions(pn1, new PercentOptions() { ValueAsPercent = true, PercentageAccuracy = 5 });//Quy dinh ty le phan tram chinh xac
                dgs1.PointOptions = pn1;
                dg1.Series.Add(dgs1);
                //Tao chu thich
                dgs1.LegendPointOptions = pn1;

            }
            abc.Legend = new Legend();
            //End tao chu thich
            //Set mau sac cho seriespont
            abc.CustomDrawSeriesPoint += abc_CustomDrawSeriesPoint;
            return abc;
        }
示例#20
0
        private void SaveJobTitle()
        {
            Title item = new Title();
            item.Name = tbxName.Text.Trim();
            item.Remark = tbxRemark.Text.Trim();

            DB.Titles.Add(item);
            DB.SaveChanges();
        }
示例#21
0
        public void Convert(FB2File fb2File, IBookInformationData titleInformation)
        {
            if (fb2File.PublishInfo.BookTitle != null)
            {
                var bookTitle = new Title
                {
                    TitleName =
                        Rus2Lat.Instance.Translate(fb2File.PublishInfo.BookTitle.Text, _conversionSettings.TransliterationSettings),
                    Language =
                        !string.IsNullOrEmpty(fb2File.PublishInfo.BookTitle.Language)
                            ? fb2File.PublishInfo.BookTitle.Language
                            : fb2File.TitleInfo.Language
                };
                if (!SourceDataInclusionControl.Instance.IsIgnoreInfoSource(SourceDataInclusionControl.DataTypes.Publish, _conversionSettings.IgnoreTitle))
                {
                    bookTitle.TitleType = TitleType.PublishInfo;
                    titleInformation.BookTitles.Add(bookTitle);
                }
            }


            if (fb2File.PublishInfo.ISBN != null)
            {
                var bookId = new Identifier
                {
                    IdentifierName = "BookISBN",
                    ID = fb2File.PublishInfo.ISBN.Text,
                    Scheme = "ISBN"
                };
               titleInformation.Identifiers.Add(bookId);
            }

            titleInformation.Publisher = new Publisher();
            if (fb2File.PublishInfo.Publisher != null)
            {
               titleInformation.Publisher.PublisherName = Rus2Lat.Instance.Translate(fb2File.PublishInfo.Publisher.Text, _conversionSettings.TransliterationSettings);
            }


            try
            {
                if (fb2File.PublishInfo.Year.HasValue)
                {
                    var date = new DateTime(fb2File.PublishInfo.Year.Value, 1, 1);
                    titleInformation.DatePublished = date;
                }
            }
            catch (FormatException ex)
            {
                Logger.Log.DebugFormat("Date reading format exception: {0}", ex);
            }
            catch (Exception exAll)
            {
                Logger.Log.ErrorFormat("Date reading exception: {0}", exAll);
            }
        }   
示例#22
0
 private Chart FormatTitle(Chart chart, string titleText)
 {
     Title title = new Title(titleText);
     chart.Titles.Clear();
     chart.Titles.Add(title);
     title.Docking = Docking.Top;
     title.Alignment = System.Drawing.ContentAlignment.MiddleCenter;
     title.Font = new System.Drawing.Font(title.Font.FontFamily, 18);
     return chart;
 }
示例#23
0
 public MetadataSelect(Title title, string propertyName, PropertyTypeEnum type)
 {
     InitializeComponent();
     _title = title;
     _propertyName = propertyName;
     _type = type;
     Type tTitle = title.GetType();
     _propertyInfo = tTitle.GetProperty(propertyName);
     lblTitleProperty.Text = String.Format("{0} : {1}", _title.Name, _propertyName);
 }
示例#24
0
 public People()
 {
     firstName = String.Empty;
     lastName = String.Empty;
     id = 0;
     title = Title.Unknown;
     work = null;
     earnMoney = null;
     report = null;
 }
示例#25
0
 public PatientAdded(int userId, Guid patientId, string firstname, string surname,
     Title title, NHSNumber nhsNumber)
     : base(userId)
 {
     PatientId = patientId;
     FirstName = firstname;
     Surname = surname;
     Title = title;
     NhsNumber = nhsNumber;
 }
示例#26
0
 public void TestSetup()
 {
     _library = new Library();
     _testTitle = new Title
     {
         TitleName = "Test Name",
         Director = "John Doe",
         YearOfRelease = 1900
     };
 }
        public IHttpActionResult PostTitle(Title title)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            _TitleService.Create(title);

            return CreatedAtRoute("DefaultApi", new { id = title.Id }, title);
        }
 //--- Constructors ---
 public ParserResult(XDoc content, string contentType, Title redirectsTo, XUri redirectToUri, bool hasScriptContent, List<Title> links, List<Title> templates, List<string> tags) {
     this.Content = content;
     this.ContentType = contentType;
     this.RedirectsToTitle = redirectsTo;
     this.RedirectsToUri = redirectToUri;
     this.HasScriptContent = hasScriptContent;
     this.Links = links;
     this.Templates = templates;
     this.Tags = tags;
     _bodyText = null;
     _summary = null;
 }
 public void Generate(BudgetDTO[] budget, Int32 money)
 {
     Chart = new ChartType() { Type = "areaspline" };
     Title = new Title() { Text = "Budget report" };
     Subtitle = new Title() { Text = "Current session" };
     XAxis = new XAxis() { Categories = budget.Select(x => x.Name).ToArray() };
     YAxis = new YAxis() { Title = new Title() { Text = "Budget" } };
     Tooltip = new Tooltip() { Shared = true, ValueSuffix = " money" };
     Series = new ChartSeries[] {
         new ChartSeries() { Name = "Current", Data = budget.Select(x => (Int32)(x.Value)).ToArray() }
     };
 }
示例#30
0
 public AddPatient(int userId, Guid patientId, string firstname, string surname, string middlename, 
     Title title, Gender gender, DateTime dateOfBirth, NHSNumber nhsNumber)
     : base(userId)
 {
     PatientId = patientId;
     FirstName = firstname;
     Surname = surname;
     MiddleName = middlename;
     Title = title;
     Gender = gender;
     DateOfBirth = dateOfBirth;
     NhsNumber = nhsNumber;
 }
示例#31
0
 public static void Name_is_not_empty(Title actual) => Assert.NotEmpty(actual.Name);
示例#32
0
        /*
         *  Method:     FormLineChart_Load
         *
         *  Purpose:    Handles loading of line graph window.
         *
         *  Arguments:  object       UI component sending event.
         *              EventArgs    The event.
         *
         *  Return:     void
         */
        private void FormLineGraph_Load(object sender, EventArgs e)
        {
            // Instantiate list of data points.
            x = new List <string>();
            y = new List <double>();

            // Set chart properties.
            chartGas.Series[0].ChartType   = SeriesChartType.Line;
            chartGas.Series[1].ChartType   = SeriesChartType.Line;
            chartGas.Series[2].ChartType   = SeriesChartType.Line;
            chartGas.Series[0].BorderWidth = 3;
            chartGas.Series[1].BorderWidth = 3;
            chartGas.Series[2].BorderWidth = 3;
            chartGas.ChartAreas[0].AxisX.IsMarginVisible   = false;
            chartGas.ChartAreas[0].AxisY.LabelStyle.Format = "{0.00}";
            chartGas.ChartAreas[0].AxisY2.Enabled          = AxisEnabled.True;
            chartGas.ChartAreas[0].AxisY.MajorGrid.Enabled = false;

            // Assign series to Y axes.
            chartGas.Series[0].YAxisType = AxisType.Primary;
            chartGas.Series[1].YAxisType = AxisType.Primary;
            chartGas.Series[2].YAxisType = AxisType.Secondary;

            // Construct font for the graph's title.
            FontFamily fontFamily = new FontFamily("Times New Roman");
            Font       titleFont  = new Font(fontFamily, 18, FontStyle.Bold);
            Title      title      = new Title("Gas Prices ($/gal) with oil barrel price ($/Barrel)", Docking.Top, titleFont, Color.Black);

            chartGas.Titles.Add(title);

            // Set style of axis titles and labels.
            chartGas.ChartAreas[0].AxisX.Title            = "Year";
            chartGas.ChartAreas[0].AxisX.LabelStyle.Font  = new Font("Times New Roman", 12, FontStyle.Bold);
            chartGas.ChartAreas[0].AxisX.TitleFont        = new Font("Times New Roman", 12, FontStyle.Bold);
            chartGas.ChartAreas[0].AxisY.Title            = "Price (USD)";
            chartGas.ChartAreas[0].AxisY.LabelStyle.Font  = new Font("Times New Roman", 12, FontStyle.Bold);
            chartGas.ChartAreas[0].AxisY.TitleFont        = new Font("Times New Roman", 12, FontStyle.Bold);
            chartGas.ChartAreas[0].AxisY2.Title           = "Price (USD)";
            chartGas.ChartAreas[0].AxisY2.LabelStyle.Font = new Font("Times New Roman", 12, FontStyle.Bold);
            chartGas.ChartAreas[0].AxisY2.TitleFont       = new Font("Times New Roman", 12, FontStyle.Bold);

            // Label the series (line) in the legend.
            chartGas.Series[0].Name = "Gas Price Not inflation-adjusted (LHS)";
            chartGas.Series[1].Name = "Gas Price Inflation-adjusted (LHS)";
            chartGas.Series[2].Name = "Oil price per barrel Not inflation-adjusted (RHS)";

            // Open the data file for gas prices.
            using (var dataFile = new StreamReader("../../../Data/gasPricesCurrent.txt")) {
                // While file has data in it, consume it.
                while ((dataLine = dataFile.ReadLine()) != null)
                {
                    // Split data line into year token and gas price token.
                    dataLineTokens = dataLine.Split(':');

                    // Add data to respective axis lists.
                    x.Add(dataLineTokens[0]);
                    y.Add(Convert.ToDouble(dataLineTokens[1]));
                }
            }

            // Add data points to the current (non-inflation-adjusted) series points.
            chartGas.Series[0].Points.DataBindXY(x, y);

            // Reset data points for new data.
            x.Clear();
            y.Clear();

            // Open the data file for gas prices.
            using (var dataFile = new StreamReader("../../../Data/gasPricesReal.txt")) {
                // While file has data in it, consume it.
                while ((dataLine = dataFile.ReadLine()) != null)
                {
                    // Split data line into year token and gas price token.
                    dataLineTokens = dataLine.Split(':');

                    // Add data to respective axis lists.
                    x.Add(dataLineTokens[0]);
                    y.Add(Convert.ToDouble(dataLineTokens[1]));
                }
            }

            // Add data points to the real (inflation-adjusted) series points.
            chartGas.Series[1].Points.DataBindXY(x, y);

            // Reset data points for new data.
            x.Clear();
            y.Clear();

            // Open the data file for gas prices.
            using (var dataFile = new StreamReader("../../../Data/oilPrice.txt")) {
                // While file has data in it, consume it.
                while ((dataLine = dataFile.ReadLine()) != null)
                {
                    // Split data line into year token and gas price token.
                    dataLineTokens = dataLine.Split(':');

                    // Add data to respective axis lists.
                    x.Add(dataLineTokens[0]);
                    y.Add(Convert.ToDouble(dataLineTokens[1]));
                }
            }

            // Add data points to the real (inflation-adjusted) series points.
            chartGas.Series[2].Points.DataBindXY(x, y);
        }
示例#33
0
 public override bool Equals(object obj)
 {
     return(Title.Equals(((ResCulture)obj).Title));
 }
示例#34
0
 public int CompareTo(DeviceInfo?other)
 {
     return(Title.CompareTo(other?.Title));
 }
示例#35
0
 public static void ValidateUser(UserBE user)
 {
     if (string.IsNullOrEmpty(user.Name) || user.Name.EndsWith(".", true, CultureInfo.InvariantCulture) || !Title.FromUIUsername(user.Name).IsValid)
     {
         throw new UserValidationInvalidOperationException(user.Name);
     }
 }
示例#36
0
 /// <inheritdoc />
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         if (Visible != null)
         {
             hashCode = hashCode * 59 + Visible.GetHashCode();
         }
         if (ShowSpikes != null)
         {
             hashCode = hashCode * 59 + ShowSpikes.GetHashCode();
         }
         if (SpikeSides != null)
         {
             hashCode = hashCode * 59 + SpikeSides.GetHashCode();
         }
         if (SpikeThickness != null)
         {
             hashCode = hashCode * 59 + SpikeThickness.GetHashCode();
         }
         if (SpikeColor != null)
         {
             hashCode = hashCode * 59 + SpikeColor.GetHashCode();
         }
         if (ShowBackground != null)
         {
             hashCode = hashCode * 59 + ShowBackground.GetHashCode();
         }
         if (BackgroundColor != null)
         {
             hashCode = hashCode * 59 + BackgroundColor.GetHashCode();
         }
         if (ShowAxesLabels != null)
         {
             hashCode = hashCode * 59 + ShowAxesLabels.GetHashCode();
         }
         if (Color != null)
         {
             hashCode = hashCode * 59 + Color.GetHashCode();
         }
         if (CategoryOrder != null)
         {
             hashCode = hashCode * 59 + CategoryOrder.GetHashCode();
         }
         if (CategoryArray != null)
         {
             hashCode = hashCode * 59 + CategoryArray.GetHashCode();
         }
         if (Title != null)
         {
             hashCode = hashCode * 59 + Title.GetHashCode();
         }
         if (Type != null)
         {
             hashCode = hashCode * 59 + Type.GetHashCode();
         }
         if (AutoRange != null)
         {
             hashCode = hashCode * 59 + AutoRange.GetHashCode();
         }
         if (RangeMode != null)
         {
             hashCode = hashCode * 59 + RangeMode.GetHashCode();
         }
         if (Range != null)
         {
             hashCode = hashCode * 59 + Range.GetHashCode();
         }
         if (TickMode != null)
         {
             hashCode = hashCode * 59 + TickMode.GetHashCode();
         }
         if (NTicks != null)
         {
             hashCode = hashCode * 59 + NTicks.GetHashCode();
         }
         if (Tick0 != null)
         {
             hashCode = hashCode * 59 + Tick0.GetHashCode();
         }
         if (DTick != null)
         {
             hashCode = hashCode * 59 + DTick.GetHashCode();
         }
         if (TickVals != null)
         {
             hashCode = hashCode * 59 + TickVals.GetHashCode();
         }
         if (TickText != null)
         {
             hashCode = hashCode * 59 + TickText.GetHashCode();
         }
         if (Ticks != null)
         {
             hashCode = hashCode * 59 + Ticks.GetHashCode();
         }
         if (Mirror != null)
         {
             hashCode = hashCode * 59 + Mirror.GetHashCode();
         }
         if (TickLen != null)
         {
             hashCode = hashCode * 59 + TickLen.GetHashCode();
         }
         if (TickWidth != null)
         {
             hashCode = hashCode * 59 + TickWidth.GetHashCode();
         }
         if (TickColor != null)
         {
             hashCode = hashCode * 59 + TickColor.GetHashCode();
         }
         if (ShowTickLabels != null)
         {
             hashCode = hashCode * 59 + ShowTickLabels.GetHashCode();
         }
         if (TickFont != null)
         {
             hashCode = hashCode * 59 + TickFont.GetHashCode();
         }
         if (TickAngle != null)
         {
             hashCode = hashCode * 59 + TickAngle.GetHashCode();
         }
         if (TickPrefix != null)
         {
             hashCode = hashCode * 59 + TickPrefix.GetHashCode();
         }
         if (ShowTickPrefix != null)
         {
             hashCode = hashCode * 59 + ShowTickPrefix.GetHashCode();
         }
         if (TickSuffix != null)
         {
             hashCode = hashCode * 59 + TickSuffix.GetHashCode();
         }
         if (ShowTickSuffix != null)
         {
             hashCode = hashCode * 59 + ShowTickSuffix.GetHashCode();
         }
         if (ShowExponent != null)
         {
             hashCode = hashCode * 59 + ShowExponent.GetHashCode();
         }
         if (ExponentFormat != null)
         {
             hashCode = hashCode * 59 + ExponentFormat.GetHashCode();
         }
         if (MinExponent != null)
         {
             hashCode = hashCode * 59 + MinExponent.GetHashCode();
         }
         if (SeparateThousands != null)
         {
             hashCode = hashCode * 59 + SeparateThousands.GetHashCode();
         }
         if (TickFormat != null)
         {
             hashCode = hashCode * 59 + TickFormat.GetHashCode();
         }
         if (TickFormatStops != null)
         {
             hashCode = hashCode * 59 + TickFormatStops.GetHashCode();
         }
         if (HoverFormat != null)
         {
             hashCode = hashCode * 59 + HoverFormat.GetHashCode();
         }
         if (ShowLine != null)
         {
             hashCode = hashCode * 59 + ShowLine.GetHashCode();
         }
         if (LineColor != null)
         {
             hashCode = hashCode * 59 + LineColor.GetHashCode();
         }
         if (LineWidth != null)
         {
             hashCode = hashCode * 59 + LineWidth.GetHashCode();
         }
         if (ShowGrid != null)
         {
             hashCode = hashCode * 59 + ShowGrid.GetHashCode();
         }
         if (GridColor != null)
         {
             hashCode = hashCode * 59 + GridColor.GetHashCode();
         }
         if (GridWidth != null)
         {
             hashCode = hashCode * 59 + GridWidth.GetHashCode();
         }
         if (ZeroLine != null)
         {
             hashCode = hashCode * 59 + ZeroLine.GetHashCode();
         }
         if (ZeroLineColor != null)
         {
             hashCode = hashCode * 59 + ZeroLineColor.GetHashCode();
         }
         if (ZeroLineWidth != null)
         {
             hashCode = hashCode * 59 + ZeroLineWidth.GetHashCode();
         }
         if (Calendar != null)
         {
             hashCode = hashCode * 59 + Calendar.GetHashCode();
         }
         if (CategoryArraySrc != null)
         {
             hashCode = hashCode * 59 + CategoryArraySrc.GetHashCode();
         }
         if (TickValsSrc != null)
         {
             hashCode = hashCode * 59 + TickValsSrc.GetHashCode();
         }
         if (TickTextSrc != null)
         {
             hashCode = hashCode * 59 + TickTextSrc.GetHashCode();
         }
         return(hashCode);
     }
 }
示例#37
0
        /// <inheritdoc />
        public bool Equals([AllowNull] XAxis other)
        {
            if (other == null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Visible == other.Visible ||
                     Visible != null &&
                     Visible.Equals(other.Visible)
                     ) &&
                 (
                     ShowSpikes == other.ShowSpikes ||
                     ShowSpikes != null &&
                     ShowSpikes.Equals(other.ShowSpikes)
                 ) &&
                 (
                     SpikeSides == other.SpikeSides ||
                     SpikeSides != null &&
                     SpikeSides.Equals(other.SpikeSides)
                 ) &&
                 (
                     SpikeThickness == other.SpikeThickness ||
                     SpikeThickness != null &&
                     SpikeThickness.Equals(other.SpikeThickness)
                 ) &&
                 (
                     SpikeColor == other.SpikeColor ||
                     SpikeColor != null &&
                     SpikeColor.Equals(other.SpikeColor)
                 ) &&
                 (
                     ShowBackground == other.ShowBackground ||
                     ShowBackground != null &&
                     ShowBackground.Equals(other.ShowBackground)
                 ) &&
                 (
                     BackgroundColor == other.BackgroundColor ||
                     BackgroundColor != null &&
                     BackgroundColor.Equals(other.BackgroundColor)
                 ) &&
                 (
                     ShowAxesLabels == other.ShowAxesLabels ||
                     ShowAxesLabels != null &&
                     ShowAxesLabels.Equals(other.ShowAxesLabels)
                 ) &&
                 (
                     Color == other.Color ||
                     Color != null &&
                     Color.Equals(other.Color)
                 ) &&
                 (
                     CategoryOrder == other.CategoryOrder ||
                     CategoryOrder != null &&
                     CategoryOrder.Equals(other.CategoryOrder)
                 ) &&
                 (
                     Equals(CategoryArray, other.CategoryArray) ||
                     CategoryArray != null && other.CategoryArray != null &&
                     CategoryArray.SequenceEqual(other.CategoryArray)
                 ) &&
                 (
                     Title == other.Title ||
                     Title != null &&
                     Title.Equals(other.Title)
                 ) &&
                 (
                     Type == other.Type ||
                     Type != null &&
                     Type.Equals(other.Type)
                 ) &&
                 (
                     AutoRange == other.AutoRange ||
                     AutoRange != null &&
                     AutoRange.Equals(other.AutoRange)
                 ) &&
                 (
                     RangeMode == other.RangeMode ||
                     RangeMode != null &&
                     RangeMode.Equals(other.RangeMode)
                 ) &&
                 (
                     Equals(Range, other.Range) ||
                     Range != null && other.Range != null &&
                     Range.SequenceEqual(other.Range)
                 ) &&
                 (
                     TickMode == other.TickMode ||
                     TickMode != null &&
                     TickMode.Equals(other.TickMode)
                 ) &&
                 (
                     NTicks == other.NTicks ||
                     NTicks != null &&
                     NTicks.Equals(other.NTicks)
                 ) &&
                 (
                     Tick0 == other.Tick0 ||
                     Tick0 != null &&
                     Tick0.Equals(other.Tick0)
                 ) &&
                 (
                     DTick == other.DTick ||
                     DTick != null &&
                     DTick.Equals(other.DTick)
                 ) &&
                 (
                     Equals(TickVals, other.TickVals) ||
                     TickVals != null && other.TickVals != null &&
                     TickVals.SequenceEqual(other.TickVals)
                 ) &&
                 (
                     Equals(TickText, other.TickText) ||
                     TickText != null && other.TickText != null &&
                     TickText.SequenceEqual(other.TickText)
                 ) &&
                 (
                     Ticks == other.Ticks ||
                     Ticks != null &&
                     Ticks.Equals(other.Ticks)
                 ) &&
                 (
                     Mirror == other.Mirror ||
                     Mirror != null &&
                     Mirror.Equals(other.Mirror)
                 ) &&
                 (
                     TickLen == other.TickLen ||
                     TickLen != null &&
                     TickLen.Equals(other.TickLen)
                 ) &&
                 (
                     TickWidth == other.TickWidth ||
                     TickWidth != null &&
                     TickWidth.Equals(other.TickWidth)
                 ) &&
                 (
                     TickColor == other.TickColor ||
                     TickColor != null &&
                     TickColor.Equals(other.TickColor)
                 ) &&
                 (
                     ShowTickLabels == other.ShowTickLabels ||
                     ShowTickLabels != null &&
                     ShowTickLabels.Equals(other.ShowTickLabels)
                 ) &&
                 (
                     TickFont == other.TickFont ||
                     TickFont != null &&
                     TickFont.Equals(other.TickFont)
                 ) &&
                 (
                     TickAngle == other.TickAngle ||
                     TickAngle != null &&
                     TickAngle.Equals(other.TickAngle)
                 ) &&
                 (
                     TickPrefix == other.TickPrefix ||
                     TickPrefix != null &&
                     TickPrefix.Equals(other.TickPrefix)
                 ) &&
                 (
                     ShowTickPrefix == other.ShowTickPrefix ||
                     ShowTickPrefix != null &&
                     ShowTickPrefix.Equals(other.ShowTickPrefix)
                 ) &&
                 (
                     TickSuffix == other.TickSuffix ||
                     TickSuffix != null &&
                     TickSuffix.Equals(other.TickSuffix)
                 ) &&
                 (
                     ShowTickSuffix == other.ShowTickSuffix ||
                     ShowTickSuffix != null &&
                     ShowTickSuffix.Equals(other.ShowTickSuffix)
                 ) &&
                 (
                     ShowExponent == other.ShowExponent ||
                     ShowExponent != null &&
                     ShowExponent.Equals(other.ShowExponent)
                 ) &&
                 (
                     ExponentFormat == other.ExponentFormat ||
                     ExponentFormat != null &&
                     ExponentFormat.Equals(other.ExponentFormat)
                 ) &&
                 (
                     MinExponent == other.MinExponent ||
                     MinExponent != null &&
                     MinExponent.Equals(other.MinExponent)
                 ) &&
                 (
                     SeparateThousands == other.SeparateThousands ||
                     SeparateThousands != null &&
                     SeparateThousands.Equals(other.SeparateThousands)
                 ) &&
                 (
                     TickFormat == other.TickFormat ||
                     TickFormat != null &&
                     TickFormat.Equals(other.TickFormat)
                 ) &&
                 (
                     Equals(TickFormatStops, other.TickFormatStops) ||
                     TickFormatStops != null && other.TickFormatStops != null &&
                     TickFormatStops.SequenceEqual(other.TickFormatStops)
                 ) &&
                 (
                     HoverFormat == other.HoverFormat ||
                     HoverFormat != null &&
                     HoverFormat.Equals(other.HoverFormat)
                 ) &&
                 (
                     ShowLine == other.ShowLine ||
                     ShowLine != null &&
                     ShowLine.Equals(other.ShowLine)
                 ) &&
                 (
                     LineColor == other.LineColor ||
                     LineColor != null &&
                     LineColor.Equals(other.LineColor)
                 ) &&
                 (
                     LineWidth == other.LineWidth ||
                     LineWidth != null &&
                     LineWidth.Equals(other.LineWidth)
                 ) &&
                 (
                     ShowGrid == other.ShowGrid ||
                     ShowGrid != null &&
                     ShowGrid.Equals(other.ShowGrid)
                 ) &&
                 (
                     GridColor == other.GridColor ||
                     GridColor != null &&
                     GridColor.Equals(other.GridColor)
                 ) &&
                 (
                     GridWidth == other.GridWidth ||
                     GridWidth != null &&
                     GridWidth.Equals(other.GridWidth)
                 ) &&
                 (
                     ZeroLine == other.ZeroLine ||
                     ZeroLine != null &&
                     ZeroLine.Equals(other.ZeroLine)
                 ) &&
                 (
                     ZeroLineColor == other.ZeroLineColor ||
                     ZeroLineColor != null &&
                     ZeroLineColor.Equals(other.ZeroLineColor)
                 ) &&
                 (
                     ZeroLineWidth == other.ZeroLineWidth ||
                     ZeroLineWidth != null &&
                     ZeroLineWidth.Equals(other.ZeroLineWidth)
                 ) &&
                 (
                     Calendar == other.Calendar ||
                     Calendar != null &&
                     Calendar.Equals(other.Calendar)
                 ) &&
                 (
                     CategoryArraySrc == other.CategoryArraySrc ||
                     CategoryArraySrc != null &&
                     CategoryArraySrc.Equals(other.CategoryArraySrc)
                 ) &&
                 (
                     TickValsSrc == other.TickValsSrc ||
                     TickValsSrc != null &&
                     TickValsSrc.Equals(other.TickValsSrc)
                 ) &&
                 (
                     TickTextSrc == other.TickTextSrc ||
                     TickTextSrc != null &&
                     TickTextSrc.Equals(other.TickTextSrc)
                 ));
        }
示例#38
0
 /// <inheritdoc />
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         if (ThicknessMode != null)
         {
             hashCode = hashCode * 59 + ThicknessMode.GetHashCode();
         }
         if (Thickness != null)
         {
             hashCode = hashCode * 59 + Thickness.GetHashCode();
         }
         if (LenMode != null)
         {
             hashCode = hashCode * 59 + LenMode.GetHashCode();
         }
         if (Len != null)
         {
             hashCode = hashCode * 59 + Len.GetHashCode();
         }
         if (X != null)
         {
             hashCode = hashCode * 59 + X.GetHashCode();
         }
         if (XAnchor != null)
         {
             hashCode = hashCode * 59 + XAnchor.GetHashCode();
         }
         if (XPad != null)
         {
             hashCode = hashCode * 59 + XPad.GetHashCode();
         }
         if (Y != null)
         {
             hashCode = hashCode * 59 + Y.GetHashCode();
         }
         if (YAnchor != null)
         {
             hashCode = hashCode * 59 + YAnchor.GetHashCode();
         }
         if (YPad != null)
         {
             hashCode = hashCode * 59 + YPad.GetHashCode();
         }
         if (OutlineColor != null)
         {
             hashCode = hashCode * 59 + OutlineColor.GetHashCode();
         }
         if (OutlineWidth != null)
         {
             hashCode = hashCode * 59 + OutlineWidth.GetHashCode();
         }
         if (BorderColor != null)
         {
             hashCode = hashCode * 59 + BorderColor.GetHashCode();
         }
         if (BorderWidth != null)
         {
             hashCode = hashCode * 59 + BorderWidth.GetHashCode();
         }
         if (BgColor != null)
         {
             hashCode = hashCode * 59 + BgColor.GetHashCode();
         }
         if (TickMode != null)
         {
             hashCode = hashCode * 59 + TickMode.GetHashCode();
         }
         if (NTicks != null)
         {
             hashCode = hashCode * 59 + NTicks.GetHashCode();
         }
         if (Tick0 != null)
         {
             hashCode = hashCode * 59 + Tick0.GetHashCode();
         }
         if (DTick != null)
         {
             hashCode = hashCode * 59 + DTick.GetHashCode();
         }
         if (TickVals != null)
         {
             hashCode = hashCode * 59 + TickVals.GetHashCode();
         }
         if (TickText != null)
         {
             hashCode = hashCode * 59 + TickText.GetHashCode();
         }
         if (Ticks != null)
         {
             hashCode = hashCode * 59 + Ticks.GetHashCode();
         }
         if (TickleN != null)
         {
             hashCode = hashCode * 59 + TickleN.GetHashCode();
         }
         if (TickWidth != null)
         {
             hashCode = hashCode * 59 + TickWidth.GetHashCode();
         }
         if (TickColor != null)
         {
             hashCode = hashCode * 59 + TickColor.GetHashCode();
         }
         if (ShowTickLabels != null)
         {
             hashCode = hashCode * 59 + ShowTickLabels.GetHashCode();
         }
         if (TickFont != null)
         {
             hashCode = hashCode * 59 + TickFont.GetHashCode();
         }
         if (TickAngle != null)
         {
             hashCode = hashCode * 59 + TickAngle.GetHashCode();
         }
         if (TickFormat != null)
         {
             hashCode = hashCode * 59 + TickFormat.GetHashCode();
         }
         if (TickFormatStops != null)
         {
             hashCode = hashCode * 59 + TickFormatStops.GetHashCode();
         }
         if (TickPrefix != null)
         {
             hashCode = hashCode * 59 + TickPrefix.GetHashCode();
         }
         if (ShowTickPrefix != null)
         {
             hashCode = hashCode * 59 + ShowTickPrefix.GetHashCode();
         }
         if (TickSuffix != null)
         {
             hashCode = hashCode * 59 + TickSuffix.GetHashCode();
         }
         if (ShowTickSuffix != null)
         {
             hashCode = hashCode * 59 + ShowTickSuffix.GetHashCode();
         }
         if (SeparateThousands != null)
         {
             hashCode = hashCode * 59 + SeparateThousands.GetHashCode();
         }
         if (ExponentFormat != null)
         {
             hashCode = hashCode * 59 + ExponentFormat.GetHashCode();
         }
         if (ShowExponent != null)
         {
             hashCode = hashCode * 59 + ShowExponent.GetHashCode();
         }
         if (Title != null)
         {
             hashCode = hashCode * 59 + Title.GetHashCode();
         }
         if (TickValsSrc != null)
         {
             hashCode = hashCode * 59 + TickValsSrc.GetHashCode();
         }
         if (TickTextSrc != null)
         {
             hashCode = hashCode * 59 + TickTextSrc.GetHashCode();
         }
         return(hashCode);
     }
 }
示例#39
0
        /// <inheritdoc />
        public bool Equals([AllowNull] ColorBar other)
        {
            if (other == null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     ThicknessMode == other.ThicknessMode ||
                     ThicknessMode != null &&
                     ThicknessMode.Equals(other.ThicknessMode)
                     ) &&
                 (
                     Thickness == other.Thickness ||
                     Thickness != null &&
                     Thickness.Equals(other.Thickness)
                 ) &&
                 (
                     LenMode == other.LenMode ||
                     LenMode != null &&
                     LenMode.Equals(other.LenMode)
                 ) &&
                 (
                     Len == other.Len ||
                     Len != null &&
                     Len.Equals(other.Len)
                 ) &&
                 (
                     X == other.X ||
                     X != null &&
                     X.Equals(other.X)
                 ) &&
                 (
                     XAnchor == other.XAnchor ||
                     XAnchor != null &&
                     XAnchor.Equals(other.XAnchor)
                 ) &&
                 (
                     XPad == other.XPad ||
                     XPad != null &&
                     XPad.Equals(other.XPad)
                 ) &&
                 (
                     Y == other.Y ||
                     Y != null &&
                     Y.Equals(other.Y)
                 ) &&
                 (
                     YAnchor == other.YAnchor ||
                     YAnchor != null &&
                     YAnchor.Equals(other.YAnchor)
                 ) &&
                 (
                     YPad == other.YPad ||
                     YPad != null &&
                     YPad.Equals(other.YPad)
                 ) &&
                 (
                     OutlineColor == other.OutlineColor ||
                     OutlineColor != null &&
                     OutlineColor.Equals(other.OutlineColor)
                 ) &&
                 (
                     OutlineWidth == other.OutlineWidth ||
                     OutlineWidth != null &&
                     OutlineWidth.Equals(other.OutlineWidth)
                 ) &&
                 (
                     BorderColor == other.BorderColor ||
                     BorderColor != null &&
                     BorderColor.Equals(other.BorderColor)
                 ) &&
                 (
                     BorderWidth == other.BorderWidth ||
                     BorderWidth != null &&
                     BorderWidth.Equals(other.BorderWidth)
                 ) &&
                 (
                     BgColor == other.BgColor ||
                     BgColor != null &&
                     BgColor.Equals(other.BgColor)
                 ) &&
                 (
                     TickMode == other.TickMode ||
                     TickMode != null &&
                     TickMode.Equals(other.TickMode)
                 ) &&
                 (
                     NTicks == other.NTicks ||
                     NTicks != null &&
                     NTicks.Equals(other.NTicks)
                 ) &&
                 (
                     Tick0 == other.Tick0 ||
                     Tick0 != null &&
                     Tick0.Equals(other.Tick0)
                 ) &&
                 (
                     DTick == other.DTick ||
                     DTick != null &&
                     DTick.Equals(other.DTick)
                 ) &&
                 (
                     Equals(TickVals, other.TickVals) ||
                     TickVals != null && other.TickVals != null &&
                     TickVals.SequenceEqual(other.TickVals)
                 ) &&
                 (
                     Equals(TickText, other.TickText) ||
                     TickText != null && other.TickText != null &&
                     TickText.SequenceEqual(other.TickText)
                 ) &&
                 (
                     Ticks == other.Ticks ||
                     Ticks != null &&
                     Ticks.Equals(other.Ticks)
                 ) &&
                 (
                     TickleN == other.TickleN ||
                     TickleN != null &&
                     TickleN.Equals(other.TickleN)
                 ) &&
                 (
                     TickWidth == other.TickWidth ||
                     TickWidth != null &&
                     TickWidth.Equals(other.TickWidth)
                 ) &&
                 (
                     TickColor == other.TickColor ||
                     TickColor != null &&
                     TickColor.Equals(other.TickColor)
                 ) &&
                 (
                     ShowTickLabels == other.ShowTickLabels ||
                     ShowTickLabels != null &&
                     ShowTickLabels.Equals(other.ShowTickLabels)
                 ) &&
                 (
                     TickFont == other.TickFont ||
                     TickFont != null &&
                     TickFont.Equals(other.TickFont)
                 ) &&
                 (
                     TickAngle == other.TickAngle ||
                     TickAngle != null &&
                     TickAngle.Equals(other.TickAngle)
                 ) &&
                 (
                     TickFormat == other.TickFormat ||
                     TickFormat != null &&
                     TickFormat.Equals(other.TickFormat)
                 ) &&
                 (
                     Equals(TickFormatStops, other.TickFormatStops) ||
                     TickFormatStops != null && other.TickFormatStops != null &&
                     TickFormatStops.SequenceEqual(other.TickFormatStops)
                 ) &&
                 (
                     TickPrefix == other.TickPrefix ||
                     TickPrefix != null &&
                     TickPrefix.Equals(other.TickPrefix)
                 ) &&
                 (
                     ShowTickPrefix == other.ShowTickPrefix ||
                     ShowTickPrefix != null &&
                     ShowTickPrefix.Equals(other.ShowTickPrefix)
                 ) &&
                 (
                     TickSuffix == other.TickSuffix ||
                     TickSuffix != null &&
                     TickSuffix.Equals(other.TickSuffix)
                 ) &&
                 (
                     ShowTickSuffix == other.ShowTickSuffix ||
                     ShowTickSuffix != null &&
                     ShowTickSuffix.Equals(other.ShowTickSuffix)
                 ) &&
                 (
                     SeparateThousands == other.SeparateThousands ||
                     SeparateThousands != null &&
                     SeparateThousands.Equals(other.SeparateThousands)
                 ) &&
                 (
                     ExponentFormat == other.ExponentFormat ||
                     ExponentFormat != null &&
                     ExponentFormat.Equals(other.ExponentFormat)
                 ) &&
                 (
                     ShowExponent == other.ShowExponent ||
                     ShowExponent != null &&
                     ShowExponent.Equals(other.ShowExponent)
                 ) &&
                 (
                     Title == other.Title ||
                     Title != null &&
                     Title.Equals(other.Title)
                 ) &&
                 (
                     TickValsSrc == other.TickValsSrc ||
                     TickValsSrc != null &&
                     TickValsSrc.Equals(other.TickValsSrc)
                 ) &&
                 (
                     TickTextSrc == other.TickTextSrc ||
                     TickTextSrc != null &&
                     TickTextSrc.Equals(other.TickTextSrc)
                 ));
        }
示例#40
0
        private async Task <string> ExecuteWithTimeout(AsyncCodeActivityContext context, CancellationToken cancellationToken = default)
        {
            var title       = Title.Get(context);
            var defaultpath = InitialPath.Get(context);
            var result      = string.Empty;
            var dlg         = new CommonOpenFileDialog();

            if (!string.IsNullOrEmpty(defaultpath))
            {
                var index    = defaultpath.LastIndexOf(@"\");
                var dotindex = defaultpath.IndexOf(@".", index);
                if (dotindex < 0)
                {
                    defaultpath = defaultpath + @"\";
                }
            }

            if (!string.IsNullOrEmpty(title))
            {
                dlg.Title = title;
            }
            if (!string.IsNullOrEmpty(Path.GetDirectoryName(defaultpath)))
            {
                dlg.InitialDirectory = Path.GetDirectoryName(defaultpath);
            }
            if (!string.IsNullOrEmpty(Path.GetFileName(defaultpath)))
            {
                dlg.DefaultFileName = Path.GetFileName(defaultpath);
            }

            if ((int)this.FileType >= 1)
            {
                var filter = new CommonFileDialogFilter();
                filter.DisplayName = "許可されたファイル";

                if (this.FileType.HasFlag(FileTypes.Excel))
                {
                    filter.Extensions.Add("xls");
                    filter.Extensions.Add("xlsx");
                    filter.Extensions.Add("xlsm");
                }
                if (this.FileType.HasFlag(FileTypes.CSV))
                {
                    filter.Extensions.Add("csv");
                }
                if (this.FileType.HasFlag(FileTypes.PDF))
                {
                    filter.Extensions.Add("pdf");
                }
                if (this.FileType.HasFlag(FileTypes.Text))
                {
                    filter.Extensions.Add("txt");
                }
                if (this.FileType.HasFlag(FileTypes.PowerPoint))
                {
                    filter.Extensions.Add("ppt");
                    filter.Extensions.Add("pptx");
                }
                if (this.FileType.HasFlag(FileTypes.Word))
                {
                    filter.Extensions.Add("doc");
                    filter.Extensions.Add("docx");
                }
                dlg.Filters.Add(filter);
            }
            else
            {
                dlg.Filters.Add(new CommonFileDialogFilter("すべてのファイル", "*.*"));
            }

            if (dlg.ShowDialog() == CommonFileDialogResult.Ok)
            {
                result = dlg.FileName;
            }

            return(await Task.FromResult(result));
        }
示例#41
0
文件: Node.cs 项目: josgood88/Scout2
 public override int GetHashCode()
 {
     return(ID.GetHashCode() ^ Title.GetHashCode());
 }
示例#42
0
 public static PageBE GetHomePage(UserBE user)
 {
     return(PageBL.GetPageByTitle(Title.FromUIUsername(user.Name)));
 }
示例#43
0
 public static XUri GetUriUiHomePage(UserBE user)
 {
     return(XUri.TryParse(Utils.AsPublicUiUri(Title.FromDbPath(NS.USER, user.Name, null))));
 }
示例#44
0
        private void Set(Context context, DataRow dataRow, string tableAlias = null)
        {
            AccessStatus = Databases.AccessStatuses.Selected;
            foreach (DataColumn dataColumn in dataRow.Table.Columns)
            {
                var column = new ColumnNameInfo(dataColumn.ColumnName);
                if (column.TableAlias == tableAlias)
                {
                    switch (column.Name)
                    {
                    case "ReferenceType":
                        if (dataRow[column.ColumnName] != DBNull.Value)
                        {
                            ReferenceType      = dataRow[column.ColumnName].ToString();
                            SavedReferenceType = ReferenceType;
                        }
                        break;

                    case "ReferenceId":
                        if (dataRow[column.ColumnName] != DBNull.Value)
                        {
                            ReferenceId      = dataRow[column.ColumnName].ToLong();
                            SavedReferenceId = ReferenceId;
                        }
                        break;

                    case "ReferenceVer":
                        if (dataRow[column.ColumnName] != DBNull.Value)
                        {
                            ReferenceVer      = dataRow[column.ColumnName].ToInt();
                            SavedReferenceVer = ReferenceVer;
                        }
                        break;

                    case "OutgoingMailId":
                        if (dataRow[column.ColumnName] != DBNull.Value)
                        {
                            OutgoingMailId      = dataRow[column.ColumnName].ToLong();
                            SavedOutgoingMailId = OutgoingMailId;
                        }
                        break;

                    case "Ver":
                        Ver      = dataRow[column.ColumnName].ToInt();
                        SavedVer = Ver;
                        break;

                    case "Host":
                        Host      = dataRow[column.ColumnName].ToString();
                        SavedHost = Host;
                        break;

                    case "Port":
                        Port      = dataRow[column.ColumnName].ToInt();
                        SavedPort = Port;
                        break;

                    case "From":
                        From      = new System.Net.Mail.MailAddress(dataRow[column.ColumnName].ToString());
                        SavedFrom = From.ToString();
                        break;

                    case "To":
                        To      = dataRow[column.ColumnName].ToString();
                        SavedTo = To;
                        break;

                    case "Cc":
                        Cc      = dataRow[column.ColumnName].ToString();
                        SavedCc = Cc;
                        break;

                    case "Bcc":
                        Bcc      = dataRow[column.ColumnName].ToString();
                        SavedBcc = Bcc;
                        break;

                    case "Title":
                        Title      = new Title(dataRow, "OutgoingMailId");
                        SavedTitle = Title.Value;
                        break;

                    case "Body":
                        Body      = dataRow[column.ColumnName].ToString();
                        SavedBody = Body;
                        break;

                    case "SentTime":
                        SentTime      = new Time(context, dataRow, column.ColumnName);
                        SavedSentTime = SentTime.Value;
                        break;

                    case "Comments":
                        Comments      = dataRow[column.ColumnName].ToString().Deserialize <Comments>() ?? new Comments();
                        SavedComments = Comments.ToJson();
                        break;

                    case "Creator":
                        Creator      = SiteInfo.User(context: context, userId: dataRow.Int(column.ColumnName));
                        SavedCreator = Creator.Id;
                        break;

                    case "Updator":
                        Updator      = SiteInfo.User(context: context, userId: dataRow.Int(column.ColumnName));
                        SavedUpdator = Updator.Id;
                        break;

                    case "CreatedTime":
                        CreatedTime      = new Time(context, dataRow, column.ColumnName);
                        SavedCreatedTime = CreatedTime.Value;
                        break;

                    case "UpdatedTime":
                        UpdatedTime      = new Time(context, dataRow, column.ColumnName); Timestamp = dataRow.Field <DateTime>(column.ColumnName).ToString("yyyy/M/d H:m:s.fff");
                        SavedUpdatedTime = UpdatedTime.Value;
                        break;

                    case "IsHistory":
                        VerType = dataRow.Bool(column.ColumnName)
                                ? Versions.VerTypes.History
                                : Versions.VerTypes.Latest; break;

                    default:
                        switch (Def.ExtendedColumnTypes.Get(column.Name))
                        {
                        case "Class":
                            Class(
                                columnName: column.Name,
                                value: dataRow[column.ColumnName].ToString());
                            SavedClass(
                                columnName: column.Name,
                                value: Class(columnName: column.Name));
                            break;

                        case "Num":
                            Num(
                                columnName: column.Name,
                                value: dataRow[column.ColumnName].ToDecimal());
                            SavedNum(
                                columnName: column.Name,
                                value: Num(columnName: column.Name));
                            break;

                        case "Date":
                            Date(
                                columnName: column.Name,
                                value: dataRow[column.ColumnName].ToDateTime());
                            SavedDate(
                                columnName: column.Name,
                                value: Date(columnName: column.Name));
                            break;

                        case "Description":
                            Description(
                                columnName: column.Name,
                                value: dataRow[column.ColumnName].ToString());
                            SavedDescription(
                                columnName: column.Name,
                                value: Description(columnName: column.Name));
                            break;

                        case "Check":
                            Check(
                                columnName: column.Name,
                                value: dataRow[column.ColumnName].ToBool());
                            SavedCheck(
                                columnName: column.Name,
                                value: Check(columnName: column.Name));
                            break;

                        case "Attachments":
                            Attachments(
                                columnName: column.Name,
                                value: dataRow[column.ColumnName].ToString()
                                .Deserialize <Attachments>() ?? new Attachments());
                            SavedAttachments(
                                columnName: column.Name,
                                value: Attachments(columnName: column.Name).ToJson());
                            break;
                        }
                        break;
                    }
                }
            }
        }
示例#45
0
        private void ImportMarcBatch(int batchID)
        {
            BHLProvider provider = new BHLProvider();

            CustomGenericList <Marc> marcs = provider.MarcSelectForImportByBatchID(batchID);

            foreach (Marc marc in marcs)
            {
                Title title = null;

                try
                {
                    title = null;
                    String marcBibId = marc.Leader.Trim().Replace(' ', 'x');

                    if (marc.BhlTitleId == 0)
                    {
                        // Build new title class, populate, and save
                        title                 = provider.MarcSelectTitleDetailsByMarcID(marc.MarcID);
                        title.IsNew           = true;
                        title.InstitutionCode = marc.InstitutionCode;

                        // Grab all of the supporting data (subjects, languages, authors, identifiers, associations)
                        CustomGenericList <TitleTag> titleTags = provider.MarcSelectTitleTagsByMarcID(marc.MarcID);
                        foreach (TitleTag titleTag in titleTags)
                        {
                            titleTag.IsNew = true;
                            title.TitleTags.Add(titleTag);
                        }
                        CustomGenericList <TitleLanguage> titleLanguages = provider.MarcSelectTitleLanguagesByMarcID(marc.MarcID);
                        foreach (TitleLanguage titleLanguage in titleLanguages)
                        {
                            titleLanguage.IsNew = true;
                            title.TitleLanguages.Add(titleLanguage);
                        }
                        CustomGenericList <Title_Creator> titleCreators = provider.MarcSelectCreatorsByMarcID(marc.MarcID);
                        foreach (Title_Creator titleCreator in titleCreators)
                        {
                            titleCreator.IsNew = true;
                            title.TitleCreators.Add(titleCreator);
                        }
                        CustomGenericList <Title_TitleIdentifier> titleIdentifiers = provider.MarcSelectTitleIdentifiersByMarcID(marc.MarcID);
                        foreach (Title_TitleIdentifier titleIdentifier in titleIdentifiers)
                        {
                            titleIdentifier.IsNew = true;
                            title.TitleIdentifiers.Add(titleIdentifier);
                        }
                        CustomGenericList <TitleAssociation> titleAssociations = provider.MarcSelectAssociationsByMarcID(marc.MarcID);
                        foreach (TitleAssociation titleAssociation in titleAssociations)
                        {
                            titleAssociation.IsNew = true;

                            // Get title association title identifiers
                            titleAssociation.TitleAssociationIdentifiers =
                                provider.MarcSelectAssociationIdsByMarcDataFieldID(titleAssociation.MarcDataFieldID);
                            title.TitleAssociations.Add(titleAssociation);
                        }

                        // Save the new title
                        provider.TitleSave(title, 1);

                        // Copy MARC XML file to the appropriate server
                        // - Create new folder in current vault (using MarcBibID as name)
                        // - Copy MARC.XML file to new folder (using MarcBibID as name)
                        MOBOT.BHL.DataObjects.Configuration config = provider.ConfigurationSelectByName(
                            System.Configuration.ConfigurationManager.AppSettings["ConfigNameCurrentIAVault"]);
                        if (config != null)
                        {
                            Vault vault = provider.VaultSelect(Convert.ToInt32(config.ConfigurationValue));
                            if (vault != null)
                            {
                                String destinationFile = vault.OCRFolderShare + "\\" + title.MARCBibID + "\\" + title.MARCBibID + "_marc.xml";
                                provider.GetFileAccessProvider(ConfigurationManager.AppSettings["UseRemoteFileAccessProvider"] == "true").MoveFile(marc.MarcFileLocation, destinationFile);
                            }
                        }

                        _inserted++;
                    }
                    else
                    {
                        // Load existing title and new title information
                        title = provider.TitleSelectExtended(marc.BhlTitleId);
                        Title marcTitle = provider.MarcSelectTitleDetailsByMarcID(marc.MarcID);

                        // Update title values
                        title.MARCLeader                  = marcTitle.MARCLeader;
                        title.FullTitle                   = marcTitle.FullTitle;
                        title.ShortTitle                  = marcTitle.ShortTitle;
                        title.UniformTitle                = marcTitle.UniformTitle;
                        title.SortTitle                   = marcTitle.SortTitle;
                        title.CallNumber                  = marcTitle.CallNumber;
                        title.PublicationDetails          = marcTitle.PublicationDetails;
                        title.StartYear                   = marcTitle.StartYear;
                        title.EndYear                     = marcTitle.EndYear;
                        title.Datafield_260_a             = marcTitle.Datafield_260_a;
                        title.Datafield_260_b             = marcTitle.Datafield_260_b;
                        title.Datafield_260_c             = marcTitle.Datafield_260_c;
                        title.InstitutionCode             = marc.InstitutionCode;
                        title.LanguageCode                = marcTitle.LanguageCode;
                        title.OriginalCatalogingSource    = marcTitle.OriginalCatalogingSource;
                        title.EditionStatement            = marcTitle.EditionStatement;
                        title.CurrentPublicationFrequency = marcTitle.CurrentPublicationFrequency;

                        // Replace all subjects associated with this title
                        foreach (TitleTag titletag in title.TitleTags)
                        {
                            titletag.IsDeleted = true;
                        }

                        CustomGenericList <TitleTag> titleTags = provider.MarcSelectTitleTagsByMarcID(marc.MarcID);
                        foreach (TitleTag titleTag in titleTags)
                        {
                            titleTag.IsNew   = true;
                            titleTag.TitleID = title.TitleID;
                            title.TitleTags.Add(titleTag);
                        }

                        // Replace all languages associated with this title
                        foreach (TitleLanguage titlelanguage in title.TitleLanguages)
                        {
                            titlelanguage.IsDeleted = true;
                        }

                        CustomGenericList <TitleLanguage> titleLanguages = provider.MarcSelectTitleLanguagesByMarcID(marc.MarcID);
                        foreach (TitleLanguage titleLanguage in titleLanguages)
                        {
                            titleLanguage.IsNew   = true;
                            titleLanguage.TitleID = title.TitleID;
                            title.TitleLanguages.Add(titleLanguage);
                        }

                        // Replace all title creators associated with this title
                        foreach (Title_Creator titleCreator in title.TitleCreators)
                        {
                            titleCreator.IsDeleted = true;
                        }

                        CustomGenericList <Title_Creator> titleCreators = provider.MarcSelectCreatorsByMarcID(marc.MarcID);
                        foreach (Title_Creator titleCreator in titleCreators)
                        {
                            titleCreator.IsNew   = true;
                            titleCreator.TitleID = title.TitleID;
                            title.TitleCreators.Add(titleCreator);
                        }

                        // Replace all identifiers associated with this title
                        foreach (Title_TitleIdentifier title_titleidentifier in title.TitleIdentifiers)
                        {
                            title_titleidentifier.IsDeleted = true;
                        }

                        CustomGenericList <Title_TitleIdentifier> titleIdentifiers = provider.MarcSelectTitleIdentifiersByMarcID(marc.MarcID);
                        foreach (Title_TitleIdentifier titleIdentifier in titleIdentifiers)
                        {
                            titleIdentifier.IsNew   = true;
                            titleIdentifier.TitleID = title.TitleID;
                            title.TitleIdentifiers.Add(titleIdentifier);
                        }

                        // Replace all associations associated with this title
                        foreach (TitleAssociation titleAssociation in title.TitleAssociations)
                        {
                            titleAssociation.IsDeleted = true;
                        }

                        CustomGenericList <TitleAssociation> titleAssociations = provider.MarcSelectAssociationsByMarcID(marc.MarcID);
                        foreach (TitleAssociation titleAssociation in titleAssociations)
                        {
                            titleAssociation.IsNew   = true;
                            titleAssociation.TitleID = title.TitleID;
                            titleAssociation.Active  = true;

                            // Get title association title identifiers
                            titleAssociation.TitleAssociationIdentifiers =
                                provider.MarcSelectAssociationIdsByMarcDataFieldID(titleAssociation.MarcDataFieldID);
                            title.TitleAssociations.Add(titleAssociation);
                        }

                        // Update the title
                        provider.TitleSave(title, 1);

                        // Copy MARC XML file to the appropriate location(s)
                        CustomGenericList <PageSummaryView> folders  = provider.PageSummarySelectFoldersForTitleID(title.TitleID);
                        CustomGenericList <PageSummaryView> barcodes = provider.PageSummarySelectBarcodeForTitleID(title.TitleID);

                        // For each folder containing items for this title
                        foreach (PageSummaryView folder in folders)
                        {
                            // Get the files in the folder
                            MOBOT.FileAccess.IFileAccessProvider fileAccess =
                                provider.GetFileAccessProvider(ConfigurationManager.AppSettings["UseRemoteFileAccessProvider"] == "true");
                            String   destinationFolder = folder.OCRFolderShare + "\\" + folder.FileRootFolder;
                            String[] marcXmlFiles      = fileAccess.GetFiles(destinationFolder);

                            // Check each file
                            foreach (String marcXmlFile in marcXmlFiles)
                            {
                                if (marcXmlFile.EndsWith("_marc.xml"))
                                {
                                    // See if any file is related to this title
                                    foreach (PageSummaryView barcode in barcodes)
                                    {
                                        if (marcXmlFile.EndsWith(barcode.BarCode + "_marc.xml"))
                                        {
                                            // Found a match, so replace the file
                                            fileAccess.MoveFile(marcXmlFile, marcXmlFile + "." + System.DateTime.Now.Ticks.ToString());
                                            fileAccess.CopyFile(marc.MarcFileLocation, marcXmlFile, true);
                                            break;
                                        }
                                    }
                                }
                            }
                        }

                        _updated++;
                    }

                    // Update the record to indicate that the import has completed
                    provider.MarcUpdateStatusImported(marc.MarcID);
                }
                catch (Exception ex)
                {
                    // Update the record to indicate the failed import
                    provider.MarcUpdateStatusError(marc.MarcID);

                    if (title != null)
                    {
                        _error.Add("Error loading '" + title.ShortTitle + "': " + ex.Message);
                    }
                    else
                    {
                        _error.Add("Error loading MARC ID " + marc.MarcID.ToString() + ": " + ex.Message);
                    }
                }
            }
        }
示例#46
0
 public Chat()
 {
     InitializeComponent();
     Title = Title.Replace("AssemblyTitle", AssemblyInfo.AssemblyTitle);
 }
示例#47
0
        public void GraphPath()
        {
            chart.BackColor = Properties.Settings.Default.BackColour;
            chart.ChartAreas[0].BackColor = Properties.Settings.Default.BackColour;
            chart.ChartAreas[0].AxisX.ScaleView.ZoomReset();
            chart.ChartAreas[0].AxisY.ScaleView.ZoomReset();
            chart.ChartAreas[0].AxisY.IsReversed = true;

            if (creature_entry == "")
            {
                return;
            }

            if (Properties.Settings.Default.UsingDB == true)
            {
                DataSet DS      = new DataSet();
                string  sqltext = "SELECT `name` FROM `creature_template` WHERE `entry`=";
                sqltext = sqltext + creature_entry + ";";
                DS      = (DataSet)Module.database_conn(sqltext);

                if (DS.Tables["table1"].Rows.Count > 0)
                {
                    creature_name = DS.Tables["table1"].Rows[0][0].ToString();
                    chart.Titles.Clear();
                    Title title = chart.Titles.Add(creature_name + " Entry: " + creature_entry);
                    title.Font      = new System.Drawing.Font("Arial", 16, FontStyle.Bold);
                    title.ForeColor = Properties.Settings.Default.TitleColour;
                }
                else
                {
                    chart.Titles.Clear();
                    Title title = chart.Titles.Add("Entry " + creature_entry + " not in database");
                    title.Font      = new System.Drawing.Font("Arial", 16, FontStyle.Bold);
                    title.ForeColor = Properties.Settings.Default.TitleColour;
                }
            }
            else
            {
                chart.Titles.Clear();
                Title title = chart.Titles.Add("Entry " + creature_entry + " database not connected");
                title.Font      = new System.Drawing.Font("Arial", 16, FontStyle.Bold);
                title.ForeColor = Properties.Settings.Default.TitleColour;
            }

            chart.Series.Clear();
            chart.Series.Add("Path");
            chart.Series["Path"].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point;

            if (Properties.Settings.Default.Lines == true)
            {
                chart.Series.Add("Line");

                if (Properties.Settings.Default.Splines == true)
                {
                    chart.Series["Line"].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Spline;
                }
                else
                {
                    chart.Series["Line"].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
                }
            }

            for (var l = 0; l < gridWaypoint.RowCount; l++)
            {
                Double xpos = Convert.ToDouble(gridWaypoint[1, l].Value);
                Double ypos = Convert.ToDouble(gridWaypoint[2, l].Value);

                chart.Series["Path"].Points.AddXY(xpos, ypos);
                chart.Series["Path"].Points[l].Color = Properties.Settings.Default.PointColour;
                // TODO Add Label Colour to settings
                chart.Series["Path"].Points[l].Label = Convert.ToString(l + 1);

                if (Properties.Settings.Default.Lines == true)
                {
                    chart.Series["Line"].Points.AddXY(xpos, ypos);;
                    chart.Series["Line"].Points[l].Color = Properties.Settings.Default.LineColour;
                }
            }
        }
示例#48
0
 /// <inheritdoc />
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         if (Title != null)
         {
             hashCode = hashCode * 59 + Title.GetHashCode();
         }
         if (Color != null)
         {
             hashCode = hashCode * 59 + Color.GetHashCode();
         }
         if (TickMode != null)
         {
             hashCode = hashCode * 59 + TickMode.GetHashCode();
         }
         if (NTicks != null)
         {
             hashCode = hashCode * 59 + NTicks.GetHashCode();
         }
         if (Tick0 != null)
         {
             hashCode = hashCode * 59 + Tick0.GetHashCode();
         }
         if (DTick != null)
         {
             hashCode = hashCode * 59 + DTick.GetHashCode();
         }
         if (TickVals != null)
         {
             hashCode = hashCode * 59 + TickVals.GetHashCode();
         }
         if (TickText != null)
         {
             hashCode = hashCode * 59 + TickText.GetHashCode();
         }
         if (Ticks != null)
         {
             hashCode = hashCode * 59 + Ticks.GetHashCode();
         }
         if (TickLen != null)
         {
             hashCode = hashCode * 59 + TickLen.GetHashCode();
         }
         if (TickWidth != null)
         {
             hashCode = hashCode * 59 + TickWidth.GetHashCode();
         }
         if (TickColor != null)
         {
             hashCode = hashCode * 59 + TickColor.GetHashCode();
         }
         if (ShowTickLabels != null)
         {
             hashCode = hashCode * 59 + ShowTickLabels.GetHashCode();
         }
         if (ShowTickPrefix != null)
         {
             hashCode = hashCode * 59 + ShowTickPrefix.GetHashCode();
         }
         if (TickPrefix != null)
         {
             hashCode = hashCode * 59 + TickPrefix.GetHashCode();
         }
         if (ShowTickSuffix != null)
         {
             hashCode = hashCode * 59 + ShowTickSuffix.GetHashCode();
         }
         if (TickSuffix != null)
         {
             hashCode = hashCode * 59 + TickSuffix.GetHashCode();
         }
         if (ShowExponent != null)
         {
             hashCode = hashCode * 59 + ShowExponent.GetHashCode();
         }
         if (ExponentFormat != null)
         {
             hashCode = hashCode * 59 + ExponentFormat.GetHashCode();
         }
         if (MinExponent != null)
         {
             hashCode = hashCode * 59 + MinExponent.GetHashCode();
         }
         if (SeparateThousands != null)
         {
             hashCode = hashCode * 59 + SeparateThousands.GetHashCode();
         }
         if (TickFont != null)
         {
             hashCode = hashCode * 59 + TickFont.GetHashCode();
         }
         if (TickAngle != null)
         {
             hashCode = hashCode * 59 + TickAngle.GetHashCode();
         }
         if (TickFormat != null)
         {
             hashCode = hashCode * 59 + TickFormat.GetHashCode();
         }
         if (TickFormatStops != null)
         {
             hashCode = hashCode * 59 + TickFormatStops.GetHashCode();
         }
         if (HoverFormat != null)
         {
             hashCode = hashCode * 59 + HoverFormat.GetHashCode();
         }
         if (ShowLine != null)
         {
             hashCode = hashCode * 59 + ShowLine.GetHashCode();
         }
         if (LineColor != null)
         {
             hashCode = hashCode * 59 + LineColor.GetHashCode();
         }
         if (LineWidth != null)
         {
             hashCode = hashCode * 59 + LineWidth.GetHashCode();
         }
         if (ShowGrid != null)
         {
             hashCode = hashCode * 59 + ShowGrid.GetHashCode();
         }
         if (GridColor != null)
         {
             hashCode = hashCode * 59 + GridColor.GetHashCode();
         }
         if (GridWidth != null)
         {
             hashCode = hashCode * 59 + GridWidth.GetHashCode();
         }
         if (Layer != null)
         {
             hashCode = hashCode * 59 + Layer.GetHashCode();
         }
         if (UiRevision != null)
         {
             hashCode = hashCode * 59 + UiRevision.GetHashCode();
         }
         if (TickValsSrc != null)
         {
             hashCode = hashCode * 59 + TickValsSrc.GetHashCode();
         }
         if (TickTextSrc != null)
         {
             hashCode = hashCode * 59 + TickTextSrc.GetHashCode();
         }
         return(hashCode);
     }
 }
示例#49
0
        private void Init()
        {
            // Configure remote logging
            RemoteLogger.SetTag("game", Title.ToLower());
            RemoteLogger.SetTag("version", NetworkController.NetManager_.get_GAME_VERSION);

            // Register messages for localization
            lang.RegisterMessages(messages, this);

            // Add general commands
            //cmdlib.AddChatCommand("oxide.plugins", this, "ChatPlugins");
            //cmdlib.AddChatCommand("plugins", this, "ChatPlugins");
            cmdlib.AddChatCommand("oxide.load", this, "ChatLoad");
            cmdlib.AddChatCommand("load", this, "ChatLoad");
            cmdlib.AddChatCommand("oxide.unload", this, "ChatUnload");
            cmdlib.AddChatCommand("unload", this, "ChatUnload");
            cmdlib.AddChatCommand("oxide.reload", this, "ChatReload");
            cmdlib.AddChatCommand("reload", this, "ChatReload");
            cmdlib.AddChatCommand("oxide.version", this, "ChatVersion");
            cmdlib.AddChatCommand("version", this, "ChatVersion");
            cmdlib.AddConsoleCommand("oxide.version", this, "ConsoleVersion");
            cmdlib.AddConsoleCommand("version", this, "ConsoleVersion");
            cmdlib.AddConsoleCommand("quit", this, "ConsoleQuit");
            cmdlib.AddConsoleCommand("shutdown", this, "ConsoleQuit");

            // Add permission commands
            cmdlib.AddChatCommand("oxide.group", this, "ChatGroup");
            cmdlib.AddChatCommand("group", this, "ChatGroup");
            cmdlib.AddChatCommand("oxide.usergroup", this, "ChatUserGroup");
            cmdlib.AddChatCommand("usergroup", this, "ChatUserGroup");
            cmdlib.AddChatCommand("oxide.grant", this, "ChatGrant");
            cmdlib.AddChatCommand("grant", this, "ChatGrant");
            cmdlib.AddChatCommand("oxide.revoke", this, "ChatRevoke");
            cmdlib.AddChatCommand("revoke", this, "ChatRevoke");
            cmdlib.AddChatCommand("oxide.show", this, "ChatShow");
            cmdlib.AddChatCommand("show", this, "ChatShow");

            // Setup the default permission groups
            if (permission.IsLoaded)
            {
                var rank = 0;
                for (var i = DefaultGroups.Length - 1; i >= 0; i--)
                {
                    var defaultGroup = DefaultGroups[i];
                    if (!permission.GroupExists(defaultGroup))
                    {
                        permission.CreateGroup(defaultGroup, defaultGroup, rank++);
                    }
                }
                permission.RegisterValidate(s =>
                {
                    ulong temp;
                    if (!ulong.TryParse(s, out temp))
                    {
                        return(false);
                    }
                    var digits = temp == 0 ? 1 : (int)Math.Floor(Math.Log10(temp) + 1);
                    return(digits >= 17);
                });
                permission.CleanUp();
            }
        }
示例#50
0
 protected virtual void CustomizeChartTitle(Title title)
 {
 }
示例#51
0
        public void LoadDVD(Title dvd)
        {
            /*BinaryFormatter formatter = new BinaryFormatter();
             * using (MemoryStream stream = new MemoryStream())
             * {
             *  formatter.Serialize(stream, dvd);
             *  stream.Position = 0;
             *  _dvdTitle = (Title)formatter.Deserialize(stream);
             * }*/
            _dvdTitle              = dvd;
            _isLoading             = true;
            titleSource.DataSource = _dvdTitle;
            Status = TitleStatus.Normal;

            cbTitleType.Properties.Items.Clear();

            // Disable certain functions if title is a folder
            if ((_dvdTitle.TitleType & TitleTypes.AllFolders) != 0)
            {
                btnDisks.Enabled = false;

                // Setup titletype combo
                foreach (int titletype in Enum.GetValues(typeof(TitleTypes)))
                {
                    if (((titletype & (int)TitleTypes.AllFolders) != 0) &&
                        ((titletype & (int)TitleTypes.AllFolders) != (int)TitleTypes.AllFolders))
                    {
                        cbTitleType.Properties.Items.Add(Enum.GetName(typeof(TitleTypes), titletype));
                        if (((int)_dvdTitle.TitleType & titletype) != 0)
                        {
                            cbTitleType.SelectedItem = Enum.GetName(typeof(TitleTypes), titletype);
                        }
                    }
                }
            }

            if ((_dvdTitle.TitleType & TitleTypes.AllMedia) != 0)
            {
                btnDisks.Enabled = true;

                // Setup titletype combo
                foreach (int titletype in Enum.GetValues(typeof(TitleTypes)))
                {
                    if (((titletype & (int)TitleTypes.AllMedia) != 0) &&
                        ((titletype & (int)TitleTypes.AllMedia) != (int)TitleTypes.AllMedia))
                    {
                        cbTitleType.Properties.Items.Add(Enum.GetName(typeof(TitleTypes), titletype));
                        if (((int)_dvdTitle.TitleType & titletype) != 0)
                        {
                            cbTitleType.SelectedItem = Enum.GetName(typeof(TitleTypes), titletype);
                        }
                    }
                }
            }
            // todo : solomon : i'm not sure what this code is for but it's crashing right now if you delete a cover image
            //imageWatcherFront.Path = Path.GetDirectoryName(_dvdTitle.FrontCoverPath);
            //imageWatcherFront.Filter = "F*.jpg";

            DrawUserRating((int)_dvdTitle.UserStarRating);

            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(TitleEditor));

            if (!File.Exists(_dvdTitle.FrontCoverPath))
            {
                this.pbFrontCover.Image = ((System.Drawing.Image)(resources.GetObject("pbFrontCover.Image")));
            }

            if (!File.Exists(_dvdTitle.BackCoverPath))
            {
                this.pbBackCover.Image = ((System.Drawing.Image)(resources.GetObject("pbFrontCover.Image")));
            }

            LoadBackdrops();
            _isLoading = false;
        }
示例#52
0
        /// <inheritdoc />
        public bool Equals([AllowNull] AAxis other)
        {
            if (other == null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Title == other.Title ||
                     Title != null &&
                     Title.Equals(other.Title)
                     ) &&
                 (
                     Color == other.Color ||
                     Color != null &&
                     Color.Equals(other.Color)
                 ) &&
                 (
                     TickMode == other.TickMode ||
                     TickMode != null &&
                     TickMode.Equals(other.TickMode)
                 ) &&
                 (
                     NTicks == other.NTicks ||
                     NTicks != null &&
                     NTicks.Equals(other.NTicks)
                 ) &&
                 (
                     Tick0 == other.Tick0 ||
                     Tick0 != null &&
                     Tick0.Equals(other.Tick0)
                 ) &&
                 (
                     DTick == other.DTick ||
                     DTick != null &&
                     DTick.Equals(other.DTick)
                 ) &&
                 (
                     Equals(TickVals, other.TickVals) ||
                     TickVals != null && other.TickVals != null &&
                     TickVals.SequenceEqual(other.TickVals)
                 ) &&
                 (
                     Equals(TickText, other.TickText) ||
                     TickText != null && other.TickText != null &&
                     TickText.SequenceEqual(other.TickText)
                 ) &&
                 (
                     Ticks == other.Ticks ||
                     Ticks != null &&
                     Ticks.Equals(other.Ticks)
                 ) &&
                 (
                     TickLen == other.TickLen ||
                     TickLen != null &&
                     TickLen.Equals(other.TickLen)
                 ) &&
                 (
                     TickWidth == other.TickWidth ||
                     TickWidth != null &&
                     TickWidth.Equals(other.TickWidth)
                 ) &&
                 (
                     TickColor == other.TickColor ||
                     TickColor != null &&
                     TickColor.Equals(other.TickColor)
                 ) &&
                 (
                     ShowTickLabels == other.ShowTickLabels ||
                     ShowTickLabels != null &&
                     ShowTickLabels.Equals(other.ShowTickLabels)
                 ) &&
                 (
                     ShowTickPrefix == other.ShowTickPrefix ||
                     ShowTickPrefix != null &&
                     ShowTickPrefix.Equals(other.ShowTickPrefix)
                 ) &&
                 (
                     TickPrefix == other.TickPrefix ||
                     TickPrefix != null &&
                     TickPrefix.Equals(other.TickPrefix)
                 ) &&
                 (
                     ShowTickSuffix == other.ShowTickSuffix ||
                     ShowTickSuffix != null &&
                     ShowTickSuffix.Equals(other.ShowTickSuffix)
                 ) &&
                 (
                     TickSuffix == other.TickSuffix ||
                     TickSuffix != null &&
                     TickSuffix.Equals(other.TickSuffix)
                 ) &&
                 (
                     ShowExponent == other.ShowExponent ||
                     ShowExponent != null &&
                     ShowExponent.Equals(other.ShowExponent)
                 ) &&
                 (
                     ExponentFormat == other.ExponentFormat ||
                     ExponentFormat != null &&
                     ExponentFormat.Equals(other.ExponentFormat)
                 ) &&
                 (
                     MinExponent == other.MinExponent ||
                     MinExponent != null &&
                     MinExponent.Equals(other.MinExponent)
                 ) &&
                 (
                     SeparateThousands == other.SeparateThousands ||
                     SeparateThousands != null &&
                     SeparateThousands.Equals(other.SeparateThousands)
                 ) &&
                 (
                     TickFont == other.TickFont ||
                     TickFont != null &&
                     TickFont.Equals(other.TickFont)
                 ) &&
                 (
                     TickAngle == other.TickAngle ||
                     TickAngle != null &&
                     TickAngle.Equals(other.TickAngle)
                 ) &&
                 (
                     TickFormat == other.TickFormat ||
                     TickFormat != null &&
                     TickFormat.Equals(other.TickFormat)
                 ) &&
                 (
                     Equals(TickFormatStops, other.TickFormatStops) ||
                     TickFormatStops != null && other.TickFormatStops != null &&
                     TickFormatStops.SequenceEqual(other.TickFormatStops)
                 ) &&
                 (
                     HoverFormat == other.HoverFormat ||
                     HoverFormat != null &&
                     HoverFormat.Equals(other.HoverFormat)
                 ) &&
                 (
                     ShowLine == other.ShowLine ||
                     ShowLine != null &&
                     ShowLine.Equals(other.ShowLine)
                 ) &&
                 (
                     LineColor == other.LineColor ||
                     LineColor != null &&
                     LineColor.Equals(other.LineColor)
                 ) &&
                 (
                     LineWidth == other.LineWidth ||
                     LineWidth != null &&
                     LineWidth.Equals(other.LineWidth)
                 ) &&
                 (
                     ShowGrid == other.ShowGrid ||
                     ShowGrid != null &&
                     ShowGrid.Equals(other.ShowGrid)
                 ) &&
                 (
                     GridColor == other.GridColor ||
                     GridColor != null &&
                     GridColor.Equals(other.GridColor)
                 ) &&
                 (
                     GridWidth == other.GridWidth ||
                     GridWidth != null &&
                     GridWidth.Equals(other.GridWidth)
                 ) &&
                 (
                     Layer == other.Layer ||
                     Layer != null &&
                     Layer.Equals(other.Layer)
                 ) &&
                 (
                     UiRevision == other.UiRevision ||
                     UiRevision != null &&
                     UiRevision.Equals(other.UiRevision)
                 ) &&
                 (
                     TickValsSrc == other.TickValsSrc ||
                     TickValsSrc != null &&
                     TickValsSrc.Equals(other.TickValsSrc)
                 ) &&
                 (
                     TickTextSrc == other.TickTextSrc ||
                     TickTextSrc != null &&
                     TickTextSrc.Equals(other.TickTextSrc)
                 ));
        }
示例#53
0
 public override Int32 GetHashCode()
 {
     return(Title.GetHashCode());
 }
示例#54
0
 public void SetSource(Source source, Title title, Preset preset, EncodeTask task)
 {
     this.CurrentTask = task;
 }
示例#55
0
        private void Set(
            Context context,
            SiteSettings ss,
            DataRow dataRow,
            string tableAlias)
        {
            foreach (DataColumn dataColumn in dataRow.Table.Columns)
            {
                var column = new ColumnNameInfo(dataColumn.ColumnName);
                if (column.TableAlias == tableAlias)
                {
                    switch (column.Name)
                    {
                    case "SiteId":
                        SiteId = dataRow[column.ColumnName].ToLong();
                        break;

                    case "IssueId":
                        IssueId = dataRow[column.ColumnName].ToLong();
                        break;

                    case "Ver":
                        Ver = dataRow[column.ColumnName].ToInt();
                        break;

                    case "Title":
                        Title = new Title(context: context, ss: ss, dataRow: dataRow, column: column);
                        break;

                    case "Body":
                        Body = dataRow[column.ColumnName].ToString();
                        break;

                    case "StartTime":
                        StartTime = dataRow[column.ColumnName].ToDateTime();
                        break;

                    case "CompletionTime":
                        CompletionTime = new CompletionTime(context: context, ss: ss, dataRow: dataRow, column: column);
                        break;

                    case "WorkValue":
                        WorkValue = new WorkValue(dataRow, column);
                        break;

                    case "ProgressRate":
                        ProgressRate = new ProgressRate(dataRow, column);
                        break;

                    case "RemainingWorkValue":
                        RemainingWorkValue = dataRow[column.ColumnName].ToDecimal();
                        break;

                    case "Status":
                        Status = new Status(dataRow, column);
                        break;

                    case "Manager":
                        Manager = SiteInfo.User(context: context, userId: dataRow.Int(column.ColumnName));
                        break;

                    case "Owner":
                        Owner = SiteInfo.User(context: context, userId: dataRow.Int(column.ColumnName));
                        break;

                    case "Locked":
                        Locked = dataRow[column.ColumnName].ToBool();
                        break;

                    case "Comments":
                        Comments = dataRow[column.ColumnName].ToString().Deserialize <Comments>() ?? new Comments();
                        break;

                    case "Creator":
                        Creator = SiteInfo.User(context: context, userId: dataRow.Int(column.ColumnName));
                        break;

                    case "Updator":
                        Updator = SiteInfo.User(context: context, userId: dataRow.Int(column.ColumnName));
                        break;

                    case "CreatedTime":
                        CreatedTime = new Time(context, dataRow, column.ColumnName);
                        break;

                    default:
                        switch (Def.ExtendedColumnTypes.Get(column.Name))
                        {
                        case "Class":
                            Class(
                                columnName: column.Name,
                                value: dataRow[column.ColumnName].ToString());
                            break;

                        case "Num":
                            Num(
                                columnName: column.Name,
                                value: dataRow[column.ColumnName].ToDecimal());
                            break;

                        case "Date":
                            Date(
                                columnName: column.Name,
                                value: dataRow[column.ColumnName].ToDateTime());
                            break;

                        case "Description":
                            Description(
                                columnName: column.Name,
                                value: dataRow[column.ColumnName].ToString());
                            break;

                        case "Check":
                            Check(
                                columnName: column.Name,
                                value: dataRow[column.ColumnName].ToBool());
                            break;
                        }
                        break;
                    }
                }
            }
        }
示例#56
0
 public static void Id_is_positive(Title actual) =>
 Assert.InRange(actual.Id, 1, int.MaxValue);
示例#57
0
        internal void EnterShareSkill()
        {
            int rows;

            rows = GlobalDefinitions.ExcelLib.NumberofRows(@"C:\Users\JIJI\source\repos\marsframework-master\MarsFramework\ExcelData\TestDataShareSkill.xlsx", "ShareSkill");
            //Populate the excel data
            GlobalDefinitions.ExcelLib.PopulateInCollection(@"C:\Users\JIJI\source\repos\marsframework-master\MarsFramework\ExcelData\TestDataShareSkill.xlsx", "ShareSkill");
            Thread.Sleep(1500);

            for (int i = 2; i <= rows + 1; i++)
            {
                Thread.Sleep(1500);
                //Click on Share Skill
                ShareSkillButton.Click();
                //Enter Title
                Thread.Sleep(3500);
                Title.SendKeys(GlobalDefinitions.ExcelLib.ReadData(i, "Title"));
                //Enter Description
                Description.SendKeys(GlobalDefinitions.ExcelLib.ReadData(i, "Description"));
                //Enter Category
                CategoryDropDown.SendKeys(GlobalDefinitions.ExcelLib.ReadData(i, "Category"));
                //Enter Sub-Category
                SubCategoryDropDown.SendKeys(GlobalDefinitions.ExcelLib.ReadData(i, "SubCategory"));
                //Enter Tags
                Tags.SendKeys(GlobalDefinitions.ExcelLib.ReadData(i, "Tags"));
                Tags.SendKeys(Keys.Enter);
                //Enter ServiceType
                String Service = GlobalDefinitions.ExcelLib.ReadData(i, "ServiceType");
                if (Service == "One-off service")
                {
                    ServiceTypeOptions.FindElement(By.XPath("/ html / body / div / div / div[1] / div[2] / div / form / div[5] / div[2] / div[1] / div[2] / div / input")).Click();
                }
                else
                {
                    ServiceTypeOptions.FindElement(By.XPath("/html/body/div/div/div[1]/div[2]/div/form/div[5]/div[2]/div[1]/div[1]/div/input")).Click();
                }
                //Enter LocationType
                String LocationType = GlobalDefinitions.ExcelLib.ReadData(i, "LocationType");
                if (LocationType == "On-site")
                {
                    LocationTypeOption.FindElement(By.XPath("/html/body/div/div/div[1]/div[2]/div/form/div[6]/div[2]/div/div[1]/div/input")).Click();
                }
                else
                {
                    LocationTypeOption.FindElement(By.XPath("/html/body/div/div/div[1]/div[2]/div/form/div[6]/div[2]/div/div[2]/div/input")).Click();
                }
                //Enter Startdate

                //StartDateDropDown.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Startdate").ToString());
                //Enter Enddate
                // EndDateDropDown.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Enddate"));
                //Enter Selectday
                // String Day=GlobalDefinitions.ExcelLib.ReadData(2, "Selectday");
                //if(Day== "Sun")
                //{
                //    Days.FindElement(By.XPath("/html/body/div/div/div[1]/div[2]/div/form/div[7]/div[2]/div[1]/div[2]/div[1]/div/input")).Click();
                //}
                //else if(Day=="Mon")
                //{
                //    Days.FindElement(By.XPath("/html/body/div/div/div[1]/div[2]/div/form/div[7]/div[2]/div[1]/div[3]/div[1]/div/input")).Click();
                // }
                //else if (Day == "Tue")
                //{
                //    Days.FindElement(By.XPath("/html/body/div/div/div[1]/div[2]/div/form/div[7]/div[2]/div[1]/div[4]/div[1]/div/input")).Click();
                //}
                //else if (Day == "Wed")
                //{
                //    Days.FindElement(By.XPath("/html/body/div/div/div[1]/div[2]/div/form/div[7]/div[2]/div[1]/div[5]/div[1]/div/input")).Click();
                //}
                //else if (Day == "Thu")
                //{
                //    Days.FindElement(By.XPath("/html/body/div/div/div[1]/div[2]/div/form/div[7]/div[2]/div[1]/div[6]/div[1]/div/input")).Click();
                //}
                //else if (Day == "Fri")
                //{
                //    Days.FindElement(By.XPath("/html/body/div/div/div[1]/div[2]/div/form/div[7]/div[2]/div[1]/div[7]/div[1]/div/input")).Click();
                //}
                //else if (Day == "Sat")
                //{
                //    Days.FindElement(By.XPath("/html/body/div/div/div[1]/div[2]/div/form/div[7]/div[2]/div[1]/div[8]/div[1]/div/input")).Click();
                //}

                //Enter Starttime
                // StartTimeDropDown.SendKeys(GlobalDefinitions.ExcelLib.ReadData(i, "Starttime"));
                //Enter Endtime
                // EndTimeDropDown.SendKeys(GlobalDefinitions.ExcelLib.ReadData(i, "Endtime"));
                //Enter SkillTrade
                string SkillTrade = GlobalDefinitions.ExcelLib.ReadData(i, "SkillTrade");
                if (SkillTrade == "Skill-Exchange")
                {
                    SkillTradeOption.FindElement(By.XPath("/html/body/div/div/div[1]/div[2]/div/form/div[8]/div[2]/div/div[1]/div/label")).Click();
                }
                else
                {
                    SkillTradeOption.FindElement(By.XPath("/html/body/div/div/div[1]/div[2]/div/form/div[8]/div[2]/div/div[2]/div/label")).Click();
                }
                //Enter Skill-Exchange
                SkillExchange.SendKeys(GlobalDefinitions.ExcelLib.ReadData(i, "Skill-Exchange"));
                SkillExchange.SendKeys(Keys.Enter);
                //Enter Credit
                if (SkillExchange.Text == "Credit")
                {
                    CreditAmount.SendKeys(GlobalDefinitions.ExcelLib.ReadData(i, "Credit"));
                }
                ////Work Sample
                Driver.FindElement(By.XPath("/html/body/div/div/div[1]/div[2]/div/form/div[9]/div/div[2]/section/div/label/div/span/i")).Click();
                AutoItX3 autoit = new AutoItX3();
                autoit.WinActivate("Open");
                Thread.Sleep(1500);
                autoit.ControlSetText("Open", "", "Edit1", StrSendText);
                autoit.ControlClick("Open", "", "Button1");


                //Enter Active
                string Active = GlobalDefinitions.ExcelLib.ReadData(i, "Active");
                if (Active == "Active")
                {
                    ActiveOption.FindElement(By.XPath("/html/body/div/div/div[1]/div[2]/div/form/div[10]/div[2]/div/div[1]/div/input")).Click();
                }
                else
                {
                    ActiveOption.FindElement(By.XPath("/html/body/div/div/div[1]/div[2]/div/form/div[10]/div[2]/div/div[2]/div/input")).Click();
                }
                //Click on save
                Save.Click();
                Thread.Sleep(1500);
            }
        }
示例#58
0
 //Methods
 public override string ToString()
 {
     return(Title.ToString() + ": Physcial Book");
 }
        public void EnterDetails(Table table)
        {
            foreach (var row in table.Rows)
            {
                switch (row[0].ToLower())
                {
                case "approved":
                    var approved = Convert.ToBoolean(row[1]);
                    if ((Approved.Selected && !approved) || (!Approved.Selected && approved))
                    {
                        Approved.Click();
                    }
                    break;

                case "emailverified":
                    var emailVerified = Convert.ToBoolean(row[1]);
                    if ((EmailVerified.Selected && !emailVerified) || (!EmailVerified.Selected && emailVerified))
                    {
                        EmailVerified.Click();
                    }
                    break;

                case "enabled":
                    var enabled = Convert.ToBoolean(row[1]);
                    if ((Enabled.Selected && !enabled) || (!Enabled.Selected && enabled))
                    {
                        Enabled.Click();
                    }
                    break;

                case "firstname":
                    FirstName.Clear();
                    FirstName.SendKeys(row[1]);
                    break;

                case "lastname":
                    LastName.Clear();
                    LastName.SendKeys(row[1]);
                    break;

                case "postcode":
                    PostCode.Clear();
                    PostCode.SendKeys(row[1]);
                    break;

                case "skypename":
                    SkypeName.Clear();
                    SkypeName.SendKeys(row[1]);
                    break;

                case "hometelephonenumber":
                    TelNoHome.Clear();
                    TelNoHome.SendKeys(row[1]);
                    break;

                case "mobiletelephonenumber":
                    TelNoMobile.Clear();
                    TelNoMobile.SendKeys(row[1]);
                    break;

                case "worktelephonenumber":
                    TelNoWork.Clear();
                    TelNoWork.SendKeys(row[1]);
                    break;

                case "title":
                    Title.Clear();
                    Title.SendKeys(row[1]);
                    break;

                case "town":
                    Town.Clear();
                    Town.SendKeys(row[1]);
                    break;

                default:
                    throw new Exception(string.Format("Field {0} not defined", row[0]));
                }
            }
        }
        /// <summary>
        /// 初始化图表
        /// </summary>
        private void InitChart()
        {
            //定义图表区域
            ChartArea chartArea = new ChartArea("C1");

            //设置图表显示样式
            chartArea.AxisX.Minimum = 0;
            //chartArea.AxisX.Interval = 5;
            chartArea.AxisX.Interval            = 10;
            chartArea.AxisY.Minimum             = -4;
            chartArea.AxisY.Maximum             = 52; //网格测距最大值为60
            chartArea.AxisY.Interval            = 2;
            chartArea.AxisX.MajorGrid.LineColor = Color.Silver;
            chartArea.AxisY.MajorGrid.LineColor = Color.Silver;
            Series seriesLeftFront = new Series("LeftFront")
            {
                ChartArea = "C1", Color = Color.Red, ChartType = SeriesChartType.Line
            }, seriesLeftMiddle = new Series("LeftMiddle")
            {
                ChartArea = "C1", Color = Color.Blue, ChartType = SeriesChartType.Line
            }, seriesLeftBack = new Series("LeftBack")
            {
                ChartArea = "C1", Color = Color.Orange, ChartType = SeriesChartType.Line
            }, seriesRightFront = new Series("RightFront")
            {
                ChartArea = "C1", Color = Color.Black, ChartType = SeriesChartType.Line
            }, seriesRightMiddle = new Series("RightMiddle")
            {
                ChartArea = "C1", Color = Color.Green, ChartType = SeriesChartType.Line
            }, seriesRightBack = new Series("RightBack")
            {
                ChartArea = "C1", Color = Color.Purple, ChartType = SeriesChartType.Line
            };
            Legend legendLeftFront = new Legend("左前")
            {
                ForeColor = Color.Red
            }, legendLeftMiddle = new Legend("左中")
            {
                ForeColor = Color.Blue
            }, legendLeftBack = new Legend("左后")
            {
                ForeColor = Color.Orange
            }, legendRightFront = new Legend("右前")
            {
                ForeColor = Color.Black
            }, legendRightMiddle = new Legend("右中")
            {
                ForeColor = Color.Green
            }, legendRightBack = new Legend("右后")
            {
                ForeColor = Color.Purple
            };
            Title title = new Title("网格测距折线图", Docking.Top, new Font("Microsoft Sans Serif", 12F), Color.RoyalBlue);

            this.chart1.ChartAreas.Clear();
            this.chart1.ChartAreas.Add(chartArea);
            //Series
            this.chart1.Series.Clear();
            this.chart1.Series.Add(seriesLeftFront);
            this.chart1.Series.Add(seriesLeftMiddle);
            this.chart1.Series.Add(seriesLeftBack);
            this.chart1.Series.Add(seriesRightFront);
            this.chart1.Series.Add(seriesRightMiddle);
            this.chart1.Series.Add(seriesRightBack);
            //Legends
            this.chart1.Legends.Clear();
            this.chart1.Legends.Add(legendLeftFront);
            this.chart1.Legends.Add(legendLeftMiddle);
            this.chart1.Legends.Add(legendLeftBack);
            this.chart1.Legends.Add(legendRightFront);
            this.chart1.Legends.Add(legendRightMiddle);
            this.chart1.Legends.Add(legendRightBack);
            //设置标题
            this.chart1.Titles.Clear();
            this.chart1.Titles.Add(title);
        }