Пример #1
0
    // Use this for initialization
    public override void Create()
    {
        Lifes.Add(skin);
        Forms.Add(verts);
        Forms.Add(tris);
        Forms.Add(bones);

        skin._Create();

        verts._Create(verts);
        tris._Create(tris);
        bones._Create(bones);

        skin.BindPrimaryForm("_VertBuffer", verts);
        skin.BindForm("_BoneBuffer", bones);
    }
        public ValidationHtmlConventions()
        {
            Editors.Add(new FieldValidationElementModifier());
            Editors.Add(new RemoteValidationElementModifier());
            Editors.Add(new DateElementModifier());
            Editors.Add(new NumberElementModifier());
            Editors.Add(new MaximumLengthModifier());
            Editors.Add(new MinimumLengthModifier());
            Editors.Add(new RangeLengthModifier());
            Editors.Add(new MinValueModifier());
            Editors.Add(new MaxValueModifier());
            Editors.Add(new LocalizationLabelModifier());
            Editors.Add(new RegularExpressionModifier());

            Forms.Add(new FormValidationSummaryModifier());
            Forms.Add(new FormValidationModifier());
            Forms.Add(new FieldEqualityFormModifier());
            Forms.Add(new NotificationSerializationModifier());
        }
Пример #3
0
        private void New()
        {
            var form = new Form()
            {
                Name = "Новый бланк"
            };
            var page = new Model.Page()
            {
                Name = "Страница 1", Height = 29.7, Width = 21
            };

            page.Elements.Add(new Element()
            {
                Name = "Новое поле", Value = "Новое поле"
            });
            form.Pages.Add(page);
            Forms.Add(form);
            CurrentForm            = form;
            CurrentForm.HasChanges = false;
        }
Пример #4
0
 public StudentClass(StudentClassEntity studentClassEntity) : base(studentClassEntity)
 {
     if (studentClassEntity.Class != null)
     {
         this.Class = new Class(studentClassEntity.Class);
     }
     if (studentClassEntity.Student != null)
     {
         this.Student = new Student(studentClassEntity.Student);
     }
     if (studentClassEntity.Forms != null)
     {
         this.Forms = new HashSet <Form>();
         foreach (var form in studentClassEntity.Forms)
         {
             form.StudentClassId = this.Id;
             Forms.Add(new Form(form));
         }
     }
 }
Пример #5
0
        public DefaultHtmlConventions()
        {
            Editors.BuilderPolicy <CheckboxBuilder>();

            Editors.Always.BuildBy <TextboxBuilder>();

            Editors.Modifier <AddNameModifier>();

            Displays.Always.BuildBy <SpanDisplayBuilder>();

            Labels.Always.BuildBy <DefaultLabelBuilder>();

            Templates.Displays.Always.BuildBy <TemplateSpanBuilder>();
            Templates.Editors.Always.BuildBy <TemplateTextboxBuilder>();

            Templates.Displays.Always.ModifyWith <DataFldModifier>();
            Templates.Editors.Always.ModifyWith <DataFldModifier>();

            FieldChrome <DefinitionListFieldChrome>();

            Forms.Add(new FormTagBuilder());
        }
Пример #6
0
    // Use this for initialization
    public override void Create()
    {
        Lifes.Add(intersect);
        Lifes.Add(place);
        Lifes.Add(bodyTransfer);
        Forms.Add(particles);
        Forms.Add(bodyVerts);
        Forms.Add(bodyTris);

        mesh = skin.gameObject.GetComponent <MeshFilter>();

        particles._Create(skin.verts);

        bodyVerts._Create(particles);
        bodyTris._Create(bodyVerts);

        place._Create();
        intersect._Create();
        bodyTransfer._Create();

        place.BindPrimaryForm("_VertBuffer", particles);
        place.BindForm("_SkinnedBuffer", skin.verts);
        place.BindAttribute("_Transform", "transformFloats", this);


        intersect.BindForm("_ParticleBuffer", particles);
        intersect.BindForm("_SkinnedVertBuffer", skin.verts);
        intersect.BindPrimaryForm("_SkinnedTriBuffer", skin.tris);
        intersect.BindAttribute("_RO", "RayOrigin", touch);
        intersect.BindAttribute("_RD", "RayDirection", touch);
        intersect.BindAttribute("_Transform", "transformFloats", this);

        bodyTransfer.BindAttribute("_CameraUp", "cameraUp", this);
        bodyTransfer.BindAttribute("_CameraLeft", "cameraLeft", this);
        bodyTransfer.BindAttribute("_Radius", "radius", this);

        bodyTransfer.BindPrimaryForm("_VertBuffer", bodyVerts);
        bodyTransfer.BindForm("_ParticleBuffer", particles);
    }
