private RefData GetData(GameObject go)
    {
        if (go != null)
        {
            RefData refData = null;
            for (int i = 0; i < (int)EComponentType.EnumCount; i++)
            {
                var typeComp = (EComponentType)i;
                if (typeComp != EComponentType.GameObject)
                {
                    var comp = go.GetComponent(typeComp.ToString());
                    if (comp != null)
                    {
                        refData = new RefData(go.name, typeComp, comp);
                        break;
                    }
                }
            }

            if (refData == null)
            {
                refData = new RefData(go.name, EComponentType.GameObject, go);
            }

            return(refData);
        }

        return(null);
    }
        /// <summary>
        /// Return a specific contact based on the contact id
        /// </summary>
        /// <param name="ContactId">int</param>
        /// <returns>ContactModel</returns>
        public ContactModel GetContactById(int ContactId)
        {
            RefData             refData      = RefDataManager.Get();
            List <ContactModel> contactsList = refData.ContactList;

            return(contactsList.Find(item => item.ContactId == ContactId));
        }
Exemple #3
0
        public static void Main()
        {
            var raw = new RefData();

            raw.P.X  = 1; // プロパティ越しに、参照先のフィールドを書き換え可能
            raw[0].X = 1; // インデクサー越しに、参照先の配列を書き換え可能
        }
Exemple #4
0
    // Token: 0x06000019 RID: 25 RVA: 0x0000315C File Offset: 0x0000135C
    private void AddGo(GameObject go, Type type)
    {
        RefData data = this.GetData(go);
        bool    flag = data != null;

        if (flag)
        {
            bool flag2 = type == typeof(GameObject);
            if (flag2)
            {
                data.bindObj = go;
            }
            else
            {
                bool flag3 = type == typeof(Transform);
                if (flag3)
                {
                    data.bindObj = go.transform;
                }
                else
                {
                    data.bindObj = go.GetComponent(type);
                }
            }
            data.TypeName = type.Name;
            this.m_RefHolder.Datas.Add(data);
        }
    }
Exemple #5
0
        internal GMFile()
        {
            Options = new OptionInfo
            {
                Constants = new Dictionary <string, string>()
            };

            AudioSoundMap = new Dictionary <uint, uint>();

            RefData = new RefData
            {
                Functions = new ReferenceDef[0],
                Variables = new ReferenceDef[0],

                VarAccessors  = new Dictionary <IntPtr, int>(),
                FuncAccessors = new Dictionary <IntPtr, int>()
            };

            Sound        = new SoundInfo      [0];
            Sprites      = new SpriteInfo     [0];
            Backgrounds  = new BackgroundInfo [0];
            Paths        = new PathInfo       [0];
            Scripts      = new ScriptInfo     [0];
            Fonts        = new FontInfo       [0];
            Objects      = new ObjectInfo     [0];
            Rooms        = new RoomInfo       [0];
            TexturePages = new TexturePageInfo[0];
            Code         = new CodeInfo       [0];
            Strings      = new string         [0];
            Textures     = new TextureInfo    [0];
            Audio        = new AudioInfo      [0];
        }
Exemple #6
0
    // Token: 0x06000016 RID: 22 RVA: 0x00002FA0 File Offset: 0x000011A0
    private void Move(int i, int type)
    {
        bool flag = type == 1;

        if (flag)
        {
            bool flag2 = i != 0;
            if (flag2)
            {
                RefData value = this.m_RefHolder.Datas[i];
                this.m_RefHolder.Datas[i]     = this.m_RefHolder.Datas[i - 1];
                this.m_RefHolder.Datas[i - 1] = value;
            }
        }
        else
        {
            bool flag3 = type == 2;
            if (flag3)
            {
                bool flag4 = i != this.m_RefHolder.Datas.Count - 1;
                if (flag4)
                {
                    RefData value2 = this.m_RefHolder.Datas[i];
                    this.m_RefHolder.Datas[i]     = this.m_RefHolder.Datas[i + 1];
                    this.m_RefHolder.Datas[i + 1] = value2;
                }
            }
        }
    }
