/// <summary>
        ///     Essentially resets this object for next use. Could dispose and make a new one
        ///     but where is the fun in that?
        /// </summary>
        public void VoidEvent()
        {
            if (_data.RSettings.ProgramSettings.Debug)
            {
                _ = _log.LogMessage("Voiding test event", false, color: LOG_COLOR);
            }

            IsValid       = false;
            CanUseGallery = false;
            EventEditTime = null;
            StartDateTime = null;
            EndDateTime   = null;
            Title         = null;
            Creators.Clear();
            Creators.TrimExcess();
            GalleryImages.Clear();
            GalleryImages.TrimExcess();
            ImageGallery     = null;
            WorkshopLink     = null;
            IsCasual         = true;
            Moderator        = null;
            Description      = null;
            ServerLocation   = null;
            CompPassword     = null;
            CompCasualServer = null;
        }
 public NancyRazorProjectScopeProvider()
 {
     Creators.AddRange(new List <Func <string, ITemplateScopePoint> >
     {
         TryToCreate <InAnyRazorProject>
     });
 }
        internal static void SetCodeCollection(
            CodeDefinition codeDefinition,
            List <string> codeCollection,
            DataContainer dataContainer)
        {
            var code = string.Empty;

            Def.BaseItemColumnDefinitionCollection(order: codeDefinition.Order)
            .Where(o => Column.CheckExclude(codeDefinition, o) == false)
            .Where(o => !o.EachModel)
            .ForEach(columnDefinition =>
            {
                dataContainer.TableName  = "_BaseItems";
                dataContainer.ColumnName = columnDefinition.ColumnName;
                Creators.SetCodeCollection(
                    ref code,
                    codeCollection,
                    codeDefinition,
                    dataContainer,
                    () => Column.ReplaceCode(
                        ref code,
                        codeDefinition,
                        columnDefinition));
                dataContainer.TableName  = string.Empty;
                dataContainer.ColumnName = string.Empty;
            });
        }
示例#4
0
        internal static void SetCodeCollection(
            CodeDefinition codeDefinition,
            List <string> codeCollection,
            DataContainer dataContainer)
        {
            var code = string.Empty;

            dataContainer
            .XlsIoCollection[dataContainer.DefinitionName]
            .XlsSheet
            .Columns
            .ForEach(definitionColumnName =>
                     Creators.SetCodeCollection(
                         ref code,
                         codeCollection,
                         codeDefinition,
                         dataContainer,
                         () =>
            {
                var definitionColumnNameAlternate = definitionColumnName
                                                    .EscapeReservedWord()
                                                    .Replace("-", "_");
                var definitionColumnType = dataContainer
                                           .XlsIoCollection[dataContainer.DefinitionName]
                                           .XlsSheet[0][definitionColumnName]
                                           .ToString();
                ReplaceCode(
                    ref code,
                    codeDefinition,
                    dataContainer.DefinitionName,
                    definitionColumnName,
                    definitionColumnNameAlternate,
                    definitionColumnType);
            }));
        }
示例#5
0
        public DivisionService_Test()
        {
            var diServiceBuilder = new DIServiceBuilder();

            _divisionService = diServiceBuilder.GetService <DivisionService>();
            _creators        = new Creators();
        }
        public DivisionsControllerTest()
        {
            var diServiceBuilder = new DIServiceBuilder();

            _controller = diServiceBuilder.GetService <DivisionsController>();
            _creators   = new Creators();
        }
