当前位置: 首页>>代码示例>>C#>>正文


C# FileManager类代码示例

本文整理汇总了C#中FileManager的典型用法代码示例。如果您正苦于以下问题:C# FileManager类的具体用法?C# FileManager怎么用?C# FileManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


FileManager类属于命名空间,在下文中一共展示了FileManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        // get id from query string
        int id = Convert.ToInt32(Request.QueryString["id"]);
        string type = Request.QueryString["type"];

        if (type == "doc")
        {
            // get document for id
            FileManager fm = new FileManager();
            Document d = fm.documentForID(id);
            Response.Write(Request.QueryString["id"]);

            Response.Clear();
            Response.Buffer = true;

            Response.ContentType = d.MIMEType;
            Response.BinaryWrite(d.fileContent);
        }
        else {
            ReportManager rm = new ReportManager();
           Report r = rm.ReportForID(id);
            Response.Write(Request.QueryString["id"]);

            Response.Clear();
            Response.Buffer = true;

            Response.ContentType = r.MIMEType;
            Response.BinaryWrite(r.FileContent);
        }
        Response.Flush();
        Response.End();
    }
开发者ID:rafathan,项目名称:intranet-reference,代码行数:33,代码来源:Default.aspx.cs

示例2: Setup

        public void Setup()
        {
            _mockData = MockComponentProvider.CreateDataProvider();
            _mockFolder = MockComponentProvider.CreateFolderProvider(Constants.FOLDER_ValidFolderProviderType);
            _mockCache = MockComponentProvider.CreateDataCacheProvider();

            _folderManager = new Mock<IFolderManager>();
            _folderPermissionController = new Mock<IFolderPermissionController>();
            _portalController = new Mock<IPortalController>();
            _folderMappingController = new Mock<IFolderMappingController>();
            _globals = new Mock<IGlobals>();
            _cbo = new Mock<ICBO>();
            _pathUtils = new Mock<IPathUtils>();

            _fileManager = new FileManager();

            FolderManager.RegisterInstance(_folderManager.Object);
            FolderPermissionControllerWrapper.RegisterInstance(_folderPermissionController.Object);
            PortalControllerWrapper.RegisterInstance(_portalController.Object);
            FolderMappingController.RegisterInstance(_folderMappingController.Object);
            TestableGlobals.SetTestableInstance(_globals.Object);
            CBOWrapper.RegisterInstance(_cbo.Object);
            PathUtils.RegisterInstance(_pathUtils.Object);

            _mockFileManager = new Mock<FileManager> { CallBase = true };

            _folderInfo = new Mock<IFolderInfo>();
            _fileInfo = new Mock<IFileInfo>();
        }
开发者ID:biganth,项目名称:Curt,代码行数:29,代码来源:FileManagerTests.cs

示例3: Initialize

        /// <summary>
        /// This only needs to be called from ComponentManager
        /// </summary>
        public override void Initialize() {
            SetDebugConditional();

            RunningOn = CurrentLocation;

            Files = new FileManager(); 
            Files.Initialize();  // logging depends on this

            Log.Info("Starting SE Garden v" + ModInfo.Version, "");

            Commands = new ChatManager();
            Commands.Initialize();

            Messages = new MessageManager();
            Messages.Initialize();

            if (ModInfo.DebugMode) {
                Specification.RunSpecTests(
                    "SEGarden",
                    new List<Specification>() {
                        new ItemCountAggregateDefinitionSpec(),
                        new ItemCountDefinitionSpec()
                    }
                );
            }

            base.Initialize();
        }
开发者ID:zrisher,项目名称:SEGarden,代码行数:31,代码来源:GardenGateway.cs

示例4: MainPage

        public MainPage()
        {
            InitializeComponent();

            this.fileManager = new FileManager(this.diagram);
            this.toolBox.ItemsSource = new HierarchicalGalleryItemsCollection();
        }
开发者ID:CJMarsland,项目名称:xaml-sdk,代码行数:7,代码来源:MainPage.xaml.cs