Exemple #7
0
    void OnDestroy()
    {
#if !UNITY_5
        if ((!Application.isEditor || Application.isPlaying) && globalLightmapRefCount != null)
        {
            int numLightmaps = LightmapSettings.lightmaps.Length;
            int numRefs      = lightmapRefs.Count;
            for (int refIndex = 0; refIndex < numRefs; ++refIndex)
            {
                RefData refData = lightmapRefs[refIndex];
                if (refData.index >= 0 && refData.index < globalLightmapRefCount.Length)
                {
                    --globalLightmapRefCount[refData.index];
                    if (globalLightmapRefCount[refData.index] == 0)
                    {
                        LightmapData[] newLightmaps = new LightmapData[numLightmaps];
                        for (int lightmapIndex = 0; lightmapIndex < numLightmaps; ++lightmapIndex)
                        {
                            if (refData.index == lightmapIndex)
                            {
                                newLightmaps[lightmapIndex] = new LightmapData();
                            }
                            else
                            {
                                newLightmaps[lightmapIndex] = LightmapSettings.lightmaps[lightmapIndex];
                            }
                        }
                        LightmapSettings.lightmaps = newLightmaps;
                    }
                }
            }
        }
#endif
    }
Exemple #8
0
 void LoadData()
 {
     try
     {
         playData  = TimeData.ReadObject <PlayData>();
         timeCache = playData.timeData;
     }
     catch
     {
         playData = new PlayData();
     }
     try
     {
         referData = ReferralData.ReadObject <RefData>();
     }
     catch
     {
         referData = new RefData();
     }
     try
     {
         permData = PermissionData.ReadObject <PermData>();
     }
     catch
     {
         permData = new PermData();
     }
 }
Exemple #9
0
        public void Create_server_and_issue_a_get_request()
        {
            using (var host = new InMemoryHost(new OpenRastaConfiguration()))
            {
                var request = new InMemoryRequest()
                {
                    Uri        = new Uri("http://localhost/10000/refData"),
                    HttpMethod = "GET"
                };

                // set up code formats

                request.Entity.ContentType       = MediaType.Json;
                request.Entity.Headers["Accept"] = "application/json";

                // send the request and save the resulting response
                var response   = host.ProcessRequest(request);
                int statusCode = response.StatusCode;

                // deserialize the content from the response

                if (response.Entity.ContentLength > 0)
                {
                    // rewind the stream, as OpenRasta won't do this
                    response.Entity.Stream.Seek(0, SeekOrigin.Begin);

                    var serializer =
                        new DataContractJsonSerializer(typeof(RefData));

                    refData = (RefData)serializer.ReadObject(response.Entity.Stream);
                }
            }
        }
Exemple #10
0
        void xapFormControl1_RefCanSelect(object sender, RefCanSelectEventArgs e)
        {
            if (e.BindingFieldName.Equals("Name_srv"))
            {
                RefData data   = e.SelectingData;
                string  strSrv = data["Name"] as string;

                //新增时候 参照写会
                EmsOrDrug drugNew = gv.GetFocusedRow().RowDataSource as EmsOrDrug;
                // string strSrv = data.FirstData["Name"].ToString();
                if (this.EmsHeadDO.Emsdrugs.EmsOrDrugList.Count > 1)
                {
                    foreach (EmsOrDrug drug in this.EmsHeadDO.Emsdrugs.EmsOrDrugList)
                    {
                        if (strSrv == drug.Name_srv)
                        {
                            e.Cancel  = true;
                            e.Message = strSrv + ": 已经添加";
                        }
                    }
                    //this.ShowInfo("存在相同的服务!");
                    //drugNew.Name_srv = null;
                    //drugNew.Id_srv = null;
                    //return;
                }
            }
        }
        public RefData Add(TKey key, TValue value, int weight, bool commit = true)
        {
            this.CheckWeight(weight, null);

            if (0 > weight)
            {
                weight = 0;
            }

            var refData = new RefData(key, value, weight);

            if (commit)
            {
                refData.AddRef();
                refData.ResetGeneration();
                this.foreground.Add(key, refData);
            }
            else
            {
                refData.SetBackgroundNode(this.background.AddFirst(refData));
            }

            this.weight += weight;
            return(refData);
        }
        private void LoadRefData()
        {
            var     refController = new RefController();
            RefData refData       = RefDataManager.Get();

            refData.ContactList = refController.GetContactList();
            RefDataManager.Save(refData);
        }
 void DecreaseWeight(RefData refData)
 {
     this.weight -= refData.Weight;
     if (0 > this.weight) // NOTE: 계산 미스인데 걍 넘어가!!
     {
         this.weight = 0;
     }
 }
 /// <summary>
 /// </summary>
 /// <param name="disposing"></param>
 public void Dispose(bool disposing)
 {
     RefData?.Dispose();
     if (disposing)
     {
         RefData = default;
     }
 }
