Beispiel #1
0
        internal cMultiPartBody(IList <cBodyPart> pParts, string pSubType, cSection pSection, cMultiPartExtensionData pExtensionData) : base(kMimeType.Multipart, pSubType, pSection)
        {
            Parts = new cBodyParts(pParts);

            if (SubType.Equals("MIXED", StringComparison.InvariantCultureIgnoreCase))
            {
                SubTypeCode = eMultiPartBodySubTypeCode.mixed;
            }
            else if (SubType.Equals("DIGEST", StringComparison.InvariantCultureIgnoreCase))
            {
                SubTypeCode = eMultiPartBodySubTypeCode.digest;
            }
            else if (SubType.Equals("ALTERNATIVE", StringComparison.InvariantCultureIgnoreCase))
            {
                SubTypeCode = eMultiPartBodySubTypeCode.alternative;
            }
            else if (SubType.Equals("RELATED", StringComparison.InvariantCultureIgnoreCase))
            {
                SubTypeCode = eMultiPartBodySubTypeCode.related;
            }
            else
            {
                SubTypeCode = eMultiPartBodySubTypeCode.other;
            }

            ExtensionData = pExtensionData;
        }
Beispiel #2
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Name.Length != 0)
            {
                hash ^= Name.GetHashCode();
            }
            if (Value.Length != 0)
            {
                hash ^= Value.GetHashCode();
            }
            if (ContentType != 0)
            {
                hash ^= ContentType.GetHashCode();
            }
            if (ArtifactSignature.Length != 0)
            {
                hash ^= ArtifactSignature.GetHashCode();
            }
            if (SubType.Length != 0)
            {
                hash ^= SubType.GetHashCode();
            }
            if (SignedTimeStamp.Length != 0)
            {
                hash ^= SignedTimeStamp.GetHashCode();
            }
            return(hash);
        }
Beispiel #3
0
        private PixelFormat subtypeToPixelFormat(SubType subType)
        {
            switch (subType)
            {
            case SubType.RGB24: {
                return(PixelFormat.Format24bppRgb);
            }

            case SubType.RGB555: {
                return(PixelFormat.Format16bppRgb555);
            }

            case SubType.RGB32: {
                return(PixelFormat.Format32bppRgb);
            }

            case SubType.RGB565: {
                return(PixelFormat.Format16bppRgb565);
            }

            default: {
                return(PixelFormat.Format24bppRgb);
            }
            }
        }
Beispiel #4
0
 public Message(MsgType MessageType, SubType Stype, string Parameter, string Username)
 {
     this.Mtype     = MessageType;
     this.Stype     = Stype;
     this.Parameter = Parameter;
     this.Username  = Username;
 }
 public CoolerMaster(string _type, SubType _subType, string _Name)
 {
     this.Type    = _type;
     this.subType = _subType;
     this.Name    = _Name;
     this.Icon    = "/HueHue;component/Icons/Devices/CoolerMaster.png";
 }