Пример #7
0
        private void Open(string filePath)
        {
            System.Xml.Serialization.XmlSerializer reader =
                new System.Xml.Serialization.XmlSerializer(typeof(Form));
            System.IO.StreamReader file = new System.IO.StreamReader(
                filePath);
            var form = (Form)reader.Deserialize(file);

            file.Close();
            var name = Path.GetFileNameWithoutExtension(filePath);

            form.Name = name;
            Forms.Add(form);
            CurrentForm = form;

            CurrentForm.HasChanges = false;

            if (Path.GetExtension(filePath) == ".frmx")
            {
                MainWindowViewModel.SetFileName(form, filePath);
            }
        }
Пример #8
0
 public void AddFromBDC(BaseDataClass dataClass)
 {
     if (dataClass is Teacher teacher)
     {
         Teachers.Add(teacher);
     }
     if (dataClass is Form form)
     {
         Forms.Add(form);
     }
     if (dataClass is Subject subject)
     {
         Subjects.Add(subject);
     }
     if (dataClass is Lesson lesson)
     {
         Lessons.Add(lesson);
     }
     if (dataClass is Group group)
     {
         Groups.Add(group);
     }
 }
Пример #9
0
    public override void Create()
    {
        /*
         * All of this info should be visualizable!
         */

        Lifes.Add(FlowerTransfer);

        Forms.Add(FlowerVerts);
        Forms.Add(FlowerTriangles);


        FlowerTransfer._Create();
        FlowerVerts._Create(Base);
        FlowerTriangles._Create(FlowerVerts);



        FlowerTransfer.BindPrimaryForm("_VertBuffer", FlowerVerts);
        FlowerTransfer.BindForm("_HairBuffer", Hair);

        FlowerTransfer.BindAttribute("_NumVertsPerHair", "numVertsPerHair", Hair);
        FlowerTransfer.BindAttribute("_Size", "size", this);
    }
Пример #10
0
 public void AddReportDef(ReportDef report)
 {
     Forms.Add(new XlsReportDefAdjustInfo(report));
 }
Пример #11
0
 public void AddTableForm(BizControl form)
 {
     Forms.Add(new XlsTableFormAdjustInfo(form));
 }
Пример #12
0
 internal void addForm(PokemonEmerald pokemon)
 {
     Forms.Add(pokemon);
 }