Exemple #15
0
        public IHttpActionResult GetOnLoadData(string username)  // Get On Load Data (Reference Data and User Data)
        {
            RefData     refData     = new RefData();
            UserDetails userDetails = new UserDetails(username);
            OnLoadData  onLoadData  = new OnLoadData(refData, userDetails);

            return(Ok(onLoadData));
        }
Exemple #16
0
        public override MixAttributeSetData ParseModel(MixCmsContext _context = null, IDbContextTransaction _transaction = null)
        {
            Id = Guid.NewGuid().ToString();
            CreatedDateTime = DateTime.UtcNow;
            Values          = new List <MixAttributeSetValues.ODataMobileViewModel>();
            foreach (var field in Fields)
            {
                var val = new MixAttributeSetValues.ODataMobileViewModel()
                {
                    AttributeFieldId   = field.Id,
                    AttributeFieldName = field.Name,
                    StringValue        = field.DefaultValue,
                    Priority           = field.Priority,
                    Field = field
                };

                val.Priority         = field.Priority;
                val.DataType         = field.DataType;
                val.AttributeSetName = AttributeSetName;
                if (Data[val.AttributeFieldName] != null)
                {
                    if (val.Field.DataType == MixEnums.MixDataType.Reference)
                    {
                        var arr = Data[val.AttributeFieldName].Value <JArray>();
                        foreach (JObject objData in arr)
                        {
                            string id = objData["id"]?.Value <string>();
                            // if have id => update data, else add new
                            if (!string.IsNullOrEmpty(id))
                            {
                                //var getData = Repository.GetSingleModel(m => m.Id == id && m.Specificulture == Specificulture, _context, _transaction);
                                //if (getData.IsSucceed)
                                //{
                                //    getData.Data.Data = objData;
                                //    RefData.Add(getData.Data);
                                //}
                            }
                            else
                            {
                                RefData.Add(new ODataMobileViewModel()
                                {
                                    Specificulture = Specificulture,
                                    AttributeSetId = field.ReferenceId.Value,
                                    Data           = objData
                                });
                            }
                        }
                    }
                    else
                    {
                        ParseModelValue(Data[val.AttributeFieldName], val);
                    }
                }
                Values.Add(val);
            }

            return(base.ParseModel(_context, _transaction));;
        }
Exemple #17
0
    private void Start()
    {
        // 초기화
        _cameraMgr = GameManager.Instance.CameraManager;

        _pCtrl = GetComponent <PlayerController>();

        _refMoveSpeed = _pCtrl.GetMoveSpeed();
        _refJumpPower = _pCtrl.GetJumpPower();
    }
Exemple #18
0
    // Token: 0x06000018 RID: 24 RVA: 0x00003128 File Offset: 0x00001328
    private void AddGo(GameObject go)
    {
        RefData data = this.GetData(go);
        bool    flag = data != null;

        if (flag)
        {
            this.m_RefHolder.Datas.Add(data);
        }
    }
    public void Init()
    {
        if (DefaultValue == -1)
        {
            DefaultValue = MaxValue;
        }

        Data        = new RefData();
        Data._Value = DefaultValue;
    }