示例5: GenerateCode

        public override void GenerateCode(FileManager fileManager, SymbolTable symbolTable, CodeGeneratorHelper codeGeneratorHelper)
        {
            AppendNodeComment(fileManager);

            // Initialization assignment
            this._children[0].GenerateCode(fileManager, symbolTable, codeGeneratorHelper);

            // Generate loop start label
            string startLabel = codeGeneratorHelper.GenerateNextLabel();
            fileManager.Output.Append(Macro.Label(startLabel));

            // Check condition and jump out if false
            this._children[1].GenerateCode(fileManager, symbolTable, codeGeneratorHelper);
            string outLabel = codeGeneratorHelper.GenerateNextLabel();
            fileManager.Output.Append(Macro.JumpOnFalse(outLabel));

            // Loop body
            this._children[3].GenerateCode(fileManager, symbolTable, codeGeneratorHelper);

            // Altering assignment
            this._children[2].GenerateCode(fileManager, symbolTable, codeGeneratorHelper);

            // Jump back to condition check
            fileManager.Output.Append(Macro.Jump(startLabel));

            // Generate loop end label
            fileManager.Output.Append(Macro.Label(outLabel));
        }
开发者ID:alirazavi,项目名称:nase-compiler,代码行数:28,代码来源:SyntaxTreeForStatementNode.cs

示例6: Initialize

        protected override void Initialize()
        {
            theFileManager = FileManager.Get(this);
            theInputManager = InputManager.Get(this);
            theUtilityManager = UtilityManager.Get(this);
            theTileManager = TileManager.Get(this);
            theButtonManager = ButtonManager.Get(this);
            thePlayerManager = PlayerManager.Get(this);
            theScreenManager = ScreenManager.Get(this);
            theCameraManager = CameraManager.Get(this);
            theEnemyManager = EnemyManager.Get(this);
            theProjectileManager = ProjectileManager.Get(this);
            theCollisionManager = CollisionManager.Get(this);

            theScreenManager.WorldScreen = new MainMenu();

            Player.CreatePlayer("test", new Vector2(mScreenDimensions.X / 2.0f, mScreenDimensions.Y / 2.0f), Vector2.Zero);

            TileButton.Create(new FloorCopper(), Keys.E);
            TileButton.Create(new FloorMetal(), Keys.R);
            TileButton.Create(new HardWallCopper(), Keys.T);
            TileButton.Create(new HardWallMetal(), Keys.Y);
            TileButton.Create(new WallMetal(), Keys.Q);
            TileButton.Create(new CopperWall(), Keys.W);

            EnemyButton.Create(new EnemyTurret(), Keys.F);
             //   EnemyButton.Create("Turret_Gun", Keys.F);

            theTileManager.Load("Level_1.xml");

            base.Initialize();
        }
开发者ID:JonathanMcCaffrey,项目名称:tank-gauntlet,代码行数:32,代码来源:Game1.cs

示例7: Search

        public IEnumerable<SearchResult> Search(SearchQuery query, FileManager fileManager)
        {
            var repos = from dir in fileManager.DirectoryInfo.EnumerateDirectories()
                        let repoInfo = GitUtilities.GetRepoInfo(dir.FullName)
                        where repoInfo.IsGitRepo
                        select repoInfo;

            foreach (var repo in repos)
            {
                if (query.Terms.All(t => repo.Name.IndexOf(t, StringComparison.OrdinalIgnoreCase) != -1 || repo.Description.IndexOf(t, StringComparison.OrdinalIgnoreCase) != -1))
                {
                    yield return new SearchResult
                    {
                        LinkText = repo.Name,
                        ActionName = "ViewRepo",
                        ControllerName = "Browse",
                        RouteValues = new { repo = repo.Name },
                        Lines = new List<SearchLine>
                        {
                            new SearchLine { Line = repo.Description },
                        },
                    };
                }
            }
        }
开发者ID:ALyman,项目名称:WebGitNet,代码行数:25,代码来源:RepoInfoSearchProvider.cs