Пример #13
0
        /// <summary>
        /// Goes through the GAME_MASTERs and collects the data we want to leverage for the PokeRef site.
        /// </summary>
        /// <param name="gameMaster"></param>
        /// <param name="legacyGameMasters"></param>
        private void CollectData(GameMasterTemplate gameMasterTemplate, IEnumerable <GameMasterTemplate> legacyGameMasterTemplates)
        {
            // Get a list of all of the GAME_MASTER files.
            CurrentGameMaster = gameMasterTemplate;
            GameMasters.Add(gameMasterTemplate.FileName, gameMasterTemplate.HaveRawGameMaster);
            foreach (var legacyGameMasterTemplate in legacyGameMasterTemplates)
            {
                GameMasters.Add(legacyGameMasterTemplate.FileName, legacyGameMasterTemplate.HaveRawGameMaster);
            }

            // Process the current GameMaster
            foreach (var itemTemplate in gameMasterTemplate.GameMaster.item_templates)
            {
                try
                {
                    if (itemTemplate.pokemon_settings != null)
                    {
                        PokemonTranslator pokemon = new PokemonTranslator(itemTemplate);
                        Pokemon.Add(pokemon.Key, pokemon);
                    }
                    else if (itemTemplate.move_settings != null)
                    {
                        MoveTranslator move = new MoveTranslator(itemTemplate);
                        PokeMoves.Add(move.Key, move);
                    }
                    else if (itemTemplate.gender_settings != null)
                    {
                        GenderRatioTranslator genderRatio = new GenderRatioTranslator(itemTemplate);

                        // Some Pokemon are duplicated and should be ignored. (E.G. Castform for each of the weathers.)
                        if (GenderRatios.ContainsKey(genderRatio.Key))
                        {
                            continue;
                        }

                        GenderRatios.Add(genderRatio.Key, genderRatio);
                    }
                    else if (itemTemplate.player_level != null)
                    {
                        PlayerLevel = new PlayerLevelTranslator(itemTemplate);
                    }
                    else if (itemTemplate.form_settings != null)
                    {
                        if (itemTemplate.form_settings.forms != null)
                        {
                            FormSettingsTranslator formSettings = new FormSettingsTranslator(itemTemplate);
                            Forms.Add(formSettings.Key, formSettings);
                        }
                    }
                    else if (itemTemplate.friendship_milestone_settings != null)
                    {
                        Friendships.Add(new FriendshipTranslator(itemTemplate));
                    }

                    #region Data I am currently not using.

                    //else if (itemTemplate.avatarCustomization != null)
                    //{
                    //}
                    //else if (itemTemplate.badgeSettings != null)
                    //{
                    //}
                    //else if (itemTemplate.battleSettings != null)
                    //{
                    //}
                    //else if (itemTemplate.camera != null)
                    //{
                    //}
                    //else if (itemTemplate.encounterSettings != null)
                    //{
                    //}
                    //else if (itemTemplate.gymBadgeSettings != null)
                    //{
                    //}
                    //else if (itemTemplate.gymLevel != null)
                    //{
                    //}
                    //else if (itemTemplate.iapItemDisplay != null)
                    //{
                    //}
                    //else if (itemTemplate.iapSettings != null)
                    //{
                    //}
                    //else if (itemTemplate.itemSettings != null)
                    //{
                    //}
                    //else if (itemTemplate.moveSequenceSettings != null)
                    //{
                    //}
                    //else if (itemTemplate.pokemonUpgrades != null)
                    //{
                    //}
                    //else if (itemTemplate.questSettings != null)
                    //{
                    //}
                    //else if (itemTemplate.typeEffective != null)
                    //{
                    //}

                    #endregion Data I am currently not using.
                }
                catch (Exception ex)
                {
                    ConsoleOutput.OutputException(ex, $"Error processing {itemTemplate.template_id} ({gameMasterTemplate.FileName})");
                }
            }

            Legacy.Initialize(gameMasterTemplate, legacyGameMasterTemplates, ManualDataSettings.PokemonAvailability, ManualDataSettings.SpecialMoves);
            foreach (var pokemon in Pokemon.Values)
            {
                pokemon.AssignProperties(Pokemon,
                                         GenderRatios.ContainsKey(pokemon.PokemonSettings.pokemon_id) ? GenderRatios[pokemon.PokemonSettings.pokemon_id] : null,
                                         Legacy.FastMoves.ContainsKey(pokemon.TemplateId) ? Legacy.FastMoves[pokemon.TemplateId] : null,
                                         Legacy.ChargedMoves.ContainsKey(pokemon.TemplateId) ? Legacy.ChargedMoves[pokemon.TemplateId] : null);
            }
        }
Пример #14
0
 public void RegisterForm(IMForm pForm)
 {
     Forms.Add(pForm);
 }