Exemple #20
0
    void Start()
    {
        if ((!Application.isEditor || Application.isPlaying) && globalLightmapRefCount != null)
        {
#if !UNITY_5
            int numLightmaps = LightmapSettings.lightmaps.Length;
            int numRefs      = lightmapRefs.Count;
            for (int refIndex = 0; refIndex < numRefs; ++refIndex)
            {
                RefData refData = lightmapRefs[refIndex];
                if (refData.index >= 0 && refData.index < globalLightmapRefCount.Length)
                {
                    if (globalLightmapRefCount[refData.index] == 0)
                    {
                        LightmapData newData = new LightmapData();
                        newData.lightmapDir   = refData.NearLightmap;
                        newData.lightmapColor = refData.FarLightmap;

                        LightmapData[] newLightmaps = new LightmapData[numLightmaps];
                        for (int lightmapIndex = 0; lightmapIndex < numLightmaps; ++lightmapIndex)
                        {
                            if (refData.index == lightmapIndex)
                            {
                                newLightmaps[lightmapIndex] = newData;
                            }
                            else
                            {
                                newLightmaps[lightmapIndex] = LightmapSettings.lightmaps[lightmapIndex];
                            }
                        }
                        LightmapSettings.lightmaps = newLightmaps;
                    }
                    ++globalLightmapRefCount[refData.index];
                }
            }
#else
            int numMeshIndeces = lightmapRenderRefs.Count;
            for (int meshIndex = 0; meshIndex < numMeshIndeces; ++meshIndex)
            {
                RenderData indexData = lightmapRenderRefs[meshIndex];
                if (indexData.renderer)
                {
                    indexData.renderer.lightmapIndex       = indexData.rendererLightmapIndex;
                    indexData.renderer.lightmapScaleOffset = indexData.rendererLightmapScaleOffset;
                }
                if (indexData.terrain)
                {
                    indexData.terrain.lightmapIndex = indexData.terrainLightmapIndex;
                }
            }
#endif
        }
    }
