public void Start(IBundleContext context) { BundleContext = context; Bundle = context.Bundle; NavigationServiceTracker = new ServiceTracker <INavigationService>(context); ConfigurationServiceTracker = new ServiceTracker <IConfigurationService>(context); PermissionServiceTracker = new ServiceTracker <IPermissionService>(context); NavigationServiceFactoryTracker = new ServiceTracker <INavigationServiceFactory>(context); MainWindowServiceTracker = new ServiceTracker <IMainWindowService>(context); FirstFloor.ModernUI.Resources.Culture = new CultureInfo("zh-CN"); var app = context.GetFirstOrDefaultService <Application>(); if (app != null) { try { // 注册ModernUI皮肤资源。 ResourceDictionary r = new ResourceDictionary(); r.MergedDictionaries.Add(new ResourceDictionary() { Source = new Uri("/FirstFloor.ModernUI,Version=1.0.6.0;component/Assets/ModernUI.xaml", UriKind.RelativeOrAbsolute) }); r.MergedDictionaries.Add(new ResourceDictionary() { Source = new Uri("/FirstFloor.ModernUI,Version=1.0.6.0;component/Assets/ModernUI.Light.xaml", UriKind.RelativeOrAbsolute) }); app.Resources = r; } catch { } } }
public void Start(IBundleContext context) { Bundle = context.Bundle; BundleManagementServiceTracker = new ServiceTracker <IBundleManagementService>(context); BundleInstallerService = context.GetFirstOrDefaultService <IBundleInstallerService>(); Application firstOrDefaultService = context.GetFirstOrDefaultService <Application>(); if (firstOrDefaultService != null) { try { ResourceDictionary resourceDictionary = new ResourceDictionary(); resourceDictionary.MergedDictionaries.Add(new ResourceDictionary { Source = new Uri("/FirstFloor.ModernUI,Version=1.0.3.0;component/Assets/ModernUI.xaml", UriKind.RelativeOrAbsolute) }); resourceDictionary.MergedDictionaries.Add(new ResourceDictionary { Source = new Uri("/FirstFloor.ModernUI,Version=1.0.3.0;component/Assets/ModernUI.Light.xaml", UriKind.RelativeOrAbsolute) }); firstOrDefaultService.Resources = resourceDictionary; } catch { } } }
protected internal virtual void startTrackingServices() { processEngineServiceTracker = new ServiceTracker <ProcessEngine>(ServiceNames.forManagedProcessEngines(), processEngines); serviceContainer.addListener(processEngineServiceTracker); processApplicationServiceTracker = new ServiceTracker <MscManagedProcessApplication>(ServiceNames.forManagedProcessApplications(), processApplications); serviceContainer.addListener(processApplicationServiceTracker); }
/// <summary> /// 启动插件时,执行操作。 /// </summary> /// <param name="context">插件上下文。</param> public void Start(IBundleContext context) { Bundle = context.Bundle; PermissionServiceTracker = new ServiceTracker <IPermissionService>(context); ConfigurationServiceTracker = new ServiceTracker <IConfigurationService>(context); DbConnectionFactoryServiceTracker = new ServiceTracker <IDbConnectionFactoryService>(context); MainWindowServiceTracker = new ServiceTracker <IMainWindowService>(context); }
public void Start(IBundleContext context) { Bundle = context.Bundle; var navigationFactory = new NavigationServiceFactory(context); context.AddService <INavigationServiceFactory>(navigationFactory); context.AddService <INavigationService>(navigationFactory.CreateNavigationService("UIShell.NavigationService")); PermissionServiceTracker = new ServiceTracker <IPermissionService>(context); }
public void Start(IBundleContext context) { Bundle = context.Bundle; PageFlowServiceTracker = new ServiceTracker <IPageFlowService>(context); BundleManagementServiceTracker = new ServiceTracker <IBundleManagementService>(context); //初始化菜单数据 NavigationModel = new NavigationModel(context.Bundle); DefaultConfig.RegisterBundleNamespaces(context.Bundle.SymbolicName, GetType().Assembly); BundleConfig.RegisterBundles(BundleTable.Bundles); }
public void Start(IBundleContext context) { Bundle = context.Bundle; var userDataAccessor = new UserDataAccessor(); userDataAccessor.CreateDefaultSystemManager(); PermissionServiceTracker = new ServiceTracker <IPermissionService>(context); PermissionExtensionModelServiceTracker = new ServiceTracker <IPermissionExtensionModelService>(context); ConfigurationServiceTracker = new ServiceTracker <IConfigurationService>(context); MainWindowServiceTracker = new ServiceTracker <IMainWindowService>(context); context.AddService <Window>(new LoginWindow()); }
public void FillGrid() { string username = "", userid = ""; int totallogins = 0; try { string utype = Session["utype"].ToString(); string[] date = txtmonth.Text.Split('/'); int mn = Convert.ToInt32(date[0]); int yr = Convert.ToInt32(date[1]); ds = new DataSet(); ds.Clear(); if (utype == "admin") { qr = "select userid,usernm from users where usertype='user' and userstatus='active'"; } else { qr = "select userid,usernm from users where userid='" + Session["userid"].ToString() + "'"; } ds = obj.GetData(qr); ds.Tables[0].Columns[0].ColumnName = "User_Name"; ds.Tables[0].Columns[1].ColumnName = "Logins"; ds.Tables[0].Columns.Add(); ds.Tables[0].Columns[2].ColumnName = "Uploads"; ds.Tables[0].Columns.Add(); ds.Tables[0].Columns[3].ColumnName = "Downloads"; ds.Tables[0].Columns.Add(); ds.Tables[0].Columns[4].ColumnName = "Encryption"; ds.Tables[0].Columns.Add(); ds.Tables[0].Columns[5].ColumnName = "Decryption"; ds.Tables[0].Columns.Add(); ds.Tables[0].Columns[6].ColumnName = "Permission"; ds.Tables[0].Columns.Add(); ds.Tables[0].Columns[7].ColumnName = "Askkey"; ds.Tables[0].Columns.Add(); ds.Tables[0].Columns[8].ColumnName = "Recovery"; ds.Tables[0].Columns.Add(); ds.Tables[0].Columns[9].ColumnName = "Space"; int rows = ds.Tables[0].Rows.Count; int cnt = 0; for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { cnt++; userid = ds.Tables[0].Rows[i][0].ToString(); username = ds.Tables[0].Rows[i][1].ToString(); LoginLog ul = new LoginLog(); totallogins = ul.getLoginCount(userid, mn, yr); ServiceTracker sl = new ServiceTracker(userid, mn, yr); upload = sl.Upload; download = sl.Download; encryption = sl.Encryption; decryption = sl.Decryption; spacebytes = sl.SpaceBytes; spacekb = sl.SpaceKB; spacemb = sl.SpaceMB; permission = sl.Permission; askkey = sl.Askkey; recovery = sl.Recovery; ServiceDetails charge = new ServiceDetails(); uploadch = charge.UploadCharge; downloadch = charge.DownloadCharge; askkeych = charge.AskkeyCharge; permissionch = charge.PermissionCharge; loginch = charge.LoginCharge; spacech = charge.SpaceCharge; encryptionch = charge.EncryptionCharge; decryptionch = charge.DecryptionCharge; recoverych = charge.RecoveryCharge; double usagerent = 0.0; usagerent = (totallogins * loginch) + (upload * uploadch) + (download * downloadch) + (permission * permissionch) * (spacemb * spacech); usagerent += (askkey * askkeych) + (encryption * encryptionch) + (decryption * decryptionch) + (recovery * recoverych); ds.Tables[0].Rows[i][0] = username; ds.Tables[0].Rows[i][1] = totallogins; ds.Tables[0].Rows[i][2] = upload; ds.Tables[0].Rows[i][3] = download; ds.Tables[0].Rows[i][4] = encryption; ds.Tables[0].Rows[i][5] = decryption; ds.Tables[0].Rows[i][6] = permission; ds.Tables[0].Rows[i][7] = askkey; ds.Tables[0].Rows[i][8] = recovery; ds.Tables[0].Rows[i][9] = spacekb + " KB " + spacemb + " MB"; ManagePayments objpay = new ManagePayments(userid, Math.Round(usagerent)); } int count = ds.Tables[0].Rows.Count; if (count == 0) { flag = false; LinkButton2.Visible = false; LinkButton3.Visible = false; } else { flag = true; } PagedDataSource pgd = new PagedDataSource(); pgd.DataSource = ds.Tables[0].DefaultView; pgd.CurrentPageIndex = CurrentPageIndex; pgd.AllowPaging = true; if (count < 8) { pgd.PageSize = count; } else { pgd.PageSize = 8; } LinkButton2.Enabled = !(pgd.IsLastPage); LinkButton3.Enabled = !(pgd.IsFirstPage); datausage.DataSource = pgd; datausage.DataBind(); } catch (Exception ex) { } }
public void Start(IBundleContext context) { Bundle = context.Bundle; PageFlowServiceTracker = new ServiceTracker <IPageFlowService>(context); DefaultConfig.RegisterBundleNamespaces(context.Bundle.SymbolicName, GetType().Assembly); }
public void Start(IBundleContext context) { //todo: BundleManagementServiceTracker = new ServiceTracker<IBundleManagementService>(context); }
public void Start(IBundleContext context) { //todo: BundleManagementServiceTracker = new ServiceTracker <IBundleManagementService>(context); }