Beispiel #6
0
        public bool TypeMatches(ToffeeNetwork network, object o)
        {
            Type            t          = o.GetType();
            ToffeeValueType toffeeType = GetToffeeValueTypeFromType(network, t);

            if (toffeeType == BaseType)
            {
                if ((toffeeType != ToffeeValueType.Array) && (toffeeType != ToffeeValueType.Struct))
                {
                    return(true);
                }
                else
                {
                    if (t.IsArray)
                    {
                        return(SubType.TypeMatches(network, t.GetElementType()));
                    }
                    else if ((t.IsValueType) && (network.HasObject <ToffeeStruct>(t.FullName)))
                    {
                        return(StructId == network.GetObject <ToffeeStruct>(t.FullName).ObjectId);
                    }
                }
            }

            return(false);
        }
        public override void ApplySnapshot(INode node, IMap <I, S> snapshot)
        {
            StateTreeUtils.Typecheck(this, snapshot);

            var map = GetValue(node);

            var keysmap = map.Keys.Aggregate(new Map <I, bool>(), (acc, key) =>
            {
                acc[key] = false;
                return(acc);
            });

            foreach (var pair in snapshot)
            {
                map[pair.Key]     = SubType.Create(pair.Value, node.Environment);
                keysmap[pair.Key] = true;
            }

            foreach (var pair in keysmap)
            {
                if (!pair.Value)
                {
                    map.Remove(pair.Key);
                }
            }
        }
        public bool Create(SubTypeDto subTypeDto)
        {
            using (UnitOfWork unitOfWork = new UnitOfWork())
            {
                var subType = new SubType()
                {
                    Id        = subTypeDto.Id,
                    IsDeleted = false,
                    DeletedOn = subTypeDto.DeletedOn,
                    Title     = subTypeDto.Title,
                    CreatedOn = DateTime.Now,
                    CreatorId = subTypeDto.Creator.Id,
                    CatalogId = subTypeDto.Catalog.Id
                };

                if (subType.Title.Equals("Unsorted"))
                {
                    return(true);
                }

                unitOfWork.SubTypeRepository.Create(subType);

                return(unitOfWork.Save());
            }
        }
        public bool Delete(int id)
        {
            using (UnitOfWork unitOfWork = new UnitOfWork())
            {
                SubType result = unitOfWork.SubTypeRepository.GetById(id);

                if (result == null)
                {
                    return(false);
                }

                if (result.Title.Equals("Unsorted"))
                {
                    return(true);
                }

                TorrentService torrentService = new TorrentService();

                List <TorrentDto> torrents = torrentService.GetAllBySubTypeWithDeleted(id).ToList();

                CatalogDto unsortedC = catalogService.GetAllWithTitle("Unsorted").FirstOrDefault();
                SubTypeDto unsortedS = GetAllWithTitle(unsortedC.Id, "Unsorted").FirstOrDefault();

                foreach (var item in torrents)
                {
                    item.Catalog = unsortedC;
                    item.SybType = unsortedS;
                    torrentService.Update(item);
                }

                unitOfWork.SubTypeRepository.Delete(result);

                return(unitOfWork.Save());
            }
        }
        /// <summary>
        /// Removes all components of given type except one subtype.
        /// Assumes that only a single component will be left, and returns it.
        /// </summary>
        /// <typeparam name="Type"></typeparam>
        /// <typeparam name="SubType"></typeparam>
        /// <returns></returns>
        protected SubType RemoveComponentsOfTypeExceptSubtype <Type, SubType>()
            where Type : UnityEngine.Object where SubType : UnityEngine.Object
        {
            Type[] components = chunkManager.gameObject.GetComponents <Type>();

            SubType DesiredObject = null;

            for (int i = 0; i < components.Length; i++)
            {
                var comp = components[i];
                if (comp is SubType desired)
                {
                    if (DesiredObject == null)
                    {
                        DesiredObject = desired;
                    }
                    else
                    {
                        throw new Exception("More than one component of the subtype was found");
                    }
                }
                else
                {
                    Destroy(comp);
                }
            }

            return(DesiredObject);
        }
Beispiel #11
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="node"></param>
        public override void Parse(XmlNode node)
        {
            m_BuildAction = (BuildAction)Enum.Parse(typeof(BuildAction),
                                                    Helper.AttributeValue(node, "buildAction", m_BuildAction.ToString()));
            m_SubType = (SubType)Enum.Parse(typeof(SubType),
                                            Helper.AttributeValue(node, "subType", m_SubType.ToString()));

            if (node == null)
            {
                throw new ArgumentNullException("node");
            }

            m_Path = Helper.InterpolateForEnvironmentVariables(node.InnerText);
            if (m_Path == null)
            {
                m_Path = "";
            }

            m_Path  = m_Path.Trim();
            m_Valid = true;
            if (!File.Exists(m_Path))
            {
                m_Valid = false;
                Kernel.Instance.Log.Write(LogType.Warning, "File does not exist: {0}", m_Path);
            }
        }
Beispiel #12
0
        public HPBar(float x, float y, int hp, Team team, SubType type)
        {
            if (type == SubType.Warrior)
            {
                X = x - 8;
                Y = y - 30;
                SetGraphic(new Text(10));
            }
            else if (type == SubType.Building)
            {
                X = x - 16;
                Y = y - 60;
                SetGraphic(new Text(16));
            }
            else
            {
                X = x - 10;
                Y = y - 40;
                SetGraphic(new Text(14));
            }
            _hp = hp;
            _team = team;

            ((Text)Graphic).OutlineColor = Color.Black;
            ((Text)Graphic).OutlineThickness = 2;
            ((Text)Graphic).String = ((int)_hp).ToString();
            if (_team == Team.Blu) ((Text)Graphic).Color = Color.Cyan;
            else ((Text)Graphic).Color = Color.Red;
            LifeSpan = Global.HPBarsUpdateRate;
        }