Exemple #21
0
 static int GetRefData(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         ResUtil obj = (ResUtil)ToLua.CheckObject <ResUtil>(L, 1);
         RefData o   = obj.GetRefData();
         ToLua.PushObject(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemple #22
0
        static void Main(string[] args)
        {
            RefData refData = new RefData();

            List <Country> countries = refData.GetCountries();

            List <IbanFormat> ibanFormats = refData.GetIbanFormats();

            List <Currency> currencies = refData.GetCurrencies();

            CountryBank countryBank = refData.GetBanks("TR");
            List <Bank> banks       = countryBank.Banks;

            Console.ReadLine();
        }
 private int ListSort(RefData x, RefData y)
 {
     if (x.hasVal && !y.hasVal)
     {
         return(1);
     }
     else if (!x.hasVal && y.hasVal)
     {
         return(-1);
     }
     else
     {
         return(0);
     }
 }
        /// <summary>
        /// Diese Klasse bereitet die Referenz-Datensätze für die Ermitellung der Koordinaten bei Datensätzen vor 2009 auf.
        /// </summary>
        /// <returns></returns>
        static Dictionary <string, RefData> ParseRefCoordinates()
        {
            //Zuordnung der Gemeinde erfolgt nach Gemeindenamen
            Dictionary <string, RefData> result = new Dictionary <string, RefData>();
            var srcFile = new System.IO.FileInfo("../../../../../data/population/31122010_Auszug_GV.csv");

            //CSV Parsen
            using (TextFieldParser parser = new TextFieldParser(srcFile.FullName, System.Text.Encoding.GetEncoding(1252)))
            {
                parser.TextFieldType = FieldType.Delimited;
                parser.SetDelimiters(";");
                while (!parser.EndOfData)
                {
                    //Prüfen ob die notwendingen Felder vorhanden sind
                    string[] fields = parser.ReadFields();
                    if (fields.Count() > 15 && !String.IsNullOrWhiteSpace(fields[7]) && !String.IsNullOrWhiteSpace(fields[2]) && !String.IsNullOrWhiteSpace(fields[9]) && !String.IsNullOrWhiteSpace(fields[10]) && !String.IsNullOrWhiteSpace(fields[11]) && !String.IsNullOrWhiteSpace(fields[13]) && !String.IsNullOrWhiteSpace(fields[14]) && !String.IsNullOrWhiteSpace(fields[15]))
                    {
                        //Felder extrahieren
                        string totalPop = fields[9].Replace(" ", "");
                        string lng      = fields[14].Replace(" ", "").Replace(",", ".");
                        string lat      = fields[15].Replace(" ", "").Replace(",", ".");
                        string bl       = fields[2].Replace(" ", "").Replace(",", ".");
                        string mPop     = fields[10].Replace(" ", "");
                        string fPop     = fields[11].Replace(" ", "");
                        string name     = fields[7].Trim().ToLowerInvariant().Replace(".", " ").Replace(",", " ").Replace("(", " ").Replace(")", " ");
                        string plz      = fields[13].Replace(" ", "");

                        int    p;
                        double p1;
                        int    intBl;
                        //Extrahierte Werte auf Gültigkeit überprüfen
                        if (int.TryParse(totalPop, out p) && int.TryParse(mPop, out p) && int.TryParse(fPop, out p) && int.TryParse(plz, out p) && int.TryParse(bl, out intBl) && double.TryParse(lng, out p1) && double.TryParse(lat, out p1))
                        {
                            if (!result.ContainsKey(intBl + name))
                            {
                                RefData rd = new RefData();
                                rd.lng  = lng;
                                rd.lat  = lat;
                                rd.name = intBl + name;
                                rd.plz  = plz;
                                result.Add(intBl + name, rd);
                            }
                        }
                    }
                }
            }
            return(result);
        }
Exemple #25
0
    public void ReferenceLightmaps(List <int> lightmapIndices)
    {
        lightmapRefs.Clear();
        int numIndices = lightmapIndices.Count;

        for (int index = 0; index < numIndices; ++index)
        {
            int lightmapIndex = lightmapIndices[index];
            if (lightmapIndex >= 0 && lightmapIndex < LightmapSettings.lightmaps.Length)
            {
                RefData newRef = new RefData();
                newRef.index        = lightmapIndex;
                newRef.NearLightmap = LightmapSettings.lightmaps[lightmapIndex].lightmapDir;
                newRef.FarLightmap  = LightmapSettings.lightmaps[lightmapIndex].lightmapColor;
                lightmapRefs.Add(newRef);
            }
        }

#if UNITY_5
        lightmapRenderRefs.Clear();
        Transform[] transforms    = GetComponentsInChildren <Transform>();
        int         numTransforms = transforms.Length;
        for (int transformIndex = 0; transformIndex < numTransforms; ++transformIndex)
        {
            Renderer renderer = transforms[transformIndex].GetComponent <Renderer>();
            Terrain  terrain  = transforms[transformIndex].GetComponent <Terrain>();
            if ((renderer != null && renderer.lightmapIndex >= 0) ||
                (terrain != null && terrain.lightmapIndex >= 0))
            {
                RenderData newIndex = new RenderData();
                if (renderer)
                {
                    newIndex.renderer = renderer;
                    newIndex.rendererLightmapIndex       = renderer.lightmapIndex;
                    newIndex.rendererLightmapScaleOffset = renderer.lightmapScaleOffset;
                    GameObjectUtility.SetStaticEditorFlags(renderer.gameObject, GameObjectUtility.GetStaticEditorFlags(renderer.gameObject) & ~StaticEditorFlags.BatchingStatic);
                }
                if (terrain)
                {
                    newIndex.terrain = terrain;
                    newIndex.terrainLightmapIndex = terrain.lightmapIndex;
                }
                lightmapRenderRefs.Add(newIndex);
            }
        }
#endif
    }
        /// <summary>
        /// Display the contact list by 10
        /// </summary>
        /// <param name="page">int</param>
        /// <returns>contact list</returns>
        public ActionResult Index(int page = 0)
        {
            ViewBag.Message = "Your contact page.";

            RefData refData = RefDataManager.Get();
            IEnumerable <ContactModel> contactsList = refData.ContactList;

            //Pagination calcuation
            int PageSize = Convert.ToInt32(ConfigurationManager.AppSettings["Pagination"]);
            var count    = contactsList.Count();
            var data     = contactsList.Skip(page * PageSize).Take(PageSize).ToList();

            this.ViewBag.MaxPage = (count / PageSize) - (count % PageSize == 0 ? 1 : 0);
            this.ViewBag.Page    = page;

            return(this.View(data));
        }
Exemple #27
0
    static int set_type(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            RefData obj  = (RefData)o;
            int     arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
            obj.type = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index type on a nil value"));
        }
    }
Exemple #28
0
    static int get_data(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            RefData obj = (RefData)o;
            VObject ret = obj.data;
            ToLua.PushObject(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index data on a nil value"));
        }
    }
Exemple #29
0
    static int get_size(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            RefData obj = (RefData)o;
            int     ret = obj.size;
            LuaDLL.lua_pushinteger(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index size on a nil value"));
        }
    }
Exemple #30
0
    static int set_data(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            RefData obj  = (RefData)o;
            VObject arg0 = (VObject)ToLua.CheckObject <VObject>(L, 2);
            obj.data = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index data on a nil value"));
        }
    }
      public static RefData Get(string bloombergTicker_, string reutersTicker_)
      {
        var data = BbgTalk.HistoryRequester.GetReferenceData(bloombergTicker_, fields, null, false);
        RefData ret = new RefData();

        if (data != null)
        {
          BbgTalk.RDFieldData fd;

          ret.BloombergTicker = bloombergTicker_;
          ret.ReutersTicker = reutersTicker_;

          if ((fd = data.AllResult.FirstOrDefault(x => x.FieldName.Equals("UNIQUE_ID_FUT_OPT"))) != null)
            ret.ReturnedBloombergTicker = (string)fd.Data;

          // check to see that we've got back what we've asked for
          // e.g. search for NKH7 Index returns NHK7 Comdty as best guess, because the NKH7 Index hasn't been created yet
          if (ret.ReturnedBloombergTicker != null)
          {
            if (ret.ReturnedBloombergTicker.ToLower().Contains("index") && bloombergTicker_.ToLower().Contains("comdty"))
              return ret;

            if (ret.ReturnedBloombergTicker.ToLower().Contains("comdty") && bloombergTicker_.ToLower().Contains("index"))
              return ret;
          }

          if ((fd = data.AllResult.FirstOrDefault(x => x.FieldName.Equals("FUT_FIRST_TRADE_DT"))) != null)
            ret.FirstTradeDate = (DateTime)fd.Data;
          if ((fd = data.AllResult.FirstOrDefault(x => x.FieldName.Equals("FUT_NOTICE_FIRST"))) != null)
            ret.FirstNotice = (DateTime)fd.Data;
          if ((fd = data.AllResult.FirstOrDefault(x => x.FieldName.Equals("LAST_TRADEABLE_DT"))) != null)
            ret.LastTradeDate = (DateTime)fd.Data;
          if ((fd = data.AllResult.FirstOrDefault(x => x.FieldName.Equals("SECURITY_NAME"))) != null)
            ret.Name = (string)fd.Data;
          if ((fd = data.AllResult.FirstOrDefault(x => x.FieldName.Equals("CRNCY"))) != null)
            ret.Currency = (string)fd.Data;
          if ((fd = data.AllResult.FirstOrDefault(x => x.FieldName.Equals("EXCH_CODE"))) != null)
            ret.Exchange = (string)fd.Data;
        }
        else
        {
          ret = null;
        }

        if (ret.LastTradeDate.HasValue)
        {
          var row = Singleton<ConnMngr>.Instance.ExecuteGetSingleRow(DBNames.SQLSERVER_FUTURES,
            string.Format("select metaID from staticFutures where bloombergTicker like '{0}%' and lastTradeDate='{1}'",
              bloombergTicker_.Substring(0, 2), ret.LastTradeDate.Value.ToString("dd-MMM-yyyy")));

          if (row != null)
            ret.CurrentMetaId = Convert.ToInt32(row[0]);
        }
        else
        {
          DataSet ds = Singleton<ConnMngr>.Instance.Execute(DBNames.SQLSERVER_FUTURES, string.Format("select metaID from staticFutures where bloombergTicker='{0}'", bloombergTicker_));

          if (ConnMngr.HasResult(ds))
            ret.CurrentMetaId = Convert.ToInt32(ds.Tables[0].Rows[0][0]);
        }

        return ret;
      }
        private void DumpReferences()
        {
            Window window = _applicationObject.Windows.Item(Constants.vsWindowKindOutput);

            OutputWindow outputWindow = (OutputWindow)window.Object;
            OutputWindowPane owp;
            owp = outputWindow.OutputWindowPanes.Add("Dump References");

            owp.OutputString("Initializing references dump on " + _applicationObject.Solution.FullName + "\n");

            owp.OutputString("================ All project names ================ \n");
            Dictionary<string, string> allProjectGUIDs = new Dictionary<string, string>();
            List<Project> allProjs = new List<Project>();
            foreach (Project proj in _applicationObject.Solution.Projects)
            {
                if (proj.Kind == TypeProject)
                {
                    allProjs.Add(proj);
                }
                else if(proj.Kind == TypeSolutionFolder)
                {
                    EnumSFProjects(proj, allProjs);
                }
            }

            foreach (Project pr in allProjs)
            {
                VCProject vcpr = (VCProject)pr.Object;
                owp.OutputString(vcpr.Name + "\n");
                allProjectGUIDs.Add(vcpr.Name, vcpr.ProjectGUID);
            }

            HashSet<string> uniqueReferences = new HashSet<string>();

            List<RefData> allReferences = new List<RefData>();
            owp.OutputString("================ Full list of expanded dependencies ================ \n");
            foreach (Project proj in allProjs)
            {
                owp.OutputString("--- " + proj.Name + " ---\n");
                if (proj.Properties != null)
                {
                    foreach (Property prop in proj.Properties)
                    {
                        if (prop.Name == "VCReferences")
                        {
                            VCReferences references = (VCReferences)prop.Object;
                            foreach (VCReference reference in references)
                            {
                                owp.OutputString(reference.Name + "\n");
                                uniqueReferences.Add(reference.Name);
                                RefData item = new RefData();
                                item.Parent = proj.Name;
                                item.ReferencedProject = reference.Name;

                                VCProjectReference projRef = reference as VCProjectReference;
                                if (projRef != null)
                                {
                                    item.ReferencedGUID = projRef.ReferencedProjectIdentifier;
                                }
                                allReferences.Add(item);
                            }
                        }
                    }
                }
            }

            owp.OutputString("================ List of expanded unique dependencies ================ \n");
            foreach (var reference in uniqueReferences)
            {
                owp.OutputString(reference + "\n");
            }

            owp.OutputString("================ Possible issues ================ \n");
            foreach (RefData reference in allReferences)
            {
                if (reference.ReferencedGUID != "")
                {
                    string projectGUIDInSolution;
                    if (allProjectGUIDs.TryGetValue(reference.ReferencedProject, out projectGUIDInSolution))
                    {
                        if (projectGUIDInSolution != reference.ReferencedGUID)
                        {
                            owp.OutputString("Reference " + reference.ReferencedProject + " referenced by " + reference.Parent + " has a different GUID than the loaded in the solution! \n");
                            owp.OutputString(reference.ReferencedProject + " in solution: " + projectGUIDInSolution + " in reference: " + reference.ReferencedGUID + "\n");
                        }
                    }
                    else
                    {
                        owp.OutputString("Reference " + reference.ReferencedProject + " referenced by " + reference.Parent + " is MISSING FROM THE SOLUTION! \n");
                    }
                }
                else
                {
                    owp.OutputString("Reference " + reference.ReferencedProject + " referenced by " + reference.Parent + " has an UNKNOWN GUID! \n");
                }
            }
        }
Exemple #33
0
 public static void Main()
 {
     var raw = new RefData();
     raw.P.X = 1; // プロパティ越しに、参照先のフィールドを書き換え可能
     raw[0].X = 1; // インデクサー越しに、参照先の配列を書き換え可能
 }