コード例 #1
0
        public static Image GetImage(ImageName imageName)
        {
            Image found;

            images.TryGetValue(imageName, out found);
            return(found);
        }
 public string ToCsv()
 {
     return(string.Join(",",
                        //AssemblyId.ToString().FormatForCsv(),
                        AssemblyName.FormatForCsv(),
                        //PluginTypeId.ToString().FormatForCsv(),
                        PluginTypeName, StepId.ToString().FormatForCsv(),
                        StepName.FormatForCsv(),
                        FormatForCsv(ImageId),
                        ImageName.FormatForCsv(),
                        Environment.FormatForCsv(),
                        GetStateText(Environment == "Source" ? "target": "source").FormatForCsv(),
                        StepMessageName.FormatForCsv(),
                        EntityName.FormatForCsv(),
                        StepFilteringAttributes.FormatForCsv(),
                        FormatForCsv(RunAsUserId),
                        RunAsUserName.FormatForCsv(),
                        StepRank.ToString().FormatForCsv(),
                        StepDescription.FormatForCsv(),
                        StepStageName.FormatForCsv(),
                        StepModeName.FormatForCsv(),
                        StepSupportedDeploymentName.FormatForCsv(),
                        StepAsyncAutoDelete.ToString(),
                        StepConfiguration.FormatForCsv(),
                        StepSecureConfiguration.FormatForCsv(),
                        ImageAttributes.FormatForCsv()
                        ));
 }
コード例 #3
0
 public override object Clone()
 {
     FuzzyData.FuzzyString n = ImageName == null ? null : ImageName.Clone() as FuzzyData.FuzzyString;
     FuzzyData.FuzzyFixnum i = ImageIndex == null ? null : ImageIndex.Clone() as FuzzyData.FuzzyFixnum;
     FuzzyData.FuzzyFixnum h = ImageHue == null ? null : ImageHue.Clone() as FuzzyData.FuzzyFixnum;
     return(new AdvanceImage(n, i, h));
 }
コード例 #4
0
ファイル: BodyItem.cs プロジェクト: sempers/book-utils
        public XNode ToXML()
        {
            XElement xBody = new XElement(Fb2Const.fb2DefaultNamespace + Fb2BodyItemName);

            if (!string.IsNullOrEmpty(Name))
            {
                xBody.Add(new XAttribute(Fb2NameAttributeName, Name));
            }
            if (!string.IsNullOrEmpty(Lang))
            {
                xBody.Add(new XAttribute(XNamespace.Xml + "lang", Lang));
            }
            if (ImageName != null)
            {
                xBody.Add(ImageName.ToXML());
            }
            if (Title != null)
            {
                xBody.Add(Title.ToXML());
            }
            foreach (EpigraphItem EpItem in epigraphs)
            {
                xBody.Add(EpItem.ToXML());
            }
            foreach (SectionItem SecItem in sections)
            {
                xBody.Add(SecItem.ToXML());
            }

            return(xBody);
        }
コード例 #5
0
        public IActionResult deleteImage(int post, ImageName image)
        {
            int?id = ClaimHelper.GetIdFromClaimIdentity((ClaimsIdentity)this.ControllerContext.HttpContext.User.Identity);

            if (id == null)
            {
                return(Unauthorized(new ErrorMessageModel("Sem Autorização ou sem sessão inciada")));
            }

            if (image == null)
            {
                return(BadRequest(new ErrorMessageModel("Nome de imagem não enviado!")));
            }

            try
            {
                JobDAO jobDAO  = new JobDAO(_connection, this._environment.ContentRootPath);
                bool   deleted = jobDAO.deleteImage((int)id, post, image);

                if (deleted == true)
                {
                    return(Ok(new SuccessMessageModel("Imagem apagada!")));
                }
                else
                {
                    return(BadRequest(new ErrorMessageModel("Imagem não apagada ou inexistente!")));
                }
            }
            catch (Exception e)
            {
                return(BadRequest(new ErrorMessageModel(e.Message)));
            }
        }
コード例 #6
0
        public IActionResult deleteImage(int post, ImageName image)
        {
            //Implementar claim identity do user e levar o id em delete Image
            if (image == null)
            {
                return(BadRequest("Nome de imagem não enviado!"));
            }

            try
            {
                PublicationDAO pDAO    = new PublicationDAO(_connection);
                bool           deleted = pDAO.deleteImage(post, image);

                if (deleted == true)
                {
                    return(Ok("Imagem apagada!"));
                }
                else
                {
                    return(BadRequest("Imagem não apagada ou inexistente!"));
                }
            }
            catch (Exception e)
            {
                return(BadRequest(e.Message));
            }
        }
