Ejemplo n.º 1
0
 public DetailPage()
 {
     this._constantCollection  = new ConstantCollection();
     this._customClientRT      = new CustomClientRT();
     this._pictureRT           = new PictureRT();
     this._visitorIPMACAddress = new VisitorIPMACAddress();
 }
Ejemplo n.º 2
0
 public OtherContentDetailPage()
 {
     this._constantCollection  = new ConstantCollection();
     this._otherContentRT      = new OtherContentRT();
     this._pictureRT           = new PictureRT();
     this._visitorIPMACAddress = new VisitorIPMACAddress();
 }
Ejemplo n.º 3
0
		public Scope ()
		{
			m_scopes = new ScopeCollection (this);
			m_usings = new UsingCollection (this);
			m_constants = new ConstantCollection (this);
			m_variables = new VariableCollection (this);
		}
Ejemplo n.º 4
0
 public Scope()
 {
     m_scopes    = new ScopeCollection(this);
     m_usings    = new UsingCollection(this);
     m_constants = new ConstantCollection(this);
     m_variables = new VariableCollection(this);
 }
Ejemplo n.º 5
0
 public Default()
 {
     this._customClientRT      = new CustomClientRT();
     this._categoryRT          = new CategoryRT();
     this._constantCollection  = new ConstantCollection();
     this._visitorIPMACAddress = new VisitorIPMACAddress();
 }
Ejemplo n.º 6
0
 public void Initialize(ConstantCollection constantCollection, Dictionary <string, string> typeInfo)
 {
     _collection = constantCollection;
     _className  = _collection.Name.Camelize();
     _directory  = typeInfo["directory"];
     _namespace  = typeInfo["namespace"];
 }
Ejemplo n.º 7
0
 public void Initialize(ConstantCollection constantCollection, Dictionary <string, string> typeInfo)
 {
     this.collection        = constantCollection;
     this.className         = this.collection.Name.Camelize();
     this.directory         = typeInfo["directory"];
     this.namespaceProperty = typeInfo["namespace"];
     typeInfo.TryGetValue("scope", out this.scope);
 }
        public void TestInitialize()
        {
            DecimalConstant     decimalConstant     = new DecimalConstant(DecimalValue);
            HexaDecimalConstant hexaDecimalConstant = new HexaDecimalConstant(HexaDecimalValue);
            AddressConstant     addressConstant     = new AddressConstant("LBL001");
            StringConstant      stringConstant      = new StringConstant(StringValue);

            m_constants = ConstantCollection.MakeForUnitTest(
                decimalConstant, hexaDecimalConstant, addressConstant, stringConstant);
        }
Ejemplo n.º 9
0
        public static IOutputFile CreateByType(Dictionary <string, string> typeInfo, ConstantCollection constantCollection)
        {
            string typeName = typeInfo["type"];

            typeInfo.Remove("type");

            IOutputFile outputFile = Activator.CreateInstance(OutputsByType[typeName]) as IOutputFile;

            outputFile.Initialize(constantCollection, typeInfo);
            return(outputFile);
        }
Ejemplo n.º 10
0
        private void CheckReadOperand(
            String text, Boolean success, Constant[] expectedConstants, String message)
        {
            AsmDcInstruction target = new AsmDcInstruction();

            ProgramInstructionTest.CheckReadOperand(target, text, success, message);
            if (success)
            {
                ConstantCollection actualConstants = target.Constants;
                ConstantCollectionTest.Check(expectedConstants, actualConstants, message);
            }
        }
Ejemplo n.º 11
0
 public GameMakerFile()
 {
     Sprites = new SpriteCollection();
       Sounds = new SoundCollection();
       Backgrounds = new BackgroundCollection();
       Paths = new PathCollection();
       Scripts = new ScriptCollection();
       Fonts = new FontCollection();
       TimeLines = new TimeLineCollection();
       Objects = new ObjectCollection();
       Rooms = new RoomCollection();
       Triggers = new TriggerCollection();
       Includes = new IncludedFileCollection();
       Constants = new ConstantCollection();
       Information = new GameInformation();
       Settings = new GameSettings();
       ResourceTree = new ResourceTree();
 }
Ejemplo n.º 12
0
        protected override void ProcessResource(ConstantCollection aConstants)
        {
            var document = LoadXml(Filenames.Constants + ".xml");

            if (document != null)
            {
                OnCategoryProcessing(ResourceTypes.Constants);

                aConstants.AddRange(from element in document.Elements("Constant")
                                    select new Constant()
                {
                    Name  = GetElement(element, "Name").Value,
                    Value = GetElement(element, "Value").Value
                });

                OnCategoryProcessed(ResourceTypes.Constants);
            }
        }
