public void Configure(FilePool files, ScriptGraph graph)
 {
     // TODO -- need to use the virtual path provider to register the relative path here
     files
         .FilesMatching(file => true)
         .Each(file => graph.RegisterScript(file.Name, file.FullName));
 }
        public void Configure(FilePool files, ScriptGraph graph)
        {
            files
                .FilesMatching(file => file.Extension == "js")
                .Each(file =>
                          {
                              using(var reader = new StreamReader(file.FullName))
                              {
                                  string line;
                                  while((line = reader.ReadLine()) != null)
                                  {
                                      var matches = ReferenceExpression.Matches(line);
                                      if(matches.Count == 0)
                                      {
                                          continue;
                                      }

                                      var path = matches[0].Groups["path"].Value;
                                      var script = getScript(graph, file.Name);
                                      var dependency = getScript(graph, path);
                                      if(script == null || dependency == null)
                                      {
                                          continue;
                                      }

                                      script.AddDependency(dependency);
                                  }
                              }
                          });
        }
Пример #3
0
 private SceneService()
 {
     var fileReader = new MpqFileReader();
     // var fileReader = new MpqFileReader(WoWInstallation.AssumeAt("Z:\\World of Warcraft"));
     Files = new FilePool(fileReader);
     _liquidTypeDatabase = InitializeDatabase(fileReader);
     _builder = new AdtGeometryBuilder(Files, MapLiquidType);
 }
Пример #4
0
        private SceneService()
        {
            var fileReader = new MpqFileReader();

            // var fileReader = new MpqFileReader(WoWInstallation.AssumeAt("Z:\\World of Warcraft"));
            Files = new FilePool(fileReader);
            _liquidTypeDatabase = InitializeDatabase(fileReader);
            _builder            = new AdtGeometryBuilder(Files, MapLiquidType);
        }
        private void InitFilePool()
        {
            // Get FilePool and initialize it
            string filePoolFolderPath = Path.Combine(Helper.GetTempFolder(), "Rainbow.CSharp.SDK", "FileStorage");

            FilePool filePool = FilePool.Instance;

            filePool.SetFolderPath(filePoolFolderPath);
            filePool.SetApplication(ref RbApplication);

            filePool.AllowAutomaticThumbnailDownload     = true;
            filePool.AutomaticDownloadLimitSizeForImages = 250 * 1024; // 250 Ko
        }
Пример #6
0
        private void InitFilePool()
        {
            // Get FilePool and initialize it
            string filePoolFolderPath = Path.Combine(Helper.GetTempFolder(), LogFolderName, "FileStorage");

            FilePool filePool = FilePool.Instance;

            if (!USE_FILE_CACHE)
            {
                if (Directory.Exists(filePoolFolderPath))
                {
                    Directory.Delete(filePoolFolderPath, true);
                }
            }

            filePool.SetFolderPath(filePoolFolderPath);
            filePool.SetApplication(ref RbApplication);

            filePool.AllowAutomaticThumbnailDownload     = true;
            filePool.AutomaticDownloadLimitSizeForImages = 250 * 1024; // 250 Ko
        }
