예제 #1
0
 public SqlObject(string name, int objectId, int parentObjectId, ObjectType objectType)
 {
     Name = name;
     ObjectId = objectId;
     ObjectType = objectType;
     ParentObjectId = parentObjectId;
 }
        /// <summary>
        /// Deletes specified object
        /// </summary>
        /// <param name="objectID">ID of the object to delete</param>
        /// <param name="objectType">Type of the object</param>
        /// <returns>Operation status</returns>
        public DeleteObjectStatus DeleteObject(long objectID, ObjectType objectType)
        {
            string type = ObjectType2String(objectType);
            string result = _service.delete(_apiKey, _token, type, objectID);

            return StatusMessageParser.ParseDeleteObjectStatus(result);
        }
 /// <summary>
 /// Asynchronously deletes specified object
 /// </summary>
 /// <param name="objectID">ID of the object to delete</param>
 /// <param name="objectType">Type of the object</param>
 /// <param name="deleteObjectCompleted">Callback method which will be invoked after delete operation completes</param>
 /// <exception cref="ArgumentException">Thrown if <paramref name="deleteObjectCompleted"/> is null</exception>
 public void DeleteObject(
     long objectID,
     ObjectType objectType,
     OperationFinished<DeleteObjectResponse> deleteObjectCompleted)
 {
     DeleteObject(objectID, objectType, deleteObjectCompleted, null);
 }
예제 #4
0
        public Friendly(ObjectType mObjectType, ContentManager content,
                        SpriteState defaultState, Vector2 SpritePosition, Vector2 mDefaultTarget, int mAttackLevel, int mDefenseLevel)
            : base(mObjectType, content, defaultState, SpritePosition, Hostility.FRIENDLY)
        {
            this.DefaultTarget = mDefaultTarget;
            this.mCurrentTarget = mDefaultTarget;
            this.hostility = Hostility.FRIENDLY;
            mBehaviorFriendly = new BehaviorFriendly(1.0f);
            mFieldOfViewSize = 300;

            mObjectID = mGlobalID;
            mGlobalID++;
            SetUnitAnimation();

            mFriendlyAttribute = new FriendlyAttribute(this, content);
            if (GameObject.FromSaveGameState == FromSaveGame.NEWGAME)
            {
                SetAttributes();
            }
            this.FriendlyAggroMode = FriendlyAggroMode.MOVING;

            for (int i = 0; i < mAttackLevel; i++)
            {
                mFriendlyAttribute.UpgradeAttack();
            }
            for (int i = 0; i < mDefenseLevel; i++)
            {
                mFriendlyAttribute.UpgradeDefense();
            }
        }
예제 #5
0
 public Texture(string name, Sprite sprite, Bitmap image)
 {
     Sprite = sprite;
     Image = image;
     Name = name;
     Type = ObjectType.Texture;
 }
        public override int ReadPrefix(string shortSha, out ObjectId id, out UnmanagedMemoryStream data, out ObjectType objectType)
        {
            id = null;
            data = null;
            objectType = default(ObjectType);

            ObjectId matchingKey;

            int ret = ExistsPrefix(shortSha, out matchingKey);

            if (ret != (int)ReturnCode.GIT_OK)
            {
                return ret;
            }

            ret = Read(matchingKey, out data, out objectType);

            if (ret != (int)ReturnCode.GIT_OK)
            {
                return ret;
            }

            id = matchingKey;

            return (int)ReturnCode.GIT_OK;
        }
 public PrimitiveObject(string id, ObjectType objectType,
     Transform3D transform, IVertexData vertexData, Effect effect, Color color, float alpha)
     : base(id, objectType, transform, effect, color, alpha)
 {
     this.vertexData = vertexData;
     this.effect = effect;
 }
예제 #8
0
파일: Helpers.cs 프로젝트: VALLIS-NERIA/osu
 /// <summary>
 /// 构造物件
 /// </summary>
 /// <param name="x1">x坐标</param>
 /// <param name="y1">y坐标</param>
 /// <param name="hitTime1">击打时间</param>
 /// <param name="type1">物件种类</param>
 public HitObject(int x1, int y1, int hitTime1, ObjectType type1)
 {
     x = x1;
     y = y1;
     hitTime = hitTime1;
     type = type1;
 }
예제 #9
0
 public TrackCamera3D(string id, ObjectType objectType,
     Transform3D transform, ProjectionParameters projectionParameters,
     Viewport viewPort, Camera3DTrack track)
     : base(id, objectType, transform, projectionParameters, viewPort)
 {
     this.track = track;
 }
예제 #10
0
 public GameObject RequestPoolObject(ObjectType type, Vector3 position, Quaternion rotation)
 {
     if(objectPools[type].Count > 0)
     {
         // Get object of the specified kind from the pool
         GameObject obj = objectPools[type].Pop();
         // Set the specified position and rotation
         obj.transform.position = position;
         obj.transform.rotation = rotation;
         // Enable the object
         obj.SetActive(true);
         return obj;
     }
     else if (objectCount < HardSizeLimit)
     {
         // Create new object of the specified type and set it as a child of the pool game object
         GameObject obj = Instantiate (ObjectPrefabs[(int)type]);
         obj.transform.parent = transform;
         // Set the specified position and rotation
         obj.transform.position = position;
         obj.transform.rotation = rotation;
         // Update object count
         ++objectCount;
         return obj;
     }
     else
     {
         throw new System.Exception("Object Pool hard size limit reached. No more pool objects will be instantiated.");
     }
 }