示例#7
0
 internal override void parse(string str, ref int pos, ReleaseVersion release, int len, ConcurrentDictionary <int, BaseClassIfc> dictionary)
 {
     base.parse(str, ref pos, release, len, dictionary);
     if (release < ReleaseVersion.IFC4)
     {
         mIdentification = ParserSTEP.StripString(str, ref pos, len);
         mSSCreationDate = ParserSTEP.StripLink(str, ref pos, len);
         Creators.AddRange(ParserSTEP.StripListLink(str, ref pos, len).ConvertAll(x => dictionary[x] as IfcPerson));
         mPurpose      = ParserSTEP.StripString(str, ref pos, len);
         mSSDuration   = ParserSTEP.StripDouble(str, ref pos, len);
         mSSTotalFloat = ParserSTEP.StripDouble(str, ref pos, len);
         mSSStartTime  = ParserSTEP.StripLink(str, ref pos, len);
         mSSFinishTime = ParserSTEP.StripLink(str, ref pos, len);
         string s = ParserSTEP.StripField(str, ref pos, len);
         if (s.StartsWith("."))
         {
             Enum.TryParse <IfcWorkControlTypeEnum>(s.Replace(".", ""), true, out mWorkControlType);
         }
         mUserDefinedControlType = ParserSTEP.StripString(str, ref pos, len);
     }
     else
     {
         mCreationDate = IfcDateTime.ParseSTEP(ParserSTEP.StripField(str, ref pos, len));
         Creators.AddRange(ParserSTEP.StripListLink(str, ref pos, len).ConvertAll(x => dictionary[x] as IfcPerson));
         mPurpose    = ParserSTEP.StripString(str, ref pos, len);
         mDuration   = ParserSTEP.StripString(str, ref pos, len);
         mTotalFloat = ParserSTEP.StripString(str, ref pos, len);
         mStartTime  = IfcDateTime.ParseSTEP(ParserSTEP.StripField(str, ref pos, len));
         mFinishTime = IfcDateTime.ParseSTEP(ParserSTEP.StripField(str, ref pos, len));
     }
 }
示例#8
0
        internal static void SetCodeCollection(
            CodeDefinition codeDefinition,
            List <string> codeCollection,
            DataContainer dataContainer)
        {
            var code = string.Empty;

            Def.ColumnDefinitionCollection
            .Where(o => !Column.CheckExclude(codeDefinition, o))
            .Where(o => o.TableName == dataContainer.TableName)
            .OrderBy(o => o.No)
            .ForEach(columnDefinition =>
            {
                dataContainer.ColumnName = columnDefinition.ColumnName;
                Creators.SetCodeCollection(
                    ref code, codeCollection, codeDefinition, dataContainer, () =>
                {
                    var tableNameAlias = TableNameAlias(columnDefinition);
                    ReplaceCodeOfJoin(
                        ref code,
                        codeDefinition,
                        columnDefinition,
                        tableNameAlias: TableNameAlias(columnDefinition),
                        columnNameAlias: ColumnNameAlias(columnDefinition),
                        joinType: JoinType(columnDefinition),
                        joinExpression: columnDefinition.JoinExpression);
                });
                dataContainer.ColumnName = string.Empty;
            });
        }
示例#9
0
        internal static void SetCodeCollection(
            CodeDefinition codeDefinition,
            List <string> codeCollection,
            DataContainer dataContainer)
        {
            dataContainer.Type = "Table";
            var code            = string.Empty;
            var parentTableName = dataContainer.TableName;
            var parentModelName = dataContainer.ModelName;

            Def.TableNameCollection(order: codeDefinition.Order)
            .Where(o => !CheckExclude(codeDefinition, o))
            .ForEach(tableName =>
            {
                dataContainer.TableName = tableName;
                dataContainer.ModelName = Def.ModelNameByTableName(tableName);
                Creators.SetCodeCollection(
                    ref code,
                    codeCollection,
                    codeDefinition,
                    dataContainer,
                    () => ReplaceCode(ref code, codeDefinition, dataContainer));
            });
            dataContainer.TableName = parentTableName;
            dataContainer.ModelName = parentModelName;
        }
示例#10
0
 internal static void SetCodeCollection_Default(
     CodeDefinition codeDefinition,
     List <string> codeCollection,
     DataContainer dataContainer)
 {
     if (!Table.CheckExclude(codeDefinition, dataContainer.TableName) ||
         dataContainer.TableName == string.Empty)
     {
         var code = Creators.Create(codeDefinition, dataContainer);
         if (dataContainer.ColumnName != string.Empty)
         {
             var columnDefinition = Def.ColumnDefinitionCollection.First(o =>
                                                                         o.TableName == dataContainer.TableName &&
                                                                         o.ColumnName == dataContainer.ColumnName);
             if (!CheckExclude(codeDefinition, columnDefinition))
             {
                 ReplaceCode(ref code, codeDefinition, columnDefinition);
                 codeCollection.Add(code);
             }
         }
         else
         {
             codeCollection.Add(code);
         }
     }
 }
