Inheritance: object, System.ComponentModel.INotifyPropertyChanged
コード例 #1
0
        public void DeleteAsset(asset removeAsset)
        {
            List <asset> assetList = new List <asset>(asset);

            assetList.Remove(removeAsset);
            asset = assetList.ToArray();
        }
コード例 #2
0
        public void AddAsset(asset newAsset)
        {
            if (asset == null)
            {
                asset = new asset[0];
            }

            var local_asset = asset;

            Array.Resize(ref local_asset, local_asset.Length + 1);
            local_asset[local_asset.Length - 1] = newAsset;
            asset = local_asset;
        }
コード例 #3
0
ファイル: ViewModel.cs プロジェクト: blackberry/VSPlugin
        public void AddLocalAsset(string assetPath)
        {
            asset newAsset = new asset();

            FileInfo fileInfo = new FileInfo(assetPath);
            newAsset.Value = fileInfo.Name;

            string activeDir = _activeProjectDirectory;
            string back = "";

            // generating the relative path for the asset.
            do
            {
                if (assetPath.Contains(activeDir + "\\"))
                {
                    newAsset.path = back + assetPath.Replace(activeDir + "\\", "");
                    break;
                }
                else
                {
                    int pos = activeDir.LastIndexOf('\\', activeDir.Length - 1);
                    if (pos < 0)
                    { // file is located in a different driver. Copy the entire assetPath.
                        newAsset.path = assetPath;
                        break;
                    }
                    else
                    {
                        back += "..\\";
                        activeDir = activeDir.Remove(pos);
                    }
                }
            }
            while (true);

            if (_config.Name == "All Configurations")
                _qnxSchema.AddLocalAsset(newAsset);
            else
            {
                foreach (qnxConfiguration config in _qnxSchema.configuration)
                {
                    if (config.name == _config.Name)
                    {
                        config.AddAsset(newAsset);
                    }
                }
            }

            DesignerDirty = true;

            if (ViewModelChanged != null)
            {
                // Update the Designer View
                ViewModelChanged(this, new EventArgs());
            }
        }
コード例 #4
0
ファイル: bar-descriptor.cs プロジェクト: blackberry/VSPlugin
 public void DeleteAsset(asset removeAsset)
 {
     List<asset> assetList = new List<asset>(asset);
     assetList.Remove(removeAsset);
     asset = assetList.ToArray();
 }
コード例 #5
0
ファイル: bar-descriptor.cs プロジェクト: blackberry/VSPlugin
        public void AddAsset(asset newAsset)
        {
            if (asset == null)
            {
                asset = new asset[0];
            }

            var local_asset = asset;
            Array.Resize(ref local_asset, local_asset.Length + 1);
            local_asset[local_asset.Length - 1] = newAsset;
            asset = local_asset;
        }
コード例 #6
0
ファイル: ViewModel.cs プロジェクト: hkopparru/VSPlugin
        public void AddLocalAsset(string assetPath)
        {
            asset newAsset = new asset();

            FileInfo fileInfo = new FileInfo(assetPath);
            newAsset.Value = fileInfo.Name;
            newAsset.path = assetPath.Replace(_activeProjectDirectory + "\\", "");

            if (_config.Name == "All Configurations")
                _qnxSchema.AddLocalAsset(newAsset);
            else
            {
                foreach (qnxConfiguration config in _qnxSchema.configuration)
                {
                    if (config.name == _config.Name)
                    {
                        config.AddAsset(newAsset);
                    }
                }
            }

            DesignerDirty = true;

            if (ViewModelChanged != null)
            {
                // Update the Designer View
                ViewModelChanged(this, new EventArgs());
            }
        }