Пример #15
0
    public override void Create()
    {
        transformArray = new float[16];


        /*
         * All of this info should be visualizable!
         */

        Lifes.Add(SetHairPosition);
        Lifes.Add(HairCollision);
        Lifes.Add(HairConstraint0);
        Lifes.Add(HairConstraint1);
        Lifes.Add(HairTransfer);

        Forms.Add(Base);
        Forms.Add(Hair);
        Forms.Add(TubeVerts);
        Forms.Add(TubeTriangles);


        SetHairPosition._Create();
        HairCollision._Create();
        HairConstraint0._Create();
        HairConstraint1._Create();

        Base._Create();
        Hair._Create();


        HairTransfer._Create();
        TubeVerts._Create();
        TubeTriangles._Create();


        SetHairPosition.BindPrimaryForm("_VertBuffer", Hair);
        SetHairPosition.BindForm("_BaseBuffer", Base);

        HairCollision.BindPrimaryForm("_VertBuffer", Hair);
        HairCollision.BindForm("_BaseBuffer", Base);

        HairConstraint0.BindInt("_Pass", 0);
        HairConstraint0.BindPrimaryForm("_VertBuffer", Hair);

        HairConstraint1.BindInt("_Pass", 1);
        HairConstraint1.BindPrimaryForm("_VertBuffer", Hair);

        HairTransfer.BindPrimaryForm("_VertBuffer", TubeVerts);
        HairTransfer.BindForm("_HairBuffer", Hair);

        HairTransfer.BindAttribute("_TubeWidth", "width", TubeVerts);
        HairTransfer.BindAttribute("_TubeLength", "length", TubeVerts);
        HairTransfer.BindAttribute("_NumVertsPerHair", "numVertsPerHair", Hair);
        HairTransfer.BindAttribute("_TubeRadius", "tubeRadius", this);

        SetHairPosition.BindAttribute("_HairLength", "length", Hair);
        SetHairPosition.BindAttribute("_NumVertsPerHair", "numVertsPerHair", Hair);

        // Don't need to bind for all of them ( constraints ) because same shader
        HairCollision.BindAttribute("_HairLength", "length", Hair);
        HairCollision.BindAttribute("_NumVertsPerHair", "numVertsPerHair", Hair);
        HairCollision.BindAttribute("transform", "transformArray", this);
    }
Пример #16
0
 internal void addForm(PokemonDP pokemon)
 {
     Forms.Add(pokemon);
 }
Пример #17
0
 internal void addForm(PokemonCrystal pokemon)
 {
     Forms.Add(pokemon);
 }