예제 #11
0
 public void DisablePoolObject(GameObject obj, ObjectType type)
 {
     // Disable the object
     obj.SetActive(false);
     // Put it in the pool for this kind of object
     objectPools[type].Push(obj);
 }
예제 #12
0
 protected ConcreteObject(ObjectType objectType, ConcreteObjectBuilder builder)
     : base(objectType, builder)
 {
     m_name = builder.Name;
     m_color = builder.Color;
     m_materialID = builder.MaterialID;
 }
예제 #13
0
        private FileMode(int mode, ObjectType type, EqualsDelegate equals)
        {
            if (equals == null)
                throw new ArgumentNullException("equals");

            this.Equals = equals;

            this.Bits = mode;
            this.ObjectType = type;

            if (mode != 0)
            {
                byte[] tmp = new byte[10];
                int p = tmp.Length;

                while (mode != 0)
                {
                    tmp[--p] = (byte)('0' + (mode & 07));
                    mode >>= 3;
                }

                _octalBytes = new byte[tmp.Length - p];
                for (int k = 0; k < _octalBytes.Length; k++)
                {
                    _octalBytes[k] = tmp[p + k];
                }
            }
            else
            {
                _octalBytes = new byte[] { (byte)'0' };
            }
        }
예제 #14
0
 public ObjectInfo(ObjectType objectType, string hash, int? size, string name)
 {
     this.objectType = objectType;
     this.hash = hash;
     this.size = size;
     this.name = name;
 }
예제 #15
0
 protected PackedObjectReader(PackFile packFile, long objectOffset, long dataOffset, long size, ObjectType type)
     : base(type, size)
 {
     this.PackFile = packFile;
     this.ObjectOffset = objectOffset;
     this.DataOffset = dataOffset;
 }
 public UITextObject(string id, ObjectType objectType, Transform2D transform,
     Color color, SpriteEffects spriteEffects, float layerDepth, string text, SpriteFont spriteFont, bool isVisible)
     : base(id, objectType, transform, color, spriteEffects, layerDepth, isVisible)
 {
     this.spriteFont = spriteFont;
     this.text = text;
 }
예제 #17
0
 public OBISCodesForm(GXManufacturerCollection manufacturers, string selectedManufacturer, ObjectType Interface, string ln)
 {
     InitializeComponent();
     ManufacturerNameCH.Width = -2;
     NewBtn.Enabled = manufacturers.Count != 0;
     EditBtn.Enabled = RemoveBtn.Enabled = false;
     bool bSelected = false;
     //Add manufacturers
     foreach (GXManufacturer it in manufacturers)
     {
     if (!it.Removed)
     {
         ListViewItem item = AddManufacturer(it);
         if (it.Identification == selectedManufacturer)
         {
             bSelected = item.Selected = true;
         }
     }
     }
     //Select first item
     if (!bSelected && ManufacturersList.Items.Count != 0)
     {
     ManufacturersList.Items[0].Selected = true;
     }
     //Add OBIS Codes.
     ManufacturersList_SelectedIndexChanged(null, null);
     //Select OBIS code by Logical name.
     if (ManufacturersList.SelectedItems.Count == 1)
     {
     ShowOBISCOdes(((GXManufacturer)ManufacturersList.SelectedItems[0].Tag).ObisCodes, Interface, ln);
     }
     this.ManufacturersList.SelectedIndexChanged += new System.EventHandler(this.ManufacturersList_SelectedIndexChanged);
 }
예제 #18
0
        public static async Task<ObjectWriteResult> CreateTempFile(ObjectType type, int length, byte[] data, string rootPath)
        {
            var name = Path.Combine(rootPath, "tmp" + _random.Next(0, int.MaxValue));
            
            using (var file = File.OpenWrite(name))
            using (var stream = CompressionStream.CompressStream(file))
            using (var md = new MessageDigest())
            {
                var header = Encoding.ASCII.GetBytes(string.Format("{0} {1}\0", type.ToTypeCode(), length));

                await stream.WriteAsync(header, 0, header.Length);
                await stream.WriteAsync(data, 0, data.Length);

                md.Update(header);
                md.Update(data);

                var digest = md.Digest();

                return new ObjectWriteResult
                {
                    FileInfo = new FileInfo(name),
                    ObjectId = Helper.ByteArrayToId(digest)
                };
            }
        }
예제 #19
0
        public int[] GetObjectsByOptionalData (ObjectType objectType, ObjectOptionalDataType dataType, string data)
        {
            List<int> objectIds = new List<int>();

            using (DbConnection connection = GetMySqlDbConnection())
            {
                connection.Open();

                DbCommand command =
                    GetDbCommand(
                        "SELECT" + objectOptionalDataFieldSequence + "WHERE ObjectTypes.Name='" + objectType.ToString() + "' " +
                        "AND ObjectOptionalDataTypes.Name='" + dataType.ToString() + "' " +
                        "AND ObjectOptionalData.Data='" + data.Replace("'", "''") + "';", connection);

                using (DbDataReader reader = command.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        objectIds.Add(reader.GetInt32(1));
                    }

                    return objectIds.ToArray();
                }
            }
        }