コード例 #7
0
        public Task <ManifestQueryResult> GetManifestAsync(string image, IRegistryCredentialsHost credsHost, bool isDryRun)
        {
            if (isDryRun)
            {
                return(Task.FromResult(new ManifestQueryResult("", new JsonObject())));
            }

            ImageName imageName = ImageName.Parse(image, autoResolveImpliedNames: true);

            BasicAuthenticationCredentials?basicAuthCreds = null;

            // Lookup the credentials, if any, for the registry where the image is located
            if (credsHost.Credentials.TryGetValue(imageName.Registry !, out RegistryCredentials? registryCreds))
            {
                basicAuthCreds = new BasicAuthenticationCredentials
                {
                    UserName = registryCreds.Username,
                    Password = registryCreds.Password
                };
            }

            // Docker Hub's registry has a separate host name for its API
            string apiRegistry = imageName.Registry == DockerHelper.DockerHubRegistry ?
                                 DockerHelper.DockerHubApiRegistry :
                                 imageName.Registry !;

            RegistryServiceClient registryClient = new(apiRegistry, _httpClient, basicAuthCreds);

            return(registryClient.GetManifestAsync(imageName.Repo, (imageName.Tag ?? imageName.Digest) !));
        }
コード例 #8
0
        public IActionResult deleteMainPicture(int publicationId, ImageName image)
        {
            try
            {
                int?id = ClaimHelper.GetIdFromClaimIdentity((ClaimsIdentity)this.ControllerContext.HttpContext.User.Identity);

                if (id == null)
                {
                    return(Unauthorized(new ErrorExceptionModel("Sem Autorização ou sem sessão inciada")));
                }
                PublicationDAO pDAO    = new PublicationDAO(_connection);
                bool           deleted = pDAO.deleteMainImage(publicationId, image);

                if (deleted == true)
                {
                    return(Ok("Imagem apagada!"));
                }
                else
                {
                    return(BadRequest("Imagem não apagada ou inexistente!"));
                }
            }
            catch (Exception e)
            {
                return(BadRequest(e.Message));
            }
        }
コード例 #9
0
ファイル: Prototype.cs プロジェクト: OlyaOlga/Product
        public object Clone()
        {
            ImageName name   = new ImageName(Name.ProductName, Name.PrototypeName, Name.FormatName);
            Prototype cloned = new Prototype(name, Size, CurrentMeasurement);

            return(cloned);
        }
コード例 #10
0
    public void EditButton(Data data, ImageName imageName, GameObject gameObject)
    {
        ImageURL1 = imageName.ImageURL1;
        ImageURL2 = imageName.ImageURL2;
        counter.setValue(data.num);
        boardSizeCounter.setValue(data.size);
        switch (data.type)
        {
        case "piece":
            Type_dropdown.value = 0;
            break;

        case "card":
            Type_dropdown.value = 1;
            break;

        case "board":
            Type_dropdown.value = 2;
            break;

        case "deck":
            Type_dropdown.value = 3;
            break;
        }
        Destroy(gameObject);
    }
コード例 #11
0
ファイル: SpriteManager.cs プロジェクト: ccaunca/Projects
        public static Sprite Add(SpriteBaseName name, ImageName imgName, float x, float y, float sx, float sy)
        {
            SpriteManager spriteMan = SpriteManager.GetInstance();
            Sprite        sprite    = (Sprite)spriteMan.BaseAdd();

            sprite.Set(name, imgName, x, y, sx, sy);
            return(sprite);
        }
コード例 #12
0
        public static Image Find(ImageName imgName)
        {
            ImageManager imgMan = ImageManager.GetInstance();

            return((Image)imgMan.BaseFind(new Image {
                name = imgName
            }));
        }
