Exemplo n.º 1
0
        public DotaObjectDocument(DotaDataObject RootObject)
            : base()
        {
            DotaObject = RootObject;

            Source = DotaObject.ObjectInfo.FromVPK ? DocumentSource.VPK : DocumentSource.File;
            Path = DotaObject.ObjectInfo.OriginatingFile;

            Name = RootObject.ClassName;
        }
Exemplo n.º 2
0
        public static IList FindListThatHasObject(DotaDataObject ddo)
        {
            //I hate writing code like this


            DotaDataObject.DataObjectInfo.ObjectDataClass ObjectClass = ddo.ObjectInfo.ObjectClass;
            if (ddo is DotaHero)
            {
                return(AllHeroes);
            }
            else if (ddo is DotaUnit)
            {
                return(AllUnits);
            }
            else if (ddo is DotaItem)
            {
                return(AllItems);
            }
            else if (ddo is DotaAbility)
            {
                return(AllAbilities);
            }
            throw new ArgumentException("Don't have a list for that type");
        }
Exemplo n.º 3
0
 private void OpenObjectEditor(DotaDataObject ddo)
 {
     var doc = OpenDocument(ddo);
     doc.OpenDefaultEditor();
 }
Exemplo n.º 4
0
 private void OpenTextEditor(DotaDataObject ddo)
 {
     var doc = OpenDocument(ddo);
     (doc as DotaObjectDocument).OpenTextEditor();
 }
Exemplo n.º 5
0
        private Document OpenDocument(DotaDataObject ddo)
        {
            Document doc = DocumentRegistry.GetDocumentFor(ddo);
            if (doc == null)
            {
                //If we don't have this document open, create it and add it to the registry
                doc = new DotaObjectDocument(ddo);
                DocumentRegistry.OpenDocument(ddo, doc);
            }

            return doc;
        }