示例#11
0
        internal static void SetCodeCollection(
            CodeDefinition codeDefinition,
            List <string> codeCollection,
            DataContainer dataContainer)
        {
            var code             = string.Empty;
            var columnCollection = Def.ColumnDefinitionCollection
                                   .Where(o => o.TableName == dataContainer.TableName)
                                   .Where(o => !CheckExclude(codeDefinition, o))
                                   .OrderBy(o => o[Strings.CoalesceEmpty(codeDefinition.Order, "No")])
                                   .ToList();
            var count = columnCollection.Count();

            columnCollection.ForEach(columnDefinition =>
            {
                dataContainer.ColumnName = columnDefinition.ColumnName;
                Creators.SetCodeCollection(
                    ref code,
                    codeCollection,
                    codeDefinition,
                    dataContainer,
                    () => ReplaceCode(
                        ref code,
                        codeDefinition,
                        columnDefinition,
                        count));
                dataContainer.ColumnName = string.Empty;
            });
        }
示例#12
0
        private void Delete_Fab(object sender, FileSystemEventArgs e)
        {
            int TypeID = 0;

            for (int i = 0; i < Types.Count; i++)
            {
                if (Types[i].Name == e.Name.Split('.')[0])
                {
                    TypeID = i;
                }
            }
            string    Name = FigList.DeleteFig(Types[TypeID]);
            DeleteDel Del  = new DeleteDel(DeleteFromList);

            if (Name != null)
            {
                lvFigures.Invoke(Del, Name);
            }
            SelectedFig    = null;
            SelectedFabric = 0;
            Types.RemoveAt(TypeID);
            Creators.RemoveAt(TypeID);
            Buttons.RemoveAt(TypeID);
            RedrawButtons(Buttons, TypeID);
            Domains.RemoveAt(TypeID);
            MainView.Image = Canvas;
        }
        private static async Task <Tuple <ToExit, ChatMember[], List <int> > > CheckIfToExit_NullValue2Async(
            TelegramBotAbstract telegramBotClient, MessageEventArgs e)
        {
            var r = await telegramBotClient.GetChatAdministratorsAsync(e.Message.Chat.Id);

            if (r == null)
            {
                return(new Tuple <ToExit, ChatMember[], List <int> >(ToExit.STAY, r, new List <int> {
                    3
                }));
            }

            foreach (var chatMember in r)
            {
                var isCreator = Creators.CheckIfIsCreatorOrSubCreator(chatMember);
                if (isCreator != null && isCreator.Value)
                {
                    return(new Tuple <ToExit, ChatMember[], List <int> >(ToExit.STAY, r, new List <int> {
                        4
                    }));
                }
            }

            return(new Tuple <ToExit, ChatMember[], List <int> >(ToExit.EXIT, r, new List <int> {
                5
            }));
        }
示例#14
0
        public List <string> GetCreator()
        {
            var list = new List <string>();

            Creators?.ForEach(x => list.Add(x.Creators));

            return(list);
        }
示例#15
0
        /// <summary>Registers a creator function for the type that can create
        /// an instance of type based on a thread.
        /// </summary>
        /// <param name="type">
        /// The type to register.
        /// </param>
        /// <param name="creator">
        /// The creator function.
        /// </param>
        /// <exception cref="ArgumentNullException">
        /// If the type or the creator is null.
        /// </exception>
        /// <exception cref="NotSupportedException">
        /// If the type is generic, or has no converter, or a convertor that can not
        /// convert from string.
        /// </exception>
        /// <remarks>
        /// These creators are used to generate a value, if no one is
        /// assigned or configured.
        /// </remarks>
        public static void Register(Type type, Func <Thread, object> creator)
        {
            Qowaiv.Guard.NotNull(type, "type");
            Qowaiv.Guard.NotNull(creator, "creator");
            Guard(type, Creators.ContainsKey(type));

            Creators.TryAdd(type, creator);
        }