예제 #20
0
    public void verifyTarget(GameObject obj)
    {
        if (_targetType != ObjectType.Unknown)
        {
            if (obj == _target)
            {
                if (hoverObject != null)
                {
                    if (hoverObject.GetComponent<ActionTile>())
                    {
                        Debug.Log("item");
                        hoverObject.GetComponent<ActionTile>().ClickAction(this.gameObject);
                    }
                    if (hoverObject.GetComponent<ActionCharacter>())
                    {
                        Debug.Log("character");
                        hoverObject.GetComponent<ActionCharacter>().ClickAction();
                    }
                    hoverObject = null;
                }
                else
                {
                    Debug.Log("no action possible");
                }

                _targetPos.x = this.transform.position.x;
                _targetPos.y = this.transform.position.y;
                scriptAnim.hasAnim = false;
                this.rigidbody.velocity = new Vector3(0, 0, 0);
                _targetType = ObjectType.Unknown;
            }
        }
    }
 public UIMouseObject(string id, ObjectType objectType, Transform2D transform,
 Color color, SpriteEffects spriteEffects, float layerDepth, Texture2D texture, bool isVisible)
     : this(id, objectType, transform, color, spriteEffects, layerDepth, texture, 
         new Rectangle(0, 0, texture.Width, texture.Height),
             new Vector2(texture.Width / 2.0f, texture.Height / 2.0f), isVisible)
 {
 }
예제 #22
0
        private static void ReadHeader(Stream stream, out ObjectType type, out int size)
        {
            size = 0;
            var typeCode = string.Empty;
            var sb = new StringBuilder();
            var inHeader = true;

            while (inHeader)
            {
                var c = (char)stream.ReadByte();
                switch (c)
                {
                    case ' ':
                        typeCode = sb.ToString();
                        sb.Clear();
                        continue;
                    case '\0':
                        size = int.Parse(sb.ToString());
                        sb.Clear();
                        inHeader = false;
                        continue;
                }
                sb.Append(c);
            }

            type = ObjectTypeFromString(typeCode);
        }
예제 #23
0
 /// <summary>
 /// Only derived classes should use this constructor. Creates an Object from parameters
 /// </summary>
 /// <param name="objectType">The ObjectType</param>
 /// <param name="bounds">The Rect bounds</param>
 /// <param name="rotation">Object's rotation</param>
 /// <param name="points">Object's list of points</param>
 internal Object(ObjectType objectType, Rect bounds, float rotation, List<Vector2> points)
 {
     ObjectType = objectType;
     Bounds = bounds;
     Rotation = rotation;
     Points = points;
 }
예제 #24
0
 public GameObject GetObject(ObjectType type, Vector3 pos, Quaternion rot)
 {
     
     switch(type)
     {
         case ObjectType.Bullet:
             tempList = BulletList;
         break;
     }
     itemFound = false;
     for(int i = 0; i < tempList.Count; i++)
     {
         if(!tempList[i].activeInHierarchy)
         {
           //  Debug.Log("ItemFound");
             tempList[i].SetActive(true);
             tempObj = tempList[i];
             tempObj.transform.position = pos;
             tempObj.transform.rotation = rot;
             itemFound = true;
             break;
         }
     }
     if(itemFound)
         return tempObj;
     else
         return CreateNewObject(type, pos, rot);
 }
예제 #25
0
 public ItemDropProfile(ObjectType p_item, bool p_freeze)
 {
     this.equipmentString = "";
     this.item = p_item;
     this.freezeOnAppear = p_freeze;
     this.chance = 100;
 }
 public DrawnActor(string id, ObjectType objectType, Transform3D transform, Effect effect, Color color, float alpha)
     : base(id, objectType, transform)
 {
     this.Effect = effect;
     this.Color = color;
     this.Alpha = alpha;
 }
예제 #27
0
        public Enemy(ObjectType mObjectType, ContentManager content,
            SpriteState defaultState, Castle castle, Vector2 SpritePosition)
            : base(mObjectType, content, defaultState, SpritePosition, Hostility.ENEMY)
        {
            isInPlay = true;
            this.hostility = Hostility.ENEMY;
            mFieldOfViewSize = 200;

            SetUnitAnimation();
            random = new Random();

            y = random.Next(25, 700);
            mDefaultTarget = new Rectangle(1400, y, 200, 775);
            mCurrentTarget = new Vector2(mDefaultTarget.X, mDefaultTarget.Y);

            mBehaviorEnemy = new BehaviorEnemy(1.0f);
            mObjectID = mGlobalID;
            mGlobalID++;

            enemyAttribute = new EnemyAttribute(this, content, castle);
            SetAttributes();
            this.AttackState = AttackState.READY;

            enemyAttribute.UpgradeAttack();
            enemyAttribute.UpgradeDefense();
        }
예제 #28
0
        public long ReadObjectHeader(out ObjectType type)
        {
            if (!IsStartOfStream)
                Rewind();

            long length;

            string typeString = ReadWord().GetString();
            switch (typeString)
            {
                case "blob":
                    type = ObjectType.Blob;
                    break;
                case "commit":
                    type = ObjectType.Commit;
                    break;
                case "tag":
                    type = ObjectType.Tag;
                    break;
                case "tree":
                    type = ObjectType.Tree;
                    break;
                default:
                    throw new ParseException("Unknown type: {0}".FormatWith(typeString));
            }
            length = ReadToNull().Sum(b => b);
            return length;
        }
