Esempio n. 1
0
        public void ShowAddOptionDialog(object obj)
        {
            var newWindow = new AddOption();
            var viewModel = new AddOptionViewModel(dataReceiver);

            viewModel.RequestClose += newWindow.Close;
            newWindow.DataContext   = viewModel;
            newWindow.Show();
        }
Esempio n. 2
0
    void AddOptionFromASM(Assembly asm)
    {
        foreach (var type in asm.DefinedTypes)
        {
            Attribute attr = type.GetCustomAttribute(typeof(AddOption));

            if (attr != null)
            {
                List <Type> typeList;
                AddOption   option = (AddOption)attr;
                if (!Center.OptionTypes.TryGetValue(option.Cate, out typeList))
                {
                    typeList = new List <Type>();
                    Center.OptionTypes.Add(option.Cate, typeList);
                }
                if (!typeList.Contains(type))
                {
                    typeList.Add(type);
                }
            }
        }
    }
Esempio n. 3
0
 private async void TSB_AddOption_Click(object sender, EventArgs e)
 {
     await AddOption?.Invoke();
 }