示例#16
0
 protected override string BuildStringSTEP(ReleaseVersion release)
 {
     return(base.BuildStringSTEP(release) + "," + (release < ReleaseVersion.IFC4 ? "'" + mIdentification + "'," + ParserSTEP.LinkToString(mSSCreationDate) : IfcDateTime.STEPAttribute(mCreationDate)) +
            (mCreators.Count > 0 ? ",(#" + string.Join(",#", Creators.ConvertAll(x => x.Index)) + ")," : ",$,") +
            (release < ReleaseVersion.IFC4 ? (mPurpose == "$" ? "$," : "'" + mPurpose + "',") + ParserSTEP.DoubleOptionalToString(mSSDuration) + "," + ParserSTEP.DoubleOptionalToString(mSSTotalFloat) + "," +
             ParserSTEP.LinkToString(mSSStartTime) + "," + ParserSTEP.LinkToString(mSSFinishTime) + ",." + mWorkControlType.ToString() + (mUserDefinedControlType == "$" ? ".,$" : ".,'" + mUserDefinedControlType + "'") :
             (mPurpose == "$" ? "$," : "'" + mPurpose + "',") + mDuration + "," + mTotalFloat + "," + IfcDateTime.STEPAttribute(mStartTime) + "," + IfcDateTime.STEPAttribute(mFinishTime)));
 }
示例#17
0
 protected IfcWorkControl(DatabaseIfc db, IfcWorkControl c, DuplicateOptions options) : base(db, c, options)
 {
     mCreationDate = c.mCreationDate;
     Creators.AddRange(c.mCreators.ConvertAll(x => db.Factory.Duplicate(x) as IfcPerson));
     mDuration   = c.mDuration;
     mTotalFloat = c.mTotalFloat;
     mStartTime  = c.mStartTime;
     mFinishTime = c.mFinishTime;
 }
示例#18
0
 protected IfcWorkControl(DatabaseIfc db, IfcWorkControl c, IfcOwnerHistory ownerHistory, bool downStream) : base(db, c, ownerHistory, downStream)
 {
     mCreationDate = c.mCreationDate;
     Creators.AddRange(c.mCreators.ConvertAll(x => db.Factory.Duplicate(x) as IfcPerson));
     mDuration   = c.mDuration;
     mTotalFloat = c.mTotalFloat;
     mStartTime  = c.mStartTime;
     mFinishTime = c.mFinishTime;
 }
示例#19
0
        private void SeedCreator()
        {
            if (Creators.Find(Builders <Creator> .Filter.Empty).Any())
            {
                return;
            }

            Creators.InsertOne(new Creator());
        }
 internal static void SetCodeCollection_Default(
     CodeDefinition codeDefinition,
     List <string> codeCollection,
     DataContainer dataContainer)
 {
     if (!CheckExcludeConditionsByDefName(codeDefinition, dataContainer))
     {
         codeCollection.Add(Creators.Create(codeDefinition, dataContainer));
     }
 }
示例#21
0
 public UnityProjectScopeProvider()
 {
     // Used when creating scope point from settings
     Creators.Add(TryToCreate <InUnityCSharpProject>);
     Creators.Add(TryToCreate <InUnityCSharpAssetsFolder>);
     Creators.Add(TryToCreate <InUnityCSharpEditorFolder>);
     Creators.Add(TryToCreate <InUnityCSharpRuntimeFolder>);
     Creators.Add(TryToCreate <InUnityCSharpFirstpassFolder>);
     Creators.Add(TryToCreate <InUnityCSharpFirstpassEditorFolder>);
     Creators.Add(TryToCreate <InUnityCSharpFirstpassRuntimeFolder>);
 }