예제 #29
0
 public Camera3D(string id, ObjectType objectType,
     Transform3D transform, ProjectionParameters projectionParameters, Viewport viewPort)
     : base(id, objectType, transform)
 {
     this.projectionParameters = projectionParameters;
     this.viewPort = viewPort;
 }
예제 #30
0
        public Hero(ObjectType mObjectType, ContentManager content,
            SpriteState defaultState, Vector2 SpritePosition)
            : base(mObjectType, content, defaultState, SpritePosition, Hostility.FRIENDLY)
        {
            mSpriteScale = 0.8f;
            this.mSprite.SpriteScale = mSpriteScale;
            this.hostility = Hostility.FRIENDLY;
            SetUnitAnimation();
            mTarget = SpritePosition;
            mBehaviorHero = new BehaviorHero(1.0f, mTarget);
            mObjectID = mGlobalID;
            mGlobalID++;
            mheroAttribute = new HeroAttribute(this, content);
            SetAttributes();

            int mAttackLevel = (int)HeroAttribute.AttackUpgradeLevel;
            int mDefenseLevel = (int)HeroAttribute.DefenseUpgradeLevel;

            for (int i = 0; i < mAttackLevel; i++)
            {
                mheroAttribute.UpgradeAttack();
            }

            for (int i = 0; i < mDefenseLevel; i++)
            {
                mheroAttribute.UpgradeDefense();
            }
        }
예제 #31
0
 public void BitXorObj(object x, object y, object expected)
 {
     Assert.Equal(expected, ObjectType.BitXorObj(x, y));
 }
예제 #32
0
 public void ObjTst(object x, object y, bool textCompare, object expected)
 {
     Assert.Equal(expected, ObjectType.ObjTst(x, y, textCompare));
 }
예제 #33
0
 public void LikeObj_NullReference(object left, object right)
 {
     Assert.Throws <NullReferenceException>(() => ObjectType.LikeObj(left, right, CompareMethod.Binary));
     Assert.Throws <NullReferenceException>(() => ObjectType.LikeObj(left, right, CompareMethod.Text));
 }
예제 #34
0
 public void LikeObj(object left, object right, object expectedBinaryCompare, object expectedTextCompare)
 {
     Assert.Equal(expectedBinaryCompare, ObjectType.LikeObj(left, right, CompareMethod.Binary));
     Assert.Equal(expectedTextCompare, ObjectType.LikeObj(left, right, CompareMethod.Text));
 }
예제 #35
0
 public void GetObjectValuePrimitive(object obj, object expected)
 {
     Assert.Equal(expected, ObjectType.GetObjectValuePrimitive(obj));
 }
예제 #36
0
 public void StrCatObj(object x, object y, object expected)
 {
     Assert.Equal(expected, ObjectType.StrCatObj(x, y));
 }
예제 #37
0
 public static bool ValidateColor(AspNetCore.ReportingServices.ReportIntermediateFormat.ExpressionInfo color, ObjectType objectType, string objectName, string propertyName, ErrorContext errorContext)
 {
     Global.Tracer.Assert(null != color);
     if (AspNetCore.ReportingServices.ReportIntermediateFormat.ExpressionInfo.Types.Constant == color.Type)
     {
         string stringValue = default(string);
         if (!Validator.ValidateColor(color.StringValue, out stringValue, Validator.IsDynamicImageReportItem(objectType)))
         {
             errorContext.Register(ProcessingErrorCode.rsInvalidColor, Severity.Error, objectType, objectName, propertyName, color.StringValue);
             return(false);
         }
         color.StringValue = stringValue;
     }
     return(true);
 }
예제 #38
0
 private void SetUnitCharge(GXUnitCharge charge, object value)
 {
     if (value != null)
     {
         List <object> tmp, tmp2, it;
         if (value is List <object> )
         {
             tmp = (List <object>)value;
         }
         else
         {
             tmp = new List <object>((object[])value);
         }
         if (tmp[0] is List <object> )
         {
             tmp2 = (List <object>)tmp[0];
         }
         else
         {
             tmp2 = new List <object>((object[])tmp[0]);
         }
         charge.ChargePerUnitScaling.CommodityScale = (sbyte)tmp2[0];
         charge.ChargePerUnitScaling.PriceScale     = (sbyte)tmp2[1];
         if (tmp[1] is List <object> )
         {
             tmp2 = (List <object>)tmp[1];
         }
         else
         {
             tmp2 = new List <object>((object[])tmp[1]);
         }
         ObjectType ot = (ObjectType)Convert.ToInt32(tmp2[0]);
         string     ln = GXCommon.ToLogicalName(tmp2[1]);
         if (ot != ObjectType.None)
         {
             if (Parent != null)
             {
                 charge.Commodity.Target = Parent.FindByLN(ot, ln);
             }
             else
             {
                 charge.Commodity.Target             = GXDLMSClient.CreateObject(ot);
                 charge.Commodity.Target.LogicalName = ln;
             }
         }
         else
         {
             charge.Commodity.Target = null;
         }
         charge.Commodity.Index = (sbyte)tmp2[2];
         List <GXChargeTable> list = new List <GXChargeTable>();
         foreach (object tmp3 in (IEnumerable <object>)tmp[2])
         {
             if (tmp3 is List <object> )
             {
                 it = (List <object>)tmp3;
             }
             else
             {
                 it = new List <object>((object[])tmp3);
             }
             GXChargeTable item = new GXChargeTable();
             item.Index         = ASCIIEncoding.ASCII.GetString((byte[])it[0]);
             item.ChargePerUnit = (Int16)it[1];
             list.Add(item);
         }
         charge.ChargeTables = list.ToArray();
     }
     else
     {
         charge.ChargePerUnitScaling.CommodityScale = 0;
         charge.ChargePerUnitScaling.PriceScale     = 0;
         charge.Commodity.Target = null;
         charge.Commodity.Index  = 0;
         charge.ChargeTables     = new GXChargeTable[0];
     }
 }