Ejemplo n.º 13
0
 public GameMakerFile()
 {
     Sprites      = new SpriteCollection();
     Sounds       = new SoundCollection();
     Backgrounds  = new BackgroundCollection();
     Paths        = new PathCollection();
     Scripts      = new ScriptCollection();
     Fonts        = new FontCollection();
     TimeLines    = new TimeLineCollection();
     Objects      = new ObjectCollection();
     Rooms        = new RoomCollection();
     Triggers     = new TriggerCollection();
     Includes     = new IncludedFileCollection();
     Constants    = new ConstantCollection();
     Information  = new GameInformation();
     Settings     = new GameSettings();
     ResourceTree = new ResourceTree();
 }
Ejemplo n.º 14
0
		public DataContext(MetadataContext metadataContext)
		{
			_metadataContext = metadataContext;

			_tables = new TableCollection(this);
			_tables.Changed += member_Changed;

			_tableRelations = new TableRelationCollection(this);
			_tableRelations.Changed += member_Changed;

			_constants = new ConstantCollection();
			_constants.Changed += member_Changed;

			_aggregates = new AggregateCollection();
			_aggregates.AddDefaults();
			_aggregates.Changed += member_Changed;

			_functions = new FunctionCollection();
			_functions.AddDefaults();
			_functions.Changed += member_Changed;			
		}
        private static void CheckParse(
            String str, Constant[] expectedConstants, TokenType expectedLeftTokenType, String message)
        {
            ReadBuffer   buffer = new ReadBuffer(str);
            OperandLexer lexer  = new OperandLexer(buffer);

            lexer.MoveNext();
            try
            {
                ConstantCollection actualConstants = ConstantCollection.Parse(lexer);

                Assert.IsNotNull(expectedConstants, message);
                TestUtils.CheckEnumerable(expectedConstants, actualConstants, ConstantTest.Check, message);

                TokenType actualLeftTokenType = lexer.CurrentToken.Type;
                Assert.AreEqual(expectedLeftTokenType, actualLeftTokenType, message);
            }
            catch (Casl2SimulatorException)
            {
                Assert.IsNull(expectedConstants, message);
            }
        }
Ejemplo n.º 16
0
        protected void btnPostAd_Click(object sender, EventArgs e)
        {
            try
            {
                int    materialID = 0;
                string matCode    = string.Empty;
                if (!TextControlCheckBeforeSave())
                {
                    return;
                }
                Material material = CreateMaterial();
                if (material == null)
                {
                    return;
                }
                List <ImageUrl> matPicUrlList = new List <ImageUrl>();
                if (MatPicUpload.HasFile)
                {
                    btnMatPicUpload_Click(sender, e);
                }
                //else
                //{
                //    labelMessage.Text = "Select Image";

                //}

                matPicUrlList = (List <ImageUrl>)Session["seMatPicTempFileName"];
                List <Picture> pictureColl = new List <Picture>();
                matCode = material.Code;
                if (matPicUrlList == null)
                {
                    Picture aPicture = new Picture();
                    aPicture.MaterialID = material.IID;
                    string permanentImagePath = new ConstantCollection().noImageUrl;
                    aPicture.UrlAddress = permanentImagePath;
                    pictureColl.Add(aPicture);
                }
                else if (matPicUrlList.Count > 0)
                {
                    int count = 1;
                    foreach (var imageUrl in matPicUrlList)
                    {
                        Picture aPicture = new Picture();
                        aPicture.MaterialID = material.IID;
                        string permanentImagePathToSave = Server.MapPath("~/Image/MatImage/") + matCode + "_" + count + (Path.GetExtension(imageUrl.ImageUrlTemp)); //image path to save folder
                        string permanentImagePath       = "~/Image/MatImage/" + matCode + "_" + count + (Path.GetExtension(Server.MapPath(imageUrl.ImageUrlTemp))); //image path to save db
                        aPicture.UrlAddress = permanentImagePath;
                        // File.Move(Server.MapPath(imageUrl.ImageUrlTemp), permanentImagePathToSave);//move pic to permanent folder from tempPic folder
                        pictureColl.Add(aPicture);
                        count++;
                    }
                }



                if (material.AdGiverID != -1)
                {
                    string materialAllChildXML = ConversionXML.ConvertObjectToXML <Material, Picture>(material, pictureColl, string.Empty);
                    materialID = MaterialRT.InsertMaterialAndAllChildXML(materialAllChildXML);

                    if (materialID == -100)
                    {
                        labelMessage.Text      = "Network connection fail ... Please try again..!!";
                        labelMessage.ForeColor = System.Drawing.Color.Red;
                    }
                    else if (materialID == -101)
                    {
                        labelMessage.Text      = "Network connection fail ... Please try again..!!";
                        labelMessage.ForeColor = System.Drawing.Color.Red;
                    }
                    else if (materialID > 0)
                    {
                        if (matPicUrlList.Count > 0)
                        {
                            int count = 1;
                            foreach (var imageUrl in matPicUrlList)
                            {
                                Picture aPicture = new Picture();
                                aPicture.MaterialID = material.IID;
                                string permanentImagePathToSave = Server.MapPath("~/Image/MatImage/") + matCode + "_" + count + (Path.GetExtension(imageUrl.ImageUrlTemp)); //image path to save folder
                                string permanentImagePath       = "~/Image/MatImage/" + matCode + "_" + count + (Path.GetExtension(Server.MapPath(imageUrl.ImageUrlTemp))); //image path to save db
                                aPicture.UrlAddress = permanentImagePath;
                                File.Move(Server.MapPath(imageUrl.ImageUrlTemp), permanentImagePathToSave);                                                                 //move pic to permanent folder from tempPic folder
                                count++;
                            }
                        }


                        labelMessage.Text      = "Your post is successfully added, Your Post Code is " + matCode + " ..!!";
                        labelMessage.ForeColor = System.Drawing.Color.Green;
                        ClearField();
                    }
                }
                else
                {
                    labelMessage.Text = String.Format("Please register first. You can register here. <a href=\"{0}\">{1}</a>",
                                                      HttpUtility.HtmlEncode("UserRegistrationPage.aspx"), HttpUtility.HtmlEncode("Register now"));

                    labelMessage.ForeColor = System.Drawing.Color.Red;
                }
            }
            catch (Exception ex)
            {
                labelMessage.Text      = "Error : " + ex.Message;
                labelMessage.ForeColor = System.Drawing.Color.Red;
            }
        }