示例#22
0
        public static void SEOrderKnightCuirass(IEquipement input)
        {
            input.ITEX.IconPath  = "si\\a\\SEOrderKnightC.dds\0";
            input.MODL.ModelPath = "si\\a\\SEOrderKnightCGND.nif\0";

            input.BPSL = new List <(INDX INDX, BNAM BNAM, CNAM CNAM)>
            {
                Creators.EquipementBodyPart(BodyPartSlot.Chest, "SEOrderKnightChestM\0", null),
            };

            (input as ARMO).AODT.Type = ArmorType.Cuirass;
        }
 public UnityProjectScopeProvider()
 {
     // These factory methods are used to create scope points when reading templates from settings
     Creators.Add(TryToCreate <UnityFileTemplateSectionMarker>);
     Creators.Add(TryToCreate <InUnityCSharpProject>);
     Creators.Add(TryToCreate <InUnityCSharpAssetsFolder>);
     Creators.Add(TryToCreate <InUnityCSharpEditorFolder>);
     Creators.Add(TryToCreate <InUnityCSharpRuntimeFolder>);
     Creators.Add(TryToCreate <InUnityCSharpFirstpassFolder>);
     Creators.Add(TryToCreate <InUnityCSharpFirstpassEditorFolder>);
     Creators.Add(TryToCreate <InUnityCSharpFirstpassRuntimeFolder>);
 }
示例#24
0
        private void ButtonAdd_Click(object sender, RoutedEventArgs e)
        {
            MainInfoFilm    newMainInfoFilm    = new MainInfoFilm();
            Creators        newCreators        = new Creators();
            BudgetAndFees   newBudgetAndFees   = new BudgetAndFees();
            FilmDescription newFilmDescription = new FilmDescription();
            RentalData      newRentalData      = new RentalData();
            AgeLimit        newAgeLimit        = new AgeLimit();


            newMainInfoFilm.Name              = tbName.Text;
            newMainInfoFilm.CountryCreator    = tbCountryCreator.Text;
            newMainInfoFilm.Operator          = tbOperator.Text;
            newMainInfoFilm.Genres            = tbGenres.Text;
            newMainInfoFilm.idCreators        = newCreators.ID;
            newMainInfoFilm.idFilmDescription = newFilmDescription.ID;
            newMainInfoFilm.idBudgetAndFees   = newBudgetAndFees.ID;
            newMainInfoFilm.idRentalData      = newRentalData.ID;
            newMainInfoFilm.idAgeLimit        = newAgeLimit.ID;
            MemoryStream      stream  = new MemoryStream();
            JpegBitmapEncoder encoder = new JpegBitmapEncoder();

            encoder.Frames.Add(BitmapFrame.Create((BitmapImage)imgLoad.Source));
            encoder.Save(stream);
            newMainInfoFilm.ImageMovie = stream.ToArray();

            var currentType = dbContext.db.AgeLimit.FirstOrDefault(item => item.MPAA == cmbMPAA.Text);

            newMainInfoFilm.ID = currentType.ID;

            newBudgetAndFees.Budget        = Convert.ToInt32(tbBudget.Text);
            newBudgetAndFees.WorldwideFees = Convert.ToInt32(tbWorldwideFees.Text);

            newCreators.Director = tbDirector.Text;
            newCreators.Producer = tbProducer.Text;

            newRentalData.PremiereInRussia = (DateTime)tbPremiereInRussia.SelectedDate;
            newRentalData.PremiereInWorld  = (DateTime)tbPremiereInWorld.SelectedDate;

            newFilmDescription.Description = tbDescription.Text;

            dbContext.db.BudgetAndFees.Add(newBudgetAndFees);

            dbContext.db.Creators.Add(newCreators);
            dbContext.db.AgeLimit.Add(newAgeLimit);
            dbContext.db.RentalData.Add(newRentalData);
            dbContext.db.FilmDescription.Add(newFilmDescription);
            dbContext.db.MainInfoFilm.Add(newMainInfoFilm);

            dbContext.db.SaveChanges();

            MessageBox.Show("Вы успешно добавили данные", "Уведомление", MessageBoxButton.OK, MessageBoxImage.Information);
        }