Пример #18
0
        //Открывает новую заданную форму
        public Form RunCommandReporter(ReporterCommand c)
        {
            if (Forms.ContainsKey(c) && Forms[c] != null)
            {
                var fm = Forms[c];
                if (!fm.Visible)
                {
                    fm.Show();
                }
                if (fm.WindowState == FormWindowState.Minimized)
                {
                    fm.WindowState = FormWindowState.Normal;
                }
                fm.Focus();
                return(fm);
            }
            if (!c.OneForAllBooks() && IsReportForming)
            {
                return(null);
            }
            if (c.NeedCheckReport() && !SysPage.IsInfoTask())
            {
                MessageReportError("Да запуска команды необходимо открыть отчет InfoTask");
                return(null);
            }

            Form f = null;

            using (StartAtom(c))
            {
                try
                {
                    AddEvent("Закрытие лишних форм");
                    var less  = new Dictionary <ReporterCommand, Form>();
                    var great = new Dictionary <ReporterCommand, Form>();
                    foreach (var k in Forms)
                    {
                        if (c.Greater(k.Key))
                        {
                            less.Add(k.Key, k.Value);
                        }
                        if (c.Less(k.Key))
                        {
                            great.Add(k.Key, k.Value);
                        }
                    }
                    var cForms = GeneralRep.CommonBook.Forms;
                    foreach (var k in cForms)
                    {
                        if (c.Less(k.Key))
                        {
                            great.Add(k.Key, k.Value);
                        }
                    }

                    if (great.Count > 0)
                    {
                        string smess = "";
                        foreach (var g in great)
                        {
                            smess += (smess != "" ? "," : "") + " Форма " + g.Key.ToFormName();
                        }
                        smess = "Команда не может быть выполнена, пока открыты:" + smess + ". Закрыть формы?";
                        if (!MessageReportQuestion(smess))
                        {
                            return(null);
                        }
                    }

                    foreach (var k in less)
                    {
                        k.Value.Close();
                        if (Forms.ContainsKey(k.Key))
                        {
                            Forms.Remove(k.Key);
                        }
                        if (cForms.ContainsKey(k.Key))
                        {
                            cForms.Remove(k.Key);
                        }
                    }
                    foreach (var k in great)
                    {
                        GeneralRep.CloseForm(k.Key, true);
                    }

                    if (c == ReporterCommand.PutLinks || c == ReporterCommand.ShapeLibrary || c == ReporterCommand.Report || c == ReporterCommand.LiveReport || c == ReporterCommand.Intervals || c == ReporterCommand.AbsoluteEdit || c == ReporterCommand.LinksList)
                    {
                        UpdateDataFile(false);
                    }

                    System.Windows.Forms.Application.EnableVisualStyles();
                    switch (c)
                    {
                    case ReporterCommand.GroupReports:
                        f = new FormGroupReports();
                        break;

                    case ReporterCommand.GroupReportEdit:
                        f = new FormGroupReportEdit();
                        break;

                    case ReporterCommand.Create:
                        f = new FormCreate();
                        break;

                    case ReporterCommand.Setup:
                        f = new FormSetup();
                        break;

                    case ReporterCommand.CopyServerReport:
                        CopyServerReport();
                        break;

                    case ReporterCommand.PutLinks:
                        using (Start()) LoadCurTemplate();
                        LastChangeLinks = DateTime.Now;
                        f = new FormPutLinks();
                        break;

                    case ReporterCommand.FilterParams:
                        f = new FormFiltersParams();
                        break;

                    case ReporterCommand.LinkProperties:
                        f = new FormLinkProperties();
                        break;

                    case ReporterCommand.FindLinks:
                        f = new FormFindLinks();
                        break;

                    case ReporterCommand.LinksTemplate:
                        f = new FormLinksTemplate();
                        break;

                    case ReporterCommand.DeleteLinks:
                        DeleteLinks();
                        LastChangeLinks = DateTime.Now;
                        break;

                    case ReporterCommand.ClearCells:
                        Forms.Add(ReporterCommand.ClearCells, null);
                        UsedFileToMemory();
                        ClearAllCells();
                        Forms.Remove(ReporterCommand.ClearCells);
                        break;

                    case ReporterCommand.ShapeLibrary:
                        f = new FormShapeLibrary();
                        break;

                    case ReporterCommand.Report:
                        UsedFileToMemory();
                        PrepareController();
                        f = new FormReport();
                        break;

                    case ReporterCommand.LiveReport:
                        UsedFileToMemory();
                        PrepareController();
                        f = new FormLiveReport();
                        break;

                    case ReporterCommand.Video:
                        UsedFileToMemory();
                        PrepareController();
                        f = new FormVideo();
                        break;

                    case ReporterCommand.ArchivesRanges:
                        f = new FormArchivesRanges();
                        break;

                    case ReporterCommand.Intervals:
                        UsedFileToMemory();
                        if (FormInf == null || FormToDir || FormToFile)
                        {
                            MessageReportError("Сохранение в журнал возможно только при формировании отчета непосредственно в бланк отчета (задается в настройках)");
                        }
                        else
                        {
                            PrepareArchive();
                            f = new FormIntervals();
                        }
                        break;

                    case ReporterCommand.FilterIntervals:
                        f = new FormFiltersIntervals();
                        break;

                    case ReporterCommand.SaveReport:
                        if (CanSaveReport())
                        {
                            f = new FormSaveReport();
                        }
                        break;

                    case ReporterCommand.AbsoluteEdit:
                        UsedFileToMemory();
                        AddEvent("Чтение абсолютных значений из архива");
                        foreach (var project in UsedProjects.Values)
                        {
                            project.AbsoluteEditValues = project.Archive.ReadAbsoluteEdit(project.Code, false);
                        }
                        f = new FormAbsoluteEdit();
                        break;

                    case ReporterCommand.Update:
                        UpdateDataFile(true);
                        if (!Command.IsError)
                        {
                            MessageReport("Ссылки были обновлены");
                        }
                        break;

                    case ReporterCommand.LinksList:
                        f = new FormLinksList();
                        break;

                    case ReporterCommand.AppInfo:
                        f = new FormAppInfo();
                        break;
                    }
                    if (f != null)
                    {
                        if (!c.OneForAllBooks())
                        {
                            f.Text += " (" + Code + ")";
                        }
                        Forms.Add(c, f);
                        f.Show();
                    }
                }
                catch (Exception ex)
                {
                    AddError("Ошибка при открытии формы", ex, c.ToString());
                }
                if (Command != null && Command.IsError)
                {
                    foreach (var ff in Forms)
                    {
                        if (ff.Key != ReporterCommand.LinkProperties && ff.Value != null && ff.Value.Visible)
                        {
                            ff.Value.Activate();
                            break;
                        }
                    }
                    ShowError();
                }
            }
            return(f);
        }