Beispiel #13
0
 public RazerChroma(string _type, SubType _subType, string _Name)
 {
     this.Type    = _type;
     this.subType = _subType;
     this.Name    = _Name;
     this.Icon    = "/HueHue;component/Icons/Devices/RazerChroma.png";
 }
Beispiel #14
0
 public void Update(SubType subtype)
 {
     if (subtype != null && Exists(subtype.SubTypeID))
     {
         db.SaveChanges();
     }
 }
Beispiel #15
0
    public static void Main()
    {
        TestType v1 = new SubType();

        Foo(v1);
        return;
    }
Beispiel #16
0
        private void AddType(object sender, RoutedEventArgs e)
        {
            if (nameTypeTextBox.Text != "")
            {
                Type newType = new Type();
                newType.TypeName          = nameTypeTextBox.Text;
                newType.TypeAllowToDelete = 1;
                db.Types.Add(newType);
                db.SaveChanges();

                SubType newSubType = new SubType();
                newSubType.TypeId = newType.typeId;
                newSubType.SubTypeAllowToDelete = 0;
                newSubType.SubTypeName          = "Другое";
                db.SubTypes.Add(newSubType);
                db.SaveChanges();

                CallPopup($"Тип {newType.TypeName}\nдобавлен");
                RefreshListBoxType();
                nameTypeTextBox.Text = "";
            }
            else
            {
                CallPopup("Не заполнено поле 'Тип'");
            }
        }
Beispiel #17
0
        public async Task <IActionResult> SetBudget([FromRoute] string id, [FromRoute] SubType subType, [FromBody] Unit <FrequencyValue>[] data)
        {
            if (data == null)
            {
                return(this.BadRequest("Failed to save data."));
            }

            var entity = await this.TableStore.GetAsync(new Tables.Budget {
                Id = id, UserId = this.UserId
            }) ?? new Tables.Budget
            {
                Id = id, UserId = this.UserId
            };

            entity.Data = entity.Data ?? new BudgetData();

            if (subType == SubType.Negative)
            {
                entity.Data.Negative = data;
            }
            else
            {
                entity.Data.Positive = data;
            }

            var result = await this.TableStore.AddOrUpdateAsync(entity);

            if (result.Success())
            {
                return(this.Ok(data));
            }
            return(this.BadRequest("Failed to save data."));
        }
Beispiel #18
0
 public Card(Variant variant, float age = 0f)
 {
     this.variant = variant;
     subType      = Spellbook.getCardSubType(variant);
     type         = Spellbook.getCardType(subType);
     this.age     = age;
 }
Beispiel #19
0
 public void Can_create_with_convertible_type()
 {
     var Complex = new SubType();
     var a = Immutable.Build<HazAComplexType>(new { Complex });
     Assert.IsNotNull(a.Complex);
     Assert.AreSame(Complex, a.Complex);
 }
        public ActionResult NewType(Int32 id, Int32 sid, Int32 tid)
        {
            var TypeCont = new TypeConteiner();

            if (id == 0)
            {
                var Main = new ProdType()
                {
                    Id = -1
                };
                TypeCont.Main.Add(Main);
            }
            else if (sid == 0)
            {
                var Sub = new SubType()
                {
                    Id = -1
                };
                TypeCont.SubList.Add(Sub);
            }
            else if (tid == 0)
            {
                var Th = new ThSubType()
                {
                    Id = -1
                };
                TypeCont.ThList.Add(Th);
            }
            return(View("TypeForm", TypeCont));
        }
        public static List <string> GetSubTypes(Dictionary <string, string> query = null)
        {
            try
            {
                string queryString = string.Empty;
                HttpResponseMessage stringTask;
                List <string>       superTypes = new List <string>();
                query = QueryBuilderHelper.GetDefaultQuery(query);

                using (HttpClient client = QueryBuilderHelper.SetupClient())
                {
                    stringTask = QueryBuilderHelper.BuildTaskString(query, ref queryString, client, ResourceTypes.SubTypes);
                    SubType type = QueryBuilderHelper.CreateObject <SubType>(stringTask);
                    superTypes.AddRange(type.Types);
                    return(superTypes);
                }
            }
            catch (Exception ex)
            {
                List <string> errors = new List <string>()
                {
                    ex.Message
                };
                return(errors);
            }
        }
