示例#1
0
        public MenuButton[] GetMenuItems(SessionProfile sessionProfile)
        {
            var xyPlotSeq = new MenuButton(sessionProfile.CurrentLanguage.Abbr == "RUS" ? "X-Y График" : "X-Y Plot Seq Marching")
            {
                Behavior = MenuButtonBehavior.DisableWhenInsideRegion,
                Icon     = Graphics.Specifics.BitmapFromNativeImage(Resources.menuIcon),
                Action   = args => args.CurrentRegion = CreateNew(args.SessionProfile)
            };

            var plotMenu = new MenuButton(sessionProfile.CurrentLanguage.StringsGUI[151]);

            plotMenu.AppendChild(xyPlotSeq);

            return(new[] { plotMenu });
        }
示例#2
0
        public FormFormat(XYPlotSeq region, SessionProfile sessionProfile, EnChartElement element)
        {
            InitializeComponent();

            _region  = region;
            _element = element;

            var cult = Thread.CurrentThread.CurrentCulture;

            Thread.CurrentThread.CurrentCulture = new CultureInfo(cult.IetfLanguageTag)
            {
                NumberFormat = { NumberDecimalSeparator = sessionProfile.DecimalSymbol.ToString() }
            };

            MyCollectionEditor.MyPropertyValueChanged += propertyGrid1_PropertyValueChanged;
        }