Ejemplo n.º 17
0
        protected void btnUpdatePost_Click(object sender, EventArgs e)
        {
            try
            {
                hdIsEdit.Value = "true";
                int    imgCount   = 0;
                int    materialID = 0;
                string matCode    = string.Empty;
                if (!TextControlCheckBeforeSave())
                {
                    return;
                }
                Material material = CreateMaterial();
                if (material == null)
                {
                    return;
                }
                List <ControlAdmin.MaterialWF.ImageUrl> matPicUrlList = new List <ControlAdmin.MaterialWF.ImageUrl>();

                btnMatPicUpload_Click(sender, e);

                var matPicListForTempUrl = (List <ControlAdmin.MaterialWF.ImageUrl>)Session["seMatPicTempFileName"];
                matPicUrlList = matPicListForTempUrl.Where(url => url.ImageUrlTemp.StartsWith("~/Image/MatTempImage")).ToList();//Set for temp img update
                List <Picture> pictureColl = new List <Picture>();
                matCode = material.Code;

                if (matPicUrlList.Count == 0)
                {
                    Picture aPicture = new Picture();
                    aPicture.MaterialID = material.IID;
                    string permanentImagePath = new ConstantCollection().noImageUrl;
                    aPicture.UrlAddress = permanentImagePath;
                    pictureColl.Add(aPicture);
                }
                else if (matPicUrlList.Count > 0)
                {
                    int tempImgCount = 0;
                    using (PictureRT aPictureRt = new PictureRT())
                    {
                        try
                        {
                            var imgList = aPictureRt.GetAllPicturesAccordingToMaterialID(material.IID).ToList();
                            if (imgList.Count > 0)
                            {
                                var picCount =
                                    (Path.GetFileNameWithoutExtension(
                                         Server.MapPath(
                                             aPictureRt.GetAllPicturesAccordingToMaterialID(material.IID)
                                             .OrderByDescending(pic => pic.UrlAddress)
                                             .FirstOrDefault()
                                             .UrlAddress)).Substring(13));

                                imgCount     = Convert.ToInt32(picCount) + 1;
                                tempImgCount = imgCount;
                            }
                            else
                            {
                                imgCount = 1;//set image number if no image found
                            }
                        }
                        catch (Exception exception)
                        {
                            throw new Exception(exception.Message, exception);
                        }
                    }

                    foreach (var imageUrl in matPicUrlList)
                    {
                        Picture aPicture = new Picture();
                        aPicture.MaterialID = material.IID;
                        // string permanentImagePathToSave = Server.MapPath("~/Image/MatImage/") + matCode + "_" + count + (Path.GetExtension(imageUrl.ImageUrlTemp));//image path to save folder
                        string permanentImagePath = "~/Image/MatImage/" + matCode + "_" + imgCount + (Path.GetExtension(Server.MapPath(imageUrl.ImageUrlTemp)));//image path to save db
                        aPicture.UrlAddress = permanentImagePath;
                        // File.Move(Server.MapPath(imageUrl.ImageUrlTemp), permanentImagePathToSave);//move pic to permanent folder from tempPic folder
                        pictureColl.Add(aPicture);
                        imgCount++;
                    }
                    imgCount = tempImgCount;
                }

                if (material.AdGiverID != -1)
                {
                    using (MaterialRT aMaterialRt = new MaterialRT())
                    {
                        aMaterialRt.UpdateMaterial(material);
                    }


                    if (matPicUrlList.Count > 0)
                    {
                        using (PictureRT aPictureRt = new PictureRT())
                        {
                            foreach (var pic in pictureColl)
                            {
                                aPictureRt.AddMaterialPicture(pic);
                            }
                        }


                        foreach (var imageUrl in matPicUrlList)
                        {
                            Picture aPicture = new Picture();
                            aPicture.MaterialID = material.IID;
                            string permanentImagePathToSave = Server.MapPath("~/Image/MatImage/") + matCode + "_" + imgCount + (Path.GetExtension(imageUrl.ImageUrlTemp)); //image path to save folder
                            string permanentImagePath       = "~/Image/MatImage/" + matCode + "_" + imgCount + (Path.GetExtension(Server.MapPath(imageUrl.ImageUrlTemp))); //image path to save db
                            aPicture.UrlAddress = permanentImagePath;
                            File.Move(Server.MapPath(imageUrl.ImageUrlTemp), permanentImagePathToSave);                                                                    //move pic to permanent folder from tempPic folder
                            imgCount++;
                        }
                    }
                    Session["seMatPicTempFileName"] = null;
                    Response.Redirect("~/ManageYourAds.aspx");
                    //labelMessage.Text = "Your post is successfully added, Your Post Code is " + matCode + " ..!!";
                    //labelMessage.ForeColor = System.Drawing.Color.Green;
                    //labelMessage.Focus();
                    ClearField();
                }
                else
                {
                    labelMessage.Text = String.Format("Please register frist. You can register here. <a href=\"{0}\">{1}</a>",
                                                      HttpUtility.HtmlEncode("UserRegistrationPage.aspx"), HttpUtility.HtmlEncode("Register now"));

                    labelMessage.ForeColor = System.Drawing.Color.Red;
                    labelMessage.Focus();
                }
            }
            catch (Exception ex)
            {
                labelMessage.Text      = "Error : " + ex.Message;
                labelMessage.ForeColor = System.Drawing.Color.Red;
                labelMessage.Focus();
            }
        }