Beispiel #22
0
        private void DetermineType()
        {
            if (subType == SubType.Unknown)
            {
                // Look for the first magic four bytes of the file
                // This also allows us to determine whether it is
                // Surfer 6 or Surfer 7 binary format
                using (FileStream stream = new FileStream(Location.LocalPath, FileMode.Open, FileAccess.Read))
                    using (BinaryReader reader = EndianBinaryReader.CreateForLittleEndianData(stream))
                    {
                        Int32 magic = reader.ReadInt32();
                        switch (magic)
                        {
                        case 0x41415344:
                            subType = SubType.SurferAscii;
                            break;

                        case 0x42425344:
                            subType = SubType.Surfer6Binary;
                            break;

                        case 0x42525344:
                            subType = SubType.Surfer7Binary;
                            break;

                        default:
                            subType = SubType.Unknown;
                            break;
                        }
                    }
            }
        }
Beispiel #23
0
        public Feature(FeatureDefinition dto)
        {
            FeatureName = dto.Name;
            Title       = dto.DisplayName;
            // TODO:  The server should also send a feature ID wit each feature. In the meantime, use the FeatureName
            FeatureId = dto.Name;

            // TODO: This needs to be redone in a more generic fashion
            string[] methods = dto.MethodNames.Split(',');

            FeatureMethodName = methods[methods.Length - 1];
            MethodName        = methods[methods.Length - 1];
            if (FeatureMethodName.Contains("launch"))
            {
                this.FeatureType = FeatureType.Action;
            }
            else if (FeatureMethodName.Contains("change"))
            {
                this.FeatureType = FeatureType.Selection;

                var     index = FeatureMethodName.IndexOf("change");
                string  type  = FeatureMethodName.Remove(index, "change".Length);
                SubType st    = SubType.BrewStrength; //SubType.Undefined;
                Enum.TryParse(type, out st);
                this.SubType = st;
            }
        }
Beispiel #24
0
        public StorageItemInfo(IStorageItem storageItem, SubType subType = SubType.None) : base()
        {
            this.StorageItem = storageItem;
            this.DateCreated = storageItem.DateCreated;
            this.IsFile      = storageItem.IsOfType(StorageItemTypes.File);
            IsFullFitImage   = true;
            this.Name        = storageItem.Name;
            this.Path        = storageItem.Path;
            this.SubType     = subType;
            //폴더이거나 파일 연결의 경우 FAL등록
            if (!IsFile || subType == SubType.FileAssociation)
            {
                //FAL추가 여부 체크
                CheckFutureAccessList(storageItem);
            }
            //표시 이름 설정
            this.SetDisplayName();

            var storageProvider = storageItem as IStorageItemPropertiesWithProvider;

            if (storageProvider != null)
            {
                IsNetworkStorage = storageProvider?.Provider.Id.ToLower() == "network";
            }
        }
