コード例 #1
0
ファイル: TemplateGenerator.cs プロジェクト: bottleboy/e4xu
        public static string GetDefaultPrefix(AssetTypes type)
        {
            if (knownPackages == null)
            {
                PopulateKnownPackages(defaultPrefices, defaultURIs);
            }
            switch (type)
            {
            default:
            case AssetTypes.Img: return(defaultPrefices[0]);

            case AssetTypes.Snd: return(defaultPrefices[1]);

            case AssetTypes.Fnt: return(defaultPrefices[2]);

            case AssetTypes.Swf: return(defaultPrefices[3]);

            case AssetTypes.Fxg: return(defaultPrefices[4]);

            case AssetTypes.Svg: return(defaultPrefices[5]);

            case AssetTypes.Txt: return(defaultPrefices[6]);

            case AssetTypes.Bin: return(defaultPrefices[7]);
            }
        }
コード例 #2
0
            /// <summary>
            /// Initializes a new instance of the <see cref="ConfigurationDictionary"/> class.
            /// </summary>
            /// <param name="assetType">Type of the asset.</param>
            /// <param name="itemPart">The item part.</param>
            public ConfigurationDictionary(AssetTypes assetType, ItemParts itemPart)
            {
                this.dictionary = new Dictionary <string, string>();
                this.Changed    = true;

                this.AssetType = assetType;
                this.ItemPart  = itemPart;

                switch (itemPart)
                {
                case ItemParts.Identity:
                    this.assigner      = "=";
                    this.separator     = ", ";
                    this.preSeparator  = null;
                    this.postSeparator = Environment.NewLine;
                    break;

                case ItemParts.Values:
                    this.assigner      = "=";
                    this.separator     = Environment.NewLine + "\t";
                    this.preSeparator  = "\t";
                    this.postSeparator = Environment.NewLine;
                    break;

                default:
                    this.assigner      = "=";
                    this.separator     = ", ";
                    this.preSeparator  = null;
                    this.postSeparator = null;
                    break;
                }
            }
コード例 #3
0
ファイル: PluginMain.cs プロジェクト: bottleboy/e4xu
        public void AddFiles(string[] files, AssetTypes ofType)
        {
            FileInfo fi;
            string   generatedName;

            foreach (string n in files)
            {
                try
                {
                    fi = new FileInfo(n);
                    Console.WriteLine("fi " + fi);
                    generatedName = TemplateGenerator.AddFile(new FileInfo(n),
                                                              AssetTypes.Img, this.project.GetAssetPath(ofType));
                    TemplateGenerator.AddEntry(generatedName,
                                               TemplateGenerator.GetDefaultPrefix(ofType),
                                               TemplateGenerator.GetDefaultURI(ofType),
                                               new FileInfo(this.project.Directory +
                                                            Path.DirectorySeparatorChar +
                                                            this.project.CompileTargets[0]), 0);
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.StackTrace);
                }
            }
        }
コード例 #4
0
            /// <summary>
            /// Initializes a new instance of the <see cref="Item"/> class.
            /// </summary>
            /// <param name="assetType">Type of the asset.</param>
            public Item(AssetTypes assetType)
            {
                this.AssetType = assetType;

                this.Identity = new ConfigurationDictionary(assetType, ItemParts.Identity);
                this.Values   = new ConfigurationDictionary(assetType, ItemParts.Values);
            }
コード例 #5
0
 public void AddFiles(string[] files, AssetTypes ofType)
 {
     /*FileInfo fi;
      * string generatedName;
      * foreach (string n in files)
      * {
      *  try
      *  {
      *      fi = new FileInfo(n);
      *      Console.WriteLine("fi " + fi);
      *      generatedName = TemplateGenerator.AddFile(new FileInfo(n),
      *          AssetTypes.Img, this.project.GetAssetPath(ofType));
      *      TemplateGenerator.AddEntry(generatedName,
      *          TemplateGenerator.GetDefaultPrefix(ofType),
      *          TemplateGenerator.GetDefaultURI(ofType),
      *          new FileInfo(this.project.Directory +
      *              Path.DirectorySeparatorChar +
      *              this.project.CompileTargets[0]), 0);
      *  }
      *  catch (Exception e)
      *  {
      *      Console.WriteLine(e.StackTrace);
      *  }
      * }*/
 }