Ejemplo n.º 18
0
 protected abstract void ProcessResource( ConstantCollection aConstants );
Ejemplo n.º 19
0
 protected abstract void ProcessResource(ConstantCollection aConstants);
Ejemplo n.º 20
0
 public void Initialize(ConstantCollection constantCollection, Dictionary <string, string> typeInfo)
 {
     this.collection = constantCollection;
     this.directory  = typeInfo["directory"];
     this.package    = typeInfo.GetValueOrDefault("package") ?? Path.GetFileName(this.directory);
 }
Ejemplo n.º 21
0
        protected override void ProcessResource( ConstantCollection aConstants )
        {
            if ( !aConstants.Any() )
            return;

              OnCategoryProcessing( ResourceTypes.Constants );

              var document =
            new XElement( "Constants",
              from constant in aConstants
              select new XElement( "Constant",
                   new XElement( "Name", constant.Name ),
                   new XElement( "Value", EscapeText( constant.Value ) )
              )
            );

              SaveDocument( document, Filenames.Constants + ".xml" );
              OnCategoryProcessed( ResourceTypes.Constants );
        }
Ejemplo n.º 22
0
 public void Initialize(ConstantCollection constantCollection, Dictionary <string, string> typeInfo)
 {
     _collection     = constantCollection;
     _directory      = typeInfo["directory"];
     _fileNamePrefix = typeInfo["file-name-prefix"];
 }