示例#3
0
        /*
         *  Configure services.
         */
        public void ConfigureServices(IServiceCollection services)
        {
            // Add MVC services.
            services.AddMvc();

            // Add Db context service for Application and provide connection string.
            services.AddDbContext <ApplicationDbContext>
                (options => options.UseSqlServer(Configuration["Data:Profile:ConnectionString"]));

            // Add Db context service for Identity and provide connection string.
            services.AddDbContext <AppIdentityDbContext>
                (options => options.UseSqlServer(Configuration["Data:Identity:ConnectionString"]));

            // Add Identity service, configure options, and add EF stores for user storage.
            // This is another layer of validation.
            services.AddIdentity <IdentityUser, IdentityRole>(
                opts =>
            {
                opts.Password.RequiredLength         = 4;
                opts.Password.RequireDigit           = false;
                opts.Password.RequireUppercase       = false;
                opts.Password.RequireNonAlphanumeric = false;
            })
            .AddEntityFrameworkStores <AppIdentityDbContext>();

            // Dependency injection for repositories.
            services.AddTransient <IProfileRepository, EFProfileRepository>();
            services.AddTransient <IPostRepository, EFPostRepository>();
            services.AddTransient <IImageRepository, EFImageRepository>();
            services.AddTransient <IFriendRepository, EFFriendRepository>();
            services.AddTransient <ICommentRepository, EFCommentRepository>();
            services.AddTransient <ILikeRepository, EFLikeRepository>();

            // This service is used in most controllers to verify the user.
            services.AddScoped <CurrentProfile>(sp => SessionProfile.GetCurrentProfile(sp));
            services.AddScoped <SessionResults>(sp => SessionResults.GetSessionResults(sp));
            services.AddSingleton <IHttpContextAccessor, HttpContextAccessor>();

            services.AddMemoryCache();
            services.AddSession();
        }
        public TermInfo[] GetTermsHandled(SessionProfile sessionProfile)
        {
            //functions definitions
            return(new TermInfo[]
            {
                new TermInfo("list", TermType.Function,
                             "Возвращает нулевой вектор заданной ('число') размерности.",
                             FunctionSections.MatricesAndVectors, true,
                             new ArgumentInfo(ArgumentSections.RealNumber)),

                new TermInfo("listDistinct", TermType.Function,
                             "Возвращает вектор уникальных значений, содержащихся в ('матрица').",
                             FunctionSections.MatricesAndVectors, true,
                             new ArgumentInfo(ArgumentSections.Matrix)),

                new TermInfo("listSortAsText", TermType.Function,
                             "Возвращает сортированный вектор значений, содержащихся в ('матрица').",
                             FunctionSections.MatricesAndVectors, true,
                             new ArgumentInfo(ArgumentSections.Matrix)),

                new TermInfo("listLength", TermType.Function,
                             "Возвращает длину вектора ('вектор').",
                             FunctionSections.MatricesAndVectors, true,
                             new ArgumentInfo(ArgumentSections.ColumnVector)),

                new TermInfo("listNonZeros", TermType.Function,
                             "Возвращает вектор не нулевых значений, содержащихся в ('матрица').",
                             FunctionSections.MatricesAndVectors, true,
                             new ArgumentInfo(ArgumentSections.Matrix)),

                //new TermInfo("listDistinct", TermType.Function,
                //"Возвращает вектор или вектор-строку уникальных значений, содержащихся в ('матрица'), а" +
                //" ('число') указывает на вид возвращаемого вектора: 0 - вектор; 1 - вектор-строка.",
                //FunctionSections.MatricesAndVectors, true,
                //new ArgumentInfo(ArgumentSections.Matrix), new ArgumentInfo(ArgumentSections.RealNumber)),

                new TermInfo("listAdd", TermType.Function,
                             "Добавление нового значения ('аргумент') в конец вектора ('вектор').",
                             FunctionSections.MatricesAndVectors, true,
                             new ArgumentInfo(ArgumentSections.ColumnVector), new ArgumentInfo(ArgumentSections.Default)),

                new TermInfo("listInsert", TermType.Function,
                             "Добавление нового значения ('аргумент') в вектор ('вектор') по указанному индексу ('число').",
                             FunctionSections.MatricesAndVectors, true,
                             new ArgumentInfo(ArgumentSections.ColumnVector), new ArgumentInfo(ArgumentSections.Default),
                             new ArgumentInfo(ArgumentSections.RealNumber)),

                new TermInfo("listInsertRange", TermType.Function,
                             "Добавление нового диапазона значений ('3:вектор') в вектор ('1:вектор') по указанному индексу ('число').",
                             FunctionSections.MatricesAndVectors, true,
                             new ArgumentInfo(ArgumentSections.ColumnVector), new ArgumentInfo(ArgumentSections.RealNumber),
                             new ArgumentInfo(ArgumentSections.ColumnVector)),

                new TermInfo("listRemoveAt", TermType.Function,
                             "Удаление элемента вектора ('вектор') по указанному индексу ('число').",
                             FunctionSections.MatricesAndVectors, true,
                             new ArgumentInfo(ArgumentSections.ColumnVector), new ArgumentInfo(ArgumentSections.RealNumber)),

                new TermInfo("listRemoveRange", TermType.Function,
                             "Удаление диапазона элементов вектора ('1:вектор') по указанному индексу начала ('2:число') и количеству ('3:число') значений удаляемого диапазона.",
                             FunctionSections.MatricesAndVectors, true,
                             new ArgumentInfo(ArgumentSections.ColumnVector), new ArgumentInfo(ArgumentSections.RealNumber),
                             new ArgumentInfo(ArgumentSections.RealNumber)),

                new TermInfo("insertRows", TermType.Function,
                             "Вставка заданного количества ('3:число') нулевых строк в матрицу ('матрица') по указанному индексу ('2:число').",
                             FunctionSections.MatricesAndVectors, true,
                             new ArgumentInfo(ArgumentSections.Matrix), new ArgumentInfo(ArgumentSections.RealNumber),
                             new ArgumentInfo(ArgumentSections.RealNumber)),

                new TermInfo("insertRow", TermType.Function,
                             "Вставка строки в матрицу ('1:матрица') по указанному индексу ('число') из вектора ('3:матрица').",
                             FunctionSections.MatricesAndVectors, true,
                             new ArgumentInfo(ArgumentSections.Matrix), new ArgumentInfo(ArgumentSections.RealNumber),
                             new ArgumentInfo(ArgumentSections.Matrix)),

                new TermInfo("insertCols", TermType.Function,
                             "Вставка заданного количества ('3:число') нулевых столбцов в матрицу ('матрица') по указанному индексу ('2:число').",
                             FunctionSections.MatricesAndVectors, true,
                             new ArgumentInfo(ArgumentSections.Matrix), new ArgumentInfo(ArgumentSections.RealNumber),
                             new ArgumentInfo(ArgumentSections.RealNumber)),

                new TermInfo("insertCol", TermType.Function,
                             "Вставка столбца в матрицу ('1:матрица') по указанному индексу ('число') из вектора ('3:матрица').",
                             FunctionSections.MatricesAndVectors, true,
                             new ArgumentInfo(ArgumentSections.Matrix), new ArgumentInfo(ArgumentSections.RealNumber),
                             new ArgumentInfo(ArgumentSections.Matrix)),

                new TermInfo("removeRows", TermType.Function,
                             "Удаление заданного количества ('3:число') строк из матрицы ('матрица') по указанному индексу ('2:число').",
                             FunctionSections.MatricesAndVectors, true,
                             new ArgumentInfo(ArgumentSections.Matrix), new ArgumentInfo(ArgumentSections.RealNumber),
                             new ArgumentInfo(ArgumentSections.RealNumber)),

                new TermInfo("removeCols", TermType.Function,
                             "Удаление заданного количества ('3:число') столбцов из матрицы ('матрица') по указанному индексу ('2:число').",
                             FunctionSections.MatricesAndVectors, true,
                             new ArgumentInfo(ArgumentSections.Matrix), new ArgumentInfo(ArgumentSections.RealNumber),
                             new ArgumentInfo(ArgumentSections.RealNumber)),

                new TermInfo("nonZerosRows", TermType.Function,
                             "Удаление нулевых строк из матрицы ('матрица').",

                             FunctionSections.MatricesAndVectors, true,
                             new ArgumentInfo(ArgumentSections.Matrix)),

                new TermInfo("nonZerosCols", TermType.Function,
                             "Удаление нулевых столбцов из матрицы ('матрица').",
                             FunctionSections.MatricesAndVectors, true,
                             new ArgumentInfo(ArgumentSections.Matrix)),

                new TermInfo("nonZerosRowsCols", TermType.Function,
                             "Удаление нулевых строк и столбцов из матрицы ('матрица').",
                             FunctionSections.MatricesAndVectors, true,
                             new ArgumentInfo(ArgumentSections.Matrix)),

                new TermInfo("putMatrix", TermType.Function,
                             "Вставка матрицы ('2:матрица') в исходную матрицу ('1:матрица') по указанным индексам строки ('3:число')" +
                             " и столбца ('4:число') с заменой элементов исходной матрицы.",
                             FunctionSections.MatricesAndVectors, true,
                             new ArgumentInfo(ArgumentSections.Matrix), new ArgumentInfo(ArgumentSections.Matrix),
                             new ArgumentInfo(ArgumentSections.RealNumber), new ArgumentInfo(ArgumentSections.RealNumber)),

                new TermInfo("insertMatrix", TermType.Function,
                             "Вставка матрицы ('2:матрица') в исходную матрицу ('1:матрица') по указанным индексам строки ('3:число')" +
                             " и столбца ('4:число') с изменеием размерности исходной матрицы.",
                             FunctionSections.MatricesAndVectors, true,
                             new ArgumentInfo(ArgumentSections.Matrix), new ArgumentInfo(ArgumentSections.Matrix),
                             new ArgumentInfo(ArgumentSections.RealNumber), new ArgumentInfo(ArgumentSections.RealNumber)),
            });
        }
示例#5
0
 public RegionBase CreateNew(SessionProfile sessionProfile) => new XYPlotSeq(sessionProfile);
示例#6
0
 public TermInfo[] GetTermsHandled(SessionProfile sessionProfile) => _terms ?? (_terms = _functions?.ConvertAll(f => f.GetTermInfo(sessionProfile.CurrentLanguage.Abbr)).ToArray());
示例#7
0
        public Chart2D(SessionProfile sessionProfile) : base(sessionProfile)
        {
            Initialize();

            Size = new Size(300, 200);
        }