Example #1
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            if (video != null)
            {
                txtName.Text = _proxy.GetItemProperty(Convert.ToInt32(video), EngServRef.ServerData.Video, EngServRef.PropertyData.Name);
                txtDesc.Text = _proxy.GetItemProperty(Convert.ToInt32(video), EngServRef.ServerData.Video, EngServRef.PropertyData.Description);
                txtPath.Text = _proxy.GetItemProperty(Convert.ToInt32(video), EngServRef.ServerData.Video, EngServRef.PropertyData.Path);
                txtSubs.Text = _proxy.GetItemProperty(Convert.ToInt32(video), EngServRef.ServerData.Video, EngServRef.PropertyData.SubPath);
                if (_proxy.GetItemProperty(Convert.ToInt32(video), EngServRef.ServerData.Video, EngServRef.PropertyData.Year) != null)
                {
                    txtYear.Text = _proxy.GetItemProperty(Convert.ToInt32(video), EngServRef.ServerData.Video, EngServRef.PropertyData.Year).ToString();
                }
                chCopy.IsChecked = !_proxy.CheckAbsolute(Convert.ToInt32(video), EngServRef.ServerData.Video);
                string imgPath = _proxy.GetItemProperty(Convert.ToInt32(video), EngServRef.ServerData.Video, EngServRef.PropertyData.Imgpath);
                if (imgPath == "WolfV.png")
                {
                    FormData.SetImage("pack://*****:*****@"Temp\VideoImages\{imgPath}"))
                    {
                        FormData.SetImage($@"pack://siteoforigin:,,,/Temp\VideoImages\{imgPath}", imDrag);
                    }
                    else
                    {
                        MessageBox.Show("Image can not be found!", "Something went wrong", MessageBoxButton.OK, MessageBoxImage.Error);
                    }
                }
                lPath.Content = "...";

                stRating.Visibility = Visibility.Collapsed;
                FillCategories(new List <int>(_proxy.GetItemData(Convert.ToInt32(video), EngServRef.ServerData.Video, EngServRef.ServerData.VideoCategory)));
            }
        }
Example #2
0
        //Initialize '_proxy'. Requires the users id.
        public EditRole(EngServRef.EngServiceClient tmp, int id) : this()
        {
            _proxy  = tmp;
            this.id = id;
            int roleId = Convert.ToInt32(_proxy.GetItemProperty(id, EngServRef.ServerData.User, EngServRef.PropertyData.Role));

            role = _proxy.GetItemProperty(roleId, EngServRef.ServerData.Role, EngServRef.PropertyData.Name);
            lUsername.Content = _proxy.GetItemProperty(id, EngServRef.ServerData.User, EngServRef.PropertyData.Name);

            List <int> lst = new List <int>(_proxy.GetItems(EngServRef.ServerData.Role));
            int        i   = 0;

            foreach (int item in lst)
            {
                cmbRole.Items.Add(new TextBlock {
                    Text = _proxy.GetItemProperty(item, EngServRef.ServerData.Role, EngServRef.PropertyData.Name), FontSize = 12, Foreground = Brushes.Black
                });
                if (item == roleId)
                {
                    cmbRole.SelectedIndex = i;
                }
                i++;
            }
        }
Example #3
0
        //Initialize '_proxy'. Requires the users id.
        public EditAvatar(EngServRef.EngServiceClient tmp, int id) : this()
        {
            _proxy  = tmp;
            this.id = id;

            string path = _proxy.GetItemProperty(id, EngServRef.ServerData.User, EngServRef.PropertyData.Imgpath) ?? "Wolf.png";

            if (path == "Wolf.png")
            {
                FormData.SetImage("pack://*****:*****@"Temp\Avatars\{path}"))
                {
                    FormData.SetImage($@"pack://siteoforigin:,,,/Temp\Avatars\{path}", imDrag);
                }
                else
                {
                    MessageBox.Show("Your avatar can not be found!", "Something went wrong", MessageBoxButton.OK, MessageBoxImage.Error);
                }
            }
        }
Example #4
0
 /// <summary>
 /// Initialize form for editting.
 /// </summary>
 /// <param name="tmp">Host.</param>
 /// <param name="wordsName">Word.</param>
 /// <param name="userId">Id of user.</param>
 public AddWord(EngServRef.EngServiceClient tmp, int word, int?userId) : this(tmp, userId)
 {
     name     = _proxy.GetItemProperty(word, EngServRef.ServerData.Word, EngServRef.PropertyData.Name);
     wordsId  = word;
     editForm = true;
 }
Example #5
0
 /// <summary>
 /// Initialize form for editting.
 /// </summary>
 /// <param name="tmp">Host.</param>
 /// <param name="grammar">Rules id.</param>
 public AddGrammar(EngServRef.EngServiceClient tmp, int grammar) : this(tmp)
 {
     grammarId    = grammar;
     txtName.Text = _proxy.GetItemProperty(grammar, EngServRef.ServerData.Grammar, EngServRef.PropertyData.Name);
 }