コード例 #1
0
 protected void SetSerializableConentFromFlags()
 {
     SerializableContent    = "";
     NonSerializableContent = "";
     foreach (object value in Enum.GetValues(typeof(SerializationContent)))
     {
         if (!(value is SerializationContent))
         {
             continue;
         }
         SerializationContent serializationContent = (SerializationContent)value;
         if ((Content & serializationContent) == serializationContent && serializationContent != SerializationContent.All && Content != SerializationContent.All)
         {
             if (!string.IsNullOrEmpty(NonSerializableContent))
             {
                 NonSerializableContent += ", ";
             }
             NonSerializableContent += GetFlagContentString(serializationContent, serializable: false);
             NonSerializableContent  = NonSerializableContent.TrimStart(',');
             if (!string.IsNullOrEmpty(SerializableContent))
             {
                 SerializableContent += ", ";
             }
             SerializableContent += GetFlagContentString(serializationContent, serializable: true);
             SerializableContent  = SerializableContent.TrimStart(',');
         }
     }
 }
コード例 #2
0
        protected void SetSerializableContentFromFlags()
        {
            this.SerializableContent    = "";
            this.NonSerializableContent = "";
            Array values = Enum.GetValues(typeof(SerializationContent));

            foreach (object item in values)
            {
                if (item is SerializationContent)
                {
                    SerializationContent serializationContent = (SerializationContent)item;
                    if ((this.Content & serializationContent) == serializationContent && serializationContent != SerializationContent.All && this.Content != SerializationContent.All)
                    {
                        if (this.NonSerializableContent.Length != 0)
                        {
                            this.NonSerializableContent += ", ";
                        }
                        this.NonSerializableContent += this.GetFlagContentString(serializationContent, false);
                        this.NonSerializableContent  = this.NonSerializableContent.TrimStart(',');
                        if (this.SerializableContent.Length != 0)
                        {
                            this.SerializableContent += ", ";
                        }
                        this.SerializableContent += this.GetFlagContentString(serializationContent, true);
                        this.SerializableContent  = this.SerializableContent.TrimStart(',');
                    }
                }
            }
        }
コード例 #3
0
        internal string GetFlagContentString(SerializationContent flag, bool serializable)
        {
            switch (flag)
            {
            case SerializationContent.All:
                return("");

            case SerializationContent.Appearance:
                if (serializable)
                {
                    return("MapCore.BuildNumber, *.Name, *.LedDimColor, *.NeedleStyle, *.Cap*, CircularPointer.Type, LinearPointer.Type, *.Shape, *.Fill*, *.Frame*, *.Back*, *.Border*, *.SeparatorColor, *.DecimalColor, *.DigitColor, *.TextColor, *.Color, *.Shadow*, *.AntiAliasing, *.GlassEffect, *.FontColor");
                }
                return("");

            default:
                throw new InvalidOperationException("Serializer - Unsupported serialization content flag.");
            }
        }