示例8: LoadContent

        public override void LoadContent(ContentManager Content, InputManager inputManager)
        {
            base.LoadContent(Content, inputManager);
            if (font== null)
                font = content.Load<SpriteFont>("Font1");

            imageNumber = 0;
            fileManager = new FileManager();
            fade = new List<FadeAnimation>();
            images = new List<Texture2D>();

            fileManager.LoadContent("Load/Splash.cme", attributes, contents);

            for (int i = 0; i < attributes.Count; i++)
            {
                for (int j = 0; j < attributes[i].Count; j++)
                {
                    switch (attributes[i][j])
                    {
                        case "Image":
                            images.Add(content.Load<Texture2D>(contents[i][j]));
                            fade.Add(new FadeAnimation());
                            break;
                    }
                }
            }
            for (int i = 0; i < fade.Count; i++)
            {
                fade[i].LoadContent(content, images[i], "", new Vector2(80,60));
                fade[i].Scale = 1.25f;
                fade[i].IsActive = true;
            }
        }
开发者ID:Nerminkrus,项目名称:Spel,代码行数:33,代码来源:SplashScreen.cs

示例9: GetTempFileNameReturnsNewFileName

        public void GetTempFileNameReturnsNewFileName()
        {
            // Arrange.
            const string TempDocumentUNC = @"z:\Temp\";
            var guid1 = new Guid("{D98C2A44-FACF-4FD4-ACA8-EBBE3AD6A173}");
            var guid2 = new Guid("{28FAEA09-F87A-42F4-B7AA-18079670C428}");

            var fileManager = new FileManager();
            var systemOptions = Mock.Create<ISystemOptionsInfo>();
            Mock.Arrange(() => systemOptions.TempDocumentUNC).Returns(TempDocumentUNC);
            Mock.Arrange(() => SystemOptionsInfo.GetSystemOptionsInfo()).Returns(systemOptions);
            Mock.Arrange(() => Guid.NewGuid()).Returns(guid1).InSequence();
            Mock.Arrange(() => Guid.NewGuid()).Returns(guid2).InSequence();

            Mock.Arrange(() => Directory.Exists(TempDocumentUNC)).Returns(true);
            Mock.Arrange(() => File.Create(Arg.AnyString)).Returns(() => Mock.Create<FileStream>(Behavior.Loose));

            // Act.
            var tempFile = fileManager.GetTempFileName(null);
            var tempFileWithExtension = fileManager.GetTempFileName("tmp");

            // Assert.
            Assert.AreEqual(@"z:\Temp\D98C2A44-FACF-4FD4-ACA8-EBBE3AD6A173", tempFile);
            Assert.AreEqual(@"z:\Temp\28FAEA09-F87A-42F4-B7AA-18079670C428.tmp", tempFileWithExtension);
            Mock.Assert(() => File.Create(@"z:\Temp\D98C2A44-FACF-4FD4-ACA8-EBBE3AD6A173"), Occurs.Once());
            Mock.Assert(() => File.Create(@"z:\Temp\28FAEA09-F87A-42F4-B7AA-18079670C428.tmp"), Occurs.Once());

            // Expected exceptions.
            Mock.Arrange(() => SystemOptionsInfo.GetSystemOptionsInfo()).Returns(() => null);
            TestsHelper.VerifyThrow<SystemOptionsLoadException>(() => fileManager.GetTempFileName(null));

            Mock.Arrange(() => systemOptions.TempDocumentUNC).Returns(string.Empty);
            Mock.Arrange(() => SystemOptionsInfo.GetSystemOptionsInfo()).Returns(systemOptions);
            TestsHelper.VerifyThrow<InvalidSystemOptionsException>(() => fileManager.GetTempFileName(null));
        }
开发者ID:mparsin,项目名称:Elements,代码行数:35,代码来源:FileManagerTests.cs

示例10: CreateCommand

        public static ICommand CreateCommand(FileManager manager, string commandLine)
        {
            manager.Parser.Parse(commandLine);

            switch (manager.Parser.CommandType)
            {
                case CommandTypes.NOP:
                    return new NOPCommand(manager.Parser.Operands);
                case CommandTypes.MD:
                    return new MDCommand(manager, manager.Parser.Operands);
                case CommandTypes.CD:
                    return new CDCommand(manager, manager.Parser.Operands);
                case CommandTypes.RD:
                    return new RDCommand(manager, manager.Parser.Operands);
                case CommandTypes.DELTREE:
                    return new DELTREECommand(manager, manager.Parser.Operands);
                case CommandTypes.MF:
                    return new MFCommand(manager, manager.Parser.Operands);
                case CommandTypes.MHL:
                    return new MHLCommand(manager, manager.Parser.Operands);
                case CommandTypes.MDL:
                    return new MDLCommand(manager, manager.Parser.Operands);
                case CommandTypes.DEL:
                    return new DELCommand(manager, manager.Parser.Operands);
                case CommandTypes.COPY:
                    return new COPYCommand(manager, manager.Parser.Operands);
                case CommandTypes.MOVE:
                    return new MOVECommand(manager, manager.Parser.Operands);
                case CommandTypes.DIR:
                    return new DIRCommand(manager, manager.Parser.Operands);
                default:
                    throw new UnknownCommandException(commandLine);
            }
        }