Пример #7
0
 public ModelBuilder(FilePool files)
 {
     Files = files;
 }
        }                                                      // Need to be public - Used as Binding from XAML

        #endregion XAML BINDING ELEMENTS

        #region PUBLIC METHODS

        /// <summary>
        /// Constructor
        /// </summary>
        public ConversationStreamViewModel(String conversationId)
        {
            // Get Xamarin Application
            XamarinApplication = (InstantMessaging.App)Xamarin.Forms.Application.Current;

            // Manage event(s) from FilePool
            filePool = FilePool.Instance;
            filePool.FileDescriptorAvailable += FilePool_FileDescriptorAvailable;
            filePool.ThumbnailAvailable      += FilePool_ThumbnailAvailable;

            // Manage event(s) from AvatarPool
            avatarPool = AvatarPool.Instance;
            avatarPool.ContactAvatarChanged += AvatarPool_ContactAvatarChanged;
            avatarPool.BubbleAvatarChanged  += AvatarPool_BubbleAvatarChanged;

            // Manage event(s) from InstantMessaging
            XamarinApplication.RbInstantMessaging.MessageReceived   += RbInstantMessaging_MessageReceived;
            XamarinApplication.RbInstantMessaging.ReceiptReceived   += RbInstantMessaging_ReceiptReceived;
            XamarinApplication.RbInstantMessaging.MessagesAllRead   += RbInstantMessaging_MessagesAllRead;
            XamarinApplication.RbInstantMessaging.UserTypingChanged += RbInstantMessaging_UserTypingChanged;

            // Manage event(s) from Contacts
            XamarinApplication.RbContacts.ContactAdded       += RbContacts_ContactAdded;
            XamarinApplication.RbContacts.ContactInfoChanged += RbContacts_ContactInfoChanged;

            currentContactJid = XamarinApplication.RbContacts.GetCurrentContactJid();

            // Store conversation Id
            this.conversationId = conversationId;

            // Create default ConversationStream object
            ConversationStream = new ConversationStream
            {
                LoadingIndicatorIsVisible = "False",
                ListViewIsEnabled         = "True"
            };

            // Create default MessagesList  object
            MessagesList = new ObservableRangeCollection <InstantMessaging.Model.Message>();

            if (string.IsNullOrEmpty(this.conversationId))
            {
                //TODO
                Conversation = new ConversationLight();
            }
            else
            {
                // Get Rainbow Conversation object
                rbConversation = XamarinApplication.RbConversations.GetConversationByIdFromCache(this.conversationId);

                // Get Conversation Model Object using Rainbow Conversation
                Conversation = Helper.GetConversationFromRBConversation(rbConversation);
                if (Conversation != null)
                {
                    Conversation.AvatarSource = Helper.GetConversationAvatarImageSource(Conversation);
                }

                // Get Messages
                List <Rainbow.Model.Message> rbMessagesList = XamarinApplication.RbInstantMessaging.GetAllMessagesFromConversationIdFromCache(this.conversationId);
                if (rbMessagesList != null)
                {
                    if (rbMessagesList.Count > 0)
                    {
                        AddToModelRbMessages(rbMessagesList);
                    }

                    if (rbMessagesList.Count < NB_MESSAGE_LOADED_BY_ROW)
                    {
                        LoadMoreMessages();
                    }
                }
                else
                {
                    LoadMoreMessages();
                }
            }
        }
Пример #9
0
 public AdtGeometryBuilder(FilePool files, Func <int, LiquidTypeClass> liquidTypeMapper)
 {
     _files            = files;
     _liquidTypeMapper = liquidTypeMapper;
 }
Пример #10
0
 public DoodadBuilder(FilePool files) : base(files)
 {
 }
Пример #11
0
 public WmoBuilder(FilePool files, DoodadBuilder doodadBuilder, Func<int, MaterialFlags> getLiquidMaterial)
     : base(files)
 {
     _doodadBuilder = doodadBuilder;
     _getLiquidMaterial = getLiquidMaterial;
 }
Пример #12
0
 public ModelBuilder(FilePool files)
 {
     Files = files;
 }
 public AppliesToDirectoryExpression(FilePool files)
 {
     _files = files;
 }
Пример #14
0
 public WmoBuilder(FilePool files, DoodadBuilder doodadBuilder, Func <int, MaterialFlags> getLiquidMaterial) : base(files)
 {
     _doodadBuilder     = doodadBuilder;
     _getLiquidMaterial = getLiquidMaterial;
 }
Пример #15
0
 public AdtGeometryBuilder(FilePool files, Func<int, LiquidTypeClass> liquidTypeMapper)
 {
     _files = files;
     _liquidTypeMapper = liquidTypeMapper;
 }
Пример #16
0
 public DoodadBuilder(FilePool files)
     : base(files)
 {
 }