Пример #19
0
        private void LoadTest()
        {
            using (Stream file = Application.GetResourceStream(new Uri("pack://application:,,,/new.frmx")).Stream)
            {
                file.Position = 0;
                System.Xml.Serialization.XmlSerializer reader =
                    new System.Xml.Serialization.XmlSerializer(typeof(Form));

                var form = (Form)reader.Deserialize(file);
                Forms.Add(form);
                form.HasChanges = false;
                CurrentForm     = form;
            }


            return;



            var Form = new Form();

            Form.Name = "Мой бланк 1";
            Forms.Add(Form);

            CurrentForm = Form;

            var page = new formPrinter.Model.Page();

            page.Width  = 21;
            page.Height = 15;
            page.Name   = "Страница 1";


            Stream picStream = Application.GetResourceStream(new Uri("pack://application:,,,/новый файл.jpg")).Stream;

            picStream.Position = 0;
            byte[] bytes = new byte[picStream.Length];
            picStream.Read(bytes, 0, (int)picStream.Length);
            page.Image = formPrinter.Model.Page.ImageFromBytes(bytes);

            Form.Pages.Add(page);

            var element = new Element();

            element.Name   = "Number";
            element.X      = 3;
            element.Y      = 5;
            element.Height = 1;
            element.Width  = 6;
            element.Value  = "Some text";
            page.Elements.Add(element);

            element             = new Element();
            element.Name        = "Date";
            element.ElementType = ElementType.Calendar;
            element.X           = 7;
            element.Y           = 4;
            element.Height      = 1;
            element.Width       = 6;
            element.Value       = "01.05.2012";
            page.Elements.Add(element);


            element             = new Element();
            element.Name        = "Date";
            element.ElementType = ElementType.List;
            element.ListChoisesSeparetedText = "apple;mint;berry";

            element.X      = 3;
            element.Y      = 8;
            element.Height = 1;
            element.Width  = 6;
            element.Value  = "apple";
            page.Elements.Add(element);

            element             = new Element();
            element.Name        = "Date";
            element.ElementType = ElementType.Text;
            element.X           = 13;
            element.Y           = 5;
            element.Height      = 1;
            element.Width       = 6;
            element.Value       = "True";
            page.Elements.Add(element);

            page = new formPrinter.Model.Page();



            page.Image = formPrinter.Model.Page.ImageFromBytes(bytes);

            page.Width  = 21;
            page.Height = 29.7;
            page.Name   = "Page 2";

            Form.Pages.Add(page);

            element        = new Element();
            element.Name   = "Number";
            element.X      = 3;
            element.Y      = 5;
            element.Height = 1;
            element.Width  = 6;
            element.Value  = "Some text";
            page.Elements.Add(element);
        }