예제 #1
0
        public static int ResourceBaseParse(ResourceBase resourceBase, string[] strSplit, int strCnt)
        {
            int count = 0;

            resourceBase.UniqueID = Convert.ToUInt64(strSplit[strCnt] == null ? "0" : strSplit[strCnt]); strCnt++;

            resourceBase.Admin = new UserBase(Convert.ToUInt64(strSplit[strCnt] == null ? "0" : strSplit[strCnt])); strCnt++;

            strCnt = ResourceDescription.Parse(resourceBase.ResourceDescription, strSplit, strCnt);

            resourceBase.ResourcePriority = (EResourcePriority)Convert.ToInt32(strSplit[strCnt] == null ? "0" : strSplit[strCnt]); strCnt++;

            resourceBase.MaxHoldings = Convert.ToInt32(strSplit[strCnt] == null ? "0" : strSplit[strCnt]); strCnt++;

            count = Convert.ToInt32(strSplit[strCnt] == null ? "0" : strSplit[strCnt]); strCnt++;
            for (int i = 0; i < count; i++)
            {
                if (strSplit[strCnt] == null)
                {
                    break;
                }
                resourceBase.HoldingsInfo.Add(new HoldingsInfo(Convert.ToUInt64(strSplit[strCnt]))); strCnt++;
            }

            resourceBase.Scalable = Convert.ToBoolean(strSplit[strCnt] == null ? "0" : strSplit[strCnt]); strCnt++;

            resourceBase.Value = Convert.ToInt32(strSplit[strCnt] == null ? "0" : strSplit[strCnt]); strCnt++;

            strCnt = NameImage.Parse(resourceBase.ThumbNameImage, strSplit, strCnt);

            strCnt = NameImage.Parse(resourceBase.FullNameImage, strSplit, strCnt);

            return(strCnt);
        }
        public void LoadToImageList(UserNameImageList userNameImageList, UInt64 uniqueID, int index)
        {
            SqlDataReader sqlReader  = null;
            SqlCommand    sqlCommand = null;

            try
            {
                sqlCommand = new SqlCommand("select * from UserNameImages where UserUniqueID = @1", mSqlConnection);
                SqlParameter sqlParameter = new SqlParameter("@1", SqlDbType.BigInt);
                sqlParameter.Value = uniqueID;
                sqlCommand.Parameters.Add(sqlParameter);

                sqlReader = sqlCommand.ExecuteReader();

                userNameImageList.UniqueID      = uniqueID;
                userNameImageList.LastDALChange = DateTime.Now.Ticks;
                while (sqlReader.Read())
                {
                    Int64 lastDALChange = Convert.ToInt64(sqlReader["LastDALChange"].ToString());
                    userNameImageList.LastDALChange = (lastDALChange < userNameImageList.LastDALChange) ? lastDALChange : userNameImageList.LastDALChange;
                    NameImage newNameImage = new NameImage(sqlReader["Name"].ToString(), sqlReader["ImageLocation"].ToString(), int.Parse(sqlReader["Value"].ToString()));
                    newNameImage.IsDefault = false;
                    userNameImageList.Items.Insert(index++, newNameImage);
                }
            }
            catch (Exception exception)
            {
                throw exception;
            }
            finally
            {
                sqlReader.Close();
            }
        }
예제 #3
0
 public ItemBase(UInt64 uniqueID, EventBase eventParent, UserBase adminUser, NameImage nameImage) :
     base(
         uniqueID,
         adminUser,
         new ResourceDescription(uniqueID),
         nameImage,
         new NameImage())
 {
     mEventParent = eventParent;
 }
예제 #4
0
 public ResourceBase(
     UInt64 uniqueID,
     UserBase adminUser,
     ResourceDescription resourceDescription,
     NameImage fullNameImage,
     NameImage thumbNameImage)
 {
     InitResourceBase(
         uniqueID,
         adminUser,
         resourceDescription,
         fullNameImage,
         thumbNameImage);
 }
예제 #5
0
 private void InitResourceBase(
     UInt64 uniqueID,
     UserBase adminUser,
     ResourceDescription resourceDescription,
     NameImage fullNameImage,
     NameImage thumbNameimage)
 {
     mUniqueID            = uniqueID;
     mAdmin               = adminUser;
     mResourceDescription = resourceDescription;
     mResourcePriority    = MyEasySettings.DefaultResourcePriority;
     mHoldingsInfo.Clear();
     mScalable       = false;
     mFullNameImage  = fullNameImage;
     mThumbNameImage = thumbNameimage;
 }