コード例 #13
0
        static void Main(string[] args)
        {
            // InterNetwork - 10.7.0.7
            Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
            // Адрес на який хоститься наш сервер. 127.0.0.1 - локальний адрес(працює тільки на вашому пк)
            IPAddress iPAddress = IPAddress.Parse("127.0.0.1");
            // Зв'язує іп адресу і порт. Порт вказуємо любий.
            IPEndPoint iPEndPoint = new IPEndPoint(iPAddress, 1098);

            // Вказуємо що сервер працює на цій кінцевій точці
            s.Bind(iPEndPoint);
            //Вказуємо серверу що він має слухати і його черга на повідомлення становить 10
            s.Listen(-1);

            try
            {
                while (true)
                {
                    // Підключення з клієнтом
                    Socket client = s.Accept();
                    Console.WriteLine(client.RemoteEndPoint.ToString());
                    //тимчасова змінна для зберігання даних, які прийшли з сервера
                    byte[] buffer = new byte[10000000];
                    //скільки байті залишилось зчитати
                    int length;

                    do
                    {
                        // Hello World
                        // Hello - 1kb
                        // World - 1kb

                        //Зчитування даних які залишилось отримать з сервера
                        length = client.Receive(buffer);
                    } while (client.Available > 0);

                    ImageName imgName = new ImageName();

                    using (MemoryStream memStream = new MemoryStream(buffer))
                    {
                        BinaryFormatter binForm = new BinaryFormatter();
                        imgName = (ImageName)binForm.Deserialize(memStream);
                    }

                    imgName.Image.Save(imgName.Name);


                    //client.Send(Encoding.UTF8.GetBytes($"Hello from server {DateTime.Now}"));
                    //Закрить підключення з клієнтом
                    client.Shutdown(SocketShutdown.Both);
                    client.Close();
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
コード例 #14
0
 public InstallModuleTaskRequestEvent(Id taskId, Id referenceId, ModuleReplicas moduleReplicas, ImageName imageName,
                                      ModuleName moduleName)
 {
     TaskId         = taskId;
     ReferenceId    = referenceId;
     ModuleReplicas = moduleReplicas;
     ImageName      = imageName;
     ModuleName     = moduleName;
 }
コード例 #15
0
        // parameterized constructor
        public Image(ImageName imageName, Texture imageTex, Azul.Rect imageRect)
        {
            Debug.Assert(imageTex != null);
            Debug.Assert(imageRect != null);

            this.setImageName(imageName);
            this.setImageRect(imageRect);
            this.setImageTexture(imageTex);
        }
コード例 #16
0
ファイル: ResImageList.cs プロジェクト: prepare/HTML-Renderer
 public static ImageBinder GetImageBinder(ImageName imageName)
 {
     Image found;
     images.TryGetValue(imageName, out found);
     ImageBinder binder = new ClientImageBinder(null);
     binder.SetImage(found);
     binder.State = ImageBinderState.Loaded;
     return binder;
 }
コード例 #17
0
        public static Image Add(ImageName imgName, TextureName texName, float x, float y, float width, float height)
        {   // Remove from Reserve, Add to Active
            ImageManager imageMan = ImageManager.GetInstance();
            Image        pImage   = (Image)imageMan.BaseAdd();

            Debug.Assert(pImage != null);
            pImage.Set(imgName, texName, x, y, width, height);
            return(pImage);
        }
コード例 #18
0
 public Bullet(ImageName imageName, Point frameSize, Point framePosition, Vector2 position, float speed,
               float speedDirec, float acceleration, float deepth)
     : base(imageName, frameSize, framePosition, position, new Vector2(Laser.laserFrameSize.X / 2, 0), 0, speed)
 {
     this.accelerationDegree = speedDirec;
     this.directType         = directionType.SPEED;
     this.life = 1000000;
     eventID   = 0;
 }
コード例 #19
0
ファイル: DAO.cs プロジェクト: slagusev/GameEngineSFML
        public static void LoadImages()
        {
            #region Load Slices from XML into Dictionary<Element, Slice> Slices
            try
            {
                XmlSerializer serializer = new XmlSerializer(typeof(Slice[]));
                TextReader    reader     = new StreamReader(SLICES_FILENAME, false);

                Slice[] slices = (Slice[])serializer.Deserialize(reader);
                reader.Close();

                foreach (Slice slice in slices)
                {
                    Slices.Add(slice.Element, slice);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error loading slices: " + ex.Message);
            }
            #endregion

            #region Load Images from XML into Dictionary<Element, Texture> Images
            try
            {
                XmlSerializer serializer = new XmlSerializer(typeof(ImagePath[]));
                TextReader    reader     = new StreamReader(IMAGES_FILENAME, false);

                ImagePath[] paths = (ImagePath[])serializer.Deserialize(reader);
                reader.Close();

                foreach (ImagePath path in paths)
                {
                    Texture texture = new Texture(new Image(path.Path));
                    Images.Add(path.Name, texture);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error loading images: " + ex.Message);
            }
            #endregion

            #region Match Slices and Textures and add to Dictionary<Element, Sprite> Sprites
            foreach (Slice slice in Slices.Values)
            {
                Element   element   = slice.Element;
                IntRect   rectangle = new IntRect(slice.X, slice.Y, slice.Width, slice.Height);
                ImageName imageName = slice.ImageName;
                Texture   texture   = Images[imageName];
                Sprite    sprite    = new Sprite(texture, rectangle);

                Sprites.Add(element, sprite);
            }
            #endregion
        }
コード例 #20
0
ファイル: DAO.cs プロジェクト: slagusev/GameEngineSFML
        //public Slice()
        //{
        //  Element = Element.Blank;
        //  ImageName = ImageName.Nothing;
        //  X = 0;
        //  Y = 0;
        //  Width = 0;
        //  Height = 0;
        //}

        public Slice(Element element, ImageName imageName,
                     int x, int y, int width, int height)
        {
            Element   = element;
            ImageName = imageName;
            X         = x;
            Y         = y;
            Width     = width;
            Height    = height;
        }
コード例 #21
0
 public DeadAnime(ImageName imageName, Vector2 position, Color blendColor, Random ran)
     : base(imageName, new Point(60, 60), new Point(0, 0), position, 0)
 {
     alpha           = 1;
     this.isOneFrame = true;
     rotateDegree    = (float)ran.NextDouble() * MathHelper.TwoPi;
     scaleRate       = originScaleRate;
     myState         = SpriteState.LIVE;
     this.blendColor = blendColor;
 }
コード例 #22
0
 public Shoujo(ImageName imageName, Point frameSize, Point sheetSize, Vector2 spriteOrigin, int hitRadius, int speed)
     : base(imageName, frameSize, sheetSize, spriteOrigin, hitRadius, speed)
 {
     rotateDegree    = 0;
     myState         = SpriteState.BORN;
     isUnbeatable    = true;
     showHitCircle   = false;
     isClear         = false;
     bornPosition    = position;
     clearFrameCount = 0;
 }
コード例 #23
0
        public static ImageBinder GetImageBinder(ImageName imageName)
        {
            Image found;

            images.TryGetValue(imageName, out found);
            ImageBinder binder = new MyClientImageBinder(null);

            binder.SetImage(found);
            binder.State = ImageBinderState.Loaded;
            return(binder);
        }
コード例 #24
0
 public ModuleManagerConfig(Id taskId, ModuleReplicas moduleReplicas, ModuleName moduleName, ImageName imageName, LoadBalancerConfig loadBalancerConfig, Func <Id, ILogHandler, Task> successCallback, Func <Id, ILogHandler, Task> failureCallback, Func <Id, ILogHandler, Task> updateCallback)
 {
     TaskId             = taskId;
     LoadBalancerConfig = loadBalancerConfig;
     _moduleReplicas    = moduleReplicas;
     _moduleName        = moduleName;
     _imageName         = imageName;
     SuccessCallback    = successCallback;
     FailureCallback    = failureCallback;
     UpdateCallback     = updateCallback;
 }
コード例 #25
0
 public void Set(SpriteBaseName name, ImageName imgName, float x, float y, float w, float h)
 {
     this.name   = name;
     this.pImage = ImageManager.Find(imgName);
     this.pScreenRect.Set(x, y, w, h);
     this.pColor.Set(1.0f, 1.0f, 1.0f, 1.0f);
     this.pAzulSprite.Swap(pImage.pTexture.pAzulTexture, pImage.pRect, this.pScreenRect, this.pColor);
     this.x  = pAzulSprite.x;
     this.y  = pAzulSprite.y;
     this.sx = pAzulSprite.sx;
     this.sy = pAzulSprite.sy;
 }
コード例 #26
0
        public static void LoadImage(ImageName name, string path)
        {
            Image newImage = new Image(path);
            newImage.SetName(name);
            images.Add(name, newImage);

            // Create a rectangle object, make it have 0 alpha, and stream it over to CalVR to pre-load the textures
            Rectangle r = new Rectangle(0, 0, newImage.width, newImage.height);
            r.setTexture(path);
            r.Hide();
            Mugic.MugicObjectManager.Register(r);
        }
コード例 #27
0
        public RequestInstallModule(string imageName, int moduleReplicas, string moduleName, LoadBalancerConfig loadBalancerConfig)
        {
            if (loadBalancerConfig == null)
            {
                throw new Exception("loadBalancerConfig may not be null");
            }

            ImageName          = new ImageName(imageName);
            ModuleReplicas     = new ModuleReplicas(moduleReplicas);
            ModuleName         = new ModuleName(moduleName);
            LoadBalancerConfig = loadBalancerConfig;
        }
コード例 #28
0
 public IActionResult getMainPicture(int id)
 {
     try
     {
         PublicationDAO pDAO  = new PublicationDAO(_connection);
         ImageName      image = pDAO.getMainImage(id);
         return(Ok(image));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
コード例 #29
0
 public IActionResult getMainPicture(int post)
 {
     try
     {
         JobDAO    jobDAO = new JobDAO(_connection, this._environment.ContentRootPath);
         ImageName image  = jobDAO.getMainImage(post);
         return(Ok(image));
     }
     catch (Exception e)
     {
         return(BadRequest(new ErrorMessageModel(e.Message)));
     }
 }
コード例 #30
0
        public static Texture2D getImage(ImageName imageName)
        {
            int i = (int)imageName;

            if (i < myImage.Count)
            {
                return(myImage[i]);
            }
            else
            {
                return(null);
            }
        }
コード例 #31
0
 public IActionResult getProfilePicture(int user)
 {
     try
     {
         UserDAO   userDAO = new UserDAO(_connection, this._environment.ContentRootPath);
         ImageName image   = userDAO.getProfileImage(user);
         return(Ok(image));
     }
     catch (Exception e)
     {
         return(BadRequest(new ErrorMessageModel(e.Message)));
     }
 }
コード例 #32
0
 public IActionResult getProfilePicture(int user)
 {
     try
     {
         UserDAO   userDAO = new UserDAO(_connection);
         ImageName image   = userDAO.getProfileImage(user);
         return(Ok(image));
     }
     catch (Exception e)
     {
         return(BadRequest(new ErrorExceptionModel(e.Message)));
     }
 }
コード例 #33
0
ファイル: Tile.cs プロジェクト: Kalasen/Adventurer
 /// <summary>
 /// Initializes a new instance of the <see cref="Tile"/> class.
 /// </summary>
 /// <param name="image">
 /// The image this tile should be drawn with.
 /// </param>
 public Tile(ImageName image)
 {
     this.image = image;
 }
コード例 #34
0
ファイル: DAO.cs プロジェクト: colincapurso/IndieSpeedRun2013
 //public Slice()
 //{
 //  Element = Element.Blank;
 //  ImageName = ImageName.Nothing;
 //  X = 0;
 //  Y = 0;
 //  Width = 0;
 //  Height = 0;
 //}
 public Slice(Element element, ImageName imageName,
           int x, int y, int width, int height)
 {
     Element = element;
       ImageName = imageName;
       X = x;
       Y = y;
       Width = width;
       Height = height;
 }
コード例 #35
0
ファイル: DAO.cs プロジェクト: colincapurso/IndieSpeedRun2013
 public ImagePath(ImageName imageName, string path)
 {
     Name = imageName;
       Path = path;
 }
コード例 #36
0
ファイル: Player.cs プロジェクト: Kalasen/Adventurer
 /// <summary>
 /// Initializes a new instance of the <see cref="Player"/> class.
 /// </summary>
 /// <param name="image">
 /// The image to represent the player.
 /// </param>
 public Player(ImageName image)
     : base(image)
 {
 }
コード例 #37
0
 public void setTexture(ImageName name)
 {
     image = ImageManager.GetImage(name);
     dirty = true;
 }
コード例 #38
0
 public static Image GetImage(ImageName name)
 {
     return images[name];
 }
コード例 #39
0
ファイル: ResImageList.cs プロジェクト: prepare/HTML-Renderer
 public static Image GetImage(ImageName imageName)
 {
     Image found;
     images.TryGetValue(imageName, out found);
     return found;
 }
コード例 #40
0
ファイル: Image.cs プロジェクト: AesteroidBlues/rampage-xl
 public void SetName(ImageName name)
 {
     _name = name;
 }