예제 #39
0
 public void IDivObj(object x, object y, object expected)
 {
     Assert.Equal(expected, ObjectType.IDivObj(x, y));
 }
예제 #40
0
 public void ModObj_DivideByZero(object x, object y)
 {
     Assert.Throws <DivideByZeroException>(() => ObjectType.ModObj(x, y));
 }
예제 #41
0
 protected Geometry(ObjectType type) : base(type)
 {
 }
예제 #42
0
 public override IObject[] CreateArray(ObjectType objectType, int count)
 {
     return(this.profile.CreateArray(objectType, count));
 }
예제 #43
0
 //Return gameObject to pool
 public void ReturnToPool(ObjectType type, GameObject gameObj)
 {
     gameObj.SetActive(false);
     poolDict[type].Enqueue(gameObj);
 }
예제 #44
0
 protected override void GetEventData(IDictionary <string, object> data)
 {
     data["obj.type"] = ObjectType.ToString().ToLowerInvariant();
     data["obj.name"] = ObjectName.ToString();
 }
예제 #45
0
        public static bool ValidateSize(string size, bool allowNegative, double minValue, double maxValue, ObjectType objectType, string objectName, string propertyName, ErrorContext errorContext, out double validSizeInMM, out string newSize)
        {
            validSizeInMM = minValue;
            newSize       = minValue + "mm";
            RVUnit rVUnit = default(RVUnit);

            if (!Validator.ValidateSizeString(size, out rVUnit))
            {
                errorContext.Register(ProcessingErrorCode.rsInvalidSize, Severity.Error, objectType, objectName, propertyName, size);
                return(false);
            }
            if (!Validator.ValidateSizeUnitType(rVUnit))
            {
                errorContext.Register(ProcessingErrorCode.rsInvalidMeasurementUnit, Severity.Error, objectType, objectName, propertyName, rVUnit.Type.ToString());
                return(false);
            }
            if (!allowNegative && !Validator.ValidateSizeIsPositive(rVUnit))
            {
                errorContext.Register(ProcessingErrorCode.rsNegativeSize, Severity.Error, objectType, objectName, propertyName);
                return(false);
            }
            double num = Converter.ConvertToMM(rVUnit);

            if (!Validator.ValidateSizeValue(num, minValue, maxValue))
            {
                errorContext.Register(ProcessingErrorCode.rsOutOfRangeSize, Severity.Error, objectType, objectName, propertyName, size, Converter.ConvertSizeFromMM(allowNegative ? minValue : Math.Max(0.0, minValue), rVUnit.Type), Converter.ConvertSizeFromMM(maxValue, rVUnit.Type));
                return(false);
            }
            validSizeInMM = num;
            newSize       = rVUnit.ToString(CultureInfo.InvariantCulture);
            return(true);
        }
        public void TestObjectType()
        {
            ObjectType node = new ObjectType(GetCallSignatureList(), DefaultLineInfo);

            CheckSerializationRoundTrip(node);
        }
예제 #47
0
        public static string ValidateReportName(ICatalogItemContext reportContext, string reportName, ObjectType objectType, string objectName, string propertyName, ErrorContext errorContext)
        {
            Global.Tracer.Assert(null != reportName);
            if (reportName.StartsWith(Uri.UriSchemeHttp + Uri.SchemeDelimiter, StringComparison.OrdinalIgnoreCase) || reportName.StartsWith(Uri.UriSchemeHttps + Uri.SchemeDelimiter, StringComparison.OrdinalIgnoreCase))
            {
                try
                {
                    new Uri(reportName);
                }
                catch (UriFormatException)
                {
                    errorContext.Register(ProcessingErrorCode.rsInvalidReportUri, Severity.Error, objectType, objectName, propertyName);
                    return(reportName);
                }
            }
            else if (reportName.Length > 0 && -1 != reportName.IndexOfAny(PublishingValidator.m_invalidCharacters.ToCharArray()))
            {
                errorContext.Register(ProcessingErrorCode.rsInvalidReportNameCharacters, Severity.Error, objectType, objectName, propertyName, PublishingValidator.m_invalidCharacters);
                return(reportName);
            }
            string text;

            try
            {
                text = reportContext.AdjustSubreportOrDrillthroughReportPath(reportName.Trim());
            }
            catch (RSException)
            {
                errorContext.Register(ProcessingErrorCode.rsInvalidReportUri, Severity.Error, objectType, objectName, propertyName);
                return(reportName);
            }
            if (text != null && reportName.Length != 0)
            {
                return(text);
            }
            errorContext.Register((ProcessingErrorCode)((reportName.Length == 0) ? 151 : 153), Severity.Error, objectType, objectName, propertyName);
            return(reportName);
        }