コード例 #6
0
    public void RemoveAssetType(string value)
    {
        List <UpdatableAsset> assets = mAssets[value];

        foreach (UpdatableAsset asset in assets)
        {
            if (asset.CurrentStatus != UpdatableAsset.Status.NEW)
            {
                mAdmin.DeleteAsset(asset, (Asset resultAsset, NPNFError error) => {
                    string assetName = (resultAsset != null ? resultAsset.Name : "<Name Unknown>");
                    if (error != null)
                    {
                        Debug.Log("Deleting asset failed: " + assetName);
                    }
                    else
                    {
                        Debug.Log("Deleting asset succeeded: " + assetName);
                    }
                });
            }
        }
        mAssets.Remove(value);
        AssetTypes.Remove(value);
        if (CurrentAssetType == value)
        {
            CurrentAssetType = null;
        }
    }
コード例 #7
0
 public AssetTypeModel GetAssetTypeModel(int?Id = null, int assetCategoryID = -1)
 {
     if (Id.HasValue)
     {
         AssetTypes assetType = _assetAssetTypeRepository.GetAssetTypeByID(Id.Value);
         if (assetType != null)
         {
             return(new AssetTypeModel
             {
                 ID = assetType.ID,
                 Description = assetType.Description,
                 AssetCategoryID = assetType.AssetCategoryID,
                 AssetCategoryName = assetType.AssetCategory.Description,
                 AssetCategories = _assetCategoryService.GetDropdownAssetCategories(assetType.AssetCategoryID)
             });
         }
         else
         {
             throw new EntryPointNotFoundException();
         }
     }
     else
     {
         return(new AssetTypeModel {
             AssetCategories = _assetCategoryService.GetDropdownAssetCategories(assetCategoryID)
         });
     }
 }
コード例 #8
0
        /// <summary>
        /// Fill method for populating an entire collection of AssetTypes
        /// </summary>
        public virtual void Fill(AssetTypes assetTypes)
        {
            // create the connection to use
            SqlConnection cnn = new SqlConnection(AssetType.GetConnectionString());


            try
            {
                using (cnn)
                {
                    // open the connection
                    cnn.Open();


                    // create an instance of the reader to fill.
                    SqlDataReader datareader = SqlHelper.ExecuteReader(cnn, "gsp_SelectAssetTypes");


                    // Send the collection and data to the object factory
                    CreateObjectsFromData(assetTypes, datareader);


                    // close the connection
                    cnn.Close();
                }


                // nullify the connection
                cnn = null;
            }
            catch (SqlException sqlex)
            {
                throw sqlex;
            }
        }
コード例 #9
0
 public Dependency(AssetTypes type, string id, string name, int assetHandle)
 {
     Type        = type;
     Id          = id;
     Name        = name;
     AssetHandle = assetHandle;
 }
コード例 #10
0
        /// <summary>
        /// The object factory for a particular data collection instance.
        /// </summary>
        public virtual void CreateObjectsFromData(AssetTypes assettypes, System.Data.DataSet data)
        {
            // Do nothing if we have nothing
            if (data == null || data.Tables.Count == 0 || data.Tables[0].Rows.Count == 0)
            {
                return;
            }


            // Create a local variable for the new instance.
            AssetType newobj = null;

            // Create a local variable for the data row instance.
            System.Data.DataRow dr = null;


            // Iterate through the table rows
            for (int i = 0; i < data.Tables[0].Rows.Count; i++)
            {
                // Get a reference to the data row
                dr = data.Tables[0].Rows[i];
                // Create a new object instance
                newobj = System.Activator.CreateInstance(assettypes.ContainsType[0]) as AssetType;
                // Let the instance set its own members
                newobj.SetMembers(ref dr);
                // Add the new object to the collection instance
                assettypes.Add(newobj);
            }
        }
コード例 #11
0
 private void ExecuteAddNew(object parameter)
 {
     AssetTypes.Add(new AssetTypeModel {
         ID = 0, Name = string.Empty, AssetGroupID = this.AssetGroupID
     });
     ScrollToSelectedItem = AssetTypes.Count - 1;
 }
コード例 #12
0
ファイル: AssetsServices.cs プロジェクト: evgeniynet/API5
        public object Get(AssetTypes request)
        {
            ApiUser hdUser = request.ApiUser;

            CheckAssets(hdUser);
            return(Models.AssetTypes.GetAssetTypes(hdUser.OrganizationId, hdUser.DepartmentId, request.category_id));
        }
コード例 #13
0
        private void ExecuteDelete(object parameter)
        {
            Collection <AssetTypeModel> deleteditems = new Collection <AssetTypeModel>();
            IMessageBoxService          msg          = new MessageBoxService();
            string title      = "Deleting Asset Type";
            string confirmtxt = "Do you want to delete the selected item";

            if (AssetTypes.Count(x => x.Selected) > 1)
            {
                title      = title + "s";
                confirmtxt = confirmtxt + "s";
            }
            if (msg.ShowMessage(confirmtxt + "?", title, GenericMessageBoxButton.OKCancel, GenericMessageBoxIcon.Question).Equals(GenericMessageBoxResult.OK))
            {
                foreach (AssetTypeModel si in AssetTypes)
                {
                    if (si.Selected)
                    {
                        if (si.ID > 0)
                        {
                            DeleteItem(si.ID, "AssetTypes");
                        }
                        deleteditems.Add(si);
                    }
                }
                foreach (AssetTypeModel pm in deleteditems)
                {
                    AssetTypes.Remove(pm);
                }
                deleteditems.Clear();
            }
            msg = null;
        }