예제 #6
0
        public ImageModel(string link)
        {//не все ссылки содержат формат файла если его нет по умолчанию зделаем jpeg
            var url = new Uri(link);

            Link      = url.Scheme + "://" + url.Host + url.PathAndQuery;
            NameImage = url.Segments[url.Segments.Length - 1];
            if (!NameImage.Contains('.'))
            {
                NameImage += ".jpeg";
                Format     = ".jpeg";
            }
            else
            {
                var fo = NameImage.Split(".");
                Format = "." + fo[fo.Length - 1];
            }
        }
예제 #7
0
            public void Bind(IItemMenu model)
            {
                NameImage?.SetImageFromResource((model as IHome)?.ImageHome);

                if (!NameText.IsNull())
                {
                    NameText.Text = model.Name;

                    NameText?.SetTextColor(ColorConstants.WhiteColor);
                    NameText?.SetFont(FontsConstant.RobotoBold, FontsConstant.Size36);
                }

                if (CellContentRootView.IsNull())
                {
                    return;
                }
                CellContentRootView.Tag    = model;
                CellContentRootView.Click -= CellContentRootView_Click;
                CellContentRootView.Click += CellContentRootView_Click;
            }
    protected string GetNameImageString(NameImage imageInfo)
    {
        string removeStr = "";

        if (!imageInfo.IsDefault)
        {
            removeStr = "<img class=\"fr\" alt=\"Remove\" src=\"Icons/DeleteX.png\" onMouseOver=\"this.src='Icons/DeleteXh.png'\" onMouseOut=\"this.src='Icons/DeleteX.png'\"" +
                        "width=\"24\" height=\"24\" onclick=\"removeItemName('" + imageInfo.Name + "','" + imageInfo.ImageLocation + "');\">";
        }

        /*return "<div class=\"scrollItemsDiv\" id=\"__" +imageInfo.Name+imageInfo.ImageLocation + "__\" onclick=\"newItemClicked('__" +imageInfo.Name+imageInfo.ImageLocation + "__');\"" +
         *              "onmouseover=\"this.style.background='#B0E0E6'\" onmouseout=\"this.style.background=''\"" +
         *              "><input type=\"checkbox\" class=\"nmCBoxS\" name=\"nmCBox\" value=\"" +imageInfo.Name+"(#)"+imageInfo.ImageLocation +"(#)" + imageInfo.Value.ToString() + "\" /><img alt=\"" + imageInfo.Name + "\" src=\"" + imageInfo.ImageLocation  + "\" width=\"24\" height=\"24\" />" +
         *              "&nbsp;<img alt=\" \" class=\"smallStar\" src=\"Icons/sStars"+imageInfo.Value.ToString()+".png\" /><span>&nbsp;"+ imageInfo.Name + removeStr + "</span></div>";*/

        return("<div class=\"scrollItemsDiv\" id=\"__" + imageInfo.Name + imageInfo.ImageLocation + "__\" onclick=\"newItemClicked('__" + imageInfo.Name + imageInfo.ImageLocation + "__');\"" +
               "onmouseover=\"this.style.background='#B0E0E6'\" onmouseout=\"this.style.background=''\">" +
               "<input type=\"checkbox\" class=\"nmCBoxS\" name=\"nmCBox\" value=\"" + imageInfo.Name + "(#)" + imageInfo.ImageLocation + "(#)" + imageInfo.Value.ToString() + "\" />" +
               "<img alt=\"\" src=\"Images/global/chkF.png\" class=\"nmChkTF\" />" +
               "<img alt=\"" + imageInfo.Name + "\" src=\"" + imageInfo.ImageLocation + "\" width=\"24\" height=\"24\" />" +
               "&nbsp;<img alt=\" \" class=\"smallStar\" src=\"Icons/sStars" + imageInfo.Value.ToString() + ".png\" /><span>&nbsp;" + imageInfo.Name + removeStr + "</span></div>");
    }
    public string AddNewItemTypeEvent(
        string itemName,
        string iconLocation,
        string value)
    {
        if (!mIsInit)
        {
            InitMembers();
        }

        if (mCurrentEvent == null)
        {
            return("Event is not Loaded");
        }

        bool saveDicList = true;

        foreach (NameImage imageInfo in mCurrentUserNameImageList.Items)
        {
            if ((imageInfo.Name.ToLowerInvariant() == itemName.ToLowerInvariant()) &&
                (imageInfo.ImageLocation == iconLocation))
            {
                saveDicList = false;
            }
        }

        NameImage selectedItem = new NameImage(itemName, iconLocation, int.Parse(value));

        selectedItem.IsDefault = false;

        if (saveDicList)
        {
            mCurrentUserNameImageList.Items.Add(selectedItem);
            mUserNameImageListBO.Save(mCurrentUserNameImageList);
        }

        return(GetNameImageString(selectedItem));
    }