예제 #48
0
 public static bool ValidateSize(AspNetCore.ReportingServices.ReportIntermediateFormat.ExpressionInfo size, double minValue, double maxValue, ObjectType objectType, string objectName, string propertyName, ErrorContext errorContext)
 {
     Global.Tracer.Assert(null != size);
     if (AspNetCore.ReportingServices.ReportIntermediateFormat.ExpressionInfo.Types.Constant == size.Type)
     {
         bool   allowNegative = false;
         double num           = default(double);
         string text          = default(string);
         return(PublishingValidator.ValidateSize(size.StringValue, allowNegative, minValue, maxValue, objectType, objectName, propertyName, errorContext, out num, out text));
     }
     return(true);
 }
예제 #49
0
        public static bool ValidateSize(string size, ObjectType objectType, string objectName, string propertyName, bool restrictMaxValue, ErrorContext errorContext, out double sizeInMM, out string roundSize)
        {
            bool allowNegative = ObjectType.Line == objectType;

            return(PublishingValidator.ValidateSize(size, objectType, objectName, propertyName, restrictMaxValue, allowNegative, errorContext, out sizeInMM, out roundSize));
        }
예제 #50
0
 public static void ValidateNumeralVariant(CultureInfo language, int numVariant, ObjectType objectType, string ObjectName, string propertyName, ErrorContext errorContext)
 {
     if (!Validator.ValidateNumeralVariant(language, numVariant))
     {
         errorContext.Register(ProcessingErrorCode.rsInvalidNumeralVariantForLanguage, Severity.Error, objectType, ObjectName, propertyName, numVariant.ToString(CultureInfo.InvariantCulture), language.Name);
     }
 }
예제 #51
0
 public static AspNetCore.ReportingServices.ReportIntermediateFormat.Style ValidateAndCreateStyle(List <StyleInformation.StyleInformationAttribute> attributes, ObjectType objectType, string objectName, ErrorContext errorContext, bool checkForMeDotValue, out bool meDotValueReferenced)
 {
     return(PublishingValidator.ValidateAndCreateStyle(attributes, objectType, objectName, false, errorContext, checkForMeDotValue, out meDotValueReferenced));
 }