コード例 #14
0
 public AssetPreviewModel(Uri contentUrl, AssetTypes contentType, string assetKey, string contextKey, string deleteScriptName = null)
 {
     ContentUrl       = contentUrl;
     AssetType        = contentType;
     AssetKey         = assetKey;
     ContextKey       = contextKey;
     DeleteScriptName = deleteScriptName;
 }
コード例 #15
0
 public void AddAssetType(string value)
 {
     if (!mAssets.ContainsKey(value))
     {
         AssetTypes.Add(value);
         mAssets.Add(value, new List <UpdatableAsset>());
     }
 }
コード例 #16
0
        public MetaAsset LoadMetaAsset(string Name, AssetTypes Type)
        {
            MetaAsset asset = new MetaAsset();

            asset.Name     = Name;
            asset.InfoType = Type;
            FSWorker.LoadAssetFile(asset);
            return(asset);
        }
コード例 #17
0
 public void AddAsset(InstalledFile file, AssetTypes assetType, Generation generation, Gender gender)
 {
     if (!Cache.TryGetValue(assetType, out GenerationCache gen))
     {
         gen = new GenerationCache();
         Cache.Add(assetType, gen);
     }
     gen.AddAsset(file, generation, gender);
 }
コード例 #18
0
        internal string[] DetectAssetsNamesByType(AssetTypes type)
        {
            string path = GetAssetTypePath(type);

            if (!Directory.Exists(path))
            {
                return(new string[0]);
            }
            return(Directory.GetFiles(path));
        }
コード例 #19
0
ファイル: AssetDataBase.cs プロジェクト: blue3k/StormForge
        // register all possible build processors form the assembly
        public void RegisterClasses(Assembly assembly)
        {
            foreach (Type classType in assembly.GetTypes())
            {
                if (!classType.IsClass || classType.IsAbstract)
                {
                    continue;
                }

                if (classType.IsSubclassOf(typeof(AssetProcessor)))
                {
                    var buildProcessor = Activator.CreateInstance(classType) as AssetProcessor;

                    bool result = ProcessorByName.TryAdd(buildProcessor.Name, buildProcessor);
                    if (!result)
                    {
                        ToolDebug.Warning("Duplicated processor {0}", buildProcessor.Name);
                    }

                    result = ProcessorByType.TryAdd(buildProcessor.GetType(), buildProcessor);
                    if (!result)
                    {
                        ToolDebug.Warning("Duplicated processor {0}", buildProcessor.Name);
                    }

                    foreach (var inputType in buildProcessor.GetInputAssetTypes())
                    {
                        List <AssetProcessor> processorList;
                        if (!ProcessorByInputType.TryGetValue(inputType, out processorList))
                        {
                            processorList = new List <AssetProcessor>();
                            ProcessorByInputType.TryAdd(inputType, processorList);
                        }
                        if (processorList.IndexOf(buildProcessor) >= 0)
                        {
                            ToolDebug.Warning("Duplicated processor {0}", buildProcessor.Name);
                        }
                        else
                        {
                            processorList.Add(buildProcessor);
                        }
                    }
                }
                else if (classType.IsSubclassOf(typeof(Asset)))
                {
                    var assetData = Activator.CreateInstance(classType) as Asset;
                    AssetTypes.AddOrUpdate(assetData.AssetTypeName, classType, (name, oldValue) => { return(classType); });
                }
                else
                {
                    continue;
                }
            }
        }
コード例 #20
0
        private bool CreateAssetTypeDirectory(AssetTypes type)
        {
            string path = NativeFSWorker.GetAssetTypePath(type);

            if (!Directory.Exists(path))
            {
                Directory.CreateDirectory(path);
                Console.WriteLine("Create directory: {0}", path);
            }
            return(true);
        }
コード例 #21
0
 private string[] DetectAssetsNamesByType(AssetTypes type)
 {
     string[] result = FSWorker.DetectAssetsNamesByType(type);
     for (int i = 0; i < result.Length; i++)
     {
         string[] arr = result[i].Split('/');
         arr       = arr[arr.Length - 1].Split('.');
         result[i] = arr[0];
     }
     return(result);
 }