Beispiel #25
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (ArtifactLink.Length != 0)
            {
                hash ^= ArtifactLink.GetHashCode();
            }
            hash ^= originServerCerts_.GetHashCode();
            if (ArtifactSignature.Length != 0)
            {
                hash ^= ArtifactSignature.GetHashCode();
            }
            if (SubType.Length != 0)
            {
                hash ^= SubType.GetHashCode();
            }
            if (Signature.Length != 0)
            {
                hash ^= Signature.GetHashCode();
            }
            if (SignedTimeStamp.Length != 0)
            {
                hash ^= SignedTimeStamp.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Beispiel #26
0
        /// <summary>
        /// Get type of two
        /// </summary>
        /// <param name="second">Second type which compares</param>
        /// <returns>Main type</returns>
        private JType GetEitherType(JType second)
        {
            var sub = Either(this, second);

            if (Type == JTypeEnum.Array)
            {
                if (second.IsNull)
                {
                    return(this);
                }

                if (IsNull)
                {
                    return(second);
                }

                var locale = SubType.GetEitherType(second.SubType).GetEitherType(CreateNull());

                if (locale != SubType)
                {
                    return new JType {
                               Type = JTypeEnum.Array, SubType = locale
                    }
                }
                ;
            }
            if (Type == sub.Type)
            {
                return(this);
            }

            return(sub.GetEitherType(CreateNull()));
        }
Beispiel #27
0
        public static void Delete(SubType pData)
        {
            cSettings.GetSettings("");
            cSQL   lSql  = new cSQL();
            string lResp = lSql.ConnectSQL(Splosno.AppSQLName);

            if (lResp.Length > 0)
            {
                throw new Exception(lResp);
            }

            StringBuilder sSQL = new StringBuilder();

            sSQL.AppendLine("DELETE FROM SubTypes  ");
            sSQL.AppendLine("WHERE (ID = @ID) ");
            sSQL.AppendLine(" ");

            SqlParameter[] sqlParams = new SqlParameter[] {
                new SqlParameter("@ID", pData.ID)
            };

            string lErr = lSql.ExecuteQuery(sSQL, sqlParams);

            lSql.DisconnectSQL();

            if (lErr.Length > 0)
            {
                throw new Exception(lErr);
            }
        }
Beispiel #28
0
        public static string SignTypeName(SubType _type)
        {
            switch (_type)
            {
            case SubType.atk_blunt:
                return("钝击");

            case SubType.atk_chop:
                return("劈砍");

            case SubType.atk_stab:
                return("突刺");

            case SubType.dfd_block:
                return("格挡");

            case SubType.dfd_dodge:
                return("闪避");

            case SubType.dfd_parry:
                return("招架");

            case SubType.none:
                return("");
            }
            return("");
        }
Beispiel #29
0
        public bool configureSWFE(float SampleFrequency, float CenterFrequency, float Usefulbwhz, float Gaindb,
                                  string InputFilename, InputType inputType, SubType subType)
        {
            try
            {
                //FeinHz = 12.5F;
                //Usefulbwhz = 2.5F;
                configure_SWFE csw = new configure_SWFE
                {
                    Filename                   = InputFilename,
                    Inputsignaltype            = inputType,
                    Inputsignalsubtypefromfile = subType,
                    Feinhz     = SampleFrequency * 1000000, // Sample Frequency
                    Fchz       = CenterFrequency * 1000000, // Center Frequency
                    Usefulbwhz = Usefulbwhz * 1000000,      // 2.5
                    Gaindb     = Gaindb,
                    Wideband   = false,
                };

                Header h = new Header {
                    Sequence = Sequence++, Opcode = OPCODE.ConfigureSwfe, MessageData = MessageExtensions.ToByteString(csw)
                };
                lastCommand = "configure_SWFE";
                Send(h);
                log.Debug("configureSWFE sent");
                return(true);
            }
            catch (Exception ex)
            {
                log.Error("configureHWFE failed", ex);
            }
            return(false);
        }
Beispiel #30
0
        private Dictionary <string, long> SaveInternal(Stream s, bool forReal)
        {
            var ret = new Dictionary <string, long>();
            var w   = new BinaryWriter(s);

            w.Write("BIZHAWK-CDL-2");
            w.Write(SubType.PadRight(15));
            w.Write(Count);
            w.Flush();
            long addr = s.Position;

            if (forReal)
            {
                foreach (var kvp in this)
                {
                    w.Write(kvp.Key);
                    w.Write(kvp.Value.Length);
                    w.Write(kvp.Value);
                }
            }
            else
            {
                foreach (var kvp in this)
                {
                    addr        += kvp.Key.Length + 1;              //assumes shortly-encoded key names
                    addr        += 4;
                    ret[kvp.Key] = addr;
                    addr        += kvp.Value.Length;
                }
            }

            w.Flush();
            return(ret);
        }
Beispiel #31
0
        private async void Save_Clicked(object sender, EventArgs e)
        {
            PlantType newType;

            if (enterNewType.IsToggled)
            {
                newType = new PlantType()
                {
                    PlantTypeName = typeEntry.Text,
                };
                MainPage.conn.Insert(newType);
            }
            else
            {
                newType = (PlantType)typePicker.SelectedItem;
            }
            SubType newSubType = new SubType()
            {
                SubTypeName   = subTypeEntry.Text,
                DaysToHarvest = Int32.Parse(daysEntry.SelectedItem.ToString()),
                PlantTypeId   = newType.PlantTypeId,
                Description   = descEntry.Text
            };

            MainPage.conn.Insert(newSubType);

            MainPage.LoadListFromTables();
            await Navigation.PopAsync();
        }
        private void GetSubType()
        {
            switch (ComboBox_SubType.SelectedIndex)
            {
            case 0:
                Subtype = RazerChroma.SubType.Keyboard;
                break;

            case 1:
                Subtype = RazerChroma.SubType.Mouse;
                break;

            case 2:
                Subtype = RazerChroma.SubType.Headset;
                break;

            case 3:
                Subtype = RazerChroma.SubType.Mousepad;
                break;

            case 4:
                Subtype = RazerChroma.SubType.Keypad;
                break;

            default:
                Subtype = RazerChroma.SubType.All;
                break;
            }
        }
Beispiel #33
0
 private void ShowSubscribeSite(SubType subtype)
 {
     Log.InfoFormat("Show sub site {0}", subtype);
     var url = SubscriptionModule.Get().GetSubscribeUrl(subtype);
     if (url != null)
     {
         Program.LaunchUrl(url);
     }
 }
        public bool shortMistake = false; //if mistake is of short type (either pause or speakingtime) it stil does not have to be a mistake

        public Mistake(Type type, SubType subType, GravityType gravityType)
        {
            timeStarted = DateTime.Now.TimeOfDay.TotalMilliseconds;            
            this.subType = subType;
            this.type = type;
            this.gravityType = gravityType;
            setGravity(gravityType);
            hasEnded = false;
            volumeMistakeLongEnough = false;
            classtype = "Mistake";
        }
Beispiel #35
0
       public void afficherAutomobile(SubType soustype)
       {
           switch (soustype)
           {
               case SubType.Automobile: foreach (Automobile a in autos)
                   {
                       if (a is Voiture)
                       {
                           Console.WriteLine(a.ToString());
                       }
                   }
                   break;
               case SubType.Moto: foreach (Automobile a in autos)
                   {
                       if (a is Moto)
                       {
                           Console.WriteLine(a.ToString());
                       }
                   }
                   break;

           }
       }
Beispiel #36
0
		/// <summary>
		/// 
		/// </summary>
		/// <param name="node"></param>
		public override void Parse(XmlNode node)
		{
			if( node == null )
			{
				throw new ArgumentNullException("node");
			}
			string path = Helper.AttributeValue(node, "path", ".");
			string pattern = Helper.AttributeValue(node, "pattern", "*");
			bool recurse = (bool)Helper.TranslateValue(typeof(bool), Helper.AttributeValue(node, "recurse", "false"));
			bool useRegex = (bool)Helper.TranslateValue(typeof(bool), Helper.AttributeValue(node, "useRegex", "false"));
			m_BuildAction = (BuildAction)Enum.Parse(typeof(BuildAction), 
				Helper.AttributeValue(node, "buildAction", m_BuildAction.ToString()));
			m_SubType = (SubType)Enum.Parse(typeof(SubType), 
				Helper.AttributeValue(node, "subType", m_SubType.ToString()));
			m_ResourceName = Helper.AttributeValue(node, "resourceName", m_ResourceName.ToString());
			this.m_CopyToOutput = (CopyToOutput) Enum.Parse(typeof(CopyToOutput), Helper.AttributeValue(node, "copyToOutput", this.m_CopyToOutput.ToString()));
			this.m_Link = bool.Parse(Helper.AttributeValue(node, "link", bool.FalseString));


			if(path != null && path.Length == 0)
			{
				path = ".";//use current directory
			}
			//throw new WarningException("Match must have a 'path' attribute");

			if(pattern == null)
			{
				throw new WarningException("Match must have a 'pattern' attribute");
			}

			path = Helper.NormalizePath(path);
			if(!Directory.Exists(path))
			{
				throw new WarningException("Match path does not exist: {0}", path);
			}

			try
			{
				if(useRegex)
				{
					m_Regex = new Regex(pattern);
				}
			}
			catch(ArgumentException ex)
			{
				throw new WarningException("Could not compile regex pattern: {0}", ex.Message);
			}

			RecurseDirectories(path, pattern, recurse, useRegex);

			foreach(XmlNode child in node.ChildNodes)
			{
				IDataNode dataNode = Kernel.Instance.ParseNode(child, this);
				if(dataNode is ExcludeNode)
				{
					ExcludeNode excludeNode = (ExcludeNode)dataNode;
					if (m_Files.Contains(Helper.NormalizePath(excludeNode.Name)))
					{
						m_Files.Remove(Helper.NormalizePath(excludeNode.Name));
					}
				}
			}

			if(m_Files.Count < 1)
			{
				throw new WarningException("Match returned no files: {0}{1}", Helper.EndPath(path), pattern);
			}
			m_Regex = null;
		}
Beispiel #37
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="node"></param>
        public override void Parse(XmlNode node)
        {
            m_BuildAction = (BuildAction)Enum.Parse(typeof(BuildAction),
                Helper.AttributeValue(node, "buildAction", m_BuildAction.ToString()));
            m_SubType = (SubType)Enum.Parse(typeof(SubType),
                Helper.AttributeValue(node, "subType", m_SubType.ToString()));
            m_ResourceName = Helper.AttributeValue(node, "resourceName", m_ResourceName.ToString());
            this.m_Link = bool.Parse(Helper.AttributeValue(node, "link", bool.FalseString));
            if ( this.m_Link == true )
            {
                this.m_LinkPath = Helper.AttributeValue( node, "linkPath", string.Empty );
            }
            this.m_CopyToOutput = (CopyToOutput) Enum.Parse(typeof(CopyToOutput), Helper.AttributeValue(node, "copyToOutput", this.m_CopyToOutput.ToString()));
            this.m_PreservePath = bool.Parse( Helper.AttributeValue( node, "preservePath", bool.FalseString ) );

            if( node == null )
            {
                throw new ArgumentNullException("node");
            }

            m_Path = Helper.InterpolateForEnvironmentVariables(node.InnerText);
            if(m_Path == null)
            {
                m_Path = "";
            }

            m_Path = m_Path.Trim();
            m_Valid = true;
            if(!File.Exists(m_Path))
            {
                m_Valid = false;
                Kernel.Instance.Log.Write(LogType.Warning, "File does not exist: {0}", m_Path);
            }
        }
 public static String getStringOfSubType(SubType subType)
 {
     string temp = "";
     switch (subType)
     {
         case SubType.loud:
             {
                 temp = "loud volume";
                 break;
             }
         case SubType.soft:
             {
                 temp = "soft volume";
                 break;
             }
         case SubType.longPause:
             {
                 temp = "long pause";
                 break;
             }
         case SubType.longSpeakingTime:
             {
                 temp = "long speaking time";
                 break;
             }
         case SubType.badPosture:
             {
                 temp = "bad posture"; 
                 break;
             }
         case SubType.noHandMovement:
             {
                 temp = "no hand movement";
                 break;
             }
         case SubType.tooMuchHandMovement:
             {
                 temp = "too much hand movement";
                 break;
             }
         case SubType.shortSpeakingTime:
             {
                 temp = "short speaking time";
                 break;
             }
         case SubType.shortPause:
             {
                 temp = "short pause";
                 break;
             }
         case SubType.moduleVolume:
             {
                 temp = "no mistake registered";
                 break;
             }
     }
     return temp;
 }
Beispiel #39
0
		/// <summary>
		/// 
		/// </summary>
		/// <param name="node"></param>
		public override void Parse(XmlNode node)
		{
			m_BuildAction = (BuildAction)Enum.Parse(typeof(BuildAction), 
				Helper.AttributeValue(node, "buildAction", m_BuildAction.ToString()));
			m_SubType = (SubType)Enum.Parse(typeof(SubType), 
				Helper.AttributeValue(node, "subType", m_SubType.ToString()));

			if( node == null )
			{
				throw new ArgumentNullException("node");
			}

			m_Path = Helper.InterpolateForEnvironmentVariables(node.InnerText);
			if(m_Path == null)
			{
				m_Path = "";
			}

			m_Path = m_Path.Trim();
			m_Valid = true;
			if(!File.Exists(m_Path))
			{
				m_Valid = false;
				Kernel.Instance.Log.Write(LogType.Warning, "File does not exist: {0}", m_Path);
			}
		}