示例#25
0
        public static void SEOrderKnightHelm(IEquipement input)
        {
            input.ITEX.IconPath  = "si\\a\\SEOrderKnightH.dds\0";
            input.MODL.ModelPath = "si\\a\\SEOrderKnightHGND.nif\0";

            input.BPSL = new List <(INDX INDX, BNAM BNAM, CNAM CNAM)>
            {
                Creators.EquipementBodyPart(BodyPartSlot.Head, "SEOrderKnightHeadM\0", null),
                Creators.EquipementBodyPart(BodyPartSlot.Neck, "SEOrderKnightNeckM\0", null),
            };

            (input as ARMO).AODT.Type = ArmorType.Helmet;
        }
示例#26
0
        public static void SEOrderKnightGloveRight(IEquipement input)
        {
            input.ITEX.IconPath  = "si\\a\\SEOrderKnightG.dds\0";
            input.MODL.ModelPath = "si\\a\\SEOrderKnightGGND.nif\0";

            input.BPSL = new List <(INDX INDX, BNAM BNAM, CNAM CNAM)>
            {
                Creators.EquipementBodyPart(BodyPartSlot.HandRight, "SEOrderKnightHandM\0", null),
                Creators.EquipementBodyPart(BodyPartSlot.WristRight, null, null),
            };

            (input as ARMO).AODT.Type = ArmorType.LGauntlet;
        }
示例#27
0
 internal SongbookDto ToDto()
 {
     return(new SongbookDto()
     {
         Id = Id,
         Title = Title,
         Publisher = Publisher,
         ISBN10 = ISBN10,
         ISBN13 = ISBN13,
         Creators = Creators.Select(c => c.ToDto()).ToList(),
         Songs = Songs.Select(s => s.ToDto()).ToList()
     });
 }
示例#28
0
        public static void SEOrderKnightPauldronLeft(IEquipement input)
        {
            input.ITEX.IconPath  = "si\\a\\SEOrderKnightP.dds\0";
            input.MODL.ModelPath = "si\\a\\SEOrderKnightPGND.nif\0";

            input.BPSL = new List <(INDX INDX, BNAM BNAM, CNAM CNAM)>
            {
                Creators.EquipementBodyPart(BodyPartSlot.PauldronLeft, "SEOrderKnightPauldronM\0", null),
                Creators.EquipementBodyPart(BodyPartSlot.UpperArmLeft, "SEOrderKnightUpperArmM\0", null),
                Creators.EquipementBodyPart(BodyPartSlot.ForearmLeft, null, null),
            };

            (input as ARMO).AODT.Type = ArmorType.LPauldron;
        }
示例#29
0
        public static T Create <T>()
            where T : IRpcRoot
        {
            if (Creators <T> .Create != null)
            {
                return(Creators <T> .Create());
            }

            var implemented = Implement <T>();

            Creators <T> .Create = Expression.Lambda <Func <T> >(Expression.New(implemented.GetConstructor(new Type[0])))
                                   .Compile();
            return(Creators <T> .Create());
        }
示例#30
0
        public static void SEOrderKnightBoots(IEquipement input)
        {
            input.ITEX.IconPath  = "si\\a\\SEOrderKnightB.dds\0";
            input.MODL.ModelPath = "si\\a\\SEOrderKnightBGND.nif\0";

            input.BPSL = new List <(INDX INDX, BNAM BNAM, CNAM CNAM)>
            {
                Creators.EquipementBodyPart(BodyPartSlot.FootRight, "SEOrderKnightFootM\0", null),
                Creators.EquipementBodyPart(BodyPartSlot.FootLeft, null, null),
                Creators.EquipementBodyPart(BodyPartSlot.AnkleLeft, null, null),
                Creators.EquipementBodyPart(BodyPartSlot.AnkleRight, null, null),
            };

            (input as ARMO).AODT.Type = ArmorType.Boots;
        }