コード例 #22
0
ファイル: AssetDataBase.cs プロジェクト: blue3k/StormForge
        public Asset CreateAssetByExt(string ext)
        {
            Type found;

            if (AssetTypes.TryGetValue(ext.ToLower(), out found))
            {
                return(Activator.CreateInstance(found) as Asset);
            }

            return(null);
        }
コード例 #23
0
        public override void Read(XmlElement node)
        {
            this.Name     = this.GetAttribute(node, "Name", true);
            this.Filename = this.GetAttribute(node, "Filename", true);
            this.Type     = this.GetEnumAttribute(node, "Type", true, AssetTypes.None);

            if (this.Type == AssetTypes.None)
            {
                throw new Exception("The type of the name '" + this.Name + "' is not valid!");
            }
        }
コード例 #24
0
ファイル: AssetDataBase.cs プロジェクト: blue3k/StormForge
        Asset CreateAssetByExt(string ext, params object[] args)
        {
            Type found;

            if (AssetTypes.TryGetValue(ext.ToLower(), out found))
            {
                return(Activator.CreateInstance(found, args) as Asset);
            }

            return(null);
        }
コード例 #25
0
        public int CreateAssetType(AssetTypeModel assetTypeModel)
        {
            AssetTypes assetType = null;

            assetType = this._assetAssetTypeRepository.CreateAssetType(new AssetTypes()
            {
                Description     = assetTypeModel.Description,
                AssetCategoryID = assetTypeModel.AssetCategoryID
            });

            return(assetType.ID);
        }
コード例 #26
0
        public int UpdateAssetType(AssetTypeModel assetTypeModel)
        {
            AssetTypes assetType = _assetAssetTypeRepository.GetAssetTypeByID(assetTypeModel.ID);

            if (assetType != null)
            {
                assetType.Description     = assetTypeModel.Description;
                assetType.AssetCategoryID = assetTypeModel.AssetCategoryID;
            }
            _assetAssetTypeRepository.UpdateAssetType(assetType);
            return(assetType.ID);
        }
コード例 #27
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Configuration" /> class.
        /// </summary>
        /// <param name="itemType">Type of the item.</param>
        /// <param name="assetType">Type of the asset.</param>
        /// <param name="cityName">Name of the city.</param>
        public Configuration(ItemTypes itemType, AssetTypes assetType, string cityName)
        {
            this.ItemType  = itemType;
            this.assetType = assetType;
            this.items     = new List <Item>();
            this.cityName  = cityName;

            if (itemType == ItemTypes.Configuration)
            {
                this.index = new Dictionary <string, int>();
            }
        }
コード例 #28
0
ファイル: Asset.cs プロジェクト: 2ez-bit/Ultimatefighter
 public Asset(int id, string name, AssetTypes type, Faction faction, Clan clan, int designId, int expansionStage, Vector position, Spacemap map, bool invisible,
              bool visibleOnWarnRadar, bool detectedByWarnRadar) : base(id, position, map)
 {
     Type                = type;
     Name                = name;
     Faction             = faction;
     Clan                = clan;
     DesignId            = designId;
     ExpansionStage      = expansionStage;
     Invisible           = invisible;
     VisibleOnWarnRadar  = visibleOnWarnRadar;
     DetectedByWarnRadar = detectedByWarnRadar;
 }
コード例 #29
0
        /// <summary>
        /// Gets all the available objects.
        /// </summary>
        public virtual AssetTypes GetAll()
        {
            // create a new instance of the return object
            AssetTypes objects = new AssetTypes();


            // fill the objects
            this.Fill(objects);


            // return the filled object from the service
            return(objects);
        }
コード例 #30
0
        public IHttpActionResult InsertLoanValueRatio(LoanValueRatioModel model)
        {
            AssetTypes type = (AssetTypes)Int32.Parse(model.AssetType);

            edisRepo.FeedDataForLoanValueRatios(new LoanValueRatioFeed {
                AssetType = type,
                CreateOn  = model.CreateOn,
                Lender    = model.Lender,
                Ratio     = model.Ratio,
                Ticker    = model.Ticker
            });

            return(Ok());
        }
コード例 #31
0
ファイル: LegoGame.cs プロジェクト: colbybhearn/3DPhysics
 private Model GetAssetModel(AssetTypes a)
 {
     return assetManager.GetModel((int) a);
 }
コード例 #32
0
ファイル: LegoGame.cs プロジェクト: colbybhearn/3DPhysics
 private void PickPiece(AssetTypes p)
 {
     currentPiece = GetAssetModel(p);
 }
コード例 #33
0
 void IAssetService.SetAssetInfo(long assetNo, AssetTypes assetType, long BoyzbeMemberNo)
 {
     throw new NotImplementedException();
 }