コード例 #1
0
ファイル: ScriptHost.cs プロジェクト: lycilph/Projects
        public ScriptHost(Profile profile, CategoryController category_controller, MainWindowViewModel vm)
        {
            script_engine = new ScriptEngine();
            script_session = script_engine.CreateSession(this);
            script_session.AddReference("System");
            script_session.AddReference(GetType().Assembly.Location);

            Profile = profile;
            ViewModel = vm;
            CategoryController = category_controller;
        }
コード例 #2
0
ファイル: DataGenerator.cs プロジェクト: lycilph/Projects
 public static Profile GenerateProfile()
 {
     var profile = new Profile() {Name = Wordlist.Instance.Random()};
     // Add accounts
     profile.Accounts.AddRange(RandomAccounts(rand.Next(1,11)));
     // Add posts to accounts
     foreach (var account in profile.Accounts)
         account.Add(RandomPosts(rand.Next(100,1001)));
     // Add categories
     foreach (var category in FixedCategories(profile.AggregatedPosts()))
         profile.RootCategory.Add(category);
     return profile;
 }
コード例 #3
0
 public GraphDataGenerator(Profile profile)
 {
     this.profile = profile;
 }
コード例 #4
0
        public void Initialize()
        {
            profile = DataGenerator.GenerateProfile();
            category_controller = new CategoryController(profile);
            graph_data_generator = new GraphDataGenerator(profile);
            script_host = new ScriptHost(profile, category_controller, this);

            Posts = new ObservableCollection<Post>(profile.AggregatedPosts());
            Root = CategoryViewModel.Create(profile.RootCategory);
            Accounts = new ObservableCollection<Account>(profile.Accounts);
            Title = "Categorization engine [" + profile.Name + "]";

            SelectedPost = Posts.FirstOrDefault();
        }
コード例 #5
0
 public CategoryController(Profile profile)
 {
     this.profile = profile;
 }