开发者ID:gilind,项目名称:workshop,代码行数:34,代码来源:CommandFactory.cs

示例11: GenerateCode

        public override void GenerateCode(FileManager fileManager, SymbolTable symbolTable, CodeGeneratorHelper codeGeneratorHelper)
        {
            AppendNodeComment(fileManager);

            // Check condition
            this._children[0].GenerateCode(fileManager, symbolTable, codeGeneratorHelper);

            // If the condition is false, jump to the else-statement (exit label if else-statement is null)
            string elseLabel = codeGeneratorHelper.GenerateNextLabel();
            fileManager.Output.Append(Macro.JumpOnFalse(elseLabel));

            // Then-statement
            this._children[1].GenerateCode(fileManager, symbolTable, codeGeneratorHelper);

            // On existing else-statement jump over it
            string outLabel = null;
            if (this._children[2] != null)
            {
                outLabel = codeGeneratorHelper.GenerateNextLabel();
                fileManager.Output.Append(Macro.Jump(outLabel));
            }

            // Generate else label
            fileManager.Output.Append(Macro.Label(elseLabel));

            // Else-statement and exit label
            if (this._children[2] != null)
            {
                this._children[2].GenerateCode(fileManager, symbolTable, codeGeneratorHelper);
                fileManager.Output.Append(Macro.Label(outLabel));
            }
        }
开发者ID:alirazavi,项目名称:nase-compiler,代码行数:32,代码来源:SyntaxTreeIfStatementNode.cs

示例12: Initialize

 public void Initialize()
 {
     SolutionConfigurationNode node = new SolutionConfigurationNode();
     ApplicationData applicationData = ApplicationData.FromCurrentAppDomain();
     appNode = new ApplicationConfigurationNode(applicationData.Name, applicationData);
     appNode.Load(null);
     fileManager = new FileManager(node);
 }
开发者ID:bnantz,项目名称:NCS-V1-1,代码行数:8,代码来源:FileManagerFixture.cs

示例13: GenerateCode

        public override void GenerateCode(FileManager fileManager, SymbolTable symbolTable, CodeGeneratorHelper codeGeneratorHelper)
        {
            AppendNodeComment(fileManager);

            this._children[0].GenerateCode(fileManager, symbolTable, codeGeneratorHelper);

            fileManager.Output.Append(Macro.MonadicOperator(this._opCodeSymbol));
        }
开发者ID:alirazavi,项目名称:nase-compiler,代码行数:8,代码来源:SyntaxTreeMonadicOpNode.cs

示例14: MainMenu

        //Contructor
        public MainMenu()
        {
            //Open center screen
            this.StartPosition = FormStartPosition.CenterScreen;
            InitializeComponent();

            fileManager = new FileManager();
        }
开发者ID:CGHill,项目名称:Hard-To-Find,代码行数:9,代码来源:MainMenu.cs

示例15: GenerateCode

        public override void GenerateCode(FileManager fileManager, SymbolTable symbolTable, CodeGeneratorHelper labelHelper)
        {
            AppendNodeComment(fileManager);

            SyntaxTreeDeclarationNode declNode = symbolTable.GetDeclarationNodeLinkToSymbol(this.Identifier) as SyntaxTreeDeclarationNode;

            fileManager.Output.Append(Macro.LoadAccu(declNode.GetMemoryAddress()));
        }
开发者ID:alirazavi,项目名称:nase-compiler,代码行数:8,代码来源:SyntaxTreeIdentNode.cs


注:本文中的FileManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。