예제 #52
0
        public static AspNetCore.ReportingServices.ReportIntermediateFormat.Style ValidateAndCreateStyle(List <StyleInformation.StyleInformationAttribute> attributes, ObjectType objectType, string objectName, bool isDynamicImageSubElement, ErrorContext errorContext, bool checkForMeDotValue, out bool meDotValueReferenced)
        {
            meDotValueReferenced = false;
            AspNetCore.ReportingServices.ReportIntermediateFormat.Style style = new AspNetCore.ReportingServices.ReportIntermediateFormat.Style(AspNetCore.ReportingServices.ReportIntermediateFormat.ConstructionPhase.Publishing);
            Global.Tracer.Assert(null != attributes);
            AspNetCore.ReportingServices.ReportIntermediateFormat.ExpressionInfo backgroundImageSource   = null;
            AspNetCore.ReportingServices.ReportIntermediateFormat.ExpressionInfo backgroundImageValue    = null;
            AspNetCore.ReportingServices.ReportIntermediateFormat.ExpressionInfo backgroundImageMIMEType = null;
            AspNetCore.ReportingServices.ReportIntermediateFormat.ExpressionInfo backgroundEmbeddingMode = null;
            for (int i = 0; i < attributes.Count; i++)
            {
                StyleInformation.StyleInformationAttribute styleInformationAttribute = attributes[i];
                if (checkForMeDotValue && styleInformationAttribute.ValueType == AspNetCore.ReportingServices.ReportIntermediateFormat.ValueType.Constant && styleInformationAttribute.Value.MeDotValueDetected)
                {
                    meDotValueReferenced = true;
                }
                switch (attributes[i].Name)
                {
                case "BackgroundImageSource":
                    backgroundImageSource = styleInformationAttribute.Value;
                    break;

                case "BackgroundImageValue":
                    backgroundImageValue = styleInformationAttribute.Value;
                    break;

                case "BackgroundImageMIMEType":
                    backgroundImageMIMEType = styleInformationAttribute.Value;
                    break;

                case "BackgroundRepeat":
                    if (PublishingValidator.ValidateBackgroundRepeat(styleInformationAttribute.Value, objectType, objectName, styleInformationAttribute.Name, errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "EmbeddingMode":
                    backgroundEmbeddingMode = styleInformationAttribute.Value;
                    break;

                case "Transparency":
                    if (PublishingValidator.ValidateTransparency(styleInformationAttribute.Value, objectType, objectName, "Transparency", errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "TransparentColor":
                    if (PublishingValidator.ValidateColor(styleInformationAttribute.Value, objectType, objectName, "TransparentColor", errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "BorderColor":
                case "BorderColorLeft":
                case "BorderColorRight":
                case "BorderColorTop":
                case "BorderColorBottom":
                    if (PublishingValidator.ValidateColor(styleInformationAttribute.Value, objectType, objectName, "BorderColor", errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "BorderStyle":
                    if (PublishingValidator.ValidateBorderStyle(styleInformationAttribute.Value, objectType, objectName, isDynamicImageSubElement, "BorderStyle", true, errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "BorderStyleLeft":
                case "BorderStyleRight":
                case "BorderStyleTop":
                case "BorderStyleBottom":
                    if (PublishingValidator.ValidateBorderStyle(styleInformationAttribute.Value, objectType, objectName, isDynamicImageSubElement, "BorderStyle", false, errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "BorderWidth":
                case "BorderWidthLeft":
                case "BorderWidthRight":
                case "BorderWidthTop":
                case "BorderWidthBottom":
                    if (PublishingValidator.ValidateSize(styleInformationAttribute.Value, Validator.BorderWidthMin, Validator.BorderWidthMax, objectType, objectName, styleInformationAttribute.Name, errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "BackgroundGradientEndColor":
                    if (PublishingValidator.ValidateColor(styleInformationAttribute.Value, objectType, objectName, styleInformationAttribute.Name, errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "BackgroundGradientType":
                    if (PublishingValidator.ValidateBackgroundGradientType(styleInformationAttribute.Value, objectType, objectName, styleInformationAttribute.Name, errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "FontStyle":
                    if (PublishingValidator.ValidateFontStyle(styleInformationAttribute.Value, objectType, objectName, styleInformationAttribute.Name, errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "FontFamily":
                    style.AddAttribute(styleInformationAttribute);
                    break;

                case "FontSize":
                    if (PublishingValidator.ValidateSize(styleInformationAttribute.Value, Validator.FontSizeMin, Validator.FontSizeMax, objectType, objectName, styleInformationAttribute.Name, errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "FontWeight":
                    if (PublishingValidator.ValidateFontWeight(styleInformationAttribute.Value, objectType, objectName, styleInformationAttribute.Name, errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "Format":
                    style.AddAttribute(styleInformationAttribute);
                    break;

                case "TextDecoration":
                    if (PublishingValidator.ValidateTextDecoration(styleInformationAttribute.Value, objectType, objectName, styleInformationAttribute.Name, errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "TextAlign":
                    if (PublishingValidator.ValidateTextAlign(styleInformationAttribute.Value, objectType, objectName, styleInformationAttribute.Name, errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "VerticalAlign":
                    if (PublishingValidator.ValidateVerticalAlign(styleInformationAttribute.Value, objectType, objectName, styleInformationAttribute.Name, errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "Color":
                case "BackgroundColor":
                    if (PublishingValidator.ValidateColor(styleInformationAttribute, objectType, objectName, styleInformationAttribute.Name, errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "PaddingLeft":
                case "PaddingRight":
                case "PaddingTop":
                case "PaddingBottom":
                    if (PublishingValidator.ValidateSize(styleInformationAttribute.Value, Validator.PaddingMin, Validator.PaddingMax, objectType, objectName, styleInformationAttribute.Name, errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "LineHeight":
                    if (PublishingValidator.ValidateSize(styleInformationAttribute.Value, Validator.LineHeightMin, Validator.LineHeightMax, objectType, objectName, styleInformationAttribute.Name, errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "Direction":
                    if (PublishingValidator.ValidateDirection(styleInformationAttribute.Value, objectType, objectName, styleInformationAttribute.Name, errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "WritingMode":
                    if (PublishingValidator.ValidateWritingMode(styleInformationAttribute.Value, objectType, objectName, styleInformationAttribute.Name, errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "Language":
                {
                    CultureInfo cultureInfo = default(CultureInfo);
                    if (PublishingValidator.ValidateSpecificLanguage(styleInformationAttribute.Value, objectType, objectName, styleInformationAttribute.Name, errorContext, out cultureInfo))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;
                }

                case "UnicodeBiDi":
                    if (PublishingValidator.ValidateUnicodeBiDi(styleInformationAttribute.Value, objectType, objectName, styleInformationAttribute.Name, errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "Calendar":
                    if (PublishingValidator.ValidateCalendar(styleInformationAttribute.Value, objectType, objectName, styleInformationAttribute.Name, errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "CurrencyLanguage":
                    if (PublishingValidator.ValidateLanguage(styleInformationAttribute.Value, objectType, objectName, styleInformationAttribute.Name, errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "NumeralLanguage":
                    if (PublishingValidator.ValidateLanguage(styleInformationAttribute.Value, objectType, objectName, styleInformationAttribute.Name, errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "NumeralVariant":
                    if (PublishingValidator.ValidateNumeralVariant(styleInformationAttribute.Value, objectType, objectName, styleInformationAttribute.Name, errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "ShadowColor":
                    if (PublishingValidator.ValidateColor(styleInformationAttribute.Value, objectType, objectName, "ShadowColor", errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "ShadowOffset":
                    if (PublishingValidator.ValidateSize(styleInformationAttribute.Value, Validator.NormalMin, Validator.NormalMax, objectType, objectName, styleInformationAttribute.Name, errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "BackgroundHatchType":
                    if (PublishingValidator.ValidateBackgroundHatchType(styleInformationAttribute.Value, objectType, objectName, styleInformationAttribute.Name, errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "TextEffect":
                    if (PublishingValidator.ValidateTextEffect(styleInformationAttribute.Value, objectType, objectName, styleInformationAttribute.Name, errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                case "Position":
                    if (PublishingValidator.ValidatePosition(styleInformationAttribute.Value, objectType, objectName, styleInformationAttribute.Name, errorContext))
                    {
                        style.AddAttribute(styleInformationAttribute);
                    }
                    break;

                default:
                    Global.Tracer.Assert(false);
                    break;
                }
            }
            PublishingValidator.ValidateBackgroundImage(backgroundImageSource, backgroundImageValue, backgroundImageMIMEType, backgroundEmbeddingMode, style, objectType, objectName, errorContext);
            if (0 < style.StyleAttributes.Count)
            {
                return(style);
            }
            return(null);
        }
예제 #53
0
 private static void ValidateBackgroundImage(AspNetCore.ReportingServices.ReportIntermediateFormat.ExpressionInfo backgroundImageSource, AspNetCore.ReportingServices.ReportIntermediateFormat.ExpressionInfo backgroundImageValue, AspNetCore.ReportingServices.ReportIntermediateFormat.ExpressionInfo backgroundImageMIMEType, AspNetCore.ReportingServices.ReportIntermediateFormat.ExpressionInfo backgroundEmbeddingMode, AspNetCore.ReportingServices.ReportIntermediateFormat.Style style, ObjectType objectType, string objectName, ErrorContext errorContext)
 {
     if (backgroundImageSource != null)
     {
         bool flag = true;
         Global.Tracer.Assert(AspNetCore.ReportingServices.ReportIntermediateFormat.ExpressionInfo.Types.Constant == backgroundImageSource.Type);
         AspNetCore.ReportingServices.OnDemandReportRendering.Image.SourceType intValue = (AspNetCore.ReportingServices.OnDemandReportRendering.Image.SourceType)backgroundImageSource.IntValue;
         Global.Tracer.Assert(null != backgroundImageValue);
         if (AspNetCore.ReportingServices.OnDemandReportRendering.Image.SourceType.Database == intValue && AspNetCore.ReportingServices.ReportIntermediateFormat.ExpressionInfo.Types.Constant == backgroundImageValue.Type)
         {
             errorContext.Register(ProcessingErrorCode.rsBinaryConstant, Severity.Error, objectType, objectName, "BackgroundImageValue");
             flag = false;
         }
         if (AspNetCore.ReportingServices.OnDemandReportRendering.Image.SourceType.Database == intValue && !PublishingValidator.ValidateMimeType(backgroundImageMIMEType, objectType, objectName, "BackgroundImageMIMEType", errorContext))
         {
             flag = false;
         }
         if (flag)
         {
             style.AddAttribute("BackgroundImageSource", backgroundImageSource);
             style.AddAttribute("BackgroundImageValue", backgroundImageValue);
             if (backgroundEmbeddingMode != null)
             {
                 style.AddAttribute("EmbeddingMode", backgroundEmbeddingMode);
             }
             if (AspNetCore.ReportingServices.OnDemandReportRendering.Image.SourceType.Database == intValue)
             {
                 style.AddAttribute("BackgroundImageMIMEType", backgroundImageMIMEType);
             }
         }
     }
 }
예제 #54
0
        public static AspNetCore.ReportingServices.ReportIntermediateFormat.Style ValidateAndCreateStyle(List <StyleInformation.StyleInformationAttribute> attributes, ObjectType objectType, string objectName, bool isDynamicImageSubElement, ErrorContext errorContext)
        {
            bool flag = default(bool);

            return(PublishingValidator.ValidateAndCreateStyle(attributes, objectType, objectName, isDynamicImageSubElement, errorContext, false, out flag));
        }
예제 #55
0
 public void NotObj(object obj, object expected)
 {
     Assert.Equal(expected, ObjectType.NotObj(obj));
 }
예제 #56
0
 private static bool ValidateCalendar(AspNetCore.ReportingServices.ReportIntermediateFormat.ExpressionInfo calendar, ObjectType objectType, string objectName, string propertyName, ErrorContext errorContext)
 {
     Global.Tracer.Assert(null != calendar);
     if (AspNetCore.ReportingServices.ReportIntermediateFormat.ExpressionInfo.Types.Constant == calendar.Type && !Validator.ValidateCalendar(calendar.StringValue))
     {
         errorContext.Register(ProcessingErrorCode.rsInvalidCalendar, Severity.Error, objectType, objectName, propertyName, calendar.StringValue);
         return(false);
     }
     return(true);
 }
예제 #57
0
 public void PlusObj(object obj, object expected)
 {
     Assert.Equal(expected, ObjectType.PlusObj(obj));
 }
예제 #58
0
 public void ShiftRightObj(object obj, int amount, object expected)
 {
     Assert.Equal(expected, ObjectType.ShiftRightObj(obj, amount));
 }
 /// <inheritdoc cref="object.ToString"/>
 public override string ToString()
 {
     return(ObjectType.ToString() + " " + LogicalName);
 }
예제 #60
0
        private static bool ValidateTransparency(AspNetCore.ReportingServices.ReportIntermediateFormat.ExpressionInfo transparency, ObjectType objectType, string objectName, string propertyName, ErrorContext errorContext)
        {
            Global.Tracer.Assert(null != transparency);
            if (AspNetCore.ReportingServices.ReportIntermediateFormat.ExpressionInfo.Types.Constant == transparency.Type)
            {
                double floatValue = transparency.FloatValue;
                if (!(floatValue < 0.0) && !(floatValue > 100.0))
                {
                    goto IL_006d;
                }
                errorContext.Register(ProcessingErrorCode.rsOutOfRangeSize, Severity.Error, objectType, objectName, propertyName, transparency.OriginalText, "0", "100");
                return(false);
            }
            goto IL_006d;
IL